reactive-md 0.9.3 → 0.10.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 +34 -0
- package/CHANGELOG.md +34 -0
- package/README-ch.md +7 -7
- package/README-en.md +7 -7
- package/README.md +7 -7
- package/THIRD_PARTY_NOTICES.md +0 -57
- package/cli/help.mjs +6 -4
- package/cli/init.mjs +1 -1
- package/cli/migrate.mjs +1 -1
- package/dist-library/{LocalDocumentView-D6zQkTkt.js → LocalDocumentView-CP2QG86k.js} +46 -44
- package/dist-library/{LocalDocumentViewCore-CmJhemcA.js → LocalDocumentViewCore-Cd6yMEkg.js} +284 -265
- package/dist-library/{LocalReactiveDocumentCore-lAKOGAZ7.js → LocalReactiveDocumentCore-VuYpZqdn.js} +7 -7
- package/dist-library/LocalStaticDocumentView-DfX6bemE.js +147 -0
- package/dist-library/authoring-Bwu_zCWs.js +768 -0
- package/dist-library/choice-values-BItGjPD2.js +58 -0
- package/dist-library/compile-B35rfzKr.js +1742 -0
- package/dist-library/{compile-cache-key-6GgpETz_.js → compile-cache-key-D21X2Obx.js} +5 -5
- package/dist-library/{compiler-DLkKUK4t.js → compiler-DBwLawMZ.js} +4 -4
- package/dist-library/{compiler-core-Niqhp9wV.js → compiler-core-kkDiQ1RK.js} +3146 -2055
- package/dist-library/{component-kernel-IG4wOO0i.js → component-kernel-CsJSabHX.js} +42 -26
- package/dist-library/{component-state-Ht-hOK0W.js → component-state-Da0G8Ajc.js} +1 -1
- package/dist-library/{component-utils-eSj5IdG4.js → component-utils-ZM3jUJNy.js} +80 -79
- package/dist-library/conditional-branches-CIhJXasR.js +17 -0
- package/dist-library/{config-validation-Cpol91_M.js → config-validation-DbmsWAEV.js} +165 -152
- package/dist-library/{controls-B-CLSK8Q.js → controls-DRy5rzzN.js} +271 -228
- package/dist-library/{coordinate-PyLPMIQK.js → coordinate-c54pHfgf.js} +29 -29
- package/dist-library/data-table-CSAkm1eU.js +290 -0
- package/dist-library/data-table-model-DruztQFt.js +391 -0
- package/dist-library/{data-visuals-_Z7QqYTk.js → data-visuals-rZQUeQM0.js} +14 -14
- package/dist-library/{default-components-jugH7Ubr.js → default-components-B-39etG9.js} +233 -71
- package/dist-library/{default-config-DIrRpuQz.js → default-config-CCa8rm2k.js} +236 -216
- package/dist-library/default-options-By16CVw1.js +131 -0
- package/dist-library/{default-registry-BlloaZi7.js → default-registry-DXJy66xj.js} +3 -3
- package/dist-library/{default-schema-Ch-Vznpm.js → default-schema-CeYiEW1K.js} +3 -3
- package/dist-library/display-Bb6hAG5T.js +2065 -0
- package/dist-library/{document-theme-DBAfnk7y.js → document-theme-CJvN-nC1.js} +190 -3
- package/dist-library/{export-heVBqgxA.js → export-BSV4E0jv.js} +105 -106
- package/dist-library/font-aliases-CKYjwn4o.js +4 -0
- package/dist-library/{gallery-Q6VPS2ep.js → gallery-DM2yTVZJ.js} +1 -1
- package/dist-library/{html-CCnvzan1.js → html-CY9mC3Sr.js} +5 -5
- package/dist-library/{incremental-Bzvh8_lB.js → incremental-B-wW4H3F.js} +251 -245
- package/dist-library/{display-y4v9v0Qd.js → katex-4ukd4ZxT.js} +1555 -3618
- package/dist-library/layout-CPQggKxk.js +592 -0
- package/dist-library/{layout-BnfDeUNy.js → layout-CaDWsDof.js} +1 -1
- package/dist-library/{math-view-B0jthpRw.js → math-view-CyGTS6kv.js} +1 -1
- package/dist-library/{mount-preset-C_i37FvY.js → mount-preset-DtrCX4G8.js} +4 -4
- package/dist-library/{numeric-sliders-CkWS0-ja.js → numeric-sliders-BmJ1LCLx.js} +190 -190
- package/dist-library/{observability-CYLuvFfL.js → observability-BVQ16ByQ.js} +5 -4
- package/dist-library/{package-core-9UK5ZdqB.js → package-core-Cu_r_qs7.js} +7 -6
- package/dist-library/{parser-9yNJxGip.js → parser-BHl9Lxbw.js} +2 -2
- package/dist-library/{parser-standard-BPIy4HOu.js → parser-standard-DDAKv_DZ.js} +247 -247
- package/dist-library/{plugin-packs-CZb46nuv.js → plugin-packs-CkI0floL.js} +3 -3
- package/dist-library/{preset-core-BW3NWZJ9.js → preset-core-BKPbH_Nv.js} +377 -306
- package/dist-library/{props-pJRrfDc6.js → props-0iDqxlTk.js} +56 -61
- package/dist-library/{react-BSo0o998.js → react-74jdGBmu.js} +2 -2
- package/dist-library/reactive-md-authoring.js +277 -269
- package/dist-library/reactive-md-build.js +327 -33
- package/dist-library/reactive-md-compiler-session.js +3 -3
- package/dist-library/reactive-md-compiler-standard.js +10 -10
- package/dist-library/reactive-md-compiler.js +3 -3
- package/dist-library/reactive-md-contracts.js +4 -4
- package/dist-library/reactive-md-default-packs.js +4 -3
- package/dist-library/reactive-md-default-preset.js +3 -3
- package/dist-library/reactive-md-export.js +6 -6
- package/dist-library/reactive-md-minimal-preset.js +3 -2
- package/dist-library/reactive-md-minimal-react-preset.js +18 -17
- package/dist-library/reactive-md-minimal.css +1 -1
- package/dist-library/reactive-md-observability.js +2 -2
- package/dist-library/reactive-md-pack-style-manifest.js +8 -0
- package/dist-library/reactive-md-plugin-chart.js +13 -9
- package/dist-library/reactive-md-plugin-data.js +4 -4
- package/dist-library/reactive-md-plugin-diagram.js +3 -3
- package/dist-library/reactive-md-plugin-forms.js +5 -5
- package/dist-library/reactive-md-plugin-gallery.js +3 -3
- package/dist-library/reactive-md-plugin-navigation.js +10 -10
- package/dist-library/reactive-md-plugin-network.js +5 -5
- package/dist-library/reactive-md-plugin-plot.js +4 -4
- package/dist-library/reactive-md-react-component-accordion.js +3 -3
- package/dist-library/reactive-md-react-component-alert.js +3 -3
- package/dist-library/reactive-md-react-component-anchor.js +3 -3
- package/dist-library/reactive-md-react-component-badge.js +3 -3
- package/dist-library/reactive-md-react-component-card.js +3 -3
- package/dist-library/reactive-md-react-component-chart.js +2 -2
- package/dist-library/reactive-md-react-component-checkbox.js +2 -2
- package/dist-library/reactive-md-react-component-checklist.js +2 -2
- package/dist-library/reactive-md-react-component-choices.js +2 -2
- package/dist-library/reactive-md-react-component-column.js +1 -1
- package/dist-library/reactive-md-react-component-coordinate.js +2 -2
- package/dist-library/reactive-md-react-component-counter.js +2 -2
- package/dist-library/reactive-md-react-component-data-table.js +2 -2
- package/dist-library/reactive-md-react-component-date.js +2 -2
- package/dist-library/reactive-md-react-component-diagram.js +2 -2
- package/dist-library/reactive-md-react-component-disclosure.js +3 -3
- package/dist-library/reactive-md-react-component-edge.js +1 -1
- package/dist-library/reactive-md-react-component-else.js +10 -0
- package/dist-library/reactive-md-react-component-gallery-item.js +2 -2
- package/dist-library/reactive-md-react-component-gallery.js +2 -2
- package/dist-library/reactive-md-react-component-grid.js +3 -3
- package/dist-library/reactive-md-react-component-if.js +3 -3
- package/dist-library/reactive-md-react-component-input.js +2 -2
- package/dist-library/reactive-md-react-component-jump.js +3 -3
- package/dist-library/reactive-md-react-component-multi-select.js +2 -2
- package/dist-library/reactive-md-react-component-node.js +2 -2
- package/dist-library/reactive-md-react-component-number.js +2 -2
- package/dist-library/reactive-md-react-component-option.js +1 -1
- package/dist-library/reactive-md-react-component-panel.js +3 -3
- package/dist-library/reactive-md-react-component-plot.js +2 -2
- package/dist-library/reactive-md-react-component-progress.js +2 -2
- package/dist-library/reactive-md-react-component-quiz.js +2 -2
- package/dist-library/reactive-md-react-component-radio-group.js +2 -2
- package/dist-library/reactive-md-react-component-range-slider.js +2 -2
- package/dist-library/reactive-md-react-component-section.js +3 -3
- package/dist-library/reactive-md-react-component-select.js +2 -2
- package/dist-library/reactive-md-react-component-slider.js +2 -2
- package/dist-library/reactive-md-react-component-step.js +3 -3
- package/dist-library/reactive-md-react-component-steps.js +3 -3
- package/dist-library/reactive-md-react-component-tab.js +3 -3
- package/dist-library/reactive-md-react-component-table.js +2 -2
- package/dist-library/reactive-md-react-component-tabs.js +3 -3
- package/dist-library/reactive-md-react-component-text.js +3 -3
- package/dist-library/reactive-md-react-component-textarea.js +2 -2
- package/dist-library/reactive-md-react-component-timeline.js +2 -2
- package/dist-library/reactive-md-react-component-timer.js +2 -2
- package/dist-library/reactive-md-react-component-toggle.js +2 -2
- package/dist-library/reactive-md-react-component-tooltip.js +3 -3
- package/dist-library/reactive-md-react-component-validation.js +3 -3
- package/dist-library/reactive-md-react-minimal.js +4 -4
- package/dist-library/reactive-md-react-pack-controls.js +4 -4
- package/dist-library/reactive-md-react-pack-data.js +3 -3
- package/dist-library/reactive-md-react-pack-layout.js +25 -24
- package/dist-library/reactive-md-react-pack-visuals.js +2 -2
- package/dist-library/reactive-md-react-packed.js +6 -6
- package/dist-library/reactive-md-react-server.js +37 -36
- package/dist-library/reactive-md-react-static-server.js +2 -2
- package/dist-library/reactive-md-react-static.js +1 -1
- package/dist-library/reactive-md-react-unstyled.js +12 -12
- package/dist-library/reactive-md-react.js +12 -12
- package/dist-library/reactive-md-scan.js +1 -1
- package/dist-library/reactive-md-sdk.js +23 -9
- package/dist-library/reactive-md-standalone-configured.js +2 -2
- package/dist-library/reactive-md-standalone-host.js +2 -2
- package/dist-library/reactive-md-testing-browser.js +2 -2
- package/dist-library/reactive-md-testing-react.js +6 -6
- package/dist-library/reactive-md-testing.js +6 -6
- package/dist-library/reactive-md-vite.js +25 -9
- package/dist-library/reactive-md-worker-pool.js +3 -3
- package/dist-library/reactive-md.css +1 -1
- package/dist-library/reactive-md.js +52 -43
- package/dist-library/{registry-core-CziAIP5P.js → registry-core-DxEaxhJ6.js} +3 -2
- package/dist-library/{render-nodes-DKjg_TR1.js → render-nodes-B6j6Ip5I.js} +766 -731
- package/dist-library/{requirements-DhIkxAbl.js → requirements-C56sFIEs.js} +2 -2
- package/dist-library/{resources-B_nbROgj.js → resources-6VaNgk-h.js} +2 -2
- package/dist-library/rmd-pack-layout.css +9 -0
- package/dist-library/rmd-pack-resource-layout.css +9 -0
- package/dist-library/runtime-BHeuLOv_.js +1369 -0
- package/dist-library/{runtime-requirement-C4-vNcf5.js → runtime-requirement-DzPO8raU.js} +166 -163
- package/dist-library/{schema-core-4sd1Vu7V.js → schema-core-CDXfxdID.js} +24 -1
- package/dist-library/{sdk-core-BLsW9cCy.js → sdk-core-CnE-n0Z7.js} +469 -314
- package/dist-library/{session-core-DLBRPV7f.js → session-core-C071yQwV.js} +140 -127
- package/dist-library/{validation-XXlb-spV.js → sha256-utf16-Bmandi_H.js} +392 -315
- package/dist-library/shareable-CHCDnl6j.js +844 -0
- package/dist-library/types/authoring/catalog.d.ts +3 -1
- package/dist-library/types/authoring/index.d.ts +1 -1
- package/dist-library/types/components/chart/default-chart-types.d.ts +3 -0
- package/dist-library/types/components/chart/default-chart.d.ts +7 -0
- package/dist-library/types/components/entries/else.d.ts +3 -0
- package/dist-library/types/components/layout/layout.d.ts +5 -0
- package/dist-library/types/components/shared/visuals.d.ts +1 -1
- package/dist-library/types/components/table/data-table-model.d.ts +95 -2
- package/dist-library/types/components/table/data-table.d.ts +2 -2
- package/dist-library/types/contracts/component-kernel.d.ts +5 -0
- package/dist-library/types/contracts/font-aliases.d.ts +18 -0
- package/dist-library/types/contracts/number-literal.d.ts +2 -0
- package/dist-library/types/contracts/sha256-utf16.d.ts +2 -0
- package/dist-library/types/export/index.d.ts +4 -1
- package/dist-library/types/local/compilation/compiler-choices.d.ts +4 -0
- package/dist-library/types/local/compilation/compiler-declarations.d.ts +2 -1
- package/dist-library/types/local/compilation/compiler-expressions.d.ts +12 -1
- package/dist-library/types/local/compilation/compiler-macros.d.ts +18 -0
- package/dist-library/types/local/compilation/compiler-structure.d.ts +8 -2
- package/dist-library/types/local/compilation/compiler-tables.d.ts +1 -0
- package/dist-library/types/local/compilation/compiler-validation.d.ts +11 -0
- package/dist-library/types/local/compilation/compiler-values.d.ts +1 -2
- package/dist-library/types/local/configuration/diagnostic-messages.d.ts +173 -2
- package/dist-library/types/local/configuration/diagnostic-runtime-messages.d.ts +40 -0
- package/dist-library/types/local/evaluation/choice-values.d.ts +22 -0
- package/dist-library/types/local/evaluation/computations.d.ts +13 -5
- package/dist-library/types/local/evaluation/dataset.d.ts +4 -0
- package/dist-library/types/local/evaluation/expression/collection-functions.d.ts +13 -0
- package/dist-library/types/local/evaluation/expression/compile.d.ts +11 -4
- package/dist-library/types/local/evaluation/expression/data-functions.d.ts +23 -0
- package/dist-library/types/local/evaluation/expression/evaluation.d.ts +3 -1
- package/dist-library/types/local/evaluation/expression/internal-names.d.ts +8 -0
- package/dist-library/types/local/evaluation/expression/syntax.d.ts +19 -2
- package/dist-library/types/local/evaluation/expression/transform-budget.d.ts +13 -0
- package/dist-library/types/local/evaluation/expression/values.d.ts +9 -1
- package/dist-library/types/local/evaluation/validation.d.ts +8 -6
- package/dist-library/types/local/index.d.ts +4 -3
- package/dist-library/types/local/parsing/conditional-branches.d.ts +4 -0
- package/dist-library/types/local/parsing/source-revision.d.ts +3 -0
- package/dist-library/types/local/runtime/runtime-choices.d.ts +11 -0
- package/dist-library/types/local/runtime/runtime.d.ts +3 -1
- package/dist-library/types/local/runtime/state.d.ts +30 -15
- package/dist-library/types/local/source/authoring-requirements.d.ts +3 -0
- package/dist-library/types/local/source/authoring-syntax.d.ts +3 -2
- package/dist-library/types/local/source/authoring.d.ts +10 -0
- package/dist-library/types/local/source/source-migration.d.ts +1 -0
- package/dist-library/types/local/types.d.ts +33 -2
- package/dist-library/types/react/component-api.d.ts +21 -2
- package/dist-library/types/react/component-utils.d.ts +11 -0
- package/dist-library/types/react/font-aliases.d.ts +2 -0
- package/dist-library/types/react/package-core.d.ts +3 -0
- package/dist-library/types/react/rendering/document/validation-state.d.ts +1 -1
- package/dist-library/types/react/rendering/document/view-revision.d.ts +3 -12
- package/dist-library/types/react/rendering/table/data-table.d.ts +1 -1
- package/dist-library/types/react/sdk-core.d.ts +3 -1
- package/dist-library/types/sdk/assembly.d.ts +3 -0
- package/dist-library/types/sdk/font.d.ts +13 -0
- package/dist-library/types/sdk/index.d.ts +1 -0
- package/dist-library/types/sdk/theme.d.ts +5 -0
- package/dist-library/types/sdk/types.d.ts +6 -0
- package/dist-library/types/sdk/version.d.ts +1 -1
- package/dist-library/types/shareable.d.ts +15 -3
- package/dist-library/types/standalone/prepare.d.ts +4 -2
- package/dist-library/types/standalone/session-core.d.ts +4 -1
- package/dist-library/types/vite/index.d.ts +3 -0
- package/dist-library/types/vite/registration.d.ts +1 -0
- package/dist-library/{types-Bza88SGK.js → types-B4qG8J4S.js} +1 -1
- package/dist-library/types-FYhRWRn9.js +3 -0
- package/dist-library/use-hydrated-D1gFY2Dq.js +2655 -0
- package/dist-library/validation-DRuW0Wl9.js +433 -0
- package/dist-library/{version-B0G1699c.js → version-4wzhbvDG.js} +1 -1
- package/dist-library/{visual-helpers-CRmaqCHX.js → visual-helpers-UU6xiL8g.js} +3 -3
- package/dist-library/visuals-7xzoL9ql.js +49340 -0
- package/dist-library/{worker-D6WMV8xJ.js → worker-3ldRjOEG.js} +9 -9
- package/dist-standalone/reactive-md-standalone.css +1 -1
- package/dist-standalone/reactive-md-standalone.js +128 -368
- package/docs/README-ch.md +3 -1
- package/docs/README.md +3 -1
- package/docs/compatibility/api-stability-ch.md +1 -1
- package/docs/compatibility/api-stability-en.md +1 -1
- package/docs/compatibility/compatibility-ch.md +15 -15
- package/docs/compatibility/compatibility-en.md +15 -15
- package/docs/compatibility/compatibility-manifest.schema.json +3 -2
- package/docs/compatibility/deprecation-ch.md +2 -2
- package/docs/compatibility/deprecation-en.md +2 -2
- package/docs/compatibility/source-versioning-ch.md +22 -14
- package/docs/compatibility/source-versioning-en.md +22 -13
- package/docs/compatibility/support-matrix-ch.md +4 -3
- package/docs/compatibility/support-matrix-en.md +4 -3
- package/docs/development/component-development-ch.md +2 -2
- package/docs/development/component-development-en.md +2 -2
- package/docs/development/component-protocol-ch.md +18 -18
- package/docs/development/component-protocol-en.md +14 -14
- package/docs/guides/local-guide-ch.md +109 -20
- package/docs/guides/local-guide-en.md +109 -20
- package/docs/integration/author-tools-ch.md +1 -1
- package/docs/integration/author-tools-en.md +1 -1
- package/docs/integration/editor-ch.md +3 -3
- package/docs/integration/editor-en.md +3 -3
- package/docs/integration/extension-sdk-ch.md +29 -3
- package/docs/integration/extension-sdk-en.md +29 -3
- package/docs/integration/local-integration-ch.md +3 -3
- package/docs/integration/local-integration-en.md +3 -3
- package/docs/integration/pdf-export-ch.md +42 -0
- package/docs/integration/pdf-export-en.md +42 -0
- package/docs/integration/shareable-export-ch.md +11 -19
- package/docs/integration/shareable-export-en.md +11 -19
- package/docs/reference/diagnostics-counting-ch.md +24 -1
- package/docs/reference/diagnostics-counting-en.md +24 -1
- package/docs/reference/local-interaction-syntax-ch.md +222 -33
- package/docs/reference/local-interaction-syntax-en.md +220 -31
- package/docs/reference/public-api-ch.md +24 -18
- package/docs/reference/public-api-en.md +24 -18
- package/docs/reference/theme-protocol-ch.md +1 -1
- package/docs/reference/theme-protocol-en.md +1 -1
- package/docs/releases/release-0.10.0-ch.md +45 -0
- package/docs/releases/release-0.10.0-en.md +45 -0
- package/examples/conformance/README-ch.md +3 -3
- package/examples/conformance/README.md +3 -3
- package/examples/conformance/local-draft-4.json +441 -0
- package/examples/integration/README-ch.md +3 -3
- package/examples/integration/README.md +3 -3
- package/examples/integration/chat-session/package.json +1 -1
- package/examples/local/README-ch.md +1 -1
- package/examples/local/README.md +1 -1
- package/package.json +6 -1
- package/dist-library/LocalStaticDocumentView-2J7w0sKm.js +0 -143
- package/dist-library/authoring-B14SsOXZ.js +0 -893
- package/dist-library/compile-D50B5_Ww.js +0 -1249
- package/dist-library/computations-CffoW7Ff.js +0 -340
- package/dist-library/data-table-Kv_ZA2Z2.js +0 -297
- package/dist-library/default-options-DU5dxuU6.js +0 -125
- package/dist-library/layout-BfUzzO2b.js +0 -553
- package/dist-library/runtime-CuJndKqK.js +0 -1289
- package/dist-library/shareable-C6mUerpQ.js +0 -817
- package/dist-library/types-daDo2c_w.js +0 -3
- package/dist-library/use-hydrated-W-laKPhY.js +0 -22975
- package/dist-library/visuals-CoVSjVD8.js +0 -49159
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { t as
|
|
5
|
-
import {
|
|
6
|
-
import { s as f } from "./default-
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
1
|
+
import { y as e } from "./compile-B35rfzKr.js";
|
|
2
|
+
import { V as t, z as n } from "./preset-core-BKPbH_Nv.js";
|
|
3
|
+
import { n as r } from "./schema-core-CDXfxdID.js";
|
|
4
|
+
import { t as i } from "./registry-core-DxEaxhJ6.js";
|
|
5
|
+
import { t as a } from "./compiler-DBwLawMZ.js";
|
|
6
|
+
import { a as o, c as s, d as c, i as l, l as u, o as d, s as f, u as p } from "./default-components-B-39etG9.js";
|
|
7
|
+
import { s as m } from "./default-config-CCa8rm2k.js";
|
|
8
|
+
import { r as h, t as ee } from "./default-options-By16CVw1.js";
|
|
9
|
+
import { a as g, i as _, n as v, r as y, t as b } from "./authoring-Bwu_zCWs.js";
|
|
10
|
+
import { t as te } from "./parser-BHl9Lxbw.js";
|
|
11
|
+
import { a as ne, i as re, n as ie, o as ae, r as oe, s as se, t as ce } from "./default-schema-CeYiEW1K.js";
|
|
11
12
|
// src/authoring/editor-i18n.ts
|
|
12
|
-
var
|
|
13
|
+
var le = {
|
|
13
14
|
en: {
|
|
14
15
|
boldPlaceholder: "bold text",
|
|
15
16
|
italicPlaceholder: "italic text",
|
|
@@ -58,11 +59,11 @@ var oe = {
|
|
|
58
59
|
}
|
|
59
60
|
};
|
|
60
61
|
// src/authoring/editor-commands.ts
|
|
61
|
-
function
|
|
62
|
+
function ue(e, t) {
|
|
62
63
|
return typeof e != "number" || Number.isNaN(e) ? 0 : Math.min(Math.max(Math.trunc(e), 0), t);
|
|
63
64
|
}
|
|
64
65
|
function x(e, t) {
|
|
65
|
-
let n =
|
|
66
|
+
let n = ue(t.start, e.length), r = ue(t.end, e.length);
|
|
66
67
|
return n <= r ? {
|
|
67
68
|
start: n,
|
|
68
69
|
end: r
|
|
@@ -72,7 +73,7 @@ function x(e, t) {
|
|
|
72
73
|
};
|
|
73
74
|
}
|
|
74
75
|
function S(e) {
|
|
75
|
-
return
|
|
76
|
+
return le[e] ?? le.en;
|
|
76
77
|
}
|
|
77
78
|
function C(e, t) {
|
|
78
79
|
return t <= 0 ? 0 : e.lastIndexOf("\n", t - 1) + 1;
|
|
@@ -173,13 +174,13 @@ function O(e, t, n, r) {
|
|
|
173
174
|
}
|
|
174
175
|
};
|
|
175
176
|
}
|
|
176
|
-
function
|
|
177
|
+
function de(e, t, n = "en") {
|
|
177
178
|
return O(e, t, "**", S(n).boldPlaceholder);
|
|
178
179
|
}
|
|
179
|
-
function
|
|
180
|
+
function fe(e, t, n = "en") {
|
|
180
181
|
return O(e, t, "*", S(n).italicPlaceholder);
|
|
181
182
|
}
|
|
182
|
-
function
|
|
183
|
+
function pe(e, t, n = "en") {
|
|
183
184
|
return O(e, t, "~~", S(n).strikePlaceholder);
|
|
184
185
|
}
|
|
185
186
|
function k(e) {
|
|
@@ -192,7 +193,7 @@ function A(e, t, n) {
|
|
|
192
193
|
for (; e[t] === "`";) r += 1, t += n;
|
|
193
194
|
return r;
|
|
194
195
|
}
|
|
195
|
-
function
|
|
196
|
+
function me(e, t) {
|
|
196
197
|
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 ? {
|
|
197
198
|
run: a,
|
|
198
199
|
padding: 0
|
|
@@ -202,7 +203,7 @@ function de(e, t) {
|
|
|
202
203
|
} : null, d = s ?? u;
|
|
203
204
|
return !d || k(i) >= d.run ? null : d;
|
|
204
205
|
}
|
|
205
|
-
function
|
|
206
|
+
function he(e, t, n = "en") {
|
|
206
207
|
let r = x(e, t), { start: i, end: a } = r, o = e.slice(i, a);
|
|
207
208
|
if (i === a) {
|
|
208
209
|
let t = S(n).inlineCodePlaceholder, r = `\`${t}\``;
|
|
@@ -225,7 +226,7 @@ function fe(e, t, n = "en") {
|
|
|
225
226
|
}
|
|
226
227
|
};
|
|
227
228
|
}
|
|
228
|
-
let l =
|
|
229
|
+
let l = me(e, r);
|
|
229
230
|
if (l) {
|
|
230
231
|
let t = l.run + l.padding;
|
|
231
232
|
return {
|
|
@@ -245,11 +246,11 @@ function fe(e, t, n = "en") {
|
|
|
245
246
|
}
|
|
246
247
|
};
|
|
247
248
|
}
|
|
248
|
-
var
|
|
249
|
-
function
|
|
249
|
+
var ge = /^(#{1,6})[ \t]+/;
|
|
250
|
+
function _e(e, t, n) {
|
|
250
251
|
let r = x(e, t), i = [];
|
|
251
252
|
for (let t of w(e, r)) {
|
|
252
|
-
let e =
|
|
253
|
+
let e = ge.exec(t.text), r = e ? e[0].length : 0;
|
|
253
254
|
if (n === 0 && !e) continue;
|
|
254
255
|
let a = t.text.slice(r), o = n === 0 ? "" : `${"#".repeat(n)} `, s = E(t, o + a, r, o.length);
|
|
255
256
|
s && i.push(s);
|
|
@@ -267,7 +268,7 @@ function F(e, t) {
|
|
|
267
268
|
prefixLength: r.length + i.length
|
|
268
269
|
};
|
|
269
270
|
}
|
|
270
|
-
function
|
|
271
|
+
function ve(e) {
|
|
271
272
|
let t = /^[ \t]*/.exec(e);
|
|
272
273
|
return t ? t[0] : "";
|
|
273
274
|
}
|
|
@@ -286,24 +287,24 @@ function I(e, t, n, r) {
|
|
|
286
287
|
e && u.push(e);
|
|
287
288
|
continue;
|
|
288
289
|
}
|
|
289
|
-
let i = n ? n.indent :
|
|
290
|
+
let i = n ? n.indent : ve(t.text), s = t.text.slice(n ? n.prefixLength : i.length), c = r(i, e + 1), d = E(t, i + c + s, n ? n.prefixLength : i.length, i.length + c.length);
|
|
290
291
|
d && u.push(d);
|
|
291
292
|
}
|
|
292
293
|
return T(e, i, u);
|
|
293
294
|
}
|
|
294
|
-
function
|
|
295
|
+
function ye(e, t) {
|
|
295
296
|
return I(e, t, (e) => F(e, j), () => "- ");
|
|
296
297
|
}
|
|
297
|
-
function
|
|
298
|
+
function be(e, t) {
|
|
298
299
|
return I(e, t, (e) => F(e, M), (e, t) => `${t}. `);
|
|
299
300
|
}
|
|
300
|
-
function
|
|
301
|
+
function xe(e, t) {
|
|
301
302
|
return I(e, t, (e) => F(e, N), () => "- [ ] ");
|
|
302
303
|
}
|
|
303
|
-
function
|
|
304
|
+
function Se(e, t) {
|
|
304
305
|
return I(e, t, (e) => F(e, P), () => "> ");
|
|
305
306
|
}
|
|
306
|
-
function
|
|
307
|
+
function Ce(e, t) {
|
|
307
308
|
let n = x(e, t);
|
|
308
309
|
return T(e, n, w(e, n).map((e) => ({
|
|
309
310
|
start: e.start,
|
|
@@ -313,7 +314,7 @@ function be(e, t) {
|
|
|
313
314
|
newPrefixLength: 2
|
|
314
315
|
})));
|
|
315
316
|
}
|
|
316
|
-
function
|
|
317
|
+
function we(e) {
|
|
317
318
|
if (e.startsWith(" ")) return {
|
|
318
319
|
text: e.slice(1),
|
|
319
320
|
removed: 1
|
|
@@ -325,17 +326,17 @@ function xe(e) {
|
|
|
325
326
|
removed: t
|
|
326
327
|
};
|
|
327
328
|
}
|
|
328
|
-
function
|
|
329
|
+
function Te(e, t) {
|
|
329
330
|
let n = x(e, t), r = [];
|
|
330
331
|
for (let t of w(e, n)) {
|
|
331
|
-
let e =
|
|
332
|
+
let e = we(t.text);
|
|
332
333
|
if (e.removed === 0) continue;
|
|
333
334
|
let n = E(t, e.text, e.removed, 0);
|
|
334
335
|
n && r.push(n);
|
|
335
336
|
}
|
|
336
337
|
return T(e, n, r);
|
|
337
338
|
}
|
|
338
|
-
function
|
|
339
|
+
function Ee(e, t, n = "en") {
|
|
339
340
|
let { start: r, end: i } = x(e, t), a = e.slice(r, i), o = "https://example.com";
|
|
340
341
|
if (a.length > 0) {
|
|
341
342
|
let t = `[${a}](${o})`, n = r + 1 + a.length + 2;
|
|
@@ -356,7 +357,7 @@ function Ce(e, t, n = "en") {
|
|
|
356
357
|
}
|
|
357
358
|
};
|
|
358
359
|
}
|
|
359
|
-
function
|
|
360
|
+
function De(e, t, n = "en") {
|
|
360
361
|
let { start: r, end: i } = x(e, t), a = e.slice(r, i), o = "images/example.png";
|
|
361
362
|
if (a.length > 0) {
|
|
362
363
|
let t = ``, n = r + 2 + a.length + 2;
|
|
@@ -377,21 +378,21 @@ function we(e, t, n = "en") {
|
|
|
377
378
|
}
|
|
378
379
|
};
|
|
379
380
|
}
|
|
380
|
-
function
|
|
381
|
+
function Oe(e, t, n = "en") {
|
|
381
382
|
let r = x(e, t), i = e.slice(r.start, r.end), a = i.length > 0 ? i : S(n).codeBlockPlaceholder, o = "`".repeat(Math.max(3, k(a) + 1)), s = `${o}text\n`;
|
|
382
|
-
return
|
|
383
|
+
return R(e, r, `${s}${a}\n${o}`, {
|
|
383
384
|
start: s.length,
|
|
384
385
|
end: s.length + a.length
|
|
385
386
|
});
|
|
386
387
|
}
|
|
387
|
-
function
|
|
388
|
+
function ke(e) {
|
|
388
389
|
return [
|
|
389
390
|
`| ${e.tableHeaders.join(" | ")} |`,
|
|
390
391
|
`| ${e.tableHeaders.map(() => "---").join(" | ")} |`,
|
|
391
392
|
...e.tableRows.map((e) => `| ${e.join(" | ")} |`)
|
|
392
393
|
].join("\n");
|
|
393
394
|
}
|
|
394
|
-
function
|
|
395
|
+
function L(e, t) {
|
|
395
396
|
let n = C(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 = "";
|
|
396
397
|
if (/\S/.test(r)) s = "\n\n";
|
|
397
398
|
else if (n > 0) {
|
|
@@ -403,8 +404,8 @@ function De(e, t) {
|
|
|
403
404
|
suffix: /\S/.test(o) ? "\n\n" : ""
|
|
404
405
|
};
|
|
405
406
|
}
|
|
406
|
-
function
|
|
407
|
-
let { prefix: i, suffix: a } =
|
|
407
|
+
function R(e, t, n, r) {
|
|
408
|
+
let { prefix: i, suffix: a } = L(e, t), o = t.start + i.length;
|
|
408
409
|
return {
|
|
409
410
|
value: e.slice(0, t.start) + i + n + a + e.slice(t.end),
|
|
410
411
|
selection: {
|
|
@@ -413,20 +414,20 @@ function L(e, t, n, r) {
|
|
|
413
414
|
}
|
|
414
415
|
};
|
|
415
416
|
}
|
|
416
|
-
function
|
|
417
|
-
let r = x(e, t), i = S(n), a =
|
|
418
|
-
return
|
|
417
|
+
function Ae(e, t, n = "en") {
|
|
418
|
+
let r = x(e, t), i = S(n), a = ke(i), o = i.tableRows[0][0], s = a.indexOf(o);
|
|
419
|
+
return R(e, r, a, {
|
|
419
420
|
start: s,
|
|
420
421
|
end: s + o.length
|
|
421
422
|
});
|
|
422
423
|
}
|
|
423
|
-
function
|
|
424
|
-
return
|
|
424
|
+
function je(e, t) {
|
|
425
|
+
return R(e, x(e, t), "---", {
|
|
425
426
|
start: 3,
|
|
426
427
|
end: 3
|
|
427
428
|
});
|
|
428
429
|
}
|
|
429
|
-
function
|
|
430
|
+
function Me(e, t, n) {
|
|
430
431
|
let r = x(e, t), i = r.start + n.length;
|
|
431
432
|
return {
|
|
432
433
|
value: e.slice(0, r.start) + n + e.slice(r.end),
|
|
@@ -436,11 +437,11 @@ function Ae(e, t, n) {
|
|
|
436
437
|
}
|
|
437
438
|
};
|
|
438
439
|
}
|
|
439
|
-
var
|
|
440
|
-
function
|
|
440
|
+
var z = /\{\{(selection(?::[^{}]*)?|caret|select:[^{}]*)\}\}/g;
|
|
441
|
+
function Ne(e, t) {
|
|
441
442
|
let n = "", r = 0, i = null, a = null, o = null;
|
|
442
|
-
|
|
443
|
-
for (let s =
|
|
443
|
+
z.lastIndex = 0;
|
|
444
|
+
for (let s = z.exec(e); s; s = z.exec(e)) {
|
|
444
445
|
let c = s.index;
|
|
445
446
|
n += e.slice(r, c), r = c + s[0].length;
|
|
446
447
|
let l = s[1] ?? "";
|
|
@@ -471,8 +472,8 @@ function je(e, t) {
|
|
|
471
472
|
caret: o
|
|
472
473
|
};
|
|
473
474
|
}
|
|
474
|
-
function
|
|
475
|
-
let i = x(e, t), a =
|
|
475
|
+
function B(e, t, n, r = {}) {
|
|
476
|
+
let i = x(e, t), a = Ne(n, e.slice(i.start, i.end)), o = r.block === !0 && a.text.length > 0 ? L(e, i) : {
|
|
476
477
|
prefix: "",
|
|
477
478
|
suffix: ""
|
|
478
479
|
}, s = i.start + o.prefix.length, c;
|
|
@@ -493,7 +494,7 @@ function z(e, t, n, r = {}) {
|
|
|
493
494
|
selection: c
|
|
494
495
|
};
|
|
495
496
|
}
|
|
496
|
-
function
|
|
497
|
+
function V(e, t) {
|
|
497
498
|
let n = [], r = 0;
|
|
498
499
|
for (; r < e.length;) {
|
|
499
500
|
if (e[r] !== t) {
|
|
@@ -510,9 +511,9 @@ function Me(e, t) {
|
|
|
510
511
|
}
|
|
511
512
|
return n;
|
|
512
513
|
}
|
|
513
|
-
function
|
|
514
|
-
if (t === "inlineCode") return
|
|
515
|
-
let n =
|
|
514
|
+
function H(e, t) {
|
|
515
|
+
if (t === "inlineCode") return V(e, "`");
|
|
516
|
+
let n = V(e, t === "strike" ? "~" : "*");
|
|
516
517
|
return t === "italic" ? n.filter((e) => e.length % 2 == 1) : n.filter((e) => e.length >= 2);
|
|
517
518
|
}
|
|
518
519
|
function Pe(e, t, n) {
|
|
@@ -535,12 +536,12 @@ function Ie(e, t) {
|
|
|
535
536
|
}
|
|
536
537
|
return !1;
|
|
537
538
|
}
|
|
538
|
-
function
|
|
539
|
+
function U(e, t, n, r) {
|
|
539
540
|
if (t.start !== t.end) {
|
|
540
|
-
let n =
|
|
541
|
+
let n = H(e, r);
|
|
541
542
|
return Pe(t.start, t.end, n) || Fe(t.start, t.end, n);
|
|
542
543
|
}
|
|
543
|
-
return Ie(Math.min(Math.max(t.start - n.start, 0), n.text.length),
|
|
544
|
+
return Ie(Math.min(Math.max(t.start - n.start, 0), n.text.length), H(n.text, r).filter((e) => e.start >= Le(n.text)));
|
|
544
545
|
}
|
|
545
546
|
function Le(e) {
|
|
546
547
|
let t = 0;
|
|
@@ -557,76 +558,76 @@ function ze(e, t) {
|
|
|
557
558
|
let n = x(e, t), r = w(e, {
|
|
558
559
|
start: n.start,
|
|
559
560
|
end: n.start
|
|
560
|
-
})[0], i = r.text, a =
|
|
561
|
+
})[0], i = r.text, a = ge.exec(i);
|
|
561
562
|
return {
|
|
562
563
|
headingLevel: a ? a[1].length : 0,
|
|
563
|
-
bold:
|
|
564
|
-
italic:
|
|
565
|
-
strike:
|
|
566
|
-
inlineCode:
|
|
564
|
+
bold: U(e, n, r, "bold"),
|
|
565
|
+
italic: U(e, n, r, "italic"),
|
|
566
|
+
strike: U(e, n, r, "strike"),
|
|
567
|
+
inlineCode: U(e, n, r, "inlineCode"),
|
|
567
568
|
list: Re(i),
|
|
568
569
|
quote: F(i, P) !== null
|
|
569
570
|
};
|
|
570
571
|
}
|
|
571
572
|
// src/authoring/native-components.ts
|
|
572
|
-
var Be = Object.freeze(
|
|
573
|
+
var Be = Object.freeze(l.map((e) => ({
|
|
573
574
|
id: e.id,
|
|
574
|
-
label:
|
|
575
|
+
label: c(e.title, "en", e.id)
|
|
575
576
|
})));
|
|
576
577
|
function Ve(e, t) {
|
|
577
|
-
let n =
|
|
578
|
+
let n = d[e];
|
|
578
579
|
return {
|
|
579
580
|
id: e,
|
|
580
|
-
label:
|
|
581
|
-
description:
|
|
581
|
+
label: c(n.title, t, e),
|
|
582
|
+
description: c(n.description, t, e),
|
|
582
583
|
group: n.category,
|
|
583
|
-
keywords: [...
|
|
584
|
+
keywords: [...s(e) ?? []],
|
|
584
585
|
...n.inline === !0 ? { inline: !0 } : {},
|
|
585
|
-
template:
|
|
586
|
+
template: c(n.insertText, t, n.insertText.en ?? "")
|
|
586
587
|
};
|
|
587
588
|
}
|
|
588
|
-
var
|
|
589
|
+
var W = o.map((e) => Ve(e, "en")), He = Object.freeze(l.map((e) => ({
|
|
589
590
|
id: e.id,
|
|
590
|
-
label:
|
|
591
|
-
}))),
|
|
591
|
+
label: c(e.title, "zh", e.id)
|
|
592
|
+
}))), G = o.map((e) => Ve(e, "zh")), Ue = W.filter((e) => d[e.id]?.extended === !0), We = Object.freeze(Object.fromEntries(G.filter((e) => d[e.id]?.extended === !0).map((e) => [e.id, Object.freeze({
|
|
592
593
|
label: e.label,
|
|
593
594
|
description: e.description,
|
|
594
595
|
keywords: Object.freeze([...e.keywords]),
|
|
595
596
|
template: e.template
|
|
596
597
|
})])));
|
|
597
|
-
function
|
|
598
|
+
function Ge(e = "en") {
|
|
598
599
|
return e === "zh" ? {
|
|
599
|
-
groups:
|
|
600
|
-
components:
|
|
600
|
+
groups: He,
|
|
601
|
+
components: G
|
|
601
602
|
} : {
|
|
602
603
|
groups: Be,
|
|
603
|
-
components:
|
|
604
|
+
components: W
|
|
604
605
|
};
|
|
605
606
|
}
|
|
606
|
-
function
|
|
607
|
+
function Ke(e) {
|
|
607
608
|
return new Set(e.match(/[A-Za-z_][A-Za-z0-9_]*/g) ?? []);
|
|
608
609
|
}
|
|
609
|
-
function
|
|
610
|
+
function qe(e) {
|
|
610
611
|
let t = e.trim().replace(/[^A-Za-z0-9_]/g, "_");
|
|
611
612
|
return t ? /^[0-9]/.test(t) ? `_${t}` : t : "value";
|
|
612
613
|
}
|
|
613
|
-
function
|
|
614
|
+
function Je(e, t) {
|
|
614
615
|
if (!t.has(e)) return e;
|
|
615
616
|
let n = 2;
|
|
616
617
|
for (; t.has(`${e}${n}`);) n += 1;
|
|
617
618
|
return `${e}${n}`;
|
|
618
619
|
}
|
|
619
|
-
function
|
|
620
|
-
let r =
|
|
620
|
+
function K(e, t, n) {
|
|
621
|
+
let r = Ke(t), i = /* @__PURE__ */ new Map();
|
|
621
622
|
return e.template.replace(/\{\{bind:([^{}]+)\}\}/g, (e, t) => {
|
|
622
623
|
let n = t.trim(), a = i.get(n);
|
|
623
624
|
if (a) return a;
|
|
624
|
-
let o = qe(
|
|
625
|
+
let o = Je(qe(n), r);
|
|
625
626
|
return r.add(o), i.set(n, o), o;
|
|
626
627
|
});
|
|
627
628
|
}
|
|
628
629
|
// src/authoring/templates.ts
|
|
629
|
-
function
|
|
630
|
+
function Ye(e) {
|
|
630
631
|
let t = {};
|
|
631
632
|
for (let [n, r] of Object.entries(e.props)) t[n] = {
|
|
632
633
|
kind: r.kind,
|
|
@@ -641,22 +642,22 @@ function G(e) {
|
|
|
641
642
|
};
|
|
642
643
|
return t;
|
|
643
644
|
}
|
|
644
|
-
function
|
|
645
|
+
function Xe(e) {
|
|
645
646
|
return e.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">");
|
|
646
647
|
}
|
|
647
|
-
function
|
|
648
|
-
return e === null ? "" :
|
|
648
|
+
function Ze(e) {
|
|
649
|
+
return e === null ? "" : Xe(String(e));
|
|
649
650
|
}
|
|
650
|
-
function
|
|
651
|
+
function Qe(t) {
|
|
651
652
|
let n = t.replace(/[^A-Za-z0-9_]/g, "_"), r = /^[0-9]/.test(n) ? `_${n}` : n;
|
|
652
653
|
return e.has(r) ? `${r}_value` : r;
|
|
653
654
|
}
|
|
654
|
-
function
|
|
655
|
-
if (e.defaultValue !== void 0 && e.defaultValue !== null) return
|
|
655
|
+
function $e(e, t) {
|
|
656
|
+
if (e.defaultValue !== void 0 && e.defaultValue !== null) return Ze(e.defaultValue);
|
|
656
657
|
switch (e.kind) {
|
|
657
658
|
case "boolean": return "false";
|
|
658
659
|
case "enum":
|
|
659
|
-
if (e.values?.length) return
|
|
660
|
+
if (e.values?.length) return Ze(e.values[0]);
|
|
660
661
|
throw Error(`${t} is a required enum without values; provide an authoring.insertText.`);
|
|
661
662
|
case "number": {
|
|
662
663
|
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;
|
|
@@ -672,24 +673,24 @@ function Ze(e, t) {
|
|
|
672
673
|
default: throw Error(`${t} has an unsupported property kind; provide an authoring.insertText.`);
|
|
673
674
|
}
|
|
674
675
|
}
|
|
675
|
-
function
|
|
676
|
+
function et(e) {
|
|
676
677
|
if (e.structure && e.structure.rule !== "none" && e.structure.rule !== "any" && e.structure.rule !== "inline") return !0;
|
|
677
678
|
let t = e.children;
|
|
678
679
|
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;
|
|
679
680
|
}
|
|
680
|
-
function
|
|
681
|
+
function tt(e, t) {
|
|
681
682
|
let n = e.name, r = e.form;
|
|
682
683
|
if (r !== "leaf" && r !== "inline" && r !== "container") throw Error(`component "${n}" has an unsupported form; provide an authoring.insertText.`);
|
|
683
684
|
let i = e.structure?.rule === "raw-body";
|
|
684
685
|
if (i && r !== "container") throw Error(`component "${n}" declares a raw body on a non-container form; provide an authoring.insertText.`);
|
|
685
|
-
if (!i &&
|
|
686
|
+
if (!i && et(e)) throw Error(`component "${n}" requires children; provide an authoring.insertText.`);
|
|
686
687
|
let a = Object.entries(e.bindings ?? {}), o = new Set(a.flatMap(([, e]) => [e.bind, e.initial])), s = [];
|
|
687
|
-
for (let [e, t] of a) s.push(`${t.bind}="${
|
|
688
|
-
for (let [e, r] of Object.entries(t)) r.required && (o.has(e) || s.push(`${e}="${
|
|
688
|
+
for (let [e, t] of a) s.push(`${t.bind}="${Qe(e === "value" ? n : `${n}_${e}`)}"`);
|
|
689
|
+
for (let [e, r] of Object.entries(t)) r.required && (o.has(e) || s.push(`${e}="${$e(r, `component "${n}" property "${e}"`)}"`));
|
|
689
690
|
let c = `<${n}${s.length > 0 ? ` ${s.join(" ")}` : ""}`;
|
|
690
691
|
return r === "leaf" ? `${c}>` : r === "inline" ? `${c}></${n}>` : i ? `${c}>${(e.structure?.min ?? 0) > 0 ? "\n…\n" : "\n\n"}</${n}>` : `${c}>\n\n</${n}>`;
|
|
691
692
|
}
|
|
692
|
-
var
|
|
693
|
+
var nt = {
|
|
693
694
|
id: "authoring-template",
|
|
694
695
|
label: "",
|
|
695
696
|
description: "",
|
|
@@ -697,41 +698,41 @@ var et = {
|
|
|
697
698
|
keywords: [],
|
|
698
699
|
template: ""
|
|
699
700
|
};
|
|
700
|
-
function
|
|
701
|
-
let n =
|
|
702
|
-
...
|
|
701
|
+
function q(e, t = "") {
|
|
702
|
+
let n = K({
|
|
703
|
+
...nt,
|
|
703
704
|
template: e
|
|
704
705
|
}, t);
|
|
705
|
-
return
|
|
706
|
+
return B(t, {
|
|
706
707
|
start: t.length,
|
|
707
708
|
end: t.length
|
|
708
709
|
}, n).value.slice(t.length);
|
|
709
710
|
}
|
|
710
|
-
function
|
|
711
|
+
function rt(e) {
|
|
711
712
|
return e.diagnostics.map((e) => `${e.code}: ${e.message}`).join("; ");
|
|
712
713
|
}
|
|
713
|
-
function
|
|
714
|
-
let n =
|
|
714
|
+
function it(e, t) {
|
|
715
|
+
let n = q(t), r = `</${e}>`, i = n.lastIndexOf(r);
|
|
715
716
|
if (!(i < 0)) return {
|
|
716
717
|
before: `${n.slice(0, i)}\n`,
|
|
717
718
|
after: `\n${n.slice(i)}`
|
|
718
719
|
};
|
|
719
720
|
}
|
|
720
|
-
function
|
|
721
|
-
let
|
|
721
|
+
function at(e, t, n, r) {
|
|
722
|
+
let i = r === void 0 ? q(e) : q(e, r.before), o = r === void 0 ? i : `${r.before}${i}${r.after}`, s;
|
|
722
723
|
try {
|
|
723
|
-
s =
|
|
724
|
+
s = a(o, t ?? {});
|
|
724
725
|
} catch (e) {
|
|
725
726
|
throw Error(`${n} authoring.insertText could not be compiled: ${e instanceof Error ? e.message : String(e)}.`);
|
|
726
727
|
}
|
|
727
728
|
if (s.ok) return;
|
|
728
|
-
let c =
|
|
729
|
+
let c = rt(s);
|
|
729
730
|
throw Error(`${n} authoring.insertText does not compile with this configuration${c ? ` (${c})` : ""}.`);
|
|
730
731
|
}
|
|
731
|
-
function
|
|
732
|
-
let
|
|
732
|
+
function ot(e, t, n, r) {
|
|
733
|
+
let i = r === void 0 ? e : `${r.before}${e}${r.after}`, o;
|
|
733
734
|
try {
|
|
734
|
-
o =
|
|
735
|
+
o = a(i, t ?? {});
|
|
735
736
|
} catch (e) {
|
|
736
737
|
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.`);
|
|
737
738
|
}
|
|
@@ -740,42 +741,42 @@ function it(e, t, n, i) {
|
|
|
740
741
|
throw Error(`${n} has no authoring.insertText and its synthesized template does not compile with this configuration${s ? ` (${s})` : ""}. Provide authoring.insertText.`);
|
|
741
742
|
}
|
|
742
743
|
// src/authoring/catalog.ts
|
|
743
|
-
function
|
|
744
|
+
function J(e) {
|
|
744
745
|
return /* @__PURE__ */ Error(`Invalid local component catalog: ${e}`);
|
|
745
746
|
}
|
|
746
|
-
function
|
|
747
|
-
return
|
|
747
|
+
function Y(e, t, n) {
|
|
748
|
+
return c(e, t, n);
|
|
748
749
|
}
|
|
749
|
-
function
|
|
750
|
-
let n =
|
|
750
|
+
function st(e, t) {
|
|
751
|
+
let n = Y(e, t, "");
|
|
751
752
|
return n === "" ? void 0 : n;
|
|
752
753
|
}
|
|
753
|
-
function
|
|
754
|
+
function ct(e) {
|
|
754
755
|
if (typeof e == "string" || typeof e == "number" || typeof e == "boolean") return e;
|
|
755
756
|
if (e === null) return null;
|
|
756
757
|
}
|
|
757
|
-
function
|
|
758
|
+
function X(e) {
|
|
758
759
|
return e?.rule === "raw-body" ? "raw" : "markdown";
|
|
759
760
|
}
|
|
760
|
-
function
|
|
761
|
+
function lt(e, t, n) {
|
|
761
762
|
return Object.freeze({
|
|
762
|
-
name:
|
|
763
|
-
kind:
|
|
764
|
-
required: t
|
|
765
|
-
static:
|
|
766
|
-
dynamic:
|
|
767
|
-
...
|
|
768
|
-
...
|
|
763
|
+
name: t,
|
|
764
|
+
kind: n.kind,
|
|
765
|
+
required: g(e, t, n),
|
|
766
|
+
static: n.static === !0,
|
|
767
|
+
dynamic: n.dynamic === !0,
|
|
768
|
+
...n.values ? { values: Object.freeze([...n.values]) } : {},
|
|
769
|
+
...ct(n.default) === void 0 ? {} : { defaultValue: ct(n.default) }
|
|
769
770
|
});
|
|
770
771
|
}
|
|
771
|
-
function
|
|
772
|
-
let
|
|
773
|
-
for (let [
|
|
774
|
-
return
|
|
772
|
+
function ut(e) {
|
|
773
|
+
let t = {};
|
|
774
|
+
for (let [n, r] of Object.entries(e.props)) t[n] = lt(e, n, r);
|
|
775
|
+
return t;
|
|
775
776
|
}
|
|
776
|
-
function
|
|
777
|
+
function dt(e, t, n) {
|
|
777
778
|
for (let [r, i] of Object.entries(e.props)) {
|
|
778
|
-
let e =
|
|
779
|
+
let e = st(i.description, n);
|
|
779
780
|
if (e === void 0) continue;
|
|
780
781
|
let a = t[r];
|
|
781
782
|
t[r] = Object.freeze({
|
|
@@ -791,7 +792,7 @@ function lt(e, t, n) {
|
|
|
791
792
|
}
|
|
792
793
|
return t;
|
|
793
794
|
}
|
|
794
|
-
function
|
|
795
|
+
function ft(e) {
|
|
795
796
|
return Object.freeze({
|
|
796
797
|
id: e.id,
|
|
797
798
|
name: e.name,
|
|
@@ -812,163 +813,163 @@ function ut(e) {
|
|
|
812
813
|
...e.requires === void 0 ? {} : { requires: Object.freeze({ ...e.requires }) }
|
|
813
814
|
});
|
|
814
815
|
}
|
|
815
|
-
function
|
|
816
|
+
function pt(e) {
|
|
816
817
|
let t = e.structure;
|
|
817
818
|
return {
|
|
818
819
|
...t?.parents?.length ? { parents: t.parents } : {},
|
|
819
820
|
...t?.children?.length ? { allowedChildren: t.children } : {}
|
|
820
821
|
};
|
|
821
822
|
}
|
|
822
|
-
function
|
|
823
|
+
function mt(e, t) {
|
|
823
824
|
if (e === t) return !0;
|
|
824
825
|
if (e === void 0 || t === void 0) return !1;
|
|
825
826
|
let n = Object.keys(e).sort(), r = Object.keys(t).sort();
|
|
826
827
|
return n.length === r.length && n.every((n, i) => n === r[i] && e[n] === t[n]);
|
|
827
828
|
}
|
|
828
|
-
function
|
|
829
|
+
function Z(e) {
|
|
829
830
|
let t = e.authoring;
|
|
830
831
|
if (t === void 0) return;
|
|
831
|
-
if (
|
|
832
|
-
let n =
|
|
833
|
-
return t.title !== void 0 && !
|
|
832
|
+
if (u(e.name) === void 0) return t;
|
|
833
|
+
let n = p(e.name), r = {};
|
|
834
|
+
return t.title !== void 0 && !mt(t.title, n?.title) && (r.title = t.title), t.description !== void 0 && !mt(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);
|
|
834
835
|
}
|
|
835
|
-
function
|
|
836
|
-
let n =
|
|
836
|
+
function Q(e, t) {
|
|
837
|
+
let n = u(e.name), r = Z(e);
|
|
837
838
|
if (n) {
|
|
838
839
|
let e = r?.insertText;
|
|
839
840
|
if (e !== void 0) return e.trim() === "" ? void 0 : e;
|
|
840
|
-
let i =
|
|
841
|
+
let i = Y(n.insertText, t, n.insertText.en ?? "");
|
|
841
842
|
return i === "" ? void 0 : i;
|
|
842
843
|
}
|
|
843
844
|
let i = r?.insertText;
|
|
844
845
|
return i !== void 0 && i.trim() !== "" ? i : void 0;
|
|
845
846
|
}
|
|
846
|
-
function
|
|
847
|
-
let n =
|
|
848
|
-
return n === void 0 ?
|
|
847
|
+
function ht(e, t) {
|
|
848
|
+
let n = Q(e, t);
|
|
849
|
+
return n === void 0 ? tt(e, Ye(e)) : n;
|
|
849
850
|
}
|
|
850
|
-
function
|
|
851
|
-
let
|
|
852
|
-
if (
|
|
853
|
-
let
|
|
854
|
-
if (
|
|
851
|
+
function gt(e, t, n) {
|
|
852
|
+
let r = i(e).structure?.parents;
|
|
853
|
+
if (r !== void 0 && r.length !== 0) for (let e of r) {
|
|
854
|
+
let r = t.get(e);
|
|
855
|
+
if (r === void 0 || r.form !== "container") continue;
|
|
855
856
|
let i;
|
|
856
857
|
try {
|
|
857
|
-
i =
|
|
858
|
+
i = ht(r, n);
|
|
858
859
|
} catch {
|
|
859
860
|
continue;
|
|
860
861
|
}
|
|
861
|
-
let a =
|
|
862
|
+
let a = it(e, i);
|
|
862
863
|
if (a !== void 0) return a;
|
|
863
864
|
}
|
|
864
865
|
}
|
|
865
|
-
function
|
|
866
|
+
function _t(e, t) {
|
|
866
867
|
if (e.parents !== void 0 && e.parents.length !== 0) for (let n of e.parents) {
|
|
867
868
|
let e = t.find((e) => e.name === n);
|
|
868
869
|
if (e === void 0 || e.form !== "container") continue;
|
|
869
|
-
let r =
|
|
870
|
+
let r = it(n, e.insertText);
|
|
870
871
|
if (r !== void 0) return r;
|
|
871
872
|
}
|
|
872
873
|
}
|
|
873
|
-
function
|
|
874
|
-
let
|
|
875
|
-
if (
|
|
876
|
-
if (
|
|
877
|
-
let
|
|
874
|
+
function vt(e, t, n, r, a) {
|
|
875
|
+
let o = i(e), c = u(e.name), l = e.authoring, d = Z(e), p = Y(c ? d?.title ?? c.title : l?.title, t, e.name), m = Y(c ? d?.description ?? c.description : l?.description, t, p), h = c ? d?.category ?? c.category : l?.category !== void 0 && l.category.trim() !== "" ? l.category : "extension", ee = f(h, t), g = Q(e, t), _ = pt(o), v;
|
|
876
|
+
if (g !== void 0) {
|
|
877
|
+
if (v = g, a) {
|
|
878
|
+
let i = gt(e, r, t);
|
|
878
879
|
try {
|
|
879
|
-
|
|
880
|
+
at(v, n, `component "${e.name}"`, i);
|
|
880
881
|
} catch (e) {
|
|
881
|
-
throw
|
|
882
|
+
throw J(e instanceof Error ? e.message : String(e));
|
|
882
883
|
}
|
|
883
884
|
}
|
|
884
885
|
} else {
|
|
885
886
|
try {
|
|
886
|
-
|
|
887
|
+
v = tt(e, Ye(e));
|
|
887
888
|
} catch (e) {
|
|
888
|
-
throw
|
|
889
|
+
throw J(e instanceof Error ? e.message : String(e));
|
|
889
890
|
}
|
|
890
|
-
if (
|
|
891
|
-
|
|
891
|
+
if (a) try {
|
|
892
|
+
ot(v, n, `component "${e.name}"`, gt(e, r, t));
|
|
892
893
|
} catch (e) {
|
|
893
|
-
throw
|
|
894
|
+
throw J(e instanceof Error ? e.message : String(e));
|
|
894
895
|
}
|
|
895
896
|
}
|
|
896
|
-
let
|
|
897
|
-
return
|
|
898
|
-
id:
|
|
897
|
+
let y = dt(e, ut(o), t), b = s(e.name);
|
|
898
|
+
return ft({
|
|
899
|
+
id: c ? e.name : e.id,
|
|
899
900
|
name: e.name,
|
|
900
901
|
title: p,
|
|
901
902
|
description: m,
|
|
902
903
|
category: h,
|
|
903
|
-
categoryLabel:
|
|
904
|
-
insertText:
|
|
904
|
+
categoryLabel: ee,
|
|
905
|
+
insertText: v,
|
|
905
906
|
form: e.form,
|
|
906
|
-
bodyKind:
|
|
907
|
-
inline:
|
|
908
|
-
...
|
|
907
|
+
bodyKind: X(o.structure),
|
|
908
|
+
inline: c ? c.inline === !0 : e.form === "inline",
|
|
909
|
+
..._,
|
|
909
910
|
...b === void 0 ? {} : { keywords: b },
|
|
910
|
-
props:
|
|
911
|
+
props: y,
|
|
911
912
|
...e.styles === void 0 ? {} : { styles: e.styles },
|
|
912
913
|
...e.requires === void 0 ? {} : { requires: e.requires }
|
|
913
914
|
});
|
|
914
915
|
}
|
|
915
|
-
function
|
|
916
|
-
let
|
|
917
|
-
for (let e of
|
|
918
|
-
let t =
|
|
919
|
-
t && t.authoring !== void 0 && (s.push(
|
|
916
|
+
function yt(e, t, n, r, i) {
|
|
917
|
+
let a = new Map(e.map((e) => [e.name, e])), s = [], c = /* @__PURE__ */ new Set();
|
|
918
|
+
for (let e of o) {
|
|
919
|
+
let t = a.get(e);
|
|
920
|
+
t && t.authoring !== void 0 && (s.push(vt(t, n, r, a, !1)), c.add(e));
|
|
920
921
|
}
|
|
921
|
-
for (let
|
|
922
|
+
for (let o of e) c.has(o.name) || (o.authoring !== void 0 || t.has(o.name)) && (s.push(vt(o, n, r, a, i && t.has(o.name))), c.add(o.name));
|
|
922
923
|
return s;
|
|
923
924
|
}
|
|
924
|
-
function
|
|
925
|
-
let
|
|
926
|
-
for (let [t, n] of Object.entries(e.props))
|
|
925
|
+
function bt(e, t) {
|
|
926
|
+
let n = u(e.name), r = e.authoring, a = Z(e), o = {};
|
|
927
|
+
for (let [t, n] of Object.entries(e.props)) o[t] = n.description;
|
|
927
928
|
return JSON.stringify({
|
|
928
929
|
name: e.name,
|
|
929
930
|
id: e.id,
|
|
930
931
|
form: e.form,
|
|
931
|
-
title:
|
|
932
|
-
description:
|
|
933
|
-
category:
|
|
934
|
-
categoryLabel:
|
|
935
|
-
insertText:
|
|
936
|
-
inline:
|
|
937
|
-
bodyKind:
|
|
938
|
-
keywords:
|
|
939
|
-
manifest:
|
|
940
|
-
preset:
|
|
941
|
-
propDescriptions:
|
|
942
|
-
structure:
|
|
932
|
+
title: Y(n ? a?.title ?? n.title : r?.title, t, e.name),
|
|
933
|
+
description: Y(n ? a?.description ?? n.description : r?.description, t, ""),
|
|
934
|
+
category: n ? a?.category ?? n.category : r?.category ?? "",
|
|
935
|
+
categoryLabel: f(n ? a?.category ?? n.category : r?.category ?? "extension", t),
|
|
936
|
+
insertText: Q(e, t) ?? null,
|
|
937
|
+
inline: n ? n.inline === !0 : e.form === "inline",
|
|
938
|
+
bodyKind: X(i(e).structure),
|
|
939
|
+
keywords: s(e.name) ?? null,
|
|
940
|
+
manifest: r ?? null,
|
|
941
|
+
preset: n ?? null,
|
|
942
|
+
propDescriptions: o,
|
|
943
|
+
structure: i(e).structure ?? null,
|
|
943
944
|
styles: e.styles ?? null,
|
|
944
945
|
requires: e.requires ?? null
|
|
945
946
|
});
|
|
946
947
|
}
|
|
947
|
-
function
|
|
948
|
-
let n =
|
|
948
|
+
function xt(e, t = "en") {
|
|
949
|
+
let n = h(e);
|
|
949
950
|
if (!n.ok) return `invalid|${t}`;
|
|
950
|
-
let r = n.registry.map((e) =>
|
|
951
|
-
return `${
|
|
951
|
+
let r = n.registry.map((e) => bt(e, t));
|
|
952
|
+
return `${ee(e)}|${t}|${r.join("\0")}`;
|
|
952
953
|
}
|
|
953
954
|
function $(e, t, n, r) {
|
|
954
|
-
return Object.freeze(
|
|
955
|
+
return Object.freeze(yt(e.registry, e.externalComponentNames, t, n, r));
|
|
955
956
|
}
|
|
956
|
-
function
|
|
957
|
-
let n =
|
|
958
|
-
if (!r.ok) throw
|
|
957
|
+
function St(e, t = "en") {
|
|
958
|
+
let n = m(e), r = h({ config: n });
|
|
959
|
+
if (!r.ok) throw J(r.message);
|
|
959
960
|
return $(r, t, { config: n }, !0);
|
|
960
961
|
}
|
|
961
|
-
function
|
|
962
|
-
let n =
|
|
963
|
-
if (!r.ok) throw
|
|
962
|
+
function Ct(e, t = "en") {
|
|
963
|
+
let n = m(e), r = h({ config: n });
|
|
964
|
+
if (!r.ok) throw J(r.message);
|
|
964
965
|
return $(r, t, { config: n }, !1);
|
|
965
966
|
}
|
|
966
|
-
function
|
|
967
|
-
let n =
|
|
967
|
+
function wt(e, t = "en") {
|
|
968
|
+
let n = h(e);
|
|
968
969
|
return n.ok ? $(n, t, e, !0) : Object.freeze([]);
|
|
969
970
|
}
|
|
970
|
-
function
|
|
971
|
-
let t = new Map(
|
|
971
|
+
function Tt(e) {
|
|
972
|
+
let t = new Map(l.map((e, t) => [e.id, t])), n = /* @__PURE__ */ new Map();
|
|
972
973
|
for (let t of e) {
|
|
973
974
|
let e = n.get(t.category);
|
|
974
975
|
e ? e.entries.push(t) : n.set(t.category, {
|
|
@@ -987,7 +988,7 @@ function St(e) {
|
|
|
987
988
|
entries: Object.freeze([...e.entries])
|
|
988
989
|
})));
|
|
989
990
|
}
|
|
990
|
-
function
|
|
991
|
+
function Et(e, t = {}) {
|
|
991
992
|
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 === "" || [
|
|
992
993
|
e.name,
|
|
993
994
|
e.title,
|
|
@@ -997,17 +998,17 @@ function Ct(e, t = {}) {
|
|
|
997
998
|
].some((e) => e.toLowerCase().includes(a)));
|
|
998
999
|
return Object.freeze(o);
|
|
999
1000
|
}
|
|
1000
|
-
function
|
|
1001
|
+
function Dt(e) {
|
|
1001
1002
|
let t = [];
|
|
1002
1003
|
e.description !== "" && t.push(e.description);
|
|
1003
1004
|
for (let n of Object.values(e.props)) n.description !== void 0 && t.push(`${n.name}: ${n.description}`);
|
|
1004
1005
|
return t.join("\n");
|
|
1005
1006
|
}
|
|
1006
|
-
function
|
|
1007
|
-
if (typeof e != "string" || !Number.isFinite(t) || !
|
|
1007
|
+
function Ot(e, t, n) {
|
|
1008
|
+
if (typeof e != "string" || !Number.isFinite(t) || !h(n).ok) return Object.freeze([]);
|
|
1008
1009
|
let r = Math.max(0, Math.min(e.length, Math.floor(t))), i = Object.freeze([]), a;
|
|
1009
1010
|
try {
|
|
1010
|
-
a =
|
|
1011
|
+
a = te(e, n);
|
|
1011
1012
|
} catch {
|
|
1012
1013
|
return i;
|
|
1013
1014
|
}
|
|
@@ -1019,13 +1020,13 @@ function Tt(e, t, n) {
|
|
|
1019
1020
|
};
|
|
1020
1021
|
return o(a.nodes, Object.freeze([])), i;
|
|
1021
1022
|
}
|
|
1022
|
-
function
|
|
1023
|
+
function kt(e) {
|
|
1023
1024
|
let t = {};
|
|
1024
1025
|
if (!e) return t;
|
|
1025
1026
|
for (let [n, r] of Object.entries(e.props)) t[n] = Object.freeze({
|
|
1026
1027
|
name: n,
|
|
1027
1028
|
kind: r.kind,
|
|
1028
|
-
required:
|
|
1029
|
+
required: g(e, n, r),
|
|
1029
1030
|
static: r.static === !0,
|
|
1030
1031
|
dynamic: r.dynamic === !0,
|
|
1031
1032
|
...r.values ? { values: Object.freeze([...r.values]) } : {},
|
|
@@ -1033,7 +1034,7 @@ function Et(e) {
|
|
|
1033
1034
|
});
|
|
1034
1035
|
return t;
|
|
1035
1036
|
}
|
|
1036
|
-
function
|
|
1037
|
+
function At(e) {
|
|
1037
1038
|
return Object.freeze({
|
|
1038
1039
|
name: e.name,
|
|
1039
1040
|
form: e.form,
|
|
@@ -1052,7 +1053,7 @@ function Dt(e) {
|
|
|
1052
1053
|
...e.requires === void 0 ? {} : { requires: Object.freeze({ ...e.requires }) }
|
|
1053
1054
|
});
|
|
1054
1055
|
}
|
|
1055
|
-
function
|
|
1056
|
+
function jt(e) {
|
|
1056
1057
|
let t = new Map(e.map((e) => [e.name, e])), n = Object.freeze([...e]);
|
|
1057
1058
|
return Object.freeze({
|
|
1058
1059
|
tags: n,
|
|
@@ -1064,53 +1065,60 @@ function Ot(e) {
|
|
|
1064
1065
|
}
|
|
1065
1066
|
});
|
|
1066
1067
|
}
|
|
1067
|
-
function
|
|
1068
|
-
let
|
|
1069
|
-
if (!
|
|
1070
|
-
let
|
|
1068
|
+
function Mt(e, r = "en", i) {
|
|
1069
|
+
let a = h(e);
|
|
1070
|
+
if (!a.ok) return jt([]);
|
|
1071
|
+
let o = [];
|
|
1071
1072
|
try {
|
|
1072
|
-
|
|
1073
|
+
o = $(a, r, e, !1);
|
|
1073
1074
|
} catch {
|
|
1074
|
-
|
|
1075
|
+
o = Object.freeze([]);
|
|
1075
1076
|
}
|
|
1076
|
-
let
|
|
1077
|
-
for (let [e,
|
|
1078
|
-
let
|
|
1079
|
-
for (let [e, t] of Object.entries(
|
|
1080
|
-
...
|
|
1077
|
+
let s = new Map(o.map((e) => [e.name, e])), c = [];
|
|
1078
|
+
for (let [e, r] of a.schemaByName) {
|
|
1079
|
+
let o = s.get(e), l = kt(r);
|
|
1080
|
+
for (let [e, t] of Object.entries(o?.props ?? {})) l[e] = Object.freeze({
|
|
1081
|
+
...l[e],
|
|
1081
1082
|
...t
|
|
1082
1083
|
});
|
|
1083
|
-
a.
|
|
1084
|
+
if (e === "text" && a.componentByName.get(e)?.id === "reactive-md/text" && l.font?.kind === "enum") {
|
|
1085
|
+
let e = n(a.config, i);
|
|
1086
|
+
l.font = Object.freeze({
|
|
1087
|
+
...l.font,
|
|
1088
|
+
values: Object.freeze(t(e, l.font.values))
|
|
1089
|
+
});
|
|
1090
|
+
}
|
|
1091
|
+
c.push(At({
|
|
1084
1092
|
name: e,
|
|
1085
|
-
form:
|
|
1086
|
-
bodyKind:
|
|
1087
|
-
title:
|
|
1088
|
-
description:
|
|
1089
|
-
category:
|
|
1090
|
-
categoryLabel:
|
|
1091
|
-
insertText:
|
|
1092
|
-
props:
|
|
1093
|
-
...
|
|
1094
|
-
...
|
|
1095
|
-
...
|
|
1096
|
-
...
|
|
1097
|
-
...
|
|
1093
|
+
form: r.form,
|
|
1094
|
+
bodyKind: X(r.structure),
|
|
1095
|
+
title: o?.title ?? e,
|
|
1096
|
+
description: o?.description ?? "",
|
|
1097
|
+
category: o?.category ?? "component",
|
|
1098
|
+
categoryLabel: o?.categoryLabel ?? "component",
|
|
1099
|
+
insertText: o?.insertText ?? "",
|
|
1100
|
+
props: l,
|
|
1101
|
+
...o?.parents === void 0 ? {} : { parents: o.parents },
|
|
1102
|
+
...o?.allowedChildren === void 0 ? {} : { allowedChildren: o.allowedChildren },
|
|
1103
|
+
...o?.keywords === void 0 ? {} : { keywords: o.keywords },
|
|
1104
|
+
...o?.styles === void 0 ? {} : { styles: o.styles },
|
|
1105
|
+
...o?.requires === void 0 ? {} : { requires: o.requires }
|
|
1098
1106
|
}));
|
|
1099
1107
|
}
|
|
1100
|
-
return
|
|
1108
|
+
return jt(c);
|
|
1101
1109
|
}
|
|
1102
1110
|
// src/authoring/insert.ts
|
|
1103
|
-
var
|
|
1104
|
-
function
|
|
1105
|
-
let i = new Set(r.match(
|
|
1111
|
+
var Nt = /[A-Za-z_][A-Za-z0-9_]*/g;
|
|
1112
|
+
function Pt(t, n, r) {
|
|
1113
|
+
let i = new Set(r.match(Nt) ?? []), a = b(t, n, { diagnostics: !1 }).bindings.filter((e) => e.declarations.length > 0).map((e) => e.name), o = new Set(a), s = t;
|
|
1106
1114
|
for (let t of a) {
|
|
1107
1115
|
let r = t, a = 2;
|
|
1108
1116
|
for (; i.has(r) || e.has(r) || r !== t && o.has(r);) r = `${t}${a}`, a += 1;
|
|
1109
|
-
i.add(r), r !== t && (s =
|
|
1117
|
+
i.add(r), r !== t && (s = _(s, t, r, n).source);
|
|
1110
1118
|
}
|
|
1111
1119
|
return s;
|
|
1112
1120
|
}
|
|
1113
|
-
function
|
|
1121
|
+
function Ft(e) {
|
|
1114
1122
|
return {
|
|
1115
1123
|
id: e.id,
|
|
1116
1124
|
label: e.title,
|
|
@@ -1120,31 +1128,31 @@ function Mt(e) {
|
|
|
1120
1128
|
template: e.insertText
|
|
1121
1129
|
};
|
|
1122
1130
|
}
|
|
1123
|
-
function
|
|
1124
|
-
return
|
|
1131
|
+
function It(e, t, n, r) {
|
|
1132
|
+
return B(n, r, Pt(K(Ft(e), n), t, n), { block: !e.inline });
|
|
1125
1133
|
}
|
|
1126
|
-
function
|
|
1134
|
+
function Lt(e, t, n, r, i = "en") {
|
|
1127
1135
|
if (typeof n != "string") throw TypeError("insertLocalComponent requires source text.");
|
|
1128
1136
|
if (typeof t != "string" || t.length === 0) throw TypeError("insertLocalComponent requires a component id.");
|
|
1129
|
-
let a =
|
|
1137
|
+
let a = h(e);
|
|
1130
1138
|
if (!a.ok) throw Error(`Invalid compile options: ${a.message}`);
|
|
1131
|
-
let o =
|
|
1139
|
+
let o = wt(e, i).find((e) => e.id === t || e.name === t);
|
|
1132
1140
|
if (!o) throw Error(`Unknown local component "${t}".`);
|
|
1133
|
-
return
|
|
1141
|
+
return It(o, e, n, r);
|
|
1134
1142
|
}
|
|
1135
|
-
function
|
|
1136
|
-
return
|
|
1143
|
+
function Rt(e, t, n, r, i = "en") {
|
|
1144
|
+
return Lt({ config: m(e) }, t, n, r, i);
|
|
1137
1145
|
}
|
|
1138
1146
|
// src/authoring/conformance.ts
|
|
1139
|
-
function
|
|
1140
|
-
let n =
|
|
1147
|
+
function zt(e, t = "en") {
|
|
1148
|
+
let n = m(e), r = new Set(n.components.map((e) => e.name)), i = [], o = { config: n }, s = Ct(n, t);
|
|
1141
1149
|
for (let e of s) {
|
|
1142
|
-
if (!
|
|
1143
|
-
let t =
|
|
1150
|
+
if (!r.has(e.name)) continue;
|
|
1151
|
+
let t = It(e, o, "", {
|
|
1144
1152
|
start: 0,
|
|
1145
1153
|
end: 0
|
|
1146
|
-
}).value, n =
|
|
1147
|
-
l.ok ||
|
|
1154
|
+
}).value, n = _t(e, s), c = n === void 0 ? t : `${n.before}${t}${n.after}`, l = a(c, o);
|
|
1155
|
+
l.ok || i.push(Object.freeze({
|
|
1148
1156
|
id: e.id,
|
|
1149
1157
|
name: e.name,
|
|
1150
1158
|
message: `Insert template for <${e.name}> does not compile with this configuration.`,
|
|
@@ -1154,6 +1162,6 @@ function It(e, t = "en") {
|
|
|
1154
1162
|
})))
|
|
1155
1163
|
}));
|
|
1156
1164
|
}
|
|
1157
|
-
return Object.freeze(
|
|
1165
|
+
return Object.freeze(i);
|
|
1158
1166
|
}
|
|
1159
|
-
export {
|
|
1167
|
+
export { Ue as EXTENDED_NATIVE_COMPONENTS, We as EXTENDED_NATIVE_COMPONENT_COPY_ZH, ce as LOCAL_COMPONENTS, ie as LOCAL_COMPONENT_NAMES, W as NATIVE_COMPONENTS, G as NATIVE_COMPONENTS_ZH, Be as NATIVE_COMPONENT_GROUPS, He as NATIVE_COMPONENT_GROUPS_ZH, b as analyzeLocalSource, r as closestName, v as completeLocalSource, Mt as createLocalAuthoringLookup, St as createLocalComponentCatalog, wt as createLocalComponentCatalogForOptions, Et as filterLocalComponentCatalog, de as formatBold, ye as formatBulletList, _e as formatHeading, he as formatInlineCode, fe as formatItalic, y as formatLocalSource, be as formatOrderedList, Se as formatQuote, pe as formatStrike, xe as formatTaskList, oe as getLocalComponent, Ge as getNativeComponentCatalog, re as getPropDefault, Ce as indentSelection, Oe as insertCodeBlock, je as insertDivider, De as insertImage, Ee as insertLink, Rt as insertLocalComponent, Lt as insertLocalComponentFromOptions, Ae as insertTable, B as insertTemplate, Me as insertText, Ot as localCatalogAncestors, Tt as localComponentCatalogGroups, xt as localComponentCatalogKey, Dt as localComponentHelp, ne as localComponentNames, Te as outdentSelection, ze as readFormatState, _ as renameLocalBinding, K as renderNativeSnippet, ae as suggestAttribute, se as suggestComponent, zt as validateLocalComponentInsertTemplates };
|