@ccslabs/xtend 0.1.0-rc.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/CHANGELOG.md +65 -0
- package/LICENSE +201 -0
- package/README.md +184 -0
- package/a11y/motion-contrast-policy.d.ts +32 -0
- package/a11y/motion-contrast-policy.js +261 -0
- package/a11y/runtime-a11y-contract.d.ts +44 -0
- package/a11y/runtime-a11y-contract.js +385 -0
- package/a11y/screenreader-signals.d.ts +32 -0
- package/a11y/screenreader-signals.js +372 -0
- package/api.d.ts +168 -0
- package/api.js +864 -0
- package/catalog/catalog-public-types.d.ts +66 -0
- package/catalog/component-catalog-coverage.d.ts +20 -0
- package/catalog/component-catalog-coverage.js +377 -0
- package/catalog/component-long-tail-migration.d.ts +18 -0
- package/catalog/component-long-tail-migration.js +305 -0
- package/catalog/component-regression-priority.d.ts +20 -0
- package/catalog/component-regression-priority.js +305 -0
- package/catalog/enterprise-component-flex-release-handoff.d.ts +32 -0
- package/catalog/enterprise-component-flex-release-handoff.js +437 -0
- package/catalog/enterprise-component-style-audit.d.ts +22 -0
- package/catalog/enterprise-component-style-audit.js +353 -0
- package/catalog/enterprise-form-control-theme-a11y.d.ts +19 -0
- package/catalog/enterprise-form-control-theme-a11y.js +220 -0
- package/catalog/enterprise-icon-control-audit.d.ts +21 -0
- package/catalog/enterprise-icon-control-audit.js +258 -0
- package/catalog/enterprise-layout-display-media-tokenization.d.ts +20 -0
- package/catalog/enterprise-layout-display-media-tokenization.js +237 -0
- package/catalog/enterprise-navigation-routing-state-hardening.d.ts +20 -0
- package/catalog/enterprise-navigation-routing-state-hardening.js +255 -0
- package/catalog/enterprise-overlay-mode-token-parity.d.ts +15 -0
- package/catalog/enterprise-overlay-mode-token-parity.js +178 -0
- package/catalog/enterprise-third-party-authoring-guide.d.ts +23 -0
- package/catalog/enterprise-third-party-authoring-guide.js +310 -0
- package/catalog/enterprise-visual-dom-snapshot-matrix.d.ts +31 -0
- package/catalog/enterprise-visual-dom-snapshot-matrix.js +357 -0
- package/catalog/epic10-existing-component-metadata.d.ts +25 -0
- package/catalog/epic10-existing-component-metadata.js +534 -0
- package/catalog/epic10-p0-component-wave.d.ts +28 -0
- package/catalog/epic10-p0-component-wave.js +688 -0
- package/catalog/epic10-platform-gates.d.ts +31 -0
- package/catalog/epic10-platform-gates.js +425 -0
- package/catalog/epic10-release-handoff.d.ts +30 -0
- package/catalog/epic10-release-handoff.js +195 -0
- package/catalog/epic11-enterprise-ux-handoff.d.ts +29 -0
- package/catalog/epic11-enterprise-ux-handoff.js +403 -0
- package/catalog/epic12-docs-adoption.d.ts +29 -0
- package/catalog/epic12-docs-adoption.js +183 -0
- package/catalog/epic12-rc0-gate-matrix.d.ts +36 -0
- package/catalog/epic12-rc0-gate-matrix.js +439 -0
- package/catalog/epic12-rc0-handoff.d.ts +30 -0
- package/catalog/epic12-rc0-handoff.js +385 -0
- package/catalog/epic13-conditional-network-evidence-ci.d.ts +35 -0
- package/catalog/epic13-conditional-network-evidence-ci.js +278 -0
- package/catalog/epic13-conditional-network-evidence.d.ts +34 -0
- package/catalog/epic13-conditional-network-evidence.js +280 -0
- package/catalog/epic13-docs-rmt-production-hardening.d.ts +39 -0
- package/catalog/epic13-docs-rmt-production-hardening.js +286 -0
- package/catalog/epic13-hydration-performance-closure.d.ts +33 -0
- package/catalog/epic13-hydration-performance-closure.js +234 -0
- package/catalog/epic13-known-residual-triage.d.ts +32 -0
- package/catalog/epic13-known-residual-triage.js +339 -0
- package/catalog/epic13-package-export-lock.d.ts +41 -0
- package/catalog/epic13-package-export-lock.js +604 -0
- package/catalog/epic13-prod-browser-csp-smoke.d.ts +35 -0
- package/catalog/epic13-prod-browser-csp-smoke.js +218 -0
- package/catalog/epic13-rc1-gate-matrix-ci-handoff.d.ts +36 -0
- package/catalog/epic13-rc1-gate-matrix-ci-handoff.js +418 -0
- package/catalog/epic13-rc1-migration-notes.d.ts +36 -0
- package/catalog/epic13-rc1-migration-notes.js +271 -0
- package/catalog/epic13-rc1-readiness.d.ts +33 -0
- package/catalog/epic13-rc1-readiness.js +487 -0
- package/catalog/epic13-release-owner-acceptance.d.ts +33 -0
- package/catalog/epic13-release-owner-acceptance.js +354 -0
- package/catalog/epic13-release-report-pack-dry-run-evidence.d.ts +36 -0
- package/catalog/epic13-release-report-pack-dry-run-evidence.js +253 -0
- package/catalog/epic13-rmt-production-readiness.d.ts +35 -0
- package/catalog/epic13-rmt-production-readiness.js +314 -0
- package/catalog/epic13-trusted-dom-boundary.d.ts +36 -0
- package/catalog/epic13-trusted-dom-boundary.js +230 -0
- package/catalog/epic13-visual-owner-artifact.d.ts +35 -0
- package/catalog/epic13-visual-owner-artifact.js +233 -0
- package/catalog/epic14-lsp-handoff.d.ts +28 -0
- package/catalog/epic14-lsp-handoff.js +312 -0
- package/catalog/epic14-rmt-tooling.d.ts +33 -0
- package/catalog/epic14-rmt-tooling.js +282 -0
- package/catalog/surface-manager-adapter-runtime.d.ts +37 -0
- package/catalog/surface-manager-adapter-runtime.js +203 -0
- package/catalog/surface-manager-browser-lab.d.ts +39 -0
- package/catalog/surface-manager-browser-lab.js +225 -0
- package/catalog/surface-manager-controller.d.ts +43 -0
- package/catalog/surface-manager-controller.js +290 -0
- package/catalog/surface-manager-layout-engines.d.ts +32 -0
- package/catalog/surface-manager-layout-engines.js +161 -0
- package/catalog/surface-manager-lazy-loading.d.ts +35 -0
- package/catalog/surface-manager-lazy-loading.js +173 -0
- package/catalog/surface-manager-materialization.d.ts +37 -0
- package/catalog/surface-manager-materialization.js +202 -0
- package/catalog/surface-manager-native-rmt-surfaces.d.ts +48 -0
- package/catalog/surface-manager-native-rmt-surfaces.js +325 -0
- package/catalog/surface-manager-overlay-bridge.d.ts +42 -0
- package/catalog/surface-manager-overlay-bridge.js +247 -0
- package/catalog/surface-manager-persistence.d.ts +37 -0
- package/catalog/surface-manager-persistence.js +178 -0
- package/catalog/surface-manager-quality-gates.d.ts +48 -0
- package/catalog/surface-manager-quality-gates.js +324 -0
- package/catalog/surface-manager-release-handoff.d.ts +47 -0
- package/catalog/surface-manager-release-handoff.js +274 -0
- package/catalog/surface-manager-remote-policy.d.ts +34 -0
- package/catalog/surface-manager-remote-policy.js +199 -0
- package/catalog/surface-manager-rmt-authoring.d.ts +44 -0
- package/catalog/surface-manager-rmt-authoring.js +368 -0
- package/catalog/surface-manager-route-lifecycle.d.ts +32 -0
- package/catalog/surface-manager-route-lifecycle.js +162 -0
- package/catalog/surface-manager-runtime-release-handoff.d.ts +36 -0
- package/catalog/surface-manager-runtime-release-handoff.js +245 -0
- package/catalog/surface-manager-side-panel-runtime.d.ts +46 -0
- package/catalog/surface-manager-side-panel-runtime.js +307 -0
- package/catalog/surface-manager-stack-policy.d.ts +32 -0
- package/catalog/surface-manager-stack-policy.js +169 -0
- package/catalog/surface-manager-window-runtime.d.ts +45 -0
- package/catalog/surface-manager-window-runtime.js +285 -0
- package/catalog/surface-manager-workbench-fixture.d.ts +50 -0
- package/catalog/surface-manager-workbench-fixture.js +315 -0
- package/catalog/type-exports-api.js +236 -0
- package/catalog/type-exports-builder.js +405 -0
- package/catalog/type-exports-catalog.js +394 -0
- package/catalog/type-exports-loader.js +266 -0
- package/catalog/type-exports-policy.js +461 -0
- package/catalog/type-exports-rmt.js +407 -0
- package/catalog/type-exports-vendor.js +365 -0
- package/catalog/type-exports.js +574 -0
- package/components/icon-packs/core.js +154 -0
- package/components/icon-packs/lucide.js +136 -0
- package/components/manifest.json +44 -0
- package/components/prism.d.ts +73 -0
- package/components/prism.js +300 -0
- package/components/turndown.d.ts +34 -0
- package/components/turndown.js +107 -0
- package/components/x-rmt-lifecycle-demo-build.d.ts +78 -0
- package/components/x-rmt-lifecycle-demo-build.js +1175 -0
- package/components/x-rmt-lifecycle-demo.d.ts +83 -0
- package/components/x-rmt-lifecycle-demo.js +1175 -0
- package/components/xalert.d.ts +42 -0
- package/components/xalert.js +538 -0
- package/components/xbutton.d.ts +127 -0
- package/components/xbutton.js +612 -0
- package/components/xcalendar.d.ts +39 -0
- package/components/xcalendar.js +338 -0
- package/components/xcards.d.ts +34 -0
- package/components/xcards.js +253 -0
- package/components/xcheckbox.d.ts +48 -0
- package/components/xcheckbox.js +448 -0
- package/components/xcode.d.ts +35 -0
- package/components/xcode.js +370 -0
- package/components/xdialog.d.ts +48 -0
- package/components/xdialog.js +763 -0
- package/components/xdrawer.d.ts +61 -0
- package/components/xdrawer.js +654 -0
- package/components/xfooter.d.ts +41 -0
- package/components/xfooter.js +351 -0
- package/components/xform.d.ts +43 -0
- package/components/xform.js +456 -0
- package/components/xheader.d.ts +68 -0
- package/components/xheader.js +1253 -0
- package/components/xhero.d.ts +42 -0
- package/components/xhero.js +475 -0
- package/components/xicon.d.ts +146 -0
- package/components/xicon.js +688 -0
- package/components/xinput.d.ts +37 -0
- package/components/xinput.js +444 -0
- package/components/xlightbox.d.ts +48 -0
- package/components/xlightbox.js +571 -0
- package/components/xlink.d.ts +63 -0
- package/components/xlink.js +565 -0
- package/components/xmasonry.d.ts +35 -0
- package/components/xmasonry.js +666 -0
- package/components/xmenu.d.ts +118 -0
- package/components/xmenu.js +1005 -0
- package/components/xmodal.d.ts +64 -0
- package/components/xmodal.js +831 -0
- package/components/xplayer.d.ts +57 -0
- package/components/xplayer.js +1748 -0
- package/components/xpopover.d.ts +54 -0
- package/components/xpopover.js +466 -0
- package/components/xprogress.d.ts +40 -0
- package/components/xprogress.js +345 -0
- package/components/xradio.d.ts +50 -0
- package/components/xradio.js +474 -0
- package/components/xrouter.d.ts +244 -0
- package/components/xrouter.js +1841 -0
- package/components/xsection.d.ts +34 -0
- package/components/xsection.js +253 -0
- package/components/xselect.d.ts +46 -0
- package/components/xselect.js +463 -0
- package/components/xsidepanel.d.ts +56 -0
- package/components/xsidepanel.js +728 -0
- package/components/xspinner.d.ts +38 -0
- package/components/xspinner.js +388 -0
- package/components/xstate.d.ts +137 -0
- package/components/xstate.js +493 -0
- package/components/xstatus.d.ts +41 -0
- package/components/xstatus.js +381 -0
- package/components/xsummary.d.ts +43 -0
- package/components/xsummary.js +293 -0
- package/components/xsurfacemanager-controller.d.ts +130 -0
- package/components/xsurfacemanager-controller.js +699 -0
- package/components/xsurfacemanager.d.ts +452 -0
- package/components/xsurfacemanager.js +3775 -0
- package/components/xsurfaceoverlay-bridge.d.ts +43 -0
- package/components/xsurfaceoverlay-bridge.js +238 -0
- package/components/xsurfacewindow.d.ts +50 -0
- package/components/xsurfacewindow.js +576 -0
- package/components/xtabs.d.ts +73 -0
- package/components/xtabs.js +611 -0
- package/components/xtend-public-types.d.ts +208 -0
- package/components/xtextarea.d.ts +46 -0
- package/components/xtextarea.js +451 -0
- package/components/xtheme.d.ts +253 -0
- package/components/xtheme.js +1438 -0
- package/components/xtoast.d.ts +39 -0
- package/components/xtoast.js +389 -0
- package/components/xtooltip.d.ts +53 -0
- package/components/xtooltip.js +432 -0
- package/components/xtype.d.ts +42 -0
- package/components/xtype.js +244 -0
- package/components/xutils.d.ts +164 -0
- package/components/xutils.js +496 -0
- package/components/xwriter.d.ts +67 -0
- package/components/xwriter.js +854 -0
- package/design-tokens/themes/enterprise-light.json +40 -0
- package/design-tokens/themes/xtend-signature.json +126 -0
- package/design-tokens/xtend-design-tokens.d.ts +95 -0
- package/design-tokens/xtend-design-tokens.js +395 -0
- package/design-tokens/xtheme-token-alias-layer.d.ts +84 -0
- package/design-tokens/xtheme-token-alias-layer.js +423 -0
- package/docs/.htaccess +51 -0
- package/docs/README.md +340 -0
- package/docs/XTend-ADR.md +221 -0
- package/docs/a11y-keyboard-smokes.md +62 -0
- package/docs/about.md +18 -0
- package/docs/api.md +157 -0
- package/docs/best-practices.md +76 -0
- package/docs/component-catalog-coverage.md +58 -0
- package/docs/component-lab.md +103 -0
- package/docs/component-long-tail-migration.md +41 -0
- package/docs/component-platform.md +159 -0
- package/docs/component-ux-app-authoring.md +130 -0
- package/docs/component-ux-authoring.md +96 -0
- package/docs/component-ux-gates.md +45 -0
- package/docs/components/x-rmt-lifecycle-demo-build.md +60 -0
- package/docs/components/xalert.md +81 -0
- package/docs/components/xbutton.md +103 -0
- package/docs/components/xcalendar.md +82 -0
- package/docs/components/xcards.md +128 -0
- package/docs/components/xcheckbox.md +102 -0
- package/docs/components/xcode.md +126 -0
- package/docs/components/xdialog.md +92 -0
- package/docs/components/xdrawer.md +84 -0
- package/docs/components/xfooter.md +126 -0
- package/docs/components/xform.md +128 -0
- package/docs/components/xheader.md +308 -0
- package/docs/components/xhero.md +142 -0
- package/docs/components/xicon.md +125 -0
- package/docs/components/xinput.md +129 -0
- package/docs/components/xlightbox.md +98 -0
- package/docs/components/xlink.md +109 -0
- package/docs/components/xmasonry.md +124 -0
- package/docs/components/xmenu.md +158 -0
- package/docs/components/xmodal.md +82 -0
- package/docs/components/xplayer.md +104 -0
- package/docs/components/xpopover.md +67 -0
- package/docs/components/xprogress.md +56 -0
- package/docs/components/xradio.md +103 -0
- package/docs/components/xrouter.md +260 -0
- package/docs/components/xsection.md +125 -0
- package/docs/components/xselect.md +105 -0
- package/docs/components/xsidepanel.md +30 -0
- package/docs/components/xspinner.md +102 -0
- package/docs/components/xstate.md +148 -0
- package/docs/components/xstatus.md +55 -0
- package/docs/components/xsummary.md +78 -0
- package/docs/components/xsurfacemanager.md +27 -0
- package/docs/components/xsurfacewindow.md +21 -0
- package/docs/components/xtabs.md +160 -0
- package/docs/components/xtextarea.md +98 -0
- package/docs/components/xtheme.md +167 -0
- package/docs/components/xtoast.md +62 -0
- package/docs/components/xtooltip.md +66 -0
- package/docs/components/xtype.md +82 -0
- package/docs/components/xutils.md +144 -0
- package/docs/components/xwriter.md +94 -0
- package/docs/components.md +117 -0
- package/docs/conditional-network-evidence-ci.md +38 -0
- package/docs/conditional-network-evidence.md +50 -0
- package/docs/core-migration-guide.md +110 -0
- package/docs/design-tokens.md +116 -0
- package/docs/docs-rmt-production-hardening.md +31 -0
- package/docs/enterprise-adoption.md +411 -0
- package/docs/enterprise-component-flex-release-handoff.md +129 -0
- package/docs/epic10-platform-gates.md +62 -0
- package/docs/epic10-release-handoff.md +81 -0
- package/docs/epic11-enterprise-ux-handoff.md +70 -0
- package/docs/epic12-rc0-handoff.md +61 -0
- package/docs/existing-component-metadata.md +67 -0
- package/docs/hydration-performance-closure.md +34 -0
- package/docs/hydration-policies.md +71 -0
- package/docs/index.php +1625 -0
- package/docs/known-residual-triage.md +22 -0
- package/docs/manifest-import-policy.md +79 -0
- package/docs/manifest.md +106 -0
- package/docs/menu.json +1190 -0
- package/docs/motion-contrast.md +67 -0
- package/docs/package-export-lock.md +44 -0
- package/docs/performance-measurements.md +106 -0
- package/docs/performance-regression.md +89 -0
- package/docs/performance.md +94 -0
- package/docs/previews/README.md +17 -0
- package/docs/prod-browser-csp-smokes.md +40 -0
- package/docs/public-component-types.md +79 -0
- package/docs/quick-start-guide.md +152 -0
- package/docs/rc0-adoption-guide.md +102 -0
- package/docs/rc0-gate-matrix.md +58 -0
- package/docs/rc1-gate-matrix-ci-handoff.md +56 -0
- package/docs/rc1-migration-notes.md +69 -0
- package/docs/rc1-readiness.md +46 -0
- package/docs/release-owner-acceptance.md +56 -0
- package/docs/release-report-pack-dry-run-evidence.md +39 -0
- package/docs/rmt-dsl-authoring-polish.md +122 -0
- package/docs/rmt-first-demo-app.md +77 -0
- package/docs/rmt-first-xtend-apps.md +105 -0
- package/docs/rmt-kernel-panic-recovery-incident-handoff.md +61 -0
- package/docs/rmt-kernel-security-hardening-migration.md +50 -0
- package/docs/rmt-kernel-trusted-output-authoring.md +69 -0
- package/docs/rmt-language-server.md +177 -0
- package/docs/rmt-lifecycle-demo.md +25 -0
- package/docs/rmt-linter.md +140 -0
- package/docs/rmt-production-readiness.md +63 -0
- package/docs/rmt-tooling-release-gates.md +77 -0
- package/docs/rmt-vnext-authoring.md +60 -0
- package/docs/rmt-vnext-cross-surface-events.md +68 -0
- package/docs/rmt-vnext-enterprise-mfe-handoff.md +70 -0
- package/docs/rmt-vnext-migration-notes.md +62 -0
- package/docs/rmt-vnext-release-handoff.md +69 -0
- package/docs/rmt-vnext-remote-surfaces.md +90 -0
- package/docs/rmt-vnext-surface-registry-enterprise.md +76 -0
- package/docs/screenreader-signals.md +56 -0
- package/docs/supply-chain-gates.md +100 -0
- package/docs/surface-manager-authoring-guide.md +94 -0
- package/docs/surface-manager-browser-lab.md +45 -0
- package/docs/surface-manager-component-lab.md +43 -0
- package/docs/surface-manager-controller.md +66 -0
- package/docs/surface-manager-layout-engines.md +32 -0
- package/docs/surface-manager-lazy-hydration.md +63 -0
- package/docs/surface-manager-migration-guide.md +94 -0
- package/docs/surface-manager-native-rmt-surfaces.md +38 -0
- package/docs/surface-manager-overlay-bridge.md +53 -0
- package/docs/surface-manager-persistence.md +30 -0
- package/docs/surface-manager-quality-gates.md +51 -0
- package/docs/surface-manager-release-handoff.md +68 -0
- package/docs/surface-manager-remote-policy.md +54 -0
- package/docs/surface-manager-rmt-authoring.md +86 -0
- package/docs/surface-manager-route-lifecycle.md +59 -0
- package/docs/surface-manager-runtime-release-handoff.md +69 -0
- package/docs/surface-manager-side-panel-runtime.md +36 -0
- package/docs/surface-manager-stack-policy.md +39 -0
- package/docs/surface-manager-window-runtime.md +47 -0
- package/docs/surface-manager-workbench-fixture.md +43 -0
- package/docs/third-party-design-authoring.md +406 -0
- package/docs/trusted-dom-boundary-browser-proof.md +32 -0
- package/docs/trusted-dom-sanitizing.md +110 -0
- package/docs/type-exports.md +61 -0
- package/docs/typescript-components.md +63 -0
- package/docs/utils/fabric-runtime.js +650 -0
- package/docs/utils/pageloader.js +2823 -0
- package/docs/utils/parsedown.php +298 -0
- package/docs/visual-browser-regression.md +83 -0
- package/docs/visual-owner-artifacts.md +46 -0
- package/docs/visual-snapshot-automation.md +87 -0
- package/docs/xtend-api-types.md +55 -0
- package/docs/xtend-builder-types.md +55 -0
- package/docs/xtend-catalog-types.md +44 -0
- package/docs/xtend-fabric-rmt-lane-mapping.md +143 -0
- package/docs/xtend-fabric.md +474 -0
- package/docs/xtend-loader-types.md +58 -0
- package/docs/xtend-loader.md +265 -0
- package/docs/xtend-policy-types.md +38 -0
- package/docs/xtend-rmt-types.md +39 -0
- package/docs/xtend-vendor-types.md +36 -0
- package/docs/xtendrmt-app-dsl.md +269 -0
- package/docs/xtendrmt-migration-guide.md +235 -0
- package/docs/xtendrmt-native-authoring.md +337 -0
- package/docs/xtendrmt-overview.md +89 -0
- package/docs/xtendrmt-parsedown-docs.rmt +956 -0
- package/docs/xtendrmt-parsedown-scheduling.md +301 -0
- package/docs/xtendrmt-runtime-bridge.md +155 -0
- package/fabric/hydration-policy.d.ts +27 -0
- package/fabric/hydration-policy.js +306 -0
- package/fabric/package.json +58 -0
- package/fabric/rmt-lane-mapping.d.ts +47 -0
- package/fabric/rmt-lane-mapping.js +504 -0
- package/fabric/xtend-fabric.d.ts +81 -0
- package/fabric/xtend-fabric.js +2669 -0
- package/fabric/xtend-policy-public-types.d.ts +135 -0
- package/package.json +8225 -0
- package/security/README.md +54 -0
- package/security/manifest-import-policy.d.ts +43 -0
- package/security/manifest-import-policy.js +260 -0
- package/security/supply-chain-gate-policy.d.ts +45 -0
- package/security/supply-chain-gate-policy.js +249 -0
- package/security/trusted-dom-policy.d.ts +36 -0
- package/security/trusted-dom-policy.js +316 -0
- package/tools/package.json +77 -0
- package/tools/rmt-editor/vscode/README.md +33 -0
- package/tools/rmt-editor/vscode/extension.d.ts +9 -0
- package/tools/rmt-editor/vscode/extension.js +55 -0
- package/tools/rmt-editor/vscode/language-configuration.json +28 -0
- package/tools/rmt-editor/vscode/package.json +83 -0
- package/tools/rmt-editor/vscode/snippets/rmt.code-snippets +243 -0
- package/tools/rmt-editor/vscode/syntaxes/rmt.tmLanguage.json +13 -0
- package/tools/rmt-editor/vscode/xtend-rmt-language-0.0.0-enterprise-readiness.vsix +0 -0
- package/tools/rmt-language/code-actions.d.ts +15 -0
- package/tools/rmt-language/code-actions.js +566 -0
- package/tools/rmt-language/completions.d.ts +22 -0
- package/tools/rmt-language/completions.js +475 -0
- package/tools/rmt-language/definitions.d.ts +13 -0
- package/tools/rmt-language/definitions.js +212 -0
- package/tools/rmt-language/diagnostics.d.ts +23 -0
- package/tools/rmt-language/diagnostics.js +486 -0
- package/tools/rmt-language/format-adapter.d.ts +16 -0
- package/tools/rmt-language/format-adapter.js +270 -0
- package/tools/rmt-language/hover.d.ts +12 -0
- package/tools/rmt-language/hover.js +326 -0
- package/tools/rmt-language/kernel-escalation.d.ts +122 -0
- package/tools/rmt-language/kernel-escalation.js +427 -0
- package/tools/rmt-language/kernel-panic-monitor.d.ts +176 -0
- package/tools/rmt-language/kernel-panic-monitor.js +674 -0
- package/tools/rmt-language/kernel-policy-parity.d.ts +142 -0
- package/tools/rmt-language/kernel-policy-parity.js +629 -0
- package/tools/rmt-language/kernel-recovery.d.ts +173 -0
- package/tools/rmt-language/kernel-recovery.js +666 -0
- package/tools/rmt-language/kernel-scheduler-failure.d.ts +136 -0
- package/tools/rmt-language/kernel-scheduler-failure.js +486 -0
- package/tools/rmt-language/kernel-security-regression.d.ts +154 -0
- package/tools/rmt-language/kernel-security-regression.js +465 -0
- package/tools/rmt-language/kernel-trust-authority.d.ts +120 -0
- package/tools/rmt-language/kernel-trust-authority.js +549 -0
- package/tools/rmt-language/parser.d.ts +14 -0
- package/tools/rmt-language/parser.js +111 -0
- package/tools/rmt-language/rmt-tooling-public-types.d.ts +179 -0
- package/tools/rmt-language/rules/boundary-policy.js +81 -0
- package/tools/rmt-language/rules/document-policy.js +65 -0
- package/tools/rmt-language/rules/index.js +29 -0
- package/tools/rmt-language/rules/route-policy.js +81 -0
- package/tools/rmt-language/rules/scheduler-policy.js +66 -0
- package/tools/rmt-language/rules/template-policy.js +130 -0
- package/tools/rmt-language/semantic-graph.d.ts +18 -0
- package/tools/rmt-language/semantic-graph.js +827 -0
- package/tools/rmt-language/snippets/README.md +17 -0
- package/tools/rmt-language/snippets/index.d.ts +17 -0
- package/tools/rmt-language/snippets/index.js +417 -0
- package/tools/rmt-language/snippets/rmt.code-snippets +243 -0
- package/tools/rmt-language/source-model.d.ts +14 -0
- package/tools/rmt-language/source-model.js +731 -0
- package/tools/rmt-language/symbols.d.ts +13 -0
- package/tools/rmt-language/symbols.js +183 -0
- package/tools/rmt-language/vnext-compatibility.d.ts +28 -0
- package/tools/rmt-language/vnext-compatibility.js +675 -0
- package/tools/rmt-language/vnext-compiler.d.ts +17 -0
- package/tools/rmt-language/vnext-compiler.js +716 -0
- package/tools/rmt-language/vnext-composition.d.ts +30 -0
- package/tools/rmt-language/vnext-composition.js +595 -0
- package/tools/rmt-language/vnext-conditions.d.ts +25 -0
- package/tools/rmt-language/vnext-conditions.js +474 -0
- package/tools/rmt-language/vnext-cross-surface-events.d.ts +30 -0
- package/tools/rmt-language/vnext-cross-surface-events.js +607 -0
- package/tools/rmt-language/vnext-degradation.d.ts +23 -0
- package/tools/rmt-language/vnext-degradation.js +428 -0
- package/tools/rmt-language/vnext-enterprise-fixtures.d.ts +28 -0
- package/tools/rmt-language/vnext-enterprise-fixtures.js +487 -0
- package/tools/rmt-language/vnext-enterprise-registry.d.ts +21 -0
- package/tools/rmt-language/vnext-enterprise-registry.js +495 -0
- package/tools/rmt-language/vnext-enterprise-release.d.ts +44 -0
- package/tools/rmt-language/vnext-enterprise-release.js +472 -0
- package/tools/rmt-language/vnext-event-governance.d.ts +29 -0
- package/tools/rmt-language/vnext-event-governance.js +488 -0
- package/tools/rmt-language/vnext-events.d.ts +44 -0
- package/tools/rmt-language/vnext-events.js +680 -0
- package/tools/rmt-language/vnext-import-resolver.d.ts +28 -0
- package/tools/rmt-language/vnext-import-resolver.js +642 -0
- package/tools/rmt-language/vnext-lifecycle.d.ts +22 -0
- package/tools/rmt-language/vnext-lifecycle.js +404 -0
- package/tools/rmt-language/vnext-parser.d.ts +21 -0
- package/tools/rmt-language/vnext-parser.js +1391 -0
- package/tools/rmt-language/vnext-regression.d.ts +25 -0
- package/tools/rmt-language/vnext-regression.js +394 -0
- package/tools/rmt-language/vnext-release.d.ts +29 -0
- package/tools/rmt-language/vnext-release.js +293 -0
- package/tools/rmt-language/vnext-remote-compatibility.d.ts +33 -0
- package/tools/rmt-language/vnext-remote-compatibility.js +892 -0
- package/tools/rmt-language/vnext-remote-compiler.d.ts +14 -0
- package/tools/rmt-language/vnext-remote-compiler.js +520 -0
- package/tools/rmt-language/vnext-remote-manifest.d.ts +33 -0
- package/tools/rmt-language/vnext-remote-manifest.js +538 -0
- package/tools/rmt-language/vnext-remote-security.d.ts +27 -0
- package/tools/rmt-language/vnext-remote-security.js +380 -0
- package/tools/rmt-language/vnext-remote-tooling.d.ts +25 -0
- package/tools/rmt-language/vnext-remote-tooling.js +805 -0
- package/tools/rmt-language/vnext-scheduler.d.ts +24 -0
- package/tools/rmt-language/vnext-scheduler.js +469 -0
- package/tools/rmt-language/vnext-security.d.ts +28 -0
- package/tools/rmt-language/vnext-security.js +597 -0
- package/tools/rmt-language/vnext-streaming.d.ts +28 -0
- package/tools/rmt-language/vnext-streaming.js +593 -0
- package/tools/rmt-language/vnext-surfaces.d.ts +24 -0
- package/tools/rmt-language/vnext-surfaces.js +406 -0
- package/tools/rmt-language/vnext-tooling.d.ts +25 -0
- package/tools/rmt-language/vnext-tooling.js +728 -0
- package/tools/rmt-language-server/protocol.d.ts +22 -0
- package/tools/rmt-language-server/protocol.js +352 -0
- package/tools/rmt-language-server/server.d.ts +15 -0
- package/tools/rmt-language-server/server.js +622 -0
- package/tools/rmt-linter/cli.d.ts +14 -0
- package/tools/rmt-linter/cli.js +450 -0
- package/tools/rmt-linter/reporter.d.ts +16 -0
- package/tools/rmt-linter/reporter.js +472 -0
- package/xtend-builder/README.md +83 -0
- package/xtend-builder/a11y/README.md +42 -0
- package/xtend-builder/a11y/component-a11y-profile.d.ts +14 -0
- package/xtend-builder/a11y/component-a11y-profile.js +314 -0
- package/xtend-builder/blueprints/README.md +105 -0
- package/xtend-builder/blueprints/component-blueprint.contract.d.ts +16 -0
- package/xtend-builder/blueprints/component-blueprint.contract.js +343 -0
- package/xtend-builder/builder-public-types.d.ts +234 -0
- package/xtend-builder/extensions/README.md +26 -0
- package/xtend-builder/extensions/component-extension-points.d.ts +11 -0
- package/xtend-builder/extensions/component-extension-points.js +277 -0
- package/xtend-builder/generators/README.md +149 -0
- package/xtend-builder/generators/component-files.d.ts +5 -0
- package/xtend-builder/generators/component-files.js +769 -0
- package/xtend-builder/generators/component-plan.d.ts +4 -0
- package/xtend-builder/generators/component-plan.js +104 -0
- package/xtend-builder/generators/registry.d.ts +6 -0
- package/xtend-builder/generators/registry.js +118 -0
- package/xtend-builder/generators/rmt-build.js +738 -0
- package/xtend-builder/generators/rmt-lifecycle-demo.js +922 -0
- package/xtend-builder/lib/cli.d.ts +9 -0
- package/xtend-builder/lib/cli.js +543 -0
- package/xtend-builder/lib/layout.d.ts +6 -0
- package/xtend-builder/lib/layout.js +153 -0
- package/xtend-builder/lib/package-resolver.js +25 -0
- package/xtend-builder/package.json +90 -0
- package/xtend-builder/performance/README.md +31 -0
- package/xtend-builder/performance/component-performance-profile.d.ts +11 -0
- package/xtend-builder/performance/component-performance-profile.js +347 -0
- package/xtend-builder/performance/component-ux-performance-contract.d.ts +27 -0
- package/xtend-builder/performance/component-ux-performance-contract.js +424 -0
- package/xtend-builder/preview/README.md +61 -0
- package/xtend-builder/preview/component-lab-ux-inspector.d.ts +20 -0
- package/xtend-builder/preview/component-lab-ux-inspector.js +448 -0
- package/xtend-builder/preview/component-lab.d.ts +14 -0
- package/xtend-builder/preview/component-lab.js +278 -0
- package/xtend-builder/preview/component-preview.d.ts +5 -0
- package/xtend-builder/preview/component-preview.js +160 -0
- package/xtend-builder/scaffold.config.d.ts +4 -0
- package/xtend-builder/scaffold.config.js +2056 -0
- package/xtend-builder/scaffold.d.ts +3 -0
- package/xtend-builder/scaffold.js +11 -0
- package/xtend-builder/templates/README.md +33 -0
- package/xtend-builder/templates/component/a11y.template.ts +11 -0
- package/xtend-builder/templates/component/component-suite.template.d.ts +2 -0
- package/xtend-builder/templates/component/component-suite.template.js +108 -0
- package/xtend-builder/templates/component/contract.template.ts +10 -0
- package/xtend-builder/templates/component/demo-plan.template.md +73 -0
- package/xtend-builder/templates/component/docs.template.md +301 -0
- package/xtend-builder/templates/component/fixture-data.template.ts +28 -0
- package/xtend-builder/templates/component/fixture.template.html +37 -0
- package/xtend-builder/templates/component/manifest-plan.template.json +22 -0
- package/xtend-builder/templates/component/performance.template.ts +13 -0
- package/xtend-builder/templates/component/rmt.template.ts +12 -0
- package/xtend-builder/templates/component/source.template.d.ts +2 -0
- package/xtend-builder/templates/component/source.template.js +137 -0
- package/xtend-builder/templates/component/source.template.ts +110 -0
- package/xtend-builder/templates/component/types.template.d.ts +423 -0
- package/xtend-builder/templates/loader.d.ts +4 -0
- package/xtend-builder/templates/loader.js +51 -0
- package/xtend-builder/templates/registry.d.ts +6 -0
- package/xtend-builder/templates/registry.js +119 -0
- package/xtend-builder/typing/README.md +130 -0
- package/xtend-builder/typing/component-contract-v2.d.ts +15 -0
- package/xtend-builder/typing/component-contract-v2.js +248 -0
- package/xtend-builder/typing/component-network-contract.d.ts +22 -0
- package/xtend-builder/typing/component-network-contract.js +478 -0
- package/xtend-builder/typing/component-shell-contract.d.ts +21 -0
- package/xtend-builder/typing/component-shell-contract.js +312 -0
- package/xtend-builder/typing/component-styling-contract.d.ts +22 -0
- package/xtend-builder/typing/component-styling-contract.js +301 -0
- package/xtend-builder/typing/component-types.d.ts +10 -0
- package/xtend-builder/typing/component-types.js +551 -0
- package/xtend-builder/typing/enterprise-component-flex-hardening-contract.d.ts +20 -0
- package/xtend-builder/typing/enterprise-component-flex-hardening-contract.js +332 -0
- package/xtend-builder/typing/feedback-status-ux-contract.d.ts +25 -0
- package/xtend-builder/typing/feedback-status-ux-contract.js +347 -0
- package/xtend-builder/typing/form-controls-ux-contract.d.ts +25 -0
- package/xtend-builder/typing/form-controls-ux-contract.js +357 -0
- package/xtend-builder/typing/layout-display-media-ux-contract.d.ts +25 -0
- package/xtend-builder/typing/layout-display-media-ux-contract.js +420 -0
- package/xtend-builder/typing/navigation-routing-ux-contract.d.ts +17 -0
- package/xtend-builder/typing/navigation-routing-ux-contract.js +297 -0
- package/xtend-builder/typing/overlay-interaction-ux-contract.d.ts +25 -0
- package/xtend-builder/typing/overlay-interaction-ux-contract.js +383 -0
- package/xtend-builder/typing/rmt-dsl-authoring-polish.d.ts +27 -0
- package/xtend-builder/typing/rmt-dsl-authoring-polish.js +419 -0
- package/xtend-builder/typing/rmt-shell-authoring-contract.d.ts +26 -0
- package/xtend-builder/typing/rmt-shell-authoring-contract.js +315 -0
- package/xtend-builder/utils/README.md +8 -0
- package/xtend-builder/utils/naming.d.ts +7 -0
- package/xtend-builder/utils/naming.js +36 -0
- package/xtend-builder/utils/validation.d.ts +5 -0
- package/xtend-builder/utils/validation.js +95 -0
- package/xtend-builder/wiring/README.md +46 -0
- package/xtend-builder/wiring/features.d.ts +5 -0
- package/xtend-builder/wiring/features.js +165 -0
- package/xtend-builder/wiring/hydration.d.ts +4 -0
- package/xtend-builder/wiring/hydration.js +44 -0
- package/xtend-builder/wiring/manifest.d.ts +5 -0
- package/xtend-builder/wiring/manifest.js +48 -0
- package/xtend-builder/workflows/README.md +47 -0
- package/xtend-builder/workflows/developer-workflow.d.ts +6 -0
- package/xtend-builder/workflows/developer-workflow.js +125 -0
- package/xtend-builder/writing/manifest-patcher.d.ts +49 -0
- package/xtend-builder/writing/manifest-patcher.js +391 -0
- package/xtend-builder/writing/write-plan.d.ts +148 -0
- package/xtend-builder/writing/write-plan.js +646 -0
- package/xtend-dev.d.ts +23 -0
- package/xtend-dev.js +4 -0
- package/xtend-loader.d.ts +201 -0
- package/xtend-loader.js +1704 -0
- package/xtend.css +402 -0
- package/xtendrmt/package.json +64 -0
- package/xtendrmt/rmt-core.d.ts +4452 -0
- package/xtendrmt/rmt-core.esm.js +25793 -0
- package/xtendrmt/rmt-first-demo-app.js +265 -0
- package/xtendrmt/rmt-first-demo-app.rmt +737 -0
- package/xtendrmt/rmt-lifecycle-demo.app.js +493 -0
- package/xtendrmt/rmt-lifecycle-demo.core.json +810 -0
- package/xtendrmt/rmt-lifecycle-demo.rmt +35 -0
- package/xtendrmt/rmt-lifecycle-demo.rmt-build.app.js +153 -0
- package/xtendrmt/rmt-lifecycle-demo.rmt-build.core.json +810 -0
- package/xtendrmt/rmt-lifecycle-demo.rmt-build.scaffold.json +202 -0
- package/xtendrmt/rmt-lifecycle-demo.scaffold.json +187 -0
- package/xtendrmt/rmt-manifest.json +548 -0
- package/xtendrmt/rmt-runtime.browser.js +26183 -0
- package/xtendrmt/rmt-runtime.esm.js +26214 -0
- package/xtendrmt/rmt-vnext-enterprise-mfe-demo.core.json +849 -0
- package/xtendrmt/rmt-vnext-enterprise-mfe-demo.rmt +50 -0
- package/xtendrmt/rmt-vnext-reference-demo.core.json +1069 -0
- package/xtendrmt/rmt-vnext-reference-demo.rmt +50 -0
- package/xtendrmt/rmt.schema.json +3145 -0
- package/xtendrmt/surface-workbench.js +316 -0
- package/xtendrmt/surface-workbench.rmt +762 -0
- package/xtendrmt/xtendrmt-bestcase-demo.core.json +1187 -0
- package/xtendrmt/xtendrmt-bestcase-demo.js +1728 -0
- package/xtendrmt/xtendrmt-bestcase-demo.rmt +57 -0
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
const COMPONENT_SHELL_CONTRACT_SCHEMA = 'xtend.component.shell.v1';
|
|
2
|
+
const COMPONENT_SHELL_REPORT_SCHEMA = 'xtend.component.shell-report.v1';
|
|
3
|
+
const COMPONENT_SHELL_WORKPACKAGE = 'WP-E11-02';
|
|
4
|
+
const COMPONENT_SHELL_CONTRACT_DOC = 'development/XTend-Component-Shell-Contract.md';
|
|
5
|
+
const COMPONENT_CONTRACT_V2_SCHEMA = 'xtend.component.contract.v2';
|
|
6
|
+
const UX_MATURITY_MODEL_SCHEMA = 'xtend.component.ux-maturity-model.v1';
|
|
7
|
+
const RMT_SHELL_AUTHORING_SCHEMA = 'xtend.rmt.shell-authoring.v1';
|
|
8
|
+
const FABRIC_BOUNDARY_SCHEMA = 'xtend.component.fabric-boundary.v2';
|
|
9
|
+
const A11Y_COMPONENT_CONTRACT_SCHEMA = 'xtend.a11y.component-contract.v1';
|
|
10
|
+
const PERFORMANCE_COMPONENT_PROFILE_SCHEMA = 'xtend.performance.component-profile.v1';
|
|
11
|
+
const KERNEL_BOUNDARY = 'no-rmt-kernel-import-of-xtend-types';
|
|
12
|
+
|
|
13
|
+
const SHELL_REQUIRED_DOMAINS = [
|
|
14
|
+
'dom',
|
|
15
|
+
'states',
|
|
16
|
+
'slots',
|
|
17
|
+
'parts',
|
|
18
|
+
'tokens',
|
|
19
|
+
'focus',
|
|
20
|
+
'a11y',
|
|
21
|
+
'performance',
|
|
22
|
+
'rmt',
|
|
23
|
+
'fabric',
|
|
24
|
+
'compatibility',
|
|
25
|
+
'docs',
|
|
26
|
+
'tests'
|
|
27
|
+
];
|
|
28
|
+
|
|
29
|
+
const SHELL_DOM_MODES = ['shadow', 'light', 'hybrid'];
|
|
30
|
+
|
|
31
|
+
const SHELL_REQUIRED_STATES = [
|
|
32
|
+
'empty',
|
|
33
|
+
'loading',
|
|
34
|
+
'ready',
|
|
35
|
+
'error',
|
|
36
|
+
'disabled',
|
|
37
|
+
'busy',
|
|
38
|
+
'invalid'
|
|
39
|
+
];
|
|
40
|
+
|
|
41
|
+
const SHELL_DEFAULT_SLOTS = [
|
|
42
|
+
'default',
|
|
43
|
+
'label',
|
|
44
|
+
'helper',
|
|
45
|
+
'error',
|
|
46
|
+
'prefix',
|
|
47
|
+
'suffix'
|
|
48
|
+
];
|
|
49
|
+
|
|
50
|
+
const SHELL_DEFAULT_PARTS = [
|
|
51
|
+
'root',
|
|
52
|
+
'control',
|
|
53
|
+
'label',
|
|
54
|
+
'content',
|
|
55
|
+
'helper',
|
|
56
|
+
'error',
|
|
57
|
+
'icon'
|
|
58
|
+
];
|
|
59
|
+
|
|
60
|
+
const SHELL_FOCUS_STRATEGIES = [
|
|
61
|
+
'none',
|
|
62
|
+
'host',
|
|
63
|
+
'delegates-focus',
|
|
64
|
+
'managed-roving',
|
|
65
|
+
'trap'
|
|
66
|
+
];
|
|
67
|
+
|
|
68
|
+
function normalizeArray(value) {
|
|
69
|
+
return Array.isArray(value) ? value.slice() : [];
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function unique(values) {
|
|
73
|
+
return Array.from(new Set(normalizeArray(values).filter(Boolean)));
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function toBasename(tag) {
|
|
77
|
+
return String(tag || 'x-example').replace(/-/g, '');
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function normalizeSlot(slot) {
|
|
81
|
+
if (typeof slot === 'string') {
|
|
82
|
+
return {
|
|
83
|
+
name: slot,
|
|
84
|
+
required: slot === 'default',
|
|
85
|
+
accepts: 'RmtTemplateRef | string | HTMLElement'
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
return {
|
|
89
|
+
name: slot.name,
|
|
90
|
+
required: Boolean(slot.required),
|
|
91
|
+
accepts: slot.accepts || 'RmtTemplateRef | string | HTMLElement'
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function normalizePart(part) {
|
|
96
|
+
if (typeof part === 'string') {
|
|
97
|
+
return {
|
|
98
|
+
name: part,
|
|
99
|
+
required: part === 'root',
|
|
100
|
+
purpose: part === 'root' ? 'stable shell root' : 'stable styling entry point'
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
return {
|
|
104
|
+
name: part.name,
|
|
105
|
+
required: Boolean(part.required),
|
|
106
|
+
purpose: part.purpose || 'stable styling entry point'
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function normalizeToken(token) {
|
|
111
|
+
if (typeof token === 'string') {
|
|
112
|
+
return {
|
|
113
|
+
name: token,
|
|
114
|
+
defaultValue: 'inherit',
|
|
115
|
+
category: 'component'
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
return {
|
|
119
|
+
name: token.name,
|
|
120
|
+
defaultValue: token.defaultValue || 'inherit',
|
|
121
|
+
category: token.category || 'component'
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function createComponentShellContract(input = {}, options = {}) {
|
|
126
|
+
const tag = input.tag || 'x-example';
|
|
127
|
+
const basename = input.basename || toBasename(tag);
|
|
128
|
+
const domInput = input.dom || {};
|
|
129
|
+
const focusInput = input.focus || {};
|
|
130
|
+
const a11yInput = input.a11y || {};
|
|
131
|
+
const performanceInput = input.performance || {};
|
|
132
|
+
const slots = normalizeArray(input.slots).length > 0
|
|
133
|
+
? normalizeArray(input.slots).map(normalizeSlot)
|
|
134
|
+
: SHELL_DEFAULT_SLOTS.map(normalizeSlot);
|
|
135
|
+
const parts = normalizeArray(input.parts).length > 0
|
|
136
|
+
? normalizeArray(input.parts).map(normalizePart)
|
|
137
|
+
: SHELL_DEFAULT_PARTS.map(normalizePart);
|
|
138
|
+
const tokens = normalizeArray(input.tokens).length > 0
|
|
139
|
+
? normalizeArray(input.tokens).map(normalizeToken)
|
|
140
|
+
: [
|
|
141
|
+
`--xtend-${basename}-color`,
|
|
142
|
+
`--xtend-${basename}-surface`,
|
|
143
|
+
`--xtend-${basename}-radius`,
|
|
144
|
+
`--xtend-${basename}-gap`,
|
|
145
|
+
`--xtend-${basename}-motion-duration`
|
|
146
|
+
].map(normalizeToken);
|
|
147
|
+
const states = unique(SHELL_REQUIRED_STATES.concat(normalizeArray(input.states)));
|
|
148
|
+
|
|
149
|
+
return {
|
|
150
|
+
schema: COMPONENT_SHELL_CONTRACT_SCHEMA,
|
|
151
|
+
status: 'contract-draft',
|
|
152
|
+
workpackage: COMPONENT_SHELL_WORKPACKAGE,
|
|
153
|
+
componentContract: COMPONENT_CONTRACT_V2_SCHEMA,
|
|
154
|
+
uxMaturityModel: UX_MATURITY_MODEL_SCHEMA,
|
|
155
|
+
tag,
|
|
156
|
+
dom: {
|
|
157
|
+
mode: domInput.mode || input.domMode || 'shadow',
|
|
158
|
+
delegatesFocus: Boolean(domInput.delegatesFocus),
|
|
159
|
+
formAssociated: Boolean(domInput.formAssociated),
|
|
160
|
+
rootPart: domInput.rootPart || 'root',
|
|
161
|
+
attributeStatePrefix: domInput.attributeStatePrefix || 'data-xtend-state'
|
|
162
|
+
},
|
|
163
|
+
states,
|
|
164
|
+
slots,
|
|
165
|
+
parts,
|
|
166
|
+
tokens,
|
|
167
|
+
focus: {
|
|
168
|
+
strategy: focusInput.strategy || 'host',
|
|
169
|
+
visibleFocusRequired: focusInput.visibleFocusRequired !== false,
|
|
170
|
+
keyboardRequired: focusInput.keyboardRequired !== false,
|
|
171
|
+
restoreOnRouteChange: Boolean(focusInput.restoreOnRouteChange)
|
|
172
|
+
},
|
|
173
|
+
a11y: {
|
|
174
|
+
schema: A11Y_COMPONENT_CONTRACT_SCHEMA,
|
|
175
|
+
runtimeBehaviorRequired: true,
|
|
176
|
+
requiredSignals: a11yInput.requiredSignals || ['role', 'name', 'state', 'keyboard', 'screenreader'],
|
|
177
|
+
ariaOnlyWhenNativeSemanticsAreInsufficient: a11yInput.ariaOnlyWhenNativeSemanticsAreInsufficient !== false,
|
|
178
|
+
reducedMotionSafe: a11yInput.reducedMotionSafe !== false,
|
|
179
|
+
forcedColorsSafe: a11yInput.forcedColorsSafe !== false
|
|
180
|
+
},
|
|
181
|
+
performance: {
|
|
182
|
+
schema: PERFORMANCE_COMPONENT_PROFILE_SCHEMA,
|
|
183
|
+
mountBudgetMs: performanceInput.mountBudgetMs || options.mountBudgetMs || 16,
|
|
184
|
+
hydrateBudgetMs: performanceInput.hydrateBudgetMs || options.hydrateBudgetMs || 24,
|
|
185
|
+
eventBudgetMs: performanceInput.eventBudgetMs || options.eventBudgetMs || 8,
|
|
186
|
+
noLayoutThrashing: performanceInput.noLayoutThrashing !== false,
|
|
187
|
+
cleanupRequired: performanceInput.cleanupRequired !== false
|
|
188
|
+
},
|
|
189
|
+
rmt: {
|
|
190
|
+
schema: RMT_SHELL_AUTHORING_SCHEMA,
|
|
191
|
+
adapter: 'xtend.component',
|
|
192
|
+
templateMode: input.templateMode || 'dom_descriptor',
|
|
193
|
+
fields: ['shell', 'style', 'a11y', 'commands', 'events', 'variants', 'density', 'hydration', 'schedule', 'fabric'],
|
|
194
|
+
kernelBoundary: KERNEL_BOUNDARY
|
|
195
|
+
},
|
|
196
|
+
fabric: {
|
|
197
|
+
schema: FABRIC_BOUNDARY_SCHEMA,
|
|
198
|
+
api: '@xtend-fabric',
|
|
199
|
+
laneIngestion: true,
|
|
200
|
+
fiberHints: ['component.mount', 'component.hydrate', 'component.render', 'component.event'],
|
|
201
|
+
errorBoundaryRequired: true
|
|
202
|
+
},
|
|
203
|
+
compatibility: {
|
|
204
|
+
hostModes: ['xtend-only', 'rmt-first', 'vanilla', 'react', 'vue', 'custom-shell'],
|
|
205
|
+
nativeCustomElementRequired: true,
|
|
206
|
+
noGlobalMagicState: true,
|
|
207
|
+
noRuntimeDependenciesAllowed: true
|
|
208
|
+
},
|
|
209
|
+
docs: {
|
|
210
|
+
contract: COMPONENT_SHELL_CONTRACT_DOC,
|
|
211
|
+
componentGuide: `docs/components/${tag.replace(/^x-/, '')}.md`,
|
|
212
|
+
requiredSections: ['Shell', 'States', 'Slots', 'Parts', 'Focus', 'A11y', 'Performance', 'RMT Authoring']
|
|
213
|
+
},
|
|
214
|
+
tests: {
|
|
215
|
+
requiredSuites: ['component-shell-contract', 'components', 'a11y-hydration', 'performance-regression', 'references'],
|
|
216
|
+
fixtureRequired: true,
|
|
217
|
+
browserSmokeRequiredForInteractiveShells: true
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
function validateComponentShellContract(contract = {}) {
|
|
223
|
+
const errors = [];
|
|
224
|
+
|
|
225
|
+
if (contract.schema !== COMPONENT_SHELL_CONTRACT_SCHEMA) {
|
|
226
|
+
errors.push(`schema must be ${COMPONENT_SHELL_CONTRACT_SCHEMA}`);
|
|
227
|
+
}
|
|
228
|
+
if (!/^x-[a-z0-9]+(?:-[a-z0-9]+)*$/.test(String(contract.tag || ''))) {
|
|
229
|
+
errors.push('tag must be a valid XTend custom element tag');
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
SHELL_REQUIRED_DOMAINS.forEach((domain) => {
|
|
233
|
+
if (!contract[domain]) {
|
|
234
|
+
errors.push(`missing domain: ${domain}`);
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
if (contract.dom && !SHELL_DOM_MODES.includes(contract.dom.mode)) {
|
|
239
|
+
errors.push(`dom.mode must be one of: ${SHELL_DOM_MODES.join(', ')}`);
|
|
240
|
+
}
|
|
241
|
+
if (!Array.isArray(contract.states)) {
|
|
242
|
+
errors.push('states must be an array');
|
|
243
|
+
} else {
|
|
244
|
+
SHELL_REQUIRED_STATES.forEach((state) => {
|
|
245
|
+
if (!contract.states.includes(state)) {
|
|
246
|
+
errors.push(`states must include ${state}`);
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
if (!Array.isArray(contract.slots) || !contract.slots.some((slot) => slot && slot.name === 'default')) {
|
|
251
|
+
errors.push('slots must include a default slot');
|
|
252
|
+
}
|
|
253
|
+
if (!Array.isArray(contract.parts) || !contract.parts.some((part) => part && part.name === 'root')) {
|
|
254
|
+
errors.push('parts must include a root part');
|
|
255
|
+
}
|
|
256
|
+
if (!Array.isArray(contract.tokens) || contract.tokens.length === 0) {
|
|
257
|
+
errors.push('tokens must include at least one design token');
|
|
258
|
+
}
|
|
259
|
+
if (contract.focus && !SHELL_FOCUS_STRATEGIES.includes(contract.focus.strategy)) {
|
|
260
|
+
errors.push(`focus.strategy must be one of: ${SHELL_FOCUS_STRATEGIES.join(', ')}`);
|
|
261
|
+
}
|
|
262
|
+
if (contract.focus && contract.focus.visibleFocusRequired !== true) {
|
|
263
|
+
errors.push('focus.visibleFocusRequired must be true');
|
|
264
|
+
}
|
|
265
|
+
if (contract.a11y && contract.a11y.runtimeBehaviorRequired !== true) {
|
|
266
|
+
errors.push('a11y.runtimeBehaviorRequired must be true');
|
|
267
|
+
}
|
|
268
|
+
if (contract.performance) {
|
|
269
|
+
['mountBudgetMs', 'hydrateBudgetMs', 'eventBudgetMs'].forEach((field) => {
|
|
270
|
+
if (typeof contract.performance[field] !== 'number' || contract.performance[field] <= 0) {
|
|
271
|
+
errors.push(`performance.${field} must be a positive number`);
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
if (contract.rmt && contract.rmt.kernelBoundary !== KERNEL_BOUNDARY) {
|
|
276
|
+
errors.push('rmt.kernelBoundary must keep the RMT kernel decoupled from XTend types');
|
|
277
|
+
}
|
|
278
|
+
if (contract.fabric && contract.fabric.api !== '@xtend-fabric') {
|
|
279
|
+
errors.push('fabric.api must be @xtend-fabric');
|
|
280
|
+
}
|
|
281
|
+
if (contract.compatibility && !normalizeArray(contract.compatibility.hostModes).includes('rmt-first')) {
|
|
282
|
+
errors.push('compatibility.hostModes must include rmt-first');
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
return {
|
|
286
|
+
schema: COMPONENT_SHELL_REPORT_SCHEMA,
|
|
287
|
+
ok: errors.length === 0,
|
|
288
|
+
errors
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
module.exports = {
|
|
293
|
+
COMPONENT_SHELL_CONTRACT_SCHEMA,
|
|
294
|
+
COMPONENT_SHELL_REPORT_SCHEMA,
|
|
295
|
+
COMPONENT_SHELL_WORKPACKAGE,
|
|
296
|
+
COMPONENT_SHELL_CONTRACT_DOC,
|
|
297
|
+
COMPONENT_CONTRACT_V2_SCHEMA,
|
|
298
|
+
UX_MATURITY_MODEL_SCHEMA,
|
|
299
|
+
RMT_SHELL_AUTHORING_SCHEMA,
|
|
300
|
+
FABRIC_BOUNDARY_SCHEMA,
|
|
301
|
+
A11Y_COMPONENT_CONTRACT_SCHEMA,
|
|
302
|
+
PERFORMANCE_COMPONENT_PROFILE_SCHEMA,
|
|
303
|
+
KERNEL_BOUNDARY,
|
|
304
|
+
SHELL_REQUIRED_DOMAINS,
|
|
305
|
+
SHELL_DOM_MODES,
|
|
306
|
+
SHELL_REQUIRED_STATES,
|
|
307
|
+
SHELL_DEFAULT_SLOTS,
|
|
308
|
+
SHELL_DEFAULT_PARTS,
|
|
309
|
+
SHELL_FOCUS_STRATEGIES,
|
|
310
|
+
createComponentShellContract,
|
|
311
|
+
validateComponentShellContract
|
|
312
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { XtendBuilderComponentInput, XtendBuilderOptions, XtendBuilderRecord, XtendBuilderReport } from '../builder-public-types';
|
|
2
|
+
|
|
3
|
+
export declare const COMPONENT_STYLING_CONTRACT_SCHEMA: string;
|
|
4
|
+
export declare const COMPONENT_STYLING_REPORT_SCHEMA: string;
|
|
5
|
+
export declare const COMPONENT_STYLING_WORKPACKAGE: string;
|
|
6
|
+
export declare const COMPONENT_STYLING_CONTRACT_DOC: string;
|
|
7
|
+
export declare const COMPONENT_SHELL_CONTRACT_SCHEMA: string;
|
|
8
|
+
export declare const COMPONENT_CONTRACT_V2_SCHEMA: string;
|
|
9
|
+
export declare const UX_MATURITY_MODEL_SCHEMA: string;
|
|
10
|
+
export declare const RMT_STYLE_AUTHORING_SCHEMA: string;
|
|
11
|
+
export declare const FABRIC_BOUNDARY_SCHEMA: string;
|
|
12
|
+
export declare const KERNEL_BOUNDARY: string;
|
|
13
|
+
export declare const STYLING_REQUIRED_DOMAINS: string[];
|
|
14
|
+
export declare const STYLING_TOKEN_CATEGORIES: string[];
|
|
15
|
+
export declare const STYLING_REQUIRED_VARIANTS: string[];
|
|
16
|
+
export declare const STYLING_REQUIRED_SIZES: string[];
|
|
17
|
+
export declare const STYLING_REQUIRED_DENSITIES: string[];
|
|
18
|
+
export declare const STYLING_REQUIRED_THEMES: string[];
|
|
19
|
+
export declare const STYLING_REQUIRED_PARTS: string[];
|
|
20
|
+
export declare const STYLING_MOTION_POLICIES: string[];
|
|
21
|
+
export declare function createComponentStylingContract(input?: XtendBuilderComponentInput, options?: XtendBuilderOptions): XtendBuilderRecord;
|
|
22
|
+
export declare function validateComponentStylingContract(contract: unknown): XtendBuilderReport<XtendBuilderRecord>;
|
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
const COMPONENT_STYLING_CONTRACT_SCHEMA = 'xtend.component.styling.v1';
|
|
2
|
+
const COMPONENT_STYLING_REPORT_SCHEMA = 'xtend.component.styling-report.v1';
|
|
3
|
+
const COMPONENT_STYLING_WORKPACKAGE = 'WP-E11-03';
|
|
4
|
+
const COMPONENT_STYLING_CONTRACT_DOC = 'development/XTend-Component-Styling-Token-und-Part-Contract.md';
|
|
5
|
+
const COMPONENT_SHELL_CONTRACT_SCHEMA = 'xtend.component.shell.v1';
|
|
6
|
+
const COMPONENT_CONTRACT_V2_SCHEMA = 'xtend.component.contract.v2';
|
|
7
|
+
const UX_MATURITY_MODEL_SCHEMA = 'xtend.component.ux-maturity-model.v1';
|
|
8
|
+
const RMT_STYLE_AUTHORING_SCHEMA = 'xtend.rmt.style-authoring.v1';
|
|
9
|
+
const FABRIC_BOUNDARY_SCHEMA = 'xtend.component.fabric-boundary.v2';
|
|
10
|
+
const KERNEL_BOUNDARY = 'no-rmt-kernel-import-of-xtend-types';
|
|
11
|
+
|
|
12
|
+
const STYLING_REQUIRED_DOMAINS = [
|
|
13
|
+
'tokens',
|
|
14
|
+
'customProperties',
|
|
15
|
+
'parts',
|
|
16
|
+
'variants',
|
|
17
|
+
'sizes',
|
|
18
|
+
'density',
|
|
19
|
+
'themes',
|
|
20
|
+
'motion',
|
|
21
|
+
'contrast',
|
|
22
|
+
'rmt',
|
|
23
|
+
'fabric',
|
|
24
|
+
'compatibility',
|
|
25
|
+
'docs',
|
|
26
|
+
'tests'
|
|
27
|
+
];
|
|
28
|
+
|
|
29
|
+
const STYLING_TOKEN_CATEGORIES = [
|
|
30
|
+
'color',
|
|
31
|
+
'surface',
|
|
32
|
+
'text',
|
|
33
|
+
'space',
|
|
34
|
+
'radius',
|
|
35
|
+
'typography',
|
|
36
|
+
'motion',
|
|
37
|
+
'elevation',
|
|
38
|
+
'state'
|
|
39
|
+
];
|
|
40
|
+
|
|
41
|
+
const STYLING_REQUIRED_VARIANTS = [
|
|
42
|
+
'default',
|
|
43
|
+
'primary',
|
|
44
|
+
'secondary',
|
|
45
|
+
'success',
|
|
46
|
+
'warning',
|
|
47
|
+
'danger',
|
|
48
|
+
'neutral'
|
|
49
|
+
];
|
|
50
|
+
|
|
51
|
+
const STYLING_REQUIRED_SIZES = ['sm', 'md', 'lg'];
|
|
52
|
+
const STYLING_REQUIRED_DENSITIES = ['comfortable', 'compact', 'dense'];
|
|
53
|
+
const STYLING_REQUIRED_THEMES = ['light', 'dark', 'high-contrast', 'forced-colors'];
|
|
54
|
+
const STYLING_REQUIRED_PARTS = ['root', 'control', 'label', 'content', 'helper', 'error'];
|
|
55
|
+
const STYLING_MOTION_POLICIES = ['standard', 'reduced'];
|
|
56
|
+
|
|
57
|
+
function normalizeArray(value) {
|
|
58
|
+
return Array.isArray(value) ? value.slice() : [];
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function unique(values) {
|
|
62
|
+
return Array.from(new Set(normalizeArray(values).filter(Boolean)));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function toBasename(tag) {
|
|
66
|
+
return String(tag || 'x-example').replace(/^x-/, '').replace(/-/g, '-');
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function normalizeToken(token, tag) {
|
|
70
|
+
if (typeof token === 'string') {
|
|
71
|
+
return {
|
|
72
|
+
name: token,
|
|
73
|
+
category: 'state',
|
|
74
|
+
defaultValue: `var(--xtend-${toBasename(tag)}-surface, inherit)`,
|
|
75
|
+
fallbackRequired: true
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
name: token.name,
|
|
80
|
+
category: token.category || 'state',
|
|
81
|
+
defaultValue: token.defaultValue || 'inherit',
|
|
82
|
+
fallbackRequired: token.fallbackRequired !== false
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function createDefaultTokens(tag) {
|
|
87
|
+
const basename = toBasename(tag);
|
|
88
|
+
return [
|
|
89
|
+
{ name: `--xtend-${basename}-color`, category: 'color', defaultValue: 'var(--xtend-color-text, currentColor)' },
|
|
90
|
+
{ name: `--xtend-${basename}-surface`, category: 'surface', defaultValue: 'var(--xtend-color-surface, transparent)' },
|
|
91
|
+
{ name: `--xtend-${basename}-text`, category: 'text', defaultValue: 'var(--xtend-color-text, currentColor)' },
|
|
92
|
+
{ name: `--xtend-${basename}-gap`, category: 'space', defaultValue: 'var(--xtend-space-2, 0.5rem)' },
|
|
93
|
+
{ name: `--xtend-${basename}-radius`, category: 'radius', defaultValue: 'var(--xtend-radius-sm, 4px)' },
|
|
94
|
+
{ name: `--xtend-${basename}-font`, category: 'typography', defaultValue: 'var(--xtend-font-family, inherit)' },
|
|
95
|
+
{ name: `--xtend-${basename}-motion-duration`, category: 'motion', defaultValue: 'var(--xtend-motion-duration-fast, 120ms)' },
|
|
96
|
+
{ name: `--xtend-${basename}-elevation`, category: 'elevation', defaultValue: 'var(--xtend-elevation-0, none)' },
|
|
97
|
+
{ name: `--xtend-${basename}-state-color`, category: 'state', defaultValue: 'var(--xtend-color-accent, currentColor)' }
|
|
98
|
+
].map((token) => normalizeToken(token, tag));
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function normalizePart(part) {
|
|
102
|
+
if (typeof part === 'string') {
|
|
103
|
+
return {
|
|
104
|
+
name: part,
|
|
105
|
+
stable: true,
|
|
106
|
+
selector: `::part(${part})`
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
return {
|
|
110
|
+
name: part.name,
|
|
111
|
+
stable: part.stable !== false,
|
|
112
|
+
selector: part.selector || `::part(${part.name})`
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function createComponentStylingContract(input = {}) {
|
|
117
|
+
const tag = input.tag || 'x-example';
|
|
118
|
+
const tokenInput = normalizeArray(input.tokens);
|
|
119
|
+
const parts = normalizeArray(input.parts).length > 0
|
|
120
|
+
? normalizeArray(input.parts).map(normalizePart)
|
|
121
|
+
: STYLING_REQUIRED_PARTS.map(normalizePart);
|
|
122
|
+
const tokens = tokenInput.length > 0
|
|
123
|
+
? tokenInput.map((token) => normalizeToken(token, tag))
|
|
124
|
+
: createDefaultTokens(tag);
|
|
125
|
+
const variants = unique(STYLING_REQUIRED_VARIANTS.concat(normalizeArray(input.variants)));
|
|
126
|
+
const sizes = unique(STYLING_REQUIRED_SIZES.concat(normalizeArray(input.sizes)));
|
|
127
|
+
const density = unique(STYLING_REQUIRED_DENSITIES.concat(normalizeArray(input.density)));
|
|
128
|
+
const themes = unique(STYLING_REQUIRED_THEMES.concat(normalizeArray(input.themes)));
|
|
129
|
+
|
|
130
|
+
return {
|
|
131
|
+
schema: COMPONENT_STYLING_CONTRACT_SCHEMA,
|
|
132
|
+
status: 'contract-draft',
|
|
133
|
+
workpackage: COMPONENT_STYLING_WORKPACKAGE,
|
|
134
|
+
componentContract: COMPONENT_CONTRACT_V2_SCHEMA,
|
|
135
|
+
shellContract: COMPONENT_SHELL_CONTRACT_SCHEMA,
|
|
136
|
+
uxMaturityModel: UX_MATURITY_MODEL_SCHEMA,
|
|
137
|
+
tag,
|
|
138
|
+
tokens,
|
|
139
|
+
customProperties: {
|
|
140
|
+
prefix: `--xtend-${toBasename(tag)}-`,
|
|
141
|
+
fallbackRequired: true,
|
|
142
|
+
hostThemeBridge: true,
|
|
143
|
+
noUnscopedGlobals: true
|
|
144
|
+
},
|
|
145
|
+
parts,
|
|
146
|
+
variants: {
|
|
147
|
+
allowed: variants,
|
|
148
|
+
defaultVariant: input.defaultVariant || 'default',
|
|
149
|
+
unknownVariantPolicy: 'ignore-and-diagnose'
|
|
150
|
+
},
|
|
151
|
+
sizes: {
|
|
152
|
+
allowed: sizes,
|
|
153
|
+
defaultSize: input.defaultSize || 'md'
|
|
154
|
+
},
|
|
155
|
+
density: {
|
|
156
|
+
allowed: density,
|
|
157
|
+
defaultDensity: input.defaultDensity || 'comfortable',
|
|
158
|
+
hostPropagation: true
|
|
159
|
+
},
|
|
160
|
+
themes: {
|
|
161
|
+
supported: themes,
|
|
162
|
+
bridge: 'x-theme',
|
|
163
|
+
tokenInheritance: true,
|
|
164
|
+
forcedColorsRequired: true
|
|
165
|
+
},
|
|
166
|
+
motion: {
|
|
167
|
+
policies: STYLING_MOTION_POLICIES.slice(),
|
|
168
|
+
reducedMotionSafe: true,
|
|
169
|
+
noMotionRequiredForCoreFunction: true
|
|
170
|
+
},
|
|
171
|
+
contrast: {
|
|
172
|
+
highContrastRequired: true,
|
|
173
|
+
forcedColorsRequired: true,
|
|
174
|
+
noColorOnlyState: true,
|
|
175
|
+
focusVisibleRequired: true
|
|
176
|
+
},
|
|
177
|
+
rmt: {
|
|
178
|
+
schema: RMT_STYLE_AUTHORING_SCHEMA,
|
|
179
|
+
adapter: 'xtend.component',
|
|
180
|
+
fields: ['style', 'tokens', 'parts', 'variant', 'size', 'density', 'theme', 'motion', 'contrast'],
|
|
181
|
+
kernelBoundary: KERNEL_BOUNDARY
|
|
182
|
+
},
|
|
183
|
+
fabric: {
|
|
184
|
+
schema: FABRIC_BOUNDARY_SCHEMA,
|
|
185
|
+
diagnostics: ['style.token.missing', 'style.variant.unknown', 'style.theme.unsupported'],
|
|
186
|
+
telemetryFields: ['componentId', 'variant', 'size', 'density', 'theme', 'forcedColors', 'reducedMotion']
|
|
187
|
+
},
|
|
188
|
+
compatibility: {
|
|
189
|
+
hostModes: ['xtend-only', 'rmt-first', 'vanilla', 'react', 'vue', 'custom-shell'],
|
|
190
|
+
cssPartsRequired: true,
|
|
191
|
+
shadowDomSkinningAllowed: true,
|
|
192
|
+
inlineStylePolicy: 'tokens-only',
|
|
193
|
+
noCdnThemeDependency: true
|
|
194
|
+
},
|
|
195
|
+
docs: {
|
|
196
|
+
contract: COMPONENT_STYLING_CONTRACT_DOC,
|
|
197
|
+
componentGuideSection: 'Styling',
|
|
198
|
+
requiredSections: ['Tokens', 'CSS Custom Properties', 'CSS Parts', 'Variants', 'Sizes', 'Density', 'Themes', 'Motion', 'Contrast', 'RMT Authoring']
|
|
199
|
+
},
|
|
200
|
+
tests: {
|
|
201
|
+
requiredSuites: ['component-styling-contract', 'component-shell-contract', 'motion-contrast', 'references'],
|
|
202
|
+
visualRegressionRequiredForP0: true,
|
|
203
|
+
fixtureRequired: true
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
function validateComponentStylingContract(contract = {}) {
|
|
209
|
+
const errors = [];
|
|
210
|
+
|
|
211
|
+
if (contract.schema !== COMPONENT_STYLING_CONTRACT_SCHEMA) {
|
|
212
|
+
errors.push(`schema must be ${COMPONENT_STYLING_CONTRACT_SCHEMA}`);
|
|
213
|
+
}
|
|
214
|
+
if (!/^x-[a-z0-9]+(?:-[a-z0-9]+)*$/.test(String(contract.tag || ''))) {
|
|
215
|
+
errors.push('tag must be a valid XTend custom element tag');
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
STYLING_REQUIRED_DOMAINS.forEach((domain) => {
|
|
219
|
+
if (!contract[domain]) {
|
|
220
|
+
errors.push(`missing domain: ${domain}`);
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
if (!Array.isArray(contract.tokens) || contract.tokens.length === 0) {
|
|
225
|
+
errors.push('tokens must include at least one token');
|
|
226
|
+
} else {
|
|
227
|
+
STYLING_TOKEN_CATEGORIES.forEach((category) => {
|
|
228
|
+
if (!contract.tokens.some((token) => token && token.category === category)) {
|
|
229
|
+
errors.push(`tokens must include category ${category}`);
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
contract.tokens.forEach((token) => {
|
|
233
|
+
if (!/^--xtend-[a-z0-9-]+$/.test(String(token.name || ''))) {
|
|
234
|
+
errors.push(`token name must use --xtend-* prefix: ${token.name}`);
|
|
235
|
+
}
|
|
236
|
+
if (token.fallbackRequired !== true) {
|
|
237
|
+
errors.push(`token ${token.name} must require a fallback`);
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
if (!contract.customProperties || contract.customProperties.fallbackRequired !== true) {
|
|
243
|
+
errors.push('customProperties.fallbackRequired must be true');
|
|
244
|
+
}
|
|
245
|
+
if (!Array.isArray(contract.parts) || !STYLING_REQUIRED_PARTS.every((partName) => contract.parts.some((part) => part && part.name === partName))) {
|
|
246
|
+
errors.push(`parts must include ${STYLING_REQUIRED_PARTS.join(', ')}`);
|
|
247
|
+
}
|
|
248
|
+
if (!contract.variants || !STYLING_REQUIRED_VARIANTS.every((variant) => normalizeArray(contract.variants.allowed).includes(variant))) {
|
|
249
|
+
errors.push(`variants.allowed must include ${STYLING_REQUIRED_VARIANTS.join(', ')}`);
|
|
250
|
+
}
|
|
251
|
+
if (!contract.sizes || !STYLING_REQUIRED_SIZES.every((size) => normalizeArray(contract.sizes.allowed).includes(size))) {
|
|
252
|
+
errors.push(`sizes.allowed must include ${STYLING_REQUIRED_SIZES.join(', ')}`);
|
|
253
|
+
}
|
|
254
|
+
if (!contract.density || !STYLING_REQUIRED_DENSITIES.every((density) => normalizeArray(contract.density.allowed).includes(density))) {
|
|
255
|
+
errors.push(`density.allowed must include ${STYLING_REQUIRED_DENSITIES.join(', ')}`);
|
|
256
|
+
}
|
|
257
|
+
if (!contract.themes || !STYLING_REQUIRED_THEMES.every((theme) => normalizeArray(contract.themes.supported).includes(theme))) {
|
|
258
|
+
errors.push(`themes.supported must include ${STYLING_REQUIRED_THEMES.join(', ')}`);
|
|
259
|
+
}
|
|
260
|
+
if (contract.motion && contract.motion.reducedMotionSafe !== true) {
|
|
261
|
+
errors.push('motion.reducedMotionSafe must be true');
|
|
262
|
+
}
|
|
263
|
+
if (contract.contrast && contract.contrast.focusVisibleRequired !== true) {
|
|
264
|
+
errors.push('contrast.focusVisibleRequired must be true');
|
|
265
|
+
}
|
|
266
|
+
if (contract.rmt && contract.rmt.kernelBoundary !== KERNEL_BOUNDARY) {
|
|
267
|
+
errors.push('rmt.kernelBoundary must keep the RMT kernel decoupled from XTend types');
|
|
268
|
+
}
|
|
269
|
+
if (contract.compatibility && contract.compatibility.noCdnThemeDependency !== true) {
|
|
270
|
+
errors.push('compatibility.noCdnThemeDependency must be true');
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
return {
|
|
274
|
+
schema: COMPONENT_STYLING_REPORT_SCHEMA,
|
|
275
|
+
ok: errors.length === 0,
|
|
276
|
+
errors
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
module.exports = {
|
|
281
|
+
COMPONENT_STYLING_CONTRACT_SCHEMA,
|
|
282
|
+
COMPONENT_STYLING_REPORT_SCHEMA,
|
|
283
|
+
COMPONENT_STYLING_WORKPACKAGE,
|
|
284
|
+
COMPONENT_STYLING_CONTRACT_DOC,
|
|
285
|
+
COMPONENT_SHELL_CONTRACT_SCHEMA,
|
|
286
|
+
COMPONENT_CONTRACT_V2_SCHEMA,
|
|
287
|
+
UX_MATURITY_MODEL_SCHEMA,
|
|
288
|
+
RMT_STYLE_AUTHORING_SCHEMA,
|
|
289
|
+
FABRIC_BOUNDARY_SCHEMA,
|
|
290
|
+
KERNEL_BOUNDARY,
|
|
291
|
+
STYLING_REQUIRED_DOMAINS,
|
|
292
|
+
STYLING_TOKEN_CATEGORIES,
|
|
293
|
+
STYLING_REQUIRED_VARIANTS,
|
|
294
|
+
STYLING_REQUIRED_SIZES,
|
|
295
|
+
STYLING_REQUIRED_DENSITIES,
|
|
296
|
+
STYLING_REQUIRED_THEMES,
|
|
297
|
+
STYLING_REQUIRED_PARTS,
|
|
298
|
+
STYLING_MOTION_POLICIES,
|
|
299
|
+
createComponentStylingContract,
|
|
300
|
+
validateComponentStylingContract
|
|
301
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { XtendBuilderComponentInput, XtendBuilderOptions, XtendBuilderRecord } from '../builder-public-types';
|
|
2
|
+
|
|
3
|
+
export declare const COMPONENT_TYPING_SCHEMA: string;
|
|
4
|
+
export declare const RMT_ATTACHMENT_SCHEMA: string;
|
|
5
|
+
export declare const RMT_COMPONENT_CONTRACT_VERSION: string;
|
|
6
|
+
export declare const RMT_TEMPLATE_AUTHORING_CONTRACT_VERSION: string;
|
|
7
|
+
export declare const RMT_ROOT_HANDSHAKE_CONTRACT_VERSION: string;
|
|
8
|
+
export declare const RMT_HOST_CAPABILITIES_CONTRACT_VERSION: string;
|
|
9
|
+
export declare const RMT_COMPATIBILITY_BINDING_SCHEMA: string;
|
|
10
|
+
export declare function createComponentTypingContract(input?: XtendBuilderComponentInput, options?: XtendBuilderOptions): XtendBuilderRecord;
|