@countermeasure-platform/web-components 1.3.3-dev.33.1 → 1.3.4-dev.35.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -0
- package/dist/component-D5sRm1fq.js +389 -0
- package/dist/component-D5sRm1fq.js.map +1 -0
- package/dist/components/index.js +27 -27
- package/dist/icons/index.d.ts +12 -0
- package/dist/icons/index.d.ts.map +1 -1
- package/dist/icons/index.js +12 -0
- package/dist/icons/index.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +127 -126
- package/dist/layout/app-shell.d.ts +50 -3
- package/dist/layout/app-shell.d.ts.map +1 -1
- package/dist/layout/app-shell.js +142 -13
- package/dist/layout/app-shell.js.map +1 -1
- package/dist/layout/core-app-chrome.d.ts +81 -0
- package/dist/layout/core-app-chrome.d.ts.map +1 -0
- package/dist/layout/core-app-chrome.js +349 -0
- package/dist/layout/core-app-chrome.js.map +1 -0
- package/dist/layout/index.d.ts +4 -2
- package/dist/layout/index.d.ts.map +1 -1
- package/dist/layout/index.js +88 -87
- package/dist/layout/index.js.map +1 -1
- package/dist/react/primitives/badge.d.ts +1 -1
- package/dist/react/primitives/button.d.ts +2 -2
- package/dist/react/primitives/copy-button.d.ts +1 -1
- package/dist/react/primitives/stat-card.d.ts +1 -1
- package/dist/react/primitives/toggle.d.ts +1 -1
- package/dist/react/sidebar.d.ts +4 -4
- package/dist/react/sidebar.d.ts.map +1 -1
- package/dist/react/sidebar.js +18 -16
- package/dist/react/sidebar.js.map +1 -1
- package/dist/sidebar/component.d.ts +24 -2
- package/dist/sidebar/component.d.ts.map +1 -1
- package/dist/sidebar/enhance.d.ts +8 -0
- package/dist/sidebar/enhance.d.ts.map +1 -1
- package/dist/sidebar/index.d.ts +3 -0
- package/dist/sidebar/index.d.ts.map +1 -1
- package/dist/sidebar/index.js +81 -28
- package/dist/sidebar/index.js.map +1 -1
- package/dist/sidebar/types.d.ts +126 -4
- package/dist/sidebar/types.d.ts.map +1 -1
- package/dist/styles/layout.css +252 -0
- package/dist/styles/sidebar.css +313 -5
- package/package.json +6 -1
- package/src/icons/icons.test.ts +9 -0
- package/src/icons/index.ts +12 -0
- package/src/index.ts +11 -0
- package/src/layout/app-shell.test.ts +204 -0
- package/src/layout/app-shell.ts +362 -3
- package/src/layout/core-app-chrome.test.ts +507 -0
- package/src/layout/core-app-chrome.ts +662 -0
- package/src/layout/index.ts +36 -2
- package/src/react/sidebar.test.tsx +104 -3
- package/src/react/sidebar.tsx +26 -4
- package/src/sidebar/component.test.ts +395 -1
- package/src/sidebar/component.ts +661 -86
- package/src/sidebar/enhance.ts +118 -0
- package/src/sidebar/index.ts +144 -0
- package/src/sidebar/types.ts +143 -4
- package/src/styles/layout.css +252 -0
- package/src/styles/sidebar.css +313 -5
- package/dist/component-Bxhxf21c.js +0 -167
- package/dist/component-Bxhxf21c.js.map +0 -1
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
import { t as e } from "../utils-CSEWuKHo.js";
|
|
2
|
+
import { TopMenuBar as t } from "./app-shell.js";
|
|
3
|
+
import { t as n } from "../component-D5sRm1fq.js";
|
|
4
|
+
//#region src/layout/core-app-chrome.ts
|
|
5
|
+
var r = "[data-core-app-sidebar]", i = "[data-core-app-topbar]", a = "[data-core-app-topbar-action]", o = [
|
|
6
|
+
{
|
|
7
|
+
id: "dashboards",
|
|
8
|
+
label: "Dashboards",
|
|
9
|
+
items: [
|
|
10
|
+
{
|
|
11
|
+
id: "library",
|
|
12
|
+
label: "Library",
|
|
13
|
+
href: "/",
|
|
14
|
+
icon: "library",
|
|
15
|
+
end: !0
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
id: "capacity",
|
|
19
|
+
label: "Capacity",
|
|
20
|
+
href: "/capacity",
|
|
21
|
+
icon: "capacity"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
id: "operational-alerts",
|
|
25
|
+
label: "Operational Alerts",
|
|
26
|
+
href: "/alerts",
|
|
27
|
+
icon: "alerts"
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
id: "threat-library",
|
|
33
|
+
label: "Threat Library",
|
|
34
|
+
items: [
|
|
35
|
+
{
|
|
36
|
+
id: "detections",
|
|
37
|
+
label: "Detections",
|
|
38
|
+
href: "/detections",
|
|
39
|
+
icon: "detections"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
id: "actors",
|
|
43
|
+
label: "Actors",
|
|
44
|
+
href: "/actors",
|
|
45
|
+
icon: "actors"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
id: "library-reports",
|
|
49
|
+
label: "Library Reports",
|
|
50
|
+
href: "/intel",
|
|
51
|
+
icon: "intel-reports"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
id: "mitre",
|
|
55
|
+
label: "MITRE ATT&CK",
|
|
56
|
+
href: "/mitre",
|
|
57
|
+
icon: "mitre"
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
id: "library-operations",
|
|
63
|
+
label: "Library Operations",
|
|
64
|
+
items: [{
|
|
65
|
+
id: "pipeline",
|
|
66
|
+
label: "Pipeline",
|
|
67
|
+
href: "/pipeline",
|
|
68
|
+
icon: "pipeline"
|
|
69
|
+
}]
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
id: "integrations",
|
|
73
|
+
label: "Integrations",
|
|
74
|
+
items: [{
|
|
75
|
+
id: "connectors",
|
|
76
|
+
label: "Connectors",
|
|
77
|
+
href: "/connectors",
|
|
78
|
+
icon: "connectors"
|
|
79
|
+
}, {
|
|
80
|
+
id: "jobs",
|
|
81
|
+
label: "Jobs",
|
|
82
|
+
href: "/jobs",
|
|
83
|
+
icon: "jobs"
|
|
84
|
+
}]
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
id: "platform",
|
|
88
|
+
label: "Platform",
|
|
89
|
+
items: [
|
|
90
|
+
{
|
|
91
|
+
id: "tenants",
|
|
92
|
+
label: "Tenants",
|
|
93
|
+
href: "/tenants",
|
|
94
|
+
icon: "tenants"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
id: "runners",
|
|
98
|
+
label: "Runners",
|
|
99
|
+
href: "/runners",
|
|
100
|
+
icon: "runners"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
id: "topology",
|
|
104
|
+
label: "Topology",
|
|
105
|
+
href: "/topology",
|
|
106
|
+
icon: "topology"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
id: "api-access",
|
|
110
|
+
label: "API Access",
|
|
111
|
+
href: "/api-access",
|
|
112
|
+
icon: "api-access"
|
|
113
|
+
}
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
], s = [
|
|
117
|
+
{
|
|
118
|
+
pattern: /^\/(?:dashboards\/)?capacity(?:\/|$)/,
|
|
119
|
+
label: "Capacity"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
pattern: /^\/(?:dashboards\/)?alerts(?:\/|$)/,
|
|
123
|
+
label: "Operational Alerts"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
pattern: /^\/dashboards\/library(?:\/|$)/,
|
|
127
|
+
label: "Library Dashboard"
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
pattern: /^\/detections(?:\/|$)/,
|
|
131
|
+
label: "Detections"
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
pattern: /^\/actors(?:\/|$)/,
|
|
135
|
+
label: "Actors"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
pattern: /^\/intel(?:\/|$)/,
|
|
139
|
+
label: "Library Reports"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
pattern: /^\/mitre(?:\/|$)/,
|
|
143
|
+
label: "MITRE ATT&CK"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
pattern: /^\/pipeline(?:\/|$)/,
|
|
147
|
+
label: "Pipeline"
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
pattern: /^\/connectors(?:\/|$)/,
|
|
151
|
+
label: "Connectors"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
pattern: /^\/jobs(?:\/|$)/,
|
|
155
|
+
label: "Jobs"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
pattern: /^\/topology(?:\/|$)/,
|
|
159
|
+
label: "Topology"
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
pattern: /^\/tenants(?:\/|$)/,
|
|
163
|
+
label: "Tenants"
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
pattern: /^\/runners(?:\/|$)/,
|
|
167
|
+
label: "Runners"
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
pattern: /^\/api-access(?:\/|$)/,
|
|
171
|
+
label: "API Access"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
pattern: /^\/settings(?:\/|$)/,
|
|
175
|
+
label: "Settings"
|
|
176
|
+
}
|
|
177
|
+
];
|
|
178
|
+
function c(e) {
|
|
179
|
+
let t = e.trim();
|
|
180
|
+
return t === "" || t === "/" ? "" : `/${t.replace(/^\/+|\/+$/g, "")}`;
|
|
181
|
+
}
|
|
182
|
+
function l(e, t) {
|
|
183
|
+
let n = c(e);
|
|
184
|
+
return t === "/" || t === "" ? n || "/" : `${n}/${t.replace(/^\/+/, "")}`;
|
|
185
|
+
}
|
|
186
|
+
function u(e, t) {
|
|
187
|
+
let n = c(t);
|
|
188
|
+
return n === "" ? e || "/" : e === n ? "/" : e.startsWith(`${n}/`) ? e.slice(n.length) || "/" : e || "/";
|
|
189
|
+
}
|
|
190
|
+
function d(e) {
|
|
191
|
+
return e.map((e) => ({
|
|
192
|
+
...e,
|
|
193
|
+
items: e.items.map((e) => ({ ...e }))
|
|
194
|
+
}));
|
|
195
|
+
}
|
|
196
|
+
function f(e = "/app") {
|
|
197
|
+
return o.map((t) => ({
|
|
198
|
+
id: t.id,
|
|
199
|
+
label: t.label,
|
|
200
|
+
items: t.items.map((t) => {
|
|
201
|
+
let n = {
|
|
202
|
+
id: t.id,
|
|
203
|
+
label: t.label,
|
|
204
|
+
href: l(e, t.href),
|
|
205
|
+
icon: t.icon,
|
|
206
|
+
tooltip: t.label,
|
|
207
|
+
activeMatch: t.end === !0 ? "exact" : "prefix"
|
|
208
|
+
};
|
|
209
|
+
return t.end !== void 0 && (n.end = t.end), n;
|
|
210
|
+
})
|
|
211
|
+
}));
|
|
212
|
+
}
|
|
213
|
+
function p(e, t = "/app") {
|
|
214
|
+
let n = u(e, t);
|
|
215
|
+
return n === "/" || n === "" ? "Platform Overview" : s.find((e) => e.pattern.test(n))?.label ?? "Threat Library";
|
|
216
|
+
}
|
|
217
|
+
function m(e = {}) {
|
|
218
|
+
let { basePath: t = "/app", sections: n, variant: r = "cm", brand: i, scope: a, beforeNav: o, afterNav: s, collapsible: c = !0, collapseButtonVisible: u = !0, user: p, footerActions: m, iconSet: h, collapsed: g, activeItemId: _, pathname: v, storageKey: y = "cm-sidebar-collapsed", persistCollapsed: b, mobileBreakpoint: x, mobileBackdrop: S = !0, closeOnNavigate: C = !0, open: w, onNavigate: T, onCollapse: E, onOpenChange: D } = e, O = i ?? {
|
|
219
|
+
label: "CounterMeasure",
|
|
220
|
+
href: l(t, "/")
|
|
221
|
+
}, k = {
|
|
222
|
+
variant: r,
|
|
223
|
+
sections: n === void 0 ? f(t) : d(n),
|
|
224
|
+
brand: O,
|
|
225
|
+
collapsible: c,
|
|
226
|
+
collapseButtonVisible: u,
|
|
227
|
+
storageKey: y,
|
|
228
|
+
mobileBackdrop: S,
|
|
229
|
+
closeOnNavigate: C
|
|
230
|
+
};
|
|
231
|
+
return a !== void 0 && (k.scope = a), o !== void 0 && (k.beforeNav = o), s !== void 0 && (k.afterNav = s), p !== void 0 && (k.user = p), m !== void 0 && (k.footerActions = m), h !== void 0 && (k.iconSet = h), g !== void 0 && (k.collapsed = g), _ !== void 0 && (k.activeItemId = _), v !== void 0 && (k.pathname = v), b !== void 0 && (k.persistCollapsed = b), x !== void 0 && (k.mobileBreakpoint = x), w !== void 0 && (k.open = w), T !== void 0 && (k.onNavigate = T), E !== void 0 && (k.onCollapse = E), D !== void 0 && (k.onOpenChange = D), k;
|
|
232
|
+
}
|
|
233
|
+
function h(e = {}) {
|
|
234
|
+
let { includeSearchAction: t = !0, includeFeedbackAction: n = !0, includeHelpAction: r = !0 } = e, i = [];
|
|
235
|
+
return t && i.push({
|
|
236
|
+
id: "search",
|
|
237
|
+
label: "Find...",
|
|
238
|
+
icon: "search",
|
|
239
|
+
showLabel: !0,
|
|
240
|
+
className: "cmm-topbar__action--search",
|
|
241
|
+
attributes: { "data-app-search-trigger": !0 }
|
|
242
|
+
}), n && i.push({
|
|
243
|
+
id: "feedback",
|
|
244
|
+
label: "Feedback",
|
|
245
|
+
showLabel: !0,
|
|
246
|
+
attributes: { "data-feedback-toggle": !0 }
|
|
247
|
+
}), r && i.push({
|
|
248
|
+
id: "help",
|
|
249
|
+
label: "Help",
|
|
250
|
+
icon: "help",
|
|
251
|
+
attributes: { "data-help-toggle": !0 }
|
|
252
|
+
}), i;
|
|
253
|
+
}
|
|
254
|
+
function g(e = {}) {
|
|
255
|
+
let { basePath: t = "/app", pathname: n = typeof window > "u" ? "/" : window.location.pathname, product: r = "CounterMeasure Core", current: i = p(n, t), actions: a, beforeActions: o, afterActions: s, user: c, iconSet: l, className: u, breadcrumbs: d, container: f, includeSearchAction: m, includeFeedbackAction: g, includeHelpAction: _ } = e, v = {};
|
|
256
|
+
m !== void 0 && (v.includeSearchAction = m), g !== void 0 && (v.includeFeedbackAction = g), _ !== void 0 && (v.includeHelpAction = _);
|
|
257
|
+
let y = {
|
|
258
|
+
product: r,
|
|
259
|
+
current: i,
|
|
260
|
+
actions: a ?? h(v)
|
|
261
|
+
};
|
|
262
|
+
return f !== void 0 && (y.container = f), d !== void 0 && (y.breadcrumbs = d), o !== void 0 && (y.beforeActions = o), s !== void 0 && (y.afterActions = s), c !== void 0 && (y.user = c), l !== void 0 && (y.iconSet = l), u !== void 0 && (y.className = u), y;
|
|
263
|
+
}
|
|
264
|
+
function _(e = {}) {
|
|
265
|
+
let { basePath: t = "/app", pathname: n, scope: r, sidebarUser: i, sidebarFooterActions: a, topbarUser: o, topbarActions: s } = e, c = { basePath: t };
|
|
266
|
+
r !== void 0 && (c.scope = r), i !== void 0 && (c.user = i), a !== void 0 && (c.footerActions = a), n !== void 0 && (c.pathname = n);
|
|
267
|
+
let l = { basePath: t };
|
|
268
|
+
return n !== void 0 && (l.pathname = n), o !== void 0 && (l.user = o), s !== void 0 && (l.actions = s), {
|
|
269
|
+
sidebar: m(c),
|
|
270
|
+
topbar: g(l)
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
function v(e, t) {
|
|
274
|
+
t !== !1 && e.replaceChildren();
|
|
275
|
+
}
|
|
276
|
+
function y(e) {
|
|
277
|
+
return e.preserveTopbarActions === !1 ? [] : Array.from(e.container.querySelectorAll(e.selector ?? a));
|
|
278
|
+
}
|
|
279
|
+
function b(e, t) {
|
|
280
|
+
return t.length === 0 ? e : e === void 0 ? t : Array.isArray(e) ? [...e, ...t] : [e, ...t];
|
|
281
|
+
}
|
|
282
|
+
function x(e, t) {
|
|
283
|
+
return e.some((e) => e.hasAttribute(t));
|
|
284
|
+
}
|
|
285
|
+
function S(e, t) {
|
|
286
|
+
e.actions !== void 0 || t.length === 0 || (e.includeSearchAction === void 0 && x(t, "data-app-search-trigger") && (e.includeSearchAction = !1), e.includeFeedbackAction === void 0 && x(t, "data-feedback-toggle") && (e.includeFeedbackAction = !1), e.includeHelpAction === void 0 && x(t, "data-help-toggle") && (e.includeHelpAction = !1));
|
|
287
|
+
}
|
|
288
|
+
function C(e) {
|
|
289
|
+
let t = e.sidebar?.basePath ?? e.basePath ?? "/app", n = {
|
|
290
|
+
...e.sidebar,
|
|
291
|
+
basePath: t
|
|
292
|
+
};
|
|
293
|
+
return e.scope !== void 0 && (n.scope = e.scope), e.sidebarUser !== void 0 && (n.user = e.sidebarUser), e.sidebarFooterActions !== void 0 && (n.footerActions = e.sidebarFooterActions), e.pathname !== void 0 && n.pathname === void 0 && (n.pathname = e.pathname), n;
|
|
294
|
+
}
|
|
295
|
+
function w(e, t, n) {
|
|
296
|
+
let r = e.topbar?.basePath ?? e.basePath ?? "/app", i = {
|
|
297
|
+
...e.topbar,
|
|
298
|
+
basePath: r,
|
|
299
|
+
container: t
|
|
300
|
+
}, a = b(e.topbar?.afterActions, n);
|
|
301
|
+
return e.pathname !== void 0 && (i.pathname = e.pathname), e.topbarUser !== void 0 && (i.user = e.topbarUser), e.topbarActions !== void 0 && (i.actions = e.topbarActions), a !== void 0 && (i.afterActions = a), S(i, n), i;
|
|
302
|
+
}
|
|
303
|
+
function T(r) {
|
|
304
|
+
let i = e(r.sidebarContainer);
|
|
305
|
+
v(i, r.clearContainers);
|
|
306
|
+
let a = new n({
|
|
307
|
+
container: i,
|
|
308
|
+
...m(C(r))
|
|
309
|
+
}), o = r.topbarContainer ?? r.topbar?.container, s = o === void 0 ? void 0 : e(o), c;
|
|
310
|
+
if (s !== void 0) {
|
|
311
|
+
let e = y({
|
|
312
|
+
container: s,
|
|
313
|
+
preserveTopbarActions: r.preserveTopbarActions,
|
|
314
|
+
selector: r.topbarActionSelector
|
|
315
|
+
});
|
|
316
|
+
v(s, r.clearContainers), c = new t(g(w(r, s, e)));
|
|
317
|
+
}
|
|
318
|
+
let l = {
|
|
319
|
+
sidebar: a,
|
|
320
|
+
destroy: () => {
|
|
321
|
+
c?.destroy(), a.destroy();
|
|
322
|
+
}
|
|
323
|
+
};
|
|
324
|
+
return c !== void 0 && (l.topbar = c), l;
|
|
325
|
+
}
|
|
326
|
+
function E(e, t) {
|
|
327
|
+
let n = e?.dataset[t];
|
|
328
|
+
return n === void 0 || n.length === 0 ? void 0 : n;
|
|
329
|
+
}
|
|
330
|
+
function D(e, t, n) {
|
|
331
|
+
let r = e.topbar?.product ?? E(n ?? void 0, "product") ?? E(t, "product"), i = e.topbar?.current ?? E(n ?? void 0, "current") ?? E(t, "current");
|
|
332
|
+
if (e.topbar === void 0 && r === void 0 && i === void 0) return;
|
|
333
|
+
let a = { ...e.topbar ?? {} };
|
|
334
|
+
return r !== void 0 && (a.product = r), i !== void 0 && (a.current = i), a;
|
|
335
|
+
}
|
|
336
|
+
function O(e = {}) {
|
|
337
|
+
let t = e.root ?? document, n = t.querySelector(e.sidebarSelector ?? r);
|
|
338
|
+
if (n === null) return null;
|
|
339
|
+
let a = t.querySelector(e.topbarSelector ?? i), o = e.basePath ?? e.sidebar?.basePath ?? e.topbar?.basePath ?? E(n, "basePath") ?? E(a ?? void 0, "basePath") ?? "/app", s = e.pathname ?? E(n, "pathname") ?? E(a ?? void 0, "pathname"), c = {
|
|
340
|
+
...e,
|
|
341
|
+
sidebarContainer: n,
|
|
342
|
+
basePath: o
|
|
343
|
+
}, l = D(e, n, a);
|
|
344
|
+
return l !== void 0 && (c.topbar = l), a !== null && (c.topbarContainer = a), s !== void 0 && (c.pathname = s), T(c);
|
|
345
|
+
}
|
|
346
|
+
//#endregion
|
|
347
|
+
export { s as CORE_APP_ROUTE_LABELS, _ as createCoreAppChromePreset, m as createCoreAppSidebarConfig, f as createCoreAppSidebarSections, h as createCoreAppTopbarActions, g as createCoreAppTopbarConfig, p as getCoreAppRouteLabel, T as mountCoreAppChrome, O as mountCoreAppChromeFromDom };
|
|
348
|
+
|
|
349
|
+
//# sourceMappingURL=core-app-chrome.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core-app-chrome.js","names":[],"sources":["../../src/layout/core-app-chrome.ts"],"sourcesContent":["import type {\n SidebarBrandConfig,\n SidebarComponentConfig,\n SidebarFooterAction,\n SidebarNavItem,\n SidebarScopeConfig,\n SidebarSection,\n SidebarUser,\n} from '../sidebar/types'\nimport { SidebarComponent } from '../sidebar/component'\nimport { resolveContainer } from '../primitives/utils'\nimport {\n TopMenuBar,\n type TopMenuBarActionInput,\n type TopMenuBarConfig,\n type TopMenuBarUser,\n} from './app-shell'\n\nexport interface CoreAppRouteLabel {\n pattern: RegExp\n label: string\n}\n\nexport interface CoreAppSidebarPresetOptions extends Omit<\n SidebarComponentConfig,\n 'container' | 'sections'\n> {\n basePath?: string\n sections?: SidebarSection[]\n}\n\nexport interface CoreAppTopbarPresetOptions extends Omit<\n TopMenuBarConfig,\n 'actions' | 'current' | 'product'\n> {\n basePath?: string\n pathname?: string\n product?: string\n current?: string\n actions?: TopMenuBarActionInput[]\n includeSearchAction?: boolean\n includeFeedbackAction?: boolean\n includeHelpAction?: boolean\n}\n\nexport interface CoreAppChromePreset {\n sidebar: Omit<SidebarComponentConfig, 'container'>\n topbar: TopMenuBarConfig\n}\n\nexport interface CoreAppChromePresetOptions {\n basePath?: string\n pathname?: string\n scope?: SidebarScopeConfig\n sidebarUser?: SidebarUser\n sidebarFooterActions?: SidebarFooterAction[]\n topbarUser?: TopMenuBarUser\n topbarActions?: TopMenuBarActionInput[]\n}\n\nexport interface CoreAppChromeMountOptions extends CoreAppChromePresetOptions {\n sidebarContainer: HTMLElement | string\n topbarContainer?: HTMLElement | string\n sidebar?: CoreAppSidebarPresetOptions\n topbar?: CoreAppTopbarPresetOptions\n /**\n * Move explicitly marked server-rendered topbar action nodes into the new topbar.\n * Useful for native hooks that are initialized outside the chrome mount.\n * @default true\n */\n preserveTopbarActions?: boolean\n /**\n * Selector for preserved action nodes inside the topbar container.\n * @default '[data-core-app-topbar-action]'\n */\n topbarActionSelector?: string\n /**\n * Remove existing placeholder/server-rendered children before mounting.\n * @default true\n */\n clearContainers?: boolean\n}\n\nexport interface CoreAppChromeDomMountOptions extends CoreAppChromePresetOptions {\n root?: ParentNode\n sidebarSelector?: string\n topbarSelector?: string\n sidebar?: CoreAppSidebarPresetOptions\n topbar?: CoreAppTopbarPresetOptions\n preserveTopbarActions?: boolean\n topbarActionSelector?: string\n clearContainers?: boolean\n}\n\nexport interface CoreAppChromeMount {\n sidebar: SidebarComponent\n topbar?: TopMenuBar\n destroy: () => void\n}\n\ninterface CoreAppNavItemBlueprint {\n id: string\n label: string\n href: string\n icon: string\n end?: boolean\n}\n\ninterface CoreAppNavSectionBlueprint {\n id: string\n label: string\n items: CoreAppNavItemBlueprint[]\n}\n\nconst DEFAULT_DOM_SIDEBAR_SELECTOR = '[data-core-app-sidebar]'\nconst DEFAULT_DOM_TOPBAR_SELECTOR = '[data-core-app-topbar]'\nconst DEFAULT_TOPBAR_ACTION_SELECTOR = '[data-core-app-topbar-action]'\n\nconst CORE_APP_NAV_SECTIONS: CoreAppNavSectionBlueprint[] = [\n {\n id: 'dashboards',\n label: 'Dashboards',\n items: [\n { id: 'library', label: 'Library', href: '/', icon: 'library', end: true },\n { id: 'capacity', label: 'Capacity', href: '/capacity', icon: 'capacity' },\n { id: 'operational-alerts', label: 'Operational Alerts', href: '/alerts', icon: 'alerts' },\n ],\n },\n {\n id: 'threat-library',\n label: 'Threat Library',\n items: [\n { id: 'detections', label: 'Detections', href: '/detections', icon: 'detections' },\n { id: 'actors', label: 'Actors', href: '/actors', icon: 'actors' },\n { id: 'library-reports', label: 'Library Reports', href: '/intel', icon: 'intel-reports' },\n { id: 'mitre', label: 'MITRE ATT&CK', href: '/mitre', icon: 'mitre' },\n ],\n },\n {\n id: 'library-operations',\n label: 'Library Operations',\n items: [{ id: 'pipeline', label: 'Pipeline', href: '/pipeline', icon: 'pipeline' }],\n },\n {\n id: 'integrations',\n label: 'Integrations',\n items: [\n { id: 'connectors', label: 'Connectors', href: '/connectors', icon: 'connectors' },\n { id: 'jobs', label: 'Jobs', href: '/jobs', icon: 'jobs' },\n ],\n },\n {\n id: 'platform',\n label: 'Platform',\n items: [\n { id: 'tenants', label: 'Tenants', href: '/tenants', icon: 'tenants' },\n { id: 'runners', label: 'Runners', href: '/runners', icon: 'runners' },\n { id: 'topology', label: 'Topology', href: '/topology', icon: 'topology' },\n { id: 'api-access', label: 'API Access', href: '/api-access', icon: 'api-access' },\n ],\n },\n]\n\nexport const CORE_APP_ROUTE_LABELS: CoreAppRouteLabel[] = [\n { pattern: /^\\/(?:dashboards\\/)?capacity(?:\\/|$)/, label: 'Capacity' },\n { pattern: /^\\/(?:dashboards\\/)?alerts(?:\\/|$)/, label: 'Operational Alerts' },\n { pattern: /^\\/dashboards\\/library(?:\\/|$)/, label: 'Library Dashboard' },\n { pattern: /^\\/detections(?:\\/|$)/, label: 'Detections' },\n { pattern: /^\\/actors(?:\\/|$)/, label: 'Actors' },\n { pattern: /^\\/intel(?:\\/|$)/, label: 'Library Reports' },\n { pattern: /^\\/mitre(?:\\/|$)/, label: 'MITRE ATT&CK' },\n { pattern: /^\\/pipeline(?:\\/|$)/, label: 'Pipeline' },\n { pattern: /^\\/connectors(?:\\/|$)/, label: 'Connectors' },\n { pattern: /^\\/jobs(?:\\/|$)/, label: 'Jobs' },\n { pattern: /^\\/topology(?:\\/|$)/, label: 'Topology' },\n { pattern: /^\\/tenants(?:\\/|$)/, label: 'Tenants' },\n { pattern: /^\\/runners(?:\\/|$)/, label: 'Runners' },\n { pattern: /^\\/api-access(?:\\/|$)/, label: 'API Access' },\n { pattern: /^\\/settings(?:\\/|$)/, label: 'Settings' },\n]\n\nfunction normalizeBasePath(basePath: string): string {\n const trimmed = basePath.trim()\n if (trimmed === '' || trimmed === '/') {\n return ''\n }\n return `/${trimmed.replace(/^\\/+|\\/+$/g, '')}`\n}\n\nfunction joinBasePath(basePath: string, href: string): string {\n const normalizedBase = normalizeBasePath(basePath)\n if (href === '/' || href === '') {\n return normalizedBase || '/'\n }\n return `${normalizedBase}/${href.replace(/^\\/+/, '')}`\n}\n\nfunction stripBasePath(pathname: string, basePath: string): string {\n const normalizedBase = normalizeBasePath(basePath)\n if (normalizedBase === '') {\n return pathname || '/'\n }\n\n if (pathname === normalizedBase) {\n return '/'\n }\n\n if (pathname.startsWith(`${normalizedBase}/`)) {\n return pathname.slice(normalizedBase.length) || '/'\n }\n\n return pathname || '/'\n}\n\nfunction cloneSections(sections: SidebarSection[]): SidebarSection[] {\n return sections.map(section => ({\n ...section,\n items: section.items.map(item => ({ ...item })),\n }))\n}\n\nexport function createCoreAppSidebarSections(basePath = '/app'): SidebarSection[] {\n return CORE_APP_NAV_SECTIONS.map(section => ({\n id: section.id,\n label: section.label,\n items: section.items.map(item => {\n const navItem: SidebarNavItem = {\n id: item.id,\n label: item.label,\n href: joinBasePath(basePath, item.href),\n icon: item.icon,\n tooltip: item.label,\n activeMatch: item.end === true ? 'exact' : 'prefix',\n }\n if (item.end !== undefined) {\n navItem.end = item.end\n }\n return navItem\n }),\n }))\n}\n\nexport function getCoreAppRouteLabel(pathname: string, basePath = '/app'): string {\n const relativePathname = stripBasePath(pathname, basePath)\n if (relativePathname === '/' || relativePathname === '') {\n return 'Platform Overview'\n }\n\n return (\n CORE_APP_ROUTE_LABELS.find(route => route.pattern.test(relativePathname))?.label ??\n 'Threat Library'\n )\n}\n\nexport function createCoreAppSidebarConfig(\n options: CoreAppSidebarPresetOptions = {}\n): Omit<SidebarComponentConfig, 'container'> {\n const {\n basePath = '/app',\n sections,\n variant = 'cm',\n brand,\n scope,\n beforeNav,\n afterNav,\n collapsible = true,\n collapseButtonVisible = true,\n user,\n footerActions,\n iconSet,\n collapsed,\n activeItemId,\n pathname,\n storageKey = 'cm-sidebar-collapsed',\n persistCollapsed,\n mobileBreakpoint,\n mobileBackdrop = true,\n closeOnNavigate = true,\n open,\n onNavigate,\n onCollapse,\n onOpenChange,\n } = options\n\n const resolvedBrand: SidebarBrandConfig = brand ?? {\n label: 'CounterMeasure',\n href: joinBasePath(basePath, '/'),\n }\n\n const config: Omit<SidebarComponentConfig, 'container'> = {\n variant,\n sections:\n sections === undefined ? createCoreAppSidebarSections(basePath) : cloneSections(sections),\n brand: resolvedBrand,\n collapsible,\n collapseButtonVisible,\n storageKey,\n mobileBackdrop,\n closeOnNavigate,\n }\n\n if (scope !== undefined) config.scope = scope\n if (beforeNav !== undefined) config.beforeNav = beforeNav\n if (afterNav !== undefined) config.afterNav = afterNav\n if (user !== undefined) config.user = user\n if (footerActions !== undefined) config.footerActions = footerActions\n if (iconSet !== undefined) config.iconSet = iconSet\n if (collapsed !== undefined) config.collapsed = collapsed\n if (activeItemId !== undefined) config.activeItemId = activeItemId\n if (pathname !== undefined) config.pathname = pathname\n if (persistCollapsed !== undefined) config.persistCollapsed = persistCollapsed\n if (mobileBreakpoint !== undefined) config.mobileBreakpoint = mobileBreakpoint\n if (open !== undefined) config.open = open\n if (onNavigate !== undefined) config.onNavigate = onNavigate\n if (onCollapse !== undefined) config.onCollapse = onCollapse\n if (onOpenChange !== undefined) config.onOpenChange = onOpenChange\n\n return config\n}\n\nexport function createCoreAppTopbarActions(\n options: Pick<\n CoreAppTopbarPresetOptions,\n 'includeSearchAction' | 'includeFeedbackAction' | 'includeHelpAction'\n > = {}\n): TopMenuBarActionInput[] {\n const {\n includeSearchAction = true,\n includeFeedbackAction = true,\n includeHelpAction = true,\n } = options\n const actions: TopMenuBarActionInput[] = []\n\n if (includeSearchAction) {\n actions.push({\n id: 'search',\n label: 'Find...',\n icon: 'search',\n showLabel: true,\n className: 'cmm-topbar__action--search',\n attributes: { 'data-app-search-trigger': true },\n })\n }\n\n if (includeFeedbackAction) {\n actions.push({\n id: 'feedback',\n label: 'Feedback',\n showLabel: true,\n attributes: { 'data-feedback-toggle': true },\n })\n }\n\n if (includeHelpAction) {\n actions.push({\n id: 'help',\n label: 'Help',\n icon: 'help',\n attributes: { 'data-help-toggle': true },\n })\n }\n\n return actions\n}\n\nexport function createCoreAppTopbarConfig(\n options: CoreAppTopbarPresetOptions = {}\n): TopMenuBarConfig {\n const {\n basePath = '/app',\n pathname = typeof window === 'undefined' ? '/' : window.location.pathname,\n product = 'CounterMeasure Core',\n current = getCoreAppRouteLabel(pathname, basePath),\n actions,\n beforeActions,\n afterActions,\n user,\n iconSet,\n className,\n breadcrumbs,\n container,\n includeSearchAction,\n includeFeedbackAction,\n includeHelpAction,\n } = options\n\n const actionOptions: Pick<\n CoreAppTopbarPresetOptions,\n 'includeSearchAction' | 'includeFeedbackAction' | 'includeHelpAction'\n > = {}\n if (includeSearchAction !== undefined) actionOptions.includeSearchAction = includeSearchAction\n if (includeFeedbackAction !== undefined)\n actionOptions.includeFeedbackAction = includeFeedbackAction\n if (includeHelpAction !== undefined) actionOptions.includeHelpAction = includeHelpAction\n\n const config: TopMenuBarConfig = {\n product,\n current,\n actions: actions ?? createCoreAppTopbarActions(actionOptions),\n }\n\n if (container !== undefined) config.container = container\n if (breadcrumbs !== undefined) config.breadcrumbs = breadcrumbs\n if (beforeActions !== undefined) config.beforeActions = beforeActions\n if (afterActions !== undefined) config.afterActions = afterActions\n if (user !== undefined) config.user = user\n if (iconSet !== undefined) config.iconSet = iconSet\n if (className !== undefined) config.className = className\n\n return config\n}\n\nexport function createCoreAppChromePreset(\n options: CoreAppChromePresetOptions = {}\n): CoreAppChromePreset {\n const {\n basePath = '/app',\n pathname,\n scope,\n sidebarUser,\n sidebarFooterActions,\n topbarUser,\n topbarActions,\n } = options\n\n const sidebarOptions: CoreAppSidebarPresetOptions = { basePath }\n if (scope !== undefined) sidebarOptions.scope = scope\n if (sidebarUser !== undefined) sidebarOptions.user = sidebarUser\n if (sidebarFooterActions !== undefined) sidebarOptions.footerActions = sidebarFooterActions\n if (pathname !== undefined) sidebarOptions.pathname = pathname\n\n const topbarOptions: CoreAppTopbarPresetOptions = { basePath }\n if (pathname !== undefined) topbarOptions.pathname = pathname\n if (topbarUser !== undefined) topbarOptions.user = topbarUser\n if (topbarActions !== undefined) topbarOptions.actions = topbarActions\n\n return {\n sidebar: createCoreAppSidebarConfig(sidebarOptions),\n topbar: createCoreAppTopbarConfig(topbarOptions),\n }\n}\n\nfunction clearContainer(container: HTMLElement, clearContainers: boolean | undefined): void {\n if (clearContainers !== false) {\n container.replaceChildren()\n }\n}\n\nfunction collectTopbarActionNodes(options: {\n container: HTMLElement\n preserveTopbarActions: boolean | undefined\n selector: string | undefined\n}): HTMLElement[] {\n if (options.preserveTopbarActions === false) {\n return []\n }\n\n return Array.from(\n options.container.querySelectorAll<HTMLElement>(\n options.selector ?? DEFAULT_TOPBAR_ACTION_SELECTOR\n )\n )\n}\n\nfunction mergeElements(\n existing: HTMLElement | HTMLElement[] | undefined,\n additions: HTMLElement[]\n): HTMLElement | HTMLElement[] | undefined {\n if (additions.length === 0) {\n return existing\n }\n\n if (existing === undefined) {\n return additions\n }\n\n return Array.isArray(existing) ? [...existing, ...additions] : [existing, ...additions]\n}\n\nfunction hasPreservedActionAttribute(actions: HTMLElement[], attribute: string): boolean {\n return actions.some(action => action.hasAttribute(attribute))\n}\n\nfunction dedupeDefaultActionsForPreservedNodes(\n options: CoreAppTopbarPresetOptions,\n preservedActions: HTMLElement[]\n): void {\n if (options.actions !== undefined || preservedActions.length === 0) {\n return\n }\n\n if (\n options.includeSearchAction === undefined &&\n hasPreservedActionAttribute(preservedActions, 'data-app-search-trigger')\n ) {\n options.includeSearchAction = false\n }\n\n if (\n options.includeFeedbackAction === undefined &&\n hasPreservedActionAttribute(preservedActions, 'data-feedback-toggle')\n ) {\n options.includeFeedbackAction = false\n }\n\n if (\n options.includeHelpAction === undefined &&\n hasPreservedActionAttribute(preservedActions, 'data-help-toggle')\n ) {\n options.includeHelpAction = false\n }\n}\n\nfunction buildSidebarMountOptions(options: CoreAppChromeMountOptions): CoreAppSidebarPresetOptions {\n const basePath = options.sidebar?.basePath ?? options.basePath ?? '/app'\n const sidebarOptions: CoreAppSidebarPresetOptions = {\n ...options.sidebar,\n basePath,\n }\n\n if (options.scope !== undefined) sidebarOptions.scope = options.scope\n if (options.sidebarUser !== undefined) sidebarOptions.user = options.sidebarUser\n if (options.sidebarFooterActions !== undefined)\n sidebarOptions.footerActions = options.sidebarFooterActions\n if (options.pathname !== undefined && sidebarOptions.pathname === undefined) {\n sidebarOptions.pathname = options.pathname\n }\n\n return sidebarOptions\n}\n\nfunction buildTopbarMountOptions(\n options: CoreAppChromeMountOptions,\n topbarContainer: HTMLElement,\n preservedActions: HTMLElement[]\n): CoreAppTopbarPresetOptions {\n const basePath = options.topbar?.basePath ?? options.basePath ?? '/app'\n const topbarOptions: CoreAppTopbarPresetOptions = {\n ...options.topbar,\n basePath,\n container: topbarContainer,\n }\n const afterActions = mergeElements(options.topbar?.afterActions, preservedActions)\n\n if (options.pathname !== undefined) topbarOptions.pathname = options.pathname\n if (options.topbarUser !== undefined) topbarOptions.user = options.topbarUser\n if (options.topbarActions !== undefined) topbarOptions.actions = options.topbarActions\n if (afterActions !== undefined) topbarOptions.afterActions = afterActions\n dedupeDefaultActionsForPreservedNodes(topbarOptions, preservedActions)\n\n return topbarOptions\n}\n\nexport function mountCoreAppChrome(options: CoreAppChromeMountOptions): CoreAppChromeMount {\n const sidebarContainer = resolveContainer(options.sidebarContainer)\n clearContainer(sidebarContainer, options.clearContainers)\n\n const sidebar = new SidebarComponent({\n container: sidebarContainer,\n ...createCoreAppSidebarConfig(buildSidebarMountOptions(options)),\n })\n\n const topbarContainerOption = options.topbarContainer ?? options.topbar?.container\n const topbarContainer =\n topbarContainerOption === undefined ? undefined : resolveContainer(topbarContainerOption)\n let topbar: TopMenuBar | undefined\n\n if (topbarContainer !== undefined) {\n const preservedActions = collectTopbarActionNodes({\n container: topbarContainer,\n preserveTopbarActions: options.preserveTopbarActions,\n selector: options.topbarActionSelector,\n })\n clearContainer(topbarContainer, options.clearContainers)\n topbar = new TopMenuBar(\n createCoreAppTopbarConfig(buildTopbarMountOptions(options, topbarContainer, preservedActions))\n )\n }\n\n const mounted: CoreAppChromeMount = {\n sidebar,\n destroy: () => {\n topbar?.destroy()\n sidebar.destroy()\n },\n }\n\n if (topbar !== undefined) {\n mounted.topbar = topbar\n }\n\n return mounted\n}\n\nfunction readDataValue(element: HTMLElement | undefined, key: string): string | undefined {\n const value = element?.dataset[key]\n return value === undefined || value.length === 0 ? undefined : value\n}\n\nfunction buildDeclarativeTopbarOptions(\n options: CoreAppChromeDomMountOptions,\n sidebarContainer: HTMLElement,\n topbarContainer: HTMLElement | null\n): CoreAppTopbarPresetOptions | undefined {\n const product =\n options.topbar?.product ??\n readDataValue(topbarContainer ?? undefined, 'product') ??\n readDataValue(sidebarContainer, 'product')\n const current =\n options.topbar?.current ??\n readDataValue(topbarContainer ?? undefined, 'current') ??\n readDataValue(sidebarContainer, 'current')\n\n if (options.topbar === undefined && product === undefined && current === undefined) {\n return undefined\n }\n\n const topbar: CoreAppTopbarPresetOptions = { ...(options.topbar ?? {}) }\n if (product !== undefined) topbar.product = product\n if (current !== undefined) topbar.current = current\n return topbar\n}\n\nexport function mountCoreAppChromeFromDom(\n options: CoreAppChromeDomMountOptions = {}\n): CoreAppChromeMount | null {\n const root = options.root ?? document\n const sidebarContainer = root.querySelector<HTMLElement>(\n options.sidebarSelector ?? DEFAULT_DOM_SIDEBAR_SELECTOR\n )\n\n if (sidebarContainer === null) {\n return null\n }\n\n const topbarContainer = root.querySelector<HTMLElement>(\n options.topbarSelector ?? DEFAULT_DOM_TOPBAR_SELECTOR\n )\n const basePath =\n options.basePath ??\n options.sidebar?.basePath ??\n options.topbar?.basePath ??\n readDataValue(sidebarContainer, 'basePath') ??\n readDataValue(topbarContainer ?? undefined, 'basePath') ??\n '/app'\n const pathname =\n options.pathname ??\n readDataValue(sidebarContainer, 'pathname') ??\n readDataValue(topbarContainer ?? undefined, 'pathname')\n\n const mountOptions: CoreAppChromeMountOptions = {\n ...options,\n sidebarContainer,\n basePath,\n }\n const topbar = buildDeclarativeTopbarOptions(options, sidebarContainer, topbarContainer)\n if (topbar !== undefined) mountOptions.topbar = topbar\n if (topbarContainer !== null) mountOptions.topbarContainer = topbarContainer\n if (pathname !== undefined) mountOptions.pathname = pathname\n\n return mountCoreAppChrome(mountOptions)\n}\n"],"mappings":";;;;AAkHA,IAAM,IAA+B,2BAC/B,IAA8B,0BAC9B,IAAiC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AAQ,mBAAmB,CAC7B;CAEA,IAAI,MAAqB,MACvB,OAAO;CAGT,IAAM,IAAkB,EAAK,cAC3B,EAAQ,kBAAkB,CAC5B,GACM,IACJ,EAAQ,YACR,EAAQ,SAAS,YACjB,EAAQ,QAAQ,YAChB,EAAc,GAAkB,UAAU,KAC1C,EAAc,KAAmB,KAAA,GAAW,UAAU,KACtD,QACI,IACJ,EAAQ,YACR,EAAc,GAAkB,UAAU,KAC1C,EAAc,KAAmB,KAAA,GAAW,UAAU,GAElD,IAA0C;EAC9C,GAAG;EACH;EACA;CACF,GACM,IAAS,EAA8B,GAAS,GAAkB,CAAe;CAKvF,OAJI,MAAW,KAAA,MAAW,EAAa,SAAS,IAC5C,MAAoB,SAAM,EAAa,kBAAkB,IACzD,MAAa,KAAA,MAAW,EAAa,WAAW,IAE7C,EAAmB,CAAY;AACxC"}
|
package/dist/layout/index.d.ts
CHANGED
|
@@ -4,8 +4,10 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Shared layout utilities for sidebar, user menu, collapsibles, and sheets.
|
|
6
6
|
*/
|
|
7
|
-
export { AppShell, createAppShell } from './app-shell';
|
|
8
|
-
export type { AppShellConfig } from './app-shell';
|
|
7
|
+
export { AppShell, TopMenuBar, createAppShell, createProductShell, createTopMenuBar, } from './app-shell';
|
|
8
|
+
export type { AppShellConfig, TopMenuBarAction, TopMenuBarActionInput, TopMenuBarBreadcrumb, TopMenuBarConfig, TopMenuBarUser, } from './app-shell';
|
|
9
|
+
export { CORE_APP_ROUTE_LABELS, createCoreAppChromePreset, createCoreAppSidebarConfig, createCoreAppSidebarSections, createCoreAppTopbarActions, createCoreAppTopbarConfig, getCoreAppRouteLabel, mountCoreAppChrome, mountCoreAppChromeFromDom, } from './core-app-chrome';
|
|
10
|
+
export type { CoreAppChromePreset, CoreAppChromeDomMountOptions, CoreAppChromeMount, CoreAppChromeMountOptions, CoreAppChromePresetOptions, CoreAppRouteLabel, CoreAppSidebarPresetOptions, CoreAppTopbarPresetOptions, } from './core-app-chrome';
|
|
9
11
|
export { PageHeader, createPageHeader } from './page-header';
|
|
10
12
|
export type { PageHeaderConfig, PageHeaderMetadata } from './page-header';
|
|
11
13
|
export interface SidebarConfig {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/layout/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/layout/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EACL,QAAQ,EACR,UAAU,EACV,cAAc,EACd,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,aAAa,CAAA;AACpB,YAAY,EACV,cAAc,EACd,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,cAAc,GACf,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,qBAAqB,EACrB,yBAAyB,EACzB,0BAA0B,EAC1B,4BAA4B,EAC5B,0BAA0B,EAC1B,yBAAyB,EACzB,oBAAoB,EACpB,kBAAkB,EAClB,yBAAyB,GAC1B,MAAM,mBAAmB,CAAA;AAC1B,YAAY,EACV,mBAAmB,EACnB,4BAA4B,EAC5B,kBAAkB,EAClB,yBAAyB,EACzB,0BAA0B,EAC1B,iBAAiB,EACjB,2BAA2B,EAC3B,0BAA0B,GAC3B,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAC5D,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAMzE,MAAM,WAAW,aAAa;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,cAAc;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