@ng-prism/core 22.2.1 → 22.4.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 +34 -36
- package/builders.json +11 -11
- package/dist/app/canvas/canvas-bg.styles.d.ts +7 -12
- package/dist/app/canvas/canvas-bg.styles.d.ts.map +1 -1
- package/dist/app/canvas/canvas-bg.styles.js +37 -22
- package/dist/app/canvas/measure-geometry.d.ts +140 -0
- package/dist/app/canvas/measure-geometry.d.ts.map +1 -0
- package/dist/app/canvas/measure-geometry.js +217 -0
- package/dist/app/canvas/measure-keyboard.d.ts +20 -0
- package/dist/app/canvas/measure-keyboard.d.ts.map +1 -0
- package/dist/app/canvas/measure-keyboard.js +34 -0
- package/dist/app/canvas/measure-quad.d.ts +114 -0
- package/dist/app/canvas/measure-quad.d.ts.map +1 -0
- package/dist/app/canvas/measure-quad.js +173 -0
- package/dist/app/canvas/measure-snap.d.ts +35 -0
- package/dist/app/canvas/measure-snap.d.ts.map +1 -0
- package/dist/app/canvas/measure-snap.js +63 -0
- package/dist/app/canvas/prism-canvas-bg-pill.component.d.ts.map +1 -1
- package/dist/app/canvas/prism-canvas-bg-pill.component.js +3 -18
- package/dist/app/canvas/prism-canvas-measure.component.d.ts +142 -0
- package/dist/app/canvas/prism-canvas-measure.component.d.ts.map +1 -0
- package/dist/app/canvas/prism-canvas-measure.component.js +554 -0
- package/dist/app/canvas/prism-canvas-pin-row.component.d.ts +23 -0
- package/dist/app/canvas/prism-canvas-pin-row.component.d.ts.map +1 -0
- package/dist/app/canvas/prism-canvas-pin-row.component.js +64 -0
- package/dist/app/canvas/prism-canvas-rulers.component.d.ts +1 -0
- package/dist/app/canvas/prism-canvas-rulers.component.d.ts.map +1 -1
- package/dist/app/canvas/prism-canvas-rulers.component.js +9 -14
- package/dist/app/canvas/prism-canvas-toolbar.component.d.ts +28 -28
- package/dist/app/canvas/prism-canvas-toolbar.component.d.ts.map +1 -1
- package/dist/app/canvas/prism-canvas-toolbar.component.js +124 -162
- package/dist/app/canvas/prism-template-popover.component.d.ts.map +1 -1
- package/dist/app/canvas/prism-template-popover.component.js +8 -49
- package/dist/app/canvas/viewport-snap.d.ts +12 -0
- package/dist/app/canvas/viewport-snap.d.ts.map +1 -0
- package/dist/app/canvas/viewport-snap.js +23 -0
- package/dist/app/component-head/head-metrics.d.ts +2 -2
- package/dist/app/component-head/head-metrics.d.ts.map +1 -1
- package/dist/app/component-head/head-metrics.js +3 -3
- package/dist/app/component-head/prism-component-head.component.d.ts +3 -3
- package/dist/app/component-head/prism-component-head.component.d.ts.map +1 -1
- package/dist/app/component-head/prism-component-head.component.js +24 -64
- package/dist/app/component-head/prism-head-gauge.component.d.ts.map +1 -1
- package/dist/app/component-head/prism-head-gauge.component.js +4 -36
- package/dist/app/component-head/prism-head-info.component.d.ts +1 -1
- package/dist/app/component-head/prism-head-info.component.d.ts.map +1 -1
- package/dist/app/component-head/prism-head-info.component.js +4 -37
- package/dist/app/component-head/prism-stat.component.d.ts +1 -1
- package/dist/app/component-head/prism-stat.component.d.ts.map +1 -1
- package/dist/app/component-head/prism-stat.component.js +4 -15
- package/dist/app/controls/boolean-control.component.d.ts.map +1 -1
- package/dist/app/controls/boolean-control.component.js +4 -12
- package/dist/app/controls/json-control.component.d.ts.map +1 -1
- package/dist/app/controls/json-control.component.js +4 -24
- package/dist/app/controls/number-control.component.d.ts.map +1 -1
- package/dist/app/controls/number-control.component.js +4 -11
- package/dist/app/controls/string-control.component.d.ts.map +1 -1
- package/dist/app/controls/string-control.component.js +4 -11
- package/dist/app/controls/union-control.component.d.ts.map +1 -1
- package/dist/app/controls/union-control.component.js +4 -16
- package/dist/app/directives/prism-resizer.directive.d.ts +24 -1
- package/dist/app/directives/prism-resizer.directive.d.ts.map +1 -1
- package/dist/app/directives/prism-resizer.directive.js +44 -7
- package/dist/app/directives/resize-value.d.ts +22 -0
- package/dist/app/directives/resize-value.d.ts.map +1 -0
- package/dist/app/directives/resize-value.js +23 -0
- 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 +16 -22
- package/dist/app/header/prism-header-widget-host.component.d.ts.map +1 -1
- package/dist/app/header/prism-header-widget-host.component.js +4 -8
- package/dist/app/header/prism-header.component.d.ts.map +1 -1
- package/dist/app/header/prism-header.component.js +9 -78
- package/dist/app/hmr.d.ts.map +1 -1
- package/dist/app/icons/icon-registry.d.ts +2 -2
- package/dist/app/icons/icon-registry.d.ts.map +1 -1
- package/dist/app/icons/icon-registry.js +5 -3
- package/dist/app/icons/prism-icon.component.d.ts +2 -2
- package/dist/app/icons/prism-icon.component.d.ts.map +1 -1
- package/dist/app/icons/prism-icon.component.js +9 -9
- package/dist/app/index.d.ts +3 -3
- package/dist/app/index.d.ts.map +1 -1
- package/dist/app/index.js +17 -24
- package/dist/app/layout-menu/prism-layout-menu.component.d.ts.map +1 -1
- package/dist/app/layout-menu/prism-layout-menu.component.js +3 -77
- package/dist/app/overview/overview-panel.js +1 -1
- package/dist/app/overview/overview-visibility.d.ts +1 -1
- package/dist/app/overview/overview-visibility.d.ts.map +1 -1
- package/dist/app/overview/overview-visibility.js +1 -1
- package/dist/app/overview/prism-overview-cell.component.d.ts +2 -2
- package/dist/app/overview/prism-overview-cell.component.d.ts.map +1 -1
- package/dist/app/overview/prism-overview-cell.component.js +17 -25
- package/dist/app/overview/prism-overview.component.d.ts +2 -2
- package/dist/app/overview/prism-overview.component.d.ts.map +1 -1
- package/dist/app/overview/prism-overview.component.js +6 -14
- package/dist/app/page-renderer/prism-page-renderer.component.d.ts.map +1 -1
- package/dist/app/page-renderer/prism-page-renderer.component.js +4 -17
- package/dist/app/panels/a11y/a11y-audit.service.d.ts.map +1 -1
- package/dist/app/panels/a11y/a11y-audit.service.js +14 -2
- package/dist/app/panels/a11y/a11y-core.plugin.d.ts.map +1 -1
- package/dist/app/panels/a11y/a11y-core.plugin.js +1 -1
- package/dist/app/panels/a11y/a11y-dom-utils.d.ts.map +1 -1
- package/dist/app/panels/a11y/a11y-dom-utils.js +9 -6
- package/dist/app/panels/a11y/a11y-header-badge.component.d.ts.map +1 -1
- package/dist/app/panels/a11y/a11y-header-badge.component.js +6 -22
- package/dist/app/panels/a11y/a11y-keyboard-overlay.component.d.ts.map +1 -1
- package/dist/app/panels/a11y/a11y-keyboard-overlay.component.js +6 -25
- package/dist/app/panels/a11y/a11y-keyboard.component.d.ts.map +1 -1
- package/dist/app/panels/a11y/a11y-keyboard.component.js +5 -36
- package/dist/app/panels/a11y/a11y-keyboard.service.d.ts.map +1 -1
- package/dist/app/panels/a11y/a11y-keyboard.service.js +2 -2
- package/dist/app/panels/a11y/a11y-overlay-host.component.d.ts.map +1 -1
- package/dist/app/panels/a11y/a11y-overlay-host.component.js +5 -32
- package/dist/app/panels/a11y/a11y-panel-state.service.d.ts.map +1 -1
- package/dist/app/panels/a11y/a11y-panel.component.d.ts +1 -1
- package/dist/app/panels/a11y/a11y-panel.component.d.ts.map +1 -1
- package/dist/app/panels/a11y/a11y-panel.component.js +7 -69
- package/dist/app/panels/a11y/a11y-perspective.service.d.ts.map +1 -1
- package/dist/app/panels/a11y/a11y-score.component.d.ts.map +1 -1
- package/dist/app/panels/a11y/a11y-score.component.js +4 -31
- package/dist/app/panels/a11y/a11y-sr-overlay.component.d.ts.map +1 -1
- package/dist/app/panels/a11y/a11y-sr-overlay.component.js +8 -28
- package/dist/app/panels/a11y/a11y-sr.component.d.ts.map +1 -1
- package/dist/app/panels/a11y/a11y-sr.component.js +5 -28
- package/dist/app/panels/a11y/a11y-sr.service.d.ts.map +1 -1
- package/dist/app/panels/a11y/a11y-sr.service.js +4 -7
- package/dist/app/panels/a11y/a11y-summary.d.ts +3 -4
- package/dist/app/panels/a11y/a11y-summary.d.ts.map +1 -1
- package/dist/app/panels/a11y/a11y-summary.js +5 -9
- package/dist/app/panels/a11y/a11y-thresholds.d.ts +1 -1
- package/dist/app/panels/a11y/a11y-thresholds.d.ts.map +1 -1
- package/dist/app/panels/a11y/a11y-thresholds.js +2 -2
- package/dist/app/panels/a11y/a11y-tree.component.d.ts.map +1 -1
- package/dist/app/panels/a11y/a11y-tree.component.js +9 -46
- package/dist/app/panels/a11y/a11y-tree.service.d.ts.map +1 -1
- package/dist/app/panels/a11y/a11y-tree.service.js +3 -5
- package/dist/app/panels/a11y/a11y-violations.component.d.ts.map +1 -1
- package/dist/app/panels/a11y/a11y-violations.component.js +7 -58
- package/dist/app/panels/a11y/a11y.types.d.ts +1 -1
- package/dist/app/panels/a11y/a11y.types.d.ts.map +1 -1
- package/dist/app/panels/builtin-header-widgets.js +2 -2
- package/dist/app/panels/builtin-navigation-decorations.d.ts +1 -1
- package/dist/app/panels/builtin-navigation-decorations.d.ts.map +1 -1
- package/dist/app/panels/builtin-navigation-decorations.js +3 -3
- package/dist/app/panels/builtin-panels.d.ts.map +1 -1
- package/dist/app/panels/builtin-panels.js +2 -7
- package/dist/app/panels/controls/controls-plugin.js +3 -3
- package/dist/app/panels/controls/non-editable-input-types.d.ts.map +1 -1
- package/dist/app/panels/controls/non-editable-input-types.js +2 -6
- package/dist/app/panels/controls/prism-controls-panel.component.d.ts.map +1 -1
- package/dist/app/panels/controls/prism-controls-panel.component.js +5 -95
- package/dist/app/panels/events/events-plugin.js +3 -3
- package/dist/app/panels/events/prism-events-panel.component.d.ts.map +1 -1
- package/dist/app/panels/events/prism-events-panel.component.js +5 -23
- package/dist/app/panels/events/prism-json-node.component.d.ts.map +1 -1
- package/dist/app/panels/events/prism-json-node.component.js +4 -86
- package/dist/app/panels/events/prism-json-node.utils.d.ts.map +1 -1
- package/dist/app/panels/panel-host/panel-badge.d.ts +1 -1
- package/dist/app/panels/panel-host/panel-badge.d.ts.map +1 -1
- package/dist/app/panels/panel-host/panel-badge.js +2 -4
- package/dist/app/panels/panel-host/prism-panel-host.component.d.ts +1 -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 +12 -67
- package/dist/app/provide-prism.d.ts +1 -1
- package/dist/app/provide-prism.d.ts.map +1 -1
- package/dist/app/provide-prism.js +8 -12
- package/dist/app/renderer/known-inputs.d.ts +1 -1
- package/dist/app/renderer/known-inputs.d.ts.map +1 -1
- package/dist/app/renderer/known-inputs.js +1 -1
- package/dist/app/renderer/overlay-resolver.d.ts +17 -3
- package/dist/app/renderer/overlay-resolver.d.ts.map +1 -1
- package/dist/app/renderer/overlay-resolver.js +10 -5
- package/dist/app/renderer/prism-renderer.component.d.ts +28 -3
- package/dist/app/renderer/prism-renderer.component.d.ts.map +1 -1
- package/dist/app/renderer/prism-renderer.component.js +107 -80
- package/dist/app/renderer/projectable-content.d.ts.map +1 -1
- package/dist/app/renderer/projectable-content.js +4 -6
- package/dist/app/renderer/snippet-generator.d.ts +1 -1
- package/dist/app/renderer/snippet-generator.d.ts.map +1 -1
- package/dist/app/renderer/snippet-generator.js +7 -22
- package/dist/app/services/navigation-item.types.d.ts +1 -1
- package/dist/app/services/navigation-item.types.d.ts.map +1 -1
- package/dist/app/services/prism-canvas.service.d.ts +33 -0
- package/dist/app/services/prism-canvas.service.d.ts.map +1 -1
- package/dist/app/services/prism-canvas.service.js +71 -6
- package/dist/app/services/prism-capture.service.d.ts +24 -50
- package/dist/app/services/prism-capture.service.d.ts.map +1 -1
- package/dist/app/services/prism-capture.service.js +62 -146
- package/dist/app/services/prism-event-log.service.d.ts.map +1 -1
- package/dist/app/services/prism-event-log.service.js +1 -4
- package/dist/app/services/prism-layout.service.d.ts.map +1 -1
- package/dist/app/services/prism-layout.service.js +5 -4
- package/dist/app/services/prism-manifest.service.d.ts +1 -1
- package/dist/app/services/prism-manifest.service.d.ts.map +1 -1
- package/dist/app/services/prism-manifest.service.js +1 -1
- package/dist/app/services/prism-measure.service.d.ts +44 -0
- package/dist/app/services/prism-measure.service.d.ts.map +1 -0
- package/dist/app/services/prism-measure.service.js +91 -0
- package/dist/app/services/prism-navigation.service.d.ts +1 -1
- package/dist/app/services/prism-navigation.service.d.ts.map +1 -1
- package/dist/app/services/prism-navigation.service.js +5 -13
- package/dist/app/services/prism-panel.service.d.ts +2 -2
- package/dist/app/services/prism-panel.service.d.ts.map +1 -1
- package/dist/app/services/prism-panel.service.js +4 -7
- package/dist/app/services/prism-persistence.service.d.ts.map +1 -1
- package/dist/app/services/prism-persistence.service.js +9 -11
- package/dist/app/services/prism-plugin.service.d.ts.map +1 -1
- package/dist/app/services/prism-renderer.service.d.ts.map +1 -1
- package/dist/app/services/prism-renderer.service.js +5 -9
- package/dist/app/services/prism-search.service.d.ts.map +1 -1
- package/dist/app/services/prism-search.service.js +1 -2
- package/dist/app/services/prism-theme.service.d.ts.map +1 -1
- package/dist/app/services/prism-theme.service.js +6 -4
- package/dist/app/services/prism-url-state.service.d.ts.map +1 -1
- package/dist/app/services/prism-url-state.service.js +4 -10
- package/dist/app/services/prism-variant-bg.service.d.ts +10 -24
- package/dist/app/services/prism-variant-bg.service.d.ts.map +1 -1
- package/dist/app/services/prism-variant-bg.service.js +13 -29
- package/dist/app/shared/prism-metric-badge.component.d.ts +9 -15
- package/dist/app/shared/prism-metric-badge.component.d.ts.map +1 -1
- package/dist/app/shared/prism-metric-badge.component.js +13 -32
- package/dist/app/shell/prism-shell.component.d.ts.map +1 -1
- package/dist/app/shell/prism-shell.component.js +26 -125
- package/dist/app/sidebar/navigation-decorations.d.ts +4 -4
- package/dist/app/sidebar/navigation-decorations.d.ts.map +1 -1
- package/dist/app/sidebar/navigation-decorations.js +3 -3
- package/dist/app/sidebar/prism-sidebar.component.d.ts +3 -3
- package/dist/app/sidebar/prism-sidebar.component.d.ts.map +1 -1
- package/dist/app/sidebar/prism-sidebar.component.js +21 -156
- package/dist/app/theme/prism-default-theme.d.ts.map +1 -1
- package/dist/app/theme/prism-default-theme.js +6 -6
- package/dist/app/tokens/prism-tokens.d.ts.map +1 -1
- package/dist/app/tokens/prism-tokens.js +1 -1
- package/dist/app/variant-ribbon/prism-variant-ribbon.component.d.ts.map +1 -1
- package/dist/app/variant-ribbon/prism-variant-ribbon.component.js +4 -49
- package/dist/app/variant-ribbon/spectrum.d.ts +1 -1
- package/dist/app/variant-ribbon/spectrum.d.ts.map +1 -1
- package/dist/app/variant-ribbon/spectrum.js +1 -1
- package/dist/app/view-tab-bar/next-view-id.d.ts +1 -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 +2 -4
- 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 +5 -17
- 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 +4 -27
- package/dist/builder/a11y/a11y-report-reader.d.ts +2 -2
- package/dist/builder/a11y/a11y-report-reader.d.ts.map +1 -1
- package/dist/builder/a11y/a11y-report-reader.js +8 -8
- package/dist/builder/build/index.d.ts.map +1 -1
- package/dist/builder/build/index.js +5 -9
- package/dist/builder/build/schema.d.ts.map +1 -1
- package/dist/builder/config-loader/config-loader.d.ts.map +1 -1
- package/dist/builder/config-loader/config-loader.js +4 -5
- package/dist/builder/manifest/host-parser.d.ts.map +1 -1
- package/dist/builder/manifest/host-parser.js +1 -1
- package/dist/builder/manifest/runtime-manifest.generator.d.ts +1 -1
- package/dist/builder/manifest/runtime-manifest.generator.d.ts.map +1 -1
- package/dist/builder/manifest/runtime-manifest.generator.js +14 -35
- package/dist/builder/plugin-runner/plugin-runner.d.ts.map +1 -1
- package/dist/builder/plugin-runner/plugin-runner.js +2 -4
- package/dist/builder/scanner/ast-utils.d.ts +46 -2
- package/dist/builder/scanner/ast-utils.d.ts.map +1 -1
- package/dist/builder/scanner/ast-utils.js +338 -38
- package/dist/builder/scanner/class-hierarchy.d.ts +33 -0
- package/dist/builder/scanner/class-hierarchy.d.ts.map +1 -0
- package/dist/builder/scanner/class-hierarchy.js +87 -0
- package/dist/builder/scanner/component.scanner.d.ts +7 -1
- package/dist/builder/scanner/component.scanner.d.ts.map +1 -1
- package/dist/builder/scanner/component.scanner.js +113 -72
- package/dist/builder/scanner/entry-point-discovery.d.ts.map +1 -1
- package/dist/builder/scanner/entry-point-discovery.js +3 -5
- package/dist/builder/scanner/entry-point.scanner.d.ts.map +1 -1
- package/dist/builder/scanner/entry-point.scanner.js +1 -3
- package/dist/builder/scanner/index.d.ts +1 -1
- package/dist/builder/scanner/index.d.ts.map +1 -1
- package/dist/builder/scanner/input.extractor.d.ts +7 -4
- package/dist/builder/scanner/input.extractor.d.ts.map +1 -1
- package/dist/builder/scanner/input.extractor.js +157 -76
- package/dist/builder/scanner/manifest.generator.d.ts.map +1 -1
- package/dist/builder/scanner/manifest.generator.js +8 -6
- package/dist/builder/scanner/scanner.d.ts +3 -1
- package/dist/builder/scanner/scanner.d.ts.map +1 -1
- package/dist/builder/scanner/scanner.js +10 -8
- package/dist/builder/scanner/showcase-diagnostics.d.ts +25 -0
- package/dist/builder/scanner/showcase-diagnostics.d.ts.map +1 -0
- package/dist/builder/scanner/showcase-diagnostics.js +96 -0
- package/dist/builder/serve/index.d.ts.map +1 -1
- package/dist/builder/serve/index.js +8 -10
- package/dist/builder/serve/schema.d.ts.map +1 -1
- package/dist/builder/shared/index.d.ts +1 -1
- package/dist/builder/shared/index.d.ts.map +1 -1
- package/dist/builder/shared/index.js +1 -1
- package/dist/builder/shared/prism-pipeline.d.ts +1 -1
- package/dist/builder/shared/prism-pipeline.d.ts.map +1 -1
- package/dist/builder/shared/prism-pipeline.js +29 -38
- package/dist/builder/shared/resolve-cache-dir.d.ts.map +1 -1
- package/dist/builder/shared/resolve-cache-dir.js +1 -1
- package/dist/builder/watcher/index.d.ts +1 -1
- package/dist/builder/watcher/index.d.ts.map +1 -1
- package/dist/builder/watcher/prism-watcher.d.ts.map +1 -1
- package/dist/builder/watcher/prism-watcher.js +14 -12
- package/dist/config/index.d.ts +2 -2
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +1 -1
- package/dist/decorator/index.d.ts +1 -1
- package/dist/decorator/index.d.ts.map +1 -1
- package/dist/decorator/showcase.decorator.d.ts.map +1 -1
- package/dist/decorator/showcase.types.d.ts +11 -9
- package/dist/decorator/showcase.types.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/plugin/define-config.js +1 -1
- package/dist/plugin/index.d.ts +4 -4
- package/dist/plugin/index.d.ts.map +1 -1
- package/dist/plugin/index.js +7 -11
- package/dist/plugin/page-helpers.d.ts +1 -1
- package/dist/plugin/page-helpers.d.ts.map +1 -1
- package/dist/plugin/page-helpers.js +2 -2
- package/dist/plugin/page.types.d.ts.map +1 -1
- package/dist/plugin/plugin.types.d.ts +31 -14
- package/dist/plugin/plugin.types.d.ts.map +1 -1
- package/dist/schematics/migrations/v21-13-manifest-cache/index.d.ts.map +1 -1
- package/dist/schematics/migrations/v21-13-manifest-cache/index.js +4 -10
- package/dist/schematics/migrations/v22-0-cache-dir-rename/index.d.ts.map +1 -1
- package/dist/schematics/migrations/v22-0-cache-dir-rename/index.js +6 -10
- package/dist/schematics/ng-add/index.d.ts.map +1 -1
- package/dist/schematics/ng-add/index.js +122 -56
- package/dist/schematics/ng-add/schema.d.ts.map +1 -1
- package/dist/schematics/utils/config-ast.d.ts.map +1 -1
- package/dist/schematics/utils/config-ast.js +8 -15
- package/dist/schematics/utils/tsconfig-paths.d.ts.map +1 -1
- package/dist/schematics/utils/tsconfig-paths.js +1 -1
- package/dist/shared/canvas-bg.type.d.ts +5 -6
- package/dist/shared/canvas-bg.type.d.ts.map +1 -1
- package/dist/shared/canvas-bg.type.js +5 -13
- package/dist/shared/canvas-layout.type.d.ts.map +1 -1
- package/dist/shared/canvas-layout.type.js +1 -4
- package/dist/shared/measure.type.d.ts +52 -0
- package/dist/shared/measure.type.d.ts.map +1 -0
- package/dist/shared/measure.type.js +21 -0
- package/dist/shared/variant-bg.d.ts +20 -31
- package/dist/shared/variant-bg.d.ts.map +1 -1
- package/dist/shared/variant-bg.js +20 -31
- package/dist/shared/viewport.type.d.ts +43 -0
- package/dist/shared/viewport.type.d.ts.map +1 -0
- package/dist/shared/viewport.type.js +44 -0
- package/dist/transformer/cli.js +0 -0
- package/dist/transformer/index.d.ts +2 -2
- package/dist/transformer/index.d.ts.map +1 -1
- package/dist/transformer/index.js +2 -2
- package/dist/transformer/showcase-strip.transformer.d.ts.map +1 -1
- package/dist/transformer/showcase-strip.transformer.js +7 -16
- package/dist/transformer/strip-directory.d.ts.map +1 -1
- package/dist/transformer/strip-directory.js +2 -4
- package/package.json +5 -2
- package/schematics/collection.json +7 -7
- package/schematics/migrations.json +12 -12
- package/schematics/ng-add/schema.json +22 -22
- package/src/builder/build/schema.json +36 -36
- package/src/builder/serve/schema.json +37 -37
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prism-canvas.service.d.ts","sourceRoot":"","sources":["../../../src/app/services/prism-canvas.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,KAAK,QAAQ,EAAE,MAAM,gCAAgC,CAAC;;
|
|
1
|
+
{"version":3,"file":"prism-canvas.service.d.ts","sourceRoot":"","sources":["../../../src/app/services/prism-canvas.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,KAAK,QAAQ,EAAE,MAAM,gCAAgC,CAAC;;AAI3E,YAAY,EAAE,QAAQ,EAAE,CAAC;AAIzB,qBACa,kBAAkB;IAC3B,QAAQ,CAAC,EAAE,mDAA4B;IACvC,QAAQ,CAAC,IAAI,iDAAa;IAC1B,QAAQ,CAAC,MAAM,kDAAiB;IAChC,QAAQ,CAAC,MAAM,kDAAiB;IAEhC;;;;;;;;OAQG;IACH,QAAQ,CAAC,OAAO,kDAAiB;IAEjC;;;;;;;;;OASG;IACH,QAAQ,CAAC,aAAa,wDAA+B;IAErD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA+B;IAEvD;;;;;;;OAOG;IACH,OAAO,CAAC,iBAAiB,CAAoB;;IAW7C,KAAK,CAAC,EAAE,EAAE,QAAQ,GAAG,IAAI;IAKzB,OAAO,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI;IAKxB,YAAY,IAAI,IAAI;IAKpB,YAAY,IAAI,IAAI;IAKpB,aAAa,IAAI,IAAI;IAKrB,gBAAgB,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAYxC,cAAc,IAAI,IAAI;IAItB,OAAO,CAAC,eAAe;IAyBvB,OAAO,CAAC,IAAI;yCApHH,kBAAkB;;CAuI9B"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { inject, Injectable, signal } from '@angular/core';
|
|
2
2
|
import { CANVAS_BGS } from '../../shared/canvas-bg.type.js';
|
|
3
|
+
import { clampViewportWidth, VIEWPORT_DEFAULT } from '../../shared/viewport.type.js';
|
|
3
4
|
import { PrismCaptureService } from './prism-capture.service.js';
|
|
4
5
|
import * as i0 from "@angular/core";
|
|
5
6
|
const STORAGE_KEY = 'ng-prism-canvas';
|
|
@@ -12,12 +13,44 @@ export class PrismCanvasService {
|
|
|
12
13
|
...(ngDevMode ? [{ debugName: "guides" }] : /* istanbul ignore next */ []));
|
|
13
14
|
rulers = signal(false, /* @ts-ignore */
|
|
14
15
|
...(ngDevMode ? [{ debugName: "rulers" }] : /* istanbul ignore next */ []));
|
|
16
|
+
/**
|
|
17
|
+
* Whether the measuring tool is active.
|
|
18
|
+
*
|
|
19
|
+
* Lives here rather than in `PrismMeasureService` because it is the same
|
|
20
|
+
* kind of state as `guides` and `rulers`: a preference about the working
|
|
21
|
+
* environment, not a statement about this variant. That also means the
|
|
22
|
+
* toggle inherits the constructor's capture-mode behaviour below for
|
|
23
|
+
* free, without having to repeat it.
|
|
24
|
+
*/
|
|
25
|
+
measure = signal(false, /* @ts-ignore */
|
|
26
|
+
...(ngDevMode ? [{ debugName: "measure" }] : /* istanbul ignore next */ []));
|
|
27
|
+
/**
|
|
28
|
+
* The width `.demo-wrap` is constrained to, or `null` for "as wide as it
|
|
29
|
+
* wants".
|
|
30
|
+
*
|
|
31
|
+
* Nullable rather than a `0`/`-1` sentinel because "off" is a
|
|
32
|
+
* different state and not a width: the renderer keys a whole set of CSS off
|
|
33
|
+
* `[data-viewport]`, and a falsy number would make `viewportWidth() ? ... `
|
|
34
|
+
* silently treat a legal narrow width as "off" the moment the floor ever
|
|
35
|
+
* moved to 0.
|
|
36
|
+
*/
|
|
37
|
+
viewportWidth = signal(null, /* @ts-ignore */
|
|
38
|
+
...(ngDevMode ? [{ debugName: "viewportWidth" }] : /* istanbul ignore next */ []));
|
|
15
39
|
capture = inject(PrismCaptureService);
|
|
40
|
+
/**
|
|
41
|
+
* What `toggleViewport()` restores.
|
|
42
|
+
*
|
|
43
|
+
* Kept in a field rather than persisted: it exists so that flicking the rail
|
|
44
|
+
* button off and on again does not throw away a width you just dragged to,
|
|
45
|
+
* which is a within-session concern. The width that *is* worth carrying
|
|
46
|
+
* across sessions is the live one, and that is already in `viewportWidth`.
|
|
47
|
+
*/
|
|
48
|
+
lastViewportWidth = VIEWPORT_DEFAULT;
|
|
16
49
|
constructor() {
|
|
17
|
-
// Capture mode renders for a screenshot tool: persisted zoom, guides
|
|
18
|
-
// rulers would leak a previous session's state
|
|
19
|
-
// defaults (zoom 1, no guides, no rulers
|
|
20
|
-
// back.
|
|
50
|
+
// Capture mode renders for a screenshot tool: persisted zoom, guides,
|
|
51
|
+
// rulers and the measure toggle would leak a previous session's state
|
|
52
|
+
// into the image, so the defaults (zoom 1, no guides, no rulers, measure
|
|
53
|
+
// off) are kept and nothing is written back.
|
|
21
54
|
if (this.capture.active())
|
|
22
55
|
return;
|
|
23
56
|
this.loadFromStorage();
|
|
@@ -38,6 +71,24 @@ export class PrismCanvasService {
|
|
|
38
71
|
this.rulers.update((v) => !v);
|
|
39
72
|
this.save();
|
|
40
73
|
}
|
|
74
|
+
toggleMeasure() {
|
|
75
|
+
this.measure.update((v) => !v);
|
|
76
|
+
this.save();
|
|
77
|
+
}
|
|
78
|
+
setViewportWidth(w) {
|
|
79
|
+
if (w === null) {
|
|
80
|
+
this.viewportWidth.set(null);
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
const clamped = clampViewportWidth(w);
|
|
84
|
+
this.lastViewportWidth = clamped;
|
|
85
|
+
this.viewportWidth.set(clamped);
|
|
86
|
+
}
|
|
87
|
+
this.save();
|
|
88
|
+
}
|
|
89
|
+
toggleViewport() {
|
|
90
|
+
this.setViewportWidth(this.viewportWidth() === null ? this.lastViewportWidth : null);
|
|
91
|
+
}
|
|
41
92
|
loadFromStorage() {
|
|
42
93
|
try {
|
|
43
94
|
const raw = localStorage.getItem(STORAGE_KEY);
|
|
@@ -53,8 +104,17 @@ export class PrismCanvasService {
|
|
|
53
104
|
this.guides.set(d['guides']);
|
|
54
105
|
if (typeof d['rulers'] === 'boolean')
|
|
55
106
|
this.rulers.set(d['rulers']);
|
|
107
|
+
if (typeof d['measure'] === 'boolean')
|
|
108
|
+
this.measure.set(d['measure']);
|
|
109
|
+
if (typeof d['viewportWidth'] === 'number') {
|
|
110
|
+
const w = clampViewportWidth(d['viewportWidth']);
|
|
111
|
+
this.lastViewportWidth = w;
|
|
112
|
+
this.viewportWidth.set(w);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
catch {
|
|
116
|
+
// Malformed JSON or no storage access: keep the field defaults.
|
|
56
117
|
}
|
|
57
|
-
catch { }
|
|
58
118
|
}
|
|
59
119
|
save() {
|
|
60
120
|
if (this.capture.active())
|
|
@@ -65,9 +125,14 @@ export class PrismCanvasService {
|
|
|
65
125
|
zoom: this.zoom(),
|
|
66
126
|
guides: this.guides(),
|
|
67
127
|
rulers: this.rulers(),
|
|
128
|
+
measure: this.measure(),
|
|
129
|
+
viewportWidth: this.viewportWidth()
|
|
68
130
|
}));
|
|
69
131
|
}
|
|
70
|
-
catch {
|
|
132
|
+
catch {
|
|
133
|
+
// Storage may be full or disabled (e.g. private browsing); the
|
|
134
|
+
// canvas state just stays unpersisted for this session.
|
|
135
|
+
}
|
|
71
136
|
}
|
|
72
137
|
static ɵfac = function PrismCanvasService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || PrismCanvasService)(); };
|
|
73
138
|
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: PrismCanvasService, factory: PrismCanvasService.ɵfac, providedIn: 'root' });
|
|
@@ -6,59 +6,33 @@ export declare const CAPTURE_ATTRIBUTE = "data-prism-capture";
|
|
|
6
6
|
/**
|
|
7
7
|
* Everything capture mode makes see-through for `bg: 'transparent'`.
|
|
8
8
|
*
|
|
9
|
-
* A screenshot tool clips the
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* `prism-shell` is the *host element* the app bootstraps into, not the
|
|
21
|
-
* `div.prism-shell` inside its template — both are in the chain and either can
|
|
22
|
-
* be given a background, a `:host` rule being the easy way to do it by
|
|
23
|
-
* accident. `.prism-body` is the grid between the shell and `.prism-main` and
|
|
24
|
-
* is listed on the same insurance grounds.
|
|
25
|
-
*
|
|
26
|
-
* Scoped by `:has()` to a *transparent* stage, so the other five backgrounds
|
|
27
|
-
* behave exactly as before. Exported so a test can assert the invariant
|
|
28
|
-
* against the real DOM rather than against this list — the list is the
|
|
29
|
-
* fragile part of the feature. A renamed wrapper or a newly introduced
|
|
30
|
-
* painting layer turns the capture opaque again, and an opaque capture still
|
|
31
|
-
* looks correct; it just silently stops testing transparency.
|
|
9
|
+
* A screenshot tool clips the composited page, so the stage and every painting
|
|
10
|
+
* ancestor must clear together or the PNG comes back opaque. `html`, `body`,
|
|
11
|
+
* the `prism-shell` host element and `.prism-body` are insurance: ng-prism
|
|
12
|
+
* paints none of them, but an app stylesheet or a `:host` rule can. The
|
|
13
|
+
* browser's own backdrop above `html` needs `omitBackground: true` in the runner.
|
|
14
|
+
*
|
|
15
|
+
* Scoped by `:has()` to a transparent stage so the other backgrounds are
|
|
16
|
+
* untouched. Exported so a test can check it against the real DOM: a renamed
|
|
17
|
+
* wrapper or a new painting layer makes captures opaque again, and an opaque
|
|
18
|
+
* capture still looks correct.
|
|
32
19
|
*/
|
|
33
20
|
export declare const CAPTURE_TRANSPARENT_SELECTOR: string;
|
|
34
21
|
/**
|
|
35
|
-
* Capture-isolation mode.
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* the mode cannot do is make room that the viewport does not have — a
|
|
50
|
-
* component larger than the viewport still overflows, and sizing the viewport
|
|
51
|
-
* to fit is the runner's job.
|
|
52
|
-
*
|
|
53
|
-
* The flag is read once from the URL at construction time and never written
|
|
54
|
-
* back — {@link PrismUrlStateService} rebuilds the query string from scratch,
|
|
55
|
-
* so navigating inside the app drops `?capture=1` from the address bar while
|
|
56
|
-
* the mode itself stays on for the lifetime of the document.
|
|
57
|
-
*
|
|
58
|
-
* Reading in the constructor (rather than during `PrismUrlStateService.init()`)
|
|
59
|
-
* is deliberate: `PrismCanvasService` restores persisted zoom in *its* own
|
|
60
|
-
* constructor, which can run first, so anything init-order dependent would
|
|
61
|
-
* make zoom-locking racy.
|
|
22
|
+
* Capture-isolation mode, for external screenshot runners.
|
|
23
|
+
*
|
|
24
|
+
* Keeps the declared canvas colour but strips its pattern (or clears the whole
|
|
25
|
+
* paint chain for `bg: 'transparent'`), hides canvas chrome and every other
|
|
26
|
+
* shell region, locks zoom to 1 and freezes animation, so a variant renders the
|
|
27
|
+
* same on every run and a runner can screenshot `.demo-wrap` directly. It
|
|
28
|
+
* cannot make room the viewport lacks: sizing the viewport is the runner's job.
|
|
29
|
+
*
|
|
30
|
+
* The flag is read once from the URL in the constructor and never written back.
|
|
31
|
+
* {@link PrismUrlStateService} rebuilds the query string, so `?capture=1` leaves
|
|
32
|
+
* the address bar on navigation while the mode stays on. Reading it during
|
|
33
|
+
* `PrismUrlStateService.init()` instead would make zoom-locking racy:
|
|
34
|
+
* `PrismCanvasService` restores persisted zoom in its own constructor, which
|
|
35
|
+
* can run first.
|
|
62
36
|
*/
|
|
63
37
|
export declare class PrismCaptureService {
|
|
64
38
|
private readonly _active;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prism-capture.service.d.ts","sourceRoot":"","sources":["../../../src/app/services/prism-capture.service.ts"],"names":[],"mappings":";AAEA,sFAAsF;AACtF,eAAO,MAAM,aAAa,YAAY,CAAC;AAEvC,8DAA8D;AAC9D,eAAO,MAAM,iBAAiB,uBAAuB,CAAC;AAItD
|
|
1
|
+
{"version":3,"file":"prism-capture.service.d.ts","sourceRoot":"","sources":["../../../src/app/services/prism-capture.service.ts"],"names":[],"mappings":";AAEA,sFAAsF;AACtF,eAAO,MAAM,aAAa,YAAY,CAAC;AAEvC,8DAA8D;AAC9D,eAAO,MAAM,iBAAiB,uBAAuB,CAAC;AAItD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,4BAA4B,QAE4H,CAAC;AA2FtK;;;;;;;;;;;;;;;GAeG;AACH,qBACa,mBAAmB;IAC5B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA6F;IAErH,kEAAkE;IAClE,QAAQ,CAAC,MAAM,0CAA6B;;IAM5C,OAAO,CAAC,eAAe;yCAVd,mBAAmB;;CAoB/B;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAKzD"}
|
|
@@ -8,135 +8,66 @@ const STYLE_ELEMENT_ID = 'ng-prism-capture-styles';
|
|
|
8
8
|
/**
|
|
9
9
|
* Everything capture mode makes see-through for `bg: 'transparent'`.
|
|
10
10
|
*
|
|
11
|
-
* A screenshot tool clips the
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* `prism-shell` is the *host element* the app bootstraps into, not the
|
|
23
|
-
* `div.prism-shell` inside its template — both are in the chain and either can
|
|
24
|
-
* be given a background, a `:host` rule being the easy way to do it by
|
|
25
|
-
* accident. `.prism-body` is the grid between the shell and `.prism-main` and
|
|
26
|
-
* is listed on the same insurance grounds.
|
|
27
|
-
*
|
|
28
|
-
* Scoped by `:has()` to a *transparent* stage, so the other five backgrounds
|
|
29
|
-
* behave exactly as before. Exported so a test can assert the invariant
|
|
30
|
-
* against the real DOM rather than against this list — the list is the
|
|
31
|
-
* fragile part of the feature. A renamed wrapper or a newly introduced
|
|
32
|
-
* painting layer turns the capture opaque again, and an opaque capture still
|
|
33
|
-
* looks correct; it just silently stops testing transparency.
|
|
11
|
+
* A screenshot tool clips the composited page, so the stage and every painting
|
|
12
|
+
* ancestor must clear together or the PNG comes back opaque. `html`, `body`,
|
|
13
|
+
* the `prism-shell` host element and `.prism-body` are insurance: ng-prism
|
|
14
|
+
* paints none of them, but an app stylesheet or a `:host` rule can. The
|
|
15
|
+
* browser's own backdrop above `html` needs `omitBackground: true` in the runner.
|
|
16
|
+
*
|
|
17
|
+
* Scoped by `:has()` to a transparent stage so the other backgrounds are
|
|
18
|
+
* untouched. Exported so a test can check it against the real DOM: a renamed
|
|
19
|
+
* wrapper or a new painting layer makes captures opaque again, and an opaque
|
|
20
|
+
* capture still looks correct.
|
|
34
21
|
*/
|
|
35
22
|
export const CAPTURE_TRANSPARENT_SELECTOR = `[${CAPTURE_ATTRIBUTE}] .prism-canvas-stage[data-bg='transparent'],\n` +
|
|
36
23
|
`[${CAPTURE_ATTRIBUTE}] :is(html, body, prism-shell, .prism-shell, .prism-body, .prism-main, .prism-canvas-wrap):has(.prism-canvas-stage[data-bg='transparent'])`;
|
|
37
24
|
/**
|
|
38
25
|
* Everything capture mode removes from layout so the canvas owns the viewport.
|
|
39
26
|
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
* coordinates* of `.demo-wrap`, and `.demo-wrap` is centred in a stage that
|
|
44
|
-
* scrolls — so whenever the component is larger than the canvas viewport, its
|
|
45
|
-
* box extends past the canvas and the compositor fills those coordinates with
|
|
46
|
-
* whichever sibling lives there. Measured in Chromium against the real
|
|
47
|
-
* stylesheets, a 200x400 component at a 1280x720 viewport leaks 57px upwards
|
|
48
|
-
* into the variant ribbon and 121px downwards into the panel. That is neither
|
|
49
|
-
* a z-order nor a clipping bug: the capture target legitimately extends beyond
|
|
50
|
-
* its scroll container and the page paints something there.
|
|
51
|
-
*
|
|
52
|
-
* `display: none` rather than `visibility: hidden`, and this is the one thing
|
|
53
|
-
* not to "simplify" later. Keeping the layout box is the tempting minimal-churn
|
|
54
|
-
* fix — nothing re-centres, no unaffected baseline moves — and it does not
|
|
55
|
-
* work: the box still occupies its space, so what paints at those coordinates
|
|
56
|
-
* becomes `.prism-main`'s own background instead of the panel. Measured at the
|
|
57
|
-
* bottom row of a `bg: 'transparent'` capture: `#11284e` with the panel left
|
|
58
|
-
* alone, `#11284e` with `visibility: hidden`, transparent only once the panel
|
|
59
|
-
* leaves layout. The canvas is `flex: 1`; it has to reclaim the space for the
|
|
60
|
-
* stage to paint there, and only removal from layout gives it back.
|
|
27
|
+
* Runners screenshot the screen coordinates of `.demo-wrap`, which is centred
|
|
28
|
+
* in a scrolling stage. A component larger than the canvas extends past it,
|
|
29
|
+
* and whichever sibling region paints there (ribbon, panel) leaks into the image.
|
|
61
30
|
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
* baselines recorded in the meantime look perfectly fine while guarding the
|
|
66
|
-
* wrong image. At every level from the shell to the canvas wrap, the one child
|
|
67
|
-
* that leads to the stage survives and every sibling is removed, so a region
|
|
68
|
-
* added tomorrow is suppressed without anyone remembering this file exists.
|
|
31
|
+
* Use `display: none`, not `visibility: hidden`: a hidden box keeps its space
|
|
32
|
+
* and `.prism-main`'s background paints there instead. The canvas is `flex: 1`
|
|
33
|
+
* and only gets the space back once its siblings leave layout.
|
|
69
34
|
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
35
|
+
* Structural rather than a list of chrome selectors: at each level from the
|
|
36
|
+
* shell to the canvas wrap, the child leading to the stage survives and every
|
|
37
|
+
* sibling goes, so a new shell region is covered without touching this file.
|
|
38
|
+
* The grid track overrides in `CAPTURE_STYLES` are required too: without them
|
|
39
|
+
* the survivor lands in the first sized track and the canvas renders 52px tall
|
|
40
|
+
* or 264px wide.
|
|
74
41
|
*
|
|
75
|
-
* Scoped by `:has(.prism-canvas-stage)
|
|
76
|
-
*
|
|
77
|
-
* with an empty screenshot rather than an honest one.
|
|
42
|
+
* Scoped by `:has(.prism-canvas-stage)`: a component page or view panel has no
|
|
43
|
+
* canvas, and blanking the shell there would give an empty screenshot.
|
|
78
44
|
*/
|
|
79
|
-
const CAPTURE_CANVAS_ONLY_SELECTOR = `[${CAPTURE_ATTRIBUTE}] ` +
|
|
80
|
-
`:is(.prism-shell, .prism-body, .prism-main, .prism-canvas-wrap)` +
|
|
81
|
-
`:has(.prism-canvas-stage) > :not(:has(.prism-canvas-stage))`;
|
|
45
|
+
const CAPTURE_CANVAS_ONLY_SELECTOR = `[${CAPTURE_ATTRIBUTE}] ` + `:is(.prism-shell, .prism-body, .prism-main, .prism-canvas-wrap)` + `:has(.prism-canvas-stage) > :not(:has(.prism-canvas-stage))`;
|
|
82
46
|
/**
|
|
83
47
|
* Global stylesheet applied in capture mode.
|
|
84
48
|
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
* The
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
* {@link CAPTURE_CANVAS_ONLY_SELECTOR} down hand the whole viewport to the
|
|
108
|
-
* canvas, which is what makes the declared background reach the *whole* of the
|
|
109
|
-
* capture target's box rather than only the part that happens to fit inside
|
|
110
|
-
* the canvas viewport.
|
|
111
|
-
*
|
|
112
|
-
* The stage's padding goes with them, and it buys more than the 32px it looks
|
|
113
|
-
* like. The stage is `height: 100%` under `content-box`, so its padding lands
|
|
114
|
-
* *outside* that height: the stage is 64px taller than the row it sits in,
|
|
115
|
-
* overflows it, and centres the component 32px below the true centre of what
|
|
116
|
-
* is actually painted. Dropping the padding makes the stage exactly the canvas
|
|
117
|
-
* and the component's centre the viewport's centre, which turns the guarantee
|
|
118
|
-
* crisp — a component is contained iff it fits the viewport. Measured: a
|
|
119
|
-
* 200x700 component at 1280x720 still leaks 22px past the canvas with the
|
|
120
|
-
* regions gone but the padding kept. None of that padding is ever inside a
|
|
121
|
-
* `.demo-wrap` screenshot, so nothing is lost by removing it.
|
|
122
|
-
*
|
|
123
|
-
* The stage's edge goes with them, and it is stripped rather than reshaped for
|
|
124
|
-
* the same reason it exists in that shape at all. The edge is deliberately
|
|
125
|
-
* built from `outline` plus `box-shadow` and never from a border or padding,
|
|
126
|
-
* because neither participates in layout: `plugin-visual-regression`
|
|
127
|
-
* screenshots `.demo-wrap`, which is centred in the stage, and a border would
|
|
128
|
-
* shrink the stage's content box by 2px and move that centre, shifting every
|
|
129
|
-
* recorded baseline without a component having changed. Not participating in
|
|
130
|
-
* layout is not the same as not painting. `outline-offset: -1px` draws the
|
|
131
|
-
* line *inside* the border box, and with the padding above gone the stage edge
|
|
132
|
-
* sits flush against the component, so for anything whose `.demo-wrap` reaches
|
|
133
|
-
* it that 1px line and the shadow under it composite straight into the
|
|
134
|
-
* screenshot. So capture mode removes the paint and leaves the geometry
|
|
135
|
-
* untouched — the same division of labour the edge was chosen for, and the
|
|
136
|
-
* only one that keeps both halves of the guarantee.
|
|
137
|
-
*
|
|
138
|
-
* {@link CAPTURE_TRANSPARENT_SELECTOR} cannot cover this: it clears background
|
|
139
|
-
* colour, and an outline is not a background.
|
|
49
|
+
* Document-level because emulated encapsulation would stop a renderer rule from
|
|
50
|
+
* reaching the dynamically created showcase component's transitions and
|
|
51
|
+
* animations.
|
|
52
|
+
*
|
|
53
|
+
* `background-image` is stripped because the dot/checker pattern's phase shifts
|
|
54
|
+
* whenever the centred component resizes; the declared colour is deterministic
|
|
55
|
+
* and stays. `!important` is required to beat the component-scoped stage rules.
|
|
56
|
+
* `transparent` also drops the colour, across the layers in
|
|
57
|
+
* {@link CAPTURE_TRANSPARENT_SELECTOR}; alpha is per-pixel and does not shift.
|
|
58
|
+
* The rules from {@link CAPTURE_CANVAS_ONLY_SELECTOR} down give the canvas the
|
|
59
|
+
* whole viewport, so the background covers the capture target's whole box.
|
|
60
|
+
*
|
|
61
|
+
* The stage padding goes too. The stage is `height: 100%` under `content-box`,
|
|
62
|
+
* so the padding makes it 64px taller than its row and centres the component
|
|
63
|
+
* 32px too low. Without it the stage is the canvas, and a component is
|
|
64
|
+
* contained iff it fits the viewport.
|
|
65
|
+
*
|
|
66
|
+
* The stage edge is `outline` plus `box-shadow`, never a border, so it does not
|
|
67
|
+
* move `.demo-wrap`'s centre and shift baselines. It still paints, and with the
|
|
68
|
+
* padding gone it sits flush against the component, so capture mode removes the
|
|
69
|
+
* paint and keeps the geometry. {@link CAPTURE_TRANSPARENT_SELECTOR} does not
|
|
70
|
+
* cover this: an outline is not a background.
|
|
140
71
|
*/
|
|
141
72
|
const CAPTURE_STYLES = `
|
|
142
73
|
[${CAPTURE_ATTRIBUTE}] *,
|
|
@@ -177,38 +108,23 @@ ${CAPTURE_CANVAS_ONLY_SELECTOR} {
|
|
|
177
108
|
}
|
|
178
109
|
`;
|
|
179
110
|
/**
|
|
180
|
-
* Capture-isolation mode.
|
|
181
|
-
*
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
*
|
|
188
|
-
*
|
|
189
|
-
*
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
* the mode cannot do is make room that the viewport does not have — a
|
|
195
|
-
* component larger than the viewport still overflows, and sizing the viewport
|
|
196
|
-
* to fit is the runner's job.
|
|
197
|
-
*
|
|
198
|
-
* The flag is read once from the URL at construction time and never written
|
|
199
|
-
* back — {@link PrismUrlStateService} rebuilds the query string from scratch,
|
|
200
|
-
* so navigating inside the app drops `?capture=1` from the address bar while
|
|
201
|
-
* the mode itself stays on for the lifetime of the document.
|
|
202
|
-
*
|
|
203
|
-
* Reading in the constructor (rather than during `PrismUrlStateService.init()`)
|
|
204
|
-
* is deliberate: `PrismCanvasService` restores persisted zoom in *its* own
|
|
205
|
-
* constructor, which can run first, so anything init-order dependent would
|
|
206
|
-
* make zoom-locking racy.
|
|
111
|
+
* Capture-isolation mode, for external screenshot runners.
|
|
112
|
+
*
|
|
113
|
+
* Keeps the declared canvas colour but strips its pattern (or clears the whole
|
|
114
|
+
* paint chain for `bg: 'transparent'`), hides canvas chrome and every other
|
|
115
|
+
* shell region, locks zoom to 1 and freezes animation, so a variant renders the
|
|
116
|
+
* same on every run and a runner can screenshot `.demo-wrap` directly. It
|
|
117
|
+
* cannot make room the viewport lacks: sizing the viewport is the runner's job.
|
|
118
|
+
*
|
|
119
|
+
* The flag is read once from the URL in the constructor and never written back.
|
|
120
|
+
* {@link PrismUrlStateService} rebuilds the query string, so `?capture=1` leaves
|
|
121
|
+
* the address bar on navigation while the mode stays on. Reading it during
|
|
122
|
+
* `PrismUrlStateService.init()` instead would make zoom-locking racy:
|
|
123
|
+
* `PrismCanvasService` restores persisted zoom in its own constructor, which
|
|
124
|
+
* can run first.
|
|
207
125
|
*/
|
|
208
126
|
export class PrismCaptureService {
|
|
209
|
-
_active = signal(typeof window !== 'undefined'
|
|
210
|
-
? parseCaptureParam(window.location.search)
|
|
211
|
-
: false, /* @ts-ignore */
|
|
127
|
+
_active = signal(typeof window !== 'undefined' ? parseCaptureParam(window.location.search) : false, /* @ts-ignore */
|
|
212
128
|
...(ngDevMode ? [{ debugName: "_active" }] : /* istanbul ignore next */ []));
|
|
213
129
|
/** True while the app renders for an external screenshot tool. */
|
|
214
130
|
active = this._active.asReadonly();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prism-event-log.service.d.ts","sourceRoot":"","sources":["../../../src/app/services/prism-event-log.service.ts"],"names":[],"mappings":";AAEA,MAAM,WAAW,aAAa;
|
|
1
|
+
{"version":3,"file":"prism-event-log.service.d.ts","sourceRoot":"","sources":["../../../src/app/services/prism-event-log.service.ts"],"names":[],"mappings":";AAEA,MAAM,WAAW,aAAa;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;CAClB;AAED,qBACa,oBAAoB;IAC7B,QAAQ,CAAC,MAAM,0DAA+B;IAC9C,OAAO,CAAC,OAAO,CAAK;IAEpB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI;IAIvC,KAAK,IAAI,IAAI;yCARJ,oBAAoB;;CAWhC"}
|
|
@@ -5,10 +5,7 @@ export class PrismEventLogService {
|
|
|
5
5
|
...(ngDevMode ? [{ debugName: "events" }] : /* istanbul ignore next */ []));
|
|
6
6
|
_nextId = 0;
|
|
7
7
|
log(name, value) {
|
|
8
|
-
this.events.update((prev) => [
|
|
9
|
-
{ id: this._nextId++, timestamp: Date.now(), name, value },
|
|
10
|
-
...prev,
|
|
11
|
-
]);
|
|
8
|
+
this.events.update((prev) => [{ id: this._nextId++, timestamp: Date.now(), name, value }, ...prev]);
|
|
12
9
|
}
|
|
13
10
|
clear() {
|
|
14
11
|
this.events.set([]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prism-layout.service.d.ts","sourceRoot":"","sources":["../../../src/app/services/prism-layout.service.ts"],"names":[],"mappings":";AAIA,qBACa,kBAAkB;
|
|
1
|
+
{"version":3,"file":"prism-layout.service.d.ts","sourceRoot":"","sources":["../../../src/app/services/prism-layout.service.ts"],"names":[],"mappings":";AAIA,qBACa,kBAAkB;IAC3B,QAAQ,CAAC,cAAc,kDAAgB;IACvC,QAAQ,CAAC,aAAa,kDAAgB;IACtC,QAAQ,CAAC,cAAc,kDAAgB;IACvC,QAAQ,CAAC,iBAAiB,6DAAwC;IAClE,QAAQ,CAAC,YAAY,iDAAe;IACpC,QAAQ,CAAC,WAAW,iDAAe;IACnC,QAAQ,CAAC,UAAU,iDAAe;;IAMlC,aAAa,IAAI,IAAI;IAKrB,YAAY,IAAI,IAAI;IAKpB,aAAa,IAAI,IAAI;IAKrB,iBAAiB,IAAI,IAAI;IAKzB,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAKjC,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAKhC,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAK/B,OAAO,CAAC,eAAe;IAqBvB,OAAO,CAAC,aAAa;yCArEZ,kBAAkB;;CAkF9B"}
|
|
@@ -59,8 +59,7 @@ export class PrismLayoutService {
|
|
|
59
59
|
this.addonsVisible.set(d['addonsVisible']);
|
|
60
60
|
if (typeof d['toolbarVisible'] === 'boolean')
|
|
61
61
|
this.toolbarVisible.set(d['toolbarVisible']);
|
|
62
|
-
if (d['addonsOrientation'] === 'bottom' ||
|
|
63
|
-
d['addonsOrientation'] === 'right') {
|
|
62
|
+
if (d['addonsOrientation'] === 'bottom' || d['addonsOrientation'] === 'right') {
|
|
64
63
|
this.addonsOrientation.set(d['addonsOrientation']);
|
|
65
64
|
}
|
|
66
65
|
if (typeof d['sidebarWidth'] === 'number')
|
|
@@ -70,7 +69,9 @@ export class PrismLayoutService {
|
|
|
70
69
|
if (typeof d['panelWidth'] === 'number')
|
|
71
70
|
this.panelWidth.set(Math.max(200, Math.min(600, d['panelWidth'])));
|
|
72
71
|
}
|
|
73
|
-
catch {
|
|
72
|
+
catch {
|
|
73
|
+
// Malformed JSON or no storage access: keep the field defaults.
|
|
74
|
+
}
|
|
74
75
|
}
|
|
75
76
|
saveToStorage() {
|
|
76
77
|
const data = {
|
|
@@ -80,7 +81,7 @@ export class PrismLayoutService {
|
|
|
80
81
|
addonsOrientation: this.addonsOrientation(),
|
|
81
82
|
sidebarWidth: this.sidebarWidth(),
|
|
82
83
|
panelHeight: this.panelHeight(),
|
|
83
|
-
panelWidth: this.panelWidth()
|
|
84
|
+
panelWidth: this.panelWidth()
|
|
84
85
|
};
|
|
85
86
|
localStorage.setItem(STORAGE_KEY, JSON.stringify(data));
|
|
86
87
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { RuntimeComponent, RuntimeManifest } from '../../plugin/plugin.types.js';
|
|
2
1
|
import type { StyleguidePage } from '../../plugin/page.types.js';
|
|
2
|
+
import type { RuntimeComponent, RuntimeManifest } from '../../plugin/plugin.types.js';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export declare class PrismManifestService {
|
|
5
5
|
private readonly _manifest;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prism-manifest.service.d.ts","sourceRoot":"","sources":["../../../src/app/services/prism-manifest.service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"prism-manifest.service.d.ts","sourceRoot":"","sources":["../../../src/app/services/prism-manifest.service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;;AAGtF,qBACa,oBAAoB;IAC7B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAmD;IAE7E,QAAQ,CAAC,QAAQ,kDAA+B;IAEhD,QAAQ,CAAC,UAAU,qDAAmE;IAEtF,QAAQ,CAAC,KAAK,mDAAkE;IAEhF,QAAQ,CAAC,UAAU,2CA0BhB;IAEH,QAAQ,CAAC,iBAAiB,kEAYvB;IAEH,cAAc,CAAC,QAAQ,EAAE,eAAe,GAAG,IAAI;yCAnDtC,oBAAoB;;CAsDhC"}
|
|
@@ -19,7 +19,7 @@ export class PrismManifestService {
|
|
|
19
19
|
orderMap.set(cat, order);
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
for (const page of
|
|
22
|
+
for (const page of manifest.pages ?? []) {
|
|
23
23
|
const cat = page.category ?? 'Uncategorized';
|
|
24
24
|
if (!orderMap.has(cat)) {
|
|
25
25
|
orderMap.set(cat, Infinity);
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { Measurement, MeasurePoint } from '../../shared/measure.type.js';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* The transient state of the measuring tool.
|
|
5
|
+
*
|
|
6
|
+
* Deliberately separate from `PrismCanvasService`, which holds durable
|
|
7
|
+
* preferences: the toggle lives there, the measurements live here. None of
|
|
8
|
+
* this is persisted — rescuing a half-finished measurement across a reload
|
|
9
|
+
* would be a burden, not a convenience.
|
|
10
|
+
*/
|
|
11
|
+
export declare class PrismMeasureService {
|
|
12
|
+
private readonly navigation;
|
|
13
|
+
private readonly renderer;
|
|
14
|
+
private readonly canvas;
|
|
15
|
+
private readonly _draft;
|
|
16
|
+
private readonly _pins;
|
|
17
|
+
private readonly _hoverAnchor;
|
|
18
|
+
/** The measurement in progress, for as long as the pointer is down. */
|
|
19
|
+
readonly draft: import("@angular/core").Signal<Measurement | null>;
|
|
20
|
+
/** Pinned measurements, in the order they were set. */
|
|
21
|
+
readonly pins: import("@angular/core").Signal<readonly Measurement[]>;
|
|
22
|
+
/** The element fixed by click for alt-hover mode. */
|
|
23
|
+
readonly hoverAnchor: import("@angular/core").Signal<Element | null>;
|
|
24
|
+
constructor();
|
|
25
|
+
beginDraft(a: MeasurePoint): void;
|
|
26
|
+
updateDraft(b: MeasurePoint): void;
|
|
27
|
+
commitDraft(): void;
|
|
28
|
+
cancelDraft(): void;
|
|
29
|
+
removePin(index: number): void;
|
|
30
|
+
setHoverAnchor(element: Element | null): void;
|
|
31
|
+
/**
|
|
32
|
+
* What happens when the tool is switched off.
|
|
33
|
+
*
|
|
34
|
+
* Deliberately not `clearAll()`: the toggle is a mode, not a reset. Anyone
|
|
35
|
+
* who hits the rail by accident must not lose the pinned measurements —
|
|
36
|
+
* the running one, on the other hand, no longer makes sense without a
|
|
37
|
+
* pointer, and an anchor with no visible overlay even less so.
|
|
38
|
+
*/
|
|
39
|
+
suspend(): void;
|
|
40
|
+
clearAll(): void;
|
|
41
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PrismMeasureService, never>;
|
|
42
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=prism-measure.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prism-measure.service.d.ts","sourceRoot":"","sources":["../../../src/app/services/prism-measure.service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;;AAK9E;;;;;;;GAOG;AACH,qBACa,mBAAmB;IAC5B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAkC;IAC7D,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAgC;IACzD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA8B;IAErD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAoC;IAC3D,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAsC;IAC5D,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAgC;IAE7D,uEAAuE;IACvE,QAAQ,CAAC,KAAK,qDAA4B;IAE1C,uDAAuD;IACvD,QAAQ,CAAC,IAAI,yDAA2B;IAExC,qDAAqD;IACrD,QAAQ,CAAC,WAAW,iDAAkC;;IAmBtD,UAAU,CAAC,CAAC,EAAE,YAAY,GAAG,IAAI;IAIjC,WAAW,CAAC,CAAC,EAAE,YAAY,GAAG,IAAI;IAIlC,WAAW,IAAI,IAAI;IAQnB,WAAW,IAAI,IAAI;IAInB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAI9B,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,GAAG,IAAI;IAI7C;;;;;;;OAOG;IACH,OAAO,IAAI,IAAI;IAKf,QAAQ,IAAI,IAAI;yCA5EP,mBAAmB;;CAiF/B"}
|