@declarion/react 0.86.0 → 0.88.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/dist-lib/app.js +28 -28
- package/dist-lib/components/actions/ActionButton.js +86 -85
- package/dist-lib/components/actions/ActionResultDialog.impl.js +47 -47
- package/dist-lib/components/actions/ActionRunner.js +47 -47
- package/dist-lib/components/actions/ObjectActionBar.js +9 -9
- package/dist-lib/components/actions/RowActionsKebab.js +19 -19
- package/dist-lib/components/agents/AgentChatPanel.impl.js +53 -53
- package/dist-lib/components/chrome/AssociationTabs.js +21 -21
- package/dist-lib/components/chrome/RecordHeader.js +33 -40
- package/dist-lib/components/detail-layout/AssociatedBlock.js +387 -381
- package/dist-lib/components/detail-layout/ChildrenBlock.js +12 -13
- package/dist-lib/components/detail-layout/ChildrenTimeline.js +198 -198
- package/dist-lib/components/detail-layout/DraggableChildrenTable.js +114 -114
- package/dist-lib/components/detail-layout/EditableChildrenTable.js +160 -160
- package/dist-lib/components/detail-layout/EvidenceBlock.js +20 -21
- package/dist-lib/components/detail-layout/PropertiesBlock.js +45 -39
- package/dist-lib/components/detail-layout/QuickAddForm.js +9 -9
- package/dist-lib/components/detail-layout/TimelineComposer.js +87 -89
- package/dist-lib/components/detail-layout/widgets/EntityScorecardWidget.js +100 -99
- package/dist-lib/components/fields/FileReferenceField.js +9 -9
- package/dist-lib/components/fields/StructureField.js +57 -47
- package/dist-lib/components/fields/TimestampField.js +59 -54
- package/dist-lib/components/fields/cells/factories/money.js +14 -23
- package/dist-lib/components/fields/cells/factories/nextRun.js +1 -1
- package/dist-lib/components/fields/cells/factories/text.js +18 -3
- package/dist-lib/components/fields/cells/factories/timestamp.js +24 -12
- package/dist-lib/components/file-widgets/DocumentCard.js +108 -106
- package/dist-lib/components/layout/Layout.js +306 -361
- package/dist-lib/components/layout/Rail.js +42 -41
- package/dist-lib/components/layout/Sidebar.js +132 -117
- package/dist-lib/components/layout/TabStrip.js +116 -115
- package/dist-lib/components/layout/TenantChip.js +47 -54
- package/dist-lib/components/layout/TopBar.js +108 -105
- package/dist-lib/components/list/InlineEditCell.js +23 -23
- package/dist-lib/components/list/QuickPeek.js +65 -66
- package/dist-lib/components/pages/DocumentsMenu.js +42 -42
- package/dist-lib/components/pages/ExportMenu.js +25 -25
- package/dist-lib/components/pages/RecordDocumentsPanel.js +35 -35
- package/dist-lib/components/pages/RecordNotesPanel.js +94 -93
- package/dist-lib/components/pages/SmartDetailPage.impl.js +421 -417
- package/dist-lib/components/pages/SmartListPage.impl.js +293 -295
- package/dist-lib/components/pages/SmartRecordListPage.impl.js +310 -310
- package/dist-lib/components/pages/auth/AuthShell.js +73 -73
- package/dist-lib/components/pages/auth/SignIn.js +32 -32
- package/dist-lib/components/pages/auth/SignUp.impl.js +3 -3
- package/dist-lib/components/pages/auth/SignUpCode.js +9 -9
- package/dist-lib/components/pages/list/ListFloatbar.js +12 -12
- package/dist-lib/components/pages/list/ListHeader.js +19 -19
- package/dist-lib/components/pages/list/ListNoRows.js +15 -15
- package/dist-lib/components/pages/list/ListToolbar.js +145 -145
- package/dist-lib/components/pages/list/useActiveView.js +14 -5
- package/dist-lib/components/pages/list/useListQuery.js +121 -81
- package/dist-lib/components/pages/list/useListRowInteraction.js +70 -70
- package/dist-lib/components/pages/list/useRowMenu.js +7 -7
- package/dist-lib/components/pages/profile/Preferences.impl.js +81 -78
- package/dist-lib/components/pages/profile/Profile.impl.js +191 -189
- package/dist-lib/components/pages/tenant-params/TenantParamsPage.impl.js +166 -158
- package/dist-lib/components/shared/ChangePasswordDialog.impl.js +23 -23
- package/dist-lib/components/shared/MarkdownRenderer.js +9 -9
- package/dist-lib/hooks/useAuth.js +11 -11
- package/dist-lib/hooks/useBranding.js +4 -4
- package/dist-lib/hooks/useDisplayTimeZone.js +8 -0
- package/dist-lib/hooks/useFollowAgentOpen.js +24 -24
- package/dist-lib/hooks/useImpersonation.js +6 -6
- package/dist-lib/hooks/useMutations.js +23 -23
- package/dist-lib/hooks/useObjectStatus.js +5 -5
- package/dist-lib/hooks/useParams.js +59 -51
- package/dist-lib/hooks/useProperties.js +8 -8
- package/dist-lib/hooks/useRowTenant.js +18 -6
- package/dist-lib/hooks/useText.js +9 -7
- package/dist-lib/hooks/useUiPreferences.js +71 -0
- package/dist-lib/index.d.ts +22 -6
- package/dist-lib/index.js +127 -126
- package/dist-lib/lib/actions.js +116 -84
- package/dist-lib/lib/child-config.js +10 -1
- package/dist-lib/lib/format-count.js +16 -1
- package/dist-lib/lib/language.js +23 -21
- package/dist-lib/lib/money-text.js +29 -0
- package/dist-lib/lib/profile.js +4 -0
- package/dist-lib/lib/role-label.js +8 -0
- package/dist-lib/lib/schema-routing.js +34 -14
- package/dist-lib/lib/shortcut.js +10 -0
- package/dist-lib/lib/timestamp.js +93 -31
- package/dist-lib/stores/auth.js +9 -8
- package/dist-lib/stores/preferences.js +56 -17
- package/dist-lib/testing.d.ts +1 -1
- package/dist-lib/testing.js +25 -28
- package/dist-lib/types/schema.js +33 -27
- package/dist-lib/{useResponsiveMode-D3SKz5z4.d.ts → useResponsiveMode-9_eJT18k.d.ts} +5 -5
- package/package.json +1 -1
|
@@ -1,38 +1,40 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
1
|
+
import { usePreferencesStore as e } from "../../stores/preferences.js";
|
|
2
|
+
import { useAuthStore as t } from "../../stores/auth.js";
|
|
3
|
+
import { Icon as n } from "../primitives/Icons.js";
|
|
4
|
+
import { IconBtn as r } from "../primitives/IconBtn.js";
|
|
5
|
+
import { Pill as i } from "../primitives/Pill.js";
|
|
6
|
+
import { Kbd as a } from "../primitives/Kbd.js";
|
|
7
|
+
import { Avatar as o } from "../primitives/Avatar.js";
|
|
8
|
+
import { Dropdown as s } from "../primitives/Dropdown.js";
|
|
9
|
+
import { useText as c } from "../../hooks/useText.js";
|
|
10
|
+
import { useResponsiveMode as ee } from "../../hooks/useResponsiveMode.js";
|
|
11
|
+
import { MenuItem as l } from "../primitives/MenuItem.js";
|
|
12
|
+
import { useUiPreferences as u } from "../../hooks/useUiPreferences.js";
|
|
13
|
+
import { shortcutLabel as d } from "../../lib/shortcut.js";
|
|
14
|
+
import { useTabStore as f } from "../../stores/tabs.js";
|
|
15
|
+
import { useAuth as p } from "../../hooks/useAuth.js";
|
|
16
|
+
import { useImpersonation as te } from "../../hooks/useImpersonation.js";
|
|
17
|
+
import { TenantChip as ne, envTone as re } from "./TenantChip.js";
|
|
18
|
+
import { Breadcrumbs as ie } from "../chrome/Breadcrumbs.js";
|
|
19
|
+
import { pageInsetX as ae } from "../../lib/page-inset.js";
|
|
20
|
+
import { activeRoleLabel as oe } from "../../lib/role-label.js";
|
|
21
|
+
import { useRef as m, useState as h } from "react";
|
|
22
|
+
import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
20
23
|
//#region src/components/layout/TopBar.tsx
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
let P = o(), F = e((e) => e.user), I = s(), { activeTenant: L, tenants: R, switchTenant: z, isSwitchingTenant: se, logout: B } = u(), { isImpersonating: V, stop: H } = d(), U = l((e) => e.colorScheme), W = l((e) => e.set), [G, K] = _(!1), q = g(null), J = L?.env, ce = p(J), Y = F?.email ?? "", X = F?.display_name || Y || P("shell.user_menu.user", "User"), Z = C && I.category === "phone", Q = C && I.category !== "desktop", $ = () => {
|
|
24
|
+
function y({ breadcrumbs: y, onCrumbClick: b, onOpenNav: x, navButtonRef: se, showNavButton: S, onOpenTabs: ce, tabsButtonRef: C, showTabsButton: w, mobileTabCount: T = 0, onCmdK: E, onToggleAI: D, aiOpen: O, onOpenProfile: k, onOpenPrefs: A, showTenantSwitcher: j = !0, showBreadcrumbs: M = !0, showThemeToggle: N = !0 } = {}) {
|
|
25
|
+
let P = c(), F = t((e) => e.user), I = ee(), { activeTenant: L, tenants: le, switchTenant: R, isSwitchingTenant: z, logout: B } = p(), { isImpersonating: V, stop: H } = te(), U = e((e) => e.colorScheme), { set: W } = u(), [ue, G] = h(!1), K = m(null), q = L?.env, de = re(q), J = F?.email ?? "", Y = oe(F, P), X = F?.display_name || J || P("shell.user_menu.user", "User"), Z = S && I.category === "phone", Q = S && I.category !== "desktop", $ = () => {
|
|
24
26
|
W("colorScheme", U === "dark" ? "light" : "dark");
|
|
25
|
-
},
|
|
26
|
-
L?.id !== e.id && (!
|
|
27
|
+
}, fe = (e) => {
|
|
28
|
+
L?.id !== e.id && (!f.getState().tabs.some((e) => e.dirty) || window.confirm(P("shell.tenant.switch_confirm", "You have unsaved changes in one or more tabs. Switching tenant will discard them. Continue?"))) && R(e.id);
|
|
27
29
|
};
|
|
28
|
-
return /* @__PURE__ */
|
|
30
|
+
return /* @__PURE__ */ v("header", {
|
|
29
31
|
style: {
|
|
30
32
|
gridArea: "topbar",
|
|
31
33
|
background: "var(--surface)",
|
|
32
34
|
borderBottom: "1px solid var(--border)",
|
|
33
35
|
display: "flex",
|
|
34
36
|
alignItems: "center",
|
|
35
|
-
...
|
|
37
|
+
...ae(12),
|
|
36
38
|
gap: Q ? 8 : 10,
|
|
37
39
|
zIndex: 5,
|
|
38
40
|
position: "relative",
|
|
@@ -40,39 +42,40 @@ function S({ breadcrumbs: S, onCrumbClick: ne, onOpenNav: re, navButtonRef: ie,
|
|
|
40
42
|
overflow: "hidden"
|
|
41
43
|
},
|
|
42
44
|
children: [
|
|
43
|
-
|
|
45
|
+
q === "production" && /* @__PURE__ */ _("span", { style: {
|
|
44
46
|
position: "absolute",
|
|
45
47
|
left: 0,
|
|
46
48
|
right: 0,
|
|
47
49
|
top: 0,
|
|
48
50
|
height: 2,
|
|
49
|
-
background: `linear-gradient(90deg, transparent, ${
|
|
51
|
+
background: `linear-gradient(90deg, transparent, ${de.fg}, transparent)`,
|
|
50
52
|
opacity: .35,
|
|
51
53
|
pointerEvents: "none"
|
|
52
54
|
} }),
|
|
53
|
-
|
|
54
|
-
ref:
|
|
55
|
-
icon: /* @__PURE__ */
|
|
55
|
+
S && /* @__PURE__ */ _(r, {
|
|
56
|
+
ref: se,
|
|
57
|
+
icon: /* @__PURE__ */ _(n.menu, { size: 16 }),
|
|
56
58
|
title: P("shell.nav.open", "Open navigation"),
|
|
57
|
-
onClick:
|
|
59
|
+
onClick: x
|
|
58
60
|
}),
|
|
59
|
-
j && /* @__PURE__ */
|
|
61
|
+
j && /* @__PURE__ */ _("div", {
|
|
60
62
|
style: {
|
|
61
63
|
minWidth: 0,
|
|
62
64
|
maxWidth: Z ? "min(210px, 56vw)" : Q ? 230 : void 0,
|
|
63
65
|
flex: Z ? "1 1 auto" : "0 0 auto"
|
|
64
66
|
},
|
|
65
|
-
children: /* @__PURE__ */
|
|
67
|
+
children: /* @__PURE__ */ _(ne, {
|
|
66
68
|
tenant: L,
|
|
67
|
-
tenants:
|
|
68
|
-
|
|
69
|
-
|
|
69
|
+
tenants: le,
|
|
70
|
+
role: Y,
|
|
71
|
+
onSwitch: fe,
|
|
72
|
+
busy: z,
|
|
70
73
|
compact: Q,
|
|
71
74
|
locked: V,
|
|
72
75
|
lockedReason: V ? P("shell.impersonation.tenant_locked", "Exit impersonation to switch tenants") : void 0
|
|
73
76
|
})
|
|
74
77
|
}),
|
|
75
|
-
V && /* @__PURE__ */
|
|
78
|
+
V && /* @__PURE__ */ v("span", {
|
|
76
79
|
"data-testid": "impersonation-chip",
|
|
77
80
|
style: {
|
|
78
81
|
display: "inline-flex",
|
|
@@ -89,39 +92,39 @@ function S({ breadcrumbs: S, onCrumbClick: ne, onOpenNav: re, navButtonRef: ie,
|
|
|
89
92
|
letterSpacing: "0.05em"
|
|
90
93
|
},
|
|
91
94
|
children: [
|
|
92
|
-
/* @__PURE__ */
|
|
95
|
+
/* @__PURE__ */ _(n.users, { size: 11 }),
|
|
93
96
|
" ",
|
|
94
97
|
P("shell.impersonation.chip", "Impersonating")
|
|
95
98
|
]
|
|
96
99
|
}),
|
|
97
|
-
!Z && M && /* @__PURE__ */
|
|
100
|
+
!Z && M && /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("span", {
|
|
98
101
|
style: {
|
|
99
102
|
color: "var(--text-4)",
|
|
100
103
|
fontSize: 11
|
|
101
104
|
},
|
|
102
|
-
children: /* @__PURE__ */
|
|
103
|
-
}), /* @__PURE__ */
|
|
104
|
-
items:
|
|
105
|
-
onCrumbClick:
|
|
105
|
+
children: /* @__PURE__ */ _(n.right, { size: 10 })
|
|
106
|
+
}), /* @__PURE__ */ _(ie, {
|
|
107
|
+
items: y ?? [],
|
|
108
|
+
onCrumbClick: b
|
|
106
109
|
})] }),
|
|
107
|
-
/* @__PURE__ */
|
|
108
|
-
w && /* @__PURE__ */
|
|
109
|
-
ref:
|
|
110
|
-
icon: /* @__PURE__ */
|
|
110
|
+
/* @__PURE__ */ _("div", { style: { flex: 1 } }),
|
|
111
|
+
w && /* @__PURE__ */ _(r, {
|
|
112
|
+
ref: C,
|
|
113
|
+
icon: /* @__PURE__ */ _(n.layers, { size: 15 }),
|
|
111
114
|
title: P("shell.tabs.open_tabs_count", "Open tabs ({count})", { count: T }),
|
|
112
|
-
onClick:
|
|
115
|
+
onClick: ce
|
|
113
116
|
}),
|
|
114
|
-
Z ? /* @__PURE__ */
|
|
115
|
-
icon: /* @__PURE__ */
|
|
117
|
+
Z ? /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(r, {
|
|
118
|
+
icon: /* @__PURE__ */ _(n.search, { size: 15 }),
|
|
116
119
|
title: P("shell.palette.search", "Search or run command"),
|
|
117
120
|
onClick: E
|
|
118
|
-
}), D && /* @__PURE__ */
|
|
119
|
-
icon: /* @__PURE__ */
|
|
121
|
+
}), D && /* @__PURE__ */ _(r, {
|
|
122
|
+
icon: /* @__PURE__ */ _(n.sparkle, { size: 15 }),
|
|
120
123
|
title: P("shell.ai_assistant", "AI Assistant"),
|
|
121
124
|
onClick: D,
|
|
122
125
|
active: O
|
|
123
|
-
})] }) : /* @__PURE__ */
|
|
124
|
-
/* @__PURE__ */
|
|
126
|
+
})] }) : /* @__PURE__ */ v(g, { children: [
|
|
127
|
+
/* @__PURE__ */ v("button", {
|
|
125
128
|
onClick: E,
|
|
126
129
|
style: {
|
|
127
130
|
display: "flex",
|
|
@@ -138,44 +141,44 @@ function S({ breadcrumbs: S, onCrumbClick: ne, onOpenNav: re, navButtonRef: ie,
|
|
|
138
141
|
minWidth: 240
|
|
139
142
|
},
|
|
140
143
|
children: [
|
|
141
|
-
/* @__PURE__ */
|
|
142
|
-
/* @__PURE__ */
|
|
144
|
+
/* @__PURE__ */ _(n.search, { size: 13 }),
|
|
145
|
+
/* @__PURE__ */ _("span", {
|
|
143
146
|
style: {
|
|
144
147
|
flex: 1,
|
|
145
148
|
textAlign: "left"
|
|
146
149
|
},
|
|
147
150
|
children: P("shell.topbar.search_hint", "Search or run command…")
|
|
148
151
|
}),
|
|
149
|
-
/* @__PURE__ */
|
|
152
|
+
/* @__PURE__ */ _(a, { children: d("K") })
|
|
150
153
|
]
|
|
151
154
|
}),
|
|
152
|
-
/* @__PURE__ */
|
|
153
|
-
icon: /* @__PURE__ */
|
|
155
|
+
/* @__PURE__ */ _(r, {
|
|
156
|
+
icon: /* @__PURE__ */ _(n.bell, { size: 15 }),
|
|
154
157
|
title: P("shell.topbar.notifications", "Notifications")
|
|
155
158
|
}),
|
|
156
|
-
N && /* @__PURE__ */
|
|
157
|
-
icon:
|
|
159
|
+
N && /* @__PURE__ */ _(r, {
|
|
160
|
+
icon: _(U === "dark" ? n.sun : n.moon, { size: 15 }),
|
|
158
161
|
title: P("shell.topbar.theme", "Theme"),
|
|
159
162
|
onClick: $
|
|
160
163
|
}),
|
|
161
|
-
/* @__PURE__ */
|
|
162
|
-
icon: /* @__PURE__ */
|
|
164
|
+
/* @__PURE__ */ _(r, {
|
|
165
|
+
icon: /* @__PURE__ */ _(n.sparkle, { size: 15 }),
|
|
163
166
|
title: P("shell.ai_assistant", "AI Assistant"),
|
|
164
167
|
onClick: D,
|
|
165
168
|
active: O
|
|
166
169
|
}),
|
|
167
|
-
/* @__PURE__ */
|
|
170
|
+
/* @__PURE__ */ _("div", { style: {
|
|
168
171
|
width: 1,
|
|
169
172
|
height: 18,
|
|
170
173
|
background: "var(--divider)",
|
|
171
174
|
margin: "0 2px"
|
|
172
175
|
} })
|
|
173
176
|
] }),
|
|
174
|
-
/* @__PURE__ */
|
|
177
|
+
/* @__PURE__ */ v("div", {
|
|
175
178
|
style: { position: "relative" },
|
|
176
|
-
children: [/* @__PURE__ */
|
|
177
|
-
ref:
|
|
178
|
-
onClick: () =>
|
|
179
|
+
children: [/* @__PURE__ */ v("button", {
|
|
180
|
+
ref: K,
|
|
181
|
+
onClick: () => G((e) => !e),
|
|
179
182
|
style: {
|
|
180
183
|
display: "flex",
|
|
181
184
|
alignItems: "center",
|
|
@@ -186,50 +189,50 @@ function S({ breadcrumbs: S, onCrumbClick: ne, onOpenNav: re, navButtonRef: ie,
|
|
|
186
189
|
border: 0,
|
|
187
190
|
cursor: "pointer"
|
|
188
191
|
},
|
|
189
|
-
children: [/* @__PURE__ */
|
|
192
|
+
children: [/* @__PURE__ */ _(o, {
|
|
190
193
|
name: X,
|
|
191
194
|
size: 22
|
|
192
|
-
}), !Q && /* @__PURE__ */
|
|
195
|
+
}), !Q && /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("span", {
|
|
193
196
|
style: {
|
|
194
197
|
fontSize: 12,
|
|
195
198
|
color: "var(--text-2)"
|
|
196
199
|
},
|
|
197
|
-
children:
|
|
198
|
-
}), /* @__PURE__ */
|
|
200
|
+
children: J
|
|
201
|
+
}), /* @__PURE__ */ _(n.down, {
|
|
199
202
|
size: 11,
|
|
200
203
|
style: { color: "var(--text-3)" }
|
|
201
204
|
})] })]
|
|
202
|
-
}), /* @__PURE__ */
|
|
203
|
-
open:
|
|
204
|
-
anchor:
|
|
205
|
-
onClose: () =>
|
|
205
|
+
}), /* @__PURE__ */ v(s, {
|
|
206
|
+
open: ue,
|
|
207
|
+
anchor: K.current,
|
|
208
|
+
onClose: () => G(!1),
|
|
206
209
|
width: 220,
|
|
207
210
|
align: "end",
|
|
208
211
|
children: [
|
|
209
|
-
/* @__PURE__ */
|
|
212
|
+
/* @__PURE__ */ v("div", {
|
|
210
213
|
style: {
|
|
211
214
|
padding: "10px 10px 8px",
|
|
212
215
|
borderBottom: "1px solid var(--divider)"
|
|
213
216
|
},
|
|
214
|
-
children: [/* @__PURE__ */
|
|
217
|
+
children: [/* @__PURE__ */ v("div", {
|
|
215
218
|
style: {
|
|
216
219
|
display: "flex",
|
|
217
220
|
gap: 8,
|
|
218
221
|
alignItems: "center"
|
|
219
222
|
},
|
|
220
|
-
children: [/* @__PURE__ */
|
|
223
|
+
children: [/* @__PURE__ */ _(o, {
|
|
221
224
|
name: X,
|
|
222
225
|
size: 28
|
|
223
|
-
}), /* @__PURE__ */
|
|
226
|
+
}), /* @__PURE__ */ v("div", {
|
|
224
227
|
style: { minWidth: 0 },
|
|
225
|
-
children: [/* @__PURE__ */
|
|
228
|
+
children: [/* @__PURE__ */ _("div", {
|
|
226
229
|
style: {
|
|
227
230
|
fontSize: 12.5,
|
|
228
231
|
fontWeight: 600,
|
|
229
232
|
color: "var(--text)"
|
|
230
233
|
},
|
|
231
234
|
children: X
|
|
232
|
-
}), /* @__PURE__ */
|
|
235
|
+
}), /* @__PURE__ */ _("div", {
|
|
233
236
|
style: {
|
|
234
237
|
fontSize: 11,
|
|
235
238
|
color: "var(--text-3)",
|
|
@@ -237,61 +240,61 @@ function S({ breadcrumbs: S, onCrumbClick: ne, onOpenNav: re, navButtonRef: ie,
|
|
|
237
240
|
textOverflow: "ellipsis",
|
|
238
241
|
whiteSpace: "nowrap"
|
|
239
242
|
},
|
|
240
|
-
children:
|
|
243
|
+
children: J
|
|
241
244
|
})]
|
|
242
245
|
})]
|
|
243
|
-
}), L && /* @__PURE__ */
|
|
246
|
+
}), L && /* @__PURE__ */ v("div", {
|
|
244
247
|
style: {
|
|
245
248
|
marginTop: 8,
|
|
246
249
|
display: "flex",
|
|
247
250
|
gap: 4,
|
|
248
251
|
flexWrap: "wrap"
|
|
249
252
|
},
|
|
250
|
-
children: [/* @__PURE__ */
|
|
253
|
+
children: [/* @__PURE__ */ _(i, {
|
|
251
254
|
tone: "violet",
|
|
252
255
|
size: "xs",
|
|
253
256
|
dot: !0,
|
|
254
|
-
children:
|
|
255
|
-
}), /* @__PURE__ */
|
|
257
|
+
children: Y
|
|
258
|
+
}), /* @__PURE__ */ v(i, {
|
|
256
259
|
tone: "slate",
|
|
257
260
|
size: "xs",
|
|
258
|
-
children: [L.name,
|
|
261
|
+
children: [L.name, q ? ` · ${q}` : ""]
|
|
259
262
|
})]
|
|
260
263
|
})]
|
|
261
264
|
}),
|
|
262
|
-
V && /* @__PURE__ */
|
|
263
|
-
icon: /* @__PURE__ */
|
|
265
|
+
V && /* @__PURE__ */ _(l, {
|
|
266
|
+
icon: /* @__PURE__ */ _(n.x, { size: 13 }),
|
|
264
267
|
onClick: () => {
|
|
265
|
-
|
|
268
|
+
G(!1), H();
|
|
266
269
|
},
|
|
267
270
|
"data-testid": "exit-impersonation-menu-item",
|
|
268
271
|
children: P("shell.impersonation.exit", "Exit impersonation")
|
|
269
272
|
}),
|
|
270
|
-
/* @__PURE__ */
|
|
271
|
-
icon: /* @__PURE__ */
|
|
273
|
+
/* @__PURE__ */ _(l, {
|
|
274
|
+
icon: /* @__PURE__ */ _(n.users, { size: 13 }),
|
|
272
275
|
onClick: () => {
|
|
273
|
-
|
|
276
|
+
G(!1), k?.();
|
|
274
277
|
},
|
|
275
278
|
children: P("shell.user_menu.profile", "My profile")
|
|
276
279
|
}),
|
|
277
|
-
/* @__PURE__ */
|
|
278
|
-
icon: /* @__PURE__ */
|
|
280
|
+
/* @__PURE__ */ _(l, {
|
|
281
|
+
icon: /* @__PURE__ */ _(n.settings, { size: 13 }),
|
|
279
282
|
onClick: () => {
|
|
280
|
-
|
|
283
|
+
G(!1), A?.();
|
|
281
284
|
},
|
|
282
285
|
children: P("shell.user_menu.preferences", "Preferences")
|
|
283
286
|
}),
|
|
284
|
-
N && /* @__PURE__ */
|
|
285
|
-
icon: /* @__PURE__ */
|
|
287
|
+
N && /* @__PURE__ */ _(l, {
|
|
288
|
+
icon: /* @__PURE__ */ _(n.moon, { size: 13 }),
|
|
286
289
|
onClick: $,
|
|
287
290
|
children: P("shell.user_menu.toggle_theme", "Toggle theme")
|
|
288
291
|
}),
|
|
289
|
-
/* @__PURE__ */
|
|
290
|
-
/* @__PURE__ */
|
|
291
|
-
icon: /* @__PURE__ */
|
|
292
|
+
/* @__PURE__ */ _(l, { divider: !0 }),
|
|
293
|
+
/* @__PURE__ */ _(l, {
|
|
294
|
+
icon: /* @__PURE__ */ _(n.x, { size: 13 }),
|
|
292
295
|
danger: !0,
|
|
293
296
|
onClick: () => {
|
|
294
|
-
|
|
297
|
+
G(!1), B();
|
|
295
298
|
},
|
|
296
299
|
children: P("shell.user_menu.sign_out", "Sign out")
|
|
297
300
|
})
|
|
@@ -302,4 +305,4 @@ function S({ breadcrumbs: S, onCrumbClick: ne, onOpenNav: re, navButtonRef: ie,
|
|
|
302
305
|
});
|
|
303
306
|
}
|
|
304
307
|
//#endregion
|
|
305
|
-
export {
|
|
308
|
+
export { y as TopBar };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { failureTitle as e } from "../../lib/failure.js";
|
|
2
|
+
import { Icon as t } from "../primitives/Icons.js";
|
|
3
|
+
import { IconBtn as n } from "../primitives/IconBtn.js";
|
|
4
|
+
import { useText as r } from "../../hooks/useText.js";
|
|
5
|
+
import { BoolToggle as i } from "../primitives/BoolToggle.js";
|
|
6
|
+
import { Select as a, TextInput as o } from "../primitives/Fields.js";
|
|
7
7
|
import { toast as s } from "../../lib/toast.js";
|
|
8
8
|
import { useEffect as c, useRef as l, useState as u } from "react";
|
|
9
9
|
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
@@ -20,24 +20,24 @@ var m = {
|
|
|
20
20
|
gap: 4
|
|
21
21
|
};
|
|
22
22
|
function h({ value: h, onSave: g, type: _ = "text", options: v, trigger: y = "always", label: b, placeholder: x }) {
|
|
23
|
-
let S =
|
|
23
|
+
let S = r(), C = r("errors"), [w, T] = u(h), [E, D] = u(h), [O, k] = u(!1), [A, j] = u(h), M = l(null);
|
|
24
24
|
c(() => {
|
|
25
25
|
T(h), D(h), j(h);
|
|
26
26
|
}, [h]);
|
|
27
27
|
let N = () => {
|
|
28
28
|
j(E), k(!0);
|
|
29
|
-
}, P = async (
|
|
30
|
-
let
|
|
31
|
-
D(
|
|
29
|
+
}, P = async (t) => {
|
|
30
|
+
let n = w;
|
|
31
|
+
D(t), T(t), k(!1);
|
|
32
32
|
try {
|
|
33
|
-
await g(
|
|
34
|
-
} catch (
|
|
35
|
-
D(
|
|
36
|
-
let
|
|
33
|
+
await g(t);
|
|
34
|
+
} catch (t) {
|
|
35
|
+
D(n), T(n);
|
|
36
|
+
let r = e(C, t);
|
|
37
37
|
s.error(C("list.cell_unsaved", "The value could not be saved."), b ? S("list.cell.field_reason", "{field}: {reason}", {
|
|
38
38
|
field: b,
|
|
39
|
-
reason:
|
|
40
|
-
}) :
|
|
39
|
+
reason: r
|
|
40
|
+
}) : r);
|
|
41
41
|
}
|
|
42
42
|
}, F = () => {
|
|
43
43
|
j(E), k(!1);
|
|
@@ -54,31 +54,31 @@ function h({ value: h, onSave: g, type: _ = "text", options: v, trigger: y = "al
|
|
|
54
54
|
onKeyDown: (e) => {
|
|
55
55
|
e.key === "Enter" && I(), e.key === "Escape" && F();
|
|
56
56
|
},
|
|
57
|
-
children: [_ === "select" ? /* @__PURE__ */ f(
|
|
57
|
+
children: [_ === "select" ? /* @__PURE__ */ f(a, {
|
|
58
58
|
value: A,
|
|
59
59
|
options: v || [],
|
|
60
60
|
onChange: (e) => {
|
|
61
61
|
j(e), P(e);
|
|
62
62
|
}
|
|
63
|
-
}) : _ === "bool" ? /* @__PURE__ */ f(
|
|
63
|
+
}) : _ === "bool" ? /* @__PURE__ */ f(i, {
|
|
64
64
|
value: A === "true",
|
|
65
65
|
onChange: (e) => {
|
|
66
66
|
let t = String(e);
|
|
67
67
|
j(t), P(t);
|
|
68
68
|
}
|
|
69
|
-
}) : /* @__PURE__ */ f(
|
|
69
|
+
}) : /* @__PURE__ */ f(o, {
|
|
70
70
|
value: A ?? "",
|
|
71
71
|
onChange: j,
|
|
72
72
|
autoFocus: !0,
|
|
73
73
|
placeholder: x
|
|
74
|
-
}), _ !== "select" && _ !== "bool" && /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(
|
|
74
|
+
}), _ !== "select" && _ !== "bool" && /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(n, {
|
|
75
75
|
size: 24,
|
|
76
|
-
icon: /* @__PURE__ */ f(
|
|
76
|
+
icon: /* @__PURE__ */ f(t.check, { size: 13 }),
|
|
77
77
|
onClick: I,
|
|
78
78
|
title: S("dialog.save", "Save")
|
|
79
|
-
}), /* @__PURE__ */ f(
|
|
79
|
+
}), /* @__PURE__ */ f(n, {
|
|
80
80
|
size: 24,
|
|
81
|
-
icon: /* @__PURE__ */ f(
|
|
81
|
+
icon: /* @__PURE__ */ f(t.x, { size: 13 }),
|
|
82
82
|
onClick: F,
|
|
83
83
|
title: S("dialog.cancel", "Cancel")
|
|
84
84
|
})] })]
|