@ng-prism/core 22.2.0-beta.5 → 22.2.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/dist/app/canvas/canvas-bg.styles.d.ts +19 -0
- package/dist/app/canvas/canvas-bg.styles.d.ts.map +1 -0
- package/dist/app/canvas/canvas-bg.styles.js +58 -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 -3
- package/dist/app/canvas/prism-canvas-toolbar.component.d.ts +25 -7
- package/dist/app/canvas/prism-canvas-toolbar.component.d.ts.map +1 -1
- package/dist/app/canvas/prism-canvas-toolbar.component.js +152 -121
- package/dist/app/canvas/prism-template-popover.component.d.ts +0 -3
- package/dist/app/canvas/prism-template-popover.component.d.ts.map +1 -1
- package/dist/app/canvas/prism-template-popover.component.js +43 -59
- package/dist/app/component-head/head-metrics.d.ts +41 -0
- package/dist/app/component-head/head-metrics.d.ts.map +1 -0
- package/dist/app/component-head/head-metrics.js +39 -0
- package/dist/app/component-head/prism-component-head.component.d.ts +10 -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 +107 -209
- package/dist/app/component-head/prism-head-gauge.component.d.ts +23 -0
- package/dist/app/component-head/prism-head-gauge.component.d.ts.map +1 -0
- package/dist/app/component-head/prism-head-gauge.component.js +123 -0
- package/dist/app/component-head/prism-head-info.component.d.ts +23 -0
- package/dist/app/component-head/prism-head-info.component.d.ts.map +1 -0
- package/dist/app/component-head/prism-head-info.component.js +124 -0
- package/dist/app/component-head/prism-stat.component.d.ts +10 -4
- package/dist/app/component-head/prism-stat.component.d.ts.map +1 -1
- package/dist/app/component-head/prism-stat.component.js +34 -44
- package/dist/app/header/prism-header.component.js +2 -2
- package/dist/app/icons/icon-registry.d.ts.map +1 -1
- package/dist/app/icons/icon-registry.js +2 -0
- package/dist/app/index.d.ts +3 -1
- package/dist/app/index.d.ts.map +1 -1
- package/dist/app/index.js +26 -1
- package/dist/app/layout-menu/prism-layout-menu.component.js +2 -2
- package/dist/app/overview/overview-panel.d.ts +3 -0
- package/dist/app/overview/overview-panel.d.ts.map +1 -0
- package/dist/app/overview/overview-panel.js +9 -0
- package/dist/app/overview/overview-visibility.d.ts +15 -0
- package/dist/app/overview/overview-visibility.d.ts.map +1 -0
- package/dist/app/overview/overview-visibility.js +18 -0
- package/dist/app/overview/prism-overview-cell.component.d.ts +29 -0
- package/dist/app/overview/prism-overview-cell.component.d.ts.map +1 -0
- package/dist/app/overview/prism-overview-cell.component.js +136 -0
- package/dist/app/overview/prism-overview.component.d.ts +17 -0
- package/dist/app/overview/prism-overview.component.d.ts.map +1 -0
- package/dist/app/overview/prism-overview.component.js +53 -0
- package/dist/app/page-renderer/prism-page-renderer.component.d.ts.map +1 -1
- package/dist/app/page-renderer/prism-page-renderer.component.js +3 -3
- package/dist/app/panels/a11y/a11y-header-badge.component.d.ts.map +1 -1
- package/dist/app/panels/a11y/a11y-header-badge.component.js +21 -30
- package/dist/app/panels/builtin-panels.d.ts.map +1 -1
- package/dist/app/panels/builtin-panels.js +2 -0
- 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 +15 -11
- package/dist/app/renderer/prism-renderer.component.d.ts +0 -1
- package/dist/app/renderer/prism-renderer.component.d.ts.map +1 -1
- package/dist/app/renderer/prism-renderer.component.js +9 -71
- package/dist/app/renderer/projectable-content.d.ts +10 -0
- package/dist/app/renderer/projectable-content.d.ts.map +1 -0
- package/dist/app/renderer/projectable-content.js +60 -0
- package/dist/app/services/prism-capture.service.d.ts.map +1 -1
- package/dist/app/services/prism-capture.service.js +20 -0
- package/dist/app/services/prism-layout.service.d.ts +0 -3
- package/dist/app/services/prism-layout.service.d.ts.map +1 -1
- package/dist/app/services/prism-layout.service.js +0 -8
- package/dist/app/services/prism-panel.service.d.ts +18 -0
- package/dist/app/services/prism-panel.service.d.ts.map +1 -1
- package/dist/app/services/prism-panel.service.js +28 -0
- package/dist/app/shared/prism-metric-badge.component.d.ts +32 -0
- package/dist/app/shared/prism-metric-badge.component.d.ts.map +1 -0
- package/dist/app/shared/prism-metric-badge.component.js +70 -0
- package/dist/app/shell/prism-shell.component.d.ts +0 -1
- package/dist/app/shell/prism-shell.component.d.ts.map +1 -1
- package/dist/app/shell/prism-shell.component.js +56 -48
- package/dist/app/sidebar/navigation-decorations.d.ts +6 -3
- package/dist/app/sidebar/navigation-decorations.d.ts.map +1 -1
- package/dist/app/sidebar/navigation-decorations.js +7 -4
- package/dist/app/sidebar/prism-sidebar.component.d.ts +11 -7
- package/dist/app/sidebar/prism-sidebar.component.d.ts.map +1 -1
- package/dist/app/sidebar/prism-sidebar.component.js +61 -83
- package/dist/app/theme/prism-default-theme.d.ts.map +1 -1
- package/dist/app/theme/prism-default-theme.js +44 -4
- package/dist/app/variant-ribbon/prism-variant-ribbon.component.d.ts +4 -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 +13 -26
- package/dist/app/variant-ribbon/spectrum.d.ts +19 -0
- package/dist/app/variant-ribbon/spectrum.d.ts.map +1 -0
- package/dist/app/variant-ribbon/spectrum.js +15 -0
- package/dist/app/view-tab-bar/next-view-id.d.ts +12 -0
- package/dist/app/view-tab-bar/next-view-id.d.ts.map +1 -0
- package/dist/app/view-tab-bar/next-view-id.js +16 -0
- package/dist/app/view-tab-bar/prism-view-panel-host.component.d.ts +0 -1
- 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 +10 -11
- package/dist/app/view-tab-bar/prism-view-tab-bar.component.d.ts +0 -1
- 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 +6 -13
- package/dist/transformer/cli.js +0 -0
- package/package.json +1 -1
- package/dist/app/canvas/prism-code-drawer.component.d.ts +0 -14
- package/dist/app/canvas/prism-code-drawer.component.d.ts.map +0 -1
- package/dist/app/canvas/prism-code-drawer.component.js +0 -116
- package/dist/app/component-header/prism-component-header.component.d.ts +0 -8
- package/dist/app/component-header/prism-component-header.component.d.ts.map +0 -1
- package/dist/app/component-header/prism-component-header.component.js +0 -77
- package/dist/cli/audit-a11y/aggregator.d.ts +0 -10
- package/dist/cli/audit-a11y/aggregator.d.ts.map +0 -1
- package/dist/cli/audit-a11y/aggregator.js +0 -64
- package/dist/cli/audit-a11y/auditor.d.ts +0 -14
- package/dist/cli/audit-a11y/auditor.d.ts.map +0 -1
- package/dist/cli/audit-a11y/auditor.js +0 -104
- package/dist/cli/audit-a11y/cli.d.ts +0 -3
- package/dist/cli/audit-a11y/cli.d.ts.map +0 -1
- package/dist/cli/audit-a11y/cli.js +0 -143
- package/dist/cli/audit-a11y/index.d.ts +0 -4
- package/dist/cli/audit-a11y/index.d.ts.map +0 -1
- package/dist/cli/audit-a11y/index.js +0 -3
- package/dist/cli/audit-a11y/static-server.d.ts +0 -11
- package/dist/cli/audit-a11y/static-server.d.ts.map +0 -1
- package/dist/cli/audit-a11y/static-server.js +0 -61
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What each `CanvasBg` value paints, shared by the Playground stage
|
|
3
|
+
* (`prism-renderer`) and the Overview cells (`prism-overview-cell`).
|
|
4
|
+
*
|
|
5
|
+
* Append this as the **last** entry of a component's `styles` array. The
|
|
6
|
+
* selectors are bare attribute selectors, so after Angular's encapsulation
|
|
7
|
+
* rewrite they carry the same specificity as the `.some-stage` class rule they
|
|
8
|
+
* have to override — source order is what decides, and only last place gets it
|
|
9
|
+
* right.
|
|
10
|
+
*
|
|
11
|
+
* The consuming element supplies its own `background-color`; `light` and `dark`
|
|
12
|
+
* override it, the rest leave it alone.
|
|
13
|
+
*
|
|
14
|
+
* Capture mode is unaffected by where these rules live: `CAPTURE_STYLES` in
|
|
15
|
+
* `prism-capture.service.ts` is a global stylesheet using `!important`, which
|
|
16
|
+
* beats any component-scoped rule regardless.
|
|
17
|
+
*/
|
|
18
|
+
export declare const CANVAS_BG_STYLES = "\n [data-bg=\"dots\"] {\n background-image: radial-gradient(circle, var(--prism-dot) 1px, transparent 1px);\n background-size: 20px 20px;\n }\n\n [data-bg=\"plain\"] {\n background-image: none;\n }\n\n /* Flat, not dotted. \"light\" and \"dark\" name a surface a component was\n designed against \u2014 and they are the two backgrounds whose colour is\n absolute rather than a theme token, which is what makes them the values\n to declare for a screenshot baseline. \"dots\" already exists for anyone\n who wants the grid. */\n [data-bg=\"light\"] {\n background-color: var(--prism-void-light, #f7f5fc);\n background-image: none;\n }\n [data-bg=\"dark\"] {\n background-color: var(--prism-void-dark, #07050f);\n background-image: none;\n }\n\n /* \"transparent\" shares the checkerboard on purpose. The two say the same\n thing in the two media the canvas has: while browsing, the checkerboard\n is already the UI's word for \"no surface here\"; in a capture it becomes\n literal transparency. A stage that were really see-through in the app\n would just show the shell through the canvas, which means nothing. The\n split between the two lives entirely in CAPTURE_STYLES. */\n [data-bg=\"checker\"],\n [data-bg=\"transparent\"] {\n background-image:\n linear-gradient(45deg, var(--prism-border) 25%, transparent 25%),\n linear-gradient(-45deg, var(--prism-border) 25%, transparent 25%),\n linear-gradient(45deg, transparent 75%, var(--prism-border) 75%),\n linear-gradient(-45deg, transparent 75%, var(--prism-border) 75%);\n background-size: 16px 16px;\n background-position: 0 0, 0 8px, 8px -8px, -8px 0;\n }\n";
|
|
19
|
+
//# sourceMappingURL=canvas-bg.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canvas-bg.styles.d.ts","sourceRoot":"","sources":["../../../src/app/canvas/canvas-bg.styles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,gBAAgB,qrDAwC5B,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What each `CanvasBg` value paints, shared by the Playground stage
|
|
3
|
+
* (`prism-renderer`) and the Overview cells (`prism-overview-cell`).
|
|
4
|
+
*
|
|
5
|
+
* Append this as the **last** entry of a component's `styles` array. The
|
|
6
|
+
* selectors are bare attribute selectors, so after Angular's encapsulation
|
|
7
|
+
* rewrite they carry the same specificity as the `.some-stage` class rule they
|
|
8
|
+
* have to override — source order is what decides, and only last place gets it
|
|
9
|
+
* right.
|
|
10
|
+
*
|
|
11
|
+
* The consuming element supplies its own `background-color`; `light` and `dark`
|
|
12
|
+
* override it, the rest leave it alone.
|
|
13
|
+
*
|
|
14
|
+
* Capture mode is unaffected by where these rules live: `CAPTURE_STYLES` in
|
|
15
|
+
* `prism-capture.service.ts` is a global stylesheet using `!important`, which
|
|
16
|
+
* beats any component-scoped rule regardless.
|
|
17
|
+
*/
|
|
18
|
+
export const CANVAS_BG_STYLES = `
|
|
19
|
+
[data-bg="dots"] {
|
|
20
|
+
background-image: radial-gradient(circle, var(--prism-dot) 1px, transparent 1px);
|
|
21
|
+
background-size: 20px 20px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
[data-bg="plain"] {
|
|
25
|
+
background-image: none;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/* Flat, not dotted. "light" and "dark" name a surface a component was
|
|
29
|
+
designed against — and they are the two backgrounds whose colour is
|
|
30
|
+
absolute rather than a theme token, which is what makes them the values
|
|
31
|
+
to declare for a screenshot baseline. "dots" already exists for anyone
|
|
32
|
+
who wants the grid. */
|
|
33
|
+
[data-bg="light"] {
|
|
34
|
+
background-color: var(--prism-void-light, #f7f5fc);
|
|
35
|
+
background-image: none;
|
|
36
|
+
}
|
|
37
|
+
[data-bg="dark"] {
|
|
38
|
+
background-color: var(--prism-void-dark, #07050f);
|
|
39
|
+
background-image: none;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* "transparent" shares the checkerboard on purpose. The two say the same
|
|
43
|
+
thing in the two media the canvas has: while browsing, the checkerboard
|
|
44
|
+
is already the UI's word for "no surface here"; in a capture it becomes
|
|
45
|
+
literal transparency. A stage that were really see-through in the app
|
|
46
|
+
would just show the shell through the canvas, which means nothing. The
|
|
47
|
+
split between the two lives entirely in CAPTURE_STYLES. */
|
|
48
|
+
[data-bg="checker"],
|
|
49
|
+
[data-bg="transparent"] {
|
|
50
|
+
background-image:
|
|
51
|
+
linear-gradient(45deg, var(--prism-border) 25%, transparent 25%),
|
|
52
|
+
linear-gradient(-45deg, var(--prism-border) 25%, transparent 25%),
|
|
53
|
+
linear-gradient(45deg, transparent 75%, var(--prism-border) 75%),
|
|
54
|
+
linear-gradient(-45deg, transparent 75%, var(--prism-border) 75%);
|
|
55
|
+
background-size: 16px 16px;
|
|
56
|
+
background-position: 0 0, 0 8px, 8px -8px, -8px 0;
|
|
57
|
+
}
|
|
58
|
+
`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prism-canvas-bg-pill.component.d.ts","sourceRoot":"","sources":["../../../src/app/canvas/prism-canvas-bg-pill.component.ts"],"names":[],"mappings":";AAGA,
|
|
1
|
+
{"version":3,"file":"prism-canvas-bg-pill.component.d.ts","sourceRoot":"","sources":["../../../src/app/canvas/prism-canvas-bg-pill.component.ts"],"names":[],"mappings":";AAGA,qBAyEa,0BAA0B;IACrC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAiC;IAE3D,SAAS,CAAC,QAAQ,CAAC,WAAW,gGAA8B;IAC5D,SAAS,CAAC,QAAQ,CAAC,OAAO,0CAA8B;IAExD,SAAS,CAAC,KAAK,IAAI,IAAI;yCANZ,0BAA0B;2CAA1B,0BAA0B;CAStC"}
|
|
@@ -27,7 +27,7 @@ export class PrismCanvasBgPillComponent {
|
|
|
27
27
|
i0.ɵɵconditionalCreate(0, PrismCanvasBgPillComponent_Conditional_0_Template, 5, 1, "div", 0);
|
|
28
28
|
} if (rf & 2) {
|
|
29
29
|
i0.ɵɵconditional(ctx.visible() ? 0 : -1);
|
|
30
|
-
} }, styles: ["[_nghost-%COMP%] {\n position: absolute;\n top: var(--%NS%prism-canvas-overlay-top, 12px);\n
|
|
30
|
+
} }, styles: ["\n\n\n\n\n\n [_nghost-%COMP%] {\n position: absolute;\n top: var(--%NS%prism-canvas-overlay-top, 12px);\n left: var(--%NS%prism-canvas-overlay-inline, 20px);\n pointer-events: none;\n z-index: 2;\n transition: top var(--%NS%dur-base), left var(--%NS%dur-base);\n }\n .prism-bg-pill[_ngcontent-%COMP%] {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n padding: 4px 4px 4px 10px;\n border-radius: 999px;\n font-size: var(--%NS%fs-xs);\n font-family: var(--%NS%font-sans);\n background: color-mix(in srgb, var(--%NS%prism-bg-elevated) 90%, transparent);\n border: 1px solid var(--%NS%prism-border);\n color: var(--%NS%prism-text-muted);\n backdrop-filter: blur(8px);\n pointer-events: auto;\n animation: _ngcontent-%COMP%_fadeIn var(--%NS%dur-base) ease-out;\n }\n .label[_ngcontent-%COMP%] { letter-spacing: 0.02em; }\n .reset[_ngcontent-%COMP%] {\n height: 22px;\n padding: 0 10px;\n border-radius: 999px;\n background: color-mix(in srgb, var(--%NS%prism-primary) 12%, transparent);\n color: var(--%NS%prism-text);\n border: 1px solid color-mix(in srgb, var(--%NS%prism-primary) 25%, transparent);\n font-family: inherit;\n font-size: inherit;\n font-weight: 500;\n cursor: pointer;\n transition: background var(--%NS%dur-fast);\n }\n .reset[_ngcontent-%COMP%]:hover {\n background: color-mix(in srgb, var(--%NS%prism-primary) 20%, transparent);\n }\n @keyframes _ngcontent-%COMP%_fadeIn {\n from { opacity: 0; transform: translateY(-4px); }\n to { opacity: 1; transform: translateY(0); }\n }"] });
|
|
31
31
|
}
|
|
32
32
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PrismCanvasBgPillComponent, [{
|
|
33
33
|
type: Component,
|
|
@@ -46,6 +46,6 @@ export class PrismCanvasBgPillComponent {
|
|
|
46
46
|
</button>
|
|
47
47
|
</div>
|
|
48
48
|
}
|
|
49
|
-
`, styles: ["\n :host {\n position: absolute;\n top: var(--prism-canvas-overlay-top, 12px);\n
|
|
49
|
+
`, styles: ["\n /* Top left, opposite the tool rail. Both used to claim the right corner and\n the rail won, hiding a notice whose whole job is to be noticed. The rail\n is permanent and the notice is not, so the permanent thing keeps the\n corner it sits in and this moves. Nothing else occupies the left corner:\n the zoom badge that used to live here was a duplicate of the readout the\n rail carries. */\n :host {\n position: absolute;\n top: var(--prism-canvas-overlay-top, 12px);\n left: var(--prism-canvas-overlay-inline, 20px);\n pointer-events: none;\n z-index: 2;\n transition: top var(--dur-base), left var(--dur-base);\n }\n .prism-bg-pill {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n padding: 4px 4px 4px 10px;\n border-radius: 999px;\n font-size: var(--fs-xs);\n font-family: var(--font-sans);\n background: color-mix(in srgb, var(--prism-bg-elevated) 90%, transparent);\n border: 1px solid var(--prism-border);\n color: var(--prism-text-muted);\n backdrop-filter: blur(8px);\n pointer-events: auto;\n animation: fadeIn var(--dur-base) ease-out;\n }\n .label { letter-spacing: 0.02em; }\n .reset {\n height: 22px;\n padding: 0 10px;\n border-radius: 999px;\n background: color-mix(in srgb, var(--prism-primary) 12%, transparent);\n color: var(--prism-text);\n border: 1px solid color-mix(in srgb, var(--prism-primary) 25%, transparent);\n font-family: inherit;\n font-size: inherit;\n font-weight: 500;\n cursor: pointer;\n transition: background var(--dur-fast);\n }\n .reset:hover {\n background: color-mix(in srgb, var(--prism-primary) 20%, transparent);\n }\n @keyframes fadeIn {\n from { opacity: 0; transform: translateY(-4px); }\n to { opacity: 1; transform: translateY(0); }\n }\n "] }]
|
|
50
50
|
}], null, null); })();
|
|
51
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PrismCanvasBgPillComponent, { className: "PrismCanvasBgPillComponent", filePath: "app/canvas/prism-canvas-bg-pill.component.ts", lineNumber:
|
|
51
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PrismCanvasBgPillComponent, { className: "PrismCanvasBgPillComponent", filePath: "app/canvas/prism-canvas-bg-pill.component.ts", lineNumber: 77 }); })();
|
|
@@ -1,22 +1,40 @@
|
|
|
1
1
|
import { type CanvasBg } from '../../shared/canvas-bg.type.js';
|
|
2
2
|
import { PrismCanvasService } from '../services/prism-canvas.service.js';
|
|
3
3
|
import { PrismVariantBgService } from '../services/prism-variant-bg.service.js';
|
|
4
|
-
import { PrismLayoutService } from '../services/prism-layout.service.js';
|
|
5
4
|
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* The canvas tools, as a rail floating over the canvas instead of a band above
|
|
7
|
+
* it.
|
|
8
|
+
*
|
|
9
|
+
* The five entries were never one kind of control, and the split follows that
|
|
10
|
+
* rather than the topic: guides and rulers are toggles you flip constantly
|
|
11
|
+
* while measuring, so they toggle at their own button; canvas background and
|
|
12
|
+
* zoom are choosers you set once, so they move behind a menu; the template is a
|
|
13
|
+
* view rather than a setting and keeps its own button. The zoom *value* stays
|
|
14
|
+
* on the rail as a readout — it is the one number here you read far more often
|
|
15
|
+
* than you set.
|
|
16
|
+
*
|
|
17
|
+
* The host deliberately generates no box. The rail has to be a direct child of
|
|
18
|
+
* `.prism-canvas-wrap` that does not contain the stage, because that is exactly
|
|
19
|
+
* what capture mode's structural rule in `prism-capture.service.ts` suppresses;
|
|
20
|
+
* a rail nested inside the renderer or the stage would survive into every
|
|
21
|
+
* screenshot and silently corrupt visual-regression baselines.
|
|
22
|
+
*/
|
|
6
23
|
export declare class PrismCanvasToolbarComponent {
|
|
7
24
|
protected readonly canvas: PrismCanvasService;
|
|
8
25
|
protected readonly variantBg: PrismVariantBgService;
|
|
9
|
-
|
|
26
|
+
/** Angular templates resolve names against the component, not the global scope. */
|
|
27
|
+
protected readonly Math: Math;
|
|
10
28
|
protected setBg(bg: CanvasBg): void;
|
|
11
29
|
/**
|
|
12
30
|
* Every {@link CanvasBg}, and the canonical list rather than a copy of it.
|
|
13
31
|
*
|
|
14
32
|
* This group is a readout as much as a control: the active button is
|
|
15
|
-
* `effective()` and the
|
|
16
|
-
* therefore cannot be *shown* either — a variant declaring it
|
|
17
|
-
* whole group with nothing active and the
|
|
18
|
-
* what a shorter list bought when `transparent` was
|
|
19
|
-
* list is now the type's own.
|
|
33
|
+
* `effective()` and the recommended one carries the `is-rec` edge. A value
|
|
34
|
+
* missing here therefore cannot be *shown* either — a variant declaring it
|
|
35
|
+
* leaves the whole group with nothing active and the recommendation with
|
|
36
|
+
* nowhere to sit. That is what a shorter list bought when `transparent` was
|
|
37
|
+
* left out of it, so the list is now the type's own.
|
|
20
38
|
*
|
|
21
39
|
* `checker` and `transparent` do paint the same checkerboard here, which is
|
|
22
40
|
* why they carry titles: the difference between them is what a capture does,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prism-canvas-toolbar.component.d.ts","sourceRoot":"","sources":["../../../src/app/canvas/prism-canvas-toolbar.component.ts"],"names":[],"mappings":"AAEA,OAAO,EAAc,KAAK,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"prism-canvas-toolbar.component.d.ts","sourceRoot":"","sources":["../../../src/app/canvas/prism-canvas-toolbar.component.ts"],"names":[],"mappings":"AAEA,OAAO,EAAc,KAAK,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;;AAEhF;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAkOa,2BAA2B;IACtC,SAAS,CAAC,QAAQ,CAAC,MAAM,qBAA8B;IACvD,SAAS,CAAC,QAAQ,CAAC,SAAS,wBAAiC;IAE7D,mFAAmF;IACnF,SAAS,CAAC,QAAQ,CAAC,IAAI,OAAQ;IAE/B,SAAS,CAAC,KAAK,CAAC,EAAE,EAAE,QAAQ,GAAG,IAAI;IAQnC;;;;;;;;;;;;;;;OAeG;IACH,SAAS,CAAC,QAAQ,CAAC,GAAG,sBAAc;IAEpC,4EAA4E;IAC5E;;;;;OAKG;IACH,SAAS,CAAC,OAAO,CAAC,EAAE,EAAE,QAAQ,GAAG,MAAM,GAAG,IAAI;IAY9C,SAAS,CAAC,QAAQ,CAAC,KAAK;;;QAKtB;IAEF,SAAS,CAAC,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;yCA3D5B,2BAA2B;2CAA3B,2BAA2B;CA8DvC"}
|
|
@@ -3,49 +3,58 @@ import { PrismIconComponent } from '../icons/prism-icon.component.js';
|
|
|
3
3
|
import { CANVAS_BGS } from '../../shared/canvas-bg.type.js';
|
|
4
4
|
import { PrismCanvasService } from '../services/prism-canvas.service.js';
|
|
5
5
|
import { PrismVariantBgService } from '../services/prism-variant-bg.service.js';
|
|
6
|
-
import { PrismLayoutService } from '../services/prism-layout.service.js';
|
|
7
6
|
import * as i0 from "@angular/core";
|
|
8
7
|
const _forTrack0 = ($index, $item) => $item.value;
|
|
9
|
-
function
|
|
10
|
-
i0.ɵɵnamespaceSVG();
|
|
11
|
-
i0.ɵɵelementStart(0, "svg", 14);
|
|
12
|
-
i0.ɵɵelement(1, "path", 15);
|
|
13
|
-
i0.ɵɵelementEnd();
|
|
14
|
-
} }
|
|
15
|
-
function PrismCanvasToolbarComponent_For_5_Template(rf, ctx) { if (rf & 1) {
|
|
8
|
+
function PrismCanvasToolbarComponent_For_17_Template(rf, ctx) { if (rf & 1) {
|
|
16
9
|
const _r1 = i0.ɵɵgetCurrentView();
|
|
17
|
-
i0.ɵɵelementStart(0, "button",
|
|
18
|
-
i0.ɵɵlistener("click", function
|
|
19
|
-
i0.ɵɵ
|
|
20
|
-
i0.ɵɵtext(2);
|
|
10
|
+
i0.ɵɵelementStart(0, "button", 16);
|
|
11
|
+
i0.ɵɵlistener("click", function PrismCanvasToolbarComponent_For_17_Template_button_click_0_listener() { const bg_r2 = i0.ɵɵrestoreView(_r1).$implicit; const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.setBg(bg_r2)); });
|
|
12
|
+
i0.ɵɵtext(1);
|
|
21
13
|
i0.ɵɵelementEnd();
|
|
22
14
|
} if (rf & 2) {
|
|
23
15
|
const bg_r2 = ctx.$implicit;
|
|
24
16
|
const ctx_r2 = i0.ɵɵnextContext();
|
|
25
|
-
i0.ɵɵclassProp("
|
|
17
|
+
i0.ɵɵclassProp("is-on", ctx_r2.variantBg.effective() === bg_r2)("is-rec", ctx_r2.variantBg.recommended() === bg_r2);
|
|
26
18
|
i0.ɵɵattribute("title", ctx_r2.bgTitle(bg_r2));
|
|
27
19
|
i0.ɵɵadvance();
|
|
28
|
-
i0.ɵɵconditional(ctx_r2.variantBg.recommended() === bg_r2 ? 1 : -1);
|
|
29
|
-
i0.ɵɵadvance();
|
|
30
20
|
i0.ɵɵtextInterpolate1(" ", ctx_r2.capitalize(bg_r2), " ");
|
|
31
21
|
} }
|
|
32
|
-
function
|
|
22
|
+
function PrismCanvasToolbarComponent_For_22_Template(rf, ctx) { if (rf & 1) {
|
|
33
23
|
const _r4 = i0.ɵɵgetCurrentView();
|
|
34
|
-
i0.ɵɵelementStart(0, "button",
|
|
35
|
-
i0.ɵɵlistener("click", function
|
|
24
|
+
i0.ɵɵelementStart(0, "button", 16);
|
|
25
|
+
i0.ɵɵlistener("click", function PrismCanvasToolbarComponent_For_22_Template_button_click_0_listener() { const z_r5 = i0.ɵɵrestoreView(_r4).$implicit; const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.canvas.setZoom(z_r5.value)); });
|
|
36
26
|
i0.ɵɵtext(1);
|
|
37
27
|
i0.ɵɵelementEnd();
|
|
38
28
|
} if (rf & 2) {
|
|
39
29
|
const z_r5 = ctx.$implicit;
|
|
40
30
|
const ctx_r2 = i0.ɵɵnextContext();
|
|
41
|
-
i0.ɵɵclassProp("
|
|
31
|
+
i0.ɵɵclassProp("is-on", ctx_r2.canvas.zoom() === z_r5.value);
|
|
42
32
|
i0.ɵɵadvance();
|
|
43
33
|
i0.ɵɵtextInterpolate1(" ", z_r5.label, " ");
|
|
44
34
|
} }
|
|
35
|
+
/**
|
|
36
|
+
* The canvas tools, as a rail floating over the canvas instead of a band above
|
|
37
|
+
* it.
|
|
38
|
+
*
|
|
39
|
+
* The five entries were never one kind of control, and the split follows that
|
|
40
|
+
* rather than the topic: guides and rulers are toggles you flip constantly
|
|
41
|
+
* while measuring, so they toggle at their own button; canvas background and
|
|
42
|
+
* zoom are choosers you set once, so they move behind a menu; the template is a
|
|
43
|
+
* view rather than a setting and keeps its own button. The zoom *value* stays
|
|
44
|
+
* on the rail as a readout — it is the one number here you read far more often
|
|
45
|
+
* than you set.
|
|
46
|
+
*
|
|
47
|
+
* The host deliberately generates no box. The rail has to be a direct child of
|
|
48
|
+
* `.prism-canvas-wrap` that does not contain the stage, because that is exactly
|
|
49
|
+
* what capture mode's structural rule in `prism-capture.service.ts` suppresses;
|
|
50
|
+
* a rail nested inside the renderer or the stage would survive into every
|
|
51
|
+
* screenshot and silently corrupt visual-regression baselines.
|
|
52
|
+
*/
|
|
45
53
|
export class PrismCanvasToolbarComponent {
|
|
46
54
|
canvas = inject(PrismCanvasService);
|
|
47
55
|
variantBg = inject(PrismVariantBgService);
|
|
48
|
-
|
|
56
|
+
/** Angular templates resolve names against the component, not the global scope. */
|
|
57
|
+
Math = Math;
|
|
49
58
|
setBg(bg) {
|
|
50
59
|
if (this.variantBg.recommended() !== null) {
|
|
51
60
|
this.variantBg.setOverride(bg);
|
|
@@ -58,11 +67,11 @@ export class PrismCanvasToolbarComponent {
|
|
|
58
67
|
* Every {@link CanvasBg}, and the canonical list rather than a copy of it.
|
|
59
68
|
*
|
|
60
69
|
* This group is a readout as much as a control: the active button is
|
|
61
|
-
* `effective()` and the
|
|
62
|
-
* therefore cannot be *shown* either — a variant declaring it
|
|
63
|
-
* whole group with nothing active and the
|
|
64
|
-
* what a shorter list bought when `transparent` was
|
|
65
|
-
* list is now the type's own.
|
|
70
|
+
* `effective()` and the recommended one carries the `is-rec` edge. A value
|
|
71
|
+
* missing here therefore cannot be *shown* either — a variant declaring it
|
|
72
|
+
* leaves the whole group with nothing active and the recommendation with
|
|
73
|
+
* nowhere to sit. That is what a shorter list bought when `transparent` was
|
|
74
|
+
* left out of it, so the list is now the type's own.
|
|
66
75
|
*
|
|
67
76
|
* `checker` and `transparent` do paint the same checkerboard here, which is
|
|
68
77
|
* why they carry titles: the difference between them is what a capture does,
|
|
@@ -100,136 +109,158 @@ export class PrismCanvasToolbarComponent {
|
|
|
100
109
|
return s.charAt(0).toUpperCase() + s.slice(1);
|
|
101
110
|
}
|
|
102
111
|
static ɵfac = function PrismCanvasToolbarComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || PrismCanvasToolbarComponent)(); };
|
|
103
|
-
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: PrismCanvasToolbarComponent, selectors: [["prism-canvas-toolbar"]], decls: 23, vars:
|
|
112
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: PrismCanvasToolbarComponent, selectors: [["prism-canvas-toolbar"]], decls: 23, vars: 13, consts: [[1, "prism-toolrail"], [1, "prism-toolrail__zoom"], ["type", "button", "title", "Toggle guides", "aria-label", "Toggle guides", 1, "prism-toolrail__btn", 3, "click"], ["name", "crosshair", 3, "size"], ["type", "button", "title", "Toggle rulers", "aria-label", "Toggle rulers", 1, "prism-toolrail__btn", 3, "click"], ["name", "move", 3, "size"], ["type", "button", "popovertarget", "prism-tools", "title", "Canvas and zoom", "aria-label", "Canvas and zoom", 1, "prism-toolrail__btn"], ["name", "sliders-horizontal", 3, "size"], [1, "prism-toolrail__sep"], ["type", "button", "popovertarget", "prism-template", "title", "Toggle Angular template", "aria-label", "Toggle Angular template", 1, "prism-toolrail__btn"], ["name", "code", 3, "size"], ["popover", "", "id", "prism-tools", "role", "dialog", "aria-label", "Canvas and zoom", 1, "prism-toolmenu"], [1, "prism-toolmenu__lbl"], [1, "prism-toolmenu__row"], ["type", "button", 3, "is-on", "is-rec"], ["type", "button", 3, "is-on"], ["type", "button", 3, "click"]], template: function PrismCanvasToolbarComponent_Template(rf, ctx) { if (rf & 1) {
|
|
104
113
|
i0.ɵɵelementStart(0, "div", 0)(1, "span", 1);
|
|
105
|
-
i0.ɵɵtext(2
|
|
114
|
+
i0.ɵɵtext(2);
|
|
106
115
|
i0.ɵɵelementEnd();
|
|
107
|
-
i0.ɵɵelementStart(3, "
|
|
108
|
-
i0.ɵɵ
|
|
116
|
+
i0.ɵɵelementStart(3, "button", 2);
|
|
117
|
+
i0.ɵɵlistener("click", function PrismCanvasToolbarComponent_Template_button_click_3_listener() { return ctx.canvas.toggleGuides(); });
|
|
118
|
+
i0.ɵɵelement(4, "prism-icon", 3);
|
|
109
119
|
i0.ɵɵelementEnd();
|
|
110
|
-
i0.ɵɵ
|
|
111
|
-
i0.ɵɵ
|
|
112
|
-
i0.ɵɵ
|
|
120
|
+
i0.ɵɵelementStart(5, "button", 4);
|
|
121
|
+
i0.ɵɵlistener("click", function PrismCanvasToolbarComponent_Template_button_click_5_listener() { return ctx.canvas.toggleRulers(); });
|
|
122
|
+
i0.ɵɵelement(6, "prism-icon", 5);
|
|
113
123
|
i0.ɵɵelementEnd();
|
|
114
|
-
i0.ɵɵelementStart(
|
|
115
|
-
i0.ɵɵ
|
|
124
|
+
i0.ɵɵelementStart(7, "button", 6);
|
|
125
|
+
i0.ɵɵelement(8, "prism-icon", 7);
|
|
116
126
|
i0.ɵɵelementEnd();
|
|
117
|
-
i0.ɵɵelement(
|
|
118
|
-
i0.ɵɵelementStart(
|
|
119
|
-
i0.ɵɵ
|
|
120
|
-
i0.ɵɵ
|
|
121
|
-
i0.ɵɵ
|
|
127
|
+
i0.ɵɵelement(9, "span", 8);
|
|
128
|
+
i0.ɵɵelementStart(10, "button", 9);
|
|
129
|
+
i0.ɵɵelement(11, "prism-icon", 10);
|
|
130
|
+
i0.ɵɵelementEnd()();
|
|
131
|
+
i0.ɵɵelementStart(12, "div", 11)(13, "span", 12);
|
|
132
|
+
i0.ɵɵtext(14, "Canvas");
|
|
133
|
+
i0.ɵɵelementEnd();
|
|
134
|
+
i0.ɵɵelementStart(15, "div", 13);
|
|
135
|
+
i0.ɵɵrepeaterCreate(16, PrismCanvasToolbarComponent_For_17_Template, 2, 6, "button", 14, i0.ɵɵrepeaterTrackByIdentity);
|
|
122
136
|
i0.ɵɵelementEnd();
|
|
123
|
-
i0.ɵɵelementStart(
|
|
124
|
-
i0.ɵɵ
|
|
125
|
-
i0.ɵɵelement(17, "prism-icon", 9);
|
|
126
|
-
i0.ɵɵtext(18, " Rulers ");
|
|
137
|
+
i0.ɵɵelementStart(18, "span", 12);
|
|
138
|
+
i0.ɵɵtext(19, "Zoom");
|
|
127
139
|
i0.ɵɵelementEnd();
|
|
128
|
-
i0.ɵɵ
|
|
129
|
-
i0.ɵɵ
|
|
130
|
-
i0.ɵɵlistener("click", function PrismCanvasToolbarComponent_Template_button_click_20_listener() { return ctx.layout.toggleTemplatePopover(); });
|
|
131
|
-
i0.ɵɵelement(21, "prism-icon", 12);
|
|
132
|
-
i0.ɵɵtext(22, " Template ");
|
|
140
|
+
i0.ɵɵelementStart(20, "div", 13);
|
|
141
|
+
i0.ɵɵrepeaterCreate(21, PrismCanvasToolbarComponent_For_22_Template, 2, 3, "button", 15, _forTrack0);
|
|
133
142
|
i0.ɵɵelementEnd()();
|
|
134
143
|
} if (rf & 2) {
|
|
135
|
-
i0.ɵɵ
|
|
136
|
-
i0.ɵɵrepeater(ctx.bgs);
|
|
137
|
-
i0.ɵɵadvance(6);
|
|
138
|
-
i0.ɵɵrepeater(ctx.zooms);
|
|
139
|
-
i0.ɵɵadvance(3);
|
|
140
|
-
i0.ɵɵclassProp("tool-btn--active", ctx.canvas.guides());
|
|
141
|
-
i0.ɵɵadvance();
|
|
142
|
-
i0.ɵɵproperty("size", 13);
|
|
144
|
+
i0.ɵɵclassProp("has-rulers", ctx.canvas.rulers());
|
|
143
145
|
i0.ɵɵadvance(2);
|
|
144
|
-
i0.ɵɵ
|
|
146
|
+
i0.ɵɵtextInterpolate1("", ctx.Math.round(ctx.canvas.zoom() * 100), "%");
|
|
145
147
|
i0.ɵɵadvance();
|
|
146
|
-
i0.ɵɵ
|
|
147
|
-
i0.ɵɵ
|
|
148
|
-
i0.ɵɵ
|
|
148
|
+
i0.ɵɵclassProp("is-on", ctx.canvas.guides());
|
|
149
|
+
i0.ɵɵattribute("aria-pressed", ctx.canvas.guides());
|
|
150
|
+
i0.ɵɵadvance();
|
|
151
|
+
i0.ɵɵproperty("size", 14);
|
|
149
152
|
i0.ɵɵadvance();
|
|
150
|
-
i0.ɵɵ
|
|
151
|
-
|
|
153
|
+
i0.ɵɵclassProp("is-on", ctx.canvas.rulers());
|
|
154
|
+
i0.ɵɵattribute("aria-pressed", ctx.canvas.rulers());
|
|
155
|
+
i0.ɵɵadvance();
|
|
156
|
+
i0.ɵɵproperty("size", 14);
|
|
157
|
+
i0.ɵɵadvance(2);
|
|
158
|
+
i0.ɵɵproperty("size", 14);
|
|
159
|
+
i0.ɵɵadvance(3);
|
|
160
|
+
i0.ɵɵproperty("size", 14);
|
|
161
|
+
i0.ɵɵadvance(5);
|
|
162
|
+
i0.ɵɵrepeater(ctx.bgs);
|
|
163
|
+
i0.ɵɵadvance(5);
|
|
164
|
+
i0.ɵɵrepeater(ctx.zooms);
|
|
165
|
+
} }, dependencies: [PrismIconComponent], styles: ["[_nghost-%COMP%] { display: contents; }\n\n \n\n\n\n\n\n\n\n\n\n\n\n .prism-toolrail[_ngcontent-%COMP%] {\n position: absolute;\n top: var(--%NS%prism-canvas-overlay-top, 12px);\n right: var(--%NS%prism-canvas-overlay-inline, 20px);\n z-index: 5;\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: var(--%NS%sp-1);\n padding: var(--%NS%sp-2);\n border: 1px solid var(--%NS%prism-border-strong);\n border-radius: var(--%NS%radius-md);\n background: var(--%NS%prism-bg-elevated);\n box-shadow: 0 4px 16px -6px rgba(0, 0, 0, 0.4);\n anchor-name: --prism-toolrail;\n }\n .prism-toolrail.has-rulers[_ngcontent-%COMP%] {\n --%NS%prism-canvas-overlay-top: 28px;\n --%NS%prism-canvas-overlay-inline: 28px;\n }\n\n .prism-toolrail__zoom[_ngcontent-%COMP%] {\n width: 100%;\n padding-bottom: var(--%NS%sp-1);\n border-bottom: 1px solid var(--%NS%prism-border);\n font-family: var(--%NS%font-mono);\n font-size: 9px;\n color: var(--%NS%prism-text-ghost);\n text-align: center;\n }\n\n .prism-toolrail__btn[_ngcontent-%COMP%] {\n display: grid;\n place-items: center;\n width: 26px;\n height: 26px;\n padding: 0;\n border: 0;\n border-radius: var(--%NS%radius-xs);\n background: transparent;\n color: var(--%NS%prism-text-muted);\n cursor: pointer;\n }\n .prism-toolrail__btn[_ngcontent-%COMP%]:hover { color: var(--%NS%prism-text); }\n .prism-toolrail__btn[_ngcontent-%COMP%]:focus-visible {\n outline: 2px solid var(--%NS%prism-primary);\n outline-offset: 1px;\n }\n .prism-toolrail__btn.is-on[_ngcontent-%COMP%] {\n background: color-mix(in srgb, var(--%NS%prism-primary) 18%, transparent);\n color: var(--%NS%prism-text);\n }\n .prism-toolrail__sep[_ngcontent-%COMP%] {\n width: 14px;\n height: 1px;\n background: var(--%NS%prism-border);\n margin: var(--%NS%sp-1) 0;\n }\n\n .prism-toolmenu[_ngcontent-%COMP%] {\n margin: 0;\n padding: var(--%NS%sp-3);\n border: 1px solid var(--%NS%prism-border-strong);\n border-radius: var(--%NS%radius-md);\n background: var(--%NS%prism-bg-elevated);\n box-shadow: 0 8px 28px -10px rgba(0, 0, 0, 0.45);\n gap: var(--%NS%sp-2);\n position-anchor: --prism-toolrail;\n position-area: inline-start;\n position-try-fallbacks: flip-inline;\n inset: auto;\n margin-inline-end: var(--%NS%sp-2);\n }\n\n \n\n\n\n .prism-toolmenu[_ngcontent-%COMP%]:popover-open {\n display: flex;\n flex-direction: column;\n }\n\n .prism-toolmenu__lbl[_ngcontent-%COMP%] {\n font-size: var(--%NS%fs-xs);\n letter-spacing: 0.08em;\n text-transform: uppercase;\n color: var(--%NS%prism-text-ghost);\n }\n .prism-toolmenu__row[_ngcontent-%COMP%] { display: flex; flex-wrap: wrap; gap: var(--%NS%sp-1); }\n .prism-toolmenu__row[_ngcontent-%COMP%] button[_ngcontent-%COMP%] {\n padding: 2px var(--%NS%sp-3);\n border: 1px solid var(--%NS%prism-border);\n border-radius: var(--%NS%radius-xs);\n background: transparent;\n font-size: var(--%NS%fs-md);\n color: var(--%NS%prism-text-2);\n cursor: pointer;\n white-space: nowrap;\n }\n .prism-toolmenu__row[_ngcontent-%COMP%] button.is-on[_ngcontent-%COMP%] {\n background: color-mix(in srgb, var(--%NS%prism-primary) 16%, transparent);\n border-color: color-mix(in srgb, var(--%NS%prism-primary) 38%, transparent);\n color: var(--%NS%prism-text);\n }\n .prism-toolmenu__row[_ngcontent-%COMP%] button.is-rec[_ngcontent-%COMP%] {\n border-color: color-mix(in srgb, var(--%NS%prism-primary) 30%, transparent);\n }"] });
|
|
152
166
|
}
|
|
153
167
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PrismCanvasToolbarComponent, [{
|
|
154
168
|
type: Component,
|
|
155
169
|
args: [{ selector: 'prism-canvas-toolbar', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [PrismIconComponent], template: `
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
(click)="setBg(bg)"
|
|
166
|
-
>
|
|
167
|
-
@if (variantBg.recommended() === bg) {
|
|
168
|
-
<svg
|
|
169
|
-
class="bg-star"
|
|
170
|
-
width="11"
|
|
171
|
-
height="11"
|
|
172
|
-
viewBox="0 0 24 24"
|
|
173
|
-
fill="#facc15"
|
|
174
|
-
aria-label="Recommended"
|
|
175
|
-
>
|
|
176
|
-
<path
|
|
177
|
-
d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01z"
|
|
178
|
-
/>
|
|
179
|
-
</svg>
|
|
180
|
-
}
|
|
181
|
-
{{ capitalize(bg) }}
|
|
182
|
-
</button>
|
|
183
|
-
}
|
|
184
|
-
</div>
|
|
185
|
-
<div class="tool-sep"></div>
|
|
186
|
-
<span class="tool-label">Zoom</span>
|
|
187
|
-
<div class="tool-group">
|
|
188
|
-
@for (z of zooms; track z.value) {
|
|
189
|
-
<button
|
|
190
|
-
class="tool-btn"
|
|
191
|
-
[class.tool-btn--active]="canvas.zoom() === z.value"
|
|
192
|
-
(click)="canvas.setZoom(z.value)"
|
|
193
|
-
>
|
|
194
|
-
{{ z.label }}
|
|
195
|
-
</button>
|
|
196
|
-
}
|
|
197
|
-
</div>
|
|
198
|
-
<div class="tool-sep"></div>
|
|
170
|
+
<!-- Anchored in .prism-canvas-wrap, deliberately absolute and not fixed:
|
|
171
|
+
a viewport-fixed rail would float over the sidebar and the panel, stay
|
|
172
|
+
put while those are resized, and sit on top of running text in the API
|
|
173
|
+
view where it has no business being. -->
|
|
174
|
+
<div class="prism-toolrail" [class.has-rulers]="canvas.rulers()">
|
|
175
|
+
<span class="prism-toolrail__zoom"
|
|
176
|
+
>{{ Math.round(canvas.zoom() * 100) }}%</span
|
|
177
|
+
>
|
|
178
|
+
|
|
199
179
|
<button
|
|
200
|
-
|
|
201
|
-
|
|
180
|
+
type="button"
|
|
181
|
+
class="prism-toolrail__btn"
|
|
182
|
+
[class.is-on]="canvas.guides()"
|
|
202
183
|
(click)="canvas.toggleGuides()"
|
|
203
184
|
title="Toggle guides"
|
|
204
185
|
aria-label="Toggle guides"
|
|
186
|
+
[attr.aria-pressed]="canvas.guides()"
|
|
205
187
|
>
|
|
206
|
-
<prism-icon name="crosshair" [size]="
|
|
207
|
-
Guides
|
|
188
|
+
<prism-icon name="crosshair" [size]="14" />
|
|
208
189
|
</button>
|
|
190
|
+
|
|
209
191
|
<button
|
|
210
|
-
|
|
211
|
-
|
|
192
|
+
type="button"
|
|
193
|
+
class="prism-toolrail__btn"
|
|
194
|
+
[class.is-on]="canvas.rulers()"
|
|
212
195
|
(click)="canvas.toggleRulers()"
|
|
213
196
|
title="Toggle rulers"
|
|
214
197
|
aria-label="Toggle rulers"
|
|
198
|
+
[attr.aria-pressed]="canvas.rulers()"
|
|
215
199
|
>
|
|
216
|
-
<prism-icon name="move" [size]="
|
|
217
|
-
Rulers
|
|
200
|
+
<prism-icon name="move" [size]="14" />
|
|
218
201
|
</button>
|
|
219
202
|
|
|
220
|
-
<
|
|
203
|
+
<button
|
|
204
|
+
type="button"
|
|
205
|
+
class="prism-toolrail__btn"
|
|
206
|
+
popovertarget="prism-tools"
|
|
207
|
+
title="Canvas and zoom"
|
|
208
|
+
aria-label="Canvas and zoom"
|
|
209
|
+
>
|
|
210
|
+
<prism-icon name="sliders-horizontal" [size]="14" />
|
|
211
|
+
</button>
|
|
212
|
+
|
|
213
|
+
<span class="prism-toolrail__sep"></span>
|
|
221
214
|
|
|
222
215
|
<button
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
216
|
+
type="button"
|
|
217
|
+
class="prism-toolrail__btn"
|
|
218
|
+
popovertarget="prism-template"
|
|
226
219
|
title="Toggle Angular template"
|
|
227
220
|
aria-label="Toggle Angular template"
|
|
228
221
|
>
|
|
229
|
-
<prism-icon name="code" [size]="
|
|
230
|
-
Template
|
|
222
|
+
<prism-icon name="code" [size]="14" />
|
|
231
223
|
</button>
|
|
232
224
|
</div>
|
|
233
|
-
|
|
225
|
+
|
|
226
|
+
<!-- Only the two choosers. The toggles stay outside: you flip guides and
|
|
227
|
+
rulers constantly while measuring, and a toggle two clicks deep is the
|
|
228
|
+
classic mistake. What you only ever set may live in a menu. -->
|
|
229
|
+
<div
|
|
230
|
+
popover
|
|
231
|
+
id="prism-tools"
|
|
232
|
+
class="prism-toolmenu"
|
|
233
|
+
role="dialog"
|
|
234
|
+
aria-label="Canvas and zoom"
|
|
235
|
+
>
|
|
236
|
+
<span class="prism-toolmenu__lbl">Canvas</span>
|
|
237
|
+
<div class="prism-toolmenu__row">
|
|
238
|
+
@for (bg of bgs; track bg) {
|
|
239
|
+
<button
|
|
240
|
+
type="button"
|
|
241
|
+
[class.is-on]="variantBg.effective() === bg"
|
|
242
|
+
[class.is-rec]="variantBg.recommended() === bg"
|
|
243
|
+
[attr.title]="bgTitle(bg)"
|
|
244
|
+
(click)="setBg(bg)"
|
|
245
|
+
>
|
|
246
|
+
{{ capitalize(bg) }}
|
|
247
|
+
</button>
|
|
248
|
+
}
|
|
249
|
+
</div>
|
|
250
|
+
|
|
251
|
+
<span class="prism-toolmenu__lbl">Zoom</span>
|
|
252
|
+
<div class="prism-toolmenu__row">
|
|
253
|
+
@for (z of zooms; track z.value) {
|
|
254
|
+
<button
|
|
255
|
+
type="button"
|
|
256
|
+
[class.is-on]="canvas.zoom() === z.value"
|
|
257
|
+
(click)="canvas.setZoom(z.value)"
|
|
258
|
+
>
|
|
259
|
+
{{ z.label }}
|
|
260
|
+
</button>
|
|
261
|
+
}
|
|
262
|
+
</div>
|
|
263
|
+
</div>
|
|
264
|
+
`, styles: ["\n :host { display: contents; }\n\n /* Canvas overlays sit at --prism-canvas-overlay-*, which the stage grows\n when the rulers claim its top and left edges (see the\n .prism-canvas-stage[data-rulers] rule in prism-renderer.component.ts).\n prism-canvas-bg-pill simply inherits those; this rail cannot, because\n capture mode requires it to be a direct child of .prism-canvas-wrap\n outside the stage. So it mirrors the same values off canvas.rulers()\n instead \u2014 keep the two in step.\n\n z-index outranks the rulers' 4 rather than matching it: the rail is a\n control and they are chrome, and the toolbar renders before the\n renderer in the shell, so an equal z-index let the rulers paint over\n the buttons. */\n .prism-toolrail {\n position: absolute;\n top: var(--prism-canvas-overlay-top, 12px);\n right: var(--prism-canvas-overlay-inline, 20px);\n z-index: 5;\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: var(--sp-1);\n padding: var(--sp-2);\n border: 1px solid var(--prism-border-strong);\n border-radius: var(--radius-md);\n background: var(--prism-bg-elevated);\n box-shadow: 0 4px 16px -6px rgba(0, 0, 0, 0.4);\n anchor-name: --prism-toolrail;\n }\n .prism-toolrail.has-rulers {\n --prism-canvas-overlay-top: 28px;\n --prism-canvas-overlay-inline: 28px;\n }\n\n .prism-toolrail__zoom {\n width: 100%;\n padding-bottom: var(--sp-1);\n border-bottom: 1px solid var(--prism-border);\n font-family: var(--font-mono);\n font-size: 9px;\n color: var(--prism-text-ghost);\n text-align: center;\n }\n\n .prism-toolrail__btn {\n display: grid;\n place-items: center;\n width: 26px;\n height: 26px;\n padding: 0;\n border: 0;\n border-radius: var(--radius-xs);\n background: transparent;\n color: var(--prism-text-muted);\n cursor: pointer;\n }\n .prism-toolrail__btn:hover { color: var(--prism-text); }\n .prism-toolrail__btn:focus-visible {\n outline: 2px solid var(--prism-primary);\n outline-offset: 1px;\n }\n .prism-toolrail__btn.is-on {\n background: color-mix(in srgb, var(--prism-primary) 18%, transparent);\n color: var(--prism-text);\n }\n .prism-toolrail__sep {\n width: 14px;\n height: 1px;\n background: var(--prism-border);\n margin: var(--sp-1) 0;\n }\n\n .prism-toolmenu {\n margin: 0;\n padding: var(--sp-3);\n border: 1px solid var(--prism-border-strong);\n border-radius: var(--radius-md);\n background: var(--prism-bg-elevated);\n box-shadow: 0 8px 28px -10px rgba(0, 0, 0, 0.45);\n gap: var(--sp-2);\n position-anchor: --prism-toolrail;\n position-area: inline-start;\n position-try-fallbacks: flip-inline;\n inset: auto;\n margin-inline-end: var(--sp-2);\n }\n\n /* display belongs on :popover-open and nowhere else \u2014 see the note in\n prism-template-popover.component.ts. An author display on the base\n rule outranks the UA's [popover]:not(:popover-open) { display: none }\n and pins the menu open. */\n .prism-toolmenu:popover-open {\n display: flex;\n flex-direction: column;\n }\n\n .prism-toolmenu__lbl {\n font-size: var(--fs-xs);\n letter-spacing: 0.08em;\n text-transform: uppercase;\n color: var(--prism-text-ghost);\n }\n .prism-toolmenu__row { display: flex; flex-wrap: wrap; gap: var(--sp-1); }\n .prism-toolmenu__row button {\n padding: 2px var(--sp-3);\n border: 1px solid var(--prism-border);\n border-radius: var(--radius-xs);\n background: transparent;\n font-size: var(--fs-md);\n color: var(--prism-text-2);\n cursor: pointer;\n white-space: nowrap;\n }\n .prism-toolmenu__row button.is-on {\n background: color-mix(in srgb, var(--prism-primary) 16%, transparent);\n border-color: color-mix(in srgb, var(--prism-primary) 38%, transparent);\n color: var(--prism-text);\n }\n .prism-toolmenu__row button.is-rec {\n border-color: color-mix(in srgb, var(--prism-primary) 30%, transparent);\n }\n "] }]
|
|
234
265
|
}], null, null); })();
|
|
235
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PrismCanvasToolbarComponent, { className: "PrismCanvasToolbarComponent", filePath: "app/canvas/prism-canvas-toolbar.component.ts", lineNumber:
|
|
266
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PrismCanvasToolbarComponent, { className: "PrismCanvasToolbarComponent", filePath: "app/canvas/prism-canvas-toolbar.component.ts", lineNumber: 251 }); })();
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import { PrismLayoutService } from '../services/prism-layout.service.js';
|
|
2
1
|
import * as i0 from "@angular/core";
|
|
3
2
|
export declare class PrismTemplatePopoverComponent {
|
|
4
3
|
private readonly navigationService;
|
|
5
4
|
private readonly rendererService;
|
|
6
|
-
protected readonly layoutService: PrismLayoutService;
|
|
7
5
|
protected readonly copied: import("@angular/core").WritableSignal<boolean>;
|
|
8
6
|
private copiedResetTimer;
|
|
9
7
|
protected readonly snippet: import("@angular/core").Signal<string>;
|
|
10
8
|
protected readonly highlighted: import("@angular/core").Signal<string>;
|
|
11
9
|
protected copy(): void;
|
|
12
|
-
protected onEscape(): void;
|
|
13
10
|
static ɵfac: i0.ɵɵFactoryDeclaration<PrismTemplatePopoverComponent, never>;
|
|
14
11
|
static ɵcmp: i0.ɵɵComponentDeclaration<PrismTemplatePopoverComponent, "prism-template-popover", never, {}, {}, never, never, true, never>;
|
|
15
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prism-template-popover.component.d.ts","sourceRoot":"","sources":["../../../src/app/canvas/prism-template-popover.component.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"prism-template-popover.component.d.ts","sourceRoot":"","sources":["../../../src/app/canvas/prism-template-popover.component.ts"],"names":[],"mappings":";AAyCA,qBAwLa,6BAA6B;IACxC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAkC;IACpE,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAgC;IAEhE,SAAS,CAAC,QAAQ,CAAC,MAAM,kDAAiB;IAC1C,OAAO,CAAC,gBAAgB,CAA8C;IAEtE,SAAS,CAAC,QAAQ,CAAC,OAAO,yCAqBvB;IAEH,SAAS,CAAC,QAAQ,CAAC,WAAW,yCAI3B;IAEH,SAAS,CAAC,IAAI,IAAI,IAAI;yCApCX,6BAA6B;2CAA7B,6BAA6B;CA4CzC"}
|