@declarion/react 0.15.0 → 0.19.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/ActionRunner-F1HBBKyQ.js +8344 -0
- package/dist-lib/{DraggableChildrenTable-I1gyEEIJ.js → DraggableChildrenTable-D7kzLdIg.js} +55 -54
- package/dist-lib/{Grid-_7PlIyGn.js → Grid-Cz_2olTR.js} +120 -120
- package/dist-lib/{MarkdownRenderer-Dbl3AFDQ.js → MarkdownRenderer-Cm-nbv6g.js} +1 -1
- package/dist-lib/api/data.d.ts +28 -0
- package/dist-lib/dataTableStyles-vwD1mVOP.js +22 -0
- package/dist-lib/declarion-react.css +1 -1
- package/dist-lib/hooks/useSSE.d.ts +1 -0
- package/dist-lib/index.js +5029 -7199
- package/dist-lib/lib/actions.d.ts +23 -18
- package/dist-lib/testing.d.ts +66 -0
- package/dist-lib/testing.js +147 -0
- package/dist-lib/types/schema.d.ts +10 -0
- package/package.json +14 -3
- package/dist-lib/dataTableStyles-WuxWH5x7.js +0 -5342
- package/dist-lib/rich-text-CJpzFOG5.js +0 -46
- package/dist-lib/value-YOCedRQq.js +0 -774
|
@@ -1,147 +1,147 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { D as e, E as t, F as n, I as r, L as i, M as a, R as o, j as s, k as c, z as l } from "./ActionRunner-F1HBBKyQ.js";
|
|
2
2
|
import { useCallback as u, useEffect as d, useMemo as f, useRef as p, useState as m } from "react";
|
|
3
3
|
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
4
|
-
import { DndContext as v, PointerSensor as y, closestCenter as b, useSensor as x, useSensors as
|
|
5
|
-
import { SortableContext as
|
|
6
|
-
import { CSS as
|
|
4
|
+
import { DndContext as v, PointerSensor as y, closestCenter as b, useSensor as x, useSensors as ee } from "@dnd-kit/core";
|
|
5
|
+
import { SortableContext as te, arrayMove as ne, rectSortingStrategy as re, useSortable as S } from "@dnd-kit/sortable";
|
|
6
|
+
import { CSS as C } from "@dnd-kit/utilities";
|
|
7
7
|
//#region src/components/file-widgets/Grid.tsx
|
|
8
|
-
function
|
|
9
|
-
return
|
|
8
|
+
function w(e, t) {
|
|
9
|
+
return s(e, t);
|
|
10
10
|
}
|
|
11
|
-
function
|
|
12
|
-
let { field:
|
|
13
|
-
R.current =
|
|
14
|
-
let z = p(
|
|
15
|
-
z.current =
|
|
11
|
+
function T(e) {
|
|
12
|
+
let { field: i, fieldName: a, value: s, onChange: h, mode: S, disabled: C } = e, w = t(s), [T, k] = m([]), [A, j] = m(/* @__PURE__ */ new Set()), [M, N] = m(null), { register: P, unregister: F, isDraft: I } = c(), L = p(/* @__PURE__ */ new Set()), R = p([]);
|
|
13
|
+
R.current = T;
|
|
14
|
+
let z = p(w);
|
|
15
|
+
z.current = w, d(() => () => {
|
|
16
16
|
R.current.forEach((e) => e.abort());
|
|
17
17
|
}, []);
|
|
18
|
-
let B =
|
|
19
|
-
let
|
|
20
|
-
if (
|
|
18
|
+
let B = ee(x(y, { activationConstraint: { distance: 5 } })), V = i.display?.placeholder || a, H = (i.accepts ?? ["image/*"]).join(","), U = i.display?.reorderable !== !1, W = i.display?.listable_thumbnail, G = u(async (t) => {
|
|
19
|
+
let s = l(t, i.accepts, i.max_size_bytes), c = `tile-${Math.random().toString(36).slice(2)}-${Date.now()}`, u = new AbortController();
|
|
20
|
+
if (s) {
|
|
21
21
|
k((e) => [...e, {
|
|
22
|
-
localId:
|
|
23
|
-
filename:
|
|
22
|
+
localId: c,
|
|
23
|
+
filename: t.name,
|
|
24
24
|
progress: null,
|
|
25
|
-
error:
|
|
25
|
+
error: s,
|
|
26
26
|
abort: () => {}
|
|
27
27
|
}]);
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
30
30
|
k((e) => [...e, {
|
|
31
|
-
localId:
|
|
32
|
-
filename:
|
|
31
|
+
localId: c,
|
|
32
|
+
filename: t.name,
|
|
33
33
|
progress: {
|
|
34
34
|
loaded: 0,
|
|
35
|
-
total:
|
|
35
|
+
total: t.size,
|
|
36
36
|
pct: 0
|
|
37
37
|
},
|
|
38
38
|
error: null,
|
|
39
39
|
abort: () => u.abort()
|
|
40
40
|
}]);
|
|
41
41
|
try {
|
|
42
|
-
let
|
|
43
|
-
file:
|
|
44
|
-
entityCode:
|
|
45
|
-
fieldCode:
|
|
42
|
+
let n = await o({
|
|
43
|
+
file: t,
|
|
44
|
+
entityCode: e.entityCode,
|
|
45
|
+
fieldCode: a,
|
|
46
46
|
signal: u.signal,
|
|
47
|
-
onProgress: (e) => k((t) => t.map((t) => t.localId ===
|
|
47
|
+
onProgress: (e) => k((t) => t.map((t) => t.localId === c ? {
|
|
48
48
|
...t,
|
|
49
49
|
progress: e
|
|
50
50
|
} : t))
|
|
51
51
|
});
|
|
52
|
-
if (L.current.delete(
|
|
53
|
-
|
|
52
|
+
if (L.current.delete(c)) {
|
|
53
|
+
r(n.id).catch(() => {}), F(n.id);
|
|
54
54
|
return;
|
|
55
55
|
}
|
|
56
|
-
P(
|
|
57
|
-
let
|
|
58
|
-
id:
|
|
59
|
-
filename:
|
|
60
|
-
content_type:
|
|
61
|
-
size_bytes:
|
|
62
|
-
sha256:
|
|
63
|
-
width:
|
|
64
|
-
height:
|
|
65
|
-
url:
|
|
66
|
-
metadata:
|
|
67
|
-
},
|
|
68
|
-
z.current =
|
|
69
|
-
} catch (
|
|
70
|
-
if (
|
|
71
|
-
k((e) => e.filter((e) => e.localId !==
|
|
56
|
+
P(n.id, () => r(n.id));
|
|
57
|
+
let i = {
|
|
58
|
+
id: n.id,
|
|
59
|
+
filename: n.filename,
|
|
60
|
+
content_type: n.content_type,
|
|
61
|
+
size_bytes: n.size_bytes,
|
|
62
|
+
sha256: n.sha256,
|
|
63
|
+
width: n.width,
|
|
64
|
+
height: n.height,
|
|
65
|
+
url: n.url,
|
|
66
|
+
metadata: n.metadata
|
|
67
|
+
}, s = [...z.current, i];
|
|
68
|
+
z.current = s, h?.(s), k((e) => e.filter((e) => e.localId !== c));
|
|
69
|
+
} catch (e) {
|
|
70
|
+
if (e instanceof n && e.code === "ABORTED") {
|
|
71
|
+
k((e) => e.filter((e) => e.localId !== c));
|
|
72
72
|
return;
|
|
73
73
|
}
|
|
74
|
-
let
|
|
75
|
-
code:
|
|
76
|
-
message:
|
|
74
|
+
let t = e instanceof n ? {
|
|
75
|
+
code: e.code,
|
|
76
|
+
message: e.message
|
|
77
77
|
} : {
|
|
78
78
|
code: "UNKNOWN",
|
|
79
|
-
message:
|
|
79
|
+
message: e instanceof Error ? e.message : "Upload failed"
|
|
80
80
|
};
|
|
81
|
-
k((e) => e.map((e) => e.localId ===
|
|
81
|
+
k((e) => e.map((e) => e.localId === c ? {
|
|
82
82
|
...e,
|
|
83
|
-
error:
|
|
83
|
+
error: t,
|
|
84
84
|
progress: null,
|
|
85
85
|
abort: () => {}
|
|
86
86
|
} : e));
|
|
87
87
|
}
|
|
88
88
|
}, [
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
89
|
+
i.accepts,
|
|
90
|
+
i.max_size_bytes,
|
|
91
|
+
a,
|
|
92
92
|
h,
|
|
93
|
-
|
|
93
|
+
e.entityCode,
|
|
94
94
|
P,
|
|
95
95
|
F
|
|
96
96
|
]), K = u((e) => {
|
|
97
97
|
Array.from(e).forEach((e) => void G(e));
|
|
98
98
|
}, [G]), q = p(null), J = u(() => {
|
|
99
|
-
|
|
100
|
-
}, [
|
|
101
|
-
|
|
102
|
-
}, [
|
|
103
|
-
if (
|
|
99
|
+
C || q.current?.click();
|
|
100
|
+
}, [C]), ie = u((e) => {
|
|
101
|
+
C || (e.preventDefault(), e.dataTransfer.dropEffect = "copy");
|
|
102
|
+
}, [C]), ae = u((e) => {
|
|
103
|
+
if (C) return;
|
|
104
104
|
e.preventDefault();
|
|
105
105
|
let t = e.dataTransfer.files;
|
|
106
106
|
t && t.length > 0 && K(t);
|
|
107
|
-
}, [
|
|
107
|
+
}, [C, K]), oe = u((e) => {
|
|
108
108
|
let t = e.target.files;
|
|
109
109
|
e.target.value = "", t && t.length > 0 && K(t);
|
|
110
110
|
}, [K]), se = u((e) => {
|
|
111
|
-
I(e) && (
|
|
112
|
-
let t =
|
|
111
|
+
I(e) && (r(e).catch(() => {}), F(e));
|
|
112
|
+
let t = w.filter((t) => t.id !== e);
|
|
113
113
|
h?.(t), j((t) => {
|
|
114
114
|
let n = new Set(t);
|
|
115
115
|
return n.delete(e), n;
|
|
116
116
|
});
|
|
117
117
|
}, [
|
|
118
118
|
I,
|
|
119
|
-
|
|
119
|
+
w,
|
|
120
120
|
h,
|
|
121
121
|
F
|
|
122
122
|
]), ce = u(() => {
|
|
123
123
|
A.size !== 0 && (Array.from(A).forEach((e) => {
|
|
124
|
-
I(e) && (
|
|
125
|
-
}), h?.(
|
|
124
|
+
I(e) && (r(e).catch(() => {}), F(e));
|
|
125
|
+
}), h?.(w.filter((e) => !A.has(e.id))), j(/* @__PURE__ */ new Set()));
|
|
126
126
|
}, [
|
|
127
127
|
I,
|
|
128
|
-
|
|
128
|
+
w,
|
|
129
129
|
A,
|
|
130
130
|
h,
|
|
131
131
|
F
|
|
132
132
|
]), le = u((e) => {
|
|
133
133
|
let { active: t, over: n } = e;
|
|
134
134
|
if (!n || t.id === n.id) return;
|
|
135
|
-
let r =
|
|
136
|
-
r < 0 || i < 0 || h?.(
|
|
137
|
-
}, [
|
|
135
|
+
let r = w.findIndex((e) => e.id === t.id), i = w.findIndex((e) => e.id === n.id);
|
|
136
|
+
r < 0 || i < 0 || h?.(ne(w, r, i));
|
|
137
|
+
}, [w, h]), ue = u((e) => {
|
|
138
138
|
j((t) => {
|
|
139
139
|
let n = new Set(t);
|
|
140
140
|
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
141
141
|
});
|
|
142
|
-
}, []), Y = M == null ? null :
|
|
143
|
-
N((e) => e == null ? e : Math.min(
|
|
144
|
-
}, [
|
|
142
|
+
}, []), Y = M == null ? null : w[M], X = u(() => {
|
|
143
|
+
N((e) => e == null ? e : Math.min(w.length - 1, e + 1));
|
|
144
|
+
}, [w.length]), Z = u(() => {
|
|
145
145
|
N((e) => e == null ? e : Math.max(0, e - 1));
|
|
146
146
|
}, []), Q = u(() => N(null), []);
|
|
147
147
|
d(() => {
|
|
@@ -157,10 +157,10 @@ function D(n) {
|
|
|
157
157
|
Z
|
|
158
158
|
]);
|
|
159
159
|
let de = u((e) => {
|
|
160
|
-
|
|
161
|
-
}, [
|
|
160
|
+
C || (e.key === "Enter" || e.key === " ") && e.target === e.currentTarget && (e.preventDefault(), J());
|
|
161
|
+
}, [C, J]), $ = S === "display", fe = f(() => w.map((e) => e.id), [w]);
|
|
162
162
|
return /* @__PURE__ */ _("div", {
|
|
163
|
-
"data-testid": `file-widget-${
|
|
163
|
+
"data-testid": `file-widget-${a}`,
|
|
164
164
|
className: "flex flex-col gap-2",
|
|
165
165
|
children: [
|
|
166
166
|
!$ && A.size > 0 && /* @__PURE__ */ _("div", {
|
|
@@ -191,41 +191,41 @@ function D(n) {
|
|
|
191
191
|
sensors: B,
|
|
192
192
|
collisionDetection: b,
|
|
193
193
|
onDragEnd: le,
|
|
194
|
-
children: /* @__PURE__ */ g(
|
|
194
|
+
children: /* @__PURE__ */ g(te, {
|
|
195
195
|
items: fe,
|
|
196
|
-
strategy:
|
|
196
|
+
strategy: re,
|
|
197
197
|
children: /* @__PURE__ */ _("div", {
|
|
198
198
|
className: "grid grid-cols-[repeat(auto-fill,minmax(140px,1fr))] gap-3 rounded-md border border-dashed border-border bg-surface p-3 outline-none focus-visible:outline-2 focus-visible:outline-accent",
|
|
199
199
|
role: "grid",
|
|
200
200
|
"aria-label": V,
|
|
201
|
-
tabIndex: $ ||
|
|
201
|
+
tabIndex: $ || C ? -1 : 0,
|
|
202
202
|
onDragOver: ie,
|
|
203
203
|
onDrop: ae,
|
|
204
204
|
onKeyDown: de,
|
|
205
205
|
"data-testid": "grid-container",
|
|
206
206
|
children: [
|
|
207
|
-
|
|
207
|
+
w.map((e, t) => /* @__PURE__ */ g(E, {
|
|
208
208
|
file: e,
|
|
209
209
|
selected: A.has(e.id),
|
|
210
|
-
disabled:
|
|
210
|
+
disabled: C || $,
|
|
211
211
|
reorderable: U && !$,
|
|
212
212
|
preferredThumbnail: W,
|
|
213
213
|
onSelect: () => ue(e.id),
|
|
214
214
|
onRemove: () => se(e.id),
|
|
215
215
|
onPreview: () => N(t)
|
|
216
216
|
}, e.id)),
|
|
217
|
-
|
|
217
|
+
T.map((e) => /* @__PURE__ */ g(D, {
|
|
218
218
|
tile: e,
|
|
219
219
|
onCancel: () => {
|
|
220
220
|
e.abort(), L.current.add(e.localId), k((t) => t.filter((t) => t.localId !== e.localId));
|
|
221
221
|
},
|
|
222
222
|
onDismiss: () => k((t) => t.filter((t) => t.localId !== e.localId))
|
|
223
223
|
}, e.localId)),
|
|
224
|
-
|
|
224
|
+
w.length === 0 && T.length === 0 && /* @__PURE__ */ g("div", {
|
|
225
225
|
className: "col-span-full flex h-24 cursor-pointer items-center justify-center text-sm text-muted-foreground",
|
|
226
226
|
onClick: J,
|
|
227
227
|
"data-testid": "grid-empty",
|
|
228
|
-
children:
|
|
228
|
+
children: i.display?.placeholder || "Drop files here or click to browse"
|
|
229
229
|
})
|
|
230
230
|
]
|
|
231
231
|
})
|
|
@@ -238,12 +238,12 @@ function D(n) {
|
|
|
238
238
|
multiple: !0,
|
|
239
239
|
onChange: oe,
|
|
240
240
|
style: { display: "none" },
|
|
241
|
-
"data-testid": `file-input-${
|
|
241
|
+
"data-testid": `file-input-${a}`
|
|
242
242
|
}),
|
|
243
|
-
Y && /* @__PURE__ */ g(
|
|
243
|
+
Y && /* @__PURE__ */ g(O, {
|
|
244
244
|
file: Y,
|
|
245
245
|
hasPrev: M > 0,
|
|
246
|
-
hasNext: M <
|
|
246
|
+
hasNext: M < w.length - 1,
|
|
247
247
|
onPrev: Z,
|
|
248
248
|
onNext: X,
|
|
249
249
|
onClose: Q
|
|
@@ -251,46 +251,46 @@ function D(n) {
|
|
|
251
251
|
]
|
|
252
252
|
});
|
|
253
253
|
}
|
|
254
|
-
function
|
|
255
|
-
let { attributes: u, listeners: d, setNodeRef: f, transform: p, transition: m, isDragging: v } =
|
|
256
|
-
id:
|
|
257
|
-
disabled: !
|
|
254
|
+
function E({ file: t, selected: n, disabled: r, reorderable: i, preferredThumbnail: o, onSelect: s, onRemove: c, onPreview: l }) {
|
|
255
|
+
let { attributes: u, listeners: d, setNodeRef: f, transform: p, transition: m, isDragging: v } = S({
|
|
256
|
+
id: t.id,
|
|
257
|
+
disabled: !i
|
|
258
258
|
}), y = {
|
|
259
|
-
transform:
|
|
259
|
+
transform: C.Transform.toString(p),
|
|
260
260
|
transition: m,
|
|
261
261
|
opacity: v ? .5 : 1
|
|
262
|
-
}, b =
|
|
262
|
+
}, b = e(t.id, a(t, o), w(t, o));
|
|
263
263
|
return /* @__PURE__ */ _("div", {
|
|
264
264
|
ref: f,
|
|
265
265
|
style: y,
|
|
266
|
-
className: `group relative aspect-square overflow-hidden rounded-md border ${
|
|
267
|
-
"data-testid": `grid-tile-${
|
|
268
|
-
"data-selected":
|
|
266
|
+
className: `group relative aspect-square overflow-hidden rounded-md border ${n ? "border-accent" : "border-border"} bg-surface-2`,
|
|
267
|
+
"data-testid": `grid-tile-${t.id}`,
|
|
268
|
+
"data-selected": n || void 0,
|
|
269
269
|
children: [b ? /* @__PURE__ */ g("img", {
|
|
270
270
|
src: b,
|
|
271
|
-
alt:
|
|
271
|
+
alt: t.filename,
|
|
272
272
|
className: "h-full w-full cursor-pointer object-cover",
|
|
273
273
|
loading: "lazy",
|
|
274
274
|
onClick: l
|
|
275
275
|
}) : /* @__PURE__ */ g("div", {
|
|
276
276
|
className: "flex h-full w-full cursor-pointer items-center justify-center bg-surface-3 text-xs text-muted-foreground",
|
|
277
277
|
onClick: l,
|
|
278
|
-
children:
|
|
279
|
-
}), !
|
|
278
|
+
children: t.filename
|
|
279
|
+
}), !r && /* @__PURE__ */ _(h, { children: [
|
|
280
280
|
/* @__PURE__ */ g("input", {
|
|
281
281
|
type: "checkbox",
|
|
282
282
|
className: "absolute left-1 top-1 h-4 w-4 cursor-pointer",
|
|
283
|
-
checked:
|
|
283
|
+
checked: n,
|
|
284
284
|
onChange: s,
|
|
285
|
-
"aria-label": `Select ${
|
|
286
|
-
"data-testid": `select-${
|
|
285
|
+
"aria-label": `Select ${t.filename}`,
|
|
286
|
+
"data-testid": `select-${t.id}`,
|
|
287
287
|
onClick: (e) => e.stopPropagation()
|
|
288
288
|
}),
|
|
289
|
-
|
|
289
|
+
i && /* @__PURE__ */ g("button", {
|
|
290
290
|
type: "button",
|
|
291
291
|
className: "absolute right-1 top-1 cursor-grab rounded-sm border border-border bg-card px-1 text-xs",
|
|
292
|
-
"aria-label": `Drag to reorder ${
|
|
293
|
-
"data-testid": `drag-${
|
|
292
|
+
"aria-label": `Drag to reorder ${t.filename}`,
|
|
293
|
+
"data-testid": `drag-${t.id}`,
|
|
294
294
|
...u,
|
|
295
295
|
...d,
|
|
296
296
|
children: "⋮⋮"
|
|
@@ -306,14 +306,14 @@ function O({ file: e, selected: t, disabled: n, reorderable: a, preferredThumbna
|
|
|
306
306
|
type: "button",
|
|
307
307
|
className: "rounded-sm border border-border bg-card px-2 py-0.5 text-xs text-destructive",
|
|
308
308
|
onClick: c,
|
|
309
|
-
"data-testid": `remove-${
|
|
309
|
+
"data-testid": `remove-${t.id}`,
|
|
310
310
|
children: "Delete"
|
|
311
311
|
})]
|
|
312
312
|
})
|
|
313
313
|
] })]
|
|
314
314
|
});
|
|
315
315
|
}
|
|
316
|
-
function
|
|
316
|
+
function D({ tile: e, onCancel: t, onDismiss: n }) {
|
|
317
317
|
return /* @__PURE__ */ _("div", {
|
|
318
318
|
className: `relative flex aspect-square flex-col items-center justify-center rounded-md border ${e.error ? "border-destructive" : "border-border"} bg-surface-2 p-2 text-center text-xs`,
|
|
319
319
|
"data-testid": `pending-tile-${e.localId}`,
|
|
@@ -345,54 +345,54 @@ function ne({ tile: e, onCancel: t, onDismiss: n }) {
|
|
|
345
345
|
]
|
|
346
346
|
});
|
|
347
347
|
}
|
|
348
|
-
function
|
|
349
|
-
let
|
|
348
|
+
function O({ file: t, hasPrev: n, hasNext: r, onPrev: a, onNext: o, onClose: s }) {
|
|
349
|
+
let c = e(t.id, "preview", t.presigned_url ?? t.url ?? w(t));
|
|
350
350
|
return /* @__PURE__ */ _("div", {
|
|
351
351
|
className: "fixed inset-0 z-50 flex items-center justify-center bg-black/80",
|
|
352
352
|
role: "dialog",
|
|
353
353
|
"aria-modal": "true",
|
|
354
|
-
"aria-label":
|
|
354
|
+
"aria-label": t.filename,
|
|
355
355
|
"data-testid": "lightbox",
|
|
356
|
-
onClick:
|
|
356
|
+
onClick: s,
|
|
357
357
|
children: [
|
|
358
358
|
/* @__PURE__ */ g("button", {
|
|
359
359
|
type: "button",
|
|
360
360
|
className: "absolute right-4 top-4 rounded-sm border border-border bg-card px-3 py-1 text-foreground",
|
|
361
361
|
onClick: (e) => {
|
|
362
|
-
e.stopPropagation(),
|
|
362
|
+
e.stopPropagation(), s();
|
|
363
363
|
},
|
|
364
364
|
"data-testid": "lightbox-close",
|
|
365
365
|
children: "Close"
|
|
366
366
|
}),
|
|
367
|
-
|
|
367
|
+
n && /* @__PURE__ */ g("button", {
|
|
368
368
|
type: "button",
|
|
369
369
|
className: "absolute left-4 rounded-sm border border-border bg-card px-3 py-2 text-foreground",
|
|
370
370
|
onClick: (e) => {
|
|
371
|
-
e.stopPropagation(),
|
|
371
|
+
e.stopPropagation(), a();
|
|
372
372
|
},
|
|
373
373
|
"data-testid": "lightbox-prev",
|
|
374
374
|
children: "‹"
|
|
375
375
|
}),
|
|
376
|
-
|
|
376
|
+
r && /* @__PURE__ */ g("button", {
|
|
377
377
|
type: "button",
|
|
378
378
|
className: "absolute right-4 bottom-4 rounded-sm border border-border bg-card px-3 py-2 text-foreground",
|
|
379
379
|
onClick: (e) => {
|
|
380
|
-
e.stopPropagation(),
|
|
380
|
+
e.stopPropagation(), o();
|
|
381
381
|
},
|
|
382
382
|
"data-testid": "lightbox-next",
|
|
383
383
|
children: "›"
|
|
384
384
|
}),
|
|
385
|
-
|
|
386
|
-
src:
|
|
387
|
-
alt:
|
|
385
|
+
c ? /* @__PURE__ */ g("img", {
|
|
386
|
+
src: c,
|
|
387
|
+
alt: t.filename,
|
|
388
388
|
className: "max-h-[90vh] max-w-[90vw] object-contain",
|
|
389
389
|
onClick: (e) => e.stopPropagation()
|
|
390
390
|
}) : /* @__PURE__ */ _("div", {
|
|
391
391
|
className: "rounded-md bg-card p-4 text-foreground",
|
|
392
392
|
children: [
|
|
393
|
-
|
|
393
|
+
t.filename,
|
|
394
394
|
" (",
|
|
395
|
-
|
|
395
|
+
i(t.size_bytes),
|
|
396
396
|
")"
|
|
397
397
|
]
|
|
398
398
|
})
|
|
@@ -400,4 +400,4 @@ function re({ file: e, hasPrev: t, hasNext: n, onPrev: r, onNext: a, onClose: o
|
|
|
400
400
|
});
|
|
401
401
|
}
|
|
402
402
|
//#endregion
|
|
403
|
-
export {
|
|
403
|
+
export { T as Grid };
|
package/dist-lib/api/data.d.ts
CHANGED
|
@@ -78,6 +78,34 @@ export declare class ActionBatchError extends Error {
|
|
|
78
78
|
* passing it triggers a 400 from the server.
|
|
79
79
|
*/
|
|
80
80
|
export declare function buildActionBody(params: Record<string, unknown> | undefined, ids?: string[]): ActionExecuteRequest;
|
|
81
|
+
/**
|
|
82
|
+
* A drop-in replacement for the network action dispatch. Installed only in
|
|
83
|
+
* tests via setActionExecutor; production leaves it null.
|
|
84
|
+
*/
|
|
85
|
+
export type ActionExecutor = (code: string, body: ActionExecuteRequest) => Promise<ActionExecuteResponse>;
|
|
86
|
+
/**
|
|
87
|
+
* Install a test-time override for executeAction - and therefore for
|
|
88
|
+
* createEntity / updateEntity / deleteEntity / restoreEntity, which all
|
|
89
|
+
* dispatch through executeAction. The @declarion/react/testing harness uses
|
|
90
|
+
* this (mirroring setApiErrorReporter) to resolve actions from a fixture map
|
|
91
|
+
* instead of the network. Returns the previous executor so a test can restore
|
|
92
|
+
* it. Pass null to clear. Default (unset) is the real apiFetch path, unchanged.
|
|
93
|
+
*/
|
|
94
|
+
export declare function setActionExecutor(fn: ActionExecutor | null): ActionExecutor | null;
|
|
95
|
+
/**
|
|
96
|
+
* Test-time override for the entity-list read seam (the leaf of useEntityData /
|
|
97
|
+
* useEntityCount). Return undefined to fall through to the network. Installed
|
|
98
|
+
* by @declarion/react/testing so the REAL list hooks run and resolve fixtures
|
|
99
|
+
* by entity, params-agnostically (the hooks' query keys carry the screen's
|
|
100
|
+
* per_page / sort / filters, which a cache seed cannot know ahead of render).
|
|
101
|
+
*/
|
|
102
|
+
export type ListEntitiesResolver = (entity: string, params: ListParams) => ListResponse | undefined;
|
|
103
|
+
/** Test-time override for the single-record read seam (useEntityItem -> getEntity). */
|
|
104
|
+
export type GetEntityResolver = (entity: string, pkValues: PkValues | string) => DataResponse | undefined;
|
|
105
|
+
/** Install/clear the list read seam. Returns the previous resolver. */
|
|
106
|
+
export declare function setListEntitiesResolver(fn: ListEntitiesResolver | null): ListEntitiesResolver | null;
|
|
107
|
+
/** Install/clear the single-record read seam. Returns the previous resolver. */
|
|
108
|
+
export declare function setGetEntityResolver(fn: GetEntityResolver | null): GetEntityResolver | null;
|
|
81
109
|
/**
|
|
82
110
|
* Invoke an action. The URL `code` must be fully qualified for
|
|
83
111
|
* entity-scoped actions (e.g. `lead.archive`). For global actions it's the
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//#region src/components/primitives/dataTableStyles.ts
|
|
2
|
+
var e = {
|
|
3
|
+
width: "100%",
|
|
4
|
+
fontSize: 12.5,
|
|
5
|
+
borderCollapse: "separate",
|
|
6
|
+
borderSpacing: 0
|
|
7
|
+
}, t = {
|
|
8
|
+
height: 30,
|
|
9
|
+
padding: "0 12px",
|
|
10
|
+
textAlign: "left",
|
|
11
|
+
fontWeight: 600,
|
|
12
|
+
fontSize: 11,
|
|
13
|
+
color: "var(--text-3)",
|
|
14
|
+
borderBottom: "1px solid var(--divider)"
|
|
15
|
+
}, n = {
|
|
16
|
+
padding: "6px 12px",
|
|
17
|
+
borderBottom: "1px solid var(--divider)",
|
|
18
|
+
color: "var(--text-2)",
|
|
19
|
+
verticalAlign: "middle"
|
|
20
|
+
};
|
|
21
|
+
//#endregion
|
|
22
|
+
export { t as n, e as r, n as t };
|