@epam/ai-dial-attachment-input 1.1.0-dev.78 → 1.1.0-dev.87

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,5 +1,5 @@
1
1
  import { FC } from 'react';
2
2
  import { AttachmentGroupProps } from '../../models/attachment-group';
3
- /** Adaptive grid of attachment tiles for a sent message; collapses behind a "+N" tile when 5 or more attachments are present. */
3
+ /** Renders every attachment as a tile: a wrapping flex row below the collapse threshold, a fixed 5-column grid at or above it. */
4
4
  export declare const AttachmentGroup: FC<AttachmentGroupProps>;
5
5
  //# sourceMappingURL=AttachmentGroup.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AttachmentGroup.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentGroup/AttachmentGroup.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAqB,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,+BAA+B,CAAC;AASvC,iIAAiI;AACjI,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CAwKpD,CAAC"}
1
+ {"version":3,"file":"AttachmentGroup.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentGroup/AttachmentGroup.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAO1E,kIAAkI;AAClI,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CAmIpD,CAAC"}
@@ -1,7 +1,5 @@
1
- /** Total attachment count at/above which the grid collapses behind a "+N" tile by default. */
1
+ /** Total attachment count at/above which the tile list switches from a wrapping flex row to a fixed 5-column grid. */
2
2
  export declare const ATTACHMENT_COLLAPSE_THRESHOLD = 5;
3
- /** Number of tiles shown before the "+N" tile while collapsed. */
4
- export declare const ATTACHMENT_COLLAPSED_VISIBLE_COUNT = 4;
5
3
  /** Base Tailwind classes shared by every square attachment tile (84 × 84 px). */
6
4
  export declare const ATTACHMENT_TILE_BASE_CLASS = "flex size-[84px] items-center justify-center rounded-xl border";
7
5
  //# sourceMappingURL=attachment-group.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"attachment-group.d.ts","sourceRoot":"","sources":["../../src/constants/attachment-group.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,eAAO,MAAM,6BAA6B,IAAI,CAAC;AAC/C,kEAAkE;AAClE,eAAO,MAAM,kCAAkC,IAAI,CAAC;AACpD,iFAAiF;AACjF,eAAO,MAAM,0BAA0B,mEAC2B,CAAC"}
