groove-dev 0.15.0 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/FILE-EDITOR-PLAN.md +253 -0
- package/node_modules/@codemirror/autocomplete/.github/workflows/dispatch.yml +16 -0
- package/node_modules/@codemirror/autocomplete/CHANGELOG.md +639 -0
- package/node_modules/@codemirror/autocomplete/LICENSE +21 -0
- package/node_modules/@codemirror/autocomplete/README.md +43 -0
- package/node_modules/@codemirror/autocomplete/dist/index.cjs +2151 -0
- package/node_modules/@codemirror/autocomplete/dist/index.d.cts +648 -0
- package/node_modules/@codemirror/autocomplete/dist/index.d.ts +648 -0
- package/node_modules/@codemirror/autocomplete/dist/index.js +2120 -0
- package/node_modules/@codemirror/autocomplete/package.json +41 -0
- package/node_modules/@codemirror/commands/.github/workflows/dispatch.yml +16 -0
- package/node_modules/@codemirror/commands/CHANGELOG.md +386 -0
- package/node_modules/@codemirror/commands/LICENSE +21 -0
- package/node_modules/@codemirror/commands/README.md +35 -0
- package/node_modules/@codemirror/commands/dist/index.cjs +1909 -0
- package/node_modules/@codemirror/commands/dist/index.d.cts +650 -0
- package/node_modules/@codemirror/commands/dist/index.d.ts +650 -0
- package/node_modules/@codemirror/commands/dist/index.js +1795 -0
- package/node_modules/@codemirror/commands/package.json +42 -0
- package/node_modules/@codemirror/lang-css/.github/workflows/dispatch.yml +16 -0
- package/node_modules/@codemirror/lang-css/CHANGELOG.md +106 -0
- package/node_modules/@codemirror/lang-css/LICENSE +21 -0
- package/node_modules/@codemirror/lang-css/README.md +50 -0
- package/node_modules/@codemirror/lang-css/dist/index.cjs +269 -0
- package/node_modules/@codemirror/lang-css/dist/index.d.cts +28 -0
- package/node_modules/@codemirror/lang-css/dist/index.d.ts +28 -0
- package/node_modules/@codemirror/lang-css/dist/index.js +264 -0
- package/node_modules/@codemirror/lang-css/package.json +42 -0
- package/node_modules/@codemirror/lang-html/.github/workflows/dispatch.yml +16 -0
- package/node_modules/@codemirror/lang-html/CHANGELOG.md +210 -0
- package/node_modules/@codemirror/lang-html/LICENSE +21 -0
- package/node_modules/@codemirror/lang-html/README.md +147 -0
- package/node_modules/@codemirror/lang-html/dist/index.cjs +667 -0
- package/node_modules/@codemirror/lang-html/dist/index.d.cts +115 -0
- package/node_modules/@codemirror/lang-html/dist/index.d.ts +115 -0
- package/node_modules/@codemirror/lang-html/dist/index.js +661 -0
- package/node_modules/@codemirror/lang-html/package.json +46 -0
- package/node_modules/@codemirror/lang-javascript/.github/workflows/dispatch.yml +16 -0
- package/node_modules/@codemirror/lang-javascript/CHANGELOG.md +206 -0
- package/node_modules/@codemirror/lang-javascript/LICENSE +21 -0
- package/node_modules/@codemirror/lang-javascript/README.md +125 -0
- package/node_modules/@codemirror/lang-javascript/dist/index.cjs +526 -0
- package/node_modules/@codemirror/lang-javascript/dist/index.d.cts +93 -0
- package/node_modules/@codemirror/lang-javascript/dist/index.d.ts +93 -0
- package/node_modules/@codemirror/lang-javascript/dist/index.js +513 -0
- package/node_modules/@codemirror/lang-javascript/package.json +45 -0
- package/node_modules/@codemirror/lang-json/.github/workflows/dispatch.yml +16 -0
- package/node_modules/@codemirror/lang-json/CHANGELOG.md +59 -0
- package/node_modules/@codemirror/lang-json/LICENSE +21 -0
- package/node_modules/@codemirror/lang-json/README.md +56 -0
- package/node_modules/@codemirror/lang-json/dist/index.cjs +68 -0
- package/node_modules/@codemirror/lang-json/dist/index.d.cts +22 -0
- package/node_modules/@codemirror/lang-json/dist/index.d.ts +22 -0
- package/node_modules/@codemirror/lang-json/dist/index.js +64 -0
- package/node_modules/@codemirror/lang-json/package.json +39 -0
- package/node_modules/@codemirror/lang-markdown/.github/workflows/dispatch.yml +16 -0
- package/node_modules/@codemirror/lang-markdown/CHANGELOG.md +246 -0
- package/node_modules/@codemirror/lang-markdown/LICENSE +21 -0
- package/node_modules/@codemirror/lang-markdown/README.md +162 -0
- package/node_modules/@codemirror/lang-markdown/dist/index.cjs +501 -0
- package/node_modules/@codemirror/lang-markdown/dist/index.d.cts +124 -0
- package/node_modules/@codemirror/lang-markdown/dist/index.d.ts +124 -0
- package/node_modules/@codemirror/lang-markdown/dist/index.js +492 -0
- package/node_modules/@codemirror/lang-markdown/package.json +44 -0
- package/node_modules/@codemirror/lang-python/.github/workflows/dispatch.yml +16 -0
- package/node_modules/@codemirror/lang-python/CHANGELOG.md +174 -0
- package/node_modules/@codemirror/lang-python/LICENSE +21 -0
- package/node_modules/@codemirror/lang-python/README.md +61 -0
- package/node_modules/@codemirror/lang-python/dist/index.cjs +313 -0
- package/node_modules/@codemirror/lang-python/dist/index.d.cts +26 -0
- package/node_modules/@codemirror/lang-python/dist/index.d.ts +26 -0
- package/node_modules/@codemirror/lang-python/dist/index.js +308 -0
- package/node_modules/@codemirror/lang-python/package.json +42 -0
- package/node_modules/@codemirror/language/.github/workflows/dispatch.yml +16 -0
- package/node_modules/@codemirror/language/CHANGELOG.md +412 -0
- package/node_modules/@codemirror/language/LICENSE +21 -0
- package/node_modules/@codemirror/language/README.md +66 -0
- package/node_modules/@codemirror/language/dist/index.cjs +2742 -0
- package/node_modules/@codemirror/language/dist/index.d.cts +1220 -0
- package/node_modules/@codemirror/language/dist/index.d.ts +1220 -0
- package/node_modules/@codemirror/language/dist/index.js +2687 -0
- package/node_modules/@codemirror/language/package.json +44 -0
- package/node_modules/@codemirror/lint/.github/workflows/dispatch.yml +16 -0
- package/node_modules/@codemirror/lint/CHANGELOG.md +318 -0
- package/node_modules/@codemirror/lint/LICENSE +21 -0
- package/node_modules/@codemirror/lint/README.md +18 -0
- package/node_modules/@codemirror/lint/dist/index.cjs +958 -0
- package/node_modules/@codemirror/lint/dist/index.d.cts +195 -0
- package/node_modules/@codemirror/lint/dist/index.d.ts +195 -0
- package/node_modules/@codemirror/lint/dist/index.js +945 -0
- package/node_modules/@codemirror/lint/package.json +40 -0
- package/node_modules/@codemirror/search/.github/workflows/dispatch.yml +16 -0
- package/node_modules/@codemirror/search/CHANGELOG.md +324 -0
- package/node_modules/@codemirror/search/LICENSE +21 -0
- package/node_modules/@codemirror/search/README.md +18 -0
- package/node_modules/@codemirror/search/dist/index.cjs +1237 -0
- package/node_modules/@codemirror/search/dist/index.d.cts +385 -0
- package/node_modules/@codemirror/search/dist/index.d.ts +385 -0
- package/node_modules/@codemirror/search/dist/index.js +1217 -0
- package/node_modules/@codemirror/search/package.json +40 -0
- package/node_modules/@codemirror/state/.github/workflows/dispatch.yml +16 -0
- package/node_modules/@codemirror/state/CHANGELOG.md +308 -0
- package/node_modules/@codemirror/state/LICENSE +21 -0
- package/node_modules/@codemirror/state/README.md +18 -0
- package/node_modules/@codemirror/state/dist/index.cjs +3922 -0
- package/node_modules/@codemirror/state/dist/index.d.cts +1713 -0
- package/node_modules/@codemirror/state/dist/index.d.ts +1713 -0
- package/node_modules/@codemirror/state/dist/index.js +3892 -0
- package/node_modules/@codemirror/state/package.json +38 -0
- package/node_modules/@codemirror/theme-one-dark/.github/workflows/dispatch.yml +16 -0
- package/node_modules/@codemirror/theme-one-dark/CHANGELOG.md +97 -0
- package/node_modules/@codemirror/theme-one-dark/LICENSE +21 -0
- package/node_modules/@codemirror/theme-one-dark/README.md +46 -0
- package/node_modules/@codemirror/theme-one-dark/dist/index.cjs +139 -0
- package/node_modules/@codemirror/theme-one-dark/dist/index.d.cts +39 -0
- package/node_modules/@codemirror/theme-one-dark/dist/index.d.ts +39 -0
- package/node_modules/@codemirror/theme-one-dark/dist/index.js +134 -0
- package/node_modules/@codemirror/theme-one-dark/package.json +41 -0
- package/node_modules/@codemirror/view/.github/workflows/dispatch.yml +16 -0
- package/node_modules/@codemirror/view/CHANGELOG.md +2284 -0
- package/node_modules/@codemirror/view/LICENSE +21 -0
- package/node_modules/@codemirror/view/README.md +37 -0
- package/node_modules/@codemirror/view/dist/index.cjs +11796 -0
- package/node_modules/@codemirror/view/dist/index.d.cts +2389 -0
- package/node_modules/@codemirror/view/dist/index.d.ts +2389 -0
- package/node_modules/@codemirror/view/dist/index.js +11745 -0
- package/node_modules/@codemirror/view/package.json +41 -0
- package/node_modules/@groove-dev/daemon/src/api.js +157 -2
- package/node_modules/@groove-dev/daemon/src/filewatcher.js +59 -0
- package/node_modules/@groove-dev/daemon/src/index.js +28 -1
- package/node_modules/@groove-dev/daemon/src/skills.js +20 -0
- package/node_modules/@groove-dev/gui/dist/assets/index-Dxg9hdf3.js +103 -0
- package/node_modules/@groove-dev/gui/dist/index.html +1 -1
- package/node_modules/@groove-dev/gui/package.json +15 -2
- package/node_modules/@groove-dev/gui/src/App.jsx +3 -0
- package/node_modules/@groove-dev/gui/src/components/CodeEditor.jsx +143 -0
- package/node_modules/@groove-dev/gui/src/components/EditorTabs.jsx +83 -0
- package/node_modules/@groove-dev/gui/src/components/FileTree.jsx +193 -0
- package/node_modules/@groove-dev/gui/src/stores/groove.js +158 -1
- package/node_modules/@groove-dev/gui/src/views/FileEditor.jsx +142 -0
- package/node_modules/@groove-dev/gui/src/views/SkillsMarketplace.jsx +112 -1
- package/node_modules/@lezer/common/LICENSE +21 -0
- package/node_modules/@lezer/common/README.md +14 -0
- package/node_modules/@lezer/common/dist/index.cjs +2209 -0
- package/node_modules/@lezer/common/dist/index.d.cts +1174 -0
- package/node_modules/@lezer/common/dist/index.d.ts +1174 -0
- package/node_modules/@lezer/common/dist/index.js +2196 -0
- package/node_modules/@lezer/common/package.json +32 -0
- package/node_modules/@lezer/css/CHANGELOG.md +307 -0
- package/node_modules/@lezer/css/LICENSE +21 -0
- package/node_modules/@lezer/css/README.md +6 -0
- package/node_modules/@lezer/css/dist/index.cjs +151 -0
- package/node_modules/@lezer/css/dist/index.d.cts +3 -0
- package/node_modules/@lezer/css/dist/index.d.ts +3 -0
- package/node_modules/@lezer/css/dist/index.js +147 -0
- package/node_modules/@lezer/css/package.json +36 -0
- package/node_modules/@lezer/css/rollup.config.js +16 -0
- package/node_modules/@lezer/css/src/css.grammar +290 -0
- package/node_modules/@lezer/css/src/highlight.js +36 -0
- package/node_modules/@lezer/css/src/parser.js +31 -0
- package/node_modules/@lezer/css/src/parser.terms.js +63 -0
- package/node_modules/@lezer/css/src/tokens.js +75 -0
- package/node_modules/@lezer/css/test/declarations.txt +241 -0
- package/node_modules/@lezer/css/test/selector.txt +178 -0
- package/node_modules/@lezer/css/test/statements.txt +227 -0
- package/node_modules/@lezer/css/test/test-css.js +16 -0
- package/node_modules/@lezer/highlight/LICENSE +21 -0
- package/node_modules/@lezer/highlight/README.md +14 -0
- package/node_modules/@lezer/highlight/dist/index.cjs +936 -0
- package/node_modules/@lezer/highlight/dist/index.d.cts +623 -0
- package/node_modules/@lezer/highlight/dist/index.d.ts +623 -0
- package/node_modules/@lezer/highlight/dist/index.js +927 -0
- package/node_modules/@lezer/highlight/package.json +31 -0
- package/node_modules/@lezer/html/CHANGELOG.md +303 -0
- package/node_modules/@lezer/html/LICENSE +21 -0
- package/node_modules/@lezer/html/README.md +37 -0
- package/node_modules/@lezer/html/dist/index.cjs +354 -0
- package/node_modules/@lezer/html/dist/index.d.cts +14 -0
- package/node_modules/@lezer/html/dist/index.d.ts +14 -0
- package/node_modules/@lezer/html/dist/index.js +349 -0
- package/node_modules/@lezer/html/package.json +37 -0
- package/node_modules/@lezer/html/rollup.config.js +16 -0
- package/node_modules/@lezer/html/src/.tern-port +1 -0
- package/node_modules/@lezer/html/src/content.js +87 -0
- package/node_modules/@lezer/html/src/highlight.js +15 -0
- package/node_modules/@lezer/html/src/html.grammar +181 -0
- package/node_modules/@lezer/html/src/index.js +2 -0
- package/node_modules/@lezer/html/src/parser.js +27 -0
- package/node_modules/@lezer/html/src/parser.terms.js +53 -0
- package/node_modules/@lezer/html/src/tokens.js +199 -0
- package/node_modules/@lezer/html/test/mixed.txt +69 -0
- package/node_modules/@lezer/html/test/tags.txt +370 -0
- package/node_modules/@lezer/html/test/test-html.js +29 -0
- package/node_modules/@lezer/html/test/test-incremental.js +97 -0
- package/node_modules/@lezer/html/test/vue.txt +56 -0
- package/node_modules/@lezer/javascript/CHANGELOG.md +485 -0
- package/node_modules/@lezer/javascript/LICENSE +21 -0
- package/node_modules/@lezer/javascript/README.md +14 -0
- package/node_modules/@lezer/javascript/dist/index.cjs +196 -0
- package/node_modules/@lezer/javascript/dist/index.d.cts +3 -0
- package/node_modules/@lezer/javascript/dist/index.d.ts +3 -0
- package/node_modules/@lezer/javascript/dist/index.js +192 -0
- package/node_modules/@lezer/javascript/package.json +36 -0
- package/node_modules/@lezer/javascript/rollup.config.js +16 -0
- package/node_modules/@lezer/javascript/src/highlight.js +62 -0
- package/node_modules/@lezer/javascript/src/javascript.grammar +735 -0
- package/node_modules/@lezer/javascript/src/parser.js +33 -0
- package/node_modules/@lezer/javascript/src/parser.terms.js +177 -0
- package/node_modules/@lezer/javascript/src/tokens.js +87 -0
- package/node_modules/@lezer/javascript/test/decorator.txt +64 -0
- package/node_modules/@lezer/javascript/test/expression.txt +686 -0
- package/node_modules/@lezer/javascript/test/jsx.txt +79 -0
- package/node_modules/@lezer/javascript/test/semicolon.txt +77 -0
- package/node_modules/@lezer/javascript/test/statement.txt +404 -0
- package/node_modules/@lezer/javascript/test/test-javascript.js +17 -0
- package/node_modules/@lezer/javascript/test/typescript.txt +401 -0
- package/node_modules/@lezer/json/CHANGELOG.md +79 -0
- package/node_modules/@lezer/json/LICENSE +21 -0
- package/node_modules/@lezer/json/README.md +7 -0
- package/node_modules/@lezer/json/dist/index.cjs +41 -0
- package/node_modules/@lezer/json/dist/index.d.cts +3 -0
- package/node_modules/@lezer/json/dist/index.d.ts +3 -0
- package/node_modules/@lezer/json/dist/index.js +37 -0
- package/node_modules/@lezer/json/package.json +36 -0
- package/node_modules/@lezer/json/rollup.config.js +15 -0
- package/node_modules/@lezer/json/src/highlight.js +12 -0
- package/node_modules/@lezer/json/src/json.grammar +38 -0
- package/node_modules/@lezer/json/src/parser.js +23 -0
- package/node_modules/@lezer/json/src/parser.terms.js +12 -0
- package/node_modules/@lezer/json/test/arrays.txt +34 -0
- package/node_modules/@lezer/json/test/literals.txt +23 -0
- package/node_modules/@lezer/json/test/numbers.txt +87 -0
- package/node_modules/@lezer/json/test/objects.txt +34 -0
- package/node_modules/@lezer/json/test/strings.txt +50 -0
- package/node_modules/@lezer/json/test/test-json.js +17 -0
- package/node_modules/@lezer/lr/LICENSE +21 -0
- package/node_modules/@lezer/lr/README.md +25 -0
- package/node_modules/@lezer/lr/dist/constants.d.ts +45 -0
- package/node_modules/@lezer/lr/dist/constants.js +5 -0
- package/node_modules/@lezer/lr/dist/index.cjs +1891 -0
- package/node_modules/@lezer/lr/dist/index.d.cts +303 -0
- package/node_modules/@lezer/lr/dist/index.d.ts +303 -0
- package/node_modules/@lezer/lr/dist/index.js +1884 -0
- package/node_modules/@lezer/lr/package.json +32 -0
- package/node_modules/@lezer/markdown/CHANGELOG.md +279 -0
- package/node_modules/@lezer/markdown/LICENSE +21 -0
- package/node_modules/@lezer/markdown/README.md +725 -0
- package/node_modules/@lezer/markdown/bin/build-readme.cjs +39 -0
- package/node_modules/@lezer/markdown/build.js +16 -0
- package/node_modules/@lezer/markdown/dist/index.cjs +2352 -0
- package/node_modules/@lezer/markdown/dist/index.d.cts +600 -0
- package/node_modules/@lezer/markdown/dist/index.d.ts +600 -0
- package/node_modules/@lezer/markdown/dist/index.js +2335 -0
- package/node_modules/@lezer/markdown/package.json +37 -0
- package/node_modules/@lezer/markdown/src/README.md +83 -0
- package/node_modules/@lezer/markdown/src/extension.ts +301 -0
- package/node_modules/@lezer/markdown/src/index.ts +5 -0
- package/node_modules/@lezer/markdown/src/markdown.ts +1961 -0
- package/node_modules/@lezer/markdown/src/nest.ts +46 -0
- package/node_modules/@lezer/markdown/test/compare-tree.ts +14 -0
- package/node_modules/@lezer/markdown/test/spec.ts +79 -0
- package/node_modules/@lezer/markdown/test/test-extension.ts +269 -0
- package/node_modules/@lezer/markdown/test/test-incremental.ts +265 -0
- package/node_modules/@lezer/markdown/test/test-markdown.ts +3574 -0
- package/node_modules/@lezer/markdown/test/test-nesting.ts +86 -0
- package/node_modules/@lezer/markdown/test/tsconfig.json +12 -0
- package/node_modules/@lezer/markdown/tsconfig.json +14 -0
- package/node_modules/@lezer/python/CHANGELOG.md +243 -0
- package/node_modules/@lezer/python/LICENSE +21 -0
- package/node_modules/@lezer/python/README.md +6 -0
- package/node_modules/@lezer/python/dist/index.cjs +330 -0
- package/node_modules/@lezer/python/dist/index.d.cts +3 -0
- package/node_modules/@lezer/python/dist/index.d.ts +3 -0
- package/node_modules/@lezer/python/dist/index.js +326 -0
- package/node_modules/@lezer/python/package.json +36 -0
- package/node_modules/@lezer/python/rollup.config.js +16 -0
- package/node_modules/@lezer/python/src/highlight.js +35 -0
- package/node_modules/@lezer/python/src/python.grammar +381 -0
- package/node_modules/@lezer/python/src/tokens.js +224 -0
- package/node_modules/@lezer/python/test/expression.txt +231 -0
- package/node_modules/@lezer/python/test/statement.txt +442 -0
- package/node_modules/@lezer/python/test/test-incremental.js +33 -0
- package/node_modules/@lezer/python/test/test-python.js +17 -0
- package/node_modules/@marijn/find-cluster-break/LICENSE +21 -0
- package/node_modules/@marijn/find-cluster-break/README.md +28 -0
- package/node_modules/@marijn/find-cluster-break/dist/index.cjs +85 -0
- package/node_modules/@marijn/find-cluster-break/dist/index.d.cts +15 -0
- package/node_modules/@marijn/find-cluster-break/package.json +35 -0
- package/node_modules/@marijn/find-cluster-break/rollup.config.js +7 -0
- package/node_modules/@marijn/find-cluster-break/src/index.d.ts +15 -0
- package/node_modules/@marijn/find-cluster-break/src/index.js +87 -0
- package/node_modules/@marijn/find-cluster-break/test/test-cluster.js +30 -0
- package/node_modules/crelt/LICENSE +19 -0
- package/node_modules/crelt/README.md +23 -0
- package/node_modules/crelt/dist/index.cjs +31 -0
- package/node_modules/crelt/dist/index.d.cts +4 -0
- package/node_modules/crelt/index.d.ts +4 -0
- package/node_modules/crelt/index.js +28 -0
- package/node_modules/crelt/package.json +35 -0
- package/node_modules/crelt/rollup.config.js +13 -0
- package/node_modules/style-mod/LICENSE +19 -0
- package/node_modules/style-mod/README.md +98 -0
- package/node_modules/style-mod/dist/style-mod.cjs +165 -0
- package/node_modules/style-mod/dist/style-mod.d.cts +16 -0
- package/node_modules/style-mod/package.json +39 -0
- package/node_modules/style-mod/src/README.md +34 -0
- package/node_modules/style-mod/src/style-mod.d.ts +16 -0
- package/node_modules/style-mod/src/style-mod.js +172 -0
- package/node_modules/style-mod/test/test-style-mod.js +104 -0
- package/node_modules/w3c-keyname/.tern-port +1 -0
- package/node_modules/w3c-keyname/LICENSE +19 -0
- package/node_modules/w3c-keyname/README.md +18 -0
- package/node_modules/w3c-keyname/index.cjs +127 -0
- package/node_modules/w3c-keyname/index.d.cts +5 -0
- package/node_modules/w3c-keyname/index.d.ts +5 -0
- package/node_modules/w3c-keyname/index.js +119 -0
- package/node_modules/w3c-keyname/package.json +37 -0
- package/package.json +1 -1
- package/packages/daemon/src/api.js +157 -2
- package/packages/daemon/src/filewatcher.js +59 -0
- package/packages/daemon/src/index.js +28 -1
- package/packages/daemon/src/skills.js +20 -0
- package/packages/gui/dist/assets/index-Dxg9hdf3.js +103 -0
- package/packages/gui/dist/index.html +1 -1
- package/packages/gui/package.json +15 -2
- package/packages/gui/src/App.jsx +3 -0
- package/packages/gui/src/components/CodeEditor.jsx +143 -0
- package/packages/gui/src/components/EditorTabs.jsx +83 -0
- package/packages/gui/src/components/FileTree.jsx +193 -0
- package/packages/gui/src/stores/groove.js +158 -1
- package/packages/gui/src/views/FileEditor.jsx +142 -0
- package/packages/gui/src/views/SkillsMarketplace.jsx +112 -1
- package/node_modules/@groove-dev/gui/dist/assets/index-CNCSwHwH.js +0 -74
- package/packages/gui/dist/assets/index-CNCSwHwH.js +0 -74
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@lezer/markdown",
|
|
3
|
+
"version": "1.6.3",
|
|
4
|
+
"description": "Incremental Markdown parser that consumes and emits Lezer trees",
|
|
5
|
+
"main": "dist/index.cjs",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"exports": {
|
|
8
|
+
"import": "./dist/index.js",
|
|
9
|
+
"require": "./dist/index.cjs"
|
|
10
|
+
},
|
|
11
|
+
"module": "dist/index.js",
|
|
12
|
+
"types": "dist/index.d.ts",
|
|
13
|
+
"author": "Marijn Haverbeke <marijn@haverbeke.berlin>",
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"ist": "^1.1.1",
|
|
17
|
+
"mocha": "^10.2.0",
|
|
18
|
+
"@lezer/html": "^1.0.0",
|
|
19
|
+
"getdocs-ts": "^0.1.0",
|
|
20
|
+
"builddocs": "^1.0.0",
|
|
21
|
+
"@marijn/buildtool": "^0.1.6"
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@lezer/common": "^1.5.0",
|
|
25
|
+
"@lezer/highlight": "^1.0.0"
|
|
26
|
+
},
|
|
27
|
+
"repository": {
|
|
28
|
+
"type" : "git",
|
|
29
|
+
"url" : "https://github.com/lezer-parser/markdown.git"
|
|
30
|
+
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"watch": "node build.js --watch",
|
|
33
|
+
"prepare": "node build.js",
|
|
34
|
+
"test": "mocha",
|
|
35
|
+
"build-readme": "node bin/build-readme.cjs"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
<!-- /README.md is generated from /src/README.md -->
|
|
2
|
+
|
|
3
|
+
# @lezer/markdown
|
|
4
|
+
|
|
5
|
+
This is an incremental Markdown ([CommonMark](https://commonmark.org/)
|
|
6
|
+
with support for extension) parser that integrates well with the
|
|
7
|
+
[Lezer](https://lezer.codemirror.net/) parser system. It does not in
|
|
8
|
+
fact use the Lezer runtime (that runs LR parsers, and Markdown can't
|
|
9
|
+
really be parsed that way), but it produces Lezer-style compact syntax
|
|
10
|
+
trees and consumes fragments of such trees for its incremental
|
|
11
|
+
parsing.
|
|
12
|
+
|
|
13
|
+
Note that this only _parses_ the document, producing a data structure
|
|
14
|
+
that represents its syntactic form, and doesn't help with outputting
|
|
15
|
+
HTML. Also, in order to be single-pass and incremental, it doesn't do
|
|
16
|
+
some things that a conforming CommonMark parser is expected to
|
|
17
|
+
do—specifically, it doesn't validate link references, so it'll parse
|
|
18
|
+
`[a][b]` and similar as a link, even if no `[b]` reference is
|
|
19
|
+
declared.
|
|
20
|
+
|
|
21
|
+
The
|
|
22
|
+
[@codemirror/lang-markdown](https://github.com/codemirror/lang-markdown)
|
|
23
|
+
package integrates this parser with CodeMirror to provide Markdown
|
|
24
|
+
editor support.
|
|
25
|
+
|
|
26
|
+
The code is licensed under an MIT license.
|
|
27
|
+
|
|
28
|
+
## Interface
|
|
29
|
+
|
|
30
|
+
@parser
|
|
31
|
+
|
|
32
|
+
@MarkdownParser
|
|
33
|
+
|
|
34
|
+
@MarkdownConfig
|
|
35
|
+
|
|
36
|
+
@MarkdownExtension
|
|
37
|
+
|
|
38
|
+
@parseCode
|
|
39
|
+
|
|
40
|
+
### GitHub Flavored Markdown
|
|
41
|
+
|
|
42
|
+
@GFM
|
|
43
|
+
|
|
44
|
+
@Table
|
|
45
|
+
|
|
46
|
+
@TaskList
|
|
47
|
+
|
|
48
|
+
@Strikethrough
|
|
49
|
+
|
|
50
|
+
@Autolink
|
|
51
|
+
|
|
52
|
+
### Other extensions
|
|
53
|
+
|
|
54
|
+
@Subscript
|
|
55
|
+
|
|
56
|
+
@Superscript
|
|
57
|
+
|
|
58
|
+
@Emoji
|
|
59
|
+
|
|
60
|
+
### Extension
|
|
61
|
+
|
|
62
|
+
The parser can, to a certain extent, be extended to handle additional
|
|
63
|
+
syntax.
|
|
64
|
+
|
|
65
|
+
@NodeSpec
|
|
66
|
+
|
|
67
|
+
@BlockContext
|
|
68
|
+
|
|
69
|
+
@BlockParser
|
|
70
|
+
|
|
71
|
+
@LeafBlockParser
|
|
72
|
+
|
|
73
|
+
@Line
|
|
74
|
+
|
|
75
|
+
@LeafBlock
|
|
76
|
+
|
|
77
|
+
@InlineContext
|
|
78
|
+
|
|
79
|
+
@InlineParser
|
|
80
|
+
|
|
81
|
+
@DelimiterType
|
|
82
|
+
|
|
83
|
+
@Element
|
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
import {InlineContext, BlockContext, MarkdownConfig,
|
|
2
|
+
LeafBlockParser, LeafBlock, Line, Element, space, Punctuation} from "./markdown"
|
|
3
|
+
import {tags as t} from "@lezer/highlight"
|
|
4
|
+
|
|
5
|
+
const StrikethroughDelim = {resolve: "Strikethrough", mark: "StrikethroughMark"}
|
|
6
|
+
|
|
7
|
+
/// An extension that implements
|
|
8
|
+
/// [GFM-style](https://github.github.com/gfm/#strikethrough-extension-)
|
|
9
|
+
/// Strikethrough syntax using `~~` delimiters.
|
|
10
|
+
export const Strikethrough: MarkdownConfig = {
|
|
11
|
+
defineNodes: [{
|
|
12
|
+
name: "Strikethrough",
|
|
13
|
+
style: {"Strikethrough/...": t.strikethrough}
|
|
14
|
+
}, {
|
|
15
|
+
name: "StrikethroughMark",
|
|
16
|
+
style: t.processingInstruction
|
|
17
|
+
}],
|
|
18
|
+
parseInline: [{
|
|
19
|
+
name: "Strikethrough",
|
|
20
|
+
parse(cx, next, pos) {
|
|
21
|
+
if (next != 126 /* '~' */ || cx.char(pos + 1) != 126 || cx.char(pos + 2) == 126) return -1
|
|
22
|
+
let before = cx.slice(pos - 1, pos), after = cx.slice(pos + 2, pos + 3)
|
|
23
|
+
let sBefore = /\s|^$/.test(before), sAfter = /\s|^$/.test(after)
|
|
24
|
+
let pBefore = Punctuation.test(before), pAfter = Punctuation.test(after)
|
|
25
|
+
return cx.addDelimiter(StrikethroughDelim, pos, pos + 2,
|
|
26
|
+
!sAfter && (!pAfter || sBefore || pBefore),
|
|
27
|
+
!sBefore && (!pBefore || sAfter || pAfter))
|
|
28
|
+
},
|
|
29
|
+
after: "Emphasis"
|
|
30
|
+
}]
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Parse a line as a table row and return the row count. When `elts`
|
|
34
|
+
// is given, push syntax elements for the content onto it.
|
|
35
|
+
function parseRow(cx: BlockContext, line: string, startI = 0, elts?: Element[], offset = 0) {
|
|
36
|
+
let count = 0, first = true, cellStart = -1, cellEnd = -1, esc = false
|
|
37
|
+
let parseCell = () => {
|
|
38
|
+
elts!.push(cx.elt("TableCell", offset + cellStart, offset + cellEnd,
|
|
39
|
+
cx.parser.parseInline(line.slice(cellStart, cellEnd), offset + cellStart)))
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
for (let i = startI; i < line.length; i++) {
|
|
43
|
+
let next = line.charCodeAt(i)
|
|
44
|
+
if (next == 124 /* '|' */ && !esc) {
|
|
45
|
+
if (!first || cellStart > -1) count++
|
|
46
|
+
first = false
|
|
47
|
+
if (elts) {
|
|
48
|
+
if (cellStart > -1) parseCell()
|
|
49
|
+
elts.push(cx.elt("TableDelimiter", i + offset, i + offset + 1))
|
|
50
|
+
}
|
|
51
|
+
cellStart = cellEnd = -1
|
|
52
|
+
} else if (esc || next != 32 && next != 9) {
|
|
53
|
+
if (cellStart < 0) cellStart = i
|
|
54
|
+
cellEnd = i + 1
|
|
55
|
+
}
|
|
56
|
+
esc = !esc && next == 92
|
|
57
|
+
}
|
|
58
|
+
if (cellStart > -1) {
|
|
59
|
+
count++
|
|
60
|
+
if (elts) parseCell()
|
|
61
|
+
}
|
|
62
|
+
return count
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function hasPipe(str: string, start: number) {
|
|
66
|
+
for (let i = start; i < str.length; i++) {
|
|
67
|
+
let next = str.charCodeAt(i)
|
|
68
|
+
if (next == 124 /* '|' */) return true
|
|
69
|
+
if (next == 92 /* '\\' */) i++
|
|
70
|
+
}
|
|
71
|
+
return false
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const delimiterLine = /^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/
|
|
75
|
+
|
|
76
|
+
class TableParser implements LeafBlockParser {
|
|
77
|
+
// Null means we haven't seen the second line yet, false means this
|
|
78
|
+
// isn't a table, and an array means this is a table and we've
|
|
79
|
+
// parsed the given rows so far.
|
|
80
|
+
rows: false | null | Element[] = null
|
|
81
|
+
|
|
82
|
+
nextLine(cx: BlockContext, line: Line, leaf: LeafBlock) {
|
|
83
|
+
if (this.rows == null) { // Second line
|
|
84
|
+
this.rows = false
|
|
85
|
+
let lineText
|
|
86
|
+
if ((line.next == 45 || line.next == 58 || line.next == 124 /* '-:|' */) &&
|
|
87
|
+
delimiterLine.test(lineText = line.text.slice(line.pos))) {
|
|
88
|
+
let firstRow: Element[] = [], firstCount = parseRow(cx, leaf.content, 0, firstRow, leaf.start)
|
|
89
|
+
if (firstCount == parseRow(cx, lineText, line.pos))
|
|
90
|
+
this.rows = [cx.elt("TableHeader", leaf.start, leaf.start + leaf.content.length, firstRow),
|
|
91
|
+
cx.elt("TableDelimiter", cx.lineStart + line.pos, cx.lineStart + line.text.length)]
|
|
92
|
+
}
|
|
93
|
+
} else if (this.rows) { // Line after the second
|
|
94
|
+
let content: Element[] = []
|
|
95
|
+
parseRow(cx, line.text, line.pos, content, cx.lineStart)
|
|
96
|
+
this.rows.push(cx.elt("TableRow", cx.lineStart + line.pos, cx.lineStart + line.text.length, content))
|
|
97
|
+
}
|
|
98
|
+
return false
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
finish(cx: BlockContext, leaf: LeafBlock) {
|
|
102
|
+
if (!this.rows) return false
|
|
103
|
+
cx.addLeafElement(leaf, cx.elt("Table", leaf.start, leaf.start + leaf.content.length, this.rows as readonly Element[]))
|
|
104
|
+
return true
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/// This extension provides
|
|
109
|
+
/// [GFM-style](https://github.github.com/gfm/#tables-extension-)
|
|
110
|
+
/// tables, using syntax like this:
|
|
111
|
+
///
|
|
112
|
+
/// ```
|
|
113
|
+
/// | head 1 | head 2 |
|
|
114
|
+
/// | --- | --- |
|
|
115
|
+
/// | cell 1 | cell 2 |
|
|
116
|
+
/// ```
|
|
117
|
+
export const Table: MarkdownConfig = {
|
|
118
|
+
defineNodes: [
|
|
119
|
+
{name: "Table", block: true},
|
|
120
|
+
{name: "TableHeader", style: {"TableHeader/...": t.heading}},
|
|
121
|
+
"TableRow",
|
|
122
|
+
{name: "TableCell", style: t.content},
|
|
123
|
+
{name: "TableDelimiter", style: t.processingInstruction},
|
|
124
|
+
],
|
|
125
|
+
parseBlock: [{
|
|
126
|
+
name: "Table",
|
|
127
|
+
leaf(_, leaf) { return hasPipe(leaf.content, 0) ? new TableParser : null },
|
|
128
|
+
endLeaf(cx, line, leaf) {
|
|
129
|
+
if (leaf.parsers.some(p => p instanceof TableParser) || !hasPipe(line.text, line.basePos)) return false
|
|
130
|
+
let next = cx.peekLine()
|
|
131
|
+
return delimiterLine.test(next) && parseRow(cx, line.text, line.basePos) == parseRow(cx, next, line.basePos)
|
|
132
|
+
},
|
|
133
|
+
before: "SetextHeading"
|
|
134
|
+
}]
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
class TaskParser implements LeafBlockParser {
|
|
138
|
+
nextLine() { return false }
|
|
139
|
+
|
|
140
|
+
finish(cx: BlockContext, leaf: LeafBlock) {
|
|
141
|
+
cx.addLeafElement(leaf, cx.elt("Task", leaf.start, leaf.start + leaf.content.length, [
|
|
142
|
+
cx.elt("TaskMarker", leaf.start, leaf.start + 3),
|
|
143
|
+
...cx.parser.parseInline(leaf.content.slice(3), leaf.start + 3)
|
|
144
|
+
]))
|
|
145
|
+
return true
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/// Extension providing
|
|
150
|
+
/// [GFM-style](https://github.github.com/gfm/#task-list-items-extension-)
|
|
151
|
+
/// task list items, where list items can be prefixed with `[ ]` or
|
|
152
|
+
/// `[x]` to add a checkbox.
|
|
153
|
+
export const TaskList: MarkdownConfig = {
|
|
154
|
+
defineNodes: [
|
|
155
|
+
{name: "Task", block: true, style: t.list},
|
|
156
|
+
{name: "TaskMarker", style: t.atom}
|
|
157
|
+
],
|
|
158
|
+
parseBlock: [{
|
|
159
|
+
name: "TaskList",
|
|
160
|
+
leaf(cx, leaf) {
|
|
161
|
+
return /^\[[ xX]\][ \t]/.test(leaf.content) && cx.parentType().name == "ListItem" ? new TaskParser : null
|
|
162
|
+
},
|
|
163
|
+
after: "SetextHeading"
|
|
164
|
+
}]
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
const autolinkRE = /(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy
|
|
168
|
+
const urlRE = /[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy
|
|
169
|
+
const lastTwoDomainWords = /[\w-]+\.[\w-]+($|\/)/
|
|
170
|
+
const emailRE = /[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy
|
|
171
|
+
const xmppResourceRE = /\/[a-zA-Z\d@.]+/gy
|
|
172
|
+
|
|
173
|
+
function count(str: string, from: number, to: number, ch: string) {
|
|
174
|
+
let result = 0
|
|
175
|
+
for (let i = from; i < to; i++) if (str[i] == ch) result++
|
|
176
|
+
return result
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
function autolinkURLEnd(text: string, from: number) {
|
|
180
|
+
urlRE.lastIndex = from
|
|
181
|
+
let m = urlRE.exec(text)
|
|
182
|
+
if (!m || lastTwoDomainWords.exec(m[0])![0].indexOf("_") > -1) return -1
|
|
183
|
+
let end = from + m[0].length
|
|
184
|
+
for (;;) {
|
|
185
|
+
let last = text[end - 1], m
|
|
186
|
+
if (/[?!.,:*_~]/.test(last) ||
|
|
187
|
+
last == ")" && count(text, from, end, ")") > count(text, from, end, "("))
|
|
188
|
+
end--
|
|
189
|
+
else if (last == ";" && (m = /&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(text.slice(from, end))))
|
|
190
|
+
end = from + m.index
|
|
191
|
+
else
|
|
192
|
+
break
|
|
193
|
+
}
|
|
194
|
+
return end
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
function autolinkEmailEnd(text: string, from: number) {
|
|
198
|
+
emailRE.lastIndex = from
|
|
199
|
+
let m = emailRE.exec(text)
|
|
200
|
+
if (!m) return -1
|
|
201
|
+
let last = m[0][m[0].length - 1]
|
|
202
|
+
return last == "_" || last == "-" ? -1 : from + m[0].length - (last == "." ? 1 : 0)
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/// Extension that implements autolinking for
|
|
206
|
+
/// `www.`/`http://`/`https://`/`mailto:`/`xmpp:` URLs and email
|
|
207
|
+
/// addresses.
|
|
208
|
+
export const Autolink: MarkdownConfig = {
|
|
209
|
+
parseInline: [{
|
|
210
|
+
name: "Autolink",
|
|
211
|
+
parse(cx, next, absPos) {
|
|
212
|
+
let pos = absPos - cx.offset
|
|
213
|
+
if (pos && /\w/.test(cx.text[pos - 1])) return -1
|
|
214
|
+
autolinkRE.lastIndex = pos
|
|
215
|
+
let m = autolinkRE.exec(cx.text), end = -1
|
|
216
|
+
if (!m) return -1
|
|
217
|
+
if (m[1] || m[2]) { // www., http://
|
|
218
|
+
end = autolinkURLEnd(cx.text, pos + m[0].length)
|
|
219
|
+
if (end > -1 && cx.hasOpenLink) {
|
|
220
|
+
let noBracket = /([^\[\]]|\[[^\]]*\])*/.exec(cx.text.slice(pos, end))
|
|
221
|
+
end = pos + noBracket![0].length
|
|
222
|
+
}
|
|
223
|
+
} else if (m[3]) { // email address
|
|
224
|
+
end = autolinkEmailEnd(cx.text, pos)
|
|
225
|
+
} else { // mailto:/xmpp:
|
|
226
|
+
end = autolinkEmailEnd(cx.text, pos + m[0].length)
|
|
227
|
+
if (end > -1 && m[0] == "xmpp:") {
|
|
228
|
+
xmppResourceRE.lastIndex = end
|
|
229
|
+
m = xmppResourceRE.exec(cx.text)
|
|
230
|
+
if (m) end = m.index + m[0].length
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
if (end < 0) return -1
|
|
234
|
+
cx.addElement(cx.elt("URL", absPos, end + cx.offset))
|
|
235
|
+
return end + cx.offset
|
|
236
|
+
}
|
|
237
|
+
}]
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/// Extension bundle containing [`Table`](#Table),
|
|
241
|
+
/// [`TaskList`](#TaskList), [`Strikethrough`](#Strikethrough), and
|
|
242
|
+
/// [`Autolink`](#Autolink).
|
|
243
|
+
export const GFM = [Table, TaskList, Strikethrough, Autolink]
|
|
244
|
+
|
|
245
|
+
function parseSubSuper(ch: number, node: string, mark: string) {
|
|
246
|
+
return (cx: InlineContext, next: number, pos: number) => {
|
|
247
|
+
if (next != ch || cx.char(pos + 1) == ch) return -1
|
|
248
|
+
let elts = [cx.elt(mark, pos, pos + 1)]
|
|
249
|
+
for (let i = pos + 1; i < cx.end; i++) {
|
|
250
|
+
let next = cx.char(i)
|
|
251
|
+
if (next == ch)
|
|
252
|
+
return cx.addElement(cx.elt(node, pos, i + 1, elts.concat(cx.elt(mark, i, i + 1))))
|
|
253
|
+
if (next == 92 /* '\\' */)
|
|
254
|
+
elts.push(cx.elt("Escape", i, i++ + 2))
|
|
255
|
+
if (space(next)) break
|
|
256
|
+
}
|
|
257
|
+
return -1
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/// Extension providing
|
|
262
|
+
/// [Pandoc-style](https://pandoc.org/MANUAL.html#superscripts-and-subscripts)
|
|
263
|
+
/// superscript using `^` markers.
|
|
264
|
+
export const Superscript: MarkdownConfig = {
|
|
265
|
+
defineNodes: [
|
|
266
|
+
{name: "Superscript", style: t.special(t.content)},
|
|
267
|
+
{name: "SuperscriptMark", style: t.processingInstruction}
|
|
268
|
+
],
|
|
269
|
+
parseInline: [{
|
|
270
|
+
name: "Superscript",
|
|
271
|
+
parse: parseSubSuper(94 /* '^' */, "Superscript", "SuperscriptMark")
|
|
272
|
+
}]
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/// Extension providing
|
|
276
|
+
/// [Pandoc-style](https://pandoc.org/MANUAL.html#superscripts-and-subscripts)
|
|
277
|
+
/// subscript using `~` markers.
|
|
278
|
+
export const Subscript: MarkdownConfig = {
|
|
279
|
+
defineNodes: [
|
|
280
|
+
{name: "Subscript", style: t.special(t.content)},
|
|
281
|
+
{name: "SubscriptMark", style: t.processingInstruction}
|
|
282
|
+
],
|
|
283
|
+
parseInline: [{
|
|
284
|
+
name: "Subscript",
|
|
285
|
+
parse: parseSubSuper(126 /* '~' */, "Subscript", "SubscriptMark")
|
|
286
|
+
}]
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/// Extension that parses two colons with only letters, underscores,
|
|
290
|
+
/// and numbers between them as `Emoji` nodes.
|
|
291
|
+
export const Emoji: MarkdownConfig = {
|
|
292
|
+
defineNodes: [{name: "Emoji", style: t.character}],
|
|
293
|
+
parseInline: [{
|
|
294
|
+
name: "Emoji",
|
|
295
|
+
parse(cx, next, pos) {
|
|
296
|
+
let match: RegExpMatchArray | null
|
|
297
|
+
if (next != 58 /* ':' */ || !(match = /^[a-zA-Z_0-9]+:/.exec(cx.slice(pos + 1, cx.end)))) return -1
|
|
298
|
+
return cx.addElement(cx.elt("Emoji", pos, pos + 1 + match[0].length))
|
|
299
|
+
}
|
|
300
|
+
}]
|
|
301
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export {parser, MarkdownParser, MarkdownConfig, MarkdownExtension,
|
|
2
|
+
NodeSpec, InlineParser, BlockParser, LeafBlockParser,
|
|
3
|
+
Line, Element, LeafBlock, DelimiterType, BlockContext, InlineContext} from "./markdown"
|
|
4
|
+
export {parseCode} from "./nest"
|
|
5
|
+
export {Table, TaskList, Strikethrough, Autolink, GFM, Subscript, Superscript, Emoji} from "./extension"
|