@ng-prism/core 21.2.0 → 21.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/dist/app/panels/controls/prism-controls-panel.component.d.ts +3 -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 +105 -75
- package/dist/app/panels/panel-host/prism-panel-host.component.d.ts +1 -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 +22 -3
- package/dist/app/sidebar/prism-sidebar.component.d.ts +12 -3
- package/dist/app/sidebar/prism-sidebar.component.d.ts.map +1 -1
- package/dist/app/sidebar/prism-sidebar.component.js +196 -64
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@ Lightweight, Angular-native component showcase tool. Annotate components with `@
|
|
|
11
11
|
- **Zero-config discovery** — TypeScript Compiler API scans your library at build time
|
|
12
12
|
- **Signal-native** — works with `input()` / `output()` signals
|
|
13
13
|
- **Directive support** — showcase directives with configurable host elements
|
|
14
|
-
- **Plugin architecture** — JSDoc, A11y, Figma, Performance, Box Model plugins
|
|
14
|
+
- **Plugin architecture** — JSDoc, A11y, Figma, Performance, Box Model, Coverage plugins
|
|
15
15
|
- **Live Controls** — auto-generated input controls with type-aware editors
|
|
16
16
|
- **Code Snippets** — live-updating Angular template snippets per variant
|
|
17
17
|
- **Component Pages** — free-form demo pages for complex components
|
|
@@ -150,6 +150,7 @@ export class TableComponent { ... }
|
|
|
150
150
|
| Figma | `@ng-prism/plugin-figma` | Figma design embed + visual diff |
|
|
151
151
|
| Box Model | `@ng-prism/plugin-box-model` | CSS box model inspector |
|
|
152
152
|
| Perf | `@ng-prism/plugin-perf` | Render performance profiling |
|
|
153
|
+
| Coverage | `@ng-prism/plugin-coverage` | Per-component test coverage from Istanbul/v8 |
|
|
153
154
|
|
|
154
155
|
> **Note:** Accessibility auditing (axe-core) is built into ng-prism core — no plugin needed.
|
|
155
156
|
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import type { ControlDefinition, InputMeta } from '../../../plugin/plugin.types.js';
|
|
1
2
|
import { PrismNavigationService } from '../../services/prism-navigation.service.js';
|
|
2
3
|
import { PrismRendererService } from '../../services/prism-renderer.service.js';
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
4
5
|
export declare class PrismControlsPanelComponent {
|
|
5
6
|
protected readonly navigationService: PrismNavigationService;
|
|
6
7
|
protected readonly rendererService: PrismRendererService;
|
|
8
|
+
private readonly pluginService;
|
|
9
|
+
protected getCustomControl(input: InputMeta): ControlDefinition | null;
|
|
7
10
|
protected asBoolean(val: unknown): boolean;
|
|
8
11
|
protected asNumber(val: unknown): number;
|
|
9
12
|
protected asString(val: unknown): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prism-controls-panel.component.d.ts","sourceRoot":"","sources":["../../../../src/app/panels/controls/prism-controls-panel.component.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"prism-controls-panel.component.d.ts","sourceRoot":"","sources":["../../../../src/app/panels/controls/prism-controls-panel.component.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACpF,OAAO,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AAEpF,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;;AAEhF,qBAiGa,2BAA2B;IACtC,SAAS,CAAC,QAAQ,CAAC,iBAAiB,yBAAkC;IACtE,SAAS,CAAC,QAAQ,CAAC,eAAe,uBAAgC;IAClE,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA8B;IAE5D,SAAS,CAAC,gBAAgB,CAAC,KAAK,EAAE,SAAS,GAAG,iBAAiB,GAAG,IAAI;IAItE,SAAS,CAAC,SAAS,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO;IAI1C,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM;IAIxC,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM;yCAjB7B,2BAA2B;2CAA3B,2BAA2B;CAoBvC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { NgComponentOutlet } from '@angular/common';
|
|
1
2
|
import { Component, inject } from '@angular/core';
|
|
2
3
|
import { BooleanControlComponent } from '../../controls/boolean-control.component.js';
|
|
3
4
|
import { JsonControlComponent } from '../../controls/json-control.component.js';
|
|
@@ -5,69 +6,85 @@ import { NumberControlComponent } from '../../controls/number-control.component.
|
|
|
5
6
|
import { StringControlComponent } from '../../controls/string-control.component.js';
|
|
6
7
|
import { UnionControlComponent } from '../../controls/union-control.component.js';
|
|
7
8
|
import { PrismNavigationService } from '../../services/prism-navigation.service.js';
|
|
9
|
+
import { PrismPluginService } from '../../services/prism-plugin.service.js';
|
|
8
10
|
import { PrismRendererService } from '../../services/prism-renderer.service.js';
|
|
9
11
|
import * as i0 from "@angular/core";
|
|
10
|
-
const _c0 =
|
|
12
|
+
const _c0 = a0 => ({ inputMeta: a0 });
|
|
13
|
+
const _c1 = () => [];
|
|
11
14
|
const _forTrack0 = ($index, $item) => $item.name;
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
function PrismControlsPanelComponent_Conditional_0_For_2_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
16
|
+
i0.ɵɵelementContainer(0, 3);
|
|
17
|
+
} if (rf & 2) {
|
|
18
|
+
const input_r1 = i0.ɵɵnextContext().$implicit;
|
|
19
|
+
i0.ɵɵproperty("ngComponentOutlet", ctx.component)("ngComponentOutletInputs", i0.ɵɵpureFunction1(2, _c0, input_r1));
|
|
20
|
+
} }
|
|
21
|
+
function PrismControlsPanelComponent_Conditional_0_For_2_Conditional_2_Case_0_Template(rf, ctx) { if (rf & 1) {
|
|
22
|
+
const _r2 = i0.ɵɵgetCurrentView();
|
|
23
|
+
i0.ɵɵelementStart(0, "prism-boolean-control", 6);
|
|
24
|
+
i0.ɵɵlistener("valueChange", function PrismControlsPanelComponent_Conditional_0_For_2_Conditional_2_Case_0_Template_prism_boolean_control_valueChange_0_listener($event) { i0.ɵɵrestoreView(_r2); const input_r1 = i0.ɵɵnextContext(2).$implicit; const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.rendererService.updateInput(input_r1.name, $event)); });
|
|
16
25
|
i0.ɵɵelementEnd();
|
|
17
26
|
} if (rf & 2) {
|
|
18
|
-
const
|
|
27
|
+
const input_r1 = i0.ɵɵnextContext(2).$implicit;
|
|
19
28
|
const ctx_r2 = i0.ɵɵnextContext(2);
|
|
20
|
-
i0.ɵɵproperty("value", ctx_r2.asBoolean(ctx_r2.rendererService.inputValues()[
|
|
29
|
+
i0.ɵɵproperty("value", ctx_r2.asBoolean(ctx_r2.rendererService.inputValues()[input_r1.name]))("label", input_r1.name)("typeName", input_r1.rawType ?? "");
|
|
21
30
|
} }
|
|
22
|
-
function
|
|
31
|
+
function PrismControlsPanelComponent_Conditional_0_For_2_Conditional_2_Case_1_Template(rf, ctx) { if (rf & 1) {
|
|
23
32
|
const _r4 = i0.ɵɵgetCurrentView();
|
|
24
|
-
i0.ɵɵelementStart(0, "prism-number-control",
|
|
25
|
-
i0.ɵɵlistener("valueChange", function
|
|
33
|
+
i0.ɵɵelementStart(0, "prism-number-control", 6);
|
|
34
|
+
i0.ɵɵlistener("valueChange", function PrismControlsPanelComponent_Conditional_0_For_2_Conditional_2_Case_1_Template_prism_number_control_valueChange_0_listener($event) { i0.ɵɵrestoreView(_r4); const input_r1 = i0.ɵɵnextContext(2).$implicit; const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.rendererService.updateInput(input_r1.name, $event)); });
|
|
26
35
|
i0.ɵɵelementEnd();
|
|
27
36
|
} if (rf & 2) {
|
|
28
|
-
const
|
|
37
|
+
const input_r1 = i0.ɵɵnextContext(2).$implicit;
|
|
29
38
|
const ctx_r2 = i0.ɵɵnextContext(2);
|
|
30
|
-
i0.ɵɵproperty("value", ctx_r2.asNumber(ctx_r2.rendererService.inputValues()[
|
|
39
|
+
i0.ɵɵproperty("value", ctx_r2.asNumber(ctx_r2.rendererService.inputValues()[input_r1.name]))("label", input_r1.name)("typeName", input_r1.rawType ?? "");
|
|
31
40
|
} }
|
|
32
|
-
function
|
|
41
|
+
function PrismControlsPanelComponent_Conditional_0_For_2_Conditional_2_Case_2_Template(rf, ctx) { if (rf & 1) {
|
|
33
42
|
const _r5 = i0.ɵɵgetCurrentView();
|
|
34
|
-
i0.ɵɵelementStart(0, "prism-union-control",
|
|
35
|
-
i0.ɵɵlistener("valueChange", function
|
|
43
|
+
i0.ɵɵelementStart(0, "prism-union-control", 7);
|
|
44
|
+
i0.ɵɵlistener("valueChange", function PrismControlsPanelComponent_Conditional_0_For_2_Conditional_2_Case_2_Template_prism_union_control_valueChange_0_listener($event) { i0.ɵɵrestoreView(_r5); const input_r1 = i0.ɵɵnextContext(2).$implicit; const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.rendererService.updateInput(input_r1.name, $event)); });
|
|
36
45
|
i0.ɵɵelementEnd();
|
|
37
46
|
} if (rf & 2) {
|
|
38
|
-
const
|
|
47
|
+
const input_r1 = i0.ɵɵnextContext(2).$implicit;
|
|
39
48
|
const ctx_r2 = i0.ɵɵnextContext(2);
|
|
40
|
-
i0.ɵɵproperty("value", ctx_r2.asString(ctx_r2.rendererService.inputValues()[
|
|
49
|
+
i0.ɵɵproperty("value", ctx_r2.asString(ctx_r2.rendererService.inputValues()[input_r1.name]))("label", input_r1.name)("typeName", input_r1.rawType ?? "")("options", input_r1.values ?? i0.ɵɵpureFunction0(4, _c1));
|
|
41
50
|
} }
|
|
42
|
-
function
|
|
51
|
+
function PrismControlsPanelComponent_Conditional_0_For_2_Conditional_2_Case_3_Template(rf, ctx) { if (rf & 1) {
|
|
43
52
|
const _r6 = i0.ɵɵgetCurrentView();
|
|
44
|
-
i0.ɵɵelementStart(0, "prism-string-control",
|
|
45
|
-
i0.ɵɵlistener("valueChange", function
|
|
53
|
+
i0.ɵɵelementStart(0, "prism-string-control", 6);
|
|
54
|
+
i0.ɵɵlistener("valueChange", function PrismControlsPanelComponent_Conditional_0_For_2_Conditional_2_Case_3_Template_prism_string_control_valueChange_0_listener($event) { i0.ɵɵrestoreView(_r6); const input_r1 = i0.ɵɵnextContext(2).$implicit; const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.rendererService.updateInput(input_r1.name, $event)); });
|
|
46
55
|
i0.ɵɵelementEnd();
|
|
47
56
|
} if (rf & 2) {
|
|
48
|
-
const
|
|
57
|
+
const input_r1 = i0.ɵɵnextContext(2).$implicit;
|
|
49
58
|
const ctx_r2 = i0.ɵɵnextContext(2);
|
|
50
|
-
i0.ɵɵproperty("value", ctx_r2.asString(ctx_r2.rendererService.inputValues()[
|
|
59
|
+
i0.ɵɵproperty("value", ctx_r2.asString(ctx_r2.rendererService.inputValues()[input_r1.name]))("label", input_r1.name)("typeName", input_r1.rawType ?? "");
|
|
51
60
|
} }
|
|
52
|
-
function
|
|
61
|
+
function PrismControlsPanelComponent_Conditional_0_For_2_Conditional_2_Case_4_Template(rf, ctx) { if (rf & 1) {
|
|
53
62
|
const _r7 = i0.ɵɵgetCurrentView();
|
|
54
|
-
i0.ɵɵelementStart(0, "prism-json-control",
|
|
55
|
-
i0.ɵɵlistener("valueChange", function
|
|
63
|
+
i0.ɵɵelementStart(0, "prism-json-control", 6);
|
|
64
|
+
i0.ɵɵlistener("valueChange", function PrismControlsPanelComponent_Conditional_0_For_2_Conditional_2_Case_4_Template_prism_json_control_valueChange_0_listener($event) { i0.ɵɵrestoreView(_r7); const input_r1 = i0.ɵɵnextContext(2).$implicit; const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.rendererService.updateInput(input_r1.name, $event)); });
|
|
56
65
|
i0.ɵɵelementEnd();
|
|
57
66
|
} if (rf & 2) {
|
|
58
|
-
const
|
|
67
|
+
const input_r1 = i0.ɵɵnextContext(2).$implicit;
|
|
59
68
|
const ctx_r2 = i0.ɵɵnextContext(2);
|
|
60
|
-
i0.ɵɵproperty("value", ctx_r2.rendererService.inputValues()[
|
|
69
|
+
i0.ɵɵproperty("value", ctx_r2.rendererService.inputValues()[input_r1.name])("label", input_r1.name)("typeName", input_r1.rawType ?? "");
|
|
70
|
+
} }
|
|
71
|
+
function PrismControlsPanelComponent_Conditional_0_For_2_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
72
|
+
i0.ɵɵconditionalCreate(0, PrismControlsPanelComponent_Conditional_0_For_2_Conditional_2_Case_0_Template, 1, 3, "prism-boolean-control", 4)(1, PrismControlsPanelComponent_Conditional_0_For_2_Conditional_2_Case_1_Template, 1, 3, "prism-number-control", 4)(2, PrismControlsPanelComponent_Conditional_0_For_2_Conditional_2_Case_2_Template, 1, 5, "prism-union-control", 5)(3, PrismControlsPanelComponent_Conditional_0_For_2_Conditional_2_Case_3_Template, 1, 3, "prism-string-control", 4)(4, PrismControlsPanelComponent_Conditional_0_For_2_Conditional_2_Case_4_Template, 1, 3, "prism-json-control", 4);
|
|
73
|
+
} if (rf & 2) {
|
|
74
|
+
let tmp_13_0;
|
|
75
|
+
const input_r1 = i0.ɵɵnextContext().$implicit;
|
|
76
|
+
i0.ɵɵconditional((tmp_13_0 = input_r1.type) === "boolean" ? 0 : tmp_13_0 === "number" ? 1 : tmp_13_0 === "union" ? 2 : tmp_13_0 === "string" ? 3 : 4);
|
|
61
77
|
} }
|
|
62
78
|
function PrismControlsPanelComponent_Conditional_0_For_2_Template(rf, ctx) { if (rf & 1) {
|
|
63
79
|
i0.ɵɵelementStart(0, "div", 1);
|
|
64
|
-
i0.ɵɵconditionalCreate(1,
|
|
80
|
+
i0.ɵɵconditionalCreate(1, PrismControlsPanelComponent_Conditional_0_For_2_Conditional_1_Template, 1, 4, "ng-container", 3)(2, PrismControlsPanelComponent_Conditional_0_For_2_Conditional_2_Template, 5, 1);
|
|
65
81
|
i0.ɵɵelementEnd();
|
|
66
82
|
} if (rf & 2) {
|
|
67
83
|
let tmp_12_0;
|
|
68
|
-
const
|
|
84
|
+
const input_r1 = ctx.$implicit;
|
|
85
|
+
const ctx_r2 = i0.ɵɵnextContext(2);
|
|
69
86
|
i0.ɵɵadvance();
|
|
70
|
-
i0.ɵɵconditional((tmp_12_0 =
|
|
87
|
+
i0.ɵɵconditional((tmp_12_0 = ctx_r2.getCustomControl(input_r1)) ? 1 : 2, tmp_12_0);
|
|
71
88
|
} }
|
|
72
89
|
function PrismControlsPanelComponent_Conditional_0_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
73
90
|
i0.ɵɵelementStart(0, "p", 2);
|
|
@@ -76,7 +93,7 @@ function PrismControlsPanelComponent_Conditional_0_Conditional_3_Template(rf, ct
|
|
|
76
93
|
} }
|
|
77
94
|
function PrismControlsPanelComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
78
95
|
i0.ɵɵelementStart(0, "div", 0);
|
|
79
|
-
i0.ɵɵrepeaterCreate(1, PrismControlsPanelComponent_Conditional_0_For_2_Template,
|
|
96
|
+
i0.ɵɵrepeaterCreate(1, PrismControlsPanelComponent_Conditional_0_For_2_Template, 3, 1, "div", 1, _forTrack0);
|
|
80
97
|
i0.ɵɵconditionalCreate(3, PrismControlsPanelComponent_Conditional_0_Conditional_3_Template, 2, 0, "p", 2);
|
|
81
98
|
i0.ɵɵelementEnd();
|
|
82
99
|
} if (rf & 2) {
|
|
@@ -89,6 +106,10 @@ function PrismControlsPanelComponent_Conditional_0_Template(rf, ctx) { if (rf &
|
|
|
89
106
|
export class PrismControlsPanelComponent {
|
|
90
107
|
navigationService = inject(PrismNavigationService);
|
|
91
108
|
rendererService = inject(PrismRendererService);
|
|
109
|
+
pluginService = inject(PrismPluginService);
|
|
110
|
+
getCustomControl(input) {
|
|
111
|
+
return this.pluginService.controls().find((ctrl) => ctrl.matchType(input)) ?? null;
|
|
112
|
+
}
|
|
92
113
|
asBoolean(val) {
|
|
93
114
|
return Boolean(val);
|
|
94
115
|
}
|
|
@@ -99,12 +120,13 @@ export class PrismControlsPanelComponent {
|
|
|
99
120
|
return String(val ?? '');
|
|
100
121
|
}
|
|
101
122
|
static ɵfac = function PrismControlsPanelComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || PrismControlsPanelComponent)(); };
|
|
102
|
-
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: PrismControlsPanelComponent, selectors: [["prism-controls-panel"]], decls: 1, vars: 1, consts: [[1, "prism-controls-panel"], [1, "prism-controls-panel__row"], [1, "prism-controls-panel__empty"], [3, "value", "label", "typeName"], [3, "value", "label", "typeName", "options"], [3, "valueChange", "value", "label", "typeName"], [3, "valueChange", "value", "label", "typeName", "options"]], template: function PrismControlsPanelComponent_Template(rf, ctx) { if (rf & 1) {
|
|
123
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: PrismControlsPanelComponent, selectors: [["prism-controls-panel"]], decls: 1, vars: 1, consts: [[1, "prism-controls-panel"], [1, "prism-controls-panel__row"], [1, "prism-controls-panel__empty"], [3, "ngComponentOutlet", "ngComponentOutletInputs"], [3, "value", "label", "typeName"], [3, "value", "label", "typeName", "options"], [3, "valueChange", "value", "label", "typeName"], [3, "valueChange", "value", "label", "typeName", "options"]], template: function PrismControlsPanelComponent_Template(rf, ctx) { if (rf & 1) {
|
|
103
124
|
i0.ɵɵconditionalCreate(0, PrismControlsPanelComponent_Conditional_0_Template, 4, 1, "div", 0);
|
|
104
125
|
} if (rf & 2) {
|
|
105
126
|
let tmp_0_0;
|
|
106
127
|
i0.ɵɵconditional((tmp_0_0 = ctx.navigationService.activeComponent()) ? 0 : -1, tmp_0_0);
|
|
107
|
-
} }, dependencies: [
|
|
128
|
+
} }, dependencies: [NgComponentOutlet,
|
|
129
|
+
BooleanControlComponent,
|
|
108
130
|
StringControlComponent,
|
|
109
131
|
NumberControlComponent,
|
|
110
132
|
UnionControlComponent,
|
|
@@ -113,6 +135,7 @@ export class PrismControlsPanelComponent {
|
|
|
113
135
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PrismControlsPanelComponent, [{
|
|
114
136
|
type: Component,
|
|
115
137
|
args: [{ selector: 'prism-controls-panel', standalone: true, imports: [
|
|
138
|
+
NgComponentOutlet,
|
|
116
139
|
BooleanControlComponent,
|
|
117
140
|
StringControlComponent,
|
|
118
141
|
NumberControlComponent,
|
|
@@ -123,47 +146,54 @@ export class PrismControlsPanelComponent {
|
|
|
123
146
|
<div class="prism-controls-panel">
|
|
124
147
|
@for (input of comp.meta.inputs; track input.name) {
|
|
125
148
|
<div class="prism-controls-panel__row">
|
|
126
|
-
@
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
149
|
+
@if (getCustomControl(input); as customCtrl) {
|
|
150
|
+
<ng-container
|
|
151
|
+
[ngComponentOutlet]="customCtrl.component"
|
|
152
|
+
[ngComponentOutletInputs]="{ inputMeta: input }"
|
|
153
|
+
/>
|
|
154
|
+
} @else {
|
|
155
|
+
@switch (input.type) {
|
|
156
|
+
@case ('boolean') {
|
|
157
|
+
<prism-boolean-control
|
|
158
|
+
[value]="asBoolean(rendererService.inputValues()[input.name])"
|
|
159
|
+
[label]="input.name"
|
|
160
|
+
[typeName]="input.rawType ?? ''"
|
|
161
|
+
(valueChange)="rendererService.updateInput(input.name, $event)"
|
|
162
|
+
/>
|
|
163
|
+
}
|
|
164
|
+
@case ('number') {
|
|
165
|
+
<prism-number-control
|
|
166
|
+
[value]="asNumber(rendererService.inputValues()[input.name])"
|
|
167
|
+
[label]="input.name"
|
|
168
|
+
[typeName]="input.rawType ?? ''"
|
|
169
|
+
(valueChange)="rendererService.updateInput(input.name, $event)"
|
|
170
|
+
/>
|
|
171
|
+
}
|
|
172
|
+
@case ('union') {
|
|
173
|
+
<prism-union-control
|
|
174
|
+
[value]="asString(rendererService.inputValues()[input.name])"
|
|
175
|
+
[label]="input.name"
|
|
176
|
+
[typeName]="input.rawType ?? ''"
|
|
177
|
+
[options]="input.values ?? []"
|
|
178
|
+
(valueChange)="rendererService.updateInput(input.name, $event)"
|
|
179
|
+
/>
|
|
180
|
+
}
|
|
181
|
+
@case ('string') {
|
|
182
|
+
<prism-string-control
|
|
183
|
+
[value]="asString(rendererService.inputValues()[input.name])"
|
|
184
|
+
[label]="input.name"
|
|
185
|
+
[typeName]="input.rawType ?? ''"
|
|
186
|
+
(valueChange)="rendererService.updateInput(input.name, $event)"
|
|
187
|
+
/>
|
|
188
|
+
}
|
|
189
|
+
@default {
|
|
190
|
+
<prism-json-control
|
|
191
|
+
[value]="rendererService.inputValues()[input.name]"
|
|
192
|
+
[label]="input.name"
|
|
193
|
+
[typeName]="input.rawType ?? ''"
|
|
194
|
+
(valueChange)="rendererService.updateInput(input.name, $event)"
|
|
195
|
+
/>
|
|
196
|
+
}
|
|
167
197
|
}
|
|
168
198
|
}
|
|
169
199
|
</div>
|
|
@@ -175,4 +205,4 @@ export class PrismControlsPanelComponent {
|
|
|
175
205
|
}
|
|
176
206
|
`, styles: ["\n .prism-controls-panel {\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n height: 100%;\n }\n\n .prism-controls-panel__row {\n border-bottom: 1px solid var(--prism-border);\n }\n\n .prism-controls-panel__row:last-child { border-bottom: none; }\n\n .prism-controls-panel__empty {\n color: var(--prism-text-ghost);\n font-size: 13px;\n font-family: var(--prism-font-sans);\n margin: 0;\n padding: 16px;\n }\n "] }]
|
|
177
207
|
}], null, null); })();
|
|
178
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PrismControlsPanelComponent, { className: "PrismControlsPanelComponent", filePath: "app/panels/controls/prism-controls-panel.component.ts", lineNumber:
|
|
208
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PrismControlsPanelComponent, { className: "PrismControlsPanelComponent", filePath: "app/panels/controls/prism-controls-panel.component.ts", lineNumber: 110 }); })();
|
|
@@ -9,6 +9,7 @@ export declare class PrismPanelHostComponent implements OnDestroy {
|
|
|
9
9
|
private readonly auditService;
|
|
10
10
|
private readonly rendererService;
|
|
11
11
|
protected readonly a11yScore: import("@angular/core").Signal<number | null>;
|
|
12
|
+
protected readonly coverageScore: import("@angular/core").Signal<number | null>;
|
|
12
13
|
private readonly builtInPanels;
|
|
13
14
|
protected readonly allPanels: import("@angular/core").Signal<import("../../../index.js").PanelDefinition[]>;
|
|
14
15
|
protected readonly resolvedComponent: import("@angular/core").WritableSignal<Type<unknown> | null>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prism-panel-host.component.d.ts","sourceRoot":"","sources":["../../../../src/app/panels/panel-host/prism-panel-host.component.ts"],"names":[],"mappings":"AACA,OAAO,EAA0D,mBAAmB,EAAU,SAAS,EAAU,KAAK,IAAI,EAAE,MAAM,eAAe,CAAC;AAKlJ,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;;AAK1E,
|
|
1
|
+
{"version":3,"file":"prism-panel-host.component.d.ts","sourceRoot":"","sources":["../../../../src/app/panels/panel-host/prism-panel-host.component.ts"],"names":[],"mappings":"AACA,OAAO,EAA0D,mBAAmB,EAAU,SAAS,EAAU,KAAK,IAAI,EAAE,MAAM,eAAe,CAAC;AAKlJ,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;;AAK1E,qBAqFa,uBAAwB,YAAW,SAAS;IACvD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA8B;IAC5D,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAkC;IACtD,SAAS,CAAC,QAAQ,CAAC,YAAY,oBAA6B;IAC5D,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA+B;IAC3D,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA4B;IACzD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAgC;IAEhE,SAAS,CAAC,QAAQ,CAAC,SAAS,gDAAkE;IAE9F,SAAS,CAAC,QAAQ,CAAC,aAAa,gDAK7B;IAEH,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAkB;IAEhD,SAAS,CAAC,QAAQ,CAAC,SAAS,gFAGzB;IACH,SAAS,CAAC,QAAQ,CAAC,iBAAiB,+DAAsC;IAC1E,SAAS,CAAC,QAAQ,CAAC,WAAW;;OAE1B;IAEJ,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAoC;IAC9D,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA0C;IAExE,SAAS,CAAC,QAAQ,CAAC,cAAc,sDAY9B;;IAmDH,WAAW,IAAI,IAAI;yCA9FR,uBAAuB;2CAAvB,uBAAuB;CAiGnC"}
|
|
@@ -15,12 +15,19 @@ function PrismPanelHostComponent_For_3_Conditional_1_Template(rf, ctx) { if (rf
|
|
|
15
15
|
const ctx_r2 = i0.ɵɵnextContext(2);
|
|
16
16
|
i0.ɵɵproperty("score", ctx_r2.a11yScore())("compact", true);
|
|
17
17
|
} }
|
|
18
|
+
function PrismPanelHostComponent_For_3_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
19
|
+
i0.ɵɵelement(0, "prism-a11y-score", 5);
|
|
20
|
+
} if (rf & 2) {
|
|
21
|
+
const ctx_r2 = i0.ɵɵnextContext(2);
|
|
22
|
+
i0.ɵɵproperty("score", ctx_r2.coverageScore())("compact", true);
|
|
23
|
+
} }
|
|
18
24
|
function PrismPanelHostComponent_For_3_Template(rf, ctx) { if (rf & 1) {
|
|
19
25
|
const _r1 = i0.ɵɵgetCurrentView();
|
|
20
26
|
i0.ɵɵelementStart(0, "button", 4);
|
|
21
27
|
i0.ɵɵlistener("click", function PrismPanelHostComponent_For_3_Template_button_click_0_listener() { const panel_r2 = i0.ɵɵrestoreView(_r1).$implicit; const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.panelService.activePanelId.set(panel_r2.id)); });
|
|
22
28
|
i0.ɵɵconditionalCreate(1, PrismPanelHostComponent_For_3_Conditional_1_Template, 1, 2, "prism-a11y-score", 5);
|
|
23
|
-
i0.ɵɵ
|
|
29
|
+
i0.ɵɵconditionalCreate(2, PrismPanelHostComponent_For_3_Conditional_2_Template, 1, 2, "prism-a11y-score", 5);
|
|
30
|
+
i0.ɵɵtext(3);
|
|
24
31
|
i0.ɵɵelementEnd();
|
|
25
32
|
} if (rf & 2) {
|
|
26
33
|
const panel_r2 = ctx.$implicit;
|
|
@@ -29,6 +36,8 @@ function PrismPanelHostComponent_For_3_Template(rf, ctx) { if (rf & 1) {
|
|
|
29
36
|
i0.ɵɵadvance();
|
|
30
37
|
i0.ɵɵconditional(panel_r2.id === "a11y" && ctx_r2.a11yScore() !== null ? 1 : -1);
|
|
31
38
|
i0.ɵɵadvance();
|
|
39
|
+
i0.ɵɵconditional(panel_r2.id === "coverage" && ctx_r2.coverageScore() !== null ? 2 : -1);
|
|
40
|
+
i0.ɵɵadvance();
|
|
32
41
|
i0.ɵɵtextInterpolate1(" ", panel_r2.label, " ");
|
|
33
42
|
} }
|
|
34
43
|
function PrismPanelHostComponent_Conditional_5_ng_container_0_Template(rf, ctx) { if (rf & 1) {
|
|
@@ -48,6 +57,13 @@ export class PrismPanelHostComponent {
|
|
|
48
57
|
auditService = inject(A11yAuditService);
|
|
49
58
|
rendererService = inject(PrismRendererService);
|
|
50
59
|
a11yScore = computed(() => this.auditService.scoreResult()?.score ?? null, ...(ngDevMode ? [{ debugName: "a11yScore" }] : []));
|
|
60
|
+
coverageScore = computed(() => {
|
|
61
|
+
const comp = this.nav.activeComponent();
|
|
62
|
+
const coverage = comp?.meta?.showcaseConfig?.meta?.['coverage'];
|
|
63
|
+
if (!coverage?.found)
|
|
64
|
+
return null;
|
|
65
|
+
return coverage.score;
|
|
66
|
+
}, ...(ngDevMode ? [{ debugName: "coverageScore" }] : []));
|
|
51
67
|
builtInPanels = BUILTIN_PANELS;
|
|
52
68
|
allPanels = computed(() => [
|
|
53
69
|
...this.builtInPanels.filter((p) => p.placement !== 'view'),
|
|
@@ -116,7 +132,7 @@ export class PrismPanelHostComponent {
|
|
|
116
132
|
static ɵfac = function PrismPanelHostComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || PrismPanelHostComponent)(); };
|
|
117
133
|
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: PrismPanelHostComponent, selectors: [["prism-panel-host"]], decls: 6, vars: 1, consts: [[1, "prism-panel-host"], [1, "prism-panel-host__tabs"], [1, "prism-panel-host__tab", 3, "prism-panel-host__tab--active"], [1, "prism-panel-host__content"], [1, "prism-panel-host__tab", 3, "click"], [2, "width", "18px", "height", "18px", 3, "score", "compact"], [4, "ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector"]], template: function PrismPanelHostComponent_Template(rf, ctx) { if (rf & 1) {
|
|
118
134
|
i0.ɵɵelementStart(0, "div", 0)(1, "div", 1);
|
|
119
|
-
i0.ɵɵrepeaterCreate(2, PrismPanelHostComponent_For_3_Template,
|
|
135
|
+
i0.ɵɵrepeaterCreate(2, PrismPanelHostComponent_For_3_Template, 4, 5, "button", 2, _forTrack0);
|
|
120
136
|
i0.ɵɵelementEnd();
|
|
121
137
|
i0.ɵɵelementStart(4, "div", 3);
|
|
122
138
|
i0.ɵɵconditionalCreate(5, PrismPanelHostComponent_Conditional_5_Template, 1, 3, "ng-container");
|
|
@@ -142,6 +158,9 @@ export class PrismPanelHostComponent {
|
|
|
142
158
|
@if (panel.id === 'a11y' && a11yScore() !== null) {
|
|
143
159
|
<prism-a11y-score [score]="a11yScore()!" [compact]="true" style="width:18px;height:18px;" />
|
|
144
160
|
}
|
|
161
|
+
@if (panel.id === 'coverage' && coverageScore() !== null) {
|
|
162
|
+
<prism-a11y-score [score]="coverageScore()!" [compact]="true" style="width:18px;height:18px;" />
|
|
163
|
+
}
|
|
145
164
|
{{ panel.label }}
|
|
146
165
|
</button>
|
|
147
166
|
}
|
|
@@ -154,4 +173,4 @@ export class PrismPanelHostComponent {
|
|
|
154
173
|
</div>
|
|
155
174
|
`, styles: ["\n .prism-panel-host {\n display: flex;\n flex-direction: column;\n height: 100%;\n background: var(--prism-bg-elevated);\n }\n\n .prism-panel-host__tabs {\n display: flex;\n border-bottom: 1px solid var(--prism-border);\n padding: 0 8px;\n flex-shrink: 0;\n background: var(--prism-bg-elevated);\n }\n\n .prism-panel-host__tab {\n padding: 9px 14px;\n font-size: 13px;\n font-family: var(--prism-font-sans);\n border: none;\n background: none;\n color: var(--prism-text-muted);\n cursor: pointer;\n position: relative;\n margin-bottom: -1px;\n transition: color 0.12s;\n }\n\n .prism-panel-host__tab::after {\n content: '';\n position: absolute;\n bottom: 0;\n left: 8px;\n right: 8px;\n height: 2px;\n background: linear-gradient(90deg, var(--prism-primary-from), var(--prism-primary-to));\n opacity: 0;\n transition: opacity 0.12s;\n }\n\n .prism-panel-host__tab:hover { color: var(--prism-text-2); }\n\n .prism-panel-host__tab--active { color: var(--prism-primary); font-weight: 500; }\n\n .prism-panel-host__tab--active::after { opacity: 1; }\n\n .prism-panel-host__tab { display: flex; align-items: center; gap: 6px; }\n\n .prism-panel-host__content {\n flex: 1;\n overflow: auto;\n }\n "] }]
|
|
156
175
|
}], () => [], null); })();
|
|
157
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PrismPanelHostComponent, { className: "PrismPanelHostComponent", filePath: "app/panels/panel-host/prism-panel-host.component.ts", lineNumber:
|
|
176
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PrismPanelHostComponent, { className: "PrismPanelHostComponent", filePath: "app/panels/panel-host/prism-panel-host.component.ts", lineNumber: 97 }); })();
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
import type { NavigationItem } from '../services/navigation-item.types.js';
|
|
2
2
|
import { PrismNavigationService } from '../services/prism-navigation.service.js';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
|
+
interface SidebarCategory {
|
|
5
|
+
name: string;
|
|
6
|
+
items: NavigationItem[];
|
|
7
|
+
}
|
|
8
|
+
interface SidebarGroup {
|
|
9
|
+
name: string | null;
|
|
10
|
+
categories: SidebarCategory[];
|
|
11
|
+
}
|
|
4
12
|
export declare class PrismSidebarComponent {
|
|
5
13
|
protected readonly navigationService: PrismNavigationService;
|
|
6
14
|
private readonly expandedSet;
|
|
7
|
-
protected readonly
|
|
8
|
-
protected isExpanded(
|
|
9
|
-
protected
|
|
15
|
+
protected readonly groups: import("@angular/core").Signal<SidebarGroup[]>;
|
|
16
|
+
protected isExpanded(key: string, index: number): boolean;
|
|
17
|
+
protected toggle(key: string, index: number): void;
|
|
10
18
|
protected itemKey(item: NavigationItem): string;
|
|
11
19
|
protected itemLabel(item: NavigationItem): string;
|
|
12
20
|
protected isActive(item: NavigationItem): boolean;
|
|
@@ -16,4 +24,5 @@ export declare class PrismSidebarComponent {
|
|
|
16
24
|
static ɵfac: i0.ɵɵFactoryDeclaration<PrismSidebarComponent, never>;
|
|
17
25
|
static ɵcmp: i0.ɵɵComponentDeclaration<PrismSidebarComponent, "prism-sidebar", never, {}, {}, never, never, true, never>;
|
|
18
26
|
}
|
|
27
|
+
export {};
|
|
19
28
|
//# sourceMappingURL=prism-sidebar.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prism-sidebar.component.d.ts","sourceRoot":"","sources":["../../../src/app/sidebar/prism-sidebar.component.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"prism-sidebar.component.d.ts","sourceRoot":"","sources":["../../../src/app/sidebar/prism-sidebar.component.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;;AAIjF,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,cAAc,EAAE,CAAC;CACzB;AAED,UAAU,YAAY;IACpB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,UAAU,EAAE,eAAe,EAAE,CAAC;CAC/B;AAED,qBA2Na,qBAAqB;IAChC,SAAS,CAAC,QAAQ,CAAC,iBAAiB,yBAAkC;IAEtE,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA4C;IAExE,SAAS,CAAC,QAAQ,CAAC,MAAM,iDAgCtB;IAEH,SAAS,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO;IAOzD,SAAS,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAoBlD,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM;IAM/C,SAAS,CAAC,SAAS,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM;IAMjD,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO;IASjD,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI;IAQ9C,OAAO,CAAC,YAAY;IASpB,OAAO,CAAC,YAAY;yCAxGT,qBAAqB;2CAArB,qBAAqB;CA6GjC"}
|
|
@@ -1,88 +1,189 @@
|
|
|
1
1
|
import { Component, computed, inject, signal } from '@angular/core';
|
|
2
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
2
3
|
import { PrismNavigationService } from '../services/prism-navigation.service.js';
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
const _c0 = a0 => ({ cat: a0, nested: true });
|
|
6
|
+
const _c1 = a0 => ({ cat: a0, nested: false });
|
|
7
|
+
const _forTrack0 = ($index, $item) => $item.name ?? "__ungrouped";
|
|
8
|
+
const _forTrack1 = ($index, $item) => $item.name;
|
|
9
|
+
function _forTrack2($index, $item) { return this.itemKey($item); }
|
|
10
|
+
function PrismSidebarComponent_For_2_Conditional_0_Conditional_5_For_1_ng_container_0_Template(rf, ctx) { if (rf & 1) {
|
|
11
|
+
i0.ɵɵelementContainer(0);
|
|
12
|
+
} }
|
|
13
|
+
function PrismSidebarComponent_For_2_Conditional_0_Conditional_5_For_1_Template(rf, ctx) { if (rf & 1) {
|
|
14
|
+
i0.ɵɵtemplate(0, PrismSidebarComponent_For_2_Conditional_0_Conditional_5_For_1_ng_container_0_Template, 1, 0, "ng-container", 6);
|
|
15
|
+
} if (rf & 2) {
|
|
16
|
+
const cat_r6 = ctx.$implicit;
|
|
17
|
+
i0.ɵɵnextContext(4);
|
|
18
|
+
const categoryTpl_r7 = i0.ɵɵreference(4);
|
|
19
|
+
i0.ɵɵproperty("ngTemplateOutlet", categoryTpl_r7)("ngTemplateOutletContext", i0.ɵɵpureFunction1(2, _c0, cat_r6));
|
|
20
|
+
} }
|
|
21
|
+
function PrismSidebarComponent_For_2_Conditional_0_Conditional_5_Template(rf, ctx) { if (rf & 1) {
|
|
22
|
+
i0.ɵɵrepeaterCreate(0, PrismSidebarComponent_For_2_Conditional_0_Conditional_5_For_1_Template, 1, 4, "ng-container", null, _forTrack1);
|
|
23
|
+
} if (rf & 2) {
|
|
24
|
+
const group_r3 = i0.ɵɵnextContext(2).$implicit;
|
|
25
|
+
i0.ɵɵrepeater(group_r3.categories);
|
|
26
|
+
} }
|
|
27
|
+
function PrismSidebarComponent_For_2_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
28
|
+
const _r1 = i0.ɵɵgetCurrentView();
|
|
29
|
+
i0.ɵɵelementStart(0, "div", 2)(1, "button", 3);
|
|
30
|
+
i0.ɵɵlistener("click", function PrismSidebarComponent_For_2_Conditional_0_Template_button_click_1_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); const group_r3 = ctx_r1.$implicit; const ɵ$index_3_r4 = ctx_r1.$index; const ctx_r4 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r4.toggle("group:" + group_r3.name, ɵ$index_3_r4)); });
|
|
31
|
+
i0.ɵɵnamespaceSVG();
|
|
32
|
+
i0.ɵɵelementStart(2, "svg", 4);
|
|
33
|
+
i0.ɵɵelement(3, "path", 5);
|
|
34
|
+
i0.ɵɵelementEnd();
|
|
35
|
+
i0.ɵɵtext(4);
|
|
36
|
+
i0.ɵɵelementEnd();
|
|
37
|
+
i0.ɵɵconditionalCreate(5, PrismSidebarComponent_For_2_Conditional_0_Conditional_5_Template, 2, 0);
|
|
38
|
+
i0.ɵɵelementEnd();
|
|
39
|
+
} if (rf & 2) {
|
|
40
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
41
|
+
const group_r3 = ctx_r1.$implicit;
|
|
42
|
+
const ɵ$index_3_r4 = ctx_r1.$index;
|
|
43
|
+
const ctx_r4 = i0.ɵɵnextContext();
|
|
44
|
+
i0.ɵɵadvance(2);
|
|
45
|
+
i0.ɵɵclassProp("prism-sidebar__chevron--expanded", ctx_r4.isExpanded("group:" + group_r3.name, ɵ$index_3_r4));
|
|
46
|
+
i0.ɵɵadvance(2);
|
|
47
|
+
i0.ɵɵtextInterpolate1(" ", group_r3.name, " ");
|
|
48
|
+
i0.ɵɵadvance();
|
|
49
|
+
i0.ɵɵconditional(ctx_r4.isExpanded("group:" + group_r3.name, ɵ$index_3_r4) ? 5 : -1);
|
|
50
|
+
} }
|
|
51
|
+
function PrismSidebarComponent_For_2_Conditional_1_For_1_ng_container_0_Template(rf, ctx) { if (rf & 1) {
|
|
52
|
+
i0.ɵɵelementContainer(0);
|
|
53
|
+
} }
|
|
54
|
+
function PrismSidebarComponent_For_2_Conditional_1_For_1_Template(rf, ctx) { if (rf & 1) {
|
|
55
|
+
i0.ɵɵtemplate(0, PrismSidebarComponent_For_2_Conditional_1_For_1_ng_container_0_Template, 1, 0, "ng-container", 6);
|
|
56
|
+
} if (rf & 2) {
|
|
57
|
+
const cat_r8 = ctx.$implicit;
|
|
58
|
+
i0.ɵɵnextContext(3);
|
|
59
|
+
const categoryTpl_r7 = i0.ɵɵreference(4);
|
|
60
|
+
i0.ɵɵproperty("ngTemplateOutlet", categoryTpl_r7)("ngTemplateOutletContext", i0.ɵɵpureFunction1(2, _c1, cat_r8));
|
|
61
|
+
} }
|
|
62
|
+
function PrismSidebarComponent_For_2_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
63
|
+
i0.ɵɵrepeaterCreate(0, PrismSidebarComponent_For_2_Conditional_1_For_1_Template, 1, 4, "ng-container", null, _forTrack1);
|
|
64
|
+
} if (rf & 2) {
|
|
65
|
+
const group_r3 = i0.ɵɵnextContext().$implicit;
|
|
66
|
+
i0.ɵɵrepeater(group_r3.categories);
|
|
67
|
+
} }
|
|
68
|
+
function PrismSidebarComponent_For_2_Template(rf, ctx) { if (rf & 1) {
|
|
69
|
+
i0.ɵɵconditionalCreate(0, PrismSidebarComponent_For_2_Conditional_0_Template, 6, 4, "div", 2)(1, PrismSidebarComponent_For_2_Conditional_1_Template, 2, 0);
|
|
70
|
+
} if (rf & 2) {
|
|
71
|
+
const group_r3 = ctx.$implicit;
|
|
72
|
+
i0.ɵɵconditional(group_r3.name ? 0 : 1);
|
|
73
|
+
} }
|
|
74
|
+
function PrismSidebarComponent_ng_template_3_Conditional_5_For_1_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
75
|
+
i0.ɵɵelementStart(0, "span", 11);
|
|
8
76
|
i0.ɵɵtext(1, "\u25C8");
|
|
9
|
-
i0.ɵɵ
|
|
77
|
+
i0.ɵɵelementEnd();
|
|
10
78
|
} }
|
|
11
|
-
function
|
|
12
|
-
const
|
|
13
|
-
i0.ɵɵ
|
|
14
|
-
i0.ɵɵ
|
|
15
|
-
i0.ɵɵconditionalCreate(1,
|
|
79
|
+
function PrismSidebarComponent_ng_template_3_Conditional_5_For_1_Template(rf, ctx) { if (rf & 1) {
|
|
80
|
+
const _r11 = i0.ɵɵgetCurrentView();
|
|
81
|
+
i0.ɵɵelementStart(0, "button", 10);
|
|
82
|
+
i0.ɵɵlistener("click", function PrismSidebarComponent_ng_template_3_Conditional_5_For_1_Template_button_click_0_listener() { const item_r12 = i0.ɵɵrestoreView(_r11).$implicit; const ctx_r4 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r4.onSelect(item_r12)); });
|
|
83
|
+
i0.ɵɵconditionalCreate(1, PrismSidebarComponent_ng_template_3_Conditional_5_For_1_Conditional_1_Template, 2, 0, "span", 11);
|
|
16
84
|
i0.ɵɵtext(2);
|
|
17
|
-
i0.ɵɵ
|
|
85
|
+
i0.ɵɵelementEnd();
|
|
18
86
|
} if (rf & 2) {
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
|
|
87
|
+
const item_r12 = ctx.$implicit;
|
|
88
|
+
const nested_r13 = i0.ɵɵnextContext(2).nested;
|
|
89
|
+
const ctx_r4 = i0.ɵɵnextContext();
|
|
90
|
+
i0.ɵɵclassProp("prism-sidebar__item--active", ctx_r4.isActive(item_r12))("prism-sidebar__item--nested", nested_r13)("prism-sidebar__item--page", item_r12.kind === "page");
|
|
22
91
|
i0.ɵɵadvance();
|
|
23
|
-
i0.ɵɵconditional(
|
|
92
|
+
i0.ɵɵconditional(item_r12.kind === "page" ? 1 : -1);
|
|
24
93
|
i0.ɵɵadvance();
|
|
25
|
-
i0.ɵɵtextInterpolate1(" ", ctx_r4.itemLabel(
|
|
94
|
+
i0.ɵɵtextInterpolate1(" ", ctx_r4.itemLabel(item_r12), " ");
|
|
26
95
|
} }
|
|
27
|
-
function
|
|
28
|
-
i0.ɵɵrepeaterCreate(0,
|
|
96
|
+
function PrismSidebarComponent_ng_template_3_Conditional_5_Template(rf, ctx) { if (rf & 1) {
|
|
97
|
+
i0.ɵɵrepeaterCreate(0, PrismSidebarComponent_ng_template_3_Conditional_5_For_1_Template, 3, 8, "button", 9, _forTrack2, true);
|
|
29
98
|
} if (rf & 2) {
|
|
30
|
-
const
|
|
31
|
-
i0.ɵɵrepeater(
|
|
99
|
+
const cat_r10 = i0.ɵɵnextContext().cat;
|
|
100
|
+
i0.ɵɵrepeater(cat_r10.items);
|
|
32
101
|
} }
|
|
33
|
-
function
|
|
34
|
-
const
|
|
35
|
-
i0.ɵɵ
|
|
36
|
-
i0.ɵɵ
|
|
102
|
+
function PrismSidebarComponent_ng_template_3_Template(rf, ctx) { if (rf & 1) {
|
|
103
|
+
const _r9 = i0.ɵɵgetCurrentView();
|
|
104
|
+
i0.ɵɵelementStart(0, "div", 7)(1, "button", 8);
|
|
105
|
+
i0.ɵɵlistener("click", function PrismSidebarComponent_ng_template_3_Template_button_click_1_listener() { const cat_r10 = i0.ɵɵrestoreView(_r9).cat; const ctx_r4 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r4.toggle("cat:" + cat_r10.name, 0)); });
|
|
37
106
|
i0.ɵɵnamespaceSVG();
|
|
38
|
-
i0.ɵɵ
|
|
39
|
-
i0.ɵɵ
|
|
40
|
-
i0.ɵɵ
|
|
107
|
+
i0.ɵɵelementStart(2, "svg", 4);
|
|
108
|
+
i0.ɵɵelement(3, "path", 5);
|
|
109
|
+
i0.ɵɵelementEnd();
|
|
41
110
|
i0.ɵɵtext(4);
|
|
42
|
-
i0.ɵɵ
|
|
43
|
-
i0.ɵɵconditionalCreate(5,
|
|
44
|
-
i0.ɵɵ
|
|
111
|
+
i0.ɵɵelementEnd();
|
|
112
|
+
i0.ɵɵconditionalCreate(5, PrismSidebarComponent_ng_template_3_Conditional_5_Template, 2, 0);
|
|
113
|
+
i0.ɵɵelementEnd();
|
|
45
114
|
} if (rf & 2) {
|
|
46
|
-
const
|
|
47
|
-
const
|
|
115
|
+
const cat_r10 = ctx.cat;
|
|
116
|
+
const nested_r13 = ctx.nested;
|
|
48
117
|
const ctx_r4 = i0.ɵɵnextContext();
|
|
118
|
+
i0.ɵɵclassProp("prism-sidebar__category--nested", nested_r13);
|
|
119
|
+
i0.ɵɵadvance();
|
|
120
|
+
i0.ɵɵclassProp("prism-sidebar__category-title--nested", nested_r13);
|
|
121
|
+
i0.ɵɵadvance();
|
|
122
|
+
i0.ɵɵclassProp("prism-sidebar__chevron--expanded", ctx_r4.isExpanded("cat:" + cat_r10.name, 0));
|
|
49
123
|
i0.ɵɵadvance(2);
|
|
50
|
-
i0.ɵɵ
|
|
51
|
-
i0.ɵɵadvance(2);
|
|
52
|
-
i0.ɵɵtextInterpolate1(" ", entry_r3[0], " ");
|
|
124
|
+
i0.ɵɵtextInterpolate1(" ", cat_r10.name, " ");
|
|
53
125
|
i0.ɵɵadvance();
|
|
54
|
-
i0.ɵɵconditional(ctx_r4.isExpanded(
|
|
126
|
+
i0.ɵɵconditional(ctx_r4.isExpanded("cat:" + cat_r10.name, 0) ? 5 : -1);
|
|
55
127
|
} }
|
|
56
128
|
const STORAGE_KEY = 'ng-prism-sidebar-expanded';
|
|
57
129
|
export class PrismSidebarComponent {
|
|
58
130
|
navigationService = inject(PrismNavigationService);
|
|
59
131
|
expandedSet = signal(this.loadExpanded(), ...(ngDevMode ? [{ debugName: "expandedSet" }] : []));
|
|
60
|
-
|
|
61
|
-
|
|
132
|
+
groups = computed(() => {
|
|
133
|
+
const tree = this.navigationService.categoryTree();
|
|
134
|
+
const groupMap = new Map();
|
|
135
|
+
for (const [fullCategory, items] of tree.entries()) {
|
|
136
|
+
const sepIdx = fullCategory.indexOf(' / ');
|
|
137
|
+
let groupName;
|
|
138
|
+
let catName;
|
|
139
|
+
if (sepIdx !== -1) {
|
|
140
|
+
groupName = fullCategory.substring(0, sepIdx).trim();
|
|
141
|
+
catName = fullCategory.substring(sepIdx + 3).trim();
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
groupName = null;
|
|
145
|
+
catName = fullCategory;
|
|
146
|
+
}
|
|
147
|
+
const cats = groupMap.get(groupName) ?? [];
|
|
148
|
+
cats.push({ name: catName, items });
|
|
149
|
+
groupMap.set(groupName, cats);
|
|
150
|
+
}
|
|
151
|
+
const result = [];
|
|
152
|
+
const ungrouped = groupMap.get(null);
|
|
153
|
+
if (ungrouped) {
|
|
154
|
+
result.push({ name: null, categories: ungrouped });
|
|
155
|
+
groupMap.delete(null);
|
|
156
|
+
}
|
|
157
|
+
for (const [name, categories] of groupMap.entries()) {
|
|
158
|
+
result.push({ name, categories });
|
|
159
|
+
}
|
|
160
|
+
return result;
|
|
161
|
+
}, ...(ngDevMode ? [{ debugName: "groups" }] : []));
|
|
162
|
+
isExpanded(key, index) {
|
|
62
163
|
const set = this.expandedSet();
|
|
63
|
-
if (set.has(
|
|
164
|
+
if (set.has(key))
|
|
64
165
|
return true;
|
|
65
|
-
if (set.has(`__collapsed:${
|
|
166
|
+
if (set.has(`__collapsed:${key}`))
|
|
66
167
|
return false;
|
|
67
168
|
return index === 0;
|
|
68
169
|
}
|
|
69
|
-
|
|
170
|
+
toggle(key, index) {
|
|
70
171
|
this.expandedSet.update(prev => {
|
|
71
172
|
const next = new Set(prev);
|
|
72
|
-
const collapsedKey = `__collapsed:${
|
|
73
|
-
if (next.has(
|
|
74
|
-
next.delete(
|
|
173
|
+
const collapsedKey = `__collapsed:${key}`;
|
|
174
|
+
if (next.has(key)) {
|
|
175
|
+
next.delete(key);
|
|
75
176
|
next.add(collapsedKey);
|
|
76
177
|
}
|
|
77
178
|
else if (next.has(collapsedKey)) {
|
|
78
179
|
next.delete(collapsedKey);
|
|
79
|
-
next.add(
|
|
180
|
+
next.add(key);
|
|
80
181
|
}
|
|
81
182
|
else if (index === 0) {
|
|
82
183
|
next.add(collapsedKey);
|
|
83
184
|
}
|
|
84
185
|
else {
|
|
85
|
-
next.add(
|
|
186
|
+
next.add(key);
|
|
86
187
|
}
|
|
87
188
|
this.saveExpanded(next);
|
|
88
189
|
return next;
|
|
@@ -131,40 +232,71 @@ export class PrismSidebarComponent {
|
|
|
131
232
|
catch { /* ignore */ }
|
|
132
233
|
}
|
|
133
234
|
static ɵfac = function PrismSidebarComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || PrismSidebarComponent)(); };
|
|
134
|
-
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: PrismSidebarComponent, selectors: [["prism-sidebar"]], decls:
|
|
135
|
-
i0.ɵɵ
|
|
136
|
-
i0.ɵɵrepeaterCreate(1, PrismSidebarComponent_For_2_Template,
|
|
137
|
-
i0.ɵɵ
|
|
235
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: PrismSidebarComponent, selectors: [["prism-sidebar"]], decls: 5, vars: 0, consts: [["categoryTpl", ""], [1, "prism-sidebar"], [1, "prism-sidebar__group"], [1, "prism-sidebar__group-title", 3, "click"], ["viewBox", "0 0 16 16", 1, "prism-sidebar__chevron"], ["d", "M6 4l4 4-4 4"], [4, "ngTemplateOutlet", "ngTemplateOutletContext"], [1, "prism-sidebar__category"], [1, "prism-sidebar__category-title", 3, "click"], [1, "prism-sidebar__item", 3, "prism-sidebar__item--active", "prism-sidebar__item--nested", "prism-sidebar__item--page"], [1, "prism-sidebar__item", 3, "click"], [1, "prism-sidebar__page-icon"]], template: function PrismSidebarComponent_Template(rf, ctx) { if (rf & 1) {
|
|
236
|
+
i0.ɵɵelementStart(0, "nav", 1);
|
|
237
|
+
i0.ɵɵrepeaterCreate(1, PrismSidebarComponent_For_2_Template, 2, 1, null, null, _forTrack0);
|
|
238
|
+
i0.ɵɵtemplate(3, PrismSidebarComponent_ng_template_3_Template, 6, 8, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor);
|
|
239
|
+
i0.ɵɵelementEnd();
|
|
138
240
|
} if (rf & 2) {
|
|
139
241
|
i0.ɵɵadvance();
|
|
140
|
-
i0.ɵɵrepeater(ctx.
|
|
141
|
-
} }, styles: [".prism-sidebar[_ngcontent-%COMP%] {\n background: var(--prism-sidebar-bg, var(--prism-bg));\n border-right: 1px solid var(--prism-border);\n overflow-y: auto;\n overflow-x: hidden;\n padding: 4px 0;\n height: 100%;\n }\n .prism-sidebar[_ngcontent-%COMP%]::-webkit-scrollbar { width: 4px; }\n .prism-sidebar[_ngcontent-%COMP%]::-webkit-scrollbar-track { background: transparent; }\n .prism-sidebar[_ngcontent-%COMP%]::-webkit-scrollbar-thumb { background: var(--prism-border-strong); border-radius: 2px; }\n\n .prism-sidebar__category[_ngcontent-%COMP%] { margin-bottom: 2px; }\n\n .prism-sidebar__category-title[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 6px;\n width: 100%;\n margin: 0;\n padding: 7px 16px;\n font-size: 11px;\n font-weight: 600;\n text-transform: uppercase;\n letter-spacing: 0.08em;\n color: var(--prism-text-2);\n font-family: var(--prism-font-sans);\n background: color-mix(in srgb, var(--prism-primary) 8%, transparent);\n border: none;\n border-left: 2px solid color-mix(in srgb, var(--prism-primary) 40%, transparent);\n cursor: pointer;\n text-align: left;\n transition: background 0.12s, color 0.12s, border-color 0.12s;\n }\n\n .prism-sidebar__category-title[_ngcontent-%COMP%]:hover {\n background: color-mix(in srgb, var(--prism-primary) 14%, transparent);\n color: var(--prism-text);\n border-left-color: var(--prism-primary);\n }\n\n .prism-sidebar__chevron[_ngcontent-%COMP%] {\n width: 10px;\n height: 10px;\n flex-shrink: 0;\n transition: transform 0.15s;\n fill: none;\n stroke: currentColor;\n stroke-width: 1.5;\n stroke-linecap: round;\n stroke-linejoin: round;\n opacity: 0.5;\n }\n\n .prism-sidebar__category-title[_ngcontent-%COMP%]:hover .prism-sidebar__chevron[_ngcontent-%COMP%] {\n opacity: 0.8;\n }\n\n .prism-sidebar__chevron--expanded[_ngcontent-%COMP%] {\n transform: rotate(90deg);\n }\n\n .prism-sidebar__item[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 6px;\n width: 100%;\n padding: 6px 14px 6px 24px;\n font-size: 13px;\n font-family: var(--prism-font-sans);\n border: none;\n background: none;\n color: var(--prism-text-muted);\n cursor: pointer;\n border-left: 2px solid transparent;\n text-align: left;\n transition: background 0.1s, color 0.1s, border-color 0.1s;\n }\n\n .prism-sidebar__item[_ngcontent-%COMP%]:hover {\n background: color-mix(in srgb, var(--prism-primary) 6%, transparent);\n color: var(--prism-text-2);\n }\n\n .prism-sidebar__item--active[_ngcontent-%COMP%] {\n border-left-color: var(--prism-primary);\n background: color-mix(in srgb, var(--prism-primary) 10%, transparent);\n color: var(--prism-text);\n font-weight: 500;\n }\n\n .prism-sidebar__item--active[_ngcontent-%COMP%]:hover {\n background: color-mix(in srgb, var(--prism-primary) 12%, transparent);\n }\n\n .prism-sidebar__page-icon[_ngcontent-%COMP%] {\n font-size: 10px;\n opacity: 0.6;\n }"] });
|
|
242
|
+
i0.ɵɵrepeater(ctx.groups());
|
|
243
|
+
} }, dependencies: [NgTemplateOutlet], styles: [".prism-sidebar[_ngcontent-%COMP%] {\n background: var(--prism-sidebar-bg, var(--prism-bg));\n border-right: 1px solid var(--prism-border);\n overflow-y: auto;\n overflow-x: hidden;\n padding: 4px 0;\n height: 100%;\n }\n .prism-sidebar[_ngcontent-%COMP%]::-webkit-scrollbar { width: 4px; }\n .prism-sidebar[_ngcontent-%COMP%]::-webkit-scrollbar-track { background: transparent; }\n .prism-sidebar[_ngcontent-%COMP%]::-webkit-scrollbar-thumb { background: var(--prism-border-strong); border-radius: 2px; }\n\n .prism-sidebar__group[_ngcontent-%COMP%] { margin-bottom: 2px; }\n\n .prism-sidebar__group-title[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 6px;\n width: 100%;\n margin: 0;\n padding: 8px 16px;\n font-size: 11px;\n font-weight: 700;\n text-transform: uppercase;\n letter-spacing: 0.08em;\n color: var(--prism-text-2);\n font-family: var(--prism-font-sans);\n background: color-mix(in srgb, var(--prism-primary) 10%, transparent);\n border: none;\n border-left: 2px solid color-mix(in srgb, var(--prism-primary) 50%, transparent);\n cursor: pointer;\n text-align: left;\n transition: background 0.12s, color 0.12s, border-color 0.12s;\n }\n\n .prism-sidebar__group-title[_ngcontent-%COMP%]:hover {\n background: color-mix(in srgb, var(--prism-primary) 16%, transparent);\n color: var(--prism-text);\n border-left-color: var(--prism-primary);\n }\n\n .prism-sidebar__category[_ngcontent-%COMP%] { margin-bottom: 2px; }\n\n .prism-sidebar__category-title[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 6px;\n width: 100%;\n margin: 0;\n padding: 7px 16px;\n font-size: 11px;\n font-weight: 600;\n text-transform: uppercase;\n letter-spacing: 0.08em;\n color: var(--prism-text-2);\n font-family: var(--prism-font-sans);\n background: color-mix(in srgb, var(--prism-primary) 8%, transparent);\n border: none;\n border-left: 2px solid color-mix(in srgb, var(--prism-primary) 40%, transparent);\n cursor: pointer;\n text-align: left;\n transition: background 0.12s, color 0.12s, border-color 0.12s;\n }\n\n .prism-sidebar__category-title[_ngcontent-%COMP%]:hover {\n background: color-mix(in srgb, var(--prism-primary) 14%, transparent);\n color: var(--prism-text);\n border-left-color: var(--prism-primary);\n }\n\n .prism-sidebar__category-title--nested[_ngcontent-%COMP%] {\n padding-left: 28px;\n font-weight: 500;\n font-size: 11px;\n background: color-mix(in srgb, var(--prism-primary) 4%, transparent);\n border-left-color: color-mix(in srgb, var(--prism-primary) 25%, transparent);\n }\n\n .prism-sidebar__category-title--nested[_ngcontent-%COMP%]:hover {\n background: color-mix(in srgb, var(--prism-primary) 10%, transparent);\n }\n\n .prism-sidebar__chevron[_ngcontent-%COMP%] {\n width: 10px;\n height: 10px;\n flex-shrink: 0;\n transition: transform 0.15s;\n fill: none;\n stroke: currentColor;\n stroke-width: 1.5;\n stroke-linecap: round;\n stroke-linejoin: round;\n opacity: 0.5;\n }\n\n .prism-sidebar__group-title[_ngcontent-%COMP%]:hover .prism-sidebar__chevron[_ngcontent-%COMP%], \n .prism-sidebar__category-title[_ngcontent-%COMP%]:hover .prism-sidebar__chevron[_ngcontent-%COMP%] {\n opacity: 0.8;\n }\n\n .prism-sidebar__chevron--expanded[_ngcontent-%COMP%] {\n transform: rotate(90deg);\n }\n\n .prism-sidebar__item[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 6px;\n width: 100%;\n padding: 6px 14px 6px 24px;\n font-size: 13px;\n font-family: var(--prism-font-sans);\n border: none;\n background: none;\n color: var(--prism-text-muted);\n cursor: pointer;\n border-left: 2px solid transparent;\n text-align: left;\n transition: background 0.1s, color 0.1s, border-color 0.1s;\n }\n\n .prism-sidebar__item--nested[_ngcontent-%COMP%] {\n padding-left: 36px;\n }\n\n .prism-sidebar__item[_ngcontent-%COMP%]:hover {\n background: color-mix(in srgb, var(--prism-primary) 6%, transparent);\n color: var(--prism-text-2);\n }\n\n .prism-sidebar__item--active[_ngcontent-%COMP%] {\n border-left-color: var(--prism-primary);\n background: color-mix(in srgb, var(--prism-primary) 10%, transparent);\n color: var(--prism-text);\n font-weight: 500;\n }\n\n .prism-sidebar__item--active[_ngcontent-%COMP%]:hover {\n background: color-mix(in srgb, var(--prism-primary) 12%, transparent);\n }\n\n .prism-sidebar__page-icon[_ngcontent-%COMP%] {\n font-size: 10px;\n opacity: 0.6;\n }"] });
|
|
142
244
|
}
|
|
143
245
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PrismSidebarComponent, [{
|
|
144
246
|
type: Component,
|
|
145
|
-
args: [{ selector: 'prism-sidebar', standalone: true, template: `
|
|
247
|
+
args: [{ selector: 'prism-sidebar', standalone: true, imports: [NgTemplateOutlet], template: `
|
|
146
248
|
<nav class="prism-sidebar">
|
|
147
|
-
@for (
|
|
148
|
-
|
|
249
|
+
@for (group of groups(); track group.name ?? '__ungrouped'; let gi = $index) {
|
|
250
|
+
@if (group.name) {
|
|
251
|
+
<div class="prism-sidebar__group">
|
|
252
|
+
<button
|
|
253
|
+
class="prism-sidebar__group-title"
|
|
254
|
+
(click)="toggle('group:' + group.name, gi)"
|
|
255
|
+
>
|
|
256
|
+
<svg
|
|
257
|
+
class="prism-sidebar__chevron"
|
|
258
|
+
[class.prism-sidebar__chevron--expanded]="isExpanded('group:' + group.name, gi)"
|
|
259
|
+
viewBox="0 0 16 16"
|
|
260
|
+
>
|
|
261
|
+
<path d="M6 4l4 4-4 4"/>
|
|
262
|
+
</svg>
|
|
263
|
+
{{ group.name }}
|
|
264
|
+
</button>
|
|
265
|
+
@if (isExpanded('group:' + group.name, gi)) {
|
|
266
|
+
@for (cat of group.categories; track cat.name) {
|
|
267
|
+
<ng-container *ngTemplateOutlet="categoryTpl; context: { cat, nested: true }" />
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
</div>
|
|
271
|
+
} @else {
|
|
272
|
+
@for (cat of group.categories; track cat.name) {
|
|
273
|
+
<ng-container *ngTemplateOutlet="categoryTpl; context: { cat, nested: false }" />
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
<ng-template #categoryTpl let-cat="cat" let-nested="nested">
|
|
279
|
+
<div class="prism-sidebar__category" [class.prism-sidebar__category--nested]="nested">
|
|
149
280
|
<button
|
|
150
281
|
class="prism-sidebar__category-title"
|
|
151
|
-
|
|
282
|
+
[class.prism-sidebar__category-title--nested]="nested"
|
|
283
|
+
(click)="toggle('cat:' + cat.name, 0)"
|
|
152
284
|
>
|
|
153
285
|
<svg
|
|
154
286
|
class="prism-sidebar__chevron"
|
|
155
|
-
[class.prism-sidebar__chevron--expanded]="isExpanded(
|
|
287
|
+
[class.prism-sidebar__chevron--expanded]="isExpanded('cat:' + cat.name, 0)"
|
|
156
288
|
viewBox="0 0 16 16"
|
|
157
|
-
fill="currentColor"
|
|
158
289
|
>
|
|
159
290
|
<path d="M6 4l4 4-4 4"/>
|
|
160
291
|
</svg>
|
|
161
|
-
{{
|
|
292
|
+
{{ cat.name }}
|
|
162
293
|
</button>
|
|
163
|
-
@if (isExpanded(
|
|
164
|
-
@for (item of
|
|
294
|
+
@if (isExpanded('cat:' + cat.name, 0)) {
|
|
295
|
+
@for (item of cat.items; track itemKey(item)) {
|
|
165
296
|
<button
|
|
166
297
|
class="prism-sidebar__item"
|
|
167
298
|
[class.prism-sidebar__item--active]="isActive(item)"
|
|
299
|
+
[class.prism-sidebar__item--nested]="nested"
|
|
168
300
|
[class.prism-sidebar__item--page]="item.kind === 'page'"
|
|
169
301
|
(click)="onSelect(item)"
|
|
170
302
|
>
|
|
@@ -176,8 +308,8 @@ export class PrismSidebarComponent {
|
|
|
176
308
|
}
|
|
177
309
|
}
|
|
178
310
|
</div>
|
|
179
|
-
|
|
311
|
+
</ng-template>
|
|
180
312
|
</nav>
|
|
181
|
-
`, styles: ["\n .prism-sidebar {\n background: var(--prism-sidebar-bg, var(--prism-bg));\n border-right: 1px solid var(--prism-border);\n overflow-y: auto;\n overflow-x: hidden;\n padding: 4px 0;\n height: 100%;\n }\n .prism-sidebar::-webkit-scrollbar { width: 4px; }\n .prism-sidebar::-webkit-scrollbar-track { background: transparent; }\n .prism-sidebar::-webkit-scrollbar-thumb { background: var(--prism-border-strong); border-radius: 2px; }\n\n .prism-sidebar__category { margin-bottom: 2px; }\n\n .prism-sidebar__category-title {\n display: flex;\n align-items: center;\n gap: 6px;\n width: 100%;\n margin: 0;\n padding: 7px 16px;\n font-size: 11px;\n font-weight: 600;\n text-transform: uppercase;\n letter-spacing: 0.08em;\n color: var(--prism-text-2);\n font-family: var(--prism-font-sans);\n background: color-mix(in srgb, var(--prism-primary) 8%, transparent);\n border: none;\n border-left: 2px solid color-mix(in srgb, var(--prism-primary) 40%, transparent);\n cursor: pointer;\n text-align: left;\n transition: background 0.12s, color 0.12s, border-color 0.12s;\n }\n\n .prism-sidebar__category-title:hover {\n background: color-mix(in srgb, var(--prism-primary) 14%, transparent);\n color: var(--prism-text);\n border-left-color: var(--prism-primary);\n }\n\n .prism-sidebar__chevron {\n width: 10px;\n height: 10px;\n flex-shrink: 0;\n transition: transform 0.15s;\n fill: none;\n stroke: currentColor;\n stroke-width: 1.5;\n stroke-linecap: round;\n stroke-linejoin: round;\n opacity: 0.5;\n }\n\n .prism-sidebar__category-title:hover .prism-sidebar__chevron {\n opacity: 0.8;\n }\n\n .prism-sidebar__chevron--expanded {\n transform: rotate(90deg);\n }\n\n .prism-sidebar__item {\n display: flex;\n align-items: center;\n gap: 6px;\n width: 100%;\n padding: 6px 14px 6px 24px;\n font-size: 13px;\n font-family: var(--prism-font-sans);\n border: none;\n background: none;\n color: var(--prism-text-muted);\n cursor: pointer;\n border-left: 2px solid transparent;\n text-align: left;\n transition: background 0.1s, color 0.1s, border-color 0.1s;\n }\n\n .prism-sidebar__item:hover {\n background: color-mix(in srgb, var(--prism-primary) 6%, transparent);\n color: var(--prism-text-2);\n }\n\n .prism-sidebar__item--active {\n border-left-color: var(--prism-primary);\n background: color-mix(in srgb, var(--prism-primary) 10%, transparent);\n color: var(--prism-text);\n font-weight: 500;\n }\n\n .prism-sidebar__item--active:hover {\n background: color-mix(in srgb, var(--prism-primary) 12%, transparent);\n }\n\n .prism-sidebar__page-icon {\n font-size: 10px;\n opacity: 0.6;\n }\n "] }]
|
|
313
|
+
`, styles: ["\n .prism-sidebar {\n background: var(--prism-sidebar-bg, var(--prism-bg));\n border-right: 1px solid var(--prism-border);\n overflow-y: auto;\n overflow-x: hidden;\n padding: 4px 0;\n height: 100%;\n }\n .prism-sidebar::-webkit-scrollbar { width: 4px; }\n .prism-sidebar::-webkit-scrollbar-track { background: transparent; }\n .prism-sidebar::-webkit-scrollbar-thumb { background: var(--prism-border-strong); border-radius: 2px; }\n\n .prism-sidebar__group { margin-bottom: 2px; }\n\n .prism-sidebar__group-title {\n display: flex;\n align-items: center;\n gap: 6px;\n width: 100%;\n margin: 0;\n padding: 8px 16px;\n font-size: 11px;\n font-weight: 700;\n text-transform: uppercase;\n letter-spacing: 0.08em;\n color: var(--prism-text-2);\n font-family: var(--prism-font-sans);\n background: color-mix(in srgb, var(--prism-primary) 10%, transparent);\n border: none;\n border-left: 2px solid color-mix(in srgb, var(--prism-primary) 50%, transparent);\n cursor: pointer;\n text-align: left;\n transition: background 0.12s, color 0.12s, border-color 0.12s;\n }\n\n .prism-sidebar__group-title:hover {\n background: color-mix(in srgb, var(--prism-primary) 16%, transparent);\n color: var(--prism-text);\n border-left-color: var(--prism-primary);\n }\n\n .prism-sidebar__category { margin-bottom: 2px; }\n\n .prism-sidebar__category-title {\n display: flex;\n align-items: center;\n gap: 6px;\n width: 100%;\n margin: 0;\n padding: 7px 16px;\n font-size: 11px;\n font-weight: 600;\n text-transform: uppercase;\n letter-spacing: 0.08em;\n color: var(--prism-text-2);\n font-family: var(--prism-font-sans);\n background: color-mix(in srgb, var(--prism-primary) 8%, transparent);\n border: none;\n border-left: 2px solid color-mix(in srgb, var(--prism-primary) 40%, transparent);\n cursor: pointer;\n text-align: left;\n transition: background 0.12s, color 0.12s, border-color 0.12s;\n }\n\n .prism-sidebar__category-title:hover {\n background: color-mix(in srgb, var(--prism-primary) 14%, transparent);\n color: var(--prism-text);\n border-left-color: var(--prism-primary);\n }\n\n .prism-sidebar__category-title--nested {\n padding-left: 28px;\n font-weight: 500;\n font-size: 11px;\n background: color-mix(in srgb, var(--prism-primary) 4%, transparent);\n border-left-color: color-mix(in srgb, var(--prism-primary) 25%, transparent);\n }\n\n .prism-sidebar__category-title--nested:hover {\n background: color-mix(in srgb, var(--prism-primary) 10%, transparent);\n }\n\n .prism-sidebar__chevron {\n width: 10px;\n height: 10px;\n flex-shrink: 0;\n transition: transform 0.15s;\n fill: none;\n stroke: currentColor;\n stroke-width: 1.5;\n stroke-linecap: round;\n stroke-linejoin: round;\n opacity: 0.5;\n }\n\n .prism-sidebar__group-title:hover .prism-sidebar__chevron,\n .prism-sidebar__category-title:hover .prism-sidebar__chevron {\n opacity: 0.8;\n }\n\n .prism-sidebar__chevron--expanded {\n transform: rotate(90deg);\n }\n\n .prism-sidebar__item {\n display: flex;\n align-items: center;\n gap: 6px;\n width: 100%;\n padding: 6px 14px 6px 24px;\n font-size: 13px;\n font-family: var(--prism-font-sans);\n border: none;\n background: none;\n color: var(--prism-text-muted);\n cursor: pointer;\n border-left: 2px solid transparent;\n text-align: left;\n transition: background 0.1s, color 0.1s, border-color 0.1s;\n }\n\n .prism-sidebar__item--nested {\n padding-left: 36px;\n }\n\n .prism-sidebar__item:hover {\n background: color-mix(in srgb, var(--prism-primary) 6%, transparent);\n color: var(--prism-text-2);\n }\n\n .prism-sidebar__item--active {\n border-left-color: var(--prism-primary);\n background: color-mix(in srgb, var(--prism-primary) 10%, transparent);\n color: var(--prism-text);\n font-weight: 500;\n }\n\n .prism-sidebar__item--active:hover {\n background: color-mix(in srgb, var(--prism-primary) 12%, transparent);\n }\n\n .prism-sidebar__page-icon {\n font-size: 10px;\n opacity: 0.6;\n }\n "] }]
|
|
182
314
|
}], null, null); })();
|
|
183
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PrismSidebarComponent, { className: "PrismSidebarComponent", filePath: "app/sidebar/prism-sidebar.component.ts", lineNumber:
|
|
315
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PrismSidebarComponent, { className: "PrismSidebarComponent", filePath: "app/sidebar/prism-sidebar.component.ts", lineNumber: 237 }); })();
|