@epam/ai-dial-attachment-input 1.0.0-dev.503 → 1.0.0-dev.509
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/components/AttachmentCard/AttachmentCard.d.ts.map +1 -1
- package/components/AttachmentFileRow/AttachmentFileRow.d.ts.map +1 -1
- package/components/AttachmentGroup/AttachmentGroup.d.ts.map +1 -1
- package/components/AttachmentMoreTile/AttachmentMoreTile.d.ts.map +1 -1
- package/components/AttachmentTray/AttachmentTray.d.ts.map +1 -1
- package/index.d.ts +5 -5
- package/index.d.ts.map +1 -1
- package/index.js +289 -283
- package/models/attachment-card.d.ts +4 -6
- package/models/attachment-card.d.ts.map +1 -1
- package/models/attachment-file-row.d.ts +14 -9
- package/models/attachment-file-row.d.ts.map +1 -1
- package/models/attachment-group.d.ts +14 -9
- package/models/attachment-group.d.ts.map +1 -1
- package/models/attachment-more-tile.d.ts +25 -10
- package/models/attachment-more-tile.d.ts.map +1 -1
- package/models/attachment-tray.d.ts +7 -2
- package/models/attachment-tray.d.ts.map +1 -1
- package/models/file-dnd-overlay.d.ts +9 -4
- package/models/file-dnd-overlay.d.ts.map +1 -1
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { AttachmentErrorReason as e, AttachmentType as t, CodeBlockTheme as n, Highlight as r, MIME_TYPE_EXT_MAP as i, RequestStatus as a, buildCssVars as o, mergeClasses as s } from "@epam/ai-dial-chat-shared";
|
|
2
2
|
import { DIAL_ICON_SIZE as c, DialGhostIconButton as l, DialSkeleton as u, DialSkeletonVariant as d, DialSpinner as f, ElementSize as p } from "@epam/ai-dial-ui-kit";
|
|
3
|
-
import { IconChevronUp as m, IconClipboard as h, IconDownload as g, IconFile as _, IconFileDescription as v, IconFileTypeBmp as y, IconFileTypeCss as b, IconFileTypeCsv as x, IconFileTypeDoc as ee, IconFileTypeDocx as
|
|
4
|
-
import { useCallback as
|
|
5
|
-
import { Fragment as
|
|
3
|
+
import { IconChevronUp as m, IconClipboard as h, IconDownload as g, IconFile as _, IconFileDescription as v, IconFileTypeBmp as y, IconFileTypeCss as b, IconFileTypeCsv as x, IconFileTypeDoc as ee, IconFileTypeDocx as S, IconFileTypeHtml as C, IconFileTypeJpg as w, IconFileTypeJs as te, IconFileTypeJsx as T, IconFileTypePdf as E, IconFileTypePhp as D, IconFileTypePng as O, IconFileTypePpt as k, IconFileTypeRs as A, IconFileTypeSql as j, IconFileTypeSvg as M, IconFileTypeTs as N, IconFileTypeTsx as P, IconFileTypeTxt as F, IconFileTypeVue as I, IconFileTypeXls as L, IconFileTypeXml as R, IconFileTypeZip as z, IconFileX as B, IconMusic as ne, IconPaperclip as V, IconPhoto as re, IconReload as ie, IconTerminal2 as ae, IconVideo as H, IconX as oe } from "@tabler/icons-react";
|
|
4
|
+
import { useCallback as se, useEffect as U, useId as W, useMemo as ce, useRef as le, useState as ue } from "react";
|
|
5
|
+
import { Fragment as G, jsx as K, jsxs as q } from "react/jsx-runtime";
|
|
6
6
|
//#region src/hooks/useLazyImageLoad.ts
|
|
7
|
-
var
|
|
7
|
+
var J = /* @__PURE__ */ function(e) {
|
|
8
8
|
return e.Idle = "idle", e.Loading = "loading", e.Loaded = "loaded", e.Error = "error", e;
|
|
9
|
-
}({}),
|
|
10
|
-
let n =
|
|
11
|
-
return
|
|
9
|
+
}({}), de = ({ enabled: e, src: t }) => {
|
|
10
|
+
let n = le(null), [r, i] = ue("idle");
|
|
11
|
+
return U(() => {
|
|
12
12
|
i(e && t ? "loading" : "idle");
|
|
13
|
-
}, [e, t]),
|
|
13
|
+
}, [e, t]), U(() => {
|
|
14
14
|
let r = n.current;
|
|
15
15
|
if (!r || !e || !t) return;
|
|
16
16
|
let a = () => i("loaded"), o = () => i("error");
|
|
@@ -21,7 +21,7 @@ var le = /* @__PURE__ */ function(e) {
|
|
|
21
21
|
imageRef: n,
|
|
22
22
|
imageLoadStatus: r
|
|
23
23
|
};
|
|
24
|
-
},
|
|
24
|
+
}, Y = {
|
|
25
25
|
card: "_card_ywrb5_1",
|
|
26
26
|
cardError: "_cardError_ywrb5_6",
|
|
27
27
|
cardSelected: "_cardSelected_ywrb5_10",
|
|
@@ -33,9 +33,9 @@ var le = /* @__PURE__ */ function(e) {
|
|
|
33
33
|
actionBtn: "_actionBtn_ywrb5_32",
|
|
34
34
|
removeBtnImage: "_removeBtnImage_ywrb5_43",
|
|
35
35
|
hoverDownloadIcon: "_hoverDownloadIcon_ywrb5_51"
|
|
36
|
-
},
|
|
36
|
+
}, fe = 5, pe = 4, X = /* @__PURE__ */ function(e) {
|
|
37
37
|
return e.None = "none", e.AllVisible = "all-visible", e.Collapsed = "collapsed", e;
|
|
38
|
-
}({}),
|
|
38
|
+
}({}), Z = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, me = (e) => {
|
|
39
39
|
let t = e.lastIndexOf(".");
|
|
40
40
|
return t > 0 ? e.slice(0, t) : e;
|
|
41
41
|
}, he = {
|
|
@@ -61,19 +61,19 @@ var le = /* @__PURE__ */ function(e) {
|
|
|
61
61
|
if (!e) return _;
|
|
62
62
|
if (e.startsWith("image/")) switch (e) {
|
|
63
63
|
case "image/jpeg":
|
|
64
|
-
case "image/jpg": return
|
|
64
|
+
case "image/jpg": return w;
|
|
65
65
|
case "image/png": return O;
|
|
66
66
|
case "image/svg+xml": return M;
|
|
67
67
|
case "image/bmp": return y;
|
|
68
|
-
default: return
|
|
68
|
+
default: return re;
|
|
69
69
|
}
|
|
70
|
-
if (e.startsWith("video/")) return
|
|
71
|
-
if (e.startsWith("audio/")) return
|
|
70
|
+
if (e.startsWith("video/")) return H;
|
|
71
|
+
if (e.startsWith("audio/")) return ne;
|
|
72
72
|
switch (e) {
|
|
73
73
|
case "application/pdf": return E;
|
|
74
74
|
case "application/msword":
|
|
75
75
|
case "application/vnd.ms-word": return ee;
|
|
76
|
-
case "application/vnd.openxmlformats-officedocument.wordprocessingml.document": return
|
|
76
|
+
case "application/vnd.openxmlformats-officedocument.wordprocessingml.document": return S;
|
|
77
77
|
case "application/vnd.ms-powerpoint": return k;
|
|
78
78
|
case "application/vnd.openxmlformats-officedocument.presentationml.presentation": return k;
|
|
79
79
|
case "application/vnd.ms-excel": return L;
|
|
@@ -87,13 +87,13 @@ var le = /* @__PURE__ */ function(e) {
|
|
|
87
87
|
case "text/csv": return x;
|
|
88
88
|
case "text/plain": return F;
|
|
89
89
|
case "text/html":
|
|
90
|
-
case "application/xhtml+xml": return
|
|
90
|
+
case "application/xhtml+xml": return C;
|
|
91
91
|
case "text/xml":
|
|
92
92
|
case "application/xml": return R;
|
|
93
93
|
case "application/sql":
|
|
94
94
|
case "text/x-sql": return j;
|
|
95
95
|
case "text/javascript":
|
|
96
|
-
case "application/javascript": return
|
|
96
|
+
case "application/javascript": return te;
|
|
97
97
|
case "text/jsx": return T;
|
|
98
98
|
case "application/typescript":
|
|
99
99
|
case "text/typescript": return N;
|
|
@@ -108,7 +108,7 @@ var le = /* @__PURE__ */ function(e) {
|
|
|
108
108
|
}
|
|
109
109
|
}, ye = (e) => {
|
|
110
110
|
let { type: n, contentType: r } = e;
|
|
111
|
-
return n === t.Prompt ?
|
|
111
|
+
return n === t.Prompt ? ae : n === t.Pasted ? h : n === t.Image ? re : ve(r ?? "");
|
|
112
112
|
}, be = (e) => {
|
|
113
113
|
let t = e.toLowerCase().split(";")[0].trim(), n = i[t];
|
|
114
114
|
if (n) return n;
|
|
@@ -126,7 +126,7 @@ var le = /* @__PURE__ */ function(e) {
|
|
|
126
126
|
let o = i.lastIndexOf(".");
|
|
127
127
|
return o > 0 && o < i.length - 1 ? `.${i.slice(o + 1).toLowerCase()}` : i;
|
|
128
128
|
}, Se = (e, n, r, i = {}) => {
|
|
129
|
-
let { type: o, status: c, previewUrl: l, url: u } = e, d = c === a.Loading, f = c === a.Error, p = o === t.Image && !!(l ?? u) && !f, m = o === t.Audio && !f, h = s(
|
|
129
|
+
let { type: o, status: c, previewUrl: l, url: u } = e, d = c === a.Loading, f = c === a.Error, p = o === t.Image && !!(l ?? u) && !f, m = o === t.Audio && !f, h = s(Y.card, f && Y.cardError, n && Y.cardSelected, !f && !n && o === t.Prompt && Y.cardPrompt, !f && !n && o === t.Pasted && Y.cardPasted);
|
|
130
130
|
return {
|
|
131
131
|
isLoading: d,
|
|
132
132
|
isError: f,
|
|
@@ -136,77 +136,77 @@ var le = /* @__PURE__ */ function(e) {
|
|
|
136
136
|
BottomIcon: ye(e),
|
|
137
137
|
typeLabel: xe(e, i),
|
|
138
138
|
cardColorClass: h,
|
|
139
|
-
removeBtnClass: p ?
|
|
139
|
+
removeBtnClass: p ? Y.removeBtnImage : Y.actionBtn
|
|
140
140
|
};
|
|
141
141
|
}, Ce = (e, t) => e <= 0 ? {
|
|
142
|
-
layout:
|
|
142
|
+
layout: X.None,
|
|
143
143
|
visibleCount: 0,
|
|
144
144
|
hiddenCount: 0
|
|
145
145
|
} : e < 5 || t ? {
|
|
146
|
-
layout:
|
|
146
|
+
layout: X.AllVisible,
|
|
147
147
|
visibleCount: e,
|
|
148
148
|
hiddenCount: 0
|
|
149
149
|
} : {
|
|
150
|
-
layout:
|
|
150
|
+
layout: X.Collapsed,
|
|
151
151
|
visibleCount: 4,
|
|
152
152
|
hiddenCount: e - 4
|
|
153
|
-
}, we = ({ attachment: n, searchQuery: i = "", onRemove: a, onRetry: m, onExpand: h, onClick: _, isSelected: v, shouldAlwaysShowActions: y, labels: b,
|
|
154
|
-
let { removeLabel:
|
|
155
|
-
"--ci-card-border":
|
|
156
|
-
"--ci-card-bg":
|
|
157
|
-
"--ci-card-name":
|
|
158
|
-
"--ci-card-meta":
|
|
159
|
-
"--ci-card-border-error":
|
|
160
|
-
"--ci-card-bg-selected":
|
|
161
|
-
"--ci-card-border-selected":
|
|
162
|
-
"--ci-card-bg-hover":
|
|
163
|
-
"--ci-loading-overlay-bg":
|
|
164
|
-
"--ci-card-action-color":
|
|
165
|
-
"--ci-card-remove-bg-hover":
|
|
166
|
-
"--ci-card-focus-outline":
|
|
167
|
-
"--ci-card-remove-bg":
|
|
168
|
-
"--ci-card-remove-color":
|
|
169
|
-
"--ci-card-hover-icon-bg":
|
|
170
|
-
"--ci-card-hover-icon-color":
|
|
171
|
-
}), { isLoading:
|
|
153
|
+
}, we = ({ attachment: n, searchQuery: i = "", onRemove: a, onRetry: m, onExpand: h, onClick: _, isSelected: v, shouldAlwaysShowActions: y, labels: b, styles: x, showHoverDownloadIcon: ee = !1 }) => {
|
|
154
|
+
let { removeLabel: S = "Remove attachment", retryLabel: C = "Retry upload", clickLabel: w = "Open attachment", expandLabel: te = "Expand pasted text", loadingLabel: T = "Loading attachment", uploadFailedStatusLabel: E = "Upload failed" } = b ?? {}, { colors: D, typography: O, roundedClassName: k = "rounded-xl", className: A } = x ?? {}, { id: j, name: M } = n, N = n.previewUrl ?? n.url, P = n.type === t.Pasted, F = P && h !== void 0, I = ce(() => P ? M : me(M), [P, M]), L = o({
|
|
155
|
+
"--ci-card-border": D?.border,
|
|
156
|
+
"--ci-card-bg": D?.background,
|
|
157
|
+
"--ci-card-name": D?.nameText,
|
|
158
|
+
"--ci-card-meta": D?.metaText,
|
|
159
|
+
"--ci-card-border-error": D?.borderError,
|
|
160
|
+
"--ci-card-bg-selected": D?.backgroundSelected,
|
|
161
|
+
"--ci-card-border-selected": D?.borderSelected,
|
|
162
|
+
"--ci-card-bg-hover": D?.backgroundHover,
|
|
163
|
+
"--ci-loading-overlay-bg": D?.loadingOverlayBackground,
|
|
164
|
+
"--ci-card-action-color": D?.actionColor,
|
|
165
|
+
"--ci-card-remove-bg-hover": D?.actionBackgroundHover,
|
|
166
|
+
"--ci-card-focus-outline": D?.focusOutline,
|
|
167
|
+
"--ci-card-remove-bg": D?.removeBackground,
|
|
168
|
+
"--ci-card-remove-color": D?.removeColor,
|
|
169
|
+
"--ci-card-hover-icon-bg": D?.hoverIconBackground,
|
|
170
|
+
"--ci-card-hover-icon-color": D?.hoverIconColor
|
|
171
|
+
}), { isLoading: R, isError: z, isImage: B, isAudio: ne, areActionsVisible: V, BottomIcon: ae, typeLabel: H, cardColorClass: se, removeBtnClass: U } = ce(() => Se(n, v ?? !1, y ?? !1, b), [
|
|
172
172
|
n,
|
|
173
173
|
v,
|
|
174
174
|
y,
|
|
175
|
-
|
|
176
|
-
]),
|
|
177
|
-
enabled:
|
|
178
|
-
src:
|
|
179
|
-
}),
|
|
180
|
-
|
|
181
|
-
},
|
|
182
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(),
|
|
175
|
+
b
|
|
176
|
+
]), W = _ !== void 0 && !F && !R && !z, le = F || W, { imageRef: ue, imageLoadStatus: fe } = de({
|
|
177
|
+
enabled: B,
|
|
178
|
+
src: N
|
|
179
|
+
}), pe = () => {
|
|
180
|
+
F && h ? h(j) : W && _ && _(j);
|
|
181
|
+
}, X = (e) => {
|
|
182
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), pe());
|
|
183
183
|
};
|
|
184
|
-
if (
|
|
185
|
-
style:
|
|
186
|
-
className: s("group flex w-full min-w-[280px] max-w-[300px] flex-col gap-2 border p-3",
|
|
187
|
-
children: [/* @__PURE__ */
|
|
184
|
+
if (ne) return /* @__PURE__ */ q("div", {
|
|
185
|
+
style: L,
|
|
186
|
+
className: s("group flex w-full min-w-[280px] max-w-[300px] flex-col gap-2 border p-3", k, se, A),
|
|
187
|
+
children: [/* @__PURE__ */ q("div", {
|
|
188
188
|
className: "flex items-center justify-between gap-2",
|
|
189
|
-
children: [/* @__PURE__ */
|
|
189
|
+
children: [/* @__PURE__ */ K("span", {
|
|
190
190
|
title: n.name,
|
|
191
|
-
className: s(
|
|
192
|
-
children: i ? /* @__PURE__ */
|
|
191
|
+
className: s(O?.fontClassName ?? "dial-tiny-text", "min-w-0 truncate", Y.name),
|
|
192
|
+
children: i ? /* @__PURE__ */ K(r, {
|
|
193
193
|
text: n.name,
|
|
194
194
|
query: i,
|
|
195
195
|
maxLines: 1
|
|
196
196
|
}) : n.name
|
|
197
|
-
}), _ && /* @__PURE__ */
|
|
198
|
-
icon: /* @__PURE__ */
|
|
197
|
+
}), _ && /* @__PURE__ */ K(l, {
|
|
198
|
+
icon: /* @__PURE__ */ K(g, {
|
|
199
199
|
size: c.SM,
|
|
200
200
|
"aria-hidden": !0
|
|
201
201
|
}),
|
|
202
202
|
size: p.Small,
|
|
203
|
-
className: s("h-6 w-6 shrink-0 rounded",
|
|
204
|
-
"aria-label":
|
|
203
|
+
className: s("h-6 w-6 shrink-0 rounded", U),
|
|
204
|
+
"aria-label": w,
|
|
205
205
|
onClick: (e) => {
|
|
206
|
-
e.stopPropagation(), _(
|
|
206
|
+
e.stopPropagation(), _(j);
|
|
207
207
|
}
|
|
208
208
|
})]
|
|
209
|
-
}), n.playUrl && /* @__PURE__ */
|
|
209
|
+
}), n.playUrl && /* @__PURE__ */ K("audio", {
|
|
210
210
|
controls: !0,
|
|
211
211
|
src: n.playUrl,
|
|
212
212
|
"aria-label": n.name,
|
|
@@ -214,145 +214,145 @@ var le = /* @__PURE__ */ function(e) {
|
|
|
214
214
|
preload: "metadata"
|
|
215
215
|
})]
|
|
216
216
|
});
|
|
217
|
-
let
|
|
218
|
-
|
|
217
|
+
let Z = s("group relative flex h-[100px] w-[100px] flex-shrink-0 border focus-within:outline focus-within:outline-1 focus-within:outline-offset-1", k, se, !B && "flex-col gap-3 p-3", le && "cursor-pointer", A), he = /* @__PURE__ */ q(G, { children: [
|
|
218
|
+
B ? /* @__PURE__ */ q("div", {
|
|
219
219
|
className: "relative h-full w-full overflow-hidden",
|
|
220
|
-
children: [fe !==
|
|
220
|
+
children: [fe !== J.Loaded && /* @__PURE__ */ K(u, {
|
|
221
221
|
variant: d.Rectangular,
|
|
222
222
|
width: "100%",
|
|
223
223
|
height: "100%",
|
|
224
|
-
active: fe ===
|
|
225
|
-
overlay: /* @__PURE__ */
|
|
224
|
+
active: fe === J.Loading,
|
|
225
|
+
overlay: /* @__PURE__ */ K(re, {
|
|
226
226
|
size: c.LG,
|
|
227
|
-
className:
|
|
227
|
+
className: O?.placeholderIconClassName ?? "text-secondary",
|
|
228
228
|
"aria-hidden": !0
|
|
229
229
|
}),
|
|
230
|
-
className: s("absolute inset-0",
|
|
231
|
-
}), /* @__PURE__ */
|
|
232
|
-
ref:
|
|
233
|
-
src:
|
|
234
|
-
alt:
|
|
230
|
+
className: s("absolute inset-0", k)
|
|
231
|
+
}), /* @__PURE__ */ K("img", {
|
|
232
|
+
ref: ue,
|
|
233
|
+
src: N,
|
|
234
|
+
alt: M,
|
|
235
235
|
loading: "lazy",
|
|
236
236
|
decoding: "async",
|
|
237
|
-
className: s("h-full w-full object-cover transition-opacity duration-200", fe ===
|
|
237
|
+
className: s("h-full w-full object-cover transition-opacity duration-200", fe === J.Loaded ? "opacity-100" : "opacity-0", k)
|
|
238
238
|
})]
|
|
239
|
-
}) :
|
|
239
|
+
}) : z ? /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ q("div", {
|
|
240
240
|
className: "flex flex-row items-center gap-1 overflow-hidden",
|
|
241
|
-
children: [/* @__PURE__ */
|
|
241
|
+
children: [/* @__PURE__ */ K(ae, {
|
|
242
242
|
size: c.SM,
|
|
243
|
-
className: s("shrink-0",
|
|
243
|
+
className: s("shrink-0", Y.meta),
|
|
244
244
|
"aria-hidden": !0
|
|
245
|
-
}), /* @__PURE__ */
|
|
246
|
-
title:
|
|
247
|
-
className: s(
|
|
248
|
-
children:
|
|
245
|
+
}), /* @__PURE__ */ K("span", {
|
|
246
|
+
title: H,
|
|
247
|
+
className: s(O?.metaClassName ?? "dial-tiny-text", "min-w-0 truncate", Y.meta),
|
|
248
|
+
children: H
|
|
249
249
|
})]
|
|
250
|
-
}), /* @__PURE__ */
|
|
250
|
+
}), /* @__PURE__ */ K("div", {
|
|
251
251
|
className: "min-w-0 flex-1",
|
|
252
|
-
children: /* @__PURE__ */
|
|
253
|
-
title:
|
|
254
|
-
className: s(
|
|
255
|
-
children: i ? /* @__PURE__ */
|
|
256
|
-
text:
|
|
252
|
+
children: /* @__PURE__ */ K("div", {
|
|
253
|
+
title: I,
|
|
254
|
+
className: s(O?.fontClassName ?? "dial-tiny-text", "line-clamp-3 break-words", Y.name),
|
|
255
|
+
children: i ? /* @__PURE__ */ K(r, {
|
|
256
|
+
text: I,
|
|
257
257
|
query: i,
|
|
258
258
|
maxLines: 3
|
|
259
|
-
}) :
|
|
259
|
+
}) : I
|
|
260
260
|
})
|
|
261
|
-
})] }) : /* @__PURE__ */
|
|
261
|
+
})] }) : /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ K("div", {
|
|
262
262
|
className: "min-w-0 flex-1",
|
|
263
|
-
children: /* @__PURE__ */
|
|
264
|
-
title:
|
|
265
|
-
className: s(
|
|
266
|
-
children: i ? /* @__PURE__ */
|
|
267
|
-
text:
|
|
263
|
+
children: /* @__PURE__ */ K("div", {
|
|
264
|
+
title: I,
|
|
265
|
+
className: s(O?.fontClassName ?? "dial-tiny-text", "line-clamp-3 break-words", Y.name),
|
|
266
|
+
children: i ? /* @__PURE__ */ K(r, {
|
|
267
|
+
text: I,
|
|
268
268
|
query: i,
|
|
269
269
|
maxLines: 3
|
|
270
|
-
}) :
|
|
270
|
+
}) : I
|
|
271
271
|
})
|
|
272
|
-
}), /* @__PURE__ */
|
|
272
|
+
}), /* @__PURE__ */ q("div", {
|
|
273
273
|
className: "flex flex-row items-center gap-1 overflow-hidden",
|
|
274
|
-
children: [/* @__PURE__ */
|
|
274
|
+
children: [/* @__PURE__ */ K(ae, {
|
|
275
275
|
size: c.SM,
|
|
276
|
-
className: s("shrink-0",
|
|
276
|
+
className: s("shrink-0", Y.meta),
|
|
277
277
|
"aria-hidden": !0
|
|
278
|
-
}), /* @__PURE__ */
|
|
279
|
-
title:
|
|
280
|
-
className: s(
|
|
281
|
-
children:
|
|
278
|
+
}), /* @__PURE__ */ K("span", {
|
|
279
|
+
title: H,
|
|
280
|
+
className: s(O?.metaClassName ?? "dial-tiny-text", "min-w-0 truncate", Y.meta),
|
|
281
|
+
children: H
|
|
282
282
|
})]
|
|
283
283
|
})] }),
|
|
284
|
-
|
|
285
|
-
className: s("absolute inset-0 flex items-center justify-center",
|
|
286
|
-
children: /* @__PURE__ */
|
|
284
|
+
R && /* @__PURE__ */ K("span", {
|
|
285
|
+
className: s("absolute inset-0 flex items-center justify-center", k, Y.loadingOverlay),
|
|
286
|
+
children: /* @__PURE__ */ K(f, {
|
|
287
287
|
size: 40,
|
|
288
|
-
ariaLabel:
|
|
288
|
+
ariaLabel: T,
|
|
289
289
|
className: "z-50"
|
|
290
290
|
})
|
|
291
291
|
}),
|
|
292
|
-
/* @__PURE__ */
|
|
292
|
+
/* @__PURE__ */ K("span", {
|
|
293
293
|
role: "status",
|
|
294
294
|
"aria-live": "polite",
|
|
295
295
|
className: "sr-only",
|
|
296
|
-
children:
|
|
296
|
+
children: z ? E : ""
|
|
297
297
|
}),
|
|
298
|
-
!
|
|
299
|
-
className: s("absolute end-1 top-1 flex gap-1 transition-opacity",
|
|
298
|
+
!R && /* @__PURE__ */ q("div", {
|
|
299
|
+
className: s("absolute end-1 top-1 flex gap-1 transition-opacity", V ? "opacity-100" : "opacity-0 group-focus-within:opacity-100 group-hover:opacity-100 mobile:opacity-100"),
|
|
300
300
|
children: [
|
|
301
|
-
|
|
302
|
-
icon: /* @__PURE__ */
|
|
301
|
+
z && m && n.errorReason !== e.UnsupportedType && /* @__PURE__ */ K(l, {
|
|
302
|
+
icon: /* @__PURE__ */ K(ie, {
|
|
303
303
|
size: c.SM,
|
|
304
304
|
"aria-hidden": !0
|
|
305
305
|
}),
|
|
306
306
|
size: p.Small,
|
|
307
|
-
className: s("h-6 w-6 rounded",
|
|
308
|
-
"aria-label":
|
|
307
|
+
className: s("h-6 w-6 rounded", U),
|
|
308
|
+
"aria-label": C,
|
|
309
309
|
onClick: (e) => {
|
|
310
|
-
e.stopPropagation(), m(
|
|
310
|
+
e.stopPropagation(), m(j);
|
|
311
311
|
}
|
|
312
312
|
}),
|
|
313
|
-
a && /* @__PURE__ */
|
|
314
|
-
icon: /* @__PURE__ */
|
|
313
|
+
a && /* @__PURE__ */ K(l, {
|
|
314
|
+
icon: /* @__PURE__ */ K(oe, {
|
|
315
315
|
size: c.SM,
|
|
316
316
|
"aria-hidden": !0
|
|
317
317
|
}),
|
|
318
318
|
size: p.Small,
|
|
319
|
-
className: s("h-6 w-6 rounded",
|
|
320
|
-
"aria-label":
|
|
319
|
+
className: s("h-6 w-6 rounded", U),
|
|
320
|
+
"aria-label": S,
|
|
321
321
|
onClick: (e) => {
|
|
322
|
-
e.stopPropagation(), a?.(
|
|
322
|
+
e.stopPropagation(), a?.(j);
|
|
323
323
|
}
|
|
324
324
|
}),
|
|
325
|
-
|
|
325
|
+
ee && !a && !z && /* @__PURE__ */ K(g, {
|
|
326
326
|
size: c.SM,
|
|
327
327
|
"aria-hidden": !0,
|
|
328
|
-
className: s("h-6 w-6 rounded-lg p-1",
|
|
328
|
+
className: s("h-6 w-6 rounded-lg p-1", Y.hoverDownloadIcon)
|
|
329
329
|
})
|
|
330
330
|
]
|
|
331
331
|
})
|
|
332
332
|
] });
|
|
333
|
-
return
|
|
334
|
-
style:
|
|
335
|
-
className:
|
|
336
|
-
onClick:
|
|
337
|
-
onKeyDown:
|
|
333
|
+
return le ? /* @__PURE__ */ K("div", {
|
|
334
|
+
style: L,
|
|
335
|
+
className: Z,
|
|
336
|
+
onClick: pe,
|
|
337
|
+
onKeyDown: X,
|
|
338
338
|
tabIndex: 0,
|
|
339
339
|
role: "button",
|
|
340
|
-
"aria-label":
|
|
341
|
-
children:
|
|
342
|
-
}) : /* @__PURE__ */
|
|
343
|
-
style:
|
|
344
|
-
className:
|
|
345
|
-
children:
|
|
340
|
+
"aria-label": W ? w : F ? te : void 0,
|
|
341
|
+
children: he
|
|
342
|
+
}) : /* @__PURE__ */ K("div", {
|
|
343
|
+
style: L,
|
|
344
|
+
className: Z,
|
|
345
|
+
children: he
|
|
346
346
|
});
|
|
347
|
-
}, Te = ({ attachments: e, onRemove: t, onRetry: n, onExpand: r, onAttachmentClick: i, labels: a,
|
|
348
|
-
let { ariaLabel: c = "Attached files", removeLabel: l, retryLabel: u, clickLabel: d } = a ?? {};
|
|
349
|
-
return e.length === 0 ? null : /* @__PURE__ */
|
|
347
|
+
}, Te = ({ attachments: e, onRemove: t, onRetry: n, onExpand: r, onAttachmentClick: i, labels: a, styles: o }) => {
|
|
348
|
+
let { ariaLabel: c = "Attached files", removeLabel: l, retryLabel: u, clickLabel: d } = a ?? {}, { className: f } = o ?? {};
|
|
349
|
+
return e.length === 0 ? null : /* @__PURE__ */ K("div", {
|
|
350
350
|
role: "list",
|
|
351
351
|
"aria-label": c,
|
|
352
|
-
className: s("flex w-full min-w-0 gap-2 overflow-x-auto",
|
|
353
|
-
children: e.map((e) => /* @__PURE__ */
|
|
352
|
+
className: s("flex w-full min-w-0 gap-2 overflow-x-auto", f),
|
|
353
|
+
children: e.map((e) => /* @__PURE__ */ K("div", {
|
|
354
354
|
role: "listitem",
|
|
355
|
-
children: /* @__PURE__ */
|
|
355
|
+
children: /* @__PURE__ */ K(we, {
|
|
356
356
|
attachment: e,
|
|
357
357
|
onRemove: t,
|
|
358
358
|
onRetry: n,
|
|
@@ -380,111 +380,111 @@ var le = /* @__PURE__ */ function(e) {
|
|
|
380
380
|
}, Ee = {
|
|
381
381
|
[e.Network]: "Upload failed · network error",
|
|
382
382
|
[e.UnsupportedType]: "Upload failed · unsupported file type"
|
|
383
|
-
}, De = ({ attachment: t, onClick: r, onRetry: i, labels: u,
|
|
384
|
-
let { clickLabel:
|
|
385
|
-
"--ci-tile-bg":
|
|
386
|
-
"--ci-tile-border":
|
|
387
|
-
"--ci-tile-border-hover":
|
|
388
|
-
"--ci-tile-focus-outline":
|
|
389
|
-
"--ci-tile-bg-error":
|
|
390
|
-
"--ci-tile-border-error":
|
|
391
|
-
"--ci-tile-error-text":
|
|
392
|
-
"--ci-tile-name-text":
|
|
393
|
-
"--ci-tile-type-text":
|
|
394
|
-
"--ci-tile-hover-icon-bg":
|
|
395
|
-
"--ci-tile-hover-icon-color":
|
|
396
|
-
"--ci-tile-track-bg":
|
|
397
|
-
"--ci-tile-fill-bg":
|
|
398
|
-
}), { id:
|
|
399
|
-
|
|
400
|
-
},
|
|
401
|
-
(e.key === "Enter" || e.key === " ") &&
|
|
402
|
-
},
|
|
403
|
-
title:
|
|
404
|
-
className: s(
|
|
405
|
-
children:
|
|
406
|
-
}),
|
|
407
|
-
className: s("flex items-center gap-1 overflow-hidden",
|
|
408
|
-
children: [/* @__PURE__ */
|
|
383
|
+
}, De = ({ attachment: t, onClick: r, onRetry: i, labels: u, styles: d, theme: f = n.Dark }) => {
|
|
384
|
+
let { clickLabel: m = "Download attachment", retryLabel: h = "Retry upload", sizeLabel: _, uploadingLabel: v = "Uploading", errorReasonLabels: y, genericErrorLabel: b = "Upload failed" } = u ?? {}, { typography: { nameClassName: x = "dial-caption-text", metaClassName: ee = "dial-caption-text" } = {}, colors: S, className: C } = d ?? {}, w = o({
|
|
385
|
+
"--ci-tile-bg": S?.background,
|
|
386
|
+
"--ci-tile-border": S?.border,
|
|
387
|
+
"--ci-tile-border-hover": S?.borderHover,
|
|
388
|
+
"--ci-tile-focus-outline": S?.focusOutline,
|
|
389
|
+
"--ci-tile-bg-error": S?.backgroundError,
|
|
390
|
+
"--ci-tile-border-error": S?.borderError,
|
|
391
|
+
"--ci-tile-error-text": S?.errorText,
|
|
392
|
+
"--ci-tile-name-text": S?.nameText,
|
|
393
|
+
"--ci-tile-type-text": S?.typeText,
|
|
394
|
+
"--ci-tile-hover-icon-bg": S?.hoverIconBackground,
|
|
395
|
+
"--ci-tile-hover-icon-color": S?.hoverIconColor,
|
|
396
|
+
"--ci-tile-track-bg": S?.trackBackground,
|
|
397
|
+
"--ci-tile-fill-bg": S?.fillBackground
|
|
398
|
+
}), { id: te, name: T, status: E, errorReason: D } = t, O = E === a.Loading, k = E === a.Error, A = W(), j = k && (D && (y?.[D] ?? Ee[D]) || b), { BottomIcon: M, typeLabel: N } = Se(t, !1, !1, u), P = !k && !O && r !== void 0, F = k && !!i && D !== e.UnsupportedType, I = P || F ? "pe-5" : void 0, L = () => {
|
|
399
|
+
P && r?.(t);
|
|
400
|
+
}, R = (e) => {
|
|
401
|
+
(e.key === "Enter" || e.key === " ") && P && (e.preventDefault(), L());
|
|
402
|
+
}, z = s("group relative flex size-[84px] flex-col justify-between gap-1 overflow-hidden rounded-xl border p-1.5", Q.tile, !k && f === n.Light && Q.tileLight, k && Q.tileError), B = /* @__PURE__ */ K("div", {
|
|
403
|
+
title: T,
|
|
404
|
+
className: s(x, "line-clamp-2 min-w-0 break-words", Q.nameText, !k && I),
|
|
405
|
+
children: T
|
|
406
|
+
}), ne = /* @__PURE__ */ q("div", {
|
|
407
|
+
className: s("flex items-center gap-1 overflow-hidden", k && I),
|
|
408
|
+
children: [/* @__PURE__ */ K(M, {
|
|
409
409
|
size: 16,
|
|
410
410
|
className: Q.typeText,
|
|
411
411
|
"aria-hidden": !0
|
|
412
|
-
}), /* @__PURE__ */
|
|
413
|
-
className: s(
|
|
414
|
-
children:
|
|
412
|
+
}), /* @__PURE__ */ K("span", {
|
|
413
|
+
className: s(ee, "truncate", Q.typeText),
|
|
414
|
+
children: _ ? `${N} · ${_}` : N
|
|
415
415
|
})]
|
|
416
|
-
}),
|
|
417
|
-
|
|
418
|
-
|
|
416
|
+
}), V = /* @__PURE__ */ q(G, { children: [
|
|
417
|
+
k ? /* @__PURE__ */ q(G, { children: [ne, B] }) : /* @__PURE__ */ q(G, { children: [B, ne] }),
|
|
418
|
+
O && /* @__PURE__ */ K("div", {
|
|
419
419
|
role: "progressbar",
|
|
420
|
-
"aria-label":
|
|
420
|
+
"aria-label": v,
|
|
421
421
|
className: s("absolute inset-x-2 bottom-2 h-[3px] overflow-hidden rounded-full", Q.track),
|
|
422
|
-
children: /* @__PURE__ */
|
|
422
|
+
children: /* @__PURE__ */ K("div", { className: s("h-full w-1/3 rounded-full", Q.indeterminateFill) })
|
|
423
423
|
}),
|
|
424
|
-
|
|
424
|
+
P && /* @__PURE__ */ K(g, {
|
|
425
425
|
size: c.SM,
|
|
426
426
|
"aria-hidden": !0,
|
|
427
427
|
className: s("absolute end-1 top-1 h-6 w-6 rounded-lg p-1 opacity-0 transition-opacity group-hover:opacity-100 mobile:opacity-100", Q.hoverIcon)
|
|
428
428
|
}),
|
|
429
|
-
|
|
430
|
-
icon: /* @__PURE__ */
|
|
429
|
+
F && /* @__PURE__ */ K(l, {
|
|
430
|
+
icon: /* @__PURE__ */ K(ie, {
|
|
431
431
|
size: c.SM,
|
|
432
432
|
"aria-hidden": !0
|
|
433
433
|
}),
|
|
434
434
|
size: p.Small,
|
|
435
435
|
className: s("absolute end-1 top-1 h-6 w-6 rounded-lg", Q.retryIcon),
|
|
436
|
-
"aria-label":
|
|
437
|
-
"aria-describedby":
|
|
436
|
+
"aria-label": h,
|
|
437
|
+
"aria-describedby": j ? A : void 0,
|
|
438
438
|
onClick: (e) => {
|
|
439
|
-
e.stopPropagation(), i(
|
|
439
|
+
e.stopPropagation(), i(te);
|
|
440
440
|
}
|
|
441
441
|
}),
|
|
442
|
-
|
|
443
|
-
id:
|
|
442
|
+
k && /* @__PURE__ */ K("span", {
|
|
443
|
+
id: A,
|
|
444
444
|
role: "status",
|
|
445
445
|
"aria-live": "polite",
|
|
446
446
|
className: "sr-only",
|
|
447
|
-
children:
|
|
447
|
+
children: j
|
|
448
448
|
})
|
|
449
449
|
] });
|
|
450
|
-
return /* @__PURE__ */
|
|
451
|
-
className: s("inline-flex",
|
|
452
|
-
children:
|
|
450
|
+
return /* @__PURE__ */ K("div", {
|
|
451
|
+
className: s("inline-flex", C),
|
|
452
|
+
children: P ? /* @__PURE__ */ K("div", {
|
|
453
453
|
role: "button",
|
|
454
454
|
tabIndex: 0,
|
|
455
|
-
"aria-label":
|
|
456
|
-
onClick:
|
|
457
|
-
onKeyDown:
|
|
455
|
+
"aria-label": m,
|
|
456
|
+
onClick: L,
|
|
457
|
+
onKeyDown: R,
|
|
458
458
|
style: w,
|
|
459
|
-
className: s(
|
|
460
|
-
children:
|
|
461
|
-
}) : /* @__PURE__ */
|
|
462
|
-
className:
|
|
463
|
-
title:
|
|
464
|
-
role:
|
|
465
|
-
"aria-describedby":
|
|
466
|
-
tabIndex:
|
|
459
|
+
className: s(z, "cursor-pointer focus-within:outline focus-within:outline-1 focus-within:outline-offset-1"),
|
|
460
|
+
children: V
|
|
461
|
+
}) : /* @__PURE__ */ K("div", {
|
|
462
|
+
className: z,
|
|
463
|
+
title: j || void 0,
|
|
464
|
+
role: k ? "group" : void 0,
|
|
465
|
+
"aria-describedby": k ? A : void 0,
|
|
466
|
+
tabIndex: k ? 0 : void 0,
|
|
467
467
|
style: w,
|
|
468
|
-
children:
|
|
468
|
+
children: V
|
|
469
469
|
})
|
|
470
470
|
});
|
|
471
|
-
}, Oe = { tile: "_tile_1s4d7_1" }, ke = ({ count: e, onClick: t,
|
|
472
|
-
let l = o({
|
|
473
|
-
"--ci-more-tile-bg":
|
|
474
|
-
"--ci-more-tile-border":
|
|
475
|
-
"--ci-more-tile-color":
|
|
476
|
-
"--ci-more-tile-bg-hover":
|
|
477
|
-
"--ci-more-tile-color-hover":
|
|
478
|
-
"--ci-more-tile-border-hover":
|
|
479
|
-
"--ci-more-tile-focus-outline":
|
|
471
|
+
}, Oe = { tile: "_tile_1s4d7_1" }, ke = ({ count: e, onClick: t, labels: n, children: r, styles: i }) => {
|
|
472
|
+
let { ariaLabel: a } = n ?? {}, { typography: { fontClassName: c = "dial-small-semi-text" } = {}, className: l, colors: u } = i ?? {}, d = o({
|
|
473
|
+
"--ci-more-tile-bg": u?.background,
|
|
474
|
+
"--ci-more-tile-border": u?.border,
|
|
475
|
+
"--ci-more-tile-color": u?.color,
|
|
476
|
+
"--ci-more-tile-bg-hover": u?.backgroundHover,
|
|
477
|
+
"--ci-more-tile-color-hover": u?.colorHover,
|
|
478
|
+
"--ci-more-tile-border-hover": u?.borderHover,
|
|
479
|
+
"--ci-more-tile-focus-outline": u?.focusOutline
|
|
480
480
|
});
|
|
481
|
-
return /* @__PURE__ */
|
|
481
|
+
return /* @__PURE__ */ K("button", {
|
|
482
482
|
type: "button",
|
|
483
483
|
onClick: t,
|
|
484
|
-
"aria-label":
|
|
485
|
-
style:
|
|
486
|
-
className: s("flex size-[84px] items-center justify-center rounded-xl border",
|
|
487
|
-
children: r ?? /* @__PURE__ */
|
|
484
|
+
"aria-label": a ?? `Show ${e} more attachments`,
|
|
485
|
+
style: d,
|
|
486
|
+
className: s("flex size-[84px] items-center justify-center rounded-xl border", c, Oe.tile, l),
|
|
487
|
+
children: r ?? /* @__PURE__ */ K("bdi", {
|
|
488
488
|
dir: "ltr",
|
|
489
489
|
children: `+${e}`
|
|
490
490
|
})
|
|
@@ -495,90 +495,96 @@ var le = /* @__PURE__ */ function(e) {
|
|
|
495
495
|
headerLabel: "_headerLabel_7fktb_7",
|
|
496
496
|
downloadAllButton: "_downloadAllButton_7fktb_8",
|
|
497
497
|
imageTile: "_imageTile_7fktb_12"
|
|
498
|
-
}, Ae = (e, t) => `${e} ${t}${e === 1 ? "" : "s"}`, je = ({ attachments: e, onAttachmentClick: n, onDownloadAll: r, onRetry: i, getSizeLabel: u, labels: d,
|
|
499
|
-
let { ariaLabel:
|
|
500
|
-
"--ci-group-bg":
|
|
501
|
-
"--ci-group-border":
|
|
502
|
-
"--ci-group-text":
|
|
503
|
-
}), [
|
|
498
|
+
}, Ae = (e, t) => `${e} ${t}${e === 1 ? "" : "s"}`, je = ({ attachments: e, onAttachmentClick: n, onDownloadAll: r, onRetry: i, getSizeLabel: u, labels: d, styles: f, theme: p }) => {
|
|
499
|
+
let { ariaLabel: h = "Attachments", clickLabel: v = "Download attachment", retryLabel: y = "Retry upload", showLessLabel: b = "Show less", downloadAllLabel: x = "Download all", getHeaderLabel: ee = (e) => Ae(e, "attachment"), promptLabel: S, pastedLabel: C, imageLabel: w } = d ?? {}, { typography: { headerLabelClassName: te = "dial-tiny-semi-text" } = {}, colors: T, className: E } = f ?? {}, D = o({
|
|
500
|
+
"--ci-group-bg": T?.background,
|
|
501
|
+
"--ci-group-border": T?.border,
|
|
502
|
+
"--ci-group-text": T?.text
|
|
503
|
+
}), [O, k] = ue(!1), A = ce(() => Ce(e.length, O), [e.length, O]);
|
|
504
504
|
if (e.length === 0) return null;
|
|
505
|
-
let
|
|
506
|
-
return /* @__PURE__ */
|
|
505
|
+
let j = e.some((e) => e.type === t.Image), M = e.some((e) => e.type !== t.Image), N = j && M, P = e.length >= 5, F = N ? V : j ? re : _, I = ee(e.length), L = e.slice(0, A.visibleCount);
|
|
506
|
+
return /* @__PURE__ */ q("div", {
|
|
507
507
|
role: "group",
|
|
508
|
-
"aria-label":
|
|
509
|
-
style:
|
|
510
|
-
className: s("rounded-2xl border p-3",
|
|
511
|
-
children: [/* @__PURE__ */
|
|
508
|
+
"aria-label": h,
|
|
509
|
+
style: D,
|
|
510
|
+
className: s("rounded-2xl border p-3", P ? "w-full min-w-0 max-w-[492px]" : "max-w-[420px]", $.container, E),
|
|
511
|
+
children: [/* @__PURE__ */ q("div", {
|
|
512
512
|
className: "mb-3 flex min-h-6 items-center gap-2",
|
|
513
513
|
children: [
|
|
514
|
-
/* @__PURE__ */
|
|
514
|
+
/* @__PURE__ */ K(F, {
|
|
515
515
|
size: c.SM,
|
|
516
516
|
className: s("shrink-0", $.headerIcon),
|
|
517
517
|
"aria-hidden": !0
|
|
518
518
|
}),
|
|
519
|
-
/* @__PURE__ */
|
|
520
|
-
className: s(
|
|
521
|
-
children:
|
|
519
|
+
/* @__PURE__ */ K("span", {
|
|
520
|
+
className: s(te, $.headerLabel),
|
|
521
|
+
children: I
|
|
522
522
|
}),
|
|
523
|
-
e.length >= 2 && (r || n) && /* @__PURE__ */
|
|
524
|
-
icon: /* @__PURE__ */
|
|
523
|
+
e.length >= 2 && (r || n) && /* @__PURE__ */ K(l, {
|
|
524
|
+
icon: /* @__PURE__ */ K(g, {
|
|
525
525
|
size: c.SM,
|
|
526
526
|
"aria-hidden": !0
|
|
527
527
|
}),
|
|
528
528
|
className: s("ms-auto h-6 w-6 rounded-lg", $.downloadAllButton),
|
|
529
|
-
"aria-label":
|
|
529
|
+
"aria-label": x,
|
|
530
530
|
onClick: () => {
|
|
531
531
|
let t = e.filter((e) => e.status === a.Idle);
|
|
532
532
|
r ? r(t) : t.forEach((e) => n?.(e));
|
|
533
533
|
}
|
|
534
534
|
})
|
|
535
535
|
]
|
|
536
|
-
}), /* @__PURE__ */
|
|
536
|
+
}), /* @__PURE__ */ q("div", {
|
|
537
537
|
role: "list",
|
|
538
|
-
"aria-label":
|
|
539
|
-
className: s("gap-3",
|
|
538
|
+
"aria-label": I,
|
|
539
|
+
className: s("gap-3", P ? "grid grid-cols-[repeat(5,84px)] overflow-x-auto" : "flex flex-wrap"),
|
|
540
540
|
children: [
|
|
541
|
-
|
|
541
|
+
L.map((e) => /* @__PURE__ */ K("div", {
|
|
542
542
|
role: "listitem",
|
|
543
|
-
children: e.type === t.Image ? /* @__PURE__ */
|
|
543
|
+
children: e.type === t.Image ? /* @__PURE__ */ K(we, {
|
|
544
544
|
attachment: e,
|
|
545
545
|
onClick: n ? () => n(e) : void 0,
|
|
546
546
|
onRetry: i,
|
|
547
547
|
labels: {
|
|
548
|
-
clickLabel:
|
|
549
|
-
retryLabel:
|
|
548
|
+
clickLabel: v,
|
|
549
|
+
retryLabel: y,
|
|
550
|
+
promptLabel: S,
|
|
551
|
+
pastedLabel: C,
|
|
552
|
+
imageLabel: w
|
|
550
553
|
},
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
554
|
+
styles: {
|
|
555
|
+
roundedClassName: "rounded-xl",
|
|
556
|
+
className: s("size-[84px]", $.imageTile)
|
|
557
|
+
},
|
|
558
|
+
showHoverDownloadIcon: !0
|
|
559
|
+
}) : /* @__PURE__ */ K(De, {
|
|
556
560
|
attachment: e,
|
|
557
561
|
onClick: n,
|
|
558
562
|
onRetry: i,
|
|
559
563
|
labels: {
|
|
560
|
-
clickLabel:
|
|
561
|
-
retryLabel:
|
|
562
|
-
sizeLabel: u?.(e)
|
|
564
|
+
clickLabel: v,
|
|
565
|
+
retryLabel: y,
|
|
566
|
+
sizeLabel: u?.(e),
|
|
567
|
+
promptLabel: S,
|
|
568
|
+
pastedLabel: C,
|
|
569
|
+
imageLabel: w
|
|
563
570
|
},
|
|
564
|
-
|
|
565
|
-
theme: h
|
|
571
|
+
theme: p
|
|
566
572
|
})
|
|
567
573
|
}, e.id)),
|
|
568
|
-
|
|
574
|
+
A.layout === X.Collapsed && /* @__PURE__ */ K("div", {
|
|
569
575
|
role: "listitem",
|
|
570
|
-
children: /* @__PURE__ */
|
|
571
|
-
count:
|
|
572
|
-
onClick: () =>
|
|
576
|
+
children: /* @__PURE__ */ K(ke, {
|
|
577
|
+
count: A.hiddenCount,
|
|
578
|
+
onClick: () => k(!0)
|
|
573
579
|
})
|
|
574
580
|
}),
|
|
575
|
-
|
|
581
|
+
P && O && /* @__PURE__ */ K("div", {
|
|
576
582
|
role: "listitem",
|
|
577
|
-
children: /* @__PURE__ */
|
|
583
|
+
children: /* @__PURE__ */ K(ke, {
|
|
578
584
|
count: 0,
|
|
579
|
-
onClick: () =>
|
|
580
|
-
ariaLabel:
|
|
581
|
-
children: /* @__PURE__ */
|
|
585
|
+
onClick: () => k(!1),
|
|
586
|
+
labels: { ariaLabel: b },
|
|
587
|
+
children: /* @__PURE__ */ K(m, {
|
|
582
588
|
size: c.MD,
|
|
583
589
|
"aria-hidden": !0
|
|
584
590
|
})
|
|
@@ -591,45 +597,45 @@ var le = /* @__PURE__ */ function(e) {
|
|
|
591
597
|
overlay: "_overlay_wr7ez_1",
|
|
592
598
|
icon: "_icon_wr7ez_5",
|
|
593
599
|
deniedIcon: "_deniedIcon_wr7ez_9"
|
|
594
|
-
}, Ne = ({ isVisible: e, isAttachmentsAllowed: t = !0,
|
|
595
|
-
let {
|
|
600
|
+
}, Ne = ({ isVisible: e, isAttachmentsAllowed: t = !0, labels: n, styles: r }) => {
|
|
601
|
+
let { title: i, subtitle: a } = n ?? {}, { colors: c, typography: l } = r ?? {}, { titleClassName: u = "heading-3 font-semibold", subtitleClassName: d = "dial-small-text" } = l ?? {};
|
|
596
602
|
if (!e) return null;
|
|
597
|
-
let
|
|
598
|
-
"--fd-bg":
|
|
599
|
-
"--fd-icon":
|
|
600
|
-
"--fd-denied-icon":
|
|
601
|
-
}),
|
|
603
|
+
let f = o({
|
|
604
|
+
"--fd-bg": c?.background,
|
|
605
|
+
"--fd-icon": c?.icon,
|
|
606
|
+
"--fd-denied-icon": c?.deniedIcon
|
|
607
|
+
}), p = i ?? (t ? "Attach files" : "No attachments allowed"), m = a ?? (t ? "Drop files here to attach them to message" : "Attachments can't be added to message"), h = t ? Me.icon : Me.deniedIcon, g = (e) => {
|
|
602
608
|
e.preventDefault();
|
|
603
|
-
},
|
|
604
|
-
return /* @__PURE__ */
|
|
609
|
+
}, _ = t ? v : B;
|
|
610
|
+
return /* @__PURE__ */ K("div", {
|
|
605
611
|
role: "status",
|
|
606
612
|
"aria-live": "polite",
|
|
607
613
|
className: s("fixed inset-0 z-[9999] flex items-center justify-center backdrop-blur-sm", Me.overlay, t ? "pointer-events-none" : "pointer-events-auto cursor-not-allowed"),
|
|
608
|
-
onDragOver: t ? void 0 :
|
|
609
|
-
onDrop: t ? void 0 :
|
|
610
|
-
style:
|
|
611
|
-
children: /* @__PURE__ */
|
|
614
|
+
onDragOver: t ? void 0 : g,
|
|
615
|
+
onDrop: t ? void 0 : g,
|
|
616
|
+
style: f,
|
|
617
|
+
children: /* @__PURE__ */ q("div", {
|
|
612
618
|
className: "flex flex-col items-center text-center",
|
|
613
619
|
children: [
|
|
614
|
-
/* @__PURE__ */
|
|
620
|
+
/* @__PURE__ */ K(_, {
|
|
615
621
|
size: 100,
|
|
616
|
-
className:
|
|
622
|
+
className: h,
|
|
617
623
|
"aria-hidden": !0
|
|
618
624
|
}),
|
|
619
|
-
/* @__PURE__ */
|
|
620
|
-
className: s("mt-5",
|
|
621
|
-
children: f
|
|
622
|
-
}),
|
|
623
|
-
/* @__PURE__ */ J("span", {
|
|
624
|
-
className: s("mt-4", u),
|
|
625
|
+
/* @__PURE__ */ K("span", {
|
|
626
|
+
className: s("mt-5", u),
|
|
625
627
|
children: p
|
|
628
|
+
}),
|
|
629
|
+
/* @__PURE__ */ K("span", {
|
|
630
|
+
className: s("mt-4", d),
|
|
631
|
+
children: m
|
|
626
632
|
})
|
|
627
633
|
]
|
|
628
634
|
})
|
|
629
635
|
});
|
|
630
636
|
}, Pe = (e, n, r = {}) => {
|
|
631
637
|
let { screenshotName: i = "Screenshot.png", pastedTextName: o = "Pasted text" } = r;
|
|
632
|
-
return { handlePaste:
|
|
638
|
+
return { handlePaste: se((r) => {
|
|
633
639
|
if (!r.clipboardData) return;
|
|
634
640
|
let s = Array.from(r.clipboardData.items).filter((e) => e.kind === "file" && e.type.startsWith("image/")), c = r.clipboardData.getData("text/plain").length > 0;
|
|
635
641
|
if (s.length > 0 && !c) {
|
|
@@ -638,7 +644,7 @@ var le = /* @__PURE__ */ function(e) {
|
|
|
638
644
|
let r = e.getAsFile();
|
|
639
645
|
if (!r) continue;
|
|
640
646
|
let o = new File([r], i, { type: r.type }), s = {
|
|
641
|
-
id:
|
|
647
|
+
id: Z(),
|
|
642
648
|
name: i,
|
|
643
649
|
contentType: r.type,
|
|
644
650
|
file: o,
|
|
@@ -654,7 +660,7 @@ var le = /* @__PURE__ */ function(e) {
|
|
|
654
660
|
let l = r.clipboardData.getData("text/plain");
|
|
655
661
|
if (l.length > n) {
|
|
656
662
|
let n = l.trim(), i = (n.length > 80 ? `${n.slice(0, 80).trimEnd()}…` : n) || o, s = new File([l], i, { type: "text/plain" }), c = {
|
|
657
|
-
id:
|
|
663
|
+
id: Z(),
|
|
658
664
|
name: i,
|
|
659
665
|
contentType: "text/plain",
|
|
660
666
|
file: s,
|
|
@@ -671,4 +677,4 @@ var le = /* @__PURE__ */ function(e) {
|
|
|
671
677
|
]) };
|
|
672
678
|
}, Fe = 100;
|
|
673
679
|
//#endregion
|
|
674
|
-
export {
|
|
680
|
+
export { pe as ATTACHMENT_COLLAPSED_VISIBLE_COUNT, fe as ATTACHMENT_COLLAPSE_THRESHOLD, we as AttachmentCard, De as AttachmentFileRow, je as AttachmentGroup, ke as AttachmentMoreTile, X as AttachmentTilesLayout, Te as AttachmentTray, Ne as FileDndOverlay, J as LazyImageLoadStatus, Fe as MAX_UPLOADS_PER_MINUTE, Z as generateAttachmentId, Se as getAttachmentCardState, ve as getAttachmentIcon, Ce as getAttachmentTilesPlan, be as getExtFromContentType, me as getNameWithoutExtension, _e as isMimeTypeAllowed, ge as mimeTypesToExtensionLabels, Pe as useClipboardPaste, de as useLazyImageLoad };
|