@epam/ai-dial-attachment-input 1.1.16 → 1.1.18
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/index.js +7 -8
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { useCallback as o, useEffect as s, useId as c, useMemo as l, useRef as u
|
|
|
3
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 P, IconFileTypeTxt as F, IconFileTypeVue as I, IconFileTypeXls as L, IconFileTypeXml as R, IconFileTypeZip as ee, IconFileX as te, 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
4
|
import { DIAL_ICON_SIZE as U, DIAL_KIT_ICON_STROKE as W, ElementSize as ae, GhostIconButton as oe, Highlight as se, Skeleton as ce, SkeletonVariant as le, Spinner as ue, StaticIconButton as de } from "@epam/ai-dial-ui-kit";
|
|
5
5
|
import { Fragment as fe, jsx as G, jsxs as K } from "react/jsx-runtime";
|
|
6
|
-
|
|
6
|
+
// src/utils/attachment.ts
|
|
7
7
|
var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, pe = (e) => {
|
|
8
8
|
if (e == null) return "";
|
|
9
9
|
let t = e.lastIndexOf(".");
|
|
@@ -26,7 +26,7 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, pe = (e) =
|
|
|
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(", "), _e = (e, t) => t.length
|
|
29
|
+
}).join(", "), _e = (e, t) => t.length !== 0 && t.some((t) => {
|
|
30
30
|
if (t === "*" || t === "*/*") return !0;
|
|
31
31
|
if (t.endsWith("/*")) {
|
|
32
32
|
let n = t.slice(0, -2);
|
|
@@ -276,13 +276,13 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, pe = (e) =
|
|
|
276
276
|
src: y
|
|
277
277
|
}), D = () => {
|
|
278
278
|
b && n ? n(_) : w && r && r(_);
|
|
279
|
-
}
|
|
279
|
+
}, O = (e) => {
|
|
280
|
+
e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), D());
|
|
281
|
+
}, k = a(Ce, "group/attachment-tile", w && "cursor-pointer", Y.tile, d && Y.selected, g);
|
|
280
282
|
return /* @__PURE__ */ G("div", {
|
|
281
|
-
className:
|
|
283
|
+
className: k,
|
|
282
284
|
onClick: D,
|
|
283
|
-
onKeyDown:
|
|
284
|
-
e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), D());
|
|
285
|
-
},
|
|
285
|
+
onKeyDown: O,
|
|
286
286
|
tabIndex: 0,
|
|
287
287
|
role: "button",
|
|
288
288
|
style: s,
|
|
@@ -545,5 +545,4 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, pe = (e) =
|
|
|
545
545
|
s
|
|
546
546
|
]) };
|
|
547
547
|
}, Ve = 100;
|
|
548
|
-
//#endregion
|
|
549
548
|
export { Se as ATTACHMENT_COLLAPSE_THRESHOLD, Q as AttachmentCard, Fe as AttachmentGroup, Me as AttachmentTray, Le as FileDndOverlay, Z as LazyImageLoadStatus, Ve as MAX_UPLOADS_PER_MINUTE, q as generateAttachmentId, J as getAttachmentCardState, ve as getAttachmentIcon, be as getExtFromContentType, pe as getNameWithoutExtension, _e as isMimeTypeAllowed, ge as mimeTypesToExtensionLabels, Be as useClipboardPaste, Ae 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.1.
|
|
4
|
+
"version": "1.1.18",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"@tabler/icons-react": "^3.44.0"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
|
-
"@epam/ai-dial-chat-shared": "1.1.
|
|
23
|
+
"@epam/ai-dial-chat-shared": "1.1.18",
|
|
24
24
|
"react": "^19.2.8",
|
|
25
25
|
"@epam/ai-dial-ui-kit": "^0.14.2"
|
|
26
26
|
},
|