@ng-prism/core 21.4.4 → 21.5.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 +1 -1
- 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/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/dist/schematics/ng-add/index.d.ts.map +1 -1
- package/dist/schematics/ng-add/index.js +2 -1
- package/package.json +6 -6
|
@@ -1,191 +1,250 @@
|
|
|
1
|
-
import { Component, computed, inject, signal } from '@angular/core';
|
|
2
|
-
import {
|
|
1
|
+
import { Component, computed, inject, signal, ChangeDetectionStrategy, } from '@angular/core';
|
|
2
|
+
import { PrismIconComponent } from '../icons/prism-icon.component.js';
|
|
3
3
|
import { PrismNavigationService } from '../services/prism-navigation.service.js';
|
|
4
|
+
import { PrismSearchService } from '../services/prism-search.service.js';
|
|
5
|
+
import { PrismManifestService } from '../services/prism-manifest.service.js';
|
|
4
6
|
import * as i0 from "@angular/core";
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
function
|
|
11
|
-
i0.ɵɵ
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
i0.ɵɵtemplate(0, PrismSidebarComponent_For_2_Conditional_0_Conditional_5_For_1_ng_container_0_Template, 1, 0, "ng-container", 6);
|
|
7
|
+
const _forTrack0 = ($index, $item) => $item.name;
|
|
8
|
+
function _forTrack1($index, $item) { return this.itemKey($item); }
|
|
9
|
+
function PrismSidebarComponent_Conditional_7_For_8_Conditional_5_For_2_Template(rf, ctx) { if (rf & 1) {
|
|
10
|
+
const _r4 = i0.ɵɵgetCurrentView();
|
|
11
|
+
i0.ɵɵelementStart(0, "button", 17);
|
|
12
|
+
i0.ɵɵlistener("click", function PrismSidebarComponent_Conditional_7_For_8_Conditional_5_For_2_Template_button_click_0_listener() { const item_r5 = i0.ɵɵrestoreView(_r4).$implicit; const ctx_r2 = i0.ɵɵnextContext(4); return i0.ɵɵresetView(ctx_r2.onSelect(item_r5)); });
|
|
13
|
+
i0.ɵɵelementStart(1, "span", 18);
|
|
14
|
+
i0.ɵɵtext(2);
|
|
15
|
+
i0.ɵɵelementEnd()();
|
|
15
16
|
} if (rf & 2) {
|
|
16
|
-
const
|
|
17
|
-
i0.ɵɵnextContext(4);
|
|
18
|
-
|
|
19
|
-
i0.ɵɵ
|
|
17
|
+
const item_r5 = ctx.$implicit;
|
|
18
|
+
const ctx_r2 = i0.ɵɵnextContext(4);
|
|
19
|
+
i0.ɵɵclassProp("sb-item--active", ctx_r2.isActive(item_r5));
|
|
20
|
+
i0.ɵɵadvance(2);
|
|
21
|
+
i0.ɵɵtextInterpolate(ctx_r2.itemLabel(item_r5));
|
|
20
22
|
} }
|
|
21
|
-
function
|
|
22
|
-
i0.ɵɵ
|
|
23
|
+
function PrismSidebarComponent_Conditional_7_For_8_Conditional_5_Template(rf, ctx) { if (rf & 1) {
|
|
24
|
+
i0.ɵɵelementStart(0, "div", 15);
|
|
25
|
+
i0.ɵɵrepeaterCreate(1, PrismSidebarComponent_Conditional_7_For_8_Conditional_5_For_2_Template, 3, 3, "button", 16, _forTrack1, true);
|
|
26
|
+
i0.ɵɵelementEnd();
|
|
23
27
|
} if (rf & 2) {
|
|
24
|
-
const
|
|
25
|
-
i0.ɵɵ
|
|
28
|
+
const cat_r2 = i0.ɵɵnextContext().$implicit;
|
|
29
|
+
i0.ɵɵadvance();
|
|
30
|
+
i0.ɵɵrepeater(cat_r2.items);
|
|
26
31
|
} }
|
|
27
|
-
function
|
|
32
|
+
function PrismSidebarComponent_Conditional_7_For_8_Template(rf, ctx) { if (rf & 1) {
|
|
28
33
|
const _r1 = i0.ɵɵgetCurrentView();
|
|
29
|
-
i0.ɵɵelementStart(0, "div",
|
|
30
|
-
i0.ɵɵlistener("click", function
|
|
31
|
-
i0.ɵɵ
|
|
32
|
-
i0.ɵɵelementStart(2, "svg", 4);
|
|
33
|
-
i0.ɵɵelement(3, "path", 5);
|
|
34
|
-
i0.ɵɵelementEnd();
|
|
34
|
+
i0.ɵɵelementStart(0, "div", 11)(1, "button", 12);
|
|
35
|
+
i0.ɵɵlistener("click", function PrismSidebarComponent_Conditional_7_For_8_Template_button_click_1_listener() { const cat_r2 = i0.ɵɵrestoreView(_r1).$implicit; const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.toggleCollapse("page:" + cat_r2.name)); });
|
|
36
|
+
i0.ɵɵelement(2, "prism-icon", 13)(3, "span", 14);
|
|
35
37
|
i0.ɵɵtext(4);
|
|
36
38
|
i0.ɵɵelementEnd();
|
|
37
|
-
i0.ɵɵconditionalCreate(5,
|
|
39
|
+
i0.ɵɵconditionalCreate(5, PrismSidebarComponent_Conditional_7_For_8_Conditional_5_Template, 3, 0, "div", 15);
|
|
38
40
|
i0.ɵɵelementEnd();
|
|
39
41
|
} if (rf & 2) {
|
|
40
|
-
const
|
|
41
|
-
const
|
|
42
|
-
|
|
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, " ");
|
|
42
|
+
const cat_r2 = ctx.$implicit;
|
|
43
|
+
const ctx_r2 = i0.ɵɵnextContext(2);
|
|
44
|
+
i0.ɵɵclassProp("sb-group--collapsed", ctx_r2.isCollapsed("page:" + cat_r2.name));
|
|
48
45
|
i0.ɵɵadvance();
|
|
49
|
-
i0.ɵɵ
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
i0.ɵɵ
|
|
46
|
+
i0.ɵɵattribute("aria-expanded", !ctx_r2.isCollapsed("page:" + cat_r2.name));
|
|
47
|
+
i0.ɵɵadvance();
|
|
48
|
+
i0.ɵɵproperty("size", 10);
|
|
49
|
+
i0.ɵɵadvance();
|
|
50
|
+
i0.ɵɵstyleProp("--chip", cat_r2.color);
|
|
51
|
+
i0.ɵɵadvance();
|
|
52
|
+
i0.ɵɵtextInterpolate1(" ", cat_r2.name, " ");
|
|
53
|
+
i0.ɵɵadvance();
|
|
54
|
+
i0.ɵɵconditional(!ctx_r2.isCollapsed("page:" + cat_r2.name) ? 5 : -1);
|
|
53
55
|
} }
|
|
54
|
-
function
|
|
55
|
-
i0.ɵɵ
|
|
56
|
+
function PrismSidebarComponent_Conditional_7_Template(rf, ctx) { if (rf & 1) {
|
|
57
|
+
i0.ɵɵelementStart(0, "div", 5)(1, "div", 8)(2, "span", 9);
|
|
58
|
+
i0.ɵɵelement(3, "prism-icon", 10);
|
|
59
|
+
i0.ɵɵtext(4, " Pages ");
|
|
60
|
+
i0.ɵɵelementEnd();
|
|
61
|
+
i0.ɵɵelementStart(5, "span");
|
|
62
|
+
i0.ɵɵtext(6);
|
|
63
|
+
i0.ɵɵelementEnd()();
|
|
64
|
+
i0.ɵɵrepeaterCreate(7, PrismSidebarComponent_Conditional_7_For_8_Template, 6, 8, "div", 7, _forTrack0);
|
|
65
|
+
i0.ɵɵelementEnd();
|
|
56
66
|
} if (rf & 2) {
|
|
57
|
-
const
|
|
58
|
-
i0.ɵɵ
|
|
59
|
-
|
|
60
|
-
i0.ɵɵ
|
|
67
|
+
const ctx_r2 = i0.ɵɵnextContext();
|
|
68
|
+
i0.ɵɵadvance(3);
|
|
69
|
+
i0.ɵɵproperty("size", 10);
|
|
70
|
+
i0.ɵɵadvance(3);
|
|
71
|
+
i0.ɵɵtextInterpolate(ctx_r2.totalPages());
|
|
72
|
+
i0.ɵɵadvance();
|
|
73
|
+
i0.ɵɵrepeater(ctx_r2.pageCategories());
|
|
61
74
|
} }
|
|
62
|
-
function
|
|
63
|
-
i0.ɵɵ
|
|
75
|
+
function PrismSidebarComponent_Conditional_8_Template(rf, ctx) { if (rf & 1) {
|
|
76
|
+
i0.ɵɵelementStart(0, "div", 6)(1, "span", 19);
|
|
77
|
+
i0.ɵɵelement(2, "prism-icon", 20);
|
|
78
|
+
i0.ɵɵtext(3, " Components ");
|
|
79
|
+
i0.ɵɵelementEnd();
|
|
80
|
+
i0.ɵɵelementStart(4, "span");
|
|
81
|
+
i0.ɵɵtext(5);
|
|
82
|
+
i0.ɵɵelementEnd()();
|
|
64
83
|
} if (rf & 2) {
|
|
65
|
-
const
|
|
66
|
-
i0.ɵɵ
|
|
84
|
+
const ctx_r2 = i0.ɵɵnextContext();
|
|
85
|
+
i0.ɵɵadvance(2);
|
|
86
|
+
i0.ɵɵproperty("size", 10);
|
|
87
|
+
i0.ɵɵadvance(3);
|
|
88
|
+
i0.ɵɵtextInterpolate(ctx_r2.stats().components);
|
|
67
89
|
} }
|
|
68
|
-
function
|
|
69
|
-
i0.ɵɵ
|
|
90
|
+
function PrismSidebarComponent_For_10_Conditional_5_For_2_Conditional_4_Template(rf, ctx) { if (rf & 1) {
|
|
91
|
+
i0.ɵɵelementStart(0, "span", 22);
|
|
92
|
+
i0.ɵɵtext(1);
|
|
93
|
+
i0.ɵɵelementEnd();
|
|
70
94
|
} if (rf & 2) {
|
|
71
|
-
const
|
|
72
|
-
i0.ɵɵ
|
|
95
|
+
const item_r9 = i0.ɵɵnextContext().$implicit;
|
|
96
|
+
i0.ɵɵadvance();
|
|
97
|
+
i0.ɵɵtextInterpolate((item_r9.data.meta.showcaseConfig.variants == null ? null : item_r9.data.meta.showcaseConfig.variants.length) ?? 0);
|
|
73
98
|
} }
|
|
74
|
-
function
|
|
75
|
-
i0.ɵɵ
|
|
76
|
-
i0.ɵɵ
|
|
99
|
+
function PrismSidebarComponent_For_10_Conditional_5_For_2_Conditional_5_For_1_Template(rf, ctx) { if (rf & 1) {
|
|
100
|
+
const _r10 = i0.ɵɵgetCurrentView();
|
|
101
|
+
i0.ɵɵelementStart(0, "button", 24);
|
|
102
|
+
i0.ɵɵlistener("click", function PrismSidebarComponent_For_10_Conditional_5_For_2_Conditional_5_For_1_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r10); const item_r9 = i0.ɵɵnextContext(2).$implicit; const ctx_r2 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r2.onSelect(item_r9)); });
|
|
103
|
+
i0.ɵɵelement(1, "span", 25);
|
|
104
|
+
i0.ɵɵtext(2);
|
|
77
105
|
i0.ɵɵelementEnd();
|
|
106
|
+
} if (rf & 2) {
|
|
107
|
+
const variant_r11 = ctx.$implicit;
|
|
108
|
+
i0.ɵɵadvance(2);
|
|
109
|
+
i0.ɵɵtextInterpolate1(" ", variant_r11.name, " ");
|
|
78
110
|
} }
|
|
79
|
-
function
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
i0.ɵɵ
|
|
84
|
-
|
|
111
|
+
function PrismSidebarComponent_For_10_Conditional_5_For_2_Conditional_5_Template(rf, ctx) { if (rf & 1) {
|
|
112
|
+
i0.ɵɵrepeaterCreate(0, PrismSidebarComponent_For_10_Conditional_5_For_2_Conditional_5_For_1_Template, 3, 1, "button", 23, _forTrack0);
|
|
113
|
+
} if (rf & 2) {
|
|
114
|
+
const item_r9 = i0.ɵɵnextContext().$implicit;
|
|
115
|
+
i0.ɵɵrepeater(item_r9.data.meta.showcaseConfig.variants);
|
|
116
|
+
} }
|
|
117
|
+
function PrismSidebarComponent_For_10_Conditional_5_For_2_Template(rf, ctx) { if (rf & 1) {
|
|
118
|
+
const _r8 = i0.ɵɵgetCurrentView();
|
|
119
|
+
i0.ɵɵelementStart(0, "button", 17);
|
|
120
|
+
i0.ɵɵlistener("click", function PrismSidebarComponent_For_10_Conditional_5_For_2_Template_button_click_0_listener() { const item_r9 = i0.ɵɵrestoreView(_r8).$implicit; const ctx_r2 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r2.onSelect(item_r9)); });
|
|
121
|
+
i0.ɵɵelement(1, "prism-icon", 21);
|
|
122
|
+
i0.ɵɵelementStart(2, "span", 18);
|
|
123
|
+
i0.ɵɵtext(3);
|
|
85
124
|
i0.ɵɵelementEnd();
|
|
125
|
+
i0.ɵɵconditionalCreate(4, PrismSidebarComponent_For_10_Conditional_5_For_2_Conditional_4_Template, 2, 1, "span", 22);
|
|
126
|
+
i0.ɵɵelementEnd();
|
|
127
|
+
i0.ɵɵconditionalCreate(5, PrismSidebarComponent_For_10_Conditional_5_For_2_Conditional_5_Template, 2, 0);
|
|
86
128
|
} if (rf & 2) {
|
|
87
|
-
const
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
i0.ɵɵ
|
|
129
|
+
const item_r9 = ctx.$implicit;
|
|
130
|
+
const ctx_r2 = i0.ɵɵnextContext(3);
|
|
131
|
+
i0.ɵɵclassProp("sb-item--active", ctx_r2.isActive(item_r9));
|
|
132
|
+
i0.ɵɵadvance();
|
|
133
|
+
i0.ɵɵproperty("size", 12);
|
|
134
|
+
i0.ɵɵadvance(2);
|
|
135
|
+
i0.ɵɵtextInterpolate(ctx_r2.itemLabel(item_r9));
|
|
91
136
|
i0.ɵɵadvance();
|
|
92
|
-
i0.ɵɵconditional(
|
|
137
|
+
i0.ɵɵconditional(item_r9.kind === "component" ? 4 : -1);
|
|
93
138
|
i0.ɵɵadvance();
|
|
94
|
-
i0.ɵɵ
|
|
139
|
+
i0.ɵɵconditional(ctx_r2.isActive(item_r9) && item_r9.kind === "component" && (item_r9.data.meta.showcaseConfig.variants == null ? null : item_r9.data.meta.showcaseConfig.variants.length) ? 5 : -1);
|
|
95
140
|
} }
|
|
96
|
-
function
|
|
97
|
-
i0.ɵɵ
|
|
141
|
+
function PrismSidebarComponent_For_10_Conditional_5_Template(rf, ctx) { if (rf & 1) {
|
|
142
|
+
i0.ɵɵelementStart(0, "div", 15);
|
|
143
|
+
i0.ɵɵrepeaterCreate(1, PrismSidebarComponent_For_10_Conditional_5_For_2_Template, 6, 6, null, null, _forTrack1, true);
|
|
144
|
+
i0.ɵɵelementEnd();
|
|
98
145
|
} if (rf & 2) {
|
|
99
|
-
const
|
|
100
|
-
i0.ɵɵ
|
|
146
|
+
const cat_r7 = i0.ɵɵnextContext().$implicit;
|
|
147
|
+
i0.ɵɵadvance();
|
|
148
|
+
i0.ɵɵrepeater(cat_r7.items);
|
|
101
149
|
} }
|
|
102
|
-
function
|
|
103
|
-
const
|
|
104
|
-
i0.ɵɵelementStart(0, "div",
|
|
105
|
-
i0.ɵɵlistener("click", function
|
|
106
|
-
i0.ɵɵ
|
|
107
|
-
i0.ɵɵelementStart(2, "svg", 4);
|
|
108
|
-
i0.ɵɵelement(3, "path", 5);
|
|
109
|
-
i0.ɵɵelementEnd();
|
|
150
|
+
function PrismSidebarComponent_For_10_Template(rf, ctx) { if (rf & 1) {
|
|
151
|
+
const _r6 = i0.ɵɵgetCurrentView();
|
|
152
|
+
i0.ɵɵelementStart(0, "div", 11)(1, "button", 12);
|
|
153
|
+
i0.ɵɵlistener("click", function PrismSidebarComponent_For_10_Template_button_click_1_listener() { const cat_r7 = i0.ɵɵrestoreView(_r6).$implicit; const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.toggleCollapse("comp:" + cat_r7.name)); });
|
|
154
|
+
i0.ɵɵelement(2, "prism-icon", 13)(3, "span", 14);
|
|
110
155
|
i0.ɵɵtext(4);
|
|
111
156
|
i0.ɵɵelementEnd();
|
|
112
|
-
i0.ɵɵconditionalCreate(5,
|
|
157
|
+
i0.ɵɵconditionalCreate(5, PrismSidebarComponent_For_10_Conditional_5_Template, 3, 0, "div", 15);
|
|
113
158
|
i0.ɵɵelementEnd();
|
|
114
159
|
} if (rf & 2) {
|
|
115
|
-
const
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
i0.ɵɵclassProp("prism-sidebar__category--nested", nested_r13);
|
|
160
|
+
const cat_r7 = ctx.$implicit;
|
|
161
|
+
const ctx_r2 = i0.ɵɵnextContext();
|
|
162
|
+
i0.ɵɵclassProp("sb-group--collapsed", ctx_r2.isCollapsed("comp:" + cat_r7.name));
|
|
119
163
|
i0.ɵɵadvance();
|
|
120
|
-
i0.ɵɵ
|
|
164
|
+
i0.ɵɵattribute("aria-expanded", !ctx_r2.isCollapsed("comp:" + cat_r7.name));
|
|
121
165
|
i0.ɵɵadvance();
|
|
122
|
-
i0.ɵɵ
|
|
123
|
-
i0.ɵɵadvance(2);
|
|
124
|
-
i0.ɵɵtextInterpolate1(" ", cat_r10.name, " ");
|
|
166
|
+
i0.ɵɵproperty("size", 10);
|
|
125
167
|
i0.ɵɵadvance();
|
|
126
|
-
i0.ɵɵ
|
|
168
|
+
i0.ɵɵstyleProp("--chip", cat_r7.color);
|
|
169
|
+
i0.ɵɵadvance();
|
|
170
|
+
i0.ɵɵtextInterpolate1(" ", cat_r7.name, " ");
|
|
171
|
+
i0.ɵɵadvance();
|
|
172
|
+
i0.ɵɵconditional(!ctx_r2.isCollapsed("comp:" + cat_r7.name) ? 5 : -1);
|
|
127
173
|
} }
|
|
128
|
-
const STORAGE_KEY = 'ng-prism-sidebar-
|
|
174
|
+
const STORAGE_KEY = 'ng-prism-sidebar-collapsed';
|
|
175
|
+
const CATEGORY_COLORS = {
|
|
176
|
+
'Data Display': '#f472b6',
|
|
177
|
+
Feedback: '#fbbf24',
|
|
178
|
+
Inputs: '#a78bfa',
|
|
179
|
+
Layout: '#34d399',
|
|
180
|
+
Navigation: '#60a5fa',
|
|
181
|
+
Overlay: '#c084fc',
|
|
182
|
+
Directives: '#ec4899',
|
|
183
|
+
};
|
|
184
|
+
function categoryColor(name) {
|
|
185
|
+
if (CATEGORY_COLORS[name])
|
|
186
|
+
return CATEGORY_COLORS[name];
|
|
187
|
+
let hash = 0;
|
|
188
|
+
for (let i = 0; i < name.length; i++)
|
|
189
|
+
hash = ((hash << 5) - hash + name.charCodeAt(i)) | 0;
|
|
190
|
+
const hue = Math.abs(hash) % 360;
|
|
191
|
+
return `hsl(${hue}, 70%, 65%)`;
|
|
192
|
+
}
|
|
129
193
|
export class PrismSidebarComponent {
|
|
130
194
|
navigationService = inject(PrismNavigationService);
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
catName = fullCategory;
|
|
146
|
-
}
|
|
147
|
-
const cats = groupMap.get(groupName) ?? [];
|
|
148
|
-
cats.push({ name: catName, items });
|
|
149
|
-
groupMap.set(groupName, cats);
|
|
195
|
+
searchService = inject(PrismSearchService);
|
|
196
|
+
manifestService = inject(PrismManifestService);
|
|
197
|
+
collapsedSet = signal(this.loadCollapsed(), ...(ngDevMode ? [{ debugName: "collapsedSet" }] : []));
|
|
198
|
+
totalPages = computed(() => {
|
|
199
|
+
return this.searchService.filteredPages().length;
|
|
200
|
+
}, ...(ngDevMode ? [{ debugName: "totalPages" }] : []));
|
|
201
|
+
pageCategories = computed(() => {
|
|
202
|
+
const pages = this.searchService.filteredPages();
|
|
203
|
+
const catMap = new Map();
|
|
204
|
+
for (const page of pages) {
|
|
205
|
+
const cat = page.category ?? 'Docs';
|
|
206
|
+
const list = catMap.get(cat) ?? [];
|
|
207
|
+
list.push({ kind: 'page', data: page });
|
|
208
|
+
catMap.set(cat, list);
|
|
150
209
|
}
|
|
210
|
+
return [...catMap.entries()].map(([name, items]) => ({
|
|
211
|
+
name,
|
|
212
|
+
color: categoryColor(name),
|
|
213
|
+
items,
|
|
214
|
+
}));
|
|
215
|
+
}, ...(ngDevMode ? [{ debugName: "pageCategories" }] : []));
|
|
216
|
+
componentCategories = computed(() => {
|
|
217
|
+
const tree = this.navigationService.categoryTree();
|
|
151
218
|
const result = [];
|
|
152
|
-
const
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
219
|
+
for (const [catName, items] of tree.entries()) {
|
|
220
|
+
const compItems = items.filter((i) => i.kind === 'component');
|
|
221
|
+
if (compItems.length === 0)
|
|
222
|
+
continue;
|
|
223
|
+
result.push({
|
|
224
|
+
name: catName,
|
|
225
|
+
color: categoryColor(catName),
|
|
226
|
+
items: compItems,
|
|
227
|
+
});
|
|
159
228
|
}
|
|
160
229
|
return result;
|
|
161
|
-
}, ...(ngDevMode ? [{ debugName: "
|
|
162
|
-
|
|
163
|
-
const
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
230
|
+
}, ...(ngDevMode ? [{ debugName: "componentCategories" }] : []));
|
|
231
|
+
stats = computed(() => {
|
|
232
|
+
const manifest = this.manifestService.manifest();
|
|
233
|
+
const components = manifest.components.length;
|
|
234
|
+
const variants = manifest.components.reduce((sum, c) => sum + (c.meta.showcaseConfig.variants?.length ?? 0), 0);
|
|
235
|
+
return { components, variants };
|
|
236
|
+
}, ...(ngDevMode ? [{ debugName: "stats" }] : []));
|
|
237
|
+
isCollapsed(key) {
|
|
238
|
+
return this.collapsedSet().has(key);
|
|
169
239
|
}
|
|
170
|
-
|
|
171
|
-
this.
|
|
240
|
+
toggleCollapse(key) {
|
|
241
|
+
this.collapsedSet.update((prev) => {
|
|
172
242
|
const next = new Set(prev);
|
|
173
|
-
|
|
174
|
-
if (next.has(key)) {
|
|
243
|
+
if (next.has(key))
|
|
175
244
|
next.delete(key);
|
|
176
|
-
|
|
177
|
-
}
|
|
178
|
-
else if (next.has(collapsedKey)) {
|
|
179
|
-
next.delete(collapsedKey);
|
|
245
|
+
else
|
|
180
246
|
next.add(key);
|
|
181
|
-
|
|
182
|
-
else if (index === 0) {
|
|
183
|
-
next.add(collapsedKey);
|
|
184
|
-
}
|
|
185
|
-
else {
|
|
186
|
-
next.add(key);
|
|
187
|
-
}
|
|
188
|
-
this.saveExpanded(next);
|
|
247
|
+
this.saveCollapsed(next);
|
|
189
248
|
return next;
|
|
190
249
|
});
|
|
191
250
|
}
|
|
@@ -204,7 +263,7 @@ export class PrismSidebarComponent {
|
|
|
204
263
|
if (!active || active.kind !== item.kind)
|
|
205
264
|
return false;
|
|
206
265
|
if (item.kind === 'component') {
|
|
207
|
-
return item.data.meta.className === active.data.meta.className;
|
|
266
|
+
return (item.data.meta.className === active.data.meta.className);
|
|
208
267
|
}
|
|
209
268
|
return item.data.title === active.data.title;
|
|
210
269
|
}
|
|
@@ -216,7 +275,7 @@ export class PrismSidebarComponent {
|
|
|
216
275
|
this.navigationService.selectPage(item.data);
|
|
217
276
|
}
|
|
218
277
|
}
|
|
219
|
-
|
|
278
|
+
loadCollapsed() {
|
|
220
279
|
try {
|
|
221
280
|
const stored = localStorage.getItem(STORAGE_KEY);
|
|
222
281
|
return stored ? new Set(JSON.parse(stored)) : new Set();
|
|
@@ -225,91 +284,146 @@ export class PrismSidebarComponent {
|
|
|
225
284
|
return new Set();
|
|
226
285
|
}
|
|
227
286
|
}
|
|
228
|
-
|
|
287
|
+
saveCollapsed(set) {
|
|
229
288
|
try {
|
|
230
289
|
localStorage.setItem(STORAGE_KEY, JSON.stringify([...set]));
|
|
231
290
|
}
|
|
232
|
-
catch {
|
|
291
|
+
catch { }
|
|
233
292
|
}
|
|
234
293
|
static ɵfac = function PrismSidebarComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || PrismSidebarComponent)(); };
|
|
235
|
-
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: PrismSidebarComponent, selectors: [["prism-sidebar"]], decls:
|
|
236
|
-
i0.ɵɵelementStart(0, "nav", 1);
|
|
237
|
-
i0.ɵɵ
|
|
238
|
-
i0.ɵɵ
|
|
294
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: PrismSidebarComponent, selectors: [["prism-sidebar"]], decls: 11, vars: 4, consts: [[1, "prism-sidebar"], [1, "sb-filter"], ["name", "search", 3, "size"], ["placeholder", "Filter components\u2026", 3, "input", "value"], [1, "sb-scroll"], [1, "sb-pinned"], [1, "sb-section-head"], [1, "sb-group", 3, "sb-group--collapsed"], [1, "sb-pinned-head"], [1, "sb-pinned-head-l"], ["name", "pin", 1, "sb-pinned-pin", 3, "size"], [1, "sb-group"], [1, "sb-group-head", 3, "click"], ["name", "chevron-down", 3, "size"], [1, "sb-group-chip"], [1, "sb-group-body"], [1, "sb-item", 3, "sb-item--active"], [1, "sb-item", 3, "click"], [1, "sb-item-name"], [1, "sb-section-head-l"], ["name", "box", 1, "sb-section-icon", 3, "size"], ["name", "box", 1, "sb-item-icon", 3, "size"], [1, "sb-item-count"], [1, "sb-sub"], [1, "sb-sub", 3, "click"], [1, "sb-sub-dot"]], template: function PrismSidebarComponent_Template(rf, ctx) { if (rf & 1) {
|
|
295
|
+
i0.ɵɵelementStart(0, "nav", 0)(1, "div", 1);
|
|
296
|
+
i0.ɵɵelement(2, "prism-icon", 2);
|
|
297
|
+
i0.ɵɵelementStart(3, "input", 3);
|
|
298
|
+
i0.ɵɵlistener("input", function PrismSidebarComponent_Template_input_input_3_listener($event) { return ctx.searchService.search($event.target.value); });
|
|
239
299
|
i0.ɵɵelementEnd();
|
|
300
|
+
i0.ɵɵelementStart(4, "kbd");
|
|
301
|
+
i0.ɵɵtext(5, "/");
|
|
302
|
+
i0.ɵɵelementEnd()();
|
|
303
|
+
i0.ɵɵelementStart(6, "div", 4);
|
|
304
|
+
i0.ɵɵconditionalCreate(7, PrismSidebarComponent_Conditional_7_Template, 9, 2, "div", 5);
|
|
305
|
+
i0.ɵɵconditionalCreate(8, PrismSidebarComponent_Conditional_8_Template, 6, 2, "div", 6);
|
|
306
|
+
i0.ɵɵrepeaterCreate(9, PrismSidebarComponent_For_10_Template, 6, 8, "div", 7, _forTrack0);
|
|
307
|
+
i0.ɵɵelementEnd()();
|
|
240
308
|
} if (rf & 2) {
|
|
309
|
+
i0.ɵɵadvance(2);
|
|
310
|
+
i0.ɵɵproperty("size", 12);
|
|
241
311
|
i0.ɵɵadvance();
|
|
242
|
-
i0.ɵɵ
|
|
243
|
-
|
|
312
|
+
i0.ɵɵproperty("value", ctx.searchService.query());
|
|
313
|
+
i0.ɵɵadvance(4);
|
|
314
|
+
i0.ɵɵconditional(ctx.pageCategories().length > 0 ? 7 : -1);
|
|
315
|
+
i0.ɵɵadvance();
|
|
316
|
+
i0.ɵɵconditional(ctx.componentCategories().length > 0 ? 8 : -1);
|
|
317
|
+
i0.ɵɵadvance();
|
|
318
|
+
i0.ɵɵrepeater(ctx.componentCategories());
|
|
319
|
+
} }, dependencies: [PrismIconComponent], styles: [".prism-sidebar[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n height: 100%;\n min-height: 0;\n overflow: hidden;\n }\n\n .sb-filter[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 8px;\n margin: 12px;\n padding: 0 10px;\n height: 30px;\n background: var(--prism-input-bg);\n border: 1px solid var(--prism-border);\n border-radius: 6px;\n color: var(--prism-text-muted);\n }\n .sb-filter[_ngcontent-%COMP%] input[_ngcontent-%COMP%] {\n flex: 1;\n min-width: 0;\n background: transparent;\n border: 0;\n outline: none;\n font-size: var(--fs-md);\n color: var(--prism-text);\n font-family: var(--font-sans);\n }\n .sb-filter[_ngcontent-%COMP%] input[_ngcontent-%COMP%]::placeholder { color: var(--prism-text-muted); }\n .sb-filter[_ngcontent-%COMP%] kbd[_ngcontent-%COMP%] {\n font-family: var(--font-mono);\n font-size: 10px;\n color: var(--prism-text-ghost);\n padding: 1px 5px;\n border: 1px solid var(--prism-border);\n border-radius: 3px;\n }\n\n .sb-scroll[_ngcontent-%COMP%] {\n flex: 1;\n overflow-y: auto;\n padding: 10px 0 16px;\n padding-top: 0;\n }\n .sb-scroll[_ngcontent-%COMP%]::-webkit-scrollbar { width: 8px; }\n .sb-scroll[_ngcontent-%COMP%]::-webkit-scrollbar-thumb { background: var(--prism-border-strong); border-radius: 4px; }\n .sb-scroll[_ngcontent-%COMP%]::-webkit-scrollbar-track { background: transparent; }\n\n .sb-pinned[_ngcontent-%COMP%] {\n padding: 0 0 10px;\n margin-bottom: 4px;\n border-bottom: 1px solid var(--prism-border);\n border-top: 1px solid var(--prism-border);\n }\n .sb-section-head[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 8px 14px 6px;\n font-size: 10.5px;\n font-weight: 700;\n letter-spacing: 0.09em;\n text-transform: uppercase;\n color: var(--prism-text-ghost);\n margin-top: 6px;\n }\n .sb-section-head-l[_ngcontent-%COMP%] { display: flex; align-items: center; gap: 6px; }\n .sb-section-icon[_ngcontent-%COMP%] { color: var(--prism-primary); }\n .sb-pinned-head[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 8px 14px 6px;\n margin-top: 6px;\n font-size: 10.5px;\n font-weight: 700;\n letter-spacing: 0.09em;\n text-transform: uppercase;\n color: var(--prism-text-ghost);\n }\n .sb-pinned-head-l[_ngcontent-%COMP%] { display: flex; align-items: center; gap: 6px; }\n .sb-pinned-pin[_ngcontent-%COMP%] { color: var(--prism-accent); }\n\n .sb-group[_ngcontent-%COMP%] { margin-bottom: 4px; }\n .sb-group-head[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 6px;\n width: 100%;\n padding: 8px 14px 6px;\n font-size: 10.5px;\n font-weight: 700;\n letter-spacing: 0.09em;\n text-transform: uppercase;\n color: var(--prism-text-ghost);\n cursor: pointer;\n user-select: none;\n background: none;\n border: none;\n text-align: left;\n font-family: var(--font-sans);\n }\n .sb-group-head[_ngcontent-%COMP%] prism-icon[_ngcontent-%COMP%] {\n transition: transform var(--dur-fast);\n color: var(--prism-text-ghost);\n }\n .sb-group--collapsed[_ngcontent-%COMP%] .sb-group-head[_ngcontent-%COMP%] prism-icon[_ngcontent-%COMP%] { transform: rotate(-90deg); }\n\n .sb-group-chip[_ngcontent-%COMP%] {\n width: 6px;\n height: 6px;\n border-radius: 2px;\n background: var(--chip, var(--prism-primary));\n box-shadow: 0 0 6px var(--chip, var(--prism-primary));\n }\n\n .sb-item[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 10px;\n width: 100%;\n height: 30px;\n padding: 0 14px 0 28px;\n font-size: 13px;\n color: var(--prism-text-2);\n cursor: pointer;\n border: none;\n border-left: 2px solid transparent;\n background: none;\n position: relative;\n transition: background var(--dur-fast), color var(--dur-fast);\n text-align: left;\n font-family: var(--font-sans);\n }\n .sb-item[_ngcontent-%COMP%]:hover {\n background: color-mix(in srgb, var(--prism-primary) 5%, transparent);\n color: var(--prism-text);\n }\n .sb-item--active[_ngcontent-%COMP%] {\n border-left-color: var(--prism-primary);\n background: color-mix(in srgb, var(--prism-primary) 12%, transparent);\n color: var(--prism-text);\n font-weight: 500;\n }\n .sb-item--active[_ngcontent-%COMP%]::before {\n content: '';\n position: absolute;\n left: -1px;\n top: 0;\n bottom: 0;\n width: 3px;\n background: linear-gradient(180deg, var(--prism-primary-from), var(--prism-primary-to));\n }\n .sb-item-icon[_ngcontent-%COMP%] { flex: 0 0 12px; opacity: 0.7; }\n .sb-item-name[_ngcontent-%COMP%] {\n flex: 1;\n min-width: 0;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n .sb-item-count[_ngcontent-%COMP%] {\n font-family: var(--font-mono);\n font-size: 10px;\n color: var(--prism-text-ghost);\n padding: 1px 5px;\n border-radius: 3px;\n background: var(--prism-input-bg);\n }\n .sb-item--active[_ngcontent-%COMP%] .sb-item-count[_ngcontent-%COMP%] {\n color: var(--prism-primary);\n background: color-mix(in srgb, var(--prism-primary) 15%, transparent);\n }\n\n .sb-sub[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 6px;\n width: 100%;\n padding-left: 44px;\n height: 24px;\n font-size: 12px;\n color: var(--prism-text-muted);\n cursor: pointer;\n border: none;\n border-left: 2px solid transparent;\n background: none;\n text-align: left;\n font-family: var(--font-sans);\n }\n .sb-sub[_ngcontent-%COMP%]:hover { color: var(--prism-text-2); }\n .sb-sub-dot[_ngcontent-%COMP%] {\n width: 4px;\n height: 4px;\n border-radius: 50%;\n background: currentColor;\n }\n\n [_ngcontent-%COMP%]:focus-visible {\n outline: 2px solid var(--prism-primary);\n outline-offset: 2px;\n }"], changeDetection: 0 });
|
|
244
320
|
}
|
|
245
321
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PrismSidebarComponent, [{
|
|
246
322
|
type: Component,
|
|
247
|
-
args: [{ selector: 'prism-sidebar', standalone: true, imports: [
|
|
323
|
+
args: [{ selector: 'prism-sidebar', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [PrismIconComponent], template: `
|
|
248
324
|
<nav class="prism-sidebar">
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
325
|
+
<div class="sb-filter">
|
|
326
|
+
<prism-icon name="search" [size]="12" />
|
|
327
|
+
<input
|
|
328
|
+
placeholder="Filter components…"
|
|
329
|
+
[value]="searchService.query()"
|
|
330
|
+
(input)="searchService.search($any($event.target).value)"
|
|
331
|
+
/>
|
|
332
|
+
<kbd>/</kbd>
|
|
333
|
+
</div>
|
|
334
|
+
|
|
335
|
+
<div class="sb-scroll">
|
|
336
|
+
@if (pageCategories().length > 0) {
|
|
337
|
+
<div class="sb-pinned">
|
|
338
|
+
<div class="sb-pinned-head">
|
|
339
|
+
<span class="sb-pinned-head-l">
|
|
340
|
+
<prism-icon name="pin" [size]="10" class="sb-pinned-pin" />
|
|
341
|
+
Pages
|
|
342
|
+
</span>
|
|
343
|
+
<span>{{ totalPages() }}</span>
|
|
344
|
+
</div>
|
|
345
|
+
@for (cat of pageCategories(); track cat.name) {
|
|
346
|
+
<div
|
|
347
|
+
class="sb-group"
|
|
348
|
+
[class.sb-group--collapsed]="isCollapsed('page:' + cat.name)"
|
|
349
|
+
>
|
|
252
350
|
<button
|
|
253
|
-
class="
|
|
254
|
-
(click)="
|
|
351
|
+
class="sb-group-head"
|
|
352
|
+
(click)="toggleCollapse('page:' + cat.name)"
|
|
353
|
+
[attr.aria-expanded]="!isCollapsed('page:' + cat.name)"
|
|
255
354
|
>
|
|
256
|
-
<
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
viewBox="0 0 16 16"
|
|
260
|
-
>
|
|
261
|
-
<path d="M6 4l4 4-4 4"/>
|
|
262
|
-
</svg>
|
|
263
|
-
{{ group.name }}
|
|
355
|
+
<prism-icon name="chevron-down" [size]="10" />
|
|
356
|
+
<span class="sb-group-chip" [style.--chip]="cat.color"></span>
|
|
357
|
+
{{ cat.name }}
|
|
264
358
|
</button>
|
|
265
|
-
@if (
|
|
266
|
-
|
|
267
|
-
|
|
359
|
+
@if (!isCollapsed('page:' + cat.name)) {
|
|
360
|
+
<div class="sb-group-body">
|
|
361
|
+
@for (item of cat.items; track itemKey(item)) {
|
|
362
|
+
<button
|
|
363
|
+
class="sb-item"
|
|
364
|
+
[class.sb-item--active]="isActive(item)"
|
|
365
|
+
(click)="onSelect(item)"
|
|
366
|
+
>
|
|
367
|
+
<span class="sb-item-name">{{ itemLabel(item) }}</span>
|
|
368
|
+
</button>
|
|
268
369
|
}
|
|
370
|
+
</div>
|
|
269
371
|
}
|
|
270
372
|
</div>
|
|
271
|
-
} @else {
|
|
272
|
-
@for (cat of group.categories; track cat.name) {
|
|
273
|
-
<ng-container *ngTemplateOutlet="categoryTpl; context: { cat, nested: false }" />
|
|
274
373
|
}
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
374
|
+
</div>
|
|
375
|
+
} @if (componentCategories().length > 0) {
|
|
376
|
+
<div class="sb-section-head">
|
|
377
|
+
<span class="sb-section-head-l">
|
|
378
|
+
<prism-icon name="box" [size]="10" class="sb-section-icon" />
|
|
379
|
+
Components
|
|
380
|
+
</span>
|
|
381
|
+
<span>{{ stats().components }}</span>
|
|
382
|
+
</div>
|
|
383
|
+
} @for (cat of componentCategories(); track cat.name) {
|
|
384
|
+
<div
|
|
385
|
+
class="sb-group"
|
|
386
|
+
[class.sb-group--collapsed]="isCollapsed('comp:' + cat.name)"
|
|
387
|
+
>
|
|
280
388
|
<button
|
|
281
|
-
class="
|
|
282
|
-
|
|
283
|
-
|
|
389
|
+
class="sb-group-head"
|
|
390
|
+
(click)="toggleCollapse('comp:' + cat.name)"
|
|
391
|
+
[attr.aria-expanded]="!isCollapsed('comp:' + cat.name)"
|
|
284
392
|
>
|
|
285
|
-
<
|
|
286
|
-
|
|
287
|
-
[class.prism-sidebar__chevron--expanded]="isExpanded('cat:' + cat.name, 0)"
|
|
288
|
-
viewBox="0 0 16 16"
|
|
289
|
-
>
|
|
290
|
-
<path d="M6 4l4 4-4 4"/>
|
|
291
|
-
</svg>
|
|
393
|
+
<prism-icon name="chevron-down" [size]="10" />
|
|
394
|
+
<span class="sb-group-chip" [style.--chip]="cat.color"></span>
|
|
292
395
|
{{ cat.name }}
|
|
293
396
|
</button>
|
|
294
|
-
@if (
|
|
397
|
+
@if (!isCollapsed('comp:' + cat.name)) {
|
|
398
|
+
<div class="sb-group-body">
|
|
295
399
|
@for (item of cat.items; track itemKey(item)) {
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
>
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
400
|
+
<button
|
|
401
|
+
class="sb-item"
|
|
402
|
+
[class.sb-item--active]="isActive(item)"
|
|
403
|
+
(click)="onSelect(item)"
|
|
404
|
+
>
|
|
405
|
+
<prism-icon name="box" [size]="12" class="sb-item-icon" />
|
|
406
|
+
<span class="sb-item-name">{{ itemLabel(item) }}</span>
|
|
407
|
+
@if (item.kind === 'component') {
|
|
408
|
+
<span class="sb-item-count">{{
|
|
409
|
+
item.data.meta.showcaseConfig.variants?.length ?? 0
|
|
410
|
+
}}</span>
|
|
411
|
+
}
|
|
412
|
+
</button>
|
|
413
|
+
@if (isActive(item) && item.kind === 'component' &&
|
|
414
|
+
item.data.meta.showcaseConfig.variants?.length) { @for (variant of
|
|
415
|
+
item.data.meta.showcaseConfig.variants; track variant.name) {
|
|
416
|
+
<button class="sb-sub" (click)="onSelect(item)">
|
|
417
|
+
<span class="sb-sub-dot"></span>
|
|
418
|
+
{{ variant.name }}
|
|
419
|
+
</button>
|
|
420
|
+
} } }
|
|
421
|
+
</div>
|
|
309
422
|
}
|
|
310
423
|
</div>
|
|
311
|
-
|
|
424
|
+
}
|
|
425
|
+
</div>
|
|
312
426
|
</nav>
|
|
313
|
-
`, styles: ["\n .prism-sidebar {\n background: var(--prism-
|
|
427
|
+
`, styles: ["\n .prism-sidebar {\n display: flex;\n flex-direction: column;\n height: 100%;\n min-height: 0;\n overflow: hidden;\n }\n\n .sb-filter {\n display: flex;\n align-items: center;\n gap: 8px;\n margin: 12px;\n padding: 0 10px;\n height: 30px;\n background: var(--prism-input-bg);\n border: 1px solid var(--prism-border);\n border-radius: 6px;\n color: var(--prism-text-muted);\n }\n .sb-filter input {\n flex: 1;\n min-width: 0;\n background: transparent;\n border: 0;\n outline: none;\n font-size: var(--fs-md);\n color: var(--prism-text);\n font-family: var(--font-sans);\n }\n .sb-filter input::placeholder { color: var(--prism-text-muted); }\n .sb-filter kbd {\n font-family: var(--font-mono);\n font-size: 10px;\n color: var(--prism-text-ghost);\n padding: 1px 5px;\n border: 1px solid var(--prism-border);\n border-radius: 3px;\n }\n\n .sb-scroll {\n flex: 1;\n overflow-y: auto;\n padding: 10px 0 16px;\n padding-top: 0;\n }\n .sb-scroll::-webkit-scrollbar { width: 8px; }\n .sb-scroll::-webkit-scrollbar-thumb { background: var(--prism-border-strong); border-radius: 4px; }\n .sb-scroll::-webkit-scrollbar-track { background: transparent; }\n\n .sb-pinned {\n padding: 0 0 10px;\n margin-bottom: 4px;\n border-bottom: 1px solid var(--prism-border);\n border-top: 1px solid var(--prism-border);\n }\n .sb-section-head {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 8px 14px 6px;\n font-size: 10.5px;\n font-weight: 700;\n letter-spacing: 0.09em;\n text-transform: uppercase;\n color: var(--prism-text-ghost);\n margin-top: 6px;\n }\n .sb-section-head-l { display: flex; align-items: center; gap: 6px; }\n .sb-section-icon { color: var(--prism-primary); }\n .sb-pinned-head {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 8px 14px 6px;\n margin-top: 6px;\n font-size: 10.5px;\n font-weight: 700;\n letter-spacing: 0.09em;\n text-transform: uppercase;\n color: var(--prism-text-ghost);\n }\n .sb-pinned-head-l { display: flex; align-items: center; gap: 6px; }\n .sb-pinned-pin { color: var(--prism-accent); }\n\n .sb-group { margin-bottom: 4px; }\n .sb-group-head {\n display: flex;\n align-items: center;\n gap: 6px;\n width: 100%;\n padding: 8px 14px 6px;\n font-size: 10.5px;\n font-weight: 700;\n letter-spacing: 0.09em;\n text-transform: uppercase;\n color: var(--prism-text-ghost);\n cursor: pointer;\n user-select: none;\n background: none;\n border: none;\n text-align: left;\n font-family: var(--font-sans);\n }\n .sb-group-head prism-icon {\n transition: transform var(--dur-fast);\n color: var(--prism-text-ghost);\n }\n .sb-group--collapsed .sb-group-head prism-icon { transform: rotate(-90deg); }\n\n .sb-group-chip {\n width: 6px;\n height: 6px;\n border-radius: 2px;\n background: var(--chip, var(--prism-primary));\n box-shadow: 0 0 6px var(--chip, var(--prism-primary));\n }\n\n .sb-item {\n display: flex;\n align-items: center;\n gap: 10px;\n width: 100%;\n height: 30px;\n padding: 0 14px 0 28px;\n font-size: 13px;\n color: var(--prism-text-2);\n cursor: pointer;\n border: none;\n border-left: 2px solid transparent;\n background: none;\n position: relative;\n transition: background var(--dur-fast), color var(--dur-fast);\n text-align: left;\n font-family: var(--font-sans);\n }\n .sb-item:hover {\n background: color-mix(in srgb, var(--prism-primary) 5%, transparent);\n color: var(--prism-text);\n }\n .sb-item--active {\n border-left-color: var(--prism-primary);\n background: color-mix(in srgb, var(--prism-primary) 12%, transparent);\n color: var(--prism-text);\n font-weight: 500;\n }\n .sb-item--active::before {\n content: '';\n position: absolute;\n left: -1px;\n top: 0;\n bottom: 0;\n width: 3px;\n background: linear-gradient(180deg, var(--prism-primary-from), var(--prism-primary-to));\n }\n .sb-item-icon { flex: 0 0 12px; opacity: 0.7; }\n .sb-item-name {\n flex: 1;\n min-width: 0;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n .sb-item-count {\n font-family: var(--font-mono);\n font-size: 10px;\n color: var(--prism-text-ghost);\n padding: 1px 5px;\n border-radius: 3px;\n background: var(--prism-input-bg);\n }\n .sb-item--active .sb-item-count {\n color: var(--prism-primary);\n background: color-mix(in srgb, var(--prism-primary) 15%, transparent);\n }\n\n .sb-sub {\n display: flex;\n align-items: center;\n gap: 6px;\n width: 100%;\n padding-left: 44px;\n height: 24px;\n font-size: 12px;\n color: var(--prism-text-muted);\n cursor: pointer;\n border: none;\n border-left: 2px solid transparent;\n background: none;\n text-align: left;\n font-family: var(--font-sans);\n }\n .sb-sub:hover { color: var(--prism-text-2); }\n .sb-sub-dot {\n width: 4px;\n height: 4px;\n border-radius: 50%;\n background: currentColor;\n }\n\n :focus-visible {\n outline: 2px solid var(--prism-primary);\n outline-offset: 2px;\n }\n "] }]
|
|
314
428
|
}], null, null); })();
|
|
315
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PrismSidebarComponent, { className: "PrismSidebarComponent", filePath: "app/sidebar/prism-sidebar.component.ts", lineNumber:
|
|
429
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PrismSidebarComponent, { className: "PrismSidebarComponent", filePath: "app/sidebar/prism-sidebar.component.ts", lineNumber: 358 }); })();
|