reactive-md 0.6.1 → 0.8.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 +66 -0
- package/CHANGELOG.md +66 -0
- package/CONTRIBUTING-ch.md +6 -62
- package/CONTRIBUTING.md +5 -63
- package/README-ch.md +232 -67
- package/README-en.md +209 -71
- package/README.md +209 -71
- package/SECURITY-ch.md +3 -1
- package/SECURITY.md +3 -1
- package/THIRD_PARTY_NOTICES.md +1909 -87
- package/cli/args.mjs +33 -1
- package/cli/build.mjs +62 -1
- package/cli/check.mjs +444 -0
- package/cli/help.mjs +181 -3
- package/cli/init.mjs +1577 -0
- package/cli/main.mjs +11 -1
- package/cli/package-loader.mjs +41 -0
- package/dist-library/LocalDocumentView-6trX7xJc.js +97920 -0
- package/dist-library/{authoring-BEVyth5X.js → authoring-BsfSwQRm.js} +237 -209
- package/dist-library/compiler--ea2CKQF.js +61 -0
- package/dist-library/compiler-core-kPiH-gOV.js +11805 -0
- package/dist-library/component-state-Cq2K5gkS.js +490 -0
- package/dist-library/component-state-D_cw_EHe.js +54 -0
- package/dist-library/config-validation-DXTynAw7.js +3005 -0
- package/dist-library/default-components-Z_YMio5P.js +2346 -0
- package/dist-library/identity-MYJXKSkB.js +1443 -0
- package/dist-library/math-display-BJz4gbFc.js +24000 -0
- package/dist-library/math-sample-BGEW49zY.js +1124 -0
- package/dist-library/options-CX5m5n-J.js +115 -0
- package/dist-library/parser-standard-DlCk7sLo.js +10122 -0
- package/dist-library/props-DGlBk0e5.js +183 -0
- package/dist-library/react-ByOHunUW.js +122 -0
- package/dist-library/reactive-md-authoring.js +712 -1077
- package/dist-library/reactive-md-build.js +7966 -0
- package/dist-library/reactive-md-compiler-standard.js +33 -0
- package/dist-library/reactive-md-compiler.js +22 -0
- package/dist-library/reactive-md-default-packs.js +71 -0
- package/dist-library/reactive-md-default-preset.js +10 -0
- package/dist-library/reactive-md-export.js +111 -0
- package/dist-library/reactive-md-print.css +18 -3
- package/dist-library/reactive-md-react-runtime.js +251 -0
- package/dist-library/reactive-md-react-server.js +55 -0
- package/dist-library/reactive-md-react-unstyled.js +9 -1
- package/dist-library/reactive-md-react.js +9 -1
- package/dist-library/reactive-md-runtime-browser.js +51 -0
- package/dist-library/reactive-md-runtime.js +3 -0
- package/dist-library/reactive-md-sdk.js +6 -0
- package/dist-library/reactive-md-standalone-host.js +442 -0
- package/dist-library/reactive-md-testing-browser.js +523 -0
- package/dist-library/reactive-md-testing-react.js +221 -0
- package/dist-library/reactive-md-testing.js +638 -0
- package/dist-library/reactive-md-vite.js +959 -0
- package/dist-library/reactive-md.css +1 -1
- package/dist-library/reactive-md.js +1080 -795
- package/dist-library/registry-B9Jc3FVe.js +1174 -0
- package/dist-library/resources-BGt8mpDA.js +204 -0
- package/dist-library/runtime-C-sbfpOX.js +1157 -0
- package/dist-library/runtime-Dkq7ldyg.js +172 -0
- package/dist-library/schema-ZFufO8V0.js +39 -0
- package/dist-library/shareable-DDVL4Fi9.js +844 -0
- package/dist-library/types/authoring/catalog.d.ts +168 -0
- package/dist-library/types/authoring/conformance.d.ts +24 -0
- package/dist-library/types/{editor → authoring}/editor-i18n.d.ts +3 -24
- package/dist-library/types/authoring/extensions.d.ts +13 -0
- package/dist-library/types/authoring/index.d.ts +14 -11
- package/dist-library/types/authoring/insert.d.ts +16 -0
- package/dist-library/types/{editor → authoring}/native-components.d.ts +19 -2
- package/dist-library/types/authoring/templates.d.ts +65 -0
- package/dist-library/types/build/diagnostics.d.ts +8 -0
- package/dist-library/types/build/digest.d.ts +5 -0
- package/dist-library/types/build/entry.d.ts +9 -0
- package/dist-library/types/build/host.d.ts +36 -0
- package/dist-library/types/build/index.d.ts +99 -0
- package/dist-library/types/build/notices.d.ts +29 -0
- package/dist-library/types/build/resources.d.ts +60 -0
- package/dist-library/types/build/vite.d.ts +15 -0
- package/dist-library/types/compiler/index.d.ts +22 -0
- package/dist-library/types/compiler/result.d.ts +30 -0
- package/dist-library/types/compiler/standard.d.ts +16 -0
- package/dist-library/types/compiler/types.d.ts +69 -0
- package/dist-library/types/components/chart-motion.d.ts +12 -0
- package/dist-library/types/components/controls.d.ts +21 -0
- package/dist-library/types/{local → components}/data-table.d.ts +10 -24
- package/dist-library/types/components/default-chart-types.d.ts +22 -0
- package/dist-library/types/components/default-chart.d.ts +2 -0
- package/dist-library/types/components/default-preset.d.ts +10 -0
- package/dist-library/types/components/diagram-inspector.d.ts +24 -0
- package/dist-library/types/components/gallery.d.ts +6 -0
- package/dist-library/types/components/layout.d.ts +23 -0
- package/dist-library/types/components/mafs-plot-grid.d.ts +57 -0
- package/dist-library/types/components/mafs-visuals.d.ts +40 -0
- package/dist-library/types/components/numeric-sliders.d.ts +3 -0
- package/dist-library/types/components/uiarc/calendar/calendar.d.ts +26 -0
- package/dist-library/types/components/uiarc/date-picker/date-picker.d.ts +29 -0
- package/dist-library/types/components/uiarc/lib/motion-tokens.d.ts +2 -0
- package/dist-library/types/components/uiarc/lib/use-today.d.ts +2 -0
- package/dist-library/types/components/uiarc/motion-tokens.d.ts +60 -0
- package/dist-library/types/components/uiarc/rmd-motion.d.ts +12 -0
- package/dist-library/types/components/uiarc/select/select.d.ts +21 -0
- package/dist-library/types/components/uiarc/slider/slider.d.ts +53 -0
- package/dist-library/types/components/use-hydrated.d.ts +6 -0
- package/dist-library/types/components/visuals.d.ts +13 -0
- package/dist-library/types/export/component-state.d.ts +39 -0
- package/dist-library/types/export/index.d.ts +47 -0
- package/dist-library/types/export/requirements.d.ts +23 -0
- package/dist-library/types/export/resources.d.ts +8 -0
- package/dist-library/types/export/restoration.d.ts +52 -0
- package/dist-library/types/index.d.ts +1 -0
- package/dist-library/types/local/compilation/compiler-core.d.ts +16 -0
- package/dist-library/types/local/compilation/compiler-services.d.ts +64 -0
- package/dist-library/types/local/compilation/compiler-structure.d.ts +46 -0
- package/dist-library/types/local/compilation/compiler-values.d.ts +9 -0
- package/dist-library/types/local/compilation/compiler.d.ts +34 -0
- package/dist-library/types/local/compilation/component-kernel.d.ts +487 -0
- package/dist-library/types/local/{dependencies.d.ts → compilation/dependencies.d.ts} +4 -3
- package/dist-library/types/local/{diagnostics.d.ts → configuration/diagnostic-messages.d.ts} +193 -65
- package/dist-library/types/local/configuration/diagnostics.d.ts +58 -0
- package/dist-library/types/local/{limits.d.ts → configuration/limits.d.ts} +15 -2
- package/dist-library/types/local/configuration/options-core.d.ts +120 -0
- package/dist-library/types/local/configuration/options.d.ts +17 -0
- package/dist-library/types/local/configuration/portable-options.d.ts +3 -0
- package/dist-library/types/local/configuration/schema-core.d.ts +32 -0
- package/dist-library/types/local/configuration/schema.d.ts +12 -0
- package/dist-library/types/local/contracts/types.d.ts +519 -0
- package/dist-library/types/local/{version.d.ts → contracts/version.d.ts} +1 -1
- package/dist-library/types/local/{computations.d.ts → evaluation/computations.d.ts} +6 -3
- package/dist-library/types/local/{expression.d.ts → evaluation/expression.d.ts} +2 -2
- package/dist-library/types/local/{math-display.d.ts → evaluation/math-display.d.ts} +2 -16
- package/dist-library/types/local/evaluation/math-sample.d.ts +23 -0
- package/dist-library/types/local/evaluation/math.d.ts +73 -0
- package/dist-library/types/local/{validation.d.ts → evaluation/validation.d.ts} +1 -1
- package/dist-library/types/local/html/html-details.d.ts +16 -0
- package/dist-library/types/local/html/html-entities.d.ts +7 -0
- package/dist-library/types/local/html/html-policy.d.ts +43 -0
- package/dist-library/types/local/html/html-recovery.d.ts +16 -0
- package/dist-library/types/local/html/html-table-names.d.ts +9 -0
- package/dist-library/types/local/{html-table.d.ts → html/html-table.d.ts} +2 -6
- package/dist-library/types/local/{html.d.ts → html/html.d.ts} +1 -1
- package/dist-library/types/local/index.d.ts +31 -24
- package/dist-library/types/local/markdown/fast-markdown.d.ts +137 -0
- package/dist-library/types/local/{footnotes.d.ts → markdown/footnotes.d.ts} +1 -1
- package/dist-library/types/local/{heading-anchors.d.ts → markdown/heading-anchors.d.ts} +12 -2
- package/dist-library/types/local/markdown/markdown-blocks.d.ts +55 -0
- package/dist-library/types/local/markdown/markdown-structure.d.ts +3 -0
- package/dist-library/types/local/markdown/plain-paragraphs.d.ts +10 -0
- package/dist-library/types/local/parsing/lexical.d.ts +21 -0
- package/dist-library/types/local/parsing/parse-budget.d.ts +67 -0
- package/dist-library/types/local/parsing/parser-capabilities.d.ts +42 -0
- package/dist-library/types/local/parsing/parser-core.d.ts +65 -0
- package/dist-library/types/local/parsing/parser-standard.d.ts +7 -0
- package/dist-library/types/local/parsing/parser.d.ts +16 -0
- package/dist-library/types/local/parsing/rmd-recovery.d.ts +48 -0
- package/dist-library/types/local/{LocalDocumentView.d.ts → rendering/LocalDocumentView.d.ts} +67 -24
- package/dist-library/types/local/rendering/legacy-component-adapter.d.ts +36 -0
- package/dist-library/types/local/rendering/render-types.d.ts +57 -0
- package/dist-library/types/local/rendering/view-revision.d.ts +75 -0
- package/dist-library/types/local/{retention.d.ts → runtime/retention.d.ts} +1 -1
- package/dist-library/types/local/runtime/runtime.d.ts +34 -0
- package/dist-library/types/local/{state.d.ts → runtime/state.d.ts} +4 -4
- package/dist-library/types/local/session/compiler-cache.d.ts +44 -0
- package/dist-library/types/local/session/incremental.d.ts +48 -0
- package/dist-library/types/local/session/parse-session.d.ts +62 -0
- package/dist-library/types/local/session/row-reuse.d.ts +46 -0
- package/dist-library/types/local/{authoring.d.ts → source/authoring.d.ts} +11 -3
- package/dist-library/types/local/source/node-walk.d.ts +3 -0
- package/dist-library/types/local/source/source-context.d.ts +63 -0
- package/dist-library/types/local/{source-migration.d.ts → source/source-migration.d.ts} +2 -2
- package/dist-library/types/local/{i18n.d.ts → theme/i18n.d.ts} +2 -2
- package/dist-library/types/local/theme/theme-name.d.ts +3 -0
- package/dist-library/types/local/{theme.d.ts → theme/theme.d.ts} +3 -3
- package/dist-library/types/local/transport/compile-patch.d.ts +127 -0
- package/dist-library/types/local/{compiled-data.d.ts → transport/compiled-data.d.ts} +1 -1
- package/dist-library/types/local/transport/flat-compiled-data.d.ts +17 -0
- package/dist-library/types/local/transport/shared-data.d.ts +10 -0
- package/dist-library/types/local/transport/worker.d.ts +265 -0
- package/dist-library/types/local/widgets/visuals.d.ts +25 -0
- package/dist-library/types/presets/default-authoring.d.ts +50 -0
- package/dist-library/types/presets/default-components.d.ts +4 -0
- package/dist-library/types/presets/default-semantics.d.ts +8 -0
- package/dist-library/types/presets/default.d.ts +11 -0
- package/dist-library/types/presets/identity.d.ts +7 -0
- package/dist-library/types/presets/packs.d.ts +4 -0
- package/dist-library/types/react/component-api.d.ts +260 -0
- package/dist-library/types/react/component-primitives.d.ts +21 -0
- package/dist-library/types/react/component-utils.d.ts +125 -0
- package/dist-library/types/react/default-theme.d.ts +6 -0
- package/dist-library/types/react/field-validation.d.ts +11 -0
- package/dist-library/types/react/index.d.ts +17 -5
- package/dist-library/types/react/overflow-text-tooltip.d.ts +6 -0
- package/dist-library/types/react/package.d.ts +69 -0
- package/dist-library/types/react/runtime/common.d.ts +4 -0
- package/dist-library/types/react/runtime/index.d.ts +8 -0
- package/dist-library/types/react/runtime/useComponentState.d.ts +30 -0
- package/dist-library/types/react/runtime/useKeys.d.ts +16 -0
- package/dist-library/types/react/runtime/useSwipe.d.ts +27 -0
- package/dist-library/types/react/runtime/useTicker.d.ts +17 -0
- package/dist-library/types/react/sdk.d.ts +110 -0
- package/dist-library/types/react/server.d.ts +15 -0
- package/dist-library/types/react/tooltip-layer.d.ts +10 -0
- package/dist-library/types/react/use-draft-field.d.ts +17 -0
- package/dist-library/types/runtime-services/browser/index.d.ts +63 -0
- package/dist-library/types/runtime-services/component-state.d.ts +152 -0
- package/dist-library/types/runtime-services/identity.d.ts +41 -0
- package/dist-library/types/runtime-services/index.d.ts +10 -0
- package/dist-library/types/runtime-services/random.d.ts +42 -0
- package/dist-library/types/runtime-services/runtime.d.ts +51 -0
- package/dist-library/types/runtime-services/scheduler.d.ts +44 -0
- package/dist-library/types/sdk/assembly.d.ts +73 -0
- package/dist-library/types/sdk/compat-profile.d.ts +57 -0
- package/dist-library/types/sdk/compiler-config.d.ts +33 -0
- package/dist-library/types/sdk/config-validation.d.ts +33 -0
- package/dist-library/types/sdk/config.d.ts +35 -0
- package/dist-library/types/sdk/hash.d.ts +9 -0
- package/dist-library/types/sdk/index.d.ts +10 -0
- package/dist-library/types/sdk/manifest.d.ts +49 -0
- package/dist-library/types/sdk/pattern.d.ts +11 -0
- package/dist-library/types/sdk/preset-core.d.ts +11 -0
- package/dist-library/types/sdk/preset.d.ts +9 -0
- package/dist-library/types/sdk/props.d.ts +33 -0
- package/dist-library/types/sdk/registry-core.d.ts +16 -0
- package/dist-library/types/sdk/registry.d.ts +18 -0
- package/dist-library/types/sdk/theme.d.ts +73 -0
- package/dist-library/types/sdk/types.d.ts +221 -0
- package/dist-library/types/sdk/version.d.ts +49 -0
- package/dist-library/types/shareable.d.ts +29 -3
- package/dist-library/types/standalone/diagnostics.d.ts +16 -0
- package/dist-library/types/standalone/events.d.ts +4 -0
- package/dist-library/types/standalone/library.d.ts +6 -0
- package/dist-library/types/standalone/payload.d.ts +15 -0
- package/dist-library/types/standalone/prepare.d.ts +21 -0
- package/dist-library/types/standalone/session.d.ts +68 -0
- package/dist-library/types/standalone/version.d.ts +7 -0
- package/dist-library/types/testing/behavior.d.ts +19 -0
- package/dist-library/types/testing/browser.d.ts +126 -0
- package/dist-library/types/testing/cases.d.ts +16 -0
- package/dist-library/types/testing/index.d.ts +13 -0
- package/dist-library/types/testing/manifest.d.ts +10 -0
- package/dist-library/types/testing/react.d.ts +45 -0
- package/dist-library/types/testing/report.d.ts +20 -0
- package/dist-library/types/testing/types.d.ts +125 -0
- package/dist-library/types/testing/values.d.ts +22 -0
- package/dist-library/types/vite/client.d.ts +36 -0
- package/dist-library/types/vite/discovery.d.ts +51 -0
- package/dist-library/types/vite/index.d.ts +31 -0
- package/dist-library/types/vite/registration.d.ts +109 -0
- package/dist-library/types-BFCrMrg0.js +52 -0
- package/dist-library/validation-W-bmny-x.js +2253 -0
- package/dist-library/values-CIt8AjiU.js +134 -0
- package/dist-standalone/reactive-md-standalone.css +1 -1
- package/dist-standalone/reactive-md-standalone.js +591 -95
- package/docs/README-ch.md +90 -0
- package/docs/README.md +87 -81
- package/docs/compatibility/compatibility-ch.md +22 -14
- package/docs/compatibility/compatibility-en.md +22 -14
- package/docs/compatibility/source-versioning-ch.md +15 -12
- package/docs/compatibility/source-versioning-en.md +16 -13
- package/docs/development/component-development-ch.md +51 -195
- package/docs/development/component-development-en.md +51 -195
- package/docs/development/component-development-reference-ch.md +253 -0
- package/docs/development/component-development-reference-en.md +238 -0
- package/docs/development/component-protocol-ch.md +51 -50
- package/docs/development/component-protocol-en.md +52 -49
- package/docs/development/local-module-layout-ch.md +59 -0
- package/docs/development/local-module-layout-en.md +59 -0
- package/docs/development/performance-overview-ch.md +402 -0
- package/docs/development/performance-overview-en.md +402 -0
- package/docs/development/releasing-ch.md +8 -104
- package/docs/development/releasing-en.md +8 -104
- package/docs/guides/local-guide-ch.md +28 -9
- package/docs/guides/local-guide-en.md +31 -12
- package/docs/integration/author-tools-ch.md +4 -2
- package/docs/integration/author-tools-en.md +4 -2
- package/docs/integration/codemirror-ch.md +52 -0
- package/docs/integration/codemirror-en.md +29 -0
- package/docs/integration/compiler-ch.md +47 -0
- package/docs/integration/compiler-en.md +34 -0
- package/docs/integration/directory-discovery-ch.md +53 -0
- package/docs/integration/directory-discovery-en.md +31 -0
- package/docs/integration/editor-ch.md +48 -21
- package/docs/integration/editor-en.md +48 -21
- package/docs/integration/extension-sdk-ch.md +392 -0
- package/docs/integration/extension-sdk-en.md +377 -0
- package/docs/integration/local-integration-ch.md +63 -9
- package/docs/integration/local-integration-en.md +89 -13
- package/docs/integration/repository-split-ch.md +40 -0
- package/docs/integration/repository-split-en.md +23 -0
- package/docs/integration/shareable-export-ch.md +46 -2
- package/docs/integration/shareable-export-en.md +46 -2
- package/docs/reference/computations-formatting-ch.md +4 -2
- package/docs/reference/computations-formatting-en.md +4 -2
- package/docs/reference/constraints-collections-ch.md +21 -1
- package/docs/reference/constraints-collections-en.md +21 -1
- package/docs/reference/diagnostics-counting-ch.md +1 -1
- package/docs/reference/diagnostics-counting-en.md +1 -1
- package/docs/reference/html-compatibility-ch.md +4 -0
- package/docs/reference/html-compatibility-en.md +4 -0
- package/docs/reference/local-components-v2-ch.md +2 -0
- package/docs/reference/local-components-v2-en.md +2 -0
- package/docs/reference/local-interaction-syntax-ch.md +51 -15
- package/docs/reference/local-interaction-syntax-en.md +58 -14
- package/docs/reference/theme-protocol-ch.md +79 -7
- package/docs/reference/theme-protocol-en.md +79 -7
- package/docs/reference/tolerance-ch.md +64 -0
- package/docs/reference/tolerance-en.md +57 -0
- package/docs/releases/release-0.4.0-ch.md +2 -0
- package/docs/releases/release-0.4.0-en.md +2 -0
- package/docs/releases/release-0.4.1-ch.md +2 -0
- package/docs/releases/release-0.4.1-en.md +2 -0
- package/docs/releases/release-0.5.0-ch.md +2 -0
- package/docs/releases/release-0.5.0-en.md +2 -0
- package/docs/releases/release-0.5.1-ch.md +2 -0
- package/docs/releases/release-0.5.1-en.md +2 -0
- package/docs/releases/release-0.5.2-ch.md +2 -0
- package/docs/releases/release-0.5.2-en.md +2 -0
- package/docs/releases/release-0.5.3-ch.md +2 -0
- package/docs/releases/release-0.5.3-en.md +2 -0
- package/docs/releases/release-0.6.0-ch.md +2 -0
- package/docs/releases/release-0.6.0-en.md +2 -0
- package/docs/releases/release-0.6.1-ch.md +2 -0
- package/docs/releases/release-0.6.1-en.md +2 -0
- package/docs/releases/release-0.7.0-ch.md +86 -0
- package/docs/releases/release-0.7.0-en.md +86 -0
- package/docs/releases/release-0.8.0-ch.md +126 -0
- package/docs/releases/release-0.8.0-en.md +126 -0
- package/examples/component-package/LICENSE +21 -0
- package/examples/component-package/NOTICES.md +12 -0
- package/examples/component-package/README-ch.md +101 -0
- package/examples/component-package/README.md +133 -0
- package/examples/component-package/package.json +35 -0
- package/examples/component-package/sample/document.reactive.md +14 -0
- package/examples/component-package/scripts/build-export.mjs +44 -0
- package/examples/component-package/scripts/build.mjs +130 -0
- package/examples/component-package/scripts/verify.mjs +257 -0
- package/examples/component-package/src/assets/notice.svg +4 -0
- package/examples/component-package/src/component.css +40 -0
- package/examples/component-package/src/components.tsx +105 -0
- package/examples/component-package/src/harness.tsx +34 -0
- package/examples/component-package/src/manifests.ts +71 -0
- package/examples/component-package/src/node-entry.ts +18 -0
- package/examples/component-package/src/sample.ts +4 -0
- package/examples/component-package/src/theme.css +44 -0
- package/examples/component-package/src/theme.ts +22 -0
- package/examples/component-package/tsconfig.json +15 -0
- package/examples/conformance/README-ch.md +55 -0
- package/examples/conformance/README.md +2 -0
- package/examples/conformance/local-draft-3.json +296 -0
- package/examples/game-2048-package/LICENSE +21 -0
- package/examples/game-2048-package/NOTICES.md +11 -0
- package/examples/game-2048-package/README-ch.md +97 -0
- package/examples/game-2048-package/README.md +102 -0
- package/examples/game-2048-package/package.json +35 -0
- package/examples/game-2048-package/sample/document.reactive.md +17 -0
- package/examples/game-2048-package/scripts/build-export.mjs +44 -0
- package/examples/game-2048-package/scripts/build.mjs +130 -0
- package/examples/game-2048-package/scripts/verify.mjs +180 -0
- package/examples/game-2048-package/src/component.css +161 -0
- package/examples/game-2048-package/src/components.tsx +326 -0
- package/examples/game-2048-package/src/game-engine.ts +228 -0
- package/examples/game-2048-package/src/harness.tsx +34 -0
- package/examples/game-2048-package/src/manifest.ts +85 -0
- package/examples/game-2048-package/src/node-entry.ts +30 -0
- package/examples/game-2048-package/src/sample.ts +4 -0
- package/examples/game-2048-package/tsconfig.json +15 -0
- package/examples/integration/README-ch.md +63 -0
- package/examples/integration/README.md +17 -1
- package/examples/integration/extension-sdk/README-ch.md +24 -0
- package/examples/integration/extension-sdk/README.md +24 -0
- package/examples/integration/extension-sdk/advanced-standalone.ts +6 -0
- package/examples/integration/extension-sdk/advanced.tsx +101 -0
- package/examples/integration/extension-sdk/env.d.ts +2 -0
- package/examples/integration/extension-sdk/extensions.tsx +97 -0
- package/examples/integration/extension-sdk/index.html +3 -0
- package/examples/integration/extension-sdk/main.tsx +10 -0
- package/examples/integration/extension-sdk/package.json +6 -0
- package/examples/integration/extension-sdk/standalone.ts +7 -0
- package/examples/integration/extension-sdk/tsconfig.json +8 -0
- package/examples/integration/react-comprehensive/index.html +12 -0
- package/examples/integration/react-comprehensive/main.jsx +123 -0
- package/examples/integration/react-comprehensive/package.json +18 -0
- package/examples/local/README-ch.md +76 -0
- package/examples/local/README.md +4 -2
- package/examples/local/scenarios/blog-zh.reactive.md +71 -0
- package/examples/local/scenarios/blog.reactive.md +71 -0
- package/examples/local/scenarios/classroom-zh.reactive.md +97 -0
- package/examples/local/scenarios/classroom.reactive.md +97 -0
- package/examples/local/scenarios/proposal-zh.reactive.md +79 -0
- package/examples/local/scenarios/proposal.reactive.md +79 -0
- package/examples/local/scenarios/survey-zh.reactive.md +74 -0
- package/examples/local/scenarios/survey.reactive.md +74 -0
- package/examples/local/showcase/README-ch.md +22 -0
- package/examples/local/showcase/README.md +9 -3
- package/examples/local/showcase/features.reactive.md +637 -0
- package/examples/local/showcase/zh/features.reactive.md +637 -0
- package/examples/sci-fi-theme/README-ch.md +131 -0
- package/examples/sci-fi-theme/README.md +146 -0
- package/examples/sci-fi-theme/demo/demo.css +532 -0
- package/examples/sci-fi-theme/demo/document.reactive.md +185 -0
- package/examples/sci-fi-theme/demo/index.html +13 -0
- package/examples/sci-fi-theme/demo/main.tsx +180 -0
- package/examples/sci-fi-theme/docs/design-system-ch.md +245 -0
- package/examples/sci-fi-theme/docs/design-system.md +474 -0
- package/examples/sci-fi-theme/package.json +27 -0
- package/examples/sci-fi-theme/scripts/screenshot.mjs +98 -0
- package/examples/sci-fi-theme/src/components.css +1460 -0
- package/examples/sci-fi-theme/src/index.ts +6 -0
- package/examples/sci-fi-theme/src/sci-fi.css +5 -0
- package/examples/sci-fi-theme/src/theme.ts +37 -0
- package/examples/sci-fi-theme/src/tokens.css +408 -0
- package/examples/sci-fi-theme/tsconfig.json +20 -0
- package/examples/sci-fi-theme/vite.config.ts +24 -0
- package/examples/tetris-package/LICENSE +21 -0
- package/examples/tetris-package/NOTICES.md +11 -0
- package/examples/tetris-package/README-ch.md +91 -0
- package/examples/tetris-package/README.md +95 -0
- package/examples/tetris-package/package.json +35 -0
- package/examples/tetris-package/sample/document.reactive.md +16 -0
- package/examples/tetris-package/scripts/build-export.mjs +44 -0
- package/examples/tetris-package/scripts/build.mjs +130 -0
- package/examples/tetris-package/scripts/verify.mjs +173 -0
- package/examples/tetris-package/src/component.css +145 -0
- package/examples/tetris-package/src/components.tsx +334 -0
- package/examples/tetris-package/src/harness.tsx +34 -0
- package/examples/tetris-package/src/manifests.ts +93 -0
- package/examples/tetris-package/src/node-entry.ts +16 -0
- package/examples/tetris-package/src/sample.ts +4 -0
- package/examples/tetris-package/src/tetris-engine.ts +325 -0
- package/examples/tetris-package/tsconfig.json +15 -0
- package/package.json +98 -44
- package/dist-library/compiler-Cm3ppMxG.js +0 -46044
- package/dist-library/react-Bh7_oxZp.js +0 -59655
- package/dist-library/reactive-md-editor.css +0 -2
- package/dist-library/reactive-md-editor.js +0 -3853
- package/dist-library/runtime-DlFYQ4s_.js +0 -498
- package/dist-library/types/editor/ReactiveMarkdownEditor.d.ts +0 -7
- package/dist-library/types/editor/editor-toolbar.d.ts +0 -24
- package/dist-library/types/editor/editor-view-bar.d.ts +0 -11
- package/dist-library/types/editor/extended-native-components.d.ts +0 -58
- package/dist-library/types/editor/index.d.ts +0 -9
- package/dist-library/types/editor/locale.d.ts +0 -13
- package/dist-library/types/editor/source-authoring.d.ts +0 -59
- package/dist-library/types/editor/types.d.ts +0 -48
- package/dist-library/types/editor/use-gutter-metrics.d.ts +0 -5
- package/dist-library/types/editor/use-source-history.d.ts +0 -16
- package/dist-library/types/local/compiler.d.ts +0 -4
- package/dist-library/types/local/math.d.ts +0 -48
- package/dist-library/types/local/options.d.ts +0 -36
- package/dist-library/types/local/parser.d.ts +0 -13
- package/dist-library/types/local/render-types.d.ts +0 -27
- package/dist-library/types/local/runtime.d.ts +0 -2
- package/dist-library/types/local/schema.d.ts +0 -77
- package/dist-library/types/local/types.d.ts +0 -263
- package/dist-library/types/local/visuals.d.ts +0 -12
- package/dist-library/types/local/worker.d.ts +0 -98
- package/docs/development/performance-ch.md +0 -76
- package/docs/development/performance-en.md +0 -76
- /package/dist-library/types/{editor → authoring}/command-types.d.ts +0 -0
- /package/dist-library/types/{editor → authoring}/editor-commands.d.ts +0 -0
- /package/dist-library/types/local/{locale.d.ts → contracts/locale.d.ts} +0 -0
- /package/dist-library/types/local/{collection-functions.d.ts → evaluation/collection-functions.d.ts} +0 -0
- /package/dist-library/types/local/{data-functions.d.ts → evaluation/data-functions.d.ts} +0 -0
- /package/dist-library/types/local/{dates.d.ts → evaluation/dates.d.ts} +0 -0
- /package/dist-library/types/local/{formatting.d.ts → evaluation/formatting.d.ts} +0 -0
- /package/dist-library/types/local/{html-names.d.ts → html/html-names.d.ts} +0 -0
- /package/dist-library/types/local/{text-length.d.ts → source/text-length.d.ts} +0 -0
- /package/dist-library/types/local/{colors.d.ts → theme/colors.d.ts} +0 -0
- /package/dist-library/types/local/{code-block.d.ts → widgets/code-block.d.ts} +0 -0
- /package/dist-library/types/local/{code-languages.d.ts → widgets/code-languages.d.ts} +0 -0
- /package/dist-library/types/local/{diagram-layout.d.ts → widgets/diagram-layout.d.ts} +0 -0
- /package/dist-library/types/local/{image-view.d.ts → widgets/image-view.d.ts} +0 -0
- /package/dist-library/types/local/{math-view.d.ts → widgets/math-view.d.ts} +0 -0
- /package/dist-library/types/local/{table-surface.d.ts → widgets/table-surface.d.ts} +0 -0
|
@@ -0,0 +1,638 @@
|
|
|
1
|
+
import { a as e, i as t } from "./props-DGlBk0e5.js";
|
|
2
|
+
import { D as n, j as r, w as i } from "./identity-MYJXKSkB.js";
|
|
3
|
+
import { n as a, u as o } from "./registry-B9Jc3FVe.js";
|
|
4
|
+
import { t as s } from "./compiler--ea2CKQF.js";
|
|
5
|
+
import { t as c } from "./runtime-C-sbfpOX.js";
|
|
6
|
+
import { A as l, C as u, D as d, E as f, O as p, S as m, T as h, _ as g, a as _, b as v, c as y, d as b, f as x, h as S, i as C, k as w, m as T, n as E, o as D, p as O, r as k, t as A, u as j, v as M, w as ee, x as te, y as N } from "./values-CIt8AjiU.js";
|
|
7
|
+
// src/testing/behavior.ts
|
|
8
|
+
var P = /* @__PURE__ */ new Set([
|
|
9
|
+
"protocol",
|
|
10
|
+
"component",
|
|
11
|
+
"source",
|
|
12
|
+
"binding",
|
|
13
|
+
"writes",
|
|
14
|
+
"reset"
|
|
15
|
+
]), F = /* @__PURE__ */ new Set([
|
|
16
|
+
"id",
|
|
17
|
+
"slot",
|
|
18
|
+
"value",
|
|
19
|
+
"values",
|
|
20
|
+
"accepted",
|
|
21
|
+
"expect"
|
|
22
|
+
]), I = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/, L = /^[A-Za-z_][A-Za-z0-9_-]*$/;
|
|
23
|
+
function ne(e, t, n) {
|
|
24
|
+
let r = `spec.writes[${t}]`, i = j(e, r);
|
|
25
|
+
A(i, F, r);
|
|
26
|
+
let a = k(i.id, `${r}.id`, n, `write.${t}`), o = E(i.accepted, `${r}.accepted`), s = i.value !== void 0, c = i.values !== void 0;
|
|
27
|
+
if (s === c) throw TypeError(`${r} must declare exactly one of "value" or "values".`);
|
|
28
|
+
let l;
|
|
29
|
+
if (i.slot !== void 0) {
|
|
30
|
+
if (c) throw TypeError(`${r}.slot cannot be combined with "values".`);
|
|
31
|
+
if (l = y(i.slot, `${r}.slot`, 128), !L.test(l)) throw TypeError(`${r}.slot is not a declared slot name.`);
|
|
32
|
+
}
|
|
33
|
+
let u = s ? C(i.value, `${r}.value`) : void 0, d = c ? _(i.values, `${r}.values`, 16) : void 0, f = i.expect === void 0 ? void 0 : _(i.expect, `${r}.expect`, 16);
|
|
34
|
+
return Object.freeze({
|
|
35
|
+
id: a,
|
|
36
|
+
accepted: o,
|
|
37
|
+
...l === void 0 ? {} : { slot: l },
|
|
38
|
+
...u === void 0 ? {} : { value: u },
|
|
39
|
+
...d === void 0 ? {} : { values: d },
|
|
40
|
+
...f === void 0 ? {} : { expect: f }
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
function R(e) {
|
|
44
|
+
let t = j(e, "spec");
|
|
45
|
+
if (A(t, P, "spec"), t.protocol !== "reactive-md-behavior-spec/v1") throw TypeError(`spec.protocol must be "${g}".`);
|
|
46
|
+
let n = y(t.component, "spec.component", 128);
|
|
47
|
+
if (!I.test(n)) throw TypeError("spec.component must be a lowercase kebab-case tag name.");
|
|
48
|
+
let r = y(t.source, "spec.source", p);
|
|
49
|
+
if (r.trim() === "") throw TypeError("spec.source must not be empty.");
|
|
50
|
+
let i;
|
|
51
|
+
if (t.binding !== void 0 && (i = y(t.binding, "spec.binding", 128), !L.test(i))) throw TypeError("spec.binding must be a public parameter name.");
|
|
52
|
+
let a;
|
|
53
|
+
if (t.writes !== void 0) {
|
|
54
|
+
if (!Array.isArray(t.writes)) throw TypeError("spec.writes must be an array.");
|
|
55
|
+
if (t.writes.length > 64) throw TypeError("spec.writes accepts at most 64 entries.");
|
|
56
|
+
let e = /* @__PURE__ */ new Set();
|
|
57
|
+
a = Object.freeze(t.writes.map((t, n) => ne(t, n, e)));
|
|
58
|
+
}
|
|
59
|
+
let o = t.reset === void 0 ? void 0 : E(t.reset, "spec.reset");
|
|
60
|
+
return Object.freeze({
|
|
61
|
+
protocol: g,
|
|
62
|
+
component: n,
|
|
63
|
+
source: r,
|
|
64
|
+
...i === void 0 ? {} : { binding: i },
|
|
65
|
+
...a === void 0 ? {} : { writes: a },
|
|
66
|
+
...o === void 0 ? {} : { reset: o }
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
function re(e, t) {
|
|
70
|
+
let n = [], r = [...e];
|
|
71
|
+
for (; r.length > 0;) {
|
|
72
|
+
let e = r.pop();
|
|
73
|
+
if (e && (e.type !== "text" && e.name === t && n.push(e), Array.isArray(e.children))) for (let t of e.children) r.push(t);
|
|
74
|
+
}
|
|
75
|
+
return n;
|
|
76
|
+
}
|
|
77
|
+
function z(e) {
|
|
78
|
+
return Array.isArray(e) ? e.slice() : e;
|
|
79
|
+
}
|
|
80
|
+
function ie(e) {
|
|
81
|
+
return Array.isArray(e) ? Object.freeze(e.slice()) : e ?? null;
|
|
82
|
+
}
|
|
83
|
+
function B(e, t) {
|
|
84
|
+
let n = [];
|
|
85
|
+
for (let [r, i] of Object.entries(e.bindings ?? {})) {
|
|
86
|
+
if (i.requiresAttributes?.some((e) => !Object.hasOwn(t.attrs ?? {}, e))) continue;
|
|
87
|
+
let e = t.attrs?.[i.bind], a = typeof e == "string" && e !== "";
|
|
88
|
+
n.push({
|
|
89
|
+
slot: r,
|
|
90
|
+
parameter: a ? e : r,
|
|
91
|
+
public: a,
|
|
92
|
+
node: t
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
return n;
|
|
96
|
+
}
|
|
97
|
+
function V(e, t) {
|
|
98
|
+
let n = {};
|
|
99
|
+
for (let r of t) n[r.parameter] = ie(H(e, r));
|
|
100
|
+
return n;
|
|
101
|
+
}
|
|
102
|
+
function H(e, t) {
|
|
103
|
+
return t.public ? e.getParameter(t.parameter) : e.get(t.node, t.slot === "value" ? void 0 : t.slot);
|
|
104
|
+
}
|
|
105
|
+
function U(e) {
|
|
106
|
+
let t = {};
|
|
107
|
+
for (let [n, r] of Object.entries(e)) t[`value.${n}`] = r;
|
|
108
|
+
return t;
|
|
109
|
+
}
|
|
110
|
+
function W(e, t, n, r, i) {
|
|
111
|
+
let a = n.id ?? `write.${r}`, o = e.snapshot().revision, s = V(e, [...i.values()]), c = [], l = [], u = [];
|
|
112
|
+
try {
|
|
113
|
+
if (n.values !== void 0) {
|
|
114
|
+
let r = {};
|
|
115
|
+
for (let [e, t] of Object.entries(n.values)) {
|
|
116
|
+
if (!i.has(e)) {
|
|
117
|
+
c.push({
|
|
118
|
+
code: "testing.spec",
|
|
119
|
+
message: `Spec writes unknown slot "${e}".`
|
|
120
|
+
});
|
|
121
|
+
continue;
|
|
122
|
+
}
|
|
123
|
+
let n = z(t);
|
|
124
|
+
Array.isArray(n) && l.push({
|
|
125
|
+
parameter: i.get(e).parameter,
|
|
126
|
+
value: n
|
|
127
|
+
}), r[e] = n;
|
|
128
|
+
}
|
|
129
|
+
u = c.length > 0 ? c : e.setMany(t, r);
|
|
130
|
+
} else {
|
|
131
|
+
let r = n.slot ?? "value";
|
|
132
|
+
if (!i.has(r)) c.push({
|
|
133
|
+
code: "testing.spec",
|
|
134
|
+
message: `Spec writes unknown slot "${r}".`
|
|
135
|
+
}), u = c;
|
|
136
|
+
else {
|
|
137
|
+
let a = z(n.value ?? null);
|
|
138
|
+
Array.isArray(a) && l.push({
|
|
139
|
+
parameter: i.get(r).parameter,
|
|
140
|
+
value: a
|
|
141
|
+
}), u = e.set(t, a, r === "value" ? void 0 : r);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
} catch (e) {
|
|
145
|
+
c.push({
|
|
146
|
+
code: "testing.behavior",
|
|
147
|
+
message: D(e)
|
|
148
|
+
}), u = c;
|
|
149
|
+
}
|
|
150
|
+
let d = u.length === 0, f = e.snapshot().revision, p = V(e, [...i.values()]), m = !b(s, p), h = [];
|
|
151
|
+
if (d !== n.accepted && h.push(`Expected the write to be ${n.accepted ? "accepted" : "rejected"}, but it was ${d ? "accepted" : "rejected"}.`), d) {
|
|
152
|
+
m && f <= o && h.push("An accepted change did not advance the runtime revision."), !m && f !== o && h.push("A no-op accepted write advanced the runtime revision.");
|
|
153
|
+
for (let [e, t] of Object.entries(n.expect ?? {})) x(p[e], t) || h.push(`Parameter "${e}" is ${JSON.stringify(p[e])}, expected ${JSON.stringify(t)}.`);
|
|
154
|
+
}
|
|
155
|
+
for (let [e, t] of Object.entries(n.expect ?? {})) d || !x(s[e], t) && !x(p[e], t) && h.push(`Parameter "${e}" did not retain the expected value ${JSON.stringify(t)}.`);
|
|
156
|
+
let g = [];
|
|
157
|
+
if (g.push(h.length === 0 ? T(`behavior.write.${a}`, "behavior", { observed: {
|
|
158
|
+
accepted: d,
|
|
159
|
+
changed: m,
|
|
160
|
+
revision: f,
|
|
161
|
+
...U(p)
|
|
162
|
+
} }) : O(`behavior.write.${a}`, "behavior", h.join(" "), u)), !d) {
|
|
163
|
+
let e = [];
|
|
164
|
+
f !== o && e.push(`Revision changed from ${o} to ${f}.`), b(s, p) || e.push("A rejected write changed public parameters."), g.push(e.length === 0 ? T(`behavior.rollback.${a}`, "behavior", { observed: { revision: f } }) : O(`behavior.rollback.${a}`, "behavior", e.join(" ")));
|
|
165
|
+
}
|
|
166
|
+
if (d && l.length > 0) {
|
|
167
|
+
let t = [];
|
|
168
|
+
for (let n of l) {
|
|
169
|
+
Array.isArray(n.value) && n.value.length > 0 && (n.value[0] = typeof n.value[0] == "number" ? 999999 : "__mutated__");
|
|
170
|
+
let r = V(e, [...i.values()]);
|
|
171
|
+
x(r[n.parameter], p[n.parameter]) || t.push(`Mutating the written array changed stored parameter "${n.parameter}".`);
|
|
172
|
+
let a = H(e, [...i.values()].find((e) => e.parameter === n.parameter));
|
|
173
|
+
if (Array.isArray(a) && a.length > 0) {
|
|
174
|
+
a[0] = typeof a[0] == "number" ? -999999 : "__read_mutated__";
|
|
175
|
+
let r = V(e, [...i.values()]);
|
|
176
|
+
x(r[n.parameter], p[n.parameter]) || t.push(`Mutating a returned array changed stored parameter "${n.parameter}".`);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
g.push(t.length === 0 ? T(`behavior.copy.${a}`, "behavior") : O(`behavior.copy.${a}`, "behavior", t.join(" ")));
|
|
180
|
+
}
|
|
181
|
+
return g;
|
|
182
|
+
}
|
|
183
|
+
function G(e, t) {
|
|
184
|
+
let n = R(e), r = o(t), i = a(r).find((e) => e.name === n.component), l = [];
|
|
185
|
+
if (!i) return l.push(O("behavior.component", "behavior", `Component <${n.component}> is not installed in this configuration.`)), Object.freeze({
|
|
186
|
+
protocol: N,
|
|
187
|
+
suite: "behavior",
|
|
188
|
+
configKey: r.key,
|
|
189
|
+
component: null,
|
|
190
|
+
cases: Object.freeze(l)
|
|
191
|
+
});
|
|
192
|
+
let u = Object.freeze({
|
|
193
|
+
id: i.id,
|
|
194
|
+
name: i.name,
|
|
195
|
+
version: i.version
|
|
196
|
+
}), d = s(n.source, { config: r });
|
|
197
|
+
if (!d.ok) return l.push(O("behavior.compile", "behavior", "The compliance source did not compile.", d.diagnostics)), l.push(S("behavior.execute", "behavior", "Skipped because the source did not compile.")), Object.freeze({
|
|
198
|
+
protocol: N,
|
|
199
|
+
suite: "behavior",
|
|
200
|
+
configKey: r.key,
|
|
201
|
+
component: u,
|
|
202
|
+
cases: Object.freeze(l)
|
|
203
|
+
});
|
|
204
|
+
l.push(T("behavior.compile", "behavior"));
|
|
205
|
+
let f = re(d.document.nodes, n.component);
|
|
206
|
+
if (f.length !== 1) return l.push(O("behavior.node", "behavior", `Expected exactly one <${n.component}> node, found ${f.length}.`)), Object.freeze({
|
|
207
|
+
protocol: N,
|
|
208
|
+
suite: "behavior",
|
|
209
|
+
configKey: r.key,
|
|
210
|
+
component: u,
|
|
211
|
+
cases: Object.freeze(l)
|
|
212
|
+
});
|
|
213
|
+
let p = f[0];
|
|
214
|
+
l.push(T("behavior.node", "behavior"));
|
|
215
|
+
let m = B(i, p);
|
|
216
|
+
if (!(Object.keys(i.bindings ?? {}).length > 0)) return l.push(S("behavior.bindings", "behavior", "The manifest declares no bindings.")), (n.writes ?? []).length > 0 && l.push(O("behavior.writes", "behavior", "Write cases were supplied for a component without bindings.")), l.push(S("behavior.interactive", "behavior", "No bindings: interactive behavior must be executed by the browser suite.", ["interactive"])), Object.freeze({
|
|
217
|
+
protocol: N,
|
|
218
|
+
suite: "behavior",
|
|
219
|
+
configKey: r.key,
|
|
220
|
+
component: u,
|
|
221
|
+
cases: Object.freeze(l)
|
|
222
|
+
});
|
|
223
|
+
if (m.length === 0) return l.push(O("behavior.bindings", "behavior", "The source does not bind any declared slot.")), Object.freeze({
|
|
224
|
+
protocol: N,
|
|
225
|
+
suite: "behavior",
|
|
226
|
+
configKey: r.key,
|
|
227
|
+
component: u,
|
|
228
|
+
cases: Object.freeze(l)
|
|
229
|
+
});
|
|
230
|
+
if (n.binding !== void 0 && !m.some((e) => e.parameter === n.binding)) return l.push(O("behavior.parameter", "behavior", `The source does not bind parameter "${n.binding}".`)), Object.freeze({
|
|
231
|
+
protocol: N,
|
|
232
|
+
suite: "behavior",
|
|
233
|
+
configKey: r.key,
|
|
234
|
+
component: u,
|
|
235
|
+
cases: Object.freeze(l)
|
|
236
|
+
});
|
|
237
|
+
l.push(T("behavior.bindings", "behavior", { observed: Object.fromEntries(m.map((e) => [e.slot, e.parameter])) }));
|
|
238
|
+
let h = new Map(m.map((e) => [e.slot, e])), g = c(d.document);
|
|
239
|
+
try {
|
|
240
|
+
let e = V(g, m), t = g.snapshot().revision;
|
|
241
|
+
l.push(T("behavior.initial", "behavior", { observed: {
|
|
242
|
+
revision: t,
|
|
243
|
+
...U(e)
|
|
244
|
+
} }));
|
|
245
|
+
let r = n.writes ?? [];
|
|
246
|
+
r.length === 0 && l.push(S("behavior.writes", "behavior", "No write cases were supplied."));
|
|
247
|
+
let i = 0, a = 0;
|
|
248
|
+
for (let e = 0; e < r.length; e += 1) {
|
|
249
|
+
let t = r[e], n = V(g, m), o = W(g, p, t, e, h);
|
|
250
|
+
l.push(...o);
|
|
251
|
+
let s = V(g, m);
|
|
252
|
+
t.accepted && !b(n, s) && (i += 1), t.accepted || (a += 1);
|
|
253
|
+
}
|
|
254
|
+
let o = n.reset !== !1;
|
|
255
|
+
if (o) {
|
|
256
|
+
let t = g.resetToken(p), n = g.snapshot().revision;
|
|
257
|
+
g.reset(p);
|
|
258
|
+
let r = g.resetToken(p), i = g.snapshot().revision, a = V(g, m), o = [];
|
|
259
|
+
b(e, a) || o.push("Reset did not restore the authored initial values."), r > t || o.push("Reset did not advance the reset token."), i > n || o.push("Reset did not advance the runtime revision."), l.push(o.length === 0 ? T("behavior.reset", "behavior", { observed: {
|
|
260
|
+
revision: i,
|
|
261
|
+
token: r,
|
|
262
|
+
...U(a)
|
|
263
|
+
} }) : O("behavior.reset", "behavior", o.join(" ")));
|
|
264
|
+
} else l.push(S("behavior.reset", "behavior", "Reset checks were disabled by the spec."));
|
|
265
|
+
i > 0 && a > 0 && o ? l.push(T("behavior.interactive", "behavior", { capabilities: ["interactive"] })) : l.push(S("behavior.interactive", "behavior", "Interactive evidence requires at least one accepted change, one rejected write and an executed reset.", ["interactive"]));
|
|
266
|
+
} finally {
|
|
267
|
+
g.dispose();
|
|
268
|
+
}
|
|
269
|
+
return Object.freeze({
|
|
270
|
+
protocol: N,
|
|
271
|
+
suite: "behavior",
|
|
272
|
+
configKey: r.key,
|
|
273
|
+
component: u,
|
|
274
|
+
cases: Object.freeze(l)
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
Object.freeze({
|
|
278
|
+
maxWrites: 64,
|
|
279
|
+
maxSlots: 16,
|
|
280
|
+
maxStringLength: w
|
|
281
|
+
});
|
|
282
|
+
// src/testing/manifest.ts
|
|
283
|
+
var K = {
|
|
284
|
+
evaluate() {
|
|
285
|
+
throw Error("Expression evaluation is not available in manifest compliance.");
|
|
286
|
+
},
|
|
287
|
+
text(e) {
|
|
288
|
+
return e;
|
|
289
|
+
}
|
|
290
|
+
};
|
|
291
|
+
function q(e) {
|
|
292
|
+
return Object.freeze({
|
|
293
|
+
id: e.id,
|
|
294
|
+
name: e.name,
|
|
295
|
+
version: e.version
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
function J(e, t, n) {
|
|
299
|
+
try {
|
|
300
|
+
t();
|
|
301
|
+
} catch (t) {
|
|
302
|
+
let r = D(t);
|
|
303
|
+
return n !== void 0 && !r.includes(n) ? O(e, "manifest", `Rejected with an unexpected message: ${r}`) : T(e, "manifest");
|
|
304
|
+
}
|
|
305
|
+
return O(e, "manifest", "Invalid manifest input was accepted.");
|
|
306
|
+
}
|
|
307
|
+
function Y(e, t) {
|
|
308
|
+
try {
|
|
309
|
+
return t(), T(e, "manifest");
|
|
310
|
+
} catch (t) {
|
|
311
|
+
return O(e, "manifest", `Expected acceptance, got: ${D(t)}`);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
function ae(e) {
|
|
315
|
+
let t;
|
|
316
|
+
try {
|
|
317
|
+
t = new RegExp(e);
|
|
318
|
+
} catch {
|
|
319
|
+
return null;
|
|
320
|
+
}
|
|
321
|
+
for (let e of [
|
|
322
|
+
"",
|
|
323
|
+
"x",
|
|
324
|
+
"!",
|
|
325
|
+
"\0"
|
|
326
|
+
]) if (!t.test(e)) return e;
|
|
327
|
+
return null;
|
|
328
|
+
}
|
|
329
|
+
function oe(e) {
|
|
330
|
+
switch (e.kind) {
|
|
331
|
+
case "number": return "not-a-number";
|
|
332
|
+
case "boolean": return "maybe";
|
|
333
|
+
case "enum": return "__invalid__";
|
|
334
|
+
case "string": return e.color === !0 ? "#zzz" : e.pattern === void 0 ? void 0 : ae(e.pattern) ?? void 0;
|
|
335
|
+
default: return;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
function se(e) {
|
|
339
|
+
switch (e.kind) {
|
|
340
|
+
case "number": return "not-a-number";
|
|
341
|
+
case "boolean": return "yes";
|
|
342
|
+
case "enum": return "__invalid__";
|
|
343
|
+
case "string": return 42;
|
|
344
|
+
default: return 42;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
function X(e) {
|
|
348
|
+
return JSON.parse(JSON.stringify(e));
|
|
349
|
+
}
|
|
350
|
+
function ce(e, t, n) {
|
|
351
|
+
return Object.defineProperty(e, t, {
|
|
352
|
+
value: n,
|
|
353
|
+
enumerable: !0,
|
|
354
|
+
configurable: !0,
|
|
355
|
+
writable: !0
|
|
356
|
+
}), e;
|
|
357
|
+
}
|
|
358
|
+
function le(a) {
|
|
359
|
+
let o;
|
|
360
|
+
try {
|
|
361
|
+
o = r(a);
|
|
362
|
+
} catch (e) {
|
|
363
|
+
let t = D(e);
|
|
364
|
+
return Object.freeze({
|
|
365
|
+
protocol: N,
|
|
366
|
+
suite: "manifest",
|
|
367
|
+
configKey: "invalid",
|
|
368
|
+
component: null,
|
|
369
|
+
cases: Object.freeze([O("manifest.normalize", "manifest", t, [{
|
|
370
|
+
code: "testing.manifest",
|
|
371
|
+
message: t
|
|
372
|
+
}])])
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
let s = [], c = X(o), l = n(o);
|
|
376
|
+
s.push(Y("manifest.normalize", () => {
|
|
377
|
+
let e = r(c);
|
|
378
|
+
if (n(e) !== l) throw Error("A plain JSON round trip changed the semantic digest.");
|
|
379
|
+
}));
|
|
380
|
+
let u = X(o), d = u.props;
|
|
381
|
+
if (d && typeof d == "object" && !Array.isArray(d)) {
|
|
382
|
+
let e = {};
|
|
383
|
+
for (let t of Object.keys(d).reverse()) e[t] = d[t];
|
|
384
|
+
u.props = e;
|
|
385
|
+
}
|
|
386
|
+
s.push(Y("manifest.key-order", () => {
|
|
387
|
+
let e = r(u);
|
|
388
|
+
if (n(e) !== l) throw Error("Reordering props changed the semantic digest.");
|
|
389
|
+
}));
|
|
390
|
+
let f = Object.keys(o.props).sort();
|
|
391
|
+
for (let e of f) {
|
|
392
|
+
let n = o.props[e], r = e.replace(/[^A-Za-z0-9._-]/g, "_");
|
|
393
|
+
if (n.default !== void 0) {
|
|
394
|
+
s.push((() => {
|
|
395
|
+
try {
|
|
396
|
+
let i = t(o, e, void 0, K), a = C(n.default, `props.${e}.default`);
|
|
397
|
+
return x(i, a) ? T(`manifest.default.${r}`, "manifest") : O(`manifest.default.${r}`, "manifest", `Declared default ${JSON.stringify(a)} resolved as ${JSON.stringify(i)}.`);
|
|
398
|
+
} catch (e) {
|
|
399
|
+
return O(`manifest.default.${r}`, "manifest", D(e));
|
|
400
|
+
}
|
|
401
|
+
})());
|
|
402
|
+
let i = oe(n);
|
|
403
|
+
i !== void 0 && s.push(J(`manifest.invalid-value.${r}`, () => t(o, e, i, K)));
|
|
404
|
+
}
|
|
405
|
+
n.required === !0 && n.default === void 0 && s.push(J(`manifest.required.${r}`, () => t(o, e, void 0, K)));
|
|
406
|
+
}
|
|
407
|
+
s.push(J("manifest.unknown-attribute", () => e(o, { __undeclared: "x" }, K))), s.push(J("manifest.unknown-field", () => {
|
|
408
|
+
let e = X(o);
|
|
409
|
+
e.__undeclared = !0, r(e);
|
|
410
|
+
}, "unknown field")), s.push(J("manifest.dangerous-key", () => r(ce(X(o), "__proto__", 1)), "not allowed"));
|
|
411
|
+
for (let [e, t] of [
|
|
412
|
+
["id", (e) => {
|
|
413
|
+
e.id = "Bad/Id";
|
|
414
|
+
}],
|
|
415
|
+
["name", (e) => {
|
|
416
|
+
e.name = "Bad Name";
|
|
417
|
+
}],
|
|
418
|
+
["version", (e) => {
|
|
419
|
+
e.version = "1";
|
|
420
|
+
}],
|
|
421
|
+
["protocol", (e) => {
|
|
422
|
+
e.protocol = "reactive-md-component/v2";
|
|
423
|
+
}],
|
|
424
|
+
["form", (e) => {
|
|
425
|
+
e.form = "box";
|
|
426
|
+
}]
|
|
427
|
+
]) s.push(J(`manifest.invalid-identity.${e}`, () => {
|
|
428
|
+
let e = X(o);
|
|
429
|
+
t(e), r(e);
|
|
430
|
+
}));
|
|
431
|
+
for (let e of f) {
|
|
432
|
+
let t = o.props[e];
|
|
433
|
+
if (t.default === void 0) continue;
|
|
434
|
+
let n = e.replace(/[^A-Za-z0-9._-]/g, "_");
|
|
435
|
+
s.push(J(`manifest.invalid-default.${n}`, () => {
|
|
436
|
+
let n = X(o), i = n.props;
|
|
437
|
+
i[e] = {
|
|
438
|
+
...i[e],
|
|
439
|
+
default: se(t)
|
|
440
|
+
}, r(n);
|
|
441
|
+
}));
|
|
442
|
+
}
|
|
443
|
+
return s.push(Y("manifest.define-round-trip", () => {
|
|
444
|
+
let e = i(c);
|
|
445
|
+
if (n(e) !== l) throw Error("defineLocalComponent changed the semantic digest.");
|
|
446
|
+
})), Object.freeze({
|
|
447
|
+
protocol: N,
|
|
448
|
+
suite: "manifest",
|
|
449
|
+
configKey: l,
|
|
450
|
+
component: q(o),
|
|
451
|
+
cases: Object.freeze(s)
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
// src/testing/report.ts
|
|
455
|
+
var Z = [
|
|
456
|
+
"interactive",
|
|
457
|
+
"static",
|
|
458
|
+
"ssr",
|
|
459
|
+
"offline"
|
|
460
|
+
], ue = new Set(Z), de = /* @__PURE__ */ new Set([
|
|
461
|
+
"passed",
|
|
462
|
+
"failed",
|
|
463
|
+
"skipped",
|
|
464
|
+
"unsupported"
|
|
465
|
+
]), fe = /* @__PURE__ */ new Set([
|
|
466
|
+
"manifest",
|
|
467
|
+
"behavior",
|
|
468
|
+
"react",
|
|
469
|
+
"browser"
|
|
470
|
+
]);
|
|
471
|
+
function pe(e) {
|
|
472
|
+
return Object.freeze({
|
|
473
|
+
id: e.id,
|
|
474
|
+
name: e.name,
|
|
475
|
+
version: e.version
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
function Q(e) {
|
|
479
|
+
return Object.freeze(Z.filter((t) => e.capabilities[t] === !0));
|
|
480
|
+
}
|
|
481
|
+
function $(e, t) {
|
|
482
|
+
if (!Array.isArray(e)) throw TypeError(`${t} must be an array.`);
|
|
483
|
+
let n = /* @__PURE__ */ new Set(), r = [];
|
|
484
|
+
for (let i of e) {
|
|
485
|
+
if (typeof i != "string" || !ue.has(i)) throw TypeError(`${t} contains an unknown capability.`);
|
|
486
|
+
if (n.has(i)) throw TypeError(`${t} repeats "${i}".`);
|
|
487
|
+
n.add(i), r.push(i);
|
|
488
|
+
}
|
|
489
|
+
return Object.freeze(r);
|
|
490
|
+
}
|
|
491
|
+
function me(e) {
|
|
492
|
+
if (!Array.isArray(e)) throw TypeError("report.suites must be an array.");
|
|
493
|
+
if (e.length > 16) throw TypeError("report.suites accepts at most 16 suites.");
|
|
494
|
+
for (let t = 0; t < e.length; t += 1) {
|
|
495
|
+
let n = e[t];
|
|
496
|
+
if (!n || typeof n != "object" || Array.isArray(n)) throw TypeError(`report.suites[${t}] must be a suite result.`);
|
|
497
|
+
if (n.protocol !== "reactive-md-compliance/v1") throw TypeError(`report.suites[${t}] has an unsupported protocol.`);
|
|
498
|
+
if (typeof n.suite != "string" || !fe.has(n.suite)) throw TypeError(`report.suites[${t}] has an unknown suite name.`);
|
|
499
|
+
if (!Array.isArray(n.cases) || n.cases.length > 512) throw TypeError(`report.suites[${t}].cases must be an array.`);
|
|
500
|
+
for (let e of n.cases) if (!e || typeof e.id != "string" || typeof e.status != "string" || !de.has(e.status)) throw TypeError(`report.suites[${t}] contains an invalid case.`);
|
|
501
|
+
}
|
|
502
|
+
return e;
|
|
503
|
+
}
|
|
504
|
+
function he(e) {
|
|
505
|
+
let t = [], n = /* @__PURE__ */ new Set();
|
|
506
|
+
for (let r of e) for (let e of r.cases) n.has(e.id) ? t.push(O("report.duplicate-case", "manifest", `Case id "${e.id}" appears more than once; evidence is ambiguous.`)) : (n.add(e.id), t.push(e));
|
|
507
|
+
return t;
|
|
508
|
+
}
|
|
509
|
+
function ge(e, t) {
|
|
510
|
+
let n = t.filter((t) => t.capabilities?.includes(e)), r = n.filter((e) => e.status === "passed");
|
|
511
|
+
if (r.length > 0) return Object.freeze({
|
|
512
|
+
capability: e,
|
|
513
|
+
status: "passed",
|
|
514
|
+
cases: Object.freeze(r.map((e) => e.id))
|
|
515
|
+
});
|
|
516
|
+
let i = "unsupported";
|
|
517
|
+
n.some((e) => e.status === "failed") ? i = "failed" : n.some((e) => e.status === "unsupported") ? i = "unsupported" : n.some((e) => e.status === "skipped") && (i = "skipped");
|
|
518
|
+
let a = n.length === 0 ? `No compliance suite executed a case for "${e}".` : `Declared capability "${e}" has no passed evidence (${i}).`;
|
|
519
|
+
return Object.freeze({
|
|
520
|
+
capability: e,
|
|
521
|
+
status: i,
|
|
522
|
+
cases: Object.freeze(n.map((e) => e.id)),
|
|
523
|
+
reason: a
|
|
524
|
+
});
|
|
525
|
+
}
|
|
526
|
+
function _e(e) {
|
|
527
|
+
let t = 0, n = 0, r = 0, i = 0;
|
|
528
|
+
for (let a of e) a.status === "passed" ? t += 1 : a.status === "failed" ? n += 1 : a.status === "skipped" ? r += 1 : i += 1;
|
|
529
|
+
return Object.freeze({
|
|
530
|
+
passed: t,
|
|
531
|
+
failed: n,
|
|
532
|
+
skipped: r,
|
|
533
|
+
unsupported: i
|
|
534
|
+
});
|
|
535
|
+
}
|
|
536
|
+
function ve(e, t) {
|
|
537
|
+
let n = [], r = /* @__PURE__ */ new Set(), i = (e) => {
|
|
538
|
+
let t = `${e.code}\u0000${e.message}`;
|
|
539
|
+
r.has(t) || (r.add(t), n.push(e));
|
|
540
|
+
};
|
|
541
|
+
for (let t of e) if (t.status === "failed") {
|
|
542
|
+
if (t.diagnostics.length === 0) i({
|
|
543
|
+
code: "testing.case-failed",
|
|
544
|
+
message: t.message ?? t.id
|
|
545
|
+
});
|
|
546
|
+
else for (let e of t.diagnostics) i(e);
|
|
547
|
+
}
|
|
548
|
+
for (let e of t) e.status !== "passed" && i({
|
|
549
|
+
code: "testing.capability-evidence",
|
|
550
|
+
message: e.reason ?? `No passed evidence for capability "${e.capability}".`
|
|
551
|
+
});
|
|
552
|
+
return Object.freeze(n);
|
|
553
|
+
}
|
|
554
|
+
function ye(e) {
|
|
555
|
+
if (!e || typeof e != "object" || Array.isArray(e)) throw TypeError("createLocalComplianceReport requires an options object.");
|
|
556
|
+
let t = o(e.config), r = a(t), i, s;
|
|
557
|
+
if (typeof e.component == "string") s = e.component, i = r.find((t) => t.name === e.component);
|
|
558
|
+
else {
|
|
559
|
+
let t = e.component;
|
|
560
|
+
s = t.id, i = r.find((e) => e.id === t.id || e.name === t.name);
|
|
561
|
+
}
|
|
562
|
+
if (!i) return Object.freeze({
|
|
563
|
+
protocol: N,
|
|
564
|
+
ok: !1,
|
|
565
|
+
complete: !1,
|
|
566
|
+
configKey: t.key,
|
|
567
|
+
component: null,
|
|
568
|
+
capabilities: Object.freeze([]),
|
|
569
|
+
cases: Object.freeze([]),
|
|
570
|
+
summary: Object.freeze({
|
|
571
|
+
passed: 0,
|
|
572
|
+
failed: 0,
|
|
573
|
+
skipped: 0,
|
|
574
|
+
unsupported: 0
|
|
575
|
+
}),
|
|
576
|
+
diagnostics: Object.freeze([{
|
|
577
|
+
code: "testing.component-missing",
|
|
578
|
+
message: `Component "${s}" is not installed in this configuration.`
|
|
579
|
+
}])
|
|
580
|
+
});
|
|
581
|
+
let c = me(e.suites), l = [], u = [];
|
|
582
|
+
for (let [e, r] of c.entries()) {
|
|
583
|
+
let a = r.component, o = r.suite === "manifest" ? n(i) : t.key;
|
|
584
|
+
!a || a.id !== i.id || a.name !== i.name || a.version !== i.version || r.configKey !== o ? u.push(O(`report.suite-contract.${e}`, "manifest", "Suite evidence belongs to another component, version or configuration.", [{
|
|
585
|
+
code: "testing.suite-contract",
|
|
586
|
+
message: "Run the suite with the same installed component and configuration."
|
|
587
|
+
}])) : l.push(r);
|
|
588
|
+
}
|
|
589
|
+
let d = [...he(l), ...u], f = e.capabilities === void 0 ? Q(i) : $(e.capabilities, "report.capabilities"), p = new Set(f), m = Z.filter((e) => p.has(e)).map((e) => ge(e, d)), h = e.requireCapabilities !== !1, g = h ? m.filter((e) => e.status !== "passed") : [], _ = d.some((e) => e.status === "failed"), v = ve(d, g);
|
|
590
|
+
return Object.freeze({
|
|
591
|
+
protocol: N,
|
|
592
|
+
ok: !_ && g.length === 0,
|
|
593
|
+
complete: !_ && h && Q(i).every((e) => p.has(e) && m.some((t) => t.capability === e && t.status === "passed")),
|
|
594
|
+
configKey: t.key,
|
|
595
|
+
component: pe(i),
|
|
596
|
+
capabilities: Object.freeze(m),
|
|
597
|
+
cases: Object.freeze(d),
|
|
598
|
+
summary: _e(d),
|
|
599
|
+
diagnostics: v
|
|
600
|
+
});
|
|
601
|
+
}
|
|
602
|
+
function be(e, t) {
|
|
603
|
+
let n = new Map(e.cases.map((e) => [e.id, e])), r = new Map(t.cases.map((e) => [e.id, e])), i = [.../* @__PURE__ */ new Set([...n.keys(), ...r.keys()])].sort(), a = [];
|
|
604
|
+
for (let e of i) {
|
|
605
|
+
let t = n.get(e), i = r.get(e);
|
|
606
|
+
if (!t || !i) {
|
|
607
|
+
a.push(Object.freeze({
|
|
608
|
+
case: e,
|
|
609
|
+
message: `Case "${e}" exists only in the ${t ? "left" : "right"} result.`
|
|
610
|
+
}));
|
|
611
|
+
continue;
|
|
612
|
+
}
|
|
613
|
+
if (t.status !== i.status) {
|
|
614
|
+
a.push(Object.freeze({
|
|
615
|
+
case: e,
|
|
616
|
+
message: `Status differs: ${t.status} vs ${i.status}.`
|
|
617
|
+
}));
|
|
618
|
+
continue;
|
|
619
|
+
}
|
|
620
|
+
let o = [...t.capabilities ?? []].sort().join(","), s = [...i.capabilities ?? []].sort().join(",");
|
|
621
|
+
o === s ? b(t.observed ?? {}, i.observed ?? {}) || a.push(Object.freeze({
|
|
622
|
+
case: e,
|
|
623
|
+
message: "Observed values differ."
|
|
624
|
+
})) : a.push(Object.freeze({
|
|
625
|
+
case: e,
|
|
626
|
+
message: `Capability evidence differs: [${o}] vs [${s}].`
|
|
627
|
+
}));
|
|
628
|
+
}
|
|
629
|
+
return Object.freeze({
|
|
630
|
+
ok: a.length === 0,
|
|
631
|
+
mismatches: Object.freeze(a)
|
|
632
|
+
});
|
|
633
|
+
}
|
|
634
|
+
function xe(e) {
|
|
635
|
+
let t = e.message ?? e.diagnostics.map((e) => e.message).join(" ");
|
|
636
|
+
return t ? `${e.id}: ${t}` : e.id;
|
|
637
|
+
}
|
|
638
|
+
export { g as LOCAL_BEHAVIOR_SPEC_PROTOCOL, M as LOCAL_BROWSER_SPEC_PROTOCOL, N as LOCAL_COMPLIANCE_PROTOCOL, v as LOCAL_REACT_SPEC_PROTOCOL, te as MAX_LOCAL_COMPLIANCE_ARRAY_LENGTH, m as MAX_LOCAL_COMPLIANCE_CASES, u as MAX_LOCAL_COMPLIANCE_ERROR_PATTERNS, ee as MAX_LOCAL_COMPLIANCE_EXPRESSION_LENGTH, h as MAX_LOCAL_COMPLIANCE_MARKUP_PATTERNS, f as MAX_LOCAL_COMPLIANCE_SELECTOR_LENGTH, d as MAX_LOCAL_COMPLIANCE_SLOTS, p as MAX_LOCAL_COMPLIANCE_SOURCE_LENGTH, w as MAX_LOCAL_COMPLIANCE_STRING_LENGTH, l as MAX_LOCAL_COMPLIANCE_WRITES, be as compareLocalComplianceParity, ye as createLocalComplianceReport, xe as describeLocalComplianceCase, R as readLocalBehaviorSpec, G as runLocalBehaviorCompliance, le as runLocalManifestCompliance };
|