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,523 @@
|
|
|
1
|
+
import { n as e, u as t } from "./registry-B9Jc3FVe.js";
|
|
2
|
+
import { c as n, f as r, h as i, i as a, k as o, l as s, m as c, n as l, o as u, p as d, r as f, s as p, t as m, u as h, v as g, w as _, y as v } from "./values-CIt8AjiU.js";
|
|
3
|
+
// src/testing/browser.ts
|
|
4
|
+
var y = /* @__PURE__ */ new Set([
|
|
5
|
+
"protocol",
|
|
6
|
+
"url",
|
|
7
|
+
"offline",
|
|
8
|
+
"javaScriptEnabled",
|
|
9
|
+
"timeoutMs",
|
|
10
|
+
"cases",
|
|
11
|
+
"expectedErrors",
|
|
12
|
+
"unmountExpression",
|
|
13
|
+
"requiredPhases"
|
|
14
|
+
]), b = /* @__PURE__ */ new Set([
|
|
15
|
+
"id",
|
|
16
|
+
"phase",
|
|
17
|
+
"kind",
|
|
18
|
+
"selector",
|
|
19
|
+
"name",
|
|
20
|
+
"value",
|
|
21
|
+
"key",
|
|
22
|
+
"expression",
|
|
23
|
+
"expected",
|
|
24
|
+
"trigger",
|
|
25
|
+
"placeholder",
|
|
26
|
+
"survivor"
|
|
27
|
+
]), x = [
|
|
28
|
+
"mount",
|
|
29
|
+
"hydration",
|
|
30
|
+
"edit",
|
|
31
|
+
"hide-show",
|
|
32
|
+
"disabled",
|
|
33
|
+
"reset",
|
|
34
|
+
"descendant-error",
|
|
35
|
+
"unmount"
|
|
36
|
+
], S = new Set(x), C = [
|
|
37
|
+
"mount",
|
|
38
|
+
"edit",
|
|
39
|
+
"hide-show",
|
|
40
|
+
"disabled",
|
|
41
|
+
"reset",
|
|
42
|
+
"descendant-error",
|
|
43
|
+
"unmount"
|
|
44
|
+
], w = /* @__PURE__ */ new Set([
|
|
45
|
+
"visible",
|
|
46
|
+
"text",
|
|
47
|
+
"attribute",
|
|
48
|
+
"count",
|
|
49
|
+
"enabled",
|
|
50
|
+
"wait",
|
|
51
|
+
"click",
|
|
52
|
+
"fill",
|
|
53
|
+
"press",
|
|
54
|
+
"evaluate",
|
|
55
|
+
"isolation",
|
|
56
|
+
"unmount"
|
|
57
|
+
]), T = "(() => {\n const hook = globalThis.__reactiveMdTestUnmount;\n if (typeof hook === 'function') { hook(); return true; }\n const root = document.querySelector('#reactive-md-document, reactive-md-doc');\n if (root && root.parentNode) { root.remove(); return true; }\n return false;\n})()";
|
|
58
|
+
function E(e, t) {
|
|
59
|
+
let r = n(e, t, 512);
|
|
60
|
+
if (r.trim() === "") throw TypeError(`${t} must not be empty.`);
|
|
61
|
+
if (/[\u0000\r\n]/.test(r)) throw TypeError(`${t} contains an unsupported character.`);
|
|
62
|
+
return r;
|
|
63
|
+
}
|
|
64
|
+
function D(e, t) {
|
|
65
|
+
let n = a(e, t);
|
|
66
|
+
if (Array.isArray(n)) throw TypeError(`${t} must be a scalar.`);
|
|
67
|
+
return n;
|
|
68
|
+
}
|
|
69
|
+
function O(e, t, r) {
|
|
70
|
+
let i = `spec.cases[${t}]`, a = h(e, i);
|
|
71
|
+
m(a, b, i);
|
|
72
|
+
let s = n(a.kind, `${i}.kind`, 32);
|
|
73
|
+
if (!w.has(s)) throw TypeError(`${i}.kind is not supported.`);
|
|
74
|
+
let c = n(a.phase, `${i}.phase`, 32);
|
|
75
|
+
if (!S.has(c)) throw TypeError(`${i}.phase is not supported.`);
|
|
76
|
+
let l = {
|
|
77
|
+
id: f(a.id, `${i}.id`, r, `browser.${t}.${s}`),
|
|
78
|
+
phase: c,
|
|
79
|
+
kind: s
|
|
80
|
+
};
|
|
81
|
+
switch (s) {
|
|
82
|
+
case "visible":
|
|
83
|
+
case "enabled":
|
|
84
|
+
if (typeof a.expected != "boolean") throw TypeError(`${i}.expected must be a boolean.`);
|
|
85
|
+
return Object.freeze({
|
|
86
|
+
...l,
|
|
87
|
+
selector: E(a.selector, `${i}.selector`),
|
|
88
|
+
expected: a.expected
|
|
89
|
+
});
|
|
90
|
+
case "text": return Object.freeze({
|
|
91
|
+
...l,
|
|
92
|
+
selector: E(a.selector, `${i}.selector`),
|
|
93
|
+
expected: n(a.expected, `${i}.expected`, o)
|
|
94
|
+
});
|
|
95
|
+
case "attribute": {
|
|
96
|
+
let e = a.expected;
|
|
97
|
+
if (e !== null && typeof e != "string") throw TypeError(`${i}.expected must be a string or null.`);
|
|
98
|
+
return Object.freeze({
|
|
99
|
+
...l,
|
|
100
|
+
selector: E(a.selector, `${i}.selector`),
|
|
101
|
+
name: n(a.name, `${i}.name`, 128),
|
|
102
|
+
expected: e === null ? null : n(e, `${i}.expected`, o)
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
case "count": return Object.freeze({
|
|
106
|
+
...l,
|
|
107
|
+
selector: E(a.selector, `${i}.selector`),
|
|
108
|
+
expected: p(a.expected, `${i}.expected`, 0, 1e4)
|
|
109
|
+
});
|
|
110
|
+
case "wait":
|
|
111
|
+
case "click": return Object.freeze({
|
|
112
|
+
...l,
|
|
113
|
+
selector: E(a.selector, `${i}.selector`)
|
|
114
|
+
});
|
|
115
|
+
case "fill": return Object.freeze({
|
|
116
|
+
...l,
|
|
117
|
+
selector: E(a.selector, `${i}.selector`),
|
|
118
|
+
value: n(a.value, `${i}.value`, o)
|
|
119
|
+
});
|
|
120
|
+
case "press": {
|
|
121
|
+
let e = n(a.key, `${i}.key`, 32);
|
|
122
|
+
if (e.trim() === "") throw TypeError(`${i}.key must not be empty.`);
|
|
123
|
+
return Object.freeze({
|
|
124
|
+
...l,
|
|
125
|
+
selector: E(a.selector, `${i}.selector`),
|
|
126
|
+
key: e
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
case "evaluate": {
|
|
130
|
+
let e = n(a.expression, `${i}.expression`, _);
|
|
131
|
+
if (e.trim() === "") throw TypeError(`${i}.expression must not be empty.`);
|
|
132
|
+
return Object.freeze({
|
|
133
|
+
...l,
|
|
134
|
+
expression: e,
|
|
135
|
+
expected: D(a.expected, `${i}.expected`)
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
case "isolation": return Object.freeze({
|
|
139
|
+
...l,
|
|
140
|
+
trigger: E(a.trigger, `${i}.trigger`),
|
|
141
|
+
placeholder: E(a.placeholder, `${i}.placeholder`),
|
|
142
|
+
survivor: E(a.survivor, `${i}.survivor`)
|
|
143
|
+
});
|
|
144
|
+
case "unmount": return Object.freeze({ ...l });
|
|
145
|
+
default: throw TypeError(`${i}.kind is not supported.`);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
function k(e) {
|
|
149
|
+
let t = h(e, "spec");
|
|
150
|
+
if (m(t, y, "spec"), t.protocol !== "reactive-md-browser-spec/v1") throw TypeError(`spec.protocol must be "${g}".`);
|
|
151
|
+
let r = n(t.url, "spec.url", 2048);
|
|
152
|
+
if (!/^(?:file|data):/i.test(r)) throw TypeError("spec.url must be a local file: or data: URL.");
|
|
153
|
+
let i = l(t.offline, "spec.offline"), a = t.javaScriptEnabled === void 0 ? void 0 : l(t.javaScriptEnabled, "spec.javaScriptEnabled"), o = t.timeoutMs === void 0 ? 5e3 : p(t.timeoutMs, "spec.timeoutMs", 1e3, 6e4);
|
|
154
|
+
if (!Array.isArray(t.cases)) throw TypeError("spec.cases must be an array.");
|
|
155
|
+
if (t.cases.length === 0) throw TypeError("spec.cases must not be empty.");
|
|
156
|
+
if (t.cases.length > 128) throw TypeError("spec.cases accepts at most 128 entries.");
|
|
157
|
+
let c = /* @__PURE__ */ new Set(), u = Object.freeze(t.cases.map((e, t) => O(e, t, c))), d = t.expectedErrors === void 0 ? void 0 : s(t.expectedErrors, "spec.expectedErrors", 16), f = t.unmountExpression === void 0 ? void 0 : n(t.unmountExpression, "spec.unmountExpression", _), v;
|
|
158
|
+
if (t.requiredPhases !== void 0) {
|
|
159
|
+
if (!Array.isArray(t.requiredPhases)) throw TypeError("spec.requiredPhases must be an array.");
|
|
160
|
+
let e = [], n = /* @__PURE__ */ new Set();
|
|
161
|
+
for (let r of t.requiredPhases) {
|
|
162
|
+
if (typeof r != "string" || !S.has(r)) throw TypeError("spec.requiredPhases contains an unknown phase.");
|
|
163
|
+
if (n.has(r)) throw TypeError(`spec.requiredPhases repeats "${r}".`);
|
|
164
|
+
n.add(r), e.push(r);
|
|
165
|
+
}
|
|
166
|
+
v = Object.freeze(e);
|
|
167
|
+
}
|
|
168
|
+
return Object.freeze({
|
|
169
|
+
protocol: g,
|
|
170
|
+
url: r,
|
|
171
|
+
offline: i,
|
|
172
|
+
...a === void 0 ? {} : { javaScriptEnabled: a },
|
|
173
|
+
timeoutMs: o,
|
|
174
|
+
cases: u,
|
|
175
|
+
...d === void 0 ? {} : { expectedErrors: d },
|
|
176
|
+
...f === void 0 ? {} : { unmountExpression: f },
|
|
177
|
+
...v === void 0 ? {} : { requiredPhases: v }
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
function A(e, t, n) {
|
|
181
|
+
return new Promise((r, i) => {
|
|
182
|
+
let a = setTimeout(() => i(/* @__PURE__ */ Error(`Timed out after ${t}ms: ${n}`)), t);
|
|
183
|
+
e.then((e) => {
|
|
184
|
+
clearTimeout(a), r(e);
|
|
185
|
+
}, (e) => {
|
|
186
|
+
clearTimeout(a), i(e);
|
|
187
|
+
});
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
function j(e) {
|
|
191
|
+
if (e === null || typeof e == "string" || typeof e == "boolean" || typeof e == "number" && Number.isFinite(e)) return e;
|
|
192
|
+
if (Array.isArray(e) && e.every((e) => typeof e == "string") || Array.isArray(e) && e.every((e) => typeof e == "number" && Number.isFinite(e))) return Object.freeze(e.map((e) => e));
|
|
193
|
+
}
|
|
194
|
+
async function M(e, t, n, i) {
|
|
195
|
+
switch (t.kind) {
|
|
196
|
+
case "visible": {
|
|
197
|
+
let n = await e.visible(t.selector);
|
|
198
|
+
return n === t.expected ? {
|
|
199
|
+
issues: [],
|
|
200
|
+
observed: { visible: n }
|
|
201
|
+
} : {
|
|
202
|
+
issues: [`Expected ${t.selector} visible=${t.expected}, got ${n}.`],
|
|
203
|
+
observed: { visible: n }
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
case "enabled": {
|
|
207
|
+
let n = await e.enabled(t.selector);
|
|
208
|
+
return n === t.expected ? {
|
|
209
|
+
issues: [],
|
|
210
|
+
observed: { enabled: n }
|
|
211
|
+
} : {
|
|
212
|
+
issues: [`Expected ${t.selector} enabled=${t.expected}, got ${n}.`],
|
|
213
|
+
observed: { enabled: n }
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
case "text": {
|
|
217
|
+
let n = await e.text(t.selector);
|
|
218
|
+
if (n === null) return { issues: [`No element matched ${t.selector}.`] };
|
|
219
|
+
let r = n.trim(), i = String(t.expected).trim();
|
|
220
|
+
return r === i ? {
|
|
221
|
+
issues: [],
|
|
222
|
+
observed: { text: r }
|
|
223
|
+
} : {
|
|
224
|
+
issues: [`Expected text ${JSON.stringify(i)}, got ${JSON.stringify(r)}.`],
|
|
225
|
+
observed: { text: r }
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
case "attribute": {
|
|
229
|
+
let n = await e.attribute(t.selector, t.name);
|
|
230
|
+
return n === t.expected ? {
|
|
231
|
+
issues: [],
|
|
232
|
+
observed: { attribute: n ?? null }
|
|
233
|
+
} : {
|
|
234
|
+
issues: [`Expected ${t.selector} [${t.name}] = ${JSON.stringify(t.expected)}, got ${JSON.stringify(n)}.`],
|
|
235
|
+
observed: { attribute: n ?? null }
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
case "count": {
|
|
239
|
+
let n = await e.count(t.selector);
|
|
240
|
+
return n === t.expected ? {
|
|
241
|
+
issues: [],
|
|
242
|
+
observed: { count: n }
|
|
243
|
+
} : {
|
|
244
|
+
issues: [`Expected ${t.expected} matches for ${t.selector}, got ${n}.`],
|
|
245
|
+
observed: { count: n }
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
case "wait": return await e.waitFor(t.selector, n), { issues: [] };
|
|
249
|
+
case "click": return await e.click(t.selector), { issues: [] };
|
|
250
|
+
case "fill": return await e.fill(t.selector, t.value), { issues: [] };
|
|
251
|
+
case "press": return await e.press(t.selector, t.key), { issues: [] };
|
|
252
|
+
case "evaluate": {
|
|
253
|
+
let n = j(await e.evaluate(t.expression));
|
|
254
|
+
return n === void 0 ? { issues: ["The evaluated expression did not return a bounded scalar."] } : r(n, t.expected) ? {
|
|
255
|
+
issues: [],
|
|
256
|
+
observed: { result: n }
|
|
257
|
+
} : {
|
|
258
|
+
issues: [`Expected ${JSON.stringify(t.expected)}, got ${JSON.stringify(n)}.`],
|
|
259
|
+
observed: { result: n }
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
case "isolation": {
|
|
263
|
+
await e.click(t.trigger), await e.waitFor(t.placeholder, n);
|
|
264
|
+
let r = await e.visible(t.placeholder), i = await e.visible(t.survivor), a = [];
|
|
265
|
+
return r || a.push(`The descendant error placeholder ${t.placeholder} is not visible.`), i || a.push(`The surviving sibling ${t.survivor} is not visible.`), a.length === 0 ? {
|
|
266
|
+
issues: [],
|
|
267
|
+
observed: {
|
|
268
|
+
placeholder: r,
|
|
269
|
+
survivor: i
|
|
270
|
+
}
|
|
271
|
+
} : {
|
|
272
|
+
issues: a,
|
|
273
|
+
observed: {
|
|
274
|
+
placeholder: r,
|
|
275
|
+
survivor: i
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
case "unmount": return await e.evaluate(i) === !0 ? { issues: [] } : { issues: ["The unmount expression did not return true."] };
|
|
280
|
+
default: return { issues: [`Unknown case kind ${String(t.kind)}.`] };
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
function N(e, t, n) {
|
|
284
|
+
return e.some((e) => e.status === "passed" && e.id.startsWith(`browser.${t}.`) && n.some((n) => e.id.startsWith(`browser.${t}.${n}`)));
|
|
285
|
+
}
|
|
286
|
+
function P(e, t, n) {
|
|
287
|
+
return e.filter((e) => e.status === "passed" && e.id.startsWith(`browser.${t}.`)).map((e) => e.observed?.[n]).filter((e) => e !== void 0);
|
|
288
|
+
}
|
|
289
|
+
function F(e, t, n) {
|
|
290
|
+
return n.some((n) => e.startsWith(`browser.${t}.${n}`));
|
|
291
|
+
}
|
|
292
|
+
function I(e, t) {
|
|
293
|
+
let n = e.filter((e) => e.status === "passed" && e.id.startsWith(`browser.${t}.`));
|
|
294
|
+
for (let e = 0; e < n.length; e += 1) if (F(n[e].id, t, [
|
|
295
|
+
"click",
|
|
296
|
+
"fill",
|
|
297
|
+
"press",
|
|
298
|
+
"evaluate"
|
|
299
|
+
]) && n.slice(e + 1).some((e) => F(e.id, t, [
|
|
300
|
+
"visible",
|
|
301
|
+
"text",
|
|
302
|
+
"attribute",
|
|
303
|
+
"count",
|
|
304
|
+
"enabled",
|
|
305
|
+
"evaluate"
|
|
306
|
+
]))) return !0;
|
|
307
|
+
return !1;
|
|
308
|
+
}
|
|
309
|
+
function L(e, t) {
|
|
310
|
+
switch (e) {
|
|
311
|
+
case "mount":
|
|
312
|
+
case "hydration": return N(t, e, [
|
|
313
|
+
"visible",
|
|
314
|
+
"text",
|
|
315
|
+
"attribute",
|
|
316
|
+
"count",
|
|
317
|
+
"enabled",
|
|
318
|
+
"evaluate"
|
|
319
|
+
]);
|
|
320
|
+
case "edit": return I(t, e) && N(t, e, [
|
|
321
|
+
"text",
|
|
322
|
+
"attribute",
|
|
323
|
+
"count",
|
|
324
|
+
"enabled",
|
|
325
|
+
"evaluate"
|
|
326
|
+
]);
|
|
327
|
+
case "hide-show": {
|
|
328
|
+
let n = P(t, e, "visible");
|
|
329
|
+
return n.includes(!0) && n.includes(!1);
|
|
330
|
+
}
|
|
331
|
+
case "disabled": {
|
|
332
|
+
let n = P(t, e, "enabled");
|
|
333
|
+
return n.includes(!0) && n.includes(!1);
|
|
334
|
+
}
|
|
335
|
+
case "reset": return N(t, e, ["click", "evaluate"]) && N(t, e, [
|
|
336
|
+
"text",
|
|
337
|
+
"attribute",
|
|
338
|
+
"count",
|
|
339
|
+
"enabled",
|
|
340
|
+
"evaluate"
|
|
341
|
+
]);
|
|
342
|
+
case "descendant-error": return N(t, e, ["isolation"]);
|
|
343
|
+
case "unmount": return N(t, e, ["unmount"]) && (N(t, e, ["count", "visible"]) || N(t, e, ["evaluate"]));
|
|
344
|
+
default: return !1;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
function R(n, r) {
|
|
348
|
+
if (n === void 0 || r === void 0) return null;
|
|
349
|
+
let i = t(n), a = e(i).find((e) => e.name === r);
|
|
350
|
+
return a ? Object.freeze({
|
|
351
|
+
id: a.id,
|
|
352
|
+
name: a.name,
|
|
353
|
+
version: a.version
|
|
354
|
+
}) : null;
|
|
355
|
+
}
|
|
356
|
+
function z(e) {
|
|
357
|
+
return e === void 0 ? "browser" : t(e).key;
|
|
358
|
+
}
|
|
359
|
+
async function B(e) {
|
|
360
|
+
if (!e || typeof e != "object") throw TypeError("runLocalBrowserCompliance requires an options object.");
|
|
361
|
+
let t = e.driver;
|
|
362
|
+
if (!t || typeof t != "object" || typeof t.open != "function") throw TypeError("options.driver must implement open().");
|
|
363
|
+
let n = k(e.spec), r = z(e.config), a = R(e.config, e.component), o = [], s = n.timeoutMs ?? 5e3, l = n.unmountExpression ?? T, f = null;
|
|
364
|
+
try {
|
|
365
|
+
f = await A(t.open({
|
|
366
|
+
url: n.url,
|
|
367
|
+
offline: n.offline,
|
|
368
|
+
...n.javaScriptEnabled === void 0 ? {} : { javaScriptEnabled: n.javaScriptEnabled },
|
|
369
|
+
timeoutMs: s
|
|
370
|
+
}), s, "driver.open");
|
|
371
|
+
} catch (e) {
|
|
372
|
+
return o.push(d("browser.open", "browser", `Could not open the document: ${u(e)}`)), Object.freeze({
|
|
373
|
+
protocol: v,
|
|
374
|
+
suite: "browser",
|
|
375
|
+
configKey: r,
|
|
376
|
+
component: a,
|
|
377
|
+
cases: Object.freeze(o)
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
if (!f) return o.push(d("browser.open", "browser", "The driver did not return a session.")), Object.freeze({
|
|
381
|
+
protocol: v,
|
|
382
|
+
suite: "browser",
|
|
383
|
+
configKey: r,
|
|
384
|
+
component: a,
|
|
385
|
+
cases: Object.freeze(o)
|
|
386
|
+
});
|
|
387
|
+
let p = f;
|
|
388
|
+
try {
|
|
389
|
+
for (let e = 0; e < n.cases.length; e += 1) {
|
|
390
|
+
let t = n.cases[e], r = `browser.${t.phase}.${t.kind}.${t.id.replace(/^browser\./, "")}`;
|
|
391
|
+
try {
|
|
392
|
+
let e = await A(M(p.page, t, s, l), s, r);
|
|
393
|
+
o.push(e.issues.length === 0 ? c(r, "browser", e.observed === void 0 ? {} : { observed: e.observed }) : d(r, "browser", e.issues.join(" ")));
|
|
394
|
+
} catch (e) {
|
|
395
|
+
o.push(d(r, "browser", u(e)));
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
if (n.offline) {
|
|
399
|
+
p.offline === !0 ? o.push(c("browser.offline-context", "browser")) : o.push(d("browser.offline-context", "browser", "The driver session was not opened in an offline context."));
|
|
400
|
+
let e = p.requests.filter((e) => /^(?:https?|wss?):/i.test(e));
|
|
401
|
+
o.push(e.length === 0 ? c("browser.network", "browser", { observed: { requests: 0 } }) : d("browser.network", "browser", "The offline document made network requests.", [{
|
|
402
|
+
code: "testing.browser-network",
|
|
403
|
+
message: e.slice(0, 10).join(" ")
|
|
404
|
+
}]));
|
|
405
|
+
}
|
|
406
|
+
let e = n.expectedErrors ?? [], t = p.errors.filter((t) => !e.some((e) => t.includes(e)));
|
|
407
|
+
o.push(t.length === 0 ? c("browser.errors", "browser") : d("browser.errors", "browser", "Unexpected page or console errors.", [{
|
|
408
|
+
code: "testing.browser-errors",
|
|
409
|
+
message: t.slice(0, 10).join(" | ")
|
|
410
|
+
}]));
|
|
411
|
+
} finally {
|
|
412
|
+
try {
|
|
413
|
+
await p.close();
|
|
414
|
+
} catch (e) {
|
|
415
|
+
o.push(d("browser.close", "browser", u(e)));
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
let m = n.requiredPhases ?? x;
|
|
419
|
+
for (let e of m) L(e, o) ? o.push(c(`browser.phase.${e}`, "browser")) : o.some((t) => t.id.startsWith(`browser.${e}.`)) ? o.push(d(`browser.phase.${e}`, "browser", `The ${e} cases did not prove the required behavior.`)) : o.push(i(`browser.phase.${e}`, "browser", `No ${e} case was executed.`));
|
|
420
|
+
let h = C.every((e) => L(e, o)), g = o.some((e) => e.status === "failed");
|
|
421
|
+
h && !g ? o.push(c("browser.interactive", "browser", { capabilities: ["interactive"] })) : o.push(i("browser.interactive", "browser", "Interactive evidence requires mount, edit, hide/show, disabled, reset, descendant error and unmount phases without failures.", ["interactive"]));
|
|
422
|
+
let _ = L("hydration", o);
|
|
423
|
+
return n.offline && h && _ && !g ? o.push(c("browser.offline", "browser", { capabilities: ["offline"] })) : o.push(i("browser.offline", "browser", n.offline ? "Offline evidence requires hydration, the full interactive lifecycle, an offline context and no network requests or unexpected errors." : "The spec did not open the document in an offline context.", ["offline"])), Object.freeze({
|
|
424
|
+
protocol: v,
|
|
425
|
+
suite: "browser",
|
|
426
|
+
configKey: r,
|
|
427
|
+
component: a,
|
|
428
|
+
cases: Object.freeze(o)
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
function V(e) {
|
|
432
|
+
if (!e || typeof e.newPage != "function") throw TypeError("createPlaywrightBrowserDriver requires a browser context.");
|
|
433
|
+
return Object.freeze({
|
|
434
|
+
name: "playwright",
|
|
435
|
+
async open(t) {
|
|
436
|
+
if (t.offline) {
|
|
437
|
+
if (typeof e.setOffline != "function") throw TypeError("Offline compliance requires a browser context with setOffline().");
|
|
438
|
+
await e.setOffline(!0);
|
|
439
|
+
}
|
|
440
|
+
let n = await e.newPage(), r = [], i = [];
|
|
441
|
+
n.on("pageerror", (e) => {
|
|
442
|
+
r.push(e instanceof Error ? e.message : String(e));
|
|
443
|
+
}), n.on("console", (e) => {
|
|
444
|
+
let t = e;
|
|
445
|
+
try {
|
|
446
|
+
t.type?.() === "error" && r.push(t.text?.() ?? "console.error");
|
|
447
|
+
} catch {}
|
|
448
|
+
}), n.on("request", (e) => {
|
|
449
|
+
let t = e;
|
|
450
|
+
try {
|
|
451
|
+
let e = t.url?.();
|
|
452
|
+
typeof e == "string" && /^(?:https?|wss?):/i.test(e) && i.push(e);
|
|
453
|
+
} catch {}
|
|
454
|
+
});
|
|
455
|
+
try {
|
|
456
|
+
await n.goto(t.url, {
|
|
457
|
+
waitUntil: "load",
|
|
458
|
+
timeout: t.timeoutMs
|
|
459
|
+
});
|
|
460
|
+
} catch (e) {
|
|
461
|
+
throw await n.close(), e;
|
|
462
|
+
}
|
|
463
|
+
let a = (e) => n.locator(e);
|
|
464
|
+
return Object.freeze({
|
|
465
|
+
page: {
|
|
466
|
+
async goto(e) {
|
|
467
|
+
await n.goto(e, {
|
|
468
|
+
waitUntil: "load",
|
|
469
|
+
timeout: t.timeoutMs
|
|
470
|
+
});
|
|
471
|
+
},
|
|
472
|
+
async reload() {
|
|
473
|
+
await n.reload({ timeout: t.timeoutMs });
|
|
474
|
+
},
|
|
475
|
+
async waitFor(e, t) {
|
|
476
|
+
await n.waitForSelector(e, {
|
|
477
|
+
state: "attached",
|
|
478
|
+
timeout: t
|
|
479
|
+
});
|
|
480
|
+
},
|
|
481
|
+
async count(e) {
|
|
482
|
+
return a(e).count();
|
|
483
|
+
},
|
|
484
|
+
async text(e) {
|
|
485
|
+
return await a(e).count() === 0 ? null : a(e).first().textContent();
|
|
486
|
+
},
|
|
487
|
+
async attribute(e, t) {
|
|
488
|
+
return await a(e).count() === 0 ? null : a(e).first().getAttribute(t);
|
|
489
|
+
},
|
|
490
|
+
async visible(e) {
|
|
491
|
+
return await a(e).count() !== 0 && a(e).first().isVisible();
|
|
492
|
+
},
|
|
493
|
+
async enabled(e) {
|
|
494
|
+
return await a(e).count() !== 0 && a(e).first().isEnabled();
|
|
495
|
+
},
|
|
496
|
+
async click(e) {
|
|
497
|
+
await a(e).first().click();
|
|
498
|
+
},
|
|
499
|
+
async fill(e, t) {
|
|
500
|
+
await a(e).first().fill(t);
|
|
501
|
+
},
|
|
502
|
+
async press(e, t) {
|
|
503
|
+
await a(e).first().press(t);
|
|
504
|
+
},
|
|
505
|
+
async evaluate(e) {
|
|
506
|
+
return n.evaluate(e);
|
|
507
|
+
}
|
|
508
|
+
},
|
|
509
|
+
get errors() {
|
|
510
|
+
return Object.freeze([...r]);
|
|
511
|
+
},
|
|
512
|
+
get requests() {
|
|
513
|
+
return Object.freeze([...i]);
|
|
514
|
+
},
|
|
515
|
+
offline: t.offline,
|
|
516
|
+
async close() {
|
|
517
|
+
await n.close();
|
|
518
|
+
}
|
|
519
|
+
});
|
|
520
|
+
}
|
|
521
|
+
});
|
|
522
|
+
}
|
|
523
|
+
export { V as createPlaywrightBrowserDriver, k as readLocalBrowserSpec, B as runLocalBrowserCompliance };
|