@epam/ai-dial-attachment-input 1.0.0-dev.462 → 1.0.0-dev.469

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":"AttachmentCard.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentCard/AttachmentCard.tsx"],"names":[],"mappings":"AAqBA,OAAO,EAAE,KAAK,EAAE,EAAgD,MAAM,OAAO,CAAC;AAK9E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAKvE,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAsVlD,CAAC"}
1
+ {"version":3,"file":"AttachmentCard.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentCard/AttachmentCard.tsx"],"names":[],"mappings":"AAqBA,OAAO,EAAE,KAAK,EAAE,EAAgD,MAAM,OAAO,CAAC;AAK9E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAKvE,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAsWlD,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { FC } from 'react';
2
+ import { AttachmentFileRowProps } from '../../models/AttachmentFileRow';
3
+ /**
4
+ * Non-previewable attachment tile: a uniform neutral square holding the
5
+ * glyph, extension label, and filename together (no external caption, no
6
+ * per-type color). Type is communicated by glyph + extension text only;
7
+ * color is reserved for upload state (failed = red tile + icon-only retry,
8
+ * uploading = progress bar). Download/retry are icon-only, matching the
9
+ * rest of the app.
10
+ */
11
+ export declare const AttachmentFileRow: FC<AttachmentFileRowProps>;
12
+ //# sourceMappingURL=AttachmentFileRow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AttachmentFileRow.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentFileRow/AttachmentFileRow.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAE,KAAK,EAAE,EAAuC,MAAM,OAAO,CAAC;AACrE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAU7E;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CAuKxD,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { FC } from 'react';
2
+ import { AttachmentGroupProps } from '../../models/AttachmentGroup';
3
+ /**
4
+ * Adaptive attachment group for an already-sent message: every attachment —
5
+ * image or file — renders as one uniform 84x84 rounded-square tile, wrapped
6
+ * in a single grid. 5+ attachments collapse behind a "+N" tile; expanding
7
+ * reveals a same-shaped collapse tile to show less again. Type is
8
+ * communicated by glyph + extension text only; color is reserved for
9
+ * upload state. Download actions are icon-only, matching the rest of the app.
10
+ */
11
+ export declare const AttachmentGroup: FC<AttachmentGroupProps>;
12
+ //# sourceMappingURL=AttachmentGroup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AttachmentGroup.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentGroup/AttachmentGroup.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,KAAK,EAAE,EAAqB,MAAM,OAAO,CAAC;AACnD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAczE;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CAqJpD,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { FC } from 'react';
2
+ import { AttachmentMoreTileProps } from '../../models/AttachmentMoreTile';
3
+ /**
4
+ * Square placeholder tile shown in the attachment grid: a "+N" tile when
5
+ * collapsed (activating it expands the group), or — via `children` — a
6
+ * collapse-icon tile in the same tile form for "show less".
7
+ */
8
+ export declare const AttachmentMoreTile: FC<AttachmentMoreTileProps>;
9
+ //# sourceMappingURL=AttachmentMoreTile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AttachmentMoreTile.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentMoreTile/AttachmentMoreTile.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAG/E;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC,uBAAuB,CAmB1D,CAAC"}
package/index.css CHANGED
@@ -1,2 +1,2 @@
1
- ._card_11tpd_1{border-color:var(--ci-card-border,var(--stroke-secondary,#d1dbea));background:var(--ci-card-bg,var(--bg-layer-0,#fcfcfc))}._cardError_11tpd_6{border-color:var(--ci-card-border-error,var(--stroke-error,#ae2f2f))}._cardSelected_11tpd_10{background:var(--ci-card-bg-selected,var(--bg-accent-primary-alpha,#7da4ff2e));border-color:var(--ci-card-border-selected,var(--stroke-accent-primary,#124ace))}._cardPrompt_11tpd_15:hover,._cardPasted_11tpd_16:hover{background:var(--ci-card-bg-hover,var(--controls-bg-neutral-hover,#d1dbea))}._name_11tpd_20{color:var(--ci-card-name,var(--text-primary,#161b2d))}._meta_11tpd_24{color:var(--ci-card-meta,var(--text-secondary,#575f73))}._loadingOverlay_11tpd_28{background:var(--ci-loading-overlay-bg,var(--bg-blackout,#0c101d4d))}._actionBtn_11tpd_32{color:var(--ci-card-action-color,var(--text-primary,#161b2d))}._actionBtn_11tpd_32:hover{background:var(--ci-card-remove-bg-hover,var(--bg-layer-3,#fcfcfc))}._card_11tpd_1:focus-within{outline-color:var(--ci-card-focus-outline,var(--controls-stroke-focus,#eef1f7))}._removeBtnImage_11tpd_43{background:var(--ci-card-remove-bg,var(--bg-layer-2,#eef1f7));color:var(--ci-card-remove-color,var(--text-primary,#161b2d))}._removeBtnImage_11tpd_43:hover{background:var(--ci-card-remove-bg-hover,var(--bg-layer-3,#fcfcfc))}
1
+ ._card_1wsze_1{border-color:var(--ci-card-border,var(--stroke-secondary,#d1dbea));background:var(--ci-card-bg,var(--bg-layer-0,#fcfcfc))}._cardError_1wsze_6{border-color:var(--ci-card-border-error,var(--stroke-error,#ae2f2f))}._cardSelected_1wsze_10{background:var(--ci-card-bg-selected,var(--bg-accent-primary-alpha,#7da4ff2e));border-color:var(--ci-card-border-selected,var(--stroke-accent-primary,#124ace))}._cardPrompt_1wsze_15:hover,._cardPasted_1wsze_16:hover{background:var(--ci-card-bg-hover,var(--controls-bg-neutral-hover,#d1dbea))}._name_1wsze_20{color:var(--ci-card-name,var(--text-primary,#161b2d))}._meta_1wsze_24{color:var(--ci-card-meta,var(--text-secondary,#575f73))}._loadingOverlay_1wsze_28{background:var(--ci-loading-overlay-bg,var(--bg-blackout,#0c101d4d))}._actionBtn_1wsze_32{color:var(--ci-card-action-color,var(--text-primary,#161b2d))}._actionBtn_1wsze_32:hover{background:var(--ci-card-remove-bg-hover,var(--bg-layer-3,#fcfcfc))}._card_1wsze_1:focus-within{outline-color:var(--ci-card-focus-outline,var(--controls-stroke-focus,#eef1f7))}._removeBtnImage_1wsze_43{background:var(--ci-card-remove-bg,var(--bg-layer-2,#eef1f7));color:var(--ci-card-remove-color,var(--text-primary,#161b2d))}._removeBtnImage_1wsze_43:hover{background:var(--ci-card-remove-bg-hover,var(--bg-layer-3,#fcfcfc))}._hoverDownloadIcon_1wsze_51{background:var(--ci-card-hover-icon-bg,var(--bg-layer-2,#161b2d));color:var(--ci-card-hover-icon-color,var(--text-primary,#eef1f7))}._tile_1x7ag_2{background:var(--ci-tile-bg,var(--bg-layer-3,#1d2439));border-color:var(--ci-tile-border,var(--stroke-secondary,#d1dbea))}._tile_1x7ag_2:hover{border-color:var(--ci-tile-border-hover,#0000001f)}._tile_1x7ag_2:focus-visible{outline-color:var(--ci-tile-focus-outline,var(--controls-stroke-focus,#eef1f7))}._tileLight_1x7ag_27{background:var(--ci-tile-bg,var(--bg-layer-6,#f8fafc))}._tileError_1x7ag_31{background:var(--ci-tile-bg-error,var(--bg-error,#402027));border-color:var(--ci-tile-border-error,var(--stroke-error,#f76464))}._tileError_1x7ag_31:hover{border-color:var(--ci-tile-border-error,var(--stroke-error,#f76464))}._tileError_1x7ag_31 ._nameText_1x7ag_38,._tileError_1x7ag_31 ._typeText_1x7ag_39{color:var(--ci-tile-error-text,var(--text-error,#ae2f2f))}._nameText_1x7ag_38{color:var(--ci-tile-name-text,var(--text-primary,#161b2d))}._typeText_1x7ag_39{color:var(--ci-tile-type-text,var(--text-secondary,#575f73))}._retryIcon_1x7ag_51{color:var(--ci-tile-error-text,var(--text-error,#ae2f2f))}._hoverIcon_1x7ag_55{background:var(--ci-tile-hover-icon-bg,var(--bg-layer-2,#161b2d));color:var(--ci-tile-hover-icon-color,var(--text-primary,#eef1f7))}._track_1x7ag_60{background:var(--ci-tile-track-bg,var(--bg-layer-1,#0c101d))}._indeterminateFill_1x7ag_64{background:var(--ci-tile-fill-bg,var(--bg-accent-primary,#5c8dea));animation:1.2s ease-in-out infinite _attachment-tile-indeterminate_1x7ag_1}@media (prefers-reduced-motion:reduce){._indeterminateFill_1x7ag_64{animation:none}}@keyframes _attachment-tile-indeterminate_1x7ag_1{0%{transform:translate(-100%)}to{transform:translate(300%)}}._tile_kvom5_1{background:var(--ci-more-tile-bg,var(--bg-layer-2,#161b2d));border-color:var(--ci-more-tile-border,var(--stroke-secondary,#d1dbea));color:var(--ci-more-tile-color,var(--text-secondary,#575f73))}._tile_kvom5_1:hover{background:var(--ci-more-tile-bg-hover,var(--bg-accent-primary-alpha,#7da4ff2e));color:var(--ci-more-tile-color-hover,var(--bg-accent-primary,#2764d9));border-color:var(--ci-more-tile-border-hover,color-mix(in srgb, var(--stroke-accent-primary,#7da4ff) 50%, transparent))}._tile_kvom5_1:focus-visible{outline-color:var(--ci-more-tile-focus-outline,var(--controls-stroke-focus,#eef1f7))}._container_4zxg9_1{background:var(--ci-group-bg,var(--bg-layer-2,#161b2d));border-color:var(--ci-group-border,var(--stroke-secondary,#d1dbea))}._headerIcon_4zxg9_6,._headerLabel_4zxg9_7,._downloadAllButton_4zxg9_8{color:var(--text-secondary,#575f73)}._imageTile_4zxg9_12{--ci-card-bg:var(--bg-layer-3,#1d2439)}
2
2
  /*$vite$:1*/
package/index.d.ts CHANGED
@@ -1,15 +1,23 @@
1
1
  export { AttachmentCard } from './components/AttachmentCard/AttachmentCard';
2
2
  export { AttachmentTray } from './components/AttachmentTray/AttachmentTray';
3
+ export { AttachmentGroup } from './components/AttachmentGroup/AttachmentGroup';
4
+ export { AttachmentFileRow } from './components/AttachmentFileRow/AttachmentFileRow';
5
+ export { AttachmentMoreTile } from './components/AttachmentMoreTile/AttachmentMoreTile';
3
6
  export { FileDndOverlay } from './components/FileDndOverlay/FileDndOverlay';
4
7
  export type { AttachmentCardProps, AttachmentCardColors, AttachmentCardTypography, } from './models/AttachmentCard';
5
8
  export type { AttachmentTrayProps } from './models/AttachmentTray';
9
+ export type { AttachmentGroupProps } from './models/AttachmentGroup';
10
+ export type { AttachmentFileRowProps } from './models/AttachmentFileRow';
11
+ export type { AttachmentMoreTileProps } from './models/AttachmentMoreTile';
6
12
  export type { FileDndOverlayProps } from './models/FileDndOverlay';
7
13
  export { useClipboardPaste } from './hooks/useClipboardPaste';
8
14
  export { useLazyImageLoad, LazyImageLoadStatus, } from './hooks/useLazyImageLoad';
9
15
  export { generateAttachmentId } from './utils/generateAttachmentId';
10
- export { getAttachmentCardState } from './utils/getAttachmentCardState';
16
+ export { getAttachmentCardState, getExtFromContentType, } from './utils/getAttachmentCardState';
11
17
  export type { AttachmentCardState } from './utils/getAttachmentCardState';
12
18
  export { getAttachmentIcon } from './utils/getAttachmentIcon';
19
+ export { getAttachmentTilesPlan, AttachmentTilesLayout, ATTACHMENT_COLLAPSE_THRESHOLD, ATTACHMENT_COLLAPSED_VISIBLE_COUNT, } from './utils/getAttachmentGroupLayout';
20
+ export type { AttachmentTilesPlan } from './utils/getAttachmentGroupLayout';
13
21
  export { getNameWithoutExtension } from './utils/getNameWithoutExtension';
14
22
  export { mimeTypesToExtensionLabels, isMimeTypeAllowed, } from './utils/attachment-mime';
15
23
  export { MAX_UPLOADS_PER_MINUTE } from './constants/upload';
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,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAE5E,YAAY,EACV,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,yBAAyB,CAAC;AACjC,YAAY,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnE,YAAY,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EACL,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,YAAY,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EACL,0BAA0B,EAC1B,iBAAiB,GAClB,MAAM,yBAAyB,CAAC;AAEjC,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,iBAAiB,EAAE,MAAM,kDAAkD,CAAC;AACrF,OAAO,EAAE,kBAAkB,EAAE,MAAM,oDAAoD,CAAC;AACxF,OAAO,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAE5E,YAAY,EACV,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,yBAAyB,CAAC;AACjC,YAAY,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnE,YAAY,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACrE,YAAY,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACzE,YAAY,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAC3E,YAAY,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EACL,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EACL,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,gCAAgC,CAAC;AACxC,YAAY,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,6BAA6B,EAC7B,kCAAkC,GACnC,MAAM,kCAAkC,CAAC;AAC1C,YAAY,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EACL,0BAA0B,EAC1B,iBAAiB,GAClB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC"}
package/index.js CHANGED
@@ -1,16 +1,16 @@
1
- import { AttachmentErrorReason as e, AttachmentType as t, Highlight as n, MIME_TYPE_EXT_MAP as r, RequestStatus as i, buildCssVars as a, mergeClasses as o } from "@epam/ai-dial-chat-shared";
2
- import { DIAL_ICON_SIZE as s, DialGhostIconButton as c, DialSkeleton as l, DialSkeletonVariant as u, DialSpinner as d, ElementSize as f } from "@epam/ai-dial-ui-kit";
3
- import { IconClipboard as p, IconDownload as ee, IconFile as m, IconFileDescription as h, IconFileTypeBmp as g, IconFileTypeCss as _, IconFileTypeCsv as v, IconFileTypeDoc as te, IconFileTypeDocx as ne, IconFileTypeHtml as y, IconFileTypeJpg as b, IconFileTypeJs as x, IconFileTypeJsx as S, IconFileTypePdf as C, IconFileTypePhp as w, IconFileTypePng as T, IconFileTypePpt as E, IconFileTypeRs as D, IconFileTypeSql as O, IconFileTypeSvg as k, IconFileTypeTs as A, IconFileTypeTsx as j, IconFileTypeTxt as M, IconFileTypeVue as N, IconFileTypeXls as P, IconFileTypeXml as F, IconFileTypeZip as re, IconFileX as ie, IconMusic as I, IconPhoto as L, IconReload as ae, IconTerminal2 as R, IconVideo as z, IconX as oe } from "@tabler/icons-react";
4
- import { useCallback as B, useEffect as V, useMemo as se, useRef as H, useState as U } from "react";
5
- import { Fragment as W, jsx as G, jsxs as K } from "react/jsx-runtime";
1
+ import { AttachmentErrorReason as e, AttachmentType as t, CodeBlockTheme as n, Highlight as r, MIME_TYPE_EXT_MAP as i, RequestStatus as a, buildCssVars as o, mergeClasses as s } from "@epam/ai-dial-chat-shared";
2
+ import { DIAL_ICON_SIZE as c, DialGhostIconButton as l, DialSkeleton as u, DialSkeletonVariant as d, DialSpinner as f, ElementSize as p } from "@epam/ai-dial-ui-kit";
3
+ import { IconChevronUp as m, IconClipboard as h, IconDownload as g, IconFile as _, IconFileDescription as v, IconFileTypeBmp as y, IconFileTypeCss as b, IconFileTypeCsv as x, IconFileTypeDoc as 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 ee, IconFileTypeXls as te, IconFileTypeXml as ne, IconFileTypeZip as R, IconFileX as z, IconMusic as B, IconPaperclip as V, IconPhoto as H, IconReload as re, IconTerminal2 as ie, IconVideo as ae, IconX as oe } from "@tabler/icons-react";
4
+ import { useCallback as U, useEffect as W, useMemo as se, useRef as ce, useState as G } from "react";
5
+ import { Fragment as K, jsx as q, jsxs as J } from "react/jsx-runtime";
6
6
  //#region src/hooks/useLazyImageLoad.ts
7
- var q = /* @__PURE__ */ function(e) {
7
+ var Y = /* @__PURE__ */ function(e) {
8
8
  return e.Idle = "idle", e.Loading = "loading", e.Loaded = "loaded", e.Error = "error", e;
9
- }({}), ce = ({ enabled: e, src: t }) => {
10
- let n = H(null), [r, i] = U("idle");
11
- return V(() => {
9
+ }({}), le = ({ enabled: e, src: t }) => {
10
+ let n = ce(null), [r, i] = G("idle");
11
+ return W(() => {
12
12
  i(e && t ? "loading" : "idle");
13
- }, [e, t]), V(() => {
13
+ }, [e, t]), W(() => {
14
14
  let r = n.current;
15
15
  if (!r || !e || !t) return;
16
16
  let a = () => i("loaded"), o = () => i("error");
@@ -21,327 +21,521 @@ var q = /* @__PURE__ */ function(e) {
21
21
  imageRef: n,
22
22
  imageLoadStatus: r
23
23
  };
24
- }, J = {
25
- card: "_card_11tpd_1",
26
- cardError: "_cardError_11tpd_6",
27
- cardSelected: "_cardSelected_11tpd_10",
28
- cardPrompt: "_cardPrompt_11tpd_15",
29
- cardPasted: "_cardPasted_11tpd_16",
30
- name: "_name_11tpd_20",
31
- meta: "_meta_11tpd_24",
32
- loadingOverlay: "_loadingOverlay_11tpd_28",
33
- actionBtn: "_actionBtn_11tpd_32",
34
- removeBtnImage: "_removeBtnImage_11tpd_43"
35
- }, Y = (e) => {
36
- if (!e) return m;
24
+ }, X = {
25
+ card: "_card_1wsze_1",
26
+ cardError: "_cardError_1wsze_6",
27
+ cardSelected: "_cardSelected_1wsze_10",
28
+ cardPrompt: "_cardPrompt_1wsze_15",
29
+ cardPasted: "_cardPasted_1wsze_16",
30
+ name: "_name_1wsze_20",
31
+ meta: "_meta_1wsze_24",
32
+ loadingOverlay: "_loadingOverlay_1wsze_28",
33
+ actionBtn: "_actionBtn_1wsze_32",
34
+ removeBtnImage: "_removeBtnImage_1wsze_43",
35
+ hoverDownloadIcon: "_hoverDownloadIcon_1wsze_51"
36
+ }, Z = (e) => {
37
+ if (!e) return _;
37
38
  if (e.startsWith("image/")) switch (e) {
38
39
  case "image/jpeg":
39
- case "image/jpg": return b;
40
- case "image/png": return T;
41
- case "image/svg+xml": return k;
42
- case "image/bmp": return g;
43
- default: return L;
40
+ case "image/jpg": return T;
41
+ case "image/png": return A;
42
+ case "image/svg+xml": return P;
43
+ case "image/bmp": return y;
44
+ default: return H;
44
45
  }
45
- if (e.startsWith("video/")) return z;
46
- if (e.startsWith("audio/")) return I;
46
+ if (e.startsWith("video/")) return ae;
47
+ if (e.startsWith("audio/")) return B;
47
48
  switch (e) {
48
- case "application/pdf": return C;
49
+ case "application/pdf": return O;
49
50
  case "application/msword":
50
- case "application/vnd.ms-word": return te;
51
- case "application/vnd.openxmlformats-officedocument.wordprocessingml.document": return ne;
52
- case "application/vnd.ms-powerpoint": return E;
53
- case "application/vnd.openxmlformats-officedocument.presentationml.presentation": return E;
54
- case "application/vnd.ms-excel": return P;
55
- case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": return P;
51
+ case "application/vnd.ms-word": return S;
52
+ case "application/vnd.openxmlformats-officedocument.wordprocessingml.document": return C;
53
+ case "application/vnd.ms-powerpoint": return j;
54
+ case "application/vnd.openxmlformats-officedocument.presentationml.presentation": return j;
55
+ case "application/vnd.ms-excel": return te;
56
+ case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": return te;
56
57
  case "application/zip":
57
58
  case "application/x-zip-compressed":
58
59
  case "application/x-rar-compressed":
59
60
  case "application/x-7z-compressed":
60
61
  case "application/gzip":
61
- case "application/x-tar": return re;
62
- case "text/csv": return v;
63
- case "text/plain": return M;
62
+ case "application/x-tar": return R;
63
+ case "text/csv": return x;
64
+ case "text/plain": return L;
64
65
  case "text/html":
65
- case "application/xhtml+xml": return y;
66
+ case "application/xhtml+xml": return w;
66
67
  case "text/xml":
67
- case "application/xml": return F;
68
+ case "application/xml": return ne;
68
69
  case "application/sql":
69
- case "text/x-sql": return O;
70
+ case "text/x-sql": return N;
70
71
  case "text/javascript":
71
- case "application/javascript": return x;
72
- case "text/jsx": return S;
72
+ case "application/javascript": return E;
73
+ case "text/jsx": return D;
73
74
  case "application/typescript":
74
- case "text/typescript": return A;
75
- case "text/tsx": return j;
76
- case "text/css": return _;
75
+ case "text/typescript": return F;
76
+ case "text/tsx": return I;
77
+ case "text/css": return b;
77
78
  case "text/x-php":
78
- case "application/x-php": return w;
79
+ case "application/x-php": return k;
79
80
  case "text/x-rustsrc":
80
- case "application/x-rust": return D;
81
- case "text/x-vue": return N;
82
- default: return m;
81
+ case "application/x-rust": return M;
82
+ case "text/x-vue": return ee;
83
+ default: return _;
83
84
  }
84
- }, X = (e) => {
85
+ }, ue = (e) => {
85
86
  let { type: n, contentType: r } = e;
86
- return n === t.Prompt ? R : n === t.Pasted ? p : n === t.Image ? L : Y(r ?? "");
87
- }, Z = (e) => {
88
- let t = e.toLowerCase().split(";")[0].trim(), n = r[t];
87
+ return n === t.Prompt ? ie : n === t.Pasted ? h : n === t.Image ? H : Z(r ?? "");
88
+ }, de = (e) => {
89
+ let t = e.toLowerCase().split(";")[0].trim(), n = i[t];
89
90
  if (n) return n;
90
- let i = t.split("/")[1];
91
- if (i && !i.startsWith("vnd.") && !i.includes("+")) return i;
92
- }, le = (e) => {
91
+ let r = t.split("/")[1];
92
+ if (r && !r.startsWith("vnd.") && !r.includes("+")) return r;
93
+ }, fe = (e) => {
93
94
  let { type: n, name: r, contentType: i } = e;
94
95
  if (n === t.Prompt) return "Prompt";
95
96
  if (n === t.Pasted) return "Pasted";
96
97
  if (n === t.Image) return "Image";
97
98
  if (i) {
98
- let e = Z(i);
99
+ let e = de(i);
99
100
  if (e) return `.${e}`;
100
101
  }
101
102
  let a = r.lastIndexOf(".");
102
103
  return a > 0 && a < r.length - 1 ? `.${r.slice(a + 1).toLowerCase()}` : r;
103
- }, ue = (e, n, r) => {
104
- let { type: a, status: s, previewUrl: c, url: l } = e, u = s === i.Loading, d = s === i.Error, f = a === t.Image && !!(c ?? l) && !d, p = a === t.Audio && !d, ee = o(J.card, d && J.cardError, n && J.cardSelected, !d && !n && a === t.Prompt && J.cardPrompt, !d && !n && a === t.Pasted && J.cardPasted);
104
+ }, pe = (e, n, r) => {
105
+ let { type: i, status: o, previewUrl: c, url: l } = e, u = o === a.Loading, d = o === a.Error, f = i === t.Image && !!(c ?? l) && !d, p = i === t.Audio && !d, m = s(X.card, d && X.cardError, n && X.cardSelected, !d && !n && i === t.Prompt && X.cardPrompt, !d && !n && i === t.Pasted && X.cardPasted);
105
106
  return {
106
107
  isLoading: u,
107
108
  isError: d,
108
109
  isImage: f,
109
110
  isAudio: p,
110
111
  areActionsVisible: d || r,
111
- BottomIcon: X(e),
112
- typeLabel: le(e),
113
- cardColorClass: ee,
114
- removeBtnClass: f ? J.removeBtnImage : J.actionBtn
112
+ BottomIcon: ue(e),
113
+ typeLabel: fe(e),
114
+ cardColorClass: m,
115
+ removeBtnClass: f ? X.removeBtnImage : X.actionBtn
115
116
  };
116
- }, Q = (e) => {
117
+ }, me = (e) => {
117
118
  let t = e.lastIndexOf(".");
118
119
  return t > 0 ? e.slice(0, t) : e;
119
- }, de = ({ attachment: r, searchQuery: i = "", onRemove: p, onRetry: m, onExpand: h, onClick: g, isSelected: _, shouldAlwaysShowActions: v, removeLabel: te = "Remove attachment", retryLabel: ne = "Retry upload", clickLabel: y = "Open attachment", colors: b, typography: x, roundedClassName: S = "rounded", className: C }) => {
120
- let { id: w, name: T } = r, E = r.previewUrl ?? r.url, D = r.type === t.Pasted, O = D && h !== void 0, k = g !== void 0 && !O, A = O || k, j = se(() => D ? T : Q(T), [D, T]), M = a({
121
- "--ci-card-border": b?.border,
122
- "--ci-card-bg": b?.background,
123
- "--ci-card-name": b?.nameText,
124
- "--ci-card-meta": b?.metaText
125
- }), { isLoading: N, isError: P, isImage: F, isAudio: re, areActionsVisible: ie, BottomIcon: I, typeLabel: R, cardColorClass: z, removeBtnClass: B } = se(() => ue(r, _ ?? !1, v ?? !1), [
126
- r,
127
- _,
128
- v
129
- ]), { imageRef: V, imageLoadStatus: H } = ce({
130
- enabled: F,
131
- src: E
132
- }), U = () => {
133
- O && h ? h(w) : k && g && g(w);
134
- }, Y = (e) => {
135
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), U());
120
+ }, he = ({ attachment: n, searchQuery: i = "", onRemove: a, onRetry: m, onExpand: h, onClick: _, isSelected: v, shouldAlwaysShowActions: y, removeLabel: b = "Remove attachment", retryLabel: x = "Retry upload", clickLabel: S = "Open attachment", colors: C, typography: w, roundedClassName: T = "rounded-xl", showHoverDownloadIcon: E = !1, className: D }) => {
121
+ let { id: O, name: k } = n, A = n.previewUrl ?? n.url, j = n.type === t.Pasted, M = j && h !== void 0, N = se(() => j ? k : me(k), [j, k]), P = o({
122
+ "--ci-card-border": C?.border,
123
+ "--ci-card-bg": C?.background,
124
+ "--ci-card-name": C?.nameText,
125
+ "--ci-card-meta": C?.metaText
126
+ }), { isLoading: F, isError: I, isImage: L, isAudio: ee, areActionsVisible: te, BottomIcon: ne, typeLabel: R, cardColorClass: z, removeBtnClass: B } = se(() => pe(n, v ?? !1, y ?? !1), [
127
+ n,
128
+ v,
129
+ y
130
+ ]), V = _ !== void 0 && !M && !F && !I, ie = M || V, { imageRef: ae, imageLoadStatus: U } = le({
131
+ enabled: L,
132
+ src: A
133
+ }), W = () => {
134
+ M && h ? h(O) : V && _ && _(O);
135
+ }, ce = (e) => {
136
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), W());
136
137
  };
137
- if (re) return /* @__PURE__ */ K("div", {
138
- style: M,
139
- className: o("group flex w-full min-w-[280px] max-w-[300px] flex-col gap-2 border p-3", S, z, C),
140
- children: [/* @__PURE__ */ K("div", {
138
+ if (ee) return /* @__PURE__ */ J("div", {
139
+ style: P,
140
+ className: s("group flex w-full min-w-[280px] max-w-[300px] flex-col gap-2 border p-3", T, z, D),
141
+ children: [/* @__PURE__ */ J("div", {
141
142
  className: "flex items-center justify-between gap-2",
142
- children: [/* @__PURE__ */ G("span", {
143
- title: r.name,
144
- className: o(x?.fontClassName ?? "dial-tiny-text", "min-w-0 truncate", J.name),
145
- children: i ? /* @__PURE__ */ G(n, {
146
- text: r.name,
143
+ children: [/* @__PURE__ */ q("span", {
144
+ title: n.name,
145
+ className: s(w?.fontClassName ?? "dial-tiny-text", "min-w-0 truncate", X.name),
146
+ children: i ? /* @__PURE__ */ q(r, {
147
+ text: n.name,
147
148
  query: i,
148
149
  maxLines: 1
149
- }) : r.name
150
- }), g && /* @__PURE__ */ G(c, {
151
- icon: /* @__PURE__ */ G(ee, {
152
- size: s.SM,
150
+ }) : n.name
151
+ }), _ && /* @__PURE__ */ q(l, {
152
+ icon: /* @__PURE__ */ q(g, {
153
+ size: c.SM,
153
154
  "aria-hidden": !0
154
155
  }),
155
- size: f.Small,
156
- className: o("h-6 w-6 shrink-0 rounded", B),
157
- "aria-label": y,
156
+ size: p.Small,
157
+ className: s("h-6 w-6 shrink-0 rounded", B),
158
+ "aria-label": S,
158
159
  onClick: (e) => {
159
- e.stopPropagation(), g(w);
160
+ e.stopPropagation(), _(O);
160
161
  }
161
162
  })]
162
- }), r.playUrl && /* @__PURE__ */ G("audio", {
163
+ }), n.playUrl && /* @__PURE__ */ q("audio", {
163
164
  controls: !0,
164
- src: r.playUrl,
165
+ src: n.playUrl,
165
166
  className: "w-full",
166
167
  preload: "metadata"
167
168
  })]
168
169
  });
169
- let X = o("group relative flex h-[100px] w-[100px] flex-shrink-0 border focus-within:outline focus-within:outline-1 focus-within:outline-offset-1", S, z, !F && "flex-col gap-3 p-3", A && "cursor-pointer", C), Z = /* @__PURE__ */ K(W, { children: [
170
- F ? /* @__PURE__ */ K("div", {
170
+ let G = s("group relative flex h-[100px] w-[100px] flex-shrink-0 border focus-within:outline focus-within:outline-1 focus-within:outline-offset-1", T, z, !L && "flex-col gap-3 p-3", ie && "cursor-pointer", D), Z = /* @__PURE__ */ J(K, { children: [
171
+ L ? /* @__PURE__ */ J("div", {
171
172
  className: "relative h-full w-full overflow-hidden",
172
- children: [H !== q.Loaded && /* @__PURE__ */ G(l, {
173
- variant: u.Rectangular,
173
+ children: [U !== Y.Loaded && /* @__PURE__ */ q(u, {
174
+ variant: d.Rectangular,
174
175
  width: "100%",
175
176
  height: "100%",
176
- active: H === q.Loading,
177
- overlay: /* @__PURE__ */ G(L, {
178
- size: s.LG,
179
- className: x?.placeholderIconClassName ?? "text-secondary",
177
+ active: U === Y.Loading,
178
+ overlay: /* @__PURE__ */ q(H, {
179
+ size: c.LG,
180
+ className: w?.placeholderIconClassName ?? "text-secondary",
180
181
  "aria-hidden": !0
181
182
  }),
182
- className: o("absolute inset-0", S)
183
- }), /* @__PURE__ */ G("img", {
184
- ref: V,
185
- src: E,
186
- alt: T,
183
+ className: s("absolute inset-0", T)
184
+ }), /* @__PURE__ */ q("img", {
185
+ ref: ae,
186
+ src: A,
187
+ alt: k,
187
188
  loading: "lazy",
188
189
  decoding: "async",
189
- className: o("h-full w-full object-cover transition-opacity duration-200", H === q.Loaded ? "opacity-100" : "opacity-0", S)
190
+ className: s("h-full w-full object-cover transition-opacity duration-200", U === Y.Loaded ? "opacity-100" : "opacity-0", T)
190
191
  })]
191
- }) : P ? /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ K("div", {
192
+ }) : I ? /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ J("div", {
192
193
  className: "flex flex-row items-center gap-1 overflow-hidden",
193
- children: [/* @__PURE__ */ G(I, {
194
- size: s.SM,
195
- className: o("shrink-0", J.meta),
194
+ children: [/* @__PURE__ */ q(ne, {
195
+ size: c.SM,
196
+ className: s("shrink-0", X.meta),
196
197
  "aria-hidden": !0
197
- }), /* @__PURE__ */ G("span", {
198
+ }), /* @__PURE__ */ q("span", {
198
199
  title: R,
199
- className: o(x?.metaClassName ?? "dial-tiny-text", "min-w-0 truncate", J.meta),
200
+ className: s(w?.metaClassName ?? "dial-tiny-text", "min-w-0 truncate", X.meta),
200
201
  children: R
201
202
  })]
202
- }), /* @__PURE__ */ G("div", {
203
+ }), /* @__PURE__ */ q("div", {
203
204
  className: "min-w-0 flex-1",
204
- children: /* @__PURE__ */ G("div", {
205
- title: j,
206
- className: o(x?.fontClassName ?? "dial-tiny-text", "line-clamp-3 break-words", J.name),
207
- children: i ? /* @__PURE__ */ G(n, {
208
- text: j,
205
+ children: /* @__PURE__ */ q("div", {
206
+ title: N,
207
+ className: s(w?.fontClassName ?? "dial-tiny-text", "line-clamp-3 break-words", X.name),
208
+ children: i ? /* @__PURE__ */ q(r, {
209
+ text: N,
209
210
  query: i,
210
211
  maxLines: 3
211
- }) : j
212
+ }) : N
212
213
  })
213
- })] }) : /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G("div", {
214
+ })] }) : /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q("div", {
214
215
  className: "min-w-0 flex-1",
215
- children: /* @__PURE__ */ G("div", {
216
- title: j,
217
- className: o(x?.fontClassName ?? "dial-tiny-text", "line-clamp-3 break-words", J.name),
218
- children: i ? /* @__PURE__ */ G(n, {
219
- text: j,
216
+ children: /* @__PURE__ */ q("div", {
217
+ title: N,
218
+ className: s(w?.fontClassName ?? "dial-tiny-text", "line-clamp-3 break-words", X.name),
219
+ children: i ? /* @__PURE__ */ q(r, {
220
+ text: N,
220
221
  query: i,
221
222
  maxLines: 3
222
- }) : j
223
+ }) : N
223
224
  })
224
- }), /* @__PURE__ */ K("div", {
225
+ }), /* @__PURE__ */ J("div", {
225
226
  className: "flex flex-row items-center gap-1 overflow-hidden",
226
- children: [/* @__PURE__ */ G(I, {
227
- size: s.SM,
228
- className: o("shrink-0", J.meta),
227
+ children: [/* @__PURE__ */ q(ne, {
228
+ size: c.SM,
229
+ className: s("shrink-0", X.meta),
229
230
  "aria-hidden": !0
230
- }), /* @__PURE__ */ G("span", {
231
+ }), /* @__PURE__ */ q("span", {
231
232
  title: R,
232
- className: o(x?.metaClassName ?? "dial-tiny-text", "min-w-0 truncate", J.meta),
233
+ className: s(w?.metaClassName ?? "dial-tiny-text", "min-w-0 truncate", X.meta),
233
234
  children: R
234
235
  })]
235
236
  })] }),
236
- N && /* @__PURE__ */ G("span", {
237
- className: o("absolute inset-0 flex items-center justify-center", S, J.loadingOverlay),
238
- children: /* @__PURE__ */ G(d, {
237
+ F && /* @__PURE__ */ q("span", {
238
+ className: s("absolute inset-0 flex items-center justify-center", T, X.loadingOverlay),
239
+ children: /* @__PURE__ */ q(f, {
239
240
  size: 40,
240
241
  ariaLabel: "Loading attachment",
241
242
  className: "z-50"
242
243
  })
243
244
  }),
244
- !N && /* @__PURE__ */ K("div", {
245
- className: o("absolute end-1 top-1 flex gap-1 transition-opacity", ie ? "opacity-100" : "opacity-0 group-focus-within:opacity-100 group-hover:opacity-100 mobile:opacity-100"),
246
- children: [P && m && r.errorReason !== e.UnsupportedType && /* @__PURE__ */ G(c, {
247
- icon: /* @__PURE__ */ G(ae, {
248
- size: s.SM,
249
- "aria-hidden": !0
245
+ !F && /* @__PURE__ */ J("div", {
246
+ className: s("absolute end-1 top-1 flex gap-1 transition-opacity", te ? "opacity-100" : "opacity-0 group-focus-within:opacity-100 group-hover:opacity-100 mobile:opacity-100"),
247
+ children: [
248
+ I && m && n.errorReason !== e.UnsupportedType && /* @__PURE__ */ q(l, {
249
+ icon: /* @__PURE__ */ q(re, {
250
+ size: c.SM,
251
+ "aria-hidden": !0
252
+ }),
253
+ size: p.Small,
254
+ className: s("h-6 w-6 rounded", B),
255
+ "aria-label": x,
256
+ onClick: (e) => {
257
+ e.stopPropagation(), m(O);
258
+ }
250
259
  }),
251
- size: f.Small,
252
- className: o("h-6 w-6 rounded", B),
253
- "aria-label": ne,
254
- onClick: (e) => {
255
- e.stopPropagation(), m(w);
256
- }
257
- }), p && /* @__PURE__ */ G(c, {
258
- icon: /* @__PURE__ */ G(oe, {
259
- size: s.SM,
260
- "aria-hidden": !0
260
+ a && /* @__PURE__ */ q(l, {
261
+ icon: /* @__PURE__ */ q(oe, {
262
+ size: c.SM,
263
+ "aria-hidden": !0
264
+ }),
265
+ size: p.Small,
266
+ className: s("h-6 w-6 rounded", B),
267
+ "aria-label": b,
268
+ onClick: (e) => {
269
+ e.stopPropagation(), a?.(O);
270
+ }
261
271
  }),
262
- size: f.Small,
263
- className: o("h-6 w-6 rounded", B),
264
- "aria-label": te,
265
- onClick: (e) => {
266
- e.stopPropagation(), p?.(w);
267
- }
268
- })]
272
+ E && !a && !I && /* @__PURE__ */ q(g, {
273
+ size: c.SM,
274
+ "aria-hidden": !0,
275
+ className: s("h-6 w-6 rounded-lg p-1", X.hoverDownloadIcon)
276
+ })
277
+ ]
269
278
  })
270
279
  ] });
271
- return A ? /* @__PURE__ */ G("div", {
272
- style: M,
273
- className: X,
274
- onClick: U,
275
- onKeyDown: Y,
280
+ return ie ? /* @__PURE__ */ q("div", {
281
+ style: P,
282
+ className: G,
283
+ onClick: W,
284
+ onKeyDown: ce,
276
285
  tabIndex: 0,
277
286
  role: "button",
278
- "aria-label": k ? y : void 0,
287
+ "aria-label": V ? S : void 0,
279
288
  children: Z
280
- }) : /* @__PURE__ */ G("div", {
281
- style: M,
282
- className: X,
289
+ }) : /* @__PURE__ */ q("div", {
290
+ style: P,
291
+ className: G,
283
292
  children: Z
284
293
  });
285
- }, fe = ({ attachments: e, onRemove: t, onRetry: n, onExpand: r, ariaLabel: i = "Attached files", removeLabel: a, retryLabel: s, onAttachmentClick: c, clickLabel: l, className: u }) => e.length === 0 ? null : /* @__PURE__ */ G("div", {
294
+ }, ge = ({ attachments: e, onRemove: t, onRetry: n, onExpand: r, ariaLabel: i = "Attached files", removeLabel: a, retryLabel: o, onAttachmentClick: c, clickLabel: l, className: u }) => e.length === 0 ? null : /* @__PURE__ */ q("div", {
286
295
  role: "list",
287
296
  "aria-label": i,
288
- className: o("flex w-full min-w-0 gap-2 overflow-x-auto", u),
289
- children: e.map((e) => /* @__PURE__ */ G("div", {
297
+ className: s("flex w-full min-w-0 gap-2 overflow-x-auto", u),
298
+ children: e.map((e) => /* @__PURE__ */ q("div", {
290
299
  role: "listitem",
291
- children: /* @__PURE__ */ G(de, {
300
+ children: /* @__PURE__ */ q(he, {
292
301
  attachment: e,
293
302
  onRemove: t,
294
303
  onRetry: n,
295
304
  onExpand: r,
296
305
  removeLabel: a,
297
- retryLabel: s,
306
+ retryLabel: o,
298
307
  onClick: c ? () => c(e) : void 0,
299
308
  clickLabel: l
300
309
  })
301
310
  }, e.id))
302
- }), pe = ({ isVisible: e, isAttachmentsAllowed: t = !0, title: n, subtitle: r, iconClassName: i = "text-accent-primary", deniedIconClassName: a = "text-error", titleClassName: s = "heading-3 font-semibold", subtitleClassName: c = "dial-small-text" }) => {
311
+ }), _e = /* @__PURE__ */ function(e) {
312
+ return e.None = "none", e.AllVisible = "all-visible", e.Collapsed = "collapsed", e;
313
+ }({}), ve = 5, ye = 4, be = (e, t) => e <= 0 ? {
314
+ layout: "none",
315
+ visibleCount: 0,
316
+ hiddenCount: 0
317
+ } : e < 5 || t ? {
318
+ layout: "all-visible",
319
+ visibleCount: e,
320
+ hiddenCount: 0
321
+ } : {
322
+ layout: "collapsed",
323
+ visibleCount: 4,
324
+ hiddenCount: e - 4
325
+ }, Q = {
326
+ tile: "_tile_1x7ag_2",
327
+ tileLight: "_tileLight_1x7ag_27",
328
+ tileError: "_tileError_1x7ag_31",
329
+ nameText: "_nameText_1x7ag_38",
330
+ typeText: "_typeText_1x7ag_39",
331
+ retryIcon: "_retryIcon_1x7ag_51",
332
+ hoverIcon: "_hoverIcon_1x7ag_55",
333
+ track: "_track_1x7ag_60",
334
+ indeterminateFill: "_indeterminateFill_1x7ag_64",
335
+ "attachment-tile-indeterminate": "_attachment-tile-indeterminate_1x7ag_1"
336
+ }, xe = {
337
+ [e.Network]: "Upload failed · network error",
338
+ [e.UnsupportedType]: "Upload failed · unsupported file type"
339
+ }, Se = ({ attachment: t, onClick: r, onRetry: i, clickLabel: o = "Download attachment", retryLabel: u = "Retry upload", theme: d = n.Dark, className: f }) => {
340
+ let { id: m, name: h, status: _, errorReason: v } = t, y = _ === a.Loading, b = _ === a.Error, x = b && (v && xe[v] || "Upload failed"), { BottomIcon: S, typeLabel: C } = pe(t, !1, !1), w = !b && !y && r !== void 0, T = b && !!i && v !== e.UnsupportedType, E = w || T ? "pe-5" : void 0, D = () => {
341
+ w && r?.(t);
342
+ }, O = (e) => {
343
+ (e.key === "Enter" || e.key === " ") && w && (e.preventDefault(), D());
344
+ }, k = s("group relative flex size-[84px] flex-col justify-between gap-1 overflow-hidden rounded-xl border p-1.5", Q.tile, !b && d === n.Light && Q.tileLight, b && Q.tileError), A = /* @__PURE__ */ q("div", {
345
+ title: h,
346
+ className: s("dial-caption-text line-clamp-2 min-w-0 break-words", Q.nameText, !b && E),
347
+ children: h
348
+ }), j = /* @__PURE__ */ J("div", {
349
+ className: s("flex items-center gap-1 overflow-hidden", b && E),
350
+ children: [/* @__PURE__ */ q(S, {
351
+ size: 16,
352
+ className: Q.typeText,
353
+ "aria-hidden": !0
354
+ }), /* @__PURE__ */ q("span", {
355
+ className: s("dial-caption-text truncate", Q.typeText),
356
+ children: C
357
+ })]
358
+ }), M = /* @__PURE__ */ J(K, { children: [
359
+ b ? /* @__PURE__ */ J(K, { children: [j, A] }) : /* @__PURE__ */ J(K, { children: [A, j] }),
360
+ y && /* @__PURE__ */ q("div", {
361
+ role: "progressbar",
362
+ "aria-label": "Uploading",
363
+ className: s("absolute inset-x-2 bottom-2 h-[3px] overflow-hidden rounded-full", Q.track),
364
+ children: /* @__PURE__ */ q("div", { className: s("h-full w-1/3 rounded-full", Q.indeterminateFill) })
365
+ }),
366
+ w && /* @__PURE__ */ q(g, {
367
+ size: c.SM,
368
+ "aria-hidden": !0,
369
+ className: s("absolute end-1 top-1 h-6 w-6 rounded-lg p-1 opacity-0 transition-opacity group-hover:opacity-100 mobile:opacity-100", Q.hoverIcon)
370
+ }),
371
+ T && /* @__PURE__ */ q(l, {
372
+ icon: /* @__PURE__ */ q(re, {
373
+ size: c.SM,
374
+ "aria-hidden": !0
375
+ }),
376
+ size: p.Small,
377
+ className: s("absolute end-1 top-1 h-6 w-6 rounded-lg", Q.retryIcon),
378
+ "aria-label": u,
379
+ onClick: (e) => {
380
+ e.stopPropagation(), i(m);
381
+ }
382
+ })
383
+ ] });
384
+ return /* @__PURE__ */ q("div", {
385
+ className: s("inline-flex", f),
386
+ children: w ? /* @__PURE__ */ q("div", {
387
+ role: "button",
388
+ tabIndex: 0,
389
+ "aria-label": o,
390
+ onClick: D,
391
+ onKeyDown: O,
392
+ className: s(k, "cursor-pointer focus-within:outline focus-within:outline-1 focus-within:outline-offset-1"),
393
+ children: M
394
+ }) : /* @__PURE__ */ q("div", {
395
+ className: k,
396
+ title: x || void 0,
397
+ children: M
398
+ })
399
+ });
400
+ }, Ce = { tile: "_tile_kvom5_1" }, we = ({ count: e, onClick: t, ariaLabel: n, children: r, className: i }) => /* @__PURE__ */ q("button", {
401
+ type: "button",
402
+ onClick: t,
403
+ "aria-label": n ?? `Show ${e} more attachments`,
404
+ className: s("dial-small-semi-text flex size-[84px] items-center justify-center rounded-xl border", Ce.tile, i),
405
+ children: r ?? /* @__PURE__ */ q("bdi", {
406
+ dir: "ltr",
407
+ children: `+${e}`
408
+ })
409
+ }), $ = {
410
+ container: "_container_4zxg9_1",
411
+ headerIcon: "_headerIcon_4zxg9_6",
412
+ headerLabel: "_headerLabel_4zxg9_7",
413
+ downloadAllButton: "_downloadAllButton_4zxg9_8",
414
+ imageTile: "_imageTile_4zxg9_12"
415
+ }, Te = (e, t) => `${e} ${t}${e === 1 ? "" : "s"}`, Ee = ({ attachments: e, onAttachmentClick: n, onDownloadAll: r, onRetry: i, getSizeLabel: o, ariaLabel: u = "Attachments", clickLabel: d = "Download attachment", retryLabel: f = "Retry upload", showLessLabel: p = "Show less", downloadAllLabel: h = "Download all", theme: v, className: y }) => {
416
+ let [b, x] = G(!1), S = se(() => be(e.length, b), [e.length, b]);
417
+ if (e.length === 0) return null;
418
+ let C = e.some((e) => e.type === t.Image), w = e.some((e) => e.type !== t.Image), T = C && w, E = e.length >= 5, D = T ? V : C ? H : _, O = Te(e.length, "attachment"), k = e.slice(0, S.visibleCount);
419
+ return /* @__PURE__ */ J("div", {
420
+ role: "group",
421
+ "aria-label": u,
422
+ className: s("rounded-2xl border p-3", E ? "w-full min-w-0 max-w-[492px]" : "max-w-[420px]", $.container, y),
423
+ children: [/* @__PURE__ */ J("div", {
424
+ className: "mb-3 flex min-h-6 items-center gap-2",
425
+ children: [
426
+ /* @__PURE__ */ q(D, {
427
+ size: c.SM,
428
+ className: s("shrink-0", $.headerIcon),
429
+ "aria-hidden": !0
430
+ }),
431
+ /* @__PURE__ */ q("span", {
432
+ className: s("dial-tiny-semi-text", $.headerLabel),
433
+ children: O
434
+ }),
435
+ e.length >= 2 && (r || n) && /* @__PURE__ */ q(l, {
436
+ icon: /* @__PURE__ */ q(g, {
437
+ size: c.SM,
438
+ "aria-hidden": !0
439
+ }),
440
+ className: s("ms-auto h-6 w-6 rounded-lg", $.downloadAllButton),
441
+ "aria-label": h,
442
+ onClick: () => {
443
+ let t = e.filter((e) => e.status === a.Idle);
444
+ r ? r(t) : t.forEach((e) => n?.(e));
445
+ }
446
+ })
447
+ ]
448
+ }), /* @__PURE__ */ J("div", {
449
+ role: "list",
450
+ "aria-label": O,
451
+ className: s("gap-3", E ? "grid grid-cols-[repeat(5,84px)] overflow-x-auto" : "flex flex-wrap"),
452
+ children: [
453
+ k.map((e) => /* @__PURE__ */ q("div", {
454
+ role: "listitem",
455
+ children: e.type === t.Image ? /* @__PURE__ */ q(he, {
456
+ attachment: e,
457
+ onClick: n ? () => n(e) : void 0,
458
+ onRetry: i,
459
+ clickLabel: d,
460
+ retryLabel: f,
461
+ roundedClassName: "rounded-xl",
462
+ showHoverDownloadIcon: !0,
463
+ className: s("size-[84px]", $.imageTile)
464
+ }) : /* @__PURE__ */ q(Se, {
465
+ attachment: e,
466
+ sizeLabel: o?.(e),
467
+ onClick: n,
468
+ onRetry: i,
469
+ clickLabel: d,
470
+ retryLabel: f,
471
+ theme: v
472
+ })
473
+ }, e.id)),
474
+ S.layout === _e.Collapsed && /* @__PURE__ */ q("div", {
475
+ role: "listitem",
476
+ children: /* @__PURE__ */ q(we, {
477
+ count: S.hiddenCount,
478
+ onClick: () => x(!0)
479
+ })
480
+ }),
481
+ E && b && /* @__PURE__ */ q("div", {
482
+ role: "listitem",
483
+ children: /* @__PURE__ */ q(we, {
484
+ count: 0,
485
+ onClick: () => x(!1),
486
+ ariaLabel: p,
487
+ children: /* @__PURE__ */ q(m, {
488
+ size: c.MD,
489
+ "aria-hidden": !0
490
+ })
491
+ })
492
+ })
493
+ ]
494
+ })]
495
+ });
496
+ }, De = ({ isVisible: e, isAttachmentsAllowed: t = !0, title: n, subtitle: r, iconClassName: i = "text-accent-primary", deniedIconClassName: a = "text-error", titleClassName: o = "heading-3 font-semibold", subtitleClassName: c = "dial-small-text" }) => {
303
497
  if (!e) return null;
304
498
  let l = n ?? (t ? "Attach files" : "No attachments allowed"), u = r ?? (t ? "Drop files here to attach them to message" : "Attachments can't be added to message"), d = t ? i : a, f = (e) => {
305
499
  e.preventDefault();
306
- }, p = t ? h : ie;
307
- return /* @__PURE__ */ G("div", {
308
- className: o("fixed inset-0 z-[9999] flex items-center justify-center bg-blackout backdrop-blur-sm", t ? "pointer-events-none" : "pointer-events-auto cursor-not-allowed"),
500
+ }, p = t ? v : z;
501
+ return /* @__PURE__ */ q("div", {
502
+ className: s("fixed inset-0 z-[9999] flex items-center justify-center bg-blackout backdrop-blur-sm", t ? "pointer-events-none" : "pointer-events-auto cursor-not-allowed"),
309
503
  onDragOver: t ? void 0 : f,
310
504
  onDrop: t ? void 0 : f,
311
- children: /* @__PURE__ */ K("div", {
505
+ children: /* @__PURE__ */ J("div", {
312
506
  className: "flex flex-col items-center text-center",
313
507
  children: [
314
- /* @__PURE__ */ G(p, {
508
+ /* @__PURE__ */ q(p, {
315
509
  size: 100,
316
510
  className: d
317
511
  }),
318
- /* @__PURE__ */ G("span", {
319
- className: o("mt-5", s),
512
+ /* @__PURE__ */ q("span", {
513
+ className: s("mt-5", o),
320
514
  children: l
321
515
  }),
322
- /* @__PURE__ */ G("span", {
323
- className: o("mt-4", c),
516
+ /* @__PURE__ */ q("span", {
517
+ className: s("mt-4", c),
324
518
  children: u
325
519
  })
326
520
  ]
327
521
  })
328
522
  });
329
- }, $ = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, me = (e, n) => ({ handlePaste: B((r) => {
523
+ }, Oe = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, ke = (e, n) => ({ handlePaste: U((r) => {
330
524
  if (!r.clipboardData) return;
331
- let a = Array.from(r.clipboardData.items).filter((e) => e.kind === "file" && e.type.startsWith("image/")), o = r.clipboardData.getData("text/plain").length > 0;
332
- if (a.length > 0 && !o) {
525
+ let i = Array.from(r.clipboardData.items).filter((e) => e.kind === "file" && e.type.startsWith("image/")), o = r.clipboardData.getData("text/plain").length > 0;
526
+ if (i.length > 0 && !o) {
333
527
  let n = [];
334
- for (let e of a) {
528
+ for (let e of i) {
335
529
  let r = e.getAsFile();
336
530
  if (!r) continue;
337
- let a = new File([r], "Screenshot.png", { type: r.type }), o = {
338
- id: $(),
531
+ let i = new File([r], "Screenshot.png", { type: r.type }), o = {
532
+ id: Oe(),
339
533
  name: "Screenshot.png",
340
534
  contentType: r.type,
341
- file: a,
535
+ file: i,
342
536
  type: t.Image,
343
- status: i.Idle,
344
- previewUrl: URL.createObjectURL(a)
537
+ status: a.Idle,
538
+ previewUrl: URL.createObjectURL(i)
345
539
  };
346
540
  n.push(o);
347
541
  }
@@ -350,35 +544,35 @@ var q = /* @__PURE__ */ function(e) {
350
544
  }
351
545
  let s = r.clipboardData.getData("text/plain");
352
546
  if (s.length > n) {
353
- let n = s.trim(), a = (n.length > 80 ? `${n.slice(0, 80).trimEnd()}…` : n) || "Pasted text", o = new File([s], a, { type: "text/plain" }), c = {
354
- id: $(),
355
- name: a,
547
+ let n = s.trim(), i = (n.length > 80 ? `${n.slice(0, 80).trimEnd()}…` : n) || "Pasted text", o = new File([s], i, { type: "text/plain" }), c = {
548
+ id: Oe(),
549
+ name: i,
356
550
  contentType: "text/plain",
357
551
  file: o,
358
552
  type: t.Pasted,
359
- status: i.Idle
553
+ status: a.Idle
360
554
  };
361
555
  r.preventDefault(), e([c]);
362
556
  }
363
- }, [e, n]) }), he = {
557
+ }, [e, n]) }), Ae = {
364
558
  image: "Image files",
365
559
  audio: "Audio files",
366
560
  video: "Video files",
367
561
  text: "Text files"
368
- }, ge = (e) => e.map((e) => {
562
+ }, je = (e) => e.map((e) => {
369
563
  if (e.endsWith("/*")) {
370
564
  let t = e.slice(0, -2);
371
- return he[t] ?? `${t} files`;
565
+ return Ae[t] ?? `${t} files`;
372
566
  }
373
567
  let t = e.split("/")[1];
374
568
  return t == null ? e.toUpperCase() : t.toUpperCase();
375
- }).join(", "), _e = (e, t) => t.length === 0 ? !1 : t.some((t) => {
569
+ }).join(", "), Me = (e, t) => t.length === 0 ? !1 : t.some((t) => {
376
570
  if (t === "*" || t === "*/*") return !0;
377
571
  if (t.endsWith("/*")) {
378
572
  let n = t.slice(0, -2);
379
573
  return e.startsWith(`${n}/`);
380
574
  }
381
575
  return e === t;
382
- }), ve = 100;
576
+ }), Ne = 100;
383
577
  //#endregion
384
- export { de as AttachmentCard, fe as AttachmentTray, pe as FileDndOverlay, q as LazyImageLoadStatus, ve as MAX_UPLOADS_PER_MINUTE, $ as generateAttachmentId, ue as getAttachmentCardState, Y as getAttachmentIcon, Q as getNameWithoutExtension, _e as isMimeTypeAllowed, ge as mimeTypesToExtensionLabels, me as useClipboardPaste, ce as useLazyImageLoad };
578
+ export { ye as ATTACHMENT_COLLAPSED_VISIBLE_COUNT, ve as ATTACHMENT_COLLAPSE_THRESHOLD, he as AttachmentCard, Se as AttachmentFileRow, Ee as AttachmentGroup, we as AttachmentMoreTile, _e as AttachmentTilesLayout, ge as AttachmentTray, De as FileDndOverlay, Y as LazyImageLoadStatus, Ne as MAX_UPLOADS_PER_MINUTE, Oe as generateAttachmentId, pe as getAttachmentCardState, Z as getAttachmentIcon, be as getAttachmentTilesPlan, de as getExtFromContentType, me as getNameWithoutExtension, Me as isMimeTypeAllowed, je as mimeTypesToExtensionLabels, ke as useClipboardPaste, le as useLazyImageLoad };
@@ -49,6 +49,12 @@ export interface AttachmentCardProps {
49
49
  typography?: AttachmentCardTypography;
50
50
  /** Tailwind border-radius utility class applied to the card and its inner layers (e.g. `'rounded'`, `'rounded-lg'`). */
51
51
  roundedClassName?: string;
52
+ /**
53
+ * Shows a small decorative download-icon overlay on hover/focus, on top of
54
+ * the existing whole-card click-to-download interaction. Opt-in so the
55
+ * composer (which uses remove/retry actions, not download) is unaffected.
56
+ */
57
+ showHoverDownloadIcon?: boolean;
52
58
  /** Extra class name(s) merged onto the root element. */
53
59
  className?: string;
54
60
  }
@@ -1 +1 @@
1
- {"version":3,"file":"AttachmentCard.d.ts","sourceRoot":"","sources":["../../src/models/AttachmentCard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,wEAAwE;AACxE,MAAM,WAAW,oBAAoB;IACnC,8CAA8C;IAC9C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kDAAkD;IAClD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4BAA4B;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sCAAsC;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,+DAA+D;AAC/D,MAAM,WAAW,wBAAwB;IACvC,mFAAmF;IACnF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,2GAA2G;IAC3G,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,sHAAsH;IACtH,wBAAwB,CAAC,EAAE,MAAM,CAAC;CACnC;AAED,wDAAwD;AACxD,MAAM,WAAW,mBAAmB;IAClC,sCAAsC;IACtC,UAAU,EAAE,iBAAiB,CAAC;IAC9B,iFAAiF;IACjF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wDAAwD;IACxD,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,0EAA0E;IAC1E,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,6GAA6G;IAC7G,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,8EAA8E;IAC9E,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,kFAAkF;IAClF,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,8CAA8C;IAC9C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gEAAgE;IAChE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gGAAgG;IAChG,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,uHAAuH;IACvH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,wDAAwD;IACxD,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,8DAA8D;IAC9D,UAAU,CAAC,EAAE,wBAAwB,CAAC;IACtC,wHAAwH;IACxH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
1
+ {"version":3,"file":"AttachmentCard.d.ts","sourceRoot":"","sources":["../../src/models/AttachmentCard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,wEAAwE;AACxE,MAAM,WAAW,oBAAoB;IACnC,8CAA8C;IAC9C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kDAAkD;IAClD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4BAA4B;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sCAAsC;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,+DAA+D;AAC/D,MAAM,WAAW,wBAAwB;IACvC,mFAAmF;IACnF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,2GAA2G;IAC3G,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,sHAAsH;IACtH,wBAAwB,CAAC,EAAE,MAAM,CAAC;CACnC;AAED,wDAAwD;AACxD,MAAM,WAAW,mBAAmB;IAClC,sCAAsC;IACtC,UAAU,EAAE,iBAAiB,CAAC;IAC9B,iFAAiF;IACjF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wDAAwD;IACxD,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,0EAA0E;IAC1E,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,6GAA6G;IAC7G,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,8EAA8E;IAC9E,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,kFAAkF;IAClF,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,8CAA8C;IAC9C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gEAAgE;IAChE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gGAAgG;IAChG,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,uHAAuH;IACvH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,wDAAwD;IACxD,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,8DAA8D;IAC9D,UAAU,CAAC,EAAE,wBAAwB,CAAC;IACtC,wHAAwH;IACxH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
@@ -0,0 +1,24 @@
1
+ import { CodeBlockTheme, DisplayAttachment } from '@epam/ai-dial-chat-shared';
2
+ /** Props accepted by the `AttachmentFileRow` component. */
3
+ export interface AttachmentFileRowProps {
4
+ /** The non-previewable attachment this row represents. */
5
+ attachment: DisplayAttachment;
6
+ /** Byte size, when derivable; omitted from the meta line if absent. */
7
+ sizeLabel?: string;
8
+ /** Called when the user clicks the row or its download button. */
9
+ onClick?: (attachment: DisplayAttachment) => void;
10
+ /** Called when the user retries a failed upload. */
11
+ onRetry?: (id: string) => void;
12
+ /** Accessible label for the download action. Defaults to `'Download attachment'`. */
13
+ clickLabel?: string;
14
+ /** Accessible label for the retry action. Defaults to `'Retry upload'`. */
15
+ retryLabel?: string;
16
+ /**
17
+ * Tile surface color theme, matching the markdown code block's own
18
+ * light/dark surface (never plain white). Defaults to `'dark'`.
19
+ */
20
+ theme?: CodeBlockTheme;
21
+ /** Extra class name(s) merged onto the root element. */
22
+ className?: string;
23
+ }
24
+ //# sourceMappingURL=AttachmentFileRow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AttachmentFileRow.d.ts","sourceRoot":"","sources":["../../src/models/AttachmentFileRow.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EAClB,MAAM,2BAA2B,CAAC;AAEnC,2DAA2D;AAC3D,MAAM,WAAW,sBAAsB;IACrC,0DAA0D;IAC1D,UAAU,EAAE,iBAAiB,CAAC;IAC9B,uEAAuE;IACvE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kEAAkE;IAClE,OAAO,CAAC,EAAE,CAAC,UAAU,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAClD,oDAAoD;IACpD,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,qFAAqF;IACrF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2EAA2E;IAC3E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
@@ -0,0 +1,37 @@
1
+ import { CodeBlockTheme, DisplayAttachment } from '@epam/ai-dial-chat-shared';
2
+ /** Props accepted by the `AttachmentGroup` component. */
3
+ export interface AttachmentGroupProps {
4
+ /** The message's full attachment list (images and files together). */
5
+ attachments: DisplayAttachment[];
6
+ /** Called when the user clicks/activates a previewable image tile or a file row (downloads it). */
7
+ onAttachmentClick?: (attachment: DisplayAttachment) => void;
8
+ /**
9
+ * Called with every currently downloadable attachment when the user
10
+ * activates the "download all" header action. Falls back to invoking
11
+ * `onAttachmentClick` once per downloadable attachment when omitted.
12
+ */
13
+ onDownloadAll?: (attachments: DisplayAttachment[]) => void;
14
+ /** Called when the user retries a failed upload. */
15
+ onRetry?: (id: string) => void;
16
+ /** Resolves the human-readable size label for an attachment, when derivable. Omitted from display when absent. */
17
+ getSizeLabel?: (attachment: DisplayAttachment) => string | undefined;
18
+ /** Accessible label for the group region. */
19
+ ariaLabel?: string;
20
+ /** Accessible label for each tile/row's click action. Defaults to `'Download attachment'`. */
21
+ clickLabel?: string;
22
+ /** Accessible label for each row's retry action. Defaults to `'Retry upload'`. */
23
+ retryLabel?: string;
24
+ /** Label for the "show less" header action, shown once the group has been expanded via the "+N" tile. Defaults to `'Show less'`. */
25
+ showLessLabel?: string;
26
+ /** Label for the "download all" header action, shown whenever the group has 2+ attachments. Defaults to `'Download all'`. */
27
+ downloadAllLabel?: string;
28
+ /**
29
+ * File tile surface color theme, matching the markdown code block's own
30
+ * light/dark surface (never plain white). Forwarded to each
31
+ * non-previewable file tile. Defaults to `'dark'`.
32
+ */
33
+ theme?: CodeBlockTheme;
34
+ /** Extra class name(s) merged onto the root element. */
35
+ className?: string;
36
+ }
37
+ //# sourceMappingURL=AttachmentGroup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AttachmentGroup.d.ts","sourceRoot":"","sources":["../../src/models/AttachmentGroup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EAClB,MAAM,2BAA2B,CAAC;AAEnC,yDAAyD;AACzD,MAAM,WAAW,oBAAoB;IACnC,sEAAsE;IACtE,WAAW,EAAE,iBAAiB,EAAE,CAAC;IACjC,mGAAmG;IACnG,iBAAiB,CAAC,EAAE,CAAC,UAAU,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC5D;;;;OAIG;IACH,aAAa,CAAC,EAAE,CAAC,WAAW,EAAE,iBAAiB,EAAE,KAAK,IAAI,CAAC;IAC3D,oDAAoD;IACpD,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,kHAAkH;IAClH,YAAY,CAAC,EAAE,CAAC,UAAU,EAAE,iBAAiB,KAAK,MAAM,GAAG,SAAS,CAAC;IACrE,6CAA6C;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8FAA8F;IAC9F,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kFAAkF;IAClF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oIAAoI;IACpI,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,6HAA6H;IAC7H,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;OAIG;IACH,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
@@ -0,0 +1,18 @@
1
+ import { ReactNode } from 'react';
2
+ /** Props accepted by the `AttachmentMoreTile` component. */
3
+ export interface AttachmentMoreTileProps {
4
+ /** Number of additional, not-yet-visible attachments. Only used for the default `"+N"` content/label. */
5
+ count: number;
6
+ /** Called when the tile is activated (expands or collapses the group). */
7
+ onClick: () => void;
8
+ /**
9
+ * Accessible label. Defaults to `'Show {count} more attachments'`; pass an
10
+ * explicit label (e.g. `'Show less'`) when overriding `children`.
11
+ */
12
+ ariaLabel?: string;
13
+ /** Overrides the default `"+N"` content, e.g. a collapse icon for the "show less" placeholder tile. */
14
+ children?: ReactNode;
15
+ /** Extra class name(s) merged onto the root element. */
16
+ className?: string;
17
+ }
18
+ //# sourceMappingURL=AttachmentMoreTile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AttachmentMoreTile.d.ts","sourceRoot":"","sources":["../../src/models/AttachmentMoreTile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,4DAA4D;AAC5D,MAAM,WAAW,uBAAuB;IACtC,yGAAyG;IACzG,KAAK,EAAE,MAAM,CAAC;IACd,0EAA0E;IAC1E,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uGAAuG;IACvG,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
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.0-dev.462",
4
+ "version": "1.0.0-dev.469",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "main": "./index.js",
@@ -17,8 +17,8 @@
17
17
  }
18
18
  },
19
19
  "peerDependencies": {
20
- "@epam/ai-dial-chat-shared": "1.0.0-dev.462",
21
- "@epam/ai-dial-ui-kit": "0.12.0-dev.25",
20
+ "@epam/ai-dial-chat-shared": "1.0.0-dev.469",
21
+ "@epam/ai-dial-ui-kit": "0.12.0-dev.28",
22
22
  "@tabler/icons-react": "^3.44.0",
23
23
  "react": "^19.0.0"
24
24
  },
@@ -11,5 +11,7 @@ export interface AttachmentCardState {
11
11
  cardColorClass: string;
12
12
  removeBtnClass: string;
13
13
  }
14
+ /** Derives a bare file extension (no leading dot) from a MIME type, e.g. `'application/pdf'` -> `'pdf'`. */
15
+ export declare const getExtFromContentType: (contentType: string) => string | undefined;
14
16
  export declare const getAttachmentCardState: (attachment: DisplayAttachment, isSelected: boolean, shouldAlwaysShowActions: boolean) => AttachmentCardState;
15
17
  //# sourceMappingURL=getAttachmentCardState.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getAttachmentCardState.d.ts","sourceRoot":"","sources":["../../src/utils/getAttachmentCardState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAOnE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAKhD,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,UAAU,EAAE,IAAI,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;CACxB;AA2CD,eAAO,MAAM,sBAAsB,GACjC,YAAY,iBAAiB,EAC7B,YAAY,OAAO,EACnB,yBAAyB,OAAO,KAC/B,mBAkCF,CAAC"}
1
+ {"version":3,"file":"getAttachmentCardState.d.ts","sourceRoot":"","sources":["../../src/utils/getAttachmentCardState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAOnE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAKhD,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,UAAU,EAAE,IAAI,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;CACxB;AAUD,4GAA4G;AAC5G,eAAO,MAAM,qBAAqB,GAChC,aAAa,MAAM,KAClB,MAAM,GAAG,SAUX,CAAC;AAuBF,eAAO,MAAM,sBAAsB,GACjC,YAAY,iBAAiB,EAC7B,YAAY,OAAO,EACnB,yBAAyB,OAAO,KAC/B,mBAkCF,CAAC"}
@@ -0,0 +1,23 @@
1
+ /** How the unified attachment tile grid should render for a given total attachment count. */
2
+ export declare enum AttachmentTilesLayout {
3
+ /** No attachments. */
4
+ None = "none",
5
+ /** Below the collapse threshold, or expanded: every tile shown. */
6
+ AllVisible = "all-visible",
7
+ /** At/above the collapse threshold, not yet expanded: a few tiles + a "+N" tile. */
8
+ Collapsed = "collapsed"
9
+ }
10
+ export interface AttachmentTilesPlan {
11
+ layout: AttachmentTilesLayout;
12
+ /** Number of tiles to actually render. */
13
+ visibleCount: number;
14
+ /** Number of attachments hidden behind the "+N" tile (0 unless `layout` is `Collapsed`). */
15
+ hiddenCount: number;
16
+ }
17
+ /** Total attachment count at/above which the grid collapses behind a "+N" tile by default. */
18
+ export declare const ATTACHMENT_COLLAPSE_THRESHOLD = 5;
19
+ /** Number of tiles shown before the "+N" tile while collapsed. */
20
+ export declare const ATTACHMENT_COLLAPSED_VISIBLE_COUNT = 4;
21
+ /** Decides how the unified tile grid should render for `totalCount` attachments, given whether the group is expanded. */
22
+ export declare const getAttachmentTilesPlan: (totalCount: number, isExpanded: boolean) => AttachmentTilesPlan;
23
+ //# sourceMappingURL=getAttachmentGroupLayout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getAttachmentGroupLayout.d.ts","sourceRoot":"","sources":["../../src/utils/getAttachmentGroupLayout.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,oBAAY,qBAAqB;IAC/B,sBAAsB;IACtB,IAAI,SAAS;IACb,mEAAmE;IACnE,UAAU,gBAAgB;IAC1B,oFAAoF;IACpF,SAAS,cAAc;CACxB;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,qBAAqB,CAAC;IAC9B,0CAA0C;IAC1C,YAAY,EAAE,MAAM,CAAC;IACrB,4FAA4F;IAC5F,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,8FAA8F;AAC9F,eAAO,MAAM,6BAA6B,IAAI,CAAC;AAC/C,kEAAkE;AAClE,eAAO,MAAM,kCAAkC,IAAI,CAAC;AAEpD,yHAAyH;AACzH,eAAO,MAAM,sBAAsB,GACjC,YAAY,MAAM,EAClB,YAAY,OAAO,KAClB,mBAoBF,CAAC"}