@declarion/react 0.45.0 → 0.48.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/{DraggableChildrenTable-BDnJK0AU.js → DraggableChildrenTable-p2ZSdwzj.js} +2 -2
- package/dist-lib/{DynamicIcon-DeRpAaXm.js → DynamicIcon-Dc2j-rg_.js} +19 -17
- package/dist-lib/{Grid-CcCveEE7.js → Grid-CjLFAKMZ.js} +2 -2
- package/dist-lib/{LayoutRenderer-BReuhVdX.js → LayoutRenderer-X3p4yfo_.js} +598 -585
- package/dist-lib/{MarkdownRenderer-DPKDFR60.js → MarkdownRenderer-Sb7zcvj0.js} +10 -10
- package/dist-lib/{RefreshControl-KddgOhUG.js → RefreshControl-Cnl9nE0x.js} +268 -238
- package/dist-lib/{SmartDetailPage.impl-D_hMxiHy.js → SmartDetailPage.impl-bb0UNOII.js} +545 -532
- package/dist-lib/{SmartRecordListPage.impl-GIo_mPIJ.js → SmartRecordListPage.impl-BFh8auUZ.js} +171 -158
- package/dist-lib/api/agents.d.ts +47 -18
- package/dist-lib/components/agents/AgentChatPanel.d.ts +7 -1
- package/dist-lib/components/agents/AgentPicker.d.ts +9 -0
- package/dist-lib/components/agents/transcript-runs.d.ts +29 -0
- package/dist-lib/components/file-widgets/host.d.ts +1 -0
- package/dist-lib/components/list/QuickPeek.d.ts +1 -1
- package/dist-lib/components/pages/list/ListFloatbar.d.ts +4 -2
- package/dist-lib/components/pages/list/cardProjection.d.ts +2 -1
- package/dist-lib/components/primitives/Tooltip.d.ts +4 -0
- package/dist-lib/components/shared/ResponsiveActionBar.d.ts +10 -5
- package/dist-lib/components/shared/RowActionsKebab.d.ts +3 -2
- package/dist-lib/components/views/ViewSwitcher.d.ts +2 -1
- package/dist-lib/declarion-react.css +1 -1
- package/dist-lib/hooks/useAgentConversation.d.ts +10 -24
- package/dist-lib/hooks/useBrandingChrome.d.ts +11 -0
- package/dist-lib/hooks/useFilters.d.ts +1 -0
- package/dist-lib/hooks/useLongPress.d.ts +29 -0
- package/dist-lib/hooks/useResponsiveMode.d.ts +2 -21
- package/dist-lib/icons.js +1 -1
- package/dist-lib/index.d.ts +10 -3
- package/dist-lib/index.js +3305 -2741
- package/dist-lib/lib/actions.d.ts +13 -5
- package/dist-lib/lib/filter-evaluator.d.ts +16 -0
- package/dist-lib/lib/filters.d.ts +10 -4
- package/dist-lib/lib/longPressGesture.d.ts +55 -0
- package/dist-lib/lib/messages.d.ts +1 -0
- package/dist-lib/lib/page-inset.d.ts +3 -0
- package/dist-lib/lib/variants.d.ts +7 -0
- package/dist-lib/lib/viewport-category.d.ts +44 -0
- package/dist-lib/{registry-DJKp0yaV.js → registry-CWDnxiLJ.js} +1291 -1008
- package/dist-lib/testing.js +10 -10
- package/dist-lib/types/api.d.ts +15 -2
- package/dist-lib/types/schema.d.ts +26 -0
- package/dist-lib/{useCurrentScreen-A3xZDs7U.js → useCurrentScreen-BshVTPVq.js} +1124 -1088
- package/dist-lib/{useProperties-TlltWwLv.js → useProperties-B5p9mIH8.js} +92 -61
- package/dist-lib/{value-CHY7LgZ-.js → value-B1O6QikE.js} +1 -1
- package/dist-lib/vite/index.js +23 -22
- package/package.json +12 -12
- package/dist-lib/components/agents/AgentVisualHints.d.ts +0 -6
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { s as e } from "./DynamicIcon-
|
|
2
|
-
import { Gt as t, Qn as n, Rn as r, St as i, Tn as a, Zn as o, bt as s, cr as c, i as l, jt as u, lr as d, mt as f,
|
|
3
|
-
import { useCallback as
|
|
4
|
-
import { useLocation as
|
|
5
|
-
import { useQuery as
|
|
6
|
-
import { Fragment as
|
|
7
|
-
import { createPortal as
|
|
8
|
-
import { create as
|
|
1
|
+
import { s as e } from "./DynamicIcon-Dc2j-rg_.js";
|
|
2
|
+
import { Gt as t, Qn as n, Rn as r, St as i, Tn as a, Zn as o, bt as s, cr as c, i as l, jt as u, lr as d, mt as f, nr as p, or as m, pt as h, tr as g, ur as ee } from "./useCurrentScreen-BshVTPVq.js";
|
|
3
|
+
import { useCallback as _, useEffect as v, useId as y, useMemo as b, useRef as x, useState as S } from "react";
|
|
4
|
+
import { useLocation as C } from "react-router";
|
|
5
|
+
import { useQuery as w, useQueryClient as T } from "@tanstack/react-query";
|
|
6
|
+
import { Fragment as E, jsx as D, jsxs as O } from "react/jsx-runtime";
|
|
7
|
+
import { createPortal as k } from "react-dom";
|
|
8
|
+
import { create as A } from "zustand";
|
|
9
9
|
//#region src/components/primitives/Avatar.tsx
|
|
10
|
-
function
|
|
10
|
+
function j({ name: e, size: t = 22, color: n }) {
|
|
11
11
|
let r = e.split(/\s+/).map((e) => e[0]).slice(0, 2).join("").toUpperCase(), i = e.split("").reduce((e, t) => e + t.charCodeAt(0), 0), a = [
|
|
12
12
|
"#DCE4F6",
|
|
13
13
|
"#E4DCF6",
|
|
@@ -17,8 +17,8 @@ function A({ name: e, size: t = 22, color: n }) {
|
|
|
17
17
|
"#DCF6F1",
|
|
18
18
|
"#F1F6DC",
|
|
19
19
|
"#F6DCF1"
|
|
20
|
-
];
|
|
21
|
-
return /* @__PURE__ */
|
|
20
|
+
], o = n || a[i % a.length];
|
|
21
|
+
return /* @__PURE__ */ D("span", {
|
|
22
22
|
style: {
|
|
23
23
|
display: "inline-flex",
|
|
24
24
|
alignItems: "center",
|
|
@@ -26,7 +26,7 @@ function A({ name: e, size: t = 22, color: n }) {
|
|
|
26
26
|
width: t,
|
|
27
27
|
height: t,
|
|
28
28
|
borderRadius: 999,
|
|
29
|
-
background:
|
|
29
|
+
background: o,
|
|
30
30
|
color: "#1E2A4A",
|
|
31
31
|
fontSize: t < 20 ? 9.5 : 10.5,
|
|
32
32
|
fontWeight: 600,
|
|
@@ -37,26 +37,26 @@ function A({ name: e, size: t = 22, color: n }) {
|
|
|
37
37
|
}
|
|
38
38
|
//#endregion
|
|
39
39
|
//#region src/components/primitives/Tooltip.tsx
|
|
40
|
-
var
|
|
41
|
-
function
|
|
42
|
-
let [n, r] =
|
|
40
|
+
var te = 350, ne = 80, M = 260, N = 6, P = 4;
|
|
41
|
+
function F(e, t) {
|
|
42
|
+
let [n, r] = S(!1), [i, a] = S(null), o = x(null), s = x(null), c = x(null), l = y(), u = _(() => {
|
|
43
43
|
s.current && clearTimeout(s.current), c.current && clearTimeout(c.current), s.current = null, c.current = null;
|
|
44
|
-
}, []), d =
|
|
44
|
+
}, []), d = _(() => {
|
|
45
45
|
let t = e.current;
|
|
46
46
|
if (!t) return;
|
|
47
|
-
let n = t.getBoundingClientRect(), r = o.current, i = r?.offsetWidth ??
|
|
48
|
-
c = Math.max(
|
|
49
|
-
let l = n.top -
|
|
47
|
+
let n = t.getBoundingClientRect(), r = o.current, i = r?.offsetWidth ?? M, s = r?.offsetHeight ?? 0, c = n.left + n.width / 2 - i / 2;
|
|
48
|
+
c = Math.max(P, Math.min(c, window.innerWidth - i - P));
|
|
49
|
+
let l = n.top - N - s < P ? n.bottom + N : n.top - N - s;
|
|
50
50
|
a({
|
|
51
51
|
left: c,
|
|
52
52
|
top: l
|
|
53
53
|
});
|
|
54
|
-
}, [e]), f =
|
|
55
|
-
t && (u(), e ? r(!0) : s.current = setTimeout(() => r(!0),
|
|
56
|
-
}, [u, t]), p =
|
|
57
|
-
u(), c.current = setTimeout(() => r(!1),
|
|
54
|
+
}, [e]), f = _((e) => {
|
|
55
|
+
t && (u(), e ? r(!0) : s.current = setTimeout(() => r(!0), te));
|
|
56
|
+
}, [u, t]), p = _(() => {
|
|
57
|
+
u(), c.current = setTimeout(() => r(!1), ne);
|
|
58
58
|
}, [u]);
|
|
59
|
-
|
|
59
|
+
v(() => {
|
|
60
60
|
if (!n) {
|
|
61
61
|
a(null);
|
|
62
62
|
return;
|
|
@@ -66,13 +66,20 @@ function I(e, t) {
|
|
|
66
66
|
return window.addEventListener("scroll", e, !0), window.addEventListener("resize", e), () => {
|
|
67
67
|
window.removeEventListener("scroll", e, !0), window.removeEventListener("resize", e);
|
|
68
68
|
};
|
|
69
|
-
}, [n, d]),
|
|
69
|
+
}, [n, d]), v(() => u, [u]), v(() => {
|
|
70
|
+
if (!n) return;
|
|
71
|
+
let t = (t) => {
|
|
72
|
+
let n = e.current;
|
|
73
|
+
n && t.target instanceof Node && n.contains(t.target) || r(!1);
|
|
74
|
+
};
|
|
75
|
+
return document.addEventListener("pointerdown", t, !0), () => document.removeEventListener("pointerdown", t, !0);
|
|
76
|
+
}, [n, e]);
|
|
70
77
|
let m = {
|
|
71
78
|
position: "fixed",
|
|
72
79
|
left: i?.left ?? 0,
|
|
73
80
|
top: i?.top ?? 0,
|
|
74
81
|
zIndex: 1e3,
|
|
75
|
-
maxWidth:
|
|
82
|
+
maxWidth: M,
|
|
76
83
|
padding: "5px 8px",
|
|
77
84
|
borderRadius: 6,
|
|
78
85
|
background: "var(--surface-inverse, #1f2430)",
|
|
@@ -83,7 +90,7 @@ function I(e, t) {
|
|
|
83
90
|
pointerEvents: "none",
|
|
84
91
|
visibility: i ? "visible" : "hidden",
|
|
85
92
|
whiteSpace: "normal"
|
|
86
|
-
}, h = n && t ?
|
|
93
|
+
}, h = n && t ? k(/* @__PURE__ */ D("div", {
|
|
87
94
|
ref: o,
|
|
88
95
|
id: l,
|
|
89
96
|
role: "tooltip",
|
|
@@ -96,15 +103,18 @@ function I(e, t) {
|
|
|
96
103
|
onMouseEnter: () => f(!1),
|
|
97
104
|
onMouseLeave: p,
|
|
98
105
|
onFocus: () => f(!0),
|
|
99
|
-
onBlur: p
|
|
106
|
+
onBlur: p,
|
|
107
|
+
onPointerUp: (e) => {
|
|
108
|
+
e.pointerType === "mouse" || !t || (u(), r((e) => !e));
|
|
109
|
+
}
|
|
100
110
|
},
|
|
101
111
|
describedBy: n && t ? l : void 0,
|
|
102
112
|
portal: h
|
|
103
113
|
};
|
|
104
114
|
}
|
|
105
|
-
function
|
|
106
|
-
let r =
|
|
107
|
-
return e ? /* @__PURE__ */
|
|
115
|
+
function re({ content: e, children: t, triggerProps: n }) {
|
|
116
|
+
let r = x(null), { triggerHandlers: i, describedBy: a, portal: o } = F(r, e);
|
|
117
|
+
return e ? /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D("span", {
|
|
108
118
|
...n,
|
|
109
119
|
ref: r,
|
|
110
120
|
"aria-describedby": a,
|
|
@@ -115,12 +125,12 @@ function ee({ content: e, children: t, triggerProps: n }) {
|
|
|
115
125
|
},
|
|
116
126
|
...i,
|
|
117
127
|
children: t
|
|
118
|
-
}), o] }) : /* @__PURE__ */ E
|
|
128
|
+
}), o] }) : /* @__PURE__ */ D(E, { children: t });
|
|
119
129
|
}
|
|
120
|
-
function
|
|
121
|
-
return /* @__PURE__ */
|
|
130
|
+
function ie({ label: t, size: n = 14, ...r }) {
|
|
131
|
+
return /* @__PURE__ */ D(re, {
|
|
122
132
|
content: t,
|
|
123
|
-
children: /* @__PURE__ */
|
|
133
|
+
children: /* @__PURE__ */ D("span", {
|
|
124
134
|
tabIndex: 0,
|
|
125
135
|
role: "note",
|
|
126
136
|
"aria-label": t,
|
|
@@ -131,25 +141,25 @@ function te({ label: t, size: n = 14, ...r }) {
|
|
|
131
141
|
color: "var(--text-3)",
|
|
132
142
|
cursor: "help"
|
|
133
143
|
},
|
|
134
|
-
children: /* @__PURE__ */
|
|
144
|
+
children: /* @__PURE__ */ D(e.info, { size: n })
|
|
135
145
|
})
|
|
136
146
|
});
|
|
137
147
|
}
|
|
138
148
|
//#endregion
|
|
139
149
|
//#region src/components/primitives/RecordIdBadge.tsx
|
|
140
|
-
var
|
|
141
|
-
function
|
|
142
|
-
let [n, r] =
|
|
143
|
-
|
|
150
|
+
var ae = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i, oe = 1200;
|
|
151
|
+
function se({ value: t }) {
|
|
152
|
+
let [n, r] = S(!1), i = ae.test(t) ? `${t.slice(0, 8)}…` : t, a = _(async () => {
|
|
153
|
+
try {
|
|
154
|
+
await navigator.clipboard.writeText(t), r(!0), window.setTimeout(() => r(!1), oe);
|
|
155
|
+
} catch {}
|
|
156
|
+
}, [t]);
|
|
157
|
+
return /* @__PURE__ */ O("button", {
|
|
144
158
|
type: "button",
|
|
145
|
-
onClick:
|
|
146
|
-
try {
|
|
147
|
-
await navigator.clipboard.writeText(t), r(!0), window.setTimeout(() => r(!1), re);
|
|
148
|
-
} catch {}
|
|
149
|
-
}, [t]),
|
|
159
|
+
onClick: a,
|
|
150
160
|
title: n ? "Copied" : `Copy ${t}`,
|
|
151
161
|
className: "mono inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[11px] text-text-4 hover:bg-surface-2 hover:text-text-3 transition-colors shrink-0 border border-transparent hover:border-border",
|
|
152
|
-
children: [/* @__PURE__ */
|
|
162
|
+
children: [/* @__PURE__ */ D("span", { children: i }), n ? /* @__PURE__ */ D(e.check, { size: 10 }) : /* @__PURE__ */ D(e.copy, {
|
|
153
163
|
size: 10,
|
|
154
164
|
style: { opacity: .6 }
|
|
155
165
|
})]
|
|
@@ -157,31 +167,31 @@ function ie({ value: t }) {
|
|
|
157
167
|
}
|
|
158
168
|
//#endregion
|
|
159
169
|
//#region src/lib/branding.ts
|
|
160
|
-
var
|
|
161
|
-
function
|
|
170
|
+
var ce = "branding";
|
|
171
|
+
function le(e, t) {
|
|
162
172
|
return e?.parameters.find((e) => e.code === t)?.value;
|
|
163
173
|
}
|
|
164
|
-
function
|
|
165
|
-
return
|
|
174
|
+
function ue(e) {
|
|
175
|
+
return I(le(e, ce));
|
|
166
176
|
}
|
|
167
|
-
function
|
|
168
|
-
if (
|
|
177
|
+
function I(e) {
|
|
178
|
+
if (L(e)) return e;
|
|
169
179
|
}
|
|
170
|
-
function
|
|
171
|
-
let t =
|
|
172
|
-
return
|
|
180
|
+
function de(e) {
|
|
181
|
+
let t = ue(e)?.identity;
|
|
182
|
+
return L(t) ? t : void 0;
|
|
173
183
|
}
|
|
174
|
-
function
|
|
184
|
+
function L(e) {
|
|
175
185
|
return !!e && typeof e == "object" && !Array.isArray(e);
|
|
176
186
|
}
|
|
177
|
-
function
|
|
187
|
+
function fe(e) {
|
|
178
188
|
if (!e) return !1;
|
|
179
189
|
let t = e.trim();
|
|
180
190
|
return t ? t.startsWith("/") || t.startsWith("http://") || t.startsWith("https://") || t.startsWith("data:image/") : !1;
|
|
181
191
|
}
|
|
182
192
|
//#endregion
|
|
183
193
|
//#region src/api/params.ts
|
|
184
|
-
async function
|
|
194
|
+
async function pe() {
|
|
185
195
|
let e = (await t("/api/params/public")).data;
|
|
186
196
|
if (Array.isArray(e)) return { parameters: e };
|
|
187
197
|
let n = e ?? {};
|
|
@@ -192,17 +202,17 @@ async function le() {
|
|
|
192
202
|
meta: n.meta
|
|
193
203
|
};
|
|
194
204
|
}
|
|
195
|
-
async function
|
|
205
|
+
async function R(e) {
|
|
196
206
|
return (await t(`/api/params/${encodeURIComponent(e)}`)).data;
|
|
197
207
|
}
|
|
198
|
-
async function
|
|
208
|
+
async function me(e) {
|
|
199
209
|
return (await t(`/api/params${e === "tenant" ? "?resolution=tenant" : ""}`)).data ?? [];
|
|
200
210
|
}
|
|
201
211
|
//#endregion
|
|
202
212
|
//#region src/hooks/useParams.ts
|
|
203
|
-
var
|
|
204
|
-
function
|
|
205
|
-
let a =
|
|
213
|
+
var z = "$params";
|
|
214
|
+
function he({ carrierEntityCode: e, rowId: t, enabled: n = !0, onWritten: r }) {
|
|
215
|
+
let a = T(), [o, c] = S(null), l = w({
|
|
206
216
|
queryKey: [
|
|
207
217
|
"params-carrier-detail",
|
|
208
218
|
e,
|
|
@@ -210,14 +220,14 @@ function de({ carrierEntityCode: e, rowId: t, enabled: n = !0, onWritten: r }) {
|
|
|
210
220
|
],
|
|
211
221
|
queryFn: () => i(e, t),
|
|
212
222
|
enabled: n && !!t,
|
|
213
|
-
staleTime:
|
|
214
|
-
}), u = l.data?.data, d = !!u && !("$params" in u), f =
|
|
223
|
+
staleTime: 3e4
|
|
224
|
+
}), u = l.data?.data, d = !!u && !("$params" in u), f = b(() => Array.isArray(u?.$params) ? u[z] : [], [u]), p = b(() => new Map(f.map((e) => [e.param_code, e])), [f]), m = _(async (n) => {
|
|
215
225
|
c(null);
|
|
216
226
|
try {
|
|
217
227
|
await s(`${e}.__update`, {
|
|
218
228
|
object_ids: [t],
|
|
219
229
|
entity: e,
|
|
220
|
-
fields: { [
|
|
230
|
+
fields: { [z]: n }
|
|
221
231
|
}), await a.invalidateQueries({ queryKey: ["params-all"] }), await a.invalidateQueries({ queryKey: [
|
|
222
232
|
"params-carrier-detail",
|
|
223
233
|
e,
|
|
@@ -231,49 +241,49 @@ function de({ carrierEntityCode: e, rowId: t, enabled: n = !0, onWritten: r }) {
|
|
|
231
241
|
t,
|
|
232
242
|
a,
|
|
233
243
|
r
|
|
234
|
-
]), h =
|
|
244
|
+
]), h = _((e, t) => {
|
|
235
245
|
let n = f.filter((t) => t.param_code !== e.code);
|
|
236
246
|
return n.push({
|
|
237
247
|
param_code: e.code,
|
|
238
248
|
value: t
|
|
239
249
|
}), m(n);
|
|
240
|
-
}, [f, m]),
|
|
250
|
+
}, [f, m]), g = _((e) => m(f.filter((t) => t.param_code !== e.code)), [f, m]), ee = _(() => c(null), []);
|
|
241
251
|
return {
|
|
242
252
|
overrides: f,
|
|
243
253
|
overrideByCode: p,
|
|
244
254
|
missingParams: d,
|
|
245
255
|
isLoading: l.isLoading,
|
|
246
256
|
error: o,
|
|
247
|
-
clearError:
|
|
257
|
+
clearError: ee,
|
|
248
258
|
save: h,
|
|
249
|
-
reset:
|
|
259
|
+
reset: g
|
|
250
260
|
};
|
|
251
261
|
}
|
|
252
|
-
function
|
|
253
|
-
return
|
|
262
|
+
function ge(e) {
|
|
263
|
+
return w({
|
|
254
264
|
queryKey: ["params-all", e ?? "full"],
|
|
255
|
-
queryFn: () =>
|
|
256
|
-
staleTime:
|
|
265
|
+
queryFn: () => me(e),
|
|
266
|
+
staleTime: 3e4
|
|
257
267
|
});
|
|
258
268
|
}
|
|
259
|
-
function
|
|
260
|
-
return
|
|
269
|
+
function B() {
|
|
270
|
+
return w({
|
|
261
271
|
queryKey: ["params-public"],
|
|
262
|
-
queryFn:
|
|
263
|
-
staleTime:
|
|
272
|
+
queryFn: pe,
|
|
273
|
+
staleTime: 3e5
|
|
264
274
|
});
|
|
265
275
|
}
|
|
266
|
-
function
|
|
276
|
+
function V(e, t = {}) {
|
|
267
277
|
let n = t.enabled ?? !0;
|
|
268
|
-
return
|
|
278
|
+
return w({
|
|
269
279
|
queryKey: ["params", e],
|
|
270
|
-
queryFn: () =>
|
|
280
|
+
queryFn: () => R(e),
|
|
271
281
|
enabled: !!e && n,
|
|
272
|
-
staleTime:
|
|
282
|
+
staleTime: 6e4
|
|
273
283
|
});
|
|
274
284
|
}
|
|
275
|
-
function
|
|
276
|
-
let t = u((e) => e.isAuthenticated), n =
|
|
285
|
+
function H(e) {
|
|
286
|
+
let t = u((e) => e.isAuthenticated), n = B(), r = V(e, { enabled: t }), i = _e(n.data?.parameters, e);
|
|
277
287
|
if (t && r.data?.found) return {
|
|
278
288
|
value: r.data.value,
|
|
279
289
|
found: !0,
|
|
@@ -290,15 +300,15 @@ function he(e) {
|
|
|
290
300
|
error: r.error ?? n.error ?? null
|
|
291
301
|
};
|
|
292
302
|
}
|
|
293
|
-
function
|
|
303
|
+
function _e(e, t) {
|
|
294
304
|
return e?.find((e) => e.code === t);
|
|
295
305
|
}
|
|
296
|
-
function
|
|
297
|
-
let n =
|
|
306
|
+
function ve(e, t) {
|
|
307
|
+
let n = w({
|
|
298
308
|
queryKey: ["params", e],
|
|
299
|
-
queryFn: () =>
|
|
309
|
+
queryFn: () => R(e),
|
|
300
310
|
enabled: !!e,
|
|
301
|
-
staleTime:
|
|
311
|
+
staleTime: 6e4
|
|
302
312
|
}), r = n.data, i = !!r?.found;
|
|
303
313
|
return {
|
|
304
314
|
value: i ? r.value : t,
|
|
@@ -310,27 +320,27 @@ function _e(e, t) {
|
|
|
310
320
|
}
|
|
311
321
|
//#endregion
|
|
312
322
|
//#region src/hooks/useBranding.ts
|
|
313
|
-
function
|
|
314
|
-
let e =
|
|
323
|
+
function U() {
|
|
324
|
+
let e = H(ce);
|
|
315
325
|
return {
|
|
316
|
-
branding:
|
|
326
|
+
branding: I(e.value),
|
|
317
327
|
isLoading: e.loading
|
|
318
328
|
};
|
|
319
329
|
}
|
|
320
|
-
function
|
|
321
|
-
return
|
|
330
|
+
function ye() {
|
|
331
|
+
return U().branding?.identity;
|
|
322
332
|
}
|
|
323
|
-
function
|
|
324
|
-
return
|
|
333
|
+
function W() {
|
|
334
|
+
return U().branding?.chrome;
|
|
325
335
|
}
|
|
326
336
|
//#endregion
|
|
327
337
|
//#region src/stores/page-state.ts
|
|
328
|
-
var
|
|
329
|
-
function
|
|
330
|
-
|
|
338
|
+
var G = 18e5, K = null;
|
|
339
|
+
function be(e) {
|
|
340
|
+
K = e;
|
|
331
341
|
}
|
|
332
342
|
function q(e) {
|
|
333
|
-
if (!(!e || !
|
|
343
|
+
if (!(!e || !K)) for (let t of e.queryKeys) K.removeQueries({
|
|
334
344
|
queryKey: t,
|
|
335
345
|
exact: !0
|
|
336
346
|
});
|
|
@@ -342,7 +352,7 @@ function J(e, t) {
|
|
|
342
352
|
let r = { ...e };
|
|
343
353
|
return delete r[t], r;
|
|
344
354
|
}
|
|
345
|
-
function
|
|
355
|
+
function xe(e, t) {
|
|
346
356
|
let n = e;
|
|
347
357
|
for (; Object.keys(n).length > 64;) {
|
|
348
358
|
let e = null, r = Infinity;
|
|
@@ -352,9 +362,9 @@ function Y(e, t) {
|
|
|
352
362
|
}
|
|
353
363
|
return n;
|
|
354
364
|
}
|
|
355
|
-
var
|
|
365
|
+
var Y = A((e, t) => ({
|
|
356
366
|
entries: {},
|
|
357
|
-
ttlMs:
|
|
367
|
+
ttlMs: G,
|
|
358
368
|
setTtl: (n) => {
|
|
359
369
|
if (n <= 0) {
|
|
360
370
|
let { entries: r } = t();
|
|
@@ -382,7 +392,7 @@ var X = k((e, t) => ({
|
|
|
382
392
|
lastActiveAt: o,
|
|
383
393
|
queryKeys: []
|
|
384
394
|
};
|
|
385
|
-
e({ entries:
|
|
395
|
+
e({ entries: xe({
|
|
386
396
|
...a.entries,
|
|
387
397
|
[n]: c
|
|
388
398
|
}, n) });
|
|
@@ -406,7 +416,7 @@ var X = k((e, t) => ({
|
|
|
406
416
|
registerQueryKey: (n, r) => {
|
|
407
417
|
let i = t();
|
|
408
418
|
if (i.ttlMs <= 0) return;
|
|
409
|
-
let a = Date.now(), o = i.entries[n], s = o?.queryKeys.some((e) =>
|
|
419
|
+
let a = Date.now(), o = i.entries[n], s = o?.queryKeys.some((e) => Se(e, r));
|
|
410
420
|
if (o && s) return;
|
|
411
421
|
let c = o ? {
|
|
412
422
|
...o,
|
|
@@ -417,7 +427,7 @@ var X = k((e, t) => ({
|
|
|
417
427
|
lastActiveAt: a,
|
|
418
428
|
queryKeys: [r]
|
|
419
429
|
};
|
|
420
|
-
e({ entries:
|
|
430
|
+
e({ entries: xe({
|
|
421
431
|
...i.entries,
|
|
422
432
|
[n]: c
|
|
423
433
|
}, n) });
|
|
@@ -439,7 +449,7 @@ var X = k((e, t) => ({
|
|
|
439
449
|
}
|
|
440
450
|
}
|
|
441
451
|
}));
|
|
442
|
-
function
|
|
452
|
+
function Se(e, t) {
|
|
443
453
|
if (e === t) return !0;
|
|
444
454
|
try {
|
|
445
455
|
return JSON.stringify(e) === JSON.stringify(t);
|
|
@@ -449,29 +459,29 @@ function ye(e, t) {
|
|
|
449
459
|
}
|
|
450
460
|
//#endregion
|
|
451
461
|
//#region src/lib/canonical-url.ts
|
|
452
|
-
function
|
|
462
|
+
function Ce(e) {
|
|
453
463
|
return e.length > 1 && e.endsWith("/") ? e.replace(/\/+$/, "") || "/" : e;
|
|
454
464
|
}
|
|
455
|
-
function
|
|
456
|
-
let t =
|
|
465
|
+
function X(e) {
|
|
466
|
+
let t = Ce(e.pathname), n = e.search ?? "", r = n.startsWith("?") ? n.slice(1) : n, i = new URLSearchParams(r);
|
|
457
467
|
for (let e of f) i.delete(e);
|
|
458
468
|
i.sort();
|
|
459
469
|
let a = i.toString();
|
|
460
470
|
return a ? `${t}?${a}` : t;
|
|
461
471
|
}
|
|
462
|
-
function
|
|
463
|
-
return
|
|
472
|
+
function we(e) {
|
|
473
|
+
return Ce(e.pathname);
|
|
464
474
|
}
|
|
465
475
|
//#endregion
|
|
466
476
|
//#region src/hooks/usePageStateTtl.ts
|
|
467
|
-
var
|
|
468
|
-
function
|
|
469
|
-
let { value: e } =
|
|
470
|
-
return typeof e != "number" || !Number.isFinite(e) || e < 0 ?
|
|
477
|
+
var Te = "ui_page_state_ttl_ms";
|
|
478
|
+
function Ee() {
|
|
479
|
+
let { value: e } = ve(Te, G);
|
|
480
|
+
return typeof e != "number" || !Number.isFinite(e) || e < 0 ? G : e;
|
|
471
481
|
}
|
|
472
482
|
//#endregion
|
|
473
483
|
//#region src/hooks/usePageStateRuntime.ts
|
|
474
|
-
var
|
|
484
|
+
var De = [
|
|
475
485
|
["entity-data"],
|
|
476
486
|
["entity-count"],
|
|
477
487
|
["entity-item"],
|
|
@@ -479,45 +489,60 @@ var we = [
|
|
|
479
489
|
["entity-data-all"],
|
|
480
490
|
["action-data"],
|
|
481
491
|
["action-data-cursor"]
|
|
482
|
-
],
|
|
483
|
-
function
|
|
484
|
-
for (let n of
|
|
485
|
-
}
|
|
486
|
-
function
|
|
487
|
-
let e =
|
|
488
|
-
r.current = n,
|
|
489
|
-
if (
|
|
490
|
-
}, [e, t]),
|
|
492
|
+
], Oe = 6e4;
|
|
493
|
+
function ke(e, t) {
|
|
494
|
+
for (let n of De) e.setQueryDefaults(n, { gcTime: t });
|
|
495
|
+
}
|
|
496
|
+
function Ae() {
|
|
497
|
+
let e = T(), t = Ee(), n = C(), r = x(n);
|
|
498
|
+
r.current = n, v(() => (be(e), () => be(null)), [e]), v(() => {
|
|
499
|
+
if (Y.getState().setTtl(t), ke(e, t), t <= 0) for (let t of De) e.removeQueries({ queryKey: t });
|
|
500
|
+
}, [e, t]), v(() => {
|
|
491
501
|
if (t <= 0) return;
|
|
492
502
|
let e = setInterval(() => {
|
|
493
|
-
let e =
|
|
494
|
-
e.touch(
|
|
495
|
-
},
|
|
503
|
+
let e = Y.getState(), t = r.current;
|
|
504
|
+
e.touch(X(t)), e.touch(we(t)), e.sweep(Date.now());
|
|
505
|
+
}, Oe);
|
|
496
506
|
return () => clearInterval(e);
|
|
497
507
|
}, [t]);
|
|
498
508
|
}
|
|
499
|
-
function
|
|
500
|
-
let n =
|
|
501
|
-
|
|
502
|
-
!t || !e ||
|
|
509
|
+
function je(e, t = !0) {
|
|
510
|
+
let n = X(C()), r = e ? JSON.stringify(e) : "";
|
|
511
|
+
v(() => {
|
|
512
|
+
!t || !e || Y.getState().registerQueryKey(n, e);
|
|
503
513
|
}, [
|
|
504
514
|
n,
|
|
505
|
-
|
|
515
|
+
r,
|
|
506
516
|
t
|
|
507
517
|
]);
|
|
508
518
|
}
|
|
509
519
|
//#endregion
|
|
510
520
|
//#region src/lib/record-documents-key.ts
|
|
511
|
-
var
|
|
521
|
+
var Me = "record-documents";
|
|
512
522
|
//#endregion
|
|
513
523
|
//#region src/hooks/useBrandingChrome.ts
|
|
514
|
-
function
|
|
515
|
-
let e =
|
|
524
|
+
function Ne() {
|
|
525
|
+
let e = h(), t = W();
|
|
516
526
|
return (e.enabled ? t?.embed?.viewport : t?.full?.viewport) ?? "auto";
|
|
517
527
|
}
|
|
518
|
-
function
|
|
519
|
-
|
|
520
|
-
|
|
528
|
+
function Z(e, t) {
|
|
529
|
+
return typeof e == "number" && Number.isFinite(e) && e > 0 ? e : t;
|
|
530
|
+
}
|
|
531
|
+
function Pe() {
|
|
532
|
+
let e = h(), t = W(), n = e.enabled ? t?.embed?.breakpoints : t?.full?.breakpoints;
|
|
533
|
+
return b(() => ({
|
|
534
|
+
phoneMax: Z(n?.phone_max, p.phoneMax),
|
|
535
|
+
tabletMax: Z(n?.tablet_max, p.tabletMax),
|
|
536
|
+
landscapePhoneMaxHeight: Z(n?.landscape_phone_max_height, p.landscapePhoneMaxHeight)
|
|
537
|
+
}), [
|
|
538
|
+
n?.phone_max,
|
|
539
|
+
n?.tablet_max,
|
|
540
|
+
n?.landscape_phone_max_height
|
|
541
|
+
]);
|
|
542
|
+
}
|
|
543
|
+
function Fe(e) {
|
|
544
|
+
let t = h(), n = W();
|
|
545
|
+
return b(() => {
|
|
521
546
|
let r = { ...t.enabled ? n?.embed?.surfaces?.[e] : n?.full?.surfaces?.[e] };
|
|
522
547
|
return {
|
|
523
548
|
...r,
|
|
@@ -529,9 +554,9 @@ function je(e) {
|
|
|
529
554
|
e
|
|
530
555
|
]);
|
|
531
556
|
}
|
|
532
|
-
function
|
|
533
|
-
let e =
|
|
534
|
-
return
|
|
557
|
+
function Ie() {
|
|
558
|
+
let e = W();
|
|
559
|
+
return b(() => {
|
|
535
560
|
let t = { ...e?.full?.shell };
|
|
536
561
|
return {
|
|
537
562
|
...t,
|
|
@@ -541,34 +566,34 @@ function Me() {
|
|
|
541
566
|
}
|
|
542
567
|
//#endregion
|
|
543
568
|
//#region src/components/pages/exportRequest.ts
|
|
544
|
-
var
|
|
545
|
-
function
|
|
569
|
+
var Le = /* @__PURE__ */ new Set(["_select", "_actions"]);
|
|
570
|
+
function Re(e) {
|
|
546
571
|
let t = {};
|
|
547
572
|
return e.screenCode && (t.screen = e.screenCode), e.jsonFilters && e.jsonFilters.length > 0 && (t.filters = e.jsonFilters), e.search && (t.search = e.search), e.sort && (t.sort = e.sort), e.includeDeleted && (t.include_deleted = !0), e.page && (t.page = e.page), e.perPage && (t.per_page = e.perPage), t;
|
|
548
573
|
}
|
|
549
|
-
function
|
|
550
|
-
let n = t.visibleColumns.filter((e) => !
|
|
574
|
+
function ze(e, t) {
|
|
575
|
+
let n = t.visibleColumns.filter((e) => !Le.has(e)), r = {
|
|
551
576
|
format: "csv",
|
|
552
577
|
scope: t.scope,
|
|
553
|
-
query:
|
|
578
|
+
query: Re(e),
|
|
554
579
|
columns: n
|
|
555
580
|
};
|
|
556
581
|
return t.scope === "selected_rows" && t.selectedRowPKs && t.selectedRowPKs.length > 0 && (r.selection = t.selectedRowPKs), t.locale && (r.locale = t.locale), t.filename && (r.filename = t.filename), r;
|
|
557
582
|
}
|
|
558
583
|
//#endregion
|
|
559
584
|
//#region src/components/pages/DocumentsMenu.tsx
|
|
560
|
-
var
|
|
561
|
-
function
|
|
562
|
-
let { run: f } = l(),
|
|
563
|
-
queryKey: [
|
|
585
|
+
var Be = "document-templates-available";
|
|
586
|
+
function Ve({ entityCode: t, scope: r, objectIds: i = [], viewState: o, selectedIds: c = [], capability: u, canManageTemplates: d = !1 }) {
|
|
587
|
+
let { run: f } = l(), p = x(null), [h, _] = S(!1), v = r === "detail" ? !!u?.generate_one : !!u?.generate_many, y = d && !v, { data: C, isLoading: T, error: k } = w({
|
|
588
|
+
queryKey: [Be, t],
|
|
564
589
|
queryFn: async () => (await s("document.templates.available", { entity: t })).result?.templates ?? [],
|
|
565
|
-
enabled:
|
|
590
|
+
enabled: h || y,
|
|
566
591
|
staleTime: 6e4
|
|
567
|
-
}), A =
|
|
568
|
-
function
|
|
592
|
+
}), A = T, j = b(() => (C ?? []).filter((e) => r === "detail" ? e.input_mode === "one" || e.input_mode === "global" : e.input_mode === "many" || e.input_mode === "global"), [r, C]), te = y && j.length > 0, ne = v || te;
|
|
593
|
+
function M() {
|
|
569
594
|
_((e) => !e);
|
|
570
595
|
}
|
|
571
|
-
function
|
|
596
|
+
function N(e) {
|
|
572
597
|
if (e.input_mode === "global") return [{ kind: "global" }];
|
|
573
598
|
if (r === "detail") return e.input_mode === "one" && i.length === 1 ? [{
|
|
574
599
|
kind: "one",
|
|
@@ -578,7 +603,7 @@ function Le({ entityCode: t, scope: r, objectIds: i = [], viewState: o, selected
|
|
|
578
603
|
let e = [];
|
|
579
604
|
return o && e.push({
|
|
580
605
|
kind: "current_view",
|
|
581
|
-
query:
|
|
606
|
+
query: Re(o)
|
|
582
607
|
}), c.length > 0 && e.push({
|
|
583
608
|
kind: "selected",
|
|
584
609
|
objectIds: c
|
|
@@ -586,8 +611,8 @@ function Le({ entityCode: t, scope: r, objectIds: i = [], viewState: o, selected
|
|
|
586
611
|
}
|
|
587
612
|
return [];
|
|
588
613
|
}
|
|
589
|
-
function
|
|
590
|
-
let r =
|
|
614
|
+
function P(e, t, n) {
|
|
615
|
+
let r = He(e), i = a(e.name) || e.code;
|
|
591
616
|
_(!1), f({
|
|
592
617
|
action: r,
|
|
593
618
|
title: i,
|
|
@@ -604,49 +629,52 @@ function Le({ entityCode: t, scope: r, objectIds: i = [], viewState: o, selected
|
|
|
604
629
|
}
|
|
605
630
|
});
|
|
606
631
|
}
|
|
607
|
-
|
|
608
|
-
|
|
632
|
+
let { isPhone: F } = g();
|
|
633
|
+
return ne ? /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D(ee, {
|
|
634
|
+
ref: p,
|
|
609
635
|
kind: "ghost",
|
|
610
636
|
size: "sm",
|
|
611
|
-
icon:
|
|
612
|
-
onClick:
|
|
637
|
+
icon: D(A ? e.loader : e.filePlus, { size: 12 }),
|
|
638
|
+
onClick: M,
|
|
613
639
|
disabled: A,
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
640
|
+
"aria-label": "Generate",
|
|
641
|
+
title: "Generate",
|
|
642
|
+
children: F ? null : "Generate"
|
|
643
|
+
}), /* @__PURE__ */ O(m, {
|
|
644
|
+
open: h,
|
|
645
|
+
anchor: p.current,
|
|
618
646
|
onClose: () => _(!1),
|
|
619
647
|
align: "end",
|
|
620
648
|
width: 300,
|
|
621
649
|
children: [
|
|
622
|
-
A && /* @__PURE__ */
|
|
650
|
+
A && /* @__PURE__ */ D(n, {
|
|
623
651
|
disabled: !0,
|
|
624
|
-
icon: /* @__PURE__ */
|
|
652
|
+
icon: /* @__PURE__ */ D(e.loader, { size: 12 }),
|
|
625
653
|
children: "Loading templates..."
|
|
626
654
|
}),
|
|
627
|
-
k && /* @__PURE__ */
|
|
655
|
+
k && /* @__PURE__ */ D(n, {
|
|
628
656
|
disabled: !0,
|
|
629
|
-
icon: /* @__PURE__ */
|
|
657
|
+
icon: /* @__PURE__ */ D(e.warning, { size: 12 }),
|
|
630
658
|
children: k instanceof Error ? k.message : String(k)
|
|
631
659
|
}),
|
|
632
|
-
!A && !k && j.length === 0 && /* @__PURE__ */
|
|
660
|
+
!A && !k && j.length === 0 && /* @__PURE__ */ D(n, {
|
|
633
661
|
disabled: !0,
|
|
634
|
-
icon: /* @__PURE__ */
|
|
662
|
+
icon: /* @__PURE__ */ D(e.file, { size: 12 }),
|
|
635
663
|
children: "No document templates"
|
|
636
664
|
}),
|
|
637
665
|
!A && !k && j.map((t) => {
|
|
638
|
-
let r =
|
|
639
|
-
return r.length === 0 ? null :
|
|
640
|
-
icon: /* @__PURE__ */
|
|
641
|
-
onClick: () =>
|
|
666
|
+
let r = N(t);
|
|
667
|
+
return r.length === 0 ? null : Ue(t).flatMap((i) => r.map((r) => i.available ? /* @__PURE__ */ D(n, {
|
|
668
|
+
icon: /* @__PURE__ */ D(e.file, { size: 12 }),
|
|
669
|
+
onClick: () => P(t, r, i.format),
|
|
642
670
|
title: a(t.description),
|
|
643
|
-
children:
|
|
644
|
-
}, `${t.source}:${t.code}:${r.kind}:${i.format}`) : /* @__PURE__ */
|
|
671
|
+
children: We(t, r, i.format)
|
|
672
|
+
}, `${t.source}:${t.code}:${r.kind}:${i.format}`) : /* @__PURE__ */ O(n, {
|
|
645
673
|
disabled: !0,
|
|
646
|
-
icon: /* @__PURE__ */
|
|
674
|
+
icon: /* @__PURE__ */ D(e.file, { size: 12 }),
|
|
647
675
|
title: i.disabled_reason,
|
|
648
676
|
children: [
|
|
649
|
-
|
|
677
|
+
We(t, r, i.format),
|
|
650
678
|
" - ",
|
|
651
679
|
i.disabled_reason || "Unavailable"
|
|
652
680
|
]
|
|
@@ -655,7 +683,7 @@ function Le({ entityCode: t, scope: r, objectIds: i = [], viewState: o, selected
|
|
|
655
683
|
]
|
|
656
684
|
})] }) : null;
|
|
657
685
|
}
|
|
658
|
-
function
|
|
686
|
+
function He(e) {
|
|
659
687
|
let t = new r((e.params ?? []).map((e) => ({
|
|
660
688
|
...e,
|
|
661
689
|
name: e.name ?? ""
|
|
@@ -670,13 +698,13 @@ function Re(e) {
|
|
|
670
698
|
resolved_params: t
|
|
671
699
|
};
|
|
672
700
|
}
|
|
673
|
-
function
|
|
701
|
+
function Ue(e) {
|
|
674
702
|
return e.outputs && e.outputs.length > 0 ? e.outputs : (e.allowed_outputs && e.allowed_outputs.length > 0 ? e.allowed_outputs : [e.output_format || "xlsx"]).map((e) => ({
|
|
675
703
|
format: e,
|
|
676
704
|
available: !0
|
|
677
705
|
}));
|
|
678
706
|
}
|
|
679
|
-
function
|
|
707
|
+
function We(e, t, n) {
|
|
680
708
|
let r = a(e.name) || e.code, i = n ? ` (${n.toUpperCase()})` : "";
|
|
681
709
|
switch (t.kind) {
|
|
682
710
|
case "one": return `${r}${i}`;
|
|
@@ -687,16 +715,16 @@ function Be(e, t, n) {
|
|
|
687
715
|
}
|
|
688
716
|
//#endregion
|
|
689
717
|
//#region src/lib/document-templates.ts
|
|
690
|
-
function
|
|
718
|
+
function Ge(e) {
|
|
691
719
|
return !!e?.entities?.document_template;
|
|
692
720
|
}
|
|
693
721
|
//#endregion
|
|
694
722
|
//#region src/lib/scroll-restoration.ts
|
|
695
|
-
var Q = "scroll",
|
|
696
|
-
function
|
|
723
|
+
var Q = "scroll", Ke = 120, qe = 24, Je = 600;
|
|
724
|
+
function Ye(e, t) {
|
|
697
725
|
return Number.isFinite(e) ? Math.max(0, Math.min(e, Number.isFinite(t) && t > 0 ? t : 0)) : 0;
|
|
698
726
|
}
|
|
699
|
-
function
|
|
727
|
+
function Xe(e, t, n) {
|
|
700
728
|
let r = Number.isFinite(e) ? e : 0;
|
|
701
729
|
if (t) {
|
|
702
730
|
let e = n[t.index];
|
|
@@ -712,33 +740,33 @@ function Ke(e, t, n) {
|
|
|
712
740
|
offset: r
|
|
713
741
|
};
|
|
714
742
|
}
|
|
715
|
-
function
|
|
743
|
+
function Ze(e, t, n, r) {
|
|
716
744
|
if (!e) return null;
|
|
717
745
|
if (e.key) {
|
|
718
746
|
let i = t.indexOf(e.key);
|
|
719
747
|
if (i >= 0) {
|
|
720
748
|
let t = n(i);
|
|
721
|
-
if (t !== void 0) return
|
|
749
|
+
if (t !== void 0) return Ye(t + e.delta, r);
|
|
722
750
|
}
|
|
723
751
|
}
|
|
724
|
-
return
|
|
752
|
+
return Ye(e.offset, r);
|
|
725
753
|
}
|
|
726
|
-
function
|
|
727
|
-
let t =
|
|
754
|
+
function Qe(e = Q) {
|
|
755
|
+
let t = C(), n = x(null);
|
|
728
756
|
if (n.current === null) {
|
|
729
|
-
let r =
|
|
757
|
+
let r = X(t), i = Y.getState().read(r, e);
|
|
730
758
|
n.current = i && Number.isFinite(i.offset) ? Math.max(0, i.offset) : 0;
|
|
731
759
|
}
|
|
732
760
|
return n.current;
|
|
733
761
|
}
|
|
734
|
-
function
|
|
762
|
+
function $e(e) {
|
|
735
763
|
let t = 0, n = null, r = () => {
|
|
736
764
|
n = null, t = Date.now(), e();
|
|
737
765
|
};
|
|
738
766
|
return {
|
|
739
767
|
trigger() {
|
|
740
768
|
let e = Date.now() - t;
|
|
741
|
-
e >=
|
|
769
|
+
e >= Ke ? r() : n === null && (n = setTimeout(r, Ke - e));
|
|
742
770
|
},
|
|
743
771
|
flush() {
|
|
744
772
|
n !== null && (clearTimeout(n), n = null), e();
|
|
@@ -748,19 +776,19 @@ function Ye(e) {
|
|
|
748
776
|
}
|
|
749
777
|
};
|
|
750
778
|
}
|
|
751
|
-
function
|
|
752
|
-
let { virtualizer: t, scrollElementRef: n, rowKeys: r } = e, i = e.stateKey ?? "scroll", a = e.enabled ?? !0, o =
|
|
779
|
+
function et(e) {
|
|
780
|
+
let { virtualizer: t, scrollElementRef: n, rowKeys: r } = e, i = e.stateKey ?? "scroll", a = e.enabled ?? !0, o = X(C()), s = x(t);
|
|
753
781
|
s.current = t;
|
|
754
|
-
let c =
|
|
782
|
+
let c = x(r);
|
|
755
783
|
c.current = r;
|
|
756
|
-
let l =
|
|
757
|
-
|
|
784
|
+
let l = x(null);
|
|
785
|
+
v(() => {
|
|
758
786
|
l.current !== o && (l.current = null);
|
|
759
|
-
}, [o]),
|
|
787
|
+
}, [o]), v(() => {
|
|
760
788
|
if (!a) return;
|
|
761
789
|
let e = s.current;
|
|
762
790
|
if (!e || r.length === 0) return;
|
|
763
|
-
let t =
|
|
791
|
+
let t = Y.getState().read(o, i), n = l.current !== o;
|
|
764
792
|
if (l.current = o, !t) {
|
|
765
793
|
n && e.scrollToOffset(0, {
|
|
766
794
|
align: "start",
|
|
@@ -771,11 +799,11 @@ function Xe(e) {
|
|
|
771
799
|
let u = 0, d = 0, f = NaN, p = () => {
|
|
772
800
|
let e = s.current;
|
|
773
801
|
if (!e) return;
|
|
774
|
-
let n =
|
|
802
|
+
let n = Ze(t, c.current, (t) => e.getOffsetForIndex(t, "start")?.[0], e.getTotalSize());
|
|
775
803
|
n !== null && (Number.isNaN(f) || Math.abs(n - f) > 1) && (e.scrollToOffset(n, {
|
|
776
804
|
align: "start",
|
|
777
805
|
behavior: "auto"
|
|
778
|
-
}), f = n, d++ <
|
|
806
|
+
}), f = n, d++ < qe && (u = requestAnimationFrame(p)));
|
|
779
807
|
};
|
|
780
808
|
return p(), () => {
|
|
781
809
|
u && cancelAnimationFrame(u);
|
|
@@ -785,27 +813,27 @@ function Xe(e) {
|
|
|
785
813
|
o,
|
|
786
814
|
r,
|
|
787
815
|
i
|
|
788
|
-
]),
|
|
816
|
+
]), tt(n, a, o, i, (e) => {
|
|
789
817
|
let t = s.current;
|
|
790
818
|
if (!t) return null;
|
|
791
819
|
let n = e.scrollTop, r = n > 0 ? n : t.scrollOffset ?? 0;
|
|
792
|
-
return
|
|
820
|
+
return Xe(r, t.getVirtualItemForOffset(r), c.current);
|
|
793
821
|
});
|
|
794
822
|
}
|
|
795
|
-
function
|
|
796
|
-
let a =
|
|
797
|
-
a.current = i,
|
|
823
|
+
function tt(e, t, n, r, i) {
|
|
824
|
+
let a = x(i);
|
|
825
|
+
a.current = i, v(() => {
|
|
798
826
|
if (!t) return;
|
|
799
|
-
let i = 0, o =
|
|
827
|
+
let i = 0, o = Je, s = null, c = null, l = (e) => {
|
|
800
828
|
let t = a.current(e);
|
|
801
|
-
t &&
|
|
829
|
+
t && Y.getState().set(n, r, t);
|
|
802
830
|
}, u = () => c?.trigger(), d = () => {
|
|
803
831
|
let t = e.current;
|
|
804
832
|
if (!t) {
|
|
805
833
|
o-- > 0 && (i = requestAnimationFrame(d));
|
|
806
834
|
return;
|
|
807
835
|
}
|
|
808
|
-
s = t, c =
|
|
836
|
+
s = t, c = $e(() => l(t)), t.addEventListener("scroll", u, { passive: !0 });
|
|
809
837
|
};
|
|
810
838
|
return d(), () => {
|
|
811
839
|
i && cancelAnimationFrame(i), s && s.removeEventListener("scroll", u), c?.flush();
|
|
@@ -817,18 +845,18 @@ function Ze(e, t, n, r, i) {
|
|
|
817
845
|
r
|
|
818
846
|
]);
|
|
819
847
|
}
|
|
820
|
-
function
|
|
821
|
-
let { scrollElementRef: t } = e, n = e.stateKey ?? "scroll", r = e.enabled ?? !0, i =
|
|
822
|
-
|
|
848
|
+
function nt(e) {
|
|
849
|
+
let { scrollElementRef: t } = e, n = e.stateKey ?? "scroll", r = e.enabled ?? !0, i = X(C()), a = x(null);
|
|
850
|
+
v(() => {
|
|
823
851
|
if (!r || a.current === i) return;
|
|
824
|
-
let e = 0, o =
|
|
852
|
+
let e = 0, o = Je, s = () => {
|
|
825
853
|
let r = t.current;
|
|
826
854
|
if (!r) {
|
|
827
855
|
o-- > 0 && (e = requestAnimationFrame(s));
|
|
828
856
|
return;
|
|
829
857
|
}
|
|
830
858
|
a.current = i;
|
|
831
|
-
let c =
|
|
859
|
+
let c = Y.getState().read(i, n);
|
|
832
860
|
c && (r.scrollTop = Number.isFinite(c.offset) ? Math.max(0, c.offset) : 0);
|
|
833
861
|
};
|
|
834
862
|
return s(), () => {
|
|
@@ -839,7 +867,7 @@ function Qe(e) {
|
|
|
839
867
|
i,
|
|
840
868
|
n,
|
|
841
869
|
t
|
|
842
|
-
]),
|
|
870
|
+
]), tt(t, r, i, n, (e) => ({
|
|
843
871
|
key: "",
|
|
844
872
|
delta: 0,
|
|
845
873
|
offset: e.scrollTop
|
|
@@ -848,68 +876,70 @@ function Qe(e) {
|
|
|
848
876
|
//#endregion
|
|
849
877
|
//#region src/components/list/peekDraftStore.ts
|
|
850
878
|
var $ = /* @__PURE__ */ new Map();
|
|
851
|
-
function
|
|
879
|
+
function rt(e, t) {
|
|
852
880
|
$.set(e, t);
|
|
853
881
|
}
|
|
854
|
-
function
|
|
882
|
+
function it(e) {
|
|
855
883
|
let t = $.get(e);
|
|
856
884
|
return t === void 0 ? null : ($.delete(e), t);
|
|
857
885
|
}
|
|
858
|
-
function
|
|
886
|
+
function at(e) {
|
|
859
887
|
$.delete(e);
|
|
860
888
|
}
|
|
861
889
|
//#endregion
|
|
862
890
|
//#region src/lib/evidence-verdict.ts
|
|
863
|
-
var
|
|
891
|
+
var ot = {
|
|
864
892
|
verified: "Verified",
|
|
865
893
|
unverified: "Not yet verified",
|
|
866
894
|
tampered: "Tampered",
|
|
867
895
|
indeterminate: "Cannot verify",
|
|
868
896
|
outside_coverage: "Outside coverage"
|
|
869
|
-
},
|
|
897
|
+
}, st = {
|
|
870
898
|
verified: "emerald",
|
|
871
899
|
unverified: "slate",
|
|
872
900
|
tampered: "rose",
|
|
873
901
|
indeterminate: "amber",
|
|
874
902
|
outside_coverage: "slate"
|
|
875
903
|
};
|
|
876
|
-
function
|
|
877
|
-
return
|
|
904
|
+
function ct(e) {
|
|
905
|
+
return ot[e] ?? e;
|
|
878
906
|
}
|
|
879
|
-
function
|
|
880
|
-
return
|
|
907
|
+
function lt(e) {
|
|
908
|
+
return st[e] ?? "slate";
|
|
881
909
|
}
|
|
882
910
|
//#endregion
|
|
883
911
|
//#region src/components/shared/RefreshControl.tsx
|
|
884
|
-
function
|
|
885
|
-
|
|
912
|
+
function ut({ liveObject: t, realtime: n = !0 }) {
|
|
913
|
+
let { isPhone: r } = g(), i = t.isLive ? r ? void 0 : "Live" : "Updates paused";
|
|
914
|
+
return /* @__PURE__ */ O("span", {
|
|
886
915
|
style: {
|
|
887
916
|
display: "inline-flex",
|
|
888
917
|
alignItems: "center",
|
|
889
918
|
gap: 8
|
|
890
919
|
},
|
|
891
|
-
children: [/* @__PURE__ */
|
|
892
|
-
icon: t.isFetching ? /* @__PURE__ */
|
|
920
|
+
children: [/* @__PURE__ */ D(d, {
|
|
921
|
+
icon: t.isFetching ? /* @__PURE__ */ D("span", {
|
|
893
922
|
"data-testid": "refresh-spinner",
|
|
894
923
|
style: { display: "inline-flex" },
|
|
895
|
-
children: /* @__PURE__ */
|
|
896
|
-
}) : /* @__PURE__ */
|
|
924
|
+
children: /* @__PURE__ */ D(o, { size: 14 })
|
|
925
|
+
}) : /* @__PURE__ */ D(e.refresh, { size: 14 }),
|
|
897
926
|
title: "Refresh",
|
|
898
927
|
disabled: t.isLoading || t.isFetching,
|
|
899
928
|
onClick: () => {
|
|
900
929
|
t.refetch();
|
|
901
930
|
}
|
|
902
|
-
}), n && /* @__PURE__ */
|
|
931
|
+
}), n && /* @__PURE__ */ D("span", {
|
|
903
932
|
"data-testid": "live-indicator",
|
|
933
|
+
"aria-label": t.isLive ? "Live" : "Updates paused",
|
|
904
934
|
title: t.isLive ? "This view updates automatically in realtime." : "Realtime updates are paused. Refresh manually to load the latest data.",
|
|
905
|
-
children: /* @__PURE__ */
|
|
935
|
+
children: /* @__PURE__ */ D(c, {
|
|
906
936
|
tone: t.isLive ? "emerald" : "amber",
|
|
907
937
|
size: "xs",
|
|
908
938
|
dot: !0,
|
|
909
|
-
children:
|
|
939
|
+
children: i
|
|
910
940
|
})
|
|
911
941
|
})]
|
|
912
942
|
});
|
|
913
943
|
}
|
|
914
944
|
//#endregion
|
|
915
|
-
export {
|
|
945
|
+
export { ge as A, re as B, Ee as C, Y as D, G as E, V as F, j as H, de as I, fe as L, H as M, ve as N, U as O, B as P, se as R, Te as S, X as T, F as V, Ne as _, rt as a, Ae as b, nt as c, Ge as d, Ve as f, Ie as g, Fe as h, at as i, he as j, ye as k, Qe as l, Pe as m, ct as n, it as o, ze as p, lt as r, Q as s, ut as t, et as u, Me as v, we as w, je as x, ke as y, ie as z };
|