reactive-md 0.6.1 → 0.8.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/CHANGELOG-ch.md +66 -0
- package/CHANGELOG.md +66 -0
- package/CONTRIBUTING-ch.md +6 -62
- package/CONTRIBUTING.md +5 -63
- package/README-ch.md +232 -67
- package/README-en.md +209 -71
- package/README.md +209 -71
- package/SECURITY-ch.md +3 -1
- package/SECURITY.md +3 -1
- package/THIRD_PARTY_NOTICES.md +1909 -87
- package/cli/args.mjs +33 -1
- package/cli/build.mjs +62 -1
- package/cli/check.mjs +444 -0
- package/cli/help.mjs +181 -3
- package/cli/init.mjs +1577 -0
- package/cli/main.mjs +11 -1
- package/cli/package-loader.mjs +41 -0
- package/dist-library/LocalDocumentView-6trX7xJc.js +97920 -0
- package/dist-library/{authoring-BEVyth5X.js → authoring-BsfSwQRm.js} +237 -209
- package/dist-library/compiler--ea2CKQF.js +61 -0
- package/dist-library/compiler-core-kPiH-gOV.js +11805 -0
- package/dist-library/component-state-Cq2K5gkS.js +490 -0
- package/dist-library/component-state-D_cw_EHe.js +54 -0
- package/dist-library/config-validation-DXTynAw7.js +3005 -0
- package/dist-library/default-components-Z_YMio5P.js +2346 -0
- package/dist-library/identity-MYJXKSkB.js +1443 -0
- package/dist-library/math-display-BJz4gbFc.js +24000 -0
- package/dist-library/math-sample-BGEW49zY.js +1124 -0
- package/dist-library/options-CX5m5n-J.js +115 -0
- package/dist-library/parser-standard-DlCk7sLo.js +10122 -0
- package/dist-library/props-DGlBk0e5.js +183 -0
- package/dist-library/react-ByOHunUW.js +122 -0
- package/dist-library/reactive-md-authoring.js +712 -1077
- package/dist-library/reactive-md-build.js +7966 -0
- package/dist-library/reactive-md-compiler-standard.js +33 -0
- package/dist-library/reactive-md-compiler.js +22 -0
- package/dist-library/reactive-md-default-packs.js +71 -0
- package/dist-library/reactive-md-default-preset.js +10 -0
- package/dist-library/reactive-md-export.js +111 -0
- package/dist-library/reactive-md-print.css +18 -3
- package/dist-library/reactive-md-react-runtime.js +251 -0
- package/dist-library/reactive-md-react-server.js +55 -0
- package/dist-library/reactive-md-react-unstyled.js +9 -1
- package/dist-library/reactive-md-react.js +9 -1
- package/dist-library/reactive-md-runtime-browser.js +51 -0
- package/dist-library/reactive-md-runtime.js +3 -0
- package/dist-library/reactive-md-sdk.js +6 -0
- package/dist-library/reactive-md-standalone-host.js +442 -0
- package/dist-library/reactive-md-testing-browser.js +523 -0
- package/dist-library/reactive-md-testing-react.js +221 -0
- package/dist-library/reactive-md-testing.js +638 -0
- package/dist-library/reactive-md-vite.js +959 -0
- package/dist-library/reactive-md.css +1 -1
- package/dist-library/reactive-md.js +1080 -795
- package/dist-library/registry-B9Jc3FVe.js +1174 -0
- package/dist-library/resources-BGt8mpDA.js +204 -0
- package/dist-library/runtime-C-sbfpOX.js +1157 -0
- package/dist-library/runtime-Dkq7ldyg.js +172 -0
- package/dist-library/schema-ZFufO8V0.js +39 -0
- package/dist-library/shareable-DDVL4Fi9.js +844 -0
- package/dist-library/types/authoring/catalog.d.ts +168 -0
- package/dist-library/types/authoring/conformance.d.ts +24 -0
- package/dist-library/types/{editor → authoring}/editor-i18n.d.ts +3 -24
- package/dist-library/types/authoring/extensions.d.ts +13 -0
- package/dist-library/types/authoring/index.d.ts +14 -11
- package/dist-library/types/authoring/insert.d.ts +16 -0
- package/dist-library/types/{editor → authoring}/native-components.d.ts +19 -2
- package/dist-library/types/authoring/templates.d.ts +65 -0
- package/dist-library/types/build/diagnostics.d.ts +8 -0
- package/dist-library/types/build/digest.d.ts +5 -0
- package/dist-library/types/build/entry.d.ts +9 -0
- package/dist-library/types/build/host.d.ts +36 -0
- package/dist-library/types/build/index.d.ts +99 -0
- package/dist-library/types/build/notices.d.ts +29 -0
- package/dist-library/types/build/resources.d.ts +60 -0
- package/dist-library/types/build/vite.d.ts +15 -0
- package/dist-library/types/compiler/index.d.ts +22 -0
- package/dist-library/types/compiler/result.d.ts +30 -0
- package/dist-library/types/compiler/standard.d.ts +16 -0
- package/dist-library/types/compiler/types.d.ts +69 -0
- package/dist-library/types/components/chart-motion.d.ts +12 -0
- package/dist-library/types/components/controls.d.ts +21 -0
- package/dist-library/types/{local → components}/data-table.d.ts +10 -24
- package/dist-library/types/components/default-chart-types.d.ts +22 -0
- package/dist-library/types/components/default-chart.d.ts +2 -0
- package/dist-library/types/components/default-preset.d.ts +10 -0
- package/dist-library/types/components/diagram-inspector.d.ts +24 -0
- package/dist-library/types/components/gallery.d.ts +6 -0
- package/dist-library/types/components/layout.d.ts +23 -0
- package/dist-library/types/components/mafs-plot-grid.d.ts +57 -0
- package/dist-library/types/components/mafs-visuals.d.ts +40 -0
- package/dist-library/types/components/numeric-sliders.d.ts +3 -0
- package/dist-library/types/components/uiarc/calendar/calendar.d.ts +26 -0
- package/dist-library/types/components/uiarc/date-picker/date-picker.d.ts +29 -0
- package/dist-library/types/components/uiarc/lib/motion-tokens.d.ts +2 -0
- package/dist-library/types/components/uiarc/lib/use-today.d.ts +2 -0
- package/dist-library/types/components/uiarc/motion-tokens.d.ts +60 -0
- package/dist-library/types/components/uiarc/rmd-motion.d.ts +12 -0
- package/dist-library/types/components/uiarc/select/select.d.ts +21 -0
- package/dist-library/types/components/uiarc/slider/slider.d.ts +53 -0
- package/dist-library/types/components/use-hydrated.d.ts +6 -0
- package/dist-library/types/components/visuals.d.ts +13 -0
- package/dist-library/types/export/component-state.d.ts +39 -0
- package/dist-library/types/export/index.d.ts +47 -0
- package/dist-library/types/export/requirements.d.ts +23 -0
- package/dist-library/types/export/resources.d.ts +8 -0
- package/dist-library/types/export/restoration.d.ts +52 -0
- package/dist-library/types/index.d.ts +1 -0
- package/dist-library/types/local/compilation/compiler-core.d.ts +16 -0
- package/dist-library/types/local/compilation/compiler-services.d.ts +64 -0
- package/dist-library/types/local/compilation/compiler-structure.d.ts +46 -0
- package/dist-library/types/local/compilation/compiler-values.d.ts +9 -0
- package/dist-library/types/local/compilation/compiler.d.ts +34 -0
- package/dist-library/types/local/compilation/component-kernel.d.ts +487 -0
- package/dist-library/types/local/{dependencies.d.ts → compilation/dependencies.d.ts} +4 -3
- package/dist-library/types/local/{diagnostics.d.ts → configuration/diagnostic-messages.d.ts} +193 -65
- package/dist-library/types/local/configuration/diagnostics.d.ts +58 -0
- package/dist-library/types/local/{limits.d.ts → configuration/limits.d.ts} +15 -2
- package/dist-library/types/local/configuration/options-core.d.ts +120 -0
- package/dist-library/types/local/configuration/options.d.ts +17 -0
- package/dist-library/types/local/configuration/portable-options.d.ts +3 -0
- package/dist-library/types/local/configuration/schema-core.d.ts +32 -0
- package/dist-library/types/local/configuration/schema.d.ts +12 -0
- package/dist-library/types/local/contracts/types.d.ts +519 -0
- package/dist-library/types/local/{version.d.ts → contracts/version.d.ts} +1 -1
- package/dist-library/types/local/{computations.d.ts → evaluation/computations.d.ts} +6 -3
- package/dist-library/types/local/{expression.d.ts → evaluation/expression.d.ts} +2 -2
- package/dist-library/types/local/{math-display.d.ts → evaluation/math-display.d.ts} +2 -16
- package/dist-library/types/local/evaluation/math-sample.d.ts +23 -0
- package/dist-library/types/local/evaluation/math.d.ts +73 -0
- package/dist-library/types/local/{validation.d.ts → evaluation/validation.d.ts} +1 -1
- package/dist-library/types/local/html/html-details.d.ts +16 -0
- package/dist-library/types/local/html/html-entities.d.ts +7 -0
- package/dist-library/types/local/html/html-policy.d.ts +43 -0
- package/dist-library/types/local/html/html-recovery.d.ts +16 -0
- package/dist-library/types/local/html/html-table-names.d.ts +9 -0
- package/dist-library/types/local/{html-table.d.ts → html/html-table.d.ts} +2 -6
- package/dist-library/types/local/{html.d.ts → html/html.d.ts} +1 -1
- package/dist-library/types/local/index.d.ts +31 -24
- package/dist-library/types/local/markdown/fast-markdown.d.ts +137 -0
- package/dist-library/types/local/{footnotes.d.ts → markdown/footnotes.d.ts} +1 -1
- package/dist-library/types/local/{heading-anchors.d.ts → markdown/heading-anchors.d.ts} +12 -2
- package/dist-library/types/local/markdown/markdown-blocks.d.ts +55 -0
- package/dist-library/types/local/markdown/markdown-structure.d.ts +3 -0
- package/dist-library/types/local/markdown/plain-paragraphs.d.ts +10 -0
- package/dist-library/types/local/parsing/lexical.d.ts +21 -0
- package/dist-library/types/local/parsing/parse-budget.d.ts +67 -0
- package/dist-library/types/local/parsing/parser-capabilities.d.ts +42 -0
- package/dist-library/types/local/parsing/parser-core.d.ts +65 -0
- package/dist-library/types/local/parsing/parser-standard.d.ts +7 -0
- package/dist-library/types/local/parsing/parser.d.ts +16 -0
- package/dist-library/types/local/parsing/rmd-recovery.d.ts +48 -0
- package/dist-library/types/local/{LocalDocumentView.d.ts → rendering/LocalDocumentView.d.ts} +67 -24
- package/dist-library/types/local/rendering/legacy-component-adapter.d.ts +36 -0
- package/dist-library/types/local/rendering/render-types.d.ts +57 -0
- package/dist-library/types/local/rendering/view-revision.d.ts +75 -0
- package/dist-library/types/local/{retention.d.ts → runtime/retention.d.ts} +1 -1
- package/dist-library/types/local/runtime/runtime.d.ts +34 -0
- package/dist-library/types/local/{state.d.ts → runtime/state.d.ts} +4 -4
- package/dist-library/types/local/session/compiler-cache.d.ts +44 -0
- package/dist-library/types/local/session/incremental.d.ts +48 -0
- package/dist-library/types/local/session/parse-session.d.ts +62 -0
- package/dist-library/types/local/session/row-reuse.d.ts +46 -0
- package/dist-library/types/local/{authoring.d.ts → source/authoring.d.ts} +11 -3
- package/dist-library/types/local/source/node-walk.d.ts +3 -0
- package/dist-library/types/local/source/source-context.d.ts +63 -0
- package/dist-library/types/local/{source-migration.d.ts → source/source-migration.d.ts} +2 -2
- package/dist-library/types/local/{i18n.d.ts → theme/i18n.d.ts} +2 -2
- package/dist-library/types/local/theme/theme-name.d.ts +3 -0
- package/dist-library/types/local/{theme.d.ts → theme/theme.d.ts} +3 -3
- package/dist-library/types/local/transport/compile-patch.d.ts +127 -0
- package/dist-library/types/local/{compiled-data.d.ts → transport/compiled-data.d.ts} +1 -1
- package/dist-library/types/local/transport/flat-compiled-data.d.ts +17 -0
- package/dist-library/types/local/transport/shared-data.d.ts +10 -0
- package/dist-library/types/local/transport/worker.d.ts +265 -0
- package/dist-library/types/local/widgets/visuals.d.ts +25 -0
- package/dist-library/types/presets/default-authoring.d.ts +50 -0
- package/dist-library/types/presets/default-components.d.ts +4 -0
- package/dist-library/types/presets/default-semantics.d.ts +8 -0
- package/dist-library/types/presets/default.d.ts +11 -0
- package/dist-library/types/presets/identity.d.ts +7 -0
- package/dist-library/types/presets/packs.d.ts +4 -0
- package/dist-library/types/react/component-api.d.ts +260 -0
- package/dist-library/types/react/component-primitives.d.ts +21 -0
- package/dist-library/types/react/component-utils.d.ts +125 -0
- package/dist-library/types/react/default-theme.d.ts +6 -0
- package/dist-library/types/react/field-validation.d.ts +11 -0
- package/dist-library/types/react/index.d.ts +17 -5
- package/dist-library/types/react/overflow-text-tooltip.d.ts +6 -0
- package/dist-library/types/react/package.d.ts +69 -0
- package/dist-library/types/react/runtime/common.d.ts +4 -0
- package/dist-library/types/react/runtime/index.d.ts +8 -0
- package/dist-library/types/react/runtime/useComponentState.d.ts +30 -0
- package/dist-library/types/react/runtime/useKeys.d.ts +16 -0
- package/dist-library/types/react/runtime/useSwipe.d.ts +27 -0
- package/dist-library/types/react/runtime/useTicker.d.ts +17 -0
- package/dist-library/types/react/sdk.d.ts +110 -0
- package/dist-library/types/react/server.d.ts +15 -0
- package/dist-library/types/react/tooltip-layer.d.ts +10 -0
- package/dist-library/types/react/use-draft-field.d.ts +17 -0
- package/dist-library/types/runtime-services/browser/index.d.ts +63 -0
- package/dist-library/types/runtime-services/component-state.d.ts +152 -0
- package/dist-library/types/runtime-services/identity.d.ts +41 -0
- package/dist-library/types/runtime-services/index.d.ts +10 -0
- package/dist-library/types/runtime-services/random.d.ts +42 -0
- package/dist-library/types/runtime-services/runtime.d.ts +51 -0
- package/dist-library/types/runtime-services/scheduler.d.ts +44 -0
- package/dist-library/types/sdk/assembly.d.ts +73 -0
- package/dist-library/types/sdk/compat-profile.d.ts +57 -0
- package/dist-library/types/sdk/compiler-config.d.ts +33 -0
- package/dist-library/types/sdk/config-validation.d.ts +33 -0
- package/dist-library/types/sdk/config.d.ts +35 -0
- package/dist-library/types/sdk/hash.d.ts +9 -0
- package/dist-library/types/sdk/index.d.ts +10 -0
- package/dist-library/types/sdk/manifest.d.ts +49 -0
- package/dist-library/types/sdk/pattern.d.ts +11 -0
- package/dist-library/types/sdk/preset-core.d.ts +11 -0
- package/dist-library/types/sdk/preset.d.ts +9 -0
- package/dist-library/types/sdk/props.d.ts +33 -0
- package/dist-library/types/sdk/registry-core.d.ts +16 -0
- package/dist-library/types/sdk/registry.d.ts +18 -0
- package/dist-library/types/sdk/theme.d.ts +73 -0
- package/dist-library/types/sdk/types.d.ts +221 -0
- package/dist-library/types/sdk/version.d.ts +49 -0
- package/dist-library/types/shareable.d.ts +29 -3
- package/dist-library/types/standalone/diagnostics.d.ts +16 -0
- package/dist-library/types/standalone/events.d.ts +4 -0
- package/dist-library/types/standalone/library.d.ts +6 -0
- package/dist-library/types/standalone/payload.d.ts +15 -0
- package/dist-library/types/standalone/prepare.d.ts +21 -0
- package/dist-library/types/standalone/session.d.ts +68 -0
- package/dist-library/types/standalone/version.d.ts +7 -0
- package/dist-library/types/testing/behavior.d.ts +19 -0
- package/dist-library/types/testing/browser.d.ts +126 -0
- package/dist-library/types/testing/cases.d.ts +16 -0
- package/dist-library/types/testing/index.d.ts +13 -0
- package/dist-library/types/testing/manifest.d.ts +10 -0
- package/dist-library/types/testing/react.d.ts +45 -0
- package/dist-library/types/testing/report.d.ts +20 -0
- package/dist-library/types/testing/types.d.ts +125 -0
- package/dist-library/types/testing/values.d.ts +22 -0
- package/dist-library/types/vite/client.d.ts +36 -0
- package/dist-library/types/vite/discovery.d.ts +51 -0
- package/dist-library/types/vite/index.d.ts +31 -0
- package/dist-library/types/vite/registration.d.ts +109 -0
- package/dist-library/types-BFCrMrg0.js +52 -0
- package/dist-library/validation-W-bmny-x.js +2253 -0
- package/dist-library/values-CIt8AjiU.js +134 -0
- package/dist-standalone/reactive-md-standalone.css +1 -1
- package/dist-standalone/reactive-md-standalone.js +591 -95
- package/docs/README-ch.md +90 -0
- package/docs/README.md +87 -81
- package/docs/compatibility/compatibility-ch.md +22 -14
- package/docs/compatibility/compatibility-en.md +22 -14
- package/docs/compatibility/source-versioning-ch.md +15 -12
- package/docs/compatibility/source-versioning-en.md +16 -13
- package/docs/development/component-development-ch.md +51 -195
- package/docs/development/component-development-en.md +51 -195
- package/docs/development/component-development-reference-ch.md +253 -0
- package/docs/development/component-development-reference-en.md +238 -0
- package/docs/development/component-protocol-ch.md +51 -50
- package/docs/development/component-protocol-en.md +52 -49
- package/docs/development/local-module-layout-ch.md +59 -0
- package/docs/development/local-module-layout-en.md +59 -0
- package/docs/development/performance-overview-ch.md +402 -0
- package/docs/development/performance-overview-en.md +402 -0
- package/docs/development/releasing-ch.md +8 -104
- package/docs/development/releasing-en.md +8 -104
- package/docs/guides/local-guide-ch.md +28 -9
- package/docs/guides/local-guide-en.md +31 -12
- package/docs/integration/author-tools-ch.md +4 -2
- package/docs/integration/author-tools-en.md +4 -2
- package/docs/integration/codemirror-ch.md +52 -0
- package/docs/integration/codemirror-en.md +29 -0
- package/docs/integration/compiler-ch.md +47 -0
- package/docs/integration/compiler-en.md +34 -0
- package/docs/integration/directory-discovery-ch.md +53 -0
- package/docs/integration/directory-discovery-en.md +31 -0
- package/docs/integration/editor-ch.md +48 -21
- package/docs/integration/editor-en.md +48 -21
- package/docs/integration/extension-sdk-ch.md +392 -0
- package/docs/integration/extension-sdk-en.md +377 -0
- package/docs/integration/local-integration-ch.md +63 -9
- package/docs/integration/local-integration-en.md +89 -13
- package/docs/integration/repository-split-ch.md +40 -0
- package/docs/integration/repository-split-en.md +23 -0
- package/docs/integration/shareable-export-ch.md +46 -2
- package/docs/integration/shareable-export-en.md +46 -2
- package/docs/reference/computations-formatting-ch.md +4 -2
- package/docs/reference/computations-formatting-en.md +4 -2
- package/docs/reference/constraints-collections-ch.md +21 -1
- package/docs/reference/constraints-collections-en.md +21 -1
- package/docs/reference/diagnostics-counting-ch.md +1 -1
- package/docs/reference/diagnostics-counting-en.md +1 -1
- package/docs/reference/html-compatibility-ch.md +4 -0
- package/docs/reference/html-compatibility-en.md +4 -0
- package/docs/reference/local-components-v2-ch.md +2 -0
- package/docs/reference/local-components-v2-en.md +2 -0
- package/docs/reference/local-interaction-syntax-ch.md +51 -15
- package/docs/reference/local-interaction-syntax-en.md +58 -14
- package/docs/reference/theme-protocol-ch.md +79 -7
- package/docs/reference/theme-protocol-en.md +79 -7
- package/docs/reference/tolerance-ch.md +64 -0
- package/docs/reference/tolerance-en.md +57 -0
- package/docs/releases/release-0.4.0-ch.md +2 -0
- package/docs/releases/release-0.4.0-en.md +2 -0
- package/docs/releases/release-0.4.1-ch.md +2 -0
- package/docs/releases/release-0.4.1-en.md +2 -0
- package/docs/releases/release-0.5.0-ch.md +2 -0
- package/docs/releases/release-0.5.0-en.md +2 -0
- package/docs/releases/release-0.5.1-ch.md +2 -0
- package/docs/releases/release-0.5.1-en.md +2 -0
- package/docs/releases/release-0.5.2-ch.md +2 -0
- package/docs/releases/release-0.5.2-en.md +2 -0
- package/docs/releases/release-0.5.3-ch.md +2 -0
- package/docs/releases/release-0.5.3-en.md +2 -0
- package/docs/releases/release-0.6.0-ch.md +2 -0
- package/docs/releases/release-0.6.0-en.md +2 -0
- package/docs/releases/release-0.6.1-ch.md +2 -0
- package/docs/releases/release-0.6.1-en.md +2 -0
- package/docs/releases/release-0.7.0-ch.md +86 -0
- package/docs/releases/release-0.7.0-en.md +86 -0
- package/docs/releases/release-0.8.0-ch.md +126 -0
- package/docs/releases/release-0.8.0-en.md +126 -0
- package/examples/component-package/LICENSE +21 -0
- package/examples/component-package/NOTICES.md +12 -0
- package/examples/component-package/README-ch.md +101 -0
- package/examples/component-package/README.md +133 -0
- package/examples/component-package/package.json +35 -0
- package/examples/component-package/sample/document.reactive.md +14 -0
- package/examples/component-package/scripts/build-export.mjs +44 -0
- package/examples/component-package/scripts/build.mjs +130 -0
- package/examples/component-package/scripts/verify.mjs +257 -0
- package/examples/component-package/src/assets/notice.svg +4 -0
- package/examples/component-package/src/component.css +40 -0
- package/examples/component-package/src/components.tsx +105 -0
- package/examples/component-package/src/harness.tsx +34 -0
- package/examples/component-package/src/manifests.ts +71 -0
- package/examples/component-package/src/node-entry.ts +18 -0
- package/examples/component-package/src/sample.ts +4 -0
- package/examples/component-package/src/theme.css +44 -0
- package/examples/component-package/src/theme.ts +22 -0
- package/examples/component-package/tsconfig.json +15 -0
- package/examples/conformance/README-ch.md +55 -0
- package/examples/conformance/README.md +2 -0
- package/examples/conformance/local-draft-3.json +296 -0
- package/examples/game-2048-package/LICENSE +21 -0
- package/examples/game-2048-package/NOTICES.md +11 -0
- package/examples/game-2048-package/README-ch.md +97 -0
- package/examples/game-2048-package/README.md +102 -0
- package/examples/game-2048-package/package.json +35 -0
- package/examples/game-2048-package/sample/document.reactive.md +17 -0
- package/examples/game-2048-package/scripts/build-export.mjs +44 -0
- package/examples/game-2048-package/scripts/build.mjs +130 -0
- package/examples/game-2048-package/scripts/verify.mjs +180 -0
- package/examples/game-2048-package/src/component.css +161 -0
- package/examples/game-2048-package/src/components.tsx +326 -0
- package/examples/game-2048-package/src/game-engine.ts +228 -0
- package/examples/game-2048-package/src/harness.tsx +34 -0
- package/examples/game-2048-package/src/manifest.ts +85 -0
- package/examples/game-2048-package/src/node-entry.ts +30 -0
- package/examples/game-2048-package/src/sample.ts +4 -0
- package/examples/game-2048-package/tsconfig.json +15 -0
- package/examples/integration/README-ch.md +63 -0
- package/examples/integration/README.md +17 -1
- package/examples/integration/extension-sdk/README-ch.md +24 -0
- package/examples/integration/extension-sdk/README.md +24 -0
- package/examples/integration/extension-sdk/advanced-standalone.ts +6 -0
- package/examples/integration/extension-sdk/advanced.tsx +101 -0
- package/examples/integration/extension-sdk/env.d.ts +2 -0
- package/examples/integration/extension-sdk/extensions.tsx +97 -0
- package/examples/integration/extension-sdk/index.html +3 -0
- package/examples/integration/extension-sdk/main.tsx +10 -0
- package/examples/integration/extension-sdk/package.json +6 -0
- package/examples/integration/extension-sdk/standalone.ts +7 -0
- package/examples/integration/extension-sdk/tsconfig.json +8 -0
- package/examples/integration/react-comprehensive/index.html +12 -0
- package/examples/integration/react-comprehensive/main.jsx +123 -0
- package/examples/integration/react-comprehensive/package.json +18 -0
- package/examples/local/README-ch.md +76 -0
- package/examples/local/README.md +4 -2
- package/examples/local/scenarios/blog-zh.reactive.md +71 -0
- package/examples/local/scenarios/blog.reactive.md +71 -0
- package/examples/local/scenarios/classroom-zh.reactive.md +97 -0
- package/examples/local/scenarios/classroom.reactive.md +97 -0
- package/examples/local/scenarios/proposal-zh.reactive.md +79 -0
- package/examples/local/scenarios/proposal.reactive.md +79 -0
- package/examples/local/scenarios/survey-zh.reactive.md +74 -0
- package/examples/local/scenarios/survey.reactive.md +74 -0
- package/examples/local/showcase/README-ch.md +22 -0
- package/examples/local/showcase/README.md +9 -3
- package/examples/local/showcase/features.reactive.md +637 -0
- package/examples/local/showcase/zh/features.reactive.md +637 -0
- package/examples/sci-fi-theme/README-ch.md +131 -0
- package/examples/sci-fi-theme/README.md +146 -0
- package/examples/sci-fi-theme/demo/demo.css +532 -0
- package/examples/sci-fi-theme/demo/document.reactive.md +185 -0
- package/examples/sci-fi-theme/demo/index.html +13 -0
- package/examples/sci-fi-theme/demo/main.tsx +180 -0
- package/examples/sci-fi-theme/docs/design-system-ch.md +245 -0
- package/examples/sci-fi-theme/docs/design-system.md +474 -0
- package/examples/sci-fi-theme/package.json +27 -0
- package/examples/sci-fi-theme/scripts/screenshot.mjs +98 -0
- package/examples/sci-fi-theme/src/components.css +1460 -0
- package/examples/sci-fi-theme/src/index.ts +6 -0
- package/examples/sci-fi-theme/src/sci-fi.css +5 -0
- package/examples/sci-fi-theme/src/theme.ts +37 -0
- package/examples/sci-fi-theme/src/tokens.css +408 -0
- package/examples/sci-fi-theme/tsconfig.json +20 -0
- package/examples/sci-fi-theme/vite.config.ts +24 -0
- package/examples/tetris-package/LICENSE +21 -0
- package/examples/tetris-package/NOTICES.md +11 -0
- package/examples/tetris-package/README-ch.md +91 -0
- package/examples/tetris-package/README.md +95 -0
- package/examples/tetris-package/package.json +35 -0
- package/examples/tetris-package/sample/document.reactive.md +16 -0
- package/examples/tetris-package/scripts/build-export.mjs +44 -0
- package/examples/tetris-package/scripts/build.mjs +130 -0
- package/examples/tetris-package/scripts/verify.mjs +173 -0
- package/examples/tetris-package/src/component.css +145 -0
- package/examples/tetris-package/src/components.tsx +334 -0
- package/examples/tetris-package/src/harness.tsx +34 -0
- package/examples/tetris-package/src/manifests.ts +93 -0
- package/examples/tetris-package/src/node-entry.ts +16 -0
- package/examples/tetris-package/src/sample.ts +4 -0
- package/examples/tetris-package/src/tetris-engine.ts +325 -0
- package/examples/tetris-package/tsconfig.json +15 -0
- package/package.json +98 -44
- package/dist-library/compiler-Cm3ppMxG.js +0 -46044
- package/dist-library/react-Bh7_oxZp.js +0 -59655
- package/dist-library/reactive-md-editor.css +0 -2
- package/dist-library/reactive-md-editor.js +0 -3853
- package/dist-library/runtime-DlFYQ4s_.js +0 -498
- package/dist-library/types/editor/ReactiveMarkdownEditor.d.ts +0 -7
- package/dist-library/types/editor/editor-toolbar.d.ts +0 -24
- package/dist-library/types/editor/editor-view-bar.d.ts +0 -11
- package/dist-library/types/editor/extended-native-components.d.ts +0 -58
- package/dist-library/types/editor/index.d.ts +0 -9
- package/dist-library/types/editor/locale.d.ts +0 -13
- package/dist-library/types/editor/source-authoring.d.ts +0 -59
- package/dist-library/types/editor/types.d.ts +0 -48
- package/dist-library/types/editor/use-gutter-metrics.d.ts +0 -5
- package/dist-library/types/editor/use-source-history.d.ts +0 -16
- package/dist-library/types/local/compiler.d.ts +0 -4
- package/dist-library/types/local/math.d.ts +0 -48
- package/dist-library/types/local/options.d.ts +0 -36
- package/dist-library/types/local/parser.d.ts +0 -13
- package/dist-library/types/local/render-types.d.ts +0 -27
- package/dist-library/types/local/runtime.d.ts +0 -2
- package/dist-library/types/local/schema.d.ts +0 -77
- package/dist-library/types/local/types.d.ts +0 -263
- package/dist-library/types/local/visuals.d.ts +0 -12
- package/dist-library/types/local/worker.d.ts +0 -98
- package/docs/development/performance-ch.md +0 -76
- package/docs/development/performance-en.md +0 -76
- /package/dist-library/types/{editor → authoring}/command-types.d.ts +0 -0
- /package/dist-library/types/{editor → authoring}/editor-commands.d.ts +0 -0
- /package/dist-library/types/local/{locale.d.ts → contracts/locale.d.ts} +0 -0
- /package/dist-library/types/local/{collection-functions.d.ts → evaluation/collection-functions.d.ts} +0 -0
- /package/dist-library/types/local/{data-functions.d.ts → evaluation/data-functions.d.ts} +0 -0
- /package/dist-library/types/local/{dates.d.ts → evaluation/dates.d.ts} +0 -0
- /package/dist-library/types/local/{formatting.d.ts → evaluation/formatting.d.ts} +0 -0
- /package/dist-library/types/local/{html-names.d.ts → html/html-names.d.ts} +0 -0
- /package/dist-library/types/local/{text-length.d.ts → source/text-length.d.ts} +0 -0
- /package/dist-library/types/local/{colors.d.ts → theme/colors.d.ts} +0 -0
- /package/dist-library/types/local/{code-block.d.ts → widgets/code-block.d.ts} +0 -0
- /package/dist-library/types/local/{code-languages.d.ts → widgets/code-languages.d.ts} +0 -0
- /package/dist-library/types/local/{diagram-layout.d.ts → widgets/diagram-layout.d.ts} +0 -0
- /package/dist-library/types/local/{image-view.d.ts → widgets/image-view.d.ts} +0 -0
- /package/dist-library/types/local/{math-view.d.ts → widgets/math-view.d.ts} +0 -0
- /package/dist-library/types/local/{table-surface.d.ts → widgets/table-surface.d.ts} +0 -0
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { v as e } from "./compiler-core-kPiH-gOV.js";
|
|
2
|
+
import { D as t } from "./config-validation-DXTynAw7.js";
|
|
3
|
+
import { $ as n, S as r } from "./validation-W-bmny-x.js";
|
|
4
|
+
import { n as i } from "./options-CX5m5n-J.js";
|
|
5
|
+
import { t as a } from "./compiler--ea2CKQF.js";
|
|
6
|
+
import { c as o } from "./schema-ZFufO8V0.js";
|
|
7
|
+
// src/local/source/authoring.ts
|
|
3
8
|
var s = /^[A-Za-z_][A-Za-z0-9_]*$/, c = 128, l = /* @__PURE__ */ new Set([
|
|
4
9
|
"code",
|
|
5
10
|
"inlineCode",
|
|
@@ -32,7 +37,7 @@ function p(e) {
|
|
|
32
37
|
return e !== void 0 && /\s/.test(e);
|
|
33
38
|
}
|
|
34
39
|
function m(e) {
|
|
35
|
-
return e.length > 0 && e.length <= c && s.test(e) && !
|
|
40
|
+
return e.length > 0 && e.length <= c && s.test(e) && !n.has(e);
|
|
36
41
|
}
|
|
37
42
|
function h(e) {
|
|
38
43
|
return {
|
|
@@ -48,13 +53,17 @@ function g(e, t) {
|
|
|
48
53
|
}
|
|
49
54
|
}
|
|
50
55
|
function _(e) {
|
|
51
|
-
let t =
|
|
56
|
+
let t = i(e);
|
|
52
57
|
return t.ok ? t.htmlActive ? "html" : "markdown" : "invalid";
|
|
53
58
|
}
|
|
54
|
-
|
|
55
|
-
|
|
59
|
+
function v(e) {
|
|
60
|
+
let t = i(e);
|
|
61
|
+
return t.ok ? [...t.schemaByName.values()] : [];
|
|
62
|
+
}
|
|
63
|
+
var y = /^<(\/?)([A-Za-z][A-Za-z0-9_-]*)(?=[\s/>])/;
|
|
64
|
+
function b(e, t) {
|
|
56
65
|
if (e[t] !== "<") return null;
|
|
57
|
-
let n =
|
|
66
|
+
let n = y.exec(e.slice(t));
|
|
58
67
|
if (!n) return null;
|
|
59
68
|
let r = !!n[1], i = n[2], a = t + (r ? 2 : 1), o = "", s = t + n[0].length;
|
|
60
69
|
for (; s < e.length; s += 1) {
|
|
@@ -169,14 +178,14 @@ function y(e, t) {
|
|
|
169
178
|
attrs: u
|
|
170
179
|
};
|
|
171
180
|
}
|
|
172
|
-
function
|
|
173
|
-
if (
|
|
174
|
-
let
|
|
175
|
-
if (
|
|
176
|
-
let
|
|
177
|
-
return !
|
|
181
|
+
function x(e, n, i) {
|
|
182
|
+
if (n.range.end <= i) return null;
|
|
183
|
+
let a = e.lastIndexOf("</", n.range.end - 1);
|
|
184
|
+
if (a < i) return null;
|
|
185
|
+
let o = b(e, a);
|
|
186
|
+
return !o || !o.closing || o.end > n.range.end || o.name !== n.name && (!t.has(o.name.toLowerCase()) && !r.has(o.name.toLowerCase()) || o.name.toLowerCase() !== n.name?.toLowerCase()) ? null : o;
|
|
178
187
|
}
|
|
179
|
-
function
|
|
188
|
+
function S(e, t, n) {
|
|
180
189
|
let r = [];
|
|
181
190
|
for (let i = t; i < n;) {
|
|
182
191
|
if (e[i] === "\\" && e.startsWith("{{", i + 1)) {
|
|
@@ -204,7 +213,7 @@ function x(e, t, n) {
|
|
|
204
213
|
}
|
|
205
214
|
return r;
|
|
206
215
|
}
|
|
207
|
-
function
|
|
216
|
+
function C(e, t) {
|
|
208
217
|
let n = {
|
|
209
218
|
quot: "\"",
|
|
210
219
|
apos: "'",
|
|
@@ -221,38 +230,38 @@ function S(e, t) {
|
|
|
221
230
|
offsets: r
|
|
222
231
|
};
|
|
223
232
|
}
|
|
224
|
-
function
|
|
233
|
+
function w(e, t, r) {
|
|
225
234
|
let i = [];
|
|
226
|
-
for (let a =
|
|
227
|
-
let
|
|
228
|
-
if (
|
|
229
|
-
let
|
|
235
|
+
for (let a = t; a < r;) {
|
|
236
|
+
let t = e[a];
|
|
237
|
+
if (t === "\"" || t === "'") {
|
|
238
|
+
let n = t;
|
|
230
239
|
for (a += 1; a < r;) if (e[a] === "\\") a += 2;
|
|
231
240
|
else {
|
|
232
|
-
if (e[a] ===
|
|
241
|
+
if (e[a] === n) {
|
|
233
242
|
a += 1;
|
|
234
243
|
break;
|
|
235
244
|
}
|
|
236
245
|
a += 1;
|
|
237
246
|
}
|
|
238
247
|
} else {
|
|
239
|
-
if (/[0-9]/.test(
|
|
248
|
+
if (/[0-9]/.test(t) || t === "." && e[a + 1] !== void 0 && /[0-9]/.test(e[a + 1])) {
|
|
240
249
|
let t = /^(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?/.exec(e.slice(a, r));
|
|
241
250
|
if (t) {
|
|
242
251
|
a += t[0].length;
|
|
243
252
|
continue;
|
|
244
253
|
}
|
|
245
254
|
}
|
|
246
|
-
if (d(
|
|
247
|
-
let
|
|
255
|
+
if (d(t)) {
|
|
256
|
+
let t = a;
|
|
248
257
|
for (a += 1; a < r && f(e[a]);) a += 1;
|
|
249
|
-
let o = e.slice(
|
|
258
|
+
let o = e.slice(t, a), s = a;
|
|
250
259
|
for (; s < r && p(e[s]);) s += 1;
|
|
251
|
-
if (e[s] === "(" || o === "true" || o === "false" || o === "null" || o === "pi" || o === "e" ||
|
|
260
|
+
if (e[s] === "(" || o === "true" || o === "false" || o === "null" || o === "pi" || o === "e" || n.has(o)) continue;
|
|
252
261
|
i.push({
|
|
253
262
|
name: o,
|
|
254
263
|
range: {
|
|
255
|
-
start:
|
|
264
|
+
start: t,
|
|
256
265
|
end: a
|
|
257
266
|
}
|
|
258
267
|
});
|
|
@@ -261,18 +270,18 @@ function C(e, n, r) {
|
|
|
261
270
|
}
|
|
262
271
|
return i;
|
|
263
272
|
}
|
|
264
|
-
function
|
|
265
|
-
return Object.
|
|
273
|
+
function T(e, t) {
|
|
274
|
+
return Object.values(e.bindings ?? {}).some((e) => e.bind === t);
|
|
266
275
|
}
|
|
267
|
-
function
|
|
268
|
-
for (let n of e) l.has(n.type) && t.push(h(n.range)), n.type !== "fallback" && n.children &&
|
|
276
|
+
function E(e, t = []) {
|
|
277
|
+
for (let n of e) l.has(n.type) && t.push(h(n.range)), n.type !== "fallback" && n.children && E(n.children, t);
|
|
269
278
|
return t;
|
|
270
279
|
}
|
|
271
|
-
function
|
|
272
|
-
let n =
|
|
280
|
+
function D(e, t) {
|
|
281
|
+
let n = E(t), r = (t) => {
|
|
273
282
|
for (let i of t) {
|
|
274
283
|
if (i.type === "component" || i.type === "hostComponent") {
|
|
275
|
-
let t =
|
|
284
|
+
let t = b(e, i.range.start);
|
|
276
285
|
t && n.push({
|
|
277
286
|
start: t.start,
|
|
278
287
|
end: t.end
|
|
@@ -300,163 +309,182 @@ function E(e, t) {
|
|
|
300
309
|
}
|
|
301
310
|
return i;
|
|
302
311
|
}
|
|
303
|
-
function
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
r.push(
|
|
312
|
+
function O(e, t) {
|
|
313
|
+
return t.find((t) => t.name === e)?.props;
|
|
314
|
+
}
|
|
315
|
+
function k(n, i, a, o) {
|
|
316
|
+
let s = [];
|
|
317
|
+
o?.themeRange && s.push({
|
|
318
|
+
type: "component",
|
|
319
|
+
name: "theme",
|
|
320
|
+
id: "author-theme",
|
|
321
|
+
range: o.themeRange
|
|
322
|
+
});
|
|
323
|
+
for (let e of Object.values(o?.computations ?? {})) s.push({
|
|
324
|
+
type: "component",
|
|
325
|
+
name: e.kind,
|
|
326
|
+
id: e.nodeId,
|
|
327
|
+
range: e.range
|
|
328
|
+
});
|
|
329
|
+
let c = s.length ? i.concat(s) : i, u = /* @__PURE__ */ new Set(), d = [], f = /* @__PURE__ */ new Map(), p = [], g = [], _ = (e, t) => {
|
|
330
|
+
for (let r of w(n, e, t)) p.push(r);
|
|
331
|
+
}, v = (e, t) => {
|
|
332
|
+
let n = f.get(e);
|
|
333
|
+
n ? n.push(h(t)) : f.set(e, [h(t)]);
|
|
334
|
+
}, y = (e, t) => {
|
|
335
|
+
if (u.has(e.range.start)) return;
|
|
336
|
+
let r = b(n, e.range.start);
|
|
337
|
+
if (!r || r.closing) return;
|
|
338
|
+
u.add(e.range.start), d.push({
|
|
322
339
|
kind: "tag",
|
|
323
|
-
range: h(
|
|
340
|
+
range: h(r.nameRange)
|
|
324
341
|
});
|
|
325
|
-
let
|
|
326
|
-
for (let
|
|
327
|
-
if (
|
|
342
|
+
let i = a.find((t) => t.name === e.name);
|
|
343
|
+
for (let t of r.attrs) {
|
|
344
|
+
if (d.push({
|
|
328
345
|
kind: "attribute",
|
|
329
|
-
range: h(
|
|
330
|
-
}), !
|
|
331
|
-
let
|
|
332
|
-
if (
|
|
333
|
-
for (let e of
|
|
346
|
+
range: h(t.nameRange)
|
|
347
|
+
}), !t.valueRange) continue;
|
|
348
|
+
let o = O(e.name ?? "", a)?.[t.name], s = i !== void 0 && T(i, t.name) && Object.values(i.bindings ?? {}).some((e) => e.bind === t.name && (e.requiresAttributes ?? []).every((e) => r.attrs.some((t) => t.name === e))), c = (e.name === "computed" || e.name === "const" || e.name === "external") && t.name === "name", l = n.slice(t.valueRange.start, t.valueRange.end), u = C(n, t.valueRange);
|
|
349
|
+
if (i?.rules?.some((e) => e.kind === "validation-rule" && e.fields === t.name)) {
|
|
350
|
+
for (let e of u.text.matchAll(/\S+/g)) {
|
|
334
351
|
if (!m(e[0])) continue;
|
|
335
352
|
let t = {
|
|
336
|
-
start:
|
|
337
|
-
end:
|
|
353
|
+
start: u.offsets[e.index],
|
|
354
|
+
end: u.offsets[e.index + e[0].length]
|
|
338
355
|
};
|
|
339
|
-
|
|
356
|
+
p.push({
|
|
340
357
|
name: e[0],
|
|
341
358
|
range: t
|
|
342
|
-
}),
|
|
359
|
+
}), d.push({
|
|
343
360
|
kind: "binding",
|
|
344
361
|
range: t
|
|
345
362
|
});
|
|
346
363
|
}
|
|
347
364
|
continue;
|
|
348
365
|
}
|
|
349
|
-
let
|
|
350
|
-
if (
|
|
366
|
+
let f = o && !o.static ? S(u.text, 0, u.text.length) : [];
|
|
367
|
+
if (f.length > 0) {
|
|
351
368
|
let e = 0;
|
|
352
|
-
for (let n of
|
|
353
|
-
n.start > e &&
|
|
369
|
+
for (let n of f) {
|
|
370
|
+
n.start > e && d.push({
|
|
354
371
|
kind: "string",
|
|
355
372
|
range: {
|
|
356
|
-
start:
|
|
357
|
-
end:
|
|
373
|
+
start: u.offsets[e],
|
|
374
|
+
end: u.offsets[n.start]
|
|
358
375
|
}
|
|
359
|
-
}),
|
|
376
|
+
}), d.push({
|
|
360
377
|
kind: "expression",
|
|
361
378
|
range: {
|
|
362
|
-
start:
|
|
363
|
-
end:
|
|
379
|
+
start: u.offsets[n.start],
|
|
380
|
+
end: u.offsets[n.end]
|
|
364
381
|
}
|
|
365
382
|
});
|
|
366
|
-
for (let e of
|
|
383
|
+
for (let e of w(u.text, n.innerStart, n.innerEnd)) (!i?.rules?.some((e) => e.kind === "scoped-expressions" && e.scope === "row" && e.attributes.includes(t.name) || e.kind === "row-values" && e.key === t.name) || e.name !== "item" && e.name !== "index") && p.push({
|
|
367
384
|
name: e.name,
|
|
368
385
|
range: {
|
|
369
|
-
start:
|
|
370
|
-
end:
|
|
386
|
+
start: u.offsets[e.range.start],
|
|
387
|
+
end: u.offsets[e.range.end]
|
|
371
388
|
}
|
|
372
389
|
});
|
|
373
390
|
e = n.end;
|
|
374
391
|
}
|
|
375
|
-
e <
|
|
392
|
+
e < u.text.length && d.push({
|
|
376
393
|
kind: "string",
|
|
377
394
|
range: {
|
|
378
|
-
start:
|
|
379
|
-
end:
|
|
395
|
+
start: u.offsets[e],
|
|
396
|
+
end: t.valueRange.end
|
|
380
397
|
}
|
|
381
398
|
});
|
|
382
|
-
} else (
|
|
399
|
+
} else (s || c) && m(l) ? (d.push({
|
|
383
400
|
kind: "binding",
|
|
384
|
-
range: h(
|
|
385
|
-
}),
|
|
401
|
+
range: h(t.valueRange)
|
|
402
|
+
}), v(l, t.valueRange)) : t.valueRange.end > t.valueRange.start && d.push({
|
|
386
403
|
kind: "string",
|
|
387
|
-
range: h(
|
|
404
|
+
range: h(t.valueRange)
|
|
388
405
|
});
|
|
389
406
|
}
|
|
390
|
-
let
|
|
391
|
-
|
|
407
|
+
let o = x(n, e, r.end);
|
|
408
|
+
o && d.push({
|
|
392
409
|
kind: "tag",
|
|
393
|
-
range: h(
|
|
410
|
+
range: h(o.nameRange)
|
|
394
411
|
});
|
|
395
|
-
},
|
|
396
|
-
for (let
|
|
397
|
-
if ((
|
|
398
|
-
else if (
|
|
412
|
+
}, E = (i, o) => {
|
|
413
|
+
for (let s of i) {
|
|
414
|
+
if ((s.type === "component" || s.type === "hostComponent") && s.name) y(s, o);
|
|
415
|
+
else if (s.type === "interpolation") d.push({
|
|
399
416
|
kind: "expression",
|
|
400
|
-
range: h(
|
|
401
|
-
}),
|
|
402
|
-
else if (
|
|
403
|
-
if (
|
|
417
|
+
range: h(s.range)
|
|
418
|
+
}), _(s.range.start + 2, Math.max(s.range.start + 2, s.range.end - 2));
|
|
419
|
+
else if (s.type === "math" || s.type === "inlineMath") {
|
|
420
|
+
if (d.push({
|
|
404
421
|
kind: "math",
|
|
405
|
-
range: h(
|
|
406
|
-
}),
|
|
407
|
-
let t =
|
|
422
|
+
range: h(s.range)
|
|
423
|
+
}), a.find((e) => e.name === o)?.rules?.some((e) => e.kind === "inline-math-reads") && s.type === "math") {
|
|
424
|
+
let t = s.range.start + 2;
|
|
408
425
|
try {
|
|
409
|
-
for (let
|
|
426
|
+
for (let r of e(n.slice(t, s.range.end - 2))) {
|
|
410
427
|
let e = {
|
|
411
|
-
name:
|
|
428
|
+
name: r.name,
|
|
412
429
|
range: {
|
|
413
|
-
start: t +
|
|
414
|
-
end: t +
|
|
430
|
+
start: t + r.range.start,
|
|
431
|
+
end: t + r.range.end
|
|
415
432
|
}
|
|
416
433
|
};
|
|
417
|
-
|
|
434
|
+
p.push(e), g.push(e);
|
|
418
435
|
}
|
|
419
436
|
} catch {}
|
|
420
437
|
}
|
|
421
|
-
} else
|
|
438
|
+
} else s.type === "code" || s.type === "inlineCode" ? d.push({
|
|
422
439
|
kind: "code",
|
|
423
|
-
range: h(
|
|
424
|
-
}) :
|
|
440
|
+
range: h(s.range)
|
|
441
|
+
}) : s.type === "comment" && d.push({
|
|
425
442
|
kind: "comment",
|
|
426
|
-
range: h(
|
|
443
|
+
range: h(s.range)
|
|
427
444
|
});
|
|
428
|
-
|
|
445
|
+
if (!l.has(s.type) && n[s.range.start] === "<" && !u.has(s.range.start)) {
|
|
446
|
+
let e = b(n, s.range.start);
|
|
447
|
+
e && !e.closing && (t.has(e.name.toLowerCase()) || r.has(e.name.toLowerCase())) && y({
|
|
448
|
+
...s,
|
|
449
|
+
name: e.name
|
|
450
|
+
}, o);
|
|
451
|
+
}
|
|
452
|
+
s.type !== "fallback" && s.children && E(s.children, s.name);
|
|
429
453
|
}
|
|
430
454
|
};
|
|
431
|
-
|
|
432
|
-
for (let
|
|
455
|
+
E(c);
|
|
456
|
+
for (let e of D(n, c)) d.push({
|
|
433
457
|
kind: "comment",
|
|
434
|
-
range:
|
|
458
|
+
range: e
|
|
435
459
|
});
|
|
436
|
-
|
|
437
|
-
let
|
|
438
|
-
for (let e of
|
|
460
|
+
d.sort((e, t) => e.range.start - t.range.start || e.range.end - t.range.end);
|
|
461
|
+
let k = [];
|
|
462
|
+
for (let e of d) {
|
|
439
463
|
if (e.range.end <= e.range.start) continue;
|
|
440
|
-
let t =
|
|
441
|
-
t && e.range.start < t.range.end ||
|
|
464
|
+
let t = k[k.length - 1];
|
|
465
|
+
t && e.range.start < t.range.end || k.push(e);
|
|
442
466
|
}
|
|
443
|
-
let
|
|
444
|
-
for (let [e, t] of
|
|
445
|
-
let n = [];
|
|
446
|
-
for (let t of
|
|
447
|
-
|
|
467
|
+
let A = [];
|
|
468
|
+
for (let [e, t] of f) {
|
|
469
|
+
let n = [], r = /* @__PURE__ */ new Set();
|
|
470
|
+
for (let t of p) {
|
|
471
|
+
if (t.name !== e) continue;
|
|
472
|
+
let i = `${t.range.start}:${t.range.end}`;
|
|
473
|
+
r.has(i) || (r.add(i), n.push(h(t.range)));
|
|
474
|
+
}
|
|
475
|
+
n.sort((e, t) => e.start - t.start || e.end - t.end), t.sort((e, t) => e.start - t.start || e.end - t.end), A.push({
|
|
448
476
|
name: e,
|
|
449
477
|
declarations: t,
|
|
450
478
|
references: n
|
|
451
479
|
});
|
|
452
480
|
}
|
|
453
|
-
return
|
|
454
|
-
tokens:
|
|
455
|
-
bindings:
|
|
456
|
-
mathReferences:
|
|
481
|
+
return A.sort((e, t) => e.declarations[0].start - t.declarations[0].start || e.name.localeCompare(t.name)), {
|
|
482
|
+
tokens: k,
|
|
483
|
+
bindings: A,
|
|
484
|
+
mathReferences: g
|
|
457
485
|
};
|
|
458
486
|
}
|
|
459
|
-
function
|
|
487
|
+
function A(e, t, n = {}) {
|
|
460
488
|
if (typeof e != "string") return {
|
|
461
489
|
tokens: [],
|
|
462
490
|
bindings: [],
|
|
@@ -465,16 +493,16 @@ function k(e, t) {
|
|
|
465
493
|
if (_(t) !== "markdown") return {
|
|
466
494
|
tokens: [],
|
|
467
495
|
bindings: [],
|
|
468
|
-
diagnostics: g(e, t)
|
|
496
|
+
diagnostics: n.diagnostics === !1 ? [] : g(e, t)
|
|
469
497
|
};
|
|
470
|
-
let r =
|
|
498
|
+
let r = n.document?.source === e ? n.document : o(e, t), i = k(e, r.nodes, v(t), r);
|
|
471
499
|
return {
|
|
472
|
-
tokens:
|
|
473
|
-
bindings:
|
|
474
|
-
diagnostics: g(e, t)
|
|
500
|
+
tokens: i.tokens,
|
|
501
|
+
bindings: i.bindings,
|
|
502
|
+
diagnostics: n.diagnostics === !1 ? [] : g(e, t)
|
|
475
503
|
};
|
|
476
504
|
}
|
|
477
|
-
function
|
|
505
|
+
function j(e, t, n) {
|
|
478
506
|
let r = /^<(\/?)([A-Za-z][A-Za-z0-9_-]*)/.exec(e.slice(t, Math.min(e.length, n + 1)));
|
|
479
507
|
if (!r) return null;
|
|
480
508
|
let i = !!r[1], a = r[2], o = t + r[0].length, s = [], c = !1, l, u = !1;
|
|
@@ -582,7 +610,7 @@ function A(e, t, n) {
|
|
|
582
610
|
partialStart: d
|
|
583
611
|
};
|
|
584
612
|
}
|
|
585
|
-
function
|
|
613
|
+
function M(e, t, n) {
|
|
586
614
|
let r = [], i = (e) => {
|
|
587
615
|
for (let t of e) t.type === "component" && r.push(t.range.start), t.type !== "fallback" && t.children && i(t.children);
|
|
588
616
|
};
|
|
@@ -590,7 +618,7 @@ function j(e, t, n) {
|
|
|
590
618
|
for (let n = r.length - 1; n >= 0; --n) {
|
|
591
619
|
let i = r[n];
|
|
592
620
|
if (i >= t) continue;
|
|
593
|
-
let a =
|
|
621
|
+
let a = b(e, i);
|
|
594
622
|
if (a && t <= a.end) return i;
|
|
595
623
|
if (a && a.end < t) break;
|
|
596
624
|
}
|
|
@@ -604,12 +632,12 @@ function j(e, t, n) {
|
|
|
604
632
|
}
|
|
605
633
|
let r = e[n + 1];
|
|
606
634
|
if (r !== "/" && !d(r)) a = n;
|
|
607
|
-
else if (
|
|
635
|
+
else if (N(e, n, t)) a = n;
|
|
608
636
|
else return n;
|
|
609
637
|
}
|
|
610
638
|
return -1;
|
|
611
639
|
}
|
|
612
|
-
function
|
|
640
|
+
function N(e, t, n) {
|
|
613
641
|
let r = "";
|
|
614
642
|
for (let i = t; i < n; i += 1) {
|
|
615
643
|
let t = e[i];
|
|
@@ -619,7 +647,7 @@ function M(e, t, n) {
|
|
|
619
647
|
}
|
|
620
648
|
return !1;
|
|
621
649
|
}
|
|
622
|
-
function
|
|
650
|
+
function P(e, t) {
|
|
623
651
|
let n = t;
|
|
624
652
|
for (; n > 0;) {
|
|
625
653
|
let r = e.lastIndexOf("{{", n - 1);
|
|
@@ -648,7 +676,7 @@ function N(e, t) {
|
|
|
648
676
|
}
|
|
649
677
|
return null;
|
|
650
678
|
}
|
|
651
|
-
function
|
|
679
|
+
function F(e, t, n) {
|
|
652
680
|
let r = "";
|
|
653
681
|
for (let i = t; i < n; i += 1) {
|
|
654
682
|
let t = e[i];
|
|
@@ -656,7 +684,7 @@ function P(e, t, n) {
|
|
|
656
684
|
}
|
|
657
685
|
return r !== "";
|
|
658
686
|
}
|
|
659
|
-
function
|
|
687
|
+
function I(e, t) {
|
|
660
688
|
let n = 0, r = e.length - 1;
|
|
661
689
|
for (; n <= r;) {
|
|
662
690
|
let i = n + r >> 1, a = e[i];
|
|
@@ -666,15 +694,15 @@ function F(e, t) {
|
|
|
666
694
|
}
|
|
667
695
|
return !1;
|
|
668
696
|
}
|
|
669
|
-
function
|
|
697
|
+
function L(e, t, n, r) {
|
|
670
698
|
let i = e.slice(t, n), a = i && r.startsWith(i) ? r.slice(i.length) : "";
|
|
671
699
|
return {
|
|
672
700
|
start: t,
|
|
673
701
|
end: a && e.startsWith(a, n) ? n + a.length : n
|
|
674
702
|
};
|
|
675
703
|
}
|
|
676
|
-
function
|
|
677
|
-
if (
|
|
704
|
+
function R(e, t, n, r) {
|
|
705
|
+
if (F(e, n.innerStart, t)) return [];
|
|
678
706
|
let i = t;
|
|
679
707
|
for (; i > n.innerStart && f(e[i - 1]);) --i;
|
|
680
708
|
if (e[i - 1] === ".") return [];
|
|
@@ -682,28 +710,28 @@ function L(e, t, n, r) {
|
|
|
682
710
|
return a && !d(a[0]) ? [] : r.filter((e) => e.name.startsWith(a)).map((n) => ({
|
|
683
711
|
label: n.name,
|
|
684
712
|
insertText: n.name,
|
|
685
|
-
range:
|
|
713
|
+
range: L(e, i, t, n.name),
|
|
686
714
|
kind: "binding",
|
|
687
715
|
detail: `${n.declarations.length} declaration${n.declarations.length === 1 ? "" : "s"}, ${n.references.length} reference${n.references.length === 1 ? "" : "s"}`
|
|
688
716
|
}));
|
|
689
717
|
}
|
|
690
|
-
function
|
|
718
|
+
function z(e, t, n, r) {
|
|
691
719
|
let i = n.currentAttribute;
|
|
692
720
|
if (!i) return [];
|
|
693
|
-
let a =
|
|
721
|
+
let a = O(n.name, r)?.[i.name];
|
|
694
722
|
if (!a || a.kind !== "enum" || !a.values) return [];
|
|
695
723
|
let o = i.valueRange?.start ?? t, s = e.slice(o, t);
|
|
696
724
|
return a.values.filter((e) => e.startsWith(s)).map((n) => ({
|
|
697
725
|
label: n,
|
|
698
726
|
insertText: n,
|
|
699
|
-
range:
|
|
727
|
+
range: L(e, o, t, n),
|
|
700
728
|
kind: "value",
|
|
701
729
|
detail: `${i.name} value`
|
|
702
730
|
}));
|
|
703
731
|
}
|
|
704
|
-
function
|
|
732
|
+
function B(e, t, n, r) {
|
|
705
733
|
if (n.closing || n.inValue || n.partialStart < 0) return [];
|
|
706
|
-
let i =
|
|
734
|
+
let i = O(n.name, r);
|
|
707
735
|
if (!i) return [];
|
|
708
736
|
let a = e.slice(n.partialStart, t);
|
|
709
737
|
if (a && !/^[A-Za-z0-9_-]*$/.test(a)) return [];
|
|
@@ -711,119 +739,119 @@ function z(e, t, n, r) {
|
|
|
711
739
|
return Object.entries(i).filter(([e]) => !o.has(e) && e.startsWith(a)).map(([r, i]) => ({
|
|
712
740
|
label: r,
|
|
713
741
|
insertText: r,
|
|
714
|
-
range:
|
|
742
|
+
range: L(e, n.partialStart, t, r),
|
|
715
743
|
kind: "attribute",
|
|
716
744
|
detail: i.required ? `${i.kind}, required` : i.kind
|
|
717
745
|
}));
|
|
718
746
|
}
|
|
719
|
-
function
|
|
720
|
-
let
|
|
721
|
-
if (!
|
|
722
|
-
let
|
|
723
|
-
if (
|
|
724
|
-
let
|
|
725
|
-
if (
|
|
726
|
-
let
|
|
727
|
-
return
|
|
728
|
-
label:
|
|
729
|
-
insertText:
|
|
730
|
-
range:
|
|
747
|
+
function V(e, t, n) {
|
|
748
|
+
let r = Math.max(0, t - 256), i = e.slice(r, t), a = /<\/?([A-Za-z][A-Za-z0-9-]*)?$/.exec(i);
|
|
749
|
+
if (!a) return [];
|
|
750
|
+
let o = r + a.index;
|
|
751
|
+
if (e[o] !== "<" || e[o - 1] === "\\") return [];
|
|
752
|
+
let s = e[o + 1] === "/", c = o + (s ? 2 : 1);
|
|
753
|
+
if (c > t) return [];
|
|
754
|
+
let l = a[1] ?? "";
|
|
755
|
+
return (s ? n.filter((e) => e.form !== "leaf").map((e) => e.name) : n.map((e) => e.name)).filter((e) => e.startsWith(l)).map((n) => ({
|
|
756
|
+
label: n,
|
|
757
|
+
insertText: n,
|
|
758
|
+
range: L(e, c, t, n),
|
|
731
759
|
kind: "tag",
|
|
732
|
-
detail:
|
|
760
|
+
detail: s ? "closing tag" : "component"
|
|
733
761
|
}));
|
|
734
762
|
}
|
|
735
|
-
function
|
|
736
|
-
if (typeof e != "string" || !Number.isFinite(t) || _(
|
|
737
|
-
let
|
|
738
|
-
if (
|
|
739
|
-
let
|
|
740
|
-
if (
|
|
741
|
-
let t =
|
|
763
|
+
function H(e, t, n) {
|
|
764
|
+
if (typeof e != "string" || !Number.isFinite(t) || _(n) !== "markdown") return [];
|
|
765
|
+
let r = Math.max(0, Math.min(e.length, Math.floor(t))), i = v(n), a = o(e, n), s = [...E(a.nodes), ...D(e, a.nodes)].sort((e, t) => e.start - t.start);
|
|
766
|
+
if (I(s, r) || r === e.length && s.some((e) => e.end === r && e.start < r)) return [];
|
|
767
|
+
let c = k(e, a.nodes, i), l = P(e, r);
|
|
768
|
+
if (l) {
|
|
769
|
+
let t = M(e, r, a.nodes);
|
|
742
770
|
if (t >= 0) {
|
|
743
|
-
let n =
|
|
744
|
-
if (n?.inValue && n.currentAttribute &&
|
|
771
|
+
let n = j(e, t, r);
|
|
772
|
+
if (n?.inValue && n.currentAttribute && O(n.name, i)?.[n.currentAttribute.name]?.static) return [];
|
|
745
773
|
}
|
|
746
|
-
return
|
|
774
|
+
return R(e, r, l, c.bindings);
|
|
747
775
|
}
|
|
748
|
-
let
|
|
749
|
-
if (
|
|
750
|
-
let t =
|
|
751
|
-
if (t?.inValue) return
|
|
776
|
+
let u = M(e, r, a.nodes);
|
|
777
|
+
if (u >= 0) {
|
|
778
|
+
let t = j(e, u, r);
|
|
779
|
+
if (t?.inValue) return z(e, r, t, i);
|
|
752
780
|
}
|
|
753
|
-
let
|
|
754
|
-
if (
|
|
755
|
-
if (
|
|
756
|
-
let t =
|
|
757
|
-
if (t) return
|
|
781
|
+
let d = V(e, r, i);
|
|
782
|
+
if (d.length > 0) return d;
|
|
783
|
+
if (u >= 0) {
|
|
784
|
+
let t = j(e, u, r);
|
|
785
|
+
if (t) return B(e, r, t, i);
|
|
758
786
|
}
|
|
759
787
|
return [];
|
|
760
788
|
}
|
|
761
|
-
function
|
|
789
|
+
function U(e, t) {
|
|
762
790
|
let n = "", r = 0;
|
|
763
791
|
for (let i of t) n += e.slice(r, i.range.start) + i.text, r = i.range.end;
|
|
764
792
|
return n + e.slice(r);
|
|
765
793
|
}
|
|
766
|
-
function
|
|
767
|
-
if (typeof e != "string" || typeof t != "string" || typeof
|
|
768
|
-
if (_(
|
|
769
|
-
if (!m(
|
|
770
|
-
let
|
|
794
|
+
function W(e, t, n, r) {
|
|
795
|
+
if (typeof e != "string" || typeof t != "string" || typeof n != "string") throw Error("Rename requires string arguments.");
|
|
796
|
+
if (_(r) === "html") throw Error("Bindings cannot be renamed in HTML mode.");
|
|
797
|
+
if (!m(n)) throw Error(`"${n}" is not a valid binding name. Use [A-Za-z_][A-Za-z0-9_]* and avoid reserved names.`);
|
|
798
|
+
let i = k(e, o(e, r).nodes, v(r)), s = i.bindings.find((e) => e.name === t);
|
|
771
799
|
if (!s || s.declarations.length === 0) throw Error(`Binding "${t}" is not declared in this document.`);
|
|
772
|
-
if (t ===
|
|
800
|
+
if (t === n) return {
|
|
773
801
|
source: e,
|
|
774
802
|
edits: []
|
|
775
803
|
};
|
|
776
|
-
if (
|
|
777
|
-
if (g(e,
|
|
804
|
+
if (i.bindings.some((e) => e.name === n)) throw Error(`Binding "${n}" already exists.`);
|
|
805
|
+
if (g(e, r).some((e) => e.severity === "error" && u.has(e.code))) throw Error("The document cannot be renamed safely while parse errors remain.");
|
|
778
806
|
let c = /* @__PURE__ */ new Set(), l = [];
|
|
779
807
|
for (let e of [...s.declarations, ...s.references]) {
|
|
780
808
|
let t = `${e.start}:${e.end}`;
|
|
781
809
|
c.has(t) || (c.add(t), l.push(h(e)));
|
|
782
810
|
}
|
|
783
811
|
l.sort((e, t) => e.start - t.start || e.end - t.end);
|
|
784
|
-
let d = new Set(
|
|
812
|
+
let d = new Set(i.mathReferences.filter((e) => e.name === t).map((e) => `${e.range.start}:${e.range.end}`)), f = l.map((e) => ({
|
|
785
813
|
range: h(e),
|
|
786
|
-
text: d.has(`${e.start}:${e.end}`) ? `\\mathrm{${
|
|
787
|
-
})), p =
|
|
788
|
-
if (a(e,
|
|
814
|
+
text: d.has(`${e.start}:${e.end}`) ? `\\mathrm{${n}}` : n
|
|
815
|
+
})), p = U(e, f);
|
|
816
|
+
if (a(e, r).ok && !a(p, r).ok) throw Error("Rename could not preserve all binding references; the source was left unchanged.");
|
|
789
817
|
return {
|
|
790
818
|
source: p,
|
|
791
819
|
edits: f
|
|
792
820
|
};
|
|
793
821
|
}
|
|
794
|
-
function
|
|
822
|
+
function G(e, t) {
|
|
795
823
|
let n = e.slice(t.nameRange.start, t.nameRange.end), r = t.attrs.map((t) => {
|
|
796
824
|
let n = e.slice(t.nameRange.start, t.nameRange.end);
|
|
797
825
|
return t.valueRange === void 0 ? n : t.quoteStart !== void 0 && t.quoteEnd !== void 0 ? `${n}=${e.slice(t.quoteStart, t.quoteEnd + 1)}` : n;
|
|
798
826
|
}), i = r.length > 0 ? `<${n} ${r.join(" ")}` : `<${n}`;
|
|
799
827
|
return t.selfClosing ? `${i} />` : `${i}>`;
|
|
800
828
|
}
|
|
801
|
-
function
|
|
829
|
+
function K(e, t) {
|
|
802
830
|
if (typeof e != "string" || _(t) !== "markdown") return e;
|
|
803
|
-
let
|
|
831
|
+
let n;
|
|
804
832
|
try {
|
|
805
|
-
|
|
833
|
+
n = a(e, t);
|
|
806
834
|
} catch {
|
|
807
835
|
return e;
|
|
808
836
|
}
|
|
809
|
-
if (
|
|
810
|
-
let
|
|
837
|
+
if (n.diagnostics.some((e) => e.severity === "error")) return e;
|
|
838
|
+
let r = o(e, t), i = [], s = (t) => {
|
|
811
839
|
for (let n of t) {
|
|
812
840
|
if ((n.type === "component" || n.type === "hostComponent") && n.name) {
|
|
813
|
-
let t =
|
|
841
|
+
let t = b(e, n.range.start);
|
|
814
842
|
if (t && !t.closing && !/[\r\n]/.test(e.slice(t.start, t.end))) {
|
|
815
|
-
let n =
|
|
816
|
-
n !== e.slice(t.start, t.end) &&
|
|
843
|
+
let n = G(e, t);
|
|
844
|
+
n !== e.slice(t.start, t.end) && i.push({
|
|
817
845
|
start: t.start,
|
|
818
846
|
end: t.end,
|
|
819
847
|
text: n
|
|
820
848
|
});
|
|
821
849
|
}
|
|
822
850
|
if (t) {
|
|
823
|
-
let r =
|
|
851
|
+
let r = x(e, n, t.end);
|
|
824
852
|
if (r && !/[\r\n]/.test(e.slice(r.start, r.end))) {
|
|
825
853
|
let t = `</${e.slice(r.nameRange.start, r.nameRange.end)}>`;
|
|
826
|
-
t !== e.slice(r.start, r.end) &&
|
|
854
|
+
t !== e.slice(r.start, r.end) && i.push({
|
|
827
855
|
start: r.start,
|
|
828
856
|
end: r.end,
|
|
829
857
|
text: t
|
|
@@ -834,9 +862,9 @@ function G(e, t) {
|
|
|
834
862
|
n.type !== "fallback" && n.children && s(n.children);
|
|
835
863
|
}
|
|
836
864
|
};
|
|
837
|
-
s(
|
|
865
|
+
s(r.nodes), i.sort((e, t) => e.start - t.start || e.end - t.end);
|
|
838
866
|
let c = "", l = 0;
|
|
839
|
-
for (let t of
|
|
867
|
+
for (let t of i) t.start < l || (c += e.slice(l, t.start) + t.text, l = t.end);
|
|
840
868
|
return c + e.slice(l);
|
|
841
869
|
}
|
|
842
|
-
export {
|
|
870
|
+
export { W as i, H as n, K as r, A as t };
|