@declarion/react 0.84.0 → 0.86.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/components/layout/CommandPalette.impl.js +116 -114
- package/dist-lib/components/layout/Layout.js +1 -2
- package/dist-lib/components/pages/auth/SignIn.js +52 -52
- package/dist-lib/components/pages/auth/icons.js +11 -1
- package/dist-lib/index.d.ts +1 -2
- package/dist-lib/lib/actions.js +41 -38
- package/package.json +1 -1
|
@@ -5,126 +5,129 @@ import { useText as r } from "../../hooks/useText.js";
|
|
|
5
5
|
import { useResponsiveMode as i } from "../../hooks/useResponsiveMode.js";
|
|
6
6
|
import { DynamicIcon as a } from "../shared/DynamicIcon.js";
|
|
7
7
|
import { useBrandingIdentity as o } from "../../hooks/useBranding.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { screenOffersCreate as s } from "../../lib/actions.js";
|
|
9
|
+
import { useEffect as c, useMemo as l, useRef as u, useState as d } from "react";
|
|
10
|
+
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
10
11
|
//#region src/components/layout/CommandPalette.impl.tsx
|
|
11
|
-
var
|
|
12
|
-
function
|
|
12
|
+
var h = "Esc";
|
|
13
|
+
function g(t, n = 14) {
|
|
13
14
|
if (!t) return null;
|
|
14
15
|
let r = e[t];
|
|
15
|
-
return r ? /* @__PURE__ */
|
|
16
|
+
return r ? /* @__PURE__ */ p(r, { size: n }) : /* @__PURE__ */ p(a, {
|
|
16
17
|
name: t,
|
|
17
18
|
size: n
|
|
18
19
|
});
|
|
19
20
|
}
|
|
20
|
-
function
|
|
21
|
-
if (!n || !
|
|
22
|
-
let a = [],
|
|
21
|
+
function _(t, n, r) {
|
|
22
|
+
if (!n?.navigation || !n.screens) return [];
|
|
23
|
+
let { navigation: i, screens: a, entities: o, actions: c } = n, l = [], u = (n) => {
|
|
23
24
|
if (n.screen) {
|
|
24
|
-
let
|
|
25
|
-
if (
|
|
26
|
-
let
|
|
27
|
-
|
|
25
|
+
let i = a[n.screen];
|
|
26
|
+
if (i) {
|
|
27
|
+
let a = t(n.name) || n.screen;
|
|
28
|
+
l.push({
|
|
28
29
|
group: t("shell.palette.group.navigate", "Navigate"),
|
|
29
|
-
icon:
|
|
30
|
-
label: t("shell.palette.go_to", "Go to {name}", { name:
|
|
31
|
-
act: () =>
|
|
30
|
+
icon: g(n.icon || i.display?.icon || "folder"),
|
|
31
|
+
label: t("shell.palette.go_to", "Go to {name}", { name: a }),
|
|
32
|
+
act: () => r({
|
|
32
33
|
type: "nav",
|
|
33
34
|
id: n.screen,
|
|
34
|
-
route:
|
|
35
|
+
route: i.route
|
|
35
36
|
}),
|
|
36
37
|
actionType: "nav"
|
|
37
|
-
})
|
|
38
|
+
});
|
|
39
|
+
let u = i.entity ? o?.[i.entity] : void 0;
|
|
40
|
+
s(i, u, c) && l.push({
|
|
38
41
|
group: t("shell.palette.group.create", "Create"),
|
|
39
|
-
icon: /* @__PURE__ */
|
|
40
|
-
label: t("shell.palette.new_in_screen", "New {name}", { name:
|
|
41
|
-
act: () =>
|
|
42
|
+
icon: /* @__PURE__ */ p(e.plus, { size: 14 }),
|
|
43
|
+
label: t("shell.palette.new_in_screen", "New {name}", { name: t(u?.display?.name) || a }),
|
|
44
|
+
act: () => r({
|
|
42
45
|
type: "new",
|
|
43
46
|
id: n.screen,
|
|
44
|
-
route:
|
|
47
|
+
route: i.route
|
|
45
48
|
}),
|
|
46
49
|
actionType: "new"
|
|
47
50
|
});
|
|
48
51
|
}
|
|
49
52
|
}
|
|
50
|
-
for (let e of n.items || [])
|
|
51
|
-
for (let e of n.children || [])
|
|
53
|
+
for (let e of n.items || []) u(e);
|
|
54
|
+
for (let e of n.children || []) u(e);
|
|
52
55
|
};
|
|
53
|
-
for (let e of
|
|
54
|
-
return
|
|
56
|
+
for (let e of i) u(e);
|
|
57
|
+
return l;
|
|
55
58
|
}
|
|
56
|
-
function
|
|
57
|
-
let
|
|
58
|
-
|
|
59
|
-
a && (setTimeout(() =>
|
|
59
|
+
function v({ open: a, onClose: s, onAction: g, mode: v = "default", schema: y, includeAI: b = !0, aiName: x = "" }) {
|
|
60
|
+
let S = r(), C = o()?.app_name?.trim(), [w, T] = d(""), [E, D] = d(0), O = u(null), k = i().category === "phone";
|
|
61
|
+
c(() => {
|
|
62
|
+
a && (setTimeout(() => O.current?.focus(), 50), T(v === "new" ? S("shell.palette.new_in_screen", "New {name}").split("{name}")[0] : ""), D(0));
|
|
60
63
|
}, [
|
|
61
64
|
a,
|
|
62
65
|
v,
|
|
63
|
-
|
|
66
|
+
S
|
|
64
67
|
]);
|
|
65
|
-
let
|
|
68
|
+
let A = l(() => {
|
|
66
69
|
let t = [];
|
|
67
|
-
if (t.push(...
|
|
68
|
-
let n =
|
|
70
|
+
if (t.push(..._(S, y, g)), b) {
|
|
71
|
+
let n = S("shell.palette.group.ai", "AI");
|
|
69
72
|
t.push({
|
|
70
73
|
group: n,
|
|
71
|
-
icon: /* @__PURE__ */
|
|
72
|
-
label:
|
|
74
|
+
icon: /* @__PURE__ */ p(e.sparkle, { size: 14 }),
|
|
75
|
+
label: S("shell.palette.ai.draft_entity", "Draft YAML for new entity…"),
|
|
73
76
|
hint: "✨",
|
|
74
|
-
act: () =>
|
|
77
|
+
act: () => g({
|
|
75
78
|
type: "ai",
|
|
76
79
|
q: "draft entity"
|
|
77
80
|
}),
|
|
78
81
|
actionType: "ai"
|
|
79
82
|
}, {
|
|
80
83
|
group: n,
|
|
81
|
-
icon: /* @__PURE__ */
|
|
82
|
-
label:
|
|
84
|
+
icon: /* @__PURE__ */ p(e.sparkle, { size: 14 }),
|
|
85
|
+
label: S("shell.palette.ai.explain_record", "Explain this record with AI"),
|
|
83
86
|
hint: "✨",
|
|
84
|
-
act: () =>
|
|
87
|
+
act: () => g({ type: "ai-panel" }),
|
|
85
88
|
actionType: "ai-panel"
|
|
86
89
|
}, {
|
|
87
90
|
group: n,
|
|
88
|
-
icon: /* @__PURE__ */
|
|
89
|
-
label:
|
|
91
|
+
icon: /* @__PURE__ */ p(e.sparkle, { size: 14 }),
|
|
92
|
+
label: S("shell.palette.ai.summarize_rows", "Summarize activity on selected rows"),
|
|
90
93
|
hint: "✨",
|
|
91
|
-
act: () =>
|
|
94
|
+
act: () => g({ type: "ai-panel" }),
|
|
92
95
|
actionType: "ai-panel"
|
|
93
96
|
});
|
|
94
97
|
}
|
|
95
|
-
let n =
|
|
98
|
+
let n = S("shell.palette.group.tabs", "Tabs"), r = S("shell.palette.group.settings", "Settings");
|
|
96
99
|
return t.push({
|
|
97
100
|
group: n,
|
|
98
|
-
icon: /* @__PURE__ */
|
|
99
|
-
label:
|
|
100
|
-
act: () =>
|
|
101
|
+
icon: /* @__PURE__ */ p(e.x, { size: 14 }),
|
|
102
|
+
label: S("shell.tabs.close_all", "Close all tabs"),
|
|
103
|
+
act: () => g({
|
|
101
104
|
type: "tab-close",
|
|
102
105
|
tabCloseScope: "all"
|
|
103
106
|
}),
|
|
104
107
|
actionType: "tab-close"
|
|
105
108
|
}, {
|
|
106
109
|
group: n,
|
|
107
|
-
icon: /* @__PURE__ */
|
|
108
|
-
label:
|
|
109
|
-
act: () =>
|
|
110
|
+
icon: /* @__PURE__ */ p(e.x, { size: 14 }),
|
|
111
|
+
label: S("shell.tabs.close_other_tabs", "Close other tabs"),
|
|
112
|
+
act: () => g({
|
|
110
113
|
type: "tab-close",
|
|
111
114
|
tabCloseScope: "others"
|
|
112
115
|
}),
|
|
113
116
|
actionType: "tab-close"
|
|
114
117
|
}, {
|
|
115
118
|
group: n,
|
|
116
|
-
icon: /* @__PURE__ */
|
|
117
|
-
label:
|
|
118
|
-
act: () =>
|
|
119
|
+
icon: /* @__PURE__ */ p(e.x, { size: 14 }),
|
|
120
|
+
label: S("shell.tabs.close_right", "Close tabs to the right"),
|
|
121
|
+
act: () => g({
|
|
119
122
|
type: "tab-close",
|
|
120
123
|
tabCloseScope: "right"
|
|
121
124
|
}),
|
|
122
125
|
actionType: "tab-close"
|
|
123
126
|
}, {
|
|
124
127
|
group: r,
|
|
125
|
-
icon: /* @__PURE__ */
|
|
126
|
-
label:
|
|
127
|
-
act: () =>
|
|
128
|
+
icon: /* @__PURE__ */ p(e.settings, { size: 14 }),
|
|
129
|
+
label: S("shell.palette.open_preferences", "Open Preferences"),
|
|
130
|
+
act: () => g({
|
|
128
131
|
type: "nav",
|
|
129
132
|
id: "preferences",
|
|
130
133
|
route: "/preferences"
|
|
@@ -132,26 +135,25 @@ function _({ open: a, onClose: h, onAction: _, mode: v = "default", navigation:
|
|
|
132
135
|
actionType: "nav"
|
|
133
136
|
}, {
|
|
134
137
|
group: r,
|
|
135
|
-
icon: /* @__PURE__ */
|
|
136
|
-
label:
|
|
137
|
-
act: () =>
|
|
138
|
+
icon: /* @__PURE__ */ p(e.moon, { size: 14 }),
|
|
139
|
+
label: S("shell.palette.toggle_dark_mode", "Toggle dark mode"),
|
|
140
|
+
act: () => g({ type: "theme" }),
|
|
138
141
|
actionType: "theme"
|
|
139
142
|
}), v === "new" ? t.filter((e) => e.actionType === "new") : t;
|
|
140
143
|
}, [
|
|
141
|
-
|
|
144
|
+
S,
|
|
142
145
|
y,
|
|
143
146
|
b,
|
|
144
|
-
|
|
145
|
-
_,
|
|
147
|
+
g,
|
|
146
148
|
v
|
|
147
|
-
]),
|
|
148
|
-
return
|
|
149
|
-
|
|
149
|
+
]), j = w ? A.filter((e) => e.label.toLowerCase().includes(w.toLowerCase()) || e.group.toLowerCase().includes(w.toLowerCase())) : A, M = {};
|
|
150
|
+
return j.forEach((e, t) => {
|
|
151
|
+
M[e.group] = M[e.group] || [], M[e.group].push({
|
|
150
152
|
...e,
|
|
151
153
|
_i: t
|
|
152
154
|
});
|
|
153
|
-
}), a ? /* @__PURE__ */
|
|
154
|
-
onClick:
|
|
155
|
+
}), a ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("div", {
|
|
156
|
+
onClick: s,
|
|
155
157
|
style: {
|
|
156
158
|
position: "fixed",
|
|
157
159
|
inset: 0,
|
|
@@ -159,9 +161,9 @@ function _({ open: a, onClose: h, onAction: _, mode: v = "default", navigation:
|
|
|
159
161
|
zIndex: 70,
|
|
160
162
|
backdropFilter: "blur(3px)"
|
|
161
163
|
}
|
|
162
|
-
}), /* @__PURE__ */
|
|
164
|
+
}), /* @__PURE__ */ m("div", {
|
|
163
165
|
role: "dialog",
|
|
164
|
-
"aria-label":
|
|
166
|
+
"aria-label": S("shell.palette.label", "Command palette"),
|
|
165
167
|
"data-testid": "command-palette",
|
|
166
168
|
style: {
|
|
167
169
|
position: "fixed",
|
|
@@ -182,13 +184,13 @@ function _({ open: a, onClose: h, onAction: _, mode: v = "default", navigation:
|
|
|
182
184
|
minWidth: 0
|
|
183
185
|
},
|
|
184
186
|
onKeyDown: (e) => {
|
|
185
|
-
e.key === "ArrowDown" ? (e.preventDefault(),
|
|
187
|
+
e.key === "ArrowDown" ? (e.preventDefault(), D(Math.min(E + 1, j.length - 1))) : e.key === "ArrowUp" ? (e.preventDefault(), D(Math.max(E - 1, 0))) : e.key === "Enter" && j[E] ? (j[E].act(), s()) : e.key === "Enter" && b && w.trim() ? (e.preventDefault(), g({
|
|
186
188
|
type: "ai",
|
|
187
|
-
q:
|
|
188
|
-
}),
|
|
189
|
+
q: w.trim()
|
|
190
|
+
}), s()) : e.key === "Escape" && s();
|
|
189
191
|
},
|
|
190
192
|
children: [
|
|
191
|
-
/* @__PURE__ */
|
|
193
|
+
/* @__PURE__ */ m("div", {
|
|
192
194
|
style: {
|
|
193
195
|
display: "flex",
|
|
194
196
|
alignItems: "center",
|
|
@@ -198,17 +200,17 @@ function _({ open: a, onClose: h, onAction: _, mode: v = "default", navigation:
|
|
|
198
200
|
minWidth: 0
|
|
199
201
|
},
|
|
200
202
|
children: [
|
|
201
|
-
/* @__PURE__ */
|
|
203
|
+
/* @__PURE__ */ p(e.command, {
|
|
202
204
|
size: 15,
|
|
203
205
|
style: { color: "var(--text-3)" }
|
|
204
206
|
}),
|
|
205
|
-
/* @__PURE__ */
|
|
206
|
-
ref:
|
|
207
|
-
value:
|
|
207
|
+
/* @__PURE__ */ p("input", {
|
|
208
|
+
ref: O,
|
|
209
|
+
value: w,
|
|
208
210
|
onChange: (e) => {
|
|
209
|
-
|
|
211
|
+
T(e.target.value), D(0);
|
|
210
212
|
},
|
|
211
|
-
placeholder:
|
|
213
|
+
placeholder: b ? S("shell.palette.search_ai", "Search or run command — type / for AI") : S("shell.palette.search", "Search or run command"),
|
|
212
214
|
style: {
|
|
213
215
|
flex: 1,
|
|
214
216
|
border: 0,
|
|
@@ -219,23 +221,23 @@ function _({ open: a, onClose: h, onAction: _, mode: v = "default", navigation:
|
|
|
219
221
|
minWidth: 0
|
|
220
222
|
}
|
|
221
223
|
}),
|
|
222
|
-
|
|
223
|
-
icon: /* @__PURE__ */
|
|
224
|
-
title:
|
|
225
|
-
onClick:
|
|
224
|
+
k && /* @__PURE__ */ p(t, {
|
|
225
|
+
icon: /* @__PURE__ */ p(e.x, { size: 14 }),
|
|
226
|
+
title: S("shell.palette.close", "Close command palette"),
|
|
227
|
+
onClick: s
|
|
226
228
|
}),
|
|
227
|
-
!
|
|
229
|
+
!k && /* @__PURE__ */ p(n, { children: h })
|
|
228
230
|
]
|
|
229
231
|
}),
|
|
230
|
-
/* @__PURE__ */
|
|
232
|
+
/* @__PURE__ */ m("div", {
|
|
231
233
|
style: {
|
|
232
234
|
flex: 1,
|
|
233
235
|
overflowY: "auto",
|
|
234
236
|
padding: 6
|
|
235
237
|
},
|
|
236
|
-
children: [Object.entries(
|
|
238
|
+
children: [Object.entries(M).map(([e, t]) => /* @__PURE__ */ m("div", {
|
|
237
239
|
style: { marginBottom: 6 },
|
|
238
|
-
children: [/* @__PURE__ */
|
|
240
|
+
children: [/* @__PURE__ */ p("div", {
|
|
239
241
|
style: {
|
|
240
242
|
padding: "8px 10px 4px",
|
|
241
243
|
fontSize: 10,
|
|
@@ -245,11 +247,11 @@ function _({ open: a, onClose: h, onAction: _, mode: v = "default", navigation:
|
|
|
245
247
|
textTransform: "uppercase"
|
|
246
248
|
},
|
|
247
249
|
children: e
|
|
248
|
-
}), t.map((e) => /* @__PURE__ */
|
|
250
|
+
}), t.map((e) => /* @__PURE__ */ m("div", {
|
|
249
251
|
onClick: () => {
|
|
250
|
-
e.act(),
|
|
252
|
+
e.act(), s();
|
|
251
253
|
},
|
|
252
|
-
onMouseEnter: () =>
|
|
254
|
+
onMouseEnter: () => D(e._i),
|
|
253
255
|
style: {
|
|
254
256
|
display: "flex",
|
|
255
257
|
alignItems: "center",
|
|
@@ -257,19 +259,19 @@ function _({ open: a, onClose: h, onAction: _, mode: v = "default", navigation:
|
|
|
257
259
|
padding: "7px 10px",
|
|
258
260
|
borderRadius: "var(--radius-md)",
|
|
259
261
|
cursor: "pointer",
|
|
260
|
-
background: e._i ===
|
|
261
|
-
color: e._i ===
|
|
262
|
+
background: e._i === E ? "var(--accent-soft)" : "transparent",
|
|
263
|
+
color: e._i === E ? "var(--accent)" : "var(--text-2)",
|
|
262
264
|
minWidth: 0
|
|
263
265
|
},
|
|
264
266
|
children: [
|
|
265
|
-
/* @__PURE__ */
|
|
267
|
+
/* @__PURE__ */ p("span", {
|
|
266
268
|
style: {
|
|
267
|
-
color: e._i ===
|
|
269
|
+
color: e._i === E ? "var(--accent)" : "var(--text-3)",
|
|
268
270
|
display: "flex"
|
|
269
271
|
},
|
|
270
272
|
children: e.icon
|
|
271
273
|
}),
|
|
272
|
-
/* @__PURE__ */
|
|
274
|
+
/* @__PURE__ */ p("span", {
|
|
273
275
|
style: {
|
|
274
276
|
flex: 1,
|
|
275
277
|
minWidth: 0,
|
|
@@ -280,7 +282,7 @@ function _({ open: a, onClose: h, onAction: _, mode: v = "default", navigation:
|
|
|
280
282
|
},
|
|
281
283
|
children: e.label
|
|
282
284
|
}),
|
|
283
|
-
e.hint && /* @__PURE__ */
|
|
285
|
+
e.hint && /* @__PURE__ */ p("span", {
|
|
284
286
|
className: "mono",
|
|
285
287
|
style: {
|
|
286
288
|
fontSize: 10.5,
|
|
@@ -290,7 +292,7 @@ function _({ open: a, onClose: h, onAction: _, mode: v = "default", navigation:
|
|
|
290
292
|
})
|
|
291
293
|
]
|
|
292
294
|
}, `${e.group}:${e.label}`))]
|
|
293
|
-
}, e)),
|
|
295
|
+
}, e)), j.length === 0 && /* @__PURE__ */ m("div", {
|
|
294
296
|
style: {
|
|
295
297
|
padding: "24px 16px",
|
|
296
298
|
textAlign: "center",
|
|
@@ -298,26 +300,26 @@ function _({ open: a, onClose: h, onAction: _, mode: v = "default", navigation:
|
|
|
298
300
|
fontSize: 12.5
|
|
299
301
|
},
|
|
300
302
|
children: [
|
|
301
|
-
/* @__PURE__ */
|
|
303
|
+
/* @__PURE__ */ p(e.sparkle, {
|
|
302
304
|
size: 20,
|
|
303
305
|
style: {
|
|
304
306
|
color: "var(--accent)",
|
|
305
307
|
marginBottom: 8
|
|
306
308
|
}
|
|
307
309
|
}),
|
|
308
|
-
/* @__PURE__ */
|
|
309
|
-
|
|
310
|
+
/* @__PURE__ */ p("div", { children: b ? S("shell.palette.ask_prompt", "Press Enter to ask {name}:", { name: x }) : S("shell.palette.no_matches", "No matches") }),
|
|
311
|
+
b && /* @__PURE__ */ p("div", {
|
|
310
312
|
style: {
|
|
311
313
|
fontWeight: 600,
|
|
312
314
|
color: "var(--text)",
|
|
313
315
|
marginTop: 4
|
|
314
316
|
},
|
|
315
|
-
children:
|
|
317
|
+
children: S("shell.palette.ask_query", "“{query}”", { query: w })
|
|
316
318
|
})
|
|
317
319
|
]
|
|
318
320
|
})]
|
|
319
321
|
}),
|
|
320
|
-
/* @__PURE__ */
|
|
322
|
+
/* @__PURE__ */ m("div", {
|
|
321
323
|
style: {
|
|
322
324
|
padding: "8px 12px",
|
|
323
325
|
borderTop: "1px solid var(--divider)",
|
|
@@ -331,7 +333,7 @@ function _({ open: a, onClose: h, onAction: _, mode: v = "default", navigation:
|
|
|
331
333
|
minWidth: 0
|
|
332
334
|
},
|
|
333
335
|
children: [
|
|
334
|
-
/* @__PURE__ */
|
|
336
|
+
/* @__PURE__ */ m("span", {
|
|
335
337
|
style: {
|
|
336
338
|
display: "flex",
|
|
337
339
|
alignItems: "center",
|
|
@@ -339,12 +341,12 @@ function _({ open: a, onClose: h, onAction: _, mode: v = "default", navigation:
|
|
|
339
341
|
minWidth: 0
|
|
340
342
|
},
|
|
341
343
|
children: [
|
|
342
|
-
/* @__PURE__ */
|
|
344
|
+
/* @__PURE__ */ p(n, { children: "↑↓" }),
|
|
343
345
|
" ",
|
|
344
|
-
|
|
346
|
+
S("shell.palette.hint.navigate", "navigate")
|
|
345
347
|
]
|
|
346
348
|
}),
|
|
347
|
-
/* @__PURE__ */
|
|
349
|
+
/* @__PURE__ */ m("span", {
|
|
348
350
|
style: {
|
|
349
351
|
display: "flex",
|
|
350
352
|
alignItems: "center",
|
|
@@ -352,12 +354,12 @@ function _({ open: a, onClose: h, onAction: _, mode: v = "default", navigation:
|
|
|
352
354
|
minWidth: 0
|
|
353
355
|
},
|
|
354
356
|
children: [
|
|
355
|
-
/* @__PURE__ */
|
|
357
|
+
/* @__PURE__ */ p(n, { children: "↵" }),
|
|
356
358
|
" ",
|
|
357
|
-
|
|
359
|
+
S("shell.palette.hint.select", "select")
|
|
358
360
|
]
|
|
359
361
|
}),
|
|
360
|
-
|
|
362
|
+
b && /* @__PURE__ */ m("span", {
|
|
361
363
|
style: {
|
|
362
364
|
display: "flex",
|
|
363
365
|
alignItems: "center",
|
|
@@ -365,15 +367,15 @@ function _({ open: a, onClose: h, onAction: _, mode: v = "default", navigation:
|
|
|
365
367
|
minWidth: 0
|
|
366
368
|
},
|
|
367
369
|
children: [
|
|
368
|
-
/* @__PURE__ */
|
|
370
|
+
/* @__PURE__ */ p(n, { children: "/" }),
|
|
369
371
|
" ",
|
|
370
|
-
|
|
372
|
+
S("shell.palette.hint.ask_ai", "ask AI")
|
|
371
373
|
]
|
|
372
374
|
}),
|
|
373
|
-
/* @__PURE__ */
|
|
374
|
-
|
|
375
|
+
/* @__PURE__ */ p("div", { style: { flex: 1 } }),
|
|
376
|
+
C && /* @__PURE__ */ p("span", {
|
|
375
377
|
className: "mono",
|
|
376
|
-
children:
|
|
378
|
+
children: C
|
|
377
379
|
})
|
|
378
380
|
]
|
|
379
381
|
})
|
|
@@ -381,4 +383,4 @@ function _({ open: a, onClose: h, onAction: _, mode: v = "default", navigation:
|
|
|
381
383
|
})] }) : null;
|
|
382
384
|
}
|
|
383
385
|
//#endregion
|
|
384
|
-
export {
|
|
386
|
+
export { v as CommandPalette };
|
|
@@ -10,61 +10,61 @@ import { toast as f } from "../../../lib/toast.js";
|
|
|
10
10
|
import { useAuth as p } from "../../../hooks/useAuth.js";
|
|
11
11
|
import { AuthShell as m } from "./AuthShell.js";
|
|
12
12
|
import { BlankScreen as h } from "../../shared/BlankScreen.js";
|
|
13
|
-
import {
|
|
14
|
-
import { accessibleRedirectPath as
|
|
15
|
-
import { useEffect as
|
|
16
|
-
import { useQuery as
|
|
17
|
-
import { Fragment as
|
|
18
|
-
import { Link as
|
|
13
|
+
import { GitHubIcon as g, GoogleIcon as _, MicrosoftIcon as v } from "./icons.js";
|
|
14
|
+
import { accessibleRedirectPath as y } from "../../../lib/schema-routing.js";
|
|
15
|
+
import { useEffect as b, useState as x } from "react";
|
|
16
|
+
import { useQuery as S } from "@tanstack/react-query";
|
|
17
|
+
import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
18
|
+
import { Link as E, useNavigate as D, useSearchParams as O } from "react-router";
|
|
19
19
|
//#region src/components/pages/auth/SignIn.tsx
|
|
20
|
-
var
|
|
20
|
+
var k = "sso-failure", A = {
|
|
21
21
|
google: {
|
|
22
22
|
name: "Google",
|
|
23
|
-
icon: /* @__PURE__ */
|
|
23
|
+
icon: /* @__PURE__ */ w(_, { size: 14 })
|
|
24
24
|
},
|
|
25
25
|
microsoft: {
|
|
26
26
|
name: "Microsoft",
|
|
27
|
-
icon: /* @__PURE__ */
|
|
27
|
+
icon: /* @__PURE__ */ w(v, { size: 14 })
|
|
28
28
|
},
|
|
29
29
|
azure: {
|
|
30
30
|
name: "Microsoft",
|
|
31
|
-
icon: /* @__PURE__ */
|
|
31
|
+
icon: /* @__PURE__ */ w(v, { size: 14 })
|
|
32
32
|
},
|
|
33
33
|
github: {
|
|
34
34
|
name: "GitHub",
|
|
35
|
-
icon: /* @__PURE__ */
|
|
35
|
+
icon: /* @__PURE__ */ w(g, { size: 14 })
|
|
36
36
|
},
|
|
37
37
|
apple: {
|
|
38
38
|
name: "Apple",
|
|
39
|
-
icon: /* @__PURE__ */
|
|
39
|
+
icon: /* @__PURE__ */ w(a.shield, { size: 13 })
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
|
-
function
|
|
43
|
-
let g =
|
|
42
|
+
function j() {
|
|
43
|
+
let g = D(), [_] = O(), { login: v, isLoginPending: j, isAuthenticated: N } = p(), { data: P } = i(), F = s(), [I, L] = x(""), [R, z] = x(""), [B, V] = x(!0), H = e(_.get("next") || _.get("redirect")), U = _.get("sso_error"), W = s("errors"), { data: G, isPending: K } = S({
|
|
44
44
|
queryKey: ["check-setup"],
|
|
45
45
|
queryFn: t
|
|
46
|
-
}), { data: q } =
|
|
46
|
+
}), { data: q } = S({
|
|
47
47
|
queryKey: ["identity-providers"],
|
|
48
48
|
queryFn: () => n(),
|
|
49
49
|
staleTime: 6e4
|
|
50
50
|
});
|
|
51
|
-
if (
|
|
51
|
+
if (b(() => {
|
|
52
52
|
G?.needs_setup && g("/signup", { replace: !0 });
|
|
53
|
-
}, [G, g]),
|
|
53
|
+
}, [G, g]), b(() => {
|
|
54
54
|
if (!N || !P) return;
|
|
55
|
-
let e =
|
|
56
|
-
|
|
55
|
+
let e = y(H, P);
|
|
56
|
+
M(H, e) && f.warning(F("auth.inaccessible_redirect", "You do not have access to that page. We opened your default page instead.")), g(e, { replace: !0 });
|
|
57
57
|
}, [
|
|
58
58
|
N,
|
|
59
59
|
g,
|
|
60
60
|
H,
|
|
61
61
|
P,
|
|
62
62
|
F
|
|
63
|
-
]),
|
|
64
|
-
U && f.error(W(U, "Sign-in failed."), void 0, { id:
|
|
65
|
-
}, [W, U]), K || G?.needs_setup) return /* @__PURE__ */
|
|
63
|
+
]), b(() => {
|
|
64
|
+
U && f.error(W(U, "Sign-in failed."), void 0, { id: k });
|
|
65
|
+
}, [W, U]), K || G?.needs_setup) return /* @__PURE__ */ w(h, {});
|
|
66
66
|
function J(e) {
|
|
67
|
-
e.preventDefault(),
|
|
67
|
+
e.preventDefault(), v({
|
|
68
68
|
email: I,
|
|
69
69
|
password: R,
|
|
70
70
|
remember: B
|
|
@@ -72,10 +72,10 @@ function A() {
|
|
|
72
72
|
f.error(d(W, e));
|
|
73
73
|
} });
|
|
74
74
|
}
|
|
75
|
-
return /* @__PURE__ */
|
|
75
|
+
return /* @__PURE__ */ w(m, { children: /* @__PURE__ */ T("form", {
|
|
76
76
|
onSubmit: J,
|
|
77
77
|
children: [
|
|
78
|
-
/* @__PURE__ */
|
|
78
|
+
/* @__PURE__ */ w("div", {
|
|
79
79
|
style: {
|
|
80
80
|
fontSize: 10.5,
|
|
81
81
|
fontWeight: 700,
|
|
@@ -85,7 +85,7 @@ function A() {
|
|
|
85
85
|
},
|
|
86
86
|
children: F("auth.signin.eyebrow", "Welcome back")
|
|
87
87
|
}),
|
|
88
|
-
/* @__PURE__ */
|
|
88
|
+
/* @__PURE__ */ w("h2", {
|
|
89
89
|
style: {
|
|
90
90
|
margin: "6px 0 4px",
|
|
91
91
|
fontSize: 24,
|
|
@@ -94,7 +94,7 @@ function A() {
|
|
|
94
94
|
},
|
|
95
95
|
children: F("auth.signin.title", "Sign in")
|
|
96
96
|
}),
|
|
97
|
-
/* @__PURE__ */
|
|
97
|
+
/* @__PURE__ */ w("p", {
|
|
98
98
|
style: {
|
|
99
99
|
margin: "0 0 20px",
|
|
100
100
|
fontSize: 13,
|
|
@@ -102,7 +102,7 @@ function A() {
|
|
|
102
102
|
},
|
|
103
103
|
children: F("auth.signin.subtitle", "Use your corporate SSO or email & password.")
|
|
104
104
|
}),
|
|
105
|
-
q && q.length > 0 && /* @__PURE__ */
|
|
105
|
+
q && q.length > 0 && /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w("div", {
|
|
106
106
|
style: {
|
|
107
107
|
display: "flex",
|
|
108
108
|
flexDirection: "column",
|
|
@@ -110,11 +110,11 @@ function A() {
|
|
|
110
110
|
marginBottom: 12
|
|
111
111
|
},
|
|
112
112
|
children: q.map((e) => {
|
|
113
|
-
let t =
|
|
113
|
+
let t = A[e.slug.toLowerCase()] ?? {
|
|
114
114
|
name: e.name,
|
|
115
|
-
icon: /* @__PURE__ */
|
|
115
|
+
icon: /* @__PURE__ */ w(a.shield, { size: 13 })
|
|
116
116
|
};
|
|
117
|
-
return /* @__PURE__ */
|
|
117
|
+
return /* @__PURE__ */ w(o, {
|
|
118
118
|
size: "md",
|
|
119
119
|
style: {
|
|
120
120
|
justifyContent: "center",
|
|
@@ -127,7 +127,7 @@ function A() {
|
|
|
127
127
|
children: F("auth.signin.sso_continue", "Continue with {provider}", { provider: t.name })
|
|
128
128
|
}, e.slug);
|
|
129
129
|
})
|
|
130
|
-
}), /* @__PURE__ */
|
|
130
|
+
}), /* @__PURE__ */ T("div", {
|
|
131
131
|
style: {
|
|
132
132
|
display: "flex",
|
|
133
133
|
alignItems: "center",
|
|
@@ -135,12 +135,12 @@ function A() {
|
|
|
135
135
|
margin: "16px 0"
|
|
136
136
|
},
|
|
137
137
|
children: [
|
|
138
|
-
/* @__PURE__ */
|
|
138
|
+
/* @__PURE__ */ w("span", { style: {
|
|
139
139
|
flex: 1,
|
|
140
140
|
height: 1,
|
|
141
141
|
background: "var(--divider)"
|
|
142
142
|
} }),
|
|
143
|
-
/* @__PURE__ */
|
|
143
|
+
/* @__PURE__ */ w("span", {
|
|
144
144
|
style: {
|
|
145
145
|
fontSize: 10.5,
|
|
146
146
|
color: "var(--text-4)",
|
|
@@ -149,37 +149,37 @@ function A() {
|
|
|
149
149
|
},
|
|
150
150
|
children: F("auth.signin.sso_divider", "or with email")
|
|
151
151
|
}),
|
|
152
|
-
/* @__PURE__ */
|
|
152
|
+
/* @__PURE__ */ w("span", { style: {
|
|
153
153
|
flex: 1,
|
|
154
154
|
height: 1,
|
|
155
155
|
background: "var(--divider)"
|
|
156
156
|
} })
|
|
157
157
|
]
|
|
158
158
|
})] }),
|
|
159
|
-
/* @__PURE__ */
|
|
159
|
+
/* @__PURE__ */ T("div", {
|
|
160
160
|
style: {
|
|
161
161
|
display: "flex",
|
|
162
162
|
flexDirection: "column",
|
|
163
163
|
gap: 12
|
|
164
164
|
},
|
|
165
165
|
children: [
|
|
166
|
-
/* @__PURE__ */
|
|
166
|
+
/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w(c, { children: F("auth.field.email", "Email") }), /* @__PURE__ */ w(u, {
|
|
167
167
|
value: I,
|
|
168
168
|
onChange: L,
|
|
169
|
-
prefix: /* @__PURE__ */
|
|
169
|
+
prefix: /* @__PURE__ */ w(a.email, { size: 13 }),
|
|
170
170
|
placeholder: F("auth.field.email_placeholder", "you@company.com"),
|
|
171
171
|
autoFocus: !0,
|
|
172
172
|
required: !0
|
|
173
173
|
})] }),
|
|
174
|
-
/* @__PURE__ */
|
|
174
|
+
/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ T("div", {
|
|
175
175
|
style: {
|
|
176
176
|
display: "flex",
|
|
177
177
|
alignItems: "center"
|
|
178
178
|
},
|
|
179
179
|
children: [
|
|
180
|
-
/* @__PURE__ */
|
|
181
|
-
/* @__PURE__ */
|
|
182
|
-
/* @__PURE__ */
|
|
180
|
+
/* @__PURE__ */ w(c, { children: F("auth.field.password", "Password") }),
|
|
181
|
+
/* @__PURE__ */ w("div", { style: { flex: 1 } }),
|
|
182
|
+
/* @__PURE__ */ w(E, {
|
|
183
183
|
to: "/forgot",
|
|
184
184
|
style: {
|
|
185
185
|
fontSize: 11,
|
|
@@ -190,12 +190,12 @@ function A() {
|
|
|
190
190
|
children: F("auth.signin.forgot_link", "Forgot?")
|
|
191
191
|
})
|
|
192
192
|
]
|
|
193
|
-
}), /* @__PURE__ */
|
|
193
|
+
}), /* @__PURE__ */ w(l, {
|
|
194
194
|
value: R,
|
|
195
195
|
onChange: z,
|
|
196
196
|
placeholder: F("auth.signin.password_placeholder", "Your password")
|
|
197
197
|
})] }),
|
|
198
|
-
/* @__PURE__ */
|
|
198
|
+
/* @__PURE__ */ T("label", {
|
|
199
199
|
style: {
|
|
200
200
|
display: "flex",
|
|
201
201
|
alignItems: "center",
|
|
@@ -204,7 +204,7 @@ function A() {
|
|
|
204
204
|
color: "var(--text-2)"
|
|
205
205
|
},
|
|
206
206
|
children: [
|
|
207
|
-
/* @__PURE__ */
|
|
207
|
+
/* @__PURE__ */ w("input", {
|
|
208
208
|
type: "checkbox",
|
|
209
209
|
name: "remember",
|
|
210
210
|
checked: B,
|
|
@@ -214,7 +214,7 @@ function A() {
|
|
|
214
214
|
F("auth.signin.remember", "Keep me signed in on this device")
|
|
215
215
|
]
|
|
216
216
|
}),
|
|
217
|
-
/* @__PURE__ */
|
|
217
|
+
/* @__PURE__ */ w(o, {
|
|
218
218
|
type: "submit",
|
|
219
219
|
size: "md",
|
|
220
220
|
kind: "primary",
|
|
@@ -222,10 +222,10 @@ function A() {
|
|
|
222
222
|
justifyContent: "center",
|
|
223
223
|
width: "100%"
|
|
224
224
|
},
|
|
225
|
-
disabled:
|
|
226
|
-
children:
|
|
225
|
+
disabled: j,
|
|
226
|
+
children: j ? F("auth.signin.submitting", "Signing in…") : F("auth.signin.submit", "Continue")
|
|
227
227
|
}),
|
|
228
|
-
G?.signup_enabled && /* @__PURE__ */
|
|
228
|
+
G?.signup_enabled && /* @__PURE__ */ T("div", {
|
|
229
229
|
style: {
|
|
230
230
|
fontSize: 12,
|
|
231
231
|
color: "var(--text-3)",
|
|
@@ -235,7 +235,7 @@ function A() {
|
|
|
235
235
|
children: [
|
|
236
236
|
F("auth.signin.new_here", "New here?"),
|
|
237
237
|
" ",
|
|
238
|
-
/* @__PURE__ */
|
|
238
|
+
/* @__PURE__ */ w(E, {
|
|
239
239
|
to: "/signup",
|
|
240
240
|
style: {
|
|
241
241
|
color: "var(--accent-text)",
|
|
@@ -251,10 +251,10 @@ function A() {
|
|
|
251
251
|
]
|
|
252
252
|
}) });
|
|
253
253
|
}
|
|
254
|
-
function
|
|
254
|
+
function M(e, t) {
|
|
255
255
|
if (e === t) return !1;
|
|
256
256
|
let n = e.split(/[?#]/, 1)[0].replace(/\/+$/, "") || "/";
|
|
257
257
|
return n !== "/" && n !== "/admin";
|
|
258
258
|
}
|
|
259
259
|
//#endregion
|
|
260
|
-
export {
|
|
260
|
+
export { j as SignIn };
|
|
@@ -52,5 +52,15 @@ function r({ size: n = 14 }) {
|
|
|
52
52
|
]
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
|
+
function i({ size: t = 14 }) {
|
|
56
|
+
return /* @__PURE__ */ e("svg", {
|
|
57
|
+
width: t,
|
|
58
|
+
height: t,
|
|
59
|
+
viewBox: "0 0 16 16",
|
|
60
|
+
fill: "currentColor",
|
|
61
|
+
"aria-hidden": !0,
|
|
62
|
+
children: /* @__PURE__ */ e("path", { d: "M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z" })
|
|
63
|
+
});
|
|
64
|
+
}
|
|
55
65
|
//#endregion
|
|
56
|
-
export { n as GoogleIcon, r as MicrosoftIcon };
|
|
66
|
+
export { i as GitHubIcon, n as GoogleIcon, r as MicrosoftIcon };
|
package/dist-lib/index.d.ts
CHANGED
|
@@ -2125,8 +2125,7 @@ interface CommandPaletteProps {
|
|
|
2125
2125
|
onClose: () => void;
|
|
2126
2126
|
onAction: (a: CommandAction) => void;
|
|
2127
2127
|
mode?: "default" | "new";
|
|
2128
|
-
|
|
2129
|
-
screens?: Record<string, Screen>;
|
|
2128
|
+
schema?: Partial<Pick<Schema, "navigation" | "screens" | "entities" | "actions">>;
|
|
2130
2129
|
includeAI?: boolean;
|
|
2131
2130
|
aiName?: string;
|
|
2132
2131
|
}
|
package/dist-lib/lib/actions.js
CHANGED
|
@@ -110,24 +110,27 @@ function x(e, n) {
|
|
|
110
110
|
return !r || t(n, r);
|
|
111
111
|
});
|
|
112
112
|
}
|
|
113
|
-
function S(e) {
|
|
113
|
+
function S(e, n, r) {
|
|
114
|
+
return e?.type !== "list" || !e.entity || !t(n, "create") ? !1 : x(y(n?.actions, e.actions, "list_toolbar", r), n).some(({ code: e }) => e === "__new" || e === "__create");
|
|
115
|
+
}
|
|
116
|
+
function C(e) {
|
|
114
117
|
return !!e?.confirmation && Object.keys(e.confirmation).length > 0;
|
|
115
118
|
}
|
|
116
|
-
function
|
|
117
|
-
return
|
|
119
|
+
function w(e, t) {
|
|
120
|
+
return C(t) ? e(t.confirmation) : t?.destructive ? e("action.confirm.destructive", "This action cannot be undone.") : null;
|
|
118
121
|
}
|
|
119
|
-
function
|
|
120
|
-
return
|
|
122
|
+
function T(e) {
|
|
123
|
+
return C(e) || !!e?.destructive;
|
|
121
124
|
}
|
|
122
|
-
function
|
|
125
|
+
function E(e, t, n, r, i, a = !1) {
|
|
123
126
|
if (r && i) return i;
|
|
124
127
|
let o = e(t?.display?.description);
|
|
125
128
|
return o ? a || t?.display?.icon_only === !0 ? `${n}\n${o}` : o : n;
|
|
126
129
|
}
|
|
127
|
-
function
|
|
130
|
+
function D(e) {
|
|
128
131
|
return !!e.association;
|
|
129
132
|
}
|
|
130
|
-
function
|
|
133
|
+
function O(e, t) {
|
|
131
134
|
if (e) {
|
|
132
135
|
for (let n of Object.values(e.screens)) if (n.entity === t && n.type === "list") {
|
|
133
136
|
let r = e.entities[t];
|
|
@@ -138,21 +141,21 @@ function D(e, t) {
|
|
|
138
141
|
}
|
|
139
142
|
}
|
|
140
143
|
}
|
|
141
|
-
function
|
|
144
|
+
function k(e, t, n, r, i, a, o, s) {
|
|
142
145
|
let c = [];
|
|
143
146
|
for (let l of t) {
|
|
144
|
-
let t =
|
|
147
|
+
let t = A(e, l, n, r, i, a, o, s);
|
|
145
148
|
t !== null && c.push(t);
|
|
146
149
|
}
|
|
147
150
|
return c;
|
|
148
151
|
}
|
|
149
|
-
function k(e, t, n, r, i, a, o, s) {
|
|
150
|
-
return t.kind === "group" ? A(e, t, n, r, i, a, o, s) : j(e, t, n, r, i, a, o, s);
|
|
151
|
-
}
|
|
152
152
|
function A(e, t, n, r, i, a, o, s) {
|
|
153
|
+
return t.kind === "group" ? j(e, t, n, r, i, a, o, s) : M(e, t, n, r, i, a, o, s);
|
|
154
|
+
}
|
|
155
|
+
function j(e, t, n, r, i, a, o, s) {
|
|
153
156
|
let c = [];
|
|
154
157
|
for (let l of t.items) {
|
|
155
|
-
let t =
|
|
158
|
+
let t = A(e, l, n, r, i, a, o, s);
|
|
156
159
|
t !== null && c.push(t);
|
|
157
160
|
}
|
|
158
161
|
return c.length === 0 ? null : {
|
|
@@ -160,29 +163,29 @@ function A(e, t, n, r, i, a, o, s) {
|
|
|
160
163
|
items: c
|
|
161
164
|
};
|
|
162
165
|
}
|
|
163
|
-
function
|
|
166
|
+
function M(e, t, n, r, i, a, o, s) {
|
|
164
167
|
if (s && !t.code.startsWith("__") && !s.has(t.code)) return null;
|
|
165
|
-
let c =
|
|
168
|
+
let c = F(t.code, n, r);
|
|
166
169
|
if (!c) return null;
|
|
167
170
|
let l = b(t.code, o);
|
|
168
171
|
if (a.length > 0) {
|
|
169
|
-
let n =
|
|
172
|
+
let n = N(e, c, a, l);
|
|
170
173
|
return n.visible ? {
|
|
171
174
|
...t,
|
|
172
175
|
enabled: n.enabled,
|
|
173
176
|
reason: n.reason
|
|
174
177
|
} : null;
|
|
175
178
|
}
|
|
176
|
-
if (!l(i) || !d(c.conditions, i) || !d(
|
|
177
|
-
let { enabled: u, reason: f } =
|
|
179
|
+
if (!l(i) || !d(c.conditions, i) || !d(I(c.visible_if), i)) return null;
|
|
180
|
+
let { enabled: u, reason: f } = P(e, c, i);
|
|
178
181
|
return {
|
|
179
182
|
...t,
|
|
180
183
|
enabled: u,
|
|
181
184
|
reason: f
|
|
182
185
|
};
|
|
183
186
|
}
|
|
184
|
-
function
|
|
185
|
-
let i =
|
|
187
|
+
function N(e, t, n, r) {
|
|
188
|
+
let i = I(t.visible_if), a = I(t.enabled_if), o = t.conditions, s = 0, c = 0, l = 0;
|
|
186
189
|
for (let e of n) {
|
|
187
190
|
let t = r(e);
|
|
188
191
|
t || l++;
|
|
@@ -223,8 +226,8 @@ function M(e, t, n, r) {
|
|
|
223
226
|
}) : e("action.bulk.rows_fail", "({failing} of {total} rows fail)", f)
|
|
224
227
|
};
|
|
225
228
|
}
|
|
226
|
-
function
|
|
227
|
-
let r =
|
|
229
|
+
function P(e, t, n) {
|
|
230
|
+
let r = I(t.enabled_if);
|
|
228
231
|
return !r || r.length === 0 || d(r, n) ? {
|
|
229
232
|
enabled: !0,
|
|
230
233
|
reason: null
|
|
@@ -233,46 +236,46 @@ function N(e, t, n) {
|
|
|
233
236
|
reason: e(t.enabled_if_reason) || null
|
|
234
237
|
};
|
|
235
238
|
}
|
|
236
|
-
function
|
|
239
|
+
function F(e, t, n) {
|
|
237
240
|
if (t && e in t) return t[e];
|
|
238
241
|
if (n && e in n) return n[e];
|
|
239
242
|
}
|
|
240
|
-
function
|
|
243
|
+
function I(e) {
|
|
241
244
|
return e;
|
|
242
245
|
}
|
|
243
|
-
function
|
|
246
|
+
function L(e, t, n, r, i) {
|
|
244
247
|
let a = [];
|
|
245
248
|
for (let o of e) {
|
|
246
249
|
if (o.kind === "group") {
|
|
247
|
-
let e =
|
|
250
|
+
let e = L(o.items, t, n, r, i);
|
|
248
251
|
e.length > 0 && a.push({
|
|
249
252
|
...o,
|
|
250
253
|
items: e
|
|
251
254
|
});
|
|
252
255
|
continue;
|
|
253
256
|
}
|
|
254
|
-
let e =
|
|
257
|
+
let e = F(o.code, t, n);
|
|
255
258
|
e && e.visibility?.includes(r) && (i?.bulkRequired === void 0 || (i.bulkRequiredPredicate ? i.bulkRequiredPredicate(e) : !1) === i.bulkRequired) && (i?.excludeIf && i.excludeIf(e) || a.push(o));
|
|
256
259
|
}
|
|
257
260
|
return a;
|
|
258
261
|
}
|
|
259
|
-
function
|
|
262
|
+
function R(e, t, n, r, i, a) {
|
|
260
263
|
let o = e ?? t;
|
|
261
|
-
return o ?
|
|
262
|
-
}
|
|
263
|
-
function R(e) {
|
|
264
|
-
return e.requires_selection === void 0 ? z(e) : e.requires_selection;
|
|
264
|
+
return o ? L(o, n, r, i, a) : H(n, i);
|
|
265
265
|
}
|
|
266
266
|
function z(e) {
|
|
267
|
+
return e.requires_selection === void 0 ? B(e) : e.requires_selection;
|
|
268
|
+
}
|
|
269
|
+
function B(e) {
|
|
267
270
|
return e.visibility?.includes("list_floatbar") ?? !1;
|
|
268
271
|
}
|
|
269
|
-
function
|
|
272
|
+
function V(e, t, n, r, i) {
|
|
270
273
|
return e.map((e) => {
|
|
271
274
|
if (e.kind === "group") return {
|
|
272
275
|
...e,
|
|
273
|
-
items:
|
|
276
|
+
items: V(e.items, t, n, r, i)
|
|
274
277
|
};
|
|
275
|
-
let a =
|
|
278
|
+
let a = F(e.code, t, n);
|
|
276
279
|
return a && r(a) ? {
|
|
277
280
|
...e,
|
|
278
281
|
enabled: !1,
|
|
@@ -280,7 +283,7 @@ function B(e, t, n, r, i) {
|
|
|
280
283
|
} : e;
|
|
281
284
|
});
|
|
282
285
|
}
|
|
283
|
-
function
|
|
286
|
+
function H(e, t) {
|
|
284
287
|
return e ? Object.entries(e).filter(([, e]) => e.visibility?.includes(t)).sort(([e, t], [n, r]) => {
|
|
285
288
|
let i = t.position ?? 0, a = r.position ?? 0;
|
|
286
289
|
return i === a ? e < n ? -1 : +(e > n) : i - a;
|
|
@@ -292,4 +295,4 @@ function V(e, t) {
|
|
|
292
295
|
})) : [];
|
|
293
296
|
}
|
|
294
297
|
//#endregion
|
|
295
|
-
export { c as EDIT_ACTION_CODE, s as OPEN_ACTION_CODE, o as PEEK_ACTION_CODE, m as actionConditionFieldValue,
|
|
298
|
+
export { c as EDIT_ACTION_CODE, s as OPEN_ACTION_CODE, o as PEEK_ACTION_CODE, m as actionConditionFieldValue, w as actionConfirmMessage, B as actionInFloatbarSlot, T as actionNeedsConfirm, z as actionRequiresSelection, E as actionTooltip, k as applyRowState, H as defaultFlatForSlot, V as disableLeavesWhere, d as evaluateConditions, L as filterLayoutForSlot, x as filterUnavailableMutationActions, O as findListScreenForEntity, v as getActionsByVisibility, y as getScreenActions, D as isAssociationAction, l as isNavDefaultCode, R as resolveActionLayoutForSlot, u as rowDetailId, S as screenOffersCreate, h as withActionConditionFields };
|