@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,688 @@
|
|
|
1
|
+
import { xstate } from './xstate.js';
|
|
2
|
+
import { createXTendCoreIconPack, XTEND_CORE_ICON_PACK } from './icon-packs/core.js';
|
|
3
|
+
import { createXTendLucideIconPack, XTEND_LUCIDE_ICON_PACK } from './icon-packs/lucide.js';
|
|
4
|
+
|
|
5
|
+
const X_ICON_REGISTRY_SCHEMA = 'xtend.icon.registry.v1';
|
|
6
|
+
const X_ICON_SOURCE_SCHEMA = 'xtend.icon.source.v1';
|
|
7
|
+
const X_ICON_STATE_SCHEMA = 'xtend.component.x-icon.state.v1';
|
|
8
|
+
const X_ICON_MISSING_SCHEMA = 'xtend.component.x-icon.missing.v1';
|
|
9
|
+
const X_ICON_READY_SCHEMA = 'xtend.component.x-icon.ready.v1';
|
|
10
|
+
const X_ICON_PERFORMANCE_PROFILE_SCHEMA = 'xtend.performance.component-profile.v1';
|
|
11
|
+
const SVG_NS = 'http://www.w3.org/2000/svg';
|
|
12
|
+
const SAFE_NODE_NAMES = new Set(['path', 'line', 'circle', 'rect', 'polyline', 'polygon', 'ellipse', 'g']);
|
|
13
|
+
const SAFE_ATTR_NAMES = new Set([
|
|
14
|
+
'd',
|
|
15
|
+
'x',
|
|
16
|
+
'y',
|
|
17
|
+
'x1',
|
|
18
|
+
'x2',
|
|
19
|
+
'y1',
|
|
20
|
+
'y2',
|
|
21
|
+
'cx',
|
|
22
|
+
'cy',
|
|
23
|
+
'r',
|
|
24
|
+
'rx',
|
|
25
|
+
'ry',
|
|
26
|
+
'width',
|
|
27
|
+
'height',
|
|
28
|
+
'points',
|
|
29
|
+
'fill',
|
|
30
|
+
'stroke',
|
|
31
|
+
'stroke-width',
|
|
32
|
+
'stroke-linecap',
|
|
33
|
+
'stroke-linejoin',
|
|
34
|
+
'stroke-miterlimit',
|
|
35
|
+
'opacity',
|
|
36
|
+
'fill-rule',
|
|
37
|
+
'clip-rule',
|
|
38
|
+
'transform'
|
|
39
|
+
]);
|
|
40
|
+
|
|
41
|
+
function getGlobalScope() {
|
|
42
|
+
if (typeof window !== 'undefined') return window;
|
|
43
|
+
if (typeof globalThis !== 'undefined') return globalThis;
|
|
44
|
+
return {};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function normalizeName(value) {
|
|
48
|
+
return String(value || '').trim().toLowerCase();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function normalizeIconNodes(record) {
|
|
52
|
+
if (Array.isArray(record.nodes)) return record.nodes;
|
|
53
|
+
if (Array.isArray(record.paths)) {
|
|
54
|
+
return record.paths.map((entry) => {
|
|
55
|
+
if (typeof entry === 'string') return { tag: 'path', attrs: { d: entry } };
|
|
56
|
+
if (entry && typeof entry === 'object' && entry.d) {
|
|
57
|
+
return { tag: 'path', attrs: { d: entry.d, ...(entry.attrs || {}) } };
|
|
58
|
+
}
|
|
59
|
+
return entry;
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
if (record.path || record.d) {
|
|
63
|
+
return [{ tag: 'path', attrs: { d: record.path || record.d } }];
|
|
64
|
+
}
|
|
65
|
+
return [];
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function normalizeIconRecord(name, record, pack = {}) {
|
|
69
|
+
const sourceName = normalizeName(name || (record && record.name));
|
|
70
|
+
if (!sourceName) return null;
|
|
71
|
+
|
|
72
|
+
if (typeof record === 'string') {
|
|
73
|
+
const value = record.trim();
|
|
74
|
+
return {
|
|
75
|
+
schema: X_ICON_SOURCE_SCHEMA,
|
|
76
|
+
name: sourceName,
|
|
77
|
+
kind: value.startsWith('<svg') ? 'svg' : 'path',
|
|
78
|
+
svg: value.startsWith('<svg') ? value : undefined,
|
|
79
|
+
nodes: value.startsWith('<svg') ? [] : [{ tag: 'path', attrs: { d: value } }],
|
|
80
|
+
viewBox: pack.viewBox || '0 0 24 24',
|
|
81
|
+
aliases: []
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const value = record && typeof record === 'object' ? record : {};
|
|
86
|
+
const src = value.src || value.url;
|
|
87
|
+
return {
|
|
88
|
+
schema: X_ICON_SOURCE_SCHEMA,
|
|
89
|
+
name: sourceName,
|
|
90
|
+
kind: src ? 'url' : (value.svg ? 'svg' : 'path'),
|
|
91
|
+
aliases: Array.isArray(value.aliases) ? value.aliases.map(normalizeName).filter(Boolean) : [],
|
|
92
|
+
nodes: normalizeIconNodes(value),
|
|
93
|
+
svg: value.svg,
|
|
94
|
+
src,
|
|
95
|
+
viewBox: value.viewBox || pack.viewBox || '0 0 24 24',
|
|
96
|
+
fill: value.fill,
|
|
97
|
+
stroke: value.stroke,
|
|
98
|
+
strokeLinecap: value.strokeLinecap || pack.strokeLinecap || 'round',
|
|
99
|
+
strokeLinejoin: value.strokeLinejoin || pack.strokeLinejoin || 'round',
|
|
100
|
+
metadata: value.metadata || {}
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function normalizeIconPack(pack) {
|
|
105
|
+
const id = normalizeName(pack && pack.id);
|
|
106
|
+
if (!id) throw new Error('XTend Icon Pack benoetigt eine id.');
|
|
107
|
+
const iconEntries = pack.icons instanceof Map
|
|
108
|
+
? Array.from(pack.icons.entries())
|
|
109
|
+
: Object.entries(pack.icons || {});
|
|
110
|
+
const icons = new Map();
|
|
111
|
+
const aliases = new Map();
|
|
112
|
+
|
|
113
|
+
iconEntries.forEach(([name, record]) => {
|
|
114
|
+
const normalized = normalizeIconRecord(name, record, pack);
|
|
115
|
+
if (!normalized) return;
|
|
116
|
+
icons.set(normalized.name, normalized);
|
|
117
|
+
normalized.aliases.forEach((alias) => aliases.set(alias, normalized.name));
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
return {
|
|
121
|
+
schema: pack.schema || 'xtend.icon-pack.custom.v1',
|
|
122
|
+
id,
|
|
123
|
+
label: pack.label || id,
|
|
124
|
+
source: pack.source || 'custom',
|
|
125
|
+
distribution: pack.distribution || 'runtime',
|
|
126
|
+
cdnAllowed: pack.cdnAllowed === true,
|
|
127
|
+
viewBox: pack.viewBox || '0 0 24 24',
|
|
128
|
+
icons,
|
|
129
|
+
aliases,
|
|
130
|
+
metadata: pack.metadata || {}
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function createRegistry(seedPacks = []) {
|
|
135
|
+
return {
|
|
136
|
+
schema: X_ICON_REGISTRY_SCHEMA,
|
|
137
|
+
packs: new Map(),
|
|
138
|
+
order: [],
|
|
139
|
+
defaultPack: 'core',
|
|
140
|
+
register(pack, options = {}) {
|
|
141
|
+
const normalized = normalizeIconPack(pack);
|
|
142
|
+
this.packs.set(normalized.id, normalized);
|
|
143
|
+
this.order = this.order.filter((id) => id !== normalized.id);
|
|
144
|
+
if (options.prepend) this.order.unshift(normalized.id);
|
|
145
|
+
else this.order.push(normalized.id);
|
|
146
|
+
if (options.default || this.order.length === 1) this.defaultPack = normalized.id;
|
|
147
|
+
return normalized;
|
|
148
|
+
},
|
|
149
|
+
resolve(name, options = {}) {
|
|
150
|
+
const iconName = normalizeName(name);
|
|
151
|
+
const requestedPack = normalizeName(options.pack || '');
|
|
152
|
+
const packOrder = requestedPack
|
|
153
|
+
? [requestedPack]
|
|
154
|
+
: Array.from(new Set([this.defaultPack, ...this.order]));
|
|
155
|
+
|
|
156
|
+
for (const packId of packOrder) {
|
|
157
|
+
const pack = this.packs.get(packId);
|
|
158
|
+
if (!pack) continue;
|
|
159
|
+
const resolvedName = pack.icons.has(iconName) ? iconName : pack.aliases.get(iconName);
|
|
160
|
+
if (resolvedName && pack.icons.has(resolvedName)) {
|
|
161
|
+
return {
|
|
162
|
+
schema: X_ICON_SOURCE_SCHEMA,
|
|
163
|
+
pack: pack.id,
|
|
164
|
+
packLabel: pack.label,
|
|
165
|
+
source: pack.source,
|
|
166
|
+
distribution: pack.distribution,
|
|
167
|
+
cdnAllowed: pack.cdnAllowed,
|
|
168
|
+
record: pack.icons.get(resolvedName)
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
return null;
|
|
173
|
+
},
|
|
174
|
+
snapshot() {
|
|
175
|
+
return {
|
|
176
|
+
schema: X_ICON_REGISTRY_SCHEMA,
|
|
177
|
+
defaultPack: this.defaultPack,
|
|
178
|
+
packs: this.order.map((id) => {
|
|
179
|
+
const pack = this.packs.get(id);
|
|
180
|
+
return {
|
|
181
|
+
id,
|
|
182
|
+
label: pack.label,
|
|
183
|
+
source: pack.source,
|
|
184
|
+
distribution: pack.distribution,
|
|
185
|
+
cdnAllowed: pack.cdnAllowed,
|
|
186
|
+
iconCount: pack.icons.size,
|
|
187
|
+
aliases: pack.aliases.size
|
|
188
|
+
};
|
|
189
|
+
})
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
const globalScope = getGlobalScope();
|
|
196
|
+
const XTendIconRegistry = globalScope.__xtendIconRegistry || createRegistry();
|
|
197
|
+
globalScope.__xtendIconRegistry = XTendIconRegistry;
|
|
198
|
+
|
|
199
|
+
export function registerIconPack(pack, options = {}) {
|
|
200
|
+
const registered = XTendIconRegistry.register(pack, options);
|
|
201
|
+
if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function') {
|
|
202
|
+
window.dispatchEvent(new CustomEvent('icon-pack-registered', {
|
|
203
|
+
detail: {
|
|
204
|
+
schema: 'xtend.icon-pack.registered.v1',
|
|
205
|
+
pack: registered.id,
|
|
206
|
+
iconCount: registered.icons.size,
|
|
207
|
+
cdnAllowed: registered.cdnAllowed
|
|
208
|
+
}
|
|
209
|
+
}));
|
|
210
|
+
}
|
|
211
|
+
return registered;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
export function resolveIcon(name, options = {}) {
|
|
215
|
+
return XTendIconRegistry.resolve(name, options);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
export function getIconRegistrySnapshot() {
|
|
219
|
+
return XTendIconRegistry.snapshot();
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
function installDefaultIconPacks() {
|
|
223
|
+
if (!XTendIconRegistry.packs.has('core')) {
|
|
224
|
+
registerIconPack(createXTendCoreIconPack(XTEND_CORE_ICON_PACK), { default: true });
|
|
225
|
+
}
|
|
226
|
+
if (!XTendIconRegistry.packs.has('lucide')) {
|
|
227
|
+
registerIconPack(createXTendLucideIconPack(XTEND_LUCIDE_ICON_PACK));
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
function isSafeIconUrl(value) {
|
|
232
|
+
const url = String(value || '').trim();
|
|
233
|
+
if (!url) return false;
|
|
234
|
+
const lowered = url.replace(/[\u0000-\u001F\u007F\s]+/g, '').toLowerCase();
|
|
235
|
+
if (lowered.startsWith('javascript:') || lowered.startsWith('vbscript:')) return false;
|
|
236
|
+
if (lowered.startsWith('data:')) return lowered.startsWith('data:image/');
|
|
237
|
+
return true;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
function setSafeAttribute(element, name, value) {
|
|
241
|
+
if (!SAFE_ATTR_NAMES.has(name)) return;
|
|
242
|
+
if (value === undefined || value === null || value === false) return;
|
|
243
|
+
element.setAttribute(name, String(value));
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
function appendSafeSvgNode(parent, sourceNode) {
|
|
247
|
+
const tag = normalizeName(sourceNode && sourceNode.localName);
|
|
248
|
+
if (!SAFE_NODE_NAMES.has(tag)) return;
|
|
249
|
+
const child = document.createElementNS(SVG_NS, tag);
|
|
250
|
+
Array.from(sourceNode.attributes || []).forEach((attribute) => {
|
|
251
|
+
setSafeAttribute(child, normalizeName(attribute.name), attribute.value);
|
|
252
|
+
});
|
|
253
|
+
Array.from(sourceNode.children || []).forEach((nestedNode) => {
|
|
254
|
+
appendSafeSvgNode(child, nestedNode);
|
|
255
|
+
});
|
|
256
|
+
parent.appendChild(child);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
function appendSafeSvgMarkup(svg, markup) {
|
|
260
|
+
if (!markup || typeof DOMParser === 'undefined') return;
|
|
261
|
+
const parsed = new DOMParser().parseFromString(String(markup), 'image/svg+xml');
|
|
262
|
+
const sourceSvg = parsed.documentElement;
|
|
263
|
+
if (!sourceSvg || normalizeName(sourceSvg.localName) !== 'svg') return;
|
|
264
|
+
const parsedViewBox = sourceSvg.getAttribute('viewBox');
|
|
265
|
+
if (parsedViewBox) svg.setAttribute('viewBox', parsedViewBox);
|
|
266
|
+
Array.from(sourceSvg.children || []).forEach((sourceNode) => {
|
|
267
|
+
appendSafeSvgNode(svg, sourceNode);
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
function createSvgElement(record, options = {}) {
|
|
272
|
+
const svg = document.createElementNS(SVG_NS, 'svg');
|
|
273
|
+
svg.setAttribute('part', 'svg');
|
|
274
|
+
svg.setAttribute('viewBox', record.viewBox || '0 0 24 24');
|
|
275
|
+
svg.setAttribute('aria-hidden', 'true');
|
|
276
|
+
svg.setAttribute('focusable', 'false');
|
|
277
|
+
svg.setAttribute('fill', record.fill || 'none');
|
|
278
|
+
svg.setAttribute('stroke', record.stroke || 'currentColor');
|
|
279
|
+
svg.setAttribute('stroke-width', String(options.strokeWidth || '2'));
|
|
280
|
+
svg.setAttribute('stroke-linecap', record.strokeLinecap || 'round');
|
|
281
|
+
svg.setAttribute('stroke-linejoin', record.strokeLinejoin || 'round');
|
|
282
|
+
|
|
283
|
+
(record.nodes || []).forEach((node) => {
|
|
284
|
+
const tag = normalizeName(node && node.tag || 'path');
|
|
285
|
+
if (!SAFE_NODE_NAMES.has(tag)) return;
|
|
286
|
+
const child = document.createElementNS(SVG_NS, tag);
|
|
287
|
+
Object.entries(node.attrs || {}).forEach(([attrName, attrValue]) => {
|
|
288
|
+
setSafeAttribute(child, attrName, attrValue);
|
|
289
|
+
});
|
|
290
|
+
svg.appendChild(child);
|
|
291
|
+
});
|
|
292
|
+
appendSafeSvgMarkup(svg, record.svg);
|
|
293
|
+
return svg;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
function createUrlElement(record, options = {}) {
|
|
297
|
+
const img = document.createElement('img');
|
|
298
|
+
img.part = 'image';
|
|
299
|
+
img.alt = options.decorative ? '' : options.label || record.name || '';
|
|
300
|
+
img.decoding = 'async';
|
|
301
|
+
img.loading = 'lazy';
|
|
302
|
+
if (isSafeIconUrl(record.src)) {
|
|
303
|
+
img.src = record.src;
|
|
304
|
+
}
|
|
305
|
+
return img;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
function createExternalSourceRecord(src) {
|
|
309
|
+
return {
|
|
310
|
+
schema: X_ICON_SOURCE_SCHEMA,
|
|
311
|
+
name: 'external-source',
|
|
312
|
+
kind: 'url',
|
|
313
|
+
src,
|
|
314
|
+
viewBox: '0 0 24 24',
|
|
315
|
+
nodes: [],
|
|
316
|
+
aliases: [],
|
|
317
|
+
metadata: {
|
|
318
|
+
providedBy: 'x-icon.src'
|
|
319
|
+
}
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
installDefaultIconPacks();
|
|
324
|
+
|
|
325
|
+
class XIcon extends HTMLElement {
|
|
326
|
+
static get observedAttributes() {
|
|
327
|
+
return ['name', 'pack', 'src', 'label', 'size', 'stroke-width', 'color', 'decorative'];
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
static get xtendComponentContract() {
|
|
331
|
+
return {
|
|
332
|
+
schema: 'xtend.component.contract.v2',
|
|
333
|
+
tag: 'x-icon',
|
|
334
|
+
maturity: 'stable',
|
|
335
|
+
profiles: ['display', 'iconography'],
|
|
336
|
+
source: {
|
|
337
|
+
strategy: 'xtend.local-esm-icon-adapter.v1',
|
|
338
|
+
state: 'js-runtime-profiled',
|
|
339
|
+
sourcePath: 'components/xicon.js'
|
|
340
|
+
},
|
|
341
|
+
runtime: {
|
|
342
|
+
format: 'esm',
|
|
343
|
+
artifact: 'components/xicon.js',
|
|
344
|
+
declaration: 'components/xicon.d.ts',
|
|
345
|
+
localOnly: true,
|
|
346
|
+
cdnAllowed: false
|
|
347
|
+
},
|
|
348
|
+
rmt: {
|
|
349
|
+
adapter: 'xtend.component',
|
|
350
|
+
kernelBoundary: 'no-rmt-kernel-import-of-xtend-types'
|
|
351
|
+
},
|
|
352
|
+
fabric: {
|
|
353
|
+
api: '@xtend-fabric',
|
|
354
|
+
defaultLane: 'visible',
|
|
355
|
+
diagnosticsLane: 'diagnostics'
|
|
356
|
+
}
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
static get xtendRmtMetadata() {
|
|
361
|
+
return {
|
|
362
|
+
schema: 'xtend.rmt.component-contract.v1',
|
|
363
|
+
adapter: 'xtend.component',
|
|
364
|
+
tag: 'x-icon',
|
|
365
|
+
componentRecordKind: 'custom_element',
|
|
366
|
+
templateMode: 'dom_descriptor',
|
|
367
|
+
eventBindingMode: 'dom-event-to-rmt-command',
|
|
368
|
+
schedules: ['component.visible.mount', 'component.visible.hydrate', 'diagnostics.snapshot'],
|
|
369
|
+
hydration: { policy: 'visible', lane: 'visible' },
|
|
370
|
+
shellAuthoring: {
|
|
371
|
+
schema: 'xtend.rmt.shell-authoring.component.v1',
|
|
372
|
+
host: 'x-icon',
|
|
373
|
+
attributes: ['name', 'pack', 'src', 'label', 'size', 'stroke-width', 'color', 'decorative'],
|
|
374
|
+
stateKey: 'xicon-state-<id>',
|
|
375
|
+
events: ['icon-ready', 'icon-missing', 'icon-pack-registered']
|
|
376
|
+
},
|
|
377
|
+
kernelBoundary: 'no-rmt-kernel-import-of-xtend-types'
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
static get xtendScaffoldA11yProfile() {
|
|
382
|
+
return {
|
|
383
|
+
schema: 'xtend.a11y.profile.v1',
|
|
384
|
+
componentRef: 'x-icon',
|
|
385
|
+
role: 'img-or-presentation',
|
|
386
|
+
accessibleName: 'label-or-decorative',
|
|
387
|
+
decorativePolicy: 'aria-hidden-when-decorative',
|
|
388
|
+
screenreader: {
|
|
389
|
+
signalContract: XIcon.xtendScreenreaderSignals
|
|
390
|
+
},
|
|
391
|
+
motionContrast: {
|
|
392
|
+
policy: XIcon.xtendMotionContrastPolicy
|
|
393
|
+
}
|
|
394
|
+
};
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
static get xtendScreenreaderSignals() {
|
|
398
|
+
return {
|
|
399
|
+
schema: 'xtend.a11y.screenreader-signals.v1',
|
|
400
|
+
componentRef: 'x-icon',
|
|
401
|
+
signals: ['icon-ready', 'icon-missing'],
|
|
402
|
+
statusRegions: ['role=img', 'aria-label', 'aria-hidden'],
|
|
403
|
+
fabric: {
|
|
404
|
+
lane: 'a11y',
|
|
405
|
+
fiberKind: 'a11y.static-label',
|
|
406
|
+
scheduleRef: 'a11y.visible.label'
|
|
407
|
+
}
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
static get xtendMotionContrastPolicy() {
|
|
412
|
+
return {
|
|
413
|
+
schema: 'xtend.a11y.motion-contrast-policy.v1',
|
|
414
|
+
componentRef: 'x-icon',
|
|
415
|
+
motion: {
|
|
416
|
+
schema: 'xtend.a11y.motion-policy.v1',
|
|
417
|
+
mediaQuery: '(prefers-reduced-motion: reduce)',
|
|
418
|
+
reducedMotion: 'supported',
|
|
419
|
+
animationPolicy: 'no-essential-motion'
|
|
420
|
+
},
|
|
421
|
+
contrast: {
|
|
422
|
+
schema: 'xtend.a11y.contrast-policy.v1',
|
|
423
|
+
mediaQuery: '(forced-colors: active)',
|
|
424
|
+
highContrast: 'required',
|
|
425
|
+
forcedColorAdjust: 'auto',
|
|
426
|
+
colorToken: 'currentColor'
|
|
427
|
+
}
|
|
428
|
+
};
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
static get xtendScaffoldPerformanceProfile() {
|
|
432
|
+
return {
|
|
433
|
+
schema: X_ICON_PERFORMANCE_PROFILE_SCHEMA,
|
|
434
|
+
componentRef: 'x-icon',
|
|
435
|
+
profiles: ['display', 'iconography'],
|
|
436
|
+
primaryProfile: 'display',
|
|
437
|
+
budgetClass: 'display-micro',
|
|
438
|
+
lane: 'visible',
|
|
439
|
+
hydrationPolicy: 'visible',
|
|
440
|
+
budgetsMs: {
|
|
441
|
+
mount: 8,
|
|
442
|
+
hydrate: 12,
|
|
443
|
+
renderUpdate: 6,
|
|
444
|
+
stateSync: 4
|
|
445
|
+
},
|
|
446
|
+
criticalMeasurements: ['xtend.component.hydrate', 'xtend.component.render', 'xtend.state.sync'],
|
|
447
|
+
cleanup: ['icon-registry-reference'],
|
|
448
|
+
rmt: {
|
|
449
|
+
scheduleRefs: ['component.visible.hydrate', 'diagnostics.snapshot'],
|
|
450
|
+
kernelBoundary: 'no-rmt-kernel-import-of-xtend-types'
|
|
451
|
+
},
|
|
452
|
+
fabric: {
|
|
453
|
+
lane: 'visible',
|
|
454
|
+
diagnosticsLane: 'diagnostics',
|
|
455
|
+
snapshotPath: 'xtend.component.x-icon.snapshot'
|
|
456
|
+
}
|
|
457
|
+
};
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
constructor() {
|
|
461
|
+
super();
|
|
462
|
+
this.attachShadow({ mode: 'open' });
|
|
463
|
+
this._lastReadyKey = '';
|
|
464
|
+
this.shadowRoot.innerHTML = `
|
|
465
|
+
<style>
|
|
466
|
+
:host {
|
|
467
|
+
--xtend-icon-size: 1em;
|
|
468
|
+
--xtend-icon-color: currentColor;
|
|
469
|
+
--xtend-icon-stroke-width: 2;
|
|
470
|
+
display: inline-flex;
|
|
471
|
+
width: var(--xtend-icon-size);
|
|
472
|
+
height: var(--xtend-icon-size);
|
|
473
|
+
min-width: var(--xtend-icon-size);
|
|
474
|
+
min-height: var(--xtend-icon-size);
|
|
475
|
+
align-items: center;
|
|
476
|
+
justify-content: center;
|
|
477
|
+
color: var(--xtend-icon-color);
|
|
478
|
+
vertical-align: -0.125em;
|
|
479
|
+
line-height: 1;
|
|
480
|
+
contain: layout paint style;
|
|
481
|
+
}
|
|
482
|
+
.icon-root,
|
|
483
|
+
svg,
|
|
484
|
+
img {
|
|
485
|
+
display: block;
|
|
486
|
+
width: 100%;
|
|
487
|
+
height: 100%;
|
|
488
|
+
}
|
|
489
|
+
svg {
|
|
490
|
+
overflow: visible;
|
|
491
|
+
}
|
|
492
|
+
img {
|
|
493
|
+
object-fit: contain;
|
|
494
|
+
}
|
|
495
|
+
:host([hidden]) {
|
|
496
|
+
display: none !important;
|
|
497
|
+
}
|
|
498
|
+
@media (forced-colors: active) {
|
|
499
|
+
:host {
|
|
500
|
+
forced-color-adjust: auto;
|
|
501
|
+
color: CanvasText;
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
</style>
|
|
505
|
+
<span class="icon-root" part="root"></span>
|
|
506
|
+
`;
|
|
507
|
+
this._root = this.shadowRoot.querySelector('.icon-root');
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
connectedCallback() {
|
|
511
|
+
this.render();
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
attributeChangedCallback() {
|
|
515
|
+
if (this.isConnected) this.render();
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
get name() {
|
|
519
|
+
return this.getAttribute('name') || '';
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
set name(value) {
|
|
523
|
+
if (value === null || value === undefined) this.removeAttribute('name');
|
|
524
|
+
else this.setAttribute('name', String(value));
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
registerPack(pack, options = {}) {
|
|
528
|
+
return registerIconPack(pack, options);
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
setIcon(name, options = {}) {
|
|
532
|
+
this.name = name;
|
|
533
|
+
if (options.pack) this.setAttribute('pack', options.pack);
|
|
534
|
+
if (options.label) this.setAttribute('label', options.label);
|
|
535
|
+
if (options.src) this.setAttribute('src', options.src);
|
|
536
|
+
return this.snapshot();
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
snapshot() {
|
|
540
|
+
const label = this.getLabel();
|
|
541
|
+
const decorative = this.isDecorative(label);
|
|
542
|
+
const src = this.getAttribute('src') || '';
|
|
543
|
+
const name = this.name;
|
|
544
|
+
const pack = this.getAttribute('pack') || '';
|
|
545
|
+
const resolved = src
|
|
546
|
+
? (isSafeIconUrl(src)
|
|
547
|
+
? { pack: 'external', record: createExternalSourceRecord(src), source: 'x-icon.src', distribution: 'runtime' }
|
|
548
|
+
: null)
|
|
549
|
+
: resolveIcon(name, { pack });
|
|
550
|
+
return {
|
|
551
|
+
schema: X_ICON_STATE_SCHEMA,
|
|
552
|
+
componentRef: 'x-icon',
|
|
553
|
+
id: this.id || null,
|
|
554
|
+
name,
|
|
555
|
+
pack: resolved ? resolved.pack : pack,
|
|
556
|
+
src,
|
|
557
|
+
mode: src ? (resolved ? 'url' : 'missing') : (resolved && resolved.record ? resolved.record.kind : 'missing'),
|
|
558
|
+
resolved: Boolean(resolved),
|
|
559
|
+
decorative,
|
|
560
|
+
label,
|
|
561
|
+
size: this.getAttribute('size') || '1em',
|
|
562
|
+
strokeWidth: this.getAttribute('stroke-width') || '2',
|
|
563
|
+
color: this.getAttribute('color') || 'currentColor',
|
|
564
|
+
registry: getIconRegistrySnapshot()
|
|
565
|
+
};
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
getLabel() {
|
|
569
|
+
return this.getAttribute('label') || this.getAttribute('aria-label') || '';
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
isDecorative(label = this.getLabel()) {
|
|
573
|
+
if (this.hasAttribute('decorative')) {
|
|
574
|
+
const value = this.getAttribute('decorative');
|
|
575
|
+
return value === '' || value === 'true' || value === 'decorative';
|
|
576
|
+
}
|
|
577
|
+
return !label;
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
applyA11y(snapshot) {
|
|
581
|
+
if (snapshot.decorative) {
|
|
582
|
+
this.removeAttribute('role');
|
|
583
|
+
this.setAttribute('aria-hidden', 'true');
|
|
584
|
+
this.removeAttribute('aria-label');
|
|
585
|
+
return;
|
|
586
|
+
}
|
|
587
|
+
this.setAttribute('role', 'img');
|
|
588
|
+
this.removeAttribute('aria-hidden');
|
|
589
|
+
this.setAttribute('aria-label', snapshot.label || snapshot.name || 'Icon');
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
applyTokens(snapshot) {
|
|
593
|
+
this.style.setProperty('--xtend-icon-size', snapshot.size);
|
|
594
|
+
this.style.setProperty('--xtend-icon-stroke-width', snapshot.strokeWidth);
|
|
595
|
+
this.style.setProperty('--xtend-icon-color', snapshot.color);
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
syncState(snapshot) {
|
|
599
|
+
const stateKey = `xicon-state-${this.id || snapshot.name || 'anonymous'}`;
|
|
600
|
+
try {
|
|
601
|
+
xstate.set(stateKey, snapshot);
|
|
602
|
+
} catch (error) {
|
|
603
|
+
// xstate is optional for host-neutral RMT rendering.
|
|
604
|
+
}
|
|
605
|
+
this.setAttribute('data-xstate-key', stateKey);
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
emitReady(snapshot, resolved) {
|
|
609
|
+
const readyKey = `${snapshot.name}|${snapshot.pack}|${snapshot.mode}|${snapshot.resolved}`;
|
|
610
|
+
if (readyKey === this._lastReadyKey) return;
|
|
611
|
+
this._lastReadyKey = readyKey;
|
|
612
|
+
const eventName = snapshot.resolved ? 'icon-ready' : 'icon-missing';
|
|
613
|
+
const schema = snapshot.resolved ? X_ICON_READY_SCHEMA : X_ICON_MISSING_SCHEMA;
|
|
614
|
+
this.dispatchEvent(new CustomEvent(eventName, {
|
|
615
|
+
bubbles: true,
|
|
616
|
+
composed: true,
|
|
617
|
+
detail: {
|
|
618
|
+
schema,
|
|
619
|
+
componentRef: 'x-icon',
|
|
620
|
+
id: this.id || null,
|
|
621
|
+
name: snapshot.name,
|
|
622
|
+
pack: snapshot.pack,
|
|
623
|
+
src: snapshot.src,
|
|
624
|
+
source: resolved ? resolved.source : 'registry-miss',
|
|
625
|
+
distribution: resolved ? resolved.distribution : null,
|
|
626
|
+
resolved: snapshot.resolved
|
|
627
|
+
}
|
|
628
|
+
}));
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
render() {
|
|
632
|
+
const src = this.getAttribute('src') || '';
|
|
633
|
+
const name = this.name;
|
|
634
|
+
const pack = this.getAttribute('pack') || '';
|
|
635
|
+
const label = this.getLabel();
|
|
636
|
+
const decorative = this.isDecorative(label);
|
|
637
|
+
const resolved = src
|
|
638
|
+
? (isSafeIconUrl(src)
|
|
639
|
+
? { pack: 'external', record: createExternalSourceRecord(src), source: 'x-icon.src', distribution: 'runtime' }
|
|
640
|
+
: null)
|
|
641
|
+
: resolveIcon(name, { pack });
|
|
642
|
+
const snapshot = this.snapshot();
|
|
643
|
+
|
|
644
|
+
this.applyTokens(snapshot);
|
|
645
|
+
this.applyA11y({ ...snapshot, decorative, label });
|
|
646
|
+
this._root.textContent = '';
|
|
647
|
+
this._root.removeAttribute('data-icon-missing');
|
|
648
|
+
|
|
649
|
+
if (resolved && resolved.record) {
|
|
650
|
+
const node = resolved.record.kind === 'url'
|
|
651
|
+
? createUrlElement(resolved.record, { decorative, label })
|
|
652
|
+
: createSvgElement(resolved.record, { strokeWidth: snapshot.strokeWidth });
|
|
653
|
+
this._root.appendChild(node);
|
|
654
|
+
} else {
|
|
655
|
+
this._root.setAttribute('data-icon-missing', name || 'empty');
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
this.syncState(snapshot);
|
|
659
|
+
this.emitReady(snapshot, resolved);
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
if (!customElements.get('x-icon')) {
|
|
664
|
+
customElements.define('x-icon', XIcon);
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
if (typeof window !== 'undefined') {
|
|
668
|
+
window.XTend = window.XTend || {};
|
|
669
|
+
window.XTend.icons = {
|
|
670
|
+
schema: X_ICON_REGISTRY_SCHEMA,
|
|
671
|
+
registry: XTendIconRegistry,
|
|
672
|
+
register: registerIconPack,
|
|
673
|
+
resolve: resolveIcon,
|
|
674
|
+
snapshot: getIconRegistrySnapshot,
|
|
675
|
+
createCorePack: createXTendCoreIconPack,
|
|
676
|
+
createLucidePack: createXTendLucideIconPack
|
|
677
|
+
};
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
export {
|
|
681
|
+
XIcon,
|
|
682
|
+
X_ICON_REGISTRY_SCHEMA,
|
|
683
|
+
X_ICON_SOURCE_SCHEMA,
|
|
684
|
+
X_ICON_STATE_SCHEMA,
|
|
685
|
+
createXTendCoreIconPack,
|
|
686
|
+
createXTendLucideIconPack,
|
|
687
|
+
XTendIconRegistry
|
|
688
|
+
};
|