reactive-md 0.9.2 → 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 +397 -333
- package/CHANGELOG.md +398 -334
- package/CONTRIBUTING-ch.md +22 -22
- package/CONTRIBUTING.md +22 -22
- package/README-ch.md +431 -431
- package/README-en.md +431 -431
- package/README.md +429 -429
- package/SECURITY-ch.md +83 -83
- package/SECURITY.md +83 -83
- package/THIRD_PARTY_NOTICES.md +0 -57
- package/bin/reactive-md.mjs +39 -39
- package/cli/args.mjs +263 -263
- package/cli/assets.mjs +395 -395
- package/cli/build.mjs +445 -445
- package/cli/check.mjs +444 -444
- package/cli/document.mjs +130 -130
- package/cli/errors.mjs +61 -61
- package/cli/fs-utils.mjs +133 -133
- package/cli/glob.mjs +203 -203
- package/cli/help.mjs +325 -323
- package/cli/init.mjs +1577 -1577
- package/cli/lint.mjs +177 -177
- package/cli/main.mjs +65 -65
- package/cli/migrate.mjs +368 -368
- package/cli/package-loader.mjs +41 -41
- package/cli/package.mjs +211 -211
- package/dist-library/LocalDocumentView-CP2QG86k.js +114 -0
- package/dist-library/{LocalDocumentViewCore-DXE0I0Qc.js → LocalDocumentViewCore-Cd6yMEkg.js} +379 -9445
- package/dist-library/LocalReactiveDocumentCore-VuYpZqdn.js +283 -0
- package/dist-library/LocalStaticDocumentView-DfX6bemE.js +147 -0
- package/dist-library/authoring-Bwu_zCWs.js +768 -0
- package/dist-library/chart-B1TUtzm-.js +3 -0
- package/dist-library/choice-values-BItGjPD2.js +58 -0
- package/dist-library/color-values-r8Wf7ALn.js +6 -0
- package/dist-library/compile-B35rfzKr.js +1742 -0
- package/dist-library/compile-cache-key-D21X2Obx.js +28 -0
- package/dist-library/compiler-DBwLawMZ.js +98 -0
- package/dist-library/{compiler-core-DDDdvuLy.js → compiler-core-kkDiQ1RK.js} +4202 -3496
- package/dist-library/component-kernel-CsJSabHX.js +372 -0
- package/dist-library/{component-state-BRwvTV0d.js → component-state-Da0G8Ajc.js} +1 -1
- package/dist-library/component-utils-ZM3jUJNy.js +339 -0
- package/dist-library/conditional-branches-CIhJXasR.js +17 -0
- package/dist-library/config-validation-DbmsWAEV.js +469 -0
- package/dist-library/controls-DRy5rzzN.js +5970 -0
- package/dist-library/controls-DWlx-AQl.js +3 -0
- package/dist-library/{coordinate-B1VFK9fd.js → coordinate-c54pHfgf.js} +89 -89
- package/dist-library/data-BtFlkJzp.js +3 -0
- package/dist-library/data-table-CSAkm1eU.js +290 -0
- package/dist-library/data-table-model-DruztQFt.js +391 -0
- package/dist-library/data-visuals-rZQUeQM0.js +384 -0
- package/dist-library/{default-components-s21NevON.js → default-components-B-39etG9.js} +518 -355
- package/dist-library/{config-DXLvctiZ.js → default-config-CCa8rm2k.js} +265 -230
- package/dist-library/default-options-By16CVw1.js +131 -0
- package/dist-library/{registry-D6OGkOcX.js → default-registry-DXJy66xj.js} +4 -4
- package/dist-library/default-schema-CeYiEW1K.js +33 -0
- package/dist-library/diagram-BLepzI8l.js +3 -0
- package/dist-library/display-Bb6hAG5T.js +2065 -0
- package/dist-library/dist-Cueh1Psp.js +4761 -0
- package/dist-library/{document-theme-C8J6UyNO.js → document-theme-CJvN-nC1.js} +246 -4
- package/dist-library/{export-CIAIPBov.js → export-BSV4E0jv.js} +135 -135
- package/dist-library/font-aliases-CKYjwn4o.js +4 -0
- package/dist-library/gallery-BC6FYTqw.js +3 -0
- package/dist-library/{gallery-Dv1rOvL0.js → gallery-DM2yTVZJ.js} +1 -1
- package/dist-library/{html-Cr4CBwAH.js → html-CY9mC3Sr.js} +49 -48
- package/dist-library/{incremental-9nx92u9c.js → incremental-B-wW4H3F.js} +537 -384
- package/dist-library/{display-B_uutKkN.js → katex-4ukd4ZxT.js} +1555 -3618
- package/dist-library/layout-CPQggKxk.js +592 -0
- package/dist-library/layout-CaDWsDof.js +3 -0
- package/dist-library/limits-CFERRrlC.js +10 -0
- package/dist-library/localization-COdJ6lw2.js +6 -0
- package/dist-library/mafs-CnzDC5CR.js +3 -0
- package/dist-library/math-view-CyGTS6kv.js +20 -0
- package/dist-library/motion-tokens-Czk0RDmS.js +283 -0
- package/dist-library/mount-preset-DtrCX4G8.js +24 -0
- package/dist-library/numeric-sliders-BmJ1LCLx.js +542 -0
- package/dist-library/{observability-4KqXhIEU.js → observability-BVQ16ByQ.js} +125 -43
- package/dist-library/package-core-Cu_r_qs7.js +128 -0
- package/dist-library/parser-BHl9Lxbw.js +8 -0
- package/dist-library/parser-standard-DDAKv_DZ.js +4872 -0
- package/dist-library/plugin-packs-CkI0floL.js +19 -0
- package/dist-library/preset-core-BKPbH_Nv.js +1371 -0
- package/dist-library/props-0iDqxlTk.js +174 -0
- package/dist-library/react-74jdGBmu.js +32 -0
- package/dist-library/reactive-md-authoring.js +315 -296
- package/dist-library/reactive-md-build.js +334 -43
- package/dist-library/reactive-md-compiler-session.js +4 -0
- 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 +6 -0
- package/dist-library/reactive-md-default-packs.js +32 -15
- package/dist-library/reactive-md-default-preset.js +7 -7
- package/dist-library/reactive-md-export.js +6 -5
- package/dist-library/reactive-md-minimal-preset.js +3 -2
- package/dist-library/reactive-md-minimal-react-preset.js +26 -23
- package/dist-library/reactive-md-minimal.css +1 -1
- package/dist-library/reactive-md-observability.js +125 -3
- package/dist-library/reactive-md-pack-style-manifest.js +805 -0
- package/dist-library/reactive-md-plugin-chart.js +14 -9
- package/dist-library/reactive-md-plugin-data.js +8 -8
- package/dist-library/reactive-md-plugin-diagram.js +7 -6
- package/dist-library/reactive-md-plugin-forms.js +14 -13
- package/dist-library/reactive-md-plugin-gallery.js +6 -5
- package/dist-library/reactive-md-plugin-navigation.js +8 -8
- package/dist-library/reactive-md-plugin-network.js +13 -13
- package/dist-library/reactive-md-plugin-plot.js +7 -6
- package/dist-library/reactive-md-print.css +304 -304
- package/dist-library/reactive-md-react-component-accordion.js +10 -0
- package/dist-library/reactive-md-react-component-alert.js +10 -0
- package/dist-library/reactive-md-react-component-anchor.js +10 -0
- package/dist-library/reactive-md-react-component-badge.js +10 -0
- package/dist-library/reactive-md-react-component-card.js +10 -0
- package/dist-library/reactive-md-react-component-chart.js +22 -0
- package/dist-library/reactive-md-react-component-checkbox.js +10 -0
- package/dist-library/reactive-md-react-component-checklist.js +10 -0
- package/dist-library/reactive-md-react-component-choices.js +10 -0
- package/dist-library/reactive-md-react-component-column.js +6 -0
- package/dist-library/reactive-md-react-component-coordinate.js +21 -0
- package/dist-library/reactive-md-react-component-counter.js +10 -0
- package/dist-library/reactive-md-react-component-data-table.js +14 -0
- package/dist-library/reactive-md-react-component-date.js +10 -0
- package/dist-library/reactive-md-react-component-diagram.js +22 -0
- package/dist-library/reactive-md-react-component-disclosure.js +10 -0
- package/dist-library/reactive-md-react-component-edge.js +22 -0
- package/dist-library/reactive-md-react-component-else.js +10 -0
- package/dist-library/reactive-md-react-component-gallery-item.js +10 -0
- package/dist-library/reactive-md-react-component-gallery.js +10 -0
- package/dist-library/reactive-md-react-component-grid.js +10 -0
- package/dist-library/reactive-md-react-component-if.js +10 -0
- package/dist-library/reactive-md-react-component-input.js +10 -0
- package/dist-library/reactive-md-react-component-jump.js +10 -0
- package/dist-library/reactive-md-react-component-multi-select.js +10 -0
- package/dist-library/reactive-md-react-component-node.js +22 -0
- package/dist-library/reactive-md-react-component-number.js +10 -0
- package/dist-library/reactive-md-react-component-option.js +10 -0
- package/dist-library/reactive-md-react-component-panel.js +10 -0
- package/dist-library/reactive-md-react-component-plot.js +26 -0
- package/dist-library/reactive-md-react-component-progress.js +10 -0
- package/dist-library/reactive-md-react-component-quiz.js +10 -0
- package/dist-library/reactive-md-react-component-radio-group.js +10 -0
- package/dist-library/reactive-md-react-component-range-slider.js +10 -0
- package/dist-library/reactive-md-react-component-section.js +10 -0
- package/dist-library/reactive-md-react-component-select.js +10 -0
- package/dist-library/reactive-md-react-component-slider.js +10 -0
- package/dist-library/reactive-md-react-component-step.js +10 -0
- package/dist-library/reactive-md-react-component-steps.js +10 -0
- package/dist-library/reactive-md-react-component-tab.js +10 -0
- package/dist-library/reactive-md-react-component-table.js +14 -0
- package/dist-library/reactive-md-react-component-tabs.js +10 -0
- package/dist-library/reactive-md-react-component-text.js +10 -0
- package/dist-library/reactive-md-react-component-textarea.js +10 -0
- package/dist-library/reactive-md-react-component-timeline.js +14 -0
- package/dist-library/reactive-md-react-component-timer.js +10 -0
- package/dist-library/reactive-md-react-component-toggle.js +10 -0
- package/dist-library/reactive-md-react-component-tooltip.js +10 -0
- package/dist-library/reactive-md-react-component-validation.js +10 -0
- package/dist-library/reactive-md-react-minimal.js +4 -4
- package/dist-library/reactive-md-react-pack-controls.js +44 -0
- package/dist-library/reactive-md-react-pack-data.js +21 -0
- package/dist-library/reactive-md-react-pack-layout.js +37 -0
- package/dist-library/reactive-md-react-pack-visuals.js +43 -0
- package/dist-library/reactive-md-react-packed.js +50 -0
- package/dist-library/reactive-md-react-server.js +29 -27
- package/dist-library/reactive-md-react-static-server.js +24 -0
- package/dist-library/reactive-md-react-static.js +1 -0
- package/dist-library/reactive-md-react-unstyled.js +15 -12
- package/dist-library/reactive-md-react.js +15 -12
- package/dist-library/reactive-md-scan.js +1 -0
- 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 +32 -32
- package/dist-library/reactive-md-testing.js +12 -12
- package/dist-library/reactive-md-vite.js +25 -9
- package/dist-library/reactive-md-worker-pool.js +401 -0
- package/dist-library/reactive-md.css +1 -1
- package/dist-library/reactive-md.js +97 -1554
- package/dist-library/registry-core-DxEaxhJ6.js +126 -0
- package/dist-library/render-nodes-B6j6Ip5I.js +9404 -0
- package/dist-library/requirements-C56sFIEs.js +157 -0
- package/dist-library/resources-6VaNgk-h.js +74 -0
- package/dist-library/rmd-pack-controls.css +1032 -0
- package/dist-library/rmd-pack-data.css +724 -0
- package/dist-library/rmd-pack-layout.css +1834 -0
- package/dist-library/rmd-pack-resource-chart.css +300 -0
- package/dist-library/rmd-pack-resource-controls.css +781 -0
- package/dist-library/rmd-pack-resource-data-visuals.css +501 -0
- package/dist-library/rmd-pack-resource-diagram.css +106 -0
- package/dist-library/rmd-pack-resource-gallery.css +346 -0
- package/dist-library/rmd-pack-resource-graphics.css +516 -0
- package/dist-library/rmd-pack-resource-layout.css +1489 -0
- package/dist-library/rmd-pack-resource-mafs-core.css +124 -0
- package/dist-library/rmd-pack-resource-mafs.css +129 -0
- package/dist-library/rmd-pack-resource-visual-base.css +224 -0
- package/dist-library/rmd-pack-visuals.css +1394 -0
- package/dist-library/runtime-BHeuLOv_.js +1369 -0
- package/dist-library/runtime-requirement-DzPO8raU.js +772 -0
- package/dist-library/schema-core-CDXfxdID.js +155 -0
- package/dist-library/sdk-core-CnE-n0Z7.js +1295 -0
- package/dist-library/{session-core-dxQCJBNa.js → session-core-C071yQwV.js} +147 -133
- package/dist-library/sha256-utf16-Bmandi_H.js +937 -0
- package/dist-library/shareable-CHCDnl6j.js +844 -0
- package/dist-library/shared-bTzN-F4g.js +3 -0
- package/dist-library/structural-views-30-YD_TJ.js +11 -0
- package/dist-library/table-surface-CfZn_tk-.js +13 -0
- package/dist-library/types/assemblies/compile-cache-key.d.ts +11 -0
- package/dist-library/types/assemblies/default-config.d.ts +35 -0
- package/dist-library/types/{local/configuration/options.d.ts → assemblies/default-options.d.ts} +4 -4
- package/dist-library/types/assemblies/default-registry.d.ts +18 -0
- package/dist-library/types/{local/configuration/schema.d.ts → assemblies/default-schema.d.ts} +4 -4
- package/dist-library/types/authoring/catalog.d.ts +14 -2
- package/dist-library/types/authoring/extensions.d.ts +1 -1
- package/dist-library/types/authoring/index.d.ts +4 -4
- package/dist-library/types/authoring/templates.d.ts +1 -1
- package/dist-library/types/compiler/index.d.ts +1 -0
- package/dist-library/types/compiler/session.d.ts +19 -0
- package/dist-library/types/compiler/standard.d.ts +1 -0
- 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/accordion.d.ts +3 -0
- package/dist-library/types/components/entries/alert.d.ts +3 -0
- package/dist-library/types/components/entries/anchor.d.ts +3 -0
- package/dist-library/types/components/entries/badge.d.ts +3 -0
- package/dist-library/types/components/entries/card.d.ts +3 -0
- package/dist-library/types/components/entries/chart.d.ts +3 -0
- package/dist-library/types/components/entries/checkbox.d.ts +3 -0
- package/dist-library/types/components/entries/checklist.d.ts +3 -0
- package/dist-library/types/components/entries/choices.d.ts +3 -0
- package/dist-library/types/components/entries/column.d.ts +3 -0
- package/dist-library/types/components/entries/coordinate.d.ts +3 -0
- package/dist-library/types/components/entries/counter.d.ts +3 -0
- package/dist-library/types/components/entries/data-table.d.ts +3 -0
- package/dist-library/types/components/entries/date.d.ts +3 -0
- package/dist-library/types/components/entries/diagram.d.ts +3 -0
- package/dist-library/types/components/entries/disclosure.d.ts +3 -0
- package/dist-library/types/components/entries/edge.d.ts +3 -0
- package/dist-library/types/components/entries/else.d.ts +3 -0
- package/dist-library/types/components/entries/gallery-item.d.ts +3 -0
- package/dist-library/types/components/entries/gallery.d.ts +3 -0
- package/dist-library/types/components/entries/grid.d.ts +3 -0
- package/dist-library/types/components/entries/if.d.ts +3 -0
- package/dist-library/types/components/entries/input.d.ts +3 -0
- package/dist-library/types/components/entries/jump.d.ts +3 -0
- package/dist-library/types/components/entries/multi-select.d.ts +3 -0
- package/dist-library/types/components/entries/node.d.ts +3 -0
- package/dist-library/types/components/entries/number.d.ts +3 -0
- package/dist-library/types/components/entries/option.d.ts +3 -0
- package/dist-library/types/components/entries/panel.d.ts +3 -0
- package/dist-library/types/components/entries/plot.d.ts +3 -0
- package/dist-library/types/components/entries/progress.d.ts +3 -0
- package/dist-library/types/components/entries/quiz.d.ts +3 -0
- package/dist-library/types/components/entries/radio-group.d.ts +3 -0
- package/dist-library/types/components/entries/range-slider.d.ts +3 -0
- package/dist-library/types/components/entries/section.d.ts +3 -0
- package/dist-library/types/components/entries/select.d.ts +3 -0
- package/dist-library/types/components/entries/slider.d.ts +3 -0
- package/dist-library/types/components/entries/step.d.ts +3 -0
- package/dist-library/types/components/entries/steps.d.ts +3 -0
- package/dist-library/types/components/entries/tab.d.ts +3 -0
- package/dist-library/types/components/entries/table.d.ts +3 -0
- package/dist-library/types/components/entries/tabs.d.ts +3 -0
- package/dist-library/types/components/entries/text.d.ts +3 -0
- package/dist-library/types/components/entries/textarea.d.ts +3 -0
- package/dist-library/types/components/entries/timeline.d.ts +3 -0
- package/dist-library/types/components/entries/timer.d.ts +3 -0
- package/dist-library/types/components/entries/toggle.d.ts +3 -0
- package/dist-library/types/components/entries/tooltip.d.ts +3 -0
- package/dist-library/types/components/entries/validation.d.ts +3 -0
- package/dist-library/types/components/layout/layout.d.ts +6 -3
- package/dist-library/types/components/layout/structural-views.d.ts +3 -0
- package/dist-library/types/components/mount-preset.d.ts +2 -0
- package/dist-library/types/components/packs/controls.d.ts +2 -0
- package/dist-library/types/components/packs/data.d.ts +2 -0
- package/dist-library/types/components/packs/layout.d.ts +2 -0
- package/dist-library/types/components/packs/visuals.d.ts +2 -0
- package/dist-library/types/components/shared/data-visuals.d.ts +3 -0
- package/dist-library/types/components/shared/table-surface.d.ts +10 -0
- package/dist-library/types/components/shared/visual-helpers.d.ts +24 -0
- package/dist-library/types/components/shared/visuals.d.ts +1 -3
- package/dist-library/types/components/table/data-table-model.d.ts +141 -0
- package/dist-library/types/components/table/data-table.d.ts +3 -50
- package/dist-library/types/{local/configuration → contracts}/component-kernel.d.ts +9 -2
- package/dist-library/types/contracts/font-aliases.d.ts +18 -0
- package/dist-library/types/contracts/index.d.ts +8 -0
- package/dist-library/types/{local/configuration → contracts}/limits.d.ts +9 -1
- package/dist-library/types/contracts/localization.d.ts +6 -0
- package/dist-library/types/contracts/number-literal.d.ts +2 -0
- package/dist-library/types/contracts/runtime-types.d.ts +19 -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/cache-version.d.ts +1 -0
- package/dist-library/types/local/compilation/compile-status.d.ts +2 -0
- package/dist-library/types/local/compilation/compiler-bindings.d.ts +1 -1
- package/dist-library/types/local/compilation/compiler-capabilities.d.ts +4 -1
- package/dist-library/types/local/compilation/compiler-choices.d.ts +4 -0
- package/dist-library/types/local/compilation/compiler-core.d.ts +1 -1
- package/dist-library/types/local/compilation/compiler-declarations.d.ts +2 -1
- package/dist-library/types/local/compilation/compiler-embedding.d.ts +20 -0
- package/dist-library/types/local/compilation/compiler-expressions.d.ts +17 -5
- package/dist-library/types/local/compilation/compiler-macros.d.ts +18 -0
- package/dist-library/types/local/compilation/compiler-structure.d.ts +9 -3
- package/dist-library/types/local/compilation/compiler-tables.d.ts +4 -2
- package/dist-library/types/local/compilation/compiler-validation.d.ts +14 -7
- package/dist-library/types/local/compilation/compiler-values.d.ts +2 -3
- package/dist-library/types/local/compilation/compiler.d.ts +1 -1
- package/dist-library/types/local/compilation/component-usage.d.ts +2 -0
- package/dist-library/types/local/compilation/runtime-requirement.d.ts +3 -0
- package/dist-library/types/local/compilation/session/incremental.d.ts +5 -1
- package/dist-library/types/local/compilation/streaming.d.ts +1 -1
- package/dist-library/types/local/configuration/diagnostic-messages.d.ts +228 -2
- package/dist-library/types/local/configuration/diagnostic-runtime-messages.d.ts +40 -0
- package/dist-library/types/local/configuration/embedding.d.ts +4 -0
- package/dist-library/types/local/configuration/kernel-value-rules.d.ts +1 -1
- package/dist-library/types/local/configuration/options-core.d.ts +8 -2
- 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 +10 -4
- package/dist-library/types/local/observability-core.d.ts +20 -1
- package/dist-library/types/local/observability.d.ts +2 -0
- package/dist-library/types/local/parsing/conditional-branches.d.ts +4 -0
- package/dist-library/types/local/parsing/parse-budget.d.ts +18 -2
- package/dist-library/types/local/parsing/parser-region.d.ts +13 -2
- package/dist-library/types/local/parsing/parser-tags.d.ts +6 -1
- package/dist-library/types/local/parsing/rmd-recovery.d.ts +8 -0
- package/dist-library/types/local/parsing/source-revision.d.ts +3 -0
- package/dist-library/types/local/performance-report.d.ts +70 -0
- package/dist-library/types/local/runtime/runtime-choices.d.ts +11 -0
- package/dist-library/types/local/runtime/runtime-pool.d.ts +14 -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/transport/worker-handler.d.ts +3 -0
- package/dist-library/types/local/transport/worker-job.d.ts +12 -2
- package/dist-library/types/local/transport/worker-pool.d.ts +68 -0
- package/dist-library/types/local/transport/worker.d.ts +14 -0
- package/dist-library/types/local/types.d.ts +70 -27
- package/dist-library/types/observability.d.ts +1 -0
- package/dist-library/types/presets/default-semantics.d.ts +1 -1
- package/dist-library/types/presets/identity.d.ts +1 -8
- package/dist-library/types/presets/pack-style-entry.d.ts +3 -0
- package/dist-library/types/presets/pack-style-manifest.d.ts +11 -0
- package/dist-library/types/react/component-api.d.ts +24 -4
- package/dist-library/types/react/component-loader.d.ts +61 -0
- package/dist-library/types/react/component-primitives.d.ts +5 -5
- 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/index.d.ts +9 -5
- package/dist-library/types/react/localization.d.ts +5 -6
- package/dist-library/types/react/minimal.d.ts +2 -2
- package/dist-library/types/react/package-core.d.ts +6 -0
- package/dist-library/types/react/packed.d.ts +17 -0
- package/dist-library/types/react/render-lifecycle.d.ts +9 -0
- package/dist-library/types/{local → react}/rendering/document/ExtendedHtmlFragment.d.ts +1 -1
- package/dist-library/types/{local → react}/rendering/document/LocalDocumentViewCore.d.ts +11 -4
- package/dist-library/types/react/rendering/document/LocalPooledDocumentView.d.ts +8 -0
- package/dist-library/types/react/rendering/document/LocalReactiveDocumentCore.d.ts +6 -0
- package/dist-library/types/react/rendering/document/LocalStaticDocumentView.d.ts +18 -0
- package/dist-library/types/react/rendering/document/StaticExternalSlot.d.ts +25 -0
- package/dist-library/types/react/rendering/document/StaticHostData.d.ts +14 -0
- package/dist-library/types/{local → react}/rendering/document/render-nodes.d.ts +8 -8
- package/dist-library/types/react/rendering/document/static-runtime.d.ts +11 -0
- package/dist-library/types/{local → react}/rendering/document/use-author-script.d.ts +2 -2
- package/dist-library/types/{local → react}/rendering/document/validation-state.d.ts +3 -3
- package/dist-library/types/{local → react}/rendering/document/view-render-context.d.ts +40 -8
- package/dist-library/types/{local → react}/rendering/document/view-revision.d.ts +5 -14
- package/dist-library/types/{local → react}/rendering/render-types.d.ts +5 -5
- package/dist-library/types/react/rendering/table/data-table.d.ts +5 -0
- package/dist-library/types/{local → react}/rendering/table/table-numeric-columns.d.ts +3 -3
- package/dist-library/types/react/sdk-core.d.ts +15 -4
- package/dist-library/types/react/sdk.d.ts +2 -1
- package/dist-library/types/react/server.d.ts +3 -10
- package/dist-library/types/react/static-server.d.ts +12 -0
- package/dist-library/types/scan/index.d.ts +15 -0
- package/dist-library/types/sdk/assembly.d.ts +3 -0
- package/dist-library/types/sdk/config.d.ts +2 -35
- package/dist-library/types/sdk/default-identity.d.ts +3 -0
- package/dist-library/types/sdk/font.d.ts +13 -0
- package/dist-library/types/sdk/index.d.ts +2 -1
- package/dist-library/types/sdk/preset.d.ts +9 -0
- package/dist-library/types/sdk/props.d.ts +8 -3
- package/dist-library/types/sdk/registry-core.d.ts +2 -2
- package/dist-library/types/sdk/registry.d.ts +2 -18
- package/dist-library/types/sdk/theme.d.ts +5 -0
- package/dist-library/types/sdk/types.d.ts +8 -2
- package/dist-library/types/sdk/version.d.ts +2 -0
- 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 +5 -2
- package/dist-library/types/vite/index.d.ts +3 -0
- package/dist-library/types/vite/registration.d.ts +1 -0
- package/dist-library/{types-Ib5kSScP.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-DAxuGOG2.js → version-4wzhbvDG.js} +24 -33
- package/dist-library/visual-frame-y5RFhJ0_.js +19 -0
- package/dist-library/visual-helpers-UU6xiL8g.js +75 -0
- package/dist-library/visuals-7xzoL9ql.js +49340 -0
- package/dist-library/visuals-CdHezgh5.js +3 -0
- package/dist-library/worker-3ldRjOEG.js +1632 -0
- package/dist-standalone/reactive-md-standalone.css +1 -1
- package/dist-standalone/reactive-md-standalone.js +127 -366
- package/docs/README-ch.md +104 -101
- package/docs/README.md +104 -101
- package/docs/compatibility/api-stability-ch.md +1 -1
- package/docs/compatibility/api-stability-en.md +1 -1
- package/docs/compatibility/compatibility-ch.md +146 -146
- package/docs/compatibility/compatibility-en.md +146 -146
- 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 +170 -162
- package/docs/compatibility/source-versioning-en.md +171 -162
- 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 +66 -66
- package/docs/development/component-development-en.md +66 -66
- package/docs/development/component-development-reference-ch.md +269 -253
- package/docs/development/component-development-reference-en.md +254 -238
- package/docs/development/component-protocol-ch.md +768 -748
- package/docs/development/component-protocol-en.md +770 -750
- package/docs/development/extension-tutorial-ch.md +308 -308
- package/docs/development/extension-tutorial-en.md +308 -308
- package/docs/development/performance-overview-ch.md +422 -422
- package/docs/development/performance-overview-en.md +422 -422
- package/docs/guides/local-guide-ch.md +621 -532
- package/docs/guides/local-guide-en.md +621 -532
- package/docs/integration/author-tools-ch.md +66 -64
- package/docs/integration/author-tools-en.md +66 -64
- package/docs/integration/compiler-ch.md +90 -49
- package/docs/integration/compiler-en.md +77 -36
- package/docs/integration/directory-discovery-en.md +1 -1
- package/docs/integration/editor-ch.md +295 -295
- package/docs/integration/editor-en.md +303 -303
- package/docs/integration/extension-sdk-ch.md +424 -394
- package/docs/integration/extension-sdk-en.md +409 -379
- package/docs/integration/local-integration-ch.md +648 -646
- package/docs/integration/local-integration-en.md +664 -662
- 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 +299 -307
- package/docs/integration/shareable-export-en.md +301 -309
- package/docs/reference/diagnostics-counting-ch.md +127 -104
- package/docs/reference/diagnostics-counting-en.md +127 -104
- package/docs/reference/html-compatibility-ch.md +93 -93
- package/docs/reference/html-compatibility-en.md +95 -95
- package/docs/reference/local-interaction-syntax-ch.md +913 -724
- package/docs/reference/local-interaction-syntax-en.md +911 -722
- package/docs/reference/public-api-ch.md +134 -21
- package/docs/reference/public-api-en.md +134 -21
- package/docs/reference/theme-protocol-ch.md +198 -198
- package/docs/reference/theme-protocol-en.md +217 -217
- package/docs/releases/release-0.10.0-ch.md +45 -0
- package/docs/releases/release-0.10.0-en.md +45 -0
- package/docs/releases/release-0.4.0-ch.md +91 -91
- package/docs/releases/release-0.4.0-en.md +91 -91
- package/docs/releases/release-0.4.1-ch.md +25 -25
- package/docs/releases/release-0.4.1-en.md +25 -25
- package/docs/releases/release-0.5.0-ch.md +43 -43
- package/docs/releases/release-0.5.0-en.md +43 -43
- package/docs/releases/release-0.5.1-ch.md +41 -41
- package/docs/releases/release-0.5.1-en.md +41 -41
- package/docs/releases/release-0.5.2-ch.md +37 -37
- package/docs/releases/release-0.5.2-en.md +37 -37
- package/docs/releases/release-0.5.3-ch.md +26 -26
- package/docs/releases/release-0.5.3-en.md +26 -26
- package/docs/releases/release-0.6.0-ch.md +59 -59
- package/docs/releases/release-0.6.0-en.md +59 -59
- package/docs/releases/release-0.6.1-ch.md +29 -29
- package/docs/releases/release-0.6.1-en.md +29 -29
- package/docs/releases/release-0.7.0-ch.md +86 -86
- package/docs/releases/release-0.7.0-en.md +86 -86
- package/docs/releases/release-0.9.3-ch.md +45 -0
- package/docs/releases/release-0.9.3-en.md +45 -0
- package/examples/component-package/README-ch.md +101 -101
- package/examples/component-package/README.md +133 -133
- package/examples/conformance/README-ch.md +55 -55
- package/examples/conformance/README.md +55 -55
- package/examples/conformance/component-protocol-1.json +482 -482
- package/examples/conformance/component-protocol-1.schema.json +76 -76
- package/examples/conformance/local-draft-1.json +50 -50
- package/examples/conformance/local-draft-2.json +212 -212
- package/examples/conformance/local-draft-4.json +441 -0
- package/examples/game-2048-package/LICENSE +21 -21
- package/examples/game-2048-package/NOTICES.md +11 -11
- package/examples/game-2048-package/README-ch.md +91 -91
- package/examples/game-2048-package/README.md +98 -98
- package/examples/game-2048-package/package.json +35 -35
- package/examples/game-2048-package/sample/document.reactive.md +17 -17
- package/examples/game-2048-package/scripts/build-export.mjs +44 -44
- package/examples/game-2048-package/scripts/build.mjs +130 -130
- package/examples/game-2048-package/scripts/verify.mjs +180 -180
- package/examples/game-2048-package/src/component.css +161 -161
- package/examples/game-2048-package/src/components.tsx +326 -326
- package/examples/game-2048-package/src/game-engine.ts +228 -228
- package/examples/game-2048-package/src/harness.tsx +34 -34
- package/examples/game-2048-package/src/manifest.ts +85 -85
- package/examples/game-2048-package/src/node-entry.ts +30 -30
- package/examples/game-2048-package/src/sample.ts +4 -4
- package/examples/game-2048-package/tsconfig.json +15 -15
- package/examples/integration/README-ch.md +114 -82
- package/examples/integration/README.md +114 -82
- package/examples/integration/chat-session/index.mjs +91 -0
- package/examples/integration/chat-session/package.json +10 -0
- package/examples/integration/core/index.mjs +32 -32
- package/examples/integration/extension-sdk/README-ch.md +24 -24
- package/examples/integration/extension-sdk/README.md +24 -24
- package/examples/integration/static-embed/embed.mjs +44 -0
- package/examples/integration/static-embed/index.html +12 -0
- package/examples/integration/static-embed/main.mjs +24 -0
- package/examples/integration/static-embed/references.mjs +5 -0
- package/examples/integration/static-embed/render.mjs +10 -0
- package/examples/integration/worker/index.html +19 -19
- package/examples/integration/worker/main.js +61 -61
- package/examples/integration/worker/package.json +13 -13
- package/examples/integration/worker/worker.js +3 -3
- package/examples/local/README-ch.md +76 -76
- package/examples/local/README.md +76 -76
- package/examples/local/charts.reactive.md +73 -73
- package/examples/local/recipes/invoice-zh.reactive.md +36 -36
- package/examples/local/recipes/invoice.reactive.md +36 -36
- package/examples/local/recipes/workshop-zh.reactive.md +33 -33
- package/examples/local/recipes/workshop.reactive.md +33 -33
- package/examples/local/showcase/README-ch.md +22 -22
- package/examples/local/showcase/README.md +31 -31
- package/examples/local/showcase/explore.reactive.md +102 -102
- package/examples/local/showcase/flow.reactive.md +86 -86
- package/examples/local/showcase/forms.reactive.md +126 -126
- package/examples/local/showcase/functions.reactive.md +119 -119
- package/examples/local/showcase/layout.reactive.md +100 -100
- package/examples/local/showcase/statistics.reactive.md +108 -108
- package/examples/local/showcase/tasks.reactive.md +89 -89
- package/examples/local/showcase/zh/explore.reactive.md +102 -102
- package/examples/local/showcase/zh/flow.reactive.md +86 -86
- package/examples/local/showcase/zh/forms.reactive.md +126 -126
- package/examples/local/showcase/zh/functions.reactive.md +119 -119
- package/examples/local/showcase/zh/layout.reactive.md +100 -100
- package/examples/local/showcase/zh/statistics.reactive.md +108 -108
- package/examples/local/showcase/zh/tasks.reactive.md +89 -89
- package/examples/minimal-extension/README-ch.md +78 -78
- package/examples/minimal-extension/README.md +78 -78
- package/examples/minimal-extension/index.html +15 -15
- package/examples/minimal-extension/package.json +26 -26
- package/examples/minimal-extension/sample/document.reactive.md +10 -10
- package/examples/minimal-extension/scripts/build.mjs +32 -32
- package/examples/minimal-extension/scripts/export.mjs +72 -72
- package/examples/minimal-extension/scripts/test-node.mjs +75 -75
- package/examples/minimal-extension/src/extension.tsx +90 -90
- package/examples/minimal-extension/src/preview.tsx +12 -12
- package/examples/minimal-extension/src/source.ts +4 -4
- package/examples/minimal-extension/tsconfig.json +14 -14
- package/examples/sci-fi-theme/README-ch.md +133 -133
- package/examples/sci-fi-theme/README.md +148 -148
- package/examples/sci-fi-theme/demo/acceptance.reactive.md +454 -454
- package/examples/sci-fi-theme/demo/demo.css +638 -638
- package/examples/sci-fi-theme/demo/document.reactive.md +206 -206
- package/examples/sci-fi-theme/demo/index.html +13 -13
- package/examples/sci-fi-theme/demo/main.tsx +215 -215
- package/examples/sci-fi-theme/docs/design-system-ch.md +245 -245
- package/examples/sci-fi-theme/docs/design-system.md +474 -474
- package/examples/sci-fi-theme/package.json +28 -28
- package/examples/sci-fi-theme/scripts/screenshot.mjs +98 -98
- package/examples/sci-fi-theme/src/components.css +2370 -2370
- package/examples/sci-fi-theme/src/index.ts +6 -6
- package/examples/sci-fi-theme/src/notch.css +142 -142
- package/examples/sci-fi-theme/src/sci-fi.css +7 -7
- package/examples/sci-fi-theme/src/theme.ts +39 -39
- package/examples/sci-fi-theme/tsconfig.json +20 -20
- package/examples/sci-fi-theme/vite.config.ts +24 -24
- package/examples/tetris-package/LICENSE +21 -21
- package/examples/tetris-package/NOTICES.md +11 -11
- package/examples/tetris-package/README-ch.md +91 -91
- package/examples/tetris-package/README.md +95 -95
- package/examples/tetris-package/package.json +35 -35
- package/examples/tetris-package/sample/document.reactive.md +16 -16
- package/examples/tetris-package/scripts/build-export.mjs +44 -44
- package/examples/tetris-package/scripts/build.mjs +130 -130
- package/examples/tetris-package/scripts/verify.mjs +173 -173
- package/examples/tetris-package/src/component.css +145 -145
- package/examples/tetris-package/src/components.tsx +334 -334
- package/examples/tetris-package/src/harness.tsx +34 -34
- package/examples/tetris-package/src/manifests.ts +93 -93
- package/examples/tetris-package/src/node-entry.ts +16 -16
- package/examples/tetris-package/src/sample.ts +4 -4
- package/examples/tetris-package/src/tetris-engine.ts +325 -325
- package/examples/tetris-package/tsconfig.json +15 -15
- package/package.json +66 -2
- package/dist-library/LocalDocumentView-BuqgJZEY.js +0 -109
- package/dist-library/LocalReactiveDocumentCore-CWBe4Mm5.js +0 -275
- package/dist-library/authoring-Ci_KzJ0q.js +0 -892
- package/dist-library/compile-Dx6Uw3D9.js +0 -1249
- package/dist-library/compiler-dxLPB9Ym.js +0 -86
- package/dist-library/config-validation-D3D7Dy2J.js +0 -586
- package/dist-library/controls-DoZyLCrV.js +0 -6740
- package/dist-library/data-table-8-3F15Jf.js +0 -296
- package/dist-library/layout-BBB2VF0S.js +0 -562
- package/dist-library/mount-preset-DMZ5wd3t.js +0 -13
- package/dist-library/options-BBp9IcHm.js +0 -121
- package/dist-library/package-core-K5xesGqy.js +0 -117
- package/dist-library/parser-standard-CBA1-hdG.js +0 -9630
- package/dist-library/plugin-packs-Bh1HhLym.js +0 -19
- package/dist-library/preset-core-DeZPA8IE.js +0 -1298
- package/dist-library/props-sJ8vk0cr.js +0 -183
- package/dist-library/react-0DCh-Mar.js +0 -7
- package/dist-library/registry-core-C9xOunaw.js +0 -479
- package/dist-library/resources-B0x_w3s9.js +0 -229
- package/dist-library/runtime-BpQdZmFI.js +0 -1288
- package/dist-library/schema-BryM_VRW.js +0 -40
- package/dist-library/sdk-core-ChslheKs.js +0 -1167
- package/dist-library/shareable-B8xMoGEa.js +0 -814
- package/dist-library/types/local/rendering/document/LocalReactiveDocumentCore.d.ts +0 -6
- package/dist-library/types/local/rendering/table/data-table.d.ts +0 -13
- package/dist-library/types-daDo2c_w.js +0 -3
- package/dist-library/validation-B3RI0xOk.js +0 -1123
- package/dist-library/visual-frame-_rcd5HUv.js +0 -48
- package/dist-library/visuals-DkDhNdEZ.js +0 -72572
- /package/dist-library/types/{local/configuration → contracts}/color-values.d.ts +0 -0
- /package/dist-library/types/{local/html → contracts}/html-names.d.ts +0 -0
- /package/dist-library/types/{local/configuration → contracts}/schema-core.d.ts +0 -0
- /package/dist-library/types/{local → react}/rendering/code/code-block.d.ts +0 -0
- /package/dist-library/types/{local → react}/rendering/code/code-languages.d.ts +0 -0
- /package/dist-library/types/{local → react}/rendering/document/LocalDocumentView.d.ts +0 -0
- /package/dist-library/types/{local → react}/rendering/document/use-color-scheme.d.ts +0 -0
- /package/dist-library/types/{local → react}/rendering/image/image-view.d.ts +0 -0
- /package/dist-library/types/{local → react}/rendering/math-view.d.ts +0 -0
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { a as
|
|
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";
|
|
10
12
|
// src/authoring/editor-i18n.ts
|
|
11
|
-
var
|
|
13
|
+
var le = {
|
|
12
14
|
en: {
|
|
13
15
|
boldPlaceholder: "bold text",
|
|
14
16
|
italicPlaceholder: "italic text",
|
|
@@ -57,11 +59,11 @@ var b = {
|
|
|
57
59
|
}
|
|
58
60
|
};
|
|
59
61
|
// src/authoring/editor-commands.ts
|
|
60
|
-
function
|
|
62
|
+
function ue(e, t) {
|
|
61
63
|
return typeof e != "number" || Number.isNaN(e) ? 0 : Math.min(Math.max(Math.trunc(e), 0), t);
|
|
62
64
|
}
|
|
63
|
-
function
|
|
64
|
-
let n =
|
|
65
|
+
function x(e, t) {
|
|
66
|
+
let n = ue(t.start, e.length), r = ue(t.end, e.length);
|
|
65
67
|
return n <= r ? {
|
|
66
68
|
start: n,
|
|
67
69
|
end: r
|
|
@@ -70,14 +72,14 @@ function S(e, t) {
|
|
|
70
72
|
end: n
|
|
71
73
|
};
|
|
72
74
|
}
|
|
73
|
-
function
|
|
74
|
-
return
|
|
75
|
+
function S(e) {
|
|
76
|
+
return le[e] ?? le.en;
|
|
75
77
|
}
|
|
76
|
-
function
|
|
78
|
+
function C(e, t) {
|
|
77
79
|
return t <= 0 ? 0 : e.lastIndexOf("\n", t - 1) + 1;
|
|
78
80
|
}
|
|
79
|
-
function
|
|
80
|
-
let n =
|
|
81
|
+
function w(e, t) {
|
|
82
|
+
let n = C(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;
|
|
81
83
|
for (;;) {
|
|
82
84
|
let t = e.indexOf("\n", s), n = t === -1 || t > a ? a : t;
|
|
83
85
|
if (o.push({
|
|
@@ -89,7 +91,7 @@ function T(e, t) {
|
|
|
89
91
|
}
|
|
90
92
|
return o;
|
|
91
93
|
}
|
|
92
|
-
function
|
|
94
|
+
function T(e, t, n) {
|
|
93
95
|
if (n.length === 0) return {
|
|
94
96
|
value: e,
|
|
95
97
|
selection: t
|
|
@@ -123,7 +125,7 @@ function E(e, t, n) {
|
|
|
123
125
|
}
|
|
124
126
|
};
|
|
125
127
|
}
|
|
126
|
-
function
|
|
128
|
+
function E(e, t, n, r) {
|
|
127
129
|
return t === e.text ? null : {
|
|
128
130
|
start: e.start,
|
|
129
131
|
end: e.end,
|
|
@@ -132,13 +134,13 @@ function D(e, t, n, r) {
|
|
|
132
134
|
newPrefixLength: r
|
|
133
135
|
};
|
|
134
136
|
}
|
|
135
|
-
function
|
|
137
|
+
function D(e, t, n, r) {
|
|
136
138
|
return n === "*" ? r ? e[t.start - 1] !== "*" && e[t.end] !== "*" : e[t.start - n.length - 1] !== "*" && e[t.end + n.length] !== "*" : !0;
|
|
137
139
|
}
|
|
138
140
|
function O(e, t, n, r) {
|
|
139
|
-
let i =
|
|
141
|
+
let i = x(e, t), a = n.length, { start: o, end: s } = i, c = e.slice(o, s);
|
|
140
142
|
if (o !== s) {
|
|
141
|
-
if (c.length >= a * 2 && c.startsWith(n) && c.endsWith(n) && (n !== "*" || !c.startsWith("**") && !c.endsWith("**")) &&
|
|
143
|
+
if (c.length >= a * 2 && c.startsWith(n) && c.endsWith(n) && (n !== "*" || !c.startsWith("**") && !c.endsWith("**")) && D(e, i, n, !0)) {
|
|
142
144
|
let t = c.slice(a, c.length - a);
|
|
143
145
|
return {
|
|
144
146
|
value: e.slice(0, o) + t + e.slice(s),
|
|
@@ -149,7 +151,7 @@ function O(e, t, n, r) {
|
|
|
149
151
|
};
|
|
150
152
|
}
|
|
151
153
|
let t = o - a, r = s + a;
|
|
152
|
-
return t >= 0 && r <= e.length && e.slice(t, o) === n && e.slice(s, r) === n &&
|
|
154
|
+
return t >= 0 && r <= e.length && e.slice(t, o) === n && e.slice(s, r) === n && D(e, i, n, !1) ? {
|
|
153
155
|
value: e.slice(0, t) + c + e.slice(r),
|
|
154
156
|
selection: {
|
|
155
157
|
start: t,
|
|
@@ -172,14 +174,14 @@ function O(e, t, n, r) {
|
|
|
172
174
|
}
|
|
173
175
|
};
|
|
174
176
|
}
|
|
175
|
-
function
|
|
176
|
-
return O(e, t, "**",
|
|
177
|
+
function de(e, t, n = "en") {
|
|
178
|
+
return O(e, t, "**", S(n).boldPlaceholder);
|
|
177
179
|
}
|
|
178
|
-
function
|
|
179
|
-
return O(e, t, "*",
|
|
180
|
+
function fe(e, t, n = "en") {
|
|
181
|
+
return O(e, t, "*", S(n).italicPlaceholder);
|
|
180
182
|
}
|
|
181
|
-
function
|
|
182
|
-
return O(e, t, "~~",
|
|
183
|
+
function pe(e, t, n = "en") {
|
|
184
|
+
return O(e, t, "~~", S(n).strikePlaceholder);
|
|
183
185
|
}
|
|
184
186
|
function k(e) {
|
|
185
187
|
let t = 0;
|
|
@@ -191,7 +193,7 @@ function A(e, t, n) {
|
|
|
191
193
|
for (; e[t] === "`";) r += 1, t += n;
|
|
192
194
|
return r;
|
|
193
195
|
}
|
|
194
|
-
function
|
|
196
|
+
function me(e, t) {
|
|
195
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 ? {
|
|
196
198
|
run: a,
|
|
197
199
|
padding: 0
|
|
@@ -201,10 +203,10 @@ function de(e, t) {
|
|
|
201
203
|
} : null, d = s ?? u;
|
|
202
204
|
return !d || k(i) >= d.run ? null : d;
|
|
203
205
|
}
|
|
204
|
-
function
|
|
205
|
-
let r =
|
|
206
|
+
function he(e, t, n = "en") {
|
|
207
|
+
let r = x(e, t), { start: i, end: a } = r, o = e.slice(i, a);
|
|
206
208
|
if (i === a) {
|
|
207
|
-
let t =
|
|
209
|
+
let t = S(n).inlineCodePlaceholder, r = `\`${t}\``;
|
|
208
210
|
return {
|
|
209
211
|
value: e.slice(0, i) + r + e.slice(a),
|
|
210
212
|
selection: {
|
|
@@ -224,7 +226,7 @@ function fe(e, t, n = "en") {
|
|
|
224
226
|
}
|
|
225
227
|
};
|
|
226
228
|
}
|
|
227
|
-
let l =
|
|
229
|
+
let l = me(e, r);
|
|
228
230
|
if (l) {
|
|
229
231
|
let t = l.run + l.padding;
|
|
230
232
|
return {
|
|
@@ -244,16 +246,16 @@ function fe(e, t, n = "en") {
|
|
|
244
246
|
}
|
|
245
247
|
};
|
|
246
248
|
}
|
|
247
|
-
var
|
|
248
|
-
function
|
|
249
|
-
let r =
|
|
250
|
-
for (let t of
|
|
251
|
-
let e =
|
|
249
|
+
var ge = /^(#{1,6})[ \t]+/;
|
|
250
|
+
function _e(e, t, n) {
|
|
251
|
+
let r = x(e, t), i = [];
|
|
252
|
+
for (let t of w(e, r)) {
|
|
253
|
+
let e = ge.exec(t.text), r = e ? e[0].length : 0;
|
|
252
254
|
if (n === 0 && !e) continue;
|
|
253
|
-
let a = t.text.slice(r), o = n === 0 ? "" : `${"#".repeat(n)} `, s =
|
|
255
|
+
let a = t.text.slice(r), o = n === 0 ? "" : `${"#".repeat(n)} `, s = E(t, o + a, r, o.length);
|
|
254
256
|
s && i.push(s);
|
|
255
257
|
}
|
|
256
|
-
return
|
|
258
|
+
return T(e, r, i);
|
|
257
259
|
}
|
|
258
260
|
var j = /^([ \t]*)([-*+] )/, M = /^([ \t]*)(\d+[.)] )/, N = /^([ \t]*)([-*+] \[[ xX]\] )/, P = /^([ \t]*)(> ?)/;
|
|
259
261
|
function F(e, t) {
|
|
@@ -266,12 +268,12 @@ function F(e, t) {
|
|
|
266
268
|
prefixLength: r.length + i.length
|
|
267
269
|
};
|
|
268
270
|
}
|
|
269
|
-
function
|
|
271
|
+
function ve(e) {
|
|
270
272
|
let t = /^[ \t]*/.exec(e);
|
|
271
273
|
return t ? t[0] : "";
|
|
272
274
|
}
|
|
273
275
|
function I(e, t, n, r) {
|
|
274
|
-
let i =
|
|
276
|
+
let i = x(e, t), a = w(e, i), o = a.map((e) => n(e.text)), s = 0, c = !0;
|
|
275
277
|
for (let e = 0; e < a.length; e += 1) {
|
|
276
278
|
let t = a[e];
|
|
277
279
|
(o[e] || t.text.trim().length > 0) && (s += 1, o[e] || (c = !1));
|
|
@@ -281,30 +283,30 @@ function I(e, t, n, r) {
|
|
|
281
283
|
let t = a[e], n = o[e] ?? null;
|
|
282
284
|
if (l) {
|
|
283
285
|
if (!n) continue;
|
|
284
|
-
let e =
|
|
286
|
+
let e = E(t, n.indent + t.text.slice(n.prefixLength), n.prefixLength, n.indent.length);
|
|
285
287
|
e && u.push(e);
|
|
286
288
|
continue;
|
|
287
289
|
}
|
|
288
|
-
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);
|
|
289
291
|
d && u.push(d);
|
|
290
292
|
}
|
|
291
|
-
return
|
|
293
|
+
return T(e, i, u);
|
|
292
294
|
}
|
|
293
|
-
function
|
|
295
|
+
function ye(e, t) {
|
|
294
296
|
return I(e, t, (e) => F(e, j), () => "- ");
|
|
295
297
|
}
|
|
296
|
-
function
|
|
298
|
+
function be(e, t) {
|
|
297
299
|
return I(e, t, (e) => F(e, M), (e, t) => `${t}. `);
|
|
298
300
|
}
|
|
299
|
-
function
|
|
301
|
+
function xe(e, t) {
|
|
300
302
|
return I(e, t, (e) => F(e, N), () => "- [ ] ");
|
|
301
303
|
}
|
|
302
|
-
function
|
|
304
|
+
function Se(e, t) {
|
|
303
305
|
return I(e, t, (e) => F(e, P), () => "> ");
|
|
304
306
|
}
|
|
305
|
-
function
|
|
306
|
-
let n =
|
|
307
|
-
return
|
|
307
|
+
function Ce(e, t) {
|
|
308
|
+
let n = x(e, t);
|
|
309
|
+
return T(e, n, w(e, n).map((e) => ({
|
|
308
310
|
start: e.start,
|
|
309
311
|
end: e.end,
|
|
310
312
|
text: ` ${e.text}`,
|
|
@@ -312,7 +314,7 @@ function be(e, t) {
|
|
|
312
314
|
newPrefixLength: 2
|
|
313
315
|
})));
|
|
314
316
|
}
|
|
315
|
-
function
|
|
317
|
+
function we(e) {
|
|
316
318
|
if (e.startsWith(" ")) return {
|
|
317
319
|
text: e.slice(1),
|
|
318
320
|
removed: 1
|
|
@@ -324,18 +326,18 @@ function xe(e) {
|
|
|
324
326
|
removed: t
|
|
325
327
|
};
|
|
326
328
|
}
|
|
327
|
-
function
|
|
328
|
-
let n =
|
|
329
|
-
for (let t of
|
|
330
|
-
let e =
|
|
329
|
+
function Te(e, t) {
|
|
330
|
+
let n = x(e, t), r = [];
|
|
331
|
+
for (let t of w(e, n)) {
|
|
332
|
+
let e = we(t.text);
|
|
331
333
|
if (e.removed === 0) continue;
|
|
332
|
-
let n =
|
|
334
|
+
let n = E(t, e.text, e.removed, 0);
|
|
333
335
|
n && r.push(n);
|
|
334
336
|
}
|
|
335
|
-
return
|
|
337
|
+
return T(e, n, r);
|
|
336
338
|
}
|
|
337
|
-
function
|
|
338
|
-
let { start: r, end: i } =
|
|
339
|
+
function Ee(e, t, n = "en") {
|
|
340
|
+
let { start: r, end: i } = x(e, t), a = e.slice(r, i), o = "https://example.com";
|
|
339
341
|
if (a.length > 0) {
|
|
340
342
|
let t = `[${a}](${o})`, n = r + 1 + a.length + 2;
|
|
341
343
|
return {
|
|
@@ -346,7 +348,7 @@ function Ce(e, t, n = "en") {
|
|
|
346
348
|
}
|
|
347
349
|
};
|
|
348
350
|
}
|
|
349
|
-
let s =
|
|
351
|
+
let s = S(n).linkText, c = `[${s}](${o})`;
|
|
350
352
|
return {
|
|
351
353
|
value: e.slice(0, r) + c + e.slice(i),
|
|
352
354
|
selection: {
|
|
@@ -355,8 +357,8 @@ function Ce(e, t, n = "en") {
|
|
|
355
357
|
}
|
|
356
358
|
};
|
|
357
359
|
}
|
|
358
|
-
function
|
|
359
|
-
let { start: r, end: i } =
|
|
360
|
+
function De(e, t, n = "en") {
|
|
361
|
+
let { start: r, end: i } = x(e, t), a = e.slice(r, i), o = "images/example.png";
|
|
360
362
|
if (a.length > 0) {
|
|
361
363
|
let t = ``, n = r + 2 + a.length + 2;
|
|
362
364
|
return {
|
|
@@ -367,7 +369,7 @@ function we(e, t, n = "en") {
|
|
|
367
369
|
}
|
|
368
370
|
};
|
|
369
371
|
}
|
|
370
|
-
let s =
|
|
372
|
+
let s = S(n).imageAlt, c = ``;
|
|
371
373
|
return {
|
|
372
374
|
value: e.slice(0, r) + c + e.slice(i),
|
|
373
375
|
selection: {
|
|
@@ -376,14 +378,14 @@ function we(e, t, n = "en") {
|
|
|
376
378
|
}
|
|
377
379
|
};
|
|
378
380
|
}
|
|
379
|
-
function
|
|
380
|
-
let r =
|
|
381
|
+
function Oe(e, t, n = "en") {
|
|
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`;
|
|
381
383
|
return R(e, r, `${s}${a}\n${o}`, {
|
|
382
384
|
start: s.length,
|
|
383
385
|
end: s.length + a.length
|
|
384
386
|
});
|
|
385
387
|
}
|
|
386
|
-
function
|
|
388
|
+
function ke(e) {
|
|
387
389
|
return [
|
|
388
390
|
`| ${e.tableHeaders.join(" | ")} |`,
|
|
389
391
|
`| ${e.tableHeaders.map(() => "---").join(" | ")} |`,
|
|
@@ -391,10 +393,10 @@ function Ee(e) {
|
|
|
391
393
|
].join("\n");
|
|
392
394
|
}
|
|
393
395
|
function L(e, t) {
|
|
394
|
-
let n =
|
|
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 = "";
|
|
395
397
|
if (/\S/.test(r)) s = "\n\n";
|
|
396
398
|
else if (n > 0) {
|
|
397
|
-
let t =
|
|
399
|
+
let t = C(e, n - 1);
|
|
398
400
|
/\S/.test(e.slice(t, n - 1)) && (s = "\n");
|
|
399
401
|
}
|
|
400
402
|
return {
|
|
@@ -412,21 +414,21 @@ function R(e, t, n, r) {
|
|
|
412
414
|
}
|
|
413
415
|
};
|
|
414
416
|
}
|
|
415
|
-
function
|
|
416
|
-
let r =
|
|
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);
|
|
417
419
|
return R(e, r, a, {
|
|
418
420
|
start: s,
|
|
419
421
|
end: s + o.length
|
|
420
422
|
});
|
|
421
423
|
}
|
|
422
|
-
function
|
|
423
|
-
return R(e,
|
|
424
|
+
function je(e, t) {
|
|
425
|
+
return R(e, x(e, t), "---", {
|
|
424
426
|
start: 3,
|
|
425
427
|
end: 3
|
|
426
428
|
});
|
|
427
429
|
}
|
|
428
|
-
function
|
|
429
|
-
let r =
|
|
430
|
+
function Me(e, t, n) {
|
|
431
|
+
let r = x(e, t), i = r.start + n.length;
|
|
430
432
|
return {
|
|
431
433
|
value: e.slice(0, r.start) + n + e.slice(r.end),
|
|
432
434
|
selection: {
|
|
@@ -436,7 +438,7 @@ function ke(e, t, n) {
|
|
|
436
438
|
};
|
|
437
439
|
}
|
|
438
440
|
var z = /\{\{(selection(?::[^{}]*)?|caret|select:[^{}]*)\}\}/g;
|
|
439
|
-
function
|
|
441
|
+
function Ne(e, t) {
|
|
440
442
|
let n = "", r = 0, i = null, a = null, o = null;
|
|
441
443
|
z.lastIndex = 0;
|
|
442
444
|
for (let s = z.exec(e); s; s = z.exec(e)) {
|
|
@@ -471,7 +473,7 @@ function Ae(e, t) {
|
|
|
471
473
|
};
|
|
472
474
|
}
|
|
473
475
|
function B(e, t, n, r = {}) {
|
|
474
|
-
let i =
|
|
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) : {
|
|
475
477
|
prefix: "",
|
|
476
478
|
suffix: ""
|
|
477
479
|
}, s = i.start + o.prefix.length, c;
|
|
@@ -492,7 +494,7 @@ function B(e, t, n, r = {}) {
|
|
|
492
494
|
selection: c
|
|
493
495
|
};
|
|
494
496
|
}
|
|
495
|
-
function
|
|
497
|
+
function V(e, t) {
|
|
496
498
|
let n = [], r = 0;
|
|
497
499
|
for (; r < e.length;) {
|
|
498
500
|
if (e[r] !== t) {
|
|
@@ -509,18 +511,18 @@ function je(e, t) {
|
|
|
509
511
|
}
|
|
510
512
|
return n;
|
|
511
513
|
}
|
|
512
|
-
function
|
|
513
|
-
if (t === "inlineCode") return
|
|
514
|
-
let n =
|
|
514
|
+
function H(e, t) {
|
|
515
|
+
if (t === "inlineCode") return V(e, "`");
|
|
516
|
+
let n = V(e, t === "strike" ? "~" : "*");
|
|
515
517
|
return t === "italic" ? n.filter((e) => e.length % 2 == 1) : n.filter((e) => e.length >= 2);
|
|
516
518
|
}
|
|
517
|
-
function
|
|
519
|
+
function Pe(e, t, n) {
|
|
518
520
|
return e >= t ? !1 : n.some((r) => r.start === e && n.some((e) => e.end === t && e.length === r.length && e.start >= r.end));
|
|
519
521
|
}
|
|
520
|
-
function
|
|
522
|
+
function Fe(e, t, n) {
|
|
521
523
|
return e >= t ? !1 : n.some((r) => r.end === e && n.some((e) => e.start === t && e.length === r.length && e.start >= r.end));
|
|
522
524
|
}
|
|
523
|
-
function
|
|
525
|
+
function Ie(e, t) {
|
|
524
526
|
let n = 0;
|
|
525
527
|
for (; n < t.length;) {
|
|
526
528
|
let r = t[n], i = n + 1;
|
|
@@ -534,14 +536,14 @@ function Fe(e, t) {
|
|
|
534
536
|
}
|
|
535
537
|
return !1;
|
|
536
538
|
}
|
|
537
|
-
function
|
|
539
|
+
function U(e, t, n, r) {
|
|
538
540
|
if (t.start !== t.end) {
|
|
539
|
-
let n =
|
|
540
|
-
return
|
|
541
|
+
let n = H(e, r);
|
|
542
|
+
return Pe(t.start, t.end, n) || Fe(t.start, t.end, n);
|
|
541
543
|
}
|
|
542
|
-
return
|
|
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)));
|
|
543
545
|
}
|
|
544
|
-
function
|
|
546
|
+
function Le(e) {
|
|
545
547
|
let t = 0;
|
|
546
548
|
for (;;) {
|
|
547
549
|
let n = e.slice(t), r = F(n, N) ?? F(n, j) ?? F(n, M) ?? F(n, P);
|
|
@@ -549,83 +551,83 @@ function Ie(e) {
|
|
|
549
551
|
t += r.prefixLength;
|
|
550
552
|
}
|
|
551
553
|
}
|
|
552
|
-
function
|
|
554
|
+
function Re(e) {
|
|
553
555
|
return F(e, N) ? "task" : F(e, j) ? "bullet" : F(e, M) ? "ordered" : null;
|
|
554
556
|
}
|
|
555
|
-
function
|
|
556
|
-
let n =
|
|
557
|
+
function ze(e, t) {
|
|
558
|
+
let n = x(e, t), r = w(e, {
|
|
557
559
|
start: n.start,
|
|
558
560
|
end: n.start
|
|
559
|
-
})[0], i = r.text, a =
|
|
561
|
+
})[0], i = r.text, a = ge.exec(i);
|
|
560
562
|
return {
|
|
561
563
|
headingLevel: a ? a[1].length : 0,
|
|
562
|
-
bold:
|
|
563
|
-
italic:
|
|
564
|
-
strike:
|
|
565
|
-
inlineCode:
|
|
566
|
-
list:
|
|
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"),
|
|
568
|
+
list: Re(i),
|
|
567
569
|
quote: F(i, P) !== null
|
|
568
570
|
};
|
|
569
571
|
}
|
|
570
572
|
// src/authoring/native-components.ts
|
|
571
|
-
var
|
|
573
|
+
var Be = Object.freeze(l.map((e) => ({
|
|
572
574
|
id: e.id,
|
|
573
|
-
label:
|
|
575
|
+
label: c(e.title, "en", e.id)
|
|
574
576
|
})));
|
|
575
|
-
function
|
|
576
|
-
let n =
|
|
577
|
+
function Ve(e, t) {
|
|
578
|
+
let n = d[e];
|
|
577
579
|
return {
|
|
578
580
|
id: e,
|
|
579
|
-
label:
|
|
580
|
-
description:
|
|
581
|
+
label: c(n.title, t, e),
|
|
582
|
+
description: c(n.description, t, e),
|
|
581
583
|
group: n.category,
|
|
582
|
-
keywords: [...
|
|
584
|
+
keywords: [...s(e) ?? []],
|
|
583
585
|
...n.inline === !0 ? { inline: !0 } : {},
|
|
584
|
-
template:
|
|
586
|
+
template: c(n.insertText, t, n.insertText.en ?? "")
|
|
585
587
|
};
|
|
586
588
|
}
|
|
587
|
-
var
|
|
589
|
+
var W = o.map((e) => Ve(e, "en")), He = Object.freeze(l.map((e) => ({
|
|
588
590
|
id: e.id,
|
|
589
|
-
label:
|
|
590
|
-
}))),
|
|
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({
|
|
591
593
|
label: e.label,
|
|
592
594
|
description: e.description,
|
|
593
595
|
keywords: Object.freeze([...e.keywords]),
|
|
594
596
|
template: e.template
|
|
595
597
|
})])));
|
|
596
|
-
function
|
|
598
|
+
function Ge(e = "en") {
|
|
597
599
|
return e === "zh" ? {
|
|
598
|
-
groups:
|
|
599
|
-
components:
|
|
600
|
+
groups: He,
|
|
601
|
+
components: G
|
|
600
602
|
} : {
|
|
601
|
-
groups:
|
|
602
|
-
components:
|
|
603
|
+
groups: Be,
|
|
604
|
+
components: W
|
|
603
605
|
};
|
|
604
606
|
}
|
|
605
|
-
function
|
|
607
|
+
function Ke(e) {
|
|
606
608
|
return new Set(e.match(/[A-Za-z_][A-Za-z0-9_]*/g) ?? []);
|
|
607
609
|
}
|
|
608
|
-
function
|
|
610
|
+
function qe(e) {
|
|
609
611
|
let t = e.trim().replace(/[^A-Za-z0-9_]/g, "_");
|
|
610
612
|
return t ? /^[0-9]/.test(t) ? `_${t}` : t : "value";
|
|
611
613
|
}
|
|
612
|
-
function
|
|
614
|
+
function Je(e, t) {
|
|
613
615
|
if (!t.has(e)) return e;
|
|
614
616
|
let n = 2;
|
|
615
617
|
for (; t.has(`${e}${n}`);) n += 1;
|
|
616
618
|
return `${e}${n}`;
|
|
617
619
|
}
|
|
618
|
-
function
|
|
619
|
-
let r =
|
|
620
|
+
function K(e, t, n) {
|
|
621
|
+
let r = Ke(t), i = /* @__PURE__ */ new Map();
|
|
620
622
|
return e.template.replace(/\{\{bind:([^{}]+)\}\}/g, (e, t) => {
|
|
621
623
|
let n = t.trim(), a = i.get(n);
|
|
622
624
|
if (a) return a;
|
|
623
|
-
let o =
|
|
625
|
+
let o = Je(qe(n), r);
|
|
624
626
|
return r.add(o), i.set(n, o), o;
|
|
625
627
|
});
|
|
626
628
|
}
|
|
627
629
|
// src/authoring/templates.ts
|
|
628
|
-
function
|
|
630
|
+
function Ye(e) {
|
|
629
631
|
let t = {};
|
|
630
632
|
for (let [n, r] of Object.entries(e.props)) t[n] = {
|
|
631
633
|
kind: r.kind,
|
|
@@ -640,22 +642,22 @@ function K(e) {
|
|
|
640
642
|
};
|
|
641
643
|
return t;
|
|
642
644
|
}
|
|
643
|
-
function
|
|
645
|
+
function Xe(e) {
|
|
644
646
|
return e.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">");
|
|
645
647
|
}
|
|
646
|
-
function
|
|
647
|
-
return e === null ? "" :
|
|
648
|
+
function Ze(e) {
|
|
649
|
+
return e === null ? "" : Xe(String(e));
|
|
648
650
|
}
|
|
649
|
-
function
|
|
651
|
+
function Qe(t) {
|
|
650
652
|
let n = t.replace(/[^A-Za-z0-9_]/g, "_"), r = /^[0-9]/.test(n) ? `_${n}` : n;
|
|
651
653
|
return e.has(r) ? `${r}_value` : r;
|
|
652
654
|
}
|
|
653
|
-
function
|
|
654
|
-
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);
|
|
655
657
|
switch (e.kind) {
|
|
656
658
|
case "boolean": return "false";
|
|
657
659
|
case "enum":
|
|
658
|
-
if (e.values?.length) return
|
|
660
|
+
if (e.values?.length) return Ze(e.values[0]);
|
|
659
661
|
throw Error(`${t} is a required enum without values; provide an authoring.insertText.`);
|
|
660
662
|
case "number": {
|
|
661
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;
|
|
@@ -671,22 +673,24 @@ function Xe(e, t) {
|
|
|
671
673
|
default: throw Error(`${t} has an unsupported property kind; provide an authoring.insertText.`);
|
|
672
674
|
}
|
|
673
675
|
}
|
|
674
|
-
function
|
|
676
|
+
function et(e) {
|
|
675
677
|
if (e.structure && e.structure.rule !== "none" && e.structure.rule !== "any" && e.structure.rule !== "inline") return !0;
|
|
676
678
|
let t = e.children;
|
|
677
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;
|
|
678
680
|
}
|
|
679
|
-
function
|
|
681
|
+
function tt(e, t) {
|
|
680
682
|
let n = e.name, r = e.form;
|
|
681
683
|
if (r !== "leaf" && r !== "inline" && r !== "container") throw Error(`component "${n}" has an unsupported form; provide an authoring.insertText.`);
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
let
|
|
687
|
-
|
|
688
|
-
}
|
|
689
|
-
|
|
684
|
+
let i = e.structure?.rule === "raw-body";
|
|
685
|
+
if (i && r !== "container") throw Error(`component "${n}" declares a raw body on a non-container form; provide an authoring.insertText.`);
|
|
686
|
+
if (!i && et(e)) throw Error(`component "${n}" requires children; provide an authoring.insertText.`);
|
|
687
|
+
let a = Object.entries(e.bindings ?? {}), o = new Set(a.flatMap(([, e]) => [e.bind, e.initial])), s = [];
|
|
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}"`)}"`));
|
|
690
|
+
let c = `<${n}${s.length > 0 ? ` ${s.join(" ")}` : ""}`;
|
|
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}>`;
|
|
692
|
+
}
|
|
693
|
+
var nt = {
|
|
690
694
|
id: "authoring-template",
|
|
691
695
|
label: "",
|
|
692
696
|
description: "",
|
|
@@ -695,8 +699,8 @@ var $e = {
|
|
|
695
699
|
template: ""
|
|
696
700
|
};
|
|
697
701
|
function q(e, t = "") {
|
|
698
|
-
let n =
|
|
699
|
-
|
|
702
|
+
let n = K({
|
|
703
|
+
...nt,
|
|
700
704
|
template: e
|
|
701
705
|
}, t);
|
|
702
706
|
return B(t, {
|
|
@@ -704,72 +708,75 @@ function q(e, t = "") {
|
|
|
704
708
|
end: t.length
|
|
705
709
|
}, n).value.slice(t.length);
|
|
706
710
|
}
|
|
707
|
-
function
|
|
711
|
+
function rt(e) {
|
|
708
712
|
return e.diagnostics.map((e) => `${e.code}: ${e.message}`).join("; ");
|
|
709
713
|
}
|
|
710
|
-
function
|
|
714
|
+
function it(e, t) {
|
|
711
715
|
let n = q(t), r = `</${e}>`, i = n.lastIndexOf(r);
|
|
712
716
|
if (!(i < 0)) return {
|
|
713
717
|
before: `${n.slice(0, i)}\n`,
|
|
714
718
|
after: `\n${n.slice(i)}`
|
|
715
719
|
};
|
|
716
720
|
}
|
|
717
|
-
function
|
|
718
|
-
let i = r === void 0 ? q(e) : q(e, r.before),
|
|
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;
|
|
719
723
|
try {
|
|
720
|
-
|
|
724
|
+
s = a(o, t ?? {});
|
|
721
725
|
} catch (e) {
|
|
722
726
|
throw Error(`${n} authoring.insertText could not be compiled: ${e instanceof Error ? e.message : String(e)}.`);
|
|
723
727
|
}
|
|
724
|
-
if (
|
|
725
|
-
let
|
|
726
|
-
throw Error(`${n} authoring.insertText does not compile with this configuration${
|
|
728
|
+
if (s.ok) return;
|
|
729
|
+
let c = rt(s);
|
|
730
|
+
throw Error(`${n} authoring.insertText does not compile with this configuration${c ? ` (${c})` : ""}.`);
|
|
727
731
|
}
|
|
728
|
-
function
|
|
729
|
-
let i = r === void 0 ? e : `${r.before}${e}${r.after}`,
|
|
732
|
+
function ot(e, t, n, r) {
|
|
733
|
+
let i = r === void 0 ? e : `${r.before}${e}${r.after}`, o;
|
|
730
734
|
try {
|
|
731
|
-
|
|
735
|
+
o = a(i, t ?? {});
|
|
732
736
|
} catch (e) {
|
|
733
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.`);
|
|
734
738
|
}
|
|
735
|
-
if (
|
|
736
|
-
let
|
|
737
|
-
throw Error(`${n} has no authoring.insertText and its synthesized template does not compile with this configuration${
|
|
739
|
+
if (o.ok) return;
|
|
740
|
+
let s = o.diagnostics.map((e) => `${e.code}: ${e.message}`).join("; ");
|
|
741
|
+
throw Error(`${n} has no authoring.insertText and its synthesized template does not compile with this configuration${s ? ` (${s})` : ""}. Provide authoring.insertText.`);
|
|
738
742
|
}
|
|
739
743
|
// src/authoring/catalog.ts
|
|
740
744
|
function J(e) {
|
|
741
745
|
return /* @__PURE__ */ Error(`Invalid local component catalog: ${e}`);
|
|
742
746
|
}
|
|
743
747
|
function Y(e, t, n) {
|
|
744
|
-
return
|
|
748
|
+
return c(e, t, n);
|
|
745
749
|
}
|
|
746
|
-
function
|
|
750
|
+
function st(e, t) {
|
|
747
751
|
let n = Y(e, t, "");
|
|
748
752
|
return n === "" ? void 0 : n;
|
|
749
753
|
}
|
|
750
|
-
function
|
|
754
|
+
function ct(e) {
|
|
751
755
|
if (typeof e == "string" || typeof e == "number" || typeof e == "boolean") return e;
|
|
752
756
|
if (e === null) return null;
|
|
753
757
|
}
|
|
754
|
-
function
|
|
758
|
+
function X(e) {
|
|
759
|
+
return e?.rule === "raw-body" ? "raw" : "markdown";
|
|
760
|
+
}
|
|
761
|
+
function lt(e, t, n) {
|
|
755
762
|
return Object.freeze({
|
|
756
|
-
name:
|
|
757
|
-
kind:
|
|
758
|
-
required: t
|
|
759
|
-
static:
|
|
760
|
-
dynamic:
|
|
761
|
-
...
|
|
762
|
-
...
|
|
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) }
|
|
763
770
|
});
|
|
764
771
|
}
|
|
765
|
-
function
|
|
766
|
-
let
|
|
767
|
-
for (let [
|
|
768
|
-
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;
|
|
769
776
|
}
|
|
770
|
-
function
|
|
777
|
+
function dt(e, t, n) {
|
|
771
778
|
for (let [r, i] of Object.entries(e.props)) {
|
|
772
|
-
let e =
|
|
779
|
+
let e = st(i.description, n);
|
|
773
780
|
if (e === void 0) continue;
|
|
774
781
|
let a = t[r];
|
|
775
782
|
t[r] = Object.freeze({
|
|
@@ -785,7 +792,7 @@ function ct(e, t, n) {
|
|
|
785
792
|
}
|
|
786
793
|
return t;
|
|
787
794
|
}
|
|
788
|
-
function
|
|
795
|
+
function ft(e) {
|
|
789
796
|
return Object.freeze({
|
|
790
797
|
id: e.id,
|
|
791
798
|
name: e.name,
|
|
@@ -795,6 +802,7 @@ function lt(e) {
|
|
|
795
802
|
categoryLabel: e.categoryLabel,
|
|
796
803
|
insertText: e.insertText,
|
|
797
804
|
form: e.form,
|
|
805
|
+
bodyKind: e.bodyKind,
|
|
798
806
|
paired: e.form !== "leaf",
|
|
799
807
|
inline: e.inline ?? e.form === "inline",
|
|
800
808
|
...e.parents === void 0 ? {} : { parents: Object.freeze([...e.parents]) },
|
|
@@ -805,28 +813,28 @@ function lt(e) {
|
|
|
805
813
|
...e.requires === void 0 ? {} : { requires: Object.freeze({ ...e.requires }) }
|
|
806
814
|
});
|
|
807
815
|
}
|
|
808
|
-
function
|
|
816
|
+
function pt(e) {
|
|
809
817
|
let t = e.structure;
|
|
810
818
|
return {
|
|
811
819
|
...t?.parents?.length ? { parents: t.parents } : {},
|
|
812
820
|
...t?.children?.length ? { allowedChildren: t.children } : {}
|
|
813
821
|
};
|
|
814
822
|
}
|
|
815
|
-
function
|
|
823
|
+
function mt(e, t) {
|
|
816
824
|
if (e === t) return !0;
|
|
817
825
|
if (e === void 0 || t === void 0) return !1;
|
|
818
826
|
let n = Object.keys(e).sort(), r = Object.keys(t).sort();
|
|
819
827
|
return n.length === r.length && n.every((n, i) => n === r[i] && e[n] === t[n]);
|
|
820
828
|
}
|
|
821
|
-
function
|
|
829
|
+
function Z(e) {
|
|
822
830
|
let t = e.authoring;
|
|
823
831
|
if (t === void 0) return;
|
|
824
|
-
if (
|
|
825
|
-
let n =
|
|
826
|
-
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);
|
|
827
835
|
}
|
|
828
|
-
function
|
|
829
|
-
let n =
|
|
836
|
+
function Q(e, t) {
|
|
837
|
+
let n = u(e.name), r = Z(e);
|
|
830
838
|
if (n) {
|
|
831
839
|
let e = r?.insertText;
|
|
832
840
|
if (e !== void 0) return e.trim() === "" ? void 0 : e;
|
|
@@ -836,59 +844,59 @@ function Z(e, t) {
|
|
|
836
844
|
let i = r?.insertText;
|
|
837
845
|
return i !== void 0 && i.trim() !== "" ? i : void 0;
|
|
838
846
|
}
|
|
839
|
-
function
|
|
840
|
-
let n =
|
|
841
|
-
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;
|
|
842
850
|
}
|
|
843
|
-
function
|
|
844
|
-
let
|
|
845
|
-
if (
|
|
846
|
-
let
|
|
847
|
-
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;
|
|
848
856
|
let i;
|
|
849
857
|
try {
|
|
850
|
-
i =
|
|
858
|
+
i = ht(r, n);
|
|
851
859
|
} catch {
|
|
852
860
|
continue;
|
|
853
861
|
}
|
|
854
|
-
let a =
|
|
862
|
+
let a = it(e, i);
|
|
855
863
|
if (a !== void 0) return a;
|
|
856
864
|
}
|
|
857
865
|
}
|
|
858
|
-
function
|
|
866
|
+
function _t(e, t) {
|
|
859
867
|
if (e.parents !== void 0 && e.parents.length !== 0) for (let n of e.parents) {
|
|
860
868
|
let e = t.find((e) => e.name === n);
|
|
861
869
|
if (e === void 0 || e.form !== "container") continue;
|
|
862
|
-
let r =
|
|
870
|
+
let r = it(n, e.insertText);
|
|
863
871
|
if (r !== void 0) return r;
|
|
864
872
|
}
|
|
865
873
|
}
|
|
866
|
-
function
|
|
867
|
-
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;
|
|
868
876
|
if (g !== void 0) {
|
|
869
|
-
if (v = g,
|
|
870
|
-
let
|
|
877
|
+
if (v = g, a) {
|
|
878
|
+
let i = gt(e, r, t);
|
|
871
879
|
try {
|
|
872
|
-
|
|
880
|
+
at(v, n, `component "${e.name}"`, i);
|
|
873
881
|
} catch (e) {
|
|
874
882
|
throw J(e instanceof Error ? e.message : String(e));
|
|
875
883
|
}
|
|
876
884
|
}
|
|
877
885
|
} else {
|
|
878
886
|
try {
|
|
879
|
-
v =
|
|
887
|
+
v = tt(e, Ye(e));
|
|
880
888
|
} catch (e) {
|
|
881
889
|
throw J(e instanceof Error ? e.message : String(e));
|
|
882
890
|
}
|
|
883
|
-
if (
|
|
884
|
-
|
|
891
|
+
if (a) try {
|
|
892
|
+
ot(v, n, `component "${e.name}"`, gt(e, r, t));
|
|
885
893
|
} catch (e) {
|
|
886
894
|
throw J(e instanceof Error ? e.message : String(e));
|
|
887
895
|
}
|
|
888
896
|
}
|
|
889
|
-
let
|
|
890
|
-
return
|
|
891
|
-
id:
|
|
897
|
+
let y = dt(e, ut(o), t), b = s(e.name);
|
|
898
|
+
return ft({
|
|
899
|
+
id: c ? e.name : e.id,
|
|
892
900
|
name: e.name,
|
|
893
901
|
title: p,
|
|
894
902
|
description: m,
|
|
@@ -896,70 +904,72 @@ function Q(e, t, r, a, o) {
|
|
|
896
904
|
categoryLabel: ee,
|
|
897
905
|
insertText: v,
|
|
898
906
|
form: e.form,
|
|
899
|
-
|
|
907
|
+
bodyKind: X(o.structure),
|
|
908
|
+
inline: c ? c.inline === !0 : e.form === "inline",
|
|
900
909
|
..._,
|
|
901
|
-
...
|
|
902
|
-
props:
|
|
910
|
+
...b === void 0 ? {} : { keywords: b },
|
|
911
|
+
props: y,
|
|
903
912
|
...e.styles === void 0 ? {} : { styles: e.styles },
|
|
904
913
|
...e.requires === void 0 ? {} : { requires: e.requires }
|
|
905
914
|
});
|
|
906
915
|
}
|
|
907
|
-
function
|
|
908
|
-
let
|
|
909
|
-
for (let e of
|
|
910
|
-
let t =
|
|
911
|
-
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));
|
|
912
921
|
}
|
|
913
|
-
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));
|
|
914
923
|
return s;
|
|
915
924
|
}
|
|
916
|
-
function
|
|
917
|
-
let
|
|
918
|
-
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;
|
|
919
928
|
return JSON.stringify({
|
|
920
929
|
name: e.name,
|
|
921
930
|
id: e.id,
|
|
922
931
|
form: e.form,
|
|
923
|
-
title: Y(
|
|
924
|
-
description: Y(
|
|
925
|
-
category:
|
|
926
|
-
categoryLabel:
|
|
927
|
-
insertText:
|
|
928
|
-
inline:
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
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,
|
|
934
944
|
styles: e.styles ?? null,
|
|
935
945
|
requires: e.requires ?? null
|
|
936
946
|
});
|
|
937
947
|
}
|
|
938
|
-
function
|
|
939
|
-
let n =
|
|
948
|
+
function xt(e, t = "en") {
|
|
949
|
+
let n = h(e);
|
|
940
950
|
if (!n.ok) return `invalid|${t}`;
|
|
941
|
-
let r = n.registry.map((e) =>
|
|
942
|
-
return `${
|
|
951
|
+
let r = n.registry.map((e) => bt(e, t));
|
|
952
|
+
return `${ee(e)}|${t}|${r.join("\0")}`;
|
|
943
953
|
}
|
|
944
954
|
function $(e, t, n, r) {
|
|
945
|
-
return Object.freeze(
|
|
955
|
+
return Object.freeze(yt(e.registry, e.externalComponentNames, t, n, r));
|
|
946
956
|
}
|
|
947
|
-
function
|
|
948
|
-
let n =
|
|
957
|
+
function St(e, t = "en") {
|
|
958
|
+
let n = m(e), r = h({ config: n });
|
|
949
959
|
if (!r.ok) throw J(r.message);
|
|
950
960
|
return $(r, t, { config: n }, !0);
|
|
951
961
|
}
|
|
952
|
-
function
|
|
953
|
-
let n =
|
|
962
|
+
function Ct(e, t = "en") {
|
|
963
|
+
let n = m(e), r = h({ config: n });
|
|
954
964
|
if (!r.ok) throw J(r.message);
|
|
955
965
|
return $(r, t, { config: n }, !1);
|
|
956
966
|
}
|
|
957
|
-
function
|
|
958
|
-
let n =
|
|
967
|
+
function wt(e, t = "en") {
|
|
968
|
+
let n = h(e);
|
|
959
969
|
return n.ok ? $(n, t, e, !0) : Object.freeze([]);
|
|
960
970
|
}
|
|
961
|
-
function
|
|
962
|
-
let t = new Map(
|
|
971
|
+
function Tt(e) {
|
|
972
|
+
let t = new Map(l.map((e, t) => [e.id, t])), n = /* @__PURE__ */ new Map();
|
|
963
973
|
for (let t of e) {
|
|
964
974
|
let e = n.get(t.category);
|
|
965
975
|
e ? e.entries.push(t) : n.set(t.category, {
|
|
@@ -978,7 +988,7 @@ function xt(e) {
|
|
|
978
988
|
entries: Object.freeze([...e.entries])
|
|
979
989
|
})));
|
|
980
990
|
}
|
|
981
|
-
function
|
|
991
|
+
function Et(e, t = {}) {
|
|
982
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 === "" || [
|
|
983
993
|
e.name,
|
|
984
994
|
e.title,
|
|
@@ -988,14 +998,14 @@ function St(e, t = {}) {
|
|
|
988
998
|
].some((e) => e.toLowerCase().includes(a)));
|
|
989
999
|
return Object.freeze(o);
|
|
990
1000
|
}
|
|
991
|
-
function
|
|
1001
|
+
function Dt(e) {
|
|
992
1002
|
let t = [];
|
|
993
1003
|
e.description !== "" && t.push(e.description);
|
|
994
1004
|
for (let n of Object.values(e.props)) n.description !== void 0 && t.push(`${n.name}: ${n.description}`);
|
|
995
1005
|
return t.join("\n");
|
|
996
1006
|
}
|
|
997
|
-
function
|
|
998
|
-
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([]);
|
|
999
1009
|
let r = Math.max(0, Math.min(e.length, Math.floor(t))), i = Object.freeze([]), a;
|
|
1000
1010
|
try {
|
|
1001
1011
|
a = te(e, n);
|
|
@@ -1010,13 +1020,13 @@ function wt(e, t, n) {
|
|
|
1010
1020
|
};
|
|
1011
1021
|
return o(a.nodes, Object.freeze([])), i;
|
|
1012
1022
|
}
|
|
1013
|
-
function
|
|
1023
|
+
function kt(e) {
|
|
1014
1024
|
let t = {};
|
|
1015
1025
|
if (!e) return t;
|
|
1016
1026
|
for (let [n, r] of Object.entries(e.props)) t[n] = Object.freeze({
|
|
1017
1027
|
name: n,
|
|
1018
1028
|
kind: r.kind,
|
|
1019
|
-
required:
|
|
1029
|
+
required: g(e, n, r),
|
|
1020
1030
|
static: r.static === !0,
|
|
1021
1031
|
dynamic: r.dynamic === !0,
|
|
1022
1032
|
...r.values ? { values: Object.freeze([...r.values]) } : {},
|
|
@@ -1024,10 +1034,11 @@ function Tt(e) {
|
|
|
1024
1034
|
});
|
|
1025
1035
|
return t;
|
|
1026
1036
|
}
|
|
1027
|
-
function
|
|
1037
|
+
function At(e) {
|
|
1028
1038
|
return Object.freeze({
|
|
1029
1039
|
name: e.name,
|
|
1030
1040
|
form: e.form,
|
|
1041
|
+
bodyKind: e.bodyKind,
|
|
1031
1042
|
paired: e.form !== "leaf",
|
|
1032
1043
|
title: e.title,
|
|
1033
1044
|
description: e.description,
|
|
@@ -1042,7 +1053,7 @@ function Et(e) {
|
|
|
1042
1053
|
...e.requires === void 0 ? {} : { requires: Object.freeze({ ...e.requires }) }
|
|
1043
1054
|
});
|
|
1044
1055
|
}
|
|
1045
|
-
function
|
|
1056
|
+
function jt(e) {
|
|
1046
1057
|
let t = new Map(e.map((e) => [e.name, e])), n = Object.freeze([...e]);
|
|
1047
1058
|
return Object.freeze({
|
|
1048
1059
|
tags: n,
|
|
@@ -1054,52 +1065,60 @@ function Dt(e) {
|
|
|
1054
1065
|
}
|
|
1055
1066
|
});
|
|
1056
1067
|
}
|
|
1057
|
-
function
|
|
1058
|
-
let
|
|
1059
|
-
if (!
|
|
1060
|
-
let
|
|
1068
|
+
function Mt(e, r = "en", i) {
|
|
1069
|
+
let a = h(e);
|
|
1070
|
+
if (!a.ok) return jt([]);
|
|
1071
|
+
let o = [];
|
|
1061
1072
|
try {
|
|
1062
|
-
|
|
1073
|
+
o = $(a, r, e, !1);
|
|
1063
1074
|
} catch {
|
|
1064
|
-
|
|
1075
|
+
o = Object.freeze([]);
|
|
1065
1076
|
}
|
|
1066
|
-
let
|
|
1067
|
-
for (let [e,
|
|
1068
|
-
let
|
|
1069
|
-
for (let [e, t] of Object.entries(
|
|
1070
|
-
...
|
|
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],
|
|
1071
1082
|
...t
|
|
1072
1083
|
});
|
|
1073
|
-
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({
|
|
1074
1092
|
name: e,
|
|
1075
|
-
form:
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
...
|
|
1084
|
-
...
|
|
1085
|
-
...
|
|
1086
|
-
...
|
|
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 }
|
|
1087
1106
|
}));
|
|
1088
1107
|
}
|
|
1089
|
-
return
|
|
1108
|
+
return jt(c);
|
|
1090
1109
|
}
|
|
1091
1110
|
// src/authoring/insert.ts
|
|
1092
|
-
var
|
|
1093
|
-
function
|
|
1094
|
-
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;
|
|
1095
1114
|
for (let t of a) {
|
|
1096
1115
|
let r = t, a = 2;
|
|
1097
1116
|
for (; i.has(r) || e.has(r) || r !== t && o.has(r);) r = `${t}${a}`, a += 1;
|
|
1098
|
-
i.add(r), r !== t && (s =
|
|
1117
|
+
i.add(r), r !== t && (s = _(s, t, r, n).source);
|
|
1099
1118
|
}
|
|
1100
1119
|
return s;
|
|
1101
1120
|
}
|
|
1102
|
-
function
|
|
1121
|
+
function Ft(e) {
|
|
1103
1122
|
return {
|
|
1104
1123
|
id: e.id,
|
|
1105
1124
|
label: e.title,
|
|
@@ -1109,35 +1128,35 @@ function jt(e) {
|
|
|
1109
1128
|
template: e.insertText
|
|
1110
1129
|
};
|
|
1111
1130
|
}
|
|
1112
|
-
function
|
|
1113
|
-
return B(n, r,
|
|
1131
|
+
function It(e, t, n, r) {
|
|
1132
|
+
return B(n, r, Pt(K(Ft(e), n), t, n), { block: !e.inline });
|
|
1114
1133
|
}
|
|
1115
|
-
function
|
|
1134
|
+
function Lt(e, t, n, r, i = "en") {
|
|
1116
1135
|
if (typeof n != "string") throw TypeError("insertLocalComponent requires source text.");
|
|
1117
1136
|
if (typeof t != "string" || t.length === 0) throw TypeError("insertLocalComponent requires a component id.");
|
|
1118
|
-
let a =
|
|
1137
|
+
let a = h(e);
|
|
1119
1138
|
if (!a.ok) throw Error(`Invalid compile options: ${a.message}`);
|
|
1120
|
-
let o =
|
|
1139
|
+
let o = wt(e, i).find((e) => e.id === t || e.name === t);
|
|
1121
1140
|
if (!o) throw Error(`Unknown local component "${t}".`);
|
|
1122
|
-
return
|
|
1141
|
+
return It(o, e, n, r);
|
|
1123
1142
|
}
|
|
1124
|
-
function
|
|
1125
|
-
return
|
|
1143
|
+
function Rt(e, t, n, r, i = "en") {
|
|
1144
|
+
return Lt({ config: m(e) }, t, n, r, i);
|
|
1126
1145
|
}
|
|
1127
1146
|
// src/authoring/conformance.ts
|
|
1128
|
-
function
|
|
1129
|
-
let n =
|
|
1130
|
-
for (let e of
|
|
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);
|
|
1149
|
+
for (let e of s) {
|
|
1131
1150
|
if (!r.has(e.name)) continue;
|
|
1132
|
-
let t =
|
|
1151
|
+
let t = It(e, o, "", {
|
|
1133
1152
|
start: 0,
|
|
1134
1153
|
end: 0
|
|
1135
|
-
}).value, n =
|
|
1136
|
-
|
|
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({
|
|
1137
1156
|
id: e.id,
|
|
1138
1157
|
name: e.name,
|
|
1139
1158
|
message: `Insert template for <${e.name}> does not compile with this configuration.`,
|
|
1140
|
-
diagnostics: Object.freeze(
|
|
1159
|
+
diagnostics: Object.freeze(l.diagnostics.map((e) => Object.freeze({
|
|
1141
1160
|
code: e.code,
|
|
1142
1161
|
message: e.message
|
|
1143
1162
|
})))
|
|
@@ -1145,4 +1164,4 @@ function Ft(e, t = "en") {
|
|
|
1145
1164
|
}
|
|
1146
1165
|
return Object.freeze(i);
|
|
1147
1166
|
}
|
|
1148
|
-
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 };
|