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,213 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"jump",
|
|
12
|
-
"anchor",
|
|
13
|
-
"navigation"
|
|
14
|
-
],
|
|
15
|
-
template: "<jump to=\"{{bind:destination}}\" appearance=\"button\" color=\"#2563eb\">View results</jump>\n\n<anchor id=\"{{bind:destination}}\">\n\n{{selection:Results appear here.}}"
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
id: "anchor",
|
|
19
|
-
label: "Anchor",
|
|
20
|
-
description: "Name a destination for document links.",
|
|
21
|
-
group: "layout",
|
|
22
|
-
keywords: [
|
|
23
|
-
"anchor",
|
|
24
|
-
"target",
|
|
25
|
-
"destination"
|
|
26
|
-
],
|
|
27
|
-
template: "<anchor id=\"{{bind:destination}}\">"
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
id: "text",
|
|
31
|
-
label: "Colored text",
|
|
32
|
-
description: "Give selected words a foreground color.",
|
|
33
|
-
group: "hint",
|
|
34
|
-
keywords: [
|
|
35
|
-
"text",
|
|
36
|
-
"color",
|
|
37
|
-
"foreground"
|
|
38
|
-
],
|
|
39
|
-
inline: !0,
|
|
40
|
-
template: "<text color=\"#a2273a\">{{selection:Important reminder}}</text>"
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
id: "section",
|
|
44
|
-
label: "Colored section",
|
|
45
|
-
description: "Apply a shared text color to several paragraphs.",
|
|
46
|
-
group: "layout",
|
|
47
|
-
keywords: [
|
|
48
|
-
"section",
|
|
49
|
-
"color",
|
|
50
|
-
"paragraph"
|
|
51
|
-
],
|
|
52
|
-
template: "<section color=\"#45536f\">\n\n{{selection:Your paragraphs go here.}}\n\n</section>"
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
id: "multi-select",
|
|
56
|
-
label: "Multiple selection",
|
|
57
|
-
description: "Choose up to two items and read their values.",
|
|
58
|
-
group: "input",
|
|
59
|
-
keywords: [
|
|
60
|
-
"multiple",
|
|
61
|
-
"select",
|
|
62
|
-
"subjects",
|
|
63
|
-
"checkbox"
|
|
64
|
-
],
|
|
65
|
-
template: "<multi-select bind=\"{{bind:subjects}}\" label=\"Subjects\" max-selected=\"2\">\n<option value=\"math\">Math</option>\n<option value=\"physics\">Physics</option>\n<option value=\"chemistry\">Chemistry</option>\n</multi-select>"
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
id: "range-slider",
|
|
69
|
-
label: "Interval slider",
|
|
70
|
-
description: "Choose the lower and upper bounds of an interval.",
|
|
71
|
-
group: "input",
|
|
72
|
-
keywords: [
|
|
73
|
-
"range",
|
|
74
|
-
"interval",
|
|
75
|
-
"slider",
|
|
76
|
-
"bounds"
|
|
77
|
-
],
|
|
78
|
-
template: "<range-slider label=\"Interval\" bind-start=\"{{bind:low}}\" bind-end=\"{{bind:high}}\" initial-start=\"20\" initial-end=\"80\" min=\"0\" max=\"100\" step=\"1\">"
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
id: "coordinate",
|
|
82
|
-
label: "Coordinate point",
|
|
83
|
-
description: "Drag a point or change its two coordinates.",
|
|
84
|
-
group: "input",
|
|
85
|
-
keywords: [
|
|
86
|
-
"coordinate",
|
|
87
|
-
"point",
|
|
88
|
-
"drag",
|
|
89
|
-
"geometry"
|
|
90
|
-
],
|
|
91
|
-
template: "<coordinate label=\"Point\" bind-x=\"{{bind:px}}\" bind-y=\"{{bind:py}}\" initial-x=\"1\" initial-y=\"2\" x-min=\"-5\" x-max=\"5\" y-min=\"-5\" y-max=\"5\">"
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
id: "quiz",
|
|
95
|
-
label: "Practice question",
|
|
96
|
-
description: "Check an answer and read a short explanation.",
|
|
97
|
-
group: "action",
|
|
98
|
-
keywords: [
|
|
99
|
-
"quiz",
|
|
100
|
-
"practice",
|
|
101
|
-
"answer",
|
|
102
|
-
"learn"
|
|
103
|
-
],
|
|
104
|
-
template: "<quiz type=\"choice\" label=\"What is 2 + 3?\" answer=\"b\" explanation=\"The sum is 5.\">\n<option value=\"a\">4</option>\n<option value=\"b\">5</option>\n</quiz>"
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
id: "steps",
|
|
108
|
-
label: "Guided steps",
|
|
109
|
-
description: "Read instructions one step at a time.",
|
|
110
|
-
group: "layout",
|
|
111
|
-
keywords: [
|
|
112
|
-
"steps",
|
|
113
|
-
"guide",
|
|
114
|
-
"previous",
|
|
115
|
-
"next"
|
|
116
|
-
],
|
|
117
|
-
template: "<steps label=\"Learning path\" bind=\"{{bind:lesson}}\">\n<step label=\"Observe\">\nChange a parameter.\n</step>\n<step label=\"Practice\">\nCheck an answer.\n</step>\n</steps>"
|
|
118
|
-
}
|
|
119
|
-
], p = {
|
|
120
|
-
jump: {
|
|
121
|
-
label: "跳转与锚点",
|
|
122
|
-
description: "跳到当前文档中的指定位置。",
|
|
123
|
-
keywords: [
|
|
124
|
-
"跳转",
|
|
125
|
-
"锚点",
|
|
126
|
-
"导航"
|
|
127
|
-
],
|
|
128
|
-
template: "<jump to=\"{{bind:destination}}\" appearance=\"button\" color=\"#2563eb\">查看结果</jump>\n\n<anchor id=\"{{bind:destination}}\">\n\n{{selection:结果显示在这里。}}"
|
|
129
|
-
},
|
|
130
|
-
anchor: {
|
|
131
|
-
label: "锚点",
|
|
132
|
-
description: "为文档内的跳转指定目标位置。",
|
|
133
|
-
keywords: [
|
|
134
|
-
"锚点",
|
|
135
|
-
"目标",
|
|
136
|
-
"位置"
|
|
137
|
-
],
|
|
138
|
-
template: "<anchor id=\"{{bind:destination}}\">"
|
|
139
|
-
},
|
|
140
|
-
text: {
|
|
141
|
-
label: "文字颜色",
|
|
142
|
-
description: "为选中的局部文字指定颜色。",
|
|
143
|
-
keywords: [
|
|
144
|
-
"文字",
|
|
145
|
-
"颜色",
|
|
146
|
-
"前景"
|
|
147
|
-
],
|
|
148
|
-
template: "<text color=\"#a2273a\">{{selection:重要提醒}}</text>"
|
|
149
|
-
},
|
|
150
|
-
section: {
|
|
151
|
-
label: "正文颜色",
|
|
152
|
-
description: "为一段或多段正文指定统一颜色。",
|
|
153
|
-
keywords: [
|
|
154
|
-
"正文",
|
|
155
|
-
"段落",
|
|
156
|
-
"颜色"
|
|
157
|
-
],
|
|
158
|
-
template: "<section color=\"#45536f\">\n\n{{selection:在这里填写正文。}}\n\n</section>"
|
|
159
|
-
},
|
|
160
|
-
"multi-select": {
|
|
161
|
-
label: "多选",
|
|
162
|
-
description: "最多选择两个选项,公开选项值数组。",
|
|
163
|
-
keywords: [
|
|
164
|
-
"多选",
|
|
165
|
-
"选项",
|
|
166
|
-
"主题"
|
|
167
|
-
],
|
|
168
|
-
template: "<multi-select bind=\"{{bind:subjects}}\" label=\"主题\" max-selected=\"2\">\n<option value=\"math\">数学</option>\n<option value=\"physics\">物理</option>\n<option value=\"chemistry\">化学</option>\n</multi-select>"
|
|
169
|
-
},
|
|
170
|
-
"range-slider": {
|
|
171
|
-
label: "区间滑块",
|
|
172
|
-
description: "同时选择区间的起点和终点。",
|
|
173
|
-
keywords: [
|
|
174
|
-
"区间",
|
|
175
|
-
"滑块",
|
|
176
|
-
"上下限"
|
|
177
|
-
],
|
|
178
|
-
template: "<range-slider label=\"观察区间\" bind-start=\"{{bind:low}}\" bind-end=\"{{bind:high}}\" initial-start=\"20\" initial-end=\"80\" min=\"0\" max=\"100\" step=\"1\">"
|
|
179
|
-
},
|
|
180
|
-
coordinate: {
|
|
181
|
-
label: "二维坐标",
|
|
182
|
-
description: "拖动坐标点,或直接修改两个坐标。",
|
|
183
|
-
keywords: [
|
|
184
|
-
"坐标",
|
|
185
|
-
"拖动",
|
|
186
|
-
"几何"
|
|
187
|
-
],
|
|
188
|
-
template: "<coordinate label=\"坐标点\" bind-x=\"{{bind:px}}\" bind-y=\"{{bind:py}}\" initial-x=\"1\" initial-y=\"2\" x-min=\"-5\" x-max=\"5\" y-min=\"-5\" y-max=\"5\">"
|
|
189
|
-
},
|
|
190
|
-
quiz: {
|
|
191
|
-
label: "练习题",
|
|
192
|
-
description: "检查答案并阅读简短解析。",
|
|
193
|
-
keywords: [
|
|
194
|
-
"练习",
|
|
195
|
-
"题目",
|
|
196
|
-
"答案"
|
|
197
|
-
],
|
|
198
|
-
template: "<quiz type=\"choice\" label=\"2 + 3 等于多少?\" answer=\"b\" explanation=\"相加得到 5。\">\n<option value=\"a\">4</option>\n<option value=\"b\">5</option>\n</quiz>"
|
|
199
|
-
},
|
|
200
|
-
steps: {
|
|
201
|
-
label: "分步阅读",
|
|
202
|
-
description: "按顺序阅读说明,内置上一步和下一步。",
|
|
203
|
-
keywords: [
|
|
204
|
-
"步骤",
|
|
205
|
-
"引导",
|
|
206
|
-
"下一步"
|
|
207
|
-
],
|
|
208
|
-
template: "<steps label=\"学习路线\" bind=\"{{bind:lesson}}\">\n<step label=\"观察\">\n调整参数。\n</step>\n<step label=\"练习\">\n检查答案。\n</step>\n</steps>"
|
|
209
|
-
}
|
|
210
|
-
}, m = {
|
|
1
|
+
import { w as e, y as t } from "./config-validation-DXTynAw7.js";
|
|
2
|
+
import { $ as n } from "./validation-W-bmny-x.js";
|
|
3
|
+
import { a as r, c as i, i as a, l as o, o as s, r as c, s as l, u } from "./default-components-Z_YMio5P.js";
|
|
4
|
+
import { u as d } from "./registry-B9Jc3FVe.js";
|
|
5
|
+
import { n as f, t as p } from "./options-CX5m5n-J.js";
|
|
6
|
+
import { t as m } from "./compiler--ea2CKQF.js";
|
|
7
|
+
import { a as h, c as ee, i as g, n as _, o as v, r as y, s as b, t as te } from "./schema-ZFufO8V0.js";
|
|
8
|
+
import { i as x, n as ne, r as re, t as ie } from "./authoring-BsfSwQRm.js";
|
|
9
|
+
// src/authoring/editor-i18n.ts
|
|
10
|
+
var ae = {
|
|
211
11
|
en: {
|
|
212
12
|
boldPlaceholder: "bold text",
|
|
213
13
|
italicPlaceholder: "italic text",
|
|
@@ -254,758 +54,13 @@ var f = [
|
|
|
254
54
|
"示例 6"
|
|
255
55
|
]]
|
|
256
56
|
}
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
input: "Input controls",
|
|
261
|
-
action: "Interactive tools",
|
|
262
|
-
layout: "Content layout",
|
|
263
|
-
data: "Data visualization",
|
|
264
|
-
hint: "Feedback"
|
|
265
|
-
},
|
|
266
|
-
components: {}
|
|
267
|
-
},
|
|
268
|
-
zh: {
|
|
269
|
-
groups: {
|
|
270
|
-
input: "输入控件",
|
|
271
|
-
action: "交互工具",
|
|
272
|
-
layout: "内容组织",
|
|
273
|
-
data: "数据可视化",
|
|
274
|
-
hint: "提示反馈"
|
|
275
|
-
},
|
|
276
|
-
components: {
|
|
277
|
-
...p,
|
|
278
|
-
slider: {
|
|
279
|
-
label: "滑块",
|
|
280
|
-
description: "拖动滑块在指定范围内选择一个数值。",
|
|
281
|
-
keywords: [
|
|
282
|
-
"滑块",
|
|
283
|
-
"范围",
|
|
284
|
-
"数值",
|
|
285
|
-
"拖动",
|
|
286
|
-
"滑动"
|
|
287
|
-
],
|
|
288
|
-
template: "<slider bind=\"{{bind:amount}}\" label=\"数量\" initial=\"10\" min=\"0\" max=\"100\" step=\"1\">"
|
|
289
|
-
},
|
|
290
|
-
number: {
|
|
291
|
-
label: "数字输入",
|
|
292
|
-
description: "输入精确数字,可限制范围和步长。",
|
|
293
|
-
keywords: [
|
|
294
|
-
"数字",
|
|
295
|
-
"数值",
|
|
296
|
-
"输入",
|
|
297
|
-
"步长",
|
|
298
|
-
"数量"
|
|
299
|
-
],
|
|
300
|
-
template: "<number bind=\"{{bind:quantity}}\" label=\"数量\" initial=\"1\" min=\"0\" max=\"100\" step=\"1\">"
|
|
301
|
-
},
|
|
302
|
-
input: {
|
|
303
|
-
label: "单行文本",
|
|
304
|
-
description: "输入姓名、标题等单行文本。",
|
|
305
|
-
keywords: [
|
|
306
|
-
"文本",
|
|
307
|
-
"单行",
|
|
308
|
-
"输入框",
|
|
309
|
-
"名称",
|
|
310
|
-
"输入"
|
|
311
|
-
],
|
|
312
|
-
template: "<input bind=\"{{bind:name}}\" label=\"名称\" placeholder=\"请输入名称\">"
|
|
313
|
-
},
|
|
314
|
-
textarea: {
|
|
315
|
-
label: "多行文本",
|
|
316
|
-
description: "输入说明、备注等多行文字。",
|
|
317
|
-
keywords: [
|
|
318
|
-
"文本域",
|
|
319
|
-
"多行",
|
|
320
|
-
"说明",
|
|
321
|
-
"备注",
|
|
322
|
-
"详细"
|
|
323
|
-
],
|
|
324
|
-
template: "<textarea bind=\"{{bind:message}}\" label=\"详细说明\" placeholder=\"请输入详细说明\" rows=\"4\">"
|
|
325
|
-
},
|
|
326
|
-
toggle: {
|
|
327
|
-
label: "开关",
|
|
328
|
-
description: "在开启与关闭之间切换一个布尔选项。",
|
|
329
|
-
keywords: [
|
|
330
|
-
"开关",
|
|
331
|
-
"布尔",
|
|
332
|
-
"启用",
|
|
333
|
-
"切换",
|
|
334
|
-
"选项"
|
|
335
|
-
],
|
|
336
|
-
template: "<toggle bind=\"{{bind:enabled}}\" label=\"启用选项\">"
|
|
337
|
-
},
|
|
338
|
-
checkbox: {
|
|
339
|
-
label: "复选框",
|
|
340
|
-
description: "勾选或取消一个布尔选项。",
|
|
341
|
-
keywords: [
|
|
342
|
-
"复选",
|
|
343
|
-
"勾选",
|
|
344
|
-
"布尔",
|
|
345
|
-
"确认",
|
|
346
|
-
"选项"
|
|
347
|
-
],
|
|
348
|
-
template: "<checkbox bind=\"{{bind:confirmed}}\" label=\"确认选项\">"
|
|
349
|
-
},
|
|
350
|
-
date: {
|
|
351
|
-
label: "日期选择",
|
|
352
|
-
description: "选择一个日期,未选择时为空字符串。",
|
|
353
|
-
keywords: [
|
|
354
|
-
"日期",
|
|
355
|
-
"日历",
|
|
356
|
-
"时间",
|
|
357
|
-
"选择"
|
|
358
|
-
],
|
|
359
|
-
template: "<date bind=\"{{bind:date}}\" label=\"选择日期\">"
|
|
360
|
-
},
|
|
361
|
-
choices: {
|
|
362
|
-
label: "选项卡片",
|
|
363
|
-
description: "从多个选项卡中选择一项。",
|
|
364
|
-
keywords: [
|
|
365
|
-
"选项",
|
|
366
|
-
"选择",
|
|
367
|
-
"卡片",
|
|
368
|
-
"单选",
|
|
369
|
-
"方案"
|
|
370
|
-
],
|
|
371
|
-
template: "<choices bind=\"{{bind:plan}}\" label=\"选择方案\">\n<option value=\"basic\">基础版</option>\n<option value=\"pro\">专业版</option>\n</choices>"
|
|
372
|
-
},
|
|
373
|
-
counter: {
|
|
374
|
-
label: "计数器",
|
|
375
|
-
description: "通过加减按钮调整整数,并可一键重置。",
|
|
376
|
-
keywords: [
|
|
377
|
-
"计数",
|
|
378
|
-
"加减",
|
|
379
|
-
"整数",
|
|
380
|
-
"调整",
|
|
381
|
-
"重置"
|
|
382
|
-
],
|
|
383
|
-
template: "<counter bind=\"{{bind:count}}\" label=\"计数\" initial=\"0\" min=\"0\" max=\"99\">"
|
|
384
|
-
},
|
|
385
|
-
timer: {
|
|
386
|
-
label: "倒计时",
|
|
387
|
-
description: "启动、暂停和重置一段专注计时。",
|
|
388
|
-
keywords: [
|
|
389
|
-
"计时",
|
|
390
|
-
"倒计时",
|
|
391
|
-
"专注",
|
|
392
|
-
"秒",
|
|
393
|
-
"暂停"
|
|
394
|
-
],
|
|
395
|
-
template: "<timer bind=\"{{bind:remaining}}\" label=\"专注计时\" duration=\"60\">"
|
|
396
|
-
},
|
|
397
|
-
checklist: {
|
|
398
|
-
label: "任务清单",
|
|
399
|
-
description: "用可勾选的任务列表记录完成情况。",
|
|
400
|
-
keywords: [
|
|
401
|
-
"清单",
|
|
402
|
-
"任务",
|
|
403
|
-
"勾选",
|
|
404
|
-
"待办",
|
|
405
|
-
"完成"
|
|
406
|
-
],
|
|
407
|
-
template: "<checklist bind=\"{{bind:done}}\" label=\"完成清单\">\n- [ ] 第一项任务\n- [ ] 第二项任务\n- [ ] 第三项任务\n</checklist>"
|
|
408
|
-
},
|
|
409
|
-
progress: {
|
|
410
|
-
label: "进度条",
|
|
411
|
-
description: "展示 0 到 100 之间的完成进度。",
|
|
412
|
-
keywords: [
|
|
413
|
-
"进度",
|
|
414
|
-
"完成度",
|
|
415
|
-
"进度条",
|
|
416
|
-
"百分比"
|
|
417
|
-
],
|
|
418
|
-
template: "<progress label=\"完成进度\" value=\"{{ 40 }}\">"
|
|
419
|
-
},
|
|
420
|
-
panel: {
|
|
421
|
-
label: "参数面板",
|
|
422
|
-
description: "把一组控件包进面板,并附带恢复默认按钮。",
|
|
423
|
-
keywords: [
|
|
424
|
-
"面板",
|
|
425
|
-
"参数",
|
|
426
|
-
"重置",
|
|
427
|
-
"表单",
|
|
428
|
-
"控件"
|
|
429
|
-
],
|
|
430
|
-
template: "<panel title=\"参数面板\">\n{{selection:示例内容}}\n</panel>"
|
|
431
|
-
},
|
|
432
|
-
card: {
|
|
433
|
-
label: "内容卡片",
|
|
434
|
-
description: "用卡片组织一段独立内容。",
|
|
435
|
-
keywords: [
|
|
436
|
-
"卡片",
|
|
437
|
-
"容器",
|
|
438
|
-
"内容",
|
|
439
|
-
"区块"
|
|
440
|
-
],
|
|
441
|
-
template: "<card title=\"内容卡片\">\n{{selection:示例内容}}\n</card>"
|
|
442
|
-
},
|
|
443
|
-
if: {
|
|
444
|
-
label: "条件区域",
|
|
445
|
-
description: "只有条件为真时才显示其中内容。",
|
|
446
|
-
keywords: [
|
|
447
|
-
"条件",
|
|
448
|
-
"判断",
|
|
449
|
-
"显示",
|
|
450
|
-
"当"
|
|
451
|
-
],
|
|
452
|
-
template: "<if when=\"{{ {{select:true}} }}\">\n{{selection:示例内容}}\n</if>"
|
|
453
|
-
},
|
|
454
|
-
tabs: {
|
|
455
|
-
label: "标签页",
|
|
456
|
-
description: "把内容分到多个可切换的标签页中。",
|
|
457
|
-
keywords: [
|
|
458
|
-
"标签页",
|
|
459
|
-
"切换",
|
|
460
|
-
"分组",
|
|
461
|
-
"选项卡"
|
|
462
|
-
],
|
|
463
|
-
template: "<tabs label=\"内容标签页\">\n<tab label=\"标签一\">\n{{selection:示例内容}}\n</tab>\n\n<tab label=\"标签二\">\n第二个标签页的内容。\n</tab>\n</tabs>"
|
|
464
|
-
},
|
|
465
|
-
accordion: {
|
|
466
|
-
label: "折叠面板",
|
|
467
|
-
description: "把说明放进可展开和收起的条目。",
|
|
468
|
-
keywords: [
|
|
469
|
-
"折叠",
|
|
470
|
-
"展开",
|
|
471
|
-
"问答",
|
|
472
|
-
"手风琴",
|
|
473
|
-
"条目"
|
|
474
|
-
],
|
|
475
|
-
template: "<accordion label=\"常见问题\">\n<disclosure label=\"问题一\">\n{{selection:示例内容}}\n</disclosure>\n\n<disclosure label=\"问题二\">\n第二个条目的说明。\n</disclosure>\n</accordion>"
|
|
476
|
-
},
|
|
477
|
-
chart: {
|
|
478
|
-
label: "柱状图",
|
|
479
|
-
description: "把 Markdown 表格转换成柱状图。",
|
|
480
|
-
keywords: [
|
|
481
|
-
"图表",
|
|
482
|
-
"柱状图",
|
|
483
|
-
"表格",
|
|
484
|
-
"数据",
|
|
485
|
-
"对比"
|
|
486
|
-
],
|
|
487
|
-
template: "<chart kind=\"bar\" title=\"分类对比\" y-label=\"数值\">\n| 项目 | 数值 |\n| --- | ---: |\n| 项目甲 | 20 |\n| 项目乙 | 35 |\n</chart>"
|
|
488
|
-
},
|
|
489
|
-
table: {
|
|
490
|
-
label: "增强表格",
|
|
491
|
-
description: "带搜索、排序和分页的 Markdown 表格。",
|
|
492
|
-
keywords: [
|
|
493
|
-
"表格",
|
|
494
|
-
"搜索",
|
|
495
|
-
"排序",
|
|
496
|
-
"分页",
|
|
497
|
-
"数据"
|
|
498
|
-
],
|
|
499
|
-
template: "<table label=\"数据表格\" page-size=\"5\">\n| 名称 | 分类 | 数值 |\n| --- | --- | ---: |\n| 项目甲 | 分类一 | 20 |\n| 项目乙 | 分类二 | 35 |\n</table>"
|
|
500
|
-
},
|
|
501
|
-
timeline: {
|
|
502
|
-
label: "时间轴",
|
|
503
|
-
description: "用表格展示任务的开始时间与时长。",
|
|
504
|
-
keywords: [
|
|
505
|
-
"时间轴",
|
|
506
|
-
"计划",
|
|
507
|
-
"时长",
|
|
508
|
-
"日程",
|
|
509
|
-
"任务"
|
|
510
|
-
],
|
|
511
|
-
template: "<timeline title=\"任务时间轴\">\n| 事项 | 开始 | 时长 | 说明 |\n| --- | ---: | ---: | --- |\n| 准备 | 0 | 10 | 列出所需材料 |\n| 执行 | 10 | 20 | 完成主要内容 |\n| 检查 | 30 | 5 | 复核结果 |\n</timeline>"
|
|
512
|
-
},
|
|
513
|
-
diagram: {
|
|
514
|
-
label: "交互图解",
|
|
515
|
-
description: "用节点和连线展示流程,可点击查看说明。",
|
|
516
|
-
keywords: [
|
|
517
|
-
"图解",
|
|
518
|
-
"流程",
|
|
519
|
-
"节点",
|
|
520
|
-
"连线",
|
|
521
|
-
"关系图"
|
|
522
|
-
],
|
|
523
|
-
template: "<diagram label=\"流程示意\">\n<node id=\"start\" label=\"开始\">\n流程起点。\n</node>\n\n<node id=\"process\" label=\"处理\">\n执行主要步骤。\n</node>\n\n<node id=\"end\" label=\"结束\">\n查看结果。\n</node>\n\n<edge from=\"start\" to=\"process\" label=\"进入\">\n<edge from=\"process\" to=\"end\" label=\"完成\">\n</diagram>"
|
|
524
|
-
},
|
|
525
|
-
plot: {
|
|
526
|
-
label: "函数曲线",
|
|
527
|
-
description: "用 LaTeX 公式绘制一条函数曲线。",
|
|
528
|
-
keywords: [
|
|
529
|
-
"曲线",
|
|
530
|
-
"函数",
|
|
531
|
-
"公式",
|
|
532
|
-
"数学",
|
|
533
|
-
"绘图"
|
|
534
|
-
],
|
|
535
|
-
template: "<plot min=\"-5\" max=\"5\" label=\"函数曲线\">\n$$ y = x^2 $$\n</plot>"
|
|
536
|
-
},
|
|
537
|
-
alert: {
|
|
538
|
-
label: "提示框",
|
|
539
|
-
description: "用不同语气突出普通、成功或警告信息。",
|
|
540
|
-
keywords: [
|
|
541
|
-
"提示",
|
|
542
|
-
"警告",
|
|
543
|
-
"通知",
|
|
544
|
-
"信息",
|
|
545
|
-
"消息"
|
|
546
|
-
],
|
|
547
|
-
template: "<alert tone=\"info\" title=\"提示\">\n{{selection:示例内容}}\n</alert>"
|
|
548
|
-
},
|
|
549
|
-
badge: {
|
|
550
|
-
label: "徽标",
|
|
551
|
-
description: "在句子里显示一个简短状态标记。",
|
|
552
|
-
keywords: [
|
|
553
|
-
"徽标",
|
|
554
|
-
"标签",
|
|
555
|
-
"状态",
|
|
556
|
-
"行内",
|
|
557
|
-
"标记"
|
|
558
|
-
],
|
|
559
|
-
template: "<badge tone=\"success\">标签</badge>"
|
|
560
|
-
},
|
|
561
|
-
tooltip: {
|
|
562
|
-
label: "行内提示",
|
|
563
|
-
description: "为句中的词语附加悬停或聚焦说明。",
|
|
564
|
-
keywords: [
|
|
565
|
-
"提示",
|
|
566
|
-
"悬停",
|
|
567
|
-
"说明",
|
|
568
|
-
"行内",
|
|
569
|
-
"气泡"
|
|
570
|
-
],
|
|
571
|
-
template: "<tooltip text=\"这里显示补充说明。\">悬停查看</tooltip>"
|
|
572
|
-
}
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
}, g = [
|
|
576
|
-
{
|
|
577
|
-
id: "input",
|
|
578
|
-
label: "Input controls"
|
|
579
|
-
},
|
|
580
|
-
{
|
|
581
|
-
id: "action",
|
|
582
|
-
label: "Interactive tools"
|
|
583
|
-
},
|
|
584
|
-
{
|
|
585
|
-
id: "layout",
|
|
586
|
-
label: "Content layout"
|
|
587
|
-
},
|
|
588
|
-
{
|
|
589
|
-
id: "data",
|
|
590
|
-
label: "Data visualization"
|
|
591
|
-
},
|
|
592
|
-
{
|
|
593
|
-
id: "hint",
|
|
594
|
-
label: "Feedback"
|
|
595
|
-
}
|
|
596
|
-
], _ = [
|
|
597
|
-
...f,
|
|
598
|
-
{
|
|
599
|
-
id: "slider",
|
|
600
|
-
label: "Slider",
|
|
601
|
-
description: "Drag the slider to choose a number within a range.",
|
|
602
|
-
group: "input",
|
|
603
|
-
keywords: [
|
|
604
|
-
"slider",
|
|
605
|
-
"range",
|
|
606
|
-
"number",
|
|
607
|
-
"drag",
|
|
608
|
-
"value"
|
|
609
|
-
],
|
|
610
|
-
template: "<slider bind=\"{{bind:amount}}\" label=\"Amount\" initial=\"10\" min=\"0\" max=\"100\" step=\"1\">"
|
|
611
|
-
},
|
|
612
|
-
{
|
|
613
|
-
id: "number",
|
|
614
|
-
label: "Number input",
|
|
615
|
-
description: "Enter an exact number with an optional range and step.",
|
|
616
|
-
group: "input",
|
|
617
|
-
keywords: [
|
|
618
|
-
"number",
|
|
619
|
-
"numeric",
|
|
620
|
-
"input",
|
|
621
|
-
"step",
|
|
622
|
-
"quantity"
|
|
623
|
-
],
|
|
624
|
-
template: "<number bind=\"{{bind:quantity}}\" label=\"Quantity\" initial=\"1\" min=\"0\" max=\"100\" step=\"1\">"
|
|
625
|
-
},
|
|
626
|
-
{
|
|
627
|
-
id: "input",
|
|
628
|
-
label: "Single-line text",
|
|
629
|
-
description: "Enter a name, title or other single-line text.",
|
|
630
|
-
group: "input",
|
|
631
|
-
keywords: [
|
|
632
|
-
"input",
|
|
633
|
-
"text",
|
|
634
|
-
"single-line",
|
|
635
|
-
"field",
|
|
636
|
-
"name"
|
|
637
|
-
],
|
|
638
|
-
template: "<input bind=\"{{bind:name}}\" label=\"Name\" placeholder=\"Enter a name\">"
|
|
639
|
-
},
|
|
640
|
-
{
|
|
641
|
-
id: "textarea",
|
|
642
|
-
label: "Multi-line text",
|
|
643
|
-
description: "Enter notes, descriptions or other multi-line text.",
|
|
644
|
-
group: "input",
|
|
645
|
-
keywords: [
|
|
646
|
-
"textarea",
|
|
647
|
-
"text area",
|
|
648
|
-
"multi-line",
|
|
649
|
-
"notes",
|
|
650
|
-
"description"
|
|
651
|
-
],
|
|
652
|
-
template: "<textarea bind=\"{{bind:message}}\" label=\"Details\" placeholder=\"Enter details\" rows=\"4\">"
|
|
653
|
-
},
|
|
654
|
-
{
|
|
655
|
-
id: "toggle",
|
|
656
|
-
label: "Toggle",
|
|
657
|
-
description: "Switch a boolean option on or off.",
|
|
658
|
-
group: "input",
|
|
659
|
-
keywords: [
|
|
660
|
-
"toggle",
|
|
661
|
-
"switch",
|
|
662
|
-
"boolean",
|
|
663
|
-
"enable",
|
|
664
|
-
"on"
|
|
665
|
-
],
|
|
666
|
-
template: "<toggle bind=\"{{bind:enabled}}\" label=\"Enable option\">"
|
|
667
|
-
},
|
|
668
|
-
{
|
|
669
|
-
id: "checkbox",
|
|
670
|
-
label: "Checkbox",
|
|
671
|
-
description: "Check or uncheck a boolean option.",
|
|
672
|
-
group: "input",
|
|
673
|
-
keywords: [
|
|
674
|
-
"checkbox",
|
|
675
|
-
"check",
|
|
676
|
-
"boolean",
|
|
677
|
-
"confirm",
|
|
678
|
-
"option"
|
|
679
|
-
],
|
|
680
|
-
template: "<checkbox bind=\"{{bind:confirmed}}\" label=\"Confirm option\">"
|
|
681
|
-
},
|
|
682
|
-
{
|
|
683
|
-
id: "date",
|
|
684
|
-
label: "Date picker",
|
|
685
|
-
description: "Pick a date; the value stays empty until one is chosen.",
|
|
686
|
-
group: "input",
|
|
687
|
-
keywords: [
|
|
688
|
-
"date",
|
|
689
|
-
"calendar",
|
|
690
|
-
"picker",
|
|
691
|
-
"day"
|
|
692
|
-
],
|
|
693
|
-
template: "<date bind=\"{{bind:date}}\" label=\"Pick a date\">"
|
|
694
|
-
},
|
|
695
|
-
{
|
|
696
|
-
id: "choices",
|
|
697
|
-
label: "Choice cards",
|
|
698
|
-
description: "Pick one option from a set of cards.",
|
|
699
|
-
group: "input",
|
|
700
|
-
keywords: [
|
|
701
|
-
"choices",
|
|
702
|
-
"options",
|
|
703
|
-
"cards",
|
|
704
|
-
"select",
|
|
705
|
-
"radio"
|
|
706
|
-
],
|
|
707
|
-
template: "<choices bind=\"{{bind:plan}}\" label=\"Choose a plan\">\n<option value=\"basic\">Basic</option>\n<option value=\"pro\">Pro</option>\n</choices>"
|
|
708
|
-
},
|
|
709
|
-
{
|
|
710
|
-
id: "counter",
|
|
711
|
-
label: "Counter",
|
|
712
|
-
description: "Adjust an integer with plus and minus buttons, then reset it in one click.",
|
|
713
|
-
group: "action",
|
|
714
|
-
keywords: [
|
|
715
|
-
"counter",
|
|
716
|
-
"count",
|
|
717
|
-
"plus",
|
|
718
|
-
"minus",
|
|
719
|
-
"integer"
|
|
720
|
-
],
|
|
721
|
-
template: "<counter bind=\"{{bind:count}}\" label=\"Count\" initial=\"0\" min=\"0\" max=\"99\">"
|
|
722
|
-
},
|
|
723
|
-
{
|
|
724
|
-
id: "timer",
|
|
725
|
-
label: "Countdown timer",
|
|
726
|
-
description: "Start, pause and reset a focus timer.",
|
|
727
|
-
group: "action",
|
|
728
|
-
keywords: [
|
|
729
|
-
"timer",
|
|
730
|
-
"countdown",
|
|
731
|
-
"focus",
|
|
732
|
-
"seconds",
|
|
733
|
-
"pause"
|
|
734
|
-
],
|
|
735
|
-
template: "<timer bind=\"{{bind:remaining}}\" label=\"Focus timer\" duration=\"60\">"
|
|
736
|
-
},
|
|
737
|
-
{
|
|
738
|
-
id: "checklist",
|
|
739
|
-
label: "Checklist",
|
|
740
|
-
description: "Track completion with a checkable task list.",
|
|
741
|
-
group: "action",
|
|
742
|
-
keywords: [
|
|
743
|
-
"checklist",
|
|
744
|
-
"tasks",
|
|
745
|
-
"todo",
|
|
746
|
-
"check",
|
|
747
|
-
"done"
|
|
748
|
-
],
|
|
749
|
-
template: "<checklist bind=\"{{bind:done}}\" label=\"Task checklist\">\n- [ ] First task\n- [ ] Second task\n- [ ] Third task\n</checklist>"
|
|
750
|
-
},
|
|
751
|
-
{
|
|
752
|
-
id: "progress",
|
|
753
|
-
label: "Progress bar",
|
|
754
|
-
description: "Show completion from 0 to 100.",
|
|
755
|
-
group: "action",
|
|
756
|
-
keywords: [
|
|
757
|
-
"progress",
|
|
758
|
-
"completion",
|
|
759
|
-
"bar",
|
|
760
|
-
"percent"
|
|
761
|
-
],
|
|
762
|
-
template: "<progress label=\"Progress\" value=\"{{ 40 }}\">"
|
|
763
|
-
},
|
|
764
|
-
{
|
|
765
|
-
id: "panel",
|
|
766
|
-
label: "Parameter panel",
|
|
767
|
-
description: "Group controls in a panel with a restore-defaults button.",
|
|
768
|
-
group: "layout",
|
|
769
|
-
keywords: [
|
|
770
|
-
"panel",
|
|
771
|
-
"parameters",
|
|
772
|
-
"reset",
|
|
773
|
-
"form",
|
|
774
|
-
"group"
|
|
775
|
-
],
|
|
776
|
-
template: "<panel title=\"Parameters\">\n{{selection:Sample content}}\n</panel>"
|
|
777
|
-
},
|
|
778
|
-
{
|
|
779
|
-
id: "card",
|
|
780
|
-
label: "Content card",
|
|
781
|
-
description: "Organize a self-contained piece of content in a card.",
|
|
782
|
-
group: "layout",
|
|
783
|
-
keywords: [
|
|
784
|
-
"card",
|
|
785
|
-
"container",
|
|
786
|
-
"content",
|
|
787
|
-
"section"
|
|
788
|
-
],
|
|
789
|
-
template: "<card title=\"Content card\">\n{{selection:Sample content}}\n</card>"
|
|
790
|
-
},
|
|
791
|
-
{
|
|
792
|
-
id: "if",
|
|
793
|
-
label: "Conditional section",
|
|
794
|
-
description: "Show the contents only when a condition is true.",
|
|
795
|
-
group: "layout",
|
|
796
|
-
keywords: [
|
|
797
|
-
"if",
|
|
798
|
-
"condition",
|
|
799
|
-
"when",
|
|
800
|
-
"show",
|
|
801
|
-
"visible"
|
|
802
|
-
],
|
|
803
|
-
template: "<if when=\"{{ {{select:true}} }}\">\n{{selection:Sample content}}\n</if>"
|
|
804
|
-
},
|
|
805
|
-
{
|
|
806
|
-
id: "tabs",
|
|
807
|
-
label: "Tabs",
|
|
808
|
-
description: "Split content across switchable tabs.",
|
|
809
|
-
group: "layout",
|
|
810
|
-
keywords: [
|
|
811
|
-
"tabs",
|
|
812
|
-
"switch",
|
|
813
|
-
"sections",
|
|
814
|
-
"groups"
|
|
815
|
-
],
|
|
816
|
-
template: "<tabs label=\"Content tabs\">\n<tab label=\"Tab one\">\n{{selection:Sample content}}\n</tab>\n\n<tab label=\"Tab two\">\nContent for the second tab.\n</tab>\n</tabs>"
|
|
817
|
-
},
|
|
818
|
-
{
|
|
819
|
-
id: "accordion",
|
|
820
|
-
label: "Accordion",
|
|
821
|
-
description: "Put notes into items that expand and collapse.",
|
|
822
|
-
group: "layout",
|
|
823
|
-
keywords: [
|
|
824
|
-
"accordion",
|
|
825
|
-
"collapse",
|
|
826
|
-
"expand",
|
|
827
|
-
"faq",
|
|
828
|
-
"disclosure"
|
|
829
|
-
],
|
|
830
|
-
template: "<accordion label=\"FAQ\">\n<disclosure label=\"Question one\">\n{{selection:Sample content}}\n</disclosure>\n\n<disclosure label=\"Question two\">\nDetails for the second item.\n</disclosure>\n</accordion>"
|
|
831
|
-
},
|
|
832
|
-
{
|
|
833
|
-
id: "chart",
|
|
834
|
-
label: "Bar chart",
|
|
835
|
-
description: "Turn a Markdown table into a bar chart.",
|
|
836
|
-
group: "data",
|
|
837
|
-
keywords: [
|
|
838
|
-
"chart",
|
|
839
|
-
"bar",
|
|
840
|
-
"graph",
|
|
841
|
-
"table",
|
|
842
|
-
"data"
|
|
843
|
-
],
|
|
844
|
-
template: "<chart kind=\"bar\" title=\"Category comparison\" y-label=\"Value\">\n| Item | Value |\n| --- | ---: |\n| Item A | 20 |\n| Item B | 35 |\n</chart>"
|
|
845
|
-
},
|
|
846
|
-
{
|
|
847
|
-
id: "table",
|
|
848
|
-
label: "Enhanced table",
|
|
849
|
-
description: "A Markdown table with search, sorting and paging.",
|
|
850
|
-
group: "data",
|
|
851
|
-
keywords: [
|
|
852
|
-
"table",
|
|
853
|
-
"search",
|
|
854
|
-
"sort",
|
|
855
|
-
"paging",
|
|
856
|
-
"data"
|
|
857
|
-
],
|
|
858
|
-
template: "<table label=\"Data table\" page-size=\"5\">\n| Name | Category | Value |\n| --- | --- | ---: |\n| Item A | Category one | 20 |\n| Item B | Category two | 35 |\n</table>"
|
|
859
|
-
},
|
|
860
|
-
{
|
|
861
|
-
id: "timeline",
|
|
862
|
-
label: "Timeline",
|
|
863
|
-
description: "Show task start times and durations in a table.",
|
|
864
|
-
group: "data",
|
|
865
|
-
keywords: [
|
|
866
|
-
"timeline",
|
|
867
|
-
"schedule",
|
|
868
|
-
"plan",
|
|
869
|
-
"duration",
|
|
870
|
-
"gantt"
|
|
871
|
-
],
|
|
872
|
-
template: "<timeline title=\"Task timeline\">\n| Task | Start | Duration | Notes |\n| --- | ---: | ---: | --- |\n| Prepare | 0 | 10 | List the materials |\n| Execute | 10 | 20 | Complete the main work |\n| Review | 30 | 5 | Check the results |\n</timeline>"
|
|
873
|
-
},
|
|
874
|
-
{
|
|
875
|
-
id: "diagram",
|
|
876
|
-
label: "Interactive diagram",
|
|
877
|
-
description: "Show a flow with nodes and edges; click a node to read its notes.",
|
|
878
|
-
group: "data",
|
|
879
|
-
keywords: [
|
|
880
|
-
"diagram",
|
|
881
|
-
"flow",
|
|
882
|
-
"node",
|
|
883
|
-
"edge",
|
|
884
|
-
"graph"
|
|
885
|
-
],
|
|
886
|
-
template: "<diagram label=\"Flow overview\">\n<node id=\"start\" label=\"Start\">\nWhere the flow begins.\n</node>\n\n<node id=\"process\" label=\"Process\">\nPerform the main step.\n</node>\n\n<node id=\"end\" label=\"End\">\nReview the result.\n</node>\n\n<edge from=\"start\" to=\"process\" label=\"Proceed\">\n<edge from=\"process\" to=\"end\" label=\"Complete\">\n</diagram>"
|
|
887
|
-
},
|
|
888
|
-
{
|
|
889
|
-
id: "plot",
|
|
890
|
-
label: "Function plot",
|
|
891
|
-
description: "Plot a function curve from a LaTeX formula.",
|
|
892
|
-
group: "data",
|
|
893
|
-
keywords: [
|
|
894
|
-
"plot",
|
|
895
|
-
"curve",
|
|
896
|
-
"function",
|
|
897
|
-
"formula",
|
|
898
|
-
"latex",
|
|
899
|
-
"math"
|
|
900
|
-
],
|
|
901
|
-
template: "<plot min=\"-5\" max=\"5\" label=\"Function plot\">\n$$ y = x^2 $$\n</plot>"
|
|
902
|
-
},
|
|
903
|
-
{
|
|
904
|
-
id: "alert",
|
|
905
|
-
label: "Alert",
|
|
906
|
-
description: "Highlight info, success or warning messages with different tones.",
|
|
907
|
-
group: "hint",
|
|
908
|
-
keywords: [
|
|
909
|
-
"alert",
|
|
910
|
-
"notice",
|
|
911
|
-
"warning",
|
|
912
|
-
"info",
|
|
913
|
-
"message"
|
|
914
|
-
],
|
|
915
|
-
template: "<alert tone=\"info\" title=\"Notice\">\n{{selection:Sample content}}\n</alert>"
|
|
916
|
-
},
|
|
917
|
-
{
|
|
918
|
-
id: "badge",
|
|
919
|
-
label: "Badge",
|
|
920
|
-
description: "Show a short status marker inside a sentence.",
|
|
921
|
-
group: "hint",
|
|
922
|
-
keywords: [
|
|
923
|
-
"badge",
|
|
924
|
-
"label",
|
|
925
|
-
"status",
|
|
926
|
-
"inline",
|
|
927
|
-
"tag"
|
|
928
|
-
],
|
|
929
|
-
inline: !0,
|
|
930
|
-
template: "<badge tone=\"success\">Badge</badge>"
|
|
931
|
-
},
|
|
932
|
-
{
|
|
933
|
-
id: "tooltip",
|
|
934
|
-
label: "Tooltip",
|
|
935
|
-
description: "Attach a hover or focus note to a word in a sentence.",
|
|
936
|
-
group: "hint",
|
|
937
|
-
keywords: [
|
|
938
|
-
"tooltip",
|
|
939
|
-
"hint",
|
|
940
|
-
"hover",
|
|
941
|
-
"focus",
|
|
942
|
-
"inline"
|
|
943
|
-
],
|
|
944
|
-
inline: !0,
|
|
945
|
-
template: "<tooltip text=\"Extra details appear here.\">Hover to view</tooltip>"
|
|
946
|
-
}
|
|
947
|
-
], v = /\{\{bind:([^{}]+)\}\}/g, ee = /[A-Za-z_][A-Za-z0-9_]*/g;
|
|
948
|
-
function y(e, t) {
|
|
949
|
-
let n = [...e];
|
|
950
|
-
for (let e of t) {
|
|
951
|
-
let t = e.toLowerCase();
|
|
952
|
-
n.some((e) => e.toLowerCase() === t) || n.push(e);
|
|
953
|
-
}
|
|
954
|
-
return n;
|
|
955
|
-
}
|
|
956
|
-
var b = g.map((e) => ({
|
|
957
|
-
...e,
|
|
958
|
-
label: h.zh.groups[e.id]
|
|
959
|
-
})), te = _.map((e) => ({
|
|
960
|
-
...e,
|
|
961
|
-
keywords: y(e.keywords, h.zh.components[e.id]?.keywords ?? [])
|
|
962
|
-
})), x = _.map((e) => {
|
|
963
|
-
let t = h.zh.components[e.id];
|
|
964
|
-
return t ? {
|
|
965
|
-
...e,
|
|
966
|
-
label: t.label,
|
|
967
|
-
description: t.description,
|
|
968
|
-
keywords: y(e.keywords, t.keywords),
|
|
969
|
-
template: t.template
|
|
970
|
-
} : e;
|
|
971
|
-
});
|
|
972
|
-
function ne(e = "en") {
|
|
973
|
-
return e === "zh" ? {
|
|
974
|
-
groups: b,
|
|
975
|
-
components: x
|
|
976
|
-
} : {
|
|
977
|
-
groups: g,
|
|
978
|
-
components: te
|
|
979
|
-
};
|
|
980
|
-
}
|
|
981
|
-
function S(e) {
|
|
982
|
-
return new Set(e.match(ee) ?? []);
|
|
983
|
-
}
|
|
984
|
-
function C(e) {
|
|
985
|
-
let t = e.trim().replace(/[^A-Za-z0-9_]/g, "_");
|
|
986
|
-
return t ? /^[0-9]/.test(t) ? `_${t}` : t : "value";
|
|
987
|
-
}
|
|
988
|
-
function w(e, t) {
|
|
989
|
-
if (!t.has(e)) return e;
|
|
990
|
-
let n = 2;
|
|
991
|
-
for (; t.has(`${e}${n}`);) n += 1;
|
|
992
|
-
return `${e}${n}`;
|
|
993
|
-
}
|
|
994
|
-
function T(e, t, n) {
|
|
995
|
-
let r = S(t), i = /* @__PURE__ */ new Map();
|
|
996
|
-
return e.template.replace(v, (e, t) => {
|
|
997
|
-
let n = t.trim(), a = i.get(n);
|
|
998
|
-
if (a) return a;
|
|
999
|
-
let o = w(C(n), r);
|
|
1000
|
-
return r.add(o), i.set(n, o), o;
|
|
1001
|
-
});
|
|
1002
|
-
}
|
|
1003
|
-
// src/editor/editor-commands.ts
|
|
1004
|
-
function E(e, t) {
|
|
57
|
+
};
|
|
58
|
+
// src/authoring/editor-commands.ts
|
|
59
|
+
function S(e, t) {
|
|
1005
60
|
return typeof e != "number" || Number.isNaN(e) ? 0 : Math.min(Math.max(Math.trunc(e), 0), t);
|
|
1006
61
|
}
|
|
1007
|
-
function
|
|
1008
|
-
let n =
|
|
62
|
+
function C(e, t) {
|
|
63
|
+
let n = S(t.start, e.length), r = S(t.end, e.length);
|
|
1009
64
|
return n <= r ? {
|
|
1010
65
|
start: n,
|
|
1011
66
|
end: r
|
|
@@ -1014,14 +69,14 @@ function D(e, t) {
|
|
|
1014
69
|
end: n
|
|
1015
70
|
};
|
|
1016
71
|
}
|
|
1017
|
-
function
|
|
1018
|
-
return
|
|
72
|
+
function w(e) {
|
|
73
|
+
return ae[e] ?? ae.en;
|
|
1019
74
|
}
|
|
1020
|
-
function
|
|
75
|
+
function T(e, t) {
|
|
1021
76
|
return t <= 0 ? 0 : e.lastIndexOf("\n", t - 1) + 1;
|
|
1022
77
|
}
|
|
1023
|
-
function
|
|
1024
|
-
let n =
|
|
78
|
+
function E(e, t) {
|
|
79
|
+
let n = T(e, t.start), r = t.end > t.start && e[t.end - 1] === "\n" ? t.end - 1 : t.end, i = e.indexOf("\n", r), a = i === -1 ? e.length : i, o = [], s = n;
|
|
1025
80
|
for (;;) {
|
|
1026
81
|
let t = e.indexOf("\n", s), n = t === -1 || t > a ? a : t;
|
|
1027
82
|
if (o.push({
|
|
@@ -1033,7 +88,7 @@ function A(e, t) {
|
|
|
1033
88
|
}
|
|
1034
89
|
return o;
|
|
1035
90
|
}
|
|
1036
|
-
function
|
|
91
|
+
function D(e, t, n) {
|
|
1037
92
|
if (n.length === 0) return {
|
|
1038
93
|
value: e,
|
|
1039
94
|
selection: t
|
|
@@ -1067,7 +122,7 @@ function j(e, t, n) {
|
|
|
1067
122
|
}
|
|
1068
123
|
};
|
|
1069
124
|
}
|
|
1070
|
-
function
|
|
125
|
+
function O(e, t, n, r) {
|
|
1071
126
|
return t === e.text ? null : {
|
|
1072
127
|
start: e.start,
|
|
1073
128
|
end: e.end,
|
|
@@ -1076,13 +131,13 @@ function M(e, t, n, r) {
|
|
|
1076
131
|
newPrefixLength: r
|
|
1077
132
|
};
|
|
1078
133
|
}
|
|
1079
|
-
function
|
|
134
|
+
function oe(e, t, n, r) {
|
|
1080
135
|
return n === "*" ? r ? e[t.start - 1] !== "*" && e[t.end] !== "*" : e[t.start - n.length - 1] !== "*" && e[t.end + n.length] !== "*" : !0;
|
|
1081
136
|
}
|
|
1082
|
-
function
|
|
1083
|
-
let i =
|
|
137
|
+
function k(e, t, n, r) {
|
|
138
|
+
let i = C(e, t), a = n.length, { start: o, end: s } = i, c = e.slice(o, s);
|
|
1084
139
|
if (o !== s) {
|
|
1085
|
-
if (c.length >= a * 2 && c.startsWith(n) && c.endsWith(n) && (n !== "*" || !c.startsWith("**") && !c.endsWith("**")) &&
|
|
140
|
+
if (c.length >= a * 2 && c.startsWith(n) && c.endsWith(n) && (n !== "*" || !c.startsWith("**") && !c.endsWith("**")) && oe(e, i, n, !0)) {
|
|
1086
141
|
let t = c.slice(a, c.length - a);
|
|
1087
142
|
return {
|
|
1088
143
|
value: e.slice(0, o) + t + e.slice(s),
|
|
@@ -1093,7 +148,7 @@ function P(e, t, n, r) {
|
|
|
1093
148
|
};
|
|
1094
149
|
}
|
|
1095
150
|
let t = o - a, r = s + a;
|
|
1096
|
-
return t >= 0 && r <= e.length && e.slice(t, o) === n && e.slice(s, r) === n &&
|
|
151
|
+
return t >= 0 && r <= e.length && e.slice(t, o) === n && e.slice(s, r) === n && oe(e, i, n, !1) ? {
|
|
1097
152
|
value: e.slice(0, t) + c + e.slice(r),
|
|
1098
153
|
selection: {
|
|
1099
154
|
start: t,
|
|
@@ -1116,39 +171,39 @@ function P(e, t, n, r) {
|
|
|
1116
171
|
}
|
|
1117
172
|
};
|
|
1118
173
|
}
|
|
1119
|
-
function
|
|
1120
|
-
return
|
|
174
|
+
function se(e, t, n = "en") {
|
|
175
|
+
return k(e, t, "**", w(n).boldPlaceholder);
|
|
1121
176
|
}
|
|
1122
|
-
function
|
|
1123
|
-
return
|
|
177
|
+
function ce(e, t, n = "en") {
|
|
178
|
+
return k(e, t, "*", w(n).italicPlaceholder);
|
|
1124
179
|
}
|
|
1125
|
-
function
|
|
1126
|
-
return
|
|
180
|
+
function le(e, t, n = "en") {
|
|
181
|
+
return k(e, t, "~~", w(n).strikePlaceholder);
|
|
1127
182
|
}
|
|
1128
|
-
function
|
|
183
|
+
function A(e) {
|
|
1129
184
|
let t = 0;
|
|
1130
185
|
for (let n of e.match(/`+/g) ?? []) t = Math.max(t, n.length);
|
|
1131
186
|
return t;
|
|
1132
187
|
}
|
|
1133
|
-
function
|
|
188
|
+
function j(e, t, n) {
|
|
1134
189
|
let r = 0;
|
|
1135
190
|
for (; e[t] === "`";) r += 1, t += n;
|
|
1136
191
|
return r;
|
|
1137
192
|
}
|
|
1138
|
-
function
|
|
1139
|
-
let { start: n, end: r } = t, i = e.slice(n, r), a =
|
|
193
|
+
function ue(e, t) {
|
|
194
|
+
let { start: n, end: r } = t, i = e.slice(n, r), a = j(e, n - 1, -1), o = j(e, r, 1), s = a > 0 && a === o ? {
|
|
1140
195
|
run: a,
|
|
1141
196
|
padding: 0
|
|
1142
|
-
} : null, c =
|
|
197
|
+
} : null, c = j(e, n - 2, -1), l = j(e, r + 1, 1), u = e[n - 1] === " " && e[r] === " " && c > 0 && c === l ? {
|
|
1143
198
|
run: c,
|
|
1144
199
|
padding: 1
|
|
1145
200
|
} : null, d = s ?? u;
|
|
1146
|
-
return !d ||
|
|
201
|
+
return !d || A(i) >= d.run ? null : d;
|
|
1147
202
|
}
|
|
1148
|
-
function
|
|
1149
|
-
let r =
|
|
203
|
+
function de(e, t, n = "en") {
|
|
204
|
+
let r = C(e, t), { start: i, end: a } = r, o = e.slice(i, a);
|
|
1150
205
|
if (i === a) {
|
|
1151
|
-
let t =
|
|
206
|
+
let t = w(n).inlineCodePlaceholder, r = `\`${t}\``;
|
|
1152
207
|
return {
|
|
1153
208
|
value: e.slice(0, i) + r + e.slice(a),
|
|
1154
209
|
selection: {
|
|
@@ -1157,8 +212,8 @@ function ae(e, t, n = "en") {
|
|
|
1157
212
|
}
|
|
1158
213
|
};
|
|
1159
214
|
}
|
|
1160
|
-
let s =
|
|
1161
|
-
if (s > 0 && s === c && o.length >= s * 2 &&
|
|
215
|
+
let s = j(o, 0, 1), c = j(o, o.length - 1, -1);
|
|
216
|
+
if (s > 0 && s === c && o.length >= s * 2 && A(o.slice(s, o.length - s)) < s) {
|
|
1162
217
|
let t = o.slice(s, o.length - s);
|
|
1163
218
|
return t.startsWith(" ") && t.endsWith(" ") && t.trim().length > 0 && (t = t.slice(1, -1)), {
|
|
1164
219
|
value: e.slice(0, i) + t + e.slice(a),
|
|
@@ -1168,7 +223,7 @@ function ae(e, t, n = "en") {
|
|
|
1168
223
|
}
|
|
1169
224
|
};
|
|
1170
225
|
}
|
|
1171
|
-
let l =
|
|
226
|
+
let l = ue(e, r);
|
|
1172
227
|
if (l) {
|
|
1173
228
|
let t = l.run + l.padding;
|
|
1174
229
|
return {
|
|
@@ -1179,7 +234,7 @@ function ae(e, t, n = "en") {
|
|
|
1179
234
|
}
|
|
1180
235
|
};
|
|
1181
236
|
}
|
|
1182
|
-
let u = "`".repeat(
|
|
237
|
+
let u = "`".repeat(A(o) + 1), d = /^[` ]|[` ]$/.test(o) ? " " : "", f = u + d;
|
|
1183
238
|
return {
|
|
1184
239
|
value: e.slice(0, i) + f + o + d + u + e.slice(a),
|
|
1185
240
|
selection: {
|
|
@@ -1188,19 +243,19 @@ function ae(e, t, n = "en") {
|
|
|
1188
243
|
}
|
|
1189
244
|
};
|
|
1190
245
|
}
|
|
1191
|
-
var
|
|
1192
|
-
function
|
|
1193
|
-
let r =
|
|
1194
|
-
for (let t of
|
|
1195
|
-
let e =
|
|
246
|
+
var fe = /^(#{1,6})[ \t]+/;
|
|
247
|
+
function pe(e, t, n) {
|
|
248
|
+
let r = C(e, t), i = [];
|
|
249
|
+
for (let t of E(e, r)) {
|
|
250
|
+
let e = fe.exec(t.text), r = e ? e[0].length : 0;
|
|
1196
251
|
if (n === 0 && !e) continue;
|
|
1197
|
-
let a = t.text.slice(r), o = n === 0 ? "" : `${"#".repeat(n)} `, s =
|
|
252
|
+
let a = t.text.slice(r), o = n === 0 ? "" : `${"#".repeat(n)} `, s = O(t, o + a, r, o.length);
|
|
1198
253
|
s && i.push(s);
|
|
1199
254
|
}
|
|
1200
|
-
return
|
|
255
|
+
return D(e, r, i);
|
|
1201
256
|
}
|
|
1202
|
-
var
|
|
1203
|
-
function
|
|
257
|
+
var M = /^([ \t]*)([-*+] )/, N = /^([ \t]*)(\d+[.)] )/, P = /^([ \t]*)([-*+] \[[ xX]\] )/, F = /^([ \t]*)(> ?)/;
|
|
258
|
+
function I(e, t) {
|
|
1204
259
|
let n = t.exec(e);
|
|
1205
260
|
if (!n) return null;
|
|
1206
261
|
let r = n[1] ?? "", i = n[2] ?? "";
|
|
@@ -1210,12 +265,12 @@ function W(e, t) {
|
|
|
1210
265
|
prefixLength: r.length + i.length
|
|
1211
266
|
};
|
|
1212
267
|
}
|
|
1213
|
-
function
|
|
268
|
+
function me(e) {
|
|
1214
269
|
let t = /^[ \t]*/.exec(e);
|
|
1215
270
|
return t ? t[0] : "";
|
|
1216
271
|
}
|
|
1217
|
-
function
|
|
1218
|
-
let i =
|
|
272
|
+
function L(e, t, n, r) {
|
|
273
|
+
let i = C(e, t), a = E(e, i), o = a.map((e) => n(e.text)), s = 0, c = !0;
|
|
1219
274
|
for (let e = 0; e < a.length; e += 1) {
|
|
1220
275
|
let t = a[e];
|
|
1221
276
|
(o[e] || t.text.trim().length > 0) && (s += 1, o[e] || (c = !1));
|
|
@@ -1225,30 +280,30 @@ function K(e, t, n, r) {
|
|
|
1225
280
|
let t = a[e], n = o[e] ?? null;
|
|
1226
281
|
if (l) {
|
|
1227
282
|
if (!n) continue;
|
|
1228
|
-
let e =
|
|
283
|
+
let e = O(t, n.indent + t.text.slice(n.prefixLength), n.prefixLength, n.indent.length);
|
|
1229
284
|
e && u.push(e);
|
|
1230
285
|
continue;
|
|
1231
286
|
}
|
|
1232
|
-
let i = n ? n.indent :
|
|
287
|
+
let i = n ? n.indent : me(t.text), s = t.text.slice(n ? n.prefixLength : i.length), c = r(i, e + 1), d = O(t, i + c + s, n ? n.prefixLength : i.length, i.length + c.length);
|
|
1233
288
|
d && u.push(d);
|
|
1234
289
|
}
|
|
1235
|
-
return
|
|
290
|
+
return D(e, i, u);
|
|
1236
291
|
}
|
|
1237
|
-
function
|
|
1238
|
-
return
|
|
292
|
+
function he(e, t) {
|
|
293
|
+
return L(e, t, (e) => I(e, M), () => "- ");
|
|
1239
294
|
}
|
|
1240
|
-
function
|
|
1241
|
-
return
|
|
295
|
+
function ge(e, t) {
|
|
296
|
+
return L(e, t, (e) => I(e, N), (e, t) => `${t}. `);
|
|
1242
297
|
}
|
|
1243
|
-
function
|
|
1244
|
-
return
|
|
298
|
+
function _e(e, t) {
|
|
299
|
+
return L(e, t, (e) => I(e, P), () => "- [ ] ");
|
|
1245
300
|
}
|
|
1246
|
-
function
|
|
1247
|
-
return
|
|
301
|
+
function ve(e, t) {
|
|
302
|
+
return L(e, t, (e) => I(e, F), () => "> ");
|
|
1248
303
|
}
|
|
1249
|
-
function
|
|
1250
|
-
let n =
|
|
1251
|
-
return
|
|
304
|
+
function ye(e, t) {
|
|
305
|
+
let n = C(e, t);
|
|
306
|
+
return D(e, n, E(e, n).map((e) => ({
|
|
1252
307
|
start: e.start,
|
|
1253
308
|
end: e.end,
|
|
1254
309
|
text: ` ${e.text}`,
|
|
@@ -1256,7 +311,7 @@ function ue(e, t) {
|
|
|
1256
311
|
newPrefixLength: 2
|
|
1257
312
|
})));
|
|
1258
313
|
}
|
|
1259
|
-
function
|
|
314
|
+
function be(e) {
|
|
1260
315
|
if (e.startsWith(" ")) return {
|
|
1261
316
|
text: e.slice(1),
|
|
1262
317
|
removed: 1
|
|
@@ -1268,18 +323,18 @@ function de(e) {
|
|
|
1268
323
|
removed: t
|
|
1269
324
|
};
|
|
1270
325
|
}
|
|
1271
|
-
function
|
|
1272
|
-
let n =
|
|
1273
|
-
for (let t of
|
|
1274
|
-
let e =
|
|
326
|
+
function xe(e, t) {
|
|
327
|
+
let n = C(e, t), r = [];
|
|
328
|
+
for (let t of E(e, n)) {
|
|
329
|
+
let e = be(t.text);
|
|
1275
330
|
if (e.removed === 0) continue;
|
|
1276
|
-
let n =
|
|
331
|
+
let n = O(t, e.text, e.removed, 0);
|
|
1277
332
|
n && r.push(n);
|
|
1278
333
|
}
|
|
1279
|
-
return
|
|
334
|
+
return D(e, n, r);
|
|
1280
335
|
}
|
|
1281
|
-
function
|
|
1282
|
-
let { start: r, end: i } =
|
|
336
|
+
function Se(e, t, n = "en") {
|
|
337
|
+
let { start: r, end: i } = C(e, t), a = e.slice(r, i), o = "https://example.com";
|
|
1283
338
|
if (a.length > 0) {
|
|
1284
339
|
let t = `[${a}](${o})`, n = r + 1 + a.length + 2;
|
|
1285
340
|
return {
|
|
@@ -1290,7 +345,7 @@ function pe(e, t, n = "en") {
|
|
|
1290
345
|
}
|
|
1291
346
|
};
|
|
1292
347
|
}
|
|
1293
|
-
let s =
|
|
348
|
+
let s = w(n).linkText, c = `[${s}](${o})`;
|
|
1294
349
|
return {
|
|
1295
350
|
value: e.slice(0, r) + c + e.slice(i),
|
|
1296
351
|
selection: {
|
|
@@ -1299,8 +354,8 @@ function pe(e, t, n = "en") {
|
|
|
1299
354
|
}
|
|
1300
355
|
};
|
|
1301
356
|
}
|
|
1302
|
-
function
|
|
1303
|
-
let { start: r, end: i } =
|
|
357
|
+
function Ce(e, t, n = "en") {
|
|
358
|
+
let { start: r, end: i } = C(e, t), a = e.slice(r, i), o = "images/example.png";
|
|
1304
359
|
if (a.length > 0) {
|
|
1305
360
|
let t = ``, n = r + 2 + a.length + 2;
|
|
1306
361
|
return {
|
|
@@ -1311,7 +366,7 @@ function me(e, t, n = "en") {
|
|
|
1311
366
|
}
|
|
1312
367
|
};
|
|
1313
368
|
}
|
|
1314
|
-
let s =
|
|
369
|
+
let s = w(n).imageAlt, c = ``;
|
|
1315
370
|
return {
|
|
1316
371
|
value: e.slice(0, r) + c + e.slice(i),
|
|
1317
372
|
selection: {
|
|
@@ -1320,25 +375,25 @@ function me(e, t, n = "en") {
|
|
|
1320
375
|
}
|
|
1321
376
|
};
|
|
1322
377
|
}
|
|
1323
|
-
function
|
|
1324
|
-
let r =
|
|
1325
|
-
return
|
|
378
|
+
function we(e, t, n = "en") {
|
|
379
|
+
let r = C(e, t), i = e.slice(r.start, r.end), a = i.length > 0 ? i : w(n).codeBlockPlaceholder, o = "`".repeat(Math.max(3, A(a) + 1)), s = `${o}text\n`;
|
|
380
|
+
return R(e, r, `${s}${a}\n${o}`, {
|
|
1326
381
|
start: s.length,
|
|
1327
382
|
end: s.length + a.length
|
|
1328
383
|
});
|
|
1329
384
|
}
|
|
1330
|
-
function
|
|
385
|
+
function Te(e) {
|
|
1331
386
|
return [
|
|
1332
387
|
`| ${e.tableHeaders.join(" | ")} |`,
|
|
1333
388
|
`| ${e.tableHeaders.map(() => "---").join(" | ")} |`,
|
|
1334
389
|
...e.tableRows.map((e) => `| ${e.join(" | ")} |`)
|
|
1335
390
|
].join("\n");
|
|
1336
391
|
}
|
|
1337
|
-
function
|
|
1338
|
-
let n =
|
|
392
|
+
function Ee(e, t) {
|
|
393
|
+
let n = T(e, t.start), r = e.slice(n, t.start), i = e.indexOf("\n", t.end), a = i === -1 ? e.length : i, o = e.slice(t.end, a), s = "";
|
|
1339
394
|
if (/\S/.test(r)) s = "\n\n";
|
|
1340
395
|
else if (n > 0) {
|
|
1341
|
-
let t =
|
|
396
|
+
let t = T(e, n - 1);
|
|
1342
397
|
/\S/.test(e.slice(t, n - 1)) && (s = "\n");
|
|
1343
398
|
}
|
|
1344
399
|
return {
|
|
@@ -1346,8 +401,8 @@ function J(e, t) {
|
|
|
1346
401
|
suffix: /\S/.test(o) ? "\n\n" : ""
|
|
1347
402
|
};
|
|
1348
403
|
}
|
|
1349
|
-
function
|
|
1350
|
-
let { prefix: i, suffix: a } =
|
|
404
|
+
function R(e, t, n, r) {
|
|
405
|
+
let { prefix: i, suffix: a } = Ee(e, t), o = t.start + i.length;
|
|
1351
406
|
return {
|
|
1352
407
|
value: e.slice(0, t.start) + i + n + a + e.slice(t.end),
|
|
1353
408
|
selection: {
|
|
@@ -1356,21 +411,21 @@ function Y(e, t, n, r) {
|
|
|
1356
411
|
}
|
|
1357
412
|
};
|
|
1358
413
|
}
|
|
1359
|
-
function
|
|
1360
|
-
let r =
|
|
1361
|
-
return
|
|
414
|
+
function De(e, t, n = "en") {
|
|
415
|
+
let r = C(e, t), i = w(n), a = Te(i), o = i.tableRows[0][0], s = a.indexOf(o);
|
|
416
|
+
return R(e, r, a, {
|
|
1362
417
|
start: s,
|
|
1363
418
|
end: s + o.length
|
|
1364
419
|
});
|
|
1365
420
|
}
|
|
1366
|
-
function
|
|
1367
|
-
return
|
|
421
|
+
function Oe(e, t) {
|
|
422
|
+
return R(e, C(e, t), "---", {
|
|
1368
423
|
start: 3,
|
|
1369
424
|
end: 3
|
|
1370
425
|
});
|
|
1371
426
|
}
|
|
1372
|
-
function
|
|
1373
|
-
let r =
|
|
427
|
+
function ke(e, t, n) {
|
|
428
|
+
let r = C(e, t), i = r.start + n.length;
|
|
1374
429
|
return {
|
|
1375
430
|
value: e.slice(0, r.start) + n + e.slice(r.end),
|
|
1376
431
|
selection: {
|
|
@@ -1379,11 +434,11 @@ function ye(e, t, n) {
|
|
|
1379
434
|
}
|
|
1380
435
|
};
|
|
1381
436
|
}
|
|
1382
|
-
var
|
|
1383
|
-
function
|
|
437
|
+
var z = /\{\{(selection(?::[^{}]*)?|caret|select:[^{}]*)\}\}/g;
|
|
438
|
+
function Ae(e, t) {
|
|
1384
439
|
let n = "", r = 0, i = null, a = null, o = null;
|
|
1385
|
-
|
|
1386
|
-
for (let s =
|
|
440
|
+
z.lastIndex = 0;
|
|
441
|
+
for (let s = z.exec(e); s; s = z.exec(e)) {
|
|
1387
442
|
let c = s.index;
|
|
1388
443
|
n += e.slice(r, c), r = c + s[0].length;
|
|
1389
444
|
let l = s[1] ?? "";
|
|
@@ -1414,8 +469,8 @@ function be(e, t) {
|
|
|
1414
469
|
caret: o
|
|
1415
470
|
};
|
|
1416
471
|
}
|
|
1417
|
-
function
|
|
1418
|
-
let i =
|
|
472
|
+
function B(e, t, n, r = {}) {
|
|
473
|
+
let i = C(e, t), a = Ae(n, e.slice(i.start, i.end)), o = r.block === !0 && a.text.length > 0 ? Ee(e, i) : {
|
|
1419
474
|
prefix: "",
|
|
1420
475
|
suffix: ""
|
|
1421
476
|
}, s = i.start + o.prefix.length, c;
|
|
@@ -1436,7 +491,7 @@ function xe(e, t, n, r = {}) {
|
|
|
1436
491
|
selection: c
|
|
1437
492
|
};
|
|
1438
493
|
}
|
|
1439
|
-
function
|
|
494
|
+
function je(e, t) {
|
|
1440
495
|
let n = [], r = 0;
|
|
1441
496
|
for (; r < e.length;) {
|
|
1442
497
|
if (e[r] !== t) {
|
|
@@ -1453,18 +508,18 @@ function Z(e, t) {
|
|
|
1453
508
|
}
|
|
1454
509
|
return n;
|
|
1455
510
|
}
|
|
1456
|
-
function
|
|
1457
|
-
if (t === "inlineCode") return
|
|
1458
|
-
let n =
|
|
511
|
+
function Me(e, t) {
|
|
512
|
+
if (t === "inlineCode") return je(e, "`");
|
|
513
|
+
let n = je(e, t === "strike" ? "~" : "*");
|
|
1459
514
|
return t === "italic" ? n.filter((e) => e.length % 2 == 1) : n.filter((e) => e.length >= 2);
|
|
1460
515
|
}
|
|
1461
|
-
function
|
|
516
|
+
function Ne(e, t, n) {
|
|
1462
517
|
return e >= t ? !1 : n.some((r) => r.start === e && n.some((e) => e.end === t && e.length === r.length && e.start >= r.end));
|
|
1463
518
|
}
|
|
1464
|
-
function
|
|
519
|
+
function Pe(e, t, n) {
|
|
1465
520
|
return e >= t ? !1 : n.some((r) => r.end === e && n.some((e) => e.start === t && e.length === r.length && e.start >= r.end));
|
|
1466
521
|
}
|
|
1467
|
-
function
|
|
522
|
+
function Fe(e, t) {
|
|
1468
523
|
let n = 0;
|
|
1469
524
|
for (; n < t.length;) {
|
|
1470
525
|
let r = t[n], i = n + 1;
|
|
@@ -1478,37 +533,617 @@ function we(e, t) {
|
|
|
1478
533
|
}
|
|
1479
534
|
return !1;
|
|
1480
535
|
}
|
|
1481
|
-
function
|
|
536
|
+
function V(e, t, n, r) {
|
|
1482
537
|
if (t.start !== t.end) {
|
|
1483
|
-
let n =
|
|
1484
|
-
return
|
|
538
|
+
let n = Me(e, r);
|
|
539
|
+
return Ne(t.start, t.end, n) || Pe(t.start, t.end, n);
|
|
1485
540
|
}
|
|
1486
|
-
return
|
|
541
|
+
return Fe(Math.min(Math.max(t.start - n.start, 0), n.text.length), Me(n.text, r).filter((e) => e.start >= Ie(n.text)));
|
|
1487
542
|
}
|
|
1488
|
-
function
|
|
543
|
+
function Ie(e) {
|
|
1489
544
|
let t = 0;
|
|
1490
545
|
for (;;) {
|
|
1491
|
-
let n = e.slice(t), r =
|
|
546
|
+
let n = e.slice(t), r = I(n, P) ?? I(n, M) ?? I(n, N) ?? I(n, F);
|
|
1492
547
|
if (!r) return t;
|
|
1493
548
|
t += r.prefixLength;
|
|
1494
549
|
}
|
|
1495
550
|
}
|
|
1496
|
-
function
|
|
1497
|
-
return
|
|
551
|
+
function Le(e) {
|
|
552
|
+
return I(e, P) ? "task" : I(e, M) ? "bullet" : I(e, N) ? "ordered" : null;
|
|
1498
553
|
}
|
|
1499
|
-
function
|
|
1500
|
-
let n =
|
|
554
|
+
function Re(e, t) {
|
|
555
|
+
let n = C(e, t), r = E(e, {
|
|
1501
556
|
start: n.start,
|
|
1502
557
|
end: n.start
|
|
1503
|
-
})[0], i = r.text, a =
|
|
558
|
+
})[0], i = r.text, a = fe.exec(i);
|
|
1504
559
|
return {
|
|
1505
560
|
headingLevel: a ? a[1].length : 0,
|
|
1506
|
-
bold:
|
|
1507
|
-
italic:
|
|
1508
|
-
strike:
|
|
1509
|
-
inlineCode:
|
|
1510
|
-
list:
|
|
1511
|
-
quote:
|
|
561
|
+
bold: V(e, n, r, "bold"),
|
|
562
|
+
italic: V(e, n, r, "italic"),
|
|
563
|
+
strike: V(e, n, r, "strike"),
|
|
564
|
+
inlineCode: V(e, n, r, "inlineCode"),
|
|
565
|
+
list: Le(i),
|
|
566
|
+
quote: I(i, F) !== null
|
|
567
|
+
};
|
|
568
|
+
}
|
|
569
|
+
// src/authoring/native-components.ts
|
|
570
|
+
var H = Object.freeze(c.map((e) => ({
|
|
571
|
+
id: e.id,
|
|
572
|
+
label: u(e.title, "en", e.id)
|
|
573
|
+
})));
|
|
574
|
+
function U(e, t) {
|
|
575
|
+
let n = r[e];
|
|
576
|
+
return {
|
|
577
|
+
id: e,
|
|
578
|
+
label: u(n.title, t, e),
|
|
579
|
+
description: u(n.description, t, e),
|
|
580
|
+
group: n.category,
|
|
581
|
+
keywords: [...l(e) ?? []],
|
|
582
|
+
...n.inline === !0 ? { inline: !0 } : {},
|
|
583
|
+
template: u(n.insertText, t, n.insertText.en ?? "")
|
|
584
|
+
};
|
|
585
|
+
}
|
|
586
|
+
var W = a.map((e) => U(e, "en")), G = Object.freeze(c.map((e) => ({
|
|
587
|
+
id: e.id,
|
|
588
|
+
label: u(e.title, "zh", e.id)
|
|
589
|
+
}))), K = a.map((e) => U(e, "zh")), ze = W.filter((e) => r[e.id]?.extended === !0), Be = Object.freeze(Object.fromEntries(K.filter((e) => r[e.id]?.extended === !0).map((e) => [e.id, Object.freeze({
|
|
590
|
+
label: e.label,
|
|
591
|
+
description: e.description,
|
|
592
|
+
keywords: Object.freeze([...e.keywords]),
|
|
593
|
+
template: e.template
|
|
594
|
+
})])));
|
|
595
|
+
function Ve(e = "en") {
|
|
596
|
+
return e === "zh" ? {
|
|
597
|
+
groups: G,
|
|
598
|
+
components: K
|
|
599
|
+
} : {
|
|
600
|
+
groups: H,
|
|
601
|
+
components: W
|
|
602
|
+
};
|
|
603
|
+
}
|
|
604
|
+
function He(e) {
|
|
605
|
+
return new Set(e.match(/[A-Za-z_][A-Za-z0-9_]*/g) ?? []);
|
|
606
|
+
}
|
|
607
|
+
function Ue(e) {
|
|
608
|
+
let t = e.trim().replace(/[^A-Za-z0-9_]/g, "_");
|
|
609
|
+
return t ? /^[0-9]/.test(t) ? `_${t}` : t : "value";
|
|
610
|
+
}
|
|
611
|
+
function We(e, t) {
|
|
612
|
+
if (!t.has(e)) return e;
|
|
613
|
+
let n = 2;
|
|
614
|
+
for (; t.has(`${e}${n}`);) n += 1;
|
|
615
|
+
return `${e}${n}`;
|
|
616
|
+
}
|
|
617
|
+
function q(e, t, n) {
|
|
618
|
+
let r = He(t), i = /* @__PURE__ */ new Map();
|
|
619
|
+
return e.template.replace(/\{\{bind:([^{}]+)\}\}/g, (e, t) => {
|
|
620
|
+
let n = t.trim(), a = i.get(n);
|
|
621
|
+
if (a) return a;
|
|
622
|
+
let o = We(Ue(n), r);
|
|
623
|
+
return r.add(o), i.set(n, o), o;
|
|
624
|
+
});
|
|
625
|
+
}
|
|
626
|
+
// src/authoring/templates.ts
|
|
627
|
+
function Ge(e) {
|
|
628
|
+
let t = {};
|
|
629
|
+
for (let [n, r] of Object.entries(e.props)) t[n] = {
|
|
630
|
+
kind: r.kind,
|
|
631
|
+
required: r.required === !0,
|
|
632
|
+
...r.enum ? { values: r.enum } : {},
|
|
633
|
+
...r.default === void 0 ? {} : { defaultValue: r.default },
|
|
634
|
+
...r.pattern === void 0 ? {} : { pattern: r.pattern },
|
|
635
|
+
...r.min === void 0 ? {} : { min: r.min },
|
|
636
|
+
...r.max === void 0 ? {} : { max: r.max },
|
|
637
|
+
integer: r.integer === !0,
|
|
638
|
+
color: r.color === !0
|
|
639
|
+
};
|
|
640
|
+
return t;
|
|
641
|
+
}
|
|
642
|
+
function Ke(e) {
|
|
643
|
+
return e.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">");
|
|
644
|
+
}
|
|
645
|
+
function qe(e) {
|
|
646
|
+
return e === null ? "" : Ke(String(e));
|
|
647
|
+
}
|
|
648
|
+
function Je(e) {
|
|
649
|
+
let t = e.replace(/[^A-Za-z0-9_]/g, "_"), r = /^[0-9]/.test(t) ? `_${t}` : t;
|
|
650
|
+
return n.has(r) ? `${r}_value` : r;
|
|
651
|
+
}
|
|
652
|
+
function Ye(e, t) {
|
|
653
|
+
if (e.defaultValue !== void 0 && e.defaultValue !== null) return qe(e.defaultValue);
|
|
654
|
+
switch (e.kind) {
|
|
655
|
+
case "boolean": return "false";
|
|
656
|
+
case "enum":
|
|
657
|
+
if (e.values?.length) return qe(e.values[0]);
|
|
658
|
+
throw Error(`${t} is a required enum without values; provide an authoring.insertText.`);
|
|
659
|
+
case "number": {
|
|
660
|
+
let n = e.min === void 0 ? void 0 : e.integer ? Math.ceil(e.min) : e.min, r = e.max === void 0 ? void 0 : e.integer ? Math.floor(e.max) : e.max;
|
|
661
|
+
if (n !== void 0 && r !== void 0 && n > r) throw Error(`${t} has no integer inside its declared range; provide an authoring.insertText.`);
|
|
662
|
+
let i = n !== void 0 && n > 0 ? n : r !== void 0 && r < 0 ? r : 0;
|
|
663
|
+
if (n !== void 0 && i < n && (i = n), r !== void 0 && i > r && (i = r), !Number.isFinite(i)) throw Error(`${t} is a required number without a legal finite value; provide an authoring.insertText.`);
|
|
664
|
+
return String(i);
|
|
665
|
+
}
|
|
666
|
+
case "string":
|
|
667
|
+
if (e.color) return "#000000";
|
|
668
|
+
if (e.pattern) throw Error(`${t} is a required pattern-constrained string; provide an authoring.insertText.`);
|
|
669
|
+
return "";
|
|
670
|
+
default: throw Error(`${t} has an unsupported property kind; provide an authoring.insertText.`);
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
function Xe(e) {
|
|
674
|
+
if (e.structure && e.structure.rule !== "none" && e.structure.rule !== "any" && e.structure.rule !== "inline") return !0;
|
|
675
|
+
let t = e.children;
|
|
676
|
+
return Array.isArray(t) ? t.some((e) => typeof e == "object" && !!e && (e.required === !0 || typeof e.min == "number" && e.min > 0)) : typeof t == "object" && t ? t.required === !0 || typeof t.min == "number" && t.min > 0 : !1;
|
|
677
|
+
}
|
|
678
|
+
function Ze(e, t) {
|
|
679
|
+
let n = e.name, r = e.form;
|
|
680
|
+
if (r !== "leaf" && r !== "inline" && r !== "container") throw Error(`component "${n}" has an unsupported form; provide an authoring.insertText.`);
|
|
681
|
+
if (Xe(e)) throw Error(`component "${n}" requires children; provide an authoring.insertText.`);
|
|
682
|
+
let i = Object.entries(e.bindings ?? {}), a = new Set(i.flatMap(([, e]) => [e.bind, e.initial])), o = [];
|
|
683
|
+
for (let [e, t] of i) o.push(`${t.bind}="${Je(e === "value" ? n : `${n}_${e}`)}"`);
|
|
684
|
+
for (let [e, r] of Object.entries(t)) r.required && (a.has(e) || o.push(`${e}="${Ye(r, `component "${n}" property "${e}"`)}"`));
|
|
685
|
+
let s = `<${n}${o.length > 0 ? ` ${o.join(" ")}` : ""}`;
|
|
686
|
+
return r === "leaf" ? `${s}>` : r === "inline" ? `${s}></${n}>` : `${s}>\n\n</${n}>`;
|
|
687
|
+
}
|
|
688
|
+
var Qe = {
|
|
689
|
+
id: "authoring-template",
|
|
690
|
+
label: "",
|
|
691
|
+
description: "",
|
|
692
|
+
group: "input",
|
|
693
|
+
keywords: [],
|
|
694
|
+
template: ""
|
|
695
|
+
};
|
|
696
|
+
function J(e, t = "") {
|
|
697
|
+
let n = q({
|
|
698
|
+
...Qe,
|
|
699
|
+
template: e
|
|
700
|
+
}, t);
|
|
701
|
+
return B(t, {
|
|
702
|
+
start: t.length,
|
|
703
|
+
end: t.length
|
|
704
|
+
}, n).value.slice(t.length);
|
|
705
|
+
}
|
|
706
|
+
function $e(e) {
|
|
707
|
+
return e.diagnostics.map((e) => `${e.code}: ${e.message}`).join("; ");
|
|
708
|
+
}
|
|
709
|
+
function et(e, t) {
|
|
710
|
+
let n = J(t), r = `</${e}>`, i = n.lastIndexOf(r);
|
|
711
|
+
if (!(i < 0)) return {
|
|
712
|
+
before: `${n.slice(0, i)}\n`,
|
|
713
|
+
after: `\n${n.slice(i)}`
|
|
714
|
+
};
|
|
715
|
+
}
|
|
716
|
+
function tt(e, t, n, r) {
|
|
717
|
+
let i = r === void 0 ? J(e) : J(e, r.before), a = r === void 0 ? i : `${r.before}${i}${r.after}`, o;
|
|
718
|
+
try {
|
|
719
|
+
o = m(a, t ?? {});
|
|
720
|
+
} catch (e) {
|
|
721
|
+
throw Error(`${n} authoring.insertText could not be compiled: ${e instanceof Error ? e.message : String(e)}.`);
|
|
722
|
+
}
|
|
723
|
+
if (o.ok) return;
|
|
724
|
+
let s = $e(o);
|
|
725
|
+
throw Error(`${n} authoring.insertText does not compile with this configuration${s ? ` (${s})` : ""}.`);
|
|
726
|
+
}
|
|
727
|
+
function nt(e, t, n, r) {
|
|
728
|
+
let i = r === void 0 ? e : `${r.before}${e}${r.after}`, a;
|
|
729
|
+
try {
|
|
730
|
+
a = m(i, t ?? {});
|
|
731
|
+
} catch (e) {
|
|
732
|
+
throw Error(`${n} has no authoring.insertText and its synthesized template could not be compiled: ${e instanceof Error ? e.message : String(e)}. Provide authoring.insertText.`);
|
|
733
|
+
}
|
|
734
|
+
if (a.ok) return;
|
|
735
|
+
let o = a.diagnostics.map((e) => `${e.code}: ${e.message}`).join("; ");
|
|
736
|
+
throw Error(`${n} has no authoring.insertText and its synthesized template does not compile with this configuration${o ? ` (${o})` : ""}. Provide authoring.insertText.`);
|
|
737
|
+
}
|
|
738
|
+
// src/authoring/catalog.ts
|
|
739
|
+
function Y(e) {
|
|
740
|
+
return /* @__PURE__ */ Error(`Invalid local component catalog: ${e}`);
|
|
741
|
+
}
|
|
742
|
+
function X(e, t, n) {
|
|
743
|
+
return u(e, t, n);
|
|
744
|
+
}
|
|
745
|
+
function rt(e, t) {
|
|
746
|
+
let n = X(e, t, "");
|
|
747
|
+
return n === "" ? void 0 : n;
|
|
748
|
+
}
|
|
749
|
+
function it(e) {
|
|
750
|
+
if (typeof e == "string" || typeof e == "number" || typeof e == "boolean") return e;
|
|
751
|
+
if (e === null) return null;
|
|
752
|
+
}
|
|
753
|
+
function at(e, t) {
|
|
754
|
+
return Object.freeze({
|
|
755
|
+
name: e,
|
|
756
|
+
kind: t.kind,
|
|
757
|
+
required: t.required === !0,
|
|
758
|
+
static: t.static === !0,
|
|
759
|
+
dynamic: t.dynamic === !0,
|
|
760
|
+
...t.values ? { values: Object.freeze([...t.values]) } : {},
|
|
761
|
+
...it(t.default) === void 0 ? {} : { defaultValue: it(t.default) }
|
|
762
|
+
});
|
|
763
|
+
}
|
|
764
|
+
function ot(e, t) {
|
|
765
|
+
let n = {};
|
|
766
|
+
for (let [t, r] of Object.entries(e)) n[t] = at(t, r);
|
|
767
|
+
return n;
|
|
768
|
+
}
|
|
769
|
+
function st(e, t, n) {
|
|
770
|
+
for (let [r, i] of Object.entries(e.props)) {
|
|
771
|
+
let e = rt(i.description, n);
|
|
772
|
+
if (e === void 0) continue;
|
|
773
|
+
let a = t[r];
|
|
774
|
+
t[r] = Object.freeze({
|
|
775
|
+
...a ?? {
|
|
776
|
+
name: r,
|
|
777
|
+
kind: i.kind,
|
|
778
|
+
required: i.required === !0,
|
|
779
|
+
static: i.static === !0,
|
|
780
|
+
dynamic: i.dynamic === !0
|
|
781
|
+
},
|
|
782
|
+
description: e
|
|
783
|
+
});
|
|
784
|
+
}
|
|
785
|
+
return t;
|
|
786
|
+
}
|
|
787
|
+
function ct(e) {
|
|
788
|
+
return Object.freeze({
|
|
789
|
+
id: e.id,
|
|
790
|
+
name: e.name,
|
|
791
|
+
title: e.title,
|
|
792
|
+
description: e.description,
|
|
793
|
+
category: e.category,
|
|
794
|
+
categoryLabel: e.categoryLabel,
|
|
795
|
+
insertText: e.insertText,
|
|
796
|
+
form: e.form,
|
|
797
|
+
paired: e.form !== "leaf",
|
|
798
|
+
inline: e.inline ?? e.form === "inline",
|
|
799
|
+
...e.parents === void 0 ? {} : { parents: Object.freeze([...e.parents]) },
|
|
800
|
+
...e.allowedChildren === void 0 ? {} : { allowedChildren: Object.freeze([...e.allowedChildren]) },
|
|
801
|
+
...e.keywords === void 0 ? {} : { keywords: Object.freeze([...e.keywords]) },
|
|
802
|
+
props: Object.freeze({ ...e.props }),
|
|
803
|
+
...e.styles === void 0 ? {} : { styles: Object.freeze([...e.styles]) },
|
|
804
|
+
...e.requires === void 0 ? {} : { requires: Object.freeze({ ...e.requires }) }
|
|
805
|
+
});
|
|
806
|
+
}
|
|
807
|
+
function lt(e) {
|
|
808
|
+
let t = e.structure;
|
|
809
|
+
return {
|
|
810
|
+
...t?.parents?.length ? { parents: t.parents } : {},
|
|
811
|
+
...t?.children?.length ? { allowedChildren: t.children } : {}
|
|
812
|
+
};
|
|
813
|
+
}
|
|
814
|
+
function ut(e, t) {
|
|
815
|
+
if (e === t) return !0;
|
|
816
|
+
if (e === void 0 || t === void 0) return !1;
|
|
817
|
+
let n = Object.keys(e).sort(), r = Object.keys(t).sort();
|
|
818
|
+
return n.length === r.length && n.every((n, i) => n === r[i] && e[n] === t[n]);
|
|
819
|
+
}
|
|
820
|
+
function Z(e) {
|
|
821
|
+
let t = e.authoring;
|
|
822
|
+
if (t === void 0) return;
|
|
823
|
+
if (i(e.name) === void 0) return t;
|
|
824
|
+
let n = o(e.name), r = {};
|
|
825
|
+
return t.title !== void 0 && !ut(t.title, n?.title) && (r.title = t.title), t.description !== void 0 && !ut(t.description, n?.description) && (r.description = t.description), t.category !== void 0 && t.category !== n?.category && (r.category = t.category), t.insertText !== void 0 && t.insertText !== n?.insertText && (r.insertText = t.insertText), Object.keys(r).length === 0 ? void 0 : Object.freeze(r);
|
|
826
|
+
}
|
|
827
|
+
function Q(e, t) {
|
|
828
|
+
let n = i(e.name), r = Z(e);
|
|
829
|
+
if (n) {
|
|
830
|
+
let e = r?.insertText;
|
|
831
|
+
if (e !== void 0) return e.trim() === "" ? void 0 : e;
|
|
832
|
+
let i = X(n.insertText, t, n.insertText.en ?? "");
|
|
833
|
+
return i === "" ? void 0 : i;
|
|
834
|
+
}
|
|
835
|
+
let a = r?.insertText;
|
|
836
|
+
return a !== void 0 && a.trim() !== "" ? a : void 0;
|
|
837
|
+
}
|
|
838
|
+
function dt(e, t) {
|
|
839
|
+
let n = Q(e, t);
|
|
840
|
+
return n === void 0 ? Ze(e, Ge(e)) : n;
|
|
841
|
+
}
|
|
842
|
+
function ft(e, n, r) {
|
|
843
|
+
let i = t(e).structure?.parents;
|
|
844
|
+
if (i !== void 0 && i.length !== 0) for (let e of i) {
|
|
845
|
+
let t = n.get(e);
|
|
846
|
+
if (t === void 0 || t.form !== "container") continue;
|
|
847
|
+
let i;
|
|
848
|
+
try {
|
|
849
|
+
i = dt(t, r);
|
|
850
|
+
} catch {
|
|
851
|
+
continue;
|
|
852
|
+
}
|
|
853
|
+
let a = et(e, i);
|
|
854
|
+
if (a !== void 0) return a;
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
function pt(e, t) {
|
|
858
|
+
if (e.parents !== void 0 && e.parents.length !== 0) for (let n of e.parents) {
|
|
859
|
+
let e = t.find((e) => e.name === n);
|
|
860
|
+
if (e === void 0 || e.form !== "container") continue;
|
|
861
|
+
let r = et(n, e.insertText);
|
|
862
|
+
if (r !== void 0) return r;
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
function mt(e, n, r, a, o) {
|
|
866
|
+
let c = t(e), u = i(e.name), d = e.authoring, f = Z(e), p = X(u ? f?.title ?? u.title : d?.title, n, e.name), m = X(u ? f?.description ?? u.description : d?.description, n, p), h = u ? f?.category ?? u.category : d?.category !== void 0 && d.category.trim() !== "" ? d.category : "extension", ee = s(h, n), g = Q(e, n), _ = lt(c), v;
|
|
867
|
+
if (g !== void 0) {
|
|
868
|
+
if (v = g, o) {
|
|
869
|
+
let t = ft(e, a, n);
|
|
870
|
+
try {
|
|
871
|
+
tt(v, r, `component "${e.name}"`, t);
|
|
872
|
+
} catch (e) {
|
|
873
|
+
throw Y(e instanceof Error ? e.message : String(e));
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
} else {
|
|
877
|
+
try {
|
|
878
|
+
v = Ze(e, Ge(e));
|
|
879
|
+
} catch (e) {
|
|
880
|
+
throw Y(e instanceof Error ? e.message : String(e));
|
|
881
|
+
}
|
|
882
|
+
if (o) try {
|
|
883
|
+
nt(v, r, `component "${e.name}"`, ft(e, a, n));
|
|
884
|
+
} catch (e) {
|
|
885
|
+
throw Y(e instanceof Error ? e.message : String(e));
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
let y = st(e, ot(c.props, n), n), b = l(e.name);
|
|
889
|
+
return ct({
|
|
890
|
+
id: u ? e.name : e.id,
|
|
891
|
+
name: e.name,
|
|
892
|
+
title: p,
|
|
893
|
+
description: m,
|
|
894
|
+
category: h,
|
|
895
|
+
categoryLabel: ee,
|
|
896
|
+
insertText: v,
|
|
897
|
+
form: e.form,
|
|
898
|
+
inline: u ? u.inline === !0 : e.form === "inline",
|
|
899
|
+
..._,
|
|
900
|
+
...b === void 0 ? {} : { keywords: b },
|
|
901
|
+
props: y,
|
|
902
|
+
...e.styles === void 0 ? {} : { styles: e.styles },
|
|
903
|
+
...e.requires === void 0 ? {} : { requires: e.requires }
|
|
904
|
+
});
|
|
905
|
+
}
|
|
906
|
+
function ht(e, t, n, r, i) {
|
|
907
|
+
let o = new Map(e.map((e) => [e.name, e])), s = [], c = /* @__PURE__ */ new Set();
|
|
908
|
+
for (let e of a) {
|
|
909
|
+
let t = o.get(e);
|
|
910
|
+
t && t.authoring !== void 0 && (s.push(mt(t, n, r, o, !1)), c.add(e));
|
|
911
|
+
}
|
|
912
|
+
for (let a of e) c.has(a.name) || (a.authoring !== void 0 || t.has(a.name)) && (s.push(mt(a, n, r, o, i && t.has(a.name))), c.add(a.name));
|
|
913
|
+
return s;
|
|
914
|
+
}
|
|
915
|
+
function gt(e, n) {
|
|
916
|
+
let r = i(e.name), a = e.authoring, o = Z(e), c = {};
|
|
917
|
+
for (let [t, n] of Object.entries(e.props)) c[t] = n.description;
|
|
918
|
+
return JSON.stringify({
|
|
919
|
+
name: e.name,
|
|
920
|
+
id: e.id,
|
|
921
|
+
form: e.form,
|
|
922
|
+
title: X(r ? o?.title ?? r.title : a?.title, n, e.name),
|
|
923
|
+
description: X(r ? o?.description ?? r.description : a?.description, n, ""),
|
|
924
|
+
category: r ? o?.category ?? r.category : a?.category ?? "",
|
|
925
|
+
categoryLabel: s(r ? o?.category ?? r.category : a?.category ?? "extension", n),
|
|
926
|
+
insertText: Q(e, n) ?? null,
|
|
927
|
+
inline: r ? r.inline === !0 : e.form === "inline",
|
|
928
|
+
keywords: l(e.name) ?? null,
|
|
929
|
+
manifest: a ?? null,
|
|
930
|
+
preset: r ?? null,
|
|
931
|
+
propDescriptions: c,
|
|
932
|
+
structure: t(e).structure ?? null,
|
|
933
|
+
styles: e.styles ?? null,
|
|
934
|
+
requires: e.requires ?? null
|
|
935
|
+
});
|
|
936
|
+
}
|
|
937
|
+
function _t(e, t = "en") {
|
|
938
|
+
let n = f(e);
|
|
939
|
+
if (!n.ok) return `invalid|${t}`;
|
|
940
|
+
let r = n.registry.map((e) => gt(e, t));
|
|
941
|
+
return `${p(e)}|${t}|${r.join("\0")}`;
|
|
942
|
+
}
|
|
943
|
+
function $(e, t, n, r) {
|
|
944
|
+
return Object.freeze(ht(e.registry, e.externalComponentNames, t, n, r));
|
|
945
|
+
}
|
|
946
|
+
function vt(e, t = "en") {
|
|
947
|
+
let n = d(e), r = f({ config: n });
|
|
948
|
+
if (!r.ok) throw Y(r.message);
|
|
949
|
+
return $(r, t, { config: n }, !0);
|
|
950
|
+
}
|
|
951
|
+
function yt(e, t = "en") {
|
|
952
|
+
let n = d(e), r = f({ config: n });
|
|
953
|
+
if (!r.ok) throw Y(r.message);
|
|
954
|
+
return $(r, t, { config: n }, !1);
|
|
955
|
+
}
|
|
956
|
+
function bt(e, t = "en") {
|
|
957
|
+
let n = f(e);
|
|
958
|
+
return n.ok ? $(n, t, e, !0) : Object.freeze([]);
|
|
959
|
+
}
|
|
960
|
+
function xt(e) {
|
|
961
|
+
let t = new Map(c.map((e, t) => [e.id, t])), n = /* @__PURE__ */ new Map();
|
|
962
|
+
for (let t of e) {
|
|
963
|
+
let e = n.get(t.category);
|
|
964
|
+
e ? e.entries.push(t) : n.set(t.category, {
|
|
965
|
+
id: t.category,
|
|
966
|
+
label: t.categoryLabel,
|
|
967
|
+
entries: [t]
|
|
968
|
+
});
|
|
969
|
+
}
|
|
970
|
+
return Object.freeze([...n.values()].map((e, n) => ({
|
|
971
|
+
...e,
|
|
972
|
+
index: n,
|
|
973
|
+
rank: t.get(e.id) ?? 2 ** 53 - 1
|
|
974
|
+
})).sort((e, t) => e.rank - t.rank || e.index - t.index).map((e) => Object.freeze({
|
|
975
|
+
id: e.id,
|
|
976
|
+
label: e.label,
|
|
977
|
+
entries: Object.freeze([...e.entries])
|
|
978
|
+
})));
|
|
979
|
+
}
|
|
980
|
+
function St(e, t = {}) {
|
|
981
|
+
let n = t.ancestors ?? [], r = n[n.length - 1], i = (r === void 0 ? void 0 : e.find((e) => e.name === r))?.allowedChildren, a = (t.query ?? "").trim().toLowerCase(), o = e.filter((e) => e.parents !== void 0 && e.parents.length > 0 && !e.parents.some((e) => n.includes(e)) || i !== void 0 && i.length > 0 && !i.includes(e.name) ? !1 : a === "" || [
|
|
982
|
+
e.name,
|
|
983
|
+
e.title,
|
|
984
|
+
e.description,
|
|
985
|
+
e.categoryLabel,
|
|
986
|
+
...e.keywords ?? []
|
|
987
|
+
].some((e) => e.toLowerCase().includes(a)));
|
|
988
|
+
return Object.freeze(o);
|
|
989
|
+
}
|
|
990
|
+
function Ct(e) {
|
|
991
|
+
let t = [];
|
|
992
|
+
e.description !== "" && t.push(e.description);
|
|
993
|
+
for (let n of Object.values(e.props)) n.description !== void 0 && t.push(`${n.name}: ${n.description}`);
|
|
994
|
+
return t.join("\n");
|
|
995
|
+
}
|
|
996
|
+
function wt(e, t, n) {
|
|
997
|
+
if (typeof e != "string" || !Number.isFinite(t)) return Object.freeze([]);
|
|
998
|
+
let r = f(n);
|
|
999
|
+
if (!r.ok || r.htmlActive) return Object.freeze([]);
|
|
1000
|
+
let i = Math.max(0, Math.min(e.length, Math.floor(t))), a = Object.freeze([]), o;
|
|
1001
|
+
try {
|
|
1002
|
+
o = ee(e, n);
|
|
1003
|
+
} catch {
|
|
1004
|
+
return a;
|
|
1005
|
+
}
|
|
1006
|
+
let s = (e, t) => {
|
|
1007
|
+
for (let n of e) if ((n.type === "component" || n.type === "hostComponent") && n.name !== void 0 && n.range.start <= i && i < n.range.end) {
|
|
1008
|
+
let e = Object.freeze([...t, n.name]);
|
|
1009
|
+
a = e, n.children && s(n.children, e);
|
|
1010
|
+
} else n.type !== "fallback" && n.children && s(n.children, t);
|
|
1011
|
+
};
|
|
1012
|
+
return s(o.nodes, Object.freeze([])), a;
|
|
1013
|
+
}
|
|
1014
|
+
function Tt(e) {
|
|
1015
|
+
let t = {};
|
|
1016
|
+
if (!e) return t;
|
|
1017
|
+
for (let [n, r] of Object.entries(e.props)) t[n] = Object.freeze({
|
|
1018
|
+
name: n,
|
|
1019
|
+
kind: r.kind,
|
|
1020
|
+
required: r.required === !0,
|
|
1021
|
+
static: r.static === !0,
|
|
1022
|
+
dynamic: r.dynamic === !0,
|
|
1023
|
+
...r.values ? { values: Object.freeze([...r.values]) } : {},
|
|
1024
|
+
...r.default === void 0 ? {} : { defaultValue: r.default }
|
|
1025
|
+
});
|
|
1026
|
+
return t;
|
|
1027
|
+
}
|
|
1028
|
+
function Et(e) {
|
|
1029
|
+
return Object.freeze({
|
|
1030
|
+
name: e.name,
|
|
1031
|
+
form: e.form,
|
|
1032
|
+
paired: e.form !== "leaf",
|
|
1033
|
+
title: e.title,
|
|
1034
|
+
description: e.description,
|
|
1035
|
+
category: e.category,
|
|
1036
|
+
categoryLabel: e.categoryLabel,
|
|
1037
|
+
insertText: e.insertText,
|
|
1038
|
+
props: Object.freeze({ ...e.props }),
|
|
1039
|
+
...e.parents === void 0 ? {} : { parents: Object.freeze([...e.parents]) },
|
|
1040
|
+
...e.allowedChildren === void 0 ? {} : { allowedChildren: Object.freeze([...e.allowedChildren]) },
|
|
1041
|
+
...e.keywords === void 0 ? {} : { keywords: Object.freeze([...e.keywords]) },
|
|
1042
|
+
...e.styles === void 0 ? {} : { styles: Object.freeze([...e.styles]) },
|
|
1043
|
+
...e.requires === void 0 ? {} : { requires: Object.freeze({ ...e.requires }) }
|
|
1044
|
+
});
|
|
1045
|
+
}
|
|
1046
|
+
function Dt(e) {
|
|
1047
|
+
let t = new Map(e.map((e) => [e.name, e])), n = Object.freeze([...e]);
|
|
1048
|
+
return Object.freeze({
|
|
1049
|
+
tags: n,
|
|
1050
|
+
tag(e) {
|
|
1051
|
+
return t.get(e);
|
|
1052
|
+
},
|
|
1053
|
+
attribute(e, n) {
|
|
1054
|
+
return t.get(e)?.props[n];
|
|
1055
|
+
}
|
|
1056
|
+
});
|
|
1057
|
+
}
|
|
1058
|
+
function Ot(e, t = "en") {
|
|
1059
|
+
let n = f(e);
|
|
1060
|
+
if (!n.ok) return Dt([]);
|
|
1061
|
+
let r = [];
|
|
1062
|
+
try {
|
|
1063
|
+
r = $(n, t, e, !1);
|
|
1064
|
+
} catch {
|
|
1065
|
+
r = Object.freeze([]);
|
|
1066
|
+
}
|
|
1067
|
+
let i = new Map(r.map((e) => [e.name, e])), a = [];
|
|
1068
|
+
for (let [e, t] of n.schemaByName) {
|
|
1069
|
+
let n = i.get(e), r = Tt(t);
|
|
1070
|
+
for (let [e, t] of Object.entries(n?.props ?? {})) r[e] = Object.freeze({
|
|
1071
|
+
...r[e],
|
|
1072
|
+
...t
|
|
1073
|
+
});
|
|
1074
|
+
a.push(Et({
|
|
1075
|
+
name: e,
|
|
1076
|
+
form: t.form,
|
|
1077
|
+
title: n?.title ?? e,
|
|
1078
|
+
description: n?.description ?? "",
|
|
1079
|
+
category: n?.category ?? "component",
|
|
1080
|
+
categoryLabel: n?.categoryLabel ?? "component",
|
|
1081
|
+
insertText: n?.insertText ?? "",
|
|
1082
|
+
props: r,
|
|
1083
|
+
...n?.parents === void 0 ? {} : { parents: n.parents },
|
|
1084
|
+
...n?.allowedChildren === void 0 ? {} : { allowedChildren: n.allowedChildren },
|
|
1085
|
+
...n?.keywords === void 0 ? {} : { keywords: n.keywords },
|
|
1086
|
+
...n?.styles === void 0 ? {} : { styles: n.styles },
|
|
1087
|
+
...n?.requires === void 0 ? {} : { requires: n.requires }
|
|
1088
|
+
}));
|
|
1089
|
+
}
|
|
1090
|
+
return Dt(a);
|
|
1091
|
+
}
|
|
1092
|
+
// src/authoring/insert.ts
|
|
1093
|
+
var kt = /[A-Za-z_][A-Za-z0-9_]*/g;
|
|
1094
|
+
function At(e, t, r) {
|
|
1095
|
+
let i = new Set(r.match(kt) ?? []), a = ie(e, t, { diagnostics: !1 }).bindings.filter((e) => e.declarations.length > 0).map((e) => e.name), o = new Set(a), s = e;
|
|
1096
|
+
for (let e of a) {
|
|
1097
|
+
let r = e, a = 2;
|
|
1098
|
+
for (; i.has(r) || n.has(r) || r !== e && o.has(r);) r = `${e}${a}`, a += 1;
|
|
1099
|
+
i.add(r), r !== e && (s = x(s, e, r, t).source);
|
|
1100
|
+
}
|
|
1101
|
+
return s;
|
|
1102
|
+
}
|
|
1103
|
+
function jt(e) {
|
|
1104
|
+
return {
|
|
1105
|
+
id: e.id,
|
|
1106
|
+
label: e.title,
|
|
1107
|
+
description: e.description,
|
|
1108
|
+
group: "input",
|
|
1109
|
+
keywords: [],
|
|
1110
|
+
template: e.insertText
|
|
1512
1111
|
};
|
|
1513
1112
|
}
|
|
1514
|
-
|
|
1113
|
+
function Mt(e, t, n, r) {
|
|
1114
|
+
return B(n, r, At(q(jt(e), n), t, n), { block: !e.inline });
|
|
1115
|
+
}
|
|
1116
|
+
function Nt(e, t, n, r, i = "en") {
|
|
1117
|
+
if (typeof n != "string") throw TypeError("insertLocalComponent requires source text.");
|
|
1118
|
+
if (typeof t != "string" || t.length === 0) throw TypeError("insertLocalComponent requires a component id.");
|
|
1119
|
+
let a = f(e);
|
|
1120
|
+
if (!a.ok) throw Error(`Invalid compile options: ${a.message}`);
|
|
1121
|
+
let o = bt(e, i).find((e) => e.id === t || e.name === t);
|
|
1122
|
+
if (!o) throw Error(`Unknown local component "${t}".`);
|
|
1123
|
+
return Mt(o, e, n, r);
|
|
1124
|
+
}
|
|
1125
|
+
function Pt(e, t, n, r, i = "en") {
|
|
1126
|
+
return Nt({ config: d(e) }, t, n, r, i);
|
|
1127
|
+
}
|
|
1128
|
+
// src/authoring/conformance.ts
|
|
1129
|
+
function Ft(e, t = "en") {
|
|
1130
|
+
let n = d(e), r = new Set(n.components.map((e) => e.name)), i = [], a = { config: n }, o = yt(n, t);
|
|
1131
|
+
for (let e of o) {
|
|
1132
|
+
if (!r.has(e.name)) continue;
|
|
1133
|
+
let t = Mt(e, a, "", {
|
|
1134
|
+
start: 0,
|
|
1135
|
+
end: 0
|
|
1136
|
+
}).value, n = pt(e, o), s = n === void 0 ? t : `${n.before}${t}${n.after}`, c = m(s, a);
|
|
1137
|
+
c.ok || i.push(Object.freeze({
|
|
1138
|
+
id: e.id,
|
|
1139
|
+
name: e.name,
|
|
1140
|
+
message: `Insert template for <${e.name}> does not compile with this configuration.`,
|
|
1141
|
+
diagnostics: Object.freeze(c.diagnostics.map((e) => Object.freeze({
|
|
1142
|
+
code: e.code,
|
|
1143
|
+
message: e.message
|
|
1144
|
+
})))
|
|
1145
|
+
}));
|
|
1146
|
+
}
|
|
1147
|
+
return Object.freeze(i);
|
|
1148
|
+
}
|
|
1149
|
+
export { ze as EXTENDED_NATIVE_COMPONENTS, Be as EXTENDED_NATIVE_COMPONENT_COPY_ZH, te as LOCAL_COMPONENTS, _ as LOCAL_COMPONENT_NAMES, W as NATIVE_COMPONENTS, K as NATIVE_COMPONENTS_ZH, H as NATIVE_COMPONENT_GROUPS, G as NATIVE_COMPONENT_GROUPS_ZH, ie as analyzeLocalSource, e as closestName, ne as completeLocalSource, Ot as createLocalAuthoringLookup, vt as createLocalComponentCatalog, bt as createLocalComponentCatalogForOptions, St as filterLocalComponentCatalog, se as formatBold, he as formatBulletList, pe as formatHeading, de as formatInlineCode, ce as formatItalic, re as formatLocalSource, ge as formatOrderedList, ve as formatQuote, le as formatStrike, _e as formatTaskList, y as getLocalComponent, Ve as getNativeComponentCatalog, g as getPropDefault, ye as indentSelection, we as insertCodeBlock, Oe as insertDivider, Ce as insertImage, Se as insertLink, Pt as insertLocalComponent, Nt as insertLocalComponentFromOptions, De as insertTable, B as insertTemplate, ke as insertText, wt as localCatalogAncestors, xt as localComponentCatalogGroups, _t as localComponentCatalogKey, Ct as localComponentHelp, h as localComponentNames, xe as outdentSelection, Re as readFormatState, x as renameLocalBinding, q as renderNativeSnippet, v as suggestAttribute, b as suggestComponent, Ft as validateLocalComponentInsertTemplates };
|