@epam/ai-dial-attachment-input 1.3.0-dev.246 → 1.3.0-dev.248
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"File.d.ts","sourceRoot":"","sources":["../../../../src/components/AttachmentCard/Attachments/File.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"File.d.ts","sourceRoot":"","sources":["../../../../src/components/AttachmentCard/Attachments/File.tsx"],"names":[],"mappings":"AAeA,OAAO,EACL,KAAK,EAAE,EAMR,MAAM,OAAO,CAAC;AAMf,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAsB/E,2HAA2H;AAC3H,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAmRlD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileDndOverlay.d.ts","sourceRoot":"","sources":["../../../src/components/FileDndOverlay/FileDndOverlay.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FileDndOverlay.d.ts","sourceRoot":"","sources":["../../../src/components/FileDndOverlay/FileDndOverlay.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAa,EAAE,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAGzE,uGAAuG;AACvG,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAuFlD,CAAC"}
|
package/index.css
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
._tile_23kve_12{box-sizing:border-box;background:var(--ai-tile-bg,var(--bg-layer-raised,#fcfcfc));border-style:solid;border-color:var(--ai-tile-border,var(--stroke-secondary,#d1dbea))}._tile_23kve_12._hovered_23kve_18:hover{background:var(--ai-tile-bg-hover,var(--bg-control-neutral-hover-muted,#e0e6f0));border-color:var(--ai-tile-border-hover,var(--ai-tile-border,var(--stroke-secondary,#d1dbea)))}._tile_23kve_12{outline-color:var(--ai-tile-focus-outline,var(--stroke-focus,#161b2d))}._selected_23kve_28{background:var(--ai-tile-bg-selected,var(--bg-control-accent-alpha,#2764d90f));border-color:var(--ai-tile-border-selected,var(--stroke-accent-alpha,#2764d933))}._tileError_23kve_33{background:var(--ai-tile-bg-error,var(--bg-error,#f3d6d8));border-color:var(--ai-tile-border-error,var(--stroke-error,#ae2f2f))}._nameText_23kve_38{color:var(--ai-tile-name-text,var(--text-primary,#161b2d))}._typeText_23kve_42{color:var(--ai-tile-type-text,var(--text-primary,#161b2d))}._placeholderIcon_23kve_46{color:var(--ai-tile-placeholder-icon,var(--text-secondary,#57647a))}._retryIcon_23kve_50{color:var(--ai-tile-error-text,var(--text-error,#ae2f2f))}._track_23kve_54{background:var(--ai-tile-progress-track,var(--bg-backdrop,#161b2d4d))}._tile_23kve_12 ._actionButton_23kve_65{background:var(--ai-tile-hover-icon-bg,var(--ai-tile-bg,var(--bg-layer-raised,#fcfcfc)))}._tile_23kve_12._hovered_23kve_18:hover ._actionButton_23kve_65{background:var(--ai-tile-hover-icon-bg,var(--ai-tile-bg-hover,var(--bg-control-neutral-hover-muted,#e0e6f0)))}._tile_23kve_12._selected_23kve_28 ._actionButton_23kve_65{background:var(--ai-tile-hover-icon-bg,linear-gradient(var(--ai-tile-bg-selected,var(--bg-control-accent-alpha,#2764d90f)), var(--ai-tile-bg-selected,var(--bg-control-accent-alpha,#2764d90f))), var(--ai-tile-bg,var(--bg-layer-raised,#fcfcfc)))}._tile_23kve_12._tileError_23kve_33 ._actionButton_23kve_65{background:var(--ai-tile-bg-error,var(--bg-error,#f3d6d8));color:var(--ai-tile-error-text,var(--text-error,#ae2f2f))}._tile_23kve_12._loading_23kve_86 ._actionButton_23kve_65,._tile_23kve_12 ._imageActionButton_23kve_87,._tile_23kve_12._selected_23kve_28 ._imageActionButton_23kve_87{background:var(--ai-tile-hover-icon-bg,var(--bg-layer-base,#f5f7fa));color:var(--ai-tile-hover-icon-color,var(--text-secondary,#57647a))}._tile_23kve_12._proxyFocus_23kve_96:has(:focus-visible){outline-width:1px;outline-style:solid}._tile_23kve_12._proxyFocus_23kve_96 ._actionButton_23kve_65:focus-visible{outline:none}._loading_23kve_86{cursor:progress}._headerIcon_1dmgi_1,._headerLabel_1dmgi_2{color:var(--ai-group-text,var(--text-secondary,#57647a))}._overlay_mzpdp_1{background:var(--ai-fd-bg,var(--bg-backdrop,#161b2d4d))}._icon_mzpdp_5{color:var(--ai-fd-icon,var(--text-accent,#1d4ed8))}._deniedIcon_mzpdp_9{color:var(--ai-fd-denied-icon,var(--text-error,#ae2f2f))}
|
|
2
2
|
/*$vite$:1*//*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
3
|
-
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}}.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.
|
|
3
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}}.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:0}.inset-e-1{inset-inline-end:.25rem}.top-1{top:.25rem}.z-10{z-index:10}.z-\[9999\]{z-index:9999}.-m-0\.5{margin:-.125rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.box-border{box-sizing:border-box}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.flex{display:flex}.grid{display:grid}.inline-flex{display:inline-flex}.size-\[100px\]{width:100px;height:100px}.h-full{height:100%}.w-full{width:100%}.max-w-\[424px\]{max-width:424px}.max-w-\[532px\]{max-width:532px}.min-w-0{min-width:0}.flex-1{flex:1}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.grid-cols-\[repeat\(5\,100px\)\]{grid-template-columns:repeat(5,100px)}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.rounded-\[11px\]{border-radius:11px}.rounded-xl{border-radius:.75rem}.border{border-style:var(--tw-border-style);border-width:1px}.object-cover{object-fit:cover}.p-0\.5{padding:.125rem}.p-3{padding:.75rem}.text-center{text-align:center}.break-words{overflow-wrap:break-word}.opacity-0{opacity:0}.opacity-100{opacity:1}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.outline-1{outline-style:var(--tw-outline-style);outline-width:1px}.outline-offset-1{outline-offset:1px}.backdrop-blur-sm{--tw-backdrop-blur:blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,cubic-bezier(.4, 0, .2, 1));transition-duration:var(--tw-duration,.15s)}.duration-200{--tw-duration:.2s;transition-duration:.2s}@media (hover:hover){.group-hover\/attachment-tile\:opacity-100:is(:where(.group\/attachment-tile):hover *){opacity:1}}.group-focus-visible\/attachment-tile\:opacity-100:is(:where(.group\/attachment-tile):focus-visible *),.group-has-\[\:focus-visible\]\/attachment-tile\:opacity-100:is(:where(.group\/attachment-tile):has(:focus-visible) *){opacity:1}.focus-visible\:outline-1:focus-visible{outline-style:var(--tw-outline-style);outline-width:1px}@media (max-width:1279px){.mobile\:opacity-100{opacity:1}}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}
|
package/index.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import { AttachmentErrorReason as e, AttachmentType as t, MIME_TYPE_EXT_MAP as n, RequestStatus as r, buildCssVars as i, getBaseMimeType as a, mergeClasses as o, normalizeMimeType as s } from "@epam/ai-dial-chat-shared";
|
|
2
2
|
import { useCallback as c, useEffect as l, useId as u, useMemo as d, useRef as f, useState as p } from "react";
|
|
3
3
|
import { IconClipboard as m, IconDownload as h, IconExternalLink as g, IconFile as _, IconFileDescription as v, IconFileTypeBmp as y, IconFileTypeCss as b, IconFileTypeCsv as x, IconFileTypeDoc as S, IconFileTypeDocx as C, IconFileTypeHtml as w, IconFileTypeJpg as T, IconFileTypeJs as E, IconFileTypeJsx as D, IconFileTypePdf as O, IconFileTypePhp as k, IconFileTypePng as A, IconFileTypePpt as j, IconFileTypeRs as M, IconFileTypeSql as N, IconFileTypeSvg as P, IconFileTypeTs as F, IconFileTypeTsx as I, IconFileTypeTxt as L, IconFileTypeVue as R, IconFileTypeXls as z, IconFileTypeXml as ee, IconFileTypeZip as te, IconFileX as ne, IconMusic as re, IconPaperclip as B, IconPhoto as V, IconReload as ie, IconTerminal2 as ae, IconVideo as oe, IconX as se } from "@tabler/icons-react";
|
|
4
|
-
import { DIAL_ICON_SIZE as H, DIAL_KIT_ICON_STROKE as U, DialItemType as ce, ElementSize as W, FileIcon as le, GhostIconButton as ue, Highlight as de,
|
|
5
|
-
import { Fragment as
|
|
4
|
+
import { DIAL_ICON_SIZE as H, DIAL_KIT_ICON_STROKE as U, DialItemType as ce, ElementSize as W, FileIcon as le, GhostIconButton as ue, Highlight as de, LiveRegion as fe, LiveRegionElement as pe, Skeleton as me, SkeletonVariant as he, Spinner as ge, StaticIconButton as _e } from "@epam/ai-dial-ui-kit";
|
|
5
|
+
import { Fragment as ve, jsx as G, jsxs as K } from "react/jsx-runtime";
|
|
6
6
|
//#region src/utils/attachment.ts
|
|
7
|
-
var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`,
|
|
7
|
+
var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, ye = (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
|
+
}, be = {
|
|
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
|
+
}, xe = { "image/jpeg": "JPEG" }, Se = (e, t = be) => e.map((e) => {
|
|
18
18
|
let r = a(e);
|
|
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 = s(r), o =
|
|
23
|
+
let i = s(r), o = xe[i];
|
|
24
24
|
if (o) return o;
|
|
25
25
|
let c = n[i];
|
|
26
26
|
if (c) return c.toUpperCase();
|
|
27
27
|
let l = i.split("/")[1];
|
|
28
28
|
return l == null ? e.toUpperCase() : l.toUpperCase();
|
|
29
|
-
}).join(", "),
|
|
29
|
+
}).join(", "), Ce = (e, t) => {
|
|
30
30
|
if (t.length === 0) return !1;
|
|
31
31
|
let n = a(e), r = s(n);
|
|
32
32
|
return t.some((e) => {
|
|
@@ -38,7 +38,7 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, _e = (e) =
|
|
|
38
38
|
}
|
|
39
39
|
return r === s(t);
|
|
40
40
|
});
|
|
41
|
-
},
|
|
41
|
+
}, we = (e) => {
|
|
42
42
|
if (!e) return _;
|
|
43
43
|
let t = s(e);
|
|
44
44
|
if (t.startsWith("image/")) switch (t) {
|
|
@@ -79,29 +79,29 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, _e = (e) =
|
|
|
79
79
|
case "text/x-vue": return R;
|
|
80
80
|
default: return _;
|
|
81
81
|
}
|
|
82
|
-
},
|
|
82
|
+
}, Te = (e) => {
|
|
83
83
|
let { type: n, contentType: r } = e;
|
|
84
|
-
return n === t.Prompt ? ae : n === t.Pasted ? m : n === t.Image ? V :
|
|
85
|
-
},
|
|
84
|
+
return n === t.Prompt ? ae : n === t.Pasted ? m : n === t.Image ? V : we(r ?? "");
|
|
85
|
+
}, Ee = (e) => {
|
|
86
86
|
let t = s(e), r = n[t];
|
|
87
87
|
if (r) return r;
|
|
88
88
|
let i = t.split("/")[1];
|
|
89
89
|
if (i && !i.startsWith("vnd.") && !i.includes("+")) return i;
|
|
90
|
-
},
|
|
90
|
+
}, De = (e) => {
|
|
91
91
|
let { name: t, contentType: n } = e;
|
|
92
92
|
if (n) {
|
|
93
|
-
let e =
|
|
93
|
+
let e = Ee(n);
|
|
94
94
|
if (e) return e;
|
|
95
95
|
}
|
|
96
96
|
if (t == null) return;
|
|
97
97
|
let r = t.lastIndexOf(".");
|
|
98
98
|
if (r > 0 && r < t.length - 1) return t.slice(r + 1).toLowerCase();
|
|
99
|
-
},
|
|
99
|
+
}, Oe = (e) => e.type !== t.Prompt && e.type !== t.Pasted, ke = (e, n) => {
|
|
100
100
|
let { type: r, name: i } = e;
|
|
101
101
|
if (r === t.Prompt) return n.promptLabel ?? "Prompt";
|
|
102
102
|
if (r === t.Pasted) return n.pastedLabel ?? "Pasted";
|
|
103
103
|
if (r === t.Image) return n.imageLabel ?? "Image";
|
|
104
|
-
let a =
|
|
104
|
+
let a = De(e);
|
|
105
105
|
return a ? `.${a}` : i ?? "";
|
|
106
106
|
}, J = (e, n = {}) => {
|
|
107
107
|
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;
|
|
@@ -110,10 +110,10 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, _e = (e) =
|
|
|
110
110
|
isError: l,
|
|
111
111
|
isImage: u,
|
|
112
112
|
isLink: d,
|
|
113
|
-
BottomIcon: d ? null :
|
|
114
|
-
typeLabel: d ? null :
|
|
113
|
+
BottomIcon: d ? null : Te(e),
|
|
114
|
+
typeLabel: d ? null : ke(e, n)
|
|
115
115
|
};
|
|
116
|
-
},
|
|
116
|
+
}, Ae = 5, je = "flex size-[100px] items-center justify-center rounded-xl border", Me = "outline-offset-1 focus-visible:outline-1", Y = {
|
|
117
117
|
tray: "dial-ai-attachment-tray",
|
|
118
118
|
trayItem: "dial-ai-attachment-tray-item",
|
|
119
119
|
tile: "dial-ai-attachment-tile",
|
|
@@ -135,7 +135,7 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, _e = (e) =
|
|
|
135
135
|
loading: "_loading_23kve_86",
|
|
136
136
|
imageActionButton: "_imageActionButton_23kve_87",
|
|
137
137
|
proxyFocus: "_proxyFocus_23kve_96"
|
|
138
|
-
}, Z = ({ ariaLabel: e, errorTitle: t, errorDescId: n, onClick: r, id: i, icon: a, className: s, isAlwaysVisible: c }) => /* @__PURE__ */ G(
|
|
138
|
+
}, Z = ({ ariaLabel: e, errorTitle: t, errorDescId: n, onClick: r, id: i, icon: a, className: s, isAlwaysVisible: c }) => /* @__PURE__ */ G(_e, {
|
|
139
139
|
icon: a,
|
|
140
140
|
size: W.Small,
|
|
141
141
|
className: o(c ? "opacity-100" : "opacity-0 group-hover/attachment-tile:opacity-100 group-focus-visible/attachment-tile:opacity-100 group-has-[:focus-visible]/attachment-tile:opacity-100", X.actionButton, s, Y.tileAction),
|
|
@@ -144,7 +144,7 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, _e = (e) =
|
|
|
144
144
|
onClick: (e) => {
|
|
145
145
|
e.stopPropagation(), r(i);
|
|
146
146
|
}
|
|
147
|
-
}),
|
|
147
|
+
}), Ne = ({ ...e }) => /* @__PURE__ */ G(Z, {
|
|
148
148
|
icon: /* @__PURE__ */ G(ie, {
|
|
149
149
|
size: H.SM,
|
|
150
150
|
"aria-hidden": !0,
|
|
@@ -152,21 +152,21 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, _e = (e) =
|
|
|
152
152
|
}),
|
|
153
153
|
className: X.retryIcon,
|
|
154
154
|
...e
|
|
155
|
-
}),
|
|
155
|
+
}), Pe = ({ ...e }) => /* @__PURE__ */ G(Z, {
|
|
156
156
|
icon: /* @__PURE__ */ G(h, {
|
|
157
157
|
size: H.SM,
|
|
158
158
|
"aria-hidden": !0,
|
|
159
159
|
stroke: U
|
|
160
160
|
}),
|
|
161
161
|
...e
|
|
162
|
-
}),
|
|
162
|
+
}), Fe = ({ ...e }) => /* @__PURE__ */ G(Z, {
|
|
163
163
|
icon: /* @__PURE__ */ G(g, {
|
|
164
164
|
size: H.SM,
|
|
165
165
|
"aria-hidden": !0,
|
|
166
166
|
stroke: U
|
|
167
167
|
}),
|
|
168
168
|
...e
|
|
169
|
-
}),
|
|
169
|
+
}), Ie = ({ className: e, ...t }) => /* @__PURE__ */ G(Z, {
|
|
170
170
|
icon: /* @__PURE__ */ G(se, {
|
|
171
171
|
size: H.SM,
|
|
172
172
|
"aria-hidden": !0,
|
|
@@ -174,18 +174,18 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, _e = (e) =
|
|
|
174
174
|
}),
|
|
175
175
|
className: o("mobile:opacity-100", e),
|
|
176
176
|
...t
|
|
177
|
-
}),
|
|
177
|
+
}), Le = {
|
|
178
178
|
[e.Network]: "Upload failed · network error",
|
|
179
179
|
[e.UnsupportedType]: "Upload failed · unsupported file type",
|
|
180
180
|
[e.FileTooLarge]: "Upload failed · file too large"
|
|
181
|
-
},
|
|
182
|
-
let { clickLabel: y = "Download attachment", expandLabel: b = "Expand pasted text", downloadLabel: x = "Download attachment", retryLabel: S = "Retry upload", removeLabel: C = "Remove attachment", openInNewTabLabel: w = "Open in new tab", sizeLabel: T, uploadingLabel: E = "Uploading", errorReasonLabels: D, genericErrorLabel: O = "Upload failed" } = s ?? {}, { typography: k, className: A } = l ?? {}, { id: j, name: M, status: N, errorReason: P } = t, F = N === r.Loading, I = N === r.Error, L = u(), R = I ? P && (D?.[P] ??
|
|
181
|
+
}, Re = ({ attachment: t, searchQuery: n = "", onClick: i, onRetry: a, labels: s, styles: l, onDownload: f, isLink: p, cssVars: m, onExpand: h, isExpandable: g, onRemove: _, isSelected: v }) => {
|
|
182
|
+
let { clickLabel: y = "Download attachment", expandLabel: b = "Expand pasted text", downloadLabel: x = "Download attachment", retryLabel: S = "Retry upload", removeLabel: C = "Remove attachment", openInNewTabLabel: w = "Open in new tab", sizeLabel: T, uploadingLabel: E = "Uploading", errorReasonLabels: D, genericErrorLabel: O = "Upload failed" } = s ?? {}, { typography: k, className: A } = l ?? {}, { id: j, name: M, status: N, errorReason: P } = t, F = N === r.Loading, I = N === r.Error, L = u(), R = I ? P && (D?.[P] ?? Le[P]) || O : "", { BottomIcon: z, typeLabel: ee } = J(t), te = Oe(t), ne = !I && !F && f && !p, re = I && !!a && P !== e.UnsupportedType && P !== e.FileTooLarge, B = !!g && h !== void 0, V = B || i !== void 0, ie = Number(!!ne) + Number(!!re) + Number(!!p) + Number(!!_), ae = !V && ie === 1, oe = () => {
|
|
183
183
|
B ? h(j) : i?.(j);
|
|
184
184
|
}, se = (e) => {
|
|
185
185
|
e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), oe());
|
|
186
|
-
}, W = d(() =>
|
|
186
|
+
}, W = d(() => ye(M), [M]), ue = c(() => {
|
|
187
187
|
window.open(t.referenceUrl, "_blank", "noopener,noreferrer");
|
|
188
|
-
}, [t]),
|
|
188
|
+
}, [t]), me = o(je, "group/attachment-tile relative flex-col justify-between items-start gap-2 overflow-hidden p-3", X.tile, V && !I && !F && X.hovered, F && X.loading, v && X.selected, I && X.tileError, ae && X.proxyFocus, Y.tile, v && Y.tileSelected), he = /* @__PURE__ */ G("div", {
|
|
189
189
|
title: W,
|
|
190
190
|
className: o(k?.nameClassName ?? "dial-tiny-text", "line-clamp-2 w-full min-w-0 break-words", X.nameText, Y.tileName),
|
|
191
191
|
children: n ? /* @__PURE__ */ G(de, {
|
|
@@ -193,12 +193,12 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, _e = (e) =
|
|
|
193
193
|
query: n,
|
|
194
194
|
maxLines: 2
|
|
195
195
|
}) : W
|
|
196
|
-
}),
|
|
196
|
+
}), _e = z && /* @__PURE__ */ K("div", {
|
|
197
197
|
className: o("flex w-full items-end gap-1", Y.tileType),
|
|
198
198
|
children: [te ? /* @__PURE__ */ G(le, {
|
|
199
199
|
type: ce.File,
|
|
200
200
|
name: M ?? "",
|
|
201
|
-
fileExtension:
|
|
201
|
+
fileExtension: De(t),
|
|
202
202
|
size: H.MD,
|
|
203
203
|
decorative: !0
|
|
204
204
|
}) : /* @__PURE__ */ G(z, {
|
|
@@ -216,39 +216,39 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, _e = (e) =
|
|
|
216
216
|
"aria-label": B ? b : y,
|
|
217
217
|
onClick: oe,
|
|
218
218
|
onKeyDown: se
|
|
219
|
-
} : {},
|
|
220
|
-
pe,
|
|
219
|
+
} : {}, be = /* @__PURE__ */ K(ve, { children: [
|
|
221
220
|
he,
|
|
221
|
+
_e,
|
|
222
222
|
F && /* @__PURE__ */ G("div", {
|
|
223
223
|
role: "progressbar",
|
|
224
224
|
"aria-label": E,
|
|
225
225
|
className: o("absolute inset-0 flex items-center justify-center rounded-[11px]", X.track),
|
|
226
|
-
children: /* @__PURE__ */ G(
|
|
226
|
+
children: /* @__PURE__ */ G(ge, { size: 32 })
|
|
227
227
|
}),
|
|
228
228
|
/* @__PURE__ */ K("div", {
|
|
229
229
|
className: "absolute inset-e-1 top-1 flex",
|
|
230
230
|
children: [
|
|
231
|
-
ne && /* @__PURE__ */ G(
|
|
231
|
+
ne && /* @__PURE__ */ G(Pe, {
|
|
232
232
|
ariaLabel: x,
|
|
233
233
|
errorTitle: R,
|
|
234
234
|
errorDescId: L,
|
|
235
235
|
onClick: f,
|
|
236
236
|
id: j
|
|
237
237
|
}),
|
|
238
|
-
re && /* @__PURE__ */ G(
|
|
238
|
+
re && /* @__PURE__ */ G(Ne, {
|
|
239
239
|
ariaLabel: S,
|
|
240
240
|
errorTitle: R,
|
|
241
241
|
errorDescId: L,
|
|
242
242
|
onClick: a,
|
|
243
243
|
id: j
|
|
244
244
|
}),
|
|
245
|
-
p && /* @__PURE__ */ G(
|
|
245
|
+
p && /* @__PURE__ */ G(Fe, {
|
|
246
246
|
ariaLabel: w,
|
|
247
247
|
errorTitle: R,
|
|
248
248
|
errorDescId: L,
|
|
249
249
|
onClick: ue
|
|
250
250
|
}),
|
|
251
|
-
_ && /* @__PURE__ */ G(
|
|
251
|
+
_ && /* @__PURE__ */ G(Ie, {
|
|
252
252
|
ariaLabel: C,
|
|
253
253
|
errorTitle: R,
|
|
254
254
|
errorDescId: L,
|
|
@@ -258,12 +258,11 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, _e = (e) =
|
|
|
258
258
|
})
|
|
259
259
|
]
|
|
260
260
|
}),
|
|
261
|
-
|
|
261
|
+
/* @__PURE__ */ G(fe, {
|
|
262
262
|
id: L,
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
children: R
|
|
263
|
+
visuallyHidden: !0,
|
|
264
|
+
as: pe.Span,
|
|
265
|
+
children: I ? R : ""
|
|
267
266
|
})
|
|
268
267
|
] });
|
|
269
268
|
return /* @__PURE__ */ G("div", {
|
|
@@ -273,13 +272,13 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, _e = (e) =
|
|
|
273
272
|
...q,
|
|
274
273
|
"aria-busy": F,
|
|
275
274
|
style: m,
|
|
276
|
-
className: o(
|
|
277
|
-
children:
|
|
275
|
+
className: o(me, V && "cursor-pointer", Me),
|
|
276
|
+
children: be
|
|
278
277
|
})
|
|
279
278
|
});
|
|
280
279
|
}, Q = /* @__PURE__ */ function(e) {
|
|
281
280
|
return e.Idle = "idle", e.Loading = "loading", e.Loaded = "loaded", e.Error = "error", e;
|
|
282
|
-
}({}),
|
|
281
|
+
}({}), ze = ({ enabled: e, src: t }) => {
|
|
283
282
|
let n = f(null), [r, i] = p("idle");
|
|
284
283
|
return l(() => {
|
|
285
284
|
i(e && t ? "loading" : "idle");
|
|
@@ -294,8 +293,8 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, _e = (e) =
|
|
|
294
293
|
imageRef: n,
|
|
295
294
|
imageLoadStatus: r
|
|
296
295
|
};
|
|
297
|
-
},
|
|
298
|
-
let { clickLabel: f = "Open attachment", expandLabel: p = "Expand pasted text", removeLabel: m = "Remove attachment", downloadLabel: h = "Download attachment", uploadingLabel: g = "Uploading" } = i ?? {}, { className: _ } = l ?? {}, { id: v, name: y } = e, b = e.previewUrl ?? e.url, x = e.type === t.Pasted && n !== void 0, { isLoading: S, isError: C, isImage: w } = d(() => J(e), [e]), T = r !== void 0 && !x && !S && !C, E = x || T, D = !!c && !S, O = !E && Number(!!a) + Number(D) === 1, { imageRef: k, imageLoadStatus: A } =
|
|
296
|
+
}, Be = ({ attachment: e, onExpand: n, onClick: r, labels: i, onRemove: a, cssVars: s, onDownload: c, styles: l, isSelected: u }) => {
|
|
297
|
+
let { clickLabel: f = "Open attachment", expandLabel: p = "Expand pasted text", removeLabel: m = "Remove attachment", downloadLabel: h = "Download attachment", uploadingLabel: g = "Uploading" } = i ?? {}, { className: _ } = l ?? {}, { id: v, name: y } = e, b = e.previewUrl ?? e.url, x = e.type === t.Pasted && n !== void 0, { isLoading: S, isError: C, isImage: w } = d(() => J(e), [e]), T = r !== void 0 && !x && !S && !C, E = x || T, D = !!c && !S, O = !E && Number(!!a) + Number(D) === 1, { imageRef: k, imageLoadStatus: A } = ze({
|
|
299
298
|
enabled: w,
|
|
300
299
|
src: b
|
|
301
300
|
}), j = () => {
|
|
@@ -308,7 +307,7 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, _e = (e) =
|
|
|
308
307
|
onKeyDown: (e) => {
|
|
309
308
|
e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), j());
|
|
310
309
|
}
|
|
311
|
-
} : {}, N = o(
|
|
310
|
+
} : {}, N = o(je, "group/attachment-tile", E && "cursor-pointer", X.tile, u && X.selected, S && X.loading, O && X.proxyFocus, Me, _, Y.tile, u && Y.tileSelected);
|
|
312
311
|
return /* @__PURE__ */ G("div", {
|
|
313
312
|
className: N,
|
|
314
313
|
...M,
|
|
@@ -319,21 +318,21 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, _e = (e) =
|
|
|
319
318
|
children: [
|
|
320
319
|
/* @__PURE__ */ K("div", {
|
|
321
320
|
className: "absolute inset-e-1 top-1 z-10 flex",
|
|
322
|
-
children: [a && /* @__PURE__ */ G(
|
|
321
|
+
children: [a && /* @__PURE__ */ G(Ie, {
|
|
323
322
|
ariaLabel: m,
|
|
324
323
|
onClick: a,
|
|
325
324
|
id: v,
|
|
326
325
|
className: X.imageActionButton,
|
|
327
326
|
isAlwaysVisible: S
|
|
328
|
-
}), D && /* @__PURE__ */ G(
|
|
327
|
+
}), D && /* @__PURE__ */ G(Pe, {
|
|
329
328
|
ariaLabel: h,
|
|
330
329
|
onClick: c,
|
|
331
330
|
id: v,
|
|
332
331
|
className: X.imageActionButton
|
|
333
332
|
})]
|
|
334
333
|
}),
|
|
335
|
-
A !== Q.Loaded && /* @__PURE__ */ G(
|
|
336
|
-
variant:
|
|
334
|
+
A !== Q.Loaded && /* @__PURE__ */ G(me, {
|
|
335
|
+
variant: he.Rectangular,
|
|
337
336
|
width: "100%",
|
|
338
337
|
height: "100%",
|
|
339
338
|
active: A === Q.Loading,
|
|
@@ -357,12 +356,12 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, _e = (e) =
|
|
|
357
356
|
role: "progressbar",
|
|
358
357
|
"aria-label": g,
|
|
359
358
|
className: o("absolute inset-0 flex items-center justify-center rounded-xl", X.track),
|
|
360
|
-
children: /* @__PURE__ */ G(
|
|
359
|
+
children: /* @__PURE__ */ G(ge, { size: 32 })
|
|
361
360
|
})
|
|
362
361
|
]
|
|
363
362
|
})
|
|
364
363
|
});
|
|
365
|
-
},
|
|
364
|
+
}, Ve = ({ attachment: e, searchQuery: n = "", onRemove: r, onRetry: a, onExpand: o, onClick: s, onDownload: c, labels: l, styles: u, isSelected: f }) => {
|
|
366
365
|
let { colors: p } = u ?? {}, m = e.type === t.Pasted && o !== void 0, h = i({
|
|
367
366
|
"--ai-tile-bg": p?.background,
|
|
368
367
|
"--ai-tile-border": p?.border,
|
|
@@ -381,7 +380,7 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, _e = (e) =
|
|
|
381
380
|
"--ai-tile-hover-icon-color": p?.hoverIconColor,
|
|
382
381
|
"--ai-tile-progress-track": p?.trackBackground
|
|
383
382
|
}), { isImage: g, isLink: _ } = d(() => J(e), [e]);
|
|
384
|
-
return g ? /* @__PURE__ */ G(
|
|
383
|
+
return g ? /* @__PURE__ */ G(Be, {
|
|
385
384
|
attachment: e,
|
|
386
385
|
labels: l,
|
|
387
386
|
onClick: s,
|
|
@@ -391,7 +390,7 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, _e = (e) =
|
|
|
391
390
|
cssVars: h,
|
|
392
391
|
onDownload: c,
|
|
393
392
|
isSelected: f
|
|
394
|
-
}) : /* @__PURE__ */ G(
|
|
393
|
+
}) : /* @__PURE__ */ G(Re, {
|
|
395
394
|
attachment: e,
|
|
396
395
|
searchQuery: n,
|
|
397
396
|
onClick: s,
|
|
@@ -406,7 +405,7 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, _e = (e) =
|
|
|
406
405
|
isExpandable: m,
|
|
407
406
|
isSelected: f
|
|
408
407
|
});
|
|
409
|
-
},
|
|
408
|
+
}, He = ({ attachments: e, onRemove: t, onRetry: n, onExpand: r, onAttachmentClick: i, labels: a, styles: s }) => {
|
|
410
409
|
let { ariaLabel: c = "Attached files", removeLabel: l, retryLabel: u, clickLabel: d, expandLabel: f, uploadingLabel: p } = a ?? {}, { className: m, card: h } = s ?? {};
|
|
411
410
|
return e.length === 0 ? null : /* @__PURE__ */ G("div", {
|
|
412
411
|
role: "list",
|
|
@@ -415,7 +414,7 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, _e = (e) =
|
|
|
415
414
|
children: e.map((e) => /* @__PURE__ */ G("div", {
|
|
416
415
|
role: "listitem",
|
|
417
416
|
className: Y.trayItem,
|
|
418
|
-
children: /* @__PURE__ */ G(
|
|
417
|
+
children: /* @__PURE__ */ G(Ve, {
|
|
419
418
|
attachment: e,
|
|
420
419
|
onRemove: t,
|
|
421
420
|
onRetry: n,
|
|
@@ -432,11 +431,11 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, _e = (e) =
|
|
|
432
431
|
})
|
|
433
432
|
}, e.id))
|
|
434
433
|
});
|
|
435
|
-
},
|
|
434
|
+
}, Ue = {
|
|
436
435
|
headerIcon: "_headerIcon_1dmgi_1",
|
|
437
436
|
headerLabel: "_headerLabel_1dmgi_2"
|
|
438
|
-
},
|
|
439
|
-
let { ariaLabel: f = "Attachments", clickLabel: p = "Download attachment", downloadLabel: m = "Download attachment", retryLabel: g = "Retry upload", downloadAllLabel: v = "Download all", openInNewTabLabel: y, getHeaderLabel: b = (e) =>
|
|
437
|
+
}, We = (e, t) => `${e} ${t}${e === 1 ? "" : "s"}`, Ge = ({ attachments: e, onAttachmentClick: n, onDownloadAll: a, isAttachmentDownloadable: s, onRetry: c, labels: l, styles: u, selectedAttachmentId: d }) => {
|
|
438
|
+
let { ariaLabel: f = "Attachments", clickLabel: p = "Download attachment", downloadLabel: m = "Download attachment", retryLabel: g = "Retry upload", downloadAllLabel: v = "Download all", openInNewTabLabel: y, getHeaderLabel: b = (e) => We(e, "attachment"), promptLabel: x, pastedLabel: S, imageLabel: C } = l ?? {}, { typography: w, colors: T, className: E } = u ?? {}, D = i({ "--ai-group-text": T?.text });
|
|
440
439
|
if (e.length === 0) return null;
|
|
441
440
|
let O = e.some((e) => e.type === t.Image), k = e.some((e) => e.type !== t.Image), A = O && k, j = e.length >= 5, M = A ? B : O ? V : _, N = b(e.length), P = (e) => s?.(e) !== !1, F = e.filter((e) => e.status === r.Idle && P(e)), I = () => {
|
|
442
441
|
a ? a(F) : F.forEach((e) => n?.(e.id));
|
|
@@ -448,17 +447,17 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, _e = (e) =
|
|
|
448
447
|
role: "group",
|
|
449
448
|
"aria-label": f,
|
|
450
449
|
style: D,
|
|
451
|
-
className: o("flex flex-col gap-2", j ? "w-full max-w-[532px] min-w-0" : "max-w-[424px]",
|
|
450
|
+
className: o("flex flex-col gap-2", j ? "w-full max-w-[532px] min-w-0" : "max-w-[424px]", Ue.container, E),
|
|
452
451
|
children: [/* @__PURE__ */ K("div", {
|
|
453
452
|
className: "flex items-center justify-between",
|
|
454
453
|
children: [/* @__PURE__ */ K("div", {
|
|
455
454
|
className: "flex items-center gap-1",
|
|
456
455
|
children: [/* @__PURE__ */ G(M, {
|
|
457
456
|
size: H.SM,
|
|
458
|
-
className: o("shrink-0",
|
|
457
|
+
className: o("shrink-0", Ue.headerIcon),
|
|
459
458
|
"aria-hidden": !0
|
|
460
459
|
}), /* @__PURE__ */ G("span", {
|
|
461
|
-
className: o(w?.headerLabelClassName ?? "dial-tiny-semi-text",
|
|
460
|
+
className: o(w?.headerLabelClassName ?? "dial-tiny-semi-text", Ue.headerLabel),
|
|
462
461
|
children: N
|
|
463
462
|
})]
|
|
464
463
|
}), e.length >= 2 && F.length > 0 && (a || n) && /* @__PURE__ */ G(ue, {
|
|
@@ -477,7 +476,7 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, _e = (e) =
|
|
|
477
476
|
className: o("gap-2", j ? "grid grid-cols-[repeat(5,100px)]" : "flex flex-wrap"),
|
|
478
477
|
children: e.map((e, t) => /* @__PURE__ */ G("div", {
|
|
479
478
|
role: "listitem",
|
|
480
|
-
children: /* @__PURE__ */ G(
|
|
479
|
+
children: /* @__PURE__ */ G(Ve, {
|
|
481
480
|
attachment: e,
|
|
482
481
|
onClick: n,
|
|
483
482
|
onDownload: a && P(e) ? L : void 0,
|
|
@@ -496,51 +495,54 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, _e = (e) =
|
|
|
496
495
|
}, `${e.id}-${t}`))
|
|
497
496
|
})]
|
|
498
497
|
});
|
|
499
|
-
},
|
|
498
|
+
}, Ke = {
|
|
500
499
|
overlay: "_overlay_mzpdp_1",
|
|
501
500
|
icon: "_icon_mzpdp_5",
|
|
502
501
|
deniedIcon: "_deniedIcon_mzpdp_9"
|
|
503
|
-
},
|
|
504
|
-
let { title: a, subtitle: s } = n ?? {}, { colors: c, typography: l } = r ?? {}
|
|
505
|
-
|
|
506
|
-
|
|
502
|
+
}, qe = ({ isVisible: e, isAttachmentsAllowed: t = !0, labels: n, styles: r }) => {
|
|
503
|
+
let { title: a, subtitle: s } = n ?? {}, { colors: c, typography: l } = r ?? {}, u = a ?? (t ? "Attach files" : "No attachments allowed"), d = s ?? (t ? "Drop files here to attach them to message" : "Attachments can't be added to message"), f = /* @__PURE__ */ G(fe, {
|
|
504
|
+
visuallyHidden: !0,
|
|
505
|
+
as: pe.Span,
|
|
506
|
+
children: e ? `${u}. ${d}` : ""
|
|
507
|
+
});
|
|
508
|
+
if (!e) return f;
|
|
509
|
+
let p = i({
|
|
507
510
|
"--ai-fd-bg": c?.background,
|
|
508
511
|
"--ai-fd-icon": c?.icon,
|
|
509
512
|
"--ai-fd-denied-icon": c?.deniedIcon
|
|
510
|
-
}),
|
|
513
|
+
}), m = t ? Ke.icon : Ke.deniedIcon, h = (e) => {
|
|
511
514
|
e.preventDefault();
|
|
512
|
-
},
|
|
513
|
-
return /* @__PURE__ */ G("div", {
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
onDrop: t ? void 0 : m,
|
|
519
|
-
style: u,
|
|
515
|
+
}, g = t ? v : ne;
|
|
516
|
+
return /* @__PURE__ */ K(ve, { children: [f, /* @__PURE__ */ G("div", {
|
|
517
|
+
className: o("fixed inset-0 z-[9999] flex items-center justify-center backdrop-blur-sm", Ke.overlay, t ? "pointer-events-none" : "pointer-events-auto cursor-not-allowed"),
|
|
518
|
+
onDragOver: t ? void 0 : h,
|
|
519
|
+
onDrop: t ? void 0 : h,
|
|
520
|
+
style: p,
|
|
520
521
|
children: /* @__PURE__ */ K("div", {
|
|
522
|
+
"aria-hidden": !0,
|
|
521
523
|
className: "flex flex-col items-center text-center",
|
|
522
524
|
children: [
|
|
523
|
-
/* @__PURE__ */ G(
|
|
525
|
+
/* @__PURE__ */ G(g, {
|
|
524
526
|
size: 100,
|
|
525
527
|
stroke: 1,
|
|
526
|
-
className:
|
|
528
|
+
className: m,
|
|
527
529
|
"aria-hidden": !0
|
|
528
530
|
}),
|
|
529
531
|
/* @__PURE__ */ G("span", {
|
|
530
532
|
className: o("mt-5", l?.titleClassName ?? "dial-h3-text"),
|
|
531
|
-
children:
|
|
533
|
+
children: u
|
|
532
534
|
}),
|
|
533
535
|
/* @__PURE__ */ G("span", {
|
|
534
536
|
className: o("mt-4", l?.subtitleClassName ?? "dial-small-text"),
|
|
535
|
-
children:
|
|
537
|
+
children: d
|
|
536
538
|
})
|
|
537
539
|
]
|
|
538
540
|
})
|
|
539
|
-
});
|
|
540
|
-
}, $ = (e) => String(e).padStart(2, "0"),
|
|
541
|
+
})] });
|
|
542
|
+
}, $ = (e) => String(e).padStart(2, "0"), Je = (e) => `${e.getFullYear()}-${$(e.getMonth() + 1)}-${$(e.getDate())} ${$(e.getHours())}-${$(e.getMinutes())}-${$(e.getSeconds())}`, Ye = (e, t, n) => {
|
|
541
543
|
let r = e.lastIndexOf("."), i = r > 0, a = i ? e.slice(0, r) : e, o = i ? e.slice(r) : "", s = n === 0 ? "" : ` (${n + 1})`;
|
|
542
|
-
return `${a} ${
|
|
543
|
-
},
|
|
544
|
+
return `${a} ${Je(t)}${s}${o}`;
|
|
545
|
+
}, Xe = (e, n, i = {}) => {
|
|
544
546
|
let { screenshotName: a = "Screenshot.png", pastedTextName: o = "Pasted text" } = i;
|
|
545
547
|
return { handlePaste: c((i) => {
|
|
546
548
|
if (!i.clipboardData) return;
|
|
@@ -550,7 +552,7 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, _e = (e) =
|
|
|
550
552
|
for (let e of s) {
|
|
551
553
|
let i = e.getAsFile();
|
|
552
554
|
if (!i) continue;
|
|
553
|
-
let s =
|
|
555
|
+
let s = Ye(a, o, n.length), c = new File([i], s, { type: i.type }), l = {
|
|
554
556
|
id: q(),
|
|
555
557
|
name: s,
|
|
556
558
|
contentType: i.type,
|
|
@@ -566,7 +568,7 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, _e = (e) =
|
|
|
566
568
|
}
|
|
567
569
|
let l = i.clipboardData.getData("text/plain");
|
|
568
570
|
if (l.length > n) {
|
|
569
|
-
let n = `${o} ${
|
|
571
|
+
let n = `${o} ${Je(/* @__PURE__ */ new Date())}.txt`, a = new File([l], n, { type: "text/plain" }), s = {
|
|
570
572
|
id: q(),
|
|
571
573
|
name: n,
|
|
572
574
|
contentType: "text/plain",
|
|
@@ -582,6 +584,6 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, _e = (e) =
|
|
|
582
584
|
a,
|
|
583
585
|
o
|
|
584
586
|
]) };
|
|
585
|
-
},
|
|
587
|
+
}, Ze = 100;
|
|
586
588
|
//#endregion
|
|
587
|
-
export {
|
|
589
|
+
export { Ae as ATTACHMENT_COLLAPSE_THRESHOLD, Y as ATTACHMENT_INPUT_CLASS, Ve as AttachmentCard, Ge as AttachmentGroup, He as AttachmentTray, qe as FileDndOverlay, Q as LazyImageLoadStatus, Ze as MAX_UPLOADS_PER_MINUTE, q as generateAttachmentId, J as getAttachmentCardState, we as getAttachmentIcon, Ee as getExtFromContentType, ye as getNameWithoutExtension, Ce as isMimeTypeAllowed, Se as mimeTypesToExtensionLabels, Xe as useClipboardPaste, ze as useLazyImageLoad };
|
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.3.0-dev.
|
|
4
|
+
"version": "1.3.0-dev.248",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
"@tabler/icons-react": "^3.44.0"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
|
-
"@epam/ai-dial-chat-shared": "1.3.0-dev.
|
|
23
|
+
"@epam/ai-dial-chat-shared": "1.3.0-dev.248",
|
|
24
24
|
"react": "^19.2.8",
|
|
25
|
-
"@epam/ai-dial-ui-kit": "^0.16.0-dev.
|
|
25
|
+
"@epam/ai-dial-ui-kit": "^0.16.0-dev.56"
|
|
26
26
|
},
|
|
27
27
|
"repository": {
|
|
28
28
|
"type": "git",
|