@ng-prism/core 22.2.0-beta.5 → 22.2.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/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
|
@@ -1,45 +1,9 @@
|
|
|
1
|
-
import { Component, inject, computed, signal, ChangeDetectionStrategy,
|
|
1
|
+
import { Component, inject, computed, signal, ChangeDetectionStrategy, } from '@angular/core';
|
|
2
2
|
import { PrismIconComponent } from '../icons/prism-icon.component.js';
|
|
3
|
-
import { PrismLayoutService } from '../services/prism-layout.service.js';
|
|
4
3
|
import { PrismNavigationService } from '../services/prism-navigation.service.js';
|
|
5
4
|
import { PrismRendererService } from '../services/prism-renderer.service.js';
|
|
6
5
|
import { generateSnippet } from '../renderer/snippet-generator.js';
|
|
7
6
|
import * as i0 from "@angular/core";
|
|
8
|
-
function PrismTemplatePopoverComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
9
|
-
const _r1 = i0.ɵɵgetCurrentView();
|
|
10
|
-
i0.ɵɵelementStart(0, "div", 1);
|
|
11
|
-
i0.ɵɵlistener("click", function PrismTemplatePopoverComponent_Conditional_0_Template_div_click_0_listener($event) { return $event.stopPropagation(); });
|
|
12
|
-
i0.ɵɵelementStart(1, "div", 2);
|
|
13
|
-
i0.ɵɵelement(2, "prism-icon", 3);
|
|
14
|
-
i0.ɵɵelementStart(3, "span");
|
|
15
|
-
i0.ɵɵtext(4, "Angular Template");
|
|
16
|
-
i0.ɵɵelementEnd();
|
|
17
|
-
i0.ɵɵelementStart(5, "button", 4);
|
|
18
|
-
i0.ɵɵlistener("click", function PrismTemplatePopoverComponent_Conditional_0_Template_button_click_5_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.copy()); });
|
|
19
|
-
i0.ɵɵelement(6, "prism-icon", 5);
|
|
20
|
-
i0.ɵɵtext(7);
|
|
21
|
-
i0.ɵɵelementEnd();
|
|
22
|
-
i0.ɵɵelementStart(8, "button", 6);
|
|
23
|
-
i0.ɵɵlistener("click", function PrismTemplatePopoverComponent_Conditional_0_Template_button_click_8_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.layoutService.closeTemplatePopover()); });
|
|
24
|
-
i0.ɵɵelement(9, "prism-icon", 7);
|
|
25
|
-
i0.ɵɵelementEnd()();
|
|
26
|
-
i0.ɵɵelement(10, "pre", 8);
|
|
27
|
-
i0.ɵɵelementEnd();
|
|
28
|
-
} if (rf & 2) {
|
|
29
|
-
const ctx_r1 = i0.ɵɵnextContext();
|
|
30
|
-
i0.ɵɵadvance(2);
|
|
31
|
-
i0.ɵɵproperty("size", 13);
|
|
32
|
-
i0.ɵɵadvance(3);
|
|
33
|
-
i0.ɵɵproperty("title", ctx_r1.copied() ? "Copied!" : "Copy to clipboard");
|
|
34
|
-
i0.ɵɵadvance();
|
|
35
|
-
i0.ɵɵproperty("name", ctx_r1.copied() ? "shield-check" : "copy")("size", 12);
|
|
36
|
-
i0.ɵɵadvance();
|
|
37
|
-
i0.ɵɵtextInterpolate1(" ", ctx_r1.copied() ? "Copied" : "Copy", " ");
|
|
38
|
-
i0.ɵɵadvance(2);
|
|
39
|
-
i0.ɵɵproperty("size", 13);
|
|
40
|
-
i0.ɵɵadvance();
|
|
41
|
-
i0.ɵɵproperty("innerHTML", ctx_r1.highlighted(), i0.ɵɵsanitizeHtml);
|
|
42
|
-
} }
|
|
43
7
|
function esc(s) {
|
|
44
8
|
return s.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
|
45
9
|
}
|
|
@@ -75,7 +39,6 @@ function tokenizeXml(code) {
|
|
|
75
39
|
export class PrismTemplatePopoverComponent {
|
|
76
40
|
navigationService = inject(PrismNavigationService);
|
|
77
41
|
rendererService = inject(PrismRendererService);
|
|
78
|
-
layoutService = inject(PrismLayoutService);
|
|
79
42
|
copied = signal(false, /* @ts-ignore */
|
|
80
43
|
...(ngDevMode ? [{ debugName: "copied" }] : /* istanbul ignore next */ []));
|
|
81
44
|
copiedResetTimer = null;
|
|
@@ -110,34 +73,57 @@ export class PrismTemplatePopoverComponent {
|
|
|
110
73
|
clearTimeout(this.copiedResetTimer);
|
|
111
74
|
this.copiedResetTimer = setTimeout(() => this.copied.set(false), 1500);
|
|
112
75
|
}
|
|
113
|
-
onEscape() {
|
|
114
|
-
if (this.layoutService.templatePopoverVisible()) {
|
|
115
|
-
this.layoutService.closeTemplatePopover();
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
76
|
static ɵfac = function PrismTemplatePopoverComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || PrismTemplatePopoverComponent)(); };
|
|
119
|
-
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: PrismTemplatePopoverComponent, selectors: [["prism-template-popover"]],
|
|
120
|
-
i0.ɵɵ
|
|
121
|
-
|
|
122
|
-
i0.ɵɵ
|
|
77
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: PrismTemplatePopoverComponent, selectors: [["prism-template-popover"]], decls: 11, vars: 7, consts: [["popover", "", "id", "prism-template", "role", "dialog", "aria-label", "Angular template", 1, "tpl-popover"], [1, "tpl-popover-head"], ["name", "code", 3, "size"], ["type", "button", 1, "tpl-popover-copy", 3, "click", "title"], [3, "name", "size"], ["type", "button", "popovertarget", "prism-template", "popovertargetaction", "hide", "aria-label", "Close", "title", "Close (Esc)", 1, "tpl-popover-close"], ["name", "x", 3, "size"], [1, "tpl-popover-body", 3, "innerHTML"]], template: function PrismTemplatePopoverComponent_Template(rf, ctx) { if (rf & 1) {
|
|
78
|
+
i0.ɵɵelementStart(0, "div", 0)(1, "div", 1);
|
|
79
|
+
i0.ɵɵelement(2, "prism-icon", 2);
|
|
80
|
+
i0.ɵɵelementStart(3, "span");
|
|
81
|
+
i0.ɵɵtext(4, "Angular Template");
|
|
82
|
+
i0.ɵɵelementEnd();
|
|
83
|
+
i0.ɵɵelementStart(5, "button", 3);
|
|
84
|
+
i0.ɵɵlistener("click", function PrismTemplatePopoverComponent_Template_button_click_5_listener() { return ctx.copy(); });
|
|
85
|
+
i0.ɵɵelement(6, "prism-icon", 4);
|
|
86
|
+
i0.ɵɵtext(7);
|
|
87
|
+
i0.ɵɵelementEnd();
|
|
88
|
+
i0.ɵɵelementStart(8, "button", 5);
|
|
89
|
+
i0.ɵɵelement(9, "prism-icon", 6);
|
|
90
|
+
i0.ɵɵelementEnd()();
|
|
91
|
+
i0.ɵɵelement(10, "pre", 7);
|
|
92
|
+
i0.ɵɵelementEnd();
|
|
123
93
|
} if (rf & 2) {
|
|
124
|
-
i0.ɵɵ
|
|
125
|
-
|
|
94
|
+
i0.ɵɵadvance(2);
|
|
95
|
+
i0.ɵɵproperty("size", 13);
|
|
96
|
+
i0.ɵɵadvance(3);
|
|
97
|
+
i0.ɵɵproperty("title", ctx.copied() ? "Copied!" : "Copy to clipboard");
|
|
98
|
+
i0.ɵɵadvance();
|
|
99
|
+
i0.ɵɵproperty("name", ctx.copied() ? "shield-check" : "copy")("size", 12);
|
|
100
|
+
i0.ɵɵadvance();
|
|
101
|
+
i0.ɵɵtextInterpolate1(" ", ctx.copied() ? "Copied" : "Copy", " ");
|
|
102
|
+
i0.ɵɵadvance(2);
|
|
103
|
+
i0.ɵɵproperty("size", 13);
|
|
104
|
+
i0.ɵɵadvance();
|
|
105
|
+
i0.ɵɵproperty("innerHTML", ctx.highlighted(), i0.ɵɵsanitizeHtml);
|
|
106
|
+
} }, dependencies: [PrismIconComponent], styles: ["[_nghost-%COMP%] { display: contents; }\n\n \n\n\n\n\n\n .tpl-popover[_ngcontent-%COMP%] {\n width: 520px;\n max-width: calc(100vw - var(--%NS%sp-6));\n max-height: min(420px, calc(100vh - var(--%NS%sp-7)));\n position-anchor: --prism-toolrail;\n position-area: block-end span-inline-start;\n position-try-fallbacks: flip-block, flip-inline;\n inset: auto;\n margin: var(--%NS%sp-2) 0 0 0;\n background: var(--%NS%prism-bg-elevated);\n border: 1px solid var(--%NS%prism-border-strong);\n border-radius: var(--%NS%radius-lg, 10px);\n box-shadow:\n 0 20px 60px rgba(0, 0, 0, 0.45),\n 0 0 0 1px color-mix(in srgb, var(--%NS%prism-primary) 10%, transparent);\n overflow: hidden;\n animation: _ngcontent-%COMP%_tpl-fade-in var(--%NS%dur-fast, 0.15s) var(--%NS%ease-default, ease-out);\n }\n\n \n\n\n\n\n\n .tpl-popover[_ngcontent-%COMP%]:popover-open {\n display: flex;\n flex-direction: column;\n }\n\n @keyframes _ngcontent-%COMP%_tpl-fade-in {\n from {\n opacity: 0;\n transform: translateY(-8px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n\n .tpl-popover-head[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 0 12px 0 16px;\n height: 40px;\n border-bottom: 1px solid var(--%NS%prism-border);\n background: linear-gradient(\n 180deg,\n var(--%NS%prism-bg-surface),\n var(--%NS%prism-bg-elevated)\n );\n flex-shrink: 0;\n }\n .tpl-popover-head[_ngcontent-%COMP%] > prism-icon[_ngcontent-%COMP%] {\n color: var(--%NS%prism-text-muted);\n }\n .tpl-popover-head[_ngcontent-%COMP%] > span[_ngcontent-%COMP%] {\n flex: 1;\n font-size: var(--%NS%fs-xs);\n font-weight: 700;\n letter-spacing: 0.08em;\n text-transform: uppercase;\n color: var(--%NS%prism-text-2);\n }\n\n .tpl-popover-copy[_ngcontent-%COMP%] {\n height: 26px;\n padding: 0 10px;\n font-size: var(--%NS%fs-sm);\n font-family: var(--%NS%font-sans);\n font-weight: 500;\n color: var(--%NS%prism-primary);\n background: color-mix(in srgb, var(--%NS%prism-primary) 12%, transparent);\n border: 1px solid color-mix(in srgb, var(--%NS%prism-primary) 25%, transparent);\n border-radius: var(--%NS%radius-sm, 5px);\n display: flex;\n align-items: center;\n gap: 5px;\n cursor: pointer;\n transition: background var(--%NS%dur-fast);\n }\n .tpl-popover-copy[_ngcontent-%COMP%]:hover {\n background: color-mix(in srgb, var(--%NS%prism-primary) 20%, transparent);\n }\n\n .tpl-popover-close[_ngcontent-%COMP%] {\n width: 26px;\n height: 26px;\n display: grid;\n place-items: center;\n border-radius: var(--%NS%radius-sm, 5px);\n color: var(--%NS%prism-text-muted);\n background: transparent;\n border: 0;\n cursor: pointer;\n transition: background var(--%NS%dur-fast), color var(--%NS%dur-fast);\n }\n .tpl-popover-close[_ngcontent-%COMP%]:hover {\n color: var(--%NS%prism-text);\n background: var(--%NS%prism-input-bg);\n }\n\n .tpl-popover-body[_ngcontent-%COMP%] {\n margin: 0;\n padding: 14px 18px;\n font-family: var(--%NS%font-mono);\n font-size: var(--%NS%fs-md);\n line-height: 1.7;\n color: var(--%NS%prism-text-2);\n overflow: auto;\n background: var(--%NS%prism-bg);\n flex: 1;\n min-height: 0;\n white-space: pre;\n }\n .tpl-popover-body[_ngcontent-%COMP%]::-webkit-scrollbar {\n width: 6px;\n height: 6px;\n }\n .tpl-popover-body[_ngcontent-%COMP%]::-webkit-scrollbar-thumb {\n background: var(--%NS%prism-border-strong);\n border-radius: 3px;\n }\n\n [_nghost-%COMP%] .tok-tag { color: var(--%NS%prism-code-tag); }\n [_nghost-%COMP%] .tok-attr { color: var(--%NS%prism-code-attr); }\n [_nghost-%COMP%] .tok-str { color: var(--%NS%prism-code-str); }\n [_nghost-%COMP%] .tok-com { color: var(--%NS%prism-code-com); font-style: italic; }"] });
|
|
126
107
|
}
|
|
127
108
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PrismTemplatePopoverComponent, [{
|
|
128
109
|
type: Component,
|
|
129
110
|
args: [{ selector: 'prism-template-popover', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [PrismIconComponent], template: `
|
|
130
|
-
|
|
111
|
+
<!-- A native popover: the platform owns open, light-dismiss and Escape, so
|
|
112
|
+
there is no visibility signal, no document click listener and no key
|
|
113
|
+
handler here. The id is what the rail's button names in its
|
|
114
|
+
popovertarget. -->
|
|
131
115
|
<div
|
|
116
|
+
popover
|
|
117
|
+
id="prism-template"
|
|
132
118
|
class="tpl-popover"
|
|
133
119
|
role="dialog"
|
|
134
120
|
aria-label="Angular template"
|
|
135
|
-
(click)="$event.stopPropagation()"
|
|
136
121
|
>
|
|
137
122
|
<div class="tpl-popover-head">
|
|
138
123
|
<prism-icon name="code" [size]="13" />
|
|
139
124
|
<span>Angular Template</span>
|
|
140
125
|
<button
|
|
126
|
+
type="button"
|
|
141
127
|
class="tpl-popover-copy"
|
|
142
128
|
(click)="copy()"
|
|
143
129
|
[title]="copied() ? 'Copied!' : 'Copy to clipboard'"
|
|
@@ -146,8 +132,10 @@ export class PrismTemplatePopoverComponent {
|
|
|
146
132
|
{{ copied() ? 'Copied' : 'Copy' }}
|
|
147
133
|
</button>
|
|
148
134
|
<button
|
|
135
|
+
type="button"
|
|
149
136
|
class="tpl-popover-close"
|
|
150
|
-
|
|
137
|
+
popovertarget="prism-template"
|
|
138
|
+
popovertargetaction="hide"
|
|
151
139
|
aria-label="Close"
|
|
152
140
|
title="Close (Esc)"
|
|
153
141
|
>
|
|
@@ -156,10 +144,6 @@ export class PrismTemplatePopoverComponent {
|
|
|
156
144
|
</div>
|
|
157
145
|
<pre class="tpl-popover-body" [innerHTML]="highlighted()"></pre>
|
|
158
146
|
</div>
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
type: HostListener,
|
|
163
|
-
args: ['document:keydown.escape']
|
|
164
|
-
}] }); })();
|
|
165
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PrismTemplatePopoverComponent, { className: "PrismTemplatePopoverComponent", filePath: "app/canvas/prism-template-popover.component.ts", lineNumber: 206 }); })();
|
|
147
|
+
`, styles: ["\n :host { display: contents; }\n\n /* No position of its own: a popover is in the top layer, where the\n containing block is the viewport, so the old right/top pair against the\n canvas would have parked this in the corner of the *window* and over the\n header. It hangs off the rail instead, the same way the head popovers\n hang off their triggers. Viewport units, not percentages \u2014 a percentage\n here resolves against the position area, not the canvas. */\n .tpl-popover {\n width: 520px;\n max-width: calc(100vw - var(--sp-6));\n max-height: min(420px, calc(100vh - var(--sp-7)));\n position-anchor: --prism-toolrail;\n position-area: block-end span-inline-start;\n position-try-fallbacks: flip-block, flip-inline;\n inset: auto;\n margin: var(--sp-2) 0 0 0;\n background: var(--prism-bg-elevated);\n border: 1px solid var(--prism-border-strong);\n border-radius: var(--radius-lg, 10px);\n box-shadow:\n 0 20px 60px rgba(0, 0, 0, 0.45),\n 0 0 0 1px color-mix(in srgb, var(--prism-primary) 10%, transparent);\n overflow: hidden;\n animation: tpl-fade-in var(--dur-fast, 0.15s) var(--ease-default, ease-out);\n }\n\n /* display belongs on :popover-open and nowhere else. The UA stylesheet\n hides a closed popover with [popover]:not(:popover-open) { display: none },\n and any author display on the base rule outranks it \u2014 the panel then\n shows permanently and neither Escape nor light-dismiss can hide it,\n because closing only drops :popover-open and leaves the author rule\n standing. */\n .tpl-popover:popover-open {\n display: flex;\n flex-direction: column;\n }\n\n @keyframes tpl-fade-in {\n from {\n opacity: 0;\n transform: translateY(-8px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n\n .tpl-popover-head {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 0 12px 0 16px;\n height: 40px;\n border-bottom: 1px solid var(--prism-border);\n background: linear-gradient(\n 180deg,\n var(--prism-bg-surface),\n var(--prism-bg-elevated)\n );\n flex-shrink: 0;\n }\n .tpl-popover-head > prism-icon {\n color: var(--prism-text-muted);\n }\n .tpl-popover-head > span {\n flex: 1;\n font-size: var(--fs-xs);\n font-weight: 700;\n letter-spacing: 0.08em;\n text-transform: uppercase;\n color: var(--prism-text-2);\n }\n\n .tpl-popover-copy {\n height: 26px;\n padding: 0 10px;\n font-size: var(--fs-sm);\n font-family: var(--font-sans);\n font-weight: 500;\n color: var(--prism-primary);\n background: color-mix(in srgb, var(--prism-primary) 12%, transparent);\n border: 1px solid color-mix(in srgb, var(--prism-primary) 25%, transparent);\n border-radius: var(--radius-sm, 5px);\n display: flex;\n align-items: center;\n gap: 5px;\n cursor: pointer;\n transition: background var(--dur-fast);\n }\n .tpl-popover-copy:hover {\n background: color-mix(in srgb, var(--prism-primary) 20%, transparent);\n }\n\n .tpl-popover-close {\n width: 26px;\n height: 26px;\n display: grid;\n place-items: center;\n border-radius: var(--radius-sm, 5px);\n color: var(--prism-text-muted);\n background: transparent;\n border: 0;\n cursor: pointer;\n transition: background var(--dur-fast), color var(--dur-fast);\n }\n .tpl-popover-close:hover {\n color: var(--prism-text);\n background: var(--prism-input-bg);\n }\n\n .tpl-popover-body {\n margin: 0;\n padding: 14px 18px;\n font-family: var(--font-mono);\n font-size: var(--fs-md);\n line-height: 1.7;\n color: var(--prism-text-2);\n overflow: auto;\n background: var(--prism-bg);\n flex: 1;\n min-height: 0;\n white-space: pre;\n }\n .tpl-popover-body::-webkit-scrollbar {\n width: 6px;\n height: 6px;\n }\n .tpl-popover-body::-webkit-scrollbar-thumb {\n background: var(--prism-border-strong);\n border-radius: 3px;\n }\n\n :host ::ng-deep .tok-tag { color: var(--prism-code-tag); }\n :host ::ng-deep .tok-attr { color: var(--prism-code-attr); }\n :host ::ng-deep .tok-str { color: var(--prism-code-str); }\n :host ::ng-deep .tok-com { color: var(--prism-code-com); font-style: italic; }\n "] }]
|
|
148
|
+
}], null, null); })();
|
|
149
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PrismTemplatePopoverComponent, { className: "PrismTemplatePopoverComponent", filePath: "app/canvas/prism-template-popover.component.ts", lineNumber: 226 }); })();
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How a metric compares to its threshold.
|
|
3
|
+
*
|
|
4
|
+
* `none` means there is no verdict to give — either the value is missing, or
|
|
5
|
+
* it is a plain fact with no threshold to compare against, like a count of
|
|
6
|
+
* variants. Those render grey and stay out of the gauge's tally, which counts
|
|
7
|
+
* the metrics that actually passed something.
|
|
8
|
+
*/
|
|
9
|
+
export type MetricVariant = 'ok' | 'warn' | 'danger' | 'none';
|
|
10
|
+
/** One measured value, already formatted for display. */
|
|
11
|
+
export interface HeadMetric {
|
|
12
|
+
id: string;
|
|
13
|
+
label: string;
|
|
14
|
+
value: string;
|
|
15
|
+
variant: MetricVariant;
|
|
16
|
+
}
|
|
17
|
+
/** What the gauge chip renders, derived from the full metric list. */
|
|
18
|
+
export interface GaugeSummary {
|
|
19
|
+
/** Metrics that actually carry data. `none` does not count. */
|
|
20
|
+
measured: number;
|
|
21
|
+
/** The worst-ranked deviating metric, or null when nothing deviates. */
|
|
22
|
+
worst: HeadMetric | null;
|
|
23
|
+
/** How many further metrics deviate besides `worst`. */
|
|
24
|
+
others: number;
|
|
25
|
+
/** Colour role for the chip. */
|
|
26
|
+
variant: 'ok' | 'warn' | 'danger';
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Folds the head's metrics into what one chip can say.
|
|
30
|
+
*
|
|
31
|
+
* Deliberately a pure function rather than a computed inside the component:
|
|
32
|
+
* components using signal inputs cannot be rendered through TestBed in this
|
|
33
|
+
* repo's Jest setup, so any logic left in a template is logic that never gets
|
|
34
|
+
* a test. This mirrors `decorateItem` in the sidebar, which resolves the same
|
|
35
|
+
* kind of question for navigation marks.
|
|
36
|
+
*
|
|
37
|
+
* Ties resolve by source order so the chip shows a stable metric across
|
|
38
|
+
* renders rather than flickering between two equally bad ones.
|
|
39
|
+
*/
|
|
40
|
+
export declare function summarizeMetrics(metrics: readonly HeadMetric[]): GaugeSummary;
|
|
41
|
+
//# sourceMappingURL=head-metrics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"head-metrics.d.ts","sourceRoot":"","sources":["../../../src/app/component-head/head-metrics.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,MAAM,aAAa,GAAG,IAAI,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE9D,yDAAyD;AACzD,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,aAAa,CAAC;CACxB;AAED,sEAAsE;AACtE,MAAM,WAAW,YAAY;IAC3B,+DAA+D;IAC/D,QAAQ,EAAE,MAAM,CAAC;IACjB,wEAAwE;IACxE,KAAK,EAAE,UAAU,GAAG,IAAI,CAAC;IACzB,wDAAwD;IACxD,MAAM,EAAE,MAAM,CAAC;IACf,gCAAgC;IAChC,OAAO,EAAE,IAAI,GAAG,MAAM,GAAG,QAAQ,CAAC;CACnC;AASD;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,SAAS,UAAU,EAAE,GAAG,YAAY,CAoB7E"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const SEVERITY = {
|
|
2
|
+
none: 0,
|
|
3
|
+
ok: 0,
|
|
4
|
+
warn: 1,
|
|
5
|
+
danger: 2,
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Folds the head's metrics into what one chip can say.
|
|
9
|
+
*
|
|
10
|
+
* Deliberately a pure function rather than a computed inside the component:
|
|
11
|
+
* components using signal inputs cannot be rendered through TestBed in this
|
|
12
|
+
* repo's Jest setup, so any logic left in a template is logic that never gets
|
|
13
|
+
* a test. This mirrors `decorateItem` in the sidebar, which resolves the same
|
|
14
|
+
* kind of question for navigation marks.
|
|
15
|
+
*
|
|
16
|
+
* Ties resolve by source order so the chip shows a stable metric across
|
|
17
|
+
* renders rather than flickering between two equally bad ones.
|
|
18
|
+
*/
|
|
19
|
+
export function summarizeMetrics(metrics) {
|
|
20
|
+
let measured = 0;
|
|
21
|
+
let worst = null;
|
|
22
|
+
let deviating = 0;
|
|
23
|
+
for (const m of metrics) {
|
|
24
|
+
if (m.variant !== 'none')
|
|
25
|
+
measured++;
|
|
26
|
+
if (SEVERITY[m.variant] === 0)
|
|
27
|
+
continue;
|
|
28
|
+
deviating++;
|
|
29
|
+
if (worst === null || SEVERITY[m.variant] > SEVERITY[worst.variant]) {
|
|
30
|
+
worst = m;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
measured,
|
|
35
|
+
worst,
|
|
36
|
+
others: deviating > 0 ? deviating - 1 : 0,
|
|
37
|
+
variant: worst === null ? 'ok' : worst.variant,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { HeadMetric } from './head-metrics.js';
|
|
1
2
|
import type { ComponentStatus } from '../../decorator/showcase.types.js';
|
|
2
3
|
import * as i0 from "@angular/core";
|
|
3
4
|
interface StatusBadge {
|
|
@@ -13,7 +14,6 @@ export declare class PrismComponentHeadComponent {
|
|
|
13
14
|
protected readonly status: import("@angular/core").Signal<ComponentStatus | undefined>;
|
|
14
15
|
protected readonly statusBadge: import("@angular/core").Signal<StatusBadge | null>;
|
|
15
16
|
protected readonly coveragePercent: import("@angular/core").Signal<number | null>;
|
|
16
|
-
protected readonly bundleSize: import("@angular/core").Signal<string | null>;
|
|
17
17
|
protected readonly a11yScore: import("@angular/core").Signal<number | null>;
|
|
18
18
|
/**
|
|
19
19
|
* The visual regression headline, as the plugin already derived it.
|
|
@@ -27,9 +27,17 @@ export declare class PrismComponentHeadComponent {
|
|
|
27
27
|
value: string;
|
|
28
28
|
variant: "ok" | "warn" | "danger";
|
|
29
29
|
} | null>;
|
|
30
|
+
/**
|
|
31
|
+
* The full metric list for the gauge, in source order.
|
|
32
|
+
*
|
|
33
|
+
* Order matters: `summarizeMetrics` breaks severity ties by position, so
|
|
34
|
+
* this sequence is what makes the chip show a stable metric rather than
|
|
35
|
+
* flickering between two equally bad ones.
|
|
36
|
+
*/
|
|
37
|
+
protected readonly metrics: import("@angular/core").Signal<HeadMetric[]>;
|
|
30
38
|
private readonly componentMeta;
|
|
31
39
|
static ɵfac: i0.ɵɵFactoryDeclaration<PrismComponentHeadComponent, never>;
|
|
32
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<PrismComponentHeadComponent, "prism-component-head", never, {}, {}, never,
|
|
40
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<PrismComponentHeadComponent, "prism-component-head", never, {}, {}, never, ["[headEnd]"], true, never>;
|
|
33
41
|
}
|
|
34
42
|
export {};
|
|
35
43
|
//# sourceMappingURL=prism-component-head.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prism-component-head.component.d.ts","sourceRoot":"","sources":["../../../src/app/component-head/prism-component-head.component.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;;AAEzE,UAAU,WAAW;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AAqBD,
|
|
1
|
+
{"version":3,"file":"prism-component-head.component.d.ts","sourceRoot":"","sources":["../../../src/app/component-head/prism-component-head.component.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;;AAEzE,UAAU,WAAW;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AAqBD,qBA6Ia,2BAA2B;IACtC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAkC;IACpE,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA4B;IAEzD,SAAS,CAAC,QAAQ,CAAC,IAAI,mFAErB;IAEF,SAAS,CAAC,QAAQ,CAAC,QAAQ,yCAGxB;IAEH,SAAS,CAAC,QAAQ,CAAC,YAAY,yCAG5B;IAEH,SAAS,CAAC,QAAQ,CAAC,MAAM,8DAEvB;IAEF,SAAS,CAAC,QAAQ,CAAC,WAAW,qDAG3B;IAEH,SAAS,CAAC,QAAQ,CAAC,eAAe,gDAM/B;IAkBH,SAAS,CAAC,QAAQ,CAAC,SAAS,gDAEzB;IAEH;;;;;;;OAOG;IACH,SAAS,CAAC,QAAQ,CAAC,OAAO;eACjB,MAAM;iBACJ,IAAI,GAAG,MAAM,GAAG,QAAQ;cAUhC;IAEH;;;;;;OAMG;IACH,SAAS,CAAC,QAAQ,CAAC,OAAO,+CAyBvB;IAEH,OAAO,CAAC,QAAQ,CAAC,aAAa,CAM3B;yCArHQ,2BAA2B;2CAA3B,2BAA2B;CAsHvC"}
|