@ng-prism/core 22.3.0 → 22.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -13
- 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 +35 -37
- 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-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-toolbar.component.d.ts +22 -39
- package/dist/app/canvas/prism-canvas-toolbar.component.d.ts.map +1 -1
- package/dist/app/canvas/prism-canvas-toolbar.component.js +61 -69
- package/dist/app/canvas/prism-template-popover.component.js +1 -1
- package/dist/app/canvas/viewport-snap.d.ts +1 -1
- package/dist/app/canvas/viewport-snap.js +1 -1
- package/dist/app/component-head/head-metrics.d.ts +2 -2
- package/dist/app/component-head/head-metrics.js +1 -1
- package/dist/app/component-head/prism-component-head.component.d.ts +2 -2
- package/dist/app/component-head/prism-component-head.component.d.ts.map +1 -1
- package/dist/app/component-head/prism-component-head.component.js +11 -18
- package/dist/app/component-head/prism-head-gauge.component.js +1 -1
- package/dist/app/component-head/prism-head-info.component.d.ts +1 -1
- package/dist/app/component-head/prism-head-info.component.js +2 -2
- package/dist/app/component-head/prism-stat.component.d.ts +1 -1
- package/dist/app/component-head/prism-stat.component.js +2 -2
- package/dist/app/directives/prism-resizer.directive.d.ts +1 -1
- package/dist/app/directives/prism-resizer.directive.js +2 -2
- package/dist/app/directives/resize-value.d.ts +2 -2
- package/dist/app/directives/resize-value.js +2 -2
- 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 +11 -15
- package/dist/app/header/prism-header.component.js +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 +3 -2
- package/dist/app/icons/prism-icon.component.d.ts +2 -2
- package/dist/app/icons/prism-icon.component.js +4 -4
- package/dist/app/index.d.ts.map +1 -1
- package/dist/app/index.js +14 -21
- package/dist/app/overview/overview-visibility.d.ts +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 +9 -10
- package/dist/app/overview/prism-overview.component.d.ts +2 -2
- package/dist/app/overview/prism-overview.component.js +2 -2
- package/dist/app/page-renderer/prism-page-renderer.component.js +1 -1
- package/dist/app/panels/a11y/a11y-audit.service.js +2 -2
- 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 +3 -4
- 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 +1 -1
- 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-navigation-decorations.d.ts +1 -1
- package/dist/app/panels/builtin-navigation-decorations.js +1 -1
- package/dist/app/panels/controls/non-editable-input-types.js +1 -1
- package/dist/app/panels/panel-host/panel-badge.d.ts +1 -1
- package/dist/app/provide-prism.js +1 -1
- package/dist/app/renderer/known-inputs.d.ts +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 +9 -4
- package/dist/app/renderer/prism-renderer.component.d.ts +3 -3
- package/dist/app/renderer/prism-renderer.component.d.ts.map +1 -1
- package/dist/app/renderer/prism-renderer.component.js +25 -16
- package/dist/app/renderer/projectable-content.js +3 -3
- package/dist/app/services/prism-canvas.service.d.ts +12 -1
- package/dist/app/services/prism-canvas.service.d.ts.map +1 -1
- package/dist/app/services/prism-canvas.service.js +23 -5
- 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 +60 -140
- 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-panel.service.d.ts +2 -2
- package/dist/app/services/prism-panel.service.js +2 -2
- package/dist/app/services/prism-persistence.service.js +1 -1
- package/dist/app/services/prism-renderer.service.js +1 -1
- package/dist/app/services/prism-url-state.service.js +1 -1
- 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 +10 -24
- 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 +10 -16
- package/dist/app/shell/prism-shell.component.d.ts.map +1 -1
- package/dist/app/shell/prism-shell.component.js +12 -9
- package/dist/app/sidebar/navigation-decorations.d.ts +4 -4
- package/dist/app/sidebar/navigation-decorations.js +2 -2
- package/dist/app/sidebar/prism-sidebar.component.d.ts +2 -2
- package/dist/app/sidebar/prism-sidebar.component.js +3 -3
- package/dist/app/theme/prism-default-theme.js +3 -3
- package/dist/app/variant-ribbon/spectrum.d.ts +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.js +1 -1
- package/dist/builder/a11y/a11y-report-reader.d.ts +1 -1
- package/dist/builder/a11y/a11y-report-reader.js +1 -1
- package/dist/builder/manifest/runtime-manifest.generator.js +6 -2
- package/dist/builder/plugin-runner/plugin-runner.js +1 -1
- 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 +337 -31
- 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 +106 -58
- 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 +153 -55
- package/dist/builder/scanner/manifest.generator.js +6 -2
- 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 +6 -4
- 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/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 +12 -14
- package/dist/builder/watcher/prism-watcher.js +2 -2
- 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.map +1 -1
- package/dist/plugin/index.js +5 -9
- package/dist/plugin/plugin.types.d.ts +30 -13
- package/dist/plugin/plugin.types.d.ts.map +1 -1
- package/dist/schematics/migrations/v22-0-cache-dir-rename/index.js +2 -2
- package/dist/schematics/ng-add/index.js +4 -4
- 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 +4 -5
- 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 +15 -19
- package/dist/shared/viewport.type.d.ts.map +1 -1
- package/dist/shared/viewport.type.js +15 -19
- package/dist/transformer/showcase-strip.transformer.js +1 -1
- package/package.json +5 -5
|
@@ -8,133 +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
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))`;
|
|
80
46
|
/**
|
|
81
47
|
* Global stylesheet applied in capture mode.
|
|
82
48
|
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
* The
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
* {@link CAPTURE_CANVAS_ONLY_SELECTOR} down hand the whole viewport to the
|
|
106
|
-
* canvas, which is what makes the declared background reach the *whole* of the
|
|
107
|
-
* capture target's box rather than only the part that happens to fit inside
|
|
108
|
-
* the canvas viewport.
|
|
109
|
-
*
|
|
110
|
-
* The stage's padding goes with them, and it buys more than the 32px it looks
|
|
111
|
-
* like. The stage is `height: 100%` under `content-box`, so its padding lands
|
|
112
|
-
* *outside* that height: the stage is 64px taller than the row it sits in,
|
|
113
|
-
* overflows it, and centres the component 32px below the true centre of what
|
|
114
|
-
* is actually painted. Dropping the padding makes the stage exactly the canvas
|
|
115
|
-
* and the component's centre the viewport's centre, which turns the guarantee
|
|
116
|
-
* crisp — a component is contained iff it fits the viewport. Measured: a
|
|
117
|
-
* 200x700 component at 1280x720 still leaks 22px past the canvas with the
|
|
118
|
-
* regions gone but the padding kept. None of that padding is ever inside a
|
|
119
|
-
* `.demo-wrap` screenshot, so nothing is lost by removing it.
|
|
120
|
-
*
|
|
121
|
-
* The stage's edge goes with them, and it is stripped rather than reshaped for
|
|
122
|
-
* the same reason it exists in that shape at all. The edge is deliberately
|
|
123
|
-
* built from `outline` plus `box-shadow` and never from a border or padding,
|
|
124
|
-
* because neither participates in layout: `plugin-visual-regression`
|
|
125
|
-
* screenshots `.demo-wrap`, which is centred in the stage, and a border would
|
|
126
|
-
* shrink the stage's content box by 2px and move that centre, shifting every
|
|
127
|
-
* recorded baseline without a component having changed. Not participating in
|
|
128
|
-
* layout is not the same as not painting. `outline-offset: -1px` draws the
|
|
129
|
-
* line *inside* the border box, and with the padding above gone the stage edge
|
|
130
|
-
* sits flush against the component, so for anything whose `.demo-wrap` reaches
|
|
131
|
-
* it that 1px line and the shadow under it composite straight into the
|
|
132
|
-
* screenshot. So capture mode removes the paint and leaves the geometry
|
|
133
|
-
* untouched — the same division of labour the edge was chosen for, and the
|
|
134
|
-
* only one that keeps both halves of the guarantee.
|
|
135
|
-
*
|
|
136
|
-
* {@link CAPTURE_TRANSPARENT_SELECTOR} cannot cover this: it clears background
|
|
137
|
-
* 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.
|
|
138
71
|
*/
|
|
139
72
|
const CAPTURE_STYLES = `
|
|
140
73
|
[${CAPTURE_ATTRIBUTE}] *,
|
|
@@ -175,33 +108,20 @@ ${CAPTURE_CANVAS_ONLY_SELECTOR} {
|
|
|
175
108
|
}
|
|
176
109
|
`;
|
|
177
110
|
/**
|
|
178
|
-
* Capture-isolation mode.
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
*
|
|
188
|
-
*
|
|
189
|
-
*
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
* the mode cannot do is make room that the viewport does not have — a
|
|
193
|
-
* component larger than the viewport still overflows, and sizing the viewport
|
|
194
|
-
* to fit is the runner's job.
|
|
195
|
-
*
|
|
196
|
-
* The flag is read once from the URL at construction time and never written
|
|
197
|
-
* back — {@link PrismUrlStateService} rebuilds the query string from scratch,
|
|
198
|
-
* so navigating inside the app drops `?capture=1` from the address bar while
|
|
199
|
-
* the mode itself stays on for the lifetime of the document.
|
|
200
|
-
*
|
|
201
|
-
* Reading in the constructor (rather than during `PrismUrlStateService.init()`)
|
|
202
|
-
* is deliberate: `PrismCanvasService` restores persisted zoom in *its* own
|
|
203
|
-
* constructor, which can run first, so anything init-order dependent would
|
|
204
|
-
* 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.
|
|
205
125
|
*/
|
|
206
126
|
export class PrismCaptureService {
|
|
207
127
|
_active = signal(typeof window !== 'undefined' ? parseCaptureParam(window.location.search) : false, /* @ts-ignore */
|
|
@@ -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"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { effect, inject, Injectable, signal } from '@angular/core';
|
|
2
|
+
import { PrismCanvasService } from './prism-canvas.service.js';
|
|
3
|
+
import { PrismNavigationService } from './prism-navigation.service.js';
|
|
4
|
+
import { PrismRendererService } from './prism-renderer.service.js';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
/**
|
|
7
|
+
* The transient state of the measuring tool.
|
|
8
|
+
*
|
|
9
|
+
* Deliberately separate from `PrismCanvasService`, which holds durable
|
|
10
|
+
* preferences: the toggle lives there, the measurements live here. None of
|
|
11
|
+
* this is persisted — rescuing a half-finished measurement across a reload
|
|
12
|
+
* would be a burden, not a convenience.
|
|
13
|
+
*/
|
|
14
|
+
export class PrismMeasureService {
|
|
15
|
+
navigation = inject(PrismNavigationService);
|
|
16
|
+
renderer = inject(PrismRendererService);
|
|
17
|
+
canvas = inject(PrismCanvasService);
|
|
18
|
+
_draft = signal(null, /* @ts-ignore */
|
|
19
|
+
...(ngDevMode ? [{ debugName: "_draft" }] : /* istanbul ignore next */ []));
|
|
20
|
+
_pins = signal([], /* @ts-ignore */
|
|
21
|
+
...(ngDevMode ? [{ debugName: "_pins" }] : /* istanbul ignore next */ []));
|
|
22
|
+
_hoverAnchor = signal(null, /* @ts-ignore */
|
|
23
|
+
...(ngDevMode ? [{ debugName: "_hoverAnchor" }] : /* istanbul ignore next */ []));
|
|
24
|
+
/** The measurement in progress, for as long as the pointer is down. */
|
|
25
|
+
draft = this._draft.asReadonly();
|
|
26
|
+
/** Pinned measurements, in the order they were set. */
|
|
27
|
+
pins = this._pins.asReadonly();
|
|
28
|
+
/** The element fixed by click for alt-hover mode. */
|
|
29
|
+
hoverAnchor = this._hoverAnchor.asReadonly();
|
|
30
|
+
constructor() {
|
|
31
|
+
// The same mechanism by which PrismVariantBgService lets its override
|
|
32
|
+
// lapse. Both are statements about *this* variant.
|
|
33
|
+
effect(() => {
|
|
34
|
+
this.navigation.activeComponent();
|
|
35
|
+
this.renderer.activeVariantIndex();
|
|
36
|
+
this.clearAll();
|
|
37
|
+
});
|
|
38
|
+
// Hangs off the toggle, not the variant, which is why it calls
|
|
39
|
+
// `suspend()` instead of `clearAll()`.
|
|
40
|
+
effect(() => {
|
|
41
|
+
if (this.canvas.measure())
|
|
42
|
+
return;
|
|
43
|
+
this.suspend();
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
beginDraft(a) {
|
|
47
|
+
this._draft.set({ a, b: a });
|
|
48
|
+
}
|
|
49
|
+
updateDraft(b) {
|
|
50
|
+
this._draft.update((d) => (d ? { a: d.a, b } : null));
|
|
51
|
+
}
|
|
52
|
+
commitDraft() {
|
|
53
|
+
const draft = this._draft();
|
|
54
|
+
if (!draft)
|
|
55
|
+
return;
|
|
56
|
+
this._pins.update((pins) => [...pins, draft]);
|
|
57
|
+
this._draft.set(null);
|
|
58
|
+
}
|
|
59
|
+
cancelDraft() {
|
|
60
|
+
this._draft.set(null);
|
|
61
|
+
}
|
|
62
|
+
removePin(index) {
|
|
63
|
+
this._pins.update((pins) => pins.filter((_, i) => i !== index));
|
|
64
|
+
}
|
|
65
|
+
setHoverAnchor(element) {
|
|
66
|
+
this._hoverAnchor.set(element);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* What happens when the tool is switched off.
|
|
70
|
+
*
|
|
71
|
+
* Deliberately not `clearAll()`: the toggle is a mode, not a reset. Anyone
|
|
72
|
+
* who hits the rail by accident must not lose the pinned measurements —
|
|
73
|
+
* the running one, on the other hand, no longer makes sense without a
|
|
74
|
+
* pointer, and an anchor with no visible overlay even less so.
|
|
75
|
+
*/
|
|
76
|
+
suspend() {
|
|
77
|
+
this._draft.set(null);
|
|
78
|
+
this._hoverAnchor.set(null);
|
|
79
|
+
}
|
|
80
|
+
clearAll() {
|
|
81
|
+
this._draft.set(null);
|
|
82
|
+
this._pins.set([]);
|
|
83
|
+
this._hoverAnchor.set(null);
|
|
84
|
+
}
|
|
85
|
+
static ɵfac = function PrismMeasureService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || PrismMeasureService)(); };
|
|
86
|
+
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: PrismMeasureService, factory: PrismMeasureService.ɵfac, providedIn: 'root' });
|
|
87
|
+
}
|
|
88
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PrismMeasureService, [{
|
|
89
|
+
type: Injectable,
|
|
90
|
+
args: [{ providedIn: 'root' }]
|
|
91
|
+
}], () => [], null); })();
|
|
@@ -13,9 +13,9 @@ export declare class PrismPanelService {
|
|
|
13
13
|
/**
|
|
14
14
|
* Every panel that renders as a view tab, builtin before plugin.
|
|
15
15
|
*
|
|
16
|
-
* Unfiltered
|
|
16
|
+
* Unfiltered because `prism-view-panel-host` resolves the active view
|
|
17
17
|
* through this list. Filtering here would let the host come up empty for a
|
|
18
|
-
* frame whenever a component switch invalidates the active view
|
|
18
|
+
* frame whenever a component switch invalidates the active view, because the
|
|
19
19
|
* fallback in `prism-shell` runs in the same change-detection round.
|
|
20
20
|
*/
|
|
21
21
|
readonly viewPanels: import("@angular/core").Signal<PanelDefinition[]>;
|
|
@@ -18,9 +18,9 @@ export class PrismPanelService {
|
|
|
18
18
|
/**
|
|
19
19
|
* Every panel that renders as a view tab, builtin before plugin.
|
|
20
20
|
*
|
|
21
|
-
* Unfiltered
|
|
21
|
+
* Unfiltered because `prism-view-panel-host` resolves the active view
|
|
22
22
|
* through this list. Filtering here would let the host come up empty for a
|
|
23
|
-
* frame whenever a component switch invalidates the active view
|
|
23
|
+
* frame whenever a component switch invalidates the active view, because the
|
|
24
24
|
* fallback in `prism-shell` runs in the same change-detection round.
|
|
25
25
|
*/
|
|
26
26
|
viewPanels = computed(() => [...this.builtinPanels.filter((p) => p.placement === 'view'), ...this.pluginService.viewPanels()], /* @ts-ignore */
|
|
@@ -23,7 +23,7 @@ export class PrismPersistenceService {
|
|
|
23
23
|
init() {
|
|
24
24
|
if (this.config.persistState === false)
|
|
25
25
|
return;
|
|
26
|
-
// Capture mode must render a variant
|
|
26
|
+
// Capture mode must render a variant as the manifest declares it;
|
|
27
27
|
// restoring a previous session's control values would silently change what
|
|
28
28
|
// an external screenshot tool captures.
|
|
29
29
|
if (this.capture.active())
|
|
@@ -136,7 +136,7 @@ export class PrismRendererService {
|
|
|
136
136
|
}
|
|
137
137
|
applyVariant(index, comp) {
|
|
138
138
|
const { values, activeContent } = computeVariantState(comp, index, {
|
|
139
|
-
onUnknownInput: (variantName, key) => console.warn(`[ng-prism] Variant "${variantName}" references unknown input "${key}" on ${comp.meta.className}
|
|
139
|
+
onUnknownInput: (variantName, key) => console.warn(`[ng-prism] Variant "${variantName}" references unknown input "${key}" on ${comp.meta.className}, ignoring.`)
|
|
140
140
|
});
|
|
141
141
|
this.inputValues.set(values);
|
|
142
142
|
this.activeContent.set(activeContent);
|
|
@@ -77,7 +77,7 @@ export class PrismUrlStateService {
|
|
|
77
77
|
writeToUrl(item, variantIndex, viewId, panelId) {
|
|
78
78
|
// Built from scratch, never from the current search string: parameters the
|
|
79
79
|
// app does not own must not survive a navigation. `?capture=1` relies on
|
|
80
|
-
// this
|
|
80
|
+
// this; the "capture flag" specs pin the guarantee.
|
|
81
81
|
const params = new URLSearchParams();
|
|
82
82
|
if (item?.kind === 'component') {
|
|
83
83
|
params.set(PARAM_COMPONENT, item.data.meta.className);
|
|
@@ -11,32 +11,18 @@ export declare class PrismVariantBgService {
|
|
|
11
11
|
/**
|
|
12
12
|
* The background the stage actually paints.
|
|
13
13
|
*
|
|
14
|
-
* Capture mode
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* them would pin the wrong image.
|
|
14
|
+
* Capture mode uses the declared background, since a component must be
|
|
15
|
+
* judged on the surface it was designed for, and ignores the user override,
|
|
16
|
+
* which is session UI state and must not shape a baseline. Patterns are
|
|
17
|
+
* stripped separately in `CAPTURE_STYLES`.
|
|
19
18
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* in `CAPTURE_STYLES`, which strips the pattern and leaves the colour. Colour
|
|
25
|
-
* is deterministic; the pattern is not.
|
|
19
|
+
* With nothing declared, capture uses {@link DEFAULT_VARIANT_BG}, not the
|
|
20
|
+
* canvas default: `dots` paints a theme token, so the baseline would depend
|
|
21
|
+
* on the runner's theme. It is also what the discovery manifest reports, so
|
|
22
|
+
* the reported and the captured background cannot drift apart.
|
|
26
23
|
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* *theme* token, so the surface behind an undeclared component would depend
|
|
30
|
-
* on whichever theme the runner's browser started in — a baseline that
|
|
31
|
-
* flips with a persisted UI preference. The fixed default is also exactly
|
|
32
|
-
* what the discovery manifest reports for the variant, so what a tool is
|
|
33
|
-
* told and what it screenshots cannot drift apart. That default is
|
|
34
|
-
* `transparent`, which removes the theme dependency outright instead of
|
|
35
|
-
* pinning one theme's colour: an undeclared variant has no opinion about its
|
|
36
|
-
* surface, and no surface is the honest capture of that.
|
|
37
|
-
*
|
|
38
|
-
* Interactive mode keeps `canvas.bg()`: there the dot grid on the themed
|
|
39
|
-
* surface is the point, and forcing `light` would break dark-theme browsing.
|
|
24
|
+
* Interactive mode keeps `canvas.bg()`: browsing wants the themed dot grid,
|
|
25
|
+
* and forcing `light` would break dark-theme browsing.
|
|
40
26
|
*/
|
|
41
27
|
readonly effective: import("@angular/core").Signal<CanvasBg>;
|
|
42
28
|
/** True when the user's override differs from the (non-null) recommended bg. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prism-variant-bg.service.d.ts","sourceRoot":"","sources":["../../../src/app/services/prism-variant-bg.service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;;AAO/D,qBACa,qBAAqB;IAC9B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA8B;IACrD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAkC;IAC7D,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAgC;IACzD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA+B;IAEvD,QAAQ,CAAC,WAAW,kDAKjB;IAEH,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAiC;IAC3D,QAAQ,CAAC,QAAQ,kDAA+B;IAEhD
|
|
1
|
+
{"version":3,"file":"prism-variant-bg.service.d.ts","sourceRoot":"","sources":["../../../src/app/services/prism-variant-bg.service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;;AAO/D,qBACa,qBAAqB;IAC9B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA8B;IACrD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAkC;IAC7D,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAgC;IACzD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA+B;IAEvD,QAAQ,CAAC,WAAW,kDAKjB;IAEH,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAiC;IAC3D,QAAQ,CAAC,QAAQ,kDAA+B;IAEhD;;;;;;;;;;;;;;;OAeG;IACH,QAAQ,CAAC,SAAS,2CAEhB;IAEF,gFAAgF;IAChF,QAAQ,CAAC,WAAW,0CAKjB;;IAUH,WAAW,CAAC,EAAE,EAAE,QAAQ,GAAG,IAAI;IAI/B,aAAa,IAAI,IAAI;yCAxDZ,qBAAqB;;CA2DjC"}
|
|
@@ -23,32 +23,18 @@ export class PrismVariantBgService {
|
|
|
23
23
|
/**
|
|
24
24
|
* The background the stage actually paints.
|
|
25
25
|
*
|
|
26
|
-
* Capture mode
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* them would pin the wrong image.
|
|
26
|
+
* Capture mode uses the declared background, since a component must be
|
|
27
|
+
* judged on the surface it was designed for, and ignores the user override,
|
|
28
|
+
* which is session UI state and must not shape a baseline. Patterns are
|
|
29
|
+
* stripped separately in `CAPTURE_STYLES`.
|
|
31
30
|
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* in `CAPTURE_STYLES`, which strips the pattern and leaves the colour. Colour
|
|
37
|
-
* is deterministic; the pattern is not.
|
|
31
|
+
* With nothing declared, capture uses {@link DEFAULT_VARIANT_BG}, not the
|
|
32
|
+
* canvas default: `dots` paints a theme token, so the baseline would depend
|
|
33
|
+
* on the runner's theme. It is also what the discovery manifest reports, so
|
|
34
|
+
* the reported and the captured background cannot drift apart.
|
|
38
35
|
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
* *theme* token, so the surface behind an undeclared component would depend
|
|
42
|
-
* on whichever theme the runner's browser started in — a baseline that
|
|
43
|
-
* flips with a persisted UI preference. The fixed default is also exactly
|
|
44
|
-
* what the discovery manifest reports for the variant, so what a tool is
|
|
45
|
-
* told and what it screenshots cannot drift apart. That default is
|
|
46
|
-
* `transparent`, which removes the theme dependency outright instead of
|
|
47
|
-
* pinning one theme's colour: an undeclared variant has no opinion about its
|
|
48
|
-
* surface, and no surface is the honest capture of that.
|
|
49
|
-
*
|
|
50
|
-
* Interactive mode keeps `canvas.bg()`: there the dot grid on the themed
|
|
51
|
-
* surface is the point, and forcing `light` would break dark-theme browsing.
|
|
36
|
+
* Interactive mode keeps `canvas.bg()`: browsing wants the themed dot grid,
|
|
37
|
+
* and forcing `light` would break dark-theme browsing.
|
|
52
38
|
*/
|
|
53
39
|
effective = computed(() => this.capture.active() ? (this.recommended() ?? DEFAULT_VARIANT_BG) : (this._override() ?? this.recommended() ?? this.canvas.bg()), /* @ts-ignore */
|
|
54
40
|
...(ngDevMode ? [{ debugName: "effective" }] : /* istanbul ignore next */ []));
|
|
@@ -2,21 +2,15 @@ import * as i0 from "@angular/core";
|
|
|
2
2
|
/**
|
|
3
3
|
* Library-wide metric badge for the header.
|
|
4
4
|
*
|
|
5
|
-
* Presentational only
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* regression in their plugins) owning their own data logic while sharing one
|
|
9
|
-
* appearance.
|
|
5
|
+
* Presentational only: it takes a formatted value and a variant, so each badge
|
|
6
|
+
* (a11y in core, coverage and visual regression in their plugins) keeps its own
|
|
7
|
+
* data logic while sharing one appearance.
|
|
10
8
|
*
|
|
11
|
-
* It
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* name is composed here as "label: value" (e.g. "Library coverage: 23%"), so
|
|
17
|
-
* the figure that is the whole point of the badge cannot be dropped by a
|
|
18
|
-
* consumer that only passes `label`. `title` stays the full text the
|
|
19
|
-
* consumer passes, for the hover tooltip.
|
|
9
|
+
* It shows an icon instead of a text label: the same glyph the source uses for
|
|
10
|
+
* its navigation marks and panel tab, and narrow enough to fit three badges in
|
|
11
|
+
* the 40px header. The icon is `aria-hidden`; the accessible name is built here
|
|
12
|
+
* as "label: value" (e.g. "Library coverage: 23%") so a consumer cannot drop
|
|
13
|
+
* the figure. `title` is the consumer's full text for the hover tooltip.
|
|
20
14
|
*/
|
|
21
15
|
export declare class PrismMetricBadgeComponent {
|
|
22
16
|
readonly icon: import("@angular/core").InputSignal<string>;
|
|
@@ -24,7 +18,7 @@ export declare class PrismMetricBadgeComponent {
|
|
|
24
18
|
readonly label: import("@angular/core").InputSignal<string>;
|
|
25
19
|
readonly title: import("@angular/core").InputSignal<string>;
|
|
26
20
|
readonly variant: import("@angular/core").InputSignal<"ok" | "warn" | "danger">;
|
|
27
|
-
/** "label: value"
|
|
21
|
+
/** "label: value" is the accessible name, so the figure is never dropped. */
|
|
28
22
|
readonly accessibleName: import("@angular/core").Signal<string>;
|
|
29
23
|
static ɵfac: i0.ɵɵFactoryDeclaration<PrismMetricBadgeComponent, never>;
|
|
30
24
|
static ɵcmp: i0.ɵɵComponentDeclaration<PrismMetricBadgeComponent, "prism-metric-badge", never, { "icon": { "alias": "icon"; "required": true; "isSignal": true; }; "value": { "alias": "value"; "required": true; "isSignal": true; }; "label": { "alias": "label"; "required": true; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prism-metric-badge.component.d.ts","sourceRoot":"","sources":["../../../src/app/shared/prism-metric-badge.component.ts"],"names":[],"mappings":";AAGA
|
|
1
|
+
{"version":3,"file":"prism-metric-badge.component.d.ts","sourceRoot":"","sources":["../../../src/app/shared/prism-metric-badge.component.ts"],"names":[],"mappings":";AAGA;;;;;;;;;;;;GAYG;AACH,qBAQa,yBAAyB;IAClC,QAAQ,CAAC,IAAI,8CAA4B;IACzC,QAAQ,CAAC,KAAK,8CAA4B;IAC1C,QAAQ,CAAC,KAAK,8CAA4B;IAC1C,QAAQ,CAAC,KAAK,8CAAqB;IACnC,QAAQ,CAAC,OAAO,gEAAyC;IAEzD,6EAA6E;IAC7E,QAAQ,CAAC,cAAc,yCAAsD;yCARpE,yBAAyB;2CAAzB,yBAAyB;CASrC"}
|