@declarion/react 0.30.0 → 0.31.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-lib/{ActionRunner-HrBGEIPi.js → ActionRunner-BzaZQtiI.js} +1149 -992
- package/dist-lib/{DraggableChildrenTable-DawgL01j.js → DraggableChildrenTable-DILqStHQ.js} +29 -29
- package/dist-lib/{Grid-CywIwAds.js → Grid-BIsiUwPh.js} +2 -2
- package/dist-lib/LayoutRenderer-3RvIsC9M.js +2885 -0
- package/dist-lib/{MarkdownRenderer-DoKB-5LZ.js → MarkdownRenderer-CaHhWrfm.js} +1 -1
- package/dist-lib/SmartDetailPage.impl--EO-9fos.js +1494 -0
- package/dist-lib/SmartRecordListPage.impl-B1iws8yf.js +763 -0
- package/dist-lib/components/detail-layout/DraggableChildrenTable.d.ts +1 -0
- package/dist-lib/components/detail-layout/EditableChildrenTable.d.ts +2 -1
- package/dist-lib/components/detail-layout/LayoutRenderer.d.ts +2 -0
- package/dist-lib/components/layout/TenantChip.d.ts +2 -1
- package/dist-lib/components/layout/TopBar.d.ts +9 -1
- package/dist-lib/components/pages/SmartDetailPage.d.ts +2 -5
- package/dist-lib/components/pages/SmartDetailPage.impl.d.ts +4 -0
- package/dist-lib/components/pages/SmartRecordListPage.d.ts +2 -5
- package/dist-lib/components/pages/SmartRecordListPage.impl.d.ts +4 -0
- package/dist-lib/components/pages/list/cardProjection.d.ts +66 -0
- package/dist-lib/declarion-react.css +1 -1
- package/dist-lib/hooks/useResponsiveMode.d.ts +30 -0
- package/dist-lib/index.d.ts +2 -0
- package/dist-lib/index.js +6773 -15562
- package/dist-lib/peekDraftStore-yyzMbaiI.js +468 -0
- package/dist-lib/registry-2KliNTHB.js +5177 -0
- package/dist-lib/testing.d.ts +3 -0
- package/dist-lib/testing.js +55 -52
- package/dist-lib/types/schema.d.ts +38 -0
- package/dist-lib/useProperties-Co3RdtuT.js +453 -0
- package/dist-lib/{value-D9BaSRFG.js → value-BooGwUik.js} +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,468 @@
|
|
|
1
|
+
import { s as e } from "./DynamicIcon-DCRdxxZ7.js";
|
|
2
|
+
import { Ot as t, U as n, ut as r } from "./ActionRunner-BzaZQtiI.js";
|
|
3
|
+
import { useCallback as i, useEffect as a, useRef as o, useState as s } from "react";
|
|
4
|
+
import { useLocation as c } from "react-router-dom";
|
|
5
|
+
import { useQuery as l, useQueryClient as u } from "@tanstack/react-query";
|
|
6
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
7
|
+
import { create as p } from "zustand";
|
|
8
|
+
//#region src/components/primitives/Avatar.tsx
|
|
9
|
+
function m({ name: e, size: t = 22, color: n }) {
|
|
10
|
+
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 = [
|
|
11
|
+
"#DCE4F6",
|
|
12
|
+
"#E4DCF6",
|
|
13
|
+
"#F6DCE4",
|
|
14
|
+
"#F6E4DC",
|
|
15
|
+
"#DCF6E4",
|
|
16
|
+
"#DCF6F1",
|
|
17
|
+
"#F1F6DC",
|
|
18
|
+
"#F6DCF1"
|
|
19
|
+
];
|
|
20
|
+
return /* @__PURE__ */ d("span", {
|
|
21
|
+
style: {
|
|
22
|
+
display: "inline-flex",
|
|
23
|
+
alignItems: "center",
|
|
24
|
+
justifyContent: "center",
|
|
25
|
+
width: t,
|
|
26
|
+
height: t,
|
|
27
|
+
borderRadius: 999,
|
|
28
|
+
background: n || a[i % a.length],
|
|
29
|
+
color: "#1E2A4A",
|
|
30
|
+
fontSize: t < 20 ? 9.5 : 10.5,
|
|
31
|
+
fontWeight: 600,
|
|
32
|
+
flexShrink: 0
|
|
33
|
+
},
|
|
34
|
+
children: r
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region src/components/primitives/RecordIdBadge.tsx
|
|
39
|
+
var h = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i, g = 1200;
|
|
40
|
+
function ee({ value: t }) {
|
|
41
|
+
let [n, r] = s(!1), a = h.test(t) ? `${t.slice(0, 8)}…` : t;
|
|
42
|
+
return /* @__PURE__ */ f("button", {
|
|
43
|
+
type: "button",
|
|
44
|
+
onClick: i(async () => {
|
|
45
|
+
try {
|
|
46
|
+
await navigator.clipboard.writeText(t), r(!0), window.setTimeout(() => r(!1), g);
|
|
47
|
+
} catch {}
|
|
48
|
+
}, [t]),
|
|
49
|
+
title: n ? "Copied" : `Copy ${t}`,
|
|
50
|
+
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",
|
|
51
|
+
children: [/* @__PURE__ */ d("span", { children: a }), n ? /* @__PURE__ */ d(e.check, { size: 10 }) : /* @__PURE__ */ d(e.copy, {
|
|
52
|
+
size: 10,
|
|
53
|
+
style: { opacity: .6 }
|
|
54
|
+
})]
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region src/stores/page-state.ts
|
|
59
|
+
var _ = 1800 * 1e3, v = null;
|
|
60
|
+
function y(e) {
|
|
61
|
+
v = e;
|
|
62
|
+
}
|
|
63
|
+
function b(e) {
|
|
64
|
+
if (!(!e || !v)) for (let t of e.queryKeys) v.removeQueries({
|
|
65
|
+
queryKey: t,
|
|
66
|
+
exact: !0
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
function x(e, t) {
|
|
70
|
+
let n = e[t];
|
|
71
|
+
if (!n) return e;
|
|
72
|
+
b(n);
|
|
73
|
+
let r = { ...e };
|
|
74
|
+
return delete r[t], r;
|
|
75
|
+
}
|
|
76
|
+
function S(e, t) {
|
|
77
|
+
let n = e;
|
|
78
|
+
for (; Object.keys(n).length > 64;) {
|
|
79
|
+
let e = null, r = Infinity;
|
|
80
|
+
for (let [i, a] of Object.entries(n)) i !== t && a.lastActiveAt < r && (r = a.lastActiveAt, e = i);
|
|
81
|
+
if (e === null) break;
|
|
82
|
+
n = x(n, e);
|
|
83
|
+
}
|
|
84
|
+
return n;
|
|
85
|
+
}
|
|
86
|
+
var C = p((e, t) => ({
|
|
87
|
+
entries: {},
|
|
88
|
+
ttlMs: _,
|
|
89
|
+
setTtl: (n) => {
|
|
90
|
+
if (n <= 0) {
|
|
91
|
+
let { entries: r } = t();
|
|
92
|
+
for (let e of Object.keys(r)) b(r[e]);
|
|
93
|
+
e({
|
|
94
|
+
ttlMs: n,
|
|
95
|
+
entries: {}
|
|
96
|
+
});
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
e({ ttlMs: n });
|
|
100
|
+
},
|
|
101
|
+
set: (n, r, i) => {
|
|
102
|
+
let a = t();
|
|
103
|
+
if (a.ttlMs <= 0) return;
|
|
104
|
+
let o = Date.now(), s = a.entries[n], c = s ? {
|
|
105
|
+
...s,
|
|
106
|
+
bag: {
|
|
107
|
+
...s.bag,
|
|
108
|
+
[r]: i
|
|
109
|
+
},
|
|
110
|
+
lastActiveAt: o
|
|
111
|
+
} : {
|
|
112
|
+
bag: { [r]: i },
|
|
113
|
+
lastActiveAt: o,
|
|
114
|
+
queryKeys: []
|
|
115
|
+
};
|
|
116
|
+
e({ entries: S({
|
|
117
|
+
...a.entries,
|
|
118
|
+
[n]: c
|
|
119
|
+
}, n) });
|
|
120
|
+
},
|
|
121
|
+
read: (e, n) => {
|
|
122
|
+
let r = t();
|
|
123
|
+
if (!(r.ttlMs <= 0)) return r.entries[e]?.bag[n];
|
|
124
|
+
},
|
|
125
|
+
touch: (n) => {
|
|
126
|
+
let r = t();
|
|
127
|
+
if (r.ttlMs <= 0) return;
|
|
128
|
+
let i = r.entries[n];
|
|
129
|
+
i && e({ entries: {
|
|
130
|
+
...r.entries,
|
|
131
|
+
[n]: {
|
|
132
|
+
...i,
|
|
133
|
+
lastActiveAt: Date.now()
|
|
134
|
+
}
|
|
135
|
+
} });
|
|
136
|
+
},
|
|
137
|
+
registerQueryKey: (n, r) => {
|
|
138
|
+
let i = t();
|
|
139
|
+
if (i.ttlMs <= 0) return;
|
|
140
|
+
let a = Date.now(), o = i.entries[n], s = o?.queryKeys.some((e) => w(e, r));
|
|
141
|
+
if (o && s) return;
|
|
142
|
+
let c = o ? {
|
|
143
|
+
...o,
|
|
144
|
+
queryKeys: [...o.queryKeys, r],
|
|
145
|
+
lastActiveAt: a
|
|
146
|
+
} : {
|
|
147
|
+
bag: {},
|
|
148
|
+
lastActiveAt: a,
|
|
149
|
+
queryKeys: [r]
|
|
150
|
+
};
|
|
151
|
+
e({ entries: S({
|
|
152
|
+
...i.entries,
|
|
153
|
+
[n]: c
|
|
154
|
+
}, n) });
|
|
155
|
+
},
|
|
156
|
+
kill: (n) => {
|
|
157
|
+
let r = t(), i = x(r.entries, n);
|
|
158
|
+
i !== r.entries && e({ entries: i });
|
|
159
|
+
},
|
|
160
|
+
sweep: (n) => {
|
|
161
|
+
let { ttlMs: r, entries: i } = t(), a = i;
|
|
162
|
+
for (let [e, t] of Object.entries(i)) (r <= 0 || n - t.lastActiveAt > r) && (a = x(a, e));
|
|
163
|
+
a !== i && e({ entries: a });
|
|
164
|
+
},
|
|
165
|
+
clear: () => {
|
|
166
|
+
let { entries: n } = t();
|
|
167
|
+
if (Object.keys(n).length !== 0) {
|
|
168
|
+
for (let e of Object.keys(n)) b(n[e]);
|
|
169
|
+
e({ entries: {} });
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}));
|
|
173
|
+
function w(e, t) {
|
|
174
|
+
if (e === t) return !0;
|
|
175
|
+
try {
|
|
176
|
+
return JSON.stringify(e) === JSON.stringify(t);
|
|
177
|
+
} catch {
|
|
178
|
+
return !1;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
//#endregion
|
|
182
|
+
//#region src/api/params.ts
|
|
183
|
+
async function T() {
|
|
184
|
+
let e = (await t("/api/params/public")).data;
|
|
185
|
+
if (Array.isArray(e)) return { parameters: e };
|
|
186
|
+
let n = e ?? {};
|
|
187
|
+
return {
|
|
188
|
+
parameters: n.parameters ?? [],
|
|
189
|
+
accents: n.accents,
|
|
190
|
+
messages: n.messages,
|
|
191
|
+
branding: n.branding,
|
|
192
|
+
meta: n.meta
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
async function E(e) {
|
|
196
|
+
return (await t(`/api/params/${encodeURIComponent(e)}`)).data;
|
|
197
|
+
}
|
|
198
|
+
async function D(e, t, r) {
|
|
199
|
+
await n("user.__update", {
|
|
200
|
+
object_ids: [e],
|
|
201
|
+
entity: "user",
|
|
202
|
+
fields: { $params: [{
|
|
203
|
+
param_code: t,
|
|
204
|
+
value: r
|
|
205
|
+
}] }
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
//#endregion
|
|
209
|
+
//#region src/hooks/useParams.ts
|
|
210
|
+
function O() {
|
|
211
|
+
return l({
|
|
212
|
+
queryKey: ["params-public"],
|
|
213
|
+
queryFn: T,
|
|
214
|
+
staleTime: 300 * 1e3
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
function k(e) {
|
|
218
|
+
return l({
|
|
219
|
+
queryKey: ["params", e],
|
|
220
|
+
queryFn: () => E(e),
|
|
221
|
+
enabled: !!e,
|
|
222
|
+
staleTime: 60 * 1e3
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
function A(e, t) {
|
|
226
|
+
let n = l({
|
|
227
|
+
queryKey: ["params", e],
|
|
228
|
+
queryFn: () => E(e),
|
|
229
|
+
enabled: !!e,
|
|
230
|
+
staleTime: 60 * 1e3
|
|
231
|
+
}), r = n.data, i = !!r?.found;
|
|
232
|
+
return {
|
|
233
|
+
value: i ? r.value : t,
|
|
234
|
+
found: i,
|
|
235
|
+
source: r?.source,
|
|
236
|
+
loading: n.isLoading,
|
|
237
|
+
error: n.error ?? null
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
//#endregion
|
|
241
|
+
//#region src/lib/canonical-url.ts
|
|
242
|
+
function j(e) {
|
|
243
|
+
return e.length > 1 && e.endsWith("/") ? e.replace(/\/+$/, "") || "/" : e;
|
|
244
|
+
}
|
|
245
|
+
function M(e) {
|
|
246
|
+
let t = j(e.pathname), n = e.search ?? "", i = n.startsWith("?") ? n.slice(1) : n, a = new URLSearchParams(i);
|
|
247
|
+
for (let e of r) a.delete(e);
|
|
248
|
+
a.sort();
|
|
249
|
+
let o = a.toString();
|
|
250
|
+
return o ? `${t}?${o}` : t;
|
|
251
|
+
}
|
|
252
|
+
function N(e) {
|
|
253
|
+
return j(e.pathname);
|
|
254
|
+
}
|
|
255
|
+
//#endregion
|
|
256
|
+
//#region src/hooks/usePageStateTtl.ts
|
|
257
|
+
var P = "ui_page_state_ttl_ms";
|
|
258
|
+
function F() {
|
|
259
|
+
let { value: e } = A(P, _);
|
|
260
|
+
return typeof e != "number" || !Number.isFinite(e) || e < 0 ? _ : e;
|
|
261
|
+
}
|
|
262
|
+
//#endregion
|
|
263
|
+
//#region src/hooks/usePageStateRuntime.ts
|
|
264
|
+
var I = [
|
|
265
|
+
["entity-data"],
|
|
266
|
+
["entity-count"],
|
|
267
|
+
["entity-item"],
|
|
268
|
+
["entity-data-cursor"],
|
|
269
|
+
["entity-data-all"],
|
|
270
|
+
["action-data"],
|
|
271
|
+
["action-data-cursor"]
|
|
272
|
+
], L = 6e4;
|
|
273
|
+
function R(e, t) {
|
|
274
|
+
for (let n of I) e.setQueryDefaults(n, { gcTime: t });
|
|
275
|
+
}
|
|
276
|
+
function z() {
|
|
277
|
+
let e = u(), t = F(), n = c(), r = o(n);
|
|
278
|
+
r.current = n, a(() => (y(e), () => y(null)), [e]), a(() => {
|
|
279
|
+
if (C.getState().setTtl(t), R(e, t), t <= 0) for (let t of I) e.removeQueries({ queryKey: t });
|
|
280
|
+
}, [e, t]), a(() => {
|
|
281
|
+
if (t <= 0) return;
|
|
282
|
+
let e = setInterval(() => {
|
|
283
|
+
let e = C.getState(), t = r.current;
|
|
284
|
+
e.touch(M(t)), e.touch(N(t)), e.sweep(Date.now());
|
|
285
|
+
}, L);
|
|
286
|
+
return () => clearInterval(e);
|
|
287
|
+
}, [t]);
|
|
288
|
+
}
|
|
289
|
+
function B(e, t = !0) {
|
|
290
|
+
let n = M(c());
|
|
291
|
+
a(() => {
|
|
292
|
+
!t || !e || C.getState().registerQueryKey(n, e);
|
|
293
|
+
}, [
|
|
294
|
+
n,
|
|
295
|
+
e ? JSON.stringify(e) : "",
|
|
296
|
+
t
|
|
297
|
+
]);
|
|
298
|
+
}
|
|
299
|
+
//#endregion
|
|
300
|
+
//#region src/lib/scroll-restoration.ts
|
|
301
|
+
var V = "scroll", H = 120, U = 24, W = 600;
|
|
302
|
+
function G(e, t) {
|
|
303
|
+
return Number.isFinite(e) ? Math.max(0, Math.min(e, Number.isFinite(t) && t > 0 ? t : 0)) : 0;
|
|
304
|
+
}
|
|
305
|
+
function K(e, t, n) {
|
|
306
|
+
let r = Number.isFinite(e) ? e : 0;
|
|
307
|
+
if (t) {
|
|
308
|
+
let e = n[t.index];
|
|
309
|
+
if (e !== void 0) return {
|
|
310
|
+
key: e,
|
|
311
|
+
delta: Math.max(0, r - t.start),
|
|
312
|
+
offset: r
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
return {
|
|
316
|
+
key: "",
|
|
317
|
+
delta: 0,
|
|
318
|
+
offset: r
|
|
319
|
+
};
|
|
320
|
+
}
|
|
321
|
+
function q(e, t, n, r) {
|
|
322
|
+
if (!e) return null;
|
|
323
|
+
if (e.key) {
|
|
324
|
+
let i = t.indexOf(e.key);
|
|
325
|
+
if (i >= 0) {
|
|
326
|
+
let t = n(i);
|
|
327
|
+
if (t !== void 0) return G(t + e.delta, r);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
return G(e.offset, r);
|
|
331
|
+
}
|
|
332
|
+
function J(e = V) {
|
|
333
|
+
let t = c(), n = o(null);
|
|
334
|
+
if (n.current === null) {
|
|
335
|
+
let r = M(t), i = C.getState().read(r, e);
|
|
336
|
+
n.current = i && Number.isFinite(i.offset) ? Math.max(0, i.offset) : 0;
|
|
337
|
+
}
|
|
338
|
+
return n.current;
|
|
339
|
+
}
|
|
340
|
+
function Y(e) {
|
|
341
|
+
let t = 0, n = null, r = () => {
|
|
342
|
+
n = null, t = Date.now(), e();
|
|
343
|
+
};
|
|
344
|
+
return {
|
|
345
|
+
trigger() {
|
|
346
|
+
let e = Date.now() - t;
|
|
347
|
+
e >= H ? r() : n === null && (n = setTimeout(r, H - e));
|
|
348
|
+
},
|
|
349
|
+
flush() {
|
|
350
|
+
n !== null && (clearTimeout(n), n = null), e();
|
|
351
|
+
},
|
|
352
|
+
cancel() {
|
|
353
|
+
n !== null && (clearTimeout(n), n = null);
|
|
354
|
+
}
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
function X(e) {
|
|
358
|
+
let { virtualizer: t, scrollElementRef: n, rowKeys: r } = e, i = e.stateKey ?? "scroll", s = e.enabled ?? !0, l = M(c()), u = o(t);
|
|
359
|
+
u.current = t;
|
|
360
|
+
let d = o(r);
|
|
361
|
+
d.current = r;
|
|
362
|
+
let f = o(null);
|
|
363
|
+
a(() => {
|
|
364
|
+
f.current !== l && (f.current = null);
|
|
365
|
+
}, [l]), a(() => {
|
|
366
|
+
if (!s) return;
|
|
367
|
+
let e = u.current;
|
|
368
|
+
if (!e || r.length === 0) return;
|
|
369
|
+
let t = C.getState().read(l, i), n = f.current !== l;
|
|
370
|
+
if (f.current = l, !t) {
|
|
371
|
+
n && e.scrollToOffset(0, {
|
|
372
|
+
align: "start",
|
|
373
|
+
behavior: "auto"
|
|
374
|
+
});
|
|
375
|
+
return;
|
|
376
|
+
}
|
|
377
|
+
let a = 0, o = 0, c = NaN, p = () => {
|
|
378
|
+
let e = u.current;
|
|
379
|
+
if (!e) return;
|
|
380
|
+
let n = q(t, d.current, (t) => e.getOffsetForIndex(t, "start")?.[0], e.getTotalSize());
|
|
381
|
+
n !== null && (Number.isNaN(c) || Math.abs(n - c) > 1) && (e.scrollToOffset(n, {
|
|
382
|
+
align: "start",
|
|
383
|
+
behavior: "auto"
|
|
384
|
+
}), c = n, o++ < U && (a = requestAnimationFrame(p)));
|
|
385
|
+
};
|
|
386
|
+
return p(), () => {
|
|
387
|
+
a && cancelAnimationFrame(a);
|
|
388
|
+
};
|
|
389
|
+
}, [
|
|
390
|
+
s,
|
|
391
|
+
l,
|
|
392
|
+
r,
|
|
393
|
+
i
|
|
394
|
+
]), Z(n, s, l, i, (e) => {
|
|
395
|
+
let t = u.current;
|
|
396
|
+
if (!t) return null;
|
|
397
|
+
let n = e.scrollTop, r = n > 0 ? n : t.scrollOffset ?? 0;
|
|
398
|
+
return K(r, t.getVirtualItemForOffset(r), d.current);
|
|
399
|
+
});
|
|
400
|
+
}
|
|
401
|
+
function Z(e, t, n, r, i) {
|
|
402
|
+
let s = o(i);
|
|
403
|
+
s.current = i, a(() => {
|
|
404
|
+
if (!t) return;
|
|
405
|
+
let i = 0, a = W, o = null, c = null, l = (e) => {
|
|
406
|
+
let t = s.current(e);
|
|
407
|
+
t && C.getState().set(n, r, t);
|
|
408
|
+
}, u = () => c?.trigger(), d = () => {
|
|
409
|
+
let t = e.current;
|
|
410
|
+
if (!t) {
|
|
411
|
+
a-- > 0 && (i = requestAnimationFrame(d));
|
|
412
|
+
return;
|
|
413
|
+
}
|
|
414
|
+
o = t, c = Y(() => l(t)), t.addEventListener("scroll", u, { passive: !0 });
|
|
415
|
+
};
|
|
416
|
+
return d(), () => {
|
|
417
|
+
i && cancelAnimationFrame(i), o && o.removeEventListener("scroll", u), c?.flush();
|
|
418
|
+
};
|
|
419
|
+
}, [
|
|
420
|
+
t,
|
|
421
|
+
e,
|
|
422
|
+
n,
|
|
423
|
+
r
|
|
424
|
+
]);
|
|
425
|
+
}
|
|
426
|
+
function Q(e) {
|
|
427
|
+
let { scrollElementRef: t } = e, n = e.stateKey ?? "scroll", r = e.enabled ?? !0, i = M(c()), s = o(null);
|
|
428
|
+
a(() => {
|
|
429
|
+
if (!r || s.current === i) return;
|
|
430
|
+
let e = 0, a = W, o = () => {
|
|
431
|
+
let r = t.current;
|
|
432
|
+
if (!r) {
|
|
433
|
+
a-- > 0 && (e = requestAnimationFrame(o));
|
|
434
|
+
return;
|
|
435
|
+
}
|
|
436
|
+
s.current = i;
|
|
437
|
+
let c = C.getState().read(i, n);
|
|
438
|
+
c && (r.scrollTop = Number.isFinite(c.offset) ? Math.max(0, c.offset) : 0);
|
|
439
|
+
};
|
|
440
|
+
return o(), () => {
|
|
441
|
+
e && cancelAnimationFrame(e);
|
|
442
|
+
};
|
|
443
|
+
}, [
|
|
444
|
+
r,
|
|
445
|
+
i,
|
|
446
|
+
n,
|
|
447
|
+
t
|
|
448
|
+
]), Z(t, r, i, n, (e) => ({
|
|
449
|
+
key: "",
|
|
450
|
+
delta: 0,
|
|
451
|
+
offset: e.scrollTop
|
|
452
|
+
}));
|
|
453
|
+
}
|
|
454
|
+
//#endregion
|
|
455
|
+
//#region src/components/list/peekDraftStore.ts
|
|
456
|
+
var $ = /* @__PURE__ */ new Map();
|
|
457
|
+
function te(e, t) {
|
|
458
|
+
$.set(e, t);
|
|
459
|
+
}
|
|
460
|
+
function ne(e) {
|
|
461
|
+
let t = $.get(e);
|
|
462
|
+
return t === void 0 ? null : ($.delete(e), t);
|
|
463
|
+
}
|
|
464
|
+
function re(e) {
|
|
465
|
+
$.delete(e);
|
|
466
|
+
}
|
|
467
|
+
//#endregion
|
|
468
|
+
export { m as S, k as _, Q as a, C as b, R as c, P as d, F as f, O as g, A as h, V as i, z as l, M as m, te as n, J as o, N as p, ne as r, X as s, re as t, B as u, D as v, ee as x, _ as y };
|