@epam/ai-dial-attachment-input 1.0.10 → 1.0.12
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/Attachments/Actions.d.ts +3 -3
- package/components/AttachmentCard/Attachments/Actions.d.ts.map +1 -1
- package/components/AttachmentCard/Attachments/File.d.ts.map +1 -1
- package/components/AttachmentCard/Attachments/Image.d.ts.map +1 -1
- package/index.js +166 -162
- package/models/attachment-file-row.d.ts +4 -0
- package/models/attachment-file-row.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -4,15 +4,15 @@ interface ActionProps {
|
|
|
4
4
|
icon: ReactNode;
|
|
5
5
|
/** Optional additional class name for the button. */
|
|
6
6
|
className?: string;
|
|
7
|
-
/** Localised accessible label for
|
|
7
|
+
/** Localised accessible label for this button. */
|
|
8
8
|
ariaLabel?: string;
|
|
9
9
|
/** Localised accessible title for the error state. */
|
|
10
10
|
errorTitle?: string;
|
|
11
11
|
/** ID of the element that describes the error state. */
|
|
12
12
|
errorDescId?: string;
|
|
13
|
-
/** Called when the user clicks the
|
|
13
|
+
/** Called when the user clicks the button. */
|
|
14
14
|
onClick: (id: string) => void;
|
|
15
|
-
/** ID of the attachment to
|
|
15
|
+
/** ID of the attachment the action applies to. */
|
|
16
16
|
id?: string;
|
|
17
17
|
}
|
|
18
18
|
/** Retry button for failed uploads. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Actions.d.ts","sourceRoot":"","sources":["../../../../src/components/AttachmentCard/Attachments/Actions.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,EAAmB,MAAM,OAAO,CAAC;AAG5D,UAAU,WAAW;IACnB,wCAAwC;IACxC,IAAI,EAAE,SAAS,CAAC;IAChB,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,
|
|
1
|
+
{"version":3,"file":"Actions.d.ts","sourceRoot":"","sources":["../../../../src/components/AttachmentCard/Attachments/Actions.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,EAAmB,MAAM,OAAO,CAAC;AAG5D,UAAU,WAAW;IACnB,wCAAwC;IACxC,IAAI,EAAE,SAAS,CAAC;IAChB,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kDAAkD;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,wDAAwD;IACxD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8CAA8C;IAC9C,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9B,kDAAkD;IAClD,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AA+BD,uCAAuC;AACvC,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,CActD,CAAC;AAEF,6CAA6C;AAC7C,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,CAaxD,CAAC;AAEF,mDAAmD;AACnD,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,CAaxD,CAAC;AAEF,qCAAqC;AACrC,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,CAatD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"File.d.ts","sourceRoot":"","sources":["../../../../src/components/AttachmentCard/Attachments/File.tsx"],"names":[],"mappings":"AAMA,OAAO,EACL,KAAK,EAAE,EAKR,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAmB/E,2HAA2H;AAC3H,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,
|
|
1
|
+
{"version":3,"file":"File.d.ts","sourceRoot":"","sources":["../../../../src/components/AttachmentCard/Attachments/File.tsx"],"names":[],"mappings":"AAMA,OAAO,EACL,KAAK,EAAE,EAKR,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAmB/E,2HAA2H;AAC3H,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAiOlD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../../../../src/components/AttachmentCard/Attachments/Image.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAElB,MAAM,2BAA2B,CAAC;AAQnC,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,EAA+B,MAAM,OAAO,CAAC;AAM5E,OAAO,KAAK,EACV,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,iCAAiC,CAAC;AAKzC,UAAU,oBAAoB;IAC5B,UAAU,EAAE,iBAAiB,CAAC;IAC9B,QAAQ,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,OAAO,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,QAAQ,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,uHAAuH;IACvH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,0EAA0E;AAC1E,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,
|
|
1
|
+
{"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../../../../src/components/AttachmentCard/Attachments/Image.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAElB,MAAM,2BAA2B,CAAC;AAQnC,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,EAA+B,MAAM,OAAO,CAAC;AAM5E,OAAO,KAAK,EACV,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,iCAAiC,CAAC;AAKzC,UAAU,oBAAoB;IAC5B,UAAU,EAAE,iBAAiB,CAAC;IAC9B,QAAQ,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,OAAO,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,QAAQ,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,uHAAuH;IACvH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,0EAA0E;AAC1E,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CAkIpD,CAAC"}
|
package/index.js
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
import { AttachmentErrorReason as e, AttachmentType as t, MIME_TYPE_EXT_MAP as n, RequestStatus as r, buildCssVars as i, mergeClasses as a } from "@epam/ai-dial-chat-shared";
|
|
2
2
|
import { useCallback as o, useEffect as s, useId as c, useMemo as l, useRef as u, useState as d } from "react";
|
|
3
|
-
import { IconClipboard as f, IconDownload as p, IconExternalLink as m, IconFile as h, IconFileDescription as g, IconFileTypeBmp as _, IconFileTypeCss as v, IconFileTypeCsv as y, IconFileTypeDoc as b, IconFileTypeDocx as x, IconFileTypeHtml as S, IconFileTypeJpg as C, IconFileTypeJs as w, 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
|
|
4
|
-
import { DIAL_ICON_SIZE as U, DIAL_KIT_ICON_STROKE as W, ElementSize as
|
|
5
|
-
import { Fragment as
|
|
3
|
+
import { IconClipboard as f, IconDownload as p, IconExternalLink as m, IconFile as h, IconFileDescription as g, IconFileTypeBmp as _, IconFileTypeCss as v, IconFileTypeCsv as y, IconFileTypeDoc as b, IconFileTypeDocx as x, IconFileTypeHtml as S, IconFileTypeJpg as C, IconFileTypeJs as w, 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 ee, IconFileTypeTxt as P, IconFileTypeVue as F, IconFileTypeXls as I, IconFileTypeXml as te, IconFileTypeZip as L, IconFileX as R, IconMusic as z, IconPaperclip as B, IconPhoto as V, IconReload as ne, IconTerminal2 as H, IconVideo as re, IconX as ie } from "@tabler/icons-react";
|
|
4
|
+
import { DIAL_ICON_SIZE as U, DIAL_KIT_ICON_STROKE as W, ElementSize as G, GhostIconButton as ae, Highlight as oe, Skeleton as se, SkeletonVariant as ce, Spinner as le, StaticIconButton as ue } from "@epam/ai-dial-ui-kit";
|
|
5
|
+
import { Fragment as de, jsx as K, jsxs as q } from "react/jsx-runtime";
|
|
6
6
|
//#region src/utils/attachment.ts
|
|
7
|
-
var
|
|
7
|
+
var J = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, fe = (e) => {
|
|
8
8
|
if (e == null) return "";
|
|
9
9
|
let t = e.lastIndexOf(".");
|
|
10
10
|
return t > 0 ? e.slice(0, t) : e;
|
|
11
|
-
},
|
|
11
|
+
}, pe = {
|
|
12
12
|
image: "Image files",
|
|
13
13
|
audio: "Audio files",
|
|
14
14
|
video: "Video files",
|
|
15
15
|
text: "Text files",
|
|
16
16
|
"*": "All files"
|
|
17
|
-
},
|
|
17
|
+
}, me = { "image/jpeg": "JPEG" }, he = (e, t = pe) => e.map((e) => {
|
|
18
18
|
let r = e.toLowerCase().split(";")[0].trim();
|
|
19
19
|
if (r.endsWith("/*")) {
|
|
20
20
|
let e = r.slice(0, -2);
|
|
21
21
|
return t[e] ?? `${e} files`;
|
|
22
22
|
}
|
|
23
|
-
let i =
|
|
23
|
+
let i = me[r];
|
|
24
24
|
if (i) return i;
|
|
25
25
|
let a = n[r];
|
|
26
26
|
if (a) return a.toUpperCase();
|
|
27
27
|
let o = r.split("/")[1];
|
|
28
28
|
return o == null ? e.toUpperCase() : o.toUpperCase();
|
|
29
|
-
}).join(", "),
|
|
29
|
+
}).join(", "), ge = (e, t) => t.length === 0 ? !1 : t.some((t) => {
|
|
30
30
|
if (t === "*" || t === "*/*") return !0;
|
|
31
31
|
if (t.endsWith("/*")) {
|
|
32
32
|
let n = t.slice(0, -2);
|
|
33
33
|
return e.startsWith(`${n}/`);
|
|
34
34
|
}
|
|
35
35
|
return e === t;
|
|
36
|
-
}),
|
|
36
|
+
}), _e = (e) => {
|
|
37
37
|
if (!e) return h;
|
|
38
38
|
if (e.startsWith("image/")) switch (e) {
|
|
39
39
|
case "image/jpeg":
|
|
@@ -41,10 +41,10 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, pe = (e) =
|
|
|
41
41
|
case "image/png": return O;
|
|
42
42
|
case "image/svg+xml": return M;
|
|
43
43
|
case "image/bmp": return _;
|
|
44
|
-
default: return
|
|
44
|
+
default: return V;
|
|
45
45
|
}
|
|
46
46
|
if (e.startsWith("video/")) return re;
|
|
47
|
-
if (e.startsWith("audio/")) return
|
|
47
|
+
if (e.startsWith("audio/")) return z;
|
|
48
48
|
switch (e) {
|
|
49
49
|
case "application/pdf": return E;
|
|
50
50
|
case "application/msword":
|
|
@@ -52,20 +52,20 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, pe = (e) =
|
|
|
52
52
|
case "application/vnd.openxmlformats-officedocument.wordprocessingml.document": return x;
|
|
53
53
|
case "application/vnd.ms-powerpoint": return k;
|
|
54
54
|
case "application/vnd.openxmlformats-officedocument.presentationml.presentation": return k;
|
|
55
|
-
case "application/vnd.ms-excel": return
|
|
56
|
-
case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": return
|
|
55
|
+
case "application/vnd.ms-excel": return I;
|
|
56
|
+
case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": return I;
|
|
57
57
|
case "application/zip":
|
|
58
58
|
case "application/x-zip-compressed":
|
|
59
59
|
case "application/x-rar-compressed":
|
|
60
60
|
case "application/x-7z-compressed":
|
|
61
61
|
case "application/gzip":
|
|
62
|
-
case "application/x-tar": return
|
|
62
|
+
case "application/x-tar": return L;
|
|
63
63
|
case "text/csv": return y;
|
|
64
|
-
case "text/plain": return
|
|
64
|
+
case "text/plain": return P;
|
|
65
65
|
case "text/html":
|
|
66
66
|
case "application/xhtml+xml": return S;
|
|
67
67
|
case "text/xml":
|
|
68
|
-
case "application/xml": return
|
|
68
|
+
case "application/xml": return te;
|
|
69
69
|
case "application/sql":
|
|
70
70
|
case "text/x-sql": return j;
|
|
71
71
|
case "text/javascript":
|
|
@@ -73,46 +73,46 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, pe = (e) =
|
|
|
73
73
|
case "text/jsx": return T;
|
|
74
74
|
case "application/typescript":
|
|
75
75
|
case "text/typescript": return N;
|
|
76
|
-
case "text/tsx": return
|
|
76
|
+
case "text/tsx": return ee;
|
|
77
77
|
case "text/css": return v;
|
|
78
78
|
case "text/x-php":
|
|
79
79
|
case "application/x-php": return D;
|
|
80
80
|
case "text/x-rustsrc":
|
|
81
81
|
case "application/x-rust": return A;
|
|
82
|
-
case "text/x-vue": return
|
|
82
|
+
case "text/x-vue": return F;
|
|
83
83
|
default: return h;
|
|
84
84
|
}
|
|
85
|
-
},
|
|
85
|
+
}, ve = (e) => {
|
|
86
86
|
let { type: n, contentType: r } = e;
|
|
87
|
-
return n === t.Prompt ?
|
|
88
|
-
},
|
|
87
|
+
return n === t.Prompt ? H : n === t.Pasted ? f : n === t.Image ? V : _e(r ?? "");
|
|
88
|
+
}, ye = (e) => {
|
|
89
89
|
let t = e.toLowerCase().split(";")[0].trim(), r = n[t];
|
|
90
90
|
if (r) return r;
|
|
91
91
|
let i = t.split("/")[1];
|
|
92
92
|
if (i && !i.startsWith("vnd.") && !i.includes("+")) return i;
|
|
93
|
-
},
|
|
93
|
+
}, be = (e, n) => {
|
|
94
94
|
let { type: r, name: i, contentType: a } = e;
|
|
95
95
|
if (r === t.Prompt) return n.promptLabel ?? "Prompt";
|
|
96
96
|
if (r === t.Pasted) return n.pastedLabel ?? "Pasted";
|
|
97
97
|
if (r === t.Image) return n.imageLabel ?? "Image";
|
|
98
98
|
if (a) {
|
|
99
|
-
let e =
|
|
99
|
+
let e = ye(a);
|
|
100
100
|
if (e) return `.${e}`;
|
|
101
101
|
}
|
|
102
102
|
if (i == null) return "";
|
|
103
103
|
let o = i.lastIndexOf(".");
|
|
104
104
|
return o > 0 && o < i.length - 1 ? `.${i.slice(o + 1).toLowerCase()}` : i;
|
|
105
|
-
},
|
|
105
|
+
}, Y = (e, n = {}) => {
|
|
106
106
|
let { type: i, status: a, previewUrl: o, url: s } = e, c = a === r.Loading, l = a === r.Error, u = i === t.Image && !!(o ?? s) && !l, d = i === t.Link && !l;
|
|
107
107
|
return {
|
|
108
108
|
isLoading: c,
|
|
109
109
|
isError: l,
|
|
110
110
|
isImage: u,
|
|
111
111
|
isLink: d,
|
|
112
|
-
BottomIcon: d ? null :
|
|
113
|
-
typeLabel: d ? null :
|
|
112
|
+
BottomIcon: d ? null : ve(e),
|
|
113
|
+
typeLabel: d ? null : be(e, n)
|
|
114
114
|
};
|
|
115
|
-
},
|
|
115
|
+
}, xe = 5, Se = "flex size-[84px] items-center justify-center rounded-xl border", X = {
|
|
116
116
|
tile: "_tile_1whwz_1",
|
|
117
117
|
hovered: "_hovered_1whwz_5",
|
|
118
118
|
selected: "_selected_1whwz_15",
|
|
@@ -123,137 +123,137 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, pe = (e) =
|
|
|
123
123
|
track: "_track_1whwz_37",
|
|
124
124
|
actionButton: "_actionButton_1whwz_43",
|
|
125
125
|
imageActionButton: "_imageActionButton_1whwz_47"
|
|
126
|
-
},
|
|
126
|
+
}, Z = ({ ariaLabel: e, errorTitle: t, errorDescId: n, onClick: r, id: i, icon: o, className: s }) => /* @__PURE__ */ K(ue, {
|
|
127
127
|
icon: o,
|
|
128
|
-
size:
|
|
129
|
-
className: a("
|
|
128
|
+
size: G.Small,
|
|
129
|
+
className: a("opacity-0 focus-visible:opacity-100 group-focus-within/attachment-tile:opacity-100 group-hover/attachment-tile:opacity-100", X.actionButton, s),
|
|
130
130
|
"aria-label": e,
|
|
131
131
|
"aria-describedby": t ? n : void 0,
|
|
132
132
|
onClick: (e) => {
|
|
133
133
|
e.stopPropagation(), r(i);
|
|
134
134
|
}
|
|
135
|
-
}),
|
|
136
|
-
icon: /* @__PURE__ */
|
|
135
|
+
}), Ce = ({ ...e }) => /* @__PURE__ */ K(Z, {
|
|
136
|
+
icon: /* @__PURE__ */ K(ne, {
|
|
137
137
|
size: U.SM,
|
|
138
138
|
"aria-hidden": !0,
|
|
139
139
|
stroke: W
|
|
140
140
|
}),
|
|
141
|
-
className:
|
|
141
|
+
className: X.retryIcon,
|
|
142
142
|
...e
|
|
143
|
-
}),
|
|
144
|
-
icon: /* @__PURE__ */
|
|
143
|
+
}), we = ({ ...e }) => /* @__PURE__ */ K(Z, {
|
|
144
|
+
icon: /* @__PURE__ */ K(p, {
|
|
145
145
|
size: U.SM,
|
|
146
146
|
"aria-hidden": !0,
|
|
147
147
|
stroke: W
|
|
148
148
|
}),
|
|
149
149
|
...e
|
|
150
|
-
}),
|
|
151
|
-
icon: /* @__PURE__ */
|
|
150
|
+
}), Te = ({ ...e }) => /* @__PURE__ */ K(Z, {
|
|
151
|
+
icon: /* @__PURE__ */ K(m, {
|
|
152
152
|
size: U.SM,
|
|
153
153
|
"aria-hidden": !0,
|
|
154
154
|
stroke: W
|
|
155
155
|
}),
|
|
156
156
|
...e
|
|
157
|
-
}),
|
|
158
|
-
icon: /* @__PURE__ */
|
|
157
|
+
}), Ee = ({ ...e }) => /* @__PURE__ */ K(Z, {
|
|
158
|
+
icon: /* @__PURE__ */ K(ie, {
|
|
159
159
|
size: U.SM,
|
|
160
160
|
"aria-hidden": !0,
|
|
161
161
|
stroke: W
|
|
162
162
|
}),
|
|
163
163
|
...e
|
|
164
|
-
}),
|
|
164
|
+
}), De = {
|
|
165
165
|
[e.Network]: "Upload failed · network error",
|
|
166
166
|
[e.UnsupportedType]: "Upload failed · unsupported file type"
|
|
167
|
-
},
|
|
168
|
-
let { clickLabel: b = "Download attachment", retryLabel: x = "Retry upload",
|
|
169
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), i?.(t.id));
|
|
170
|
-
},
|
|
167
|
+
}, Oe = ({ attachment: t, searchQuery: n = "", onClick: i, onRetry: s, labels: u, styles: d, onDownload: f, isPasted: p, isLink: m, cssVars: h, onExpand: g, isExpandable: _, onRemove: v, isSelected: y }) => {
|
|
168
|
+
let { clickLabel: b = "Download attachment", retryLabel: x = "Retry upload", removeLabel: S = "Remove attachment", openInNewTabLabel: C = "Open in new tab", sizeLabel: w, uploadingLabel: T = "Uploading", errorReasonLabels: E, genericErrorLabel: D = "Upload failed" } = u ?? {}, { typography: O, className: k } = d ?? {}, { id: A, name: j, status: M, errorReason: N } = t, ee = M === r.Loading, P = M === r.Error, F = c(), I = P ? N && (E?.[N] ?? De[N]) || D : "", { BottomIcon: te, typeLabel: L } = Y(t), R = !P && !ee && f && !m, z = P && !!s && N !== e.UnsupportedType, B = Number(!!R) + Number(!!z) + Number(!!m) + Number(!!v), V = B > 1 ? "pe-11" : B === 1 ? "pe-5" : void 0, ne = (e) => {
|
|
169
|
+
e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), i?.(t.id));
|
|
170
|
+
}, H = l(() => p ? j : fe(j), [p, j]), re = o(() => {
|
|
171
171
|
window.open(t.referenceUrl, "_blank", "noopener,noreferrer");
|
|
172
|
-
}, [t]),
|
|
173
|
-
title:
|
|
174
|
-
className: a(
|
|
175
|
-
children: n ? /* @__PURE__ */
|
|
176
|
-
text:
|
|
172
|
+
}, [t]), ie = a(Se, "group/attachment-tile relative flex-col justify-between items-start gap-1 overflow-hidden p-1.5", X.tile, !P && X.hovered, y && X.selected, P && X.tileError), U = /* @__PURE__ */ K("div", {
|
|
173
|
+
title: H,
|
|
174
|
+
className: a(O?.nameClassName ?? "dial-caption-text", "line-clamp-2 min-w-0 break-words", X.nameText, !P && V),
|
|
175
|
+
children: n ? /* @__PURE__ */ K(oe, {
|
|
176
|
+
text: H,
|
|
177
177
|
query: n,
|
|
178
178
|
maxLines: 2
|
|
179
|
-
}) :
|
|
180
|
-
}),
|
|
181
|
-
className: a("flex w-full items-center gap-1",
|
|
182
|
-
children: [/* @__PURE__ */
|
|
179
|
+
}) : H
|
|
180
|
+
}), W = te && /* @__PURE__ */ q("div", {
|
|
181
|
+
className: a("flex w-full items-center gap-1", P && V),
|
|
182
|
+
children: [/* @__PURE__ */ K(te, {
|
|
183
183
|
size: 16,
|
|
184
|
-
className:
|
|
184
|
+
className: X.typeText,
|
|
185
185
|
"aria-hidden": !0
|
|
186
|
-
}), /* @__PURE__ */
|
|
187
|
-
className: a(
|
|
188
|
-
children:
|
|
186
|
+
}), /* @__PURE__ */ K("span", {
|
|
187
|
+
className: a(O?.metaClassName ?? "dial-caption-text", "min-w-0 flex-1 truncate", X.typeText),
|
|
188
|
+
children: w ? `${L} · ${w}` : L
|
|
189
189
|
})]
|
|
190
|
-
}),
|
|
191
|
-
_ && g ? g(
|
|
192
|
-
},
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
"aria-label":
|
|
197
|
-
className: a("absolute left-[-1px] top-[-1px] flex size-full items-center justify-center rounded",
|
|
198
|
-
children: /* @__PURE__ */
|
|
190
|
+
}), G = () => {
|
|
191
|
+
_ && g ? g(A) : i && i(A);
|
|
192
|
+
}, ae = /* @__PURE__ */ q(de, { children: [
|
|
193
|
+
U,
|
|
194
|
+
W,
|
|
195
|
+
ee && /* @__PURE__ */ K("div", {
|
|
196
|
+
"aria-label": T,
|
|
197
|
+
className: a("absolute left-[-1px] top-[-1px] flex size-full items-center justify-center rounded", X.track),
|
|
198
|
+
children: /* @__PURE__ */ K(le, { size: 32 })
|
|
199
199
|
}),
|
|
200
|
-
/* @__PURE__ */
|
|
201
|
-
className:
|
|
200
|
+
/* @__PURE__ */ q("div", {
|
|
201
|
+
className: "absolute end-1 top-1 flex gap-1",
|
|
202
202
|
children: [
|
|
203
|
-
R && /* @__PURE__ */
|
|
203
|
+
R && /* @__PURE__ */ K(we, {
|
|
204
204
|
ariaLabel: b,
|
|
205
|
-
errorTitle:
|
|
206
|
-
errorDescId:
|
|
205
|
+
errorTitle: I,
|
|
206
|
+
errorDescId: F,
|
|
207
207
|
onClick: f,
|
|
208
|
-
id:
|
|
208
|
+
id: A
|
|
209
209
|
}),
|
|
210
|
-
z && /* @__PURE__ */
|
|
210
|
+
z && /* @__PURE__ */ K(Ce, {
|
|
211
211
|
ariaLabel: x,
|
|
212
|
-
errorTitle:
|
|
213
|
-
errorDescId:
|
|
212
|
+
errorTitle: I,
|
|
213
|
+
errorDescId: F,
|
|
214
214
|
onClick: s,
|
|
215
|
-
id:
|
|
215
|
+
id: A
|
|
216
216
|
}),
|
|
217
|
-
m && /* @__PURE__ */
|
|
218
|
-
ariaLabel:
|
|
219
|
-
errorTitle:
|
|
220
|
-
errorDescId:
|
|
221
|
-
onClick:
|
|
217
|
+
m && /* @__PURE__ */ K(Te, {
|
|
218
|
+
ariaLabel: C,
|
|
219
|
+
errorTitle: I,
|
|
220
|
+
errorDescId: F,
|
|
221
|
+
onClick: re
|
|
222
222
|
}),
|
|
223
|
-
v && /* @__PURE__ */
|
|
224
|
-
ariaLabel:
|
|
225
|
-
errorTitle:
|
|
226
|
-
errorDescId:
|
|
223
|
+
v && /* @__PURE__ */ K(Ee, {
|
|
224
|
+
ariaLabel: S,
|
|
225
|
+
errorTitle: I,
|
|
226
|
+
errorDescId: F,
|
|
227
227
|
onClick: v,
|
|
228
|
-
id:
|
|
228
|
+
id: A
|
|
229
229
|
})
|
|
230
230
|
]
|
|
231
231
|
}),
|
|
232
|
-
|
|
233
|
-
id:
|
|
232
|
+
P && /* @__PURE__ */ K("span", {
|
|
233
|
+
id: F,
|
|
234
234
|
role: "status",
|
|
235
235
|
"aria-live": "polite",
|
|
236
236
|
className: "sr-only",
|
|
237
|
-
children:
|
|
237
|
+
children: I
|
|
238
238
|
})
|
|
239
239
|
] });
|
|
240
|
-
return /* @__PURE__ */
|
|
240
|
+
return /* @__PURE__ */ K("div", {
|
|
241
241
|
style: h,
|
|
242
|
-
className: a("inline-flex",
|
|
243
|
-
children: /* @__PURE__ */
|
|
242
|
+
className: a("inline-flex", k),
|
|
243
|
+
children: /* @__PURE__ */ K("div", {
|
|
244
244
|
role: "button",
|
|
245
245
|
tabIndex: 0,
|
|
246
246
|
"aria-label": b,
|
|
247
|
-
onClick:
|
|
248
|
-
onKeyDown:
|
|
247
|
+
onClick: G,
|
|
248
|
+
onKeyDown: ne,
|
|
249
249
|
style: h,
|
|
250
|
-
className: a(
|
|
251
|
-
children:
|
|
250
|
+
className: a(ie, "cursor-pointer focus-within:outline focus-within:outline-1 focus-within:outline-offset-1"),
|
|
251
|
+
children: ae
|
|
252
252
|
})
|
|
253
253
|
});
|
|
254
|
-
},
|
|
254
|
+
}, Q = /* @__PURE__ */ function(e) {
|
|
255
255
|
return e.Idle = "idle", e.Loading = "loading", e.Loaded = "loaded", e.Error = "error", e;
|
|
256
|
-
}({}),
|
|
256
|
+
}({}), ke = ({ enabled: e, src: t }) => {
|
|
257
257
|
let n = u(null), [r, i] = d("idle");
|
|
258
258
|
return s(() => {
|
|
259
259
|
i(e && t ? "loading" : "idle");
|
|
@@ -268,61 +268,65 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, pe = (e) =
|
|
|
268
268
|
imageRef: n,
|
|
269
269
|
imageLoadStatus: r
|
|
270
270
|
};
|
|
271
|
-
},
|
|
272
|
-
let { clickLabel: f = "Open attachment", expandLabel: p = "Expand pasted text" } = i ?? {}, { className:
|
|
273
|
-
enabled:
|
|
274
|
-
src:
|
|
275
|
-
}),
|
|
276
|
-
|
|
271
|
+
}, Ae = ({ attachment: e, onExpand: n, onClick: r, labels: i, onRemove: o, cssVars: s, onDownload: c, styles: u, isSelected: d }) => {
|
|
272
|
+
let { clickLabel: f = "Open attachment", expandLabel: p = "Expand pasted text", removeLabel: m = "Remove attachment", downloadLabel: h = "Download attachment" } = i ?? {}, { className: g } = u ?? {}, { id: _, name: v } = e, y = e.previewUrl ?? e.url, b = e.type === t.Pasted && n !== void 0, { isLoading: x, isError: S, isImage: C } = l(() => Y(e), [e]), w = r !== void 0 && !b && !x && !S, { imageRef: T, imageLoadStatus: E } = ke({
|
|
273
|
+
enabled: C,
|
|
274
|
+
src: y
|
|
275
|
+
}), D = () => {
|
|
276
|
+
b && n ? n(_) : w && r && r(_);
|
|
277
277
|
};
|
|
278
|
-
return /* @__PURE__ */
|
|
279
|
-
className: a(
|
|
280
|
-
onClick:
|
|
278
|
+
return /* @__PURE__ */ K("div", {
|
|
279
|
+
className: a(Se, "group/attachment-tile", w && "cursor-pointer", X.tile, d && X.selected, g),
|
|
280
|
+
onClick: D,
|
|
281
281
|
onKeyDown: (e) => {
|
|
282
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(),
|
|
282
|
+
e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), D());
|
|
283
283
|
},
|
|
284
284
|
tabIndex: 0,
|
|
285
285
|
role: "button",
|
|
286
286
|
style: s,
|
|
287
|
-
"aria-label":
|
|
288
|
-
children: /* @__PURE__ */
|
|
287
|
+
"aria-label": w ? f : b ? p : void 0,
|
|
288
|
+
children: /* @__PURE__ */ q("div", {
|
|
289
289
|
className: "relative h-full w-full overflow-hidden",
|
|
290
290
|
children: [
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
291
|
+
/* @__PURE__ */ q("div", {
|
|
292
|
+
className: "absolute end-1 top-1 z-10 flex gap-1",
|
|
293
|
+
children: [o && /* @__PURE__ */ K(Ee, {
|
|
294
|
+
ariaLabel: m,
|
|
295
|
+
onClick: o,
|
|
296
|
+
id: _,
|
|
297
|
+
className: X.imageActionButton
|
|
298
|
+
}), c && /* @__PURE__ */ K(we, {
|
|
299
|
+
ariaLabel: h,
|
|
300
|
+
onClick: c,
|
|
301
|
+
id: _,
|
|
302
|
+
className: X.imageActionButton
|
|
303
|
+
})]
|
|
300
304
|
}),
|
|
301
|
-
|
|
302
|
-
variant:
|
|
305
|
+
E !== Q.Loaded && /* @__PURE__ */ K(se, {
|
|
306
|
+
variant: ce.Rectangular,
|
|
303
307
|
width: "100%",
|
|
304
308
|
height: "100%",
|
|
305
|
-
active:
|
|
306
|
-
overlay: /* @__PURE__ */
|
|
309
|
+
active: E === Q.Loading,
|
|
310
|
+
overlay: /* @__PURE__ */ K(V, {
|
|
307
311
|
size: U.LG,
|
|
308
|
-
className:
|
|
312
|
+
className: X.typeText,
|
|
309
313
|
"aria-hidden": !0,
|
|
310
314
|
stroke: W
|
|
311
315
|
}),
|
|
312
316
|
className: "absolute inset-0 rounded-xl"
|
|
313
317
|
}),
|
|
314
|
-
/* @__PURE__ */
|
|
315
|
-
ref:
|
|
316
|
-
src:
|
|
317
|
-
alt:
|
|
318
|
+
/* @__PURE__ */ K("img", {
|
|
319
|
+
ref: T,
|
|
320
|
+
src: y,
|
|
321
|
+
alt: v,
|
|
318
322
|
loading: "lazy",
|
|
319
323
|
decoding: "async",
|
|
320
|
-
className: a("h-full w-full rounded-xl object-cover transition-opacity duration-200",
|
|
324
|
+
className: a("h-full w-full rounded-xl object-cover transition-opacity duration-200", E === Q.Loaded ? "opacity-100" : "opacity-0")
|
|
321
325
|
})
|
|
322
326
|
]
|
|
323
327
|
})
|
|
324
328
|
});
|
|
325
|
-
},
|
|
329
|
+
}, $ = ({ attachment: e, searchQuery: n = "", onRemove: r, onRetry: a, onExpand: o, onClick: s, onDownload: c, labels: u, styles: d, isSelected: f }) => {
|
|
326
330
|
let { colors: p } = d ?? {}, m = e.type === t.Pasted, h = m && o !== void 0, g = i({
|
|
327
331
|
"--ai-tile-bg": p?.background,
|
|
328
332
|
"--ai-tile-border": p?.border,
|
|
@@ -339,8 +343,8 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, pe = (e) =
|
|
|
339
343
|
"--ai-tile-hover-icon-bg": p?.hoverIconBackground,
|
|
340
344
|
"--ai-tile-hover-icon-color": p?.hoverIconColor,
|
|
341
345
|
"--ai-tile-progress-track": p?.trackBackground
|
|
342
|
-
}), { isImage: _, isLink: v } = l(() =>
|
|
343
|
-
return _ ? /* @__PURE__ */
|
|
346
|
+
}), { isImage: _, isLink: v } = l(() => Y(e), [e]);
|
|
347
|
+
return _ ? /* @__PURE__ */ K(Ae, {
|
|
344
348
|
attachment: e,
|
|
345
349
|
labels: u,
|
|
346
350
|
onClick: s,
|
|
@@ -350,7 +354,7 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, pe = (e) =
|
|
|
350
354
|
cssVars: g,
|
|
351
355
|
onDownload: c,
|
|
352
356
|
isSelected: f
|
|
353
|
-
}) : /* @__PURE__ */
|
|
357
|
+
}) : /* @__PURE__ */ K(Oe, {
|
|
354
358
|
attachment: e,
|
|
355
359
|
searchQuery: n,
|
|
356
360
|
onClick: s,
|
|
@@ -366,15 +370,15 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, pe = (e) =
|
|
|
366
370
|
isExpandable: h,
|
|
367
371
|
isSelected: f
|
|
368
372
|
});
|
|
369
|
-
},
|
|
373
|
+
}, je = ({ attachments: e, onRemove: t, onRetry: n, onExpand: r, onAttachmentClick: i, labels: o, styles: s }) => {
|
|
370
374
|
let { ariaLabel: c = "Attached files", removeLabel: l, retryLabel: u, clickLabel: d } = o ?? {}, { className: f } = s ?? {};
|
|
371
|
-
return e.length === 0 ? null : /* @__PURE__ */
|
|
375
|
+
return e.length === 0 ? null : /* @__PURE__ */ K("div", {
|
|
372
376
|
role: "list",
|
|
373
377
|
"aria-label": c,
|
|
374
378
|
className: a("flex w-full min-w-0 gap-2 overflow-x-auto", f),
|
|
375
|
-
children: e.map((e) => /* @__PURE__ */
|
|
379
|
+
children: e.map((e) => /* @__PURE__ */ K("div", {
|
|
376
380
|
role: "listitem",
|
|
377
|
-
children: /* @__PURE__ */
|
|
381
|
+
children: /* @__PURE__ */ K($, {
|
|
378
382
|
attachment: e,
|
|
379
383
|
onRemove: t,
|
|
380
384
|
onRetry: n,
|
|
@@ -388,53 +392,53 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, pe = (e) =
|
|
|
388
392
|
})
|
|
389
393
|
}, e.id))
|
|
390
394
|
});
|
|
391
|
-
},
|
|
395
|
+
}, Me = {
|
|
392
396
|
headerIcon: "_headerIcon_1dmgi_1",
|
|
393
397
|
headerLabel: "_headerLabel_1dmgi_2"
|
|
394
398
|
}, Ne = (e, t) => `${e} ${t}${e === 1 ? "" : "s"}`, Pe = ({ attachments: e, onAttachmentClick: n, onDownloadAll: o, onRetry: s, labels: c, styles: l, selectedAttachmentId: u }) => {
|
|
395
399
|
let { ariaLabel: d = "Attachments", clickLabel: f = "Download attachment", retryLabel: m = "Retry upload", downloadAllLabel: g = "Download all", openInNewTabLabel: _, getHeaderLabel: v = (e) => Ne(e, "attachment"), promptLabel: y, pastedLabel: b, imageLabel: x } = c ?? {}, { typography: S, colors: C, className: w } = l ?? {}, T = i({ "--ai-group-text": C?.text });
|
|
396
400
|
if (e.length === 0) return null;
|
|
397
|
-
let E = e.some((e) => e.type === t.Image), D = e.some((e) => e.type !== t.Image), O = E && D, k = e.length >= 5, A = O ?
|
|
401
|
+
let E = e.some((e) => e.type === t.Image), D = e.some((e) => e.type !== t.Image), O = E && D, k = e.length >= 5, A = O ? B : E ? V : h, j = v(e.length), M = () => {
|
|
398
402
|
let t = e.filter((e) => e.status === r.Idle);
|
|
399
403
|
o ? o(t) : t.forEach((e) => n?.(e.id));
|
|
400
404
|
}, N = (t) => {
|
|
401
405
|
let n = e.find((e) => e.id === t);
|
|
402
406
|
n && o?.([n]);
|
|
403
407
|
};
|
|
404
|
-
return /* @__PURE__ */
|
|
408
|
+
return /* @__PURE__ */ q("div", {
|
|
405
409
|
role: "group",
|
|
406
410
|
"aria-label": d,
|
|
407
411
|
style: T,
|
|
408
|
-
className: a("flex flex-col gap-1", k ? "w-full min-w-0 max-w-[492px]" : "max-w-[420px]",
|
|
409
|
-
children: [/* @__PURE__ */
|
|
412
|
+
className: a("flex flex-col gap-1", k ? "w-full min-w-0 max-w-[492px]" : "max-w-[420px]", Me.container, w),
|
|
413
|
+
children: [/* @__PURE__ */ q("div", {
|
|
410
414
|
className: "flex items-center justify-between",
|
|
411
|
-
children: [/* @__PURE__ */
|
|
415
|
+
children: [/* @__PURE__ */ q("div", {
|
|
412
416
|
className: "flex items-center gap-1",
|
|
413
|
-
children: [/* @__PURE__ */
|
|
417
|
+
children: [/* @__PURE__ */ K(A, {
|
|
414
418
|
size: U.SM,
|
|
415
|
-
className: a("shrink-0",
|
|
419
|
+
className: a("shrink-0", Me.headerIcon),
|
|
416
420
|
"aria-hidden": !0
|
|
417
|
-
}), /* @__PURE__ */
|
|
418
|
-
className: a(S?.headerLabelClassName ?? "dial-tiny-semi-text",
|
|
421
|
+
}), /* @__PURE__ */ K("span", {
|
|
422
|
+
className: a(S?.headerLabelClassName ?? "dial-tiny-semi-text", Me.headerLabel),
|
|
419
423
|
children: j
|
|
420
424
|
})]
|
|
421
|
-
}), e.length >= 2 && (o || n) && /* @__PURE__ */
|
|
422
|
-
icon: /* @__PURE__ */
|
|
425
|
+
}), e.length >= 2 && (o || n) && /* @__PURE__ */ K(ae, {
|
|
426
|
+
icon: /* @__PURE__ */ K(p, {
|
|
423
427
|
size: U.SM,
|
|
424
428
|
"aria-hidden": !0,
|
|
425
429
|
stroke: W
|
|
426
430
|
}),
|
|
427
|
-
size:
|
|
431
|
+
size: G.Small,
|
|
428
432
|
"aria-label": g,
|
|
429
433
|
onClick: M
|
|
430
434
|
})]
|
|
431
|
-
}), /* @__PURE__ */
|
|
435
|
+
}), /* @__PURE__ */ K("div", {
|
|
432
436
|
role: "list",
|
|
433
437
|
"aria-label": j,
|
|
434
438
|
className: a("gap-3", k ? "grid grid-cols-[repeat(5,83px)]" : "flex flex-wrap"),
|
|
435
|
-
children: e.map((e, t) => /* @__PURE__ */
|
|
439
|
+
children: e.map((e, t) => /* @__PURE__ */ K("div", {
|
|
436
440
|
role: "listitem",
|
|
437
|
-
children: /* @__PURE__ */
|
|
441
|
+
children: /* @__PURE__ */ K($, {
|
|
438
442
|
attachment: e,
|
|
439
443
|
onClick: n,
|
|
440
444
|
onDownload: N,
|
|
@@ -465,27 +469,27 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, pe = (e) =
|
|
|
465
469
|
"--ai-fd-denied-icon": c?.deniedIcon
|
|
466
470
|
}), d = o ?? (t ? "Attach files" : "No attachments allowed"), f = s ?? (t ? "Drop files here to attach them to message" : "Attachments can't be added to message"), p = t ? Fe.icon : Fe.deniedIcon, m = (e) => {
|
|
467
471
|
e.preventDefault();
|
|
468
|
-
}, h = t ? g :
|
|
469
|
-
return /* @__PURE__ */
|
|
472
|
+
}, h = t ? g : R;
|
|
473
|
+
return /* @__PURE__ */ K("div", {
|
|
470
474
|
role: "status",
|
|
471
475
|
"aria-live": "polite",
|
|
472
476
|
className: a("fixed inset-0 z-[9999] flex items-center justify-center backdrop-blur-sm", Fe.overlay, t ? "pointer-events-none" : "pointer-events-auto cursor-not-allowed"),
|
|
473
477
|
onDragOver: t ? void 0 : m,
|
|
474
478
|
onDrop: t ? void 0 : m,
|
|
475
479
|
style: u,
|
|
476
|
-
children: /* @__PURE__ */
|
|
480
|
+
children: /* @__PURE__ */ q("div", {
|
|
477
481
|
className: "flex flex-col items-center text-center",
|
|
478
482
|
children: [
|
|
479
|
-
/* @__PURE__ */
|
|
483
|
+
/* @__PURE__ */ K(h, {
|
|
480
484
|
size: 100,
|
|
481
485
|
className: p,
|
|
482
486
|
"aria-hidden": !0
|
|
483
487
|
}),
|
|
484
|
-
/* @__PURE__ */
|
|
488
|
+
/* @__PURE__ */ K("span", {
|
|
485
489
|
className: a("mt-5", l?.titleClassName ?? "dial-h3-text"),
|
|
486
490
|
children: d
|
|
487
491
|
}),
|
|
488
|
-
/* @__PURE__ */
|
|
492
|
+
/* @__PURE__ */ K("span", {
|
|
489
493
|
className: a("mt-4", l?.subtitleClassName ?? "dial-small-text"),
|
|
490
494
|
children: f
|
|
491
495
|
})
|
|
@@ -503,7 +507,7 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, pe = (e) =
|
|
|
503
507
|
let i = e.getAsFile();
|
|
504
508
|
if (!i) continue;
|
|
505
509
|
let o = new File([i], a, { type: i.type }), s = {
|
|
506
|
-
id:
|
|
510
|
+
id: J(),
|
|
507
511
|
name: a,
|
|
508
512
|
contentType: i.type,
|
|
509
513
|
file: o,
|
|
@@ -519,7 +523,7 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, pe = (e) =
|
|
|
519
523
|
let l = i.clipboardData.getData("text/plain");
|
|
520
524
|
if (l.length > n) {
|
|
521
525
|
let n = l.trim(), a = (n.length > 80 ? `${n.slice(0, 80).trimEnd()}…` : n) || s, o = new File([l], a, { type: "text/plain" }), c = {
|
|
522
|
-
id:
|
|
526
|
+
id: J(),
|
|
523
527
|
name: a,
|
|
524
528
|
contentType: "text/plain",
|
|
525
529
|
file: o,
|
|
@@ -536,4 +540,4 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, pe = (e) =
|
|
|
536
540
|
]) };
|
|
537
541
|
}, Re = 100;
|
|
538
542
|
//#endregion
|
|
539
|
-
export {
|
|
543
|
+
export { xe as ATTACHMENT_COLLAPSE_THRESHOLD, $ as AttachmentCard, Pe as AttachmentGroup, je as AttachmentTray, Ie as FileDndOverlay, Q as LazyImageLoadStatus, Re as MAX_UPLOADS_PER_MINUTE, J as generateAttachmentId, Y as getAttachmentCardState, _e as getAttachmentIcon, ye as getExtFromContentType, fe as getNameWithoutExtension, ge as isMimeTypeAllowed, he as mimeTypesToExtensionLabels, Le as useClipboardPaste, ke as useLazyImageLoad };
|
|
@@ -7,6 +7,10 @@ export interface FileAttachmentLabels extends AttachmentTypeLabels {
|
|
|
7
7
|
clickLabel?: string;
|
|
8
8
|
/** Accessible label for the retry action. Defaults to `'Retry upload'`. */
|
|
9
9
|
retryLabel?: string;
|
|
10
|
+
/** Accessible label for the remove action. Defaults to `'Remove attachment'`. */
|
|
11
|
+
removeLabel?: string;
|
|
12
|
+
/** Accessible label for the open-in-new-tab action on link attachments. Defaults to `'Open in new tab'`. */
|
|
13
|
+
openInNewTabLabel?: string;
|
|
10
14
|
/** Human-readable size text (e.g. `'2.4 MB'`), appended after the type label in the meta line (`'.pdf · 2.4 MB'`) when derivable; omitted from the meta line if absent. */
|
|
11
15
|
sizeLabel?: string;
|
|
12
16
|
/** Accessible label for the in-progress upload progress bar. Defaults to `'Uploading'`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachment-file-row.d.ts","sourceRoot":"","sources":["../../src/models/attachment-file-row.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,iBAAiB,EAClB,MAAM,2BAA2B,CAAC;AACnC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AC,EAAE,OAAO,CAAC;IACvB,uHAAuH;IACvH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epam/ai-dial-attachment-input",
|
|
3
3
|
"description": "File attachment input components with upload validation, drag-and-drop, and progress tracking",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.12",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
|
-
"@epam/ai-dial-chat-shared": "1.0.
|
|
20
|
+
"@epam/ai-dial-chat-shared": "1.0.12",
|
|
21
21
|
"@tabler/icons-react": "^3.44.0",
|
|
22
22
|
"react": "^19.0.0",
|
|
23
23
|
"@epam/ai-dial-ui-kit": "^0.14.0-dev.15"
|