@declarion/react 0.57.0 → 0.59.2
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/README.md +0 -2
- package/dist-lib/AgentChatPanel.impl-DBH1Ff4G.js +1200 -0
- package/dist-lib/DetailAuditStrip-9eJM2Fml.js +288 -0
- package/dist-lib/{DraggableChildrenTable-BV5sb8Uo.js → DraggableChildrenTable-4RZC351U.js} +87 -86
- package/dist-lib/Grid-CQabaBLx.js +405 -0
- package/dist-lib/{LayoutRenderer-C9AH9cXf.js → LayoutRenderer-DGKWZKpW.js} +1000 -1114
- package/dist-lib/{ListCardsBody-DXcDg536.js → ListCardsBody-DfGmyNIu.js} +84 -84
- package/dist-lib/MarkdownRenderer-BDbzDv_y.js +87 -0
- package/dist-lib/{RefreshControl-CNtN8zSl.js → RefreshControl-Bhoib0ZA.js} +126 -155
- package/dist-lib/SmartDetailPage.impl-DFjz29Ff.js +1565 -0
- package/dist-lib/SmartListPage.impl-BrZLE_Gb.js +3046 -0
- package/dist-lib/{SmartRecordListPage.impl-Bkl9aZJ8.js → SmartRecordListPage.impl-C1FJLr80.js} +281 -280
- package/dist-lib/SortHeaderMenu-Cijxk4cX.js +107 -0
- package/dist-lib/action-dispatch-DY0c8U81.js +1967 -0
- package/dist-lib/api/client.d.ts +5 -0
- package/dist-lib/api/data.d.ts +2 -4
- package/dist-lib/api/entities.d.ts +8 -15
- package/dist-lib/api/events.d.ts +3 -3
- package/dist-lib/cardProjection-Bkl2SSYz.js +499 -0
- package/dist-lib/components/actions/ResponsiveActionBar.d.ts +17 -16
- package/dist-lib/components/agents/AgentChatPanel.d.ts +3 -13
- package/dist-lib/components/agents/AgentChatPanel.impl.d.ts +14 -0
- package/dist-lib/components/agents/AgentPicker.d.ts +1 -2
- package/dist-lib/components/chrome/PageShell.d.ts +7 -0
- package/dist-lib/components/chrome/RecordHeader.d.ts +1 -2
- package/dist-lib/components/chrome/headerActionZone.d.ts +27 -0
- package/dist-lib/components/detail-layout/DetailAuditStrip.d.ts +1 -2
- package/dist-lib/components/detail-layout/DetailHighlights.d.ts +1 -2
- package/dist-lib/components/detail-layout/blockMeta.d.ts +2 -1
- package/dist-lib/components/fields/BoolField.d.ts +1 -1
- package/dist-lib/components/fields/EnumField.d.ts +1 -1
- package/dist-lib/components/fields/IntArrayField.d.ts +1 -1
- package/dist-lib/components/fields/MultilangArrayField.d.ts +2 -0
- package/dist-lib/components/fields/MultilangField.d.ts +1 -1
- package/dist-lib/components/fields/MultilangTextField.d.ts +1 -1
- package/dist-lib/components/fields/NumberField.d.ts +1 -1
- package/dist-lib/components/fields/PasswordField.d.ts +1 -1
- package/dist-lib/components/fields/RefCombobox.d.ts +1 -1
- package/dist-lib/components/fields/SecretField.d.ts +1 -1
- package/dist-lib/components/fields/StringArrayField.d.ts +1 -1
- package/dist-lib/components/fields/TimestampField.d.ts +1 -1
- package/dist-lib/components/fields/cells/registry.d.ts +2 -1
- package/dist-lib/components/fields/index.d.ts +2 -1
- package/dist-lib/components/fields/langMap.d.ts +2 -0
- package/dist-lib/components/fields/secretValue.d.ts +2 -0
- package/dist-lib/components/file-widgets/UnknownFileWidget.d.ts +3 -0
- package/dist-lib/components/file-widgets/UploadFailureText.d.ts +4 -0
- package/dist-lib/components/file-widgets/helpers.d.ts +1 -1
- package/dist-lib/components/file-widgets/host.d.ts +4 -3
- package/dist-lib/components/file-widgets/types.d.ts +1 -0
- package/dist-lib/components/file-widgets/upload.d.ts +18 -3
- package/dist-lib/components/filters/filter-op-label.d.ts +3 -0
- package/dist-lib/components/layout/ImpersonationBanner.d.ts +1 -1
- package/dist-lib/components/layout/ImpersonationFrame.d.ts +1 -1
- package/dist-lib/components/layout/Layout.d.ts +2 -1
- package/dist-lib/components/layout/Sidebar.d.ts +2 -1
- package/dist-lib/components/layout/TenantChip.d.ts +1 -1
- package/dist-lib/components/list/ViewSwitcher.d.ts +4 -2
- package/dist-lib/components/pages/DocumentsMenu.d.ts +1 -2
- package/dist-lib/components/pages/ExportMenu.d.ts +3 -5
- package/dist-lib/components/pages/RecordDocumentsPanel.d.ts +1 -2
- package/dist-lib/components/pages/auth/AuthShell.d.ts +4 -31
- package/dist-lib/components/pages/exportRequest.d.ts +4 -6
- package/dist-lib/components/pages/list/DeleteViewDialog.d.ts +8 -0
- package/dist-lib/components/pages/list/ListCardRow.d.ts +1 -2
- package/dist-lib/components/pages/list/ListCardsBody.d.ts +0 -1
- package/dist-lib/components/pages/list/ListFloatbar.d.ts +2 -2
- package/dist-lib/components/pages/list/ListHeader.d.ts +2 -2
- package/dist-lib/components/pages/list/ListNoRows.d.ts +4 -5
- package/dist-lib/components/pages/list/ListToolbar.d.ts +3 -2
- package/dist-lib/components/pages/list/ListUrlBanner.d.ts +10 -0
- package/dist-lib/components/pages/list/RowActionsCell.d.ts +2 -4
- package/dist-lib/components/pages/list/RowContextMenu.d.ts +1 -2
- package/dist-lib/components/pages/list/columns.d.ts +2 -1
- package/dist-lib/components/pages/list/filter-meta.d.ts +2 -1
- package/dist-lib/components/pages/list/useActiveView.d.ts +38 -0
- package/dist-lib/components/pages/list/useListColumnLayout.d.ts +6 -5
- package/dist-lib/components/pages/list/useListQuery.d.ts +4 -4
- package/dist-lib/components/pages/list/useListSort.d.ts +5 -4
- package/dist-lib/components/pages/list/useListViews.d.ts +18 -8
- package/dist-lib/components/pages/list/useRowMenu.d.ts +2 -3
- package/dist-lib/components/pages/profile/Profile.d.ts +3 -0
- package/dist-lib/components/params/ParamsBlock.d.ts +1 -13
- package/dist-lib/components/params/param-editors.d.ts +3 -11
- package/dist-lib/components/primitives/ClassifiedFieldLocked.d.ts +1 -2
- package/dist-lib/components/shared/DynamicIcon.d.ts +2 -2
- package/dist-lib/components/shared/LoadingSkeleton.d.ts +1 -0
- package/dist-lib/components/shared/LucideIcon.d.ts +1 -1
- package/dist-lib/components/shared/useOwnRefresh.d.ts +1 -1
- package/dist-lib/declarion-react.css +1 -1
- package/dist-lib/embed/theme.d.ts +1 -1
- package/dist-lib/embed/useEmbedNavigate.d.ts +1 -1
- package/dist-lib/failure-v-uGSpbX.js +158 -0
- package/dist-lib/{field-classification-D6xQYn-h.js → field-classification-C28XE-_P.js} +514 -307
- package/dist-lib/format-count-DA4wmmWR.js +1771 -0
- package/dist-lib/hooks/useEntityData.d.ts +1 -1
- package/dist-lib/hooks/useFilters.d.ts +7 -5
- package/dist-lib/hooks/useLanguage.d.ts +4 -0
- package/dist-lib/hooks/useParams.d.ts +4 -51
- package/dist-lib/hooks/useRegisterScreenTab.d.ts +1 -1
- package/dist-lib/hooks/useSSE.d.ts +3 -3
- package/dist-lib/hooks/useTabTitle.d.ts +2 -0
- package/dist-lib/hooks/useText.d.ts +3 -3
- package/dist-lib/hooks/useVersionWatcher.d.ts +1 -1
- package/dist-lib/hooks/useViews.d.ts +20 -0
- package/dist-lib/index.d.ts +8 -7
- package/dist-lib/index.js +2716 -5803
- package/dist-lib/lib/action-dispatch.d.ts +2 -1
- package/dist-lib/lib/actions.d.ts +30 -42
- package/dist-lib/lib/anchor.d.ts +3 -4
- package/dist-lib/lib/decimal-text.d.ts +1 -0
- package/dist-lib/lib/document-templates.d.ts +1 -2
- package/dist-lib/lib/download.d.ts +2 -1
- package/dist-lib/lib/evidence-verdict.d.ts +2 -1
- package/dist-lib/lib/failure.d.ts +2 -0
- package/dist-lib/lib/field-classification.d.ts +3 -3
- package/dist-lib/lib/filters.d.ts +18 -2
- package/dist-lib/lib/format-count.d.ts +8 -7
- package/dist-lib/lib/language.d.ts +19 -0
- package/dist-lib/lib/mass-edit.d.ts +2 -1
- package/dist-lib/lib/realtime-query-keys.d.ts +1 -1
- package/dist-lib/lib/realtime-reconcile.d.ts +3 -4
- package/dist-lib/lib/screen-back.d.ts +4 -6
- package/dist-lib/lib/sort.d.ts +9 -9
- package/dist-lib/lib/timestamp.d.ts +5 -7
- package/dist-lib/lib/ui-actions.d.ts +2 -1
- package/dist-lib/peekDraftStore-D-cTbiIr.js +199 -0
- package/dist-lib/registry-Cb3W-czW.js +1950 -0
- package/dist-lib/safe-url-oSJw5pzO.js +34 -0
- package/dist-lib/stores/icon-registry.d.ts +2 -2
- package/dist-lib/stores/list-layout.d.ts +3 -4
- package/dist-lib/stores/realtime.d.ts +1 -1
- package/dist-lib/stores/tabs.d.ts +3 -2
- package/dist-lib/testing.d.ts +6 -0
- package/dist-lib/testing.js +98 -76
- package/dist-lib/types/api.d.ts +7 -8
- package/dist-lib/types/fieldType.d.ts +1 -1
- package/dist-lib/types/files.d.ts +4 -4
- package/dist-lib/types/schema.d.ts +44 -50
- package/dist-lib/useAgentConversation-D97IqE-J.js +623 -0
- package/dist-lib/{useCurrentScreen-CzwzQpoW.js → useCurrentScreen-BL5NZFCw.js} +2777 -3768
- package/dist-lib/useListQuery-BG1GyKtJ.js +103 -0
- package/dist-lib/useProperties-4Lg3odrt.js +83 -0
- package/dist-lib/{useTabSearchMirror-C39U85cg.js → useTabSearchMirror-ZVLlINBX.js} +49 -51
- package/dist-lib/useText-BFDCTUSo.js +952 -0
- package/dist-lib/{value-Bo8C8WMU.js → value-By1-WJ8J.js} +74 -76
- package/dist-lib/vite/fingerprint-plugin.d.ts +2 -3
- package/package.json +9 -9
- package/dist-lib/Grid-DWgUPuZ3.js +0 -404
- package/dist-lib/MarkdownRenderer-CcSFc2N3.js +0 -85
- package/dist-lib/RecordIdBadge-CGxPR-8q.js +0 -24
- package/dist-lib/SmartDetailPage.impl-lskCd-WG.js +0 -1846
- package/dist-lib/SmartListPage.impl-CrGbdzyK.js +0 -2854
- package/dist-lib/SortHeaderMenu-SYSAaqQJ.js +0 -106
- package/dist-lib/action-dispatch-CR4ajBtT.js +0 -1985
- package/dist-lib/cardProjection-CW5RIMko.js +0 -699
- package/dist-lib/components/pages/home/HomeStub.d.ts +0 -6
- package/dist-lib/components/pages/jobs/Jobs.d.ts +0 -1
- package/dist-lib/components/pages/pipeline/Pipeline.d.ts +0 -1
- package/dist-lib/format-count-Dobmi-Ji.js +0 -1551
- package/dist-lib/hooks/useUserLocale.d.ts +0 -1
- package/dist-lib/lib/messages.d.ts +0 -12
- package/dist-lib/peekDraftStore-5wQ7lq_V.js +0 -194
- package/dist-lib/registry-CjgUaF7C.js +0 -1768
- package/dist-lib/useListQuery-D7Hr5WM1.js +0 -96
- package/dist-lib/useProperties-CqtCzFCr.js +0 -81
|
@@ -1,404 +0,0 @@
|
|
|
1
|
-
import { ct as e, it as t, lt as n, ot as r, st as i, ut as a } from "./useCurrentScreen-CzwzQpoW.js";
|
|
2
|
-
import { c as o, i as s, l as c, t as l } from "./value-Bo8C8WMU.js";
|
|
3
|
-
import { useCallback as u, useEffect as d, useMemo as f, useRef as p, useState as m } from "react";
|
|
4
|
-
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
5
|
-
import { DndContext as v, PointerSensor as y, closestCenter as b, useSensor as x, useSensors as ee } from "@dnd-kit/core";
|
|
6
|
-
import { SortableContext as te, arrayMove as ne, rectSortingStrategy as re, useSortable as S } from "@dnd-kit/sortable";
|
|
7
|
-
import { CSS as C } from "@dnd-kit/utilities";
|
|
8
|
-
//#region src/components/file-widgets/Grid.tsx
|
|
9
|
-
function w(e, t) {
|
|
10
|
-
return o(e, t);
|
|
11
|
-
}
|
|
12
|
-
function T(e) {
|
|
13
|
-
let { field: o, fieldName: s, value: c, onChange: h, mode: S, disabled: C } = e, w = l(c), [T, k] = m([]), [A, j] = m(/* @__PURE__ */ new Set()), [M, N] = m(null), { register: P, unregister: F, isDraft: I } = t(), L = p(/* @__PURE__ */ new Set()), R = p([]);
|
|
14
|
-
R.current = T;
|
|
15
|
-
let z = p(w);
|
|
16
|
-
z.current = w, d(() => () => {
|
|
17
|
-
R.current.forEach((e) => e.abort());
|
|
18
|
-
}, []);
|
|
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 (t) => {
|
|
20
|
-
let c = a(t, o.accepts, o.max_size_bytes), l = `tile-${Math.random().toString(36).slice(2)}-${Date.now()}`, u = new AbortController();
|
|
21
|
-
if (c) {
|
|
22
|
-
k((e) => [...e, {
|
|
23
|
-
localId: l,
|
|
24
|
-
filename: t.name,
|
|
25
|
-
progress: null,
|
|
26
|
-
error: c,
|
|
27
|
-
abort: () => {}
|
|
28
|
-
}]);
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
k((e) => [...e, {
|
|
32
|
-
localId: l,
|
|
33
|
-
filename: t.name,
|
|
34
|
-
progress: {
|
|
35
|
-
loaded: 0,
|
|
36
|
-
total: t.size,
|
|
37
|
-
pct: 0
|
|
38
|
-
},
|
|
39
|
-
error: null,
|
|
40
|
-
abort: () => u.abort()
|
|
41
|
-
}]);
|
|
42
|
-
try {
|
|
43
|
-
let r = await n({
|
|
44
|
-
file: t,
|
|
45
|
-
entityCode: e.entityCode,
|
|
46
|
-
fieldCode: s,
|
|
47
|
-
signal: u.signal,
|
|
48
|
-
onProgress: (e) => k((t) => t.map((t) => t.localId === l ? {
|
|
49
|
-
...t,
|
|
50
|
-
progress: e
|
|
51
|
-
} : t))
|
|
52
|
-
});
|
|
53
|
-
if (L.current.delete(l)) {
|
|
54
|
-
i(r.id).catch(() => {}), F(r.id);
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
P(r.id, () => i(r.id));
|
|
58
|
-
let a = {
|
|
59
|
-
id: r.id,
|
|
60
|
-
filename: r.filename,
|
|
61
|
-
content_type: r.content_type,
|
|
62
|
-
size_bytes: r.size_bytes,
|
|
63
|
-
sha256: r.sha256,
|
|
64
|
-
width: r.width,
|
|
65
|
-
height: r.height,
|
|
66
|
-
url: r.url,
|
|
67
|
-
metadata: r.metadata
|
|
68
|
-
}, o = [...z.current, a];
|
|
69
|
-
z.current = o, h?.(o), k((e) => e.filter((e) => e.localId !== l));
|
|
70
|
-
} catch (e) {
|
|
71
|
-
if (e instanceof r && e.code === "ABORTED") {
|
|
72
|
-
k((e) => e.filter((e) => e.localId !== l));
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
let t = e instanceof r ? {
|
|
76
|
-
code: e.code,
|
|
77
|
-
message: e.message
|
|
78
|
-
} : {
|
|
79
|
-
code: "UNKNOWN",
|
|
80
|
-
message: e instanceof Error ? e.message : "Upload failed"
|
|
81
|
-
};
|
|
82
|
-
k((e) => e.map((e) => e.localId === l ? {
|
|
83
|
-
...e,
|
|
84
|
-
error: t,
|
|
85
|
-
progress: null,
|
|
86
|
-
abort: () => {}
|
|
87
|
-
} : e));
|
|
88
|
-
}
|
|
89
|
-
}, [
|
|
90
|
-
o.accepts,
|
|
91
|
-
o.max_size_bytes,
|
|
92
|
-
s,
|
|
93
|
-
h,
|
|
94
|
-
e.entityCode,
|
|
95
|
-
P,
|
|
96
|
-
F
|
|
97
|
-
]), K = u((e) => {
|
|
98
|
-
Array.from(e).forEach((e) => void G(e));
|
|
99
|
-
}, [G]), q = p(null), J = u(() => {
|
|
100
|
-
C || q.current?.click();
|
|
101
|
-
}, [C]), ie = u((e) => {
|
|
102
|
-
C || (e.preventDefault(), e.dataTransfer.dropEffect = "copy");
|
|
103
|
-
}, [C]), ae = u((e) => {
|
|
104
|
-
if (C) return;
|
|
105
|
-
e.preventDefault();
|
|
106
|
-
let t = e.dataTransfer.files;
|
|
107
|
-
t && t.length > 0 && K(t);
|
|
108
|
-
}, [C, K]), oe = u((e) => {
|
|
109
|
-
let t = e.target.files;
|
|
110
|
-
e.target.value = "", t && t.length > 0 && K(t);
|
|
111
|
-
}, [K]), se = u((e) => {
|
|
112
|
-
I(e) && (i(e).catch(() => {}), F(e));
|
|
113
|
-
let t = w.filter((t) => t.id !== e);
|
|
114
|
-
h?.(t), j((t) => {
|
|
115
|
-
let n = new Set(t);
|
|
116
|
-
return n.delete(e), n;
|
|
117
|
-
});
|
|
118
|
-
}, [
|
|
119
|
-
I,
|
|
120
|
-
w,
|
|
121
|
-
h,
|
|
122
|
-
F
|
|
123
|
-
]), ce = u(() => {
|
|
124
|
-
A.size !== 0 && (Array.from(A).forEach((e) => {
|
|
125
|
-
I(e) && (i(e).catch(() => {}), F(e));
|
|
126
|
-
}), h?.(w.filter((e) => !A.has(e.id))), j(/* @__PURE__ */ new Set()));
|
|
127
|
-
}, [
|
|
128
|
-
I,
|
|
129
|
-
w,
|
|
130
|
-
A,
|
|
131
|
-
h,
|
|
132
|
-
F
|
|
133
|
-
]), le = u((e) => {
|
|
134
|
-
let { active: t, over: n } = e;
|
|
135
|
-
if (!n || t.id === n.id) return;
|
|
136
|
-
let r = w.findIndex((e) => e.id === t.id), i = w.findIndex((e) => e.id === n.id);
|
|
137
|
-
r < 0 || i < 0 || h?.(ne(w, r, i));
|
|
138
|
-
}, [w, h]), ue = u((e) => {
|
|
139
|
-
j((t) => {
|
|
140
|
-
let n = new Set(t);
|
|
141
|
-
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
142
|
-
});
|
|
143
|
-
}, []), Y = M == null ? null : w[M], X = u(() => {
|
|
144
|
-
N((e) => e == null ? e : Math.min(w.length - 1, e + 1));
|
|
145
|
-
}, [w.length]), Z = u(() => {
|
|
146
|
-
N((e) => e == null ? e : Math.max(0, e - 1));
|
|
147
|
-
}, []), Q = u(() => N(null), []);
|
|
148
|
-
d(() => {
|
|
149
|
-
if (M == null) return;
|
|
150
|
-
let e = (e) => {
|
|
151
|
-
e.key === "Escape" ? Q() : e.key === "ArrowRight" ? X() : e.key === "ArrowLeft" && Z();
|
|
152
|
-
};
|
|
153
|
-
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
154
|
-
}, [
|
|
155
|
-
M,
|
|
156
|
-
Q,
|
|
157
|
-
X,
|
|
158
|
-
Z
|
|
159
|
-
]);
|
|
160
|
-
let de = u((e) => {
|
|
161
|
-
C || (e.key === "Enter" || e.key === " ") && e.target === e.currentTarget && (e.preventDefault(), J());
|
|
162
|
-
}, [C, J]), $ = S === "display", fe = f(() => w.map((e) => e.id), [w]);
|
|
163
|
-
return /* @__PURE__ */ _("div", {
|
|
164
|
-
"data-testid": `file-widget-${s}`,
|
|
165
|
-
className: "flex flex-col gap-2",
|
|
166
|
-
children: [
|
|
167
|
-
!$ && A.size > 0 && /* @__PURE__ */ _("div", {
|
|
168
|
-
className: "flex items-center gap-2 rounded-md border border-border bg-surface-2 p-2 text-sm",
|
|
169
|
-
role: "toolbar",
|
|
170
|
-
"aria-label": "Bulk actions",
|
|
171
|
-
children: [
|
|
172
|
-
/* @__PURE__ */ _("span", {
|
|
173
|
-
className: "text-foreground",
|
|
174
|
-
children: [A.size, " selected"]
|
|
175
|
-
}),
|
|
176
|
-
/* @__PURE__ */ g("button", {
|
|
177
|
-
type: "button",
|
|
178
|
-
className: "rounded-sm border border-border bg-card px-2 py-1 text-xs text-destructive hover:bg-surface-2",
|
|
179
|
-
onClick: ce,
|
|
180
|
-
"data-testid": "bulk-delete",
|
|
181
|
-
children: "Delete"
|
|
182
|
-
}),
|
|
183
|
-
/* @__PURE__ */ g("button", {
|
|
184
|
-
type: "button",
|
|
185
|
-
className: "rounded-sm border border-border bg-card px-2 py-1 text-xs text-foreground hover:bg-surface-2",
|
|
186
|
-
onClick: () => j(/* @__PURE__ */ new Set()),
|
|
187
|
-
children: "Clear"
|
|
188
|
-
})
|
|
189
|
-
]
|
|
190
|
-
}),
|
|
191
|
-
/* @__PURE__ */ g(v, {
|
|
192
|
-
sensors: B,
|
|
193
|
-
collisionDetection: b,
|
|
194
|
-
onDragEnd: le,
|
|
195
|
-
children: /* @__PURE__ */ g(te, {
|
|
196
|
-
items: fe,
|
|
197
|
-
strategy: re,
|
|
198
|
-
children: /* @__PURE__ */ _("div", {
|
|
199
|
-
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",
|
|
200
|
-
role: "grid",
|
|
201
|
-
"aria-label": V,
|
|
202
|
-
tabIndex: $ || C ? -1 : 0,
|
|
203
|
-
onDragOver: ie,
|
|
204
|
-
onDrop: ae,
|
|
205
|
-
onKeyDown: de,
|
|
206
|
-
"data-testid": "grid-container",
|
|
207
|
-
children: [
|
|
208
|
-
w.map((e, t) => /* @__PURE__ */ g(E, {
|
|
209
|
-
file: e,
|
|
210
|
-
selected: A.has(e.id),
|
|
211
|
-
disabled: C || $,
|
|
212
|
-
reorderable: U && !$,
|
|
213
|
-
preferredThumbnail: W,
|
|
214
|
-
onSelect: () => ue(e.id),
|
|
215
|
-
onRemove: () => se(e.id),
|
|
216
|
-
onPreview: () => N(t)
|
|
217
|
-
}, e.id)),
|
|
218
|
-
T.map((e) => /* @__PURE__ */ g(D, {
|
|
219
|
-
tile: e,
|
|
220
|
-
onCancel: () => {
|
|
221
|
-
e.abort(), L.current.add(e.localId), k((t) => t.filter((t) => t.localId !== e.localId));
|
|
222
|
-
},
|
|
223
|
-
onDismiss: () => k((t) => t.filter((t) => t.localId !== e.localId))
|
|
224
|
-
}, e.localId)),
|
|
225
|
-
w.length === 0 && T.length === 0 && /* @__PURE__ */ g("div", {
|
|
226
|
-
className: "col-span-full flex h-24 cursor-pointer items-center justify-center text-sm text-muted-foreground",
|
|
227
|
-
onClick: J,
|
|
228
|
-
"data-testid": "grid-empty",
|
|
229
|
-
children: o.display?.placeholder || "Drop files here or click to browse"
|
|
230
|
-
})
|
|
231
|
-
]
|
|
232
|
-
})
|
|
233
|
-
})
|
|
234
|
-
}),
|
|
235
|
-
!$ && /* @__PURE__ */ g("input", {
|
|
236
|
-
ref: q,
|
|
237
|
-
type: "file",
|
|
238
|
-
accept: H,
|
|
239
|
-
multiple: !0,
|
|
240
|
-
onChange: oe,
|
|
241
|
-
style: { display: "none" },
|
|
242
|
-
"data-testid": `file-input-${s}`
|
|
243
|
-
}),
|
|
244
|
-
Y && /* @__PURE__ */ g(O, {
|
|
245
|
-
file: Y,
|
|
246
|
-
hasPrev: M > 0,
|
|
247
|
-
hasNext: M < w.length - 1,
|
|
248
|
-
onPrev: Z,
|
|
249
|
-
onNext: X,
|
|
250
|
-
onClose: Q
|
|
251
|
-
})
|
|
252
|
-
]
|
|
253
|
-
});
|
|
254
|
-
}
|
|
255
|
-
function E({ file: e, selected: t, disabled: n, reorderable: r, preferredThumbnail: i, onSelect: a, onRemove: o, onPreview: l }) {
|
|
256
|
-
let { attributes: u, listeners: d, setNodeRef: f, transform: p, transition: m, isDragging: v } = S({
|
|
257
|
-
id: e.id,
|
|
258
|
-
disabled: !r
|
|
259
|
-
}), y = {
|
|
260
|
-
transform: C.Transform.toString(p),
|
|
261
|
-
transition: m,
|
|
262
|
-
opacity: v ? .5 : 1
|
|
263
|
-
}, b = s(e.id, c(e, i), w(e, i));
|
|
264
|
-
return /* @__PURE__ */ _("div", {
|
|
265
|
-
ref: f,
|
|
266
|
-
style: y,
|
|
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,
|
|
270
|
-
children: [b ? /* @__PURE__ */ g("img", {
|
|
271
|
-
src: b,
|
|
272
|
-
alt: e.filename,
|
|
273
|
-
className: "h-full w-full cursor-pointer object-cover",
|
|
274
|
-
loading: "lazy",
|
|
275
|
-
onClick: l
|
|
276
|
-
}) : /* @__PURE__ */ g("div", {
|
|
277
|
-
className: "flex h-full w-full cursor-pointer items-center justify-center bg-surface-3 text-xs text-muted-foreground",
|
|
278
|
-
onClick: l,
|
|
279
|
-
children: e.filename
|
|
280
|
-
}), !n && /* @__PURE__ */ _(h, { children: [
|
|
281
|
-
/* @__PURE__ */ g("input", {
|
|
282
|
-
type: "checkbox",
|
|
283
|
-
className: "absolute left-1 top-1 h-4 w-4 cursor-pointer",
|
|
284
|
-
checked: t,
|
|
285
|
-
onChange: a,
|
|
286
|
-
"aria-label": `Select ${e.filename}`,
|
|
287
|
-
"data-testid": `select-${e.id}`,
|
|
288
|
-
onClick: (e) => e.stopPropagation()
|
|
289
|
-
}),
|
|
290
|
-
r && /* @__PURE__ */ g("button", {
|
|
291
|
-
type: "button",
|
|
292
|
-
className: "absolute right-1 top-1 cursor-grab rounded-sm border border-border bg-card px-1 text-xs",
|
|
293
|
-
"aria-label": `Drag to reorder ${e.filename}`,
|
|
294
|
-
"data-testid": `drag-${e.id}`,
|
|
295
|
-
...u,
|
|
296
|
-
...d,
|
|
297
|
-
children: "⋮⋮"
|
|
298
|
-
}),
|
|
299
|
-
/* @__PURE__ */ _("div", {
|
|
300
|
-
className: "absolute inset-x-0 bottom-0 flex items-center justify-end gap-1 bg-black/50 p-1 opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",
|
|
301
|
-
children: [/* @__PURE__ */ g("button", {
|
|
302
|
-
type: "button",
|
|
303
|
-
className: "rounded-sm border border-border bg-card px-2 py-0.5 text-xs",
|
|
304
|
-
onClick: l,
|
|
305
|
-
children: "View"
|
|
306
|
-
}), /* @__PURE__ */ g("button", {
|
|
307
|
-
type: "button",
|
|
308
|
-
className: "rounded-sm border border-border bg-card px-2 py-0.5 text-xs text-destructive",
|
|
309
|
-
onClick: o,
|
|
310
|
-
"data-testid": `remove-${e.id}`,
|
|
311
|
-
children: "Delete"
|
|
312
|
-
})]
|
|
313
|
-
})
|
|
314
|
-
] })]
|
|
315
|
-
});
|
|
316
|
-
}
|
|
317
|
-
function D({ tile: e, onCancel: t, onDismiss: n }) {
|
|
318
|
-
return /* @__PURE__ */ _("div", {
|
|
319
|
-
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`,
|
|
320
|
-
"data-testid": `pending-tile-${e.localId}`,
|
|
321
|
-
children: [
|
|
322
|
-
/* @__PURE__ */ g("span", {
|
|
323
|
-
className: "truncate",
|
|
324
|
-
title: e.filename,
|
|
325
|
-
children: e.filename
|
|
326
|
-
}),
|
|
327
|
-
e.progress && !e.error && /* @__PURE__ */ _("span", {
|
|
328
|
-
className: "mt-1 text-muted-foreground",
|
|
329
|
-
role: "progressbar",
|
|
330
|
-
"aria-valuenow": e.progress.pct,
|
|
331
|
-
"aria-valuemin": 0,
|
|
332
|
-
"aria-valuemax": 100,
|
|
333
|
-
children: [e.progress.pct, "%"]
|
|
334
|
-
}),
|
|
335
|
-
e.error && /* @__PURE__ */ g("div", {
|
|
336
|
-
role: "alert",
|
|
337
|
-
className: "mt-1 text-destructive",
|
|
338
|
-
children: e.error.message
|
|
339
|
-
}),
|
|
340
|
-
/* @__PURE__ */ g("button", {
|
|
341
|
-
type: "button",
|
|
342
|
-
className: "mt-1 rounded-sm border border-border bg-card px-2 py-0.5",
|
|
343
|
-
onClick: e.error ? n : t,
|
|
344
|
-
children: e.error ? "Dismiss" : "Cancel"
|
|
345
|
-
})
|
|
346
|
-
]
|
|
347
|
-
});
|
|
348
|
-
}
|
|
349
|
-
function O({ file: t, hasPrev: n, hasNext: r, onPrev: i, onNext: a, onClose: o }) {
|
|
350
|
-
let c = s(t.id, "preview", t.presigned_url ?? t.url ?? w(t));
|
|
351
|
-
return /* @__PURE__ */ _("div", {
|
|
352
|
-
className: "fixed inset-0 z-50 flex items-center justify-center bg-black/80",
|
|
353
|
-
role: "dialog",
|
|
354
|
-
"aria-modal": "true",
|
|
355
|
-
"aria-label": t.filename,
|
|
356
|
-
"data-testid": "lightbox",
|
|
357
|
-
onClick: o,
|
|
358
|
-
children: [
|
|
359
|
-
/* @__PURE__ */ g("button", {
|
|
360
|
-
type: "button",
|
|
361
|
-
className: "absolute right-4 top-4 rounded-sm border border-border bg-card px-3 py-1 text-foreground",
|
|
362
|
-
onClick: (e) => {
|
|
363
|
-
e.stopPropagation(), o();
|
|
364
|
-
},
|
|
365
|
-
"data-testid": "lightbox-close",
|
|
366
|
-
children: "Close"
|
|
367
|
-
}),
|
|
368
|
-
n && /* @__PURE__ */ g("button", {
|
|
369
|
-
type: "button",
|
|
370
|
-
className: "absolute left-4 rounded-sm border border-border bg-card px-3 py-2 text-foreground",
|
|
371
|
-
onClick: (e) => {
|
|
372
|
-
e.stopPropagation(), i();
|
|
373
|
-
},
|
|
374
|
-
"data-testid": "lightbox-prev",
|
|
375
|
-
children: "‹"
|
|
376
|
-
}),
|
|
377
|
-
r && /* @__PURE__ */ g("button", {
|
|
378
|
-
type: "button",
|
|
379
|
-
className: "absolute right-4 bottom-4 rounded-sm border border-border bg-card px-3 py-2 text-foreground",
|
|
380
|
-
onClick: (e) => {
|
|
381
|
-
e.stopPropagation(), a();
|
|
382
|
-
},
|
|
383
|
-
"data-testid": "lightbox-next",
|
|
384
|
-
children: "›"
|
|
385
|
-
}),
|
|
386
|
-
c ? /* @__PURE__ */ g("img", {
|
|
387
|
-
src: c,
|
|
388
|
-
alt: t.filename,
|
|
389
|
-
className: "max-h-[90vh] max-w-[90vw] object-contain",
|
|
390
|
-
onClick: (e) => e.stopPropagation()
|
|
391
|
-
}) : /* @__PURE__ */ _("div", {
|
|
392
|
-
className: "rounded-md bg-card p-4 text-foreground",
|
|
393
|
-
children: [
|
|
394
|
-
t.filename,
|
|
395
|
-
" (",
|
|
396
|
-
e(t.size_bytes),
|
|
397
|
-
")"
|
|
398
|
-
]
|
|
399
|
-
})
|
|
400
|
-
]
|
|
401
|
-
});
|
|
402
|
-
}
|
|
403
|
-
//#endregion
|
|
404
|
-
export { T as Grid };
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { Tt as e, ft as t } from "./useCurrentScreen-CzwzQpoW.js";
|
|
2
|
-
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
3
|
-
import i, { defaultUrlTransform as a } from "react-markdown";
|
|
4
|
-
import o from "remark-breaks";
|
|
5
|
-
import s from "remark-gfm";
|
|
6
|
-
//#region src/components/shared/MarkdownRenderer.tsx
|
|
7
|
-
var c = "prose prose-sm dark:prose-invert max-w-none break-words overflow-hidden", l = [o], u = [s];
|
|
8
|
-
function d(e) {
|
|
9
|
-
return e.startsWith("declarion://file/") ? e : a(e);
|
|
10
|
-
}
|
|
11
|
-
function f(e) {
|
|
12
|
-
return e.startsWith("/") || e.startsWith("https://") || e.startsWith("http://") ? e : null;
|
|
13
|
-
}
|
|
14
|
-
function p({ href: t, children: r }) {
|
|
15
|
-
return e(t) ? /* @__PURE__ */ n("a", {
|
|
16
|
-
href: t,
|
|
17
|
-
target: "_blank",
|
|
18
|
-
rel: "noopener noreferrer",
|
|
19
|
-
children: r
|
|
20
|
-
}) : /* @__PURE__ */ n("a", {
|
|
21
|
-
href: t,
|
|
22
|
-
children: r
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
function m(e) {
|
|
26
|
-
return {
|
|
27
|
-
img({ src: i, alt: a }) {
|
|
28
|
-
let o = t(i);
|
|
29
|
-
if (!o) return /* @__PURE__ */ n("img", {
|
|
30
|
-
src: i,
|
|
31
|
-
alt: a ?? ""
|
|
32
|
-
});
|
|
33
|
-
let s = e[o], c = s?.presigned_url ?? s?.url, l = c ? f(c) : null;
|
|
34
|
-
return l ? /* @__PURE__ */ n("img", {
|
|
35
|
-
src: l,
|
|
36
|
-
alt: a ?? s.filename ?? ""
|
|
37
|
-
}) : /* @__PURE__ */ r("span", {
|
|
38
|
-
style: {
|
|
39
|
-
color: "var(--warn)",
|
|
40
|
-
fontSize: 12
|
|
41
|
-
},
|
|
42
|
-
children: ["Missing image ", o]
|
|
43
|
-
});
|
|
44
|
-
},
|
|
45
|
-
a({ href: i, children: a }) {
|
|
46
|
-
let o = t(i);
|
|
47
|
-
if (!o) return /* @__PURE__ */ n(p, {
|
|
48
|
-
href: i,
|
|
49
|
-
children: a
|
|
50
|
-
});
|
|
51
|
-
let s = e[o], c = s?.presigned_url ?? s?.url, l = c ? f(c) : null;
|
|
52
|
-
return l ? /* @__PURE__ */ n("a", {
|
|
53
|
-
href: l,
|
|
54
|
-
target: "_blank",
|
|
55
|
-
rel: "noreferrer",
|
|
56
|
-
children: a
|
|
57
|
-
}) : /* @__PURE__ */ r("span", {
|
|
58
|
-
style: {
|
|
59
|
-
color: "var(--warn)",
|
|
60
|
-
fontSize: 12
|
|
61
|
-
},
|
|
62
|
-
children: ["Missing file ", o]
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
function h({ content: e, plugins: t = "breaks", files: r, components: a, skipHtml: o = !0, prose: s = !0 }) {
|
|
68
|
-
let f = t === "gfm" ? u : l, h = {
|
|
69
|
-
a: p,
|
|
70
|
-
...r ? m(r) : {},
|
|
71
|
-
...a
|
|
72
|
-
}, g = /* @__PURE__ */ n(i, {
|
|
73
|
-
skipHtml: o,
|
|
74
|
-
remarkPlugins: f,
|
|
75
|
-
components: h,
|
|
76
|
-
urlTransform: r ? d : void 0,
|
|
77
|
-
children: e
|
|
78
|
-
});
|
|
79
|
-
return s ? /* @__PURE__ */ n("div", {
|
|
80
|
-
className: c,
|
|
81
|
-
children: g
|
|
82
|
-
}) : g;
|
|
83
|
-
}
|
|
84
|
-
//#endregion
|
|
85
|
-
export { h as MarkdownRenderer };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { s as e } from "./DynamicIcon-DW5krHuX.js";
|
|
2
|
-
import { useCallback as t, useState as n } from "react";
|
|
3
|
-
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
4
|
-
//#region src/components/primitives/RecordIdBadge.tsx
|
|
5
|
-
var a = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i, o = 1200;
|
|
6
|
-
function s({ value: s }) {
|
|
7
|
-
let [c, l] = n(!1), u = a.test(s) ? `${s.slice(0, 8)}…` : s, d = t(async () => {
|
|
8
|
-
try {
|
|
9
|
-
await navigator.clipboard.writeText(s), l(!0), window.setTimeout(() => l(!1), o);
|
|
10
|
-
} catch {}
|
|
11
|
-
}, [s]);
|
|
12
|
-
return /* @__PURE__ */ i("button", {
|
|
13
|
-
type: "button",
|
|
14
|
-
onClick: d,
|
|
15
|
-
title: c ? "Copied" : `Copy ${s}`,
|
|
16
|
-
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",
|
|
17
|
-
children: [/* @__PURE__ */ r("span", { children: u }), c ? /* @__PURE__ */ r(e.check, { size: 10 }) : /* @__PURE__ */ r(e.copy, {
|
|
18
|
-
size: 10,
|
|
19
|
-
style: { opacity: .6 }
|
|
20
|
-
})]
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
//#endregion
|
|
24
|
-
export { s as t };
|