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,63 +1,64 @@
|
|
|
1
1
|
import { r as e } from "./latex-1w7aQgD5.js";
|
|
2
2
|
import "./limits-CFERRrlC.js";
|
|
3
|
-
import { t } from "./compile-
|
|
4
|
-
import {
|
|
5
|
-
import { n as
|
|
6
|
-
import {
|
|
7
|
-
import { n as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
3
|
+
import { t } from "./compile-B35rfzKr.js";
|
|
4
|
+
import { f as n, h as r, p as i, r as a } from "./compiler-core-kkDiQ1RK.js";
|
|
5
|
+
import { n as o } from "./runtime-requirement-DzPO8raU.js";
|
|
6
|
+
import { t as s } from "./conditional-branches-CIhJXasR.js";
|
|
7
|
+
import { i as c, n as l, r as u } from "./parser-standard-DDAKv_DZ.js";
|
|
8
|
+
import { n as d } from "./compiler-DBwLawMZ.js";
|
|
9
|
+
import { n as f } from "./display-Bb6hAG5T.js";
|
|
10
|
+
import { s as p } from "./default-config-CCa8rm2k.js";
|
|
11
|
+
import { r as m, t as h } from "./default-options-By16CVw1.js";
|
|
12
|
+
import { t as g } from "./parser-BHl9Lxbw.js";
|
|
13
|
+
import { r as _ } from "./default-schema-CeYiEW1K.js";
|
|
14
|
+
function v(e, t) {
|
|
14
15
|
if (typeof t != "string" || t.length > 1e6) return !0;
|
|
15
16
|
if (e.severity !== "error") return !1;
|
|
16
17
|
let n = e.code, r = (e) => n === e || n.startsWith(`${e}.`);
|
|
17
|
-
return r("local.options") || r("local.budget") || r("local.version") || r("local.html") || r("local.parse") || r("local.security") || r("local.config") || r("local.registry") || r("local.capability");
|
|
18
|
+
return r("local.options") || r("local.budget") || n === "local.macro.depth" || n === "local.macro.conflict" || n === "local.macro.recursion" || r("local.version") || r("local.html") || r("local.parse") || r("local.security") || r("local.config") || r("local.registry") || r("local.capability");
|
|
18
19
|
}
|
|
19
|
-
function
|
|
20
|
-
let n = e.filter((e) => !
|
|
21
|
-
for (let i of e)
|
|
20
|
+
function y(e, t) {
|
|
21
|
+
let n = e.filter((e) => !v(e, t)), r = [];
|
|
22
|
+
for (let i of e) v(i, t) && (i.code === "local.html" && n.some((e) => e.range.start === i.range.start && e.range.end === i.range.end) ? n.push(i) : r.push(i));
|
|
22
23
|
return {
|
|
23
24
|
definite: r,
|
|
24
25
|
transient: n
|
|
25
26
|
};
|
|
26
27
|
}
|
|
27
|
-
function
|
|
28
|
+
function b(e) {
|
|
28
29
|
return `${e.code}:${e.range.start}:${e.range.end}`;
|
|
29
30
|
}
|
|
30
|
-
function
|
|
31
|
+
function x(e, t) {
|
|
31
32
|
return e.range.start - t.range.start || e.range.end - t.range.end || e.line - t.line || e.column - t.column || (e.code < t.code ? -1 : +(e.code > t.code));
|
|
32
33
|
}
|
|
33
|
-
function
|
|
34
|
+
function S(e) {
|
|
34
35
|
let t = /* @__PURE__ */ new Map();
|
|
35
36
|
for (let n of e) for (let e of n) {
|
|
36
|
-
let n =
|
|
37
|
+
let n = b(e);
|
|
37
38
|
t.has(n) || t.set(n, e);
|
|
38
39
|
}
|
|
39
|
-
return [...t.values()].sort(
|
|
40
|
+
return [...t.values()].sort(x);
|
|
40
41
|
}
|
|
41
|
-
function
|
|
42
|
-
let n = t.filter((e) => e.code !== "local.author.unclosed"), r = t.filter((e) => e.code === "local.author.unclosed"), i = new Set(n.map(
|
|
42
|
+
function C(e, t) {
|
|
43
|
+
let n = t.filter((e) => e.code !== "local.author.unclosed"), r = t.filter((e) => e.code === "local.author.unclosed"), i = new Set(n.map(b));
|
|
43
44
|
return {
|
|
44
45
|
diagnostics: n,
|
|
45
|
-
transientDiagnostics:
|
|
46
|
+
transientDiagnostics: S([...e, r]).filter((e) => !i.has(b(e)))
|
|
46
47
|
};
|
|
47
48
|
}
|
|
48
|
-
function
|
|
49
|
+
function w(e, t) {
|
|
49
50
|
if (e.length !== t.length) return !1;
|
|
50
51
|
for (let n = 0; n < e.length; n += 1) if (e[n].start !== t[n].start || e[n].end !== t[n].end) return !1;
|
|
51
52
|
return !0;
|
|
52
53
|
}
|
|
53
|
-
function
|
|
54
|
+
function T(e, t) {
|
|
54
55
|
return e.length === 1 && e[0].start === 0 && e[0].end === t;
|
|
55
56
|
}
|
|
56
|
-
function
|
|
57
|
+
function E(e, t, n) {
|
|
57
58
|
for (let r of e) if (r.range.start <= t && r.range.end >= n) return r;
|
|
58
59
|
}
|
|
59
|
-
function
|
|
60
|
-
let r = t.length, i = Math.max(0, Math.min(r, e.range.start)), a =
|
|
60
|
+
function D(e, t, n) {
|
|
61
|
+
let r = t.length, i = Math.max(0, Math.min(r, e.range.start)), a = E(n, i, Math.max(i, Math.min(r, e.range.end)));
|
|
61
62
|
if (a) return {
|
|
62
63
|
start: a.range.start,
|
|
63
64
|
end: a.range.end
|
|
@@ -74,27 +75,27 @@ function T(e, t, n) {
|
|
|
74
75
|
end: r
|
|
75
76
|
};
|
|
76
77
|
}
|
|
77
|
-
function
|
|
78
|
+
function O(e, t) {
|
|
78
79
|
let n = t;
|
|
79
80
|
for (let t of e) t.range.start < n && (n = t.range.start);
|
|
80
81
|
return n;
|
|
81
82
|
}
|
|
82
|
-
function
|
|
83
|
+
function k(e, t, n, r, a) {
|
|
83
84
|
let o = [...e];
|
|
84
|
-
for (let e of t) o.push(
|
|
85
|
-
let s =
|
|
86
|
-
return a && (s =
|
|
85
|
+
for (let e of t) o.push(D(e, r, n?.nodes ?? []));
|
|
86
|
+
let s = i(o, r.length), c = O(t, r.length);
|
|
87
|
+
return a && (s = i([...s, {
|
|
87
88
|
start: c,
|
|
88
|
-
end:
|
|
89
|
-
}],
|
|
89
|
+
end: r.length
|
|
90
|
+
}], r.length)), w(s, e) && (s = i([...e, {
|
|
90
91
|
start: c,
|
|
91
|
-
end:
|
|
92
|
-
}],
|
|
92
|
+
end: r.length
|
|
93
|
+
}], r.length)), s;
|
|
93
94
|
}
|
|
94
|
-
function
|
|
95
|
+
function A(e, t) {
|
|
95
96
|
for (let [n, r] of Object.entries(t)) typeof r == "number" && Number.isFinite(r) && (e[n] = (e[n] ?? 0) + r);
|
|
96
97
|
}
|
|
97
|
-
function
|
|
98
|
+
function ee(e) {
|
|
98
99
|
let t = e;
|
|
99
100
|
if (typeof t != "object" || !t || Array.isArray(t)) return e;
|
|
100
101
|
let n = t.sourcePhase;
|
|
@@ -103,91 +104,91 @@ function k(e) {
|
|
|
103
104
|
sourcePhase: "streaming"
|
|
104
105
|
};
|
|
105
106
|
}
|
|
106
|
-
function
|
|
107
|
-
let i =
|
|
107
|
+
function te(e, t, n, r = !1) {
|
|
108
|
+
let i = ee(t), a = [], o = [], s = {}, c, l = 0;
|
|
108
109
|
for (let t = 1; t <= 6; t += 1) {
|
|
109
|
-
|
|
110
|
-
let
|
|
111
|
-
if (
|
|
112
|
-
let e =
|
|
110
|
+
l = t, c = d(e, i, n, a, r), A(s, c.timings);
|
|
111
|
+
let u = c.result;
|
|
112
|
+
if (u.ok) {
|
|
113
|
+
let e = C(o, u.diagnostics);
|
|
113
114
|
return {
|
|
114
115
|
result: {
|
|
115
|
-
...
|
|
116
|
+
...u,
|
|
116
117
|
status: "partial",
|
|
117
118
|
...e
|
|
118
119
|
},
|
|
119
|
-
...
|
|
120
|
+
...c.parsed ? { parsed: c.parsed } : {},
|
|
120
121
|
transientDiagnostics: e.transientDiagnostics,
|
|
121
122
|
literalRanges: [...a],
|
|
122
|
-
attempts:
|
|
123
|
-
timings:
|
|
123
|
+
attempts: l,
|
|
124
|
+
timings: s
|
|
124
125
|
};
|
|
125
126
|
}
|
|
126
|
-
let { definite: f, transient: p } =
|
|
127
|
+
let { definite: f, transient: p } = y(u.diagnostics, e);
|
|
127
128
|
if (f.length > 0) {
|
|
128
|
-
let e =
|
|
129
|
+
let e = S([...o, p]);
|
|
129
130
|
return {
|
|
130
131
|
result: {
|
|
131
132
|
ok: !1,
|
|
132
133
|
diagnostics: f,
|
|
133
|
-
...
|
|
134
|
+
...u.recoveries ? { recoveries: [...u.recoveries] } : {},
|
|
134
135
|
status: "failed",
|
|
135
136
|
transientDiagnostics: e
|
|
136
137
|
},
|
|
137
|
-
...
|
|
138
|
+
...c.parsed ? { parsed: c.parsed } : {},
|
|
138
139
|
transientDiagnostics: e,
|
|
139
140
|
literalRanges: [...a],
|
|
140
|
-
attempts:
|
|
141
|
-
timings:
|
|
141
|
+
attempts: l,
|
|
142
|
+
timings: s
|
|
142
143
|
};
|
|
143
144
|
}
|
|
144
|
-
if (
|
|
145
|
-
let m =
|
|
146
|
-
if (
|
|
147
|
-
a = m,
|
|
145
|
+
if (o.push(p), t === 6) break;
|
|
146
|
+
let m = k(a, p, c.parsed, e, t >= 5);
|
|
147
|
+
if (w(m, a)) break;
|
|
148
|
+
a = m, T(a, e.length);
|
|
148
149
|
}
|
|
149
|
-
if (typeof e == "string" && e.length <= 1e6 && !
|
|
150
|
+
if (typeof e == "string" && e.length <= 1e6 && !T(a, e.length)) {
|
|
150
151
|
let t = [{
|
|
151
152
|
start: 0,
|
|
152
153
|
end: e.length
|
|
153
|
-
}],
|
|
154
|
-
if (
|
|
155
|
-
let e =
|
|
154
|
+
}], c = d(e, i, n, t, r);
|
|
155
|
+
if (A(s, c.timings), l += 1, c.result.ok) {
|
|
156
|
+
let e = C(o, c.result.diagnostics);
|
|
156
157
|
return {
|
|
157
158
|
result: {
|
|
158
|
-
...
|
|
159
|
+
...c.result,
|
|
159
160
|
status: "partial",
|
|
160
161
|
...e
|
|
161
162
|
},
|
|
162
|
-
...
|
|
163
|
+
...c.parsed ? { parsed: c.parsed } : {},
|
|
163
164
|
transientDiagnostics: e.transientDiagnostics,
|
|
164
165
|
literalRanges: t,
|
|
165
|
-
attempts:
|
|
166
|
-
timings:
|
|
166
|
+
attempts: l,
|
|
167
|
+
timings: s
|
|
167
168
|
};
|
|
168
169
|
}
|
|
169
|
-
let { definite:
|
|
170
|
-
if (
|
|
170
|
+
let { definite: u, transient: f } = y(c.result.diagnostics, e), p = S([...o, f]);
|
|
171
|
+
if (u.length > 0) return {
|
|
171
172
|
result: {
|
|
172
173
|
ok: !1,
|
|
173
|
-
diagnostics:
|
|
174
|
-
...
|
|
174
|
+
diagnostics: u,
|
|
175
|
+
...c.result.recoveries ? { recoveries: [...c.result.recoveries] } : {},
|
|
175
176
|
status: "failed",
|
|
176
177
|
transientDiagnostics: p
|
|
177
178
|
},
|
|
178
|
-
...
|
|
179
|
+
...c.parsed ? { parsed: c.parsed } : {},
|
|
179
180
|
transientDiagnostics: p,
|
|
180
181
|
literalRanges: t,
|
|
181
|
-
attempts:
|
|
182
|
-
timings:
|
|
182
|
+
attempts: l,
|
|
183
|
+
timings: s
|
|
183
184
|
};
|
|
184
185
|
a = t;
|
|
185
186
|
}
|
|
186
|
-
let
|
|
187
|
+
let u = c, f = S(o);
|
|
187
188
|
return {
|
|
188
189
|
result: {
|
|
189
190
|
ok: !1,
|
|
190
|
-
diagnostics:
|
|
191
|
+
diagnostics: u !== void 0 && u.result.ok === !1 && u.result.diagnostics.length > 0 ? [...u.result.diagnostics] : f.length > 0 ? f : [{
|
|
191
192
|
code: "local.parse",
|
|
192
193
|
message: "The streaming snapshot could not be compiled.",
|
|
193
194
|
severity: "error",
|
|
@@ -198,19 +199,19 @@ function ee(e, t, n, r = !1) {
|
|
|
198
199
|
line: 1,
|
|
199
200
|
column: 1
|
|
200
201
|
}],
|
|
201
|
-
...
|
|
202
|
+
...u?.result.recoveries ? { recoveries: [...u.result.recoveries] } : {},
|
|
202
203
|
status: "failed",
|
|
203
204
|
transientDiagnostics: f
|
|
204
205
|
},
|
|
205
|
-
...
|
|
206
|
+
...u?.parsed ? { parsed: u.parsed } : {},
|
|
206
207
|
transientDiagnostics: f,
|
|
207
208
|
literalRanges: [...a],
|
|
208
|
-
attempts:
|
|
209
|
-
timings:
|
|
209
|
+
attempts: l,
|
|
210
|
+
timings: s
|
|
210
211
|
};
|
|
211
212
|
}
|
|
212
213
|
// src/local/compilation/session/semantic-cache.ts
|
|
213
|
-
var
|
|
214
|
+
var j = () => ({
|
|
214
215
|
expressionsCompiled: 0,
|
|
215
216
|
expressionsReused: 0,
|
|
216
217
|
typesInferred: 0,
|
|
@@ -223,18 +224,18 @@ var A = () => ({
|
|
|
223
224
|
formulasReused: 0,
|
|
224
225
|
displaysInspected: 0,
|
|
225
226
|
displaysReused: 0
|
|
226
|
-
}),
|
|
227
|
+
}), ne = class {
|
|
227
228
|
capacity;
|
|
228
229
|
maxWeight;
|
|
229
230
|
key;
|
|
230
231
|
values = /* @__PURE__ */ new Map();
|
|
231
232
|
weight = 0;
|
|
232
|
-
counts =
|
|
233
|
+
counts = j();
|
|
233
234
|
constructor(e = 16384, t = 8e6) {
|
|
234
235
|
this.capacity = e, this.maxWeight = t;
|
|
235
236
|
}
|
|
236
237
|
begin(e) {
|
|
237
|
-
this.key !== e && (this.clear(), this.key = e), this.counts =
|
|
238
|
+
this.key !== e && (this.clear(), this.key = e), this.counts = j();
|
|
238
239
|
}
|
|
239
240
|
get stats() {
|
|
240
241
|
return {
|
|
@@ -243,7 +244,7 @@ var A = () => ({
|
|
|
243
244
|
};
|
|
244
245
|
}
|
|
245
246
|
clear() {
|
|
246
|
-
this.values.clear(), this.weight = 0, this.key = void 0, this.counts =
|
|
247
|
+
this.values.clear(), this.weight = 0, this.key = void 0, this.counts = j();
|
|
247
248
|
}
|
|
248
249
|
get(e) {
|
|
249
250
|
let t = this.values.get(e);
|
|
@@ -294,11 +295,11 @@ var A = () => ({
|
|
|
294
295
|
display(e, t) {
|
|
295
296
|
let n = "display:" + JSON.stringify([e, t]), r = this.get(n);
|
|
296
297
|
if (r) return this.counts.displaysReused++, r;
|
|
297
|
-
let i =
|
|
298
|
+
let i = f(e, t);
|
|
298
299
|
return this.counts.displaysInspected++, this.put(n, i), i;
|
|
299
300
|
}
|
|
300
|
-
},
|
|
301
|
-
function
|
|
301
|
+
}, re = 128, ie = 512, ae = 32, oe = 131072, se = (e) => JSON.parse(JSON.stringify(e));
|
|
302
|
+
function ce(e) {
|
|
302
303
|
return typeof e == "object" && !!e && e.strict === !1;
|
|
303
304
|
}
|
|
304
305
|
var M = class {
|
|
@@ -329,13 +330,13 @@ var M = class {
|
|
|
329
330
|
clear() {
|
|
330
331
|
this.entries.clear(), this.bytes = 0;
|
|
331
332
|
}
|
|
332
|
-
},
|
|
333
|
+
}, le = class {
|
|
333
334
|
disposed = !1;
|
|
334
335
|
optionKey;
|
|
335
336
|
recoveryMode;
|
|
336
|
-
plans = new M(
|
|
337
|
-
inline = new M(
|
|
338
|
-
trees = new M(
|
|
337
|
+
plans = new M(re, 524288);
|
|
338
|
+
inline = new M(ie, 262144);
|
|
339
|
+
trees = new M(ae, 524288);
|
|
339
340
|
counts = {
|
|
340
341
|
hits: 0,
|
|
341
342
|
misses: 0,
|
|
@@ -348,8 +349,8 @@ var M = class {
|
|
|
348
349
|
};
|
|
349
350
|
parse(e, t, n, r, i) {
|
|
350
351
|
if (this.disposed) throw Error("Local parse session is disposed");
|
|
351
|
-
let a =
|
|
352
|
-
return (a !== this.optionKey || o !== this.recoveryMode) && (this.optionKey = a, this.recoveryMode = o, this.reset()), i && i.length > 0 ?
|
|
352
|
+
let a = h(t), o = ce(t);
|
|
353
|
+
return (a !== this.optionKey || o !== this.recoveryMode) && (this.optionKey = a, this.recoveryMode = o, this.reset()), i && i.length > 0 ? g(e, t, n, void 0, void 0, i) : g(e, t, n, this, r);
|
|
353
354
|
}
|
|
354
355
|
clear() {
|
|
355
356
|
this.optionKey = void 0, this.recoveryMode = void 0, this.reset();
|
|
@@ -394,9 +395,9 @@ var M = class {
|
|
|
394
395
|
return this.lookup(this.inline, e);
|
|
395
396
|
}
|
|
396
397
|
writeInline(e, t) {
|
|
397
|
-
e.length >
|
|
398
|
+
e.length > oe || this.inline.write(se(e), t?.map((e) => ({
|
|
398
399
|
...e,
|
|
399
|
-
value:
|
|
400
|
+
value: se(e.value)
|
|
400
401
|
})));
|
|
401
402
|
}
|
|
402
403
|
notePlanReuse() {
|
|
@@ -465,7 +466,7 @@ function P(e, t) {
|
|
|
465
466
|
created: r
|
|
466
467
|
};
|
|
467
468
|
}
|
|
468
|
-
function
|
|
469
|
+
function ue(e, t) {
|
|
469
470
|
if (!e?.ok || !t.ok) return 0;
|
|
470
471
|
let n = /* @__PURE__ */ new Set(), r = [...e.document.nodes];
|
|
471
472
|
for (; r.length;) {
|
|
@@ -537,7 +538,7 @@ function R(e, t) {
|
|
|
537
538
|
function z(e, t) {
|
|
538
539
|
if (t.add(e.id), e.children) for (let n of e.children) z(n, t);
|
|
539
540
|
}
|
|
540
|
-
function
|
|
541
|
+
function de(e, t) {
|
|
541
542
|
if (!e) return;
|
|
542
543
|
let n = F(e), r = F(t);
|
|
543
544
|
if (!n || !r || n.kind !== r.kind) return;
|
|
@@ -577,7 +578,7 @@ function V(e) {
|
|
|
577
578
|
function H(e) {
|
|
578
579
|
return e === "streaming" || e === "final" ? e : void 0;
|
|
579
580
|
}
|
|
580
|
-
function
|
|
581
|
+
function fe() {
|
|
581
582
|
return {
|
|
582
583
|
ok: !1,
|
|
583
584
|
status: "failed",
|
|
@@ -597,7 +598,7 @@ function ue() {
|
|
|
597
598
|
}]
|
|
598
599
|
};
|
|
599
600
|
}
|
|
600
|
-
function
|
|
601
|
+
function pe(e) {
|
|
601
602
|
try {
|
|
602
603
|
return typeof e == "object" && e ? H(e.sourcePhase) : void 0;
|
|
603
604
|
} catch {
|
|
@@ -638,13 +639,13 @@ function q(e, t, n) {
|
|
|
638
639
|
for (let i of G(e)) r[n?.get(i.id) ?? i.id] = t.dependencies?.[i.id] ?? null;
|
|
639
640
|
return r;
|
|
640
641
|
}
|
|
641
|
-
var J = /* @__PURE__ */ new Set(),
|
|
642
|
-
function
|
|
642
|
+
var J = /* @__PURE__ */ new Set(), me = "raw-body";
|
|
643
|
+
function he(e) {
|
|
643
644
|
try {
|
|
644
|
-
let t =
|
|
645
|
+
let t = m(e);
|
|
645
646
|
if (!t.ok) return J;
|
|
646
647
|
let n = /* @__PURE__ */ new Set();
|
|
647
|
-
for (let [e, r] of t.schemaByName) r.form === "container" && r.structure.rule ===
|
|
648
|
+
for (let [e, r] of t.schemaByName) r.form === "container" && r.structure.rule === me && n.add(e);
|
|
648
649
|
return n.size ? n : J;
|
|
649
650
|
} catch {
|
|
650
651
|
return J;
|
|
@@ -680,7 +681,7 @@ function X(e, t = J) {
|
|
|
680
681
|
n = !0;
|
|
681
682
|
continue;
|
|
682
683
|
}
|
|
683
|
-
if (["anchor", "jump"].includes(r.name ?? "") || !
|
|
684
|
+
if (["anchor", "jump"].includes(r.name ?? "") || !_(r.name ?? "")) return "unsupported";
|
|
684
685
|
n = !0;
|
|
685
686
|
}
|
|
686
687
|
r.type === "comment" && (n = !0);
|
|
@@ -711,14 +712,14 @@ function Q(e, t, n) {
|
|
|
711
712
|
}
|
|
712
713
|
return i;
|
|
713
714
|
}
|
|
714
|
-
function
|
|
715
|
+
function $(e) {
|
|
715
716
|
return /\r(?!\n)/.test(e);
|
|
716
717
|
}
|
|
717
|
-
function
|
|
718
|
+
function ge(e, t) {
|
|
718
719
|
for (; t > 0 && e[t - 1] !== "\n" && e[t - 1] !== "\r";) t--;
|
|
719
720
|
return t;
|
|
720
721
|
}
|
|
721
|
-
function
|
|
722
|
+
function _e(e, t) {
|
|
722
723
|
let n = new Set(t.map((e) => e.from));
|
|
723
724
|
for (let r of t) {
|
|
724
725
|
let t = r.to;
|
|
@@ -733,7 +734,7 @@ function ge(e, t) {
|
|
|
733
734
|
}
|
|
734
735
|
return !1;
|
|
735
736
|
}
|
|
736
|
-
function
|
|
737
|
+
function ve(e, t, n, r) {
|
|
737
738
|
if (e.type !== n.type || e.range.start + t !== n.range.start + r || e.range.end + t !== n.range.end + r) return !1;
|
|
738
739
|
let i = 0;
|
|
739
740
|
for (let [a, o] of Object.entries(e)) {
|
|
@@ -743,13 +744,13 @@ function $(e, t, n, r) {
|
|
|
743
744
|
if (a === "children") {
|
|
744
745
|
let n = o, i = e;
|
|
745
746
|
if (!i || n.length !== i.length) return !1;
|
|
746
|
-
for (let e = 0; e < n.length; e++) if (
|
|
747
|
+
for (let e = 0; e < n.length; e++) if (!ve(n[e], t, i[e], r)) return !1;
|
|
747
748
|
} else if (o !== e && JSON.stringify(o) !== JSON.stringify(e)) return !1;
|
|
748
749
|
}
|
|
749
750
|
for (let [e, t] of Object.entries(n)) t !== void 0 && e !== "id" && e !== "range" && i--;
|
|
750
751
|
return i === 0;
|
|
751
752
|
}
|
|
752
|
-
function
|
|
753
|
+
function ye(e, t) {
|
|
753
754
|
let n = 0, r = e.length, i = t.length;
|
|
754
755
|
for (; n < r && n < i && e.charCodeAt(n) === t.charCodeAt(n);) n++;
|
|
755
756
|
for (; r > n && i > n && e.charCodeAt(r - 1) === t.charCodeAt(i - 1);) r--, i--;
|
|
@@ -760,19 +761,19 @@ function _e(e, t) {
|
|
|
760
761
|
delta: i - r
|
|
761
762
|
};
|
|
762
763
|
}
|
|
763
|
-
function
|
|
764
|
+
function be(e, t) {
|
|
764
765
|
let n = e.parsed?.plans;
|
|
765
766
|
if (n?.length) {
|
|
766
767
|
for (let e of n) if (e.source === t) return e.rows;
|
|
767
768
|
if (n.length === 1) return n[0].rows;
|
|
768
769
|
}
|
|
769
770
|
}
|
|
770
|
-
var
|
|
771
|
+
var xe = class {
|
|
771
772
|
disposed = !1;
|
|
772
773
|
snapshot = null;
|
|
773
774
|
deferred = null;
|
|
774
|
-
parseSession = new
|
|
775
|
-
semantic = new
|
|
775
|
+
parseSession = new le();
|
|
776
|
+
semantic = new ne();
|
|
776
777
|
services = {
|
|
777
778
|
parser: this.parseSession,
|
|
778
779
|
semantic: this.semantic
|
|
@@ -798,8 +799,8 @@ var ye = class {
|
|
|
798
799
|
cacheBuilds: this.cacheBuilds
|
|
799
800
|
};
|
|
800
801
|
}
|
|
801
|
-
compile(e, t,
|
|
802
|
-
let i = this.compileShared(e, t,
|
|
802
|
+
compile(e, t, r) {
|
|
803
|
+
let i = this.compileShared(e, t, r), a = performance.now(), o = n(i);
|
|
803
804
|
return this.lastStats = {
|
|
804
805
|
...this.lastStats,
|
|
805
806
|
stages: {
|
|
@@ -810,8 +811,8 @@ var ye = class {
|
|
|
810
811
|
}
|
|
811
812
|
compileShared(e, t, n, r = !!t?.observer?.onTrace) {
|
|
812
813
|
if (this.disposed) throw Error("Local compile session is disposed");
|
|
813
|
-
if (n !== void 0 && H(n) === void 0) return
|
|
814
|
-
let i =
|
|
814
|
+
if (n !== void 0 && H(n) === void 0) return fe();
|
|
815
|
+
let i = pe(t), a = H(n) ?? i;
|
|
815
816
|
return a === "streaming" ? this.compileStreaming(e, t, r) : a === "final" ? this.compileFinal(e, i === "streaming" ? {
|
|
816
817
|
...t,
|
|
817
818
|
sourcePhase: "final"
|
|
@@ -828,7 +829,7 @@ var ye = class {
|
|
|
828
829
|
};
|
|
829
830
|
}
|
|
830
831
|
compileStreaming(e, t, n) {
|
|
831
|
-
let r =
|
|
832
|
+
let r = m(t).ok, i = h(t), a = this.streamingCache;
|
|
832
833
|
if (r && a !== null && a.source === e && a.key === i) return this.lastStats = {
|
|
833
834
|
mode: "streaming",
|
|
834
835
|
totalBlocks: a.blocks,
|
|
@@ -836,7 +837,7 @@ var ye = class {
|
|
|
836
837
|
reusedBlocks: 0,
|
|
837
838
|
compiledCharacters: 0
|
|
838
839
|
}, a.result;
|
|
839
|
-
let o =
|
|
840
|
+
let o = te(e, t, this.services, n), s = o.parsed?.nodes.length ?? 0;
|
|
840
841
|
return this.lastStats = {
|
|
841
842
|
mode: "streaming",
|
|
842
843
|
totalBlocks: s,
|
|
@@ -853,12 +854,12 @@ var ye = class {
|
|
|
853
854
|
}
|
|
854
855
|
compileFinalOrLegacy(e, t, n) {
|
|
855
856
|
this.epoch++;
|
|
856
|
-
let r =
|
|
857
|
+
let r = h(t), i = B(t);
|
|
857
858
|
(r !== this.sharedKey || i !== this.sharedMode) && (this.shared = null, this.sharedKey = r, this.sharedMode = i);
|
|
858
859
|
let a = this.compileCore(e, t, n), o = performance.now(), s = this.shared, c = P(s ?? void 0, a).value;
|
|
859
860
|
return this.shared = c, this.lastStats = {
|
|
860
861
|
...this.lastStats,
|
|
861
|
-
sharedNodes:
|
|
862
|
+
sharedNodes: ue(s, c),
|
|
862
863
|
parse: this.parseSession.stats,
|
|
863
864
|
semantic: this.lastStats.semantic ?? this.semantic.stats,
|
|
864
865
|
stages: {
|
|
@@ -867,79 +868,79 @@ var ye = class {
|
|
|
867
868
|
}
|
|
868
869
|
}, c;
|
|
869
870
|
}
|
|
870
|
-
compileCore(e, t,
|
|
871
|
+
compileCore(e, t, i) {
|
|
871
872
|
if (this.disposed) throw Error("Local compile session is disposed");
|
|
872
873
|
this.cacheBuilds = 0;
|
|
873
|
-
let
|
|
874
|
-
if (this.deferred = null, !
|
|
875
|
-
if (e ===
|
|
874
|
+
let a = h(t), o = m(t), s = this.rawNames(a, t), c = B(t), l = typeof e == "string" && e.length <= 1e6 && r(e), u = c || l, f = l ? "macro-scope" : c ? "recovery-reference" : "initial", g = !1, _ = this.deferred;
|
|
875
|
+
if (this.deferred = null, !u && _ && _.key === a && o.ok && typeof e == "string" && e.length <= 1e6) {
|
|
876
|
+
if (e === _.source) return this.deferred = _, this.lastStats = {
|
|
876
877
|
mode: "cached",
|
|
877
878
|
totalBlocks: this.lastStats.totalBlocks,
|
|
878
879
|
compiledBlocks: 0,
|
|
879
880
|
reusedBlocks: this.lastStats.totalBlocks,
|
|
880
881
|
compiledCharacters: 0
|
|
881
|
-
},
|
|
882
|
-
|
|
883
|
-
let n =
|
|
884
|
-
if (
|
|
885
|
-
this.snapshot = this.seed(
|
|
882
|
+
}, _.tracked.result;
|
|
883
|
+
g = !0, f = "scope-or-boundary";
|
|
884
|
+
let n = ye(_.source, e), r = (e) => n.from <= e.end && n.oldTo >= e.start, i = _.tracked.parsed;
|
|
885
|
+
if (i && !/[`\\~]/.test(_.source.slice(n.from, n.oldTo) + e.slice(n.from, n.newTo)) && !i.nodes.some((e) => r(e.range) && X(e, s) !== "fragment") && ![i.versionDeclaration?.range, i.themeRange].some((e) => e && r(e))) try {
|
|
886
|
+
this.snapshot = this.seed(_.source, a, _.tracked, t, void 0, s);
|
|
886
887
|
} catch {
|
|
887
888
|
this.snapshot = null;
|
|
888
889
|
}
|
|
889
|
-
} else
|
|
890
|
-
let
|
|
891
|
-
if (!
|
|
892
|
-
if (e ===
|
|
890
|
+
} else _ && !u && (f = "options-or-limits");
|
|
891
|
+
let v = this.snapshot;
|
|
892
|
+
if (!u && v && v.key === a && o.ok && typeof e == "string" && e.length <= 1e6) {
|
|
893
|
+
if (e === v.source) return this.lastStats = {
|
|
893
894
|
mode: "cached",
|
|
894
|
-
totalBlocks:
|
|
895
|
+
totalBlocks: v.blocks.length,
|
|
895
896
|
compiledBlocks: 0,
|
|
896
|
-
reusedBlocks:
|
|
897
|
+
reusedBlocks: v.blocks.length,
|
|
897
898
|
compiledCharacters: 0
|
|
898
|
-
}, this.publish(
|
|
899
|
-
let
|
|
899
|
+
}, this.publish(v);
|
|
900
|
+
let n = null;
|
|
900
901
|
try {
|
|
901
|
-
|
|
902
|
+
n = this.update(v, e, t, o.maxSyntaxNodes, s, i);
|
|
902
903
|
} catch {}
|
|
903
|
-
if (
|
|
904
|
-
|
|
905
|
-
} else
|
|
904
|
+
if (n) return this.snapshot = n, this.publish(n);
|
|
905
|
+
f = "scope-or-boundary", g = !0;
|
|
906
|
+
} else v && !u && (f = "options-or-limits");
|
|
906
907
|
this.snapshot = null;
|
|
907
|
-
let
|
|
908
|
+
let y = d(e, t, this.services, void 0, i);
|
|
908
909
|
if (this.lastStats = {
|
|
909
910
|
mode: "full",
|
|
910
|
-
totalBlocks:
|
|
911
|
-
compiledBlocks:
|
|
911
|
+
totalBlocks: y.parsed?.nodes.length ?? 0,
|
|
912
|
+
compiledBlocks: y.parsed?.nodes.length ?? 0,
|
|
912
913
|
reusedBlocks: 0,
|
|
913
914
|
compiledCharacters: typeof e == "string" ? e.length : 0,
|
|
914
|
-
fallbackReason:
|
|
915
|
-
semantic:
|
|
916
|
-
stages:
|
|
917
|
-
}, !
|
|
918
|
-
if (
|
|
919
|
-
let
|
|
920
|
-
if (
|
|
921
|
-
|
|
922
|
-
...
|
|
923
|
-
config:
|
|
915
|
+
fallbackReason: f,
|
|
916
|
+
semantic: y.semantic,
|
|
917
|
+
stages: y.timings
|
|
918
|
+
}, !u && y.result.ok && !y.result.document.capabilities && y.result.diagnostics.length === 0 && !V(y.result) && o.ok && a !== "invalid") {
|
|
919
|
+
if (g) {
|
|
920
|
+
let r = t === void 0 ? void 0 : n(t), i = r;
|
|
921
|
+
if (r?.config !== void 0) try {
|
|
922
|
+
i = {
|
|
923
|
+
...r,
|
|
924
|
+
config: p(r.config)
|
|
924
925
|
};
|
|
925
926
|
} catch {}
|
|
926
927
|
this.deferred = {
|
|
927
928
|
source: e,
|
|
928
|
-
key:
|
|
929
|
-
tracked:
|
|
930
|
-
options:
|
|
929
|
+
key: a,
|
|
930
|
+
tracked: y,
|
|
931
|
+
options: i
|
|
931
932
|
};
|
|
932
933
|
} else try {
|
|
933
|
-
this.snapshot = this.seed(e,
|
|
934
|
+
this.snapshot = this.seed(e, a, y, t, void 0, s);
|
|
934
935
|
} catch {
|
|
935
936
|
this.snapshot = null;
|
|
936
937
|
}
|
|
937
938
|
this.snapshot && (this.lastStats.totalBlocks = this.lastStats.compiledBlocks = this.snapshot.blocks.length);
|
|
938
939
|
}
|
|
939
|
-
return this.snapshot ? this.publish(this.snapshot) :
|
|
940
|
+
return this.snapshot ? this.publish(this.snapshot) : y.result;
|
|
940
941
|
}
|
|
941
942
|
seed(e, t, n, r, i, a) {
|
|
942
|
-
if (this.cacheBuilds++, !n.result.ok || !n.parsed || V(n.result) || e.includes("[^") || e.includes("") ||
|
|
943
|
+
if (this.cacheBuilds++, !n.result.ok || !n.parsed || V(n.result) || e.includes("[^") || e.includes("") || $(e)) return null;
|
|
943
944
|
let o = a ?? this.rawNamesFor(r), s = n.parsed.nodes, c = s.map((e) => X(e, o)), l = s.length === 1 && c[0] === "fragment" && (s[0].type === "list" || s[0].type === "table"), u = c.filter((e) => e === "raw").length;
|
|
944
945
|
if (c.includes("unsupported") || !l && u === 0 && c.filter((e) => e === "fragment").length < 2) return null;
|
|
945
946
|
let d = {
|
|
@@ -977,7 +978,7 @@ var ye = class {
|
|
|
977
978
|
dependencies: {},
|
|
978
979
|
cost: 0
|
|
979
980
|
});
|
|
980
|
-
if (p.sort((e, t) => e.from - t.from),
|
|
981
|
+
if (p.sort((e, t) => e.from - t.from), _e(e, p)) return null;
|
|
981
982
|
let h = Z(e, p);
|
|
982
983
|
if (h.includes("<")) return null;
|
|
983
984
|
let g = i ?? U.parse(h), _ = Q(g, p, h);
|
|
@@ -1021,7 +1022,7 @@ var ye = class {
|
|
|
1021
1022
|
nodes: o,
|
|
1022
1023
|
dependencies: q(o, d),
|
|
1023
1024
|
cost: s,
|
|
1024
|
-
rowPlans:
|
|
1025
|
+
rowPlans: be(n, c)
|
|
1025
1026
|
});
|
|
1026
1027
|
}
|
|
1027
1028
|
if (x !== m.length) return null;
|
|
@@ -1041,8 +1042,8 @@ var ye = class {
|
|
|
1041
1042
|
});
|
|
1042
1043
|
}
|
|
1043
1044
|
update(e, t, n, r, i, a) {
|
|
1044
|
-
if (t.includes("[^") || t.includes("") ||
|
|
1045
|
-
let
|
|
1045
|
+
if (t.includes("[^") || t.includes("") || $(t)) return null;
|
|
1046
|
+
let o = i, l = ye(e.source, t);
|
|
1046
1047
|
if (/[`\\~]/.test(e.source.slice(l.from, l.oldTo) + t.slice(l.from, l.newTo))) return null;
|
|
1047
1048
|
let u = [];
|
|
1048
1049
|
for (let n of e.context) {
|
|
@@ -1055,12 +1056,12 @@ var ye = class {
|
|
|
1055
1056
|
if (t.slice(r.from, r.to) !== n.text) return null;
|
|
1056
1057
|
u.push(r);
|
|
1057
1058
|
}
|
|
1058
|
-
let
|
|
1059
|
+
let f = [];
|
|
1059
1060
|
for (let n of e.blocks) {
|
|
1060
1061
|
if (!n.opaque) continue;
|
|
1061
1062
|
if (l.from > n.from && l.oldTo < n.to) {
|
|
1062
1063
|
let e = n.to + l.delta;
|
|
1063
|
-
|
|
1064
|
+
f.push({
|
|
1064
1065
|
...n,
|
|
1065
1066
|
to: e,
|
|
1066
1067
|
text: t.slice(n.from, e)
|
|
@@ -1074,52 +1075,52 @@ var ye = class {
|
|
|
1074
1075
|
to: n.to + e
|
|
1075
1076
|
};
|
|
1076
1077
|
if (t.slice(r.from, r.to) !== n.text) return null;
|
|
1077
|
-
|
|
1078
|
+
f.push(r);
|
|
1078
1079
|
}
|
|
1079
|
-
let
|
|
1080
|
-
if (
|
|
1081
|
-
let
|
|
1080
|
+
let p = [...u, ...f].sort((e, t) => e.from - t.from);
|
|
1081
|
+
if (_e(t, p)) return null;
|
|
1082
|
+
let m = c.applyChanges(c.addTree(e.tree), [{
|
|
1082
1083
|
fromA: l.from,
|
|
1083
1084
|
toA: l.oldTo,
|
|
1084
1085
|
fromB: l.from,
|
|
1085
1086
|
toB: l.newTo
|
|
1086
|
-
}], 0),
|
|
1087
|
-
if (
|
|
1088
|
-
let
|
|
1089
|
-
if (!
|
|
1090
|
-
for (let e of
|
|
1091
|
-
let
|
|
1087
|
+
}], 0), h = Z(t, p);
|
|
1088
|
+
if (h.includes("<")) return null;
|
|
1089
|
+
let g = U.parse(h, m), _ = Q(g, p, h);
|
|
1090
|
+
if (!_) return null;
|
|
1091
|
+
for (let e of f) if (_.some((t) => t.start < e.to && t.end > e.from)) return null;
|
|
1092
|
+
let v = [..._.map((e) => ({ range: e })), ...f.map((e) => ({
|
|
1092
1093
|
range: {
|
|
1093
1094
|
start: e.from,
|
|
1094
1095
|
end: e.to
|
|
1095
1096
|
},
|
|
1096
1097
|
opaque: e
|
|
1097
|
-
}))].sort((e, t) => e.range.start - t.range.start || e.range.end - t.range.end),
|
|
1098
|
-
for (let i of
|
|
1099
|
-
let
|
|
1100
|
-
if (
|
|
1098
|
+
}))].sort((e, t) => e.range.start - t.range.start || e.range.end - t.range.end), y = new Map(e.blocks.map((e) => [`${e.from}:${e.to}`, e])), b = [], x = /* @__PURE__ */ new Set(), S = /* @__PURE__ */ new Set(), C = 0, w = 0, T = 0, E = e.contextCost, D = 0, O = 0, k = 0, A = 0;
|
|
1099
|
+
for (let i of v) {
|
|
1100
|
+
let s = i.range, c = s.start >= l.newTo ? l.delta : 0, u = s.end <= l.from || s.start >= l.newTo ? y.get(`${s.start - c}:${s.end - c}`) : void 0, f = t.slice(s.start, s.end);
|
|
1101
|
+
if (u && u.text === f) {
|
|
1101
1102
|
let e = a ? performance.now() : 0;
|
|
1102
|
-
|
|
1103
|
-
...
|
|
1104
|
-
from:
|
|
1105
|
-
to:
|
|
1106
|
-
}),
|
|
1107
|
-
for (let e of G(
|
|
1108
|
-
a && (
|
|
1103
|
+
b.push({
|
|
1104
|
+
...u,
|
|
1105
|
+
from: s.start,
|
|
1106
|
+
to: s.end
|
|
1107
|
+
}), C++, E += u.cost;
|
|
1108
|
+
for (let e of G(u.nodes)) x.add(e.id);
|
|
1109
|
+
a && (D += performance.now() - e);
|
|
1109
1110
|
} else if (i.opaque) {
|
|
1110
|
-
let e = i.opaque.prefix ?? "", t = e.length, r =
|
|
1111
|
-
if (a && (
|
|
1112
|
-
let
|
|
1113
|
-
if (
|
|
1114
|
-
let
|
|
1115
|
-
if (
|
|
1116
|
-
let
|
|
1111
|
+
let e = i.opaque.prefix ?? "", t = e.length, r = d(e + f, n, this.services, void 0, a);
|
|
1112
|
+
if (a && (O += r.timings.totalMs, k += r.timings.parseMs ?? 0, A += r.timings.semanticMs ?? 0), T += t + f.length, w++, !r.result.ok || r.result.diagnostics.length || !r.parsed || V(r.result)) return null;
|
|
1113
|
+
let c = r.parsed.nodes.filter((e) => e.range.start >= t);
|
|
1114
|
+
if (c.length !== 1 || X(c[0], o) !== "raw") return null;
|
|
1115
|
+
let l = r.result.document.nodes.filter((e) => e.range.start >= t);
|
|
1116
|
+
if (l.length !== 1) return null;
|
|
1117
|
+
let u = new Map(G(l).map((e) => [e.id, `incremental-${++this.serial}-${e.id}`])), p = K(l, 0, u), m = (r.parsed.syntaxNodes ?? 0) - (i.opaque.prefixCost ?? 0);
|
|
1117
1118
|
if (m < G(p).length) return null;
|
|
1118
|
-
let h = q(
|
|
1119
|
+
let h = q(l, r.result.document, u), g = Object.create(null);
|
|
1119
1120
|
for (let e of G(p)) g[e.id] = h[e.id] ?? null;
|
|
1120
1121
|
let _ = {
|
|
1121
|
-
from:
|
|
1122
|
-
to:
|
|
1122
|
+
from: s.start,
|
|
1123
|
+
to: s.end,
|
|
1123
1124
|
origin: t,
|
|
1124
1125
|
text: f,
|
|
1125
1126
|
nodes: p,
|
|
@@ -1129,19 +1130,19 @@ var ye = class {
|
|
|
1129
1130
|
prefix: e,
|
|
1130
1131
|
prefixCost: i.opaque.prefixCost ?? 0
|
|
1131
1132
|
};
|
|
1132
|
-
|
|
1133
|
+
b.push(_), S.add(_), E += m;
|
|
1133
1134
|
} else {
|
|
1134
1135
|
let t = e.prefix.length, r = e.blocks.find((e) => {
|
|
1135
1136
|
let t = e.from >= l.oldTo ? e.from + l.delta : e.from, n = e.to >= l.oldTo ? e.to + l.delta : e.to;
|
|
1136
|
-
return t <
|
|
1137
|
+
return t < s.end && n > s.start;
|
|
1137
1138
|
}), i = r?.rowPlans ? {
|
|
1138
1139
|
...this.services,
|
|
1139
1140
|
rowPlans: r.rowPlans
|
|
1140
|
-
} : this.services,
|
|
1141
|
-
if (a && (
|
|
1142
|
-
let
|
|
1143
|
-
if (!
|
|
1144
|
-
let
|
|
1141
|
+
} : this.services, o = d(e.prefix + f, n, i, void 0, a);
|
|
1142
|
+
if (a && (O += o.timings.totalMs, k += o.timings.parseMs ?? 0, A += o.timings.semanticMs ?? 0), T += t + f.length, w++, !o.result.ok || o.result.diagnostics.length || !o.parsed || V(o.result)) return null;
|
|
1143
|
+
let c = o.parsed.nodes.filter((e) => e.range.start >= t);
|
|
1144
|
+
if (!c.length || c.some((e) => X(e) !== "fragment")) return null;
|
|
1145
|
+
let u = o.result.document.nodes.filter((e) => e.range.start >= t), p = new Map(G(u).map((e) => [e.id, `incremental-${++this.serial}-${e.id}`])), m = K(u, 0, p), h = r ? de({
|
|
1145
1146
|
text: r.text,
|
|
1146
1147
|
origin: r.origin,
|
|
1147
1148
|
nodes: r.nodes
|
|
@@ -1151,55 +1152,60 @@ var ye = class {
|
|
|
1151
1152
|
nodes: m
|
|
1152
1153
|
}) : void 0;
|
|
1153
1154
|
if (h) {
|
|
1154
|
-
for (let e of h.reusedIds) if (
|
|
1155
|
+
for (let e of h.reusedIds) if (x.has(e)) {
|
|
1155
1156
|
h = void 0;
|
|
1156
1157
|
break;
|
|
1157
1158
|
}
|
|
1158
1159
|
}
|
|
1159
|
-
let g = h?.nodes ?? m, _ = (
|
|
1160
|
+
let g = h?.nodes ?? m, _ = (o.parsed.syntaxNodes ?? 0) - e.prefixCost;
|
|
1160
1161
|
if (_ < G(g).length) return null;
|
|
1161
|
-
let v = q(
|
|
1162
|
-
for (let e of G(g))
|
|
1162
|
+
let v = q(u, o.result.document, p), y = Object.create(null);
|
|
1163
|
+
for (let e of G(g)) y[e.id] = v[e.id] ?? null;
|
|
1163
1164
|
if (h && r) {
|
|
1164
1165
|
let e = r.nodes[0]?.id, t = m[0]?.id;
|
|
1165
|
-
for (let n of h.reusedIds)
|
|
1166
|
+
for (let n of h.reusedIds) y[n] = n === e && t !== void 0 ? v[t] ?? null : r.dependencies[n] ?? null, x.add(n);
|
|
1166
1167
|
for (let e = 0; e < h.reused; e++) this.parseSession.noteRowReuse(h.kind);
|
|
1167
1168
|
}
|
|
1168
|
-
let
|
|
1169
|
-
from:
|
|
1170
|
-
to:
|
|
1169
|
+
let C = {
|
|
1170
|
+
from: s.start,
|
|
1171
|
+
to: s.end,
|
|
1171
1172
|
origin: t,
|
|
1172
1173
|
text: f,
|
|
1173
1174
|
nodes: g,
|
|
1174
|
-
dependencies:
|
|
1175
|
+
dependencies: y,
|
|
1175
1176
|
cost: _,
|
|
1176
|
-
rowPlans:
|
|
1177
|
+
rowPlans: be(o, f)
|
|
1177
1178
|
};
|
|
1178
|
-
|
|
1179
|
+
b.push(C), S.add(C), E += _;
|
|
1179
1180
|
}
|
|
1180
|
-
if (
|
|
1181
|
+
if (E > r) return null;
|
|
1182
|
+
}
|
|
1183
|
+
if (E > r) return null;
|
|
1184
|
+
if (u.some((e) => e.nodes.some((e) => e.type === "component" && e.name === "else")) && e.metadata.componentDefinitions?.some((e) => e.id === "reactive-md/else")) {
|
|
1185
|
+
let e = [...b, ...u].sort((e, t) => e.from - t.from).flatMap((e) => e.nodes);
|
|
1186
|
+
if (e.some((t, n) => t.type === "component" && t.name === "else" && s(e, n) !== void 0)) return null;
|
|
1181
1187
|
}
|
|
1182
|
-
return
|
|
1188
|
+
return this.sameBoundaries(t, b, u, S, l, n) ? (this.lastStats = {
|
|
1183
1189
|
mode: "incremental",
|
|
1184
|
-
totalBlocks:
|
|
1185
|
-
compiledBlocks:
|
|
1186
|
-
reusedBlocks:
|
|
1187
|
-
compiledCharacters:
|
|
1190
|
+
totalBlocks: b.length,
|
|
1191
|
+
compiledBlocks: w,
|
|
1192
|
+
reusedBlocks: C,
|
|
1193
|
+
compiledCharacters: T,
|
|
1188
1194
|
...a ? { stages: {
|
|
1189
|
-
...
|
|
1190
|
-
...
|
|
1191
|
-
rebuildMs:
|
|
1192
|
-
parseMs:
|
|
1193
|
-
semanticMs:
|
|
1195
|
+
...C ? { reuseMs: D } : {},
|
|
1196
|
+
...w ? {
|
|
1197
|
+
rebuildMs: O,
|
|
1198
|
+
parseMs: k,
|
|
1199
|
+
semanticMs: A
|
|
1194
1200
|
} : {}
|
|
1195
1201
|
} } : {}
|
|
1196
1202
|
}, {
|
|
1197
1203
|
...e,
|
|
1198
1204
|
source: t,
|
|
1199
|
-
tree:
|
|
1205
|
+
tree: g,
|
|
1200
1206
|
context: u,
|
|
1201
|
-
blocks:
|
|
1202
|
-
});
|
|
1207
|
+
blocks: b
|
|
1208
|
+
}) : null;
|
|
1203
1209
|
}
|
|
1204
1210
|
sameBoundaries(e, t, n, r, i, a) {
|
|
1205
1211
|
let o = new Set(n), s = [...t, ...n].sort((e, t) => e.from - t.from), c = (e) => r.has(s[e]) || r.has(s[e + 1]) || i.from <= s[e + 1].from && i.newTo >= s[e].to;
|
|
@@ -1221,7 +1227,7 @@ var ye = class {
|
|
|
1221
1227
|
delta: a
|
|
1222
1228
|
});
|
|
1223
1229
|
}
|
|
1224
|
-
let i = r[0], l = r[r.length - 1], u = "node" in i ? Math.max(s[t].from,
|
|
1230
|
+
let i = r[0], l = r[r.length - 1], u = "node" in i ? Math.max(s[t].from, ge(e, i.node.range.start + i.delta)) : i.from, d = "node" in l ? l.node.range.end + l.delta : l.to, f = s.slice(t, n + 2).flatMap((e) => e.rowPlans ? [e.rowPlans] : []), p = f.length < 2 ? f[0] : {
|
|
1225
1231
|
has: (e) => f.some((t) => t.has(e)),
|
|
1226
1232
|
get: (e) => f.find((t) => t.has(e))?.get(e)
|
|
1227
1233
|
}, m = this.parseSession.parse(e.slice(u, d), a, void 0, p);
|
|
@@ -1229,7 +1235,7 @@ var ye = class {
|
|
|
1229
1235
|
for (let e = 0; e < r.length; e++) {
|
|
1230
1236
|
let t = r[e], n = m.nodes[e];
|
|
1231
1237
|
if ("node" in t) {
|
|
1232
|
-
if (
|
|
1238
|
+
if (!ve(n, u, t.node, t.delta)) return !1;
|
|
1233
1239
|
} else if (n.range.start + u !== t.from || n.range.end + u !== t.to) return !1;
|
|
1234
1240
|
}
|
|
1235
1241
|
t = n;
|
|
@@ -1237,20 +1243,20 @@ var ye = class {
|
|
|
1237
1243
|
return !0;
|
|
1238
1244
|
}
|
|
1239
1245
|
publish(e) {
|
|
1240
|
-
let t =
|
|
1246
|
+
let t = n(e.metadata);
|
|
1241
1247
|
t.source = e.source;
|
|
1242
|
-
let
|
|
1243
|
-
t.nodes =
|
|
1248
|
+
let r = [...e.blocks, ...e.context].sort((e, t) => e.from - t.from), i = new Map(this.shared?.ok ? this.shared.document.nodes.map((e) => [e.id, e]) : []);
|
|
1249
|
+
t.nodes = r.flatMap((e) => {
|
|
1244
1250
|
let t = e.from - e.origin;
|
|
1245
1251
|
if (e.publication?.delta === t) return e.publication.nodes;
|
|
1246
|
-
let n = P(e.publication?.nodes ?? e.nodes.map((e) =>
|
|
1252
|
+
let n = P(e.publication?.nodes ?? e.nodes.map((e) => i.get(e.id)).filter((e) => !!e), K(e.nodes, t)).value;
|
|
1247
1253
|
return e.publication = {
|
|
1248
1254
|
delta: t,
|
|
1249
1255
|
nodes: n
|
|
1250
1256
|
}, n;
|
|
1251
1257
|
});
|
|
1252
1258
|
let s = {};
|
|
1253
|
-
for (let e of
|
|
1259
|
+
for (let e of r) for (let [t, n] of Object.entries(e.dependencies)) Object.defineProperty(s, t, {
|
|
1254
1260
|
value: n === null ? null : Object.freeze([...n]),
|
|
1255
1261
|
enumerable: !0
|
|
1256
1262
|
});
|
|
@@ -1270,7 +1276,7 @@ var ye = class {
|
|
|
1270
1276
|
start: t.offset,
|
|
1271
1277
|
end: t.offset
|
|
1272
1278
|
}).start;
|
|
1273
|
-
return t.requiresRuntime =
|
|
1279
|
+
return t.requiresRuntime = o(t), t.usedComponents = a(t.nodes), {
|
|
1274
1280
|
ok: !0,
|
|
1275
1281
|
document: t,
|
|
1276
1282
|
diagnostics: []
|
|
@@ -1336,11 +1342,11 @@ var ye = class {
|
|
|
1336
1342
|
rawNames(e, t) {
|
|
1337
1343
|
return this.rawNamesCache?.key !== e && (this.rawNamesCache = {
|
|
1338
1344
|
key: e,
|
|
1339
|
-
names:
|
|
1345
|
+
names: he(t)
|
|
1340
1346
|
}), this.rawNamesCache.names;
|
|
1341
1347
|
}
|
|
1342
1348
|
rawNamesFor(e) {
|
|
1343
|
-
return this.rawNames(
|
|
1349
|
+
return this.rawNames(h(e), e);
|
|
1344
1350
|
}
|
|
1345
1351
|
clear() {
|
|
1346
1352
|
this.epoch++, this.snapshot = null, this.deferred = null, this.serial = 0, this.cacheBuilds = 0, this.shared = null, this.sharedKey = void 0, this.sharedMode = void 0, this.streamingCache = null, this.rawNamesCache = null, this.parseSession.clear(), this.semantic.clear();
|
|
@@ -1349,7 +1355,7 @@ var ye = class {
|
|
|
1349
1355
|
this.clear(), this.parseSession.dispose(), this.disposed = !0;
|
|
1350
1356
|
}
|
|
1351
1357
|
};
|
|
1352
|
-
function
|
|
1353
|
-
return new
|
|
1358
|
+
function Se() {
|
|
1359
|
+
return new xe();
|
|
1354
1360
|
}
|
|
1355
|
-
export {
|
|
1361
|
+
export { Se as n, xe as t };
|