@ng-prism/core 22.5.0 → 22.7.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -9
- package/dist/app/canvas/canvas-bg.styles.d.ts +1 -1
- package/dist/app/canvas/canvas-bg.styles.d.ts.map +1 -1
- package/dist/app/canvas/canvas-bg.styles.js +1 -1
- package/dist/app/canvas/canvas-overlay-tokens.d.ts +12 -0
- package/dist/app/canvas/canvas-overlay-tokens.d.ts.map +1 -0
- package/dist/app/canvas/canvas-overlay-tokens.js +52 -0
- package/dist/app/canvas/prism-canvas-bg-pill.component.js +2 -2
- package/dist/app/canvas/prism-canvas-pin-row.component.js +2 -2
- package/dist/app/canvas/prism-canvas-rulers.component.d.ts +2 -0
- package/dist/app/canvas/prism-canvas-rulers.component.d.ts.map +1 -1
- package/dist/app/canvas/prism-canvas-rulers.component.js +17 -12
- package/dist/app/canvas/prism-canvas-toolbar.component.d.ts +25 -3
- package/dist/app/canvas/prism-canvas-toolbar.component.d.ts.map +1 -1
- package/dist/app/canvas/prism-canvas-toolbar.component.js +154 -89
- package/dist/app/canvas/prism-template-popover.component.d.ts.map +1 -1
- package/dist/app/canvas/prism-template-popover.component.js +16 -7
- package/dist/app/canvas/state-chips.d.ts +50 -0
- package/dist/app/canvas/state-chips.d.ts.map +1 -0
- package/dist/app/canvas/state-chips.js +40 -0
- package/dist/app/component-head/head-metrics.d.ts +35 -19
- package/dist/app/component-head/head-metrics.d.ts.map +1 -1
- package/dist/app/component-head/head-metrics.js +57 -27
- package/dist/app/component-head/pipe-facts.d.ts +9 -0
- package/dist/app/component-head/pipe-facts.d.ts.map +1 -0
- package/dist/app/component-head/pipe-facts.js +15 -0
- package/dist/app/component-head/prism-component-head.component.d.ts +20 -22
- package/dist/app/component-head/prism-component-head.component.d.ts.map +1 -1
- package/dist/app/component-head/prism-component-head.component.js +85 -96
- package/dist/app/component-head/prism-head-gauge.component.d.ts +8 -12
- package/dist/app/component-head/prism-head-gauge.component.d.ts.map +1 -1
- package/dist/app/component-head/prism-head-gauge.component.js +51 -67
- package/dist/app/component-head/prism-head-info.component.d.ts +14 -2
- package/dist/app/component-head/prism-head-info.component.d.ts.map +1 -1
- package/dist/app/component-head/prism-head-info.component.js +84 -20
- package/dist/app/component-head/prism-stat.component.d.ts +4 -5
- package/dist/app/component-head/prism-stat.component.d.ts.map +1 -1
- package/dist/app/component-head/prism-stat.component.js +16 -12
- package/dist/app/component-head/service-facts.d.ts +8 -0
- package/dist/app/component-head/service-facts.d.ts.map +1 -0
- package/dist/app/component-head/service-facts.js +11 -0
- package/dist/app/controls/boolean-control.component.js +2 -2
- package/dist/app/controls/json-control.component.js +2 -2
- package/dist/app/controls/union-control.component.js +4 -3
- package/dist/app/directives/resize-value.d.ts +1 -1
- package/dist/app/directives/resize-value.js +1 -1
- package/dist/app/discovery-manifest.d.ts +2 -2
- package/dist/app/discovery-manifest.d.ts.map +1 -1
- package/dist/app/discovery-manifest.js +15 -3
- package/dist/app/header/header-brand.d.ts +25 -0
- package/dist/app/header/header-brand.d.ts.map +1 -0
- package/dist/app/header/header-brand.js +10 -0
- package/dist/app/header/prism-header.component.d.ts +2 -2
- package/dist/app/header/prism-header.component.d.ts.map +1 -1
- package/dist/app/header/prism-header.component.js +73 -57
- package/dist/app/icons/icon-registry.d.ts.map +1 -1
- package/dist/app/icons/icon-registry.js +4 -1
- package/dist/app/index.d.ts +12 -0
- package/dist/app/index.d.ts.map +1 -1
- package/dist/app/index.js +12 -1
- package/dist/app/layout-menu/prism-layout-menu.component.d.ts +3 -0
- package/dist/app/layout-menu/prism-layout-menu.component.d.ts.map +1 -1
- package/dist/app/layout-menu/prism-layout-menu.component.js +72 -58
- package/dist/app/overview/open-in-playground.d.ts +19 -0
- package/dist/app/overview/open-in-playground.d.ts.map +1 -0
- package/dist/app/overview/open-in-playground.js +25 -0
- package/dist/app/overview/overview-matrix.d.ts +85 -0
- package/dist/app/overview/overview-matrix.d.ts.map +1 -0
- package/dist/app/overview/overview-matrix.js +98 -0
- package/dist/app/overview/overview-visibility.d.ts +10 -2
- package/dist/app/overview/overview-visibility.d.ts.map +1 -1
- package/dist/app/overview/overview-visibility.js +14 -3
- package/dist/app/overview/prism-overview-cell.component.d.ts +27 -2
- package/dist/app/overview/prism-overview-cell.component.d.ts.map +1 -1
- package/dist/app/overview/prism-overview-cell.component.js +145 -28
- package/dist/app/overview/prism-overview-matrix.component.d.ts +29 -0
- package/dist/app/overview/prism-overview-matrix.component.d.ts.map +1 -0
- package/dist/app/overview/prism-overview-matrix.component.js +155 -0
- package/dist/app/overview/prism-overview.component.d.ts +4 -0
- package/dist/app/overview/prism-overview.component.d.ts.map +1 -1
- package/dist/app/overview/prism-overview.component.js +37 -14
- package/dist/app/page-renderer/prism-page-renderer.component.js +2 -2
- package/dist/app/panels/a11y/a11y-core.plugin.d.ts.map +1 -1
- package/dist/app/panels/a11y/a11y-core.plugin.js +0 -1
- package/dist/app/panels/a11y/a11y-header-badge.component.d.ts +1 -4
- package/dist/app/panels/a11y/a11y-header-badge.component.d.ts.map +1 -1
- package/dist/app/panels/a11y/a11y-header-badge.component.js +8 -19
- package/dist/app/panels/a11y/a11y-keyboard-overlay.component.js +2 -2
- package/dist/app/panels/a11y/a11y-overlay-host.component.d.ts +1 -0
- package/dist/app/panels/a11y/a11y-overlay-host.component.d.ts.map +1 -1
- package/dist/app/panels/a11y/a11y-overlay-host.component.js +4 -3
- package/dist/app/panels/a11y/a11y-panel.component.d.ts +4 -1
- package/dist/app/panels/a11y/a11y-panel.component.d.ts.map +1 -1
- package/dist/app/panels/a11y/a11y-panel.component.js +32 -54
- package/dist/app/panels/a11y/a11y-score.component.d.ts +8 -3
- package/dist/app/panels/a11y/a11y-score.component.d.ts.map +1 -1
- package/dist/app/panels/a11y/a11y-score.component.js +19 -35
- package/dist/app/panels/a11y/a11y-sr-overlay.component.js +2 -2
- package/dist/app/panels/a11y/a11y-sr.component.js +2 -2
- package/dist/app/panels/a11y/a11y-summary.d.ts.map +1 -1
- package/dist/app/panels/a11y/a11y-summary.js +8 -1
- package/dist/app/panels/a11y/a11y-tree.component.js +2 -2
- package/dist/app/panels/a11y/a11y-violations.component.d.ts +23 -2
- package/dist/app/panels/a11y/a11y-violations.component.d.ts.map +1 -1
- package/dist/app/panels/a11y/a11y-violations.component.js +104 -89
- package/dist/app/panels/a11y/severity.d.ts +9 -0
- package/dist/app/panels/a11y/severity.d.ts.map +1 -0
- package/dist/app/panels/a11y/severity.js +12 -0
- package/dist/app/panels/controls/controls-plugin.d.ts.map +1 -1
- package/dist/app/panels/controls/controls-plugin.js +1 -2
- package/dist/app/panels/controls/non-editable-input-types.d.ts +9 -1
- package/dist/app/panels/controls/non-editable-input-types.d.ts.map +1 -1
- package/dist/app/panels/controls/non-editable-input-types.js +18 -0
- package/dist/app/panels/controls/prism-controls-panel.component.d.ts +2 -1
- package/dist/app/panels/controls/prism-controls-panel.component.d.ts.map +1 -1
- package/dist/app/panels/controls/prism-controls-panel.component.js +77 -59
- package/dist/app/panels/events/events-plugin.d.ts.map +1 -1
- package/dist/app/panels/events/events-plugin.js +1 -2
- package/dist/app/panels/events/prism-events-panel.component.d.ts +2 -0
- package/dist/app/panels/events/prism-events-panel.component.d.ts.map +1 -1
- package/dist/app/panels/events/prism-events-panel.component.js +20 -7
- package/dist/app/panels/events/prism-json-node.utils.d.ts +6 -0
- package/dist/app/panels/events/prism-json-node.utils.d.ts.map +1 -1
- package/dist/app/panels/events/prism-json-node.utils.js +8 -0
- package/dist/app/panels/panel-host/addon-panels.d.ts +11 -0
- package/dist/app/panels/panel-host/addon-panels.d.ts.map +1 -0
- package/dist/app/panels/panel-host/addon-panels.js +12 -0
- package/dist/app/panels/panel-host/panel-badge.d.ts +22 -0
- package/dist/app/panels/panel-host/panel-badge.d.ts.map +1 -1
- package/dist/app/panels/panel-host/panel-badge.js +56 -11
- package/dist/app/panels/panel-host/prism-panel-host.component.d.ts +4 -1
- package/dist/app/panels/panel-host/prism-panel-host.component.d.ts.map +1 -1
- package/dist/app/panels/panel-host/prism-panel-host.component.js +36 -70
- package/dist/app/pseudo/pseudo-state-marker.d.ts +32 -10
- package/dist/app/pseudo/pseudo-state-marker.d.ts.map +1 -1
- package/dist/app/pseudo/pseudo-state-marker.js +83 -67
- package/dist/app/pseudo/pseudo-targets.d.ts +11 -0
- package/dist/app/pseudo/pseudo-targets.d.ts.map +1 -0
- package/dist/app/pseudo/pseudo-targets.js +46 -0
- package/dist/app/pseudo/state-fit.d.ts +28 -0
- package/dist/app/pseudo/state-fit.d.ts.map +1 -0
- package/dist/app/pseudo/state-fit.js +97 -0
- package/dist/app/renderer/composition.d.ts +20 -0
- package/dist/app/renderer/composition.d.ts.map +1 -0
- package/dist/app/renderer/composition.js +26 -0
- package/dist/app/renderer/input-bindings.d.ts +28 -0
- package/dist/app/renderer/input-bindings.d.ts.map +1 -0
- package/dist/app/renderer/input-bindings.js +42 -0
- package/dist/app/renderer/known-inputs.d.ts +8 -1
- package/dist/app/renderer/known-inputs.d.ts.map +1 -1
- package/dist/app/renderer/known-inputs.js +13 -5
- package/dist/app/renderer/prism-renderer.component.d.ts +18 -4
- package/dist/app/renderer/prism-renderer.component.d.ts.map +1 -1
- package/dist/app/renderer/prism-renderer.component.js +78 -44
- package/dist/app/renderer/projectable-content.d.ts +8 -1
- package/dist/app/renderer/projectable-content.d.ts.map +1 -1
- package/dist/app/renderer/projectable-content.js +40 -29
- package/dist/app/renderer/rendered-key.d.ts +20 -6
- package/dist/app/renderer/rendered-key.d.ts.map +1 -1
- package/dist/app/renderer/rendered-key.js +25 -8
- package/dist/app/renderer/snippet-generator.d.ts +14 -2
- package/dist/app/renderer/snippet-generator.d.ts.map +1 -1
- package/dist/app/renderer/snippet-generator.js +138 -81
- package/dist/app/services/navigation-item.d.ts +10 -0
- package/dist/app/services/navigation-item.d.ts.map +1 -0
- package/dist/app/services/navigation-item.js +20 -0
- package/dist/app/services/navigation-item.types.d.ts +8 -0
- package/dist/app/services/navigation-item.types.d.ts.map +1 -1
- package/dist/app/services/prism-layout.service.d.ts +12 -0
- package/dist/app/services/prism-layout.service.d.ts.map +1 -1
- package/dist/app/services/prism-layout.service.js +17 -7
- package/dist/app/services/prism-manifest.service.d.ts +4 -0
- package/dist/app/services/prism-manifest.service.d.ts.map +1 -1
- package/dist/app/services/prism-manifest.service.js +4 -0
- package/dist/app/services/prism-navigation.service.d.ts +12 -0
- package/dist/app/services/prism-navigation.service.d.ts.map +1 -1
- package/dist/app/services/prism-navigation.service.js +85 -19
- package/dist/app/services/prism-panel.service.d.ts +7 -3
- package/dist/app/services/prism-panel.service.d.ts.map +1 -1
- package/dist/app/services/prism-panel.service.js +13 -4
- package/dist/app/services/prism-pseudo-state.service.d.ts +59 -14
- package/dist/app/services/prism-pseudo-state.service.d.ts.map +1 -1
- package/dist/app/services/prism-pseudo-state.service.js +86 -29
- package/dist/app/services/prism-renderer.service.d.ts +23 -0
- package/dist/app/services/prism-renderer.service.d.ts.map +1 -1
- package/dist/app/services/prism-renderer.service.js +77 -8
- package/dist/app/services/prism-search.service.d.ts +4 -0
- package/dist/app/services/prism-search.service.d.ts.map +1 -1
- package/dist/app/services/prism-search.service.js +29 -6
- package/dist/app/services/prism-theme.service.d.ts +11 -3
- package/dist/app/services/prism-theme.service.d.ts.map +1 -1
- package/dist/app/services/prism-theme.service.js +27 -19
- package/dist/app/services/prism-url-state.service.d.ts.map +1 -1
- package/dist/app/services/prism-url-state.service.js +81 -12
- package/dist/app/shared/badge.types.d.ts +7 -0
- package/dist/app/shared/badge.types.d.ts.map +1 -0
- package/dist/app/shared/badge.types.js +9 -0
- package/dist/app/shared/brand-mark.d.ts +35 -0
- package/dist/app/shared/brand-mark.d.ts.map +1 -0
- package/dist/app/shared/brand-mark.js +52 -0
- package/dist/app/shared/metric-bar.d.ts +6 -0
- package/dist/app/shared/metric-bar.d.ts.map +1 -0
- package/dist/app/shared/metric-bar.js +7 -0
- package/dist/app/shared/prism-badge.component.d.ts +21 -0
- package/dist/app/shared/prism-badge.component.d.ts.map +1 -0
- package/dist/app/shared/prism-badge.component.js +68 -0
- package/dist/app/shared/prism-button.component.d.ts +12 -0
- package/dist/app/shared/prism-button.component.d.ts.map +1 -0
- package/dist/app/shared/prism-button.component.js +28 -0
- package/dist/app/shared/prism-icon-button.component.d.ts +17 -0
- package/dist/app/shared/prism-icon-button.component.d.ts.map +1 -0
- package/dist/app/shared/prism-icon-button.component.js +37 -0
- package/dist/app/shared/prism-list-row.component.d.ts +17 -0
- package/dist/app/shared/prism-list-row.component.d.ts.map +1 -0
- package/dist/app/shared/prism-list-row.component.js +57 -0
- package/dist/app/shared/prism-logo.component.d.ts +24 -0
- package/dist/app/shared/prism-logo.component.d.ts.map +1 -0
- package/dist/app/shared/prism-logo.component.js +77 -0
- package/dist/app/shared/prism-metric-badge.component.d.ts +9 -4
- package/dist/app/shared/prism-metric-badge.component.d.ts.map +1 -1
- package/dist/app/shared/prism-metric-badge.component.js +33 -12
- package/dist/app/shared/prism-metric-card.component.d.ts +30 -0
- package/dist/app/shared/prism-metric-card.component.d.ts.map +1 -0
- package/dist/app/shared/prism-metric-card.component.js +111 -0
- package/dist/app/shared/prism-panel-toolbar.component.d.ts +13 -0
- package/dist/app/shared/prism-panel-toolbar.component.d.ts.map +1 -0
- package/dist/app/shared/prism-panel-toolbar.component.js +28 -0
- package/dist/app/shared/prism-segmented.component.d.ts +25 -0
- package/dist/app/shared/prism-segmented.component.d.ts.map +1 -0
- package/dist/app/shared/prism-segmented.component.js +77 -0
- package/dist/app/shared/prism-tabs.component.d.ts +44 -0
- package/dist/app/shared/prism-tabs.component.d.ts.map +1 -0
- package/dist/app/shared/prism-tabs.component.js +134 -0
- package/dist/app/shared/roving-focus.d.ts +13 -0
- package/dist/app/shared/roving-focus.d.ts.map +1 -0
- package/dist/app/shared/roving-focus.js +34 -0
- package/dist/app/shell/prism-shell.component.d.ts +13 -0
- package/dist/app/shell/prism-shell.component.d.ts.map +1 -1
- package/dist/app/shell/prism-shell.component.js +57 -28
- package/dist/app/shell/should-select-first.d.ts +17 -0
- package/dist/app/shell/should-select-first.d.ts.map +1 -0
- package/dist/app/shell/should-select-first.js +13 -0
- package/dist/app/sidebar/navigation-decorations.d.ts +23 -1
- package/dist/app/sidebar/navigation-decorations.d.ts.map +1 -1
- package/dist/app/sidebar/navigation-decorations.js +33 -2
- package/dist/app/sidebar/prism-sidebar.component.d.ts +5 -15
- package/dist/app/sidebar/prism-sidebar.component.d.ts.map +1 -1
- package/dist/app/sidebar/prism-sidebar.component.js +89 -77
- package/dist/app/theme/deprecated-tokens.d.ts +15 -0
- package/dist/app/theme/deprecated-tokens.d.ts.map +1 -0
- package/dist/app/theme/deprecated-tokens.js +22 -0
- package/dist/app/theme/favicon.d.ts +3 -0
- package/dist/app/theme/favicon.d.ts.map +1 -0
- package/dist/app/theme/favicon.js +3 -0
- package/dist/app/theme/prism-default-theme.d.ts.map +1 -1
- package/dist/app/theme/prism-default-theme.js +122 -66
- package/dist/app/theme/resolve-theme-tokens.d.ts +29 -0
- package/dist/app/theme/resolve-theme-tokens.d.ts.map +1 -0
- package/dist/app/theme/resolve-theme-tokens.js +43 -0
- package/dist/app/variant-ribbon/prism-variant-ribbon.component.d.ts +4 -7
- package/dist/app/variant-ribbon/prism-variant-ribbon.component.d.ts.map +1 -1
- package/dist/app/variant-ribbon/prism-variant-ribbon.component.js +31 -69
- package/dist/app/view-tab-bar/next-view-id.d.ts +7 -1
- package/dist/app/view-tab-bar/next-view-id.d.ts.map +1 -1
- package/dist/app/view-tab-bar/next-view-id.js +9 -1
- package/dist/app/view-tab-bar/panel-inputs.d.ts +28 -0
- package/dist/app/view-tab-bar/panel-inputs.d.ts.map +1 -0
- package/dist/app/view-tab-bar/panel-inputs.js +41 -0
- package/dist/app/view-tab-bar/prism-view-panel-host.component.d.ts +2 -3
- package/dist/app/view-tab-bar/prism-view-panel-host.component.d.ts.map +1 -1
- package/dist/app/view-tab-bar/prism-view-panel-host.component.js +9 -9
- package/dist/app/view-tab-bar/prism-view-tab-bar.component.d.ts +6 -0
- package/dist/app/view-tab-bar/prism-view-tab-bar.component.d.ts.map +1 -1
- package/dist/app/view-tab-bar/prism-view-tab-bar.component.js +22 -29
- package/dist/builder/config-loader/deprecated-options.d.ts +9 -0
- package/dist/builder/config-loader/deprecated-options.d.ts.map +1 -0
- package/dist/builder/config-loader/deprecated-options.js +34 -0
- package/dist/builder/manifest/composition-wrapper.generator.d.ts +14 -0
- package/dist/builder/manifest/composition-wrapper.generator.d.ts.map +1 -0
- package/dist/builder/manifest/composition-wrapper.generator.js +66 -0
- package/dist/builder/manifest/host-parser.d.ts +2 -0
- package/dist/builder/manifest/host-parser.d.ts.map +1 -1
- package/dist/builder/manifest/host-parser.js +9 -4
- package/dist/builder/manifest/manifest-imports.d.ts +34 -0
- package/dist/builder/manifest/manifest-imports.d.ts.map +1 -0
- package/dist/builder/manifest/manifest-imports.js +91 -0
- package/dist/builder/manifest/runtime-manifest.generator.d.ts +13 -0
- package/dist/builder/manifest/runtime-manifest.generator.d.ts.map +1 -1
- package/dist/builder/manifest/runtime-manifest.generator.js +137 -65
- package/dist/builder/manifest/selector-element.d.ts +16 -0
- package/dist/builder/manifest/selector-element.d.ts.map +1 -0
- package/dist/builder/manifest/selector-element.js +46 -0
- package/dist/builder/manifest/template-literal.d.ts +3 -0
- package/dist/builder/manifest/template-literal.d.ts.map +1 -0
- package/dist/builder/manifest/template-literal.js +4 -0
- package/dist/builder/plugin-runner/plugin-runner.d.ts.map +1 -1
- package/dist/builder/plugin-runner/plugin-runner.js +29 -26
- package/dist/builder/scanner/api/angular-decorators.d.ts +84 -0
- package/dist/builder/scanner/api/angular-decorators.d.ts.map +1 -0
- package/dist/builder/scanner/api/angular-decorators.js +157 -0
- package/dist/builder/scanner/api/component-api.extractor.d.ts +13 -0
- package/dist/builder/scanner/api/component-api.extractor.d.ts.map +1 -0
- package/dist/builder/scanner/api/component-api.extractor.js +104 -0
- package/dist/builder/scanner/api/doc-tags.d.ts +13 -0
- package/dist/builder/scanner/api/doc-tags.d.ts.map +1 -0
- package/dist/builder/scanner/api/doc-tags.js +101 -0
- package/dist/builder/scanner/api/export-index.d.ts +18 -0
- package/dist/builder/scanner/api/export-index.d.ts.map +1 -0
- package/dist/builder/scanner/api/export-index.js +22 -0
- package/dist/builder/scanner/api/member.extractor.d.ts +90 -0
- package/dist/builder/scanner/api/member.extractor.d.ts.map +1 -0
- package/dist/builder/scanner/api/member.extractor.js +270 -0
- package/dist/builder/scanner/api/pipe-api.extractor.d.ts +12 -0
- package/dist/builder/scanner/api/pipe-api.extractor.d.ts.map +1 -0
- package/dist/builder/scanner/api/pipe-api.extractor.js +52 -0
- package/dist/builder/scanner/api/service-api.extractor.d.ts +14 -0
- package/dist/builder/scanner/api/service-api.extractor.d.ts.map +1 -0
- package/dist/builder/scanner/api/service-api.extractor.js +119 -0
- package/dist/builder/scanner/api/setup.reader.d.ts +26 -0
- package/dist/builder/scanner/api/setup.reader.d.ts.map +1 -0
- package/dist/builder/scanner/api/setup.reader.js +89 -0
- package/dist/builder/scanner/api/type-collector.d.ts +24 -0
- package/dist/builder/scanner/api/type-collector.d.ts.map +1 -0
- package/dist/builder/scanner/api/type-collector.js +211 -0
- package/dist/builder/scanner/ast-utils.d.ts +8 -0
- package/dist/builder/scanner/ast-utils.d.ts.map +1 -1
- package/dist/builder/scanner/ast-utils.js +37 -1
- package/dist/builder/scanner/class-hierarchy.d.ts +5 -3
- package/dist/builder/scanner/class-hierarchy.d.ts.map +1 -1
- package/dist/builder/scanner/class-hierarchy.js +12 -6
- package/dist/builder/scanner/component.scanner.d.ts +60 -6
- package/dist/builder/scanner/component.scanner.d.ts.map +1 -1
- package/dist/builder/scanner/component.scanner.js +229 -58
- package/dist/builder/scanner/composition/compose-template.d.ts +36 -0
- package/dist/builder/scanner/composition/compose-template.d.ts.map +1 -0
- package/dist/builder/scanner/composition/compose-template.js +187 -0
- package/dist/builder/scanner/composition/declarables.d.ts +54 -0
- package/dist/builder/scanner/composition/declarables.d.ts.map +1 -0
- package/dist/builder/scanner/composition/declarables.js +182 -0
- package/dist/builder/scanner/composition/match-declarables.d.ts +43 -0
- package/dist/builder/scanner/composition/match-declarables.d.ts.map +1 -0
- package/dist/builder/scanner/composition/match-declarables.js +131 -0
- package/dist/builder/scanner/composition/read-composition.d.ts +77 -0
- package/dist/builder/scanner/composition/read-composition.d.ts.map +1 -0
- package/dist/builder/scanner/composition/read-composition.js +302 -0
- package/dist/builder/scanner/composition/template-elements.d.ts +12 -0
- package/dist/builder/scanner/composition/template-elements.d.ts.map +1 -0
- package/dist/builder/scanner/composition/template-elements.js +41 -0
- package/dist/builder/scanner/entry-point-discovery.d.ts +5 -0
- package/dist/builder/scanner/entry-point-discovery.d.ts.map +1 -1
- package/dist/builder/scanner/entry-point-discovery.js +14 -0
- package/dist/builder/scanner/entry-point.scanner.d.ts +3 -1
- package/dist/builder/scanner/entry-point.scanner.d.ts.map +1 -1
- package/dist/builder/scanner/entry-point.scanner.js +7 -6
- package/dist/builder/scanner/index.d.ts +4 -0
- package/dist/builder/scanner/index.d.ts.map +1 -1
- package/dist/builder/scanner/index.js +2 -0
- package/dist/builder/scanner/input.extractor.d.ts +31 -2
- package/dist/builder/scanner/input.extractor.d.ts.map +1 -1
- package/dist/builder/scanner/input.extractor.js +73 -17
- package/dist/builder/scanner/pipe.scanner.d.ts +29 -0
- package/dist/builder/scanner/pipe.scanner.d.ts.map +1 -0
- package/dist/builder/scanner/pipe.scanner.js +65 -0
- package/dist/builder/scanner/pseudo-states.d.ts +1 -0
- package/dist/builder/scanner/pseudo-states.d.ts.map +1 -1
- package/dist/builder/scanner/pseudo-states.js +1 -1
- package/dist/builder/scanner/scanner.d.ts +27 -3
- package/dist/builder/scanner/scanner.d.ts.map +1 -1
- package/dist/builder/scanner/scanner.js +68 -24
- package/dist/builder/scanner/service/angular-decorators.d.ts +80 -0
- package/dist/builder/scanner/service/angular-decorators.d.ts.map +1 -0
- package/dist/builder/scanner/service/angular-decorators.js +154 -0
- package/dist/builder/scanner/service/doc-tags.d.ts +13 -0
- package/dist/builder/scanner/service/doc-tags.d.ts.map +1 -0
- package/dist/builder/scanner/service/doc-tags.js +97 -0
- package/dist/builder/scanner/service/export-index.d.ts +18 -0
- package/dist/builder/scanner/service/export-index.d.ts.map +1 -0
- package/dist/builder/scanner/service/export-index.js +22 -0
- package/dist/builder/scanner/service/member.extractor.d.ts +65 -0
- package/dist/builder/scanner/service/member.extractor.d.ts.map +1 -0
- package/dist/builder/scanner/service/member.extractor.js +216 -0
- package/dist/builder/scanner/service/pipe-api.extractor.d.ts +12 -0
- package/dist/builder/scanner/service/pipe-api.extractor.d.ts.map +1 -0
- package/dist/builder/scanner/service/pipe-api.extractor.js +72 -0
- package/dist/builder/scanner/service/service-api.extractor.d.ts +14 -0
- package/dist/builder/scanner/service/service-api.extractor.d.ts.map +1 -0
- package/dist/builder/scanner/service/service-api.extractor.js +119 -0
- package/dist/builder/scanner/service/setup.reader.d.ts +26 -0
- package/dist/builder/scanner/service/setup.reader.d.ts.map +1 -0
- package/dist/builder/scanner/service/setup.reader.js +89 -0
- package/dist/builder/scanner/service/type-collector.d.ts +23 -0
- package/dist/builder/scanner/service/type-collector.d.ts.map +1 -0
- package/dist/builder/scanner/service/type-collector.js +210 -0
- package/dist/builder/scanner/service.scanner.d.ts +26 -0
- package/dist/builder/scanner/service.scanner.d.ts.map +1 -0
- package/dist/builder/scanner/service.scanner.js +61 -0
- package/dist/builder/scanner/showcase-diagnostics.d.ts +60 -1
- package/dist/builder/scanner/showcase-diagnostics.d.ts.map +1 -1
- package/dist/builder/scanner/showcase-diagnostics.js +123 -10
- package/dist/builder/scanner/showcase-states.d.ts +17 -0
- package/dist/builder/scanner/showcase-states.d.ts.map +1 -0
- package/dist/builder/scanner/showcase-states.js +58 -0
- package/dist/builder/scanner/source-file-cache.d.ts +26 -0
- package/dist/builder/scanner/source-file-cache.d.ts.map +1 -0
- package/dist/builder/scanner/source-file-cache.js +60 -0
- package/dist/builder/shared/prism-pipeline.d.ts +6 -0
- package/dist/builder/shared/prism-pipeline.d.ts.map +1 -1
- package/dist/builder/shared/prism-pipeline.js +71 -18
- package/dist/decorator/index.d.ts +1 -1
- package/dist/decorator/index.d.ts.map +1 -1
- package/dist/decorator/showcase.types.d.ts +102 -9
- package/dist/decorator/showcase.types.d.ts.map +1 -1
- package/dist/plugin/index.d.ts +6 -1
- package/dist/plugin/index.d.ts.map +1 -1
- package/dist/plugin/index.js +4 -0
- package/dist/plugin/pipe.types.d.ts +36 -0
- package/dist/plugin/pipe.types.d.ts.map +1 -0
- package/dist/plugin/pipe.types.js +1 -0
- package/dist/plugin/plugin.types.d.ts +184 -8
- package/dist/plugin/plugin.types.d.ts.map +1 -1
- package/dist/plugin/service.types.d.ts +124 -0
- package/dist/plugin/service.types.d.ts.map +1 -0
- package/dist/plugin/service.types.js +1 -0
- package/dist/plugin/status.d.ts +27 -0
- package/dist/plugin/status.d.ts.map +1 -0
- package/dist/plugin/status.js +26 -0
- package/dist/shared/composition.d.ts +30 -0
- package/dist/shared/composition.d.ts.map +1 -0
- package/dist/shared/composition.js +29 -0
- package/dist/shared/pseudo-state.type.d.ts +2 -1
- package/dist/shared/pseudo-state.type.d.ts.map +1 -1
- package/dist/shared/void-elements.d.ts +3 -0
- package/dist/shared/void-elements.d.ts.map +1 -0
- package/dist/shared/void-elements.js +2 -0
- package/package.json +1 -1
- package/src/builder/build/schema.json +6 -6
- package/src/builder/serve/schema.json +6 -6
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NgComponentOutlet } from '@angular/common';
|
|
2
|
-
import { ChangeDetectionStrategy, Component, computed, DestroyRef, effect, ElementRef, inject, Injector, signal, untracked, viewChild, ViewContainerRef } from '@angular/core';
|
|
3
|
-
import {
|
|
2
|
+
import { ChangeDetectionStrategy, Component, computed, DestroyRef, effect, ElementRef, inject, Injector, reflectComponentType, signal, untracked, viewChild, ViewContainerRef } from '@angular/core';
|
|
3
|
+
import { PRISM_VARIANT_INPUT } from '../../shared/composition.js';
|
|
4
4
|
import { VIEWPORT_MAX, VIEWPORT_MIN } from '../../shared/viewport.type.js';
|
|
5
5
|
import { CANVAS_BG_STYLES } from '../canvas/canvas-bg.styles.js';
|
|
6
6
|
import { PrismCanvasBgPillComponent } from '../canvas/prism-canvas-bg-pill.component.js';
|
|
@@ -9,6 +9,7 @@ import { PrismCanvasRulersComponent } from '../canvas/prism-canvas-rulers.compon
|
|
|
9
9
|
import { snapViewportWidth } from '../canvas/viewport-snap.js';
|
|
10
10
|
import { PrismResizerDirective } from '../directives/prism-resizer.directive.js';
|
|
11
11
|
import { BUILTIN_PANELS } from '../panels/builtin-panels.js';
|
|
12
|
+
import { appliedStateNames } from '../pseudo/pseudo-state-marker.js';
|
|
12
13
|
import { PrismCanvasService } from '../services/prism-canvas.service.js';
|
|
13
14
|
import { PrismCaptureService } from '../services/prism-capture.service.js';
|
|
14
15
|
import { PrismEventLogService } from '../services/prism-event-log.service.js';
|
|
@@ -20,10 +21,11 @@ import { PrismPseudoStateService } from '../services/prism-pseudo-state.service.
|
|
|
20
21
|
import { PrismRendererService } from '../services/prism-renderer.service.js';
|
|
21
22
|
import { PrismVariantBgService } from '../services/prism-variant-bg.service.js';
|
|
22
23
|
import { PRISM_RENDERER_HOOKS } from '../tokens/prism-tokens.js';
|
|
23
|
-
import {
|
|
24
|
+
import { activeCase, renderSignature, renderTypeFor, sameRender } from './composition.js';
|
|
25
|
+
import { buildInputBindings, unboundInputs } from './input-bindings.js';
|
|
24
26
|
import { resolveOverlay } from './overlay-resolver.js';
|
|
25
27
|
import { parseContentToNodes } from './projectable-content.js';
|
|
26
|
-
import { resolveRenderedKey } from './rendered-key.js';
|
|
28
|
+
import { resolveExcludedReason, resolveRenderedKey } from './rendered-key.js';
|
|
27
29
|
import * as i0 from "@angular/core";
|
|
28
30
|
const _c0 = ["outlet"];
|
|
29
31
|
function PrismRendererComponent_Conditional_1_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
@@ -128,30 +130,44 @@ export class PrismRendererComponent {
|
|
|
128
130
|
outlet = viewChild.required('outlet', { ...(ngDevMode ? { debugName: "outlet" } : /* istanbul ignore next */ {}), read: ViewContainerRef });
|
|
129
131
|
componentRef = null;
|
|
130
132
|
outputSubscriptions = [];
|
|
131
|
-
|
|
133
|
+
/** What the instance on the canvas renders, `null` without one: a variant switch to another render creates a new instance. */
|
|
134
|
+
lastRender = null;
|
|
132
135
|
isRenderPage = false;
|
|
133
136
|
overlayCache = new Map();
|
|
134
137
|
activeOverlay = signal(null, /* @ts-ignore */
|
|
135
138
|
...(ngDevMode ? [{ debugName: "activeOverlay" }] : /* istanbul ignore next */ []));
|
|
136
139
|
/**
|
|
137
|
-
* Identifier of the currently rendered component/variant
|
|
138
|
-
* Held back until the
|
|
140
|
+
* Identifier of the currently rendered component/variant, and of the active state.
|
|
141
|
+
* Held back until the forced pseudo states and the state are in place, see {@link resolveRenderedKey}.
|
|
139
142
|
*/
|
|
140
|
-
renderedKey = computed(() =>
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
143
|
+
renderedKey = computed(() => {
|
|
144
|
+
const { base, state } = this.pseudoState.layers();
|
|
145
|
+
return resolveRenderedKey({
|
|
146
|
+
component: this.navigationService.activeComponent(),
|
|
147
|
+
variantIndex: this.rendererService.activeVariantIndex(),
|
|
148
|
+
stateIndex: this.rendererService.activeStateIndex(),
|
|
149
|
+
element: this.rendererService.renderedElement(),
|
|
150
|
+
pseudo: base,
|
|
151
|
+
state,
|
|
152
|
+
pseudoApplied: this.pseudoMarker.applied()
|
|
153
|
+
});
|
|
154
|
+
}, /* @ts-ignore */
|
|
147
155
|
...(ngDevMode ? [{ debugName: "renderedKey" }] : /* istanbul ignore next */ []));
|
|
156
|
+
/**
|
|
157
|
+
* Why the active state is not part of what the canvas shows, `null` when it is
|
|
158
|
+
* or none is active. A runner reads it next to `data-prism-rendered` and
|
|
159
|
+
* reports the cell as excluded rather than taking a picture of it.
|
|
160
|
+
*/
|
|
161
|
+
excludedReason = computed(() => resolveExcludedReason(this.rendererService.activeStateIndex(), this.pseudoState.stateExclusion(), this.pseudoMarker.applied()), /* @ts-ignore */
|
|
162
|
+
...(ngDevMode ? [{ debugName: "excludedReason" }] : /* istanbul ignore next */ []));
|
|
148
163
|
/**
|
|
149
164
|
* The states forced on the canvas, space-separated, `null` for none. Capture
|
|
150
|
-
* mode keys the room it leaves for focus rings on it.
|
|
165
|
+
* mode keys the room it leaves for focus rings on it. The active state's
|
|
166
|
+
* pseudo-classes count only while it fits.
|
|
151
167
|
*/
|
|
152
168
|
forcedStates = computed(() => {
|
|
153
|
-
const
|
|
154
|
-
return
|
|
169
|
+
const names = appliedStateNames(this.pseudoMarker.applied());
|
|
170
|
+
return names.length > 0 ? names.join(' ') : null;
|
|
155
171
|
}, /* @ts-ignore */
|
|
156
172
|
...(ngDevMode ? [{ debugName: "forcedStates" }] : /* istanbul ignore next */ []));
|
|
157
173
|
/** Resolved canvas layout for the active variant. Variant overrides component config; defaults to 'fit'. */
|
|
@@ -183,6 +199,7 @@ export class PrismRendererComponent {
|
|
|
183
199
|
effect(() => {
|
|
184
200
|
const inputs = this.rendererService.inputValues();
|
|
185
201
|
const content = this.rendererService.activeContent();
|
|
202
|
+
const variantIndex = this.rendererService.activeVariantIndex();
|
|
186
203
|
const ref = this.componentRef;
|
|
187
204
|
if (!ref)
|
|
188
205
|
return;
|
|
@@ -193,19 +210,12 @@ export class PrismRendererComponent {
|
|
|
193
210
|
const comp = untracked(() => this.navigationService.activeComponent());
|
|
194
211
|
if (!comp)
|
|
195
212
|
return;
|
|
196
|
-
if (
|
|
213
|
+
if (!sameRender(this.lastRender, renderSignature(comp, variantIndex, content))) {
|
|
197
214
|
untracked(() => this.createComponent(comp));
|
|
198
215
|
return;
|
|
199
216
|
}
|
|
200
217
|
performance.mark('prism:rerender:start');
|
|
201
|
-
|
|
202
|
-
for (const [key, value] of Object.entries(inputs)) {
|
|
203
|
-
if (!knownInputs.has(key)) {
|
|
204
|
-
console.warn(`[ng-prism] Unknown input "${key}" on <${comp.meta.componentMeta.selector}>, skipping. Remove it from @Showcase variants.`);
|
|
205
|
-
continue;
|
|
206
|
-
}
|
|
207
|
-
ref.setInput(key, value);
|
|
208
|
-
}
|
|
218
|
+
this.setInputs(ref, comp, variantIndex, inputs);
|
|
209
219
|
ref.changeDetectorRef.detectChanges();
|
|
210
220
|
performance.mark('prism:rerender:end');
|
|
211
221
|
performance.measure('prism:rerender', 'prism:rerender:start', 'prism:rerender:end');
|
|
@@ -236,8 +246,13 @@ export class PrismRendererComponent {
|
|
|
236
246
|
// `renderedKey` waits for what this applies.
|
|
237
247
|
effect(() => {
|
|
238
248
|
const element = this.rendererService.renderedElement();
|
|
239
|
-
const
|
|
240
|
-
untracked(() => this.pseudoMarker.apply(element,
|
|
249
|
+
const { base, state } = this.pseudoState.layers();
|
|
250
|
+
untracked(() => this.pseudoMarker.apply(element, base, state));
|
|
251
|
+
});
|
|
252
|
+
// What the layers and the toggles of the tools menu depend on. Written from the marker alone and never
|
|
253
|
+
// read back here: `null` whenever no state layer is applied, so the fit of the previous state cannot linger.
|
|
254
|
+
effect(() => {
|
|
255
|
+
this.pseudoState.canvasFit.set(this.pseudoMarker.applied()?.fit ?? null);
|
|
241
256
|
});
|
|
242
257
|
this.destroyRef.onDestroy(() => {
|
|
243
258
|
this.cleanup();
|
|
@@ -273,9 +288,15 @@ export class PrismRendererComponent {
|
|
|
273
288
|
parent: this.injector
|
|
274
289
|
});
|
|
275
290
|
const content = this.rendererService.activeContent();
|
|
276
|
-
|
|
277
|
-
const
|
|
278
|
-
|
|
291
|
+
const variantIndex = this.rendererService.activeVariantIndex();
|
|
292
|
+
const composed = activeCase(comp, variantIndex) !== null;
|
|
293
|
+
const type = renderTypeFor(comp, variantIndex);
|
|
294
|
+
this.lastRender = renderSignature(comp, variantIndex, content);
|
|
295
|
+
// A composed variant has its content in the template of its case.
|
|
296
|
+
const projectableNodes = content && !composed
|
|
297
|
+
? parseContentToNodes(content, reflectComponentType(type)?.ngContentSelectors ?? [], (key) => console.warn(`[ng-prism] Variant content "${key}" matches no <ng-content> of ${comp.meta.className}, skipping it.`))
|
|
298
|
+
: undefined;
|
|
299
|
+
this.componentRef = this.outlet().createComponent(type, {
|
|
279
300
|
injector,
|
|
280
301
|
projectableNodes
|
|
281
302
|
});
|
|
@@ -286,20 +307,33 @@ export class PrismRendererComponent {
|
|
|
286
307
|
this.outputSubscriptions.push(sub);
|
|
287
308
|
}
|
|
288
309
|
}
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
console.warn(`[ng-prism] Unknown input "${key}" on <${selector}>, skipping. Remove it from @Showcase variants.`);
|
|
293
|
-
continue;
|
|
294
|
-
}
|
|
295
|
-
this.componentRef.setInput(key, value);
|
|
296
|
-
}
|
|
310
|
+
if (composed)
|
|
311
|
+
this.componentRef.setInput(PRISM_VARIANT_INPUT, variantIndex);
|
|
312
|
+
this.setInputs(this.componentRef, comp, variantIndex, this.rendererService.inputValues());
|
|
297
313
|
this.componentRef.changeDetectorRef.detectChanges();
|
|
298
314
|
performance.mark('prism:render:end', detail);
|
|
299
315
|
performance.measure('prism:render', 'prism:render:start', 'prism:render:end');
|
|
300
316
|
this.rendererService.renderedElement.set(this.componentRef.location.nativeElement);
|
|
301
317
|
this.rendererHooks?.onAfterCreate?.(selector);
|
|
302
318
|
}
|
|
319
|
+
/**
|
|
320
|
+
* Sets `values` on the instance by the bindings of the variant. A key that
|
|
321
|
+
* names no input gets a warning, an input the composition of the variant
|
|
322
|
+
* leaves unbound is skipped without one.
|
|
323
|
+
*/
|
|
324
|
+
setInputs(ref, comp, variantIndex, values) {
|
|
325
|
+
const bindings = buildInputBindings(comp, variantIndex);
|
|
326
|
+
const unbound = unboundInputs(comp, variantIndex);
|
|
327
|
+
for (const [key, value] of Object.entries(values)) {
|
|
328
|
+
const binding = bindings.get(key);
|
|
329
|
+
if (binding !== undefined) {
|
|
330
|
+
ref.setInput(binding, value);
|
|
331
|
+
}
|
|
332
|
+
else if (!unbound.has(key)) {
|
|
333
|
+
console.warn(`[ng-prism] Unknown input "${key}" on <${comp.meta.componentMeta.selector}>, skipping. Remove it from @Showcase variants.`);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
}
|
|
303
337
|
cleanup() {
|
|
304
338
|
const hadComponent = this.componentRef !== null;
|
|
305
339
|
this.rendererService.renderedElement.set(null);
|
|
@@ -309,7 +343,7 @@ export class PrismRendererComponent {
|
|
|
309
343
|
this.outputSubscriptions = [];
|
|
310
344
|
this.outlet().clear();
|
|
311
345
|
this.componentRef = null;
|
|
312
|
-
this.
|
|
346
|
+
this.lastRender = null;
|
|
313
347
|
if (hadComponent) {
|
|
314
348
|
this.rendererHooks?.onAfterDestroy?.('');
|
|
315
349
|
}
|
|
@@ -319,7 +353,7 @@ export class PrismRendererComponent {
|
|
|
319
353
|
i0.ɵɵviewQuerySignal(ctx.outlet, _c0, 5, ViewContainerRef);
|
|
320
354
|
} if (rf & 2) {
|
|
321
355
|
i0.ɵɵqueryAdvance();
|
|
322
|
-
} }, decls: 6, vars:
|
|
356
|
+
} }, decls: 6, vars: 16, consts: [["outlet", ""], [1, "prism-canvas-stage"], [1, "demo-wrap"], [1, "stage-crosshair"], [1, "vp-dim"], [1, "vp-dim__rule"], [1, "vp-dim__v"], ["prismResizer", "", "axis", "x", "aria-label", "Viewport width, left edge", 1, "vp-grip", 3, "valueChange", "scale", "min", "max", "value"], [1, "vp-grip__bar"], ["prismResizer", "", "axis", "x", "aria-label", "Viewport width, right edge", 1, "vp-grip", "vp-grip--end", 3, "valueChange", "scale", "min", "max", "value"], [4, "ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector"]], template: function PrismRendererComponent_Template(rf, ctx) { if (rf & 1) {
|
|
323
357
|
i0.ɵɵelementStart(0, "div", 1);
|
|
324
358
|
i0.ɵɵconditionalCreate(1, PrismRendererComponent_Conditional_1_Template, 5, 4);
|
|
325
359
|
i0.ɵɵelementStart(2, "div", 2);
|
|
@@ -333,15 +367,15 @@ export class PrismRendererComponent {
|
|
|
333
367
|
i0.ɵɵconditional(!ctx.capture.active() ? 1 : -1);
|
|
334
368
|
i0.ɵɵadvance();
|
|
335
369
|
i0.ɵɵstyleProp("--%NS%zoom", ctx.canvasService.zoom());
|
|
336
|
-
i0.ɵɵattribute("data-prism-rendered", ctx.renderedKey())("data-canvas-layout", ctx.canvasLayout())("data-viewport", ctx.viewportWidth() !== null ? "" : null)("data-pseudo", ctx.forcedStates());
|
|
370
|
+
i0.ɵɵattribute("data-prism-rendered", ctx.renderedKey())("data-prism-excluded", ctx.excludedReason())("data-canvas-layout", ctx.canvasLayout())("data-viewport", ctx.viewportWidth() !== null ? "" : null)("data-pseudo", ctx.forcedStates());
|
|
337
371
|
i0.ɵɵadvance(3);
|
|
338
372
|
i0.ɵɵconditional(ctx.activeOverlay() ? 5 : -1);
|
|
339
373
|
} }, dependencies: [PrismCanvasRulersComponent, PrismCanvasBgPillComponent, PrismCanvasMeasureComponent, NgComponentOutlet, PrismResizerDirective], styles: ["[_nghost-%COMP%] {\n display: block;\n flex: 1;\n min-height: 0;\n}\n\n.prism-canvas-stage[_ngcontent-%COMP%] {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n min-height: 200px;\n padding: 32px;\n overflow: auto;\n\n \n\n\n\n\n\n\n\n\n\n\n outline: 1px solid var(--%NS%prism-stage-edge);\n outline-offset: -1px;\n background-color: var(--%NS%prism-stage);\n box-shadow:\n 0 1px 3px rgb(0 0 0 / 10%),\n 0 8px 24px -12px rgb(0 0 0 / 18%);\n transition: filter var(--%NS%dur-base);\n\n --%NS%prism-canvas-overlay-top: 12px;\n --%NS%prism-canvas-overlay-inline: 20px;\n}\n\n.prism-canvas-stage[data-rulers][_ngcontent-%COMP%] {\n --%NS%prism-canvas-overlay-top: 28px;\n --%NS%prism-canvas-overlay-inline: 28px;\n}\n\n.stage-crosshair[_ngcontent-%COMP%] {\n position: absolute;\n inset: 0;\n pointer-events: none;\n opacity: 0;\n transition: opacity var(--%NS%dur-base);\n}\n\n.stage-crosshair.visible[_ngcontent-%COMP%] {\n opacity: 1;\n}\n\n.stage-crosshair[_ngcontent-%COMP%]::before, \n.stage-crosshair[_ngcontent-%COMP%]::after {\n position: absolute;\n content: '';\n background: color-mix(in srgb, var(--%NS%prism-primary) 20%, transparent);\n}\n\n.stage-crosshair[_ngcontent-%COMP%]::before {\n top: 50%;\n right: 0;\n left: 0;\n height: 1px;\n}\n\n.stage-crosshair[_ngcontent-%COMP%]::after {\n top: 0;\n bottom: 0;\n left: 50%;\n width: 1px;\n}\n\n.demo-wrap[_ngcontent-%COMP%] {\n position: relative;\n display: inline-block;\n transform: scale(var(--%NS%zoom, 1));\n transition: transform 0.18s;\n}\n\n.demo-wrap[data-canvas-layout='stretch'][_ngcontent-%COMP%] {\n display: block;\n width: 100%;\n max-width: 800px;\n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n.demo-wrap[data-viewport][_ngcontent-%COMP%] {\n display: grid;\n\n \n\n\n\n\n\n\n\n\n flex: none;\n\n \n\n\n\n\n\n\n justify-items: safe center;\n width: var(--%NS%prism-vp-w);\n max-width: none;\n container-type: inline-size;\n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n.vp-grip[_ngcontent-%COMP%] {\n position: absolute;\n top: var(--%NS%prism-canvas-overlay-top, 12px);\n bottom: 0;\n left: calc(50% - var(--%NS%prism-vp-w) * var(--%NS%zoom, 1) / 2 - 4.5px);\n z-index: 4;\n display: grid;\n width: 9px;\n\n \n\n\n\n\n\n pointer-events: none;\n background: transparent;\n}\n\n.vp-grip--end[_ngcontent-%COMP%] {\n right: calc(50% - var(--%NS%prism-vp-w) * var(--%NS%zoom, 1) / 2 - 4.5px);\n left: auto;\n}\n\n\n\n\n\n\n\n\n\n\n\n\n.vp-grip__bar[_ngcontent-%COMP%] {\n z-index: 1;\n box-sizing: content-box;\n grid-area: 1 / 1;\n place-self: center center;\n width: 3px;\n height: 34px;\n padding: 5px 3px;\n pointer-events: auto;\n background: color-mix(in srgb, var(--%NS%prism-measure) 80%, transparent);\n background-clip: content-box;\n border-radius: 2px;\n transition: background var(--%NS%dur-fast);\n}\n\n\n\n\n\n\n.vp-grip[_ngcontent-%COMP%]::after {\n grid-area: 1 / 1;\n place-self: stretch center;\n width: 1px;\n content: '';\n background: color-mix(in srgb, var(--%NS%prism-measure) 75%, transparent);\n transition: background var(--%NS%dur-fast);\n}\n\n.vp-grip[_ngcontent-%COMP%]:hover::after, \n.vp-grip.active[_ngcontent-%COMP%]::after, \n.vp-grip[_ngcontent-%COMP%]:focus-visible::after {\n background: color-mix(in srgb, var(--%NS%prism-measure) 55%, transparent);\n}\n\n.vp-grip[_ngcontent-%COMP%]:hover .vp-grip__bar[_ngcontent-%COMP%], \n.vp-grip.active[_ngcontent-%COMP%] .vp-grip__bar[_ngcontent-%COMP%], \n.vp-grip[_ngcontent-%COMP%]:focus-visible .vp-grip__bar[_ngcontent-%COMP%] {\n background: var(--%NS%prism-measure);\n background-clip: content-box;\n}\n\n\n\n\n.vp-grip[_ngcontent-%COMP%]:focus-visible {\n outline: none;\n}\n\n.vp-grip[_ngcontent-%COMP%]:focus-visible .vp-grip__bar[_ngcontent-%COMP%] {\n outline: 2px solid var(--%NS%prism-primary);\n outline-offset: 1px;\n}\n\n\n\n\n\n\n\n\n\n\n.vp-dim[_ngcontent-%COMP%] {\n position: absolute;\n top: var(--%NS%prism-canvas-overlay-top, 12px);\n left: 50%;\n z-index: 4;\n display: flex;\n gap: var(--%NS%sp-3);\n align-items: center;\n width: calc(var(--%NS%prism-vp-w) * var(--%NS%zoom, 1));\n pointer-events: none;\n transform: translateX(-50%);\n}\n\n\n\n\n.vp-dim__rule[_ngcontent-%COMP%] {\n position: relative;\n flex: 1;\n height: 1px;\n background: color-mix(in srgb, var(--%NS%prism-measure) 70%, transparent);\n}\n\n\n\n\n.vp-dim__rule[_ngcontent-%COMP%]::before {\n position: absolute;\n top: -3px;\n width: 1px;\n height: 7px;\n content: '';\n background: color-mix(in srgb, var(--%NS%prism-measure) 90%, transparent);\n}\n\n.vp-dim__rule[_ngcontent-%COMP%]:first-child::before {\n left: 0;\n}\n\n.vp-dim__rule[_ngcontent-%COMP%]:last-child::before {\n right: 0;\n}\n\n.vp-dim__v[_ngcontent-%COMP%] {\n flex: none;\n font-family: var(--%NS%font-mono);\n font-size: 9px;\n color: var(--%NS%prism-measure);\n white-space: nowrap;\n}", "[data-bg=\"dots\"][_ngcontent-%COMP%] {\n background-image: radial-gradient(circle, var(--%NS%prism-dot) 1px, transparent 1px);\n background-size: 20px 20px;\n }\n\n [data-bg=\"plain\"][_ngcontent-%COMP%] {\n background-image: none;\n }\n\n \n\n\n\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n [data-bg=\"light\"][_ngcontent-%COMP%] {\n background-color: var(--%NS%prism-void-light, #f7f5fc);\n background-image: none;\n --%NS%prism-measure: #ca00c1;\n --%NS%prism-measure-plate: var(--%NS%prism-void-light, #f7f5fc);\n }\n [data-bg=\"dark\"][_ngcontent-%COMP%] {\n background-color: var(--%NS%prism-void-dark, #07050f);\n background-image: none;\n --%NS%prism-measure: #f632ff;\n --%NS%prism-measure-plate: var(--%NS%prism-void-dark, #07050f);\n }\n\n \n\n\n [data-bg=\"checker\"][_ngcontent-%COMP%], \n [data-bg=\"transparent\"][_ngcontent-%COMP%] {\n background-image:\n linear-gradient(45deg, var(--%NS%prism-border) 25%, transparent 25%),\n linear-gradient(-45deg, var(--%NS%prism-border) 25%, transparent 25%),\n linear-gradient(45deg, transparent 75%, var(--%NS%prism-border) 75%),\n linear-gradient(-45deg, transparent 75%, var(--%NS%prism-border) 75%);\n background-size: 16px 16px;\n background-position: 0 0, 0 8px, 8px -8px, -8px 0;\n }"] });
|
|
340
374
|
}
|
|
341
375
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PrismRendererComponent, [{
|
|
342
376
|
type: Component,
|
|
343
|
-
args: [{ selector: 'prism-renderer', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [PrismCanvasRulersComponent, PrismCanvasBgPillComponent, PrismCanvasMeasureComponent, NgComponentOutlet, PrismResizerDirective], template: "<div\n class=\"prism-canvas-stage\"\n [attr.data-bg]=\"variantBg.effective()\"\n [attr.data-rulers]=\"canvasService.rulers() ? '' : null\"\n [attr.data-viewport]=\"viewportWidth() !== null ? '' : null\"\n [style.--prism-vp-w.px]=\"viewportWidth()\"\n [style.--zoom]=\"canvasService.zoom()\">\n @if (!capture.active()) {\n <div\n class=\"stage-crosshair\"\n [class.visible]=\"canvasService.guides()\"></div>\n <prism-canvas-rulers />\n @if (canvasService.measure()) {\n <prism-canvas-measure />\n }\n <prism-canvas-bg-pill />\n @if (viewportWidth() !== null) {\n <!-- Grips and the dimension line are siblings of .demo-wrap, never\n children of it: .demo-wrap is what plugin-visual-regression\n screenshots, and anything inside it composites into every baseline.\n They sit inside the capture guard for the same reason the rulers and\n the pill do. -->\n <span class=\"vp-dim\">\n <span class=\"vp-dim__rule\"></span>\n <span class=\"vp-dim__v\">{{ viewportWidth() }} px</span>\n <span class=\"vp-dim__rule\"></span>\n </span>\n <div\n class=\"vp-grip\"\n prismResizer\n axis=\"x\"\n [scale]=\"-2 / (canvasService.zoom() || 1)\"\n [min]=\"VIEWPORT_MIN\"\n [max]=\"VIEWPORT_MAX\"\n [value]=\"viewportWidth()!\"\n (valueChange)=\"onViewportResize($event)\"\n aria-label=\"Viewport width, left edge\"\n [attr.aria-valuenow]=\"viewportWidth()\"\n [attr.aria-valuemin]=\"VIEWPORT_MIN\"\n [attr.aria-valuemax]=\"VIEWPORT_MAX\">\n <span class=\"vp-grip__bar\"></span>\n </div>\n <div\n class=\"vp-grip vp-grip--end\"\n prismResizer\n axis=\"x\"\n [scale]=\"2 / (canvasService.zoom() || 1)\"\n [min]=\"VIEWPORT_MIN\"\n [max]=\"VIEWPORT_MAX\"\n [value]=\"viewportWidth()!\"\n (valueChange)=\"onViewportResize($event)\"\n aria-label=\"Viewport width, right edge\"\n [attr.aria-valuenow]=\"viewportWidth()\"\n [attr.aria-valuemin]=\"VIEWPORT_MIN\"\n [attr.aria-valuemax]=\"VIEWPORT_MAX\">\n <span class=\"vp-grip__bar\"></span>\n </div>\n }\n }\n\n <div\n class=\"demo-wrap\"\n [style.--zoom]=\"canvasService.zoom()\"\n [attr.data-prism-rendered]=\"renderedKey()\"\n [attr.data-canvas-layout]=\"canvasLayout()\"\n [attr.data-viewport]=\"viewportWidth() !== null ? '' : null\"\n [attr.data-pseudo]=\"forcedStates()\">\n <ng-container #outlet />\n @if (activeOverlay()) {\n <ng-container *ngComponentOutlet=\"activeOverlay()!; inputs: overlayInputs; injector: overlayInjector()\" />\n }\n </div>\n</div>\n", styles: [":host {\n display: block;\n flex: 1;\n min-height: 0;\n}\n\n.prism-canvas-stage {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n min-height: 200px;\n padding: 32px;\n overflow: auto;\n\n /* The edge is outline + shadow, never border and never extra padding.\n plugin-visual-regression screenshots .demo-wrap, which is centred in\n this element; a border would shrink the content box by 2px and move\n that centre, shifting all 15 baselines in test-workspace/vrt/baseline\n without a single component having changed. Capture mode resets this\n element's padding but not its border, and this repo has no VRT runner\n to catch the drift. outline and box-shadow do not participate in\n layout, so the box is provably unchanged. Keep it that way.\n They do still paint, and outline-offset is negative, so the line lands\n inside the box: CAPTURE_STYLES in prism-capture.service.ts sets both\n to none, which is only safe because neither affects layout here. */\n outline: 1px solid var(--prism-stage-edge);\n outline-offset: -1px;\n background-color: var(--prism-stage);\n box-shadow:\n 0 1px 3px rgb(0 0 0 / 10%),\n 0 8px 24px -12px rgb(0 0 0 / 18%);\n transition: filter var(--dur-base);\n\n --prism-canvas-overlay-top: 12px;\n --prism-canvas-overlay-inline: 20px;\n}\n\n.prism-canvas-stage[data-rulers] {\n --prism-canvas-overlay-top: 28px;\n --prism-canvas-overlay-inline: 28px;\n}\n\n.stage-crosshair {\n position: absolute;\n inset: 0;\n pointer-events: none;\n opacity: 0;\n transition: opacity var(--dur-base);\n}\n\n.stage-crosshair.visible {\n opacity: 1;\n}\n\n.stage-crosshair::before,\n.stage-crosshair::after {\n position: absolute;\n content: '';\n background: color-mix(in srgb, var(--prism-primary) 20%, transparent);\n}\n\n.stage-crosshair::before {\n top: 50%;\n right: 0;\n left: 0;\n height: 1px;\n}\n\n.stage-crosshair::after {\n top: 0;\n bottom: 0;\n left: 50%;\n width: 1px;\n}\n\n.demo-wrap {\n position: relative;\n display: inline-block;\n transform: scale(var(--zoom, 1));\n transition: transform 0.18s;\n}\n\n.demo-wrap[data-canvas-layout='stretch'] {\n display: block;\n width: 100%;\n max-width: 800px;\n}\n\n/* max-width: none rather than min(800px, var(--prism-vp-w)): an explicitly\n requested width beats a layout default, and min() would silently cap a\n 1024 viewport at 800 on any component declaring canvasLayout:\n 'stretch'.\n\n container-type must stay confined to this rule. It implies contain: inline-size, which on the width:auto\n inline-block .demo-wrap is at rest would decouple its width from its\n contents, collapsing the box and shifting every baseline in\n test-workspace/vrt/baseline without a component having changed. Here\n the width is explicit, so containment costs nothing and is what makes\n a component's own @container rules respond. Media queries do not and\n cannot: they read the real browser viewport.\n\n grid + justify-items: center, and not text-align: center, which is the\n obvious way to centre an inline-level child and the wrong one. The\n showcase component is created through ViewContainerRef, so its host\n element carries none of this component's _ngcontent attribute and no\n scoped rule here can reach it to undo an inherited value. text-align\n would therefore leak all the way into the specimen and silently\n re-align its own text the moment the viewport is switched on. That is a\n canvas that lies about what it is showing. Centring at the container\n instead touches nothing inside.\n\n Shrinking is not a side effect of that choice, it is the resting\n behaviour preserved: at rest .demo-wrap is an inline-block that\n already shrink-wraps its child, so a block-level specimen sizes to its\n content here the same as with the constraint off. The implicit\n auto column still fills the declared width, so a component that asks\n for width: 100% (the canvasLayout: 'stretch' case) keeps getting the\n whole viewport. */\n.demo-wrap[data-viewport] {\n display: grid;\n\n /* flex: none is required. The stage is a flex container\n and this is its only item, so the default flex-shrink: 1 lets the\n box render narrower than the width just asked for whenever the\n canvas is the smaller of the two, and container-type below drops\n the automatic minimum size to zero, so nothing stops the shrink.\n The result is the one failure this whole feature cannot afford:\n the dimension line states 1024 while every @container rule in the\n specimen answers whatever the canvas happened to allow. The stage\n is overflow: auto, so refusing to shrink scrolls instead. */\n flex: none;\n\n /* safe center, not bare center. Centring is right while the specimen\n fits and wrong the moment it does not: bare centring spills an\n over-wide specimen equally past both edges, where a real viewport of\n that width clips at zero and scrolls in one direction. The safe\n keyword falls back to start only when the item overflows, which\n is the browser making a case distinction CSS cannot otherwise\n express. */\n justify-items: safe center;\n width: var(--prism-vp-w);\n max-width: none;\n container-type: inline-size;\n}\n\n/* Both grips derive their position arithmetically, because .demo-wrap is\n centred by the stage's own flexbox and then scaled in place by\n transform: scale(var(--zoom)): the transform preserves that centre, so\n each edge sits half the *painted* width (--prism-vp-w times --zoom) away\n from the middle. No measurement, no ResizeObserver, and nothing to\n fall out of step when either the width or the zoom changes.\n\n The grip's own [scale] input (in the template) undoes the same factor\n in the other direction: a pointer that has moved dx across the painted\n box must change --prism-vp-w by dx / zoom for the grip to stay under the\n cursor, so the directive multiplier is 2 / zoom on the right grip and\n -2 / zoom on the left, not the flat \u00B12 a permanent zoom of 1 would\n need. */\n.vp-grip {\n position: absolute;\n top: var(--prism-canvas-overlay-top, 12px);\n bottom: 0;\n left: calc(50% - var(--prism-vp-w) * var(--zoom, 1) / 2 - 4.5px);\n z-index: 4;\n display: grid;\n width: 9px;\n\n /* The element is the guide line's full-height track and must not be\n clickable. It runs from the overlay band to the\n bottom of the stage at z-index 4, straight over prism-canvas-bg-pill\n at z-index 2, so leaving it hit-testable made part of the pill's\n Reset button unreachable whenever a viewport was on. Only the bar\n below takes pointer events back. */\n pointer-events: none;\n background: transparent;\n}\n\n.vp-grip--end {\n right: calc(50% - var(--prism-vp-w) * var(--zoom, 1) / 2 - 4.5px);\n left: auto;\n}\n\n/* The part you grab, and the only part of the grip that takes pointer\n events back. It shares the guide line's grid cell (hence the matching\n grid-area) and is raised above it so the 1px rule does not paint a\n seam down the middle of the 3px bar.\n\n The padding is the hit box and the background is the bar: content-box\n sizing plus background-clip: content-box paints 3x34 while leaving\n 9x44 clickable, so the target is comfortable without the mark growing\n to match. It is still narrow for WCAG 2.5.8, which the Width chooser\n in the tools menu answers: the same widths are reachable there, and\n both grips take Home/End and the arrow keys. */\n.vp-grip__bar {\n z-index: 1;\n box-sizing: content-box;\n grid-area: 1 / 1;\n place-self: center center;\n width: 3px;\n height: 34px;\n padding: 5px 3px;\n pointer-events: auto;\n background: color-mix(in srgb, var(--prism-measure) 80%, transparent);\n background-clip: content-box;\n border-radius: 2px;\n transition: background var(--dur-fast);\n}\n\n/* The edge itself, carried the whole height of the stage. Without it a\n grip is a floating nub that says where you may pull but not what it is\n pulling: the line is what makes the constrained region legible as a\n region rather than as two loose handles. Kept faint because it crosses\n the specimen, so it has to stay readable as chrome. */\n.vp-grip::after {\n grid-area: 1 / 1;\n place-self: stretch center;\n width: 1px;\n content: '';\n background: color-mix(in srgb, var(--prism-measure) 75%, transparent);\n transition: background var(--dur-fast);\n}\n\n.vp-grip:hover::after,\n.vp-grip.active::after,\n.vp-grip:focus-visible::after {\n background: color-mix(in srgb, var(--prism-measure) 55%, transparent);\n}\n\n.vp-grip:hover .vp-grip__bar,\n.vp-grip.active .vp-grip__bar,\n.vp-grip:focus-visible .vp-grip__bar {\n background: var(--prism-measure);\n background-clip: content-box;\n}\n\n/* The ring goes on the bar, not on the host: the host is the full-height\n track, and outlining that would draw a rule the length of the stage\n for a control 34px tall. */\n.vp-grip:focus-visible {\n outline: none;\n}\n\n.vp-grip:focus-visible .vp-grip__bar {\n outline: 2px solid var(--prism-primary);\n outline-offset: 1px;\n}\n\n/* The third resident of the overlay band: pill left, dimension centre,\n rail right. It reads the same --prism-canvas-overlay-top the other two\n do, so switching rulers on moves all three together.\n\n Spans the painted width rather than sitting in the middle of it as a\n badge, and carries the same --prism-vp-w * --zoom the grips do so the\n three stay locked together. A badge states a number; a dimension line\n states which distance the number measures, and that is the whole\n claim this overlay makes. */\n.vp-dim {\n position: absolute;\n top: var(--prism-canvas-overlay-top, 12px);\n left: 50%;\n z-index: 4;\n display: flex;\n gap: var(--sp-3);\n align-items: center;\n width: calc(var(--prism-vp-w) * var(--zoom, 1));\n pointer-events: none;\n transform: translateX(-50%);\n}\n\n/* Two halves with the value in the gap, rather than one rule behind it:\n a line running under the digits would need a background plate to stay\n readable, and the plate is the badge this replaced. */\n.vp-dim__rule {\n position: relative;\n flex: 1;\n height: 1px;\n background: color-mix(in srgb, var(--prism-measure) 70%, transparent);\n}\n\n/* The end ticks. They are what make the rule read as a measurement of\n the span between them instead of as a divider laid across the canvas,\n and they mark the two edges the grips can be dragged to. */\n.vp-dim__rule::before {\n position: absolute;\n top: -3px;\n width: 1px;\n height: 7px;\n content: '';\n background: color-mix(in srgb, var(--prism-measure) 90%, transparent);\n}\n\n.vp-dim__rule:first-child::before {\n left: 0;\n}\n\n.vp-dim__rule:last-child::before {\n right: 0;\n}\n\n.vp-dim__v {\n flex: none;\n font-family: var(--font-mono);\n font-size: 9px;\n color: var(--prism-measure);\n white-space: nowrap;\n}\n", "\n [data-bg=\"dots\"] {\n background-image: radial-gradient(circle, var(--prism-dot) 1px, transparent 1px);\n background-size: 20px 20px;\n }\n\n [data-bg=\"plain\"] {\n background-image: none;\n }\n\n /* Flat, not dotted. \"light\" and \"dark\" name the surface a component was\n designed against, and their colour is absolute rather than a theme token,\n which makes them the values to declare for a screenshot baseline. Use\n \"dots\" for the grid. */\n /* These two also re-point --prism-measure. Other overlays use theme colours\n on theme surfaces, but these grounds ignore the theme: \"light\" stays\n near-white in the dark theme and \"dark\" stays near-black in the light one.\n The dark theme's magenta reaches only 2.85:1 on the light ground, under the\n 4.5:1 its 9px readout needs, so the measurement colour has to follow the\n ground, not the theme.\n\n --prism-measure-plate follows it for the same reason. It is the surface\n the measuring tool's value label paints itself on, so the label reads as a\n gap in the measurement line rather than a badge on top of it. At its\n --prism-stage fallback it would be the theme's stage under a re-pointed\n foreground: the light theme's magenta on the dark theme's stage reads\n 3.71:1, the dark theme's on white 3.08:1. Pinned to the ground the same way,\n the pairs reach 4.54:1 and 6.57:1. A color-mix against the ground would\n work too, but this file already states both grounds literally, and one\n mechanism per decision is enough.\n\n Literal values because this file is theme-independent, like the two\n grounds below. Keep them in step with --prism-measure in\n prism-default-theme.ts; semantic-colours.spec.ts fails if they drift. */\n [data-bg=\"light\"] {\n background-color: var(--prism-void-light, #f7f5fc);\n background-image: none;\n --prism-measure: #ca00c1;\n --prism-measure-plate: var(--prism-void-light, #f7f5fc);\n }\n [data-bg=\"dark\"] {\n background-color: var(--prism-void-dark, #07050f);\n background-image: none;\n --prism-measure: #f632ff;\n --prism-measure-plate: var(--prism-void-dark, #07050f);\n }\n\n /* \"transparent\" shares the checkerboard. In the app the checkerboard is\n already the UI's sign for \"no surface\", and a see-through stage would only\n show the shell behind it. Only CAPTURE_STYLES tells the two apart. */\n [data-bg=\"checker\"],\n [data-bg=\"transparent\"] {\n background-image:\n linear-gradient(45deg, var(--prism-border) 25%, transparent 25%),\n linear-gradient(-45deg, var(--prism-border) 25%, transparent 25%),\n linear-gradient(45deg, transparent 75%, var(--prism-border) 75%),\n linear-gradient(-45deg, transparent 75%, var(--prism-border) 75%);\n background-size: 16px 16px;\n background-position: 0 0, 0 8px, 8px -8px, -8px 0;\n }\n"] }]
|
|
377
|
+
args: [{ selector: 'prism-renderer', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [PrismCanvasRulersComponent, PrismCanvasBgPillComponent, PrismCanvasMeasureComponent, NgComponentOutlet, PrismResizerDirective], template: "<div\n class=\"prism-canvas-stage\"\n [attr.data-bg]=\"variantBg.effective()\"\n [attr.data-rulers]=\"canvasService.rulers() ? '' : null\"\n [attr.data-viewport]=\"viewportWidth() !== null ? '' : null\"\n [style.--prism-vp-w.px]=\"viewportWidth()\"\n [style.--zoom]=\"canvasService.zoom()\">\n @if (!capture.active()) {\n <div\n class=\"stage-crosshair\"\n [class.visible]=\"canvasService.guides()\"></div>\n <prism-canvas-rulers />\n @if (canvasService.measure()) {\n <prism-canvas-measure />\n }\n <prism-canvas-bg-pill />\n @if (viewportWidth() !== null) {\n <!-- Grips and the dimension line are siblings of .demo-wrap, never\n children of it: .demo-wrap is what plugin-visual-regression\n screenshots, and anything inside it composites into every baseline.\n They sit inside the capture guard for the same reason the rulers and\n the pill do. -->\n <span class=\"vp-dim\">\n <span class=\"vp-dim__rule\"></span>\n <span class=\"vp-dim__v\">{{ viewportWidth() }} px</span>\n <span class=\"vp-dim__rule\"></span>\n </span>\n <div\n class=\"vp-grip\"\n prismResizer\n axis=\"x\"\n [scale]=\"-2 / (canvasService.zoom() || 1)\"\n [min]=\"VIEWPORT_MIN\"\n [max]=\"VIEWPORT_MAX\"\n [value]=\"viewportWidth()!\"\n (valueChange)=\"onViewportResize($event)\"\n aria-label=\"Viewport width, left edge\"\n [attr.aria-valuenow]=\"viewportWidth()\"\n [attr.aria-valuemin]=\"VIEWPORT_MIN\"\n [attr.aria-valuemax]=\"VIEWPORT_MAX\">\n <span class=\"vp-grip__bar\"></span>\n </div>\n <div\n class=\"vp-grip vp-grip--end\"\n prismResizer\n axis=\"x\"\n [scale]=\"2 / (canvasService.zoom() || 1)\"\n [min]=\"VIEWPORT_MIN\"\n [max]=\"VIEWPORT_MAX\"\n [value]=\"viewportWidth()!\"\n (valueChange)=\"onViewportResize($event)\"\n aria-label=\"Viewport width, right edge\"\n [attr.aria-valuenow]=\"viewportWidth()\"\n [attr.aria-valuemin]=\"VIEWPORT_MIN\"\n [attr.aria-valuemax]=\"VIEWPORT_MAX\">\n <span class=\"vp-grip__bar\"></span>\n </div>\n }\n }\n\n <div\n class=\"demo-wrap\"\n [style.--zoom]=\"canvasService.zoom()\"\n [attr.data-prism-rendered]=\"renderedKey()\"\n [attr.data-prism-excluded]=\"excludedReason()\"\n [attr.data-canvas-layout]=\"canvasLayout()\"\n [attr.data-viewport]=\"viewportWidth() !== null ? '' : null\"\n [attr.data-pseudo]=\"forcedStates()\">\n <ng-container #outlet />\n @if (activeOverlay()) {\n <ng-container *ngComponentOutlet=\"activeOverlay()!; inputs: overlayInputs; injector: overlayInjector()\" />\n }\n </div>\n</div>\n", styles: [":host {\n display: block;\n flex: 1;\n min-height: 0;\n}\n\n.prism-canvas-stage {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n min-height: 200px;\n padding: 32px;\n overflow: auto;\n\n /* The edge is outline + shadow, never border and never extra padding.\n plugin-visual-regression screenshots .demo-wrap, which is centred in\n this element; a border would shrink the content box by 2px and move\n that centre, shifting all 15 baselines in test-workspace/vrt/baseline\n without a single component having changed. Capture mode resets this\n element's padding but not its border, and this repo has no VRT runner\n to catch the drift. outline and box-shadow do not participate in\n layout, so the box is provably unchanged. Keep it that way.\n They do still paint, and outline-offset is negative, so the line lands\n inside the box: CAPTURE_STYLES in prism-capture.service.ts sets both\n to none, which is only safe because neither affects layout here. */\n outline: 1px solid var(--prism-stage-edge);\n outline-offset: -1px;\n background-color: var(--prism-stage);\n box-shadow:\n 0 1px 3px rgb(0 0 0 / 10%),\n 0 8px 24px -12px rgb(0 0 0 / 18%);\n transition: filter var(--dur-base);\n\n --prism-canvas-overlay-top: 12px;\n --prism-canvas-overlay-inline: 20px;\n}\n\n.prism-canvas-stage[data-rulers] {\n --prism-canvas-overlay-top: 28px;\n --prism-canvas-overlay-inline: 28px;\n}\n\n.stage-crosshair {\n position: absolute;\n inset: 0;\n pointer-events: none;\n opacity: 0;\n transition: opacity var(--dur-base);\n}\n\n.stage-crosshair.visible {\n opacity: 1;\n}\n\n.stage-crosshair::before,\n.stage-crosshair::after {\n position: absolute;\n content: '';\n background: color-mix(in srgb, var(--prism-primary) 20%, transparent);\n}\n\n.stage-crosshair::before {\n top: 50%;\n right: 0;\n left: 0;\n height: 1px;\n}\n\n.stage-crosshair::after {\n top: 0;\n bottom: 0;\n left: 50%;\n width: 1px;\n}\n\n.demo-wrap {\n position: relative;\n display: inline-block;\n transform: scale(var(--zoom, 1));\n transition: transform 0.18s;\n}\n\n.demo-wrap[data-canvas-layout='stretch'] {\n display: block;\n width: 100%;\n max-width: 800px;\n}\n\n/* max-width: none rather than min(800px, var(--prism-vp-w)): an explicitly\n requested width beats a layout default, and min() would silently cap a\n 1024 viewport at 800 on any component declaring canvasLayout:\n 'stretch'.\n\n container-type must stay confined to this rule. It implies contain: inline-size, which on the width:auto\n inline-block .demo-wrap is at rest would decouple its width from its\n contents, collapsing the box and shifting every baseline in\n test-workspace/vrt/baseline without a component having changed. Here\n the width is explicit, so containment costs nothing and is what makes\n a component's own @container rules respond. Media queries do not and\n cannot: they read the real browser viewport.\n\n grid + justify-items: center, and not text-align: center, which is the\n obvious way to centre an inline-level child and the wrong one. The\n showcase component is created through ViewContainerRef, so its host\n element carries none of this component's _ngcontent attribute and no\n scoped rule here can reach it to undo an inherited value. text-align\n would therefore leak all the way into the specimen and silently\n re-align its own text the moment the viewport is switched on. That is a\n canvas that lies about what it is showing. Centring at the container\n instead touches nothing inside.\n\n Shrinking is not a side effect of that choice, it is the resting\n behaviour preserved: at rest .demo-wrap is an inline-block that\n already shrink-wraps its child, so a block-level specimen sizes to its\n content here the same as with the constraint off. The implicit\n auto column still fills the declared width, so a component that asks\n for width: 100% (the canvasLayout: 'stretch' case) keeps getting the\n whole viewport. */\n.demo-wrap[data-viewport] {\n display: grid;\n\n /* flex: none is required. The stage is a flex container\n and this is its only item, so the default flex-shrink: 1 lets the\n box render narrower than the width just asked for whenever the\n canvas is the smaller of the two, and container-type below drops\n the automatic minimum size to zero, so nothing stops the shrink.\n The result is the one failure this whole feature cannot afford:\n the dimension line states 1024 while every @container rule in the\n specimen answers whatever the canvas happened to allow. The stage\n is overflow: auto, so refusing to shrink scrolls instead. */\n flex: none;\n\n /* safe center, not bare center. Centring is right while the specimen\n fits and wrong the moment it does not: bare centring spills an\n over-wide specimen equally past both edges, where a real viewport of\n that width clips at zero and scrolls in one direction. The safe\n keyword falls back to start only when the item overflows, which\n is the browser making a case distinction CSS cannot otherwise\n express. */\n justify-items: safe center;\n width: var(--prism-vp-w);\n max-width: none;\n container-type: inline-size;\n}\n\n/* Both grips derive their position arithmetically, because .demo-wrap is\n centred by the stage's own flexbox and then scaled in place by\n transform: scale(var(--zoom)): the transform preserves that centre, so\n each edge sits half the *painted* width (--prism-vp-w times --zoom) away\n from the middle. No measurement, no ResizeObserver, and nothing to\n fall out of step when either the width or the zoom changes.\n\n The grip's own [scale] input (in the template) undoes the same factor\n in the other direction: a pointer that has moved dx across the painted\n box must change --prism-vp-w by dx / zoom for the grip to stay under the\n cursor, so the directive multiplier is 2 / zoom on the right grip and\n -2 / zoom on the left, not the flat \u00B12 a permanent zoom of 1 would\n need. */\n.vp-grip {\n position: absolute;\n top: var(--prism-canvas-overlay-top, 12px);\n bottom: 0;\n left: calc(50% - var(--prism-vp-w) * var(--zoom, 1) / 2 - 4.5px);\n z-index: 4;\n display: grid;\n width: 9px;\n\n /* The element is the guide line's full-height track and must not be\n clickable. It runs from the overlay band to the\n bottom of the stage at z-index 4, straight over prism-canvas-bg-pill\n at z-index 2, so leaving it hit-testable made part of the pill's\n Reset button unreachable whenever a viewport was on. Only the bar\n below takes pointer events back. */\n pointer-events: none;\n background: transparent;\n}\n\n.vp-grip--end {\n right: calc(50% - var(--prism-vp-w) * var(--zoom, 1) / 2 - 4.5px);\n left: auto;\n}\n\n/* The part you grab, and the only part of the grip that takes pointer\n events back. It shares the guide line's grid cell (hence the matching\n grid-area) and is raised above it so the 1px rule does not paint a\n seam down the middle of the 3px bar.\n\n The padding is the hit box and the background is the bar: content-box\n sizing plus background-clip: content-box paints 3x34 while leaving\n 9x44 clickable, so the target is comfortable without the mark growing\n to match. It is still narrow for WCAG 2.5.8, which the Width chooser\n in the tools menu answers: the same widths are reachable there, and\n both grips take Home/End and the arrow keys. */\n.vp-grip__bar {\n z-index: 1;\n box-sizing: content-box;\n grid-area: 1 / 1;\n place-self: center center;\n width: 3px;\n height: 34px;\n padding: 5px 3px;\n pointer-events: auto;\n background: color-mix(in srgb, var(--prism-measure) 80%, transparent);\n background-clip: content-box;\n border-radius: 2px;\n transition: background var(--dur-fast);\n}\n\n/* The edge itself, carried the whole height of the stage. Without it a\n grip is a floating nub that says where you may pull but not what it is\n pulling: the line is what makes the constrained region legible as a\n region rather than as two loose handles. Kept faint because it crosses\n the specimen, so it has to stay readable as chrome. */\n.vp-grip::after {\n grid-area: 1 / 1;\n place-self: stretch center;\n width: 1px;\n content: '';\n background: color-mix(in srgb, var(--prism-measure) 75%, transparent);\n transition: background var(--dur-fast);\n}\n\n.vp-grip:hover::after,\n.vp-grip.active::after,\n.vp-grip:focus-visible::after {\n background: color-mix(in srgb, var(--prism-measure) 55%, transparent);\n}\n\n.vp-grip:hover .vp-grip__bar,\n.vp-grip.active .vp-grip__bar,\n.vp-grip:focus-visible .vp-grip__bar {\n background: var(--prism-measure);\n background-clip: content-box;\n}\n\n/* The ring goes on the bar, not on the host: the host is the full-height\n track, and outlining that would draw a rule the length of the stage\n for a control 34px tall. */\n.vp-grip:focus-visible {\n outline: none;\n}\n\n.vp-grip:focus-visible .vp-grip__bar {\n outline: 2px solid var(--prism-primary);\n outline-offset: 1px;\n}\n\n/* The third resident of the overlay band: pill left, dimension centre,\n rail right. It reads the same --prism-canvas-overlay-top the other two\n do, so switching rulers on moves all three together.\n\n Spans the painted width rather than sitting in the middle of it as a\n badge, and carries the same --prism-vp-w * --zoom the grips do so the\n three stay locked together. A badge states a number; a dimension line\n states which distance the number measures, and that is the whole\n claim this overlay makes. */\n.vp-dim {\n position: absolute;\n top: var(--prism-canvas-overlay-top, 12px);\n left: 50%;\n z-index: 4;\n display: flex;\n gap: var(--sp-3);\n align-items: center;\n width: calc(var(--prism-vp-w) * var(--zoom, 1));\n pointer-events: none;\n transform: translateX(-50%);\n}\n\n/* Two halves with the value in the gap, rather than one rule behind it:\n a line running under the digits would need a background plate to stay\n readable, and the plate is the badge this replaced. */\n.vp-dim__rule {\n position: relative;\n flex: 1;\n height: 1px;\n background: color-mix(in srgb, var(--prism-measure) 70%, transparent);\n}\n\n/* The end ticks. They are what make the rule read as a measurement of\n the span between them instead of as a divider laid across the canvas,\n and they mark the two edges the grips can be dragged to. */\n.vp-dim__rule::before {\n position: absolute;\n top: -3px;\n width: 1px;\n height: 7px;\n content: '';\n background: color-mix(in srgb, var(--prism-measure) 90%, transparent);\n}\n\n.vp-dim__rule:first-child::before {\n left: 0;\n}\n\n.vp-dim__rule:last-child::before {\n right: 0;\n}\n\n.vp-dim__v {\n flex: none;\n font-family: var(--font-mono);\n font-size: 9px;\n color: var(--prism-measure);\n white-space: nowrap;\n}\n", "\n [data-bg=\"dots\"] {\n background-image: radial-gradient(circle, var(--prism-dot) 1px, transparent 1px);\n background-size: 20px 20px;\n }\n\n [data-bg=\"plain\"] {\n background-image: none;\n }\n\n /* Flat, not dotted. \"light\" and \"dark\" name the surface a component was\n designed against, and their colour is absolute rather than a theme token,\n which makes them the values to declare for a screenshot baseline. Use\n \"dots\" for the grid. */\n /* These two also re-point --prism-measure. Other overlays use theme colours\n on theme surfaces, but these grounds ignore the theme: \"light\" stays\n near-white in the dark theme and \"dark\" stays near-black in the light one.\n The dark theme's magenta reaches only 2.85:1 on the light ground, under the\n 4.5:1 its 9px readout needs, so the measurement colour has to follow the\n ground, not the theme.\n\n --prism-measure-plate follows it for the same reason. It is the surface\n the measuring tool's value label paints itself on, so the label reads as a\n gap in the measurement line rather than a badge on top of it. At its\n --prism-stage fallback it would be the theme's stage under a re-pointed\n foreground: the light theme's magenta on the dark theme's stage reads\n 3.71:1, the dark theme's on white 3.08:1. Pinned to the ground the same way,\n the pairs reach 4.54:1 and 6.57:1. A color-mix against the ground would\n work too, but this file already states both grounds literally, and one\n mechanism per decision is enough.\n\n Literal values because this file is theme-independent, like the two\n grounds below. Keep them in step with --prism-measure in canvas-overlay-tokens.ts and\n prism-default-theme.ts; semantic-colours.spec.ts fails if they drift. */\n [data-bg=\"light\"] {\n background-color: var(--prism-void-light, #f7f5fc);\n background-image: none;\n --prism-measure: #ca00c1;\n --prism-measure-plate: var(--prism-void-light, #f7f5fc);\n }\n [data-bg=\"dark\"] {\n background-color: var(--prism-void-dark, #07050f);\n background-image: none;\n --prism-measure: #f632ff;\n --prism-measure-plate: var(--prism-void-dark, #07050f);\n }\n\n /* \"transparent\" shares the checkerboard. In the app the checkerboard is\n already the UI's sign for \"no surface\", and a see-through stage would only\n show the shell behind it. Only CAPTURE_STYLES tells the two apart. */\n [data-bg=\"checker\"],\n [data-bg=\"transparent\"] {\n background-image:\n linear-gradient(45deg, var(--prism-border) 25%, transparent 25%),\n linear-gradient(-45deg, var(--prism-border) 25%, transparent 25%),\n linear-gradient(45deg, transparent 75%, var(--prism-border) 75%),\n linear-gradient(-45deg, transparent 75%, var(--prism-border) 75%);\n background-size: 16px 16px;\n background-position: 0 0, 0 8px, 8px -8px, -8px 0;\n }\n"] }]
|
|
344
378
|
}], () => [], { outlet: [{ type: i0.ViewChild, args: ['outlet', { ...{
|
|
345
379
|
read: ViewContainerRef
|
|
346
380
|
}, isSignal: true }] }] }); })();
|
|
347
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PrismRendererComponent, { className: "PrismRendererComponent", filePath: "app/renderer/prism-renderer.component.ts", lineNumber:
|
|
381
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PrismRendererComponent, { className: "PrismRendererComponent", filePath: "app/renderer/prism-renderer.component.ts", lineNumber: 57 }); })();
|
|
@@ -5,6 +5,13 @@
|
|
|
5
5
|
* Shared by the Playground stage and the Overview cells: both project the same
|
|
6
6
|
* developer-authored content, and the slot-selector handling is the one piece
|
|
7
7
|
* of that neither wants to own twice.
|
|
8
|
+
*
|
|
9
|
+
* `createComponent` hands `projectableNodes[i]` to the i-th `<ng-content>` of
|
|
10
|
+
* the template and never looks at selectors, so the lists are ordered by the
|
|
11
|
+
* component's `ngContentSelectors` (`reflectComponentType`): `default` (or a
|
|
12
|
+
* plain string) goes to the `*` slot, every other key to the slot whose
|
|
13
|
+
* `select` it names. A key no slot takes is dropped and reported to
|
|
14
|
+
* `onUnmatchedKey`.
|
|
8
15
|
*/
|
|
9
|
-
export declare function parseContentToNodes(content: string | Record<string, string
|
|
16
|
+
export declare function parseContentToNodes(content: string | Record<string, string>, ngContentSelectors: readonly string[], onUnmatchedKey?: (key: string) => void): Node[][];
|
|
10
17
|
//# sourceMappingURL=projectable-content.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projectable-content.d.ts","sourceRoot":"","sources":["../../../src/app/renderer/projectable-content.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"projectable-content.d.ts","sourceRoot":"","sources":["../../../src/app/renderer/projectable-content.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAMH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,kBAAkB,EAAE,SAAS,MAAM,EAAE,EAAE,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI,EAAE,EAAE,CAcrK"}
|
|
@@ -5,43 +5,54 @@
|
|
|
5
5
|
* Shared by the Playground stage and the Overview cells: both project the same
|
|
6
6
|
* developer-authored content, and the slot-selector handling is the one piece
|
|
7
7
|
* of that neither wants to own twice.
|
|
8
|
+
*
|
|
9
|
+
* `createComponent` hands `projectableNodes[i]` to the i-th `<ng-content>` of
|
|
10
|
+
* the template and never looks at selectors, so the lists are ordered by the
|
|
11
|
+
* component's `ngContentSelectors` (`reflectComponentType`): `default` (or a
|
|
12
|
+
* plain string) goes to the `*` slot, every other key to the slot whose
|
|
13
|
+
* `select` it names. A key no slot takes is dropped and reported to
|
|
14
|
+
* `onUnmatchedKey`.
|
|
8
15
|
*/
|
|
9
16
|
// SAFETY: `content` originates from `@Showcase({ variants: [{ content }] })`
|
|
10
17
|
// in developer-authored source code. It is trusted by ng-prism's threat model
|
|
11
18
|
// (see SECURITY.md). Sanitization would strip the Angular component/directive
|
|
12
19
|
// selectors that variant content is meant to project.
|
|
13
|
-
export function parseContentToNodes(content) {
|
|
14
|
-
|
|
15
|
-
|
|
20
|
+
export function parseContentToNodes(content, ngContentSelectors, onUnmatchedKey) {
|
|
21
|
+
const byKey = typeof content === 'string' ? { default: content } : content;
|
|
22
|
+
const slotKeys = ngContentSelectors.map((selector) => (selector.trim() === '*' ? 'default' : selector.trim()));
|
|
23
|
+
for (const key of Object.keys(byKey)) {
|
|
24
|
+
if (!slotKeys.includes(key))
|
|
25
|
+
onUnmatchedKey?.(key);
|
|
16
26
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
27
|
+
return slotKeys.map((key) => {
|
|
28
|
+
const html = byKey[key];
|
|
29
|
+
if (html === undefined)
|
|
30
|
+
return [];
|
|
31
|
+
return key === 'default' ? htmlToNodes(html) : namedSlotNodes(html, key);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
// SAFETY: trusted developer-authored HTML, see SECURITY.md.
|
|
35
|
+
function namedSlotNodes(html, selector) {
|
|
36
|
+
const wrapper = document.createElement('div');
|
|
37
|
+
wrapper.innerHTML = html;
|
|
38
|
+
const nodes = [];
|
|
39
|
+
for (const child of Array.from(wrapper.childNodes)) {
|
|
40
|
+
const el = document.createElement('div');
|
|
41
|
+
// SAFETY: trusted developer-authored HTML (see SECURITY.md).
|
|
42
|
+
el.innerHTML = child.outerHTML ?? child.textContent ?? '';
|
|
43
|
+
const projected = el.firstChild;
|
|
44
|
+
if (projected && projected instanceof Element) {
|
|
45
|
+
applySelector(projected, selector);
|
|
46
|
+
nodes.push(projected);
|
|
47
|
+
}
|
|
48
|
+
else if (projected) {
|
|
49
|
+
const span = document.createElement('span');
|
|
50
|
+
applySelector(span, selector);
|
|
51
|
+
span.textContent = child.textContent;
|
|
52
|
+
nodes.push(span);
|
|
41
53
|
}
|
|
42
|
-
result.push(nodes);
|
|
43
54
|
}
|
|
44
|
-
return
|
|
55
|
+
return nodes;
|
|
45
56
|
}
|
|
46
57
|
// SAFETY: see `parseContentToNodes` above and SECURITY.md. `html` is trusted
|
|
47
58
|
// developer-authored variant content from the `@Showcase` decorator.
|
|
@@ -1,24 +1,38 @@
|
|
|
1
1
|
import type { RuntimeComponent } from '../../plugin/plugin.types.js';
|
|
2
2
|
import type { ForcedPseudoStates } from '../../shared/pseudo-state.type.js';
|
|
3
|
-
import {
|
|
3
|
+
import type { AppliedPseudoStates } from '../pseudo/pseudo-state-marker.js';
|
|
4
4
|
export interface RenderedKeyInput {
|
|
5
5
|
component: RuntimeComponent | null;
|
|
6
6
|
variantIndex: number;
|
|
7
|
+
/** The component-level state on the canvas, `null` when none is active. */
|
|
8
|
+
stateIndex: number | null;
|
|
7
9
|
/** The rendered component's host element, `null` while nothing is rendered. */
|
|
8
10
|
element: Element | null;
|
|
9
11
|
/** The pseudo states the variant forces, `null` when it forces none. */
|
|
10
12
|
pseudo: ForcedPseudoStates | null;
|
|
13
|
+
/** The active state's pseudo, `null` when no state applies to the variant. */
|
|
14
|
+
state: ForcedPseudoStates | null;
|
|
11
15
|
/** What the canvas marker has the states in place for. */
|
|
12
16
|
pseudoApplied: AppliedPseudoStates | null;
|
|
13
17
|
}
|
|
14
18
|
/**
|
|
15
19
|
* The value of `data-prism-rendered` on `.demo-wrap`, or `null` while the
|
|
16
|
-
* variant is not ready to be inspected
|
|
20
|
+
* variant is not ready to be inspected: `<className>:<variantIndex>`, with
|
|
21
|
+
* `:<stateIndex>` while a component-level state is active.
|
|
17
22
|
*
|
|
18
23
|
* Screenshot runners wait on this marker, so a variant that forces pseudo
|
|
19
|
-
* states only gets it once those exact
|
|
20
|
-
* element. A runner then captures the forced state with no
|
|
21
|
-
* A variant without forced states is not held back.
|
|
24
|
+
* states, or has a state layer, only gets it once those exact objects are in
|
|
25
|
+
* place on this exact element. A runner then captures the forced state with no
|
|
26
|
+
* change on its side. A variant without forced states is not held back. The
|
|
27
|
+
* index is there for an opted-out variant too (`state` is `null`), so a runner
|
|
28
|
+
* waiting for its cell finds it.
|
|
22
29
|
*/
|
|
23
|
-
export declare function resolveRenderedKey({ component, variantIndex, element, pseudo, pseudoApplied }: RenderedKeyInput): string | null;
|
|
30
|
+
export declare function resolveRenderedKey({ component, variantIndex, stateIndex, element, pseudo, state, pseudoApplied }: RenderedKeyInput): string | null;
|
|
31
|
+
/**
|
|
32
|
+
* The value of `data-prism-excluded` on `.demo-wrap`, or `null` when the cell
|
|
33
|
+
* shows what it was asked for: why the active state is not part of this
|
|
34
|
+
* variant, either because the variant opted out (`exclusion`) or because the
|
|
35
|
+
* marker found the state does not fit the rendered component.
|
|
36
|
+
*/
|
|
37
|
+
export declare function resolveExcludedReason(stateIndex: number | null, exclusion: string | null, applied: AppliedPseudoStates | null): string | null;
|
|
24
38
|
//# sourceMappingURL=rendered-key.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rendered-key.d.ts","sourceRoot":"","sources":["../../../src/app/renderer/rendered-key.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"rendered-key.d.ts","sourceRoot":"","sources":["../../../src/app/renderer/rendered-key.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAG5E,MAAM,WAAW,gBAAgB;IAC7B,SAAS,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACnC,YAAY,EAAE,MAAM,CAAC;IACrB,2EAA2E;IAC3E,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,+EAA+E;IAC/E,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IACxB,wEAAwE;IACxE,MAAM,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAClC,8EAA8E;IAC9E,KAAK,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACjC,0DAA0D;IAC1D,aAAa,EAAE,mBAAmB,GAAG,IAAI,CAAC;CAC7C;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,EAAE,gBAAgB,GAAG,MAAM,GAAG,IAAI,CAOlJ;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,EAAE,OAAO,EAAE,mBAAmB,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAI7I"}
|
|
@@ -1,17 +1,34 @@
|
|
|
1
|
-
import { forcesAnyState } from '../pseudo/pseudo-
|
|
1
|
+
import { forcesAnyState } from '../pseudo/pseudo-targets.js';
|
|
2
2
|
/**
|
|
3
3
|
* The value of `data-prism-rendered` on `.demo-wrap`, or `null` while the
|
|
4
|
-
* variant is not ready to be inspected
|
|
4
|
+
* variant is not ready to be inspected: `<className>:<variantIndex>`, with
|
|
5
|
+
* `:<stateIndex>` while a component-level state is active.
|
|
5
6
|
*
|
|
6
7
|
* Screenshot runners wait on this marker, so a variant that forces pseudo
|
|
7
|
-
* states only gets it once those exact
|
|
8
|
-
* element. A runner then captures the forced state with no
|
|
9
|
-
* A variant without forced states is not held back.
|
|
8
|
+
* states, or has a state layer, only gets it once those exact objects are in
|
|
9
|
+
* place on this exact element. A runner then captures the forced state with no
|
|
10
|
+
* change on its side. A variant without forced states is not held back. The
|
|
11
|
+
* index is there for an opted-out variant too (`state` is `null`), so a runner
|
|
12
|
+
* waiting for its cell finds it.
|
|
10
13
|
*/
|
|
11
|
-
export function resolveRenderedKey({ component, variantIndex, element, pseudo, pseudoApplied }) {
|
|
14
|
+
export function resolveRenderedKey({ component, variantIndex, stateIndex, element, pseudo, state, pseudoApplied }) {
|
|
12
15
|
if (!element || !component)
|
|
13
16
|
return null;
|
|
14
|
-
if (forcesAnyState(pseudo) && (pseudoApplied?.root !== element || pseudoApplied.states !== pseudo))
|
|
17
|
+
if ((forcesAnyState(pseudo) || state !== null) && (pseudoApplied?.root !== element || pseudoApplied.states !== pseudo || pseudoApplied.state !== state))
|
|
15
18
|
return null;
|
|
16
|
-
|
|
19
|
+
const key = `${component.meta.className}:${variantIndex}`;
|
|
20
|
+
return stateIndex === null ? key : `${key}:${stateIndex}`;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The value of `data-prism-excluded` on `.demo-wrap`, or `null` when the cell
|
|
24
|
+
* shows what it was asked for: why the active state is not part of this
|
|
25
|
+
* variant, either because the variant opted out (`exclusion`) or because the
|
|
26
|
+
* marker found the state does not fit the rendered component.
|
|
27
|
+
*/
|
|
28
|
+
export function resolveExcludedReason(stateIndex, exclusion, applied) {
|
|
29
|
+
if (stateIndex === null)
|
|
30
|
+
return null;
|
|
31
|
+
if (exclusion !== null)
|
|
32
|
+
return exclusion;
|
|
33
|
+
return applied?.fit?.fits === false ? applied.fit.reason : null;
|
|
17
34
|
}
|
|
@@ -1,7 +1,19 @@
|
|
|
1
|
-
import type { DirectiveHost } from '../../decorator/showcase.types.js';
|
|
1
|
+
import type { DirectiveHost, HostTemplate } from '../../decorator/showcase.types.js';
|
|
2
2
|
import type { InputMeta } from '../../plugin/plugin.types.js';
|
|
3
3
|
export interface SnippetDirectiveOptions {
|
|
4
|
-
host?: string | DirectiveHost;
|
|
4
|
+
host?: string | DirectiveHost | HostTemplate;
|
|
5
5
|
}
|
|
6
|
+
/**
|
|
7
|
+
* The attributes that put the current values on the subject element. A value that equals its default is left out unless
|
|
8
|
+
* the variant sets it (`explicitKeys`); `skip` holds the member names of inputs that are not written at all, such as
|
|
9
|
+
* the ones a composition does not bind.
|
|
10
|
+
*/
|
|
11
|
+
export declare function subjectAttributes(inputs: InputMeta[], values: Record<string, unknown>, explicitKeys?: ReadonlySet<string>, skip?: ReadonlySet<string>): string[];
|
|
12
|
+
/**
|
|
13
|
+
* The composition of a case as its author wrote it, with `attributes` on the subject element in place of the slot
|
|
14
|
+
* ng-prism leaves in `CompositionCase.template`. Only a bare attribute of the subject that one of them gives a value
|
|
15
|
+
* (`libTooltip`, which the selector asks for) is left out, as `attributes` writes it again.
|
|
16
|
+
*/
|
|
17
|
+
export declare function generateCompositionSnippet(caseTemplate: string, attributes: string[]): string;
|
|
6
18
|
export declare function generateSnippet(selector: string, inputs: InputMeta[], values: Record<string, unknown>, explicitKeys?: ReadonlySet<string>, content?: string | Record<string, string>, directiveOptions?: SnippetDirectiveOptions): string;
|
|
7
19
|
//# sourceMappingURL=snippet-generator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snippet-generator.d.ts","sourceRoot":"","sources":["../../../src/app/renderer/snippet-generator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"snippet-generator.d.ts","sourceRoot":"","sources":["../../../src/app/renderer/snippet-generator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACrF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAQ9D,MAAM,WAAW,uBAAuB;IACpC,IAAI,CAAC,EAAE,MAAM,GAAG,aAAa,GAAG,YAAY,CAAC;CAChD;AAoBD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,MAAM,EAAE,CA0BhK;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,MAAM,CAO7F;AAaD,wBAAgB,eAAe,CAC3B,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,SAAS,EAAE,EACnB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,YAAY,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,EAClC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACzC,gBAAgB,CAAC,EAAE,uBAAuB,GAC3C,MAAM,CAcR"}
|