1
+ {"version":3,"file":"attachment-group.d.ts","sourceRoot":"","sources":["../../src/constants/attachment-group.ts"],"names":[],"mappings":"AAAA,sHAAsH;AACtH,eAAO,MAAM,6BAA6B,IAAI,CAAC;AAC/C,iFAAiF;AACjF,eAAO,MAAM,0BAA0B,mEAC2B,CAAC"}
package/index.css CHANGED
@@ -1,2 +1,2 @@
1
- ._tile_yap03_1{background:var(--ai-tile-bg,var(--bg-layer-raised,#fcfcfc));border-color:var(--ai-tile-border,var(--stroke-secondary,#d1dbea))}._tile_yap03_1._hovered_yap03_5:hover{background:var(--ai-tile-bg-hover,var(--bg-control-neutral-hover,#e0e6f0))}._tile_yap03_1:focus-visible{outline-color:var(--ai-tile-focus-outline,var(--stroke-focus,#161b2d))}._selected_yap03_12{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_yap03_17{background:var(--ai-tile-bg-error,var(--bg-error,#f3d6d8));border-color:var(--ai-tile-border-error,var(--stroke-error,#ae2f2f))}._nameText_yap03_22{color:var(--ai-tile-name-text,var(--text-primary,#161b2d))}._typeText_yap03_26{color:var(--ai-tile-type-text,var(--text-secondary,#6b7280))}._retryIcon_yap03_30{color:var(--ai-tile-error-text,var(--text-error,#ae2f2f))}._track_yap03_34{background:var(--ai-tile-progress-track,var(--bg-backdrop,#161b2db2))}._imageActionButton_yap03_38{background:var(--ai-tile-hover-icon-bg,var(--bg-layer-base,#f5f7fa));color:var(--ai-tile-hover-icon-color,var(--text-secondary,#6b7280))}._tile_1qzn0_1{background:var(--ai-more-tile-bg,var(--bg-layer-2,#eef1f7));border-color:var(--ai-more-tile-border,var(--stroke-secondary,#d1dbea));color:var(--ai-more-tile-color,var(--text-secondary,#6b7280))}._tile_1qzn0_1:hover{background:var(--ai-more-tile-bg-hover,var(--bg-accent-primary-alpha,#7da4ff2e));color:var(--ai-more-tile-color-hover,var(--text-accent,#1d4ed8));border-color:var(--ai-more-tile-border-hover,color-mix(in srgb, var(--stroke-accent-primary-hover,#7da4ff) 50%, transparent))}._tile_1qzn0_1:focus-visible{outline-color:var(--ai-more-tile-focus-outline,var(--stroke-focus,#161b2d))}._container_jvs4c_1{background:var(--ai-group-bg,var(--bg-layer-2,#eef1f7));border-color:var(--ai-group-border,var(--stroke-secondary,#d1dbea))}._headerIcon_jvs4c_6,._headerLabel_jvs4c_7,._downloadAllButton_jvs4c_8{color:var(--ai-group-text,var(--text-secondary,#6b7280))}._overlay_1lz3x_1{background:var(--ai-fd-bg,var(--bg-backdrop,#0c101d4d))}._icon_1lz3x_5{color:var(--ai-fd-icon,var(--text-accent-primary,#124ace))}._deniedIcon_1lz3x_9{color:var(--ai-fd-denied-icon,var(--text-error,#ae2f2f))}
1
+ ._tile_yap03_1{background:var(--ai-tile-bg,var(--bg-layer-raised,#fcfcfc));border-color:var(--ai-tile-border,var(--stroke-secondary,#d1dbea))}._tile_yap03_1._hovered_yap03_5:hover{background:var(--ai-tile-bg-hover,var(--bg-control-neutral-hover,#e0e6f0))}._tile_yap03_1:focus-visible{outline-color:var(--ai-tile-focus-outline,var(--stroke-focus,#161b2d))}._selected_yap03_12{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_yap03_17{background:var(--ai-tile-bg-error,var(--bg-error,#f3d6d8));border-color:var(--ai-tile-border-error,var(--stroke-error,#ae2f2f))}._nameText_yap03_22{color:var(--ai-tile-name-text,var(--text-primary,#161b2d))}._typeText_yap03_26{color:var(--ai-tile-type-text,var(--text-secondary,#6b7280))}._retryIcon_yap03_30{color:var(--ai-tile-error-text,var(--text-error,#ae2f2f))}._track_yap03_34{background:var(--ai-tile-progress-track,var(--bg-backdrop,#161b2db2))}._imageActionButton_yap03_38{background:var(--ai-tile-hover-icon-bg,var(--bg-layer-base,#f5f7fa));color:var(--ai-tile-hover-icon-color,var(--text-secondary,#6b7280))}._headerIcon_1sgtq_1,._headerLabel_1sgtq_2{color:var(--ai-group-text,var(--text-secondary,#6b7280))}._overlay_1lz3x_1{background:var(--ai-fd-bg,var(--bg-backdrop,#0c101d4d))}._icon_1lz3x_5{color:var(--ai-fd-icon,var(--text-accent-primary,#124ace))}._deniedIcon_1lz3x_9{color:var(--ai-fd-denied-icon,var(--text-error,#ae2f2f))}
2
2
  /*$vite$:1*/
package/index.d.ts CHANGED
@@ -1,16 +1,14 @@
1
1
  export { AttachmentCard } from './components/AttachmentCard/AttachmentCard';
2
2
  export { AttachmentTray } from './components/AttachmentTray/AttachmentTray';
3
3
  export { AttachmentGroup } from './components/AttachmentGroup/AttachmentGroup';
4
- export { AttachmentMoreTile } from './components/AttachmentMoreTile/AttachmentMoreTile';
5
4
  export { FileDndOverlay } from './components/FileDndOverlay/FileDndOverlay';
6
5
  export type { AttachmentCardProps, AttachmentCardColors, AttachmentCardTypography, AttachmentCardStyles, AttachmentCardLabels, AttachmentCardState, AttachmentTypeLabels, } from './models/attachment-card';
7
6
  export type { AttachmentTrayProps, AttachmentTrayLabels, AttachmentTrayStyles, } from './models/attachment-tray';
8
- export { AttachmentTilesLayout, type AttachmentGroupProps, type AttachmentGroupLabels, type AttachmentGroupColors, type AttachmentGroupTypography, type AttachmentGroupStyles, type AttachmentTilesPlan, } from './models/attachment-group';
9
- export type { AttachmentMoreTileProps, AttachmentMoreTileLabels, AttachmentMoreTileColors, AttachmentMoreTileTypography, AttachmentMoreTileStyles, } from './models/attachment-more-tile';
7
+ export { type AttachmentGroupProps, type AttachmentGroupLabels, type AttachmentGroupColors, type AttachmentGroupTypography, type AttachmentGroupStyles, } from './models/attachment-group';
10
8
  export type { FileDndOverlayProps, FileDndOverlayLabels, FileDndOverlayColors, FileDndOverlayTypography, FileDndOverlayStyles, } from './models/file-dnd-overlay';
11
9
  export { useClipboardPaste, type UseClipboardPasteLabels, } from './hooks/useClipboardPaste';
12
10
  export { useLazyImageLoad, LazyImageLoadStatus, } from './hooks/useLazyImageLoad';
13
- export { generateAttachmentId, getAttachmentCardState, getExtFromContentType, getAttachmentIcon, getAttachmentTilesPlan, getNameWithoutExtension, mimeTypesToExtensionLabels, isMimeTypeAllowed, } from './utils/attachment';
14
- export { ATTACHMENT_COLLAPSE_THRESHOLD, ATTACHMENT_COLLAPSED_VISIBLE_COUNT, } from './constants/attachment-group';
11
+ export { generateAttachmentId, getAttachmentCardState, getExtFromContentType, getAttachmentIcon, getNameWithoutExtension, mimeTypesToExtensionLabels, isMimeTypeAllowed, } from './utils/attachment';
12
+ export { ATTACHMENT_COLLAPSE_THRESHOLD } from './constants/attachment-group';
15
13
  export { MAX_UPLOADS_PER_MINUTE } from './constants/upload';
16
14
  //# 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,kBAAkB,EAAE,MAAM,oDAAoD,CAAC;AACxF,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,qBAAqB,EACrB,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EAC9B,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,GACzB,MAAM,2BAA2B,CAAC;AACnC,YAAY,EACV,uBAAuB,EACvB,wBAAwB,EACxB,wBAAwB,EACxB,4BAA4B,EAC5B,wBAAwB,GACzB,MAAM,+BAA+B,CAAC;AACvC,YAAY,EACV,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,wBAAwB,EACxB,oBAAoB,GACrB,MAAM,2BAA2B,CAAC;AAEnC,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,sBAAsB,EACtB,uBAAuB,EACvB,0BAA0B,EAC1B,iBAAiB,GAClB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,6BAA6B,EAC7B,kCAAkC,GACnC,MAAM,8BAA8B,CAAC;AACtC,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;AAEnC,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"}
package/index.js CHANGED
@@ -1,103 +1,101 @@
1
1
  import { AttachmentErrorReason as e, AttachmentType as t, MIME_TYPE_EXT_MAP as n, RequestStatus as r, buildCssVars as i, mergeClasses as a } from "@epam/ai-dial-chat-shared";
2
2
  import { useCallback as o, useEffect as s, useId as c, useMemo as l, useRef as u, useState as d } from "react";
3
- import { IconChevronUp as f, IconClipboard as p, IconDownload as m, IconExternalLink as h, IconFile as g, IconFileDescription as _, IconFileTypeBmp as v, IconFileTypeCss as y, IconFileTypeCsv as b, IconFileTypeDoc as x, IconFileTypeDocx as S, IconFileTypeHtml as C, IconFileTypeJpg as w, IconFileTypeJs as T, IconFileTypeJsx as E, IconFileTypePdf as D, IconFileTypePhp as O, IconFileTypePng as k, IconFileTypePpt as A, IconFileTypeRs as j, IconFileTypeSql as M, IconFileTypeSvg as N, IconFileTypeTs as P, IconFileTypeTsx as F, IconFileTypeTxt as I, IconFileTypeVue as L, IconFileTypeXls as R, IconFileTypeXml as z, IconFileTypeZip as B, IconFileX as ee, IconMusic as te, IconPaperclip as ne, IconPhoto as V, IconReload as H, IconTerminal2 as U, IconVideo as re, IconX as ie } from "@tabler/icons-react";
4
- import { DIAL_ICON_SIZE as W, DialGhostIconButton as ae, DialSkeleton as oe, DialSkeletonVariant as se, DialSpinner as ce, ElementSize as le, Highlight as ue, StaticIconButton as de } from "@epam/ai-dial-ui-kit";
5
- import { Fragment as G, jsx as K, jsxs as q } from "react/jsx-runtime";
6
- //#region src/constants/attachment-group.ts
7
- var fe = 5, pe = 4, me = "flex size-[84px] items-center justify-center rounded-xl border", J = /* @__PURE__ */ function(e) {
8
- return e.None = "none", e.AllVisible = "all-visible", e.Collapsed = "collapsed", e;
9
- }({}), he = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, ge = (e) => {
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 z, IconFileX as B, IconMusic as ee, IconPaperclip as V, IconPhoto as H, IconReload as te, IconTerminal2 as U, IconVideo as W, IconX as ne } from "@tabler/icons-react";
4
+ import { DIAL_ICON_SIZE as G, DialSkeleton as re, DialSkeletonVariant as ie, DialSpinner as ae, ElementSize as oe, GhostIconButton as se, Highlight as ce } from "@epam/ai-dial-ui-kit";
5
+ import { Fragment as K, jsx as q, jsxs as J } from "react/jsx-runtime";
6
+ //#region src/utils/attachment.ts
7
+ var Y = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, le = (e) => {
10
8
  if (e == null) return "";
11
9
  let t = e.lastIndexOf(".");
12
10
  return t > 0 ? e.slice(0, t) : e;
13
- }, _e = {
11
+ }, ue = {
14
12
  image: "Image files",
15
13
  audio: "Audio files",
16
14
  video: "Video files",
17
15
  text: "Text files"
18
- }, ve = (e, t = _e) => e.map((e) => {
16
+ }, de = (e, t = ue) => e.map((e) => {
19
17
  if (e.endsWith("/*")) {
20
18
  let n = e.slice(0, -2);
21
19
  return t[n] ?? `${n} files`;
22
20
  }
23
21
  let n = e.split("/")[1];
24
22
  return n == null ? e.toUpperCase() : n.toUpperCase();
25
- }).join(", "), ye = (e, t) => t.length === 0 ? !1 : t.some((t) => {
23
+ }).join(", "), fe = (e, t) => t.length === 0 ? !1 : t.some((t) => {
26
24
  if (t === "*" || t === "*/*") return !0;
27
25
  if (t.endsWith("/*")) {
28
26
  let n = t.slice(0, -2);
29
27
  return e.startsWith(`${n}/`);
30
28
  }
31
29
  return e === t;
32
- }), be = (e) => {
33
- if (!e) return g;
30
+ }), pe = (e) => {
31
+ if (!e) return h;
34
32
  if (e.startsWith("image/")) switch (e) {
35
33
  case "image/jpeg":
36
- case "image/jpg": return w;
37
- case "image/png": return k;
38
- case "image/svg+xml": return N;
39
- case "image/bmp": return v;
40
- default: return V;
34
+ case "image/jpg": return C;
35
+ case "image/png": return O;
36
+ case "image/svg+xml": return M;
37
+ case "image/bmp": return _;
38
+ default: return H;
41
39
  }
42
- if (e.startsWith("video/")) return re;
43
- if (e.startsWith("audio/")) return te;
40
+ if (e.startsWith("video/")) return W;
41
+ if (e.startsWith("audio/")) return ee;
44
42
  switch (e) {
45
- case "application/pdf": return D;
43
+ case "application/pdf": return E;
46
44
  case "application/msword":
47
- case "application/vnd.ms-word": return x;
48
- case "application/vnd.openxmlformats-officedocument.wordprocessingml.document": return S;
49
- case "application/vnd.ms-powerpoint": return A;
50
- case "application/vnd.openxmlformats-officedocument.presentationml.presentation": return A;
51
- case "application/vnd.ms-excel": return R;
52
- case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": return R;
45
+ case "application/vnd.ms-word": return b;
46
+ case "application/vnd.openxmlformats-officedocument.wordprocessingml.document": return x;
47
+ case "application/vnd.ms-powerpoint": return k;
48
+ case "application/vnd.openxmlformats-officedocument.presentationml.presentation": return k;
49
+ case "application/vnd.ms-excel": return L;
50
+ case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": return L;
53
51
  case "application/zip":
54
52
  case "application/x-zip-compressed":
55
53
  case "application/x-rar-compressed":
56
54
  case "application/x-7z-compressed":
57
55
  case "application/gzip":
58
- case "application/x-tar": return B;
59
- case "text/csv": return b;
60
- case "text/plain": return I;
56
+ case "application/x-tar": return z;
57
+ case "text/csv": return y;
58
+ case "text/plain": return F;
61
59
  case "text/html":
62
- case "application/xhtml+xml": return C;
60
+ case "application/xhtml+xml": return S;
63
61
  case "text/xml":
64
- case "application/xml": return z;
62
+ case "application/xml": return R;
65
63
  case "application/sql":
66
- case "text/x-sql": return M;
64
+ case "text/x-sql": return j;
67
65
  case "text/javascript":
68
- case "application/javascript": return T;
69
- case "text/jsx": return E;
66
+ case "application/javascript": return w;
67
+ case "text/jsx": return T;
70
68
  case "application/typescript":
71
- case "text/typescript": return P;
72
- case "text/tsx": return F;
73
- case "text/css": return y;
69
+ case "text/typescript": return N;
70
+ case "text/tsx": return P;
71
+ case "text/css": return v;
74
72
  case "text/x-php":
75
- case "application/x-php": return O;
73
+ case "application/x-php": return D;
76
74
  case "text/x-rustsrc":
77
- case "application/x-rust": return j;
78
- case "text/x-vue": return L;
79
- default: return g;
75
+ case "application/x-rust": return A;
76
+ case "text/x-vue": return I;
77
+ default: return h;
80
78
  }
81
- }, xe = (e) => {
79
+ }, me = (e) => {
82
80
  let { type: n, contentType: r } = e;
83
- return n === t.Prompt ? U : n === t.Pasted ? p : n === t.Image ? V : be(r ?? "");
84
- }, Se = (e) => {
81
+ return n === t.Prompt ? U : n === t.Pasted ? f : n === t.Image ? H : pe(r ?? "");
82
+ }, he = (e) => {
85
83
  let t = e.toLowerCase().split(";")[0].trim(), r = n[t];
86
84
  if (r) return r;
87
85
  let i = t.split("/")[1];
88
86
  if (i && !i.startsWith("vnd.") && !i.includes("+")) return i;
89
- }, Ce = (e, n) => {
87
+ }, ge = (e, n) => {
90
88
  let { type: r, name: i, contentType: a } = e;
91
89
  if (r === t.Prompt) return n.promptLabel ?? "Prompt";
92
90
  if (r === t.Pasted) return n.pastedLabel ?? "Pasted";
93
91
  if (r === t.Image) return n.imageLabel ?? "Image";
94
92
  if (a) {
95
- let e = Se(a);
93
+ let e = he(a);
96
94
  if (e) return `.${e}`;
97
95
  }
98
96
  let o = i.lastIndexOf(".");
99
97
  return o > 0 && o < i.length - 1 ? `.${i.slice(o + 1).toLowerCase()}` : i;
100
- }, Y = (e, n = {}) => {
98
+ }, X = (e, n = {}) => {
101
99
  let { type: i, status: a, previewUrl: o, url: s } = e, c = a === r.Loading, l = a === r.Error, u = i === t.Image && !!(o ?? s) && !l, d = i === t.Audio && !l, f = i === t.Link && !l;
102
100
  return {
103
101
  isLoading: c,
@@ -105,22 +103,10 @@ var fe = 5, pe = 4, me = "flex size-[84px] items-center justify-center rounded-x
105
103
  isImage: u,
106
104
  isAudio: d,
107
105
  isLink: f,
108
- BottomIcon: f ? null : xe(e),
109
- typeLabel: f ? null : Ce(e, n)
106
+ BottomIcon: f ? null : me(e),
107
+ typeLabel: f ? null : ge(e, n)
110
108
  };
111
- }, we = (e, t) => e <= 0 ? {
112
- layout: J.None,
113
- visibleCount: 0,
114
- hiddenCount: 0
115
- } : e < 5 || t ? {
116
- layout: J.AllVisible,
117
- visibleCount: e,
118
- hiddenCount: 0
119
- } : {
120
- layout: J.Collapsed,
121
- visibleCount: 4,
122
- hiddenCount: e - 4
123
- }, X = {
109
+ }, Z = {
124
110
  tile: "_tile_yap03_1",
125
111
  hovered: "_hovered_yap03_5",
126
112
  selected: "_selected_yap03_12",
@@ -130,46 +116,46 @@ var fe = 5, pe = 4, me = "flex size-[84px] items-center justify-center rounded-x
130
116
  retryIcon: "_retryIcon_yap03_30",
131
117
  track: "_track_yap03_34",
132
118
  imageActionButton: "_imageActionButton_yap03_38"
133
- }, Z = ({ ariaLabel: e, errorTitle: t, errorDescId: n, onClick: r, id: i, icon: o, className: s }) => /* @__PURE__ */ K(de, {
119
+ }, Q = ({ ariaLabel: e, errorTitle: t, errorDescId: n, onClick: r, id: i, icon: o, className: s }) => /* @__PURE__ */ q(se, {
134
120
  icon: o,
135
- size: le.Small,
121
+ size: oe.Small,
136
122
  className: a("absolute end-1 top-1 opacity-0 focus-visible:opacity-100 group-focus-within/attachment-tile:opacity-100 group-hover/attachment-tile:opacity-100", s),
137
123
  "aria-label": e,
138
124
  "aria-describedby": t ? n : void 0,
139
125
  onClick: (e) => {
140
126
  e.stopPropagation(), r(i);
141
127
  }
142
- }), Te = ({ ...e }) => /* @__PURE__ */ K(Z, {
143
- icon: /* @__PURE__ */ K(H, {
144
- size: W.SM,
128
+ }), _e = ({ ...e }) => /* @__PURE__ */ q(Q, {
129
+ icon: /* @__PURE__ */ q(te, {
130
+ size: G.SM,
145
131
  "aria-hidden": !0
146
132
  }),
147
- className: X.retryIcon,
133
+ className: Z.retryIcon,
148
134
  ...e
149
- }), Ee = ({ ...e }) => /* @__PURE__ */ K(Z, {
150
- icon: /* @__PURE__ */ K(m, {
151
- size: W.SM,
135
+ }), ve = ({ ...e }) => /* @__PURE__ */ q(Q, {
136
+ icon: /* @__PURE__ */ q(p, {
137
+ size: G.SM,
152
138
  "aria-hidden": !0
153
139
  }),
154
140
  ...e
155
- }), De = ({ ...e }) => /* @__PURE__ */ K(Z, {
156
- icon: /* @__PURE__ */ K(h, {
157
- size: W.SM,
141
+ }), ye = ({ ...e }) => /* @__PURE__ */ q(Q, {
142
+ icon: /* @__PURE__ */ q(m, {
143
+ size: G.SM,
158
144
  "aria-hidden": !0
159
145
  }),
160
146
  ...e
161
- }), Oe = ({ ...e }) => /* @__PURE__ */ K(Z, {
162
- icon: /* @__PURE__ */ K(ie, {
163
- size: W.SM,
147
+ }), be = ({ ...e }) => /* @__PURE__ */ q(Q, {
148
+ icon: /* @__PURE__ */ q(ne, {
149
+ size: G.SM,
164
150
  "aria-hidden": !0
165
151
  }),
166
- className: X.hoverIcon,
152
+ className: Z.hoverIcon,
167
153
  ...e
168
- }), ke = ({ attachment: e, searchQuery: t = "", onClick: n, onDownload: r, onRemove: i, labels: o, styles: s, cssVars: c, isSelected: l }) => {
154
+ }), xe = ({ attachment: e, searchQuery: t = "", onClick: n, onDownload: r, onRemove: i, labels: o, styles: s, cssVars: c, isSelected: l }) => {
169
155
  let { clickLabel: u = "Open attachment", downloadLabel: d = "Download attachment", removeLabel: f = "Remove attachment" } = o ?? {}, { typography: p, className: m } = s ?? {}, h = () => {
170
156
  n?.(e.id);
171
157
  };
172
- return /* @__PURE__ */ q("div", {
158
+ return /* @__PURE__ */ J("div", {
173
159
  style: c,
174
160
  ...n == null ? {} : {
175
161
  role: "button",
@@ -180,18 +166,18 @@ var fe = 5, pe = 4, me = "flex size-[84px] items-center justify-center rounded-x
180
166
  (e.key === "Enter" || e.key === " ") && (e.preventDefault(), h());
181
167
  }
182
168
  },
183
- className: a("group/attachment-tile relative flex w-full min-w-[280px] max-w-[300px] flex-col gap-2 rounded-xl border p-3", n && "cursor-pointer", (r || i) && "pe-8", l && X.selected, m),
169
+ className: a("group/attachment-tile relative flex w-full min-w-[280px] max-w-[300px] flex-col gap-2 rounded-xl border p-3", n && "cursor-pointer", (r || i) && "pe-8", l && Z.selected, m),
184
170
  children: [
185
- /* @__PURE__ */ K("span", {
171
+ /* @__PURE__ */ q("span", {
186
172
  title: e.name,
187
- className: a(p?.fontClassName ?? "dial-tiny-text", "min-w-0 truncate", X.nameText),
188
- children: t ? /* @__PURE__ */ K(ue, {
173
+ className: a(p?.fontClassName ?? "dial-tiny-text", "min-w-0 truncate", Z.nameText),
174
+ children: t ? /* @__PURE__ */ q(ce, {
189
175
  text: e.name,
190
176
  query: t,
191
177
  maxLines: 1
192
178
  }) : e.name
193
179
  }),
194
- e.playUrl && /* @__PURE__ */ K("audio", {
180
+ e.playUrl && /* @__PURE__ */ q("audio", {
195
181
  controls: !0,
196
182
  src: e.playUrl,
197
183
  "aria-label": e.name,
@@ -199,78 +185,78 @@ var fe = 5, pe = 4, me = "flex size-[84px] items-center justify-center rounded-x
199
185
  preload: "metadata",
200
186
  onClick: (e) => e.stopPropagation()
201
187
  }),
202
- r && /* @__PURE__ */ K(Ee, {
188
+ r && /* @__PURE__ */ q(ve, {
203
189
  ariaLabel: d,
204
190
  onClick: r,
205
191
  id: e.id
206
192
  }),
207
- i && /* @__PURE__ */ K(Oe, {
193
+ i && /* @__PURE__ */ q(be, {
208
194
  ariaLabel: f,
209
195
  onClick: i,
210
196
  id: e.id
211
197
  })
212
198
  ]
213
199
  });
214
- }, Ae = {
200
+ }, Se = 5, Ce = "flex size-[84px] items-center justify-center rounded-xl border", we = {
215
201
  [e.Network]: "Upload failed · network error",
216
202
  [e.UnsupportedType]: "Upload failed · unsupported file type"
217
- }, je = ({ attachment: n, onClick: i, onRetry: s, labels: u, styles: d, onDownload: f, isPasted: p, isLink: m, cssVars: h, onExpand: g, isExpandable: _, onRemove: v, isSelected: y }) => {
218
- let { clickLabel: b = "Download attachment", retryLabel: x = "Retry upload", sizeLabel: S, uploadingLabel: C = "Uploading", errorReasonLabels: w, genericErrorLabel: T = "Upload failed" } = u ?? {}, { typography: E, className: D } = d ?? {}, { id: O, name: k, status: A, errorReason: j } = n, M = A === r.Loading, N = A === r.Error, P = c(), F = N ? j && (w?.[j] ?? Ae[j]) || T : "", { BottomIcon: I, typeLabel: L } = Y(n), R = !N && !M && f && !m, z = N && !!s && j !== e.UnsupportedType, B = R || z ? "pe-5" : void 0, ee = (e) => {
203
+ }, Te = ({ attachment: n, onClick: i, onRetry: s, labels: u, styles: d, onDownload: f, isPasted: p, isLink: m, cssVars: h, onExpand: g, isExpandable: _, onRemove: v, isSelected: y }) => {
204
+ let { clickLabel: b = "Download attachment", retryLabel: x = "Retry upload", sizeLabel: S, uploadingLabel: C = "Uploading", errorReasonLabels: w, genericErrorLabel: T = "Upload failed" } = u ?? {}, { typography: E, className: D } = d ?? {}, { id: O, name: k, status: A, errorReason: j } = n, M = A === r.Loading, N = A === r.Error, P = c(), F = N ? j && (w?.[j] ?? we[j]) || T : "", { BottomIcon: I, typeLabel: L } = X(n), R = !N && !M && f && !m, z = N && !!s && j !== e.UnsupportedType, B = R || z ? "pe-5" : void 0, ee = (e) => {
219
205
  (e.key === "Enter" || e.key === " ") && (e.preventDefault(), i?.(n.id));
220
- }, te = l(() => p ? k : ge(k), [p, k]), ne = o(() => {
206
+ }, V = l(() => p ? k : le(k), [p, k]), H = o(() => {
221
207
  window.open(n.referenceUrl, "_blank", "noopener,noreferrer");
222
- }, [n]), V = a(me, "group/attachment-tile relative flex-col justify-between items-start gap-1 overflow-hidden p-1.5", X.tile, (n.type === t.Prompt || n.type === t.Pasted) && "hovered", y && X.selected, N && X.tileError), H = /* @__PURE__ */ K("div", {
223
- title: te,
224
- className: a(E?.nameClassName ?? "dial-caption-text", "line-clamp-2 min-w-0 break-all", X.nameText, !N && B),
225
- children: te
226
- }), U = I && /* @__PURE__ */ q("div", {
208
+ }, [n]), te = a(Ce, "group/attachment-tile relative flex-col justify-between items-start gap-1 overflow-hidden p-1.5", Z.tile, (n.type === t.Prompt || n.type === t.Pasted) && "hovered", y && Z.selected, N && Z.tileError), U = /* @__PURE__ */ q("div", {
209
+ title: V,
210
+ className: a(E?.nameClassName ?? "dial-caption-text", "line-clamp-2 min-w-0 break-all", Z.nameText, !N && B),
211
+ children: V
212
+ }), W = I && /* @__PURE__ */ J("div", {
227
213
  className: a("flex w-full items-center gap-1", N && B),
228
- children: [/* @__PURE__ */ K(I, {
214
+ children: [/* @__PURE__ */ q(I, {
229
215
  size: 16,
230
- className: X.typeText,
216
+ className: Z.typeText,
231
217
  "aria-hidden": !0
232
- }), /* @__PURE__ */ K("span", {
233
- className: a(E?.metaClassName ?? "dial-caption-text", "min-w-0 flex-1 truncate", X.typeText),
218
+ }), /* @__PURE__ */ q("span", {
219
+ className: a(E?.metaClassName ?? "dial-caption-text", "min-w-0 flex-1 truncate", Z.typeText),
234
220
  children: S ? `${L} · ${S}` : L
235
221
  })]
236
- }), re = () => {
222
+ }), ne = () => {
237
223
  _ && g ? g(O) : i && i(O);
238
- }, ie = /* @__PURE__ */ q(G, { children: [
239
- N ? /* @__PURE__ */ q(G, { children: [U, H] }) : /* @__PURE__ */ q(G, { children: [H, U] }),
240
- M && /* @__PURE__ */ K("div", {
224
+ }, G = /* @__PURE__ */ J(K, { children: [
225
+ N ? /* @__PURE__ */ J(K, { children: [W, U] }) : /* @__PURE__ */ J(K, { children: [U, W] }),
226
+ M && /* @__PURE__ */ q("div", {
241
227
  role: "progressbar",
242
228
  "aria-label": C,
243
- className: a("absolute inset-x-2 bottom-2 h-[3px] overflow-hidden rounded-full", X.track),
244
- children: /* @__PURE__ */ K(ce, { size: 32 })
229
+ className: a("absolute inset-x-2 bottom-2 h-[3px] overflow-hidden rounded-full", Z.track),
230
+ children: /* @__PURE__ */ q(ae, { size: 32 })
245
231
  }),
246
- R && /* @__PURE__ */ K(Ee, {
232
+ R && /* @__PURE__ */ q(ve, {
247
233
  ariaLabel: b,
248
234
  errorTitle: F,
249
235
  errorDescId: P,
250
236
  onClick: f,
251
237
  id: O
252
238
  }),
253
- z && /* @__PURE__ */ K(Te, {
239
+ z && /* @__PURE__ */ q(_e, {
254
240
  ariaLabel: x,
255
241
  errorTitle: F,
256
242
  errorDescId: P,
257
243
  onClick: s,
258
244
  id: O
259
245
  }),
260
- m && /* @__PURE__ */ K(De, {
246
+ m && /* @__PURE__ */ q(ye, {
261
247
  ariaLabel: x,
262
248
  errorTitle: F,
263
249
  errorDescId: P,
264
- onClick: ne
250
+ onClick: H
265
251
  }),
266
- v && /* @__PURE__ */ K(Oe, {
252
+ v && /* @__PURE__ */ q(be, {
267
253
  ariaLabel: x,
268
254
  errorTitle: F,
269
255
  errorDescId: P,
270
256
  onClick: v,
271
257
  id: O
272
258
  }),
273
- N && /* @__PURE__ */ K("span", {
259
+ N && /* @__PURE__ */ q("span", {
274
260
  id: P,
275
261
  role: "status",
276
262
  "aria-live": "polite",
@@ -278,23 +264,23 @@ var fe = 5, pe = 4, me = "flex size-[84px] items-center justify-center rounded-x
278
264
  children: F
279
265
  })
280
266
  ] });
281
- return /* @__PURE__ */ K("div", {
267
+ return /* @__PURE__ */ q("div", {
282
268
  style: h,
283
269
  className: a("inline-flex", D),
284
- children: /* @__PURE__ */ K("div", {
270
+ children: /* @__PURE__ */ q("div", {
285
271
  role: "button",
286
272
  tabIndex: 0,
287
273
  "aria-label": b,
288
- onClick: re,
274
+ onClick: ne,
289
275
  onKeyDown: ee,
290
276
  style: h,
291
- className: a(V, "cursor-pointer focus-within:outline focus-within:outline-1 focus-within:outline-offset-1"),
292
- children: ie
277
+ className: a(te, "cursor-pointer focus-within:outline focus-within:outline-1 focus-within:outline-offset-1"),
278
+ children: G
293
279
  })
294
280
  });
295
- }, Q = /* @__PURE__ */ function(e) {
281
+ }, $ = /* @__PURE__ */ function(e) {
296
282
  return e.Idle = "idle", e.Loading = "loading", e.Loaded = "loaded", e.Error = "error", e;
297
- }({}), Me = ({ enabled: e, src: t }) => {
283
+ }({}), Ee = ({ enabled: e, src: t }) => {
298
284
  let n = u(null), [r, i] = d("idle");
299
285
  return s(() => {
300
286
  i(e && t ? "loading" : "idle");
@@ -309,15 +295,15 @@ var fe = 5, pe = 4, me = "flex size-[84px] items-center justify-center rounded-x
309
295
  imageRef: n,
310
296
  imageLoadStatus: r
311
297
  };
312
- }, Ne = ({ attachment: e, onExpand: n, onClick: r, labels: i, onRemove: o, cssVars: s, onDownload: c, styles: u, isSelected: d }) => {
313
- let { clickLabel: f = "Open attachment", expandLabel: p = "Expand pasted text" } = i ?? {}, { className: m } = u ?? {}, { id: h, name: g } = e, _ = e.previewUrl ?? e.url, v = e.type === t.Pasted && n !== void 0, { isLoading: y, isError: b, isImage: x } = l(() => Y(e), [e]), S = r !== void 0 && !v && !y && !b, { imageRef: C, imageLoadStatus: w } = Me({
298
+ }, De = ({ attachment: e, onExpand: n, onClick: r, labels: i, onRemove: o, cssVars: s, onDownload: c, styles: u, isSelected: d }) => {
299
+ let { clickLabel: f = "Open attachment", expandLabel: p = "Expand pasted text" } = i ?? {}, { className: m } = u ?? {}, { id: h, name: g } = e, _ = e.previewUrl ?? e.url, v = e.type === t.Pasted && n !== void 0, { isLoading: y, isError: b, isImage: x } = l(() => X(e), [e]), S = r !== void 0 && !v && !y && !b, { imageRef: C, imageLoadStatus: w } = Ee({
314
300
  enabled: x,
315
301
  src: _
316
302
  }), T = () => {
317
303
  v && n ? n(h) : S && r && r(h);
318
304
  };
319
- return /* @__PURE__ */ K("div", {
320
- className: a(me, "group/attachment-tile", S && "cursor-pointer", X.tile, d && X.selected, m),
305
+ return /* @__PURE__ */ q("div", {
306
+ className: a(Ce, "group/attachment-tile", S && "cursor-pointer", Z.tile, d && Z.selected, m),
321
307
  onClick: T,
322
308
  onKeyDown: (e) => {
323
309
  (e.key === "Enter" || e.key === " ") && (e.preventDefault(), T());
@@ -326,43 +312,43 @@ var fe = 5, pe = 4, me = "flex size-[84px] items-center justify-center rounded-x
326
312
  role: "button",
327
313
  style: s,
328
314
  "aria-label": S ? f : v ? p : void 0,
329
- children: /* @__PURE__ */ q("div", {
315
+ children: /* @__PURE__ */ J("div", {
330
316
  className: "relative h-full w-full overflow-hidden",
331
317
  children: [
332
- o && /* @__PURE__ */ K(Oe, {
318
+ o && /* @__PURE__ */ q(be, {
333
319
  onClick: o,
334
320
  id: h,
335
- className: X.imageActionButton
321
+ className: Z.imageActionButton
336
322
  }),
337
- c && /* @__PURE__ */ K(Ee, {
323
+ c && /* @__PURE__ */ q(ve, {
338
324
  onClick: c,
339
325
  id: h,
340
- className: X.imageActionButton
326
+ className: Z.imageActionButton
341
327
  }),
342
- w !== Q.Loaded && /* @__PURE__ */ K(oe, {
343
- variant: se.Rectangular,
328
+ w !== $.Loaded && /* @__PURE__ */ q(re, {
329
+ variant: ie.Rectangular,
344
330
  width: "100%",
345
331
  height: "100%",
346
- active: w === Q.Loading,
347
- overlay: /* @__PURE__ */ K(V, {
348
- size: W.LG,
349
- className: X.typeText,
332
+ active: w === $.Loading,
333
+ overlay: /* @__PURE__ */ q(H, {
334
+ size: G.LG,
335
+ className: Z.typeText,
350
336
  "aria-hidden": !0
351
337
  }),
352
338
  className: "absolute inset-0 rounded-xl"
353
339
  }),
354
- /* @__PURE__ */ K("img", {
340
+ /* @__PURE__ */ q("img", {
355
341
  ref: C,
356
342
  src: _,
357
343
  alt: g,
358
344
  loading: "lazy",
359
345
  decoding: "async",
360
- className: a("h-full w-full rounded-xl object-cover transition-opacity duration-200", w === Q.Loaded ? "opacity-100" : "opacity-0")
346
+ className: a("h-full w-full rounded-xl object-cover transition-opacity duration-200", w === $.Loaded ? "opacity-100" : "opacity-0")
361
347
  })
362
348
  ]
363
349
  })
364
350
  });
365
- }, Pe = ({ attachment: e, searchQuery: n = "", onRemove: r, onRetry: a, onExpand: o, onClick: s, onDownload: c, labels: u, styles: d, isSelected: f }) => {
351
+ }, Oe = ({ attachment: e, searchQuery: n = "", onRemove: r, onRetry: a, onExpand: o, onClick: s, onDownload: c, labels: u, styles: d, isSelected: f }) => {
366
352
  let { colors: p } = d ?? {}, m = e.type === t.Pasted, h = m && o !== void 0, g = i({
367
353
  "--ai-tile-bg": p?.background,
368
354
  "--ai-tile-border": p?.border,
@@ -380,8 +366,8 @@ var fe = 5, pe = 4, me = "flex size-[84px] items-center justify-center rounded-x
380
366
  "--ai-tile-hover-icon-color": p?.hoverIconColor,
381
367
  "--ai-tile-progress-track": p?.trackBackground,
382
368
  "--ai-tile-fill-bg": p?.fillBackground
383
- }), { isImage: _, isAudio: v, isLink: y } = l(() => Y(e), [e]);
384
- return v ? /* @__PURE__ */ K(ke, {
369
+ }), { isImage: _, isAudio: v, isLink: y } = l(() => X(e), [e]);
370
+ return v ? /* @__PURE__ */ q(xe, {
385
371
  attachment: e,
386
372
  labels: u,
387
373
  onClick: s,
@@ -391,7 +377,7 @@ var fe = 5, pe = 4, me = "flex size-[84px] items-center justify-center rounded-x
391
377
  styles: d,
392
378
  cssVars: g,
393
379
  isSelected: f
394
- }) : _ ? /* @__PURE__ */ K(Ne, {
380
+ }) : _ ? /* @__PURE__ */ q(De, {
395
381
  attachment: e,
396
382
  labels: u,
397
383
  onClick: s,
@@ -401,7 +387,7 @@ var fe = 5, pe = 4, me = "flex size-[84px] items-center justify-center rounded-x
401
387
  cssVars: g,
402
388
  onDownload: c,
403
389
  isSelected: f
404
- }) : /* @__PURE__ */ K(je, {
390
+ }) : /* @__PURE__ */ q(Te, {
405
391
  attachment: e,
406
392
  onClick: s,
407
393
  onRetry: a,
@@ -416,15 +402,15 @@ var fe = 5, pe = 4, me = "flex size-[84px] items-center justify-center rounded-x
416
402
  isExpandable: h,
417
403
  isSelected: f
418
404
  });
419
- }, Fe = ({ attachments: e, onRemove: t, onRetry: n, onExpand: r, onAttachmentClick: i, labels: o, styles: s }) => {
405
+ }, ke = ({ attachments: e, onRemove: t, onRetry: n, onExpand: r, onAttachmentClick: i, labels: o, styles: s }) => {
420
406
  let { ariaLabel: c = "Attached files", removeLabel: l, retryLabel: u, clickLabel: d } = o ?? {}, { className: f } = s ?? {};
421
- return e.length === 0 ? null : /* @__PURE__ */ K("div", {
407
+ return e.length === 0 ? null : /* @__PURE__ */ q("div", {
422
408
  role: "list",
423
409
  "aria-label": c,
424
410
  className: a("flex w-full min-w-0 gap-2 overflow-x-auto", f),
425
- children: e.map((e) => /* @__PURE__ */ K("div", {
411
+ children: e.map((e) => /* @__PURE__ */ q("div", {
426
412
  role: "listitem",
427
- children: /* @__PURE__ */ K(Pe, {
413
+ children: /* @__PURE__ */ q(Oe, {
428
414
  attachment: e,
429
415
  onRemove: t,
430
416
  onRetry: n,
@@ -438,159 +424,110 @@ var fe = 5, pe = 4, me = "flex size-[84px] items-center justify-center rounded-x
438
424
  })
439
425
  }, e.id))
440
426
  });
441
- }, Ie = { tile: "_tile_1qzn0_1" }, Le = ({ count: e, onClick: t, labels: n, children: r, styles: o }) => {
442
- let { ariaLabel: s } = n ?? {}, { typography: { fontClassName: c = "dial-small-semi-text" } = {}, className: l, colors: u } = o ?? {}, d = i({
443
- "--ai-more-tile-bg": u?.background,
444
- "--ai-more-tile-border": u?.border,
445
- "--ai-more-tile-color": u?.color,
446
- "--ai-more-tile-bg-hover": u?.backgroundHover,
447
- "--ai-more-tile-color-hover": u?.colorHover,
448
- "--ai-more-tile-border-hover": u?.borderHover,
449
- "--ai-more-tile-focus-outline": u?.focusOutline
450
- });
451
- return /* @__PURE__ */ K("button", {
452
- type: "button",
453
- onClick: t,
454
- "aria-label": s ?? `Show ${e} more attachments`,
455
- style: d,
456
- className: a(me, c, Ie.tile, l),
457
- children: r ?? /* @__PURE__ */ K("bdi", {
458
- dir: "ltr",
459
- children: `+${e}`
460
- })
461
- });
462
- }, $ = {
463
- container: "_container_jvs4c_1",
464
- headerIcon: "_headerIcon_jvs4c_6",
465
- headerLabel: "_headerLabel_jvs4c_7",
466
- downloadAllButton: "_downloadAllButton_jvs4c_8"
467
- }, Re = (e, t) => `${e} ${t}${e === 1 ? "" : "s"}`, ze = ({ attachments: e, onAttachmentClick: n, onDownloadAll: o, onRetry: s, labels: c, styles: u, selectedAttachmentId: p }) => {
468
- let { ariaLabel: h = "Attachments", clickLabel: _ = "Download attachment", retryLabel: v = "Retry upload", showLessLabel: y = "Show less", downloadAllLabel: b = "Download all", openInNewTabLabel: x, getHeaderLabel: S = (e) => Re(e, "attachment"), promptLabel: C, pastedLabel: w, imageLabel: T } = c ?? {}, { typography: { headerLabelClassName: E = "dial-tiny-semi-text" } = {}, colors: D, className: O } = u ?? {}, k = i({
469
- "--ai-group-bg": D?.background,
470
- "--ai-group-border": D?.border,
471
- "--ai-group-text": D?.text
472
- }), [A, j] = d(!1), M = l(() => we(e.length, A), [e.length, A]);
427
+ }, Ae = {
428
+ headerIcon: "_headerIcon_1sgtq_1",
429
+ headerLabel: "_headerLabel_1sgtq_2"
430
+ }, je = (e, t) => `${e} ${t}${e === 1 ? "" : "s"}`, Me = ({ attachments: e, onAttachmentClick: n, onDownloadAll: o, onRetry: s, labels: c, styles: l, selectedAttachmentId: u }) => {
431
+ let { ariaLabel: d = "Attachments", clickLabel: f = "Download attachment", retryLabel: m = "Retry upload", downloadAllLabel: g = "Download all", openInNewTabLabel: _, getHeaderLabel: v = (e) => je(e, "attachment"), promptLabel: y, pastedLabel: b, imageLabel: x } = c ?? {}, { typography: S, colors: C, className: w } = l ?? {}, T = i({ "--ai-group-text": C?.text });
473
432
  if (e.length === 0) return null;
474
- let N = e.some((e) => e.type === t.Image), P = e.some((e) => e.type !== t.Image), F = N && P, I = e.length >= 5, L = F ? ne : N ? V : g, R = S(e.length), z = e.slice(0, M.visibleCount), B = () => {
433
+ 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 ? V : E ? H : h, j = v(e.length), M = () => {
475
434
  let t = e.filter((e) => e.status === r.Idle);
476
435
  o ? o(t) : t.forEach((e) => n?.(e.id));
477
- }, ee = (t) => {
436
+ }, N = (t) => {
478
437
  let n = e.find((e) => e.id === t);
479
438
  n && o?.([n]);
480
439
  };
481
- return /* @__PURE__ */ q("div", {
440
+ return /* @__PURE__ */ J("div", {
482
441
  role: "group",
483
- "aria-label": h,
484
- style: k,
485
- className: a("rounded-2xl border p-3", I ? "w-full min-w-0 max-w-[492px]" : "max-w-[420px]", $.container, O),
486
- children: [/* @__PURE__ */ q("div", {
487
- className: "mb-3 flex min-h-6 items-center gap-2",
488
- children: [
489
- /* @__PURE__ */ K(L, {
490
- size: W.SM,
491
- className: a("shrink-0", $.headerIcon),
442
+ "aria-label": d,
443
+ style: T,
444
+ className: a("flex flex-col gap-1", k ? "w-full min-w-0 max-w-[492px]" : "max-w-[420px]", Ae.container, w),
445
+ children: [/* @__PURE__ */ J("div", {
446
+ className: "flex items-center justify-between",
447
+ children: [/* @__PURE__ */ J("div", {
448
+ className: "flex items-center gap-1",
449
+ children: [/* @__PURE__ */ q(A, {
450
+ size: G.SM,
451
+ className: a("shrink-0", Ae.headerIcon),
452
+ "aria-hidden": !0
453
+ }), /* @__PURE__ */ q("span", {
454
+ className: a(S?.headerLabelClassName ?? "dial-tiny-semi-text", Ae.headerLabel),
455
+ children: j
456
+ })]
457
+ }), e.length >= 2 && (o || n) && /* @__PURE__ */ q(se, {
458
+ icon: /* @__PURE__ */ q(p, {
459
+ size: G.SM,
492
460
  "aria-hidden": !0
493
461
  }),
494
- /* @__PURE__ */ K("span", {
495
- className: a(E, $.headerLabel),
496
- children: R
497
- }),
498
- e.length >= 2 && (o || n) && /* @__PURE__ */ K(ae, {
499
- icon: /* @__PURE__ */ K(m, {
500
- size: W.SM,
501
- "aria-hidden": !0
502
- }),
503
- className: a("ms-auto h-6 w-6 rounded-lg", $.downloadAllButton),
504
- "aria-label": b,
505
- onClick: B
506
- })
507
- ]
462
+ size: oe.Small,
463
+ "aria-label": g,
464
+ onClick: M
465
+ })]
508
466
  }), /* @__PURE__ */ q("div", {
509
467
  role: "list",
510
- "aria-label": R,
511
- className: a("gap-3", I ? "grid grid-cols-[repeat(5,83px)] overflow-x-auto" : "flex flex-wrap"),
512
- children: [
513
- z.map((e, t) => /* @__PURE__ */ K("div", {
514
- role: "listitem",
515
- children: /* @__PURE__ */ K(Pe, {
516
- attachment: e,
517
- onClick: n,
518
- onDownload: ee,
519
- onRetry: s,
520
- labels: {
521
- clickLabel: _,
522
- retryLabel: v,
523
- promptLabel: C,
524
- pastedLabel: w,
525
- imageLabel: T,
526
- openInNewTabLabel: x
527
- },
528
- isSelected: e.id === p
529
- })
530
- }, `${e.id}-${t}`)),
531
- M.layout === J.Collapsed && /* @__PURE__ */ K("div", {
532
- role: "listitem",
533
- children: /* @__PURE__ */ K(Le, {
534
- count: M.hiddenCount,
535
- onClick: () => j(!0)
536
- })
537
- }),
538
- I && A && /* @__PURE__ */ K("div", {
539
- role: "listitem",
540
- children: /* @__PURE__ */ K(Le, {
541
- count: 0,
542
- onClick: () => j(!1),
543
- labels: { ariaLabel: y },
544
- children: /* @__PURE__ */ K(f, {
545
- size: W.MD,
546
- "aria-hidden": !0
547
- })
548
- })
468
+ "aria-label": j,
469
+ className: a("gap-3", k ? "grid grid-cols-[repeat(5,83px)]" : "flex flex-wrap"),
470
+ children: e.map((e, t) => /* @__PURE__ */ q("div", {
471
+ role: "listitem",
472
+ children: /* @__PURE__ */ q(Oe, {
473
+ attachment: e,
474
+ onClick: n,
475
+ onDownload: N,
476
+ onRetry: s,
477
+ labels: {
478
+ clickLabel: f,
479
+ retryLabel: m,
480
+ promptLabel: y,
481
+ pastedLabel: b,
482
+ imageLabel: x,
483
+ openInNewTabLabel: _
484
+ },
485
+ isSelected: e.id === u
549
486
  })
550
- ]
487
+ }, `${e.id}-${t}`))
551
488
  })]
552
489
  });
553
- }, Be = {
490
+ }, Ne = {
554
491
  overlay: "_overlay_1lz3x_1",
555
492
  icon: "_icon_1lz3x_5",
556
493
  deniedIcon: "_deniedIcon_1lz3x_9"
557
- }, Ve = ({ isVisible: e, isAttachmentsAllowed: t = !0, labels: n, styles: r }) => {
494
+ }, Pe = ({ isVisible: e, isAttachmentsAllowed: t = !0, labels: n, styles: r }) => {
558
495
  let { title: o, subtitle: s } = n ?? {}, { colors: c, typography: l } = r ?? {};
559
496
  if (!e) return null;
560
497
  let u = i({
561
498
  "--ai-fd-bg": c?.background,
562
499
  "--ai-fd-icon": c?.icon,
563
500
  "--ai-fd-denied-icon": c?.deniedIcon
564
- }), 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 ? Be.icon : Be.deniedIcon, m = (e) => {
501
+ }), 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 ? Ne.icon : Ne.deniedIcon, m = (e) => {
565
502
  e.preventDefault();
566
- }, h = t ? _ : ee;
567
- return /* @__PURE__ */ K("div", {
503
+ }, h = t ? g : B;
504
+ return /* @__PURE__ */ q("div", {
568
505
  role: "status",
569
506
  "aria-live": "polite",
570
- className: a("fixed inset-0 z-[9999] flex items-center justify-center backdrop-blur-sm", Be.overlay, t ? "pointer-events-none" : "pointer-events-auto cursor-not-allowed"),
507
+ className: a("fixed inset-0 z-[9999] flex items-center justify-center backdrop-blur-sm", Ne.overlay, t ? "pointer-events-none" : "pointer-events-auto cursor-not-allowed"),
571
508
  onDragOver: t ? void 0 : m,
572
509
  onDrop: t ? void 0 : m,
573
510
  style: u,
574
- children: /* @__PURE__ */ q("div", {
511
+ children: /* @__PURE__ */ J("div", {
575
512
  className: "flex flex-col items-center text-center",
576
513
  children: [
577
- /* @__PURE__ */ K(h, {
514
+ /* @__PURE__ */ q(h, {
578
515
  size: 100,
579
516
  className: p,
580
517
  "aria-hidden": !0
581
518
  }),
582
- /* @__PURE__ */ K("span", {
519
+ /* @__PURE__ */ q("span", {
583
520
  className: a("mt-5", l?.titleClassName ?? "dial-h3-text"),
584
521
  children: d
585
522
  }),
586
- /* @__PURE__ */ K("span", {
523
+ /* @__PURE__ */ q("span", {
587
524
  className: a("mt-4", l?.subtitleClassName ?? "dial-small-text"),
588
525
  children: f
589
526
  })
590
527
  ]
591
528
  })
592
529
  });
593
- }, He = (e, n, i = {}) => {
530
+ }, Fe = (e, n, i = {}) => {
594
531
  let { screenshotName: a = "Screenshot.png", pastedTextName: s = "Pasted text" } = i;
595
532
  return { handlePaste: o((i) => {
596
533
  if (!i.clipboardData) return;
@@ -601,7 +538,7 @@ var fe = 5, pe = 4, me = "flex size-[84px] items-center justify-center rounded-x
601
538
  let i = e.getAsFile();
602
539
  if (!i) continue;
603
540
  let o = new File([i], a, { type: i.type }), s = {
604
- id: he(),
541
+ id: Y(),
605
542
  name: a,
606
543
  contentType: i.type,
607
544
  file: o,
@@ -617,7 +554,7 @@ var fe = 5, pe = 4, me = "flex size-[84px] items-center justify-center rounded-x
617
554
  let l = i.clipboardData.getData("text/plain");
618
555
  if (l.length > n) {
619
556
  let n = l.trim(), a = (n.length > 80 ? `${n.slice(0, 80).trimEnd()}…` : n) || s, o = new File([l], a, { type: "text/plain" }), c = {
620
- id: he(),
557
+ id: Y(),
621
558
  name: a,
622
559
  contentType: "text/plain",
623
560
  file: o,
@@ -632,6 +569,6 @@ var fe = 5, pe = 4, me = "flex size-[84px] items-center justify-center rounded-x
632
569
  a,
633
570
  s
634
571
  ]) };
635
- }, Ue = 100;
572
+ }, Ie = 100;
636
573
  //#endregion
637
- export { pe as ATTACHMENT_COLLAPSED_VISIBLE_COUNT, fe as ATTACHMENT_COLLAPSE_THRESHOLD, Pe as AttachmentCard, ze as AttachmentGroup, Le as AttachmentMoreTile, J as AttachmentTilesLayout, Fe as AttachmentTray, Ve as FileDndOverlay, Q as LazyImageLoadStatus, Ue as MAX_UPLOADS_PER_MINUTE, he as generateAttachmentId, Y as getAttachmentCardState, be as getAttachmentIcon, we as getAttachmentTilesPlan, Se as getExtFromContentType, ge as getNameWithoutExtension, ye as isMimeTypeAllowed, ve as mimeTypesToExtensionLabels, He as useClipboardPaste, Me as useLazyImageLoad };
574
+ export { Se as ATTACHMENT_COLLAPSE_THRESHOLD, Oe as AttachmentCard, Me as AttachmentGroup, ke as AttachmentTray, Pe as FileDndOverlay, $ as LazyImageLoadStatus, Ie as MAX_UPLOADS_PER_MINUTE, Y as generateAttachmentId, X as getAttachmentCardState, pe as getAttachmentIcon, he as getExtFromContentType, le as getNameWithoutExtension, fe as isMimeTypeAllowed, de as mimeTypesToExtensionLabels, Fe as useClipboardPaste, Ee as useLazyImageLoad };
@@ -1,23 +1,5 @@
1
1
  import { DisplayAttachment } from '@epam/ai-dial-chat-shared';
2
2
  import { AttachmentTypeLabels } from './attachment-card';
3
- /** How the unified attachment tile grid should render for a given total attachment count. */
4
- export declare enum AttachmentTilesLayout {
5
- /** No attachments. */
6
- None = "none",
7
- /** Below the collapse threshold, or expanded: every tile shown. */
8
- AllVisible = "all-visible",
9
- /** At/above the collapse threshold, not yet expanded: a few tiles + a "+N" tile. */
10
- Collapsed = "collapsed"
11
- }
12
- /** Rendering plan for the unified attachment tile grid. */
13
- export interface AttachmentTilesPlan {
14
- /** Which rendering mode the grid should use. */
15
- layout: AttachmentTilesLayout;
16
- /** Number of tiles to actually render. */
17
- visibleCount: number;
18
- /** Number of attachments hidden behind the "+N" tile (0 unless `layout` is `Collapsed`). */
19
- hiddenCount: number;
20
- }
21
3
  /** Localised accessible labels for the `AttachmentGroup` component. */
22
4
  export interface AttachmentGroupLabels extends AttachmentTypeLabels {
23
5
  /** Accessible label for the group region. Defaults to `'Attachments'`. */
@@ -26,8 +8,6 @@ export interface AttachmentGroupLabels extends AttachmentTypeLabels {
26
8
  clickLabel?: string;
27
9
  /** Accessible label for each row's retry action. Defaults to `'Retry upload'`. */
28
10
  retryLabel?: string;
29
- /** Label for the "show less" header action, shown once the group has been expanded via the "+N" tile. Defaults to `'Show less'`. */
30
- showLessLabel?: string;
31
11
  /** Label for the "download all" header action, shown whenever the group has 2+ attachments. Defaults to `'Download all'`. */
32
12
  downloadAllLabel?: string;
33
13
  /** Accessible label for each tile's open-in-new-tab button. Defaults to `'Open in new tab'`. */
@@ -41,10 +21,6 @@ export interface AttachmentGroupLabels extends AttachmentTypeLabels {
41
21
  }
42
22
  /** CSS custom-property overrides for the `AttachmentGroup` component. */
43
23
  export interface AttachmentGroupColors {
44
- /** Group container background color. */
45
- background?: string;
46
- /** Group container border color. */
47
- border?: string;
48
24
  /** Header icon/label/download-all button text color. */
49
25
  text?: string;
50
26
  }
@@ -1 +1 @@
1
- {"version":3,"file":"attachment-group.d.ts","sourceRoot":"","sources":["../../src/models/attachment-group.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE9D,6FAA6F;AAC7F,oBAAY,qBAAqB;IAC/B,sBAAsB;IACtB,IAAI,SAAS;IACb,mEAAmE;IACnE,UAAU,gBAAgB;IAC1B,oFAAoF;IACpF,SAAS,cAAc;CACxB;AAED,2DAA2D;AAC3D,MAAM,WAAW,mBAAmB;IAClC,gDAAgD;IAChD,MAAM,EAAE,qBAAqB,CAAC;IAC9B,0CAA0C;IAC1C,YAAY,EAAE,MAAM,CAAC;IACrB,4FAA4F;IAC5F,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,uEAAuE;AACvE,MAAM,WAAW,qBAAsB,SAAQ,oBAAoB;IACjE,0EAA0E;IAC1E,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,gGAAgG;IAChG,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;OAIG;IACH,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CAC5C;AAED,yEAAyE;AACzE,MAAM,WAAW,qBAAqB;IACpC,wCAAwC;IACxC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oCAAoC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,wDAAwD;IACxD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,gEAAgE;AAChE,MAAM,WAAW,yBAAyB;IACxC,4GAA4G;IAC5G,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,2DAA2D;AAC3D,MAAM,WAAW,qBAAqB;IACpC,wDAAwD;IACxD,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,iDAAiD;IACjD,UAAU,CAAC,EAAE,yBAAyB,CAAC;IACvC,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,yDAAyD;AACzD,MAAM,WAAW,oBAAoB;IACnC,sEAAsE;IACtE,WAAW,EAAE,iBAAiB,EAAE,CAAC;IACjC,mGAAmG;IACnG,iBAAiB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC;;;;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,gKAAgK;IAChK,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,qCAAqC;IACrC,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,kHAAkH;IAClH,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B"}
1
+ {"version":3,"file":"attachment-group.d.ts","sourceRoot":"","sources":["../../src/models/attachment-group.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE9D,uEAAuE;AACvE,MAAM,WAAW,qBAAsB,SAAQ,oBAAoB;IACjE,0EAA0E;IAC1E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8FAA8F;IAC9F,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kFAAkF;IAClF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,6HAA6H;IAC7H,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gGAAgG;IAChG,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;OAIG;IACH,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CAC5C;AAED,yEAAyE;AACzE,MAAM,WAAW,qBAAqB;IACpC,wDAAwD;IACxD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,gEAAgE;AAChE,MAAM,WAAW,yBAAyB;IACxC,4GAA4G;IAC5G,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,2DAA2D;AAC3D,MAAM,WAAW,qBAAqB;IACpC,wDAAwD;IACxD,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,iDAAiD;IACjD,UAAU,CAAC,EAAE,yBAAyB,CAAC;IACvC,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,yDAAyD;AACzD,MAAM,WAAW,oBAAoB;IACnC,sEAAsE;IACtE,WAAW,EAAE,iBAAiB,EAAE,CAAC;IACjC,mGAAmG;IACnG,iBAAiB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC;;;;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,gKAAgK;IAChK,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,qCAAqC;IACrC,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,kHAAkH;IAClH,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@epam/ai-dial-attachment-input",
3
3
  "description": "File attachment input components with upload validation, drag-and-drop, and progress tracking",
4
- "version": "1.1.0-dev.78",
4
+ "version": "1.1.0-dev.87",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "main": "./index.js",
@@ -17,10 +17,10 @@
17
17
  }
18
18
  },
19
19
  "peerDependencies": {
20
- "@epam/ai-dial-chat-shared": "1.1.0-dev.78",
20
+ "@epam/ai-dial-chat-shared": "1.1.0-dev.87",
21
21
  "@tabler/icons-react": "^3.44.0",
22
22
  "react": "^19.0.0",
23
- "@epam/ai-dial-ui-kit": "^0.13.0-dev.25"
23
+ "@epam/ai-dial-ui-kit": "^0.13.0-dev.26"
24
24
  },
25
25
  "repository": {
26
26
  "type": "git",
@@ -1,7 +1,6 @@
1
1
  import { DisplayAttachment } from '@epam/ai-dial-chat-shared';
2
2
  import { Icon } from '@tabler/icons-react';
3
3
  import { AttachmentCardState, AttachmentTypeLabels } from '../models/attachment-card';
4
- import { AttachmentTilesPlan } from '../models/attachment-group';
5
4
  /** Generates a unique identifier for an attachment. */
6
5
  export declare const generateAttachmentId: () => string;
7
6
  /** Returns the name without its trailing file extension. Returns an empty string when `name` is nullish. */
@@ -24,6 +23,4 @@ export declare const getAttachmentIcon: (contentType: string) => Icon;
24
23
  export declare const getExtFromContentType: (contentType: string) => string | undefined;
25
24
  /** Derives the display state (icons, labels, color classes) an AttachmentCard needs to render a given attachment. */
26
25
  export declare const getAttachmentCardState: (attachment: DisplayAttachment, typeLabels?: AttachmentTypeLabels) => AttachmentCardState;
27
- /** Decides how the unified tile grid should render for `totalCount` attachments, given whether the group is expanded. */
28
- export declare const getAttachmentTilesPlan: (totalCount: number, isExpanded: boolean) => AttachmentTilesPlan;
29
26
  //# sourceMappingURL=attachment.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"attachment.d.ts","sourceRoot":"","sources":["../../src/utils/attachment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAMnE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAoChD,OAAO,KAAK,EACV,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,4BAA4B,CAAC;AAEpC,uDAAuD;AACvD,eAAO,MAAM,oBAAoB,QAAO,MACgB,CAAC;AAEzD,4GAA4G;AAC5G,eAAO,MAAM,uBAAuB,GAAI,MAAM,MAAM,KAAG,MAItD,CAAC;AASF,uHAAuH;AACvH,eAAO,MAAM,0BAA0B,GACrC,OAAO,MAAM,EAAE,EACf,iBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAwB,KAC5D,MAUF,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,GAC5B,UAAU,MAAM,EAChB,cAAc,MAAM,EAAE,KACrB,OAUF,CAAC;AAEF,wGAAwG;AACxG,eAAO,MAAM,iBAAiB,GAAI,aAAa,MAAM,KAAG,IA0FvD,CAAC;AAUF,4GAA4G;AAC5G,eAAO,MAAM,qBAAqB,GAChC,aAAa,MAAM,KAClB,MAAM,GAAG,SAUX,CAAC;AA0BF,qHAAqH;AACrH,eAAO,MAAM,sBAAsB,GACjC,YAAY,iBAAiB,EAC7B,aAAY,oBAAyB,KACpC,mBAmBF,CAAC;AAEF,yHAAyH;AACzH,eAAO,MAAM,sBAAsB,GACjC,YAAY,MAAM,EAClB,YAAY,OAAO,KAClB,mBAoBF,CAAC"}
1
+ {"version":3,"file":"attachment.d.ts","sourceRoot":"","sources":["../../src/utils/attachment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAMnE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAgChD,OAAO,KAAK,EACV,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,2BAA2B,CAAC;AAEnC,uDAAuD;AACvD,eAAO,MAAM,oBAAoB,QAAO,MACgB,CAAC;AAEzD,4GAA4G;AAC5G,eAAO,MAAM,uBAAuB,GAAI,MAAM,MAAM,KAAG,MAItD,CAAC;AASF,uHAAuH;AACvH,eAAO,MAAM,0BAA0B,GACrC,OAAO,MAAM,EAAE,EACf,iBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAwB,KAC5D,MAUF,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,GAC5B,UAAU,MAAM,EAChB,cAAc,MAAM,EAAE,KACrB,OAUF,CAAC;AAEF,wGAAwG;AACxG,eAAO,MAAM,iBAAiB,GAAI,aAAa,MAAM,KAAG,IA0FvD,CAAC;AAUF,4GAA4G;AAC5G,eAAO,MAAM,qBAAqB,GAChC,aAAa,MAAM,KAClB,MAAM,GAAG,SAUX,CAAC;AA0BF,qHAAqH;AACrH,eAAO,MAAM,sBAAsB,GACjC,YAAY,iBAAiB,EAC7B,aAAY,oBAAyB,KACpC,mBAmBF,CAAC"}
@@ -1,5 +0,0 @@
1
- import { FC } from 'react';
2
- import { AttachmentMoreTileProps } from '../../models/attachment-more-tile';
3
- /** Square placeholder tile shown in the attachment grid: a "+N" overflow tile when collapsed, or a collapse-icon tile when expanded. */
4
- export declare const AttachmentMoreTile: FC<AttachmentMoreTileProps>;
5
- //# sourceMappingURL=AttachmentMoreTile.d.ts.map
@@ -1 +0,0 @@
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;AAEhC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAGjF,wIAAwI;AACxI,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC,uBAAuB,CAuC1D,CAAC"}
@@ -1,54 +0,0 @@
1
- import { ReactNode } from 'react';
2
- /** CSS custom-property overrides for the `AttachmentMoreTile` component. */
3
- export interface AttachmentMoreTileColors {
4
- /** Tile background color in the default state. */
5
- background?: string;
6
- /** Tile border color in the default state. */
7
- border?: string;
8
- /** Tile text/icon color in the default state. */
9
- color?: string;
10
- /** Tile background color on hover. */
11
- backgroundHover?: string;
12
- /** Tile text/icon color on hover. */
13
- colorHover?: string;
14
- /** Tile border color on hover. */
15
- borderHover?: string;
16
- /** Tile focus outline color. */
17
- focusOutline?: string;
18
- }
19
- /** User-visible strings for the `AttachmentMoreTile` component. */
20
- export interface AttachmentMoreTileLabels {
21
- /**
22
- * Accessible label. Defaults to `'Show {count} more attachments'`; pass an
23
- * explicit label (e.g. `'Show less'`) when overriding `children`.
24
- */
25
- ariaLabel?: string;
26
- }
27
- /** Typography overrides for the `AttachmentMoreTile` component. */
28
- export interface AttachmentMoreTileTypography {
29
- /** Typography class applied to the tile's text/icon content. Defaults to `'dial-small-semi-text'`. */
30
- fontClassName?: string;
31
- }
32
- /** Style overrides for the `AttachmentMoreTile` component. */
33
- export interface AttachmentMoreTileStyles {
34
- /** Color overrides applied as CSS custom properties. */
35
- colors?: AttachmentMoreTileColors;
36
- /** Typography overrides for the tile's text/icon content. */
37
- typography?: AttachmentMoreTileTypography;
38
- /** Extra class name(s) merged onto the root element. */
39
- className?: string;
40
- }
41
- /** Props accepted by the `AttachmentMoreTile` component. */
42
- export interface AttachmentMoreTileProps {
43
- /** Number of additional, not-yet-visible attachments. Only used for the default `"+N"` content/label. */
44
- count: number;
45
- /** Called when the tile is activated (expands or collapses the group). */
46
- onClick: () => void;
47
- /** User-visible strings. */
48
- labels?: AttachmentMoreTileLabels;
49
- /** Overrides the default `"+N"` content, e.g. a collapse icon for the "show less" placeholder tile. */
50
- children?: ReactNode;
51
- /** Style overrides for the tile. */
52
- styles?: AttachmentMoreTileStyles;
53
- }
54
- //# sourceMappingURL=attachment-more-tile.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"attachment-more-tile.d.ts","sourceRoot":"","sources":["../../src/models/attachment-more-tile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,4EAA4E;AAC5E,MAAM,WAAW,wBAAwB;IACvC,kDAAkD;IAClD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8CAA8C;IAC9C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iDAAiD;IACjD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sCAAsC;IACtC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,qCAAqC;IACrC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kCAAkC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gCAAgC;IAChC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,mEAAmE;AACnE,MAAM,WAAW,wBAAwB;IACvC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,mEAAmE;AACnE,MAAM,WAAW,4BAA4B;IAC3C,sGAAsG;IACtG,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,8DAA8D;AAC9D,MAAM,WAAW,wBAAwB;IACvC,wDAAwD;IACxD,MAAM,CAAC,EAAE,wBAAwB,CAAC;IAClC,6DAA6D;IAC7D,UAAU,CAAC,EAAE,4BAA4B,CAAC;IAC1C,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,4DAA4D;AAC5D,MAAM,WAAW,uBAAuB;IACtC,yGAAyG;IACzG,KAAK,EAAE,MAAM,CAAC;IACd,0EAA0E;IAC1E,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,4BAA4B;IAC5B,MAAM,CAAC,EAAE,wBAAwB,CAAC;IAClC,uGAAuG;IACvG,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,oCAAoC;IACpC,MAAM,CAAC,EAAE,wBAAwB,CAAC;CACnC"}