@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,831 @@
|
|
|
1
|
+
// Selbst-ausfuehrende asynchrone Funktion statt direktem Import
|
|
2
|
+
(async function() {
|
|
3
|
+
let xstate;
|
|
4
|
+
|
|
5
|
+
if (window.xstate) {
|
|
6
|
+
xstate = window.xstate;
|
|
7
|
+
} else {
|
|
8
|
+
try {
|
|
9
|
+
const module = await import('./xstate.js');
|
|
10
|
+
xstate = module.xstate;
|
|
11
|
+
} catch (e) {
|
|
12
|
+
console.error('Fehler beim Laden von xstate in xmodal.js:', e);
|
|
13
|
+
xstate = {
|
|
14
|
+
get: () => null,
|
|
15
|
+
set: () => {},
|
|
16
|
+
subscribe: () => () => {}
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function getModalOpenKeys(id) {
|
|
22
|
+
return [
|
|
23
|
+
`xtend.component.x-modal.${id}.open`,
|
|
24
|
+
`modal-open-${id}`
|
|
25
|
+
];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function setModalOpenState(id, isOpen) {
|
|
29
|
+
if (!id) return;
|
|
30
|
+
getModalOpenKeys(id).forEach((key) => xstate.set(key, isOpen));
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function getModalEntry(id) {
|
|
34
|
+
const uiState = xstate.get('ui');
|
|
35
|
+
if (!uiState || !Array.isArray(uiState.modals)) return null;
|
|
36
|
+
return uiState.modals.find((modal) => modal.id === id) || null;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function updateModalEntry(id, updater) {
|
|
40
|
+
const uiState = xstate.get('ui');
|
|
41
|
+
if (!uiState || !Array.isArray(uiState.modals)) return;
|
|
42
|
+
|
|
43
|
+
const modals = [...uiState.modals];
|
|
44
|
+
const index = modals.findIndex((modal) => modal.id === id);
|
|
45
|
+
if (index === -1) return;
|
|
46
|
+
|
|
47
|
+
const nextEntry = updater({ ...modals[index] });
|
|
48
|
+
if (nextEntry === null) {
|
|
49
|
+
modals.splice(index, 1);
|
|
50
|
+
} else {
|
|
51
|
+
modals[index] = nextEntry;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
xstate.set('ui', { ...uiState, modals });
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function readModalOpenState(id, fallbackOpen) {
|
|
58
|
+
const explicitValues = getModalOpenKeys(id)
|
|
59
|
+
.map((key) => xstate.get(key))
|
|
60
|
+
.filter((value) => typeof value === 'boolean');
|
|
61
|
+
|
|
62
|
+
if (explicitValues.some((value) => value === true)) return true;
|
|
63
|
+
if (explicitValues.some((value) => value === false)) return false;
|
|
64
|
+
|
|
65
|
+
const entry = getModalEntry(id);
|
|
66
|
+
if (entry && typeof entry.open === 'boolean') {
|
|
67
|
+
return entry.open;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return fallbackOpen;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
class XModal extends HTMLElement {
|
|
74
|
+
static get observedAttributes() {
|
|
75
|
+
return ['open', 'overlay', 'title', 'content', 'actions'];
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
static get xtendComponentContract() {
|
|
79
|
+
return {
|
|
80
|
+
schema: 'xtend.component.contract.v2',
|
|
81
|
+
tag: 'x-modal',
|
|
82
|
+
maturity: 'stable',
|
|
83
|
+
source: {
|
|
84
|
+
strategy: 'xtend.typescript.component-source-strategy.v1',
|
|
85
|
+
state: 'js-legacy-compatible',
|
|
86
|
+
sourcePath: 'components/xmodal.js'
|
|
87
|
+
},
|
|
88
|
+
runtime: {
|
|
89
|
+
format: 'esm',
|
|
90
|
+
artifact: 'components/xmodal.js',
|
|
91
|
+
declaration: 'components/xmodal.d.ts',
|
|
92
|
+
localOnly: true,
|
|
93
|
+
cdnAllowed: false
|
|
94
|
+
},
|
|
95
|
+
rmt: {
|
|
96
|
+
adapter: 'xtend.component',
|
|
97
|
+
kernelBoundary: 'no-rmt-kernel-import-of-xtend-types'
|
|
98
|
+
},
|
|
99
|
+
fabric: {
|
|
100
|
+
api: '@xtend-fabric',
|
|
101
|
+
defaultLane: 'user-blocking'
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
static get xtendRmtMetadata() {
|
|
107
|
+
return {
|
|
108
|
+
schema: 'xtend.rmt.component-contract.v1',
|
|
109
|
+
adapter: 'xtend.component',
|
|
110
|
+
tag: 'x-modal',
|
|
111
|
+
componentRecordKind: 'custom_element',
|
|
112
|
+
templateMode: 'dom_descriptor',
|
|
113
|
+
eventBindingMode: 'dom-event-to-rmt-command',
|
|
114
|
+
schedules: ['component.visible.mount', 'component.idle.hydrate', 'overlay.stack.open', 'overlay.stack.close', 'overlay.focus.trap', 'overlay.inert.apply', 'overlay.scroll.lock', 'diagnostics.snapshot'],
|
|
115
|
+
hydration: { policy: 'visible', lane: 'user-blocking' },
|
|
116
|
+
kernelBoundary: 'no-rmt-kernel-import-of-xtend-types'
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
static get xtendComponentLifecycleTelemetry() {
|
|
121
|
+
return {
|
|
122
|
+
schema: 'xtend.component.lifecycle-telemetry.v1',
|
|
123
|
+
componentRef: 'x-modal',
|
|
124
|
+
operations: ['mount', 'hydrate', 'render', 'update', 'event', 'error', 'unmount'],
|
|
125
|
+
snapshotPath: 'snapshot.componentTelemetry'
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
static get xtendScaffoldA11yProfile() {
|
|
130
|
+
return {
|
|
131
|
+
schema: 'xtend.a11y.profile.v1',
|
|
132
|
+
componentRef: 'x-modal',
|
|
133
|
+
role: 'dialog',
|
|
134
|
+
accessibleName: 'required',
|
|
135
|
+
liveRegion: 'none',
|
|
136
|
+
screenreader: {
|
|
137
|
+
signalContract: XModal.xtendScreenreaderSignals
|
|
138
|
+
},
|
|
139
|
+
motionContrast: {
|
|
140
|
+
policy: XModal.xtendMotionContrastPolicy
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
static get xtendScaffoldPerformanceProfile() {
|
|
146
|
+
return {
|
|
147
|
+
schema: 'xtend.performance.component-profile.v1',
|
|
148
|
+
componentRef: 'x-modal',
|
|
149
|
+
budgetClass: 'overlay-medium',
|
|
150
|
+
lane: 'user-blocking',
|
|
151
|
+
hydrationPolicy: 'visible',
|
|
152
|
+
criticalMeasurements: ['mount', 'hydrate', 'event'],
|
|
153
|
+
cleanup: ['document-keydown', 'shadow-keydown', 'focus-return']
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
static get xtendScreenreaderSignals() {
|
|
158
|
+
return {
|
|
159
|
+
schema: 'xtend.a11y.screenreader-signals.v1',
|
|
160
|
+
componentRef: 'x-modal',
|
|
161
|
+
liveRegion: 'none',
|
|
162
|
+
signals: ['dialog-context', 'focus-return'],
|
|
163
|
+
statusRegions: [],
|
|
164
|
+
errorRegions: [],
|
|
165
|
+
fabric: {
|
|
166
|
+
lane: 'a11y',
|
|
167
|
+
fiberKind: 'a11y.announce',
|
|
168
|
+
scheduleRef: 'a11y.user-blocking.announce'
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
static get xtendMotionContrastPolicy() {
|
|
174
|
+
return {
|
|
175
|
+
schema: 'xtend.a11y.motion-contrast-policy.v1',
|
|
176
|
+
componentRef: 'x-modal',
|
|
177
|
+
motion: {
|
|
178
|
+
schema: 'xtend.a11y.motion-policy.v1',
|
|
179
|
+
mediaQuery: '(prefers-reduced-motion: reduce)',
|
|
180
|
+
reducedMotion: 'required',
|
|
181
|
+
animationPolicy: 'instant-open-close-allowed',
|
|
182
|
+
noMotionOnlyState: true
|
|
183
|
+
},
|
|
184
|
+
contrast: {
|
|
185
|
+
schema: 'xtend.a11y.contrast-policy.v1',
|
|
186
|
+
mediaQuery: '(forced-colors: active)',
|
|
187
|
+
highContrast: 'required',
|
|
188
|
+
forcedColorAdjust: 'auto',
|
|
189
|
+
focusVisible: 'required',
|
|
190
|
+
nonColorStatus: 'required'
|
|
191
|
+
},
|
|
192
|
+
fabric: {
|
|
193
|
+
lane: 'a11y',
|
|
194
|
+
fiberKind: 'a11y.preference',
|
|
195
|
+
scheduleRef: 'a11y.user-blocking.preference'
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
static get xtendOverlayInteractionUxProfile() {
|
|
201
|
+
return {
|
|
202
|
+
schema: 'xtend.component.overlay-interaction-ux-profile.v1',
|
|
203
|
+
componentRef: 'x-modal',
|
|
204
|
+
family: 'modal-dialog',
|
|
205
|
+
role: 'dialog',
|
|
206
|
+
modality: 'modal',
|
|
207
|
+
focusTrap: 'required',
|
|
208
|
+
inertStrategy: 'document-background-inert',
|
|
209
|
+
escapeBehavior: 'close-topmost',
|
|
210
|
+
outsideClick: 'overlay-close',
|
|
211
|
+
scrollLock: 'balanced-document-lock',
|
|
212
|
+
portalStrategy: 'document-body-portal-layer',
|
|
213
|
+
events: ['modal-opened', 'modal-closed', 'modal-action'],
|
|
214
|
+
commands: ['open', 'close', 'focus-trap', 'release-focus', 'apply-inert', 'release-inert', 'lock-scroll', 'unlock-scroll', 'snapshot'],
|
|
215
|
+
stateKey: 'modal-open-<id>',
|
|
216
|
+
schedule: 'overlay.stack.open',
|
|
217
|
+
fabric: {
|
|
218
|
+
lane: 'user-blocking',
|
|
219
|
+
a11yLane: 'a11y',
|
|
220
|
+
diagnosticsLane: 'diagnostics'
|
|
221
|
+
},
|
|
222
|
+
rmt: {
|
|
223
|
+
adapter: 'xtend.component',
|
|
224
|
+
scheduleRefs: ['overlay.stack.open', 'overlay.stack.close', 'overlay.focus.trap', 'overlay.inert.apply', 'overlay.scroll.lock', 'diagnostics.snapshot'],
|
|
225
|
+
kernelBoundary: 'no-rmt-kernel-import-of-xtend-types'
|
|
226
|
+
},
|
|
227
|
+
overlaySemantics: {
|
|
228
|
+
topmostEscapeOnly: true,
|
|
229
|
+
returnFocusRequired: true,
|
|
230
|
+
ariaHiddenFallbackRequired: true,
|
|
231
|
+
portalContainerStable: true
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
static get xtendSurfaceOverlayCompatibilityProfile() {
|
|
237
|
+
return {
|
|
238
|
+
schema: 'xtend.surface.overlay-stack-bridge.v1',
|
|
239
|
+
componentRef: 'x-modal',
|
|
240
|
+
surfaceType: 'modal',
|
|
241
|
+
managerSlot: 'overlays',
|
|
242
|
+
managerEvent: 'surface-overlay-command',
|
|
243
|
+
legacyLifecycleEvents: ['modal-opened', 'modal-closed', 'modal-action'],
|
|
244
|
+
legacyStateKey: 'modal-open-<id>',
|
|
245
|
+
registration: 'optional',
|
|
246
|
+
bridgeModule: 'components/xsurfaceoverlay-bridge.js',
|
|
247
|
+
surfaceRecordSchema: 'xtend.surface.record.v1',
|
|
248
|
+
legacyApiPreserved: true,
|
|
249
|
+
fabric: {
|
|
250
|
+
lane: 'user-blocking',
|
|
251
|
+
diagnosticsLane: 'diagnostics'
|
|
252
|
+
},
|
|
253
|
+
rmt: {
|
|
254
|
+
adapter: 'xtend.component',
|
|
255
|
+
kernelBoundary: 'no-rmt-kernel-import-of-xtend-types'
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
constructor() {
|
|
261
|
+
super();
|
|
262
|
+
this.attachShadow({ mode: 'open' });
|
|
263
|
+
this._open = false;
|
|
264
|
+
this._overlay = this.hasAttribute('overlay');
|
|
265
|
+
this._title = this.getAttribute('title') || '';
|
|
266
|
+
this._content = this.getAttribute('content') || '';
|
|
267
|
+
this._actions = null;
|
|
268
|
+
this._unsubscribeState = null;
|
|
269
|
+
this._synchronizingAttribute = false;
|
|
270
|
+
this._lastFocusedElement = null;
|
|
271
|
+
this._onDocumentKeyDown = this._handleKeyDown.bind(this);
|
|
272
|
+
this._onShadowKeyDown = this._handleFocusTrap.bind(this);
|
|
273
|
+
this._portalParent = null;
|
|
274
|
+
this._portalNextSibling = null;
|
|
275
|
+
this._isPortaled = false;
|
|
276
|
+
this._isMovingPortal = false;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
connectedCallback() {
|
|
280
|
+
if (this._isMovingPortal) return;
|
|
281
|
+
|
|
282
|
+
if (!this.id) {
|
|
283
|
+
this.id = `modal-${Math.random().toString(36).slice(2, 10)}`;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
document.addEventListener('keydown', this._onDocumentKeyDown);
|
|
287
|
+
this.shadowRoot.addEventListener('keydown', this._onShadowKeyDown);
|
|
288
|
+
|
|
289
|
+
if (typeof xstate.subscribe === 'function') {
|
|
290
|
+
this._unsubscribeState = xstate.subscribe((key) => {
|
|
291
|
+
if (
|
|
292
|
+
key === null ||
|
|
293
|
+
key === 'ui' ||
|
|
294
|
+
getModalOpenKeys(this.id).includes(key)
|
|
295
|
+
) {
|
|
296
|
+
this._syncFromRuntime();
|
|
297
|
+
}
|
|
298
|
+
}, ['ui', ...getModalOpenKeys(this.id)]);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
if (this.hasAttribute('open')) {
|
|
302
|
+
setModalOpenState(this.id, true);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
this._syncFromRuntime();
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
disconnectedCallback() {
|
|
309
|
+
if (this._isMovingPortal) return;
|
|
310
|
+
|
|
311
|
+
document.removeEventListener('keydown', this._onDocumentKeyDown);
|
|
312
|
+
this.shadowRoot.removeEventListener('keydown', this._onShadowKeyDown);
|
|
313
|
+
if (typeof this._unsubscribeState === 'function') {
|
|
314
|
+
this._unsubscribeState();
|
|
315
|
+
this._unsubscribeState = null;
|
|
316
|
+
}
|
|
317
|
+
this._clearPortalState();
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
321
|
+
if (oldValue === newValue) return;
|
|
322
|
+
|
|
323
|
+
if (name === 'open' && !this._synchronizingAttribute && this.isConnected && this.id) {
|
|
324
|
+
const shouldOpen = newValue !== null;
|
|
325
|
+
setModalOpenState(this.id, shouldOpen);
|
|
326
|
+
const entry = getModalEntry(this.id);
|
|
327
|
+
if (entry) {
|
|
328
|
+
updateModalEntry(this.id, (modal) => ({ ...modal, open: shouldOpen }));
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
this._syncFromRuntime();
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
snapshot() {
|
|
336
|
+
return {
|
|
337
|
+
schema: 'xtend.component.overlay-interaction-snapshot.v1',
|
|
338
|
+
componentRef: 'x-modal',
|
|
339
|
+
id: this.id || null,
|
|
340
|
+
open: this._open,
|
|
341
|
+
overlay: this._overlay,
|
|
342
|
+
stateKey: this.id ? `modal-open-${this.id}` : 'modal-open-<id>',
|
|
343
|
+
schedule: 'diagnostics.snapshot',
|
|
344
|
+
fabric: {
|
|
345
|
+
lane: 'diagnostics'
|
|
346
|
+
}
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
open() {
|
|
351
|
+
if (this.id) {
|
|
352
|
+
setModalOpenState(this.id, true);
|
|
353
|
+
const entry = getModalEntry(this.id);
|
|
354
|
+
if (entry) {
|
|
355
|
+
updateModalEntry(this.id, (modal) => ({ ...modal, open: true }));
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
this._syncFromRuntime();
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
close(options = {}) {
|
|
363
|
+
const source = options.source || 'programmatic';
|
|
364
|
+
const managedByApi = this.dataset.managed === 'api';
|
|
365
|
+
const entry = getModalEntry(this.id);
|
|
366
|
+
|
|
367
|
+
if (this.id) {
|
|
368
|
+
setModalOpenState(this.id, false);
|
|
369
|
+
|
|
370
|
+
if (entry) {
|
|
371
|
+
if (managedByApi) {
|
|
372
|
+
updateModalEntry(this.id, () => null);
|
|
373
|
+
} else {
|
|
374
|
+
updateModalEntry(this.id, (modal) => ({ ...modal, open: false }));
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
this._syncFromRuntime({ source });
|
|
380
|
+
|
|
381
|
+
if (managedByApi && !getModalEntry(this.id)) {
|
|
382
|
+
this.remove();
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
_getResolvedActions(entry) {
|
|
387
|
+
if (entry && Array.isArray(entry.actions)) {
|
|
388
|
+
return entry.actions;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
const rawActions = this.getAttribute('actions');
|
|
392
|
+
if (!rawActions) return null;
|
|
393
|
+
|
|
394
|
+
try {
|
|
395
|
+
const actions = JSON.parse(rawActions);
|
|
396
|
+
return Array.isArray(actions) ? actions : null;
|
|
397
|
+
} catch {
|
|
398
|
+
return null;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
_getResolvedState() {
|
|
403
|
+
const entry = getModalEntry(this.id);
|
|
404
|
+
return {
|
|
405
|
+
entry,
|
|
406
|
+
title: entry && typeof entry.title === 'string' ? entry.title : (this.getAttribute('title') || ''),
|
|
407
|
+
content: entry && typeof entry.content === 'string' ? entry.content : (this.getAttribute('content') || ''),
|
|
408
|
+
overlay: entry ? entry.hasOverlay !== false : this.hasAttribute('overlay'),
|
|
409
|
+
actions: this._getResolvedActions(entry),
|
|
410
|
+
open: readModalOpenState(this.id, this.hasAttribute('open'))
|
|
411
|
+
};
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
_syncOpenAttribute(isOpen) {
|
|
415
|
+
this._synchronizingAttribute = true;
|
|
416
|
+
if (isOpen) {
|
|
417
|
+
this.setAttribute('open', '');
|
|
418
|
+
} else {
|
|
419
|
+
this.removeAttribute('open');
|
|
420
|
+
}
|
|
421
|
+
this._synchronizingAttribute = false;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
_syncFromRuntime(options = {}) {
|
|
425
|
+
const source = options.source || 'state';
|
|
426
|
+
const previousOpen = this._open;
|
|
427
|
+
const state = this._getResolvedState();
|
|
428
|
+
|
|
429
|
+
this._open = state.open;
|
|
430
|
+
this._overlay = state.overlay;
|
|
431
|
+
this._title = state.title;
|
|
432
|
+
this._content = state.content;
|
|
433
|
+
this._actions = state.actions;
|
|
434
|
+
|
|
435
|
+
this._syncOpenAttribute(this._open);
|
|
436
|
+
if (this._open && this._overlay) {
|
|
437
|
+
this._ensureDocumentPortal();
|
|
438
|
+
}
|
|
439
|
+
this._render(state);
|
|
440
|
+
|
|
441
|
+
if (this._open && !previousOpen) {
|
|
442
|
+
this._lastFocusedElement = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
443
|
+
this._emitLifecycleEvent('modal-opened', source);
|
|
444
|
+
queueMicrotask(() => {
|
|
445
|
+
const modal = this.shadowRoot.querySelector('.x-modal');
|
|
446
|
+
if (modal instanceof HTMLElement) {
|
|
447
|
+
modal.focus();
|
|
448
|
+
}
|
|
449
|
+
});
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
if (!this._open && previousOpen) {
|
|
453
|
+
this._emitLifecycleEvent('modal-closed', source);
|
|
454
|
+
this._restoreDocumentPortal();
|
|
455
|
+
if (this._lastFocusedElement && typeof this._lastFocusedElement.focus === 'function') {
|
|
456
|
+
queueMicrotask(() => this._lastFocusedElement.focus());
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
if (!this._open && this.dataset.managed === 'api' && !state.entry) {
|
|
461
|
+
this.remove();
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
_ensureDocumentPortal() {
|
|
466
|
+
if (this._isPortaled || !this.isConnected || !document.body || this.parentNode === document.body) {
|
|
467
|
+
return;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
this._portalParent = this.parentNode;
|
|
471
|
+
this._portalNextSibling = this.nextSibling;
|
|
472
|
+
this._isMovingPortal = true;
|
|
473
|
+
document.body.appendChild(this);
|
|
474
|
+
this._isMovingPortal = false;
|
|
475
|
+
this._isPortaled = true;
|
|
476
|
+
this.setAttribute('data-xtend-portal', 'document-body');
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
_restoreDocumentPortal() {
|
|
480
|
+
if (!this._isPortaled) return;
|
|
481
|
+
|
|
482
|
+
const parent = this._portalParent;
|
|
483
|
+
const nextSibling = this._portalNextSibling;
|
|
484
|
+
this._isMovingPortal = true;
|
|
485
|
+
|
|
486
|
+
if (parent && parent.isConnected) {
|
|
487
|
+
parent.insertBefore(this, nextSibling && nextSibling.parentNode === parent ? nextSibling : null);
|
|
488
|
+
} else if (this.parentNode) {
|
|
489
|
+
this._isMovingPortal = false;
|
|
490
|
+
this.remove();
|
|
491
|
+
this._clearPortalState();
|
|
492
|
+
return;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
this._isMovingPortal = false;
|
|
496
|
+
this._clearPortalState();
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
_clearPortalState() {
|
|
500
|
+
this._portalParent = null;
|
|
501
|
+
this._portalNextSibling = null;
|
|
502
|
+
this._isPortaled = false;
|
|
503
|
+
this._isMovingPortal = false;
|
|
504
|
+
this.removeAttribute('data-xtend-portal');
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
_emitLifecycleEvent(name, source) {
|
|
508
|
+
this.dispatchEvent(new CustomEvent(name, {
|
|
509
|
+
detail: {
|
|
510
|
+
id: this.id,
|
|
511
|
+
open: this._open,
|
|
512
|
+
source
|
|
513
|
+
},
|
|
514
|
+
bubbles: true,
|
|
515
|
+
composed: true
|
|
516
|
+
}));
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
_render(state) {
|
|
520
|
+
this.shadowRoot.innerHTML = `
|
|
521
|
+
<style>
|
|
522
|
+
:host {
|
|
523
|
+
--xtend-overlay-backdrop: var(--xtend-overlay-bg, rgba(30, 34, 44, 0.55));
|
|
524
|
+
--xtend-overlay-surface: var(--xtend-surface-muted, rgba(255,255,255,0.88));
|
|
525
|
+
--xtend-overlay-text: var(--xtend-text, #1f2635);
|
|
526
|
+
--xtend-overlay-elevation: var(--xtend-shadow, 0 8px 32px 0 rgba(31, 38, 135, 0.18));
|
|
527
|
+
--xtend-overlay-radius: var(--xtend-radius, 18px);
|
|
528
|
+
--xtend-overlay-focus-ring: var(--xtend-focus-outline, 2px solid #4fc3f7);
|
|
529
|
+
--xtend-overlay-z: var(--surface-overlay-z, 2147483645);
|
|
530
|
+
--xmodal-overlay-bg: var(--modal-backdrop, var(--xmodal-backdrop, var(--xtend-overlay-backdrop)));
|
|
531
|
+
--xmodal-surface: var(--modal-surface, var(--xtend-overlay-surface));
|
|
532
|
+
--xmodal-text: var(--modal-text, var(--xtend-overlay-text));
|
|
533
|
+
--xmodal-accent: var(--xtend-color-primary, #4fc3f7);
|
|
534
|
+
--xmodal-accent-hover: var(--xtend-color-primary-dark, #0288d1);
|
|
535
|
+
--xmodal-action-text: var(--modal-action-text, var(--xtend-on-primary, #ffffff));
|
|
536
|
+
--xmodal-close-bg: var(--modal-close-bg, rgba(255,255,255,0.12));
|
|
537
|
+
--xmodal-close-hover-bg: var(--modal-close-hover-bg, rgba(79,195,247,0.18));
|
|
538
|
+
--xmodal-shadow: var(--modal-shadow, var(--xtend-overlay-elevation));
|
|
539
|
+
--xmodal-radius: var(--modal-radius, var(--xtend-overlay-radius));
|
|
540
|
+
--xmodal-focus-outline: var(--modal-focus-outline, var(--xtend-overlay-focus-ring));
|
|
541
|
+
font-family: var(--xtend-font-family, 'Inter', 'Segoe UI', Arial, sans-serif);
|
|
542
|
+
}
|
|
543
|
+
.x-modal-wrapper {
|
|
544
|
+
position: fixed;
|
|
545
|
+
inset: 0;
|
|
546
|
+
display: ${state.open ? 'flex' : 'none'};
|
|
547
|
+
align-items: center;
|
|
548
|
+
justify-content: center;
|
|
549
|
+
z-index: var(--xtend-overlay-z);
|
|
550
|
+
}
|
|
551
|
+
.x-modal-overlay {
|
|
552
|
+
position: absolute;
|
|
553
|
+
inset: 0;
|
|
554
|
+
background: var(--xmodal-overlay-bg);
|
|
555
|
+
backdrop-filter: blur(var(--xtend-glass-blur, 18px));
|
|
556
|
+
}
|
|
557
|
+
.x-modal {
|
|
558
|
+
position: relative;
|
|
559
|
+
z-index: 1;
|
|
560
|
+
min-width: 320px;
|
|
561
|
+
max-width: 96vw;
|
|
562
|
+
max-height: 90vh;
|
|
563
|
+
overflow: auto;
|
|
564
|
+
background: var(--xmodal-surface);
|
|
565
|
+
color: var(--xmodal-text);
|
|
566
|
+
border-radius: var(--xmodal-radius);
|
|
567
|
+
box-shadow: var(--xmodal-shadow);
|
|
568
|
+
padding: 2.2rem 1.5rem 1.5rem;
|
|
569
|
+
display: flex;
|
|
570
|
+
flex-direction: column;
|
|
571
|
+
outline: none;
|
|
572
|
+
border: var(--xtend-border, 1.5px solid rgba(255,255,255,0.12));
|
|
573
|
+
backdrop-filter: blur(var(--xtend-glass-blur, 18px));
|
|
574
|
+
animation: fadeInScale 0.25s cubic-bezier(.4,1.4,.6,1);
|
|
575
|
+
}
|
|
576
|
+
.x-modal-title {
|
|
577
|
+
font-size: 1.3em;
|
|
578
|
+
font-weight: 600;
|
|
579
|
+
margin-bottom: 1em;
|
|
580
|
+
color: var(--xmodal-accent);
|
|
581
|
+
text-shadow: 0 2px 8px rgba(79,195,247,0.18);
|
|
582
|
+
}
|
|
583
|
+
.x-modal-content {
|
|
584
|
+
margin-bottom: 1.5em;
|
|
585
|
+
}
|
|
586
|
+
.x-modal-actions {
|
|
587
|
+
display: flex;
|
|
588
|
+
flex-wrap: wrap;
|
|
589
|
+
gap: 1em;
|
|
590
|
+
justify-content: flex-end;
|
|
591
|
+
}
|
|
592
|
+
.x-modal-btn {
|
|
593
|
+
background: var(--xmodal-accent);
|
|
594
|
+
color: var(--xmodal-action-text);
|
|
595
|
+
border: none;
|
|
596
|
+
border-radius: 999px;
|
|
597
|
+
padding: 0.7em 1.4em;
|
|
598
|
+
font-size: 1em;
|
|
599
|
+
cursor: pointer;
|
|
600
|
+
box-shadow: 0 2px 8px rgba(40,60,120,0.10);
|
|
601
|
+
transition: background 0.2s, transform 0.15s;
|
|
602
|
+
min-width: 2.6em;
|
|
603
|
+
min-height: 2.6em;
|
|
604
|
+
}
|
|
605
|
+
.x-modal-btn:hover {
|
|
606
|
+
background: var(--xmodal-accent-hover);
|
|
607
|
+
transform: scale(1.04);
|
|
608
|
+
}
|
|
609
|
+
.x-modal-close {
|
|
610
|
+
position: absolute;
|
|
611
|
+
top: 1.2em;
|
|
612
|
+
right: 1.2em;
|
|
613
|
+
background: var(--xmodal-close-bg);
|
|
614
|
+
border: none;
|
|
615
|
+
color: var(--xmodal-text);
|
|
616
|
+
cursor: pointer;
|
|
617
|
+
line-height: 1;
|
|
618
|
+
width: 2.75em;
|
|
619
|
+
height: 2.75em;
|
|
620
|
+
border-radius: 50%;
|
|
621
|
+
display: inline-flex;
|
|
622
|
+
align-items: center;
|
|
623
|
+
justify-content: center;
|
|
624
|
+
transition: background 0.2s, color 0.2s, transform 0.15s;
|
|
625
|
+
}
|
|
626
|
+
.x-modal-close:focus-visible,
|
|
627
|
+
.x-modal-btn:focus-visible {
|
|
628
|
+
outline: var(--xmodal-focus-outline);
|
|
629
|
+
outline-offset: 2px;
|
|
630
|
+
}
|
|
631
|
+
.x-modal-close:hover {
|
|
632
|
+
background: var(--xmodal-close-hover-bg);
|
|
633
|
+
color: var(--xmodal-accent);
|
|
634
|
+
transform: scale(1.08);
|
|
635
|
+
}
|
|
636
|
+
.x-modal-close svg {
|
|
637
|
+
width: 1.15em;
|
|
638
|
+
height: 1.15em;
|
|
639
|
+
}
|
|
640
|
+
.x-modal-fallback {
|
|
641
|
+
display: none;
|
|
642
|
+
padding: 0.8em;
|
|
643
|
+
background: #fff0f0;
|
|
644
|
+
color: #8a1f1f;
|
|
645
|
+
border-radius: 0.6em;
|
|
646
|
+
}
|
|
647
|
+
@keyframes fadeInScale {
|
|
648
|
+
from { opacity: 0; transform: scale(0.96); }
|
|
649
|
+
to { opacity: 1; transform: scale(1); }
|
|
650
|
+
}
|
|
651
|
+
@media (prefers-reduced-motion: reduce) {
|
|
652
|
+
.x-modal {
|
|
653
|
+
animation: none !important;
|
|
654
|
+
}
|
|
655
|
+
.x-modal-close,
|
|
656
|
+
.x-modal-btn {
|
|
657
|
+
transition: none !important;
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
@media (forced-colors: active) {
|
|
661
|
+
.x-modal {
|
|
662
|
+
forced-color-adjust: auto;
|
|
663
|
+
color: CanvasText;
|
|
664
|
+
background: Canvas;
|
|
665
|
+
border: 1px solid CanvasText;
|
|
666
|
+
box-shadow: none;
|
|
667
|
+
}
|
|
668
|
+
.x-modal-overlay {
|
|
669
|
+
background: Canvas;
|
|
670
|
+
opacity: 0.86;
|
|
671
|
+
}
|
|
672
|
+
.x-modal-close,
|
|
673
|
+
.x-modal-btn {
|
|
674
|
+
color: ButtonText;
|
|
675
|
+
background: ButtonFace;
|
|
676
|
+
border: 1px solid ButtonText;
|
|
677
|
+
}
|
|
678
|
+
.x-modal-close:focus-visible,
|
|
679
|
+
.x-modal-btn:focus-visible {
|
|
680
|
+
outline-color: Highlight;
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
@media (max-width: 600px) {
|
|
684
|
+
.x-modal {
|
|
685
|
+
min-width: 0;
|
|
686
|
+
padding: 1.2rem 0.5rem 1rem;
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
</style>
|
|
690
|
+
<div class="x-modal-wrapper" part="root overlay-root" role="presentation">
|
|
691
|
+
${state.overlay ? '<div class="x-modal-overlay" part="backdrop overlay" tabindex="-1" aria-hidden="true"></div>' : ''}
|
|
692
|
+
<div class="x-modal" part="surface overlay-surface" role="dialog" aria-modal="true" aria-hidden="${state.open ? 'false' : 'true'}" tabindex="0">
|
|
693
|
+
<button class="x-modal-close" part="close control" type="button" aria-label="Schliessen">
|
|
694
|
+
<svg part="close-icon control icon" viewBox="0 0 24 24" fill="none" aria-hidden="true" xmlns="http://www.w3.org/2000/svg">
|
|
695
|
+
<circle cx="12" cy="12" r="11" fill="rgba(255,255,255,0.10)"></circle>
|
|
696
|
+
<path d="M8 8l8 8M16 8l-8 8" stroke="currentColor" stroke-width="2" stroke-linecap="round"></path>
|
|
697
|
+
</svg>
|
|
698
|
+
</button>
|
|
699
|
+
<div class="x-modal-title" part="title" id="xmodal-title">${state.title}</div>
|
|
700
|
+
<div class="x-modal-content" part="content"></div>
|
|
701
|
+
<div class="x-modal-actions" part="actions"></div>
|
|
702
|
+
<div class="x-modal-fallback">[XModal sichtbar - kein Inhalt im Slot]</div>
|
|
703
|
+
</div>
|
|
704
|
+
</div>
|
|
705
|
+
`;
|
|
706
|
+
|
|
707
|
+
const modal = this.shadowRoot.querySelector('.x-modal');
|
|
708
|
+
const overlay = this.shadowRoot.querySelector('.x-modal-overlay');
|
|
709
|
+
const closeButton = this.shadowRoot.querySelector('.x-modal-close');
|
|
710
|
+
const contentContainer = this.shadowRoot.querySelector('.x-modal-content');
|
|
711
|
+
const actionsContainer = this.shadowRoot.querySelector('.x-modal-actions');
|
|
712
|
+
const fallback = this.shadowRoot.querySelector('.x-modal-fallback');
|
|
713
|
+
|
|
714
|
+
if (modal) {
|
|
715
|
+
modal.setAttribute('aria-labelledby', 'xmodal-title');
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
if (overlay) {
|
|
719
|
+
overlay.addEventListener('click', () => this.close({ source: 'overlay' }));
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
if (closeButton) {
|
|
723
|
+
closeButton.addEventListener('click', () => this.close({ source: 'button' }));
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
if (contentContainer) {
|
|
727
|
+
if (state.content) {
|
|
728
|
+
const contentDiv = document.createElement('div');
|
|
729
|
+
contentDiv.textContent = state.content;
|
|
730
|
+
contentContainer.appendChild(contentDiv);
|
|
731
|
+
} else {
|
|
732
|
+
const slot = document.createElement('slot');
|
|
733
|
+
contentContainer.appendChild(slot);
|
|
734
|
+
slot.addEventListener('slotchange', () => this._updateFallbackVisibility(slot, fallback, false));
|
|
735
|
+
this._updateFallbackVisibility(slot, fallback, false);
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
if (actionsContainer) {
|
|
740
|
+
if (state.actions && state.actions.length > 0) {
|
|
741
|
+
state.actions.forEach((action) => {
|
|
742
|
+
const button = document.createElement('button');
|
|
743
|
+
button.type = 'button';
|
|
744
|
+
button.className = 'x-modal-btn';
|
|
745
|
+
button.textContent = action.label || action.action || 'OK';
|
|
746
|
+
button.addEventListener('click', () => {
|
|
747
|
+
const detail = {
|
|
748
|
+
id: this.id,
|
|
749
|
+
action: action.action || action.label || 'action',
|
|
750
|
+
definition: action
|
|
751
|
+
};
|
|
752
|
+
|
|
753
|
+
this.dispatchEvent(new CustomEvent('modal-action', {
|
|
754
|
+
detail,
|
|
755
|
+
bubbles: true,
|
|
756
|
+
composed: true
|
|
757
|
+
}));
|
|
758
|
+
|
|
759
|
+
if (typeof action.callback === 'function') {
|
|
760
|
+
action.callback(this, action);
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
if (action.close !== false) {
|
|
764
|
+
this.close({ source: 'action' });
|
|
765
|
+
}
|
|
766
|
+
});
|
|
767
|
+
actionsContainer.appendChild(button);
|
|
768
|
+
});
|
|
769
|
+
} else {
|
|
770
|
+
const actionsSlot = document.createElement('slot');
|
|
771
|
+
actionsSlot.name = 'actions';
|
|
772
|
+
actionsContainer.appendChild(actionsSlot);
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
if (state.content) {
|
|
777
|
+
this._updateFallbackVisibility(null, fallback, true);
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
_updateFallbackVisibility(slot, fallback, hasStateContent) {
|
|
782
|
+
if (!fallback) return;
|
|
783
|
+
|
|
784
|
+
if (hasStateContent) {
|
|
785
|
+
fallback.style.display = 'none';
|
|
786
|
+
return;
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
if (!slot) {
|
|
790
|
+
fallback.style.display = 'block';
|
|
791
|
+
return;
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
const hasAssignedNodes = slot.assignedNodes({ flatten: true }).length > 0;
|
|
795
|
+
fallback.style.display = hasAssignedNodes ? 'none' : 'block';
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
_handleKeyDown(event) {
|
|
799
|
+
if (!this._open) return;
|
|
800
|
+
if (event.key === 'Escape') {
|
|
801
|
+
this.close({ source: 'escape' });
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
_handleFocusTrap(event) {
|
|
806
|
+
if (!this._open || event.key !== 'Tab') return;
|
|
807
|
+
|
|
808
|
+
const focusable = this.shadowRoot.querySelectorAll(
|
|
809
|
+
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
810
|
+
);
|
|
811
|
+
|
|
812
|
+
if (!focusable.length) return;
|
|
813
|
+
|
|
814
|
+
const first = focusable[0];
|
|
815
|
+
const last = focusable[focusable.length - 1];
|
|
816
|
+
const activeElement = this.shadowRoot.activeElement || document.activeElement;
|
|
817
|
+
|
|
818
|
+
if (event.shiftKey && activeElement === first) {
|
|
819
|
+
event.preventDefault();
|
|
820
|
+
last.focus();
|
|
821
|
+
} else if (!event.shiftKey && activeElement === last) {
|
|
822
|
+
event.preventDefault();
|
|
823
|
+
first.focus();
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
if (!customElements.get('x-modal')) {
|
|
829
|
+
customElements.define('x-modal', XModal);
|
|
830
|
+
}
|
|
831
|
+
})();
|