@reqvire-org/ads 0.4.7 → 0.5.1
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/README.md +268 -420
- package/dist/accessibility-declarations.mjs +43 -0
- package/dist/active-clock.d.mts +30 -0
- package/dist/active-clock.mjs +26 -17
- package/dist/ads-errors.mjs +3684 -0
- package/dist/ads-view-choices.mjs +17 -0
- package/dist/ads-views.mjs +12 -0
- package/dist/analysis/captured-content.mjs +16 -0
- package/dist/analysis/compiler-options.mjs +3 -7
- package/dist/analysis/context.mjs +14 -20
- package/dist/analysis/controller-gates.mjs +119 -0
- package/dist/analysis/design-usage.mjs +142 -0
- package/dist/analysis/file-tree.mjs +44 -29
- package/dist/analysis/framework-imports.mjs +62 -0
- package/dist/analysis/glyph-macros.mjs +103 -0
- package/dist/analysis/helpers.mjs +119 -91
- package/dist/analysis/impact.mjs +25 -12
- package/dist/analysis/inputs.mjs +19 -13
- package/dist/analysis/mock-check.mjs +99 -0
- package/dist/analysis/module-graph.mjs +156 -0
- package/dist/analysis/module-resolvers.mjs +30 -28
- package/dist/analysis/native-adapter.mjs +139 -146
- package/dist/analysis/native-boundary.mjs +52 -0
- package/dist/analysis/native-project.mjs +331 -231
- package/dist/analysis/native-session.mjs +20 -0
- package/dist/analysis/owner-accessibility.mjs +74 -0
- package/dist/analysis/owner-analysis-cache.mjs +125 -0
- package/dist/analysis/owner-analysis-key.mjs +114 -0
- package/dist/analysis/owner-choices.mjs +896 -0
- package/dist/analysis/owner-composition.mjs +636 -0
- package/dist/analysis/owner-controls.mjs +27 -0
- package/dist/analysis/owner-discovery.mjs +164 -0
- package/dist/analysis/owner-failures.mjs +19 -0
- package/dist/analysis/owner-outcomes.mjs +42 -0
- package/dist/analysis/owner-reuse.mjs +100 -0
- package/dist/analysis/owner-source.mjs +1555 -0
- package/dist/analysis/prose-owners.mjs +57 -0
- package/dist/analysis/public-imports.mjs +31 -0
- package/dist/analysis/queries.mjs +72 -54
- package/dist/analysis/runtime-setters.mjs +114 -0
- package/dist/analysis/scenario-keys.mjs +151 -0
- package/dist/analysis/service.mjs +111 -70
- package/dist/analysis/standalone.mjs +40 -37
- package/dist/analysis/styling-ownership.mjs +298 -0
- package/dist/analysis/svg-attributes.mjs +199 -0
- package/dist/analysis/syntax.mjs +82 -78
- package/dist/analysis/visual-bindings.mjs +68 -0
- package/dist/analysis/worker-protocol.mjs +302 -0
- package/dist/analysis/worker.mjs +234 -166
- package/dist/api-signature.mjs +53 -0
- package/dist/app-icon-checks.mjs +298 -0
- package/dist/app-icon-declaration.d.mts +53 -0
- package/dist/app-icon-declaration.mjs +66 -0
- package/dist/asset-binding.mjs +35 -0
- package/dist/asset-catalog.mjs +83 -0
- package/dist/asset-declaration.d.mts +42 -0
- package/dist/asset-declaration.mjs +108 -0
- package/dist/asset-macro.d.mts +63 -0
- package/dist/asset-macro.mjs +22 -0
- package/dist/asset-model.mjs +74 -0
- package/dist/asset-usage.mjs +14 -0
- package/dist/asset-view-facts.mjs +41 -0
- package/dist/authoring-macro.d.mts +11 -0
- package/dist/authoring-macro.mjs +21 -0
- package/dist/autocomplete-hints.mjs +31 -0
- package/dist/availability.mjs +9 -0
- package/dist/behavior-macro.d.mts +31 -0
- package/dist/behavior-macro.mjs +3 -0
- package/dist/behavior-registry.mjs +358 -0
- package/dist/boundaries.mjs +50 -212
- package/dist/browser-runtime.mjs +73 -0
- package/dist/browser-test.d.mts +3 -0
- package/dist/browser-test.mjs +2 -0
- package/dist/bun-bundler.mjs +10 -0
- package/dist/bun-compiler.mjs +30 -18
- package/dist/bun-runtime.mjs +4 -0
- package/dist/bun-worker.mjs +10 -4
- package/dist/capture/request.mjs +81 -0
- package/dist/capture/worker.mjs +69 -40
- package/dist/capture/worker.page.mjs +6 -0
- package/dist/capture-store.mjs +159 -75
- package/dist/capture.mjs +232 -95
- package/dist/check-service.mjs +27 -33
- package/dist/check.mjs +206 -904
- package/dist/cli-arguments.mjs +278 -0
- package/dist/cli.mjs +374 -304
- package/dist/color-values.mjs +294 -242
- package/dist/composed-contrast.mjs +648 -0
- package/dist/composed-keyline.mjs +107 -0
- package/dist/config.mjs +162 -468
- package/dist/construction-output.mjs +345 -0
- package/dist/construction-spec.d.mts +915 -0
- package/dist/construction-spec.mjs +1178 -0
- package/dist/corner-overpaint.mjs +53 -0
- package/dist/css-length.mjs +80 -0
- package/dist/css-quantity.mjs +173 -0
- package/dist/deletion-model.mjs +56 -0
- package/dist/deletion-plan.mjs +364 -0
- package/dist/dependency-manifest.mjs +56 -0
- package/dist/design-context-model.d.mts +61 -0
- package/dist/design-context-model.mjs +79 -0
- package/dist/design-contexts.mjs +105 -0
- package/dist/design-foundation.mjs +532 -0
- package/dist/design-inputs.mjs +156 -0
- package/dist/design-modules.mjs +27 -0
- package/dist/design-rejection.d.mts +23 -0
- package/dist/design-rejection.mjs +29 -0
- package/dist/design-system-closure.mjs +108 -0
- package/dist/design-usage.mjs +54 -0
- package/dist/development-modules.mjs +2 -0
- package/dist/development-runtime.mjs +0 -7
- package/dist/digest.mjs +2 -0
- package/dist/draft-boundary.mjs +1 -27
- package/dist/draft-workspace.mjs +11 -5
- package/dist/emit/accept.mjs +33 -0
- package/dist/emit/app-icon-emission.mjs +124 -0
- package/dist/emit/app-icon-render.mjs +126 -0
- package/dist/emit/asset-imports.mjs +18 -0
- package/dist/emit/cli-report.mjs +97 -0
- package/dist/emit/contract.mjs +136 -0
- package/dist/emit/emission.mjs +182 -0
- package/dist/emit/font-emission.mjs +111 -0
- package/dist/emit/foundation-sheet.mjs +56 -0
- package/dist/emit/icon-containers.mjs +46 -0
- package/dist/emit/integrity.mjs +61 -0
- package/dist/emit/lock.mjs +66 -0
- package/dist/emit/namespace.mjs +79 -0
- package/dist/emit/operation-reply.mjs +3 -0
- package/dist/emit/operation.mjs +36 -0
- package/dist/emit/output-location.mjs +20 -0
- package/dist/emit/output-package.mjs +7 -0
- package/dist/emit/owner-emission-cache.mjs +52 -0
- package/dist/emit/palette-module.mjs +19 -0
- package/dist/emit/palette-refresh.mjs +77 -0
- package/dist/emit/preview-emitter.mjs +110 -0
- package/dist/emit/preview-tree.mjs +174 -0
- package/dist/emit/scheduler.mjs +75 -0
- package/dist/emit/service.mjs +249 -0
- package/dist/emit/sync.mjs +38 -0
- package/dist/emit/watch.mjs +74 -0
- package/dist/emit/writer.mjs +102 -0
- package/dist/evidence.mjs +6 -8
- package/dist/example-babel.mjs +7 -0
- package/dist/example-literals.mjs +88 -0
- package/dist/finding-rules.mjs +78 -77
- package/dist/focus-checks.mjs +93 -0
- package/dist/font-checks.mjs +185 -0
- package/dist/font-declaration.d.mts +64 -0
- package/dist/font-declaration.mjs +99 -0
- package/dist/font-fallback.d.mts +37 -0
- package/dist/font-fallback.mjs +25 -0
- package/dist/font-macro.d.mts +42 -0
- package/dist/font-macro.mjs +6 -0
- package/dist/font-metrics.d.mts +34 -0
- package/dist/font-metrics.mjs +314 -0
- package/dist/font-model.mjs +63 -0
- package/dist/form-states.mjs +82 -0
- package/dist/foundation-macro.d.mts +108 -0
- package/dist/foundation-macro.mjs +6 -0
- package/dist/frame-regions.mjs +253 -0
- package/dist/glyph-set-declaration.d.mts +27 -0
- package/dist/glyph-set-declaration.mjs +36 -0
- package/dist/grid-checks.mjs +94 -0
- package/dist/grid-facts.mjs +148 -0
- package/dist/grid-lowering.mjs +263 -0
- package/dist/guard/cli.mjs +51 -0
- package/dist/guard/config.mjs +67 -0
- package/dist/guard/files.mjs +31 -0
- package/dist/guard/index.mjs +3 -0
- package/dist/guard/run.mjs +56 -0
- package/dist/guard/tsconfig.declarations.json +13 -0
- package/dist/index.mjs +2 -7
- package/dist/init-project.mjs +134 -0
- package/dist/init.mjs +217 -264
- package/dist/input-digests.mjs +109 -163
- package/dist/input-scope.mjs +18 -41
- package/dist/inspected-svg.d.mts +28 -0
- package/dist/inspected-svg.mjs +40 -0
- package/dist/inventories.mjs +149 -0
- package/dist/inventory-query.mjs +15 -0
- package/dist/investigations.mjs +177 -99
- package/dist/json.d.mts +10 -0
- package/dist/json.mjs +36 -0
- package/dist/linaria/atomic-processor.json +96 -0
- package/dist/linaria/atomic-processor.mjs +2452 -0
- package/dist/linaria/backend-identity.mjs +26 -0
- package/dist/linaria/compatibility.json +61 -0
- package/dist/linaria/css-shape.mjs +94 -0
- package/dist/linaria/custom-property-css.mjs +56 -0
- package/dist/linaria/delivery.mjs +111 -0
- package/dist/linaria/direct-extract.mjs +43 -0
- package/dist/linaria/extraction-cache.mjs +31 -0
- package/dist/linaria/extraction-model.mjs +5 -0
- package/dist/linaria/fingerprint.mjs +183 -0
- package/dist/linaria/pair-manifest.json +2315 -0
- package/dist/linaria/persisted-extraction-cache.mjs +352 -0
- package/dist/linaria/preservation.mjs +13 -0
- package/dist/linaria/priority-emitted-rank.mjs +40 -0
- package/dist/linaria/priority-manifest.mjs +87 -0
- package/dist/linaria/priority-table.mjs +47 -0
- package/dist/linaria/priority-tiers.mjs +27 -0
- package/dist/linaria/processor-host.mjs +42 -0
- package/dist/linaria/processor-runtime.mjs +36 -0
- package/dist/linaria-processor-NOTICES.md +147 -0
- package/dist/lowering-components.mjs +14 -0
- package/dist/lowering-effects.mjs +38 -0
- package/dist/lowering-emitter.mjs +29 -0
- package/dist/lowering-enter.mjs +31 -0
- package/dist/lowering-hidden.mjs +30 -0
- package/dist/lowering-layer.mjs +141 -0
- package/dist/lowering-motion.mjs +37 -0
- package/dist/lowering-normalize.mjs +194 -0
- package/dist/lowering-overlaps.mjs +328 -0
- package/dist/lowering-paint.mjs +32 -0
- package/dist/lowering-properties.mjs +165 -0
- package/dist/lowering-region-layout.mjs +225 -0
- package/dist/lowering-sequence.mjs +89 -0
- package/dist/lowering-serialize.mjs +40 -0
- package/dist/lowering-session.mjs +137 -0
- package/dist/lowering-tiers.mjs +23 -0
- package/dist/lowering-transitions.mjs +53 -0
- package/dist/mcp/ads-mcp.mjs +423 -0
- package/dist/mcp/apps.mjs +3 -25
- package/dist/mcp/behavior-pages.mjs +58 -51
- package/dist/mcp/build-status.mjs +233 -267
- package/dist/mcp/catalog.mjs +21 -128
- package/dist/mcp/compiler-channel.mjs +218 -83
- package/dist/mcp/context.mjs +50 -40
- package/dist/mcp/deletions.mjs +147 -0
- package/dist/mcp/draft-discovery.mjs +43 -38
- package/dist/mcp/drafts.mjs +635 -691
- package/dist/mcp/execution-context.mjs +33 -22
- package/dist/mcp/execution-coordinator.mjs +367 -354
- package/dist/mcp/execution-results.mjs +440 -173
- package/dist/mcp/mutation-limits.mjs +1 -2
- package/dist/mcp/mutations.mjs +515 -553
- package/dist/mcp/patch.mjs +117 -75
- package/dist/mcp/preview-http.bundle.js +3 -7
- package/dist/mcp/preview-http.mjs +220 -107
- package/dist/mcp/preview-owner-guard.mjs +81 -43
- package/dist/mcp/preview-watch.mjs +428 -365
- package/dist/mcp/preview-widget.bundle.js +42 -46
- package/dist/mcp/preview-work.mjs +25 -13
- package/dist/mcp/prompts.mjs +22 -16
- package/dist/mcp/resource-loader.js +1 -1
- package/dist/mcp/result-pages.mjs +94 -54
- package/dist/mcp/sandbox-host.mjs +41 -19
- package/dist/mcp/server-discovery.mjs +96 -0
- package/dist/mcp/server-guides.mjs +43 -0
- package/dist/mcp/server-host.mjs +203 -0
- package/dist/mcp/server-observation.mjs +225 -0
- package/dist/mcp/server-project.mjs +371 -0
- package/dist/mcp/server-resources.mjs +466 -0
- package/dist/mcp/server-shared.mjs +79 -0
- package/dist/mcp/server-tools.mjs +791 -0
- package/dist/mcp/server.mjs +2 -2813
- package/dist/mcp/showcase-host.mjs +209 -135
- package/dist/mcp/showcase-http.mjs +50 -28
- package/dist/mcp/skills.mjs +32 -36
- package/dist/mcp/text-diff.mjs +18 -36
- package/dist/measured-geometry.mjs +157 -0
- package/dist/motion-model.mjs +52 -0
- package/dist/non-text-contrast.mjs +118 -0
- package/dist/owner-analysis-check.mjs +711 -0
- package/dist/owner-design.mjs +15 -0
- package/dist/owner-errors.mjs +216 -0
- package/dist/owner-lowering.mjs +206 -0
- package/dist/owner-scenarios.mjs +854 -0
- package/dist/ownership-model.d.mts +6 -0
- package/dist/ownership-model.mjs +143 -0
- package/dist/package-declarations.mjs +34 -0
- package/dist/paint-contrast.mjs +186 -0
- package/dist/palette-generated.mjs +101 -116
- package/dist/pictogram-model.mjs +13 -51
- package/dist/placeholder-contrast.mjs +35 -0
- package/dist/platform-features.mjs +401 -0
- package/dist/press-scale.mjs +26 -0
- package/dist/preview-bun.mjs +334 -404
- package/dist/preview-compile-inputs.mjs +78 -0
- package/dist/preview-contexts.mjs +7 -0
- package/dist/preview-controls.mjs +35 -0
- package/dist/preview-failure.mjs +20 -10
- package/dist/preview-files.mjs +18 -36
- package/dist/preview-imports.mjs +76 -70
- package/dist/preview-incremental.mjs +322 -222
- package/dist/preview-inputs.mjs +26 -26
- package/dist/preview-manifest-update.mjs +67 -49
- package/dist/preview-requests.mjs +10 -17
- package/dist/preview-resources.mjs +275 -323
- package/dist/preview-scope.mjs +15 -17
- package/dist/preview-source.mjs +182 -0
- package/dist/preview-spatial.mjs +27 -0
- package/dist/profile-macro.d.mts +56 -0
- package/dist/profile-macro.mjs +6 -0
- package/dist/profile-model.d.mts +65 -0
- package/dist/profile-model.mjs +213 -0
- package/dist/profile-view-facts.mjs +93 -0
- package/dist/program-cache.mjs +9 -7
- package/dist/project-boundary.mjs +8 -13
- package/dist/project-documents.mjs +25 -29
- package/dist/property-registrations.mjs +44 -35
- package/dist/prose-model.d.mts +81 -0
- package/dist/prose-model.mjs +101 -0
- package/dist/public-catalog.mjs +76 -0
- package/dist/recipe-defaults.mjs +117 -0
- package/dist/recipe-macro.d.mts +502 -0
- package/dist/recipe-macro.mjs +23 -0
- package/dist/recipe-model.d.mts +26 -0
- package/dist/recipe-model.mjs +214 -0
- package/dist/region-lowering.mjs +723 -0
- package/dist/registration-css.mjs +41 -0
- package/dist/registration-roles.mjs +35 -0
- package/dist/render-audit/axe-run.page.mjs +28 -0
- package/dist/render-audit/corner-overpaint.page.mjs +54 -0
- package/dist/render-audit/first-render.page.mjs +35 -0
- package/dist/render-audit/image-shape.page.mjs +42 -0
- package/dist/render-audit/layout-overflow.page.mjs +240 -0
- package/dist/render-audit/layout-shift.page.mjs +36 -0
- package/dist/render-audit/non-text-contrast.page.mjs +138 -0
- package/dist/render-audit/render-states.mjs +66 -293
- package/dist/render-audit/render-states.page.mjs +177 -0
- package/dist/render-audit/text-scale.mjs +42 -0
- package/dist/render-audit/text-scale.page.mjs +25 -0
- package/dist/render-audit/worker.mjs +130 -112
- package/dist/render-audit/worker.page.mjs +21 -0
- package/dist/render-audit.mjs +490 -500
- package/dist/resource-limits.mjs +174 -223
- package/dist/result.d.mts +34 -0
- package/dist/result.mjs +60 -0
- package/dist/role-vocabulary.d.mts +260 -0
- package/dist/role-vocabulary.mjs +258 -0
- package/dist/runtime-paint-contrast.mjs +97 -0
- package/dist/runtime-paint.mjs +42 -0
- package/dist/runtime-requirements.mjs +10 -11
- package/dist/runtime-style.mjs +21 -0
- package/dist/scenario-groups.mjs +42 -33
- package/dist/scenario-inspector.mjs +4 -4
- package/dist/scenario-kit.d.mts +85 -0
- package/dist/scenario-kit.mjs +18 -0
- package/dist/scenario-registry-model.mjs +2 -0
- package/dist/scenario-registry.mjs +89 -108
- package/dist/scenarios-compiler.mjs +875 -662
- package/dist/scheme-switch.d.mts +8 -0
- package/dist/scheme-switch.mjs +1 -0
- package/dist/showcase/ads-views.mjs +166 -0
- package/dist/showcase/assets-view.mjs +252 -0
- package/dist/showcase/client.bundle.js +211 -48
- package/dist/showcase/guide-controls.d.mts +28 -0
- package/dist/showcase/guide-controls.mjs +31 -0
- package/dist/showcase/http-client.bundle.js +172 -9
- package/dist/showcase/index.html +1 -1
- package/dist/showcase/preview-frame.css +18 -0
- package/dist/showcase/preview-frame.d.mts +5 -0
- package/dist/showcase/preview-frame.mjs +4 -0
- package/dist/showcase/preview-root.d.mts +2 -0
- package/dist/showcase/preview-root.mjs +9 -0
- package/dist/showcase/profiles-view.mjs +321 -0
- package/dist/showcase/project-rules.mjs +9 -0
- package/dist/showcase/sandbox.bundle.js +1 -1
- package/dist/showcase/scenario-page.d.mts +49 -0
- package/dist/showcase/scenario-page.mjs +105 -0
- package/dist/showcase/style.css +2 -0
- package/dist/showcase/token-sample.mjs +89 -0
- package/dist/showcase/tokens-view.mjs +233 -0
- package/dist/showcase/ui/apple-touch-icon-9zwv3w79.png +0 -0
- package/dist/showcase/{favicon.ico → ui/favicon-c2c9kvtf.ico} +0 -0
- package/dist/showcase/ui/icon-192-t5zh7mxx.png +0 -0
- package/dist/showcase/ui/icon-512-ed6yz0n0.png +0 -0
- package/dist/showcase/ui/ui.css +1 -1353
- package/dist/showcase/ui/ui.js +165 -1064
- package/dist/showcase-http-routes.mjs +28 -21
- package/dist/skills/README.md +28 -28
- package/dist/skills/ads-designer/README.md +1 -1
- package/dist/skills/ads-designer/SKILL.md +313 -551
- package/dist/skills/ads-designer/references/accessibility.md +162 -114
- package/dist/skills/ads-designer/references/atomic-styles.md +72 -277
- package/dist/skills/ads-designer/references/behaviors.md +144 -280
- package/dist/skills/ads-designer/references/branding.md +137 -222
- package/dist/skills/ads-designer/references/captures.md +13 -7
- package/dist/skills/ads-designer/references/cli.md +80 -63
- package/dist/skills/ads-designer/references/contracts.md +225 -286
- package/dist/skills/ads-designer/references/design-craft.md +2 -2
- package/dist/skills/ads-designer/references/design-data.md +299 -323
- package/dist/skills/ads-designer/references/drafts.md +83 -22
- package/dist/skills/ads-designer/references/evidence.md +2 -1
- package/dist/skills/ads-designer/references/forms.md +199 -0
- package/dist/skills/ads-designer/references/guarded-editing.md +37 -48
- package/dist/skills/ads-designer/references/layers.md +64 -76
- package/dist/skills/ads-designer/references/layout.md +224 -330
- package/dist/skills/ads-designer/references/mobile.md +2 -2
- package/dist/skills/ads-designer/references/motion.md +66 -25
- package/dist/skills/ads-designer/references/performance.md +55 -50
- package/dist/skills/ads-designer/references/pictograms.md +62 -127
- package/dist/skills/ads-designer/references/recipes.md +368 -0
- package/dist/skills/ads-designer/references/review.md +51 -95
- package/dist/skills/ads-designer/references/runtimes.md +34 -33
- package/dist/skills/ads-designer/references/scenarios.md +256 -216
- package/dist/skills/ads-designer/references/stress-test.md +13 -5
- package/dist/skills/ads-designer/references/validation.md +28 -21
- package/dist/skills/ads-designer/references/workflows.md +7 -5
- package/dist/skills/ads-import/SKILL.md +29 -29
- package/dist/skills/ads-import/references/atomic-styles.md +72 -277
- package/dist/skills/ads-import/references/behaviors.md +144 -280
- package/dist/skills/ads-import/references/branding.md +24 -41
- package/dist/skills/ads-import/references/captures.md +13 -7
- package/dist/skills/ads-import/references/cli.md +80 -63
- package/dist/skills/ads-import/references/compatibility.md +3 -3
- package/dist/skills/ads-import/references/contracts.md +225 -286
- package/dist/skills/ads-import/references/design-data.md +299 -323
- package/dist/skills/ads-import/references/drafts.md +83 -22
- package/dist/skills/ads-import/references/evidence.md +2 -1
- package/dist/skills/ads-import/references/forms.md +199 -0
- package/dist/skills/ads-import/references/guarded-editing.md +37 -48
- package/dist/skills/ads-import/references/implementation.md +20 -20
- package/dist/skills/ads-import/references/layers.md +64 -76
- package/dist/skills/ads-import/references/layout.md +224 -330
- package/dist/skills/ads-import/references/recipes.md +368 -0
- package/dist/skills/ads-import/references/review.md +51 -95
- package/dist/skills/ads-import/references/runtimes.md +34 -33
- package/dist/skills/ads-import/references/scenarios.md +256 -216
- package/dist/skills/ads-import/references/tokens.md +26 -17
- package/dist/skills/ads-import/references/validation.md +28 -21
- package/dist/skills/ads-import/references/workflows.md +7 -5
- package/dist/skills/ads-migrate/SKILL.md +20 -5
- package/dist/skills/ads-migrate/references/0.4.1-to-0.4.2.md +6 -0
- package/dist/skills/ads-migrate/references/0.4.7-to-0.5.0-boundary.md +71 -0
- package/dist/skills/ads-migrate/references/0.4.7-to-0.5.0-grid.md +204 -0
- package/dist/skills/ads-migrate/references/0.4.7-to-0.5.0.md +727 -0
- package/dist/skills/ads-migrate/references/0.5.0-to-0.5.1.md +239 -0
- package/dist/skills/ads-port/SKILL.md +27 -28
- package/dist/skills/ads-port/references/atomic-styles.md +72 -277
- package/dist/skills/ads-port/references/behaviors.md +144 -280
- package/dist/skills/ads-port/references/captures.md +13 -7
- package/dist/skills/ads-port/references/cli.md +80 -63
- package/dist/skills/ads-port/references/contracts.md +225 -286
- package/dist/skills/ads-port/references/design-data.md +299 -323
- package/dist/skills/ads-port/references/drafts.md +83 -22
- package/dist/skills/ads-port/references/evidence.md +2 -1
- package/dist/skills/ads-port/references/forms.md +199 -0
- package/dist/skills/ads-port/references/guarded-editing.md +37 -48
- package/dist/skills/ads-port/references/layers.md +64 -76
- package/dist/skills/ads-port/references/layout.md +224 -330
- package/dist/skills/ads-port/references/lint-and-docs.md +2 -3
- package/dist/skills/ads-port/references/native-implementation.md +23 -33
- package/dist/skills/ads-port/references/recipes.md +368 -0
- package/dist/skills/ads-port/references/review.md +51 -95
- package/dist/skills/ads-port/references/runtimes.md +34 -33
- package/dist/skills/ads-port/references/scenarios.md +256 -216
- package/dist/skills/ads-port/references/validation.md +28 -21
- package/dist/skills/ads-port/references/workflows.md +7 -5
- package/dist/source-inventory.mjs +33 -0
- package/dist/source-values.mjs +272 -262
- package/dist/spatial-css.mjs +403 -0
- package/dist/spatial-metadata.mjs +11 -11
- package/dist/spatial-model.mjs +438 -0
- package/dist/spatial-reading.mjs +127 -0
- package/dist/stage-timing.mjs +27 -0
- package/dist/state-conditions.d.mts +80 -0
- package/dist/state-conditions.mjs +107 -0
- package/dist/static-values.mjs +94 -0
- package/dist/surface-contrast.mjs +252 -0
- package/dist/surface-effects.mjs +98 -0
- package/dist/target-size.mjs +177 -0
- package/dist/task-cache.mjs +142 -136
- package/dist/task-worker.mjs +18 -18
- package/dist/test-boundaries.mjs +50 -189
- package/dist/token-checks.mjs +21 -0
- package/dist/token-dtcg.mjs +136 -0
- package/dist/token-expression.mjs +19 -0
- package/dist/token-inventory.mjs +146 -0
- package/dist/token-operations.mjs +37 -0
- package/dist/token-overlap.mjs +29 -0
- package/dist/token-provenance.mjs +260 -0
- package/dist/token-references.mjs +71 -0
- package/dist/token-registrations.mjs +116 -0
- package/dist/token-resolution.mjs +38 -0
- package/dist/token-sections.mjs +123 -0
- package/dist/token-shapes.mjs +121 -0
- package/dist/token-sheet-check.mjs +54 -0
- package/dist/token-type-check.mjs +89 -0
- package/dist/token-view-facts.mjs +111 -0
- package/dist/tsconfig.declarations.json +24 -0
- package/dist/types/css-tree.d.ts +45 -0
- package/dist/ui-framework.mjs +34 -34
- package/dist/units.mjs +186 -226
- package/dist/unknown.d.mts +9 -0
- package/dist/unknown.mjs +13 -0
- package/dist/unreached-sources.mjs +5 -0
- package/dist/validation-checks.mjs +62 -71
- package/dist/validation-inputs.mjs +209 -279
- package/dist/validation.mjs +132 -159
- package/dist/verification/browser.d.mts +21 -25
- package/dist/verification/browser.mjs +281 -124
- package/dist/verification/browser.page.d.mts +22 -0
- package/dist/verification/browser.page.mjs +19 -0
- package/dist/verification/paint-audit.page.d.mts +55 -0
- package/dist/verification/paint-audit.page.mjs +144 -0
- package/dist/verification/playwright-reporter.mjs +160 -0
- package/dist/verification/preview-startup.d.mts +51 -0
- package/dist/verification/preview-startup.mjs +76 -0
- package/dist/verification/request.d.mts +28 -0
- package/dist/verification/request.mjs +30 -0
- package/dist/verification/unit-preload.mjs +37 -0
- package/dist/verification.mjs +574 -607
- package/docs/ADS.md +585 -565
- package/docs/ARCHITECTURE.md +2002 -1384
- package/docs/ASSETS.md +487 -0
- package/docs/BEHAVIORS.md +339 -370
- package/docs/CACHING.md +365 -154
- package/docs/CHANGELOG.md +462 -21
- package/docs/COMPARISON.md +21 -26
- package/docs/DESIGN-REFERENCES.md +40 -27
- package/docs/GUIDE.md +2473 -1292
- package/docs/LANGUAGE.md +1159 -0
- package/docs/LOWERING.md +180 -0
- package/docs/MCP.md +1461 -1179
- package/docs/MOTION.md +491 -0
- package/docs/PROFILE-KINDS.md +544 -0
- package/docs/PROFILES.md +176 -0
- package/docs/RULES.md +590 -0
- package/docs/TOKEN-ROLES.md +377 -0
- package/docs/benchmarks/README.md +26 -27
- package/package.json +59 -45
- package/dist/a11y.mjs +0 -187
- package/dist/assets.mjs +0 -159
- package/dist/atomic-composition.mjs +0 -337
- package/dist/atomic-trace.mjs +0 -162
- package/dist/behavior-libraries.mjs +0 -174
- package/dist/behaviors.mjs +0 -306
- package/dist/brand-assets.mjs +0 -458
- package/dist/brands.mjs +0 -141
- package/dist/component-contrast.mjs +0 -256
- package/dist/construction-styles.cjs +0 -10
- package/dist/contracts/foundation.json +0 -211
- package/dist/contracts/tokens.json +0 -52
- package/dist/contracts.d.mts +0 -30
- package/dist/contrast-composition.mjs +0 -80
- package/dist/contrast-styles.mjs +0 -88
- package/dist/control-padding.mjs +0 -113
- package/dist/css-values.mjs +0 -27
- package/dist/declarative-flow.mjs +0 -244
- package/dist/design-values.mjs +0 -173
- package/dist/font-rules.mjs +0 -108
- package/dist/fonts-generated.mjs +0 -112
- package/dist/foundation-views.mjs +0 -242
- package/dist/foundation.mjs +0 -154
- package/dist/generated-entries.mjs +0 -198
- package/dist/html.mjs +0 -30
- package/dist/icons.mjs +0 -154
- package/dist/image-attributes.mjs +0 -187
- package/dist/image-size.mjs +0 -28
- package/dist/layers.mjs +0 -461
- package/dist/layout-widths.mjs +0 -332
- package/dist/linaria/atomic-css.cjs +0 -2
- package/dist/linaria/atomic-styled.cjs +0 -2
- package/dist/linaria/preserve-values.cjs +0 -58
- package/dist/linaria/spatial-inputs.cjs +0 -56
- package/dist/linaria.d.mts +0 -1
- package/dist/linaria.mjs +0 -9
- package/dist/lockup-composition.mjs +0 -44
- package/dist/lockup-model.cjs +0 -64
- package/dist/paint-contracts.mjs +0 -216
- package/dist/pictograms.mjs +0 -52
- package/dist/public-api.mjs +0 -121
- package/dist/public-props.mjs +0 -91
- package/dist/render-audit/axe-run.mjs +0 -17
- package/dist/render-audit/first-render.mjs +0 -40
- package/dist/render-audit/image-shape.mjs +0 -46
- package/dist/render-audit/layout-overflow.mjs +0 -167
- package/dist/render-audit/layout-shift.mjs +0 -32
- package/dist/render-audit/non-text-contrast.mjs +0 -151
- package/dist/render-audit/pictograms.mjs +0 -88
- package/dist/render-color-probe.mjs +0 -202
- package/dist/render-composition.mjs +0 -186
- package/dist/runtime-contracts.mjs +0 -506
- package/dist/scenario-program.mjs +0 -19
- package/dist/scenario-selectors.mjs +0 -237
- package/dist/scenario-slots.mjs +0 -217
- package/dist/scenario-trace.mjs +0 -314
- package/dist/scenarios-vite.d.mts +0 -2
- package/dist/scenarios-vite.mjs +0 -2
- package/dist/scenarios.mjs +0 -616
- package/dist/selector-match.mjs +0 -94
- package/dist/showcase/comparison.js +0 -48
- package/dist/showcase/connection.js +0 -10
- package/dist/showcase/draft-navigation.js +0 -59
- package/dist/showcase/foundation-view.css +0 -58
- package/dist/showcase/foundation-view.mjs +0 -255
- package/dist/showcase/guide-controls.ads.review.mjs +0 -32
- package/dist/showcase/http-connection.js +0 -86
- package/dist/showcase/http-preview.js +0 -81
- package/dist/showcase/icons.js +0 -2
- package/dist/showcase/navigation.js +0 -13
- package/dist/showcase/pictogram-view.mjs +0 -53
- package/dist/showcase/preview-frame.ads.review.css +0 -46
- package/dist/showcase/preview-frame.ads.review.d.mts +0 -11
- package/dist/showcase/preview-frame.ads.review.mjs +0 -22
- package/dist/showcase/preview-state.js +0 -11
- package/dist/showcase/refresh-scheduler.js +0 -23
- package/dist/showcase/resource-reader.js +0 -37
- package/dist/showcase-coverage.mjs +0 -139
- package/dist/source-symbols.mjs +0 -4
- package/dist/spatial-composition.mjs +0 -322
- package/dist/spatial-contexts.cjs +0 -56
- package/dist/spatial-css.cjs +0 -351
- package/dist/spatial-inputs.cjs +0 -80
- package/dist/spatial-model.cjs +0 -322
- package/dist/spatial.mjs +0 -21
- package/dist/stage-timing.cjs +0 -21
- package/dist/starters/preact/design-system/patterns/Conversation/Conversation.tsx +0 -105
- package/dist/starters/preact/design-system/patterns/Shell/Shell.tsx +0 -275
- package/dist/starters/preact/design-system/review/demo-frame/DemoFrame.ads.review.tsx +0 -7
- package/dist/starters/preact/design-system/review/screen-frame/ScreenFrame.ads.review.tsx +0 -10
- package/dist/starters/preact/design-system/showcase/mcp/main.ads.mount.tsx +0 -8
- package/dist/starters/preact/ds.config.json +0 -37
- package/dist/starters/preact/package.json +0 -35
- package/dist/starters/preact/src/vite-env.d.ts +0 -7
- package/dist/starters/preact/tsconfig.json +0 -35
- package/dist/starters/preact/vite.config.ts +0 -23
- package/dist/starters/react/ADS.md +0 -286
- package/dist/starters/react/README.md +0 -184
- package/dist/starters/react/biome.css.json +0 -21
- package/dist/starters/react/design-system/assets/brand/README.md +0 -41
- package/dist/starters/react/design-system/assets/brand/app-icon.svg +0 -4
- package/dist/starters/react/design-system/assets/brand/logo.dark.svg +0 -6
- package/dist/starters/react/design-system/assets/brand/logo.svg +0 -6
- package/dist/starters/react/design-system/assets/glyphs/README.md +0 -15
- package/dist/starters/react/design-system/assets/glyphs/aliases.json +0 -1
- package/dist/starters/react/design-system/assets/glyphs/check.svg +0 -1
- package/dist/starters/react/design-system/assets/glyphs/chevron-down.svg +0 -1
- package/dist/starters/react/design-system/assets/glyphs/chevron-right.svg +0 -1
- package/dist/starters/react/design-system/assets/glyphs/close.svg +0 -1
- package/dist/starters/react/design-system/assets/glyphs/external-link.svg +0 -1
- package/dist/starters/react/design-system/assets/glyphs/info.svg +0 -1
- package/dist/starters/react/design-system/assets/glyphs/menu.svg +0 -1
- package/dist/starters/react/design-system/assets/glyphs/plus.svg +0 -1
- package/dist/starters/react/design-system/assets/glyphs/search.svg +0 -1
- package/dist/starters/react/design-system/assets/glyphs/warning.svg +0 -1
- package/dist/starters/react/design-system/assets/pictograms/catalog.ads.json +0 -13
- package/dist/starters/react/design-system/assets/pictograms/journey.dark.svg +0 -7
- package/dist/starters/react/design-system/assets/pictograms/journey.svg +0 -7
- package/dist/starters/react/design-system/components/Actions/Button/Button.ads.exports.ts +0 -1
- package/dist/starters/react/design-system/components/Actions/Button/Button.ads.fixture.ts +0 -1
- package/dist/starters/react/design-system/components/Actions/Button/Button.ads.scenario.tsx +0 -13
- package/dist/starters/react/design-system/components/Actions/Button/Button.tsx +0 -56
- package/dist/starters/react/design-system/components/Actions/Button/README.md +0 -12
- package/dist/starters/react/design-system/components/Actions/IconButton/IconButton.ads.exports.ts +0 -1
- package/dist/starters/react/design-system/components/Actions/IconButton/IconButton.ads.fixture.ts +0 -9
- package/dist/starters/react/design-system/components/Actions/IconButton/IconButton.ads.scenario.tsx +0 -16
- package/dist/starters/react/design-system/components/Actions/IconButton/IconButton.tsx +0 -60
- package/dist/starters/react/design-system/components/Actions/IconButton/README.md +0 -17
- package/dist/starters/react/design-system/components/Content/Icon/Icon.ads.exports.ts +0 -1
- package/dist/starters/react/design-system/components/Content/Icon/Icon.ads.fixture.ts +0 -6
- package/dist/starters/react/design-system/components/Content/Icon/Icon.ads.scenario.tsx +0 -16
- package/dist/starters/react/design-system/components/Content/Icon/Icon.tsx +0 -42
- package/dist/starters/react/design-system/components/Content/Icon/README.md +0 -17
- package/dist/starters/react/design-system/components/Content/Icon/glyphs.ts +0 -17
- package/dist/starters/react/design-system/components/Content/Image/Image.ads.exports.ts +0 -1
- package/dist/starters/react/design-system/components/Content/Image/Image.ads.fixture.ts +0 -2
- package/dist/starters/react/design-system/components/Content/Image/Image.ads.scenario.tsx +0 -13
- package/dist/starters/react/design-system/components/Content/Image/Image.tsx +0 -51
- package/dist/starters/react/design-system/components/Content/Image/README.md +0 -20
- package/dist/starters/react/design-system/components/Content/Logo/Logo.ads.exports.ts +0 -1
- package/dist/starters/react/design-system/components/Content/Logo/Logo.ads.fixture.ts +0 -1
- package/dist/starters/react/design-system/components/Content/Logo/Logo.ads.scenario.tsx +0 -12
- package/dist/starters/react/design-system/components/Content/Logo/Logo.tsx +0 -35
- package/dist/starters/react/design-system/components/Content/Logo/README.md +0 -12
- package/dist/starters/react/design-system/components/Content/Pictogram/Pictogram.ads.exports.ts +0 -1
- package/dist/starters/react/design-system/components/Content/Pictogram/Pictogram.ads.fixture.ts +0 -1
- package/dist/starters/react/design-system/components/Content/Pictogram/Pictogram.ads.scenario.tsx +0 -7
- package/dist/starters/react/design-system/components/Content/Pictogram/Pictogram.tsx +0 -26
- package/dist/starters/react/design-system/components/Forms/TextField/README.md +0 -14
- package/dist/starters/react/design-system/components/Forms/TextField/TextField.ads.exports.ts +0 -1
- package/dist/starters/react/design-system/components/Forms/TextField/TextField.ads.fixture.ts +0 -6
- package/dist/starters/react/design-system/components/Forms/TextField/TextField.ads.scenario.tsx +0 -13
- package/dist/starters/react/design-system/components/Forms/TextField/TextField.tsx +0 -61
- package/dist/starters/react/design-system/composition/Search/SearchPage/README.md +0 -4
- package/dist/starters/react/design-system/composition/Search/SearchPage/SearchPage.ads.fixture.ts +0 -7
- package/dist/starters/react/design-system/composition/Search/SearchPage/SearchPage.ads.scenario.tsx +0 -16
- package/dist/starters/react/design-system/composition/Workspace/WorkspacePage/README.md +0 -5
- package/dist/starters/react/design-system/composition/Workspace/WorkspacePage/WorkspacePage.ads.fixture.ts +0 -13
- package/dist/starters/react/design-system/composition/Workspace/WorkspacePage/WorkspacePage.ads.scenario.tsx +0 -22
- package/dist/starters/react/design-system/controllers/Palette/Palette.ads.exports.ts +0 -1
- package/dist/starters/react/design-system/controllers/Palette/Palette.ts +0 -164
- package/dist/starters/react/design-system/index.ts +0 -12
- package/dist/starters/react/design-system/patterns/Conversation/Conversation.ads.exports.ts +0 -1
- package/dist/starters/react/design-system/patterns/Conversation/Conversation.ads.fixture.ts +0 -7
- package/dist/starters/react/design-system/patterns/Conversation/Conversation.ads.scenario.tsx +0 -15
- package/dist/starters/react/design-system/patterns/Conversation/Conversation.tsx +0 -105
- package/dist/starters/react/design-system/patterns/Conversation/README.md +0 -9
- package/dist/starters/react/design-system/patterns/Search/SearchBar/README.md +0 -12
- package/dist/starters/react/design-system/patterns/Search/SearchBar/SearchBar.ads.exports.ts +0 -1
- package/dist/starters/react/design-system/patterns/Search/SearchBar/SearchBar.ads.fixture.ts +0 -1
- package/dist/starters/react/design-system/patterns/Search/SearchBar/SearchBar.ads.scenario.tsx +0 -11
- package/dist/starters/react/design-system/patterns/Search/SearchBar/SearchBar.tsx +0 -41
- package/dist/starters/react/design-system/patterns/Shell/Floating.ads.fixture.ts +0 -5
- package/dist/starters/react/design-system/patterns/Shell/Floating.ads.scenario.tsx +0 -21
- package/dist/starters/react/design-system/patterns/Shell/README.md +0 -43
- package/dist/starters/react/design-system/patterns/Shell/Shell.ads.exports.ts +0 -1
- package/dist/starters/react/design-system/patterns/Shell/Shell.ads.fixture.ts +0 -5
- package/dist/starters/react/design-system/patterns/Shell/Shell.ads.scenario.tsx +0 -21
- package/dist/starters/react/design-system/patterns/Shell/Shell.tsx +0 -274
- package/dist/starters/react/design-system/review/demo-frame/DemoFrame.ads.exports.ts +0 -1
- package/dist/starters/react/design-system/review/demo-frame/DemoFrame.ads.review.tsx +0 -7
- package/dist/starters/react/design-system/review/index.ads.review.ts +0 -4
- package/dist/starters/react/design-system/review/region-block/RegionBlock.ads.exports.ts +0 -1
- package/dist/starters/react/design-system/review/region-block/RegionBlock.ads.review.tsx +0 -6
- package/dist/starters/react/design-system/review/screen-frame/ScreenFrame.ads.exports.ts +0 -1
- package/dist/starters/react/design-system/review/screen-frame/ScreenFrame.ads.review.tsx +0 -10
- package/dist/starters/react/design-system/showcase/mcp/main.ads.mount.tsx +0 -10
- package/dist/starters/react/design-system/styles.css +0 -7
- package/dist/starters/react/design-system/tokens/base.css +0 -36
- package/dist/starters/react/design-system/tokens/catalog.ads.json +0 -1221
- package/dist/starters/react/design-system/tokens/colors.css +0 -215
- package/dist/starters/react/design-system/tokens/elevation.css +0 -53
- package/dist/starters/react/design-system/tokens/spacing.css +0 -87
- package/dist/starters/react/design-system/tokens/spatial.ads.json +0 -70
- package/dist/starters/react/design-system/tokens/themes.generated.css +0 -142
- package/dist/starters/react/design-system/tokens/themes.generated.ts +0 -402
- package/dist/starters/react/design-system/tokens/typography.css +0 -31
- package/dist/starters/react/ds.config.json +0 -37
- package/dist/starters/react/gitignore.template +0 -8
- package/dist/starters/react/package.json +0 -39
- package/dist/starters/react/scripts/build-mcp-previews.mjs +0 -3
- package/dist/starters/react/src/vite-env.d.ts +0 -7
- package/dist/starters/react/tsconfig.build.json +0 -20
- package/dist/starters/react/tsconfig.json +0 -34
- package/dist/starters/react/vite.config.ts +0 -23
- package/dist/style-boundaries.mjs +0 -106
- package/dist/style-token-rules.mjs +0 -51
- package/dist/themes-generated.mjs +0 -161
- package/dist/themes-watch.mjs +0 -83
- package/dist/themes.mjs +0 -360
- package/dist/token-export.mjs +0 -94
- package/dist/token-origins.mjs +0 -24
- package/dist/token-policy.mjs +0 -26
- package/dist/token-quality.mjs +0 -149
- package/dist/token-samples.mjs +0 -19
- package/dist/tokens.mjs +0 -194
- package/dist/unit-contracts.mjs +0 -396
- package/dist/usage.mjs +0 -184
- package/dist/verification/playwright-reporter.cjs +0 -87
- package/docs/CONTRACTS.md +0 -285
- package/docs/HTTP-SHOWCASE-POC.md +0 -397
- package/docs/SPATIAL-CHECKS.md +0 -69
- package/docs/benchmarks/http-showcase-optimized.json +0 -1879
- package/docs/benchmarks/http-showcase-profile.json +0 -308
- package/docs/benchmarks/http-showcase.json +0 -3069
- /package/dist/{starters/react/design-system/assets/fonts/.gitkeep → analysis/semantic.mjs} +0 -0
- /package/dist/{starters/react/design-system/controllers/.gitkeep → lowering-model.mjs} +0 -0
- /package/dist/showcase/{favicon.svg → ui/favicon-scavmehf.svg} +0 -0
package/dist/selector-match.mjs
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import selectorParser from "postcss-selector-parser";
|
|
2
|
-
|
|
3
|
-
const states = new Set([":hover", ":active", ":focus", ":focus-visible", ":focus-within", ":visited", ":link", ":any-link", ":enabled", ":disabled", ":checked", ":indeterminate", ":required", ":optional", ":valid", ":invalid", ":placeholder-shown", ":open"]);
|
|
4
|
-
|
|
5
|
-
/** Match bounded source DOM witnesses, not a browser cascade. Ownership requires
|
|
6
|
-
* a positive native tag or a :has binding to a real runtime-owned child marker. */
|
|
7
|
-
export function selectorWitness(selector, target, anchor, native) {
|
|
8
|
-
let steps = 0;
|
|
9
|
-
const yes = (typed )=>({typed});
|
|
10
|
-
const and = (a, b) => a === false || b === false ? false : !a || !b ? undefined : yes(a.typed || b.typed);
|
|
11
|
-
const any = results => results.find(value => value?.typed) ?? results.find(Boolean) ??( results.includes(undefined) ? undefined : false);
|
|
12
|
-
const descendants = (element, found = []) => {
|
|
13
|
-
if (found.length > 128) return found;
|
|
14
|
-
for (const child of element.children) { found.push(child); descendants(child, found); }
|
|
15
|
-
return found;
|
|
16
|
-
};
|
|
17
|
-
function simple(node, element, scope, binding) {
|
|
18
|
-
if (++steps > 2000 || !element) return undefined;
|
|
19
|
-
if (node.type === "comment") return yes(false);
|
|
20
|
-
if (node.type === "nesting") return element === anchor ? yes(false) : false;
|
|
21
|
-
if (node.type === "universal") return yes(false);
|
|
22
|
-
if (node.type === "tag") return !node.namespace && node.value.toLowerCase() === element.tag ? yes(element === native) : false;
|
|
23
|
-
if (node.type === "attribute") {
|
|
24
|
-
if (node.namespace || !element.attributes.has(node.attribute)) return false;
|
|
25
|
-
const actual = element.attributes.get(node.attribute);
|
|
26
|
-
if (actual === undefined) return undefined;
|
|
27
|
-
const owned=binding&&element.parent===native&&element.ownedAttributes?.has(node.attribute);
|
|
28
|
-
if (!node.operator) return yes(owned);
|
|
29
|
-
if (node.operator !== "=" || node.insensitive) return undefined;
|
|
30
|
-
return String(actual) === node.value ? yes(owned) : false;
|
|
31
|
-
}
|
|
32
|
-
if (node.type === "class" || node.type === "id") {
|
|
33
|
-
const value = element.attributes.get(node.type === "class" ? "className" : "id");
|
|
34
|
-
if (typeof value !== "string") return undefined;
|
|
35
|
-
return (node.type === "class" ? value.split(/\s+/).includes(node.value) : value === node.value) ? yes(false) : false;
|
|
36
|
-
}
|
|
37
|
-
if (node.type !== "pseudo" || node.value.startsWith("::")) return undefined;
|
|
38
|
-
if (node.value === ":scope") return element === scope ? yes(false) : false;
|
|
39
|
-
if (states.has(node.value) && !node.nodes?.length) return yes(false);
|
|
40
|
-
if ([":is", ":where"].includes(node.value)) return any(node.nodes.map(branch => match(branch.nodes, element, scope, binding)));
|
|
41
|
-
if (node.value === ":not") {
|
|
42
|
-
const matched = any(node.nodes.map(branch => match(branch.nodes, element, scope)));
|
|
43
|
-
return matched === false ? yes(false) : matched ? false : undefined;
|
|
44
|
-
}
|
|
45
|
-
if (node.value === ":has") {
|
|
46
|
-
const children = descendants(element);
|
|
47
|
-
if (children.length > 128) return undefined;
|
|
48
|
-
return any(node.nodes.flatMap(branch => {
|
|
49
|
-
const nodes = [selectorParser.pseudo({ value: ":scope" }), ...(branch.nodes[0]?.type === "combinator" ? [] : [selectorParser.combinator({ value: " " })]), ...branch.nodes];
|
|
50
|
-
return children.map(child => match(nodes, child, element,element===native));
|
|
51
|
-
}));
|
|
52
|
-
}
|
|
53
|
-
return undefined;
|
|
54
|
-
}
|
|
55
|
-
function match(nodes, element, scope, binding=false) {
|
|
56
|
-
if (++steps > 2000 || !element) return undefined;
|
|
57
|
-
const groups = [[]], combinators = [];
|
|
58
|
-
for (const node of nodes) {
|
|
59
|
-
if (node.type === "combinator") { combinators.push(node.value.trim() || " "); groups.push([]); }
|
|
60
|
-
else groups.at(-1).push(node);
|
|
61
|
-
}
|
|
62
|
-
if (groups.some(group => !group.length)) return undefined;
|
|
63
|
-
function part(index, current) {
|
|
64
|
-
if (!current || ++steps > 2000) return current ? undefined : false;
|
|
65
|
-
let result = yes(false);
|
|
66
|
-
for (const node of groups[index]) result = and(result, simple(node, current, scope,binding));
|
|
67
|
-
if (!result || !index) return result;
|
|
68
|
-
const candidates = [];
|
|
69
|
-
if (combinators[index - 1] === ">") candidates.push(current.parent);
|
|
70
|
-
else if (combinators[index - 1] === " ") { for (let parent = current.parent; parent && candidates.length < 32; parent = parent.parent) candidates.push(parent); }
|
|
71
|
-
else if (["+", "~"].includes(combinators[index - 1])) {
|
|
72
|
-
const siblings = current.parent?.children ?? [], position = siblings.indexOf(current);
|
|
73
|
-
candidates.push(...siblings.slice(combinators[index - 1] === "+" ? Math.max(0, position - 1) : 0, position));
|
|
74
|
-
} else return undefined;
|
|
75
|
-
return and(result, any(candidates.map(candidate => part(index - 1, candidate))));
|
|
76
|
-
}
|
|
77
|
-
return part(groups.length - 1, element);
|
|
78
|
-
}
|
|
79
|
-
try { return selectorParser().astSync(selector).nodes.some(branch => match(branch.nodes, target, anchor)?.typed); }
|
|
80
|
-
catch { return false; }
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/** Resolve CSS nesting with selector ASTs; never substitute project names. */
|
|
84
|
-
export function nestedSelectors(parents, selector) {
|
|
85
|
-
const children = selectorParser().astSync(selector).nodes;
|
|
86
|
-
const result = [];
|
|
87
|
-
for (const parent of parents) for (const child of children) {
|
|
88
|
-
if (result.length >= 32) return [];
|
|
89
|
-
const copy = child.clone(); let nested = false;
|
|
90
|
-
copy.walkNesting(node => { nested = true; node.replaceWith(selectorParser.pseudo({ value: ":is", nodes: selectorParser().astSync(parent).nodes.map(value => value.clone()) })); });
|
|
91
|
-
result.push(nested ? copy.toString() : `${parent} ${copy}`);
|
|
92
|
-
}
|
|
93
|
-
return result;
|
|
94
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { AppBridge, PostMessageTransport } from "./connection.js";
|
|
2
|
-
import { httpPreviewBridge } from "./http-preview.js";
|
|
3
|
-
|
|
4
|
-
/** Each version gets its own ordinary opaque MCP App, never another browser shell. */
|
|
5
|
-
export async function mountComparisonApp({slot,title,sandboxUrl,httpPreview=false,resourceUri,result,readResource,callTool,context,onError,onState}) {
|
|
6
|
-
const options={slot,title,sandboxUrl,httpPreview,resourceUri,readResource,callTool,context,onError,onState};
|
|
7
|
-
let latest=result,active,opening,restarting,closed=false;
|
|
8
|
-
function reopen(){
|
|
9
|
-
if(closed||restarting)return;
|
|
10
|
-
onState?.({state:"loading"});
|
|
11
|
-
restarting=Promise.resolve().then(async()=>{
|
|
12
|
-
await opening;
|
|
13
|
-
await active?.close();
|
|
14
|
-
if(closed)return;
|
|
15
|
-
opening=mountVersion({...options,result:latest,onReopen:reopen});
|
|
16
|
-
try{active=await opening;}finally{opening=undefined;}
|
|
17
|
-
}).catch(error=>{if(!closed)onError(error);}).finally(()=>{restarting=undefined;});
|
|
18
|
-
}
|
|
19
|
-
opening=mountVersion({...options,result:latest,onReopen:reopen});
|
|
20
|
-
try{active=await opening;}finally{opening=undefined;}
|
|
21
|
-
return{
|
|
22
|
-
async updateResult(value){latest=value;await restarting;if(!closed)await active.updateResult(latest);},
|
|
23
|
-
refreshContext(){if(!closed&&!restarting)active.refreshContext();},
|
|
24
|
-
receiveBuild(uri,report){if(!closed&&!restarting)active.receiveBuild?.(uri,report);},
|
|
25
|
-
reconcileBuild(){if(!closed&&!restarting)return active.reconcileBuild?.();},
|
|
26
|
-
async close(){closed=true;await restarting;await active?.close();},
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
async function mountVersion({slot,title,sandboxUrl,httpPreview,resourceUri,result,readResource,callTool,context,onError,onState,onReopen}){
|
|
31
|
-
let disposed=false;
|
|
32
|
-
const resource=httpPreview?undefined:await readResource({uri:resourceUri});
|
|
33
|
-
const content=resource?.contents.find(item=>item.mimeType==="text/html;profile=mcp-app"&&typeof item.text==="string");
|
|
34
|
-
if(!httpPreview&&!content)throw new Error("Comparison preview App is unavailable.");
|
|
35
|
-
const frame=document.createElement("iframe");frame.title=title;frame.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms");if(!httpPreview)frame.src=sandboxUrl;slot.append(frame);
|
|
36
|
-
const bridge=httpPreview?httpPreviewBridge({frame,context:context(frame),draftScope:result.structuredContent?.draftScope}):new AppBridge(null,{name:"ADS showcase",version:"1.0.0"},{serverResources:{},serverTools:{},logging:{}},{hostContext:context(frame)});
|
|
37
|
-
bridge.onreadresource=readResource;bridge.oncalltool=callTool;bridge.onerror=error=>{if(!disposed)onError(error);};
|
|
38
|
-
bridge.onloggingmessage=value=>{if(disposed||value.logger!=="ads-preview")return;if(value.data?.code==="ADS_PREVIEW_REOPEN"){onReopen();return;}onState?.(value.data);if(value.data?.state==="error")onError(new Error(value.data.message));};
|
|
39
|
-
let timer;
|
|
40
|
-
const initialized=new Promise((resolve,reject)=>{timer=setTimeout(()=>reject(new Error("Comparison App initialization timed out.")),15000);bridge.oninitialized=()=>{clearTimeout(timer);resolve();};});
|
|
41
|
-
if(!httpPreview)bridge.onsandboxready=()=>bridge.sendSandboxResourceReady({html:content.text,csp:content._meta?.ui?.csp,sandbox:"allow-scripts allow-forms"});
|
|
42
|
-
const observer=new ResizeObserver(()=>bridge.setHostContext(context(frame)));
|
|
43
|
-
try{
|
|
44
|
-
await Promise.all([bridge.connect(httpPreview?undefined:new PostMessageTransport(frame.contentWindow,frame.contentWindow)),initialized]);
|
|
45
|
-
observer.observe(frame);await bridge.sendToolInput({arguments:{}});await bridge.sendToolResult(result);
|
|
46
|
-
}catch(error){observer.disconnect();frame.remove();await bridge.close();throw error;}finally{clearTimeout(timer);}
|
|
47
|
-
return {updateResult:value=>bridge.sendToolResult(value),refreshContext:()=>bridge.setHostContext(context(frame)),receiveBuild:(uri,report)=>bridge.receiveBuild?.(uri,report),reconcileBuild:()=>bridge.reconcileBuild?.(),async close(){disposed=true;observer.disconnect();try{await bridge.teardownResource({},{timeout:500});}catch{/* A disconnected App may not acknowledge teardown. */}await bridge.close();frame.remove();}};
|
|
48
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Client, StreamableHTTPClientTransport } from "@modelcontextprotocol/client";
|
|
2
|
-
export { AppBridge, PostMessageTransport } from "@modelcontextprotocol/ext-apps/app-bridge";
|
|
3
|
-
export const httpTransport = false;
|
|
4
|
-
export function createClient() {
|
|
5
|
-
return new Client({ name: "ads-showcase", version: "1.0.0" }, {
|
|
6
|
-
versionNegotiation: { mode: "auto" },
|
|
7
|
-
capabilities: { extensions: { "io.modelcontextprotocol/ui": { mimeTypes: ["text/html;profile=mcp-app"] } } },
|
|
8
|
-
});
|
|
9
|
-
}
|
|
10
|
-
export const connectClient = client => client.connect(new StreamableHTTPClientTransport(new URL("mcp", location.href)));
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
export function ownsScenario(unit, id) {
|
|
2
|
-
return id === unit || id.startsWith(unit + "/") || id.startsWith(unit + ".");
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
/** Proposals remain attached to the ordinary catalogue, including new owners. */
|
|
6
|
-
export function withDraftEntries(scenarios, categories, drafts, previews = new Map()) {
|
|
7
|
-
const references = new Map(drafts.map(({ id, title, revision, state, preview }) => [id, { id, title, revision, state, ...(preview ? { preview } : {}) }]));
|
|
8
|
-
const entries = new Map(scenarios.map(item => [item.id, { ...item, drafts: (item.drafts ?? []).flatMap(draft => references.has(draft.id) ? [references.get(draft.id)] : []) }]));
|
|
9
|
-
for (const item of categories) {
|
|
10
|
-
const existing = entries.get(item.id);
|
|
11
|
-
entries.set(item.id, { ...existing, ...item, kind: "tokens", drafts: existing?.drafts ?? [] });
|
|
12
|
-
}
|
|
13
|
-
const owns = (unit, item) => unit === "assets/pictograms" && item.kind === "pictograms" || unit === "tokens" && item.kind === "tokens" || (item.unit ? item.unit === unit : ownsScenario(unit, item.id));
|
|
14
|
-
const attach = (entry, draft) => {
|
|
15
|
-
if (!entry.drafts.some(item => item.id === draft.id)) entry.drafts.push(references.get(draft.id));
|
|
16
|
-
};
|
|
17
|
-
// Resolve known draft scenarios first so another proposal for the same new
|
|
18
|
-
// owner cannot leave a duplicate placeholder in the catalogue.
|
|
19
|
-
for (const draft of drafts) {
|
|
20
|
-
const preview = previews.get(draft.id);
|
|
21
|
-
for (const item of preview?.scenarios ?? []) {
|
|
22
|
-
if (!draft.units.some(unit => owns(unit, item))) continue;
|
|
23
|
-
let entry = entries.get(item.id);
|
|
24
|
-
if (!entry) {
|
|
25
|
-
entry = { ...item, draftOnly: true, drafts: [] };
|
|
26
|
-
entries.set(item.id, entry);
|
|
27
|
-
}
|
|
28
|
-
attach(entry, draft);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
for (const draft of drafts) {
|
|
32
|
-
for (const unit of draft.units) {
|
|
33
|
-
const kind = unit === "assets/pictograms" ? "pictograms" : unit.split("/")[0];
|
|
34
|
-
if (!["brand", "pictograms", "tokens", "components", "patterns", "composition"].includes(kind)) continue;
|
|
35
|
-
const owned = [...entries.values()].filter(item => owns(unit, item));
|
|
36
|
-
if (owned.length) for (const item of owned) attach(item, draft);
|
|
37
|
-
else entries.set(unit, { id: unit, unit, title: unit.split("/").at(-1), kind, draftOnly: true, pendingDraftScenario: true, drafts: [references.get(draft.id)] });
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
return { scenarios: [...entries.values()], categories: [...entries.values()].filter(item => item.kind === "tokens") };
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const draftCategory = unit => unit === "assets/pictograms" ? "pictograms" : unit === "assets/glyphs" || unit === "assets/logos" ? "icons" : unit === "assets/brand" ? "brand" : unit === "foundation" ? "tokens" : ["brand","tokens","icons","components","patterns","composition"].includes(unit.split("/")[0]) ? unit.split("/")[0] : "other";
|
|
44
|
-
export const draftCategoryLabels = {brand:"Brand",icons:"Icons",pictograms:"Pictograms",tokens:"Tokens",components:"Components",patterns:"Patterns",composition:"Compositions",other:"Other"};
|
|
45
|
-
/** Every active proposal remains visible, even before it has a previewable scenario. */
|
|
46
|
-
export function draftNavigationEntries(scenarios, drafts) {
|
|
47
|
-
const result=[];
|
|
48
|
-
for(const draft of drafts){
|
|
49
|
-
const owned=scenarios.filter(item=>item.drafts?.some(value=>value.id===draft.id));
|
|
50
|
-
for(const item of owned)result.push({...item,id:`drafts/${encodeURIComponent(draft.id)}/${encodeURIComponent(item.id)}`,previewId:item.id,title:`${draft.title||draft.id} · ${item.title}`,group:draftCategoryLabels[item.kind]??"Other",drafts:[draft]});
|
|
51
|
-
for(const unit of draft.units??[]){
|
|
52
|
-
if(owned.some(item=>unit==="tokens"&&item.kind==="tokens"||item.unit===unit||!item.unit&&ownsScenario(unit,item.id)))continue;
|
|
53
|
-
const kind=draftCategory(unit);
|
|
54
|
-
result.push({id:`drafts/${encodeURIComponent(draft.id)}/${encodeURIComponent(unit)}`,unit,kind,title:`${draft.title||draft.id} · ${unit.split("/").at(-1)}`,group:draftCategoryLabels[kind],drafts:[draft]});
|
|
55
|
-
}
|
|
56
|
-
if(!owned.length&&!draft.units?.length)result.push({id:`drafts/${encodeURIComponent(draft.id)}`,kind:"other",title:draft.title||draft.id,group:"Other",drafts:[draft]});
|
|
57
|
-
}
|
|
58
|
-
return result;
|
|
59
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/* Specimen geometry only. Labels and layout come from the internal ADS UI. */
|
|
2
|
-
.ads-foundation{padding:0;overflow:auto;height:100%}
|
|
3
|
-
.ads-token-stage{display:flex;align-items:flex-start;min-width:0;overflow:auto}
|
|
4
|
-
.ads-token-sample{flex:none;inline-size:32px;block-size:32px;background:light-dark(#ddd,#444);color:var(--text-body);border:0 solid light-dark(#777,#999)}
|
|
5
|
-
.ads-token-type{inline-size:auto;block-size:auto;max-inline-size:100%;background:none;white-space:pre-wrap;font-family:var(--font-sans);font-size:var(--text-base);line-height:var(--leading-normal)}
|
|
6
|
-
[data-kind="shape"] .ads-token-stage{overflow:visible}
|
|
7
|
-
[data-kind="motion"] .ads-token-stage{height:48px;width:min(100%,192px);position:relative;overflow:visible;align-items:center;background:linear-gradient(var(--ads-ui-border-chrome),var(--ads-ui-border-chrome)) center/100% 1px no-repeat}
|
|
8
|
-
.ads-token-motion{position:relative;left:0;inline-size:16px;block-size:16px;border-radius:50%;background:var(--ads-ui-text-chrome);animation:ads-token-travel 1s ease-in-out infinite alternate}
|
|
9
|
-
@keyframes ads-token-travel{to{left:calc(100% - 16px)}}
|
|
10
|
-
@media(prefers-reduced-motion:reduce){.ads-token-motion{animation:none!important;transition:none!important}}
|
|
11
|
-
.ads-brand-clean{display:flex;max-width:100%}.ads-brand-master{display:block;height:96px;width:auto;max-width:100%;object-fit:contain}
|
|
12
|
-
.ads-pictogram-image{display:block;width:auto;max-width:none;object-fit:contain}
|
|
13
|
-
.ads-pictogram-stage{display:table;position:relative}
|
|
14
|
-
[data-pictogram] [data-slot="artwork"],[data-pictogram] [data-slot="construction"],[data-pictogram] [data-slot="sizes"]{overflow:auto}
|
|
15
|
-
.ads-brand-inspection{margin:0;min-width:0;max-width:100%;text-align:start}
|
|
16
|
-
.ads-brand-stage{position:relative;max-width:100%;width:128px;margin:0}
|
|
17
|
-
.ads-brand-art{display:block;width:100%;height:auto;max-height:none}
|
|
18
|
-
.ads-brand-grid-caption{margin-top:16px;color:var(--ads-ui-text-muted);font:12px/1.5 var(--ads-ui-font-mono);overflow-wrap:anywhere}
|
|
19
|
-
.ads-brand-sizes{display:flex;flex-wrap:wrap;gap:24px 16px;align-items:end;padding:8px}
|
|
20
|
-
/* Labels clear the 8px subject stage around each icon. */
|
|
21
|
-
.ads-brand-sizes figure{margin:0;flex:none;display:flex;flex-direction:column;align-items:center;gap:16px}.ads-brand-sizes img{display:block;width:auto;max-width:none;max-height:none;object-fit:contain}
|
|
22
|
-
.ads-brand-sizes figcaption{font:12px/1.5 var(--ads-ui-font-sans);color:var(--ads-ui-text-muted)}
|
|
23
|
-
.ux-brand-specimen .ads-foundation-note{font-size:12px;color:var(--ads-ui-text-muted)}
|
|
24
|
-
.ads-foundation-breakpoints{width:100%;border-collapse:collapse;margin:16px 0;font:inherit;font-size:14px;text-align:start}
|
|
25
|
-
.ads-foundation-breakpoints th,.ads-foundation-breakpoints td{text-align:start;padding:8px;border-bottom:1px solid light-dark(#ddd,#444)}
|
|
26
|
-
.ads-grid-example{margin-block:16px 32px}
|
|
27
|
-
.ux-spatial-cell{min-height:var(--space-24);padding:var(--grid-mini-unit);color:inherit;font:14px/1.5 system-ui}
|
|
28
|
-
.ads-grid-example-nested>.a{padding:0}
|
|
29
|
-
.ads-foundation-ratios{display:flex;gap:16px;flex-wrap:wrap;align-items:start;margin-bottom:32px}.ads-foundation-ratios>div{width:96px;min-height:0}
|
|
30
|
-
|
|
31
|
-
.ads-token-stage-length{overflow:hidden;position:relative;min-height:64px;align-items:flex-start;flex-direction:column;justify-content:center;gap:12px}
|
|
32
|
-
.ads-token-length{height:16px;min-height:16px;max-width:100%;background:var(--ads-ui-color-example-measure)}
|
|
33
|
-
.ads-token-length[data-zero="true"]{border-inline-start:1px dashed var(--ads-ui-text-muted)}
|
|
34
|
-
.ads-token-measure{position:absolute;visibility:hidden;pointer-events:none;height:0}
|
|
35
|
-
.ads-token-scale{order:1;font:12px/1.5 system-ui;color:var(--ads-ui-text-muted)}
|
|
36
|
-
.ads-token-stage-height{height:64px;overflow:auto;align-items:flex-end}
|
|
37
|
-
.ads-token-height{inline-size:96px;max-width:none;background:var(--ads-ui-bg-example)}
|
|
38
|
-
.ads-token-text{display:grid;place-items:center;inline-size:32px;block-size:32px;background:none;font:22px/1 var(--font-sans)}
|
|
39
|
-
.ads-token-color,.ads-token-text:empty{outline:1px solid var(--ads-ui-border-chrome);outline-offset:-1px}
|
|
40
|
-
.ads-token-stage-shadow{padding:16px;overflow:visible}
|
|
41
|
-
.ads-token-shadow{inline-size:96px;block-size:48px;background:var(--ads-ui-bg-surface)}
|
|
42
|
-
.ads-token-shape{inline-size:48px;block-size:48px;background:var(--ads-ui-bg-example)}
|
|
43
|
-
.ads-token-columns{inline-size:100%;block-size:48px;background:repeating-linear-gradient(to right,var(--ads-ui-bg-example) 0 calc((100% + 4px) / var(--ads-sample-columns) - 4px),transparent 0 calc((100% + 4px) / var(--ads-sample-columns)))}
|
|
44
|
-
.ads-token-columns[data-ads-property="grid-template-columns"]{display:grid;gap:4px;background:none}.ads-token-columns>span{background:var(--ads-ui-bg-example)}
|
|
45
|
-
.ads-token-stage-layer{isolation:isolate;position:relative;min-height:48px;overflow:hidden}
|
|
46
|
-
.ads-token-layer-reference{position:absolute;left:0;top:0;width:48px;height:32px;background:var(--ads-ui-bg-example);z-index:0}
|
|
47
|
-
.ads-token-layer{position:relative;margin:12px 0 0 16px;inline-size:48px;block-size:32px;background:var(--ads-ui-text-muted);color:var(--ads-ui-bg-surface);font:12px/32px system-ui;text-align:center}
|
|
48
|
-
.ads-token-effect{inline-size:64px;block-size:48px;font:24px/48px system-ui;text-align:center}
|
|
49
|
-
/* Units and scale: each bar is the token's real width; the label carries the measured value. */
|
|
50
|
-
.ads-grid-units{display:flex;flex-direction:column;gap:8px;margin-bottom:32px}
|
|
51
|
-
.ads-grid-unit{display:grid;grid-template-columns:var(--ads-grid-unit-track,96px) minmax(0,1fr);align-items:center;gap:12px;min-width:0}
|
|
52
|
-
.ads-grid-unit-bar{flex:none;display:block;min-width:1px;background:var(--ads-ui-bg-example,#dfeaf8)}
|
|
53
|
-
.ads-grid-unit-label,.ads-grid-chain{font:12px/1.5 var(--ads-ui-font-mono,ui-monospace,monospace);color:var(--ads-ui-text-muted,inherit);overflow-wrap:anywhere}
|
|
54
|
-
.ads-grid-roles{margin-bottom:8px}
|
|
55
|
-
.ads-grid-probe{position:absolute;visibility:hidden;height:0;pointer-events:none}
|
|
56
|
-
.ads-grid-link{padding:0;border:0;background:none;font:inherit;color:inherit;text-decoration:underline;text-underline-offset:2px;cursor:pointer}
|
|
57
|
-
.ads-grid-link:focus-visible{outline:2px solid currentColor;outline-offset:2px}
|
|
58
|
-
.ux-token-record[data-ads-focus]{outline:2px solid var(--ads-ui-border-focus,#2f6fd1);outline-offset:4px}
|
|
@@ -1,255 +0,0 @@
|
|
|
1
|
-
import { createPreviewRoot } from "./preview-frame.ads.review.mjs";
|
|
2
|
-
import { specimenPage, specimenSection, specimenList, tokenRecord, brandSpecimen, artworkGrid } from "./ui/ui.js";
|
|
3
|
-
import "./ui/ui.css";
|
|
4
|
-
import "./foundation-view.css";
|
|
5
|
-
import { mountPictogram } from "./pictogram-view.mjs";
|
|
6
|
-
|
|
7
|
-
/** Framework-independent, tool-owned foundation presentation. */
|
|
8
|
-
export function mountFoundation(container, data) {
|
|
9
|
-
const root = createPreviewRoot(container), doc = root.ownerDocument;
|
|
10
|
-
root.classList.add("ads-foundation");
|
|
11
|
-
root.setAttribute("aria-label", data.title);
|
|
12
|
-
const element = (tag, className, text) => {
|
|
13
|
-
const node = doc.createElement(tag);
|
|
14
|
-
if (className) node.className = className;
|
|
15
|
-
if (text !== undefined) node.textContent = text;
|
|
16
|
-
return node;
|
|
17
|
-
};
|
|
18
|
-
const page=specimenPage({title:data.title,onSearch:data.tokens?query=>{const normalized=query.trim().toLowerCase();for(const record of root.querySelectorAll(".ux-token-record"))record.hidden=!record.textContent.toLowerCase().includes(normalized);}:undefined,description:data.tokens?.some(token=>/^(animation|transition)-/.test(token.property??""))?"Duration previews play at ⅛ speed. Easing previews use a one-second travel. Reduced-motion preferences are respected.":undefined});
|
|
19
|
-
const content=page.querySelector('[data-slot="content"]');
|
|
20
|
-
root.append(page);
|
|
21
|
-
const updatePictogram = data.pictogram ? mountPictogram(content, data.pictogram) : null;
|
|
22
|
-
const addSection=(title,children)=>{const section=specimenSection({title});section.querySelector('[data-slot="content"]').append(...children);content.append(section);};
|
|
23
|
-
const readouts = [], measurements = [];
|
|
24
|
-
const unitBars=[], roleValues=[];
|
|
25
|
-
// A token chain where each token links to the page that shows it; the host opens that page and highlights it.
|
|
26
|
-
const chainNodes=(chain,links,parent)=>chain.forEach((name,index)=>{
|
|
27
|
-
if(index)parent.append(" → ");
|
|
28
|
-
const target=links?.[name];
|
|
29
|
-
if(!target){parent.append(name);return;}
|
|
30
|
-
const link=element("button","ads-grid-link",name);link.type="button";link.title=`Open ${name}`;
|
|
31
|
-
link.addEventListener("click",()=>doc.dispatchEvent(new CustomEvent("ads-preview-navigate",{detail:{target,token:name}})));
|
|
32
|
-
parent.append(link);
|
|
33
|
-
});
|
|
34
|
-
let spatialReference;
|
|
35
|
-
if (data.spatial) {
|
|
36
|
-
spatialReference=specimenSection({title:"Grid reference"});
|
|
37
|
-
const referenceContent=spatialReference.querySelector('[data-slot="content"]');
|
|
38
|
-
const intro=element("p","ads-foundation-note","Fixed units size details. Fluid tracks organize space. Cell gutters, content padding and outer margins have separate responsibilities.");
|
|
39
|
-
referenceContent.append(intro);
|
|
40
|
-
const table=element("table","ads-foundation-breakpoints"), header=element("tr","");
|
|
41
|
-
for(const title of ["Breakpoint","From","Columns","Outer margin"])header.append(element("th","",title));
|
|
42
|
-
table.append(header);
|
|
43
|
-
// Margins belong to breakpoints: each margin cell carries its value and its token chain once.
|
|
44
|
-
const marginRole=name=>(data.spatial.roles??[]).find(role=>role.role===`Outer margin · ${name}`);
|
|
45
|
-
for(const point of data.spatial.breakpoints){
|
|
46
|
-
const row=element("tr","");
|
|
47
|
-
for(const value of [point.name,`${point.fromPx}px / ${point.fromPx/16}rem`,point.count])row.append(element("td","",String(value)));
|
|
48
|
-
const margin=element("td","",`${point.marginPx}px`),role=marginRole(point.name);
|
|
49
|
-
if(role){const chain=element("span","ads-grid-chain"," · ");chainNodes(role.chain,role.links,chain);margin.append(chain);}
|
|
50
|
-
row.append(margin);table.append(row);
|
|
51
|
-
}
|
|
52
|
-
referenceContent.append(table,element("p","ads-foundation-note","Resize the preview to inspect responsive tracks. The smallest tier also supplies the base fallback."));
|
|
53
|
-
// Units and scale: the fine and mini unit, then each scale step at its real width,
|
|
54
|
-
// measured live in mini units.
|
|
55
|
-
const units=element("div","ads-grid-units");
|
|
56
|
-
const unitSample=(token,label)=>{const row=element("div","ads-grid-unit"),bar=element("span","ads-grid-unit-bar"),text=element("span","ads-grid-unit-label");bar.style.width=`var(${token})`;bar.style.height=`var(${data.spatial.miniUnit})`;row.append(bar,text);unitBars.push({bar,text,token,label});return row;};
|
|
57
|
-
|
|
58
|
-
units.append(unitSample(data.spatial.fineUnit,"Fine unit"),unitSample(data.spatial.miniUnit,"Mini unit"),...data.spatial.scale.map(token=>unitSample(token,"")));
|
|
59
|
-
// The bar column is as wide as the largest scale step, so every label starts on one line.
|
|
60
|
-
units.style.setProperty("--ads-grid-unit-track",`var(${data.spatial.scale.at(-1)})`);
|
|
61
|
-
addSection("Units and scale",[units]);
|
|
62
|
-
// Each grid role, followed to the primitive it uses, with its live value.
|
|
63
|
-
if(data.spatial.roles?.length){
|
|
64
|
-
const roles=element("table","ads-foundation-breakpoints ads-grid-roles"),head=element("tr","");
|
|
65
|
-
for(const title of ["Role","Token → primitive","Value"])head.append(element("th","",title));
|
|
66
|
-
roles.append(head);
|
|
67
|
-
// Outer margins are listed with their breakpoints above, not repeated here.
|
|
68
|
-
for(const role of data.spatial.roles.filter(item=>!item.role.startsWith("Outer margin"))){
|
|
69
|
-
const row=element("tr",""),value=element("td","");
|
|
70
|
-
// A probe takes the token as its width, so any valid expression (calc(), a chain) reads as pixels.
|
|
71
|
-
const probe=element("span","ads-grid-probe");probe.style.width=`var(${role.token})`;
|
|
72
|
-
const chain=element("td","ads-grid-chain");
|
|
73
|
-
chainNodes(role.chain,role.links,chain);
|
|
74
|
-
chain.append(probe);
|
|
75
|
-
row.append(element("td","",role.role),chain,value);
|
|
76
|
-
roleValues.push({value,probe});roles.append(row);
|
|
77
|
-
}
|
|
78
|
-
addSection("Grid roles",[roles,element("p","ads-foundation-note","Roles come from the spatial definition; values are measured in this preview.")]);
|
|
79
|
-
}
|
|
80
|
-
for(const example of data.spatial.examples){
|
|
81
|
-
|
|
82
|
-
const style=element("style", "", example.css), region=element("section",`ads-grid-example ads-grid-example-${example.id}`);
|
|
83
|
-
region.setAttribute("aria-label",example.title);
|
|
84
|
-
region.dataset.adsSource=`tokens/spatial.ads.json#${example.id}`;
|
|
85
|
-
const makeCell=(className,text)=>element("div",`ux-spatial-cell ${className}`,text);
|
|
86
|
-
if(example.id==="hybrid")region.append(makeCell("a","Fixed"),makeCell("b","Fluid tracks fill the rest"));
|
|
87
|
-
else if(example.id==="push"||example.id==="cover")region.append(makeCell("a","Navigation"),makeCell("b","Main region"),makeCell("c",example.id==="push"?"Docked panel":"Floating panel"));
|
|
88
|
-
else if(example.id==="nested"){const cell=makeCell("a");cell.dataset.nested="true";cell.append(makeCell("b","1"),makeCell("c","Inherited content"));region.append(cell);}
|
|
89
|
-
else if(example.id==="fixed")for(let i=0;i<8;i++)region.append(makeCell("",String(i+1)));
|
|
90
|
-
else region.append(makeCell("a","Full region"),makeCell("b","1"),makeCell("c","Content keeps its natural height. Track width changes with the available space."));
|
|
91
|
-
addSection(example.title,[style,region]);
|
|
92
|
-
}
|
|
93
|
-
const ratios=element("div","ads-foundation-ratios");
|
|
94
|
-
for(const ratio of data.spatial.ratios){const sample=element("div","ux-spatial-cell",ratio);sample.style.aspectRatio=ratio.replace(":","/");ratios.append(sample);}
|
|
95
|
-
addSection("Proportions",[ratios]);
|
|
96
|
-
}
|
|
97
|
-
const list = specimenList({kind:"brand"});
|
|
98
|
-
if(data.kind==="brand")content.append(list);
|
|
99
|
-
const tokenLists=new Map();
|
|
100
|
-
// The server classifies each token (sample kind and section); one rule for every caller.
|
|
101
|
-
// A page of one section shows no section heading; the page title already names it.
|
|
102
|
-
const single=new Set((data.tokens??[]).map(token=>token.section?.key)).size<2;
|
|
103
|
-
const tokenSection=section=>{
|
|
104
|
-
const key=section?.key??"value";
|
|
105
|
-
if(!tokenLists.has(key)){
|
|
106
|
-
const items=specimenList();
|
|
107
|
-
if(single)content.append(items);
|
|
108
|
-
else{const container=specimenSection({title:section?.title??"Values"});container.querySelector('[data-slot="content"]').append(items);content.append(container);}
|
|
109
|
-
tokenLists.set(key,items);
|
|
110
|
-
}
|
|
111
|
-
return tokenLists.get(key);
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
for (const token of [...data.tokens??[]].sort((a,b)=>(a.section?.order??0)-(b.section?.order??0)||a.name.localeCompare(b.name,undefined,{numeric:true}))) {
|
|
115
|
-
const property=token.property??"";
|
|
116
|
-
const kind=token.sampleKind??"value";
|
|
117
|
-
const type=kind==="type", text=kind==="text", color=kind==="color"||text, motion=kind==="motion", length=kind==="length";
|
|
118
|
-
const columns=kind==="columns", layer=kind==="layer", effect=kind==="effect";
|
|
119
|
-
const card=tokenRecord({name:token.name,meaning:token.meaning,kind});
|
|
120
|
-
if(kind!=="value"){
|
|
121
|
-
const stage=element("div",`ads-token-stage ads-token-stage-${kind}`),sample=element("div",`ads-token-sample ads-token-${kind}`);
|
|
122
|
-
sample.dataset.adsToken=token.name;sample.dataset.adsProperty=property;
|
|
123
|
-
if(!length)sample.style.setProperty(property,`var(${token.name})`);
|
|
124
|
-
if(text){
|
|
125
|
-
sample.textContent="Aa";
|
|
126
|
-
// Known shared role pairings, rather than arbitrary light/dark probe surfaces.
|
|
127
|
-
const backgrounds={"--accent-fg":"--accent","--success-fg":"--success","--warning-fg":"--warning","--danger-fg":"--danger","--info-fg":"--info","--success-text":"--success-bg","--warning-text":"--warning-bg","--danger-text":"--danger-bg","--info-text":"--info-bg"};
|
|
128
|
-
const background=backgrounds[token.name];
|
|
129
|
-
if(background&&data.tokens.some(item=>item.name===background)){
|
|
130
|
-
sample.style.backgroundColor=`var(${background})`;sample.title=`${token.name} on ${background}`;
|
|
131
|
-
}else if(token.name==="--text-inverse"){
|
|
132
|
-
// Without a declared paired fill, show the color itself instead of invisible type.
|
|
133
|
-
sample.textContent="";sample.style.backgroundColor=`var(${token.name})`;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
else if(color)sample.style.backgroundColor=`var(${token.name})`;
|
|
137
|
-
else if(type)sample.textContent=property==="line-height"?"The quick brown fox\njumps over the lazy dog.":"Aa The quick brown fox 0123456789";
|
|
138
|
-
else if(motion){
|
|
139
|
-
sample.style.animationDuration=property.endsWith("duration")?`calc(var(${token.name}) * 8)`:"1s";
|
|
140
|
-
if(property.endsWith("timing-function"))sample.style.animationTimingFunction=`var(${token.name})`;
|
|
141
|
-
}else if(length){
|
|
142
|
-
const measure=element("span","ads-token-measure"), scale=element("small","ads-token-scale");
|
|
143
|
-
measure.style.width=`var(${token.name})`;stage.append(measure,scale);measurements.push({measure,sample,scale});
|
|
144
|
-
}
|
|
145
|
-
else if(columns){
|
|
146
|
-
sample.style.setProperty("--ads-sample-columns",`var(${token.name})`);
|
|
147
|
-
if(property==="grid-template-columns")for(let i=0;i<4;i++)sample.append(element("span","",String(i+1)));
|
|
148
|
-
}else if(layer){stage.append(element("span","ads-token-layer-reference","0"));sample.textContent="Layer";}
|
|
149
|
-
else if(effect)sample.textContent="Aa";
|
|
150
|
-
stage.append(sample);card.querySelector('[data-slot="sample"]').append(stage);
|
|
151
|
-
}
|
|
152
|
-
const value=card.querySelector('[data-slot="value"]');
|
|
153
|
-
readouts.push([value, token.name]);
|
|
154
|
-
tokenSection(token.section).append(card);
|
|
155
|
-
}
|
|
156
|
-
const artwork = data.artwork ?? [];
|
|
157
|
-
const brandImages=[];
|
|
158
|
-
// Reuse supplied bytes; never insert project SVG markup into the document.
|
|
159
|
-
const artworkCoordinates=new Map();
|
|
160
|
-
function coordinates(asset,img) {
|
|
161
|
-
if(!artworkCoordinates.has(asset.src)) {
|
|
162
|
-
let result=null;
|
|
163
|
-
if(asset.src.startsWith("data:image/svg+xml;base64,"))try {
|
|
164
|
-
const text=new TextDecoder().decode(Uint8Array.from(atob(asset.src.split(",")[1]),c=>c.charCodeAt(0)));
|
|
165
|
-
const svg=new doc.defaultView.DOMParser().parseFromString(text,"image/svg+xml").documentElement;
|
|
166
|
-
const values=svg.localName==="svg"?svg.getAttribute("viewBox")?.trim().split(/[\s,]+/).map(Number):null;
|
|
167
|
-
if(values?.length===4&&values.every(Number.isFinite)&&values[2]>0&&values[3]>0)result={box:{x:values[0],y:values[1],width:values[2],height:values[3]},preserveAspectRatio:svg.getAttribute("preserveAspectRatio")||"xMidYMid meet",unit:"source units"};
|
|
168
|
-
}catch { /* Invalid artwork still gets its normal image/error presentation. */ }
|
|
169
|
-
artworkCoordinates.set(asset.src,result);
|
|
170
|
-
}
|
|
171
|
-
return artworkCoordinates.get(asset.src)??(img.naturalWidth&&img.naturalHeight?{box:{x:0,y:0,width:img.naturalWidth,height:img.naturalHeight},unit:"source pixels"}:null);
|
|
172
|
-
}
|
|
173
|
-
function updateGrid(item) {
|
|
174
|
-
if(!item.stage)return;
|
|
175
|
-
item.stage.querySelector(".ds-artwork-grid")?.remove();
|
|
176
|
-
if(!item.img.complete||!item.img.naturalWidth)return;
|
|
177
|
-
const current=coordinates(item.active,item.img);
|
|
178
|
-
if(!current){item.caption.textContent="Construction grid unavailable";return;}
|
|
179
|
-
const scale=Math.min(128/item.img.naturalHeight,280/item.img.naturalWidth);
|
|
180
|
-
item.stage.style.width=`${item.img.naturalWidth*scale}px`;
|
|
181
|
-
const grid=artworkGrid({...current,axes:false,overlay:true});
|
|
182
|
-
item.stage.append(grid);
|
|
183
|
-
const {box,unit}=current;
|
|
184
|
-
item.caption.textContent=`${box.width} × ${box.height} ${unit} · ${grid.dataset.step} per division`;
|
|
185
|
-
}
|
|
186
|
-
for (const asset of artwork.filter(item => !/\.dark\.[^.]+$/.test(item.name) || !artwork.some(base => base.name === item.name.replace(".dark.", ".")))) {
|
|
187
|
-
const card=brandSpecimen({name:asset.name});
|
|
188
|
-
card.dataset.artwork=asset.name;
|
|
189
|
-
const dark=artwork.find(item=>item.name===asset.name.replace(/(\.[^.]+)$/, ".dark$1"));
|
|
190
|
-
// The master shows clean first; its construction grid is a separate, secondary figure.
|
|
191
|
-
const clean=element("div","ads-brand-clean"),art=element("img","ads-brand-master");
|
|
192
|
-
art.alt=asset.name;art.src=asset.src;art.height=96;clean.append(art);
|
|
193
|
-
brandImages.push({img:art,asset,dark,active:asset});
|
|
194
|
-
const inspection=element("figure","ads-brand-inspection"),stage=element("div","ads-brand-stage"),img=element("img","ads-brand-art");
|
|
195
|
-
const caption=element("figcaption","ads-brand-grid-caption","Construction grid");
|
|
196
|
-
const item={img,asset,dark,active:asset,stage,caption};
|
|
197
|
-
img.onload=()=>updateGrid(item);
|
|
198
|
-
img.onerror=()=>{stage.querySelector(".ds-artwork-grid")?.remove();caption.textContent="Artwork could not be loaded";};
|
|
199
|
-
img.alt="";img.src=asset.src;
|
|
200
|
-
stage.append(img);inspection.append(stage,caption);card.querySelector('[data-slot="artwork"]').append(clean);card.querySelector('[data-slot="construction"]').append(inspection);
|
|
201
|
-
const info=card.querySelector('[data-slot="sizes"]');
|
|
202
|
-
brandImages.push(item);
|
|
203
|
-
const sizes=element("div","ads-brand-sizes");
|
|
204
|
-
// Clean actual-size samples stay separate from the enlarged construction grid.
|
|
205
|
-
for(const size of asset.appIcon?[16,32,48,64]:[16,32,64]) {
|
|
206
|
-
const figure=element("figure",""),sample=element("img","");
|
|
207
|
-
sample.src=asset.src;sample.alt="";sample.height=size;
|
|
208
|
-
if(asset.appIcon)sample.width=size;
|
|
209
|
-
brandImages.push({img:sample,asset,dark,active:asset});
|
|
210
|
-
figure.append(sample,element("figcaption","",`${size}px high`));sizes.append(figure);
|
|
211
|
-
}
|
|
212
|
-
info.append(element("p","ads-foundation-note","Actual sizes"),sizes);
|
|
213
|
-
if(asset.appIcon)info.append(element("p","ads-foundation-note","Home-screen icons (180, 192 and 512 px) use the same master."));
|
|
214
|
-
list.append(card);
|
|
215
|
-
}
|
|
216
|
-
if(spatialReference)content.append(spatialReference);
|
|
217
|
-
let pending;
|
|
218
|
-
const update = () => {
|
|
219
|
-
cancelAnimationFrame(pending);
|
|
220
|
-
pending = requestAnimationFrame(() => {
|
|
221
|
-
const style = doc.defaultView.getComputedStyle(root);
|
|
222
|
-
updatePictogram?.(root.closest("[data-theme]")?.getAttribute("data-theme"));
|
|
223
|
-
for (const [node, name] of readouts) node.textContent = style.getPropertyValue(name).trim() || "Not defined in this context";
|
|
224
|
-
for(const {measure,sample,scale} of measurements){
|
|
225
|
-
const pixels=parseFloat(doc.defaultView.getComputedStyle(measure).width)||0;
|
|
226
|
-
const factor=pixels>192?1/2**Math.ceil(Math.log2(pixels/192)):pixels>0&&pixels<8?8:1;
|
|
227
|
-
sample.style.width=`${pixels*factor}px`;
|
|
228
|
-
sample.dataset.zero=String(pixels===0);
|
|
229
|
-
scale.textContent=pixels===0?"Zero space":factor>1?`${factor}× enlarged`:factor<1?`1:${1/factor} scale`:"Actual size";
|
|
230
|
-
}
|
|
231
|
-
const mini=parseFloat(doc.defaultView.getComputedStyle(unitBars[1]?.bar??root).width)||0;
|
|
232
|
-
for(const {bar,text,token,label} of unitBars){
|
|
233
|
-
const pixels=parseFloat(doc.defaultView.getComputedStyle(bar).width)||0;
|
|
234
|
-
text.textContent=`${label?label+" · ":""}${token} · ${pixels}px${mini&&label!=="Fine unit"&&label!=="Mini unit"?` · ${+(pixels/mini).toFixed(2)} × mini`:""}`;
|
|
235
|
-
}
|
|
236
|
-
for(const {value,probe} of roleValues)value.textContent=`${+(parseFloat(doc.defaultView.getComputedStyle(probe).width)||0).toFixed(2)}px`;
|
|
237
|
-
const darkTheme=style.colorScheme==="dark";
|
|
238
|
-
for(const item of brandImages){const active=darkTheme&&item.dark?item.dark:item.asset;item.active=active;if(item.img.getAttribute("src")!==active.src)item.img.src=active.src;updateGrid(item);}
|
|
239
|
-
});
|
|
240
|
-
};
|
|
241
|
-
const observer = new MutationObserver(update);
|
|
242
|
-
// Theme/brand context is inherited from the App host; no polling or product observers.
|
|
243
|
-
for (let parent = root; parent; parent = parent.parentElement) observer.observe(parent, { attributes: true, attributeFilter: ["data-theme", "data-brand", "style"] });
|
|
244
|
-
update();
|
|
245
|
-
// A link from another view asks to show one token: scroll to its record and mark it briefly.
|
|
246
|
-
const focus=event=>{
|
|
247
|
-
const record=[...root.querySelectorAll(".ux-token-record")].find(item=>item.getAttribute("aria-label")===event.detail?.token);
|
|
248
|
-
if(!record)return;
|
|
249
|
-
record.scrollIntoView({block:"center"});
|
|
250
|
-
record.dataset.adsFocus="true";
|
|
251
|
-
setTimeout(()=>{delete record.dataset.adsFocus;},2400);
|
|
252
|
-
};
|
|
253
|
-
doc.addEventListener("ads-preview-focus",focus);
|
|
254
|
-
return () => { doc.removeEventListener("ads-preview-focus",focus); observer.disconnect(); cancelAnimationFrame(pending);for(const {img} of brandImages){img.onload=null;img.onerror=null;}root.remove(); };
|
|
255
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/** Development-only controls for the existing preview guide overlay.
|
|
2
|
-
* A choice is a mode (where guides show) plus layers (what they draw):
|
|
3
|
-
* off shows nothing, hover shows the element under the pointer or focus,
|
|
4
|
-
* always shows every element. Layer choices are kept in every mode. */
|
|
5
|
-
export const guideOptionsEvent = "ads-preview-guide-options";
|
|
6
|
-
export const guideStateEvent = "ads-preview-guide-state";
|
|
7
|
-
export const guideModes = ["off", "hover", "always"];
|
|
8
|
-
export const guideLayers = ["bounds", "tracks", "gaps", "padding", "margins", "mini"];
|
|
9
|
-
export const defaultGuideOptions = Object.freeze({ mode: "off", bounds: true, tracks: false, gaps: false, padding: true, margins: true, mini: false });
|
|
10
|
-
|
|
11
|
-
export function normalizeGuideOptions(value) {
|
|
12
|
-
const mode = guideModes.includes(value?.mode) ? value.mode : value?.all === true ? "always" : "off";
|
|
13
|
-
return { mode, ...Object.fromEntries(guideLayers.map((layer) => [layer, value?.[layer] === true])) };
|
|
14
|
-
}
|
|
15
|
-
/** What the overlay draws: `all` means every element, the layers say which geometry. */
|
|
16
|
-
export function overlayGuides(options) {
|
|
17
|
-
const { mode, ...layers } = normalizeGuideOptions(options);
|
|
18
|
-
return { all: mode === "always", ...layers };
|
|
19
|
-
}
|
|
20
|
-
export function guidesVisible(options) {
|
|
21
|
-
const { mode, ...layers } = normalizeGuideOptions(options);
|
|
22
|
-
return mode !== "off" && Object.values(layers).some(Boolean);
|
|
23
|
-
}
|
|
24
|
-
export function setPreviewGuides(options) {
|
|
25
|
-
document.dispatchEvent(new CustomEvent(guideOptionsEvent, { detail: normalizeGuideOptions(options) }));
|
|
26
|
-
}
|
|
27
|
-
export function observePreviewGuides(listener) {
|
|
28
|
-
const receive = (event) => listener(normalizeGuideOptions(event.detail));
|
|
29
|
-
document.addEventListener(guideStateEvent, receive);
|
|
30
|
-
document.dispatchEvent(new CustomEvent(guideOptionsEvent));
|
|
31
|
-
return () => document.removeEventListener(guideStateEvent, receive);
|
|
32
|
-
}
|