-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
52 changed files
with
6,831 additions
and
35,300 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,3 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
dist | ||
dist-ssr | ||
*.local | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? | ||
pnpm-lock.yaml |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* eslint-disable */ | ||
/* prettier-ignore */ | ||
// @ts-nocheck | ||
// noinspection JSUnusedGlobalSymbols | ||
// Generated by unplugin-auto-import | ||
export {} | ||
declare global { | ||
const Dynamic: typeof import('solid-js/web')['Dynamic'] | ||
const ErrorBoundary: typeof import('solid-js')['ErrorBoundary'] | ||
const For: typeof import('solid-js')['For'] | ||
const Index: typeof import('solid-js')['Index'] | ||
const Match: typeof import('solid-js')['Match'] | ||
const Portal: typeof import('solid-js/web')['Portal'] | ||
const Show: typeof import('solid-js')['Show'] | ||
const Suspense: typeof import('solid-js')['Suspense'] | ||
const SuspenseList: typeof import('solid-js')['SuspenseList'] | ||
const Switch: typeof import('solid-js')['Switch'] | ||
const batch: typeof import('solid-js')['batch'] | ||
const children: typeof import('solid-js')['children'] | ||
const createContext: typeof import('solid-js')['createContext'] | ||
const createDeferred: typeof import('solid-js')['createDeferred'] | ||
const createEffect: typeof import('solid-js')['createEffect'] | ||
const createMemo: typeof import('solid-js')['createMemo'] | ||
const createMutable: typeof import('solid-js/store')['createMutable'] | ||
const createRenderEffect: typeof import('solid-js')['createRenderEffect'] | ||
const createResource: typeof import('solid-js')['createResource'] | ||
const createRoot: typeof import('solid-js')['createRoot'] | ||
const createSelector: typeof import('solid-js')['createSelector'] | ||
const createSignal: typeof import('solid-js')['createSignal'] | ||
const createStore: typeof import('solid-js/store')['createStore'] | ||
const hydrate: typeof import('solid-js/web')['hydrate'] | ||
const indexArray: typeof import('solid-js')['indexArray'] | ||
const isServer: typeof import('solid-js/web')['isServer'] | ||
const lazy: typeof import('solid-js')['lazy'] | ||
const mapArray: typeof import('solid-js')['mapArray'] | ||
const mergeProps: typeof import('solid-js')['mergeProps'] | ||
const observable: typeof import('solid-js')['observable'] | ||
const on: typeof import('solid-js')['on'] | ||
const onCleanup: typeof import('solid-js')['onCleanup'] | ||
const onError: typeof import('solid-js')['onError'] | ||
const onMount: typeof import('solid-js')['onMount'] | ||
const produce: typeof import('solid-js/store')['produce'] | ||
const reconcile: typeof import('solid-js/store')['reconcile'] | ||
const render: typeof import('solid-js/web')['render'] | ||
const renderToStream: typeof import('solid-js/web')['renderToStream'] | ||
const renderToString: typeof import('solid-js/web')['renderToString'] | ||
const renderToStringAsync: typeof import('solid-js/web')['renderToStringAsync'] | ||
const splitProps: typeof import('solid-js')['splitProps'] | ||
const untrack: typeof import('solid-js')['untrack'] | ||
const useContext: typeof import('solid-js')['useContext'] | ||
const useTransition: typeof import('solid-js')['useTransition'] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/* eslint-disable node/prefer-global/process */ | ||
import fs from 'node:fs' | ||
import path from 'node:path' | ||
import type { BuildOptions, Charset, Plugin } from 'esbuild' | ||
import esbuild from 'esbuild' | ||
|
||
export interface StylePluginOptions { | ||
/** | ||
* whether to minify the css code. | ||
* @default true | ||
*/ | ||
minify?: boolean | ||
|
||
/** | ||
* css charset. | ||
* @default 'utf8' | ||
*/ | ||
charset?: Charset | ||
} | ||
|
||
// https://github.com/evanw/esbuild/issues/20#issuecomment-802269745 | ||
export function style({ minify = true, charset = 'utf8' }: StylePluginOptions = {}): Plugin { | ||
return { | ||
name: 'style', | ||
setup({ onResolve, onLoad }) { | ||
const cwd = process.cwd() | ||
const opt: BuildOptions = { logLevel: 'silent', bundle: true, write: false, charset, minify } | ||
|
||
onResolve({ filter: /\.css$/, namespace: 'file' }, (args) => { | ||
const absPath = path.join(args.resolveDir, args.path) | ||
const relPath = path.relative(cwd, absPath) | ||
const resolved = fs.existsSync(absPath) ? relPath : args.path | ||
return { path: resolved, namespace: 'style-stub' } | ||
}) | ||
|
||
onResolve({ filter: /\.css$/, namespace: 'style-stub' }, (args) => { | ||
return { path: args.path, namespace: 'style-content' } | ||
}) | ||
|
||
onResolve({ filter: /^__style_helper__$/, namespace: 'style-stub' }, args => ({ | ||
path: args.path, | ||
namespace: 'style-helper', | ||
sideEffects: false, | ||
})) | ||
|
||
onLoad({ filter: /.*/, namespace: 'style-helper' }, async () => ({ | ||
contents: ` | ||
export function injectStyle(text) { | ||
if (typeof document !== 'undefined') { | ||
var style = document.createElement('style') | ||
var node = document.createTextNode(text) | ||
style.appendChild(node) | ||
document.head.appendChild(style) | ||
} | ||
} | ||
`, | ||
})) | ||
|
||
onLoad({ filter: /.*/, namespace: 'style-stub' }, async args => ({ | ||
contents: ` | ||
import { injectStyle } from "__style_helper__" | ||
import css from ${JSON.stringify(args.path)} | ||
injectStyle(css) | ||
`, | ||
})) | ||
|
||
onLoad({ filter: /.*/, namespace: 'style-content' }, async (args) => { | ||
const options = { entryPoints: [args.path], ...opt } | ||
const { errors, warnings, outputFiles } = await esbuild.build(options) | ||
return { errors, warnings, contents: outputFiles![0].text, loader: 'text' } | ||
}) | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import antfu from '@antfu/eslint-config' | ||
|
||
export default antfu({ | ||
solid: true, | ||
rules: { | ||
'no-console': 'warn', | ||
// conflicts with auto-import | ||
'solid/jsx-no-undef': 'off', | ||
'solid/reactivity': ['warn', { | ||
// List of function names to consider as reactive functions (allow signals to be safely passed as arguments). In addition, any create* or use* functions are automatically included. | ||
customReactiveFunctions: ['watch'], // Array<string> | ||
}], | ||
}, | ||
ignores: ['*.d.ts', '*.js'], | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,61 @@ | ||
{ | ||
"name": "solidjs-md-editor", | ||
"private": false, | ||
"version": "0.2.1", | ||
"type": "module", | ||
"main": "./dist/editor.es.js", | ||
"module": "./dist/editor.es.js", | ||
"version": "0.3.0", | ||
"private": false, | ||
"exports": { | ||
"import": { | ||
"types": "./dist/index.d.ts", | ||
"default": "./dist/index.js" | ||
} | ||
}, | ||
"main": "./dist/index.js", | ||
"module": "./dist/index.js", | ||
"types": "./dist/index.d.ts", | ||
"typesVersions": {}, | ||
"files": [ | ||
"dist" | ||
], | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "tsc && vite build", | ||
"preview": "vite preview" | ||
"build": "tsup --dts" | ||
}, | ||
"devDependencies": { | ||
"@iconify-icon/solid": "^1.0.7", | ||
"@iconify-icons/solar": "^1.2.0", | ||
"@types/codemirror": "^5.60.7", | ||
"@types/lodash-es": "^4.17.7", | ||
"@xbmlz/eslint-config-prettier": "^0.1.16", | ||
"@xbmlz/eslint-config-solid": "^0.1.16", | ||
"babel-preset-solid": "^1.7.3", | ||
"eslint": "^8.38.0", | ||
"sass": "^1.61.0", | ||
"typescript": "^4.9.5", | ||
"typescript-plugin-css-modules": "^4.2.3", | ||
"vite": "^3.2.5", | ||
"vite-plugin-dts": "^2.2.0", | ||
"vite-plugin-solid": "^2.7.0", | ||
"@babel/core": "^7.21.4" | ||
"peerDependencies": { | ||
"solid-js": ">=1.8.0" | ||
}, | ||
"dependencies": { | ||
"codemirror": "5.65.12", | ||
"lodash-es": "^4.17.21", | ||
"solid-js": "^1.7.3" | ||
} | ||
} | ||
"@codemirror/commands": "^6.6.0", | ||
"@codemirror/lang-markdown": "^6.2.5", | ||
"@codemirror/language": "^6.10.2", | ||
"@codemirror/language-data": "^6.5.1", | ||
"@codemirror/state": "^6.4.1", | ||
"@codemirror/theme-one-dark": "^6.1.2", | ||
"@codemirror/view": "^6.29.1", | ||
"@floating-ui/dom": "^1.6.7", | ||
"@iconify-json/ri": "^1.1.21", | ||
"@iconify/json": "^2.2.232", | ||
"@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" | ||
}, | ||
"devDependencies": { | ||
"@antfu/eslint-config": "^2.21.2", | ||
"@iconify-icon/solid": "^2.1.1", | ||
"@lezer/markdown": "^1.3.0", | ||
"@types/node": "^20.14.9", | ||
"@unocss/vite": "^0.61.2", | ||
"esbuild": "^0.23.0", | ||
"eslint": "^8.57.0", | ||
"eslint-plugin-solid": "^0.14.1", | ||
"tsup": "^8.1.0", | ||
"tsup-preset-solid": "^2.2.0", | ||
"typescript": "^5.5.3", | ||
"unplugin-auto-import": "^0.18.2", | ||
"vite": "^5.3.3", | ||
"vite-plugin-solid": "^2.10.2" | ||
}, | ||
"browser": {} | ||
} |
Oops, something went wrong.