@epam/ai-dial-attachment-input 1.2.0-dev.6 → 1.2.0-dev.69
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.map +1 -1
- package/components/AttachmentCard/Attachments/File.d.ts.map +1 -1
- package/components/AttachmentCard/Attachments/Image.d.ts.map +1 -1
- package/components/AttachmentTray/AttachmentTray.d.ts.map +1 -1
- package/constants/public-class-names.d.ts +17 -0
- package/constants/public-class-names.d.ts.map +1 -0
- package/index.css +2 -2
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +119 -109
- package/package.json +3 -3
|
@@ -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;
|
|
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;AAI5D,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;AAgCD,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;
|
|
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;AAGf,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAoB/E,2HAA2H;AAC3H,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAuPlD,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;
|
|
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;AAO5E,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,CAoIpD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttachmentTray.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentTray/AttachmentTray.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"AttachmentTray.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentTray/AttachmentTray.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAGxE,gHAAgH;AAChH,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAgDlD,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const ATTACHMENT_INPUT_CLASS: {
|
|
2
|
+
/** The tray's `role="list"` root. */
|
|
3
|
+
readonly tray: "dial-ai-attachment-tray";
|
|
4
|
+
/** Each `role="listitem"` wrapper inside the tray. */
|
|
5
|
+
readonly trayItem: "dial-ai-attachment-tray-item";
|
|
6
|
+
/** The square tile element, for both image and non-previewable attachments. */
|
|
7
|
+
readonly tile: "dial-ai-attachment-tile";
|
|
8
|
+
/** The tile when selected, additive to `tile`. */
|
|
9
|
+
readonly tileSelected: "dial-ai-attachment-tile-selected";
|
|
10
|
+
/** The tile's filename element. */
|
|
11
|
+
readonly tileName: "dial-ai-attachment-tile-name";
|
|
12
|
+
/** The tile's type and size row. */
|
|
13
|
+
readonly tileType: "dial-ai-attachment-tile-type";
|
|
14
|
+
/** Every corner action button: download, retry, open-link, remove. */
|
|
15
|
+
readonly tileAction: "dial-ai-attachment-tile-action";
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=public-class-names.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-class-names.d.ts","sourceRoot":"","sources":["../../src/constants/public-class-names.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,sBAAsB;IACjC,qCAAqC;;IAErC,sDAAsD;;IAEtD,+EAA+E;;IAE/E,kDAAkD;;IAElD,mCAAmC;;IAEnC,oCAAoC;;IAEpC,sEAAsE;;CAE9D,CAAC"}
|
package/index.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
.
|
|
2
|
-
/*$vite$:1
|
|
1
|
+
._tile_s2es2_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_s2es2_12._hovered_s2es2_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_s2es2_12:focus-visible{outline-color:var(--ai-tile-focus-outline,var(--stroke-focus-black,#161b2d))}._selected_s2es2_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_s2es2_33{background:var(--ai-tile-bg-error,var(--bg-error,#f3d6d8));border-color:var(--ai-tile-border-error,var(--stroke-error,#ae2f2f))}._nameText_s2es2_38{color:var(--ai-tile-name-text,var(--text-primary,#161b2d))}._typeText_s2es2_42{color:var(--ai-tile-type-text,var(--text-secondary,#57647a))}._retryIcon_s2es2_46{color:var(--ai-tile-error-text,var(--text-error,#ae2f2f))}._track_s2es2_50{background:var(--ai-tile-progress-track,var(--bg-backdrop,#161b2d4d))}._actionButton_s2es2_56{background:var(--ai-tile-hover-icon-bg,var(--bg-control-neutral-hover-muted,#e0e6f0))}._imageActionButton_s2es2_60{background:var(--ai-tile-hover-icon-bg,var(--bg-layer-base,#f5f7fa));color:var(--ai-tile-hover-icon-color,var(--text-secondary,#57647a))}._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
|
+
/*$vite$:1*/.sr-only{height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;clip:rect(0,0,0,0);border-width:0;white-space:nowrap}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.visible{visibility:visible}.invisible{visibility:hidden}.collapse{visibility:collapse}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.end-1{inset-inline-end:.25rem}.start-\[-1px\]{inset-inline-start:-1px}.top-1{top:.25rem}.top-\[-1px\]{top:-1px}.z-10{z-index:10}.z-\[9999\]{z-index:9999}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.line-clamp-2{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.size-\[84px\]{height:84px;width:84px}.size-full{width:100%}.h-full,.size-full{height:100%}.w-full{width:100%}.min-w-0{min-width:0}.max-w-\[420px\]{max-width:420px}.max-w-\[492px\]{max-width:492px}.flex-1{flex:1 1 0%}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.grid-cols-\[repeat\(5\2c 83px\)\]{grid-template-columns:repeat(5,83px)}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:4px}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.object-cover{-o-object-fit:cover;object-fit:cover}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.pe-11{padding-inline-end:2.75rem}.pe-5{padding-inline-end:1.25rem}.text-center{text-align:center}.opacity-0{opacity:0}.opacity-100{opacity:1}.outline{outline-style:solid;outline-width:1px}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-sm{--tw-backdrop-blur:blur(4px);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-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-200{transition-duration:.2s}.focus-within\:outline:focus-within{outline-style:solid;outline-width:1px}.focus-within\:outline-1:focus-within{outline-width:1px}.focus-within\:outline-offset-1:focus-within{outline-offset:1px}.focus-visible\:opacity-100:focus-visible{opacity:1}.group\/attachment-tile:focus-within .group-focus-within\/attachment-tile\:opacity-100{opacity:1}.group\/attachment-tile:hover .group-hover\/attachment-tile\:opacity-100{opacity:1}
|
package/index.d.ts
CHANGED
|
@@ -11,5 +11,6 @@ export { useClipboardPaste, type UseClipboardPasteLabels, } from './hooks/useCli
|
|
|
11
11
|
export { useLazyImageLoad, LazyImageLoadStatus, } from './hooks/useLazyImageLoad';
|
|
12
12
|
export { generateAttachmentId, getAttachmentCardState, getExtFromContentType, getAttachmentIcon, getNameWithoutExtension, mimeTypesToExtensionLabels, isMimeTypeAllowed, } from './utils/attachment';
|
|
13
13
|
export { ATTACHMENT_COLLAPSE_THRESHOLD } from './constants/attachment-group';
|
|
14
|
+
export { ATTACHMENT_INPUT_CLASS } from './constants/public-class-names';
|
|
14
15
|
export { MAX_UPLOADS_PER_MINUTE } from './constants/upload';
|
|
15
16
|
//# sourceMappingURL=index.d.ts.map
|
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,8CAA8C,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAE5E,YAAY,EACV,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EAC9B,KAAK,qBAAqB,GAC3B,MAAM,2BAA2B,CAAC;AACnC,YAAY,EACV,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,wBAAwB,EACxB,oBAAoB,GACrB,MAAM,2BAA2B,CAAC;AACnC,YAAY,EACV,oBAAoB,EACpB,wBAAwB,EACxB,oBAAoB,GACrB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EACL,iBAAiB,EACjB,KAAK,uBAAuB,GAC7B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,iBAAiB,EACjB,uBAAuB,EACvB,0BAA0B,EAC1B,iBAAiB,GAClB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,6BAA6B,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,8CAA8C,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAE5E,YAAY,EACV,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EAC9B,KAAK,qBAAqB,GAC3B,MAAM,2BAA2B,CAAC;AACnC,YAAY,EACV,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,wBAAwB,EACxB,oBAAoB,GACrB,MAAM,2BAA2B,CAAC;AACnC,YAAY,EACV,oBAAoB,EACpB,wBAAwB,EACxB,oBAAoB,GACrB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EACL,iBAAiB,EACjB,KAAK,uBAAuB,GAC7B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,iBAAiB,EACjB,uBAAuB,EACvB,0BAA0B,EAC1B,iBAAiB,GAClB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,6BAA6B,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC"}
|
package/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
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
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
|
-
import { DIAL_ICON_SIZE as U, DIAL_KIT_ICON_STROKE as W, ElementSize as
|
|
5
|
-
import { Fragment as
|
|
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 fe = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, pe = (e) => {
|
|
8
8
|
if (e == null) return "";
|
|
9
9
|
let t = e.lastIndexOf(".");
|
|
10
10
|
return t > 0 ? e.slice(0, t) : e;
|
|
@@ -113,49 +113,57 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, pe = (e) =
|
|
|
113
113
|
typeLabel: d ? null : xe(e, n)
|
|
114
114
|
};
|
|
115
115
|
}, Se = 5, Ce = "flex size-[84px] items-center justify-center rounded-xl border", Y = {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
116
|
+
tray: "dial-ai-attachment-tray",
|
|
117
|
+
trayItem: "dial-ai-attachment-tray-item",
|
|
118
|
+
tile: "dial-ai-attachment-tile",
|
|
119
|
+
tileSelected: "dial-ai-attachment-tile-selected",
|
|
120
|
+
tileName: "dial-ai-attachment-tile-name",
|
|
121
|
+
tileType: "dial-ai-attachment-tile-type",
|
|
122
|
+
tileAction: "dial-ai-attachment-tile-action"
|
|
123
|
+
}, X = {
|
|
124
|
+
tile: "_tile_s2es2_12",
|
|
125
|
+
hovered: "_hovered_s2es2_18",
|
|
126
|
+
selected: "_selected_s2es2_28",
|
|
127
|
+
tileError: "_tileError_s2es2_33",
|
|
128
|
+
nameText: "_nameText_s2es2_38",
|
|
129
|
+
typeText: "_typeText_s2es2_42",
|
|
130
|
+
retryIcon: "_retryIcon_s2es2_46",
|
|
131
|
+
track: "_track_s2es2_50",
|
|
132
|
+
actionButton: "_actionButton_s2es2_56",
|
|
133
|
+
imageActionButton: "_imageActionButton_s2es2_60"
|
|
134
|
+
}, Z = ({ ariaLabel: e, errorTitle: t, errorDescId: n, onClick: r, id: i, icon: o, className: s }) => /* @__PURE__ */ K(ue, {
|
|
127
135
|
icon: o,
|
|
128
|
-
size:
|
|
129
|
-
className: a("opacity-0 focus-visible:opacity-100 group-focus-within/attachment-tile:opacity-100 group-hover/attachment-tile:opacity-100",
|
|
136
|
+
size: G.Small,
|
|
137
|
+
className: a("opacity-0 focus-visible:opacity-100 group-focus-within/attachment-tile:opacity-100 group-hover/attachment-tile:opacity-100", X.actionButton, s, Y.tileAction),
|
|
130
138
|
"aria-label": e,
|
|
131
139
|
"aria-describedby": t ? n : void 0,
|
|
132
140
|
onClick: (e) => {
|
|
133
141
|
e.stopPropagation(), r(i);
|
|
134
142
|
}
|
|
135
|
-
}), we = ({ ...e }) => /* @__PURE__ */
|
|
136
|
-
icon: /* @__PURE__ */
|
|
143
|
+
}), we = ({ ...e }) => /* @__PURE__ */ K(Z, {
|
|
144
|
+
icon: /* @__PURE__ */ K(ne, {
|
|
137
145
|
size: U.SM,
|
|
138
146
|
"aria-hidden": !0,
|
|
139
147
|
stroke: W
|
|
140
148
|
}),
|
|
141
|
-
className:
|
|
149
|
+
className: X.retryIcon,
|
|
142
150
|
...e
|
|
143
|
-
}), Te = ({ ...e }) => /* @__PURE__ */
|
|
144
|
-
icon: /* @__PURE__ */
|
|
151
|
+
}), Te = ({ ...e }) => /* @__PURE__ */ K(Z, {
|
|
152
|
+
icon: /* @__PURE__ */ K(p, {
|
|
145
153
|
size: U.SM,
|
|
146
154
|
"aria-hidden": !0,
|
|
147
155
|
stroke: W
|
|
148
156
|
}),
|
|
149
157
|
...e
|
|
150
|
-
}), Ee = ({ ...e }) => /* @__PURE__ */
|
|
151
|
-
icon: /* @__PURE__ */
|
|
158
|
+
}), Ee = ({ ...e }) => /* @__PURE__ */ K(Z, {
|
|
159
|
+
icon: /* @__PURE__ */ K(m, {
|
|
152
160
|
size: U.SM,
|
|
153
161
|
"aria-hidden": !0,
|
|
154
162
|
stroke: W
|
|
155
163
|
}),
|
|
156
164
|
...e
|
|
157
|
-
}), De = ({ ...e }) => /* @__PURE__ */
|
|
158
|
-
icon: /* @__PURE__ */
|
|
165
|
+
}), De = ({ ...e }) => /* @__PURE__ */ K(Z, {
|
|
166
|
+
icon: /* @__PURE__ */ K(ie, {
|
|
159
167
|
size: U.SM,
|
|
160
168
|
"aria-hidden": !0,
|
|
161
169
|
stroke: W
|
|
@@ -163,65 +171,66 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, pe = (e) =
|
|
|
163
171
|
...e
|
|
164
172
|
}), Oe = {
|
|
165
173
|
[e.Network]: "Upload failed · network error",
|
|
166
|
-
[e.UnsupportedType]: "Upload failed · unsupported file type"
|
|
174
|
+
[e.UnsupportedType]: "Upload failed · unsupported file type",
|
|
175
|
+
[e.FileTooLarge]: "Upload failed · file too large"
|
|
167
176
|
}, ke = ({ 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, P = M === r.Loading, F = M === r.Error, I = c(), L = F ? N && (E?.[N] ?? Oe[N]) || D : "", { BottomIcon: R, typeLabel: ee } = J(t), te = !F && !P && f && !m, z = F && !!s && N !== e.UnsupportedType, B = Number(!!te) + Number(!!z) + Number(!!m) + Number(!!v), V = B > 1 ? "pe-11" : B === 1 ? "pe-5" : void 0, ne = (e) => {
|
|
177
|
+
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, P = M === r.Loading, F = M === r.Error, I = c(), L = F ? N && (E?.[N] ?? Oe[N]) || D : "", { BottomIcon: R, typeLabel: ee } = J(t), te = !F && !P && f && !m, z = F && !!s && N !== e.UnsupportedType && N !== e.FileTooLarge, B = Number(!!te) + Number(!!z) + Number(!!m) + Number(!!v), V = B > 1 ? "pe-11" : B === 1 ? "pe-5" : void 0, ne = (e) => {
|
|
169
178
|
e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), i?.(t.id));
|
|
170
179
|
}, H = l(() => p ? j : pe(j), [p, j]), re = o(() => {
|
|
171
180
|
window.open(t.referenceUrl, "_blank", "noopener,noreferrer");
|
|
172
|
-
}, [t]), ie = a(Ce, "group/attachment-tile relative flex-col justify-between items-start gap-1 overflow-hidden p-1.5",
|
|
181
|
+
}, [t]), ie = a(Ce, "group/attachment-tile relative flex-col justify-between items-start gap-1 overflow-hidden p-1.5", X.tile, !F && X.hovered, y && X.selected, F && X.tileError, Y.tile, y && Y.tileSelected), U = /* @__PURE__ */ K("div", {
|
|
173
182
|
title: H,
|
|
174
|
-
className: a(O?.nameClassName ?? "dial-caption-text", "line-clamp-2 w-full min-w-0 break-words",
|
|
175
|
-
children: n ? /* @__PURE__ */
|
|
183
|
+
className: a(O?.nameClassName ?? "dial-caption-text", "line-clamp-2 w-full min-w-0 break-words", X.nameText, !F && V, Y.tileName),
|
|
184
|
+
children: n ? /* @__PURE__ */ K(oe, {
|
|
176
185
|
text: H,
|
|
177
186
|
query: n,
|
|
178
187
|
maxLines: 2
|
|
179
188
|
}) : H
|
|
180
|
-
}), W = R && /* @__PURE__ */
|
|
181
|
-
className: a("flex w-full items-center gap-1", F && V),
|
|
182
|
-
children: [/* @__PURE__ */
|
|
189
|
+
}), W = R && /* @__PURE__ */ q("div", {
|
|
190
|
+
className: a("flex w-full items-center gap-1", F && V, Y.tileType),
|
|
191
|
+
children: [/* @__PURE__ */ K(R, {
|
|
183
192
|
size: 16,
|
|
184
|
-
className:
|
|
193
|
+
className: X.typeText,
|
|
185
194
|
"aria-hidden": !0
|
|
186
|
-
}), /* @__PURE__ */
|
|
187
|
-
className: a(O?.metaClassName ?? "dial-caption-text", "min-w-0 flex-1 truncate",
|
|
195
|
+
}), /* @__PURE__ */ K("span", {
|
|
196
|
+
className: a(O?.metaClassName ?? "dial-caption-text", "min-w-0 flex-1 truncate", X.typeText),
|
|
188
197
|
children: w ? `${ee} · ${w}` : ee
|
|
189
198
|
})]
|
|
190
|
-
}),
|
|
199
|
+
}), G = () => {
|
|
191
200
|
_ && g ? g(A) : i && i(A);
|
|
192
|
-
},
|
|
201
|
+
}, ae = /* @__PURE__ */ q(de, { children: [
|
|
193
202
|
U,
|
|
194
203
|
W,
|
|
195
|
-
P && /* @__PURE__ */
|
|
204
|
+
P && /* @__PURE__ */ K("div", {
|
|
196
205
|
role: "progressbar",
|
|
197
206
|
"aria-label": T,
|
|
198
|
-
className: a("absolute start-[-1px] top-[-1px] flex size-full items-center justify-center rounded",
|
|
199
|
-
children: /* @__PURE__ */
|
|
207
|
+
className: a("absolute start-[-1px] top-[-1px] flex size-full items-center justify-center rounded", X.track),
|
|
208
|
+
children: /* @__PURE__ */ K(le, { size: 32 })
|
|
200
209
|
}),
|
|
201
|
-
/* @__PURE__ */
|
|
210
|
+
/* @__PURE__ */ q("div", {
|
|
202
211
|
className: "absolute end-1 top-1 flex gap-1",
|
|
203
212
|
children: [
|
|
204
|
-
te && /* @__PURE__ */
|
|
213
|
+
te && /* @__PURE__ */ K(Te, {
|
|
205
214
|
ariaLabel: b,
|
|
206
215
|
errorTitle: L,
|
|
207
216
|
errorDescId: I,
|
|
208
217
|
onClick: f,
|
|
209
218
|
id: A
|
|
210
219
|
}),
|
|
211
|
-
z && /* @__PURE__ */
|
|
220
|
+
z && /* @__PURE__ */ K(we, {
|
|
212
221
|
ariaLabel: x,
|
|
213
222
|
errorTitle: L,
|
|
214
223
|
errorDescId: I,
|
|
215
224
|
onClick: s,
|
|
216
225
|
id: A
|
|
217
226
|
}),
|
|
218
|
-
m && /* @__PURE__ */
|
|
227
|
+
m && /* @__PURE__ */ K(Ee, {
|
|
219
228
|
ariaLabel: C,
|
|
220
229
|
errorTitle: L,
|
|
221
230
|
errorDescId: I,
|
|
222
231
|
onClick: re
|
|
223
232
|
}),
|
|
224
|
-
v && /* @__PURE__ */
|
|
233
|
+
v && /* @__PURE__ */ K(De, {
|
|
225
234
|
ariaLabel: S,
|
|
226
235
|
errorTitle: L,
|
|
227
236
|
errorDescId: I,
|
|
@@ -230,7 +239,7 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, pe = (e) =
|
|
|
230
239
|
})
|
|
231
240
|
]
|
|
232
241
|
}),
|
|
233
|
-
F && /* @__PURE__ */
|
|
242
|
+
F && /* @__PURE__ */ K("span", {
|
|
234
243
|
id: I,
|
|
235
244
|
role: "status",
|
|
236
245
|
"aria-live": "polite",
|
|
@@ -238,22 +247,22 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, pe = (e) =
|
|
|
238
247
|
children: L
|
|
239
248
|
})
|
|
240
249
|
] });
|
|
241
|
-
return /* @__PURE__ */
|
|
250
|
+
return /* @__PURE__ */ K("div", {
|
|
242
251
|
style: h,
|
|
243
252
|
className: a("inline-flex", k),
|
|
244
|
-
children: /* @__PURE__ */
|
|
253
|
+
children: /* @__PURE__ */ K("div", {
|
|
245
254
|
role: "button",
|
|
246
255
|
tabIndex: 0,
|
|
247
256
|
"aria-label": b,
|
|
248
257
|
"aria-busy": P,
|
|
249
|
-
onClick:
|
|
258
|
+
onClick: G,
|
|
250
259
|
onKeyDown: ne,
|
|
251
260
|
style: h,
|
|
252
261
|
className: a(ie, "cursor-pointer focus-within:outline focus-within:outline-1 focus-within:outline-offset-1"),
|
|
253
|
-
children:
|
|
262
|
+
children: ae
|
|
254
263
|
})
|
|
255
264
|
});
|
|
256
|
-
},
|
|
265
|
+
}, Q = /* @__PURE__ */ function(e) {
|
|
257
266
|
return e.Idle = "idle", e.Loading = "loading", e.Loaded = "loaded", e.Error = "error", e;
|
|
258
267
|
}({}), Ae = ({ enabled: e, src: t }) => {
|
|
259
268
|
let n = u(null), [r, i] = d("idle");
|
|
@@ -277,8 +286,8 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, pe = (e) =
|
|
|
277
286
|
}), D = () => {
|
|
278
287
|
b && n ? n(_) : w && r && r(_);
|
|
279
288
|
};
|
|
280
|
-
return /* @__PURE__ */
|
|
281
|
-
className: a(Ce, "group/attachment-tile", w && "cursor-pointer",
|
|
289
|
+
return /* @__PURE__ */ K("div", {
|
|
290
|
+
className: a(Ce, "group/attachment-tile", w && "cursor-pointer", X.tile, d && X.selected, g, Y.tile, d && Y.tileSelected),
|
|
282
291
|
onClick: D,
|
|
283
292
|
onKeyDown: (e) => {
|
|
284
293
|
e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), D());
|
|
@@ -287,48 +296,48 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, pe = (e) =
|
|
|
287
296
|
role: "button",
|
|
288
297
|
style: s,
|
|
289
298
|
"aria-label": w ? f : b ? p : void 0,
|
|
290
|
-
children: /* @__PURE__ */
|
|
299
|
+
children: /* @__PURE__ */ q("div", {
|
|
291
300
|
className: "relative h-full w-full overflow-hidden",
|
|
292
301
|
children: [
|
|
293
|
-
/* @__PURE__ */
|
|
302
|
+
/* @__PURE__ */ q("div", {
|
|
294
303
|
className: "absolute end-1 top-1 z-10 flex gap-1",
|
|
295
|
-
children: [o && /* @__PURE__ */
|
|
304
|
+
children: [o && /* @__PURE__ */ K(De, {
|
|
296
305
|
ariaLabel: m,
|
|
297
306
|
onClick: o,
|
|
298
307
|
id: _,
|
|
299
|
-
className:
|
|
300
|
-
}), c && /* @__PURE__ */
|
|
308
|
+
className: X.imageActionButton
|
|
309
|
+
}), c && /* @__PURE__ */ K(Te, {
|
|
301
310
|
ariaLabel: h,
|
|
302
311
|
onClick: c,
|
|
303
312
|
id: _,
|
|
304
|
-
className:
|
|
313
|
+
className: X.imageActionButton
|
|
305
314
|
})]
|
|
306
315
|
}),
|
|
307
|
-
E !==
|
|
308
|
-
variant:
|
|
316
|
+
E !== Q.Loaded && /* @__PURE__ */ K(se, {
|
|
317
|
+
variant: ce.Rectangular,
|
|
309
318
|
width: "100%",
|
|
310
319
|
height: "100%",
|
|
311
|
-
active: E ===
|
|
312
|
-
overlay: /* @__PURE__ */
|
|
320
|
+
active: E === Q.Loading,
|
|
321
|
+
overlay: /* @__PURE__ */ K(V, {
|
|
313
322
|
size: U.LG,
|
|
314
|
-
className:
|
|
323
|
+
className: X.typeText,
|
|
315
324
|
"aria-hidden": !0,
|
|
316
325
|
stroke: W
|
|
317
326
|
}),
|
|
318
327
|
className: "absolute inset-0 rounded-xl"
|
|
319
328
|
}),
|
|
320
|
-
/* @__PURE__ */
|
|
329
|
+
/* @__PURE__ */ K("img", {
|
|
321
330
|
ref: T,
|
|
322
331
|
src: y,
|
|
323
332
|
alt: v,
|
|
324
333
|
loading: "lazy",
|
|
325
334
|
decoding: "async",
|
|
326
|
-
className: a("h-full w-full rounded-xl object-cover transition-opacity duration-200", E ===
|
|
335
|
+
className: a("h-full w-full rounded-xl object-cover transition-opacity duration-200", E === Q.Loaded ? "opacity-100" : "opacity-0")
|
|
327
336
|
})
|
|
328
337
|
]
|
|
329
338
|
})
|
|
330
339
|
});
|
|
331
|
-
},
|
|
340
|
+
}, Me = ({ attachment: e, searchQuery: n = "", onRemove: r, onRetry: a, onExpand: o, onClick: s, onDownload: c, labels: u, styles: d, isSelected: f }) => {
|
|
332
341
|
let { colors: p } = d ?? {}, m = e.type === t.Pasted, h = m && o !== void 0, g = i({
|
|
333
342
|
"--ai-tile-bg": p?.background,
|
|
334
343
|
"--ai-tile-border": p?.border,
|
|
@@ -346,7 +355,7 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, pe = (e) =
|
|
|
346
355
|
"--ai-tile-hover-icon-color": p?.hoverIconColor,
|
|
347
356
|
"--ai-tile-progress-track": p?.trackBackground
|
|
348
357
|
}), { isImage: _, isLink: v } = l(() => J(e), [e]);
|
|
349
|
-
return _ ? /* @__PURE__ */
|
|
358
|
+
return _ ? /* @__PURE__ */ K(je, {
|
|
350
359
|
attachment: e,
|
|
351
360
|
labels: u,
|
|
352
361
|
onClick: s,
|
|
@@ -356,7 +365,7 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, pe = (e) =
|
|
|
356
365
|
cssVars: g,
|
|
357
366
|
onDownload: c,
|
|
358
367
|
isSelected: f
|
|
359
|
-
}) : /* @__PURE__ */
|
|
368
|
+
}) : /* @__PURE__ */ K(ke, {
|
|
360
369
|
attachment: e,
|
|
361
370
|
searchQuery: n,
|
|
362
371
|
onClick: s,
|
|
@@ -372,15 +381,16 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, pe = (e) =
|
|
|
372
381
|
isExpandable: h,
|
|
373
382
|
isSelected: f
|
|
374
383
|
});
|
|
375
|
-
},
|
|
384
|
+
}, Ne = ({ attachments: e, onRemove: t, onRetry: n, onExpand: r, onAttachmentClick: i, labels: o, styles: s }) => {
|
|
376
385
|
let { ariaLabel: c = "Attached files", removeLabel: l, retryLabel: u, clickLabel: d, uploadingLabel: f } = o ?? {}, { className: p } = s ?? {};
|
|
377
|
-
return e.length === 0 ? null : /* @__PURE__ */
|
|
386
|
+
return e.length === 0 ? null : /* @__PURE__ */ K("div", {
|
|
378
387
|
role: "list",
|
|
379
388
|
"aria-label": c,
|
|
380
|
-
className: a("flex w-full min-w-0 gap-2 overflow-x-auto", p),
|
|
381
|
-
children: e.map((e) => /* @__PURE__ */
|
|
389
|
+
className: a("flex w-full min-w-0 gap-2 overflow-x-auto", p, Y.tray),
|
|
390
|
+
children: e.map((e) => /* @__PURE__ */ K("div", {
|
|
382
391
|
role: "listitem",
|
|
383
|
-
|
|
392
|
+
className: Y.trayItem,
|
|
393
|
+
children: /* @__PURE__ */ K(Me, {
|
|
384
394
|
attachment: e,
|
|
385
395
|
onRemove: t,
|
|
386
396
|
onRetry: n,
|
|
@@ -395,11 +405,11 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, pe = (e) =
|
|
|
395
405
|
})
|
|
396
406
|
}, e.id))
|
|
397
407
|
});
|
|
398
|
-
},
|
|
408
|
+
}, Pe = {
|
|
399
409
|
headerIcon: "_headerIcon_1dmgi_1",
|
|
400
410
|
headerLabel: "_headerLabel_1dmgi_2"
|
|
401
|
-
},
|
|
402
|
-
let { ariaLabel: d = "Attachments", clickLabel: f = "Download attachment", retryLabel: m = "Retry upload", downloadAllLabel: g = "Download all", openInNewTabLabel: _, getHeaderLabel: v = (e) =>
|
|
411
|
+
}, Fe = (e, t) => `${e} ${t}${e === 1 ? "" : "s"}`, Ie = ({ attachments: e, onAttachmentClick: n, onDownloadAll: o, onRetry: s, labels: c, styles: l, selectedAttachmentId: u }) => {
|
|
412
|
+
let { ariaLabel: d = "Attachments", clickLabel: f = "Download attachment", retryLabel: m = "Retry upload", downloadAllLabel: g = "Download all", openInNewTabLabel: _, getHeaderLabel: v = (e) => Fe(e, "attachment"), promptLabel: y, pastedLabel: b, imageLabel: x } = c ?? {}, { typography: S, colors: C, className: w } = l ?? {}, T = i({ "--ai-group-text": C?.text });
|
|
403
413
|
if (e.length === 0) return null;
|
|
404
414
|
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 = () => {
|
|
405
415
|
let t = e.filter((e) => e.status === r.Idle);
|
|
@@ -408,40 +418,40 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, pe = (e) =
|
|
|
408
418
|
let n = e.find((e) => e.id === t);
|
|
409
419
|
n && o?.([n]);
|
|
410
420
|
};
|
|
411
|
-
return /* @__PURE__ */
|
|
421
|
+
return /* @__PURE__ */ q("div", {
|
|
412
422
|
role: "group",
|
|
413
423
|
"aria-label": d,
|
|
414
424
|
style: T,
|
|
415
|
-
className: a("flex flex-col gap-1", k ? "w-full min-w-0 max-w-[492px]" : "max-w-[420px]",
|
|
416
|
-
children: [/* @__PURE__ */
|
|
425
|
+
className: a("flex flex-col gap-1", k ? "w-full min-w-0 max-w-[492px]" : "max-w-[420px]", Pe.container, w),
|
|
426
|
+
children: [/* @__PURE__ */ q("div", {
|
|
417
427
|
className: "flex items-center justify-between",
|
|
418
|
-
children: [/* @__PURE__ */
|
|
428
|
+
children: [/* @__PURE__ */ q("div", {
|
|
419
429
|
className: "flex items-center gap-1",
|
|
420
|
-
children: [/* @__PURE__ */
|
|
430
|
+
children: [/* @__PURE__ */ K(A, {
|
|
421
431
|
size: U.SM,
|
|
422
|
-
className: a("shrink-0",
|
|
432
|
+
className: a("shrink-0", Pe.headerIcon),
|
|
423
433
|
"aria-hidden": !0
|
|
424
|
-
}), /* @__PURE__ */
|
|
425
|
-
className: a(S?.headerLabelClassName ?? "dial-tiny-semi-text",
|
|
434
|
+
}), /* @__PURE__ */ K("span", {
|
|
435
|
+
className: a(S?.headerLabelClassName ?? "dial-tiny-semi-text", Pe.headerLabel),
|
|
426
436
|
children: j
|
|
427
437
|
})]
|
|
428
|
-
}), e.length >= 2 && (o || n) && /* @__PURE__ */
|
|
429
|
-
icon: /* @__PURE__ */
|
|
438
|
+
}), e.length >= 2 && (o || n) && /* @__PURE__ */ K(ae, {
|
|
439
|
+
icon: /* @__PURE__ */ K(p, {
|
|
430
440
|
size: U.SM,
|
|
431
441
|
"aria-hidden": !0,
|
|
432
442
|
stroke: W
|
|
433
443
|
}),
|
|
434
|
-
size:
|
|
444
|
+
size: G.Small,
|
|
435
445
|
"aria-label": g,
|
|
436
446
|
onClick: M
|
|
437
447
|
})]
|
|
438
|
-
}), /* @__PURE__ */
|
|
448
|
+
}), /* @__PURE__ */ K("div", {
|
|
439
449
|
role: "list",
|
|
440
450
|
"aria-label": j,
|
|
441
451
|
className: a("gap-3", k ? "grid grid-cols-[repeat(5,83px)]" : "flex flex-wrap"),
|
|
442
|
-
children: e.map((e, t) => /* @__PURE__ */
|
|
452
|
+
children: e.map((e, t) => /* @__PURE__ */ K("div", {
|
|
443
453
|
role: "listitem",
|
|
444
|
-
children: /* @__PURE__ */
|
|
454
|
+
children: /* @__PURE__ */ K(Me, {
|
|
445
455
|
attachment: e,
|
|
446
456
|
onClick: n,
|
|
447
457
|
onDownload: N,
|
|
@@ -459,50 +469,50 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, pe = (e) =
|
|
|
459
469
|
}, `${e.id}-${t}`))
|
|
460
470
|
})]
|
|
461
471
|
});
|
|
462
|
-
},
|
|
472
|
+
}, Le = {
|
|
463
473
|
overlay: "_overlay_mzpdp_1",
|
|
464
474
|
icon: "_icon_mzpdp_5",
|
|
465
475
|
deniedIcon: "_deniedIcon_mzpdp_9"
|
|
466
|
-
},
|
|
476
|
+
}, Re = ({ isVisible: e, isAttachmentsAllowed: t = !0, labels: n, styles: r }) => {
|
|
467
477
|
let { title: o, subtitle: s } = n ?? {}, { colors: c, typography: l } = r ?? {};
|
|
468
478
|
if (!e) return null;
|
|
469
479
|
let u = i({
|
|
470
480
|
"--ai-fd-bg": c?.background,
|
|
471
481
|
"--ai-fd-icon": c?.icon,
|
|
472
482
|
"--ai-fd-denied-icon": c?.deniedIcon
|
|
473
|
-
}), 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 ?
|
|
483
|
+
}), 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 ? Le.icon : Le.deniedIcon, m = (e) => {
|
|
474
484
|
e.preventDefault();
|
|
475
485
|
}, h = t ? g : te;
|
|
476
|
-
return /* @__PURE__ */
|
|
486
|
+
return /* @__PURE__ */ K("div", {
|
|
477
487
|
role: "status",
|
|
478
488
|
"aria-live": "polite",
|
|
479
|
-
className: a("fixed inset-0 z-[9999] flex items-center justify-center backdrop-blur-sm",
|
|
489
|
+
className: a("fixed inset-0 z-[9999] flex items-center justify-center backdrop-blur-sm", Le.overlay, t ? "pointer-events-none" : "pointer-events-auto cursor-not-allowed"),
|
|
480
490
|
onDragOver: t ? void 0 : m,
|
|
481
491
|
onDrop: t ? void 0 : m,
|
|
482
492
|
style: u,
|
|
483
|
-
children: /* @__PURE__ */
|
|
493
|
+
children: /* @__PURE__ */ q("div", {
|
|
484
494
|
className: "flex flex-col items-center text-center",
|
|
485
495
|
children: [
|
|
486
|
-
/* @__PURE__ */
|
|
496
|
+
/* @__PURE__ */ K(h, {
|
|
487
497
|
size: 100,
|
|
488
498
|
className: p,
|
|
489
499
|
"aria-hidden": !0
|
|
490
500
|
}),
|
|
491
|
-
/* @__PURE__ */
|
|
501
|
+
/* @__PURE__ */ K("span", {
|
|
492
502
|
className: a("mt-5", l?.titleClassName ?? "dial-h3-text"),
|
|
493
503
|
children: d
|
|
494
504
|
}),
|
|
495
|
-
/* @__PURE__ */
|
|
505
|
+
/* @__PURE__ */ K("span", {
|
|
496
506
|
className: a("mt-4", l?.subtitleClassName ?? "dial-small-text"),
|
|
497
507
|
children: f
|
|
498
508
|
})
|
|
499
509
|
]
|
|
500
510
|
})
|
|
501
511
|
});
|
|
502
|
-
}, $ = (e) => String(e).padStart(2, "0"),
|
|
512
|
+
}, $ = (e) => String(e).padStart(2, "0"), ze = (e) => `${e.getFullYear()}-${$(e.getMonth() + 1)}-${$(e.getDate())} ${$(e.getHours())}-${$(e.getMinutes())}-${$(e.getSeconds())}`, Be = (e, t, n) => {
|
|
503
513
|
let r = e.lastIndexOf("."), i = r > 0, a = i ? e.slice(0, r) : e, o = i ? e.slice(r) : "", s = n === 0 ? "" : ` (${n + 1})`;
|
|
504
|
-
return `${a} ${
|
|
505
|
-
},
|
|
514
|
+
return `${a} ${ze(t)}${s}${o}`;
|
|
515
|
+
}, Ve = (e, n, i = {}) => {
|
|
506
516
|
let { screenshotName: a = "Screenshot.png", pastedTextName: s = "Pasted text" } = i;
|
|
507
517
|
return { handlePaste: o((i) => {
|
|
508
518
|
if (!i.clipboardData) return;
|
|
@@ -512,8 +522,8 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, pe = (e) =
|
|
|
512
522
|
for (let e of o) {
|
|
513
523
|
let i = e.getAsFile();
|
|
514
524
|
if (!i) continue;
|
|
515
|
-
let o =
|
|
516
|
-
id:
|
|
525
|
+
let o = Be(a, s, n.length), c = new File([i], o, { type: i.type }), l = {
|
|
526
|
+
id: fe(),
|
|
517
527
|
name: o,
|
|
518
528
|
contentType: i.type,
|
|
519
529
|
file: c,
|
|
@@ -529,7 +539,7 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, pe = (e) =
|
|
|
529
539
|
let l = i.clipboardData.getData("text/plain");
|
|
530
540
|
if (l.length > n) {
|
|
531
541
|
let n = l.trim(), a = (n.length > 80 ? `${n.slice(0, 80).trimEnd()}…` : n) || s, o = new File([l], a, { type: "text/plain" }), c = {
|
|
532
|
-
id:
|
|
542
|
+
id: fe(),
|
|
533
543
|
name: a,
|
|
534
544
|
contentType: "text/plain",
|
|
535
545
|
file: o,
|
|
@@ -544,6 +554,6 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, pe = (e) =
|
|
|
544
554
|
a,
|
|
545
555
|
s
|
|
546
556
|
]) };
|
|
547
|
-
},
|
|
557
|
+
}, He = 100;
|
|
548
558
|
//#endregion
|
|
549
|
-
export { Se as ATTACHMENT_COLLAPSE_THRESHOLD,
|
|
559
|
+
export { Se as ATTACHMENT_COLLAPSE_THRESHOLD, Y as ATTACHMENT_INPUT_CLASS, Me as AttachmentCard, Ie as AttachmentGroup, Ne as AttachmentTray, Re as FileDndOverlay, Q as LazyImageLoadStatus, He as MAX_UPLOADS_PER_MINUTE, fe as generateAttachmentId, J as getAttachmentCardState, ve as getAttachmentIcon, be as getExtFromContentType, pe as getNameWithoutExtension, _e as isMimeTypeAllowed, ge as mimeTypesToExtensionLabels, Ve 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.2.0-dev.
|
|
4
|
+
"version": "1.2.0-dev.69",
|
|
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.2.0-dev.
|
|
23
|
+
"@epam/ai-dial-chat-shared": "1.2.0-dev.69",
|
|
24
24
|
"react": "^19.2.8",
|
|
25
|
-
"@epam/ai-dial-ui-kit": "^0.
|
|
25
|
+
"@epam/ai-dial-ui-kit": "^0.15.0-dev.9"
|
|
26
26
|
},
|
|
27
27
|
"repository": {
|
|
28
28
|
"type": "git",
|