reactive-md 0.8.0 → 0.9.1
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 +54 -4
- package/CHANGELOG.md +55 -4
- package/CONTRIBUTING-ch.md +13 -2
- package/CONTRIBUTING.md +13 -2
- package/README-ch.md +132 -23
- package/README-en.md +130 -21
- package/README.md +128 -21
- package/SECURITY-ch.md +3 -3
- package/SECURITY.md +3 -3
- package/THIRD_PARTY_NOTICES.md +111 -1
- package/cli/args.mjs +51 -1
- package/cli/assets.mjs +6 -1
- package/cli/build.mjs +125 -9
- package/cli/fs-utils.mjs +3 -3
- package/cli/help.mjs +12 -5
- package/cli/init.mjs +1 -1
- package/cli/package.mjs +1 -0
- package/dist-library/LocalDocumentView-sthUP0ct.js +109 -0
- package/dist-library/LocalDocumentViewCore-GiWV3bey.js +9829 -0
- package/dist-library/LocalReactiveDocumentCore-ZjQSGyHE.js +275 -0
- package/dist-library/{authoring-BsfSwQRm.js → authoring-Dsune4Hy.js} +240 -218
- package/dist-library/compile-wUv8KEge.js +1249 -0
- package/dist-library/{compiler-core-kPiH-gOV.js → compiler-core-As_m-MNm.js} +5372 -5559
- package/dist-library/compiler-eOfcinZs.js +62 -0
- package/dist-library/component-state-BoLCGee4.js +801 -0
- package/dist-library/{component-state-D_cw_EHe.js → component-state-C52ZFJGl.js} +2 -2
- package/dist-library/{registry-B9Jc3FVe.js → config-BadfhjdP.js} +374 -457
- package/dist-library/{config-validation-DXTynAw7.js → config-validation-F47AcE6o.js} +549 -751
- package/dist-library/controls-CcT6n7k_.js +6740 -0
- package/dist-library/coordinate-CWS9p5q_.js +293 -0
- package/dist-library/data-table-Bgccxd7h.js +296 -0
- package/dist-library/{default-components-Z_YMio5P.js → default-components-BwQf0oP-.js} +344 -334
- package/dist-library/{math-display-BJz4gbFc.js → display-B-VhqVND.js} +1299 -1299
- package/dist-library/export-BqVmTXm8.js +369 -0
- package/dist-library/gallery-CY6mTx8i.js +360 -0
- package/dist-library/html-CNT4KD-2.js +757 -0
- package/dist-library/{math-sample-BGEW49zY.js → incremental-Dv0FSp_U.js} +476 -394
- package/dist-library/latex-1w7aQgD5.js +928 -0
- package/dist-library/layout-C0YlEPGr.js +562 -0
- package/dist-library/mount-preset-KxvtKgJb.js +13 -0
- package/dist-library/options-1aDLK7JY.js +121 -0
- package/dist-library/{react-ByOHunUW.js → package-core-WFK1RhAZ.js} +49 -55
- package/dist-library/{parser-standard-DlCk7sLo.js → parser-standard-Yuf3A_VI.js} +6605 -7097
- package/dist-library/plugin-packs-B1XPWcFs.js +18 -0
- package/dist-library/{identity-MYJXKSkB.js → preset-core-CKc5YXSM.js} +31 -31
- package/dist-library/{props-DGlBk0e5.js → props-sJ8vk0cr.js} +1 -1
- package/dist-library/react-BbyAgeXc.js +6070 -0
- package/dist-library/react-D5iGiUdL.js +7 -0
- package/dist-library/reactive-md-authoring.js +222 -223
- package/dist-library/reactive-md-build.js +126 -72
- package/dist-library/reactive-md-compiler-standard.js +12 -10
- package/dist-library/reactive-md-compiler.js +3 -3
- package/dist-library/reactive-md-default-packs.js +2 -2
- package/dist-library/reactive-md-default-preset.js +4 -4
- package/dist-library/reactive-md-export-assets.js +57 -0
- package/dist-library/reactive-md-export.js +5 -111
- package/dist-library/reactive-md-minimal-preset.js +24 -0
- package/dist-library/reactive-md-minimal-react-preset.js +26 -0
- package/dist-library/reactive-md-minimal-styles.js +80 -0
- package/dist-library/reactive-md-minimal.css +2 -0
- package/dist-library/reactive-md-pdf.js +7582 -0
- package/dist-library/reactive-md-plugin-chart.js +13 -0
- package/dist-library/reactive-md-plugin-data.js +17 -0
- package/dist-library/reactive-md-plugin-diagram.js +18 -0
- package/dist-library/reactive-md-plugin-forms.js +18 -0
- package/dist-library/reactive-md-plugin-gallery.js +12 -0
- package/dist-library/reactive-md-plugin-navigation.js +15 -0
- package/dist-library/reactive-md-plugin-network.js +222 -0
- package/dist-library/reactive-md-plugin-plot.js +24 -0
- package/dist-library/reactive-md-print.css +5 -0
- package/dist-library/reactive-md-react-minimal.js +28 -0
- package/dist-library/reactive-md-react-server.js +34 -32
- package/dist-library/reactive-md-react-unstyled.js +14 -9
- package/dist-library/reactive-md-react.js +14 -9
- package/dist-library/reactive-md-runtime-browser.js +847 -15
- package/dist-library/reactive-md-runtime.js +3 -3
- package/dist-library/reactive-md-sdk.js +8 -6
- package/dist-library/reactive-md-standalone-configured.js +16 -0
- package/dist-library/reactive-md-standalone-host.js +9 -438
- package/dist-library/reactive-md-testing-browser.js +5 -4
- package/dist-library/reactive-md-testing-react.js +46 -44
- package/dist-library/reactive-md-testing.js +45 -44
- package/dist-library/reactive-md-vite.js +135 -37
- package/dist-library/reactive-md.css +1 -1
- package/dist-library/reactive-md.js +590 -498
- package/dist-library/registry-B9NGct4d.js +20 -0
- package/dist-library/registry-core-Bbad9Bm2.js +479 -0
- package/dist-library/{resources-BGt8mpDA.js → resources-D2GDQS0p.js} +45 -45
- package/dist-library/{runtime-Dkq7ldyg.js → runtime-B2fxeveq.js} +1 -1
- package/dist-library/runtime-kcA7bG7G.js +1282 -0
- package/dist-library/sample-bP4zHB3L.js +289 -0
- package/dist-library/{schema-ZFufO8V0.js → schema-BufhKUSM.js} +12 -11
- package/dist-library/sdk-core-BoJT1SIt.js +1166 -0
- package/dist-library/session-core-nmJHuR9c.js +452 -0
- package/dist-library/{shareable-DDVL4Fi9.js → shareable-DpbE-59H.js} +250 -283
- package/dist-library/tooltip-layer-HDLrSWs0.js +28 -0
- package/dist-library/types/authoring/catalog.d.ts +2 -3
- package/dist-library/types/authoring/editor-i18n.d.ts +1 -1
- package/dist-library/types/authoring/index.d.ts +1 -1
- package/dist-library/types/authoring/insert.d.ts +1 -1
- package/dist-library/types/authoring/templates.d.ts +2 -2
- package/dist-library/types/build/diagnostics.d.ts +1 -1
- package/dist-library/types/build/host.d.ts +1 -1
- package/dist-library/types/build/index.d.ts +1 -1
- package/dist-library/types/build/notices.d.ts +1 -1
- package/dist-library/types/build/resources.d.ts +1 -1
- package/dist-library/types/build/vite.d.ts +1 -1
- package/dist-library/types/compiler/index.d.ts +2 -2
- package/dist-library/types/compiler/result.d.ts +1 -1
- package/dist-library/types/compiler/standard.d.ts +2 -2
- package/dist-library/types/compiler/types.d.ts +1 -1
- package/dist-library/types/components/{controls.d.ts → controls/controls.d.ts} +2 -3
- package/dist-library/types/components/{numeric-sliders.d.ts → controls/numeric-sliders.d.ts} +1 -1
- package/dist-library/types/components/{gallery.d.ts → gallery/gallery.d.ts} +1 -1
- package/dist-library/types/components/{layout.d.ts → layout/layout.d.ts} +1 -1
- package/dist-library/types/components/minimal-preset.d.ts +2 -0
- package/dist-library/types/components/mount-preset.d.ts +4 -0
- package/dist-library/types/components/network/submit-button.d.ts +10 -0
- package/dist-library/types/components/plot/coordinate.d.ts +2 -0
- package/dist-library/types/components/plugins/chart.d.ts +2 -0
- package/dist-library/types/components/plugins/data.d.ts +2 -0
- package/dist-library/types/components/plugins/diagram.d.ts +2 -0
- package/dist-library/types/components/plugins/forms.d.ts +2 -0
- package/dist-library/types/components/plugins/gallery.d.ts +2 -0
- package/dist-library/types/components/plugins/navigation.d.ts +2 -0
- package/dist-library/types/components/plugins/network.d.ts +2 -0
- package/dist-library/types/components/plugins/plot.d.ts +2 -0
- package/dist-library/types/components/shared/visual-frame.d.ts +12 -0
- package/dist-library/types/components/{visuals.d.ts → shared/visuals.d.ts} +1 -7
- package/dist-library/types/components/{data-table.d.ts → table/data-table.d.ts} +2 -2
- package/dist-library/types/export/component-state.d.ts +1 -1
- package/dist-library/types/export/index.d.ts +2 -1
- package/dist-library/types/export/print-document.d.ts +18 -0
- package/dist-library/types/export/render-markup.d.ts +23 -0
- package/dist-library/types/export/requirements.d.ts +1 -1
- package/dist-library/types/export/resources.d.ts +1 -1
- package/dist-library/types/export/restoration.d.ts +1 -1
- package/dist-library/types/export-assets/index.d.ts +25 -0
- package/dist-library/types/local/compilation/compiler-attributes.d.ts +8 -0
- package/dist-library/types/local/compilation/compiler-bindings.d.ts +19 -0
- package/dist-library/types/local/compilation/compiler-capabilities.d.ts +3 -0
- package/dist-library/types/local/compilation/compiler-core.d.ts +11 -3
- package/dist-library/types/local/compilation/compiler-declarations.d.ts +32 -0
- package/dist-library/types/local/compilation/compiler-expressions.d.ts +32 -0
- package/dist-library/types/local/compilation/compiler-services.d.ts +62 -16
- package/dist-library/types/local/compilation/compiler-structure.d.ts +38 -3
- package/dist-library/types/local/compilation/compiler-tables.d.ts +30 -0
- package/dist-library/types/local/compilation/compiler-validation.d.ts +15 -0
- package/dist-library/types/local/compilation/compiler-values.d.ts +39 -1
- package/dist-library/types/local/compilation/compiler.d.ts +7 -14
- package/dist-library/types/local/compilation/dependencies.d.ts +1 -1
- package/dist-library/types/local/compilation/session/incremental.d.ts +75 -0
- package/dist-library/types/local/{session → compilation/session}/row-reuse.d.ts +1 -1
- package/dist-library/types/local/{session/compiler-cache.d.ts → compilation/session/semantic-cache.d.ts} +5 -19
- package/dist-library/types/local/compilation/streaming.d.ts +27 -0
- package/dist-library/types/local/configuration/capability-policy.d.ts +3 -0
- package/dist-library/types/local/{compilation → configuration}/component-kernel.d.ts +3 -79
- package/dist-library/types/local/configuration/diagnostic-messages.d.ts +1104 -1056
- package/dist-library/types/local/configuration/diagnostic-runtime-messages.d.ts +731 -0
- package/dist-library/types/local/configuration/diagnostics.d.ts +1 -1
- package/dist-library/types/local/configuration/kernel-value-rules.d.ts +66 -0
- package/dist-library/types/local/configuration/official-leaf-syntax.d.ts +24 -0
- package/dist-library/types/local/configuration/options-core.d.ts +5 -4
- package/dist-library/types/local/configuration/options.d.ts +2 -1
- package/dist-library/types/local/configuration/portable-options.d.ts +1 -1
- package/dist-library/types/local/configuration/schema-core.d.ts +1 -1
- package/dist-library/types/local/configuration/schema.d.ts +1 -1
- package/dist-library/types/local/css/author-css.d.ts +66 -0
- package/dist-library/types/local/evaluation/computations.d.ts +2 -2
- package/dist-library/types/local/evaluation/expression/compile.d.ts +30 -0
- package/dist-library/types/local/evaluation/expression/evaluation.d.ts +3 -0
- package/dist-library/types/local/evaluation/expression/inference.d.ts +4 -0
- package/dist-library/types/local/evaluation/expression/syntax.d.ts +72 -0
- package/dist-library/types/local/evaluation/expression/values.d.ts +56 -0
- package/dist-library/types/local/evaluation/{math-display.d.ts → math/display.d.ts} +2 -2
- package/dist-library/types/local/evaluation/math/evaluation.d.ts +10 -0
- package/dist-library/types/local/evaluation/{math.d.ts → math/latex.d.ts} +58 -17
- package/dist-library/types/local/evaluation/{math-sample.d.ts → math/sample.d.ts} +4 -2
- package/dist-library/types/local/evaluation/math/syntax.d.ts +72 -0
- package/dist-library/types/local/evaluation/validation.d.ts +1 -1
- package/dist-library/types/local/html/extended-fragment.d.ts +41 -0
- package/dist-library/types/local/html/html-details.d.ts +1 -1
- package/dist-library/types/local/html/html-entities.d.ts +11 -2
- package/dist-library/types/local/html/html-recovery.d.ts +1 -1
- package/dist-library/types/local/html/html-table.d.ts +1 -1
- package/dist-library/types/local/html/html.d.ts +40 -4
- package/dist-library/types/local/index.d.ts +14 -13
- package/dist-library/types/local/parsing/author-markdown.d.ts +11 -0
- package/dist-library/types/local/{markdown → parsing}/fast-markdown.d.ts +1 -1
- package/dist-library/types/local/{markdown → parsing}/footnotes.d.ts +1 -1
- package/dist-library/types/local/{markdown → parsing}/heading-anchors.d.ts +1 -1
- package/dist-library/types/local/parsing/html-attributes.d.ts +14 -0
- package/dist-library/types/local/parsing/parse-budget.d.ts +1 -1
- package/dist-library/types/local/{session → parsing}/parse-session.d.ts +5 -5
- package/dist-library/types/local/parsing/parser-capabilities.d.ts +7 -2
- package/dist-library/types/local/parsing/parser-convert.d.ts +26 -0
- package/dist-library/types/local/parsing/parser-core.d.ts +10 -4
- package/dist-library/types/local/parsing/parser-internals.d.ts +54 -0
- package/dist-library/types/local/parsing/parser-region.d.ts +46 -0
- package/dist-library/types/local/parsing/parser-standard.d.ts +3 -0
- package/dist-library/types/local/parsing/parser-tags.d.ts +108 -0
- package/dist-library/types/local/parsing/parser.d.ts +3 -3
- package/dist-library/types/local/{markdown → parsing}/plain-paragraphs.d.ts +1 -1
- package/dist-library/types/local/parsing/rmd-recovery.d.ts +1 -1
- package/dist-library/types/local/parsing/theme-declaration.d.ts +22 -0
- package/dist-library/types/local/rendering/document/ExtendedHtmlFragment.d.ts +14 -0
- package/dist-library/types/local/rendering/document/LocalDocumentView.d.ts +5 -0
- package/dist-library/types/local/rendering/{LocalDocumentView.d.ts → document/LocalDocumentViewCore.d.ts} +48 -9
- package/dist-library/types/local/rendering/document/LocalReactiveDocumentCore.d.ts +6 -0
- package/dist-library/types/local/rendering/document/render-nodes.d.ts +24 -0
- package/dist-library/types/local/rendering/document/use-author-script.d.ts +3 -0
- package/dist-library/types/local/rendering/document/use-color-scheme.d.ts +10 -0
- package/dist-library/types/local/rendering/document/validation-state.d.ts +31 -0
- package/dist-library/types/local/rendering/document/view-render-context.d.ts +146 -0
- package/dist-library/types/local/rendering/{view-revision.d.ts → document/view-revision.d.ts} +31 -4
- package/dist-library/types/local/rendering/render-types.d.ts +1 -1
- package/dist-library/types/local/{widgets/table-surface.d.ts → rendering/table/data-table.d.ts} +3 -0
- package/dist-library/types/local/rendering/table/table-numeric-columns.d.ts +7 -0
- package/dist-library/types/local/runtime/author-script-protocol.d.ts +59 -0
- package/dist-library/types/local/runtime/retention.d.ts +1 -1
- package/dist-library/types/local/runtime/runtime-document.d.ts +71 -0
- package/dist-library/types/local/runtime/runtime-migration.d.ts +19 -0
- package/dist-library/types/local/runtime/runtime-values.d.ts +39 -0
- package/dist-library/types/local/runtime/runtime.d.ts +4 -2
- package/dist-library/types/local/runtime/state.d.ts +1 -1
- package/dist-library/types/local/source/authoring-syntax.d.ts +48 -0
- package/dist-library/types/local/source/authoring.d.ts +1 -1
- package/dist-library/types/local/source/source-context.d.ts +23 -0
- package/dist-library/types/local/source/source-migration.d.ts +2 -2
- package/dist-library/types/local/transport/compile-patch.d.ts +1 -1
- package/dist-library/types/local/transport/flat-compiled-data.d.ts +1 -1
- package/dist-library/types/local/transport/shared-data.d.ts +1 -1
- package/dist-library/types/local/transport/worker-handler.d.ts +30 -0
- package/dist-library/types/local/transport/worker-job.d.ts +28 -0
- package/dist-library/types/local/transport/worker.d.ts +32 -46
- package/dist-library/types/local/{contracts/types.d.ts → types.d.ts} +78 -21
- package/dist-library/types/pdf.d.ts +22 -0
- package/dist-library/types/presets/identity.d.ts +1 -0
- package/dist-library/types/presets/minimal.d.ts +2 -0
- package/dist-library/types/presets/plugin-packs.d.ts +1 -0
- package/dist-library/types/react/component-api.d.ts +20 -4
- package/dist-library/types/react/component-primitives.d.ts +10 -10
- package/dist-library/types/react/component-utils.d.ts +9 -1
- package/dist-library/types/react/index.d.ts +6 -5
- package/dist-library/types/{local/theme/i18n.d.ts → react/localization.d.ts} +2 -2
- package/dist-library/types/react/minimal.d.ts +13 -0
- package/dist-library/types/react/package-core.d.ts +67 -0
- package/dist-library/types/react/package.d.ts +3 -67
- package/dist-library/types/react/runtime/common.d.ts +1 -1
- package/dist-library/types/react/sdk-core.d.ts +115 -0
- package/dist-library/types/react/sdk.d.ts +4 -110
- package/dist-library/types/react/server.d.ts +2 -2
- package/dist-library/types/react/use-draft-field.d.ts +5 -1
- package/dist-library/types/runtime-services/browser/duplex.d.ts +163 -0
- package/dist-library/types/runtime-services/browser/http-sse.d.ts +117 -0
- package/dist-library/types/runtime-services/browser/index.d.ts +2 -1
- package/dist-library/types/runtime-services/component-state.d.ts +1 -1
- package/dist-library/types/runtime-services/index.d.ts +2 -0
- package/dist-library/types/runtime-services/network.d.ts +86 -0
- package/dist-library/types/runtime-services/runtime.d.ts +1 -1
- package/dist-library/types/sdk/config.d.ts +1 -1
- package/dist-library/types/sdk/index.d.ts +1 -0
- package/dist-library/types/sdk/props.d.ts +1 -1
- package/dist-library/types/sdk/registry-core.d.ts +1 -1
- package/dist-library/types/sdk/theme.d.ts +5 -4
- package/dist-library/types/sdk/types.d.ts +2 -2
- package/dist-library/types/shareable.d.ts +6 -5
- package/dist-library/types/standalone/diagnostics.d.ts +1 -1
- package/dist-library/types/standalone/host.d.ts +5 -0
- package/dist-library/types/standalone/payload.d.ts +1 -1
- package/dist-library/types/standalone/prepare.d.ts +2 -2
- package/dist-library/types/standalone/session-core.d.ts +68 -0
- package/dist-library/types/standalone/session.d.ts +6 -68
- package/dist-library/types/themes/contract.d.ts +7 -0
- package/dist-library/types/{local/theme/theme.d.ts → themes/document-theme.d.ts} +4 -3
- package/dist-library/types/vite/client.d.ts +19 -0
- package/dist-library/types/vite/index.d.ts +18 -3
- package/dist-library/types/vite/registration.d.ts +2 -2
- package/dist-library/{types-BFCrMrg0.js → types-BeNtPqdY.js} +1 -1
- package/dist-library/validation-BEBA_HvS.js +1121 -0
- package/dist-library/visual-frame-CyV1FXzs.js +48 -0
- package/dist-library/visuals-B5KSafVk.js +3 -0
- package/dist-library/visuals-BZbZYA7w.js +72572 -0
- package/dist-standalone/reactive-md-standalone.css +1 -1
- package/dist-standalone/reactive-md-standalone.js +146 -137
- package/docs/README-ch.md +16 -11
- package/docs/README.md +16 -11
- package/docs/compatibility/compatibility-ch.md +8 -8
- package/docs/compatibility/compatibility-en.md +8 -8
- package/docs/compatibility/source-versioning-ch.md +1 -1
- package/docs/compatibility/source-versioning-en.md +1 -1
- package/docs/development/component-development-ch.md +2 -2
- package/docs/development/component-development-en.md +2 -2
- package/docs/development/component-development-reference-ch.md +4 -4
- package/docs/development/component-development-reference-en.md +4 -4
- package/docs/development/component-protocol-ch.md +14 -14
- package/docs/development/component-protocol-en.md +14 -14
- package/docs/development/extension-tutorial-ch.md +308 -0
- package/docs/development/extension-tutorial-en.md +308 -0
- package/docs/development/local-module-layout-ch.md +10 -50
- package/docs/development/local-module-layout-en.md +9 -49
- package/docs/development/performance-overview-ch.md +174 -154
- package/docs/development/performance-overview-en.md +174 -154
- package/docs/guides/local-guide-ch.md +2 -2
- package/docs/guides/local-guide-en.md +2 -2
- package/docs/integration/author-tools-ch.md +2 -2
- package/docs/integration/author-tools-en.md +2 -2
- package/docs/integration/compiler-ch.md +4 -2
- package/docs/integration/compiler-en.md +4 -2
- package/docs/integration/directory-discovery-ch.md +5 -1
- package/docs/integration/directory-discovery-en.md +5 -1
- package/docs/integration/editor-ch.md +35 -5
- package/docs/integration/editor-en.md +42 -4
- package/docs/integration/extension-sdk-ch.md +6 -4
- package/docs/integration/extension-sdk-en.md +6 -4
- package/docs/integration/local-integration-ch.md +201 -19
- package/docs/integration/local-integration-en.md +194 -18
- package/docs/integration/network-host-ch.md +75 -0
- package/docs/integration/network-host-en.md +75 -0
- package/docs/integration/shareable-export-ch.md +58 -16
- package/docs/integration/shareable-export-en.md +57 -15
- package/docs/reference/html-compatibility-ch.md +20 -67
- package/docs/reference/html-compatibility-en.md +19 -64
- package/docs/reference/local-interaction-syntax-ch.md +199 -26
- package/docs/reference/local-interaction-syntax-en.md +194 -27
- package/docs/reference/public-api-ch.md +416 -0
- package/docs/reference/public-api-en.md +416 -0
- package/docs/reference/theme-protocol-ch.md +27 -8
- package/docs/reference/theme-protocol-en.md +46 -8
- package/docs/releases/release-0.4.0-ch.md +2 -2
- package/docs/releases/release-0.4.0-en.md +2 -2
- package/docs/releases/release-0.8.0-ch.md +19 -3
- package/docs/releases/release-0.8.0-en.md +19 -3
- package/docs/releases/release-0.9.0-ch.md +44 -0
- package/docs/releases/release-0.9.0-en.md +44 -0
- package/docs/releases/release-0.9.1-ch.md +29 -0
- package/docs/releases/release-0.9.1-en.md +29 -0
- package/examples/component-package/README-ch.md +1 -1
- package/examples/component-package/README.md +1 -1
- package/examples/conformance/README-ch.md +3 -3
- package/examples/conformance/README.md +3 -3
- package/examples/game-2048-package/README-ch.md +3 -9
- package/examples/game-2048-package/README.md +8 -12
- package/examples/integration/README-ch.md +21 -2
- package/examples/integration/README.md +21 -2
- package/examples/integration/extension-sdk/README-ch.md +1 -1
- package/examples/integration/extension-sdk/README.md +1 -1
- package/examples/integration/streaming/index.html +48 -0
- package/examples/integration/streaming/main.js +175 -0
- package/examples/integration/streaming/package.json +13 -0
- package/examples/integration/streaming/worker.js +3 -0
- package/examples/local/README-ch.md +3 -3
- package/examples/local/README.md +2 -2
- package/examples/local/minimal-budget.reactive.md +48 -0
- package/examples/minimal-extension/README-ch.md +78 -0
- package/examples/minimal-extension/README.md +78 -0
- package/examples/minimal-extension/index.html +15 -0
- package/examples/minimal-extension/package.json +26 -0
- package/examples/minimal-extension/sample/document.reactive.md +10 -0
- package/examples/minimal-extension/scripts/build.mjs +32 -0
- package/examples/minimal-extension/scripts/export.mjs +72 -0
- package/examples/minimal-extension/scripts/test-node.mjs +75 -0
- package/examples/minimal-extension/src/extension.tsx +90 -0
- package/examples/minimal-extension/src/preview.tsx +12 -0
- package/examples/minimal-extension/src/source.ts +4 -0
- package/examples/minimal-extension/tsconfig.json +14 -0
- package/examples/network-survey/README.md +200 -0
- package/examples/network-survey/index.html +49 -0
- package/examples/network-survey/package.json +26 -0
- package/examples/network-survey/sample/document.reactive.md +51 -0
- package/examples/network-survey/src/components.tsx +325 -0
- package/examples/network-survey/src/host.ts +316 -0
- package/examples/network-survey/src/main.tsx +91 -0
- package/examples/network-survey/src/source.ts +1 -0
- package/examples/network-survey/tsconfig.json +26 -0
- package/examples/network-survey/vite.config.ts +227 -0
- package/examples/sci-fi-theme/README-ch.md +4 -2
- package/examples/sci-fi-theme/README.md +4 -2
- package/examples/sci-fi-theme/demo/acceptance.reactive.md +454 -0
- package/examples/sci-fi-theme/demo/demo.css +129 -23
- package/examples/sci-fi-theme/demo/document.reactive.md +27 -6
- package/examples/sci-fi-theme/demo/main.tsx +45 -10
- package/examples/sci-fi-theme/docs/design-system-ch.md +6 -6
- package/examples/sci-fi-theme/package.json +2 -1
- package/examples/sci-fi-theme/src/components.css +1064 -154
- package/examples/sci-fi-theme/src/notch.css +142 -0
- package/examples/sci-fi-theme/src/sci-fi.css +3 -1
- package/examples/sci-fi-theme/src/theme.ts +2 -0
- package/examples/sci-fi-theme/src/tokens.css +512 -408
- package/examples/tetris-package/README-ch.md +4 -4
- package/examples/tetris-package/README.md +4 -4
- package/package.json +70 -3
- package/dist-library/LocalDocumentView-6trX7xJc.js +0 -97920
- package/dist-library/compiler--ea2CKQF.js +0 -61
- package/dist-library/component-state-Cq2K5gkS.js +0 -490
- package/dist-library/options-CX5m5n-J.js +0 -115
- package/dist-library/runtime-C-sbfpOX.js +0 -1157
- package/dist-library/types/local/contracts/locale.d.ts +0 -1
- package/dist-library/types/local/contracts/version.d.ts +0 -2
- package/dist-library/types/local/evaluation/dates.d.ts +0 -2
- package/dist-library/types/local/evaluation/expression.d.ts +0 -47
- package/dist-library/types/local/markdown/markdown-structure.d.ts +0 -3
- package/dist-library/types/local/rendering/legacy-component-adapter.d.ts +0 -36
- package/dist-library/types/local/session/incremental.d.ts +0 -48
- package/dist-library/types/local/source/node-walk.d.ts +0 -3
- package/dist-library/types/local/source/text-length.d.ts +0 -13
- package/dist-library/types/local/theme/theme-name.d.ts +0 -3
- package/dist-library/types/local/widgets/visuals.d.ts +0 -25
- package/dist-library/types/react/default-theme.d.ts +0 -6
- package/dist-library/validation-W-bmny-x.js +0 -2253
- package/docs/development/releasing-ch.md +0 -12
- package/docs/development/releasing-en.md +0 -12
- package/docs/integration/codemirror-ch.md +0 -52
- package/docs/integration/codemirror-en.md +0 -29
- package/docs/integration/repository-split-ch.md +0 -40
- package/docs/integration/repository-split-en.md +0 -23
- package/docs/reference/computations-formatting-ch.md +0 -89
- package/docs/reference/computations-formatting-en.md +0 -89
- package/docs/reference/constraints-collections-ch.md +0 -104
- package/docs/reference/constraints-collections-en.md +0 -104
- package/docs/reference/local-components-v2-ch.md +0 -140
- package/docs/reference/local-components-v2-en.md +0 -106
- package/docs/reference/tolerance-ch.md +0 -64
- package/docs/reference/tolerance-en.md +0 -57
- /package/dist-library/types/components/{chart-motion.d.ts → chart/chart-motion.d.ts} +0 -0
- /package/dist-library/types/components/{default-chart-types.d.ts → chart/default-chart-types.d.ts} +0 -0
- /package/dist-library/types/components/{default-chart.d.ts → chart/default-chart.d.ts} +0 -0
- /package/dist-library/types/components/{diagram-inspector.d.ts → diagram/diagram-inspector.d.ts} +0 -0
- /package/dist-library/types/{local/widgets/diagram-layout.d.ts → components/diagram/layout.d.ts} +0 -0
- /package/dist-library/types/components/{mafs-plot-grid.d.ts → plot/mafs-plot-grid.d.ts} +0 -0
- /package/dist-library/types/components/{mafs-visuals.d.ts → plot/mafs-visuals.d.ts} +0 -0
- /package/dist-library/types/components/{use-hydrated.d.ts → shared/use-hydrated.d.ts} +0 -0
- /package/dist-library/types/local/{theme/colors.d.ts → configuration/color-values.d.ts} +0 -0
- /package/dist-library/types/local/evaluation/{collection-functions.d.ts → expression/collection-functions.d.ts} +0 -0
- /package/dist-library/types/local/evaluation/{data-functions.d.ts → expression/data-functions.d.ts} +0 -0
- /package/dist-library/types/local/evaluation/{formatting.d.ts → expression/formatting.d.ts} +0 -0
- /package/dist-library/types/local/{markdown → parsing}/markdown-blocks.d.ts +0 -0
- /package/dist-library/types/local/{widgets → rendering/code}/code-block.d.ts +0 -0
- /package/dist-library/types/local/{widgets → rendering/code}/code-languages.d.ts +0 -0
- /package/dist-library/types/local/{widgets → rendering/image}/image-view.d.ts +0 -0
- /package/dist-library/types/local/{widgets → rendering}/math-view.d.ts +0 -0
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { t as
|
|
7
|
-
import {
|
|
8
|
-
import { i as
|
|
1
|
+
import { b as e } from "./config-validation-F47AcE6o.js";
|
|
2
|
+
import { o as t } from "./compile-wUv8KEge.js";
|
|
3
|
+
import { t as n } from "./registry-core-Bbad9Bm2.js";
|
|
4
|
+
import { a as r, c as i, d as a, i as o, l as s, o as c, s as l, u } from "./default-components-BwQf0oP-.js";
|
|
5
|
+
import { s as d } from "./config-BadfhjdP.js";
|
|
6
|
+
import { r as f, t as p } from "./options-1aDLK7JY.js";
|
|
7
|
+
import { t as m } from "./compiler-eOfcinZs.js";
|
|
8
|
+
import { i as h, n as ee, r as g, t as _ } from "./authoring-Dsune4Hy.js";
|
|
9
|
+
import { a as v, c as te, i as y, n as ne, o as re, r as ie, s as ae, t as oe } from "./schema-BufhKUSM.js";
|
|
9
10
|
// src/authoring/editor-i18n.ts
|
|
10
|
-
var
|
|
11
|
+
var b = {
|
|
11
12
|
en: {
|
|
12
13
|
boldPlaceholder: "bold text",
|
|
13
14
|
italicPlaceholder: "italic text",
|
|
@@ -56,11 +57,11 @@ var ae = {
|
|
|
56
57
|
}
|
|
57
58
|
};
|
|
58
59
|
// src/authoring/editor-commands.ts
|
|
59
|
-
function
|
|
60
|
+
function x(e, t) {
|
|
60
61
|
return typeof e != "number" || Number.isNaN(e) ? 0 : Math.min(Math.max(Math.trunc(e), 0), t);
|
|
61
62
|
}
|
|
62
|
-
function
|
|
63
|
-
let n =
|
|
63
|
+
function S(e, t) {
|
|
64
|
+
let n = x(t.start, e.length), r = x(t.end, e.length);
|
|
64
65
|
return n <= r ? {
|
|
65
66
|
start: n,
|
|
66
67
|
end: r
|
|
@@ -69,14 +70,14 @@ function C(e, t) {
|
|
|
69
70
|
end: n
|
|
70
71
|
};
|
|
71
72
|
}
|
|
72
|
-
function
|
|
73
|
-
return
|
|
73
|
+
function C(e) {
|
|
74
|
+
return b[e] ?? b.en;
|
|
74
75
|
}
|
|
75
|
-
function
|
|
76
|
+
function w(e, t) {
|
|
76
77
|
return t <= 0 ? 0 : e.lastIndexOf("\n", t - 1) + 1;
|
|
77
78
|
}
|
|
78
|
-
function
|
|
79
|
-
let n =
|
|
79
|
+
function T(e, t) {
|
|
80
|
+
let n = w(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;
|
|
80
81
|
for (;;) {
|
|
81
82
|
let t = e.indexOf("\n", s), n = t === -1 || t > a ? a : t;
|
|
82
83
|
if (o.push({
|
|
@@ -88,7 +89,7 @@ function E(e, t) {
|
|
|
88
89
|
}
|
|
89
90
|
return o;
|
|
90
91
|
}
|
|
91
|
-
function
|
|
92
|
+
function E(e, t, n) {
|
|
92
93
|
if (n.length === 0) return {
|
|
93
94
|
value: e,
|
|
94
95
|
selection: t
|
|
@@ -122,7 +123,7 @@ function D(e, t, n) {
|
|
|
122
123
|
}
|
|
123
124
|
};
|
|
124
125
|
}
|
|
125
|
-
function
|
|
126
|
+
function D(e, t, n, r) {
|
|
126
127
|
return t === e.text ? null : {
|
|
127
128
|
start: e.start,
|
|
128
129
|
end: e.end,
|
|
@@ -131,13 +132,13 @@ function O(e, t, n, r) {
|
|
|
131
132
|
newPrefixLength: r
|
|
132
133
|
};
|
|
133
134
|
}
|
|
134
|
-
function
|
|
135
|
+
function se(e, t, n, r) {
|
|
135
136
|
return n === "*" ? r ? e[t.start - 1] !== "*" && e[t.end] !== "*" : e[t.start - n.length - 1] !== "*" && e[t.end + n.length] !== "*" : !0;
|
|
136
137
|
}
|
|
137
|
-
function
|
|
138
|
-
let i =
|
|
138
|
+
function O(e, t, n, r) {
|
|
139
|
+
let i = S(e, t), a = n.length, { start: o, end: s } = i, c = e.slice(o, s);
|
|
139
140
|
if (o !== s) {
|
|
140
|
-
if (c.length >= a * 2 && c.startsWith(n) && c.endsWith(n) && (n !== "*" || !c.startsWith("**") && !c.endsWith("**")) &&
|
|
141
|
+
if (c.length >= a * 2 && c.startsWith(n) && c.endsWith(n) && (n !== "*" || !c.startsWith("**") && !c.endsWith("**")) && se(e, i, n, !0)) {
|
|
141
142
|
let t = c.slice(a, c.length - a);
|
|
142
143
|
return {
|
|
143
144
|
value: e.slice(0, o) + t + e.slice(s),
|
|
@@ -148,7 +149,7 @@ function k(e, t, n, r) {
|
|
|
148
149
|
};
|
|
149
150
|
}
|
|
150
151
|
let t = o - a, r = s + a;
|
|
151
|
-
return t >= 0 && r <= e.length && e.slice(t, o) === n && e.slice(s, r) === n &&
|
|
152
|
+
return t >= 0 && r <= e.length && e.slice(t, o) === n && e.slice(s, r) === n && se(e, i, n, !1) ? {
|
|
152
153
|
value: e.slice(0, t) + c + e.slice(r),
|
|
153
154
|
selection: {
|
|
154
155
|
start: t,
|
|
@@ -171,39 +172,39 @@ function k(e, t, n, r) {
|
|
|
171
172
|
}
|
|
172
173
|
};
|
|
173
174
|
}
|
|
174
|
-
function se(e, t, n = "en") {
|
|
175
|
-
return k(e, t, "**", w(n).boldPlaceholder);
|
|
176
|
-
}
|
|
177
175
|
function ce(e, t, n = "en") {
|
|
178
|
-
return
|
|
176
|
+
return O(e, t, "**", C(n).boldPlaceholder);
|
|
179
177
|
}
|
|
180
178
|
function le(e, t, n = "en") {
|
|
181
|
-
return
|
|
179
|
+
return O(e, t, "*", C(n).italicPlaceholder);
|
|
180
|
+
}
|
|
181
|
+
function ue(e, t, n = "en") {
|
|
182
|
+
return O(e, t, "~~", C(n).strikePlaceholder);
|
|
182
183
|
}
|
|
183
|
-
function
|
|
184
|
+
function k(e) {
|
|
184
185
|
let t = 0;
|
|
185
186
|
for (let n of e.match(/`+/g) ?? []) t = Math.max(t, n.length);
|
|
186
187
|
return t;
|
|
187
188
|
}
|
|
188
|
-
function
|
|
189
|
+
function A(e, t, n) {
|
|
189
190
|
let r = 0;
|
|
190
191
|
for (; e[t] === "`";) r += 1, t += n;
|
|
191
192
|
return r;
|
|
192
193
|
}
|
|
193
|
-
function
|
|
194
|
-
let { start: n, end: r } = t, i = e.slice(n, r), a =
|
|
194
|
+
function de(e, t) {
|
|
195
|
+
let { start: n, end: r } = t, i = e.slice(n, r), a = A(e, n - 1, -1), o = A(e, r, 1), s = a > 0 && a === o ? {
|
|
195
196
|
run: a,
|
|
196
197
|
padding: 0
|
|
197
|
-
} : null, c =
|
|
198
|
+
} : null, c = A(e, n - 2, -1), l = A(e, r + 1, 1), u = e[n - 1] === " " && e[r] === " " && c > 0 && c === l ? {
|
|
198
199
|
run: c,
|
|
199
200
|
padding: 1
|
|
200
201
|
} : null, d = s ?? u;
|
|
201
|
-
return !d ||
|
|
202
|
+
return !d || k(i) >= d.run ? null : d;
|
|
202
203
|
}
|
|
203
|
-
function
|
|
204
|
-
let r =
|
|
204
|
+
function fe(e, t, n = "en") {
|
|
205
|
+
let r = S(e, t), { start: i, end: a } = r, o = e.slice(i, a);
|
|
205
206
|
if (i === a) {
|
|
206
|
-
let t =
|
|
207
|
+
let t = C(n).inlineCodePlaceholder, r = `\`${t}\``;
|
|
207
208
|
return {
|
|
208
209
|
value: e.slice(0, i) + r + e.slice(a),
|
|
209
210
|
selection: {
|
|
@@ -212,8 +213,8 @@ function de(e, t, n = "en") {
|
|
|
212
213
|
}
|
|
213
214
|
};
|
|
214
215
|
}
|
|
215
|
-
let s =
|
|
216
|
-
if (s > 0 && s === c && o.length >= s * 2 &&
|
|
216
|
+
let s = A(o, 0, 1), c = A(o, o.length - 1, -1);
|
|
217
|
+
if (s > 0 && s === c && o.length >= s * 2 && k(o.slice(s, o.length - s)) < s) {
|
|
217
218
|
let t = o.slice(s, o.length - s);
|
|
218
219
|
return t.startsWith(" ") && t.endsWith(" ") && t.trim().length > 0 && (t = t.slice(1, -1)), {
|
|
219
220
|
value: e.slice(0, i) + t + e.slice(a),
|
|
@@ -223,7 +224,7 @@ function de(e, t, n = "en") {
|
|
|
223
224
|
}
|
|
224
225
|
};
|
|
225
226
|
}
|
|
226
|
-
let l =
|
|
227
|
+
let l = de(e, r);
|
|
227
228
|
if (l) {
|
|
228
229
|
let t = l.run + l.padding;
|
|
229
230
|
return {
|
|
@@ -234,7 +235,7 @@ function de(e, t, n = "en") {
|
|
|
234
235
|
}
|
|
235
236
|
};
|
|
236
237
|
}
|
|
237
|
-
let u = "`".repeat(
|
|
238
|
+
let u = "`".repeat(k(o) + 1), d = /^[` ]|[` ]$/.test(o) ? " " : "", f = u + d;
|
|
238
239
|
return {
|
|
239
240
|
value: e.slice(0, i) + f + o + d + u + e.slice(a),
|
|
240
241
|
selection: {
|
|
@@ -243,19 +244,19 @@ function de(e, t, n = "en") {
|
|
|
243
244
|
}
|
|
244
245
|
};
|
|
245
246
|
}
|
|
246
|
-
var
|
|
247
|
-
function
|
|
248
|
-
let r =
|
|
249
|
-
for (let t of
|
|
250
|
-
let e =
|
|
247
|
+
var pe = /^(#{1,6})[ \t]+/;
|
|
248
|
+
function me(e, t, n) {
|
|
249
|
+
let r = S(e, t), i = [];
|
|
250
|
+
for (let t of T(e, r)) {
|
|
251
|
+
let e = pe.exec(t.text), r = e ? e[0].length : 0;
|
|
251
252
|
if (n === 0 && !e) continue;
|
|
252
|
-
let a = t.text.slice(r), o = n === 0 ? "" : `${"#".repeat(n)} `, s =
|
|
253
|
+
let a = t.text.slice(r), o = n === 0 ? "" : `${"#".repeat(n)} `, s = D(t, o + a, r, o.length);
|
|
253
254
|
s && i.push(s);
|
|
254
255
|
}
|
|
255
|
-
return
|
|
256
|
+
return E(e, r, i);
|
|
256
257
|
}
|
|
257
|
-
var
|
|
258
|
-
function
|
|
258
|
+
var j = /^([ \t]*)([-*+] )/, M = /^([ \t]*)(\d+[.)] )/, N = /^([ \t]*)([-*+] \[[ xX]\] )/, P = /^([ \t]*)(> ?)/;
|
|
259
|
+
function F(e, t) {
|
|
259
260
|
let n = t.exec(e);
|
|
260
261
|
if (!n) return null;
|
|
261
262
|
let r = n[1] ?? "", i = n[2] ?? "";
|
|
@@ -265,12 +266,12 @@ function I(e, t) {
|
|
|
265
266
|
prefixLength: r.length + i.length
|
|
266
267
|
};
|
|
267
268
|
}
|
|
268
|
-
function
|
|
269
|
+
function he(e) {
|
|
269
270
|
let t = /^[ \t]*/.exec(e);
|
|
270
271
|
return t ? t[0] : "";
|
|
271
272
|
}
|
|
272
|
-
function
|
|
273
|
-
let i =
|
|
273
|
+
function I(e, t, n, r) {
|
|
274
|
+
let i = S(e, t), a = T(e, i), o = a.map((e) => n(e.text)), s = 0, c = !0;
|
|
274
275
|
for (let e = 0; e < a.length; e += 1) {
|
|
275
276
|
let t = a[e];
|
|
276
277
|
(o[e] || t.text.trim().length > 0) && (s += 1, o[e] || (c = !1));
|
|
@@ -280,30 +281,30 @@ function L(e, t, n, r) {
|
|
|
280
281
|
let t = a[e], n = o[e] ?? null;
|
|
281
282
|
if (l) {
|
|
282
283
|
if (!n) continue;
|
|
283
|
-
let e =
|
|
284
|
+
let e = D(t, n.indent + t.text.slice(n.prefixLength), n.prefixLength, n.indent.length);
|
|
284
285
|
e && u.push(e);
|
|
285
286
|
continue;
|
|
286
287
|
}
|
|
287
|
-
let i = n ? n.indent :
|
|
288
|
+
let i = n ? n.indent : he(t.text), s = t.text.slice(n ? n.prefixLength : i.length), c = r(i, e + 1), d = D(t, i + c + s, n ? n.prefixLength : i.length, i.length + c.length);
|
|
288
289
|
d && u.push(d);
|
|
289
290
|
}
|
|
290
|
-
return
|
|
291
|
-
}
|
|
292
|
-
function he(e, t) {
|
|
293
|
-
return L(e, t, (e) => I(e, M), () => "- ");
|
|
291
|
+
return E(e, i, u);
|
|
294
292
|
}
|
|
295
293
|
function ge(e, t) {
|
|
296
|
-
return
|
|
294
|
+
return I(e, t, (e) => F(e, j), () => "- ");
|
|
297
295
|
}
|
|
298
296
|
function _e(e, t) {
|
|
299
|
-
return
|
|
297
|
+
return I(e, t, (e) => F(e, M), (e, t) => `${t}. `);
|
|
300
298
|
}
|
|
301
299
|
function ve(e, t) {
|
|
302
|
-
return
|
|
300
|
+
return I(e, t, (e) => F(e, N), () => "- [ ] ");
|
|
303
301
|
}
|
|
304
302
|
function ye(e, t) {
|
|
305
|
-
|
|
306
|
-
|
|
303
|
+
return I(e, t, (e) => F(e, P), () => "> ");
|
|
304
|
+
}
|
|
305
|
+
function be(e, t) {
|
|
306
|
+
let n = S(e, t);
|
|
307
|
+
return E(e, n, T(e, n).map((e) => ({
|
|
307
308
|
start: e.start,
|
|
308
309
|
end: e.end,
|
|
309
310
|
text: ` ${e.text}`,
|
|
@@ -311,7 +312,7 @@ function ye(e, t) {
|
|
|
311
312
|
newPrefixLength: 2
|
|
312
313
|
})));
|
|
313
314
|
}
|
|
314
|
-
function
|
|
315
|
+
function xe(e) {
|
|
315
316
|
if (e.startsWith(" ")) return {
|
|
316
317
|
text: e.slice(1),
|
|
317
318
|
removed: 1
|
|
@@ -323,18 +324,18 @@ function be(e) {
|
|
|
323
324
|
removed: t
|
|
324
325
|
};
|
|
325
326
|
}
|
|
326
|
-
function
|
|
327
|
-
let n =
|
|
328
|
-
for (let t of
|
|
329
|
-
let e =
|
|
327
|
+
function Se(e, t) {
|
|
328
|
+
let n = S(e, t), r = [];
|
|
329
|
+
for (let t of T(e, n)) {
|
|
330
|
+
let e = xe(t.text);
|
|
330
331
|
if (e.removed === 0) continue;
|
|
331
|
-
let n =
|
|
332
|
+
let n = D(t, e.text, e.removed, 0);
|
|
332
333
|
n && r.push(n);
|
|
333
334
|
}
|
|
334
|
-
return
|
|
335
|
+
return E(e, n, r);
|
|
335
336
|
}
|
|
336
|
-
function
|
|
337
|
-
let { start: r, end: i } =
|
|
337
|
+
function Ce(e, t, n = "en") {
|
|
338
|
+
let { start: r, end: i } = S(e, t), a = e.slice(r, i), o = "https://example.com";
|
|
338
339
|
if (a.length > 0) {
|
|
339
340
|
let t = `[${a}](${o})`, n = r + 1 + a.length + 2;
|
|
340
341
|
return {
|
|
@@ -345,7 +346,7 @@ function Se(e, t, n = "en") {
|
|
|
345
346
|
}
|
|
346
347
|
};
|
|
347
348
|
}
|
|
348
|
-
let s =
|
|
349
|
+
let s = C(n).linkText, c = `[${s}](${o})`;
|
|
349
350
|
return {
|
|
350
351
|
value: e.slice(0, r) + c + e.slice(i),
|
|
351
352
|
selection: {
|
|
@@ -354,8 +355,8 @@ function Se(e, t, n = "en") {
|
|
|
354
355
|
}
|
|
355
356
|
};
|
|
356
357
|
}
|
|
357
|
-
function
|
|
358
|
-
let { start: r, end: i } =
|
|
358
|
+
function we(e, t, n = "en") {
|
|
359
|
+
let { start: r, end: i } = S(e, t), a = e.slice(r, i), o = "images/example.png";
|
|
359
360
|
if (a.length > 0) {
|
|
360
361
|
let t = ``, n = r + 2 + a.length + 2;
|
|
361
362
|
return {
|
|
@@ -366,7 +367,7 @@ function Ce(e, t, n = "en") {
|
|
|
366
367
|
}
|
|
367
368
|
};
|
|
368
369
|
}
|
|
369
|
-
let s =
|
|
370
|
+
let s = C(n).imageAlt, c = ``;
|
|
370
371
|
return {
|
|
371
372
|
value: e.slice(0, r) + c + e.slice(i),
|
|
372
373
|
selection: {
|
|
@@ -375,25 +376,25 @@ function Ce(e, t, n = "en") {
|
|
|
375
376
|
}
|
|
376
377
|
};
|
|
377
378
|
}
|
|
378
|
-
function
|
|
379
|
-
let r =
|
|
379
|
+
function Te(e, t, n = "en") {
|
|
380
|
+
let r = S(e, t), i = e.slice(r.start, r.end), a = i.length > 0 ? i : C(n).codeBlockPlaceholder, o = "`".repeat(Math.max(3, k(a) + 1)), s = `${o}text\n`;
|
|
380
381
|
return R(e, r, `${s}${a}\n${o}`, {
|
|
381
382
|
start: s.length,
|
|
382
383
|
end: s.length + a.length
|
|
383
384
|
});
|
|
384
385
|
}
|
|
385
|
-
function
|
|
386
|
+
function Ee(e) {
|
|
386
387
|
return [
|
|
387
388
|
`| ${e.tableHeaders.join(" | ")} |`,
|
|
388
389
|
`| ${e.tableHeaders.map(() => "---").join(" | ")} |`,
|
|
389
390
|
...e.tableRows.map((e) => `| ${e.join(" | ")} |`)
|
|
390
391
|
].join("\n");
|
|
391
392
|
}
|
|
392
|
-
function
|
|
393
|
-
let n =
|
|
393
|
+
function L(e, t) {
|
|
394
|
+
let n = w(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 = "";
|
|
394
395
|
if (/\S/.test(r)) s = "\n\n";
|
|
395
396
|
else if (n > 0) {
|
|
396
|
-
let t =
|
|
397
|
+
let t = w(e, n - 1);
|
|
397
398
|
/\S/.test(e.slice(t, n - 1)) && (s = "\n");
|
|
398
399
|
}
|
|
399
400
|
return {
|
|
@@ -402,7 +403,7 @@ function Ee(e, t) {
|
|
|
402
403
|
};
|
|
403
404
|
}
|
|
404
405
|
function R(e, t, n, r) {
|
|
405
|
-
let { prefix: i, suffix: a } =
|
|
406
|
+
let { prefix: i, suffix: a } = L(e, t), o = t.start + i.length;
|
|
406
407
|
return {
|
|
407
408
|
value: e.slice(0, t.start) + i + n + a + e.slice(t.end),
|
|
408
409
|
selection: {
|
|
@@ -412,20 +413,20 @@ function R(e, t, n, r) {
|
|
|
412
413
|
};
|
|
413
414
|
}
|
|
414
415
|
function De(e, t, n = "en") {
|
|
415
|
-
let r =
|
|
416
|
+
let r = S(e, t), i = C(n), a = Ee(i), o = i.tableRows[0][0], s = a.indexOf(o);
|
|
416
417
|
return R(e, r, a, {
|
|
417
418
|
start: s,
|
|
418
419
|
end: s + o.length
|
|
419
420
|
});
|
|
420
421
|
}
|
|
421
422
|
function Oe(e, t) {
|
|
422
|
-
return R(e,
|
|
423
|
+
return R(e, S(e, t), "---", {
|
|
423
424
|
start: 3,
|
|
424
425
|
end: 3
|
|
425
426
|
});
|
|
426
427
|
}
|
|
427
428
|
function ke(e, t, n) {
|
|
428
|
-
let r =
|
|
429
|
+
let r = S(e, t), i = r.start + n.length;
|
|
429
430
|
return {
|
|
430
431
|
value: e.slice(0, r.start) + n + e.slice(r.end),
|
|
431
432
|
selection: {
|
|
@@ -470,7 +471,7 @@ function Ae(e, t) {
|
|
|
470
471
|
};
|
|
471
472
|
}
|
|
472
473
|
function B(e, t, n, r = {}) {
|
|
473
|
-
let i =
|
|
474
|
+
let i = S(e, t), a = Ae(n, e.slice(i.start, i.end)), o = r.block === !0 && a.text.length > 0 ? L(e, i) : {
|
|
474
475
|
prefix: "",
|
|
475
476
|
suffix: ""
|
|
476
477
|
}, s = i.start + o.prefix.length, c;
|
|
@@ -543,19 +544,19 @@ function V(e, t, n, r) {
|
|
|
543
544
|
function Ie(e) {
|
|
544
545
|
let t = 0;
|
|
545
546
|
for (;;) {
|
|
546
|
-
let n = e.slice(t), r =
|
|
547
|
+
let n = e.slice(t), r = F(n, N) ?? F(n, j) ?? F(n, M) ?? F(n, P);
|
|
547
548
|
if (!r) return t;
|
|
548
549
|
t += r.prefixLength;
|
|
549
550
|
}
|
|
550
551
|
}
|
|
551
552
|
function Le(e) {
|
|
552
|
-
return
|
|
553
|
+
return F(e, N) ? "task" : F(e, j) ? "bullet" : F(e, M) ? "ordered" : null;
|
|
553
554
|
}
|
|
554
555
|
function Re(e, t) {
|
|
555
|
-
let n =
|
|
556
|
+
let n = S(e, t), r = T(e, {
|
|
556
557
|
start: n.start,
|
|
557
558
|
end: n.start
|
|
558
|
-
})[0], i = r.text, a =
|
|
559
|
+
})[0], i = r.text, a = pe.exec(i);
|
|
559
560
|
return {
|
|
560
561
|
headingLevel: a ? a[1].length : 0,
|
|
561
562
|
bold: V(e, n, r, "bold"),
|
|
@@ -563,68 +564,68 @@ function Re(e, t) {
|
|
|
563
564
|
strike: V(e, n, r, "strike"),
|
|
564
565
|
inlineCode: V(e, n, r, "inlineCode"),
|
|
565
566
|
list: Le(i),
|
|
566
|
-
quote:
|
|
567
|
+
quote: F(i, P) !== null
|
|
567
568
|
};
|
|
568
569
|
}
|
|
569
570
|
// src/authoring/native-components.ts
|
|
570
|
-
var
|
|
571
|
+
var ze = Object.freeze(o.map((e) => ({
|
|
571
572
|
id: e.id,
|
|
572
|
-
label:
|
|
573
|
+
label: a(e.title, "en", e.id)
|
|
573
574
|
})));
|
|
574
|
-
function
|
|
575
|
-
let n =
|
|
575
|
+
function Be(e, t) {
|
|
576
|
+
let n = c[e];
|
|
576
577
|
return {
|
|
577
578
|
id: e,
|
|
578
|
-
label:
|
|
579
|
-
description:
|
|
579
|
+
label: a(n.title, t, e),
|
|
580
|
+
description: a(n.description, t, e),
|
|
580
581
|
group: n.category,
|
|
581
|
-
keywords: [...
|
|
582
|
+
keywords: [...i(e) ?? []],
|
|
582
583
|
...n.inline === !0 ? { inline: !0 } : {},
|
|
583
|
-
template:
|
|
584
|
+
template: a(n.insertText, t, n.insertText.en ?? "")
|
|
584
585
|
};
|
|
585
586
|
}
|
|
586
|
-
var
|
|
587
|
+
var H = r.map((e) => Be(e, "en")), U = Object.freeze(o.map((e) => ({
|
|
587
588
|
id: e.id,
|
|
588
|
-
label:
|
|
589
|
-
}))),
|
|
589
|
+
label: a(e.title, "zh", e.id)
|
|
590
|
+
}))), W = r.map((e) => Be(e, "zh")), Ve = H.filter((e) => c[e.id]?.extended === !0), He = Object.freeze(Object.fromEntries(W.filter((e) => c[e.id]?.extended === !0).map((e) => [e.id, Object.freeze({
|
|
590
591
|
label: e.label,
|
|
591
592
|
description: e.description,
|
|
592
593
|
keywords: Object.freeze([...e.keywords]),
|
|
593
594
|
template: e.template
|
|
594
595
|
})])));
|
|
595
|
-
function
|
|
596
|
+
function Ue(e = "en") {
|
|
596
597
|
return e === "zh" ? {
|
|
597
|
-
groups:
|
|
598
|
-
components: K
|
|
599
|
-
} : {
|
|
600
|
-
groups: H,
|
|
598
|
+
groups: U,
|
|
601
599
|
components: W
|
|
600
|
+
} : {
|
|
601
|
+
groups: ze,
|
|
602
|
+
components: H
|
|
602
603
|
};
|
|
603
604
|
}
|
|
604
|
-
function
|
|
605
|
+
function We(e) {
|
|
605
606
|
return new Set(e.match(/[A-Za-z_][A-Za-z0-9_]*/g) ?? []);
|
|
606
607
|
}
|
|
607
|
-
function
|
|
608
|
+
function Ge(e) {
|
|
608
609
|
let t = e.trim().replace(/[^A-Za-z0-9_]/g, "_");
|
|
609
610
|
return t ? /^[0-9]/.test(t) ? `_${t}` : t : "value";
|
|
610
611
|
}
|
|
611
|
-
function
|
|
612
|
+
function Ke(e, t) {
|
|
612
613
|
if (!t.has(e)) return e;
|
|
613
614
|
let n = 2;
|
|
614
615
|
for (; t.has(`${e}${n}`);) n += 1;
|
|
615
616
|
return `${e}${n}`;
|
|
616
617
|
}
|
|
617
|
-
function
|
|
618
|
-
let r =
|
|
618
|
+
function G(e, t, n) {
|
|
619
|
+
let r = We(t), i = /* @__PURE__ */ new Map();
|
|
619
620
|
return e.template.replace(/\{\{bind:([^{}]+)\}\}/g, (e, t) => {
|
|
620
621
|
let n = t.trim(), a = i.get(n);
|
|
621
622
|
if (a) return a;
|
|
622
|
-
let o =
|
|
623
|
+
let o = Ke(Ge(n), r);
|
|
623
624
|
return r.add(o), i.set(n, o), o;
|
|
624
625
|
});
|
|
625
626
|
}
|
|
626
627
|
// src/authoring/templates.ts
|
|
627
|
-
function
|
|
628
|
+
function K(e) {
|
|
628
629
|
let t = {};
|
|
629
630
|
for (let [n, r] of Object.entries(e.props)) t[n] = {
|
|
630
631
|
kind: r.kind,
|
|
@@ -639,22 +640,22 @@ function Ge(e) {
|
|
|
639
640
|
};
|
|
640
641
|
return t;
|
|
641
642
|
}
|
|
642
|
-
function Ke(e) {
|
|
643
|
-
return e.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">");
|
|
644
|
-
}
|
|
645
643
|
function qe(e) {
|
|
646
|
-
return e
|
|
644
|
+
return e.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">");
|
|
647
645
|
}
|
|
648
646
|
function Je(e) {
|
|
649
|
-
|
|
650
|
-
|
|
647
|
+
return e === null ? "" : qe(String(e));
|
|
648
|
+
}
|
|
649
|
+
function Ye(e) {
|
|
650
|
+
let n = e.replace(/[^A-Za-z0-9_]/g, "_"), r = /^[0-9]/.test(n) ? `_${n}` : n;
|
|
651
|
+
return t.has(r) ? `${r}_value` : r;
|
|
651
652
|
}
|
|
652
|
-
function
|
|
653
|
-
if (e.defaultValue !== void 0 && e.defaultValue !== null) return
|
|
653
|
+
function Xe(e, t) {
|
|
654
|
+
if (e.defaultValue !== void 0 && e.defaultValue !== null) return Je(e.defaultValue);
|
|
654
655
|
switch (e.kind) {
|
|
655
656
|
case "boolean": return "false";
|
|
656
657
|
case "enum":
|
|
657
|
-
if (e.values?.length) return
|
|
658
|
+
if (e.values?.length) return Je(e.values[0]);
|
|
658
659
|
throw Error(`${t} is a required enum without values; provide an authoring.insertText.`);
|
|
659
660
|
case "number": {
|
|
660
661
|
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;
|
|
@@ -670,22 +671,22 @@ function Ye(e, t) {
|
|
|
670
671
|
default: throw Error(`${t} has an unsupported property kind; provide an authoring.insertText.`);
|
|
671
672
|
}
|
|
672
673
|
}
|
|
673
|
-
function
|
|
674
|
+
function Ze(e) {
|
|
674
675
|
if (e.structure && e.structure.rule !== "none" && e.structure.rule !== "any" && e.structure.rule !== "inline") return !0;
|
|
675
676
|
let t = e.children;
|
|
676
677
|
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
|
}
|
|
678
|
-
function
|
|
679
|
+
function Qe(e, t) {
|
|
679
680
|
let n = e.name, r = e.form;
|
|
680
681
|
if (r !== "leaf" && r !== "inline" && r !== "container") throw Error(`component "${n}" has an unsupported form; provide an authoring.insertText.`);
|
|
681
|
-
if (
|
|
682
|
+
if (Ze(e)) throw Error(`component "${n}" requires children; provide an authoring.insertText.`);
|
|
682
683
|
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}="${
|
|
684
|
-
for (let [e, r] of Object.entries(t)) r.required && (a.has(e) || o.push(`${e}="${
|
|
684
|
+
for (let [e, t] of i) o.push(`${t.bind}="${Ye(e === "value" ? n : `${n}_${e}`)}"`);
|
|
685
|
+
for (let [e, r] of Object.entries(t)) r.required && (a.has(e) || o.push(`${e}="${Xe(r, `component "${n}" property "${e}"`)}"`));
|
|
685
686
|
let s = `<${n}${o.length > 0 ? ` ${o.join(" ")}` : ""}`;
|
|
686
687
|
return r === "leaf" ? `${s}>` : r === "inline" ? `${s}></${n}>` : `${s}>\n\n</${n}>`;
|
|
687
688
|
}
|
|
688
|
-
var
|
|
689
|
+
var $e = {
|
|
689
690
|
id: "authoring-template",
|
|
690
691
|
label: "",
|
|
691
692
|
description: "",
|
|
@@ -693,9 +694,9 @@ var Qe = {
|
|
|
693
694
|
keywords: [],
|
|
694
695
|
template: ""
|
|
695
696
|
};
|
|
696
|
-
function
|
|
697
|
-
let n =
|
|
698
|
-
|
|
697
|
+
function q(e, t = "") {
|
|
698
|
+
let n = G({
|
|
699
|
+
...$e,
|
|
699
700
|
template: e
|
|
700
701
|
}, t);
|
|
701
702
|
return B(t, {
|
|
@@ -703,28 +704,28 @@ function J(e, t = "") {
|
|
|
703
704
|
end: t.length
|
|
704
705
|
}, n).value.slice(t.length);
|
|
705
706
|
}
|
|
706
|
-
function
|
|
707
|
+
function et(e) {
|
|
707
708
|
return e.diagnostics.map((e) => `${e.code}: ${e.message}`).join("; ");
|
|
708
709
|
}
|
|
709
|
-
function
|
|
710
|
-
let n =
|
|
710
|
+
function tt(e, t) {
|
|
711
|
+
let n = q(t), r = `</${e}>`, i = n.lastIndexOf(r);
|
|
711
712
|
if (!(i < 0)) return {
|
|
712
713
|
before: `${n.slice(0, i)}\n`,
|
|
713
714
|
after: `\n${n.slice(i)}`
|
|
714
715
|
};
|
|
715
716
|
}
|
|
716
|
-
function
|
|
717
|
-
let i = r === void 0 ?
|
|
717
|
+
function nt(e, t, n, r) {
|
|
718
|
+
let i = r === void 0 ? q(e) : q(e, r.before), a = r === void 0 ? i : `${r.before}${i}${r.after}`, o;
|
|
718
719
|
try {
|
|
719
720
|
o = m(a, t ?? {});
|
|
720
721
|
} catch (e) {
|
|
721
722
|
throw Error(`${n} authoring.insertText could not be compiled: ${e instanceof Error ? e.message : String(e)}.`);
|
|
722
723
|
}
|
|
723
724
|
if (o.ok) return;
|
|
724
|
-
let s =
|
|
725
|
+
let s = et(o);
|
|
725
726
|
throw Error(`${n} authoring.insertText does not compile with this configuration${s ? ` (${s})` : ""}.`);
|
|
726
727
|
}
|
|
727
|
-
function
|
|
728
|
+
function rt(e, t, n, r) {
|
|
728
729
|
let i = r === void 0 ? e : `${r.before}${e}${r.after}`, a;
|
|
729
730
|
try {
|
|
730
731
|
a = m(i, t ?? {});
|
|
@@ -736,21 +737,21 @@ function nt(e, t, n, r) {
|
|
|
736
737
|
throw Error(`${n} has no authoring.insertText and its synthesized template does not compile with this configuration${o ? ` (${o})` : ""}. Provide authoring.insertText.`);
|
|
737
738
|
}
|
|
738
739
|
// src/authoring/catalog.ts
|
|
739
|
-
function
|
|
740
|
+
function J(e) {
|
|
740
741
|
return /* @__PURE__ */ Error(`Invalid local component catalog: ${e}`);
|
|
741
742
|
}
|
|
742
|
-
function
|
|
743
|
-
return
|
|
743
|
+
function Y(e, t, n) {
|
|
744
|
+
return a(e, t, n);
|
|
744
745
|
}
|
|
745
|
-
function
|
|
746
|
-
let n =
|
|
746
|
+
function it(e, t) {
|
|
747
|
+
let n = Y(e, t, "");
|
|
747
748
|
return n === "" ? void 0 : n;
|
|
748
749
|
}
|
|
749
|
-
function
|
|
750
|
+
function at(e) {
|
|
750
751
|
if (typeof e == "string" || typeof e == "number" || typeof e == "boolean") return e;
|
|
751
752
|
if (e === null) return null;
|
|
752
753
|
}
|
|
753
|
-
function
|
|
754
|
+
function ot(e, t) {
|
|
754
755
|
return Object.freeze({
|
|
755
756
|
name: e,
|
|
756
757
|
kind: t.kind,
|
|
@@ -758,17 +759,17 @@ function at(e, t) {
|
|
|
758
759
|
static: t.static === !0,
|
|
759
760
|
dynamic: t.dynamic === !0,
|
|
760
761
|
...t.values ? { values: Object.freeze([...t.values]) } : {},
|
|
761
|
-
...
|
|
762
|
+
...at(t.default) === void 0 ? {} : { defaultValue: at(t.default) }
|
|
762
763
|
});
|
|
763
764
|
}
|
|
764
|
-
function
|
|
765
|
+
function st(e, t) {
|
|
765
766
|
let n = {};
|
|
766
|
-
for (let [t, r] of Object.entries(e)) n[t] =
|
|
767
|
+
for (let [t, r] of Object.entries(e)) n[t] = ot(t, r);
|
|
767
768
|
return n;
|
|
768
769
|
}
|
|
769
|
-
function
|
|
770
|
+
function ct(e, t, n) {
|
|
770
771
|
for (let [r, i] of Object.entries(e.props)) {
|
|
771
|
-
let e =
|
|
772
|
+
let e = it(i.description, n);
|
|
772
773
|
if (e === void 0) continue;
|
|
773
774
|
let a = t[r];
|
|
774
775
|
t[r] = Object.freeze({
|
|
@@ -784,7 +785,7 @@ function st(e, t, n) {
|
|
|
784
785
|
}
|
|
785
786
|
return t;
|
|
786
787
|
}
|
|
787
|
-
function
|
|
788
|
+
function lt(e) {
|
|
788
789
|
return Object.freeze({
|
|
789
790
|
id: e.id,
|
|
790
791
|
name: e.name,
|
|
@@ -804,89 +805,89 @@ function ct(e) {
|
|
|
804
805
|
...e.requires === void 0 ? {} : { requires: Object.freeze({ ...e.requires }) }
|
|
805
806
|
});
|
|
806
807
|
}
|
|
807
|
-
function
|
|
808
|
+
function ut(e) {
|
|
808
809
|
let t = e.structure;
|
|
809
810
|
return {
|
|
810
811
|
...t?.parents?.length ? { parents: t.parents } : {},
|
|
811
812
|
...t?.children?.length ? { allowedChildren: t.children } : {}
|
|
812
813
|
};
|
|
813
814
|
}
|
|
814
|
-
function
|
|
815
|
+
function dt(e, t) {
|
|
815
816
|
if (e === t) return !0;
|
|
816
817
|
if (e === void 0 || t === void 0) return !1;
|
|
817
818
|
let n = Object.keys(e).sort(), r = Object.keys(t).sort();
|
|
818
819
|
return n.length === r.length && n.every((n, i) => n === r[i] && e[n] === t[n]);
|
|
819
820
|
}
|
|
820
|
-
function
|
|
821
|
+
function X(e) {
|
|
821
822
|
let t = e.authoring;
|
|
822
823
|
if (t === void 0) return;
|
|
823
|
-
if (
|
|
824
|
-
let n =
|
|
825
|
-
return t.title !== void 0 && !
|
|
824
|
+
if (s(e.name) === void 0) return t;
|
|
825
|
+
let n = u(e.name), r = {};
|
|
826
|
+
return t.title !== void 0 && !dt(t.title, n?.title) && (r.title = t.title), t.description !== void 0 && !dt(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
|
}
|
|
827
|
-
function
|
|
828
|
-
let n =
|
|
828
|
+
function Z(e, t) {
|
|
829
|
+
let n = s(e.name), r = X(e);
|
|
829
830
|
if (n) {
|
|
830
831
|
let e = r?.insertText;
|
|
831
832
|
if (e !== void 0) return e.trim() === "" ? void 0 : e;
|
|
832
|
-
let i =
|
|
833
|
+
let i = Y(n.insertText, t, n.insertText.en ?? "");
|
|
833
834
|
return i === "" ? void 0 : i;
|
|
834
835
|
}
|
|
835
|
-
let
|
|
836
|
-
return
|
|
836
|
+
let i = r?.insertText;
|
|
837
|
+
return i !== void 0 && i.trim() !== "" ? i : void 0;
|
|
837
838
|
}
|
|
838
|
-
function
|
|
839
|
-
let n =
|
|
840
|
-
return n === void 0 ?
|
|
839
|
+
function ft(e, t) {
|
|
840
|
+
let n = Z(e, t);
|
|
841
|
+
return n === void 0 ? Qe(e, K(e)) : n;
|
|
841
842
|
}
|
|
842
|
-
function
|
|
843
|
-
let i =
|
|
843
|
+
function pt(e, t, r) {
|
|
844
|
+
let i = n(e).structure?.parents;
|
|
844
845
|
if (i !== void 0 && i.length !== 0) for (let e of i) {
|
|
845
|
-
let
|
|
846
|
-
if (
|
|
846
|
+
let n = t.get(e);
|
|
847
|
+
if (n === void 0 || n.form !== "container") continue;
|
|
847
848
|
let i;
|
|
848
849
|
try {
|
|
849
|
-
i =
|
|
850
|
+
i = ft(n, r);
|
|
850
851
|
} catch {
|
|
851
852
|
continue;
|
|
852
853
|
}
|
|
853
|
-
let a =
|
|
854
|
+
let a = tt(e, i);
|
|
854
855
|
if (a !== void 0) return a;
|
|
855
856
|
}
|
|
856
857
|
}
|
|
857
|
-
function
|
|
858
|
+
function mt(e, t) {
|
|
858
859
|
if (e.parents !== void 0 && e.parents.length !== 0) for (let n of e.parents) {
|
|
859
860
|
let e = t.find((e) => e.name === n);
|
|
860
861
|
if (e === void 0 || e.form !== "container") continue;
|
|
861
|
-
let r =
|
|
862
|
+
let r = tt(n, e.insertText);
|
|
862
863
|
if (r !== void 0) return r;
|
|
863
864
|
}
|
|
864
865
|
}
|
|
865
|
-
function
|
|
866
|
-
let c =
|
|
866
|
+
function Q(e, t, r, a, o) {
|
|
867
|
+
let c = n(e), u = s(e.name), d = e.authoring, f = X(e), p = Y(u ? f?.title ?? u.title : d?.title, t, e.name), m = Y(u ? f?.description ?? u.description : d?.description, t, p), h = u ? f?.category ?? u.category : d?.category !== void 0 && d.category.trim() !== "" ? d.category : "extension", ee = l(h, t), g = Z(e, t), _ = ut(c), v;
|
|
867
868
|
if (g !== void 0) {
|
|
868
869
|
if (v = g, o) {
|
|
869
|
-
let
|
|
870
|
+
let n = pt(e, a, t);
|
|
870
871
|
try {
|
|
871
|
-
|
|
872
|
+
nt(v, r, `component "${e.name}"`, n);
|
|
872
873
|
} catch (e) {
|
|
873
|
-
throw
|
|
874
|
+
throw J(e instanceof Error ? e.message : String(e));
|
|
874
875
|
}
|
|
875
876
|
}
|
|
876
877
|
} else {
|
|
877
878
|
try {
|
|
878
|
-
v =
|
|
879
|
+
v = Qe(e, K(e));
|
|
879
880
|
} catch (e) {
|
|
880
|
-
throw
|
|
881
|
+
throw J(e instanceof Error ? e.message : String(e));
|
|
881
882
|
}
|
|
882
883
|
if (o) try {
|
|
883
|
-
|
|
884
|
+
rt(v, r, `component "${e.name}"`, pt(e, a, t));
|
|
884
885
|
} catch (e) {
|
|
885
|
-
throw
|
|
886
|
+
throw J(e instanceof Error ? e.message : String(e));
|
|
886
887
|
}
|
|
887
888
|
}
|
|
888
|
-
let
|
|
889
|
-
return
|
|
889
|
+
let te = ct(e, st(c.props, t), t), y = i(e.name);
|
|
890
|
+
return lt({
|
|
890
891
|
id: u ? e.name : e.id,
|
|
891
892
|
name: e.name,
|
|
892
893
|
title: p,
|
|
@@ -897,39 +898,39 @@ function mt(e, n, r, a, o) {
|
|
|
897
898
|
form: e.form,
|
|
898
899
|
inline: u ? u.inline === !0 : e.form === "inline",
|
|
899
900
|
..._,
|
|
900
|
-
...
|
|
901
|
-
props:
|
|
901
|
+
...y === void 0 ? {} : { keywords: y },
|
|
902
|
+
props: te,
|
|
902
903
|
...e.styles === void 0 ? {} : { styles: e.styles },
|
|
903
904
|
...e.requires === void 0 ? {} : { requires: e.requires }
|
|
904
905
|
});
|
|
905
906
|
}
|
|
906
|
-
function ht(e, t, n,
|
|
907
|
+
function ht(e, t, n, i, a) {
|
|
907
908
|
let o = new Map(e.map((e) => [e.name, e])), s = [], c = /* @__PURE__ */ new Set();
|
|
908
|
-
for (let e of
|
|
909
|
+
for (let e of r) {
|
|
909
910
|
let t = o.get(e);
|
|
910
|
-
t && t.authoring !== void 0 && (s.push(
|
|
911
|
+
t && t.authoring !== void 0 && (s.push(Q(t, n, i, o, !1)), c.add(e));
|
|
911
912
|
}
|
|
912
|
-
for (let
|
|
913
|
+
for (let r of e) c.has(r.name) || (r.authoring !== void 0 || t.has(r.name)) && (s.push(Q(r, n, i, o, a && t.has(r.name))), c.add(r.name));
|
|
913
914
|
return s;
|
|
914
915
|
}
|
|
915
|
-
function gt(e,
|
|
916
|
-
let r =
|
|
916
|
+
function gt(e, t) {
|
|
917
|
+
let r = s(e.name), a = e.authoring, o = X(e), c = {};
|
|
917
918
|
for (let [t, n] of Object.entries(e.props)) c[t] = n.description;
|
|
918
919
|
return JSON.stringify({
|
|
919
920
|
name: e.name,
|
|
920
921
|
id: e.id,
|
|
921
922
|
form: e.form,
|
|
922
|
-
title:
|
|
923
|
-
description:
|
|
923
|
+
title: Y(r ? o?.title ?? r.title : a?.title, t, e.name),
|
|
924
|
+
description: Y(r ? o?.description ?? r.description : a?.description, t, ""),
|
|
924
925
|
category: r ? o?.category ?? r.category : a?.category ?? "",
|
|
925
|
-
categoryLabel:
|
|
926
|
-
insertText:
|
|
926
|
+
categoryLabel: l(r ? o?.category ?? r.category : a?.category ?? "extension", t),
|
|
927
|
+
insertText: Z(e, t) ?? null,
|
|
927
928
|
inline: r ? r.inline === !0 : e.form === "inline",
|
|
928
|
-
keywords:
|
|
929
|
+
keywords: i(e.name) ?? null,
|
|
929
930
|
manifest: a ?? null,
|
|
930
931
|
preset: r ?? null,
|
|
931
932
|
propDescriptions: c,
|
|
932
|
-
structure:
|
|
933
|
+
structure: n(e).structure ?? null,
|
|
933
934
|
styles: e.styles ?? null,
|
|
934
935
|
requires: e.requires ?? null
|
|
935
936
|
});
|
|
@@ -945,12 +946,12 @@ function $(e, t, n, r) {
|
|
|
945
946
|
}
|
|
946
947
|
function vt(e, t = "en") {
|
|
947
948
|
let n = d(e), r = f({ config: n });
|
|
948
|
-
if (!r.ok) throw
|
|
949
|
+
if (!r.ok) throw J(r.message);
|
|
949
950
|
return $(r, t, { config: n }, !0);
|
|
950
951
|
}
|
|
951
952
|
function yt(e, t = "en") {
|
|
952
953
|
let n = d(e), r = f({ config: n });
|
|
953
|
-
if (!r.ok) throw
|
|
954
|
+
if (!r.ok) throw J(r.message);
|
|
954
955
|
return $(r, t, { config: n }, !1);
|
|
955
956
|
}
|
|
956
957
|
function bt(e, t = "en") {
|
|
@@ -958,7 +959,7 @@ function bt(e, t = "en") {
|
|
|
958
959
|
return n.ok ? $(n, t, e, !0) : Object.freeze([]);
|
|
959
960
|
}
|
|
960
961
|
function xt(e) {
|
|
961
|
-
let t = new Map(
|
|
962
|
+
let t = new Map(o.map((e, t) => [e.id, t])), n = /* @__PURE__ */ new Map();
|
|
962
963
|
for (let t of e) {
|
|
963
964
|
let e = n.get(t.category);
|
|
964
965
|
e ? e.entries.push(t) : n.set(t.category, {
|
|
@@ -994,22 +995,20 @@ function Ct(e) {
|
|
|
994
995
|
return t.join("\n");
|
|
995
996
|
}
|
|
996
997
|
function wt(e, t, n) {
|
|
997
|
-
if (typeof e != "string" || !Number.isFinite(t)) return Object.freeze([]);
|
|
998
|
-
let r =
|
|
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;
|
|
998
|
+
if (typeof e != "string" || !Number.isFinite(t) || !f(n).ok) return Object.freeze([]);
|
|
999
|
+
let r = Math.max(0, Math.min(e.length, Math.floor(t))), i = Object.freeze([]), a;
|
|
1001
1000
|
try {
|
|
1002
|
-
|
|
1001
|
+
a = te(e, n);
|
|
1003
1002
|
} catch {
|
|
1004
|
-
return
|
|
1003
|
+
return i;
|
|
1005
1004
|
}
|
|
1006
|
-
let
|
|
1007
|
-
for (let n of e) if ((n.type === "component" || n.type === "hostComponent") && n.name !== void 0 && n.range.start <=
|
|
1005
|
+
let o = (e, t) => {
|
|
1006
|
+
for (let n of e) if ((n.type === "component" || n.type === "hostComponent") && n.name !== void 0 && n.range.start <= r && r < n.range.end) {
|
|
1008
1007
|
let e = Object.freeze([...t, n.name]);
|
|
1009
|
-
|
|
1010
|
-
} else n.type !== "fallback" && n.children &&
|
|
1008
|
+
i = e, n.children && o(n.children, e);
|
|
1009
|
+
} else n.type !== "fallback" && n.children && o(n.children, t);
|
|
1011
1010
|
};
|
|
1012
|
-
return
|
|
1011
|
+
return o(a.nodes, Object.freeze([])), i;
|
|
1013
1012
|
}
|
|
1014
1013
|
function Tt(e) {
|
|
1015
1014
|
let t = {};
|
|
@@ -1091,12 +1090,12 @@ function Ot(e, t = "en") {
|
|
|
1091
1090
|
}
|
|
1092
1091
|
// src/authoring/insert.ts
|
|
1093
1092
|
var kt = /[A-Za-z_][A-Za-z0-9_]*/g;
|
|
1094
|
-
function At(e,
|
|
1095
|
-
let i = new Set(r.match(kt) ?? []), a =
|
|
1093
|
+
function At(e, n, r) {
|
|
1094
|
+
let i = new Set(r.match(kt) ?? []), a = _(e, n, { diagnostics: !1 }).bindings.filter((e) => e.declarations.length > 0).map((e) => e.name), o = new Set(a), s = e;
|
|
1096
1095
|
for (let e of a) {
|
|
1097
1096
|
let r = e, a = 2;
|
|
1098
|
-
for (; i.has(r) ||
|
|
1099
|
-
i.add(r), r !== e && (s =
|
|
1097
|
+
for (; i.has(r) || t.has(r) || r !== e && o.has(r);) r = `${e}${a}`, a += 1;
|
|
1098
|
+
i.add(r), r !== e && (s = h(s, e, r, n).source);
|
|
1100
1099
|
}
|
|
1101
1100
|
return s;
|
|
1102
1101
|
}
|
|
@@ -1111,7 +1110,7 @@ function jt(e) {
|
|
|
1111
1110
|
};
|
|
1112
1111
|
}
|
|
1113
1112
|
function Mt(e, t, n, r) {
|
|
1114
|
-
return B(n, r, At(
|
|
1113
|
+
return B(n, r, At(G(jt(e), n), t, n), { block: !e.inline });
|
|
1115
1114
|
}
|
|
1116
1115
|
function Nt(e, t, n, r, i = "en") {
|
|
1117
1116
|
if (typeof n != "string") throw TypeError("insertLocalComponent requires source text.");
|
|
@@ -1133,7 +1132,7 @@ function Ft(e, t = "en") {
|
|
|
1133
1132
|
let t = Mt(e, a, "", {
|
|
1134
1133
|
start: 0,
|
|
1135
1134
|
end: 0
|
|
1136
|
-
}).value, n =
|
|
1135
|
+
}).value, n = mt(e, o), s = n === void 0 ? t : `${n.before}${t}${n.after}`, c = m(s, a);
|
|
1137
1136
|
c.ok || i.push(Object.freeze({
|
|
1138
1137
|
id: e.id,
|
|
1139
1138
|
name: e.name,
|
|
@@ -1146,4 +1145,4 @@ function Ft(e, t = "en") {
|
|
|
1146
1145
|
}
|
|
1147
1146
|
return Object.freeze(i);
|
|
1148
1147
|
}
|
|
1149
|
-
export {
|
|
1148
|
+
export { Ve as EXTENDED_NATIVE_COMPONENTS, He as EXTENDED_NATIVE_COMPONENT_COPY_ZH, oe as LOCAL_COMPONENTS, ne as LOCAL_COMPONENT_NAMES, H as NATIVE_COMPONENTS, W as NATIVE_COMPONENTS_ZH, ze as NATIVE_COMPONENT_GROUPS, U as NATIVE_COMPONENT_GROUPS_ZH, _ as analyzeLocalSource, e as closestName, ee as completeLocalSource, Ot as createLocalAuthoringLookup, vt as createLocalComponentCatalog, bt as createLocalComponentCatalogForOptions, St as filterLocalComponentCatalog, ce as formatBold, ge as formatBulletList, me as formatHeading, fe as formatInlineCode, le as formatItalic, g as formatLocalSource, _e as formatOrderedList, ye as formatQuote, ue as formatStrike, ve as formatTaskList, ie as getLocalComponent, Ue as getNativeComponentCatalog, y as getPropDefault, be as indentSelection, Te as insertCodeBlock, Oe as insertDivider, we as insertImage, Ce 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, v as localComponentNames, Se as outdentSelection, Re as readFormatState, h as renameLocalBinding, G as renderNativeSnippet, re as suggestAttribute, ae as suggestComponent, Ft as validateLocalComponentInsertTemplates };
|