Skip to content

Commit

Permalink
rebuild this
Browse files Browse the repository at this point in the history
  • Loading branch information
g-mero committed Aug 29, 2024
1 parent 19c2c6c commit 061d67e
Show file tree
Hide file tree
Showing 20 changed files with 920 additions and 982 deletions.
6 changes: 0 additions & 6 deletions .prettierrc

This file was deleted.

50 changes: 46 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,50 @@
{
"typescript.tsdk": "node_modules\\typescript\\lib",
// Disable the default formatter, use eslint instead
"prettier.enable": false,
"editor.formatOnSave": false,

// Auto fix
"editor.codeActionsOnSave": {
"source.fixAll": "explicit"
"source.fixAll.eslint": "explicit",
"source.organizeImports": "never"
},
"iconify.cdnEntry": "https://cdn.jsdelivr.net/gh/iconify/icon-sets/json",
"iconify.customCollectionJsonPaths": ["./solar.json"]

// Silent the stylistic rules in you IDE, but still auto fix them
"eslint.rules.customizations": [
{ "rule": "style/*", "severity": "off" },
{ "rule": "format/*", "severity": "off" },
{ "rule": "*-indent", "severity": "off" },
{ "rule": "*-spacing", "severity": "off" },
{ "rule": "*-spaces", "severity": "off" },
{ "rule": "*-order", "severity": "off" },
{ "rule": "*-dangle", "severity": "off" },
{ "rule": "*-newline", "severity": "off" },
{ "rule": "*quotes", "severity": "off" },
{ "rule": "*semi", "severity": "off" }
],

// Enable eslint for all supported languages
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"vue",
"html",
"markdown",
"json",
"jsonc",
"yaml",
"toml",
"xml",
"gql",
"graphql",
"astro",
"css",
"less",
"scss",
"pcss",
"postcss"
],
"typescript.tsdk": "node_modules\\typescript\\lib"
}
29 changes: 1 addition & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,3 @@
# solidjs-md-editor

这是一个基于solidjs的markdown编辑器,也可以兼容原生js

## Getting Started

```bash
pnpm i solidjs-md-editor
```

### 原生js用法

```typescript
import { Editor } from 'solidjs-md-editor'

const editor = Editor({
target: document.querySelector('#app'),
onChange(v) {
console.log(v)
},
handelPreview(v) {
return customTrans(v)
},
height: '600px',
theme: 'dark',
})

editor.setTheme('light') // 切换主题只有light跟dark 默认是light
editor.setVal('初始化数据') // 设置值
```
rebuild this project
4 changes: 2 additions & 2 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import antfu from '@antfu/eslint-config'

export default antfu({
export default antfu({ ignores: ['*.d.ts', '*.js'] }, {
solid: true,
rules: {
'ts/no-unused-expressions': 'off',
'no-console': 'warn',
// conflicts with auto-import
'solid/jsx-no-undef': 'off',
Expand All @@ -11,5 +12,4 @@ export default antfu({
customReactiveFunctions: ['watch'], // Array<string>
}],
},
ignores: ['*.d.ts', '*.js'],
})
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
</g>
</svg></i>
</div>
<script src="https://cdn.staticfile.org/markdown-it/13.0.1/markdown-it.min.js"></script>
<!-- <script src="https://cdn.staticfile.org/markdown-it/13.0.1/markdown-it.min.js"></script> -->
<script type="module">
import { Editor } from '/src/index.ts'
import { Editor } from '/src/dev.tsx'



Expand Down
44 changes: 37 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,45 @@
{
"name": "solidjs-md-editor",
"type": "module",
"version": "0.3.0",
"version": "0.3.1",
"private": false,
"exports": {
"worker": {
"solid": "./dist/server.jsx",
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/server.js"
}
},
"browser": {
"solid": "./dist/index.jsx",
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
},
"deno": {
"solid": "./dist/server.jsx",
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/server.js"
}
},
"node": {
"solid": "./dist/server.jsx",
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/server.js"
}
},
"solid": "./dist/index.jsx",
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
},
"main": "./dist/index.js",
"module": "./dist/index.js",
"main": "./dist/server.js",
"module": "./dist/server.js",
"types": "./dist/index.d.ts",
"typesVersions": {},
"files": [
Expand All @@ -37,9 +66,7 @@
"@lezer/highlight": "^1.2.0",
"@unocss/reset": "^0.61.2",
"codemirror": "^6.0.1",
"solid-motionone": "^1.0.0",
"solid-uses": "^0.1.4",
"unocss": "^0.61.2"
"solid-uses": "^0.1.4"
},
"devDependencies": {
"@antfu/eslint-config": "^2.21.2",
Expand All @@ -53,9 +80,12 @@
"tsup": "^8.1.0",
"tsup-preset-solid": "^2.2.0",
"typescript": "^5.5.3",
"unocss": "^0.61.2",
"unplugin-auto-import": "^0.18.2",
"vite": "^5.3.3",
"vite-plugin-solid": "^2.10.2"
},
"browser": {}
"browser": {
"./dist/server.js": "./dist/index.js"
}
}
Loading

0 comments on commit 061d67e

Please sign in to comment.