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,19 +1,19 @@
|
|
|
1
|
-
import { t as e } from "./compiler-core-
|
|
2
|
-
import { t } from "./types-
|
|
3
|
-
import { t as n } from "./compiler-
|
|
4
|
-
import { r } from "./html-
|
|
5
|
-
import { b as i, s as a } from "./default-config-
|
|
6
|
-
import { r as o } from "./default-options-
|
|
1
|
+
import { t as e } from "./compiler-core-kkDiQ1RK.js";
|
|
2
|
+
import { t } from "./types-FYhRWRn9.js";
|
|
3
|
+
import { t as n } from "./compiler-DBwLawMZ.js";
|
|
4
|
+
import { r } from "./html-CY9mC3Sr.js";
|
|
5
|
+
import { b as i, s as a } from "./default-config-CCa8rm2k.js";
|
|
6
|
+
import { r as o } from "./default-options-By16CVw1.js";
|
|
7
7
|
import { u as s } from "./component-state-CwKX_SN5.js";
|
|
8
|
-
import {
|
|
9
|
-
import { a as
|
|
10
|
-
import {
|
|
11
|
-
import { r as
|
|
12
|
-
import { t as
|
|
13
|
-
import { jsx as
|
|
14
|
-
import { createRoot as
|
|
8
|
+
import { i as c, n as l } from "./runtime-BHeuLOv_.js";
|
|
9
|
+
import { a as u } from "./identity-BUx0Q_-d.js";
|
|
10
|
+
import { S as d, a as f, d as p, f as m, g as h, v as g, x as _, y as v } from "./shareable-CHCDnl6j.js";
|
|
11
|
+
import { r as y } from "./requirements-C56sFIEs.js";
|
|
12
|
+
import { t as b } from "./resources-6VaNgk-h.js";
|
|
13
|
+
import { jsx as x } from "react/jsx-runtime";
|
|
14
|
+
import { createRoot as ee, hydrateRoot as te } from "react-dom/client";
|
|
15
15
|
// src/standalone/diagnostics.ts
|
|
16
|
-
function
|
|
16
|
+
function S(e, t) {
|
|
17
17
|
return {
|
|
18
18
|
code: e,
|
|
19
19
|
message: t,
|
|
@@ -26,44 +26,44 @@ function b(e, t) {
|
|
|
26
26
|
column: 1
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function C(e, t = 8) {
|
|
30
30
|
let n = e.slice(0, t).map((e) => `- [${e.code}] ${e.message} (line ${e.line}, column ${e.column})`);
|
|
31
31
|
return e.length > n.length && n.push(`- ${e.length - n.length} more diagnostic(s).`), n.join("\n");
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function w(e) {
|
|
34
34
|
return e instanceof Error ? e.message : String(e);
|
|
35
35
|
}
|
|
36
|
-
var
|
|
36
|
+
var T = class extends Error {
|
|
37
37
|
diagnostics;
|
|
38
38
|
constructor(e, t) {
|
|
39
|
-
let n =
|
|
39
|
+
let n = C(t);
|
|
40
40
|
super(n ? `${e}\n${n}` : e), this.name = "ReactiveMDMountError", this.diagnostics = t;
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
|
-
function
|
|
43
|
+
function E(e, t = "standalone.mount") {
|
|
44
44
|
if (typeof e == "object" && e && Array.isArray(e.diagnostics)) {
|
|
45
45
|
let t = e.diagnostics;
|
|
46
46
|
if (t.length > 0) return t;
|
|
47
47
|
}
|
|
48
|
-
return [
|
|
48
|
+
return [S(t, w(e))];
|
|
49
49
|
}
|
|
50
50
|
// src/standalone/events.ts
|
|
51
|
-
var
|
|
52
|
-
function
|
|
51
|
+
var D = "reactive-md-diagnostics", O = "reactive-md-state-change", k = /^[A-Za-z][A-Za-z0-9_-]*$/, A = 256, j = /^data:image\/(?:png|jpeg|gif|webp);base64,[A-Za-z0-9+/]+={0,2}$/, M = /[\u0000-\u001f\u007f-\u009f]/, N = 64, P = 4096, F = 41943040;
|
|
52
|
+
function I(e, t) {
|
|
53
53
|
if (e === void 0) return;
|
|
54
|
-
if (!
|
|
54
|
+
if (!R(e)) {
|
|
55
55
|
t("standalone.payload.images", "images must be a JSON object mapping image URLs to data URLs.");
|
|
56
56
|
return;
|
|
57
57
|
}
|
|
58
58
|
let n = Object.entries(e);
|
|
59
|
-
if (n.length >
|
|
60
|
-
t("standalone.payload.images", `images cannot contain more than ${
|
|
59
|
+
if (n.length > N) {
|
|
60
|
+
t("standalone.payload.images", `images cannot contain more than ${N} entries.`);
|
|
61
61
|
return;
|
|
62
62
|
}
|
|
63
63
|
let r = Object.create(null), i = 0;
|
|
64
|
-
for (let [e, a] of n) if (!e || e.length >
|
|
64
|
+
for (let [e, a] of n) if (!e || e.length > P || e === "__proto__" || M.test(e) || typeof a != "string" || !j.test(a)) t("standalone.payload.images", "Every image entry must use a bounded URL key and a base64 raster data URL.");
|
|
65
65
|
else {
|
|
66
|
-
if (i += a.length, i >
|
|
66
|
+
if (i += a.length, i > F) {
|
|
67
67
|
t("standalone.payload.images", "The embedded image map exceeds the 40 MiB budget.");
|
|
68
68
|
return;
|
|
69
69
|
}
|
|
@@ -71,30 +71,30 @@ function P(e, t) {
|
|
|
71
71
|
}
|
|
72
72
|
return r;
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function L(e, t) {
|
|
75
75
|
if (e === void 0) return;
|
|
76
76
|
let n = o(e);
|
|
77
77
|
if (!n.ok) t("standalone.payload.compile-options", `The payload compile options are invalid: ${n.message}`);
|
|
78
|
-
else return
|
|
78
|
+
else return m(e);
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function R(e) {
|
|
81
81
|
if (typeof e != "object" || !e || Array.isArray(e)) return !1;
|
|
82
82
|
let t = Object.getPrototypeOf(e);
|
|
83
83
|
return t === Object.prototype || t === null;
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function z(e, t) {
|
|
86
86
|
if (e === void 0) return;
|
|
87
|
-
let n =
|
|
87
|
+
let n = u(e);
|
|
88
88
|
if (typeof e != "string" || n !== e) t("standalone.payload.document-id", "The payload documentId must be a canonical 1-256 character string.");
|
|
89
89
|
else return n;
|
|
90
90
|
}
|
|
91
|
-
function
|
|
91
|
+
function B(e, t) {
|
|
92
92
|
if (e !== void 0) {
|
|
93
93
|
if (typeof e != "number" || !Number.isInteger(e) || e < 0 || e > 4294967295) t("standalone.payload.random-seed", "The payload randomSeed must be a 32-bit unsigned integer.");
|
|
94
94
|
else return e;
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
-
function
|
|
97
|
+
function V(e, t) {
|
|
98
98
|
if (e === void 0) return;
|
|
99
99
|
let n = s(e);
|
|
100
100
|
if (!n.ok || n.diagnostics.length > 0) {
|
|
@@ -103,17 +103,17 @@ function z(e, t) {
|
|
|
103
103
|
for (let n of e) t("standalone.payload.component-state", n.message);
|
|
104
104
|
} else return n.document;
|
|
105
105
|
}
|
|
106
|
-
function
|
|
106
|
+
function H(e) {
|
|
107
107
|
let t = [], n = (e, n) => {
|
|
108
|
-
t.push(
|
|
108
|
+
t.push(S(e, n));
|
|
109
109
|
};
|
|
110
|
-
if (!
|
|
110
|
+
if (!R(e)) return {
|
|
111
111
|
ok: !1,
|
|
112
|
-
diagnostics: [
|
|
112
|
+
diagnostics: [S("standalone.payload.shape", "The reactive-md payload must be a JSON object.")]
|
|
113
113
|
};
|
|
114
114
|
e.version !== 1 && e.version !== 2 && n("standalone.payload.version", "The reactive-md payload must use version 1 or 2."), e.version === 2 && e.restoration === void 0 && n("standalone.payload.requirements", "Version 2 requires restoration contracts."), e.version === 1 && (e.restoration !== void 0 || e.resources !== void 0) && n("standalone.payload.version", "Restoration contracts require payload version 2.");
|
|
115
115
|
let r = e.target;
|
|
116
|
-
typeof r != "string" || r.length === 0 || r.length >
|
|
116
|
+
typeof r != "string" || r.length === 0 || r.length > A ? n("standalone.payload.target", `The payload target must be an element id of 1-${A} characters.`) : k.test(r) || n("standalone.payload.target", "The payload target must start with a letter and use only letters, digits, underscores or hyphens.");
|
|
117
117
|
let i = e.source;
|
|
118
118
|
typeof i != "string" && n("standalone.payload.source", "The payload source must be a string.");
|
|
119
119
|
let a = e.locale === void 0 ? "en" : e.locale;
|
|
@@ -123,22 +123,22 @@ function B(e) {
|
|
|
123
123
|
let s = e.hydrate !== void 0 && e.hydrate;
|
|
124
124
|
typeof s != "boolean" && n("standalone.payload.hydrate", "The payload hydrate flag must be a boolean.");
|
|
125
125
|
let c = e.state;
|
|
126
|
-
|
|
126
|
+
R(c) || n("standalone.payload.state", "The payload state must be a JSON object.");
|
|
127
127
|
let l = e.sourceSemantics;
|
|
128
128
|
l !== void 0 && l !== "mixed-rmd-v1" && n("standalone.payload.source-semantics", "Unsupported Reactive MD source semantics.");
|
|
129
|
-
let u =
|
|
129
|
+
let u = L(l === void 0 && R(e.compileOptions) ? {
|
|
130
130
|
enableCss: !1,
|
|
131
131
|
...e.compileOptions
|
|
132
132
|
} : e.compileOptions, n);
|
|
133
|
-
t.push(...
|
|
134
|
-
let d =
|
|
135
|
-
t.push(...d.diagnostics), t.push(...
|
|
133
|
+
t.push(...y(e.extensions, u?.config));
|
|
134
|
+
let d = b(e.resources ?? []);
|
|
135
|
+
t.push(...d.diagnostics), t.push(...p(e.restoration, {
|
|
136
136
|
config: u?.config,
|
|
137
137
|
source: typeof i == "string" ? i : "",
|
|
138
138
|
resources: d.resources
|
|
139
139
|
}));
|
|
140
|
-
let f =
|
|
141
|
-
return t.length > 0 ? {
|
|
140
|
+
let f = I(e.images, n), m = z(e.documentId, n), h = B(e.randomSeed, n), g = V(e.componentState, n), v = e.macroState === void 0 ? void 0 : _(e.macroState);
|
|
141
|
+
return v && !v.ok && t.push(...v.diagnostics), t.length > 0 ? {
|
|
142
142
|
ok: !1,
|
|
143
143
|
diagnostics: t
|
|
144
144
|
} : {
|
|
@@ -149,6 +149,7 @@ function B(e) {
|
|
|
149
149
|
target: r,
|
|
150
150
|
source: i,
|
|
151
151
|
state: c,
|
|
152
|
+
...v?.ok ? { macroState: v.file } : {},
|
|
152
153
|
locale: a,
|
|
153
154
|
colorScheme: o,
|
|
154
155
|
hydrate: s,
|
|
@@ -159,37 +160,37 @@ function B(e) {
|
|
|
159
160
|
resources: d.resources
|
|
160
161
|
},
|
|
161
162
|
...f && Object.keys(f).length > 0 ? { images: f } : {},
|
|
162
|
-
...
|
|
163
|
-
...
|
|
164
|
-
...
|
|
163
|
+
...m === void 0 ? {} : { documentId: m },
|
|
164
|
+
...h === void 0 ? {} : { randomSeed: h },
|
|
165
|
+
...g === void 0 ? {} : { componentState: g }
|
|
165
166
|
}
|
|
166
167
|
};
|
|
167
168
|
}
|
|
168
|
-
function
|
|
169
|
+
function U(e) {
|
|
169
170
|
try {
|
|
170
|
-
return
|
|
171
|
+
return H(e);
|
|
171
172
|
} catch (e) {
|
|
172
173
|
return {
|
|
173
174
|
ok: !1,
|
|
174
|
-
diagnostics: [
|
|
175
|
+
diagnostics: [S("standalone.payload.invalid", `The reactive-md payload could not be read: ${w(e)}`)]
|
|
175
176
|
};
|
|
176
177
|
}
|
|
177
178
|
}
|
|
178
179
|
// src/standalone/prepare.ts
|
|
179
|
-
function
|
|
180
|
-
if (typeof i != "string") throw new
|
|
181
|
-
let
|
|
180
|
+
function W(i, a, s, c, l, u = !1, p) {
|
|
181
|
+
if (typeof i != "string") throw new T("Cannot mount a Reactive MD document: source must be a string.", [S("standalone.source", "source must be a string.")]);
|
|
182
|
+
let m = u && c?.enableCss === void 0 ? {
|
|
182
183
|
...c,
|
|
183
184
|
enableCss: !1
|
|
184
|
-
} : c,
|
|
185
|
-
if (
|
|
185
|
+
} : c, h = o(m), _ = u && h.ok && (h.html.enableCss || h.html.enableJavaScript || h.html.enableExtendedHtml), v = _ ? e(i, h, r) : n(i, m), y;
|
|
186
|
+
if (v.ok) y = v.document;
|
|
186
187
|
else {
|
|
187
|
-
if (!
|
|
188
|
-
|
|
188
|
+
if (!_) throw new T("Cannot mount a Reactive MD document: the source contains syntax errors.", v.diagnostics);
|
|
189
|
+
y = {
|
|
189
190
|
syntax: "local",
|
|
190
191
|
syntaxVersion: t,
|
|
191
192
|
source: i,
|
|
192
|
-
html:
|
|
193
|
+
html: h.html,
|
|
193
194
|
initialState: {},
|
|
194
195
|
bindings: {},
|
|
195
196
|
nodes: [{
|
|
@@ -203,30 +204,33 @@ function H(i, a, s, c, l, d = !1) {
|
|
|
203
204
|
}]
|
|
204
205
|
};
|
|
205
206
|
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
let
|
|
210
|
-
if (!
|
|
211
|
-
|
|
207
|
+
l?.(y);
|
|
208
|
+
let b;
|
|
209
|
+
if (a !== void 0 || p !== void 0) {
|
|
210
|
+
let e = d(a ?? g(y, y.initialState));
|
|
211
|
+
if (!e.ok) throw new T("Cannot mount a Reactive MD document: the state payload is invalid.", e.diagnostics);
|
|
212
|
+
let t = f(y, e.file, p);
|
|
213
|
+
if (!t.ok) throw new T("Cannot mount a Reactive MD document: the state does not match this source.", t.diagnostics);
|
|
214
|
+
y = t.baseline.document, p !== void 0 && (b = t.baseline.state);
|
|
212
215
|
}
|
|
213
|
-
return typeof s == "string" && s.trim().length > 0 && (
|
|
214
|
-
...
|
|
216
|
+
return typeof s == "string" && s.trim().length > 0 && (y = {
|
|
217
|
+
...y,
|
|
215
218
|
theme: s.trim(),
|
|
216
219
|
themeRange: void 0
|
|
217
220
|
}), {
|
|
218
|
-
document:
|
|
219
|
-
|
|
221
|
+
document: y,
|
|
222
|
+
...b ? { restoredValues: b } : {},
|
|
223
|
+
diagnostics: v.diagnostics.slice()
|
|
220
224
|
};
|
|
221
225
|
}
|
|
222
|
-
var
|
|
226
|
+
var G = Object.freeze({
|
|
223
227
|
name: "reactive-md-standalone",
|
|
224
228
|
version: "0.4.0"
|
|
225
|
-
}),
|
|
226
|
-
function
|
|
229
|
+
}), K = "data-reactive-md-mounted", q = "script[type=\"application/reactive-md+json\"][data-reactive-md-auto]", J = /^data:image\/(?:png|jpeg|gif|webp);base64,[A-Za-z0-9+/]+={0,2}$/, ne = 64;
|
|
230
|
+
function re(e) {
|
|
227
231
|
if (!e) return {};
|
|
228
232
|
let t = /* @__PURE__ */ new Map();
|
|
229
|
-
for (let [n, r] of Object.entries(e).slice(0,
|
|
233
|
+
for (let [n, r] of Object.entries(e).slice(0, ne)) typeof n == "string" && n.length > 0 && typeof r == "string" && J.test(r) && t.set(n, r);
|
|
230
234
|
return t.size === 0 ? {} : {
|
|
231
235
|
urlPolicy: (e, n) => n === "link" || t.has(e),
|
|
232
236
|
imageResolver: (e) => t.get(e) ?? null
|
|
@@ -236,15 +240,15 @@ var Y = /* @__PURE__ */ new WeakSet();
|
|
|
236
240
|
function X(e) {
|
|
237
241
|
return Y.has(e) || e.hasAttribute("data-reactive-md-mounted");
|
|
238
242
|
}
|
|
239
|
-
function
|
|
240
|
-
return
|
|
243
|
+
function ie(e, t) {
|
|
244
|
+
return v(e, t);
|
|
241
245
|
}
|
|
242
246
|
function Z(e) {
|
|
243
247
|
if (e) try {
|
|
244
248
|
e();
|
|
245
249
|
} catch {}
|
|
246
250
|
}
|
|
247
|
-
function
|
|
251
|
+
function ae(e) {
|
|
248
252
|
let t = () => {
|
|
249
253
|
let t = e.querySelector("article.local-document");
|
|
250
254
|
t && (t.classList.remove("local-static-first", "reactive-md-static-first", "reactive-md-hydrating"), t.removeAttribute("data-static-first"), t.removeAttribute("data-reactive-md-static-first")), e.classList.remove("local-static-first", "reactive-md-static-first"), e.removeAttribute("data-static-first");
|
|
@@ -258,71 +262,75 @@ function te(e) {
|
|
|
258
262
|
};
|
|
259
263
|
}
|
|
260
264
|
function Q(e, t, n, r = {}) {
|
|
261
|
-
if (!e || typeof e != "object" || !("nodeType" in e) || !e.hasAttribute) throw new
|
|
262
|
-
if (X(e)) throw new
|
|
263
|
-
if (!t || typeof t != "object") throw new
|
|
265
|
+
if (!e || typeof e != "object" || !("nodeType" in e) || !e.hasAttribute) throw new T("Cannot mount a Reactive MD document: element must be an HTMLElement.", [S("standalone.element", "element must be an HTMLElement.")]);
|
|
266
|
+
if (X(e)) throw new T("Cannot mount a Reactive MD document: this element is already mounted.", [S("standalone.mount", "The target element already hosts a Reactive MD document.")]);
|
|
267
|
+
if (!t || typeof t != "object") throw new T("Cannot mount a Reactive MD document: options are required.", [S("standalone.options", "mount requires an options object with a source string.")]);
|
|
264
268
|
let o = t.compileOptions;
|
|
265
269
|
if (t.reactConfig) {
|
|
266
|
-
if (o?.hostComponents !== void 0 || t.themes !== void 0) throw new
|
|
267
|
-
if (o?.config && a(o.config).key !== t.reactConfig.config.key) throw new
|
|
270
|
+
if (o?.hostComponents !== void 0 || t.themes !== void 0) throw new T("Conflicting extension registration.", [S("local.extension.config", "reactConfig cannot be combined with hostComponents or themes.")]);
|
|
271
|
+
if (o?.config && a(o.config).key !== t.reactConfig.config.key) throw new T("The export configuration differs from the installed bundle.", [S("local.extension.config", "Compile configuration does not match installed implementations.")]);
|
|
268
272
|
o = {
|
|
269
273
|
...o,
|
|
270
274
|
config: t.reactConfig.config
|
|
271
275
|
};
|
|
272
276
|
}
|
|
273
|
-
let s =
|
|
274
|
-
if (s.length) throw new
|
|
275
|
-
let
|
|
277
|
+
let s = y(t.extensions, t.reactConfig?.config);
|
|
278
|
+
if (s.length) throw new T("Extension requirements are not satisfied.", s);
|
|
279
|
+
let u = p(t.restoration, {
|
|
276
280
|
config: t.reactConfig?.config ?? o?.config,
|
|
277
281
|
source: t.source,
|
|
278
282
|
resources: t.resources
|
|
279
283
|
});
|
|
280
|
-
if (
|
|
281
|
-
let
|
|
282
|
-
if (
|
|
283
|
-
let
|
|
284
|
-
let n =
|
|
285
|
-
if (n.push(...
|
|
284
|
+
if (u.length) throw new T("Restoration requirements are not satisfied.", u);
|
|
285
|
+
let d = b(t.resources ?? []);
|
|
286
|
+
if (d.diagnostics.length) throw new T("Style resources are invalid.", d.diagnostics);
|
|
287
|
+
let f = W(t.source, t.state, r.theme, o, (e) => {
|
|
288
|
+
let n = y(e.extensions, t.reactConfig?.config);
|
|
289
|
+
if (n.push(...p(t.restoration, {
|
|
286
290
|
config: t.reactConfig?.config ?? o?.config,
|
|
287
291
|
source: t.source,
|
|
288
292
|
resources: t.resources,
|
|
289
293
|
document: e
|
|
290
|
-
})), n.length) throw new
|
|
291
|
-
}, r.legacyPayload),
|
|
292
|
-
if (
|
|
293
|
-
let
|
|
294
|
+
})), n.length) throw new T("Installed contracts must match before state recovery.", n);
|
|
295
|
+
}, r.legacyPayload, t.macroState), m = y(f.document.extensions, t.reactConfig?.config);
|
|
296
|
+
if (m.length) throw new T("Installed extension implementations are required.", m);
|
|
297
|
+
let g = o?.config, _ = g?.key ?? f.document.componentConfigKey, v = g?.legacyKeys.map((e) => e.key) ?? [], C;
|
|
294
298
|
try {
|
|
295
|
-
|
|
299
|
+
C = l(f.document, {
|
|
296
300
|
documentId: t.documentId,
|
|
297
301
|
randomSeed: t.randomSeed,
|
|
298
302
|
componentState: t.componentState,
|
|
299
|
-
...
|
|
300
|
-
...
|
|
303
|
+
..._ === void 0 ? {} : { configKey: _ },
|
|
304
|
+
...v.length === 0 ? {} : { legacyConfigKeys: v }
|
|
301
305
|
});
|
|
302
306
|
} catch (e) {
|
|
303
|
-
throw new
|
|
307
|
+
throw new T("Cannot mount a Reactive MD document: the interactive runtime could not be created.", [S("standalone.runtime", w(e))]);
|
|
304
308
|
}
|
|
305
|
-
|
|
309
|
+
if (f.restoredValues) {
|
|
310
|
+
let e = c(C, f.restoredValues);
|
|
311
|
+
if (e.length) throw C.dispose(), new T("Cannot mount a Reactive MD document: macro state restoration failed.", e);
|
|
312
|
+
}
|
|
313
|
+
let D = t.generator ?? G, O = re(t.images), k = t.urlPolicy ?? O.urlPolicy, A = t.imageResolver ?? O.imageResolver, j = () => ie(C, D), M;
|
|
306
314
|
try {
|
|
307
315
|
M = j();
|
|
308
316
|
} catch (e) {
|
|
309
317
|
try {
|
|
310
|
-
|
|
318
|
+
C.dispose();
|
|
311
319
|
} catch {}
|
|
312
|
-
throw new
|
|
320
|
+
throw new T("Cannot mount a Reactive MD document: the initial state could not be captured.", [S("standalone.state", w(e))]);
|
|
313
321
|
}
|
|
314
322
|
let N = !1, P = (e) => {
|
|
315
323
|
N || Z(r.onDiagnostics ? () => r.onDiagnostics(e) : void 0);
|
|
316
324
|
}, F = (() => {
|
|
317
325
|
try {
|
|
318
|
-
return
|
|
326
|
+
return C.services?.state.diagnostics() ?? [];
|
|
319
327
|
} catch {
|
|
320
328
|
return [];
|
|
321
329
|
}
|
|
322
|
-
})(), I = t.hydrate === !0 && e.hasChildNodes(), L = /* @__PURE__ */
|
|
323
|
-
document:
|
|
330
|
+
})(), I = t.hydrate === !0 && e.hasChildNodes(), L = /* @__PURE__ */ x(n, {
|
|
331
|
+
document: f.document,
|
|
324
332
|
capabilityGrants: o,
|
|
325
|
-
runtime:
|
|
333
|
+
runtime: C,
|
|
326
334
|
onDiagnostics: P,
|
|
327
335
|
urlPolicy: k,
|
|
328
336
|
locale: t.locale ?? "en",
|
|
@@ -336,23 +344,23 @@ function Q(e, t, n, r = {}) {
|
|
|
336
344
|
if (!I) for (; e.firstChild;) e.removeChild(e.firstChild);
|
|
337
345
|
let R = null, z = [];
|
|
338
346
|
try {
|
|
339
|
-
for (let [t, n] of
|
|
347
|
+
for (let [t, n] of d.resources.entries()) {
|
|
340
348
|
let r = e.ownerDocument.createElement("style");
|
|
341
349
|
r.setAttribute("data-reactive-md-resource", n.id), r.textContent = t === 0 ? `${i}\n${n.css}` : n.css, (e.ownerDocument.head ?? e.ownerDocument.documentElement).appendChild(r), z.push(r);
|
|
342
350
|
}
|
|
343
|
-
R = I ?
|
|
351
|
+
R = I ? te(e, L) : ee(e), I || R.render(L);
|
|
344
352
|
} catch (e) {
|
|
345
353
|
z.forEach((e) => e.remove());
|
|
346
354
|
try {
|
|
347
355
|
R?.unmount();
|
|
348
356
|
} catch {}
|
|
349
357
|
try {
|
|
350
|
-
|
|
358
|
+
C.dispose();
|
|
351
359
|
} catch {}
|
|
352
|
-
throw new
|
|
360
|
+
throw new T("Cannot mount a Reactive MD document: React could not render the document.", E(e, "standalone.render"));
|
|
353
361
|
}
|
|
354
|
-
Y.add(e), e.setAttribute(
|
|
355
|
-
let B = r.onStateChange ?
|
|
362
|
+
Y.add(e), e.setAttribute(K, "");
|
|
363
|
+
let B = r.onStateChange ? C.subscribe(() => {
|
|
356
364
|
if (N) return;
|
|
357
365
|
let e;
|
|
358
366
|
try {
|
|
@@ -362,14 +370,18 @@ function Q(e, t, n, r = {}) {
|
|
|
362
370
|
}
|
|
363
371
|
Z(r.onStateChange ? () => r.onStateChange(e) : void 0);
|
|
364
372
|
}) : () => {};
|
|
365
|
-
Z(r.onStateChange ? () => r.onStateChange(M) : void 0),
|
|
366
|
-
let V = I ?
|
|
373
|
+
Z(r.onStateChange ? () => r.onStateChange(M) : void 0), f.diagnostics.length > 0 && P(f.diagnostics), F.length > 0 && P([...F]);
|
|
374
|
+
let V = I ? ae(e) : () => {};
|
|
367
375
|
return {
|
|
368
376
|
element: e,
|
|
369
377
|
getState() {
|
|
370
378
|
if (N) throw Error("This Reactive MD document has been unmounted.");
|
|
371
379
|
return j();
|
|
372
380
|
},
|
|
381
|
+
getMacroState() {
|
|
382
|
+
if (N) throw Error("This Reactive MD document has been unmounted.");
|
|
383
|
+
return C.document.macroConfigKey ? h(C) : void 0;
|
|
384
|
+
},
|
|
373
385
|
unmount: () => {
|
|
374
386
|
if (!N) {
|
|
375
387
|
N = !0, B(), V(), z.forEach((e) => e.remove());
|
|
@@ -377,9 +389,9 @@ function Q(e, t, n, r = {}) {
|
|
|
377
389
|
R?.unmount();
|
|
378
390
|
} catch {}
|
|
379
391
|
try {
|
|
380
|
-
|
|
392
|
+
C.dispose();
|
|
381
393
|
} catch {}
|
|
382
|
-
Y.delete(e), e.getAttribute("data-reactive-md-mounted") === "" && e.removeAttribute(
|
|
394
|
+
Y.delete(e), e.getAttribute("data-reactive-md-mounted") === "" && e.removeAttribute(K);
|
|
383
395
|
}
|
|
384
396
|
}
|
|
385
397
|
};
|
|
@@ -390,31 +402,31 @@ function $(e, t, n) {
|
|
|
390
402
|
} catch {}
|
|
391
403
|
let r = e.defaultView?.CustomEvent;
|
|
392
404
|
if (typeof r == "function") try {
|
|
393
|
-
t.dispatchEvent(new r(
|
|
405
|
+
t.dispatchEvent(new r(D, {
|
|
394
406
|
detail: n,
|
|
395
407
|
bubbles: !0,
|
|
396
408
|
composed: !0
|
|
397
409
|
}));
|
|
398
410
|
} catch {}
|
|
399
411
|
}
|
|
400
|
-
function
|
|
412
|
+
function oe(e, t) {
|
|
401
413
|
let n = t.defaultView?.HTMLElement;
|
|
402
414
|
return n ? e instanceof n : e.namespaceURI === "http://www.w3.org/1999/xhtml";
|
|
403
415
|
}
|
|
404
|
-
function
|
|
416
|
+
function se(e, t, n = {}) {
|
|
405
417
|
if (typeof document > "u") return [];
|
|
406
418
|
let r = t ?? document, i = r, a = i.nodeType === 9 ? r : i.ownerDocument ?? document, o = [], s;
|
|
407
419
|
try {
|
|
408
|
-
s = Array.from(r.querySelectorAll(
|
|
420
|
+
s = Array.from(r.querySelectorAll(q));
|
|
409
421
|
} catch {
|
|
410
422
|
return o;
|
|
411
423
|
}
|
|
412
424
|
for (let t of s) {
|
|
413
425
|
let s;
|
|
414
426
|
try {
|
|
415
|
-
s =
|
|
427
|
+
s = U(JSON.parse(t.textContent ?? ""));
|
|
416
428
|
} catch (e) {
|
|
417
|
-
$(a, t, [
|
|
429
|
+
$(a, t, [S("standalone.payload.json", `The reactive-md payload is not valid JSON: ${w(e)}`)]);
|
|
418
430
|
continue;
|
|
419
431
|
}
|
|
420
432
|
if (!s.ok) {
|
|
@@ -422,13 +434,14 @@ function re(e, t, n = {}) {
|
|
|
422
434
|
continue;
|
|
423
435
|
}
|
|
424
436
|
let c = s.payload, l = r, u = (typeof l.getElementById == "function" ? l.getElementById(c.target) : null) ?? a.getElementById(c.target);
|
|
425
|
-
if (!u) $(a, t, [
|
|
426
|
-
else if (i !== a && !i.contains(u)) $(a, t, [
|
|
427
|
-
else if (!
|
|
437
|
+
if (!u) $(a, t, [S("standalone.target.missing", `The reactive-md payload target "#${c.target}" was not found.`)]);
|
|
438
|
+
else if (i !== a && !i.contains(u)) $(a, t, [S("standalone.target.scope", "The reactive-md payload target is outside the scanned root.")]);
|
|
439
|
+
else if (!oe(u, a)) $(a, t, [S("standalone.target.type", "The reactive-md payload target must be an HTML element.")]);
|
|
428
440
|
else if (!X(u)) try {
|
|
429
441
|
o.push(Q(u, {
|
|
430
442
|
source: c.source,
|
|
431
443
|
state: c.state,
|
|
444
|
+
macroState: c.macroState,
|
|
432
445
|
locale: c.locale,
|
|
433
446
|
colorScheme: c.colorScheme,
|
|
434
447
|
hydrate: c.hydrate,
|
|
@@ -446,9 +459,9 @@ function re(e, t, n = {}) {
|
|
|
446
459
|
onDiagnostics: (e) => $(a, u, e)
|
|
447
460
|
}));
|
|
448
461
|
} catch (e) {
|
|
449
|
-
$(a, u,
|
|
462
|
+
$(a, u, E(e));
|
|
450
463
|
}
|
|
451
464
|
}
|
|
452
465
|
return o;
|
|
453
466
|
}
|
|
454
|
-
export {
|
|
467
|
+
export { U as a, T as c, se as i, Q as n, D as o, X as r, O as s, K as t };
|