@declarion/react 0.25.0 → 0.26.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-eixtbT5K.js → ActionRunner-B2e3Igpd.js} +1706 -3753
- package/dist-lib/{DraggableChildrenTable-ByuH27zv.js → DraggableChildrenTable-BUUUPzI3.js} +25 -25
- package/dist-lib/{Grid-hWuSXZWA.js → Grid-Bjq2IPUx.js} +76 -75
- package/dist-lib/{MarkdownRenderer-x-5sbiRs.js → MarkdownRenderer-Be0nUKB1.js} +1 -1
- package/dist-lib/index.js +5370 -3362
- package/dist-lib/lib/actions.d.ts +7 -0
- package/dist-lib/testing.js +27 -27
- package/dist-lib/value-D7fe0TEL.js +210 -0
- package/package.json +4 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { s as e } from "./DynamicIcon-DCRdxxZ7.js";
|
|
2
|
-
import {
|
|
2
|
+
import { Fn as t, In as n, m as r, mn as i, p as a, tn as o } from "./ActionRunner-B2e3Igpd.js";
|
|
3
3
|
import { n as s, r as c, t as l } from "./dataTableStyles-vwD1mVOP.js";
|
|
4
4
|
import { useCallback as u, useMemo as d, useRef as f } from "react";
|
|
5
5
|
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
@@ -7,14 +7,14 @@ import { DndContext as h, PointerSensor as g, closestCenter as _, useSensor as v
|
|
|
7
7
|
import { SortableContext as b, useSortable as x, verticalListSortingStrategy as S } from "@dnd-kit/sortable";
|
|
8
8
|
import { CSS as C } from "@dnd-kit/utilities";
|
|
9
9
|
//#region src/components/detail-layout/DraggableChildrenTable.tsx
|
|
10
|
-
function w({ config: t, childEntity:
|
|
10
|
+
function w({ config: t, childEntity: r, schema: i, rows: a, onChange: l, validationErrors: x, refs: C }) {
|
|
11
11
|
let w = f(null), E = t.position_field, D = t.columns, O = y(v(g, { activationConstraint: { distance: 5 } })), k = new Set(Array.isArray(t.foreign_key) ? t.foreign_key : [t.foreign_key]), A = D.filter((e) => {
|
|
12
12
|
if (k.has(e) || e === E) return !1;
|
|
13
|
-
let t =
|
|
13
|
+
let t = r.fields.get(e);
|
|
14
14
|
return !(!t || t.auto || t.primary || t.source);
|
|
15
15
|
}), j = new Set(D.filter((e) => {
|
|
16
16
|
if (e === E) return !0;
|
|
17
|
-
let t =
|
|
17
|
+
let t = r.fields.get(e);
|
|
18
18
|
return t && (t.auto || t.primary || t.source);
|
|
19
19
|
})), M = D.filter((e) => e !== E), N = d(() => a.filter((e) => !e._deleted).map((e) => e._key), [a]), P = u((e, t, n) => {
|
|
20
20
|
l(a.map((r) => r._key === e ? {
|
|
@@ -26,21 +26,21 @@ function w({ config: t, childEntity: n, schema: r, rows: a, onChange: l, validat
|
|
|
26
26
|
let e = a.filter((e) => !e._deleted).reduce((e, t) => {
|
|
27
27
|
let n = typeof t[E] == "number" ? t[E] : -1;
|
|
28
28
|
return Math.max(e, n);
|
|
29
|
-
}, -1),
|
|
29
|
+
}, -1), n = {
|
|
30
30
|
_key: crypto.randomUUID(),
|
|
31
31
|
_dirty: !0,
|
|
32
32
|
[E]: e + 1
|
|
33
33
|
}, i = t.quick_add?.defaults ?? {};
|
|
34
34
|
for (let e of A) {
|
|
35
|
-
let t =
|
|
36
|
-
t && (i[e] === void 0 ? t.default === void 0 ? t.type === "bool" && (
|
|
35
|
+
let t = r.fields.get(e);
|
|
36
|
+
t && (i[e] === void 0 ? t.default === void 0 ? t.type === "bool" && (n[e] = !1) : n[e] = t.default : n[e] = i[e]);
|
|
37
37
|
}
|
|
38
|
-
l([...a,
|
|
38
|
+
l([...a, n]);
|
|
39
39
|
}, [
|
|
40
40
|
a,
|
|
41
41
|
l,
|
|
42
42
|
A,
|
|
43
|
-
|
|
43
|
+
r,
|
|
44
44
|
t.quick_add?.defaults,
|
|
45
45
|
E
|
|
46
46
|
]), I = u((e) => {
|
|
@@ -118,10 +118,10 @@ function w({ config: t, childEntity: n, schema: r, rows: a, onChange: l, validat
|
|
|
118
118
|
padding: "0 4px"
|
|
119
119
|
} }),
|
|
120
120
|
M.map((e) => {
|
|
121
|
-
let t =
|
|
121
|
+
let t = r.fields.get(e);
|
|
122
122
|
return /* @__PURE__ */ p("th", {
|
|
123
123
|
style: B,
|
|
124
|
-
children: t ? o(t, e,
|
|
124
|
+
children: t ? o(t, e, i.entities) : e
|
|
125
125
|
}, e);
|
|
126
126
|
}),
|
|
127
127
|
/* @__PURE__ */ p("th", { style: {
|
|
@@ -136,7 +136,7 @@ function w({ config: t, childEntity: n, schema: r, rows: a, onChange: l, validat
|
|
|
136
136
|
columns: M,
|
|
137
137
|
editableColumns: A,
|
|
138
138
|
displayOnlyColumns: j,
|
|
139
|
-
childEntity:
|
|
139
|
+
childEntity: r,
|
|
140
140
|
validationErrors: x,
|
|
141
141
|
refs: C,
|
|
142
142
|
onCellChange: P,
|
|
@@ -148,7 +148,7 @@ function w({ config: t, childEntity: n, schema: r, rows: a, onChange: l, validat
|
|
|
148
148
|
})
|
|
149
149
|
}), /* @__PURE__ */ p("div", {
|
|
150
150
|
style: { marginTop: 8 },
|
|
151
|
-
children: /* @__PURE__ */ p(
|
|
151
|
+
children: /* @__PURE__ */ p(n, {
|
|
152
152
|
kind: "ghost",
|
|
153
153
|
size: "xs",
|
|
154
154
|
icon: /* @__PURE__ */ p(e.plus, { size: 12 }),
|
|
@@ -157,9 +157,9 @@ function w({ config: t, childEntity: n, schema: r, rows: a, onChange: l, validat
|
|
|
157
157
|
})
|
|
158
158
|
})] });
|
|
159
159
|
}
|
|
160
|
-
function T({ row:
|
|
161
|
-
let v = a(), y = !!
|
|
162
|
-
id:
|
|
160
|
+
function T({ row: n, columns: o, editableColumns: s, displayOnlyColumns: c, childEntity: u, validationErrors: d, refs: f, onCellChange: h, onDelete: g, onUndoDelete: _ }) {
|
|
161
|
+
let v = a(), y = !!n._deleted, b = d?.[n._key], { attributes: S, listeners: w, setNodeRef: T, transform: E, transition: D, isDragging: O } = x({
|
|
162
|
+
id: n._key,
|
|
163
163
|
disabled: y
|
|
164
164
|
}), k = {
|
|
165
165
|
transform: C.Translate.toString(E),
|
|
@@ -210,12 +210,12 @@ function T({ row: i, columns: o, editableColumns: s, displayOnlyColumns: c, chil
|
|
|
210
210
|
children: t ? r({
|
|
211
211
|
field: t,
|
|
212
212
|
fieldName: e,
|
|
213
|
-
value:
|
|
213
|
+
value: n[e],
|
|
214
214
|
mode: "display",
|
|
215
|
-
record:
|
|
215
|
+
record: n,
|
|
216
216
|
refs: f,
|
|
217
217
|
locale: v
|
|
218
|
-
}) : n
|
|
218
|
+
}) : i(n[e])
|
|
219
219
|
}, e) : /* @__PURE__ */ p("td", {
|
|
220
220
|
style: {
|
|
221
221
|
...j,
|
|
@@ -227,13 +227,13 @@ function T({ row: i, columns: o, editableColumns: s, displayOnlyColumns: c, chil
|
|
|
227
227
|
children: t ? r({
|
|
228
228
|
field: t,
|
|
229
229
|
fieldName: e,
|
|
230
|
-
value:
|
|
230
|
+
value: n[e],
|
|
231
231
|
mode: "edit",
|
|
232
|
-
onChange: (t) => h(
|
|
233
|
-
record:
|
|
232
|
+
onChange: (t) => h(n._key, e, t),
|
|
233
|
+
record: n,
|
|
234
234
|
refs: f,
|
|
235
235
|
locale: v
|
|
236
|
-
}) : n
|
|
236
|
+
}) : i(n[e])
|
|
237
237
|
}, e);
|
|
238
238
|
}),
|
|
239
239
|
/* @__PURE__ */ p("td", {
|
|
@@ -245,12 +245,12 @@ function T({ row: i, columns: o, editableColumns: s, displayOnlyColumns: c, chil
|
|
|
245
245
|
children: y ? /* @__PURE__ */ p(t, {
|
|
246
246
|
size: 24,
|
|
247
247
|
icon: /* @__PURE__ */ p(e.refresh, { size: 12 }),
|
|
248
|
-
onClick: () => _(
|
|
248
|
+
onClick: () => _(n._key),
|
|
249
249
|
title: "Undo delete"
|
|
250
250
|
}) : /* @__PURE__ */ p(t, {
|
|
251
251
|
size: 24,
|
|
252
252
|
icon: /* @__PURE__ */ p(e.trash, { size: 12 }),
|
|
253
|
-
onClick: () => g(
|
|
253
|
+
onClick: () => g(n._key),
|
|
254
254
|
title: "Delete row"
|
|
255
255
|
})
|
|
256
256
|
})
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as e, S as t, _ as n, b as r, x as i, y as a } from "./ActionRunner-B2e3Igpd.js";
|
|
2
|
+
import { c as o, i as s, l as c, t as l } from "./value-D7fe0TEL.js";
|
|
2
3
|
import { useCallback as u, useEffect as d, useMemo as f, useRef as p, useState as m } from "react";
|
|
3
4
|
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
4
5
|
import { DndContext as v, PointerSensor as y, closestCenter as b, useSensor as x, useSensors as ee } from "@dnd-kit/core";
|
|
@@ -6,79 +7,79 @@ import { SortableContext as te, arrayMove as ne, rectSortingStrategy as re, useS
|
|
|
6
7
|
import { CSS as C } from "@dnd-kit/utilities";
|
|
7
8
|
//#region src/components/file-widgets/Grid.tsx
|
|
8
9
|
function w(e, t) {
|
|
9
|
-
return
|
|
10
|
+
return o(e, t);
|
|
10
11
|
}
|
|
11
|
-
function T(
|
|
12
|
-
let { field:
|
|
12
|
+
function T(i) {
|
|
13
|
+
let { field: o, fieldName: s, value: c, onChange: h, mode: S, disabled: C } = i, w = l(c), [T, k] = m([]), [A, j] = m(/* @__PURE__ */ new Set()), [M, N] = m(null), { register: P, unregister: F, isDraft: I } = n(), L = p(/* @__PURE__ */ new Set()), R = p([]);
|
|
13
14
|
R.current = T;
|
|
14
15
|
let z = p(w);
|
|
15
16
|
z.current = w, d(() => () => {
|
|
16
17
|
R.current.forEach((e) => e.abort());
|
|
17
18
|
}, []);
|
|
18
|
-
let B = ee(x(y, { activationConstraint: { distance: 5 } })), V =
|
|
19
|
-
let
|
|
20
|
-
if (
|
|
19
|
+
let B = ee(x(y, { activationConstraint: { distance: 5 } })), V = o.display?.placeholder || s, H = (o.accepts ?? ["image/*"]).join(","), U = o.display?.reorderable !== !1, W = o.display?.listable_thumbnail, G = u(async (n) => {
|
|
20
|
+
let c = e(n, o.accepts, o.max_size_bytes), l = `tile-${Math.random().toString(36).slice(2)}-${Date.now()}`, u = new AbortController();
|
|
21
|
+
if (c) {
|
|
21
22
|
k((e) => [...e, {
|
|
22
|
-
localId:
|
|
23
|
-
filename:
|
|
23
|
+
localId: l,
|
|
24
|
+
filename: n.name,
|
|
24
25
|
progress: null,
|
|
25
|
-
error:
|
|
26
|
+
error: c,
|
|
26
27
|
abort: () => {}
|
|
27
28
|
}]);
|
|
28
29
|
return;
|
|
29
30
|
}
|
|
30
31
|
k((e) => [...e, {
|
|
31
|
-
localId:
|
|
32
|
-
filename:
|
|
32
|
+
localId: l,
|
|
33
|
+
filename: n.name,
|
|
33
34
|
progress: {
|
|
34
35
|
loaded: 0,
|
|
35
|
-
total:
|
|
36
|
+
total: n.size,
|
|
36
37
|
pct: 0
|
|
37
38
|
},
|
|
38
39
|
error: null,
|
|
39
40
|
abort: () => u.abort()
|
|
40
41
|
}]);
|
|
41
42
|
try {
|
|
42
|
-
let
|
|
43
|
-
file:
|
|
44
|
-
entityCode:
|
|
45
|
-
fieldCode:
|
|
43
|
+
let e = await t({
|
|
44
|
+
file: n,
|
|
45
|
+
entityCode: i.entityCode,
|
|
46
|
+
fieldCode: s,
|
|
46
47
|
signal: u.signal,
|
|
47
|
-
onProgress: (e) => k((t) => t.map((t) => t.localId ===
|
|
48
|
+
onProgress: (e) => k((t) => t.map((t) => t.localId === l ? {
|
|
48
49
|
...t,
|
|
49
50
|
progress: e
|
|
50
51
|
} : t))
|
|
51
52
|
});
|
|
52
|
-
if (L.current.delete(
|
|
53
|
-
r(
|
|
53
|
+
if (L.current.delete(l)) {
|
|
54
|
+
r(e.id).catch(() => {}), F(e.id);
|
|
54
55
|
return;
|
|
55
56
|
}
|
|
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 =
|
|
57
|
+
P(e.id, () => r(e.id));
|
|
58
|
+
let a = {
|
|
59
|
+
id: e.id,
|
|
60
|
+
filename: e.filename,
|
|
61
|
+
content_type: e.content_type,
|
|
62
|
+
size_bytes: e.size_bytes,
|
|
63
|
+
sha256: e.sha256,
|
|
64
|
+
width: e.width,
|
|
65
|
+
height: e.height,
|
|
66
|
+
url: e.url,
|
|
67
|
+
metadata: e.metadata
|
|
68
|
+
}, o = [...z.current, a];
|
|
69
|
+
z.current = o, h?.(o), k((e) => e.filter((e) => e.localId !== l));
|
|
69
70
|
} catch (e) {
|
|
70
|
-
if (e instanceof
|
|
71
|
-
k((e) => e.filter((e) => e.localId !==
|
|
71
|
+
if (e instanceof a && e.code === "ABORTED") {
|
|
72
|
+
k((e) => e.filter((e) => e.localId !== l));
|
|
72
73
|
return;
|
|
73
74
|
}
|
|
74
|
-
let t = e instanceof
|
|
75
|
+
let t = e instanceof a ? {
|
|
75
76
|
code: e.code,
|
|
76
77
|
message: e.message
|
|
77
78
|
} : {
|
|
78
79
|
code: "UNKNOWN",
|
|
79
80
|
message: e instanceof Error ? e.message : "Upload failed"
|
|
80
81
|
};
|
|
81
|
-
k((e) => e.map((e) => e.localId ===
|
|
82
|
+
k((e) => e.map((e) => e.localId === l ? {
|
|
82
83
|
...e,
|
|
83
84
|
error: t,
|
|
84
85
|
progress: null,
|
|
@@ -86,11 +87,11 @@ function T(e) {
|
|
|
86
87
|
} : e));
|
|
87
88
|
}
|
|
88
89
|
}, [
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
o.accepts,
|
|
91
|
+
o.max_size_bytes,
|
|
92
|
+
s,
|
|
92
93
|
h,
|
|
93
|
-
|
|
94
|
+
i.entityCode,
|
|
94
95
|
P,
|
|
95
96
|
F
|
|
96
97
|
]), K = u((e) => {
|
|
@@ -160,7 +161,7 @@ function T(e) {
|
|
|
160
161
|
C || (e.key === "Enter" || e.key === " ") && e.target === e.currentTarget && (e.preventDefault(), J());
|
|
161
162
|
}, [C, J]), $ = S === "display", fe = f(() => w.map((e) => e.id), [w]);
|
|
162
163
|
return /* @__PURE__ */ _("div", {
|
|
163
|
-
"data-testid": `file-widget-${
|
|
164
|
+
"data-testid": `file-widget-${s}`,
|
|
164
165
|
className: "flex flex-col gap-2",
|
|
165
166
|
children: [
|
|
166
167
|
!$ && A.size > 0 && /* @__PURE__ */ _("div", {
|
|
@@ -225,7 +226,7 @@ function T(e) {
|
|
|
225
226
|
className: "col-span-full flex h-24 cursor-pointer items-center justify-center text-sm text-muted-foreground",
|
|
226
227
|
onClick: J,
|
|
227
228
|
"data-testid": "grid-empty",
|
|
228
|
-
children:
|
|
229
|
+
children: o.display?.placeholder || "Drop files here or click to browse"
|
|
229
230
|
})
|
|
230
231
|
]
|
|
231
232
|
})
|
|
@@ -238,7 +239,7 @@ function T(e) {
|
|
|
238
239
|
multiple: !0,
|
|
239
240
|
onChange: oe,
|
|
240
241
|
style: { display: "none" },
|
|
241
|
-
"data-testid": `file-input-${
|
|
242
|
+
"data-testid": `file-input-${s}`
|
|
242
243
|
}),
|
|
243
244
|
Y && /* @__PURE__ */ g(O, {
|
|
244
245
|
file: Y,
|
|
@@ -251,46 +252,46 @@ function T(e) {
|
|
|
251
252
|
]
|
|
252
253
|
});
|
|
253
254
|
}
|
|
254
|
-
function E({ file:
|
|
255
|
+
function E({ file: e, selected: t, disabled: n, reorderable: r, preferredThumbnail: i, onSelect: a, onRemove: o, onPreview: l }) {
|
|
255
256
|
let { attributes: u, listeners: d, setNodeRef: f, transform: p, transition: m, isDragging: v } = S({
|
|
256
|
-
id:
|
|
257
|
-
disabled: !
|
|
257
|
+
id: e.id,
|
|
258
|
+
disabled: !r
|
|
258
259
|
}), y = {
|
|
259
260
|
transform: C.Transform.toString(p),
|
|
260
261
|
transition: m,
|
|
261
262
|
opacity: v ? .5 : 1
|
|
262
|
-
}, b = e
|
|
263
|
+
}, b = s(e.id, c(e, i), w(e, i));
|
|
263
264
|
return /* @__PURE__ */ _("div", {
|
|
264
265
|
ref: f,
|
|
265
266
|
style: y,
|
|
266
|
-
className: `group relative aspect-square overflow-hidden rounded-md border ${
|
|
267
|
-
"data-testid": `grid-tile-${
|
|
268
|
-
"data-selected":
|
|
267
|
+
className: `group relative aspect-square overflow-hidden rounded-md border ${t ? "border-accent" : "border-border"} bg-surface-2`,
|
|
268
|
+
"data-testid": `grid-tile-${e.id}`,
|
|
269
|
+
"data-selected": t || void 0,
|
|
269
270
|
children: [b ? /* @__PURE__ */ g("img", {
|
|
270
271
|
src: b,
|
|
271
|
-
alt:
|
|
272
|
+
alt: e.filename,
|
|
272
273
|
className: "h-full w-full cursor-pointer object-cover",
|
|
273
274
|
loading: "lazy",
|
|
274
275
|
onClick: l
|
|
275
276
|
}) : /* @__PURE__ */ g("div", {
|
|
276
277
|
className: "flex h-full w-full cursor-pointer items-center justify-center bg-surface-3 text-xs text-muted-foreground",
|
|
277
278
|
onClick: l,
|
|
278
|
-
children:
|
|
279
|
-
}), !
|
|
279
|
+
children: e.filename
|
|
280
|
+
}), !n && /* @__PURE__ */ _(h, { children: [
|
|
280
281
|
/* @__PURE__ */ g("input", {
|
|
281
282
|
type: "checkbox",
|
|
282
283
|
className: "absolute left-1 top-1 h-4 w-4 cursor-pointer",
|
|
283
|
-
checked:
|
|
284
|
-
onChange:
|
|
285
|
-
"aria-label": `Select ${
|
|
286
|
-
"data-testid": `select-${
|
|
284
|
+
checked: t,
|
|
285
|
+
onChange: a,
|
|
286
|
+
"aria-label": `Select ${e.filename}`,
|
|
287
|
+
"data-testid": `select-${e.id}`,
|
|
287
288
|
onClick: (e) => e.stopPropagation()
|
|
288
289
|
}),
|
|
289
|
-
|
|
290
|
+
r && /* @__PURE__ */ g("button", {
|
|
290
291
|
type: "button",
|
|
291
292
|
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-${
|
|
293
|
+
"aria-label": `Drag to reorder ${e.filename}`,
|
|
294
|
+
"data-testid": `drag-${e.id}`,
|
|
294
295
|
...u,
|
|
295
296
|
...d,
|
|
296
297
|
children: "⋮⋮"
|
|
@@ -305,8 +306,8 @@ function E({ file: t, selected: n, disabled: r, reorderable: i, preferredThumbna
|
|
|
305
306
|
}), /* @__PURE__ */ g("button", {
|
|
306
307
|
type: "button",
|
|
307
308
|
className: "rounded-sm border border-border bg-card px-2 py-0.5 text-xs text-destructive",
|
|
308
|
-
onClick:
|
|
309
|
-
"data-testid": `remove-${
|
|
309
|
+
onClick: o,
|
|
310
|
+
"data-testid": `remove-${e.id}`,
|
|
310
311
|
children: "Delete"
|
|
311
312
|
})]
|
|
312
313
|
})
|
|
@@ -345,54 +346,54 @@ function D({ tile: e, onCancel: t, onDismiss: n }) {
|
|
|
345
346
|
]
|
|
346
347
|
});
|
|
347
348
|
}
|
|
348
|
-
function O({ file:
|
|
349
|
-
let c = e
|
|
349
|
+
function O({ file: e, hasPrev: t, hasNext: n, onPrev: r, onNext: a, onClose: o }) {
|
|
350
|
+
let c = s(e.id, "preview", e.presigned_url ?? e.url ?? w(e));
|
|
350
351
|
return /* @__PURE__ */ _("div", {
|
|
351
352
|
className: "fixed inset-0 z-50 flex items-center justify-center bg-black/80",
|
|
352
353
|
role: "dialog",
|
|
353
354
|
"aria-modal": "true",
|
|
354
|
-
"aria-label":
|
|
355
|
+
"aria-label": e.filename,
|
|
355
356
|
"data-testid": "lightbox",
|
|
356
|
-
onClick:
|
|
357
|
+
onClick: o,
|
|
357
358
|
children: [
|
|
358
359
|
/* @__PURE__ */ g("button", {
|
|
359
360
|
type: "button",
|
|
360
361
|
className: "absolute right-4 top-4 rounded-sm border border-border bg-card px-3 py-1 text-foreground",
|
|
361
362
|
onClick: (e) => {
|
|
362
|
-
e.stopPropagation(),
|
|
363
|
+
e.stopPropagation(), o();
|
|
363
364
|
},
|
|
364
365
|
"data-testid": "lightbox-close",
|
|
365
366
|
children: "Close"
|
|
366
367
|
}),
|
|
367
|
-
|
|
368
|
+
t && /* @__PURE__ */ g("button", {
|
|
368
369
|
type: "button",
|
|
369
370
|
className: "absolute left-4 rounded-sm border border-border bg-card px-3 py-2 text-foreground",
|
|
370
371
|
onClick: (e) => {
|
|
371
|
-
e.stopPropagation(),
|
|
372
|
+
e.stopPropagation(), r();
|
|
372
373
|
},
|
|
373
374
|
"data-testid": "lightbox-prev",
|
|
374
375
|
children: "‹"
|
|
375
376
|
}),
|
|
376
|
-
|
|
377
|
+
n && /* @__PURE__ */ g("button", {
|
|
377
378
|
type: "button",
|
|
378
379
|
className: "absolute right-4 bottom-4 rounded-sm border border-border bg-card px-3 py-2 text-foreground",
|
|
379
380
|
onClick: (e) => {
|
|
380
|
-
e.stopPropagation(),
|
|
381
|
+
e.stopPropagation(), a();
|
|
381
382
|
},
|
|
382
383
|
"data-testid": "lightbox-next",
|
|
383
384
|
children: "›"
|
|
384
385
|
}),
|
|
385
386
|
c ? /* @__PURE__ */ g("img", {
|
|
386
387
|
src: c,
|
|
387
|
-
alt:
|
|
388
|
+
alt: e.filename,
|
|
388
389
|
className: "max-h-[90vh] max-w-[90vw] object-contain",
|
|
389
390
|
onClick: (e) => e.stopPropagation()
|
|
390
391
|
}) : /* @__PURE__ */ _("div", {
|
|
391
392
|
className: "rounded-md bg-card p-4 text-foreground",
|
|
392
393
|
children: [
|
|
393
|
-
|
|
394
|
+
e.filename,
|
|
394
395
|
" (",
|
|
395
|
-
i(
|
|
396
|
+
i(e.size_bytes),
|
|
396
397
|
")"
|
|
397
398
|
]
|
|
398
399
|
})
|