@ng-prism/core 21.4.5 → 21.5.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/prism-canvas-rulers.component.d.ts +16 -0
- package/dist/app/canvas/prism-canvas-rulers.component.d.ts.map +1 -0
- package/dist/app/canvas/prism-canvas-rulers.component.js +177 -0
- package/dist/app/canvas/prism-canvas-toolbar.component.d.ts +14 -0
- package/dist/app/canvas/prism-canvas-toolbar.component.d.ts.map +1 -0
- package/dist/app/canvas/prism-canvas-toolbar.component.js +144 -0
- package/dist/app/canvas/prism-code-drawer.component.d.ts +12 -0
- package/dist/app/canvas/prism-code-drawer.component.d.ts.map +1 -0
- package/dist/app/canvas/prism-code-drawer.component.js +114 -0
- package/dist/app/component-head/prism-component-head.component.d.ts +15 -0
- package/dist/app/component-head/prism-component-head.component.d.ts.map +1 -0
- package/dist/app/component-head/prism-component-head.component.js +207 -0
- package/dist/app/component-head/prism-stat.component.d.ts +10 -0
- package/dist/app/component-head/prism-stat.component.d.ts.map +1 -0
- package/dist/app/component-head/prism-stat.component.js +52 -0
- package/dist/app/controls/boolean-control.component.d.ts.map +1 -1
- package/dist/app/controls/boolean-control.component.js +16 -44
- package/dist/app/controls/json-control.component.d.ts.map +1 -1
- package/dist/app/controls/json-control.component.js +33 -54
- package/dist/app/controls/number-control.component.d.ts.map +1 -1
- package/dist/app/controls/number-control.component.js +18 -35
- package/dist/app/controls/string-control.component.d.ts.map +1 -1
- package/dist/app/controls/string-control.component.js +14 -41
- package/dist/app/controls/union-control.component.d.ts.map +1 -1
- package/dist/app/controls/union-control.component.js +26 -50
- package/dist/app/directives/prism-resizer.directive.d.ts +14 -0
- package/dist/app/directives/prism-resizer.directive.d.ts.map +1 -0
- package/dist/app/directives/prism-resizer.directive.js +71 -0
- package/dist/app/header/prism-header.component.d.ts +3 -0
- package/dist/app/header/prism-header.component.d.ts.map +1 -1
- package/dist/app/header/prism-header.component.js +91 -215
- package/dist/app/icons/prism-icon.component.d.ts +10 -0
- package/dist/app/icons/prism-icon.component.d.ts.map +1 -0
- package/dist/app/icons/prism-icon.component.js +64 -0
- package/dist/app/index.d.ts +4 -3
- package/dist/app/index.d.ts.map +1 -1
- package/dist/app/index.js +4 -3
- package/dist/app/layout-menu/prism-layout-menu.component.d.ts.map +1 -1
- package/dist/app/layout-menu/prism-layout-menu.component.js +63 -69
- package/dist/app/panels/a11y/a11y-core.plugin.d.ts.map +1 -1
- package/dist/app/panels/a11y/a11y-core.plugin.js +1 -0
- package/dist/app/panels/a11y/a11y-keyboard.component.d.ts.map +1 -1
- package/dist/app/panels/a11y/a11y-keyboard.component.js +61 -100
- package/dist/app/panels/a11y/a11y-overlay-host.component.d.ts +4 -0
- package/dist/app/panels/a11y/a11y-overlay-host.component.d.ts.map +1 -1
- package/dist/app/panels/a11y/a11y-overlay-host.component.js +87 -11
- package/dist/app/panels/a11y/a11y-panel.component.d.ts +0 -2
- package/dist/app/panels/a11y/a11y-panel.component.d.ts.map +1 -1
- package/dist/app/panels/a11y/a11y-panel.component.js +70 -85
- package/dist/app/panels/a11y/a11y-score.component.d.ts +2 -1
- package/dist/app/panels/a11y/a11y-score.component.d.ts.map +1 -1
- package/dist/app/panels/a11y/a11y-score.component.js +55 -49
- package/dist/app/panels/a11y/a11y-sr.component.d.ts +1 -9
- package/dist/app/panels/a11y/a11y-sr.component.d.ts.map +1 -1
- package/dist/app/panels/a11y/a11y-sr.component.js +60 -208
- package/dist/app/panels/a11y/a11y-tree.component.d.ts +2 -4
- package/dist/app/panels/a11y/a11y-tree.component.d.ts.map +1 -1
- package/dist/app/panels/a11y/a11y-tree.component.js +92 -137
- package/dist/app/panels/a11y/a11y-violations.component.d.ts +2 -6
- package/dist/app/panels/a11y/a11y-violations.component.d.ts.map +1 -1
- package/dist/app/panels/a11y/a11y-violations.component.js +126 -373
- package/dist/app/panels/controls/controls-plugin.d.ts.map +1 -1
- package/dist/app/panels/controls/controls-plugin.js +1 -0
- package/dist/app/panels/controls/prism-controls-panel.component.d.ts.map +1 -1
- package/dist/app/panels/controls/prism-controls-panel.component.js +96 -88
- package/dist/app/panels/events/events-plugin.d.ts.map +1 -1
- package/dist/app/panels/events/events-plugin.js +1 -0
- package/dist/app/panels/events/prism-events-panel.component.d.ts +1 -0
- package/dist/app/panels/events/prism-events-panel.component.d.ts.map +1 -1
- package/dist/app/panels/events/prism-events-panel.component.js +44 -46
- package/dist/app/panels/panel-host/prism-panel-host.component.d.ts +7 -2
- 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 +102 -42
- package/dist/app/renderer/prism-renderer.component.d.ts +5 -6
- package/dist/app/renderer/prism-renderer.component.d.ts.map +1 -1
- package/dist/app/renderer/prism-renderer.component.js +84 -150
- package/dist/app/services/prism-canvas.service.d.ts +18 -0
- package/dist/app/services/prism-canvas.service.d.ts.map +1 -0
- package/dist/app/services/prism-canvas.service.js +63 -0
- package/dist/app/services/prism-theme.service.d.ts +13 -1
- package/dist/app/services/prism-theme.service.d.ts.map +1 -1
- package/dist/app/services/prism-theme.service.js +56 -9
- package/dist/app/shell/prism-shell.component.d.ts +1 -2
- package/dist/app/shell/prism-shell.component.d.ts.map +1 -1
- package/dist/app/shell/prism-shell.component.js +189 -178
- package/dist/app/sidebar/prism-sidebar.component.d.ts +16 -10
- package/dist/app/sidebar/prism-sidebar.component.d.ts.map +1 -1
- package/dist/app/sidebar/prism-sidebar.component.js +318 -204
- package/dist/app/theme/prism-default-theme.d.ts +1 -0
- package/dist/app/theme/prism-default-theme.d.ts.map +1 -1
- package/dist/app/theme/prism-default-theme.js +53 -34
- package/dist/app/variant-ribbon/prism-variant-ribbon.component.d.ts +13 -0
- package/dist/app/variant-ribbon/prism-variant-ribbon.component.d.ts.map +1 -0
- package/dist/app/variant-ribbon/prism-variant-ribbon.component.js +134 -0
- package/dist/app/view-tab-bar/prism-view-tab-bar.component.d.ts.map +1 -1
- package/dist/app/view-tab-bar/prism-view-tab-bar.component.js +15 -11
- package/dist/builder/shared/prism-pipeline.d.ts.map +1 -1
- package/dist/builder/shared/prism-pipeline.js +22 -5
- package/dist/decorator/showcase.decorator.d.ts +1 -3
- package/dist/decorator/showcase.decorator.d.ts.map +1 -1
- package/dist/decorator/showcase.decorator.js +2 -6
- package/dist/plugin/plugin.types.d.ts +1 -0
- package/dist/plugin/plugin.types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import { Component, inject, computed, ChangeDetectionStrategy, } from '@angular/core';
|
|
2
|
+
import { PrismIconComponent } from '../icons/prism-icon.component.js';
|
|
3
|
+
import { PrismNavigationService } from '../services/prism-navigation.service.js';
|
|
4
|
+
import { A11yAuditService } from '../panels/a11y/a11y-audit.service.js';
|
|
5
|
+
import { PrismStatComponent } from './prism-stat.component.js';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
function PrismComponentHeadComponent_Conditional_0_Conditional_13_Template(rf, ctx) { if (rf & 1) {
|
|
8
|
+
i0.ɵɵelementStart(0, "p", 6);
|
|
9
|
+
i0.ɵɵtext(1);
|
|
10
|
+
i0.ɵɵelementEnd();
|
|
11
|
+
} if (rf & 2) {
|
|
12
|
+
const c_r1 = i0.ɵɵnextContext();
|
|
13
|
+
i0.ɵɵadvance();
|
|
14
|
+
i0.ɵɵtextInterpolate(c_r1.meta.showcaseConfig.description);
|
|
15
|
+
} }
|
|
16
|
+
function PrismComponentHeadComponent_Conditional_0_Conditional_14_For_2_Template(rf, ctx) { if (rf & 1) {
|
|
17
|
+
i0.ɵɵelementStart(0, "span", 13);
|
|
18
|
+
i0.ɵɵtext(1);
|
|
19
|
+
i0.ɵɵelementEnd();
|
|
20
|
+
} if (rf & 2) {
|
|
21
|
+
const tag_r2 = ctx.$implicit;
|
|
22
|
+
i0.ɵɵadvance();
|
|
23
|
+
i0.ɵɵtextInterpolate(tag_r2);
|
|
24
|
+
} }
|
|
25
|
+
function PrismComponentHeadComponent_Conditional_0_Conditional_14_Template(rf, ctx) { if (rf & 1) {
|
|
26
|
+
i0.ɵɵelementStart(0, "div", 7);
|
|
27
|
+
i0.ɵɵrepeaterCreate(1, PrismComponentHeadComponent_Conditional_0_Conditional_14_For_2_Template, 2, 1, "span", 13, i0.ɵɵrepeaterTrackByIdentity);
|
|
28
|
+
i0.ɵɵelementEnd();
|
|
29
|
+
} if (rf & 2) {
|
|
30
|
+
const c_r1 = i0.ɵɵnextContext();
|
|
31
|
+
i0.ɵɵadvance();
|
|
32
|
+
i0.ɵɵrepeater(c_r1.meta.showcaseConfig.tags);
|
|
33
|
+
} }
|
|
34
|
+
function PrismComponentHeadComponent_Conditional_0_Conditional_16_Template(rf, ctx) { if (rf & 1) {
|
|
35
|
+
i0.ɵɵelement(0, "prism-stat", 9);
|
|
36
|
+
} if (rf & 2) {
|
|
37
|
+
const ctx_r2 = i0.ɵɵnextContext(2);
|
|
38
|
+
i0.ɵɵproperty("value", ctx_r2.variantCount());
|
|
39
|
+
} }
|
|
40
|
+
function PrismComponentHeadComponent_Conditional_0_Conditional_17_Template(rf, ctx) { if (rf & 1) {
|
|
41
|
+
i0.ɵɵelement(0, "prism-stat", 10);
|
|
42
|
+
} if (rf & 2) {
|
|
43
|
+
const ctx_r2 = i0.ɵɵnextContext(2);
|
|
44
|
+
i0.ɵɵproperty("value", ctx_r2.coveragePercent() + "%")("pill", ctx_r2.coveragePercent() >= 90 ? "OK" : "WARN")("pillVariant", ctx_r2.coveragePercent() >= 90 ? "ok" : "warn");
|
|
45
|
+
} }
|
|
46
|
+
function PrismComponentHeadComponent_Conditional_0_Conditional_18_Template(rf, ctx) { if (rf & 1) {
|
|
47
|
+
i0.ɵɵelement(0, "prism-stat", 11);
|
|
48
|
+
} if (rf & 2) {
|
|
49
|
+
const ctx_r2 = i0.ɵɵnextContext(2);
|
|
50
|
+
i0.ɵɵproperty("value", ctx_r2.bundleSize());
|
|
51
|
+
} }
|
|
52
|
+
function PrismComponentHeadComponent_Conditional_0_Conditional_19_Template(rf, ctx) { if (rf & 1) {
|
|
53
|
+
i0.ɵɵelement(0, "prism-stat", 12);
|
|
54
|
+
} if (rf & 2) {
|
|
55
|
+
const ctx_r2 = i0.ɵɵnextContext(2);
|
|
56
|
+
i0.ɵɵproperty("value", ctx_r2.a11yScore())("pillVariant", ctx_r2.a11yScore() >= 90 ? "ok" : "warn");
|
|
57
|
+
} }
|
|
58
|
+
function PrismComponentHeadComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
59
|
+
i0.ɵɵelementStart(0, "section", 0)(1, "div", 1)(2, "div")(3, "div", 2)(4, "span");
|
|
60
|
+
i0.ɵɵtext(5);
|
|
61
|
+
i0.ɵɵelementEnd();
|
|
62
|
+
i0.ɵɵelement(6, "prism-icon", 3);
|
|
63
|
+
i0.ɵɵelementStart(7, "span");
|
|
64
|
+
i0.ɵɵtext(8);
|
|
65
|
+
i0.ɵɵelementEnd()();
|
|
66
|
+
i0.ɵɵelementStart(9, "h1", 4);
|
|
67
|
+
i0.ɵɵtext(10);
|
|
68
|
+
i0.ɵɵelementStart(11, "span", 5);
|
|
69
|
+
i0.ɵɵtext(12);
|
|
70
|
+
i0.ɵɵelementEnd()();
|
|
71
|
+
i0.ɵɵconditionalCreate(13, PrismComponentHeadComponent_Conditional_0_Conditional_13_Template, 2, 1, "p", 6);
|
|
72
|
+
i0.ɵɵconditionalCreate(14, PrismComponentHeadComponent_Conditional_0_Conditional_14_Template, 3, 0, "div", 7);
|
|
73
|
+
i0.ɵɵelementEnd();
|
|
74
|
+
i0.ɵɵelementStart(15, "div", 8);
|
|
75
|
+
i0.ɵɵconditionalCreate(16, PrismComponentHeadComponent_Conditional_0_Conditional_16_Template, 1, 1, "prism-stat", 9);
|
|
76
|
+
i0.ɵɵconditionalCreate(17, PrismComponentHeadComponent_Conditional_0_Conditional_17_Template, 1, 3, "prism-stat", 10);
|
|
77
|
+
i0.ɵɵconditionalCreate(18, PrismComponentHeadComponent_Conditional_0_Conditional_18_Template, 1, 1, "prism-stat", 11);
|
|
78
|
+
i0.ɵɵconditionalCreate(19, PrismComponentHeadComponent_Conditional_0_Conditional_19_Template, 1, 2, "prism-stat", 12);
|
|
79
|
+
i0.ɵɵelementEnd()()();
|
|
80
|
+
} if (rf & 2) {
|
|
81
|
+
const c_r1 = ctx;
|
|
82
|
+
const ctx_r2 = i0.ɵɵnextContext();
|
|
83
|
+
i0.ɵɵadvance(5);
|
|
84
|
+
i0.ɵɵtextInterpolate(ctx_r2.category());
|
|
85
|
+
i0.ɵɵadvance();
|
|
86
|
+
i0.ɵɵproperty("size", 10);
|
|
87
|
+
i0.ɵɵadvance(2);
|
|
88
|
+
i0.ɵɵtextInterpolate(c_r1.meta.showcaseConfig.title);
|
|
89
|
+
i0.ɵɵadvance(2);
|
|
90
|
+
i0.ɵɵtextInterpolate1(" ", c_r1.meta.showcaseConfig.title, " ");
|
|
91
|
+
i0.ɵɵadvance(2);
|
|
92
|
+
i0.ɵɵtextInterpolate1("<", c_r1.meta.componentMeta.selector, ">");
|
|
93
|
+
i0.ɵɵadvance();
|
|
94
|
+
i0.ɵɵconditional(c_r1.meta.showcaseConfig.description ? 13 : -1);
|
|
95
|
+
i0.ɵɵadvance();
|
|
96
|
+
i0.ɵɵconditional((c_r1.meta.showcaseConfig.tags == null ? null : c_r1.meta.showcaseConfig.tags.length) ? 14 : -1);
|
|
97
|
+
i0.ɵɵadvance(2);
|
|
98
|
+
i0.ɵɵconditional(ctx_r2.variantCount() > 0 ? 16 : -1);
|
|
99
|
+
i0.ɵɵadvance();
|
|
100
|
+
i0.ɵɵconditional(ctx_r2.coveragePercent() !== null ? 17 : -1);
|
|
101
|
+
i0.ɵɵadvance();
|
|
102
|
+
i0.ɵɵconditional(ctx_r2.bundleSize() !== null ? 18 : -1);
|
|
103
|
+
i0.ɵɵadvance();
|
|
104
|
+
i0.ɵɵconditional(ctx_r2.a11yScore() !== null ? 19 : -1);
|
|
105
|
+
} }
|
|
106
|
+
export class PrismComponentHeadComponent {
|
|
107
|
+
navigationService = inject(PrismNavigationService);
|
|
108
|
+
auditService = inject(A11yAuditService);
|
|
109
|
+
comp = computed(() => this.navigationService.activeComponent(), ...(ngDevMode ? [{ debugName: "comp" }] : []));
|
|
110
|
+
category = computed(() => {
|
|
111
|
+
const c = this.comp();
|
|
112
|
+
return c?.meta.showcaseConfig.category ?? 'Uncategorized';
|
|
113
|
+
}, ...(ngDevMode ? [{ debugName: "category" }] : []));
|
|
114
|
+
variantCount = computed(() => {
|
|
115
|
+
const c = this.comp();
|
|
116
|
+
return c?.meta.showcaseConfig.variants?.length ?? 0;
|
|
117
|
+
}, ...(ngDevMode ? [{ debugName: "variantCount" }] : []));
|
|
118
|
+
coveragePercent = computed(() => {
|
|
119
|
+
const meta = this.componentMeta();
|
|
120
|
+
const coverage = meta?.['coverage'];
|
|
121
|
+
if (coverage?.['found'] && typeof coverage['score'] === 'number')
|
|
122
|
+
return coverage['score'];
|
|
123
|
+
return null;
|
|
124
|
+
}, ...(ngDevMode ? [{ debugName: "coveragePercent" }] : []));
|
|
125
|
+
bundleSize = computed(() => {
|
|
126
|
+
const meta = this.componentMeta();
|
|
127
|
+
const perf = meta?.['perf'];
|
|
128
|
+
const bundle = perf?.['bundle'];
|
|
129
|
+
if (bundle && typeof bundle['gzipKb'] === 'number')
|
|
130
|
+
return bundle['gzipKb'] + ' kb';
|
|
131
|
+
if (bundle && typeof bundle['sizeKb'] === 'number')
|
|
132
|
+
return bundle['sizeKb'] + ' kb';
|
|
133
|
+
return null;
|
|
134
|
+
}, ...(ngDevMode ? [{ debugName: "bundleSize" }] : []));
|
|
135
|
+
a11yScore = computed(() => {
|
|
136
|
+
return this.auditService.scoreResult()?.score ?? null;
|
|
137
|
+
}, ...(ngDevMode ? [{ debugName: "a11yScore" }] : []));
|
|
138
|
+
componentMeta = computed(() => {
|
|
139
|
+
const c = this.comp();
|
|
140
|
+
const meta = c?.meta.showcaseConfig.meta;
|
|
141
|
+
return meta && typeof meta === 'object'
|
|
142
|
+
? meta
|
|
143
|
+
: null;
|
|
144
|
+
}, ...(ngDevMode ? [{ debugName: "componentMeta" }] : []));
|
|
145
|
+
static ɵfac = function PrismComponentHeadComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || PrismComponentHeadComponent)(); };
|
|
146
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: PrismComponentHeadComponent, selectors: [["prism-component-head"]], decls: 1, vars: 1, consts: [[1, "comp-head"], [1, "comp-head-top"], [1, "comp-crumb"], ["name", "chevron-right", 3, "size"], [1, "comp-title"], [1, "comp-selector"], [1, "comp-desc"], [1, "comp-tags"], [1, "comp-head-stats"], ["label", "Variants", 3, "value"], ["label", "Coverage", 3, "value", "pill", "pillVariant"], ["label", "Bundle", 3, "value"], ["label", "Score", "pill", "A11y", 3, "value", "pillVariant"], [1, "comp-tag"]], template: function PrismComponentHeadComponent_Template(rf, ctx) { if (rf & 1) {
|
|
147
|
+
i0.ɵɵconditionalCreate(0, PrismComponentHeadComponent_Conditional_0_Template, 20, 11, "section", 0);
|
|
148
|
+
} if (rf & 2) {
|
|
149
|
+
let tmp_0_0;
|
|
150
|
+
i0.ɵɵconditional((tmp_0_0 = ctx.comp()) ? 0 : -1, tmp_0_0);
|
|
151
|
+
} }, dependencies: [PrismIconComponent, PrismStatComponent], styles: ["[_nghost-%COMP%] { display: block; flex-shrink: 0; }\n\n .comp-head[_ngcontent-%COMP%] {\n padding: 12px 28px;\n background: var(--prism-bg);\n border-bottom: 1px solid var(--prism-border);\n position: relative;\n }\n .comp-head[_ngcontent-%COMP%]::before {\n content: '';\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n width: 6px;\n background: linear-gradient(180deg, var(--prism-primary-from) 0%, #ec4899 50%, var(--prism-primary-to) 100%);\n }\n\n .comp-head-top[_ngcontent-%COMP%] {\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n gap: 16px;\n }\n\n .comp-crumb[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 6px;\n font-size: var(--fs-sm);\n color: var(--prism-text-ghost);\n margin-bottom: 6px;\n font-weight: 500;\n letter-spacing: 0.04em;\n text-transform: uppercase;\n }\n .comp-crumb[_ngcontent-%COMP%] prism-icon[_ngcontent-%COMP%] { opacity: 0.6; }\n\n .comp-title[_ngcontent-%COMP%] {\n margin: 0;\n font-size: var(--fs-2xl);\n font-weight: 700;\n letter-spacing: -0.02em;\n color: var(--prism-text);\n display: flex;\n align-items: center;\n gap: 10px;\n }\n\n .comp-selector[_ngcontent-%COMP%] {\n font-family: var(--font-mono);\n font-size: 12px;\n color: var(--prism-primary);\n padding: 3px 8px;\n border-radius: var(--radius-sm);\n background: color-mix(in srgb, var(--prism-primary) 10%, transparent);\n border: 1px solid color-mix(in srgb, var(--prism-primary) 20%, transparent);\n font-weight: 500;\n }\n\n .comp-desc[_ngcontent-%COMP%] {\n margin: 6px 0 0;\n font-size: var(--fs-lg);\n color: var(--prism-text-2);\n max-width: 72ch;\n line-height: 1.55;\n }\n\n .comp-tags[_ngcontent-%COMP%] {\n margin-top: 10px;\n display: flex;\n gap: 6px;\n flex-wrap: wrap;\n }\n .comp-tag[_ngcontent-%COMP%] {\n padding: 2px 8px;\n font-size: 11px;\n font-weight: 500;\n border-radius: var(--radius-xs);\n background: color-mix(in srgb, var(--prism-primary) 12%, transparent);\n color: var(--prism-primary);\n border: 1px solid color-mix(in srgb, var(--prism-primary) 20%, transparent);\n }\n\n .comp-head-stats[_ngcontent-%COMP%] {\n display: flex;\n gap: 18px;\n flex-shrink: 0;\n }"], changeDetection: 0 });
|
|
152
|
+
}
|
|
153
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PrismComponentHeadComponent, [{
|
|
154
|
+
type: Component,
|
|
155
|
+
args: [{ selector: 'prism-component-head', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [PrismIconComponent, PrismStatComponent], template: `
|
|
156
|
+
@if (comp(); as c) {
|
|
157
|
+
<section class="comp-head">
|
|
158
|
+
<div class="comp-head-top">
|
|
159
|
+
<div>
|
|
160
|
+
<div class="comp-crumb">
|
|
161
|
+
<span>{{ category() }}</span>
|
|
162
|
+
<prism-icon name="chevron-right" [size]="10" />
|
|
163
|
+
<span>{{ c.meta.showcaseConfig.title }}</span>
|
|
164
|
+
</div>
|
|
165
|
+
<h1 class="comp-title">
|
|
166
|
+
{{ c.meta.showcaseConfig.title }}
|
|
167
|
+
<span class="comp-selector"
|
|
168
|
+
><{{ c.meta.componentMeta.selector }}></span
|
|
169
|
+
>
|
|
170
|
+
</h1>
|
|
171
|
+
@if (c.meta.showcaseConfig.description) {
|
|
172
|
+
<p class="comp-desc">{{ c.meta.showcaseConfig.description }}</p>
|
|
173
|
+
} @if (c.meta.showcaseConfig.tags?.length) {
|
|
174
|
+
<div class="comp-tags">
|
|
175
|
+
@for (tag of c.meta.showcaseConfig.tags; track tag) {
|
|
176
|
+
<span class="comp-tag">{{ tag }}</span>
|
|
177
|
+
}
|
|
178
|
+
</div>
|
|
179
|
+
}
|
|
180
|
+
</div>
|
|
181
|
+
<div class="comp-head-stats">
|
|
182
|
+
@if (variantCount() > 0) {
|
|
183
|
+
<prism-stat [value]="variantCount()" label="Variants" />
|
|
184
|
+
} @if (coveragePercent() !== null) {
|
|
185
|
+
<prism-stat
|
|
186
|
+
[value]="coveragePercent()! + '%'"
|
|
187
|
+
label="Coverage"
|
|
188
|
+
[pill]="coveragePercent()! >= 90 ? 'OK' : 'WARN'"
|
|
189
|
+
[pillVariant]="coveragePercent()! >= 90 ? 'ok' : 'warn'"
|
|
190
|
+
/>
|
|
191
|
+
} @if (bundleSize() !== null) {
|
|
192
|
+
<prism-stat [value]="bundleSize()!" label="Bundle" />
|
|
193
|
+
} @if (a11yScore() !== null) {
|
|
194
|
+
<prism-stat
|
|
195
|
+
[value]="a11yScore()!"
|
|
196
|
+
label="Score"
|
|
197
|
+
pill="A11y"
|
|
198
|
+
[pillVariant]="a11yScore()! >= 90 ? 'ok' : 'warn'"
|
|
199
|
+
/>
|
|
200
|
+
}
|
|
201
|
+
</div>
|
|
202
|
+
</div>
|
|
203
|
+
</section>
|
|
204
|
+
}
|
|
205
|
+
`, styles: ["\n :host { display: block; flex-shrink: 0; }\n\n .comp-head {\n padding: 12px 28px;\n background: var(--prism-bg);\n border-bottom: 1px solid var(--prism-border);\n position: relative;\n }\n .comp-head::before {\n content: '';\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n width: 6px;\n background: linear-gradient(180deg, var(--prism-primary-from) 0%, #ec4899 50%, var(--prism-primary-to) 100%);\n }\n\n .comp-head-top {\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n gap: 16px;\n }\n\n .comp-crumb {\n display: flex;\n align-items: center;\n gap: 6px;\n font-size: var(--fs-sm);\n color: var(--prism-text-ghost);\n margin-bottom: 6px;\n font-weight: 500;\n letter-spacing: 0.04em;\n text-transform: uppercase;\n }\n .comp-crumb prism-icon { opacity: 0.6; }\n\n .comp-title {\n margin: 0;\n font-size: var(--fs-2xl);\n font-weight: 700;\n letter-spacing: -0.02em;\n color: var(--prism-text);\n display: flex;\n align-items: center;\n gap: 10px;\n }\n\n .comp-selector {\n font-family: var(--font-mono);\n font-size: 12px;\n color: var(--prism-primary);\n padding: 3px 8px;\n border-radius: var(--radius-sm);\n background: color-mix(in srgb, var(--prism-primary) 10%, transparent);\n border: 1px solid color-mix(in srgb, var(--prism-primary) 20%, transparent);\n font-weight: 500;\n }\n\n .comp-desc {\n margin: 6px 0 0;\n font-size: var(--fs-lg);\n color: var(--prism-text-2);\n max-width: 72ch;\n line-height: 1.55;\n }\n\n .comp-tags {\n margin-top: 10px;\n display: flex;\n gap: 6px;\n flex-wrap: wrap;\n }\n .comp-tag {\n padding: 2px 8px;\n font-size: 11px;\n font-weight: 500;\n border-radius: var(--radius-xs);\n background: color-mix(in srgb, var(--prism-primary) 12%, transparent);\n color: var(--prism-primary);\n border: 1px solid color-mix(in srgb, var(--prism-primary) 20%, transparent);\n }\n\n .comp-head-stats {\n display: flex;\n gap: 18px;\n flex-shrink: 0;\n }\n "] }]
|
|
206
|
+
}], null, null); })();
|
|
207
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PrismComponentHeadComponent, { className: "PrismComponentHeadComponent", filePath: "app/component-head/prism-component-head.component.ts", lineNumber: 160 }); })();
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class PrismStatComponent {
|
|
3
|
+
readonly value: import("@angular/core").InputSignal<string | number>;
|
|
4
|
+
readonly label: import("@angular/core").InputSignal<string>;
|
|
5
|
+
readonly pill: import("@angular/core").InputSignal<string | undefined>;
|
|
6
|
+
readonly pillVariant: import("@angular/core").InputSignal<"ok" | "warn">;
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PrismStatComponent, never>;
|
|
8
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<PrismStatComponent, "prism-stat", never, { "value": { "alias": "value"; "required": true; "isSignal": true; }; "label": { "alias": "label"; "required": true; "isSignal": true; }; "pill": { "alias": "pill"; "required": false; "isSignal": true; }; "pillVariant": { "alias": "pillVariant"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=prism-stat.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prism-stat.component.d.ts","sourceRoot":"","sources":["../../../src/app/component-head/prism-stat.component.ts"],"names":[],"mappings":";AAEA,qBAwDa,kBAAkB;IAC7B,QAAQ,CAAC,KAAK,uDAAqC;IACnD,QAAQ,CAAC,KAAK,8CAA4B;IAC1C,QAAQ,CAAC,IAAI,0DAAmB;IAChC,QAAQ,CAAC,WAAW,qDAA8B;yCAJvC,kBAAkB;2CAAlB,kBAAkB;CAK9B"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Component, ChangeDetectionStrategy, input } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
function PrismStatComponent_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
4
|
+
i0.ɵɵdomElementStart(0, "span", 4);
|
|
5
|
+
i0.ɵɵtext(1);
|
|
6
|
+
i0.ɵɵdomElementEnd();
|
|
7
|
+
} if (rf & 2) {
|
|
8
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
9
|
+
i0.ɵɵclassProp("warn", ctx_r0.pillVariant() === "warn");
|
|
10
|
+
i0.ɵɵadvance();
|
|
11
|
+
i0.ɵɵtextInterpolate(ctx_r0.pill());
|
|
12
|
+
} }
|
|
13
|
+
export class PrismStatComponent {
|
|
14
|
+
value = input.required(...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
15
|
+
label = input.required(...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
16
|
+
pill = input(...(ngDevMode ? [undefined, { debugName: "pill" }] : []));
|
|
17
|
+
pillVariant = input('ok', ...(ngDevMode ? [{ debugName: "pillVariant" }] : []));
|
|
18
|
+
static ɵfac = function PrismStatComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || PrismStatComponent)(); };
|
|
19
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: PrismStatComponent, selectors: [["prism-stat"]], inputs: { value: [1, "value"], label: [1, "label"], pill: [1, "pill"], pillVariant: [1, "pillVariant"] }, decls: 6, vars: 3, consts: [[1, "stat"], [1, "stat-val"], [1, "pill", 3, "warn"], [1, "stat-lbl"], [1, "pill"]], template: function PrismStatComponent_Template(rf, ctx) { if (rf & 1) {
|
|
20
|
+
i0.ɵɵdomElementStart(0, "div", 0)(1, "div", 1);
|
|
21
|
+
i0.ɵɵtext(2);
|
|
22
|
+
i0.ɵɵconditionalCreate(3, PrismStatComponent_Conditional_3_Template, 2, 3, "span", 2);
|
|
23
|
+
i0.ɵɵdomElementEnd();
|
|
24
|
+
i0.ɵɵdomElementStart(4, "div", 3);
|
|
25
|
+
i0.ɵɵtext(5);
|
|
26
|
+
i0.ɵɵdomElementEnd()();
|
|
27
|
+
} if (rf & 2) {
|
|
28
|
+
i0.ɵɵadvance(2);
|
|
29
|
+
i0.ɵɵtextInterpolate1(" ", ctx.value(), " ");
|
|
30
|
+
i0.ɵɵadvance();
|
|
31
|
+
i0.ɵɵconditional(ctx.pill() ? 3 : -1);
|
|
32
|
+
i0.ɵɵadvance(2);
|
|
33
|
+
i0.ɵɵtextInterpolate(ctx.label());
|
|
34
|
+
} }, styles: [".stat[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n gap: 2px;\n min-width: 64px;\n }\n .stat-val[_ngcontent-%COMP%] {\n font-family: var(--font-mono);\n font-size: var(--fs-xl);\n font-weight: 600;\n color: var(--prism-text);\n display: flex;\n align-items: center;\n gap: 5px;\n }\n .pill[_ngcontent-%COMP%] {\n padding: 0 5px;\n font-size: 9.5px;\n border-radius: 3px;\n background: color-mix(in srgb, var(--prism-success) 15%, transparent);\n color: var(--prism-success);\n font-weight: 700;\n letter-spacing: 0.04em;\n }\n .pill.warn[_ngcontent-%COMP%] {\n background: color-mix(in srgb, var(--prism-warn) 15%, transparent);\n color: var(--prism-warn);\n }\n .stat-lbl[_ngcontent-%COMP%] {\n font-size: var(--fs-xs);\n color: var(--prism-text-ghost);\n text-transform: uppercase;\n letter-spacing: 0.08em;\n font-weight: 600;\n }"], changeDetection: 0 });
|
|
35
|
+
}
|
|
36
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PrismStatComponent, [{
|
|
37
|
+
type: Component,
|
|
38
|
+
args: [{ selector: 'prism-stat', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
39
|
+
<div class="stat">
|
|
40
|
+
<div class="stat-val">
|
|
41
|
+
{{ value() }}
|
|
42
|
+
@if (pill()) {
|
|
43
|
+
<span class="pill" [class.warn]="pillVariant() === 'warn'">{{
|
|
44
|
+
pill()
|
|
45
|
+
}}</span>
|
|
46
|
+
}
|
|
47
|
+
</div>
|
|
48
|
+
<div class="stat-lbl">{{ label() }}</div>
|
|
49
|
+
</div>
|
|
50
|
+
`, styles: ["\n .stat {\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n gap: 2px;\n min-width: 64px;\n }\n .stat-val {\n font-family: var(--font-mono);\n font-size: var(--fs-xl);\n font-weight: 600;\n color: var(--prism-text);\n display: flex;\n align-items: center;\n gap: 5px;\n }\n .pill {\n padding: 0 5px;\n font-size: 9.5px;\n border-radius: 3px;\n background: color-mix(in srgb, var(--prism-success) 15%, transparent);\n color: var(--prism-success);\n font-weight: 700;\n letter-spacing: 0.04em;\n }\n .pill.warn {\n background: color-mix(in srgb, var(--prism-warn) 15%, transparent);\n color: var(--prism-warn);\n }\n .stat-lbl {\n font-size: var(--fs-xs);\n color: var(--prism-text-ghost);\n text-transform: uppercase;\n letter-spacing: 0.08em;\n font-weight: 600;\n }\n "] }]
|
|
51
|
+
}], null, { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], pill: [{ type: i0.Input, args: [{ isSignal: true, alias: "pill", required: false }] }], pillVariant: [{ type: i0.Input, args: [{ isSignal: true, alias: "pillVariant", required: false }] }] }); })();
|
|
52
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PrismStatComponent, { className: "PrismStatComponent", filePath: "app/component-head/prism-stat.component.ts", lineNumber: 59 }); })();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boolean-control.component.d.ts","sourceRoot":"","sources":["../../../src/app/controls/boolean-control.component.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"boolean-control.component.d.ts","sourceRoot":"","sources":["../../../src/app/controls/boolean-control.component.ts"],"names":[],"mappings":";AAOA,qBA+Ca,uBAAuB;IAClC,QAAQ,CAAC,KAAK,+CAAgB;IAC9B,QAAQ,CAAC,KAAK,8CAAa;IAC3B,QAAQ,CAAC,QAAQ,8CAAa;IAC9B,QAAQ,CAAC,WAAW,oDAAqB;yCAJ9B,uBAAuB;2CAAvB,uBAAuB;CAKnC"}
|
|
@@ -1,58 +1,30 @@
|
|
|
1
|
-
import { Component, input, output } from '@angular/core';
|
|
1
|
+
import { Component, ChangeDetectionStrategy, input, output, } from '@angular/core';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
|
-
function BooleanControlComponent_Conditional_4_Template(rf, ctx) { if (rf & 1) {
|
|
4
|
-
i0.ɵɵdomElementStart(0, "code", 3);
|
|
5
|
-
i0.ɵɵtext(1);
|
|
6
|
-
i0.ɵɵdomElementEnd();
|
|
7
|
-
} if (rf & 2) {
|
|
8
|
-
const ctx_r0 = i0.ɵɵnextContext();
|
|
9
|
-
i0.ɵɵadvance();
|
|
10
|
-
i0.ɵɵtextInterpolate(ctx_r0.typeName());
|
|
11
|
-
} }
|
|
12
3
|
export class BooleanControlComponent {
|
|
13
4
|
value = input(false, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
14
5
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
15
6
|
typeName = input('', ...(ngDevMode ? [{ debugName: "typeName" }] : []));
|
|
16
7
|
valueChange = output();
|
|
17
8
|
static ɵfac = function BooleanControlComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || BooleanControlComponent)(); };
|
|
18
|
-
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: BooleanControlComponent, selectors: [["prism-boolean-control"]], inputs: { value: [1, "value"], label: [1, "label"], typeName: [1, "typeName"] }, outputs: { valueChange: "valueChange" }, decls:
|
|
19
|
-
i0.ɵɵdomElementStart(0, "
|
|
20
|
-
i0.ɵɵ
|
|
9
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: BooleanControlComponent, selectors: [["prism-boolean-control"]], inputs: { value: [1, "value"], label: [1, "label"], typeName: [1, "typeName"] }, outputs: { valueChange: "valueChange" }, decls: 1, vars: 3, consts: [["role", "switch", 1, "ctl-toggle", 3, "click"]], template: function BooleanControlComponent_Template(rf, ctx) { if (rf & 1) {
|
|
10
|
+
i0.ɵɵdomElementStart(0, "button", 0);
|
|
11
|
+
i0.ɵɵdomListener("click", function BooleanControlComponent_Template_button_click_0_listener() { return ctx.valueChange.emit(!ctx.value()); });
|
|
21
12
|
i0.ɵɵdomElementEnd();
|
|
22
|
-
i0.ɵɵconditionalCreate(4, BooleanControlComponent_Conditional_4_Template, 2, 1, "code", 3);
|
|
23
|
-
i0.ɵɵdomElementEnd();
|
|
24
|
-
i0.ɵɵdomElementStart(5, "button", 4);
|
|
25
|
-
i0.ɵɵdomListener("click", function BooleanControlComponent_Template_button_click_5_listener() { return ctx.valueChange.emit(!ctx.value()); });
|
|
26
|
-
i0.ɵɵdomElement(6, "span", 5);
|
|
27
|
-
i0.ɵɵdomElementEnd()();
|
|
28
13
|
} if (rf & 2) {
|
|
29
|
-
i0.ɵɵ
|
|
30
|
-
i0.ɵɵtextInterpolate(ctx.label());
|
|
31
|
-
i0.ɵɵadvance();
|
|
32
|
-
i0.ɵɵconditional(ctx.typeName() ? 4 : -1);
|
|
33
|
-
i0.ɵɵadvance();
|
|
34
|
-
i0.ɵɵclassProp("prism-boolean-control__toggle--on", ctx.value());
|
|
14
|
+
i0.ɵɵclassProp("on", ctx.value());
|
|
35
15
|
i0.ɵɵattribute("aria-checked", ctx.value());
|
|
36
|
-
} }, styles: [".
|
|
16
|
+
} }, styles: [".ctl-toggle[_ngcontent-%COMP%] {\n position: relative;\n width: 34px;\n height: 18px;\n border-radius: 9px;\n background: var(--prism-input-bg);\n border: 1px solid var(--prism-border);\n transition: all var(--dur-fast);\n cursor: pointer;\n flex-shrink: 0;\n padding: 0;\n }\n .ctl-toggle[_ngcontent-%COMP%]::after {\n content: '';\n position: absolute;\n left: 2px;\n top: 2px;\n width: 12px;\n height: 12px;\n border-radius: 50%;\n background: var(--prism-text-muted);\n transition: transform var(--dur-fast), background var(--dur-fast);\n }\n .ctl-toggle.on[_ngcontent-%COMP%] {\n background: var(--prism-primary);\n border-color: var(--prism-primary);\n }\n .ctl-toggle.on[_ngcontent-%COMP%]::after {\n transform: translateX(16px);\n background: white;\n }"], changeDetection: 0 });
|
|
37
17
|
}
|
|
38
18
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(BooleanControlComponent, [{
|
|
39
19
|
type: Component,
|
|
40
|
-
args: [{ selector: 'prism-boolean-control', standalone: true, template: `
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
(click)="valueChange.emit(!value())"
|
|
50
|
-
role="switch"
|
|
51
|
-
[attr.aria-checked]="value()"
|
|
52
|
-
>
|
|
53
|
-
<span class="prism-boolean-control__thumb"></span>
|
|
54
|
-
</button>
|
|
55
|
-
</div>
|
|
56
|
-
`, styles: ["\n .prism-boolean-control {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 8px 16px;\n min-height: 36px;\n }\n\n .prism-boolean-control__label {\n display: flex;\n flex-direction: column;\n gap: 1px;\n }\n .prism-boolean-control__label-text {\n font-size: 13px;\n font-family: var(--prism-font-sans);\n color: var(--prism-text-muted);\n font-weight: 500;\n }\n .prism-boolean-control__type {\n font-size: 10px;\n font-family: var(--prism-font-mono, monospace);\n color: var(--prism-text-ghost);\n }\n\n .prism-boolean-control__toggle {\n position: relative;\n width: 36px;\n height: 20px;\n border-radius: 10px;\n border: 1px solid var(--prism-border-strong);\n background: var(--prism-bg-surface);\n cursor: pointer;\n transition: background 0.2s, border-color 0.2s;\n padding: 0;\n flex-shrink: 0;\n }\n\n .prism-boolean-control__toggle--on {\n background: var(--prism-primary);\n border-color: var(--prism-primary);\n }\n\n .prism-boolean-control__thumb {\n position: absolute;\n top: 2px;\n left: 2px;\n width: 14px;\n height: 14px;\n border-radius: 50%;\n background: var(--prism-text-ghost);\n transition: transform 0.2s, background 0.2s;\n }\n\n .prism-boolean-control__toggle--on .prism-boolean-control__thumb {\n transform: translateX(16px);\n background: var(--prism-bg-elevated);\n }\n "] }]
|
|
20
|
+
args: [{ selector: 'prism-boolean-control', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
21
|
+
<button
|
|
22
|
+
class="ctl-toggle"
|
|
23
|
+
[class.on]="value()"
|
|
24
|
+
(click)="valueChange.emit(!value())"
|
|
25
|
+
role="switch"
|
|
26
|
+
[attr.aria-checked]="value()"
|
|
27
|
+
></button>
|
|
28
|
+
`, styles: ["\n .ctl-toggle {\n position: relative;\n width: 34px;\n height: 18px;\n border-radius: 9px;\n background: var(--prism-input-bg);\n border: 1px solid var(--prism-border);\n transition: all var(--dur-fast);\n cursor: pointer;\n flex-shrink: 0;\n padding: 0;\n }\n .ctl-toggle::after {\n content: '';\n position: absolute;\n left: 2px;\n top: 2px;\n width: 12px;\n height: 12px;\n border-radius: 50%;\n background: var(--prism-text-muted);\n transition: transform var(--dur-fast), background var(--dur-fast);\n }\n .ctl-toggle.on {\n background: var(--prism-primary);\n border-color: var(--prism-primary);\n }\n .ctl-toggle.on::after {\n transform: translateX(16px);\n background: white;\n }\n "] }]
|
|
57
29
|
}], null, { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], typeName: [{ type: i0.Input, args: [{ isSignal: true, alias: "typeName", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }] }); })();
|
|
58
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(BooleanControlComponent, { className: "BooleanControlComponent", filePath: "app/controls/boolean-control.component.ts", lineNumber:
|
|
30
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(BooleanControlComponent, { className: "BooleanControlComponent", filePath: "app/controls/boolean-control.component.ts", lineNumber: 55 }); })();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-control.component.d.ts","sourceRoot":"","sources":["../../../src/app/controls/json-control.component.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"json-control.component.d.ts","sourceRoot":"","sources":["../../../src/app/controls/json-control.component.ts"],"names":[],"mappings":";AAyBA,qBAuFa,oBAAoB;IAC/B,QAAQ,CAAC,KAAK,+CAAwB;IACtC,QAAQ,CAAC,KAAK,8CAAa;IAC3B,QAAQ,CAAC,QAAQ,8CAAa;IAC9B,QAAQ,CAAC,WAAW,oDAAqB;IAEzC,QAAQ,CAAC,UAAU,kDAAiB;IACpC,QAAQ,CAAC,SAAS,wDAA+B;IAEjD,OAAO,CAAC,QAAQ,CAAC,UAAU,CACgC;IAC3D,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAkD;IAExE,QAAQ,CAAC,WAAW,yCAIjB;IAEH,QAAQ,CAAC,eAAe,yCAAqD;IAE7E,SAAS,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM;IAQ/B,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAW1B,UAAU,IAAI,IAAI;yCAxCP,oBAAoB;2CAApB,oBAAoB;CAgDhC"}
|
|
@@ -1,18 +1,9 @@
|
|
|
1
|
-
import { Component, computed, input, output, signal, viewChild } from '@angular/core';
|
|
1
|
+
import { Component, ChangeDetectionStrategy, computed, input, output, signal, viewChild, } from '@angular/core';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
const _c0 = ["textareaEl"];
|
|
4
4
|
const _c1 = ["preEl"];
|
|
5
|
-
function
|
|
6
|
-
i0.ɵɵdomElementStart(0, "
|
|
7
|
-
i0.ɵɵtext(1);
|
|
8
|
-
i0.ɵɵdomElementEnd();
|
|
9
|
-
} if (rf & 2) {
|
|
10
|
-
const ctx_r0 = i0.ɵɵnextContext();
|
|
11
|
-
i0.ɵɵadvance();
|
|
12
|
-
i0.ɵɵtextInterpolate(ctx_r0.typeName());
|
|
13
|
-
} }
|
|
14
|
-
function JsonControlComponent_Conditional_12_Template(rf, ctx) { if (rf & 1) {
|
|
15
|
-
i0.ɵɵdomElementStart(0, "span", 11);
|
|
5
|
+
function JsonControlComponent_Conditional_7_Template(rf, ctx) { if (rf & 1) {
|
|
6
|
+
i0.ɵɵdomElementStart(0, "span", 7);
|
|
16
7
|
i0.ɵɵtext(1, "Invalid JSON");
|
|
17
8
|
i0.ɵɵdomElementEnd();
|
|
18
9
|
} }
|
|
@@ -79,58 +70,46 @@ export class JsonControlComponent {
|
|
|
79
70
|
i0.ɵɵviewQuerySignal(ctx.textareaEl, _c0, 5)(ctx.preEl, _c1, 5);
|
|
80
71
|
} if (rf & 2) {
|
|
81
72
|
i0.ɵɵqueryAdvance(2);
|
|
82
|
-
} }, inputs: { value: [1, "value"], label: [1, "label"], typeName: [1, "typeName"] }, outputs: { valueChange: "valueChange" }, decls:
|
|
83
|
-
i0.ɵɵdomElementStart(0, "div", 2)(1, "div", 3)(2, "
|
|
84
|
-
i0.ɵɵ
|
|
85
|
-
i0.ɵɵdomElementEnd();
|
|
86
|
-
i0.ɵɵconditionalCreate(4, JsonControlComponent_Conditional_4_Template, 2, 1, "code", 5);
|
|
73
|
+
} }, inputs: { value: [1, "value"], label: [1, "label"], typeName: [1, "typeName"] }, outputs: { valueChange: "valueChange" }, decls: 8, vars: 3, consts: [["preEl", ""], ["textareaEl", ""], [1, "json-editor"], [1, "json-overlay"], [1, "json-pre"], [3, "innerHTML"], ["spellcheck", "false", 1, "json-input", 3, "input", "scroll", "value"], [1, "json-error"]], template: function JsonControlComponent_Template(rf, ctx) { if (rf & 1) {
|
|
74
|
+
i0.ɵɵdomElementStart(0, "div", 2)(1, "div", 3)(2, "pre", 4, 0);
|
|
75
|
+
i0.ɵɵdomElement(4, "code", 5);
|
|
87
76
|
i0.ɵɵdomElementEnd();
|
|
88
|
-
i0.ɵɵdomElementStart(5, "
|
|
89
|
-
i0.ɵɵ
|
|
90
|
-
i0.ɵɵdomElementEnd();
|
|
91
|
-
i0.ɵɵdomElementStart(10, "textarea", 10, 1);
|
|
92
|
-
i0.ɵɵdomListener("input", function JsonControlComponent_Template_textarea_input_10_listener($event) { return ctx.onInput($event.target.value); })("scroll", function JsonControlComponent_Template_textarea_scroll_10_listener() { return ctx.syncScroll(); });
|
|
93
|
-
i0.ɵɵdomElementEnd()();
|
|
94
|
-
i0.ɵɵconditionalCreate(12, JsonControlComponent_Conditional_12_Template, 2, 0, "span", 11);
|
|
77
|
+
i0.ɵɵdomElementStart(5, "textarea", 6, 1);
|
|
78
|
+
i0.ɵɵdomListener("input", function JsonControlComponent_Template_textarea_input_5_listener($event) { return ctx.onInput($event.target.value); })("scroll", function JsonControlComponent_Template_textarea_scroll_5_listener() { return ctx.syncScroll(); });
|
|
95
79
|
i0.ɵɵdomElementEnd()();
|
|
80
|
+
i0.ɵɵconditionalCreate(7, JsonControlComponent_Conditional_7_Template, 2, 0, "span", 7);
|
|
81
|
+
i0.ɵɵdomElementEnd();
|
|
96
82
|
} if (rf & 2) {
|
|
97
|
-
i0.ɵɵadvance(
|
|
98
|
-
i0.ɵɵtextInterpolate(ctx.label());
|
|
99
|
-
i0.ɵɵadvance();
|
|
100
|
-
i0.ɵɵconditional(ctx.typeName() ? 4 : -1);
|
|
101
|
-
i0.ɵɵadvance(5);
|
|
83
|
+
i0.ɵɵadvance(4);
|
|
102
84
|
i0.ɵɵdomProperty("innerHTML", ctx.highlightedHtml(), i0.ɵɵsanitizeHtml);
|
|
103
85
|
i0.ɵɵadvance();
|
|
104
86
|
i0.ɵɵdomProperty("value", ctx.displayText());
|
|
105
87
|
i0.ɵɵadvance(2);
|
|
106
|
-
i0.ɵɵconditional(ctx.parseError() ?
|
|
107
|
-
} }, styles: [".
|
|
88
|
+
i0.ɵɵconditional(ctx.parseError() ? 7 : -1);
|
|
89
|
+
} }, styles: [".json-editor[_ngcontent-%COMP%] { flex: 1; min-width: 0; }\n\n .json-overlay[_ngcontent-%COMP%] {\n position: relative;\n border: 1px solid var(--prism-border);\n border-radius: var(--radius-sm);\n overflow: hidden;\n transition: border-color var(--dur-fast);\n }\n .json-overlay[_ngcontent-%COMP%]:focus-within {\n border-color: var(--prism-primary);\n box-shadow: 0 0 0 2px color-mix(in srgb, var(--prism-primary) 30%, transparent);\n }\n\n .json-pre[_ngcontent-%COMP%], .json-input[_ngcontent-%COMP%] {\n margin: 0;\n padding: 4px 8px;\n font-family: var(--font-mono);\n font-size: 12px;\n line-height: 1.4;\n white-space: pre-wrap;\n word-wrap: break-word;\n tab-size: 2;\n }\n\n .json-pre[_ngcontent-%COMP%] {\n min-height: 56px;\n pointer-events: none;\n }\n .json-pre[_ngcontent-%COMP%] code[_ngcontent-%COMP%] { font-family: inherit; }\n\n [_nghost-%COMP%] .jh-key { color: #93c5fd; }\n [_nghost-%COMP%] .jh-string { color: #86efac; }\n [_nghost-%COMP%] .jh-number { color: #fbbf24; }\n [_nghost-%COMP%] .jh-bool { color: #a78bfa; }\n [_nghost-%COMP%] .jh-null { color: var(--prism-text-ghost); }\n\n .json-input[_ngcontent-%COMP%] {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n background: transparent;\n color: transparent;\n caret-color: var(--prism-text);\n border: none;\n resize: none;\n overflow: auto;\n box-sizing: border-box;\n }\n .json-input[_ngcontent-%COMP%]:focus { outline: none; }\n .json-input[_ngcontent-%COMP%]::selection { background: rgba(99, 102, 241, 0.3); }\n\n .json-error[_ngcontent-%COMP%] {\n font-size: 11px;\n color: var(--prism-danger);\n display: block;\n margin-top: 2px;\n }"], changeDetection: 0 });
|
|
108
90
|
}
|
|
109
91
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(JsonControlComponent, [{
|
|
110
92
|
type: Component,
|
|
111
|
-
args: [{ selector: 'prism-json-control', standalone: true, template: `
|
|
112
|
-
<div class="
|
|
113
|
-
<div class="
|
|
114
|
-
<
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
<
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
spellcheck="false"
|
|
127
|
-
></textarea>
|
|
128
|
-
</div>
|
|
129
|
-
@if (parseError()) {
|
|
130
|
-
<span class="prism-json-control__error">Invalid JSON</span>
|
|
131
|
-
}
|
|
93
|
+
args: [{ selector: 'prism-json-control', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
94
|
+
<div class="json-editor">
|
|
95
|
+
<div class="json-overlay">
|
|
96
|
+
<pre
|
|
97
|
+
class="json-pre"
|
|
98
|
+
#preEl
|
|
99
|
+
><code [innerHTML]="highlightedHtml()"></code></pre>
|
|
100
|
+
<textarea
|
|
101
|
+
#textareaEl
|
|
102
|
+
class="json-input"
|
|
103
|
+
[value]="displayText()"
|
|
104
|
+
(input)="onInput($any($event.target).value)"
|
|
105
|
+
(scroll)="syncScroll()"
|
|
106
|
+
spellcheck="false"
|
|
107
|
+
></textarea>
|
|
132
108
|
</div>
|
|
109
|
+
@if (parseError()) {
|
|
110
|
+
<span class="json-error">Invalid JSON</span>
|
|
111
|
+
}
|
|
133
112
|
</div>
|
|
134
|
-
`, styles: ["\n .
|
|
113
|
+
`, styles: ["\n .json-editor { flex: 1; min-width: 0; }\n\n .json-overlay {\n position: relative;\n border: 1px solid var(--prism-border);\n border-radius: var(--radius-sm);\n overflow: hidden;\n transition: border-color var(--dur-fast);\n }\n .json-overlay:focus-within {\n border-color: var(--prism-primary);\n box-shadow: 0 0 0 2px color-mix(in srgb, var(--prism-primary) 30%, transparent);\n }\n\n .json-pre, .json-input {\n margin: 0;\n padding: 4px 8px;\n font-family: var(--font-mono);\n font-size: 12px;\n line-height: 1.4;\n white-space: pre-wrap;\n word-wrap: break-word;\n tab-size: 2;\n }\n\n .json-pre {\n min-height: 56px;\n pointer-events: none;\n }\n .json-pre code { font-family: inherit; }\n\n :host ::ng-deep .jh-key { color: #93c5fd; }\n :host ::ng-deep .jh-string { color: #86efac; }\n :host ::ng-deep .jh-number { color: #fbbf24; }\n :host ::ng-deep .jh-bool { color: #a78bfa; }\n :host ::ng-deep .jh-null { color: var(--prism-text-ghost); }\n\n .json-input {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n background: transparent;\n color: transparent;\n caret-color: var(--prism-text);\n border: none;\n resize: none;\n overflow: auto;\n box-sizing: border-box;\n }\n .json-input:focus { outline: none; }\n .json-input::selection { background: rgba(99, 102, 241, 0.3); }\n\n .json-error {\n font-size: 11px;\n color: var(--prism-danger);\n display: block;\n margin-top: 2px;\n }\n "] }]
|
|
135
114
|
}], null, { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], typeName: [{ type: i0.Input, args: [{ isSignal: true, alias: "typeName", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }], textareaEl: [{ type: i0.ViewChild, args: ['textareaEl', { isSignal: true }] }], preEl: [{ type: i0.ViewChild, args: ['preEl', { isSignal: true }] }] }); })();
|
|
136
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(JsonControlComponent, { className: "JsonControlComponent", filePath: "app/controls/json-control.component.ts", lineNumber:
|
|
115
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(JsonControlComponent, { className: "JsonControlComponent", filePath: "app/controls/json-control.component.ts", lineNumber: 113 }); })();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"number-control.component.d.ts","sourceRoot":"","sources":["../../../src/app/controls/number-control.component.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"number-control.component.d.ts","sourceRoot":"","sources":["../../../src/app/controls/number-control.component.ts"],"names":[],"mappings":";AAOA,qBAiDa,sBAAsB;IACjC,QAAQ,CAAC,KAAK,8CAAY;IAC1B,QAAQ,CAAC,KAAK,8CAAa;IAC3B,QAAQ,CAAC,QAAQ,8CAAa;IAC9B,QAAQ,CAAC,WAAW,mDAAoB;yCAJ7B,sBAAsB;2CAAtB,sBAAsB;CAKlC"}
|