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
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import type { EditorLocale } from './command-types.js';
|
|
2
|
+
import type { LocalCompileOptions, LocalValue } from '../local/contracts/types.js';
|
|
3
|
+
import type { LocalComponentForm, LocalPropKind } from '../local/configuration/schema.js';
|
|
4
|
+
import type { LocalComponentRequires, LocalConfig } from '../sdk/types.js';
|
|
5
|
+
/**
|
|
6
|
+
* Manifest-derived authoring catalog for the editor.
|
|
7
|
+
*
|
|
8
|
+
* Defaults and external components are projected from the same validated
|
|
9
|
+
* registry. Default titles, descriptions, localized templates and search terms
|
|
10
|
+
* come from the preset authoring data; external data comes from each manifest's
|
|
11
|
+
* `authoring` block and prop descriptions. Nothing in this module imports
|
|
12
|
+
* React, CSS or a browser API, so a worker or server can build the same menu.
|
|
13
|
+
*/
|
|
14
|
+
export interface LocalComponentCatalogProp {
|
|
15
|
+
readonly name: string;
|
|
16
|
+
readonly kind: LocalPropKind;
|
|
17
|
+
readonly required: boolean;
|
|
18
|
+
readonly static: boolean;
|
|
19
|
+
readonly dynamic: boolean;
|
|
20
|
+
readonly values?: readonly string[];
|
|
21
|
+
readonly defaultValue?: string | number | boolean | null;
|
|
22
|
+
/** Localized authoring description, when the manifest declares one. */
|
|
23
|
+
readonly description?: string;
|
|
24
|
+
}
|
|
25
|
+
/** One frozen insertion-catalog entry. */
|
|
26
|
+
export interface LocalComponentCatalogEntry {
|
|
27
|
+
readonly id: string;
|
|
28
|
+
readonly name: string;
|
|
29
|
+
readonly title: string;
|
|
30
|
+
readonly description: string;
|
|
31
|
+
readonly category: string;
|
|
32
|
+
/** Localized label for `category`; falls back to the category id. */
|
|
33
|
+
readonly categoryLabel: string;
|
|
34
|
+
readonly insertText: string;
|
|
35
|
+
readonly form: LocalComponentForm;
|
|
36
|
+
/** True for inline and container forms, which accept a closing tag. */
|
|
37
|
+
readonly paired: boolean;
|
|
38
|
+
/** Inline components are inserted without block padding. */
|
|
39
|
+
readonly inline: boolean;
|
|
40
|
+
/** Structural parents that must enclose this component, when declared. */
|
|
41
|
+
readonly parents?: readonly string[];
|
|
42
|
+
/** Exclusive child components accepted by a container, when declared. */
|
|
43
|
+
readonly allowedChildren?: readonly string[];
|
|
44
|
+
/** Search terms from both languages (default preset entries). */
|
|
45
|
+
readonly keywords?: readonly string[];
|
|
46
|
+
readonly props: Readonly<Record<string, LocalComponentCatalogProp>>;
|
|
47
|
+
/** Manifest style-resource identities preserved for export preflight. */
|
|
48
|
+
readonly styles?: readonly string[];
|
|
49
|
+
/** Kernel requirements preserved for configuration checks. */
|
|
50
|
+
readonly requires?: LocalComponentRequires;
|
|
51
|
+
}
|
|
52
|
+
export interface LocalTagAuthoring {
|
|
53
|
+
readonly name: string;
|
|
54
|
+
readonly form: LocalComponentForm;
|
|
55
|
+
/** True for inline and container forms, which accept a closing tag. */
|
|
56
|
+
readonly paired: boolean;
|
|
57
|
+
readonly title: string;
|
|
58
|
+
readonly description: string;
|
|
59
|
+
readonly category: string;
|
|
60
|
+
readonly categoryLabel: string;
|
|
61
|
+
readonly insertText: string;
|
|
62
|
+
readonly props: Readonly<Record<string, LocalAttributeAuthoring>>;
|
|
63
|
+
readonly parents?: readonly string[];
|
|
64
|
+
readonly allowedChildren?: readonly string[];
|
|
65
|
+
readonly keywords?: readonly string[];
|
|
66
|
+
/** Manifest style-resource identities preserved for export preflight. */
|
|
67
|
+
readonly styles?: readonly string[];
|
|
68
|
+
/** Kernel requirements preserved for configuration checks. */
|
|
69
|
+
readonly requires?: LocalComponentRequires;
|
|
70
|
+
}
|
|
71
|
+
export interface LocalAttributeAuthoring {
|
|
72
|
+
readonly name: string;
|
|
73
|
+
readonly kind: LocalPropKind;
|
|
74
|
+
readonly required: boolean;
|
|
75
|
+
readonly static: boolean;
|
|
76
|
+
readonly dynamic: boolean;
|
|
77
|
+
readonly values?: readonly string[];
|
|
78
|
+
readonly defaultValue?: LocalValue;
|
|
79
|
+
readonly pattern?: string;
|
|
80
|
+
/** Localized authoring description, when the manifest declares one. */
|
|
81
|
+
readonly description?: string;
|
|
82
|
+
}
|
|
83
|
+
export interface LocalAuthoringLookup {
|
|
84
|
+
readonly tags: readonly LocalTagAuthoring[];
|
|
85
|
+
/** Look up a tag by its exact lowercase kebab-case name. */
|
|
86
|
+
tag(name: string): LocalTagAuthoring | undefined;
|
|
87
|
+
attribute(tag: string, attribute: string): LocalAttributeAuthoring | undefined;
|
|
88
|
+
}
|
|
89
|
+
export interface LocalComponentCatalogGroup {
|
|
90
|
+
readonly id: string;
|
|
91
|
+
readonly label: string;
|
|
92
|
+
readonly entries: readonly LocalComponentCatalogEntry[];
|
|
93
|
+
}
|
|
94
|
+
export interface LocalComponentCatalogFilter {
|
|
95
|
+
/** Case-insensitive search over name, title, description, category and keywords. */
|
|
96
|
+
readonly query?: string;
|
|
97
|
+
/** Ancestor component names from outermost to innermost. */
|
|
98
|
+
readonly ancestors?: readonly string[];
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Same parent-context rule for hosts that only hold frozen catalog entries
|
|
102
|
+
* (conformance reporting). Uses the entry's already-localized template.
|
|
103
|
+
*/
|
|
104
|
+
export declare function localCatalogParentContext(entry: LocalComponentCatalogEntry, entries: readonly LocalComponentCatalogEntry[]): {
|
|
105
|
+
before: string;
|
|
106
|
+
after: string;
|
|
107
|
+
} | undefined;
|
|
108
|
+
/**
|
|
109
|
+
* Stable signature of everything the authored catalog reads, including
|
|
110
|
+
* authoring copy that the compile-semantics key deliberately excludes.
|
|
111
|
+
*
|
|
112
|
+
* Editors memoize the catalog on this key: a metadata-only configuration change
|
|
113
|
+
* rebuilds the menu, while an equivalent options object is reused.
|
|
114
|
+
*/
|
|
115
|
+
export declare function localComponentCatalogKey(options?: LocalCompileOptions, locale?: EditorLocale): string;
|
|
116
|
+
/**
|
|
117
|
+
* Frozen insertion catalog for a configuration. Invalid configurations throw;
|
|
118
|
+
* this keeps `createLocalConfig`/registration errors visible to hosts that build
|
|
119
|
+
* the catalog eagerly.
|
|
120
|
+
*/
|
|
121
|
+
export declare function createLocalComponentCatalog(config: LocalConfig, locale?: EditorLocale): readonly LocalComponentCatalogEntry[];
|
|
122
|
+
/**
|
|
123
|
+
* Catalog without compiling external insertion templates.
|
|
124
|
+
*
|
|
125
|
+
* Conformance reporting needs every declared entry so it can report each bad
|
|
126
|
+
* template individually instead of aborting on the first error. This is not
|
|
127
|
+
* re-exported from the public authoring entry.
|
|
128
|
+
*/
|
|
129
|
+
export declare function createLocalComponentCatalogUnchecked(config: LocalConfig, locale?: EditorLocale): readonly LocalComponentCatalogEntry[];
|
|
130
|
+
/**
|
|
131
|
+
* Catalog for the same `LocalCompileOptions` the editor and compiler use.
|
|
132
|
+
* Invalid options produce an empty catalog so a malformed host option cannot
|
|
133
|
+
* break the editor shell; the compiler still reports the error normally.
|
|
134
|
+
*/
|
|
135
|
+
export declare function createLocalComponentCatalogForOptions(options?: LocalCompileOptions, locale?: EditorLocale): readonly LocalComponentCatalogEntry[];
|
|
136
|
+
/**
|
|
137
|
+
* Group catalog entries for a menu. Known default categories keep their
|
|
138
|
+
* authoring order; additional host categories appear in first-seen order.
|
|
139
|
+
*/
|
|
140
|
+
export declare function localComponentCatalogGroups(entries: readonly LocalComponentCatalogEntry[]): readonly LocalComponentCatalogGroup[];
|
|
141
|
+
/**
|
|
142
|
+
* Structural filter for a menu opened at a caret.
|
|
143
|
+
*
|
|
144
|
+
* - Components that declare `parents` only appear while one of those ancestors
|
|
145
|
+
* encloses the caret.
|
|
146
|
+
* - When the innermost catalog parent declares exclusive children, only those
|
|
147
|
+
* children remain available.
|
|
148
|
+
* - The optional query is matched against literal text fields; descriptions
|
|
149
|
+
* are never interpreted as HTML.
|
|
150
|
+
*/
|
|
151
|
+
export declare function filterLocalComponentCatalog(entries: readonly LocalComponentCatalogEntry[], filter?: LocalComponentCatalogFilter): readonly LocalComponentCatalogEntry[];
|
|
152
|
+
/** Plain-text help: component description followed by declared property help. */
|
|
153
|
+
export declare function localComponentHelp(entry: LocalComponentCatalogEntry): string;
|
|
154
|
+
/**
|
|
155
|
+
* Ancestor components at `offset`, outermost to innermost. Uses the same
|
|
156
|
+
* validated compile options as analysis and completion. Returns no ancestors
|
|
157
|
+
* in HTML mode or when options are invalid.
|
|
158
|
+
*/
|
|
159
|
+
export declare function localCatalogAncestors(source: string, offset: number, options?: LocalCompileOptions): readonly string[];
|
|
160
|
+
/**
|
|
161
|
+
* Tag, attribute and description lookup for an authoring host.
|
|
162
|
+
*
|
|
163
|
+
* Component shapes come from `readLocalCompileOptions`, so a `config` option
|
|
164
|
+
* sees exactly the components the compiler accepted. Default localized
|
|
165
|
+
* templates and keywords come from preset authoring data; external titles,
|
|
166
|
+
* descriptions, templates and property help come from the same manifests.
|
|
167
|
+
*/
|
|
168
|
+
export declare function createLocalAuthoringLookup(options?: LocalCompileOptions, locale?: EditorLocale): LocalAuthoringLookup;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { EditorLocale } from './command-types.js';
|
|
2
|
+
import type { LocalConfig } from '../sdk/types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Insertion-template conformance for external components.
|
|
5
|
+
*
|
|
6
|
+
* Authoring templates are not compiled at registration time: a host may
|
|
7
|
+
* declare a template before the component set (or its config) is final. This
|
|
8
|
+
* helper performs the deferred check against the *same* configuration that
|
|
9
|
+
* editing uses, so a catalog never offers a snippet that fails immediately.
|
|
10
|
+
*
|
|
11
|
+
* Static compiler imports are shared with catalog validation. The compiler
|
|
12
|
+
* does not import authoring, so this dependency has no initialization cycle.
|
|
13
|
+
*/
|
|
14
|
+
export interface LocalInsertTemplateIssue {
|
|
15
|
+
readonly id: string;
|
|
16
|
+
readonly name: string;
|
|
17
|
+
readonly message: string;
|
|
18
|
+
readonly diagnostics: readonly {
|
|
19
|
+
readonly code: string;
|
|
20
|
+
readonly message: string;
|
|
21
|
+
}[];
|
|
22
|
+
}
|
|
23
|
+
/** Compile every external catalog insertion template with `config`. */
|
|
24
|
+
export declare function validateLocalComponentInsertTemplates(config: LocalConfig, locale?: EditorLocale): readonly LocalInsertTemplateIssue[];
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Typed copy for the source editor: toolbar chrome
|
|
3
|
-
* native-component picker text.
|
|
2
|
+
* Typed copy for the source editor: toolbar chrome and command placeholders.
|
|
4
3
|
*
|
|
5
4
|
* English strings are the canonical defaults. Chinese strings use the wording
|
|
6
|
-
* shipped in the demo.
|
|
7
|
-
* templates
|
|
8
|
-
* overrides plus the group names for both languages.
|
|
5
|
+
* shipped in the demo. Default component labels, descriptions, groups and
|
|
6
|
+
* templates are authoring data owned by `src/presets/default-authoring.ts`.
|
|
9
7
|
*/
|
|
10
8
|
import type { EditorLocale } from './command-types.js';
|
|
11
9
|
export interface EditorCommandCopy {
|
|
@@ -73,24 +71,6 @@ export interface EditorToolbarCopy {
|
|
|
73
71
|
moreMenuLabel: string;
|
|
74
72
|
linkMenuItem: string;
|
|
75
73
|
}
|
|
76
|
-
export interface NativeComponentGroupCopy {
|
|
77
|
-
input: string;
|
|
78
|
-
action: string;
|
|
79
|
-
layout: string;
|
|
80
|
-
data: string;
|
|
81
|
-
hint: string;
|
|
82
|
-
}
|
|
83
|
-
export interface NativeComponentCopy {
|
|
84
|
-
label: string;
|
|
85
|
-
description: string;
|
|
86
|
-
keywords: readonly string[];
|
|
87
|
-
template: string;
|
|
88
|
-
}
|
|
89
|
-
export interface NativeComponentCatalogCopy {
|
|
90
|
-
groups: NativeComponentGroupCopy;
|
|
91
|
-
/** Per-component Chinese overrides keyed by the stable component id. */
|
|
92
|
-
components: Readonly<Record<string, NativeComponentCopy>>;
|
|
93
|
-
}
|
|
94
74
|
export interface EditorChromeCopy {
|
|
95
75
|
/** Accessible name for the textarea when the host passes no ariaLabel. */
|
|
96
76
|
sourceLabel: string;
|
|
@@ -106,4 +86,3 @@ export interface EditorChromeCopy {
|
|
|
106
86
|
export declare const EDITOR_CHROME_COPY: Record<EditorLocale, EditorChromeCopy>;
|
|
107
87
|
export declare const EDITOR_COMMAND_COPY: Record<EditorLocale, EditorCommandCopy>;
|
|
108
88
|
export declare const EDITOR_TOOLBAR_COPY: Record<EditorLocale, EditorToolbarCopy>;
|
|
109
|
-
export declare const NATIVE_COMPONENT_CATALOG_COPY: Record<EditorLocale, NativeComponentCatalogCopy>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public authoring services, split across focused modules.
|
|
3
|
+
*
|
|
4
|
+
* - `catalog.ts`: manifest-derived insertion catalog, grouping, help and
|
|
5
|
+
* structural context filters.
|
|
6
|
+
* - `insert.ts`: source insertion with fresh bindings and selection/caret
|
|
7
|
+
* tokens.
|
|
8
|
+
*
|
|
9
|
+
* This module keeps the historical import path stable.
|
|
10
|
+
*/
|
|
11
|
+
export { createLocalAuthoringLookup, createLocalComponentCatalog, createLocalComponentCatalogForOptions, filterLocalComponentCatalog, localCatalogAncestors, localComponentCatalogGroups, localComponentCatalogKey, localComponentHelp, } from './catalog.js';
|
|
12
|
+
export type { LocalAttributeAuthoring, LocalAuthoringLookup, LocalComponentCatalogEntry, LocalComponentCatalogFilter, LocalComponentCatalogGroup, LocalComponentCatalogProp, LocalTagAuthoring, } from './catalog.js';
|
|
13
|
+
export { insertLocalComponent, insertLocalComponentFromOptions, } from './insert.js';
|
|
@@ -11,14 +11,17 @@
|
|
|
11
11
|
* `LocalCompileOptions` used for rendering so analysis diagnostics, host
|
|
12
12
|
* components, limits and HTML mode stay consistent.
|
|
13
13
|
*/
|
|
14
|
-
export { analyzeLocalSource, completeLocalSource, formatLocalSource, renameLocalBinding, } from '../local/authoring.js';
|
|
15
|
-
export type { AuthorAnalysis, AuthorBinding, AuthorCompletion, AuthorCompletionKind, AuthorRename, AuthorToken, } from '../local/authoring.js';
|
|
16
|
-
export {
|
|
17
|
-
export
|
|
18
|
-
export type {
|
|
19
|
-
export {
|
|
20
|
-
export {
|
|
21
|
-
export type {
|
|
22
|
-
export {
|
|
23
|
-
export
|
|
24
|
-
export type {
|
|
14
|
+
export { analyzeLocalSource, completeLocalSource, formatLocalSource, renameLocalBinding, } from '../local/source/authoring.js';
|
|
15
|
+
export type { AuthorAnalysis, AuthorBinding, AuthorCompletion, AuthorCompletionKind, AuthorRename, AuthorToken, } from '../local/source/authoring.js';
|
|
16
|
+
export { createLocalAuthoringLookup, createLocalComponentCatalog, createLocalComponentCatalogForOptions, filterLocalComponentCatalog, insertLocalComponent, insertLocalComponentFromOptions, localCatalogAncestors, localComponentCatalogGroups, localComponentCatalogKey, localComponentHelp, } from './extensions.js';
|
|
17
|
+
export { validateLocalComponentInsertTemplates } from './conformance.js';
|
|
18
|
+
export type { LocalAttributeAuthoring, LocalAuthoringLookup, LocalComponentCatalogEntry, LocalComponentCatalogFilter, LocalComponentCatalogGroup, LocalComponentCatalogProp, LocalTagAuthoring, } from './extensions.js';
|
|
19
|
+
export type { LocalInsertTemplateIssue } from './conformance.js';
|
|
20
|
+
export { LOCAL_COMPONENT_NAMES, LOCAL_COMPONENTS, closestName, getLocalComponent, getPropDefault, localComponentNames, suggestAttribute, suggestComponent, } from '../local/configuration/schema.js';
|
|
21
|
+
export type { LocalBindingFamily, LocalBindingSchema, LocalBindingSlotSchema, LocalChildRule, LocalComponentForm, LocalComponentSchema, LocalInitialRule, LocalPropKind, LocalPropSchema, } from '../local/configuration/schema.js';
|
|
22
|
+
export type { Diagnostic, LocalCompileLimits, LocalCompileOptions, LocalHostComponentSchema, LocalHostPropKind, LocalHostPropSchema, LocalHtmlOptions, LocalHtmlPolicy, LocalValue, SourceRange, } from '../local/contracts/types.js';
|
|
23
|
+
export { EXTENDED_NATIVE_COMPONENT_COPY_ZH, EXTENDED_NATIVE_COMPONENTS, NATIVE_COMPONENT_GROUPS, NATIVE_COMPONENT_GROUPS_ZH, NATIVE_COMPONENTS, NATIVE_COMPONENTS_ZH, getNativeComponentCatalog, renderNativeSnippet, } from './native-components.js';
|
|
24
|
+
export type { NativeComponentCatalog, NativeComponentDefinition, NativeComponentGroup, NativeComponentGroupId, } from './native-components.js';
|
|
25
|
+
export { formatBold, formatHeading, formatInlineCode, formatItalic, formatOrderedList, formatQuote, formatStrike, formatTaskList, formatBulletList, indentSelection, insertCodeBlock, insertDivider, insertImage, insertLink, insertTable, insertTemplate, insertText, outdentSelection, readFormatState, } from './editor-commands.js';
|
|
26
|
+
export type { EditorEdit, EditorFormatState, EditorListType, EditorSelection, InsertTemplateOptions, } from './editor-commands.js';
|
|
27
|
+
export type { EditorLocale } from './command-types.js';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { EditorEdit, EditorLocale, EditorSelection } from './command-types.js';
|
|
2
|
+
import type { LocalCompileOptions } from '../local/contracts/types.js';
|
|
3
|
+
import type { LocalConfig } from '../sdk/types.js';
|
|
4
|
+
import { type LocalComponentCatalogEntry } from './catalog.js';
|
|
5
|
+
/** Insert one already-resolved catalog entry. */
|
|
6
|
+
export declare function insertCatalogEntryFromOptions(entry: LocalComponentCatalogEntry, options: LocalCompileOptions | undefined, source: string, selection: EditorSelection): EditorEdit;
|
|
7
|
+
/**
|
|
8
|
+
* Insert one component id from the compile-option catalog.
|
|
9
|
+
*
|
|
10
|
+
* The public catalog validates external templates before offering them, so a
|
|
11
|
+
* snippet taken from it inserts a document that compiles. Conformance uses
|
|
12
|
+
* `insertCatalogEntryFromOptions` with an unchecked catalog instead.
|
|
13
|
+
*/
|
|
14
|
+
export declare function insertLocalComponentFromOptions(options: LocalCompileOptions | undefined, componentId: string, source: string, selection: EditorSelection, locale?: EditorLocale): EditorEdit;
|
|
15
|
+
/** Compatibility wrapper for hosts that already hold a validated config. */
|
|
16
|
+
export declare function insertLocalComponent(config: LocalConfig, componentId: string, source: string, selection: EditorSelection, locale?: EditorLocale): EditorEdit;
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Compatibility catalog of default React-free editor components.
|
|
3
|
+
*
|
|
4
|
+
* The data no longer lives here: titles, descriptions, groups, keywords and
|
|
5
|
+
* templates are the default preset authoring data in
|
|
6
|
+
* `src/presets/default-authoring.ts`, and the same manifests are validated by
|
|
7
|
+
* the default preset. This module only projects that single source into the
|
|
8
|
+
* legacy `NATIVE_COMPONENTS` shape so existing editor and host code keeps
|
|
9
|
+
* working.
|
|
3
10
|
*
|
|
4
11
|
* Templates stay close to the documented authoring syntax:
|
|
5
12
|
* - `{{bind:base}}` is resolved by `renderNativeSnippet` to a fresh bind name.
|
|
@@ -8,8 +15,9 @@
|
|
|
8
15
|
* - Leaf components never receive a closing tag; container bodies use blank
|
|
9
16
|
* lines so inserted Markdown keeps a natural block layout.
|
|
10
17
|
*/
|
|
18
|
+
import { type DefaultAuthoringGroupId } from '../presets/default-authoring.js';
|
|
11
19
|
import type { EditorLocale } from './command-types.js';
|
|
12
|
-
export type NativeComponentGroupId =
|
|
20
|
+
export type NativeComponentGroupId = DefaultAuthoringGroupId;
|
|
13
21
|
export interface NativeComponentGroup {
|
|
14
22
|
id: NativeComponentGroupId;
|
|
15
23
|
label: string;
|
|
@@ -27,6 +35,15 @@ export declare const NATIVE_COMPONENT_GROUPS: readonly NativeComponentGroup[];
|
|
|
27
35
|
export declare const NATIVE_COMPONENTS: readonly NativeComponentDefinition[];
|
|
28
36
|
export declare const NATIVE_COMPONENT_GROUPS_ZH: readonly NativeComponentGroup[];
|
|
29
37
|
export declare const NATIVE_COMPONENTS_ZH: readonly NativeComponentDefinition[];
|
|
38
|
+
/** The legacy extended subset, derived from the same preset data. */
|
|
39
|
+
export declare const EXTENDED_NATIVE_COMPONENTS: readonly NativeComponentDefinition[];
|
|
40
|
+
/** Chinese copy for the legacy extended subset. */
|
|
41
|
+
export declare const EXTENDED_NATIVE_COMPONENT_COPY_ZH: Readonly<Record<string, {
|
|
42
|
+
readonly label: string;
|
|
43
|
+
readonly description: string;
|
|
44
|
+
readonly keywords: readonly string[];
|
|
45
|
+
readonly template: string;
|
|
46
|
+
}>>;
|
|
30
47
|
export interface NativeComponentCatalog {
|
|
31
48
|
groups: readonly NativeComponentGroup[];
|
|
32
49
|
components: readonly NativeComponentDefinition[];
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { LocalComponentDefinition } from '../sdk/types.js';
|
|
2
|
+
import type { LocalCompileOptions } from '../local/contracts/types.js';
|
|
3
|
+
import type { LocalPropKind } from '../local/configuration/schema.js';
|
|
4
|
+
/**
|
|
5
|
+
* Minimal legal insertion-template synthesis for manifests that do not supply
|
|
6
|
+
* `authoring.insertText`.
|
|
7
|
+
*
|
|
8
|
+
* A synthesized template is only offered when it compiles under the *same*
|
|
9
|
+
* configuration the editor uses. Otherwise the component must provide a
|
|
10
|
+
* template; the error names the component and includes the compiler
|
|
11
|
+
* diagnostics instead of inserting a document that fails immediately.
|
|
12
|
+
*/
|
|
13
|
+
export interface TemplateProp {
|
|
14
|
+
readonly kind: LocalPropKind;
|
|
15
|
+
readonly required: boolean;
|
|
16
|
+
readonly values?: readonly string[];
|
|
17
|
+
readonly defaultValue?: string | number | boolean | null;
|
|
18
|
+
readonly pattern?: string;
|
|
19
|
+
readonly min?: number;
|
|
20
|
+
readonly max?: number;
|
|
21
|
+
readonly integer: boolean;
|
|
22
|
+
readonly color: boolean;
|
|
23
|
+
}
|
|
24
|
+
export declare function templateProps(definition: LocalComponentDefinition): Record<string, TemplateProp>;
|
|
25
|
+
/**
|
|
26
|
+
* Build a document-independent, directly compilable template. Binding names
|
|
27
|
+
* are literals so repeated insertion can retarget them without parsing tokens.
|
|
28
|
+
*/
|
|
29
|
+
export declare function synthesizeInsertText(definition: LocalComponentDefinition, props: Readonly<Record<string, TemplateProp>>): string;
|
|
30
|
+
/**
|
|
31
|
+
* Resolve toolbar-owned snippet tokens exactly as insertion does for an empty
|
|
32
|
+
* document and a collapsed caret: `{{bind:base}}` becomes a fresh literal
|
|
33
|
+
* binding, `{{selection}}` becomes empty, `{{selection:fallback}}` becomes the
|
|
34
|
+
* fallback text, `{{caret}}` is dropped and `{{select:value}}` keeps its value.
|
|
35
|
+
*
|
|
36
|
+
* `source` mirrors the document the snippet will be inserted into so validation
|
|
37
|
+
* can avoid reusing a binding name already present in a parent wrapper.
|
|
38
|
+
*/
|
|
39
|
+
export declare function expandInsertTemplate(template: string, source?: string): string;
|
|
40
|
+
/**
|
|
41
|
+
* Place a child insertion inside an expanded container template just before its
|
|
42
|
+
* closing tag. Returns `undefined` when the template has no such closing tag.
|
|
43
|
+
*/
|
|
44
|
+
export declare function parentInsertionWrapper(parentName: string, parentTemplate: string): {
|
|
45
|
+
before: string;
|
|
46
|
+
after: string;
|
|
47
|
+
} | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* Compile a supplied `authoring.insertText` after resolving snippet tokens.
|
|
50
|
+
* `before`/`after` place the snippet in a legal structural parent context for
|
|
51
|
+
* components that may only appear inside a container.
|
|
52
|
+
*/
|
|
53
|
+
export declare function assertSuppliedTemplateCompiles(template: string, options: LocalCompileOptions | undefined, label: string, context?: {
|
|
54
|
+
readonly before: string;
|
|
55
|
+
readonly after: string;
|
|
56
|
+
}): void;
|
|
57
|
+
/**
|
|
58
|
+
* Compile a synthesized template with the editor configuration. The error is
|
|
59
|
+
* deliberately concrete: it names the component and includes diagnostic codes
|
|
60
|
+
* and messages.
|
|
61
|
+
*/
|
|
62
|
+
export declare function assertTemplateCompiles(template: string, options: LocalCompileOptions | undefined, label: string, context?: {
|
|
63
|
+
readonly before: string;
|
|
64
|
+
readonly after: string;
|
|
65
|
+
}): void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Diagnostic } from '../local/contracts/types.js';
|
|
2
|
+
/** Build-side diagnostics use the same shape as compile and export diagnostics. */
|
|
3
|
+
export declare function buildDiagnostic(code: string, message: string): Diagnostic;
|
|
4
|
+
/** Thrown by the Node build adapter; carries every preflight/build diagnostic. */
|
|
5
|
+
export declare class LocalBuildError extends Error {
|
|
6
|
+
readonly diagnostics: readonly Diagnostic[];
|
|
7
|
+
constructor(message: string, diagnostics?: readonly Diagnostic[]);
|
|
8
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Byte length of one UTF-8 string; build budgets are byte based. */
|
|
2
|
+
export declare function utf8ByteLength(text: string): number;
|
|
3
|
+
/** Stable content digest for build artifacts. */
|
|
4
|
+
export declare function sha256(text: string): string;
|
|
5
|
+
export declare function sha256Bytes(bytes: Uint8Array): string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const VIRTUAL_HOST_ENTRY = "virtual:reactive-md-host-entry";
|
|
2
|
+
export declare const VIRTUAL_HOST_MODULE = "virtual:reactive-md-host-module";
|
|
3
|
+
/**
|
|
4
|
+
* Generate the Vite entry. It imports the host module for the prepared React
|
|
5
|
+
* implementations and uses only the public standalone mount API. The config key
|
|
6
|
+
* baked into the bundle is checked again at runtime so a host cannot mount the
|
|
7
|
+
* bundle after changing its extension configuration.
|
|
8
|
+
*/
|
|
9
|
+
export declare function createLocalStandaloneEntrySource(configKey: string): string;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Diagnostic } from '../local/contracts/types.js';
|
|
2
|
+
import type { LocalReactConfig } from '../react/sdk.js';
|
|
3
|
+
import type { LocalConfig } from '../sdk/types.js';
|
|
4
|
+
import type { LocalBuildNoticeInput } from './notices.js';
|
|
5
|
+
import { type LocalStyleResourceInput } from './resources.js';
|
|
6
|
+
/** Options accepted by the Node host reader. Root and allowlist come from the host module. */
|
|
7
|
+
export interface LocalBuildHostOptions {
|
|
8
|
+
readonly entry: string | URL;
|
|
9
|
+
readonly resources?: readonly LocalStyleResourceInput[];
|
|
10
|
+
readonly notices?: readonly LocalBuildNoticeInput[] | string;
|
|
11
|
+
}
|
|
12
|
+
export interface LocalBuildHost {
|
|
13
|
+
/** Real path of the Node-loadable host entry module. */
|
|
14
|
+
readonly entry: string;
|
|
15
|
+
/** Real path of the declared resource root. */
|
|
16
|
+
readonly root: string;
|
|
17
|
+
/** Real paths of directories the builder may read resources from. */
|
|
18
|
+
readonly allowlist: readonly string[];
|
|
19
|
+
readonly config: LocalConfig;
|
|
20
|
+
readonly reactConfig: LocalReactConfig;
|
|
21
|
+
readonly declared: readonly LocalStyleResourceInput[];
|
|
22
|
+
readonly notices: readonly unknown[];
|
|
23
|
+
}
|
|
24
|
+
export interface LocalBuildHostResult {
|
|
25
|
+
readonly diagnostics: readonly Diagnostic[];
|
|
26
|
+
readonly host?: LocalBuildHost;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Load the explicit host module, validate its LocalConfig and prepared React
|
|
30
|
+
* config, and resolve its resource root/allowlist before collection.
|
|
31
|
+
*
|
|
32
|
+
* The entry must be Node-loadable JavaScript (`.mjs`, or `.js` in a module
|
|
33
|
+
* package). The same file is the Vite build entry, so implementations are
|
|
34
|
+
* imported explicitly and never reconstructed from `function.toString()`.
|
|
35
|
+
*/
|
|
36
|
+
export declare function readLocalBuildHost(options: LocalBuildHostOptions): Promise<LocalBuildHostResult>;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import type { Diagnostic } from '../local/contracts/types.js';
|
|
2
|
+
import { type LocalStandaloneBundle } from '../export/index.js';
|
|
3
|
+
import type { LocalComponentRequirement, LocalConfig } from '../sdk/types.js';
|
|
4
|
+
import { LOCAL_SDK_VERSION } from '../sdk/version.js';
|
|
5
|
+
import { type LocalAssemblyIdentity } from '../sdk/assembly.js';
|
|
6
|
+
import { type LocalBuildHostOptions } from './host.js';
|
|
7
|
+
import { type LocalBuildNotice, type LocalBuildNotices } from './notices.js';
|
|
8
|
+
import { type LocalBuildAsset, type LocalBuildBudgets, type LocalBuildResource } from './resources.js';
|
|
9
|
+
import { type LocalViteSource } from './vite.js';
|
|
10
|
+
export { LocalBuildError } from './diagnostics.js';
|
|
11
|
+
export { createLocalStandaloneEntrySource, VIRTUAL_HOST_ENTRY, VIRTUAL_HOST_MODULE } from './entry.js';
|
|
12
|
+
export { readLocalBuildHost } from './host.js';
|
|
13
|
+
export type { LocalBuildHost, LocalBuildHostOptions, LocalBuildHostResult } from './host.js';
|
|
14
|
+
export { collectLocalBuildNotices } from './notices.js';
|
|
15
|
+
export type { LocalBuildNotice, LocalBuildNoticeInput, LocalBuildNotices } from './notices.js';
|
|
16
|
+
export { collectLocalBuildResources, DEFAULT_LOCAL_BUILD_BUDGETS, readLocalBuildBudgets, readLocalStyleResourceInputs, } from './resources.js';
|
|
17
|
+
export type { CollectedLocalResources, LocalBuildAsset, LocalBuildBudgets, LocalBuildResource, LocalResourceOrigin, LocalStyleResourceInput, ResourceCollectionInput, } from './resources.js';
|
|
18
|
+
export { resolveLocalVite } from './vite.js';
|
|
19
|
+
export type { LocalViteApi, LocalViteSource } from './vite.js';
|
|
20
|
+
/** Version of the build manifest, independent from SDK and document revisions. */
|
|
21
|
+
export declare const LOCAL_BUILD_PROTOCOL: 'reactive-md-build/v1';
|
|
22
|
+
export interface LocalStandaloneBuildOptions extends LocalBuildHostOptions {
|
|
23
|
+
/** Theme names to collect; defaults to every installed theme. */
|
|
24
|
+
readonly themes?: readonly string[];
|
|
25
|
+
readonly budgets?: Partial<LocalBuildBudgets>;
|
|
26
|
+
/** Optional Vite peer facade; useful for tests and nonstandard hosts. */
|
|
27
|
+
readonly vite?: LocalViteSource;
|
|
28
|
+
}
|
|
29
|
+
export interface LocalBuildPreflight {
|
|
30
|
+
readonly ok: boolean;
|
|
31
|
+
readonly diagnostics: readonly Diagnostic[];
|
|
32
|
+
readonly entry: string;
|
|
33
|
+
readonly root: string;
|
|
34
|
+
readonly allowlist: readonly string[];
|
|
35
|
+
readonly config?: LocalConfig;
|
|
36
|
+
readonly configKey?: string;
|
|
37
|
+
readonly resources: readonly LocalBuildResource[];
|
|
38
|
+
readonly assets: readonly LocalBuildAsset[];
|
|
39
|
+
readonly css: string;
|
|
40
|
+
readonly notices: LocalBuildNotices;
|
|
41
|
+
}
|
|
42
|
+
export interface LocalStandaloneBuildManifest {
|
|
43
|
+
readonly protocol: typeof LOCAL_BUILD_PROTOCOL;
|
|
44
|
+
readonly sdkVersion: typeof LOCAL_SDK_VERSION;
|
|
45
|
+
readonly configKey: string;
|
|
46
|
+
/** Assembly identity; includes presets, registry and replacement edges. */
|
|
47
|
+
readonly assembly: LocalAssemblyIdentity;
|
|
48
|
+
/** Digest over `assembly`; independent from the script digest. */
|
|
49
|
+
readonly seal: string;
|
|
50
|
+
readonly format: 'iife';
|
|
51
|
+
readonly script: {
|
|
52
|
+
readonly digest: string;
|
|
53
|
+
readonly bytes: number;
|
|
54
|
+
};
|
|
55
|
+
readonly resources: readonly {
|
|
56
|
+
readonly id: string;
|
|
57
|
+
readonly origin: LocalBuildResource['origin'];
|
|
58
|
+
readonly digest: string;
|
|
59
|
+
readonly bytes: number;
|
|
60
|
+
}[];
|
|
61
|
+
readonly inlinedAssets: readonly LocalBuildAsset[];
|
|
62
|
+
readonly components: readonly LocalComponentRequirement[];
|
|
63
|
+
/** Every theme carried by the installed config, whether selected or not. */
|
|
64
|
+
readonly themes: readonly {
|
|
65
|
+
readonly id: string;
|
|
66
|
+
readonly name: string;
|
|
67
|
+
readonly version: string;
|
|
68
|
+
readonly digest: string;
|
|
69
|
+
}[];
|
|
70
|
+
readonly notices: {
|
|
71
|
+
readonly digest: string;
|
|
72
|
+
readonly entries: readonly Omit<LocalBuildNotice, 'text'>[];
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
/** A compatible LocalStandaloneBundle plus the resources an exporter needs. */
|
|
76
|
+
export interface LocalStandaloneBuild extends LocalStandaloneBundle {
|
|
77
|
+
readonly configKey: string;
|
|
78
|
+
readonly resources: readonly LocalBuildResource[];
|
|
79
|
+
readonly assets: readonly LocalBuildAsset[];
|
|
80
|
+
readonly css: string;
|
|
81
|
+
readonly notices: string;
|
|
82
|
+
readonly manifest: LocalStandaloneBuildManifest;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Build the structured plan first: validate the host module, the LocalConfig
|
|
86
|
+
* key, React implementations, capabilities and every CSS/resource reference.
|
|
87
|
+
* No Vite build or script output happens here.
|
|
88
|
+
*/
|
|
89
|
+
export declare function preflightLocalStandaloneBuild(options: LocalStandaloneBuildOptions): Promise<LocalBuildPreflight>;
|
|
90
|
+
/**
|
|
91
|
+
* Build one inline self-contained standalone script plus the deterministic
|
|
92
|
+
* resource, notice and manifest data an offline exporter needs.
|
|
93
|
+
*
|
|
94
|
+
* The optional Vite peer is loaded dynamically, so consumers that only read
|
|
95
|
+
* manifests or preflight do not install Vite. The returned object is
|
|
96
|
+
* structurally compatible with `LocalStandaloneBundle` for the existing
|
|
97
|
+
* exporter and standalone restoration path.
|
|
98
|
+
*/
|
|
99
|
+
export declare function buildLocalStandaloneBundle(options: LocalStandaloneBuildOptions): Promise<LocalStandaloneBuild>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Diagnostic } from '../local/contracts/types.js';
|
|
2
|
+
/** One explicit host notice or license record attached by the package author. */
|
|
3
|
+
export interface LocalBuildNoticeInput {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
readonly name?: string;
|
|
6
|
+
readonly version?: string;
|
|
7
|
+
readonly license?: string;
|
|
8
|
+
readonly url?: string;
|
|
9
|
+
readonly text?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface LocalBuildNotice {
|
|
12
|
+
readonly id: string;
|
|
13
|
+
readonly name?: string;
|
|
14
|
+
readonly version?: string;
|
|
15
|
+
readonly license?: string;
|
|
16
|
+
readonly url?: string;
|
|
17
|
+
readonly text?: string;
|
|
18
|
+
readonly digest: string;
|
|
19
|
+
}
|
|
20
|
+
export interface LocalBuildNotices {
|
|
21
|
+
readonly text: string;
|
|
22
|
+
readonly digest: string;
|
|
23
|
+
readonly entries: readonly LocalBuildNotice[];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Merge explicit notice sources deterministically. Duplicate identities
|
|
27
|
+
* deduplicate; the same id with different contents is a conflict.
|
|
28
|
+
*/
|
|
29
|
+
export declare function collectLocalBuildNotices(sources: readonly unknown[], diagnostics: Diagnostic[]): LocalBuildNotices;
|