laif-ds 0.2.19 → 0.2.20
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/_virtual/index4.js +5 -5
- package/dist/_virtual/index5.js +5 -5
- package/dist/components/ui/file-preview.js +215 -138
- package/dist/components/ui/file-previewer.js +1 -1
- package/dist/components/ui/file-uploader.js +109 -96
- package/dist/index.d.ts +1 -1
- package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.js +1 -1
- package/dist/node_modules/unified/lib/index.js +1 -1
- package/dist/styles.v3.css +1 -1
- package/package.json +1 -1
package/dist/_virtual/index4.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { getDefaultExportFromCjs as
|
|
3
|
-
import { __require as
|
|
4
|
-
var t =
|
|
5
|
-
const
|
|
2
|
+
import { getDefaultExportFromCjs as e } from "./_commonjsHelpers.js";
|
|
3
|
+
import { __require as r } from "../node_modules/extend/index.js";
|
|
4
|
+
var t = r();
|
|
5
|
+
const x = /* @__PURE__ */ e(t);
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
x as default
|
|
8
8
|
};
|
package/dist/_virtual/index5.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { getDefaultExportFromCjs as
|
|
3
|
-
import { __require as
|
|
4
|
-
var t =
|
|
5
|
-
const
|
|
2
|
+
import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
|
|
3
|
+
import { __require as e } from "../node_modules/style-to-js/cjs/index.js";
|
|
4
|
+
var t = e();
|
|
5
|
+
const a = /* @__PURE__ */ r(t);
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
a as default
|
|
8
8
|
};
|
|
@@ -1,92 +1,155 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as t, jsxs as o } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
3
|
+
import { getExt as C, imageExts as W } from "../../lib/file-preview.js";
|
|
4
|
+
import { motion as F } from "framer-motion";
|
|
5
|
+
import f, { useEffect as E } from "react";
|
|
6
|
+
import { Button as R } from "./button.js";
|
|
7
|
+
import { Command as B, CommandGroup as $, CommandItem as v } from "./command.js";
|
|
8
|
+
import { Icon as y } from "./icon.js";
|
|
9
|
+
import { Popover as A, PopoverTrigger as S, PopoverContent as D } from "./popover.js";
|
|
10
|
+
import { Tooltip as G, TooltipTrigger as M, TooltipContent as V } from "./tooltip.js";
|
|
11
|
+
import { cn as N } from "../../lib/utils.js";
|
|
12
|
+
import z from "../../node_modules/lucide-react/dist/esm/icons/x.js";
|
|
13
|
+
import O from "../../node_modules/lucide-react/dist/esm/icons/file-audio.js";
|
|
14
|
+
import P from "../../node_modules/lucide-react/dist/esm/icons/file-video.js";
|
|
15
|
+
import h from "../../node_modules/lucide-react/dist/esm/icons/file-text.js";
|
|
16
|
+
import X from "../../node_modules/lucide-react/dist/esm/icons/file.js";
|
|
17
|
+
import _ from "../../node_modules/lucide-react/dist/esm/icons/file-code.js";
|
|
18
|
+
import K from "../../node_modules/lucide-react/dist/esm/icons/file-archive.js";
|
|
19
|
+
import q from "../../node_modules/lucide-react/dist/esm/icons/file-spreadsheet.js";
|
|
20
|
+
const d = (e) => "type" in e && typeof e.type == "string" && e instanceof File, T = (e) => e.name || "url" in e && e.url || "", U = (e) => {
|
|
21
|
+
if (d(e)) return e.type || "";
|
|
22
|
+
const r = e.type;
|
|
23
|
+
return typeof r == "string" ? r : "";
|
|
24
|
+
}, H = (e, r) => {
|
|
25
|
+
if (!e && r) {
|
|
26
|
+
if (r.startsWith("audio/"))
|
|
27
|
+
return { icon: O, colorClass: "text-violet-600" };
|
|
28
|
+
if (r.startsWith("video/"))
|
|
29
|
+
return { icon: P, colorClass: "text-rose-600" };
|
|
30
|
+
if (r.startsWith("text/"))
|
|
31
|
+
return { icon: h, colorClass: "text-gray-600" };
|
|
32
|
+
}
|
|
33
|
+
switch (e) {
|
|
34
|
+
case "pdf":
|
|
35
|
+
return { icon: h, colorClass: "text-red-600" };
|
|
36
|
+
case "doc":
|
|
37
|
+
case "docx":
|
|
38
|
+
return { icon: h, colorClass: "text-blue-600" };
|
|
39
|
+
case "xls":
|
|
40
|
+
case "xlsx":
|
|
41
|
+
case "csv":
|
|
42
|
+
return { icon: q, colorClass: "text-green-600" };
|
|
43
|
+
case "ppt":
|
|
44
|
+
case "pptx":
|
|
45
|
+
return { icon: h, colorClass: "text-orange-600" };
|
|
46
|
+
case "txt":
|
|
47
|
+
case "md":
|
|
48
|
+
return { icon: h, colorClass: "text-gray-600" };
|
|
49
|
+
case "zip":
|
|
50
|
+
case "rar":
|
|
51
|
+
case "7z":
|
|
52
|
+
case "tar":
|
|
53
|
+
case "gz":
|
|
54
|
+
case "tgz":
|
|
55
|
+
return { icon: K, colorClass: "text-amber-600" };
|
|
56
|
+
case "mp3":
|
|
57
|
+
case "wav":
|
|
58
|
+
case "ogg":
|
|
59
|
+
case "flac":
|
|
60
|
+
case "m4a":
|
|
61
|
+
return { icon: O, colorClass: "text-violet-600" };
|
|
62
|
+
case "mp4":
|
|
63
|
+
case "mov":
|
|
64
|
+
case "avi":
|
|
65
|
+
case "mkv":
|
|
66
|
+
case "webm":
|
|
67
|
+
return { icon: P, colorClass: "text-rose-600" };
|
|
68
|
+
case "js":
|
|
69
|
+
case "ts":
|
|
70
|
+
case "jsx":
|
|
71
|
+
case "tsx":
|
|
72
|
+
case "json":
|
|
73
|
+
case "xml":
|
|
74
|
+
case "yml":
|
|
75
|
+
case "yaml":
|
|
76
|
+
case "html":
|
|
77
|
+
case "css":
|
|
78
|
+
case "scss":
|
|
79
|
+
return { icon: _, colorClass: "text-indigo-600" };
|
|
80
|
+
default:
|
|
81
|
+
return { icon: X, colorClass: "text-d-secondary-foreground" };
|
|
82
|
+
}
|
|
83
|
+
}, L = (e) => {
|
|
84
|
+
if (!Number.isFinite(e) || e < 0) return "";
|
|
85
|
+
const r = ["B", "KB", "MB", "GB", "TB"];
|
|
86
|
+
let s = 0, a = e;
|
|
87
|
+
for (; a >= 1024 && s < r.length - 1; )
|
|
88
|
+
a /= 1024, s++;
|
|
89
|
+
const n = s > 0 && a < 100 ? 2 : 0;
|
|
90
|
+
return `${a.toFixed(n)}${r[s]}`;
|
|
91
|
+
}, j = (e) => {
|
|
92
|
+
const r = C(T(e));
|
|
93
|
+
if (r) return r.toUpperCase();
|
|
94
|
+
const s = U(e);
|
|
95
|
+
return s ? s === "application/pdf" ? "PDF" : s.startsWith("image/") ? s.split("/")[1]?.toUpperCase() || "IMAGE" : s.startsWith("audio/") ? "AUDIO" : s.startsWith("video/") ? "VIDEO" : s.startsWith("text/") ? "TEXT" : s.includes("officedocument") || s.includes("msword") || s.includes("ms-excel") || s.includes("ms-powerpoint") ? "OFFICE" : "" : "";
|
|
96
|
+
}, k = ({
|
|
97
|
+
url: e,
|
|
98
|
+
onPreview: r,
|
|
99
|
+
onDownload: s,
|
|
100
|
+
onRemove: a
|
|
101
|
+
}) => /* @__PURE__ */ o(A, { children: [
|
|
102
|
+
/* @__PURE__ */ t(S, { asChild: !0, children: /* @__PURE__ */ t(R, { variant: "ghost", size: "icon", children: /* @__PURE__ */ t(y, { name: "Menu", size: "sm" }) }) }),
|
|
103
|
+
/* @__PURE__ */ t(D, { className: "w-42 p-0", align: "end", children: /* @__PURE__ */ t(B, { children: /* @__PURE__ */ o($, { children: [
|
|
104
|
+
r && /* @__PURE__ */ o(v, { onSelect: () => r(e), children: [
|
|
105
|
+
/* @__PURE__ */ t(y, { name: "Presentation", size: "sm" }),
|
|
18
106
|
/* @__PURE__ */ t("span", { children: "Anteprima" })
|
|
19
107
|
] }),
|
|
20
|
-
|
|
21
|
-
/* @__PURE__ */ t(
|
|
108
|
+
s && /* @__PURE__ */ o(v, { onSelect: () => s(e), children: [
|
|
109
|
+
/* @__PURE__ */ t(y, { name: "Download", size: "sm" }),
|
|
22
110
|
/* @__PURE__ */ t("span", { children: "Download" })
|
|
23
111
|
] }),
|
|
24
|
-
|
|
25
|
-
|
|
112
|
+
a && /* @__PURE__ */ o(
|
|
113
|
+
v,
|
|
26
114
|
{
|
|
27
|
-
onSelect: () =>
|
|
115
|
+
onSelect: () => a(e),
|
|
28
116
|
className: "text-red-500",
|
|
29
117
|
children: [
|
|
30
|
-
/* @__PURE__ */ t(
|
|
118
|
+
/* @__PURE__ */ t(y, { name: "Trash", className: "text-red-500", size: "sm" }),
|
|
31
119
|
/* @__PURE__ */ t("span", { children: "Elimina" })
|
|
32
120
|
]
|
|
33
121
|
}
|
|
34
122
|
)
|
|
35
123
|
] }) }) })
|
|
36
124
|
] });
|
|
37
|
-
function
|
|
38
|
-
return /* @__PURE__ */ o(
|
|
39
|
-
/* @__PURE__ */ t(
|
|
40
|
-
/* @__PURE__ */ t(
|
|
125
|
+
function I({ text: e }) {
|
|
126
|
+
return /* @__PURE__ */ o(G, { children: [
|
|
127
|
+
/* @__PURE__ */ t(M, { "data-slot": "tooltip-trigger", className: "w-full min-w-0", children: /* @__PURE__ */ t("span", { className: "text-d-secondary-foreground block w-full truncate", children: e }) }),
|
|
128
|
+
/* @__PURE__ */ t(V, { children: /* @__PURE__ */ t("span", { children: e }) })
|
|
41
129
|
] });
|
|
42
130
|
}
|
|
43
|
-
const
|
|
44
|
-
if (u(e) || e.type)
|
|
45
|
-
return e.type;
|
|
46
|
-
const r = (i) => {
|
|
47
|
-
if (!i) return "";
|
|
48
|
-
const m = i.split(/[?#]/)[0].split("/").pop() || "", d = m.lastIndexOf(".");
|
|
49
|
-
return d >= 0 ? m.substring(d + 1).toLowerCase() : "";
|
|
50
|
-
}, a = r(e.name || ""), l = "url" in e ? r(e.url || "") : "", n = a || l;
|
|
51
|
-
if (n && (/* @__PURE__ */ new Set(["jpg", "jpeg", "png", "gif", "webp", "bmp", "svg", "tiff"])).has(n))
|
|
52
|
-
return `image/${n === "jpg" ? "jpeg" : n}`;
|
|
53
|
-
if (n === "txt" || n === "md")
|
|
54
|
-
return "text/plain";
|
|
55
|
-
const s = {
|
|
56
|
-
pdf: "application/pdf",
|
|
57
|
-
csv: "text/csv",
|
|
58
|
-
doc: "application/msword",
|
|
59
|
-
docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
60
|
-
xls: "application/vnd.ms-excel",
|
|
61
|
-
xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
62
|
-
ppt: "application/vnd.ms-powerpoint",
|
|
63
|
-
pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
64
|
-
};
|
|
65
|
-
return n && s[n] ? s[n] : "application/octet-stream";
|
|
66
|
-
}, W = p.forwardRef(
|
|
131
|
+
const be = f.forwardRef(
|
|
67
132
|
(e, r) => {
|
|
68
|
-
const a =
|
|
69
|
-
return
|
|
133
|
+
const s = T(e.file), a = C(s), n = U(e.file), m = a === "csv" || n === "text/csv";
|
|
134
|
+
return n && n.startsWith("image/") || a && W.has(a) ? /* @__PURE__ */ t(J, { ...e, ref: r }) : !m && (a === "txt" || a === "md" || n && n.startsWith("text/")) ? /* @__PURE__ */ t(Q, { ...e, ref: r }) : /* @__PURE__ */ t(Y, { ...e, ref: r });
|
|
70
135
|
}
|
|
71
|
-
)
|
|
72
|
-
W.displayName = "FilePreview";
|
|
73
|
-
const N = p.forwardRef(
|
|
136
|
+
), J = f.forwardRef(
|
|
74
137
|
({
|
|
75
138
|
file: e,
|
|
76
139
|
onRemove: r,
|
|
77
|
-
onPreview:
|
|
78
|
-
onDownload:
|
|
140
|
+
onPreview: s,
|
|
141
|
+
onDownload: a,
|
|
79
142
|
showActionMenu: n = !1,
|
|
80
|
-
className:
|
|
81
|
-
},
|
|
82
|
-
const i =
|
|
143
|
+
className: m
|
|
144
|
+
}, p) => {
|
|
145
|
+
const i = d(e) ? URL.createObjectURL(e) : e.url, l = d(e) ? L(e.size) : "", c = j(e);
|
|
83
146
|
return /* @__PURE__ */ o(
|
|
84
|
-
|
|
147
|
+
F.div,
|
|
85
148
|
{
|
|
86
|
-
ref:
|
|
87
|
-
className:
|
|
149
|
+
ref: p,
|
|
150
|
+
className: N(
|
|
88
151
|
"border-d-border relative flex max-w-[200px] rounded-md border p-1.5 pr-2 text-xs",
|
|
89
|
-
|
|
152
|
+
m
|
|
90
153
|
),
|
|
91
154
|
layout: !0,
|
|
92
155
|
initial: { opacity: 0, y: "100%" },
|
|
@@ -102,13 +165,19 @@ const N = p.forwardRef(
|
|
|
102
165
|
src: i
|
|
103
166
|
}
|
|
104
167
|
),
|
|
105
|
-
/* @__PURE__ */
|
|
168
|
+
/* @__PURE__ */ o("div", { className: "min-w-0", children: [
|
|
169
|
+
/* @__PURE__ */ t(I, { text: e.name }),
|
|
170
|
+
(l || c) && /* @__PURE__ */ o("div", { className: "text-d-secondary-foreground/70 mt-0.5 text-[10px] leading-3", children: [
|
|
171
|
+
l,
|
|
172
|
+
c ? l ? ` · ${c}` : c : ""
|
|
173
|
+
] })
|
|
174
|
+
] }),
|
|
106
175
|
n && /* @__PURE__ */ t(
|
|
107
|
-
|
|
176
|
+
k,
|
|
108
177
|
{
|
|
109
178
|
url: i,
|
|
110
|
-
onPreview:
|
|
111
|
-
onDownload:
|
|
179
|
+
onPreview: s,
|
|
180
|
+
onDownload: a,
|
|
112
181
|
onRemove: r
|
|
113
182
|
}
|
|
114
183
|
)
|
|
@@ -120,84 +189,84 @@ const N = p.forwardRef(
|
|
|
120
189
|
type: "button",
|
|
121
190
|
onClick: () => r(i),
|
|
122
191
|
"aria-label": "Remove attachment",
|
|
123
|
-
children: /* @__PURE__ */ t(
|
|
192
|
+
children: /* @__PURE__ */ t(z, { className: "h-2.5 w-2.5" })
|
|
124
193
|
}
|
|
125
194
|
) : null
|
|
126
195
|
]
|
|
127
196
|
}
|
|
128
197
|
);
|
|
129
198
|
}
|
|
130
|
-
)
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
/* @__PURE__ */
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
{
|
|
161
|
-
url: f,
|
|
162
|
-
onPreview: a,
|
|
163
|
-
onDownload: l,
|
|
164
|
-
onRemove: r
|
|
165
|
-
}
|
|
166
|
-
)
|
|
199
|
+
), Q = f.forwardRef(({ file: e, onRemove: r, onPreview: s, onDownload: a, showActionMenu: n = !1 }, m) => {
|
|
200
|
+
const [p, i] = f.useState(""), l = d(e) ? URL.createObjectURL(e) : e.url, c = d(e) ? L(e.size) : "", u = j(e);
|
|
201
|
+
return E(() => {
|
|
202
|
+
if (d(e)) {
|
|
203
|
+
const b = new FileReader();
|
|
204
|
+
b.onload = (x) => {
|
|
205
|
+
x.target?.result && i(
|
|
206
|
+
typeof x.target.result == "string" ? x.target.result.slice(0, 100) : ""
|
|
207
|
+
);
|
|
208
|
+
}, b.readAsText(e);
|
|
209
|
+
} else
|
|
210
|
+
i("Anteprima non disponibile");
|
|
211
|
+
}, [e]), /* @__PURE__ */ o(
|
|
212
|
+
F.div,
|
|
213
|
+
{
|
|
214
|
+
ref: m,
|
|
215
|
+
className: "border-d-border relative flex max-w-[200px] rounded-md border p-1.5 pr-2 text-xs",
|
|
216
|
+
layout: !0,
|
|
217
|
+
initial: { opacity: 0, y: "100%" },
|
|
218
|
+
animate: { opacity: 1, y: 0 },
|
|
219
|
+
exit: { opacity: 0, y: "100%" },
|
|
220
|
+
children: [
|
|
221
|
+
/* @__PURE__ */ o("div", { className: "flex w-full min-w-0 items-center space-x-2", children: [
|
|
222
|
+
/* @__PURE__ */ t("div", { className: "bg-d-secondary border-d-border grid h-10 w-10 shrink-0 place-items-center rounded rounded-sm border p-1 text-[8px]", children: p }),
|
|
223
|
+
/* @__PURE__ */ o("div", { className: "min-w-0", children: [
|
|
224
|
+
/* @__PURE__ */ t(I, { text: e.name }),
|
|
225
|
+
(c || u) && /* @__PURE__ */ o("div", { className: "text-d-secondary-foreground/70 mt-0.5 text-[10px] leading-3", children: [
|
|
226
|
+
c,
|
|
227
|
+
u ? c ? ` · ${u}` : u : ""
|
|
228
|
+
] })
|
|
167
229
|
] }),
|
|
168
|
-
|
|
169
|
-
|
|
230
|
+
n && /* @__PURE__ */ t(
|
|
231
|
+
k,
|
|
170
232
|
{
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
children: /* @__PURE__ */ t(g, { className: "h-2.5 w-2.5" })
|
|
233
|
+
url: l,
|
|
234
|
+
onPreview: s,
|
|
235
|
+
onDownload: a,
|
|
236
|
+
onRemove: r
|
|
176
237
|
}
|
|
177
|
-
)
|
|
178
|
-
]
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
238
|
+
)
|
|
239
|
+
] }),
|
|
240
|
+
!n && r ? /* @__PURE__ */ t(
|
|
241
|
+
"button",
|
|
242
|
+
{
|
|
243
|
+
className: "bg-d-background border-d-border absolute -top-2 -right-2 flex h-4 w-4 items-center justify-center rounded-full border",
|
|
244
|
+
type: "button",
|
|
245
|
+
onClick: () => r(l),
|
|
246
|
+
"aria-label": "Remove attachment",
|
|
247
|
+
children: /* @__PURE__ */ t(z, { className: "h-2.5 w-2.5" })
|
|
248
|
+
}
|
|
249
|
+
) : null
|
|
250
|
+
]
|
|
251
|
+
}
|
|
252
|
+
);
|
|
253
|
+
}), Y = f.forwardRef(
|
|
185
254
|
({
|
|
186
255
|
file: e,
|
|
187
256
|
onRemove: r,
|
|
188
|
-
onPreview:
|
|
189
|
-
onDownload:
|
|
257
|
+
onPreview: s,
|
|
258
|
+
onDownload: a,
|
|
190
259
|
showActionMenu: n = !1,
|
|
191
|
-
className:
|
|
192
|
-
},
|
|
193
|
-
const i =
|
|
260
|
+
className: m
|
|
261
|
+
}, p) => {
|
|
262
|
+
const i = d(e) ? URL.createObjectURL(e) : e.url, l = T(e), c = C(l), u = U(e), { icon: b, colorClass: x } = H(c, u), w = d(e) ? L(e.size) : "", g = j(e);
|
|
194
263
|
return /* @__PURE__ */ o(
|
|
195
|
-
|
|
264
|
+
F.div,
|
|
196
265
|
{
|
|
197
|
-
ref:
|
|
198
|
-
className:
|
|
266
|
+
ref: p,
|
|
267
|
+
className: N(
|
|
199
268
|
"border-d-border relative flex max-w-[200px] rounded-md border p-1.5 pr-2 text-xs",
|
|
200
|
-
|
|
269
|
+
m
|
|
201
270
|
),
|
|
202
271
|
layout: !0,
|
|
203
272
|
initial: { opacity: 0, y: "100%" },
|
|
@@ -205,14 +274,20 @@ const j = p.forwardRef(
|
|
|
205
274
|
exit: { opacity: 0, y: "100%" },
|
|
206
275
|
children: [
|
|
207
276
|
/* @__PURE__ */ o("div", { className: "flex w-full min-w-0 cursor-pointer items-center space-x-2", children: [
|
|
208
|
-
/* @__PURE__ */ t("div", { className: "bg-d-secondary
|
|
209
|
-
/* @__PURE__ */
|
|
277
|
+
/* @__PURE__ */ t("div", { className: "bg-d-secondary grid h-10 w-10 shrink-0 place-items-center rounded-sm", children: /* @__PURE__ */ t(b, { className: N("h-5 w-5", x) }) }),
|
|
278
|
+
/* @__PURE__ */ o("div", { className: "min-w-0", children: [
|
|
279
|
+
/* @__PURE__ */ t(I, { text: e.name }),
|
|
280
|
+
(w || g) && /* @__PURE__ */ o("div", { className: "text-d-secondary-foreground/70 mt-0.5 text-[10px] leading-3", children: [
|
|
281
|
+
w,
|
|
282
|
+
g ? w ? ` · ${g}` : g : ""
|
|
283
|
+
] })
|
|
284
|
+
] }),
|
|
210
285
|
n && /* @__PURE__ */ t(
|
|
211
|
-
|
|
286
|
+
k,
|
|
212
287
|
{
|
|
213
288
|
url: i,
|
|
214
|
-
onPreview:
|
|
215
|
-
onDownload:
|
|
289
|
+
onPreview: s,
|
|
290
|
+
onDownload: a,
|
|
216
291
|
onRemove: r
|
|
217
292
|
}
|
|
218
293
|
)
|
|
@@ -224,7 +299,7 @@ const j = p.forwardRef(
|
|
|
224
299
|
type: "button",
|
|
225
300
|
onClick: () => r(i),
|
|
226
301
|
"aria-label": "Remove attachment",
|
|
227
|
-
children: /* @__PURE__ */ t(
|
|
302
|
+
children: /* @__PURE__ */ t(z, { className: "h-2.5 w-2.5" })
|
|
228
303
|
}
|
|
229
304
|
) : null
|
|
230
305
|
]
|
|
@@ -232,8 +307,10 @@ const j = p.forwardRef(
|
|
|
232
307
|
);
|
|
233
308
|
}
|
|
234
309
|
);
|
|
235
|
-
j.displayName = "GenericFilePreview";
|
|
236
310
|
export {
|
|
237
|
-
|
|
238
|
-
|
|
311
|
+
be as FilePreview,
|
|
312
|
+
Y as GenericFilePreview,
|
|
313
|
+
J as ImageFilePreview,
|
|
314
|
+
Q as TextFilePreview,
|
|
315
|
+
I as default
|
|
239
316
|
};
|
|
@@ -17,7 +17,7 @@ function C(e) {
|
|
|
17
17
|
return d.safeAsk(f(e));
|
|
18
18
|
}
|
|
19
19
|
const H = () => {
|
|
20
|
-
const [{ payload: e }, { asking: t,
|
|
20
|
+
const [{ payload: e }, { asking: t, ok: i }] = D(), n = e?.url, a = s(() => e?.filename ? e?.filename : (e?.url || "").split(/[?#]/)[0].split("/").pop() || "" || "document", [e?.filename, e?.url]), o = s(() => {
|
|
21
21
|
if (!e?.url) return null;
|
|
22
22
|
const l = new URL(e?.url), c = l.searchParams.get("response-content-type") || l.searchParams.get("content-type"), m = e?.mimeType || c || "";
|
|
23
23
|
return y({
|