@declarion/react 0.66.1 → 0.81.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-lib/api/auth.js +24 -14
- package/dist-lib/app.js +28 -23
- package/dist-lib/components/chrome/AssociationTabs.js +35 -38
- package/dist-lib/components/chrome/HighlightsStrip.js +2 -1
- package/dist-lib/components/chrome/RecordHeader.js +33 -38
- package/dist-lib/components/detail-layout/AssociatedBlock.js +10 -21
- package/dist-lib/components/detail-layout/ChildrenBlock.js +1 -8
- package/dist-lib/components/detail-layout/ChildrenCards.js +1 -8
- package/dist-lib/components/detail-layout/ChildrenList.js +1 -8
- package/dist-lib/components/detail-layout/ChildrenTable.js +1 -8
- package/dist-lib/components/detail-layout/ChildrenTimeline.js +1 -8
- package/dist-lib/components/detail-layout/DetailAuditStrip.js +33 -29
- package/dist-lib/components/detail-layout/DetailHighlights.js +7 -2
- package/dist-lib/components/detail-layout/FieldsBlock.js +12 -9
- package/dist-lib/components/detail-layout/LayoutRenderer.js +10 -10
- package/dist-lib/components/detail-layout/LayoutTabs.js +49 -48
- package/dist-lib/components/detail-layout/SectionBlock.js +20 -28
- package/dist-lib/components/detail-layout/visibility.js +28 -0
- package/dist-lib/components/fields/IntArrayField.js +37 -33
- package/dist-lib/components/fields/NumberField.js +28 -55
- package/dist-lib/components/fields/RichTextField.js +1 -1
- package/dist-lib/components/fields/TimestampField.js +50 -89
- package/dist-lib/components/fields/cells/factories/date.js +13 -14
- package/dist-lib/components/fields/cells/factories/money.js +1 -1
- package/dist-lib/components/fields/cells/factories/number.js +4 -4
- package/dist-lib/components/file-widgets/DocumentCard.js +1 -1
- package/dist-lib/components/file-widgets/Grid.js +153 -152
- package/dist-lib/components/file-widgets/ImageWidget.js +90 -91
- package/dist-lib/components/file-widgets/LabeledSlots.js +1 -0
- package/dist-lib/components/file-widgets/helpers.js +15 -19
- package/dist-lib/components/file-widgets/host.js +33 -32
- package/dist-lib/components/file-widgets/upload.js +10 -6
- package/dist-lib/components/layout/Layout.js +125 -123
- package/dist-lib/components/pages/NoScreensPage.impl.js +14 -0
- package/dist-lib/components/pages/NoScreensPage.js +12 -0
- package/dist-lib/components/pages/SmartDetailPage.impl.js +451 -451
- package/dist-lib/components/pages/auth/AuthShell.js +62 -61
- package/dist-lib/components/pages/auth/CodeInput.js +63 -0
- package/dist-lib/components/pages/auth/SignIn.js +12 -4
- package/dist-lib/components/pages/auth/SignUp.impl.js +80 -103
- package/dist-lib/components/pages/auth/SignUpCode.js +122 -0
- package/dist-lib/components/pages/auth/TwoFA.impl.js +9 -55
- package/dist-lib/components/pages/list/cardProjection.js +135 -122
- package/dist-lib/components/pages/list/columns.js +58 -43
- package/dist-lib/components/pages/profile/Profile.impl.js +87 -104
- package/dist-lib/components/pages/tenant-params/TenantParamsPage.impl.js +1 -1
- package/dist-lib/components/params/ParamsBlock.js +6 -17
- package/dist-lib/components/params/param-editors.js +14 -10
- package/dist-lib/components/primitives/Fields.js +314 -236
- package/dist-lib/components/shared/MarkdownRenderer.js +44 -43
- package/dist-lib/declarion-react.css +1 -1
- package/dist-lib/hooks/useActiveTabFollowsRoute.js +49 -0
- package/dist-lib/hooks/useAuth.js +44 -37
- package/dist-lib/hooks/useDocumentTitle.js +20 -0
- package/dist-lib/hooks/useFollowAgentOpen.js +1 -0
- package/dist-lib/hooks/useTabTitle.js +1 -1
- package/dist-lib/index.d.ts +21 -7
- package/dist-lib/lib/date-text.js +57 -0
- package/dist-lib/lib/number-text.js +9 -0
- package/dist-lib/lib/timestamp.js +29 -29
- package/dist-lib/stores/tabs.js +7 -5
- package/dist-lib/testing.d.ts +1 -1
- package/dist-lib/testing.js +1 -0
- package/dist-lib/{useResponsiveMode-DmrpMbZX.d.ts → useResponsiveMode-D3SKz5z4.d.ts} +20 -9
- package/package.json +11 -11
|
@@ -20,7 +20,7 @@ import { useTabNavigate as ie } from "../../hooks/useTabNavigate.js";
|
|
|
20
20
|
import { Sidebar as ae, buildSections as h } from "./Sidebar.js";
|
|
21
21
|
import { useImpersonation as oe } from "../../hooks/useImpersonation.js";
|
|
22
22
|
import { TopBar as se } from "./TopBar.js";
|
|
23
|
-
import {
|
|
23
|
+
import { builtInPageTitle as g, useTabTitle as _ } from "../../hooks/useTabTitle.js";
|
|
24
24
|
import { TabStrip as ce } from "./TabStrip.js";
|
|
25
25
|
import { DirtyTabsCloseDialog as le } from "./DirtyTabsCloseDialog.js";
|
|
26
26
|
import { ImpersonationBanner as ue } from "./ImpersonationBanner.js";
|
|
@@ -35,75 +35,72 @@ import { usePageStateRuntime as be } from "../../hooks/usePageStateRuntime.js";
|
|
|
35
35
|
import { AgentOpenFollower as xe } from "../agents/AgentOpenFollower.js";
|
|
36
36
|
import { useCurrentLocation as Se } from "../../hooks/useCurrentLocation.js";
|
|
37
37
|
import { useBrandingShell as Ce } from "../../hooks/useBrandingChrome.js";
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
38
|
+
import { useActiveTabFollowsRoute as we } from "../../hooks/useActiveTabFollowsRoute.js";
|
|
39
|
+
import { useDocumentTitle as Te } from "../../hooks/useDocumentTitle.js";
|
|
40
|
+
import { useCallback as v, useEffect as y, useMemo as Ee, useRef as b, useState as x } from "react";
|
|
41
|
+
import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
42
|
+
import { Outlet as De, useLocation as Oe, useNavigate as ke } from "react-router";
|
|
41
43
|
//#region src/components/layout/Layout.tsx
|
|
42
|
-
var
|
|
43
|
-
function
|
|
44
|
+
var T = "default";
|
|
45
|
+
function E() {
|
|
44
46
|
let i = o();
|
|
45
47
|
te(), be();
|
|
46
|
-
let { isAuthenticated: a, isLoading: h, user: g, activeTenant:
|
|
48
|
+
let { isAuthenticated: a, isLoading: h, user: g, activeTenant: _ } = n(), S = t(), E = ke(), D = ie(), O = v((e) => D(e, { topLevel: !0 }), [D]), k = Oe(), { data: A } = r(), Le = s(), j = d((e) => e.sidebar), Re = d((e) => e.tabsPosition), M = d((e) => e.aiSurface), ze = d((e) => e.colorScheme), N = d((e) => e.set), Be = d((e) => e.hydrateFromBranding), { branding: Ve } = l(), P = Ce(), F = f((e) => e.tabs), He = f((e) => e.activeTabId), Ue = f((e) => e.closeTabs), We = f((e) => e.switchTab), [I, L] = x(T), [Ge, R] = x(!1), [Ke, qe] = x("default"), [z, B] = x(!1), [Je, V] = x(), [Ye, H] = x(!1), [Xe, U] = x(!1), Ze = b(null), Qe = b(null), [W, G] = x(null), K = M !== "off" && P.isVisible("show_command_palette"), q = M === "panel" || M === "both", $e = M === "command" || M === "both", et = u(), tt = et?.ai_name?.trim() ?? "", J = Le.category === "phone" || Le.category === "tablet", Y = P.isVisible("show_topbar"), nt = !J && P.isVisible("show_rail"), rt = !J && P.isVisible("show_sidebar"), it = !J && P.isVisible("show_tabs"), at = J && P.isVisible("show_sidebar"), ot = J && P.isVisible("show_tabs"), st = Ae(!J && q && z), ct = P.isVisible("show_tenant_switcher"), lt = P.isVisible("show_breadcrumbs"), ut = P.isVisible("show_theme_toggle"), X = v((e = "default") => {
|
|
47
49
|
K && (qe(e), R(!0));
|
|
48
|
-
}, [K]), Z =
|
|
50
|
+
}, [K]), Z = v((e) => {
|
|
49
51
|
if (e.length === 0) return;
|
|
50
|
-
let t = f.getState(), n = !t.activeTabId || e.includes(t.activeTabId), r =
|
|
52
|
+
let t = f.getState(), n = !t.activeTabId || e.includes(t.activeTabId), r = Ue(e);
|
|
51
53
|
if (!n) return;
|
|
52
54
|
let i = pe(r);
|
|
53
55
|
E({
|
|
54
56
|
pathname: i.pathname,
|
|
55
57
|
search: i.search
|
|
56
58
|
}, { replace: i.replace });
|
|
57
|
-
}, [
|
|
59
|
+
}, [Ue, E]), Q = v((e, t) => {
|
|
58
60
|
let n = f.getState(), r = fe(n.tabs, n.activeTabId, e, t);
|
|
59
61
|
r && (r.dirtyTabs.length > 0 ? G(r) : Z(r.ids));
|
|
60
|
-
}, [Z]), dt =
|
|
62
|
+
}, [Z]), dt = v(() => {
|
|
61
63
|
G(null);
|
|
62
|
-
}, []), ft =
|
|
64
|
+
}, []), ft = v(() => {
|
|
63
65
|
W && (G(null), Z(W.cleanIds));
|
|
64
|
-
}, [W, Z]), pt =
|
|
66
|
+
}, [W, Z]), pt = v(() => {
|
|
65
67
|
W && (G(null), Z(W.ids));
|
|
66
68
|
}, [W, Z]);
|
|
67
69
|
ge();
|
|
68
70
|
let mt = Se(), { isImpersonating: $ } = oe();
|
|
69
|
-
|
|
70
|
-
|
|
71
|
+
y(() => {
|
|
72
|
+
S.enabled || !h && !a && E(e(`${k.pathname}${k.search}${k.hash}`), { replace: !0 });
|
|
71
73
|
}, [
|
|
72
|
-
|
|
74
|
+
S.enabled,
|
|
73
75
|
h,
|
|
74
76
|
a,
|
|
75
77
|
E,
|
|
76
78
|
k.hash,
|
|
77
79
|
k.pathname,
|
|
78
80
|
k.search
|
|
79
|
-
]),
|
|
80
|
-
let e = g?.id || null, t =
|
|
81
|
-
|
|
82
|
-
}, [
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
Ue,
|
|
86
|
-
We
|
|
87
|
-
]), v(() => {
|
|
88
|
-
Re(ze?.preferences);
|
|
89
|
-
}, [ze, Re]), v(() => {
|
|
81
|
+
]), y(() => {
|
|
82
|
+
let e = g?.id || null, t = _?.id || null;
|
|
83
|
+
f.getState().setScope(t, e), ye.getState().setScope(t, e), e && t && (f.getState().hydrate(), ye.getState().hydrate(), ve());
|
|
84
|
+
}, [g?.id, _?.id]), we(), Te(), y(() => {
|
|
85
|
+
Be(Ve?.preferences);
|
|
86
|
+
}, [Ve, Be]), y(() => {
|
|
90
87
|
if (!A) return;
|
|
91
|
-
let e =
|
|
88
|
+
let e = Fe(A.navigation, A.screens, k.pathname);
|
|
92
89
|
if (e) {
|
|
93
90
|
L(e);
|
|
94
91
|
return;
|
|
95
92
|
}
|
|
96
93
|
let t = I;
|
|
97
|
-
if ((A.navigation ?? []).some((e) => (e.area ||
|
|
98
|
-
let n = (A.navigation ?? [])[0]?.area ||
|
|
94
|
+
if ((A.navigation ?? []).some((e) => (e.area || T) === t)) return;
|
|
95
|
+
let n = (A.navigation ?? [])[0]?.area || T;
|
|
99
96
|
n !== t && L(n);
|
|
100
97
|
}, [
|
|
101
98
|
A,
|
|
102
99
|
k.pathname,
|
|
103
100
|
I
|
|
104
|
-
]),
|
|
101
|
+
]), y(() => {
|
|
105
102
|
H(!1), U(!1);
|
|
106
|
-
}, [k.pathname, k.search]),
|
|
103
|
+
}, [k.pathname, k.search]), y(() => {
|
|
107
104
|
let e = (e) => {
|
|
108
105
|
let t = document.activeElement, n = !!t && (t.tagName === "INPUT" || t.tagName === "TEXTAREA" || t.isContentEditable), r = e.metaKey || e.ctrlKey;
|
|
109
106
|
r && e.key.toLowerCase() === "k" ? (e.preventDefault(), X("default")) : r && e.key.toLowerCase() === "t" ? (e.preventDefault(), X("new")) : r && e.key.toLowerCase() === "b" ? (e.preventDefault(), N("sidebar", j === "collapsed" ? "wide" : "collapsed")) : r && e.key.toLowerCase() === "w" ? (e.preventDefault(), Q("current")) : r && e.key === "/" ? (e.preventDefault(), q && B((e) => !e)) : e.key === "/" && !n ? (e.preventDefault(), X("default")) : e.key === "Escape" && R(!1);
|
|
@@ -116,14 +113,14 @@ function T() {
|
|
|
116
113
|
j,
|
|
117
114
|
q
|
|
118
115
|
]);
|
|
119
|
-
let ht =
|
|
116
|
+
let ht = Ee(() => A ? Ie(i, A.navigation, A.screens, k.pathname, F, O) : [], [
|
|
120
117
|
i,
|
|
121
118
|
A,
|
|
122
119
|
k.pathname,
|
|
123
120
|
F,
|
|
124
121
|
O
|
|
125
122
|
]);
|
|
126
|
-
if (h) return /* @__PURE__ */
|
|
123
|
+
if (h) return /* @__PURE__ */ C("div", {
|
|
127
124
|
style: {
|
|
128
125
|
display: "flex",
|
|
129
126
|
height: "var(--app-height)",
|
|
@@ -137,7 +134,7 @@ function T() {
|
|
|
137
134
|
if (!a) return null;
|
|
138
135
|
let gt = (e) => {
|
|
139
136
|
L(e);
|
|
140
|
-
let t =
|
|
137
|
+
let t = Pe(e, A);
|
|
141
138
|
t && O(t);
|
|
142
139
|
}, _t = (e) => {
|
|
143
140
|
switch (e.type) {
|
|
@@ -157,28 +154,28 @@ function T() {
|
|
|
157
154
|
q && (V(void 0), B(!0));
|
|
158
155
|
break;
|
|
159
156
|
case "theme":
|
|
160
|
-
N("colorScheme",
|
|
157
|
+
N("colorScheme", ze === "dark" ? "light" : "dark");
|
|
161
158
|
break;
|
|
162
159
|
case "tab-close": e.tabCloseScope && Q(e.tabCloseScope);
|
|
163
160
|
}
|
|
164
161
|
};
|
|
165
|
-
return
|
|
166
|
-
/* @__PURE__ */
|
|
167
|
-
/* @__PURE__ */
|
|
168
|
-
/* @__PURE__ */
|
|
169
|
-
/* @__PURE__ */
|
|
170
|
-
/* @__PURE__ */
|
|
171
|
-
/* @__PURE__ */
|
|
162
|
+
return S.enabled ? /* @__PURE__ */ w(_e, { children: [
|
|
163
|
+
/* @__PURE__ */ C(ne, {}),
|
|
164
|
+
/* @__PURE__ */ C(m, {}),
|
|
165
|
+
/* @__PURE__ */ C(re, {}),
|
|
166
|
+
/* @__PURE__ */ C(ee, {}),
|
|
167
|
+
/* @__PURE__ */ C(p, {}),
|
|
168
|
+
/* @__PURE__ */ C("div", {
|
|
172
169
|
id: "app-embed",
|
|
173
170
|
className: "flex min-h-0 flex-col overflow-auto",
|
|
174
171
|
style: { height: "var(--app-height)" },
|
|
175
|
-
children: /* @__PURE__ */
|
|
172
|
+
children: /* @__PURE__ */ C(De, {})
|
|
176
173
|
})
|
|
177
|
-
] }) : /* @__PURE__ */
|
|
174
|
+
] }) : /* @__PURE__ */ C(_e, { children: /* @__PURE__ */ w("div", {
|
|
178
175
|
id: "app",
|
|
179
176
|
"data-sidebar": j,
|
|
180
177
|
"data-mobile-shell": J ? "true" : void 0,
|
|
181
|
-
style:
|
|
178
|
+
style: je({
|
|
182
179
|
mobileShell: J,
|
|
183
180
|
showBanner: $,
|
|
184
181
|
showTopbar: Y,
|
|
@@ -188,9 +185,9 @@ function T() {
|
|
|
188
185
|
showAssistant: st
|
|
189
186
|
}),
|
|
190
187
|
children: [
|
|
191
|
-
$ && /* @__PURE__ */
|
|
192
|
-
/* @__PURE__ */
|
|
193
|
-
Y && /* @__PURE__ */
|
|
188
|
+
$ && /* @__PURE__ */ C(ue, {}),
|
|
189
|
+
/* @__PURE__ */ C(de, {}),
|
|
190
|
+
Y && /* @__PURE__ */ C(se, {
|
|
194
191
|
breadcrumbs: ht,
|
|
195
192
|
onCrumbClick: (e) => e.onClick && e.onClick(),
|
|
196
193
|
showNavButton: at,
|
|
@@ -209,7 +206,7 @@ function T() {
|
|
|
209
206
|
showBreadcrumbs: lt,
|
|
210
207
|
showThemeToggle: ut
|
|
211
208
|
}),
|
|
212
|
-
nt && /* @__PURE__ */
|
|
209
|
+
nt && /* @__PURE__ */ C(c, {
|
|
213
210
|
activeArea: I,
|
|
214
211
|
onPick: gt,
|
|
215
212
|
onToggleAI: () => q && B((e) => !e),
|
|
@@ -218,8 +215,8 @@ function T() {
|
|
|
218
215
|
areas: A?.areas,
|
|
219
216
|
branding: et
|
|
220
217
|
}),
|
|
221
|
-
rt && /* @__PURE__ */
|
|
222
|
-
/* @__PURE__ */
|
|
218
|
+
rt && /* @__PURE__ */ C(ae, { activeArea: I }),
|
|
219
|
+
/* @__PURE__ */ w("main", {
|
|
223
220
|
style: {
|
|
224
221
|
gridArea: "main",
|
|
225
222
|
overflow: "hidden",
|
|
@@ -228,11 +225,11 @@ function T() {
|
|
|
228
225
|
minWidth: 0
|
|
229
226
|
},
|
|
230
227
|
children: [
|
|
231
|
-
it &&
|
|
228
|
+
it && Re === "top" && /* @__PURE__ */ C(ce, {
|
|
232
229
|
onNew: () => X("new"),
|
|
233
230
|
onCloseRequest: Q
|
|
234
231
|
}),
|
|
235
|
-
/* @__PURE__ */
|
|
232
|
+
/* @__PURE__ */ C("div", {
|
|
236
233
|
style: {
|
|
237
234
|
flex: 1,
|
|
238
235
|
overflow: "auto",
|
|
@@ -240,15 +237,15 @@ function T() {
|
|
|
240
237
|
display: "flex",
|
|
241
238
|
flexDirection: "column"
|
|
242
239
|
},
|
|
243
|
-
children: /* @__PURE__ */
|
|
240
|
+
children: /* @__PURE__ */ C(De, {})
|
|
244
241
|
}),
|
|
245
|
-
it &&
|
|
242
|
+
it && Re === "bottom" && /* @__PURE__ */ C(ce, {
|
|
246
243
|
onNew: () => X("new"),
|
|
247
244
|
onCloseRequest: Q
|
|
248
245
|
})
|
|
249
246
|
]
|
|
250
247
|
}),
|
|
251
|
-
K && /* @__PURE__ */
|
|
248
|
+
K && /* @__PURE__ */ C(me, {
|
|
252
249
|
open: Ge,
|
|
253
250
|
mode: Ke,
|
|
254
251
|
onClose: () => R(!1),
|
|
@@ -258,8 +255,8 @@ function T() {
|
|
|
258
255
|
includeAI: $e,
|
|
259
256
|
aiName: tt
|
|
260
257
|
}),
|
|
261
|
-
/* @__PURE__ */
|
|
262
|
-
q && z && /* @__PURE__ */
|
|
258
|
+
/* @__PURE__ */ C(xe, {}),
|
|
259
|
+
q && z && /* @__PURE__ */ C(he, {
|
|
263
260
|
open: z,
|
|
264
261
|
docked: st,
|
|
265
262
|
onClose: () => {
|
|
@@ -269,7 +266,7 @@ function T() {
|
|
|
269
266
|
askOnOpen: Je,
|
|
270
267
|
context: mt ?? void 0
|
|
271
268
|
}),
|
|
272
|
-
at && /* @__PURE__ */
|
|
269
|
+
at && /* @__PURE__ */ C(Me, {
|
|
273
270
|
open: Ye,
|
|
274
271
|
activeArea: I,
|
|
275
272
|
schema: A,
|
|
@@ -277,21 +274,21 @@ function T() {
|
|
|
277
274
|
onClose: () => H(!1),
|
|
278
275
|
onNavigate: O
|
|
279
276
|
}),
|
|
280
|
-
ot && /* @__PURE__ */
|
|
277
|
+
ot && /* @__PURE__ */ C(Ne, {
|
|
281
278
|
open: Xe,
|
|
282
279
|
tabs: F,
|
|
283
|
-
activeTabId:
|
|
280
|
+
activeTabId: He,
|
|
284
281
|
returnFocusRef: Qe,
|
|
285
282
|
onClose: () => U(!1),
|
|
286
283
|
onSwitch: (e) => {
|
|
287
|
-
|
|
284
|
+
We(e.id), E({
|
|
288
285
|
pathname: e.pathname,
|
|
289
286
|
search: e.search
|
|
290
287
|
}, { replace: !1 }), U(!1);
|
|
291
288
|
},
|
|
292
289
|
onCloseTab: (e) => Q("current", e)
|
|
293
290
|
}),
|
|
294
|
-
/* @__PURE__ */
|
|
291
|
+
/* @__PURE__ */ C(le, {
|
|
295
292
|
pending: W,
|
|
296
293
|
onCancel: dt,
|
|
297
294
|
onCloseClean: ft,
|
|
@@ -300,15 +297,15 @@ function T() {
|
|
|
300
297
|
]
|
|
301
298
|
}) });
|
|
302
299
|
}
|
|
303
|
-
function
|
|
304
|
-
return
|
|
300
|
+
function Ae(e) {
|
|
301
|
+
return y(() => {
|
|
305
302
|
let t = document.documentElement.style;
|
|
306
303
|
return t.setProperty("--assistant-open-w", e ? "var(--assistant-w)" : "0px"), () => {
|
|
307
304
|
t.removeProperty("--assistant-open-w");
|
|
308
305
|
};
|
|
309
306
|
}, [e]), e;
|
|
310
307
|
}
|
|
311
|
-
function
|
|
308
|
+
function je({ mobileShell: e, showBanner: t, showTopbar: n, showRail: r, showSidebar: i, sidebarMode: a, showAssistant: o }) {
|
|
312
309
|
let s = [
|
|
313
310
|
...t ? ["auto"] : [],
|
|
314
311
|
...n ? ["var(--topbar-h)"] : [],
|
|
@@ -339,7 +336,7 @@ function ke({ mobileShell: e, showBanner: t, showTopbar: n, showRail: r, showSid
|
|
|
339
336
|
overflow: "hidden"
|
|
340
337
|
};
|
|
341
338
|
}
|
|
342
|
-
var
|
|
339
|
+
var D = [
|
|
343
340
|
"a[href]",
|
|
344
341
|
"button:not([disabled])",
|
|
345
342
|
"input:not([disabled])",
|
|
@@ -347,14 +344,14 @@ var E = [
|
|
|
347
344
|
"textarea:not([disabled])",
|
|
348
345
|
"[tabindex]:not([tabindex='-1'])"
|
|
349
346
|
].join(",");
|
|
350
|
-
function D(e) {
|
|
351
|
-
return e ? Array.from(e.querySelectorAll(E)).filter((e) => !e.hasAttribute("disabled") && e.getAttribute("aria-hidden") !== "true") : [];
|
|
352
|
-
}
|
|
353
347
|
function O(e) {
|
|
354
|
-
D(e)[
|
|
348
|
+
return e ? Array.from(e.querySelectorAll(D)).filter((e) => !e.hasAttribute("disabled") && e.getAttribute("aria-hidden") !== "true") : [];
|
|
355
349
|
}
|
|
356
|
-
function k(e
|
|
357
|
-
|
|
350
|
+
function k(e) {
|
|
351
|
+
O(e)[0]?.focus();
|
|
352
|
+
}
|
|
353
|
+
function A(e, t) {
|
|
354
|
+
let n = O(e);
|
|
358
355
|
if (n.length === 0) {
|
|
359
356
|
t.preventDefault();
|
|
360
357
|
return;
|
|
@@ -362,16 +359,16 @@ function k(e, t) {
|
|
|
362
359
|
let r = n[0], i = n[n.length - 1], a = document.activeElement;
|
|
363
360
|
t.shiftKey && a === r ? (t.preventDefault(), i.focus()) : !t.shiftKey && a === i && (t.preventDefault(), r.focus());
|
|
364
361
|
}
|
|
365
|
-
function
|
|
366
|
-
let l = o(), [u, d] =
|
|
367
|
-
if (
|
|
362
|
+
function Me({ open: e, activeArea: t, schema: n, returnFocusRef: r, onClose: s, onNavigate: c }) {
|
|
363
|
+
let l = o(), [u, d] = x(t), f = b(null);
|
|
364
|
+
if (y(() => {
|
|
368
365
|
e && d(t);
|
|
369
|
-
}, [e, t]),
|
|
366
|
+
}, [e, t]), y(() => {
|
|
370
367
|
if (!e) return;
|
|
371
368
|
let t = document.activeElement instanceof HTMLElement ? document.activeElement : null, n = r.current;
|
|
372
|
-
requestAnimationFrame(() =>
|
|
369
|
+
requestAnimationFrame(() => k(f.current));
|
|
373
370
|
let i = (e) => {
|
|
374
|
-
e.key === "Escape" ? (e.preventDefault(), s()) : e.key === "Tab" &&
|
|
371
|
+
e.key === "Escape" ? (e.preventDefault(), s()) : e.key === "Tab" && A(f.current, e);
|
|
375
372
|
};
|
|
376
373
|
return window.addEventListener("keydown", i), () => {
|
|
377
374
|
window.removeEventListener("keydown", i), (n ?? t)?.focus();
|
|
@@ -381,20 +378,20 @@ function Ae({ open: e, activeArea: t, schema: n, returnFocusRef: r, onClose: s,
|
|
|
381
378
|
s,
|
|
382
379
|
r
|
|
383
380
|
]), !e || !n) return null;
|
|
384
|
-
let p = Array.from(new Set((n.navigation ?? []).map((e) => e.area ||
|
|
385
|
-
p.length === 0 && p.push(
|
|
381
|
+
let p = Array.from(new Set((n.navigation ?? []).map((e) => e.area || T)));
|
|
382
|
+
p.length === 0 && p.push(T);
|
|
386
383
|
let ee = (e) => {
|
|
387
384
|
let t = n.areas?.find((t) => t.code === e);
|
|
388
|
-
return l(t?.name) || (e ===
|
|
385
|
+
return l(t?.name) || (e === T ? l("shell.nav.title", "Navigation") : e);
|
|
389
386
|
}, m = (e, t) => {
|
|
390
387
|
let r = e.screen ? n.screens[e.screen] : void 0, i = [...e.items ?? [], ...e.children ?? []], a = l(e.name) || (r ? l(r.display?.name) : "");
|
|
391
|
-
return /* @__PURE__ */
|
|
388
|
+
return /* @__PURE__ */ w("div", {
|
|
392
389
|
style: {
|
|
393
390
|
display: "flex",
|
|
394
391
|
flexDirection: "column",
|
|
395
392
|
gap: 2
|
|
396
393
|
},
|
|
397
|
-
children: [r?.route ? /* @__PURE__ */
|
|
394
|
+
children: [r?.route ? /* @__PURE__ */ w("button", {
|
|
398
395
|
type: "button",
|
|
399
396
|
onClick: () => {
|
|
400
397
|
c(r.route), s();
|
|
@@ -413,7 +410,7 @@ function Ae({ open: e, activeArea: t, schema: n, returnFocusRef: r, onClose: s,
|
|
|
413
410
|
textAlign: "left",
|
|
414
411
|
cursor: "pointer"
|
|
415
412
|
},
|
|
416
|
-
children: [/* @__PURE__ */
|
|
413
|
+
children: [/* @__PURE__ */ C("span", { style: { width: 12 } }), /* @__PURE__ */ C("span", {
|
|
417
414
|
style: {
|
|
418
415
|
minWidth: 0,
|
|
419
416
|
overflow: "hidden",
|
|
@@ -422,7 +419,7 @@ function Ae({ open: e, activeArea: t, schema: n, returnFocusRef: r, onClose: s,
|
|
|
422
419
|
},
|
|
423
420
|
children: a || r.route
|
|
424
421
|
})]
|
|
425
|
-
}) : a ? /* @__PURE__ */
|
|
422
|
+
}) : a ? /* @__PURE__ */ C("div", {
|
|
426
423
|
style: {
|
|
427
424
|
padding: `7px 10px 5px ${10 + t * 14}px`,
|
|
428
425
|
color: "var(--text-3)",
|
|
@@ -435,7 +432,7 @@ function Ae({ open: e, activeArea: t, schema: n, returnFocusRef: r, onClose: s,
|
|
|
435
432
|
}) : null, i.map((e) => m(e, t + 1))]
|
|
436
433
|
}, `${t}-${e.screen ?? a}`);
|
|
437
434
|
};
|
|
438
|
-
return /* @__PURE__ */
|
|
435
|
+
return /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C("div", {
|
|
439
436
|
"data-testid": "mobile-nav-backdrop",
|
|
440
437
|
onClick: s,
|
|
441
438
|
style: {
|
|
@@ -444,7 +441,7 @@ function Ae({ open: e, activeArea: t, schema: n, returnFocusRef: r, onClose: s,
|
|
|
444
441
|
background: "var(--scrim-lite)",
|
|
445
442
|
zIndex: 120
|
|
446
443
|
}
|
|
447
|
-
}), /* @__PURE__ */
|
|
444
|
+
}), /* @__PURE__ */ w("aside", {
|
|
448
445
|
ref: f,
|
|
449
446
|
role: "dialog",
|
|
450
447
|
"aria-modal": "true",
|
|
@@ -468,7 +465,7 @@ function Ae({ open: e, activeArea: t, schema: n, returnFocusRef: r, onClose: s,
|
|
|
468
465
|
boxSizing: "border-box",
|
|
469
466
|
overflow: "hidden"
|
|
470
467
|
},
|
|
471
|
-
children: [/* @__PURE__ */
|
|
468
|
+
children: [/* @__PURE__ */ w("div", {
|
|
472
469
|
style: {
|
|
473
470
|
display: "flex",
|
|
474
471
|
alignItems: "center",
|
|
@@ -476,18 +473,18 @@ function Ae({ open: e, activeArea: t, schema: n, returnFocusRef: r, onClose: s,
|
|
|
476
473
|
minHeight: 36,
|
|
477
474
|
padding: "0 2px 8px"
|
|
478
475
|
},
|
|
479
|
-
children: [/* @__PURE__ */
|
|
476
|
+
children: [/* @__PURE__ */ C("strong", {
|
|
480
477
|
style: {
|
|
481
478
|
fontSize: 13,
|
|
482
479
|
flex: 1
|
|
483
480
|
},
|
|
484
481
|
children: l("shell.nav.title", "Navigation")
|
|
485
|
-
}), /* @__PURE__ */
|
|
486
|
-
icon: /* @__PURE__ */
|
|
482
|
+
}), /* @__PURE__ */ C(a, {
|
|
483
|
+
icon: /* @__PURE__ */ C(i.x, { size: 15 }),
|
|
487
484
|
title: l("shell.nav.close", "Close navigation"),
|
|
488
485
|
onClick: s
|
|
489
486
|
})]
|
|
490
|
-
}), /* @__PURE__ */
|
|
487
|
+
}), /* @__PURE__ */ C("nav", {
|
|
491
488
|
style: {
|
|
492
489
|
overflowY: "auto",
|
|
493
490
|
overscrollBehavior: "contain",
|
|
@@ -497,7 +494,7 @@ function Ae({ open: e, activeArea: t, schema: n, returnFocusRef: r, onClose: s,
|
|
|
497
494
|
},
|
|
498
495
|
children: p.map((e) => {
|
|
499
496
|
let r = u === e, a = h(l, n.navigation ?? [], e);
|
|
500
|
-
return /* @__PURE__ */
|
|
497
|
+
return /* @__PURE__ */ w("section", { children: [/* @__PURE__ */ w("button", {
|
|
501
498
|
type: "button",
|
|
502
499
|
onClick: () => d(r ? "" : e),
|
|
503
500
|
style: {
|
|
@@ -516,16 +513,16 @@ function Ae({ open: e, activeArea: t, schema: n, returnFocusRef: r, onClose: s,
|
|
|
516
513
|
cursor: "pointer"
|
|
517
514
|
},
|
|
518
515
|
"aria-expanded": r,
|
|
519
|
-
children: [/* @__PURE__ */
|
|
516
|
+
children: [/* @__PURE__ */ C("span", {
|
|
520
517
|
style: {
|
|
521
518
|
flex: 1,
|
|
522
519
|
textAlign: "left"
|
|
523
520
|
},
|
|
524
521
|
children: ee(e)
|
|
525
|
-
}),
|
|
526
|
-
}), r && /* @__PURE__ */
|
|
522
|
+
}), C(r ? i.down : i.right, { size: 13 })]
|
|
523
|
+
}), r && /* @__PURE__ */ C("div", {
|
|
527
524
|
style: { padding: "6px 0 4px" },
|
|
528
|
-
children: a.flatMap((t) => [t.title ? /* @__PURE__ */
|
|
525
|
+
children: a.flatMap((t) => [t.title ? /* @__PURE__ */ C("div", {
|
|
529
526
|
style: {
|
|
530
527
|
padding: "8px 10px 4px",
|
|
531
528
|
color: "var(--text-3)",
|
|
@@ -541,14 +538,14 @@ function Ae({ open: e, activeArea: t, schema: n, returnFocusRef: r, onClose: s,
|
|
|
541
538
|
})]
|
|
542
539
|
})] });
|
|
543
540
|
}
|
|
544
|
-
function
|
|
545
|
-
let u = o(), d =
|
|
546
|
-
return
|
|
541
|
+
function Ne({ open: e, tabs: t, activeTabId: n, returnFocusRef: r, onClose: s, onSwitch: c, onCloseTab: l }) {
|
|
542
|
+
let u = o(), d = _(), f = b(null);
|
|
543
|
+
return y(() => {
|
|
547
544
|
if (!e) return;
|
|
548
545
|
let t = document.activeElement instanceof HTMLElement ? document.activeElement : null, n = r.current;
|
|
549
|
-
requestAnimationFrame(() =>
|
|
546
|
+
requestAnimationFrame(() => k(f.current));
|
|
550
547
|
let i = (e) => {
|
|
551
|
-
e.key === "Escape" ? (e.preventDefault(), s()) : e.key === "Tab" &&
|
|
548
|
+
e.key === "Escape" ? (e.preventDefault(), s()) : e.key === "Tab" && A(f.current, e);
|
|
552
549
|
};
|
|
553
550
|
return window.addEventListener("keydown", i), () => {
|
|
554
551
|
window.removeEventListener("keydown", i), (n ?? t)?.focus();
|
|
@@ -557,7 +554,7 @@ function je({ open: e, tabs: t, activeTabId: n, returnFocusRef: r, onClose: s, o
|
|
|
557
554
|
e,
|
|
558
555
|
s,
|
|
559
556
|
r
|
|
560
|
-
]), e ? /* @__PURE__ */
|
|
557
|
+
]), e ? /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C("div", {
|
|
561
558
|
"data-testid": "mobile-tabs-backdrop",
|
|
562
559
|
onClick: s,
|
|
563
560
|
style: {
|
|
@@ -566,7 +563,7 @@ function je({ open: e, tabs: t, activeTabId: n, returnFocusRef: r, onClose: s, o
|
|
|
566
563
|
background: "var(--scrim-lite)",
|
|
567
564
|
zIndex: 122
|
|
568
565
|
}
|
|
569
|
-
}), /* @__PURE__ */
|
|
566
|
+
}), /* @__PURE__ */ w("section", {
|
|
570
567
|
ref: f,
|
|
571
568
|
role: "dialog",
|
|
572
569
|
"aria-modal": "true",
|
|
@@ -589,32 +586,32 @@ function je({ open: e, tabs: t, activeTabId: n, returnFocusRef: r, onClose: s, o
|
|
|
589
586
|
padding: 6,
|
|
590
587
|
boxSizing: "border-box"
|
|
591
588
|
},
|
|
592
|
-
children: [/* @__PURE__ */
|
|
589
|
+
children: [/* @__PURE__ */ w("div", {
|
|
593
590
|
style: {
|
|
594
591
|
display: "flex",
|
|
595
592
|
alignItems: "center",
|
|
596
593
|
gap: 8,
|
|
597
594
|
padding: "4px 4px 8px"
|
|
598
595
|
},
|
|
599
|
-
children: [/* @__PURE__ */
|
|
596
|
+
children: [/* @__PURE__ */ C("strong", {
|
|
600
597
|
style: {
|
|
601
598
|
flex: 1,
|
|
602
599
|
fontSize: 13
|
|
603
600
|
},
|
|
604
601
|
children: u("shell.tabs.open_tabs", "Open tabs")
|
|
605
|
-
}), /* @__PURE__ */
|
|
606
|
-
icon: /* @__PURE__ */
|
|
602
|
+
}), /* @__PURE__ */ C(a, {
|
|
603
|
+
icon: /* @__PURE__ */ C(i.x, { size: 14 }),
|
|
607
604
|
title: u("shell.tabs.close_menu", "Close tabs menu"),
|
|
608
605
|
onClick: s
|
|
609
606
|
})]
|
|
610
|
-
}), t.length === 0 ? /* @__PURE__ */
|
|
607
|
+
}), t.length === 0 ? /* @__PURE__ */ C("div", {
|
|
611
608
|
style: {
|
|
612
609
|
padding: 10,
|
|
613
610
|
color: "var(--text-3)",
|
|
614
611
|
fontSize: 12
|
|
615
612
|
},
|
|
616
613
|
children: u("shell.tabs.none_open", "No open tabs")
|
|
617
|
-
}) : t.map((e) => /* @__PURE__ */
|
|
614
|
+
}) : t.map((e) => /* @__PURE__ */ w("div", {
|
|
618
615
|
style: {
|
|
619
616
|
display: "grid",
|
|
620
617
|
gridTemplateColumns: "minmax(0, 1fr) auto",
|
|
@@ -623,7 +620,7 @@ function je({ open: e, tabs: t, activeTabId: n, returnFocusRef: r, onClose: s, o
|
|
|
623
620
|
borderRadius: "var(--radius-md)",
|
|
624
621
|
background: e.id === n ? "var(--surface-3)" : "transparent"
|
|
625
622
|
},
|
|
626
|
-
children: [/* @__PURE__ */
|
|
623
|
+
children: [/* @__PURE__ */ w("button", {
|
|
627
624
|
type: "button",
|
|
628
625
|
onClick: () => c(e),
|
|
629
626
|
style: {
|
|
@@ -639,7 +636,7 @@ function je({ open: e, tabs: t, activeTabId: n, returnFocusRef: r, onClose: s, o
|
|
|
639
636
|
textAlign: "left",
|
|
640
637
|
cursor: "pointer"
|
|
641
638
|
},
|
|
642
|
-
children: [/* @__PURE__ */
|
|
639
|
+
children: [/* @__PURE__ */ C(i.layers, { size: 13 }), /* @__PURE__ */ C("span", {
|
|
643
640
|
style: {
|
|
644
641
|
overflow: "hidden",
|
|
645
642
|
textOverflow: "ellipsis",
|
|
@@ -647,15 +644,15 @@ function je({ open: e, tabs: t, activeTabId: n, returnFocusRef: r, onClose: s, o
|
|
|
647
644
|
},
|
|
648
645
|
children: d(e)
|
|
649
646
|
})]
|
|
650
|
-
}), e.closable && /* @__PURE__ */
|
|
651
|
-
icon: /* @__PURE__ */
|
|
647
|
+
}), e.closable && /* @__PURE__ */ C(a, {
|
|
648
|
+
icon: /* @__PURE__ */ C(i.x, { size: 12 }),
|
|
652
649
|
title: u("shell.tabs.close_named", "Close {title}", { title: d(e) }),
|
|
653
650
|
onClick: () => l(e.id)
|
|
654
651
|
})]
|
|
655
652
|
}, e.id))]
|
|
656
653
|
})] }) : null;
|
|
657
654
|
}
|
|
658
|
-
function
|
|
655
|
+
function Pe(e, t) {
|
|
659
656
|
if (!t) return;
|
|
660
657
|
let n = t.areas?.find((t) => t.code === e);
|
|
661
658
|
if (n?.home_screen) {
|
|
@@ -677,12 +674,12 @@ function Me(e, t) {
|
|
|
677
674
|
}
|
|
678
675
|
};
|
|
679
676
|
for (let n of t.navigation ?? []) {
|
|
680
|
-
if ((n.area ||
|
|
677
|
+
if ((n.area || T) !== e) continue;
|
|
681
678
|
let t = r(n);
|
|
682
679
|
if (t) return t;
|
|
683
680
|
}
|
|
684
681
|
}
|
|
685
|
-
function
|
|
682
|
+
function Fe(e, t, n) {
|
|
686
683
|
let r = (e) => {
|
|
687
684
|
if (!e.screen) return !1;
|
|
688
685
|
let r = t[e.screen];
|
|
@@ -699,11 +696,11 @@ function Ne(e, t, n) {
|
|
|
699
696
|
}
|
|
700
697
|
};
|
|
701
698
|
for (let t of e ?? []) {
|
|
702
|
-
let e = i(t, t.area ||
|
|
699
|
+
let e = i(t, t.area || T);
|
|
703
700
|
if (e) return e;
|
|
704
701
|
}
|
|
705
702
|
}
|
|
706
|
-
function
|
|
703
|
+
function Ie(e, t, n, r, i, a) {
|
|
707
704
|
let o = (e, t) => {
|
|
708
705
|
if (e.screen) {
|
|
709
706
|
let i = n[e.screen];
|
|
@@ -722,10 +719,15 @@ function Pe(e, t, n, r, i, a) {
|
|
|
722
719
|
for (let e of t ?? []) if (s = o(e, []), s) break;
|
|
723
720
|
if (!s || s.length === 0) {
|
|
724
721
|
let t = Object.values(n).find((e) => e.route === r);
|
|
725
|
-
|
|
722
|
+
if (t?.display?.name) return [{
|
|
726
723
|
label: e(t.display.name),
|
|
727
724
|
icon: t.display.icon,
|
|
728
725
|
isLast: !0
|
|
726
|
+
}];
|
|
727
|
+
let i = g(e, r);
|
|
728
|
+
return i ? [{
|
|
729
|
+
label: i,
|
|
730
|
+
isLast: !0
|
|
729
731
|
}] : [];
|
|
730
732
|
}
|
|
731
733
|
let c = [];
|
|
@@ -752,4 +754,4 @@ function Pe(e, t, n, r, i, a) {
|
|
|
752
754
|
return c;
|
|
753
755
|
}
|
|
754
756
|
//#endregion
|
|
755
|
-
export {
|
|
757
|
+
export { E as Layout, Ie as buildCrumbs };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useText as e } from "../../hooks/useText.js";
|
|
2
|
+
import { EmptyState as t } from "../shared/EmptyState.js";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/pages/NoScreensPage.impl.tsx
|
|
5
|
+
function r() {
|
|
6
|
+
let r = e();
|
|
7
|
+
return /* @__PURE__ */ n(t, {
|
|
8
|
+
icon: "lock",
|
|
9
|
+
title: r("page.no_screens.title", "No screens are open to you in this tenant"),
|
|
10
|
+
description: r("page.no_screens.description", "Ask an administrator of this tenant to grant you a role.")
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { r as NoScreensPage };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Suspense as e, lazy as t } from "react";
|
|
2
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/pages/NoScreensPage.tsx
|
|
4
|
+
var r = t(() => import("./NoScreensPage.impl.js").then((e) => ({ default: e.NoScreensPage })));
|
|
5
|
+
function i() {
|
|
6
|
+
return /* @__PURE__ */ n(e, {
|
|
7
|
+
fallback: null,
|
|
8
|
+
children: /* @__PURE__ */ n(r, {})
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { i as NoScreensPage };
|