@epam/ai-dial-attachment-input 1.2.1 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/AttachmentCard/Attachments/Actions.d.ts +2 -0
- package/components/AttachmentCard/Attachments/Actions.d.ts.map +1 -1
- package/components/AttachmentCard/Attachments/File.d.ts.map +1 -1
- package/components/AttachmentCard/Attachments/Image.d.ts.map +1 -1
- package/constants/attachment-group.d.ts +2 -0
- package/constants/attachment-group.d.ts.map +1 -1
- package/index.css +2 -2
- package/index.js +103 -92
- package/models/attachment-card.d.ts +4 -4
- package/models/attachment-card.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -14,6 +14,8 @@ interface ActionProps {
|
|
|
14
14
|
onClick: (id: string) => void;
|
|
15
15
|
/** ID of the attachment the action applies to. */
|
|
16
16
|
id?: string;
|
|
17
|
+
/** Whether the button stays visible without hover or keyboard focus on the tile. */
|
|
18
|
+
isAlwaysVisible?: boolean;
|
|
17
19
|
}
|
|
18
20
|
/** Retry button for failed uploads. */
|
|
19
21
|
export declare const ReloadAction: FC<Omit<ActionProps, 'icon'>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Actions.d.ts","sourceRoot":"","sources":["../../../../src/components/AttachmentCard/Attachments/Actions.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,EAAmB,MAAM,OAAO,CAAC;AAI5D,UAAU,WAAW;IACnB,wCAAwC;IACxC,IAAI,EAAE,SAAS,CAAC;IAChB,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kDAAkD;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,wDAAwD;IACxD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8CAA8C;IAC9C,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9B,kDAAkD;IAClD,EAAE,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"Actions.d.ts","sourceRoot":"","sources":["../../../../src/components/AttachmentCard/Attachments/Actions.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,EAAmB,MAAM,OAAO,CAAC;AAI5D,UAAU,WAAW;IACnB,wCAAwC;IACxC,IAAI,EAAE,SAAS,CAAC;IAChB,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kDAAkD;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,wDAAwD;IACxD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8CAA8C;IAC9C,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9B,kDAAkD;IAClD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,oFAAoF;IACpF,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAmCD,uCAAuC;AACvC,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,CActD,CAAC;AAEF,6CAA6C;AAC7C,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,CAaxD,CAAC;AAEF,mDAAmD;AACnD,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,CAaxD,CAAC;AAEF,wHAAwH;AACxH,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,CAiBtD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"File.d.ts","sourceRoot":"","sources":["../../../../src/components/AttachmentCard/Attachments/File.tsx"],"names":[],"mappings":"AAaA,OAAO,EACL,KAAK,EAAE,EAMR,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"File.d.ts","sourceRoot":"","sources":["../../../../src/components/AttachmentCard/Attachments/File.tsx"],"names":[],"mappings":"AAaA,OAAO,EACL,KAAK,EAAE,EAMR,MAAM,OAAO,CAAC;AAMf,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAsB/E,2HAA2H;AAC3H,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAyRlD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../../../../src/components/AttachmentCard/Attachments/Image.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAElB,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../../../../src/components/AttachmentCard/Attachments/Image.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAElB,MAAM,2BAA2B,CAAC;AASnC,OAAO,EACL,aAAa,EACb,KAAK,EAAE,EAIR,MAAM,OAAO,CAAC;AAUf,OAAO,KAAK,EACV,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,iCAAiC,CAAC;AAKzC,UAAU,oBAAoB;IAC5B,UAAU,EAAE,iBAAiB,CAAC;IAC9B,QAAQ,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,OAAO,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,QAAQ,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,uHAAuH;IACvH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,0EAA0E;AAC1E,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CAwKpD,CAAC"}
|
|
@@ -2,4 +2,6 @@
|
|
|
2
2
|
export declare const ATTACHMENT_COLLAPSE_THRESHOLD = 5;
|
|
3
3
|
/** Base Tailwind classes shared by every square attachment tile (100 × 100 px). */
|
|
4
4
|
export declare const ATTACHMENT_TILE_BASE_CLASS = "flex size-[100px] items-center justify-center rounded-xl border";
|
|
5
|
+
/** Tailwind classes drawing the 1px tile focus ring, 1px clear of the border, on keyboard focus of the tile itself. */
|
|
6
|
+
export declare const ATTACHMENT_TILE_FOCUS_RING_CLASS = "outline-1 outline-offset-1 focus-visible:outline";
|
|
5
7
|
//# 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,sHAAsH;AACtH,eAAO,MAAM,6BAA6B,IAAI,CAAC;AAC/C,mFAAmF;AACnF,eAAO,MAAM,0BAA0B,oEAC4B,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,mFAAmF;AACnF,eAAO,MAAM,0BAA0B,oEAC4B,CAAC;AACpE,uHAAuH;AACvH,eAAO,MAAM,gCAAgC,qDACO,CAAC"}
|
package/index.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
.
|
|
2
|
-
/*$vite$:1*/.sr-only{height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;clip:rect(0,0,0,0);border-width:0;white-space:nowrap}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.visible{visibility:visible}.invisible{visibility:hidden}.collapse{visibility:collapse}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.end-1{inset-inline-end:.25rem}.
|
|
1
|
+
._tile_1sjdm_12{box-sizing:border-box;background:var(--ai-tile-bg,var(--bg-layer-raised,#fcfcfc));border-style:solid;border-color:var(--ai-tile-border,var(--stroke-secondary,#d1dbea))}._tile_1sjdm_12._hovered_1sjdm_18:hover{background:var(--ai-tile-bg-hover,var(--bg-control-neutral-hover-muted,#e0e6f0));border-color:var(--ai-tile-border-hover,var(--ai-tile-border,var(--stroke-secondary,#d1dbea)))}._tile_1sjdm_12{outline-color:var(--ai-tile-focus-outline,var(--stroke-focus,#161b2d))}._selected_1sjdm_28{background:var(--ai-tile-bg-selected,var(--bg-control-accent-alpha,#2764d90f));border-color:var(--ai-tile-border-selected,var(--stroke-accent-alpha,#2764d933))}._tileError_1sjdm_33{background:var(--ai-tile-bg-error,var(--bg-error,#f3d6d8));border-color:var(--ai-tile-border-error,var(--stroke-error,#ae2f2f))}._nameText_1sjdm_38{color:var(--ai-tile-name-text,var(--text-primary,#161b2d))}._typeText_1sjdm_42{color:var(--ai-tile-type-text,var(--text-primary,#161b2d))}._placeholderIcon_1sjdm_46{color:var(--ai-tile-placeholder-icon,var(--text-secondary,#57647a))}._retryIcon_1sjdm_50{color:var(--ai-tile-error-text,var(--text-error,#ae2f2f))}._track_1sjdm_54{background:var(--ai-tile-progress-track,var(--bg-backdrop,#161b2d4d))}._tile_1sjdm_12 ._actionButton_1sjdm_65{background:var(--ai-tile-hover-icon-bg,var(--ai-tile-bg,var(--bg-layer-raised,#fcfcfc)))}._tile_1sjdm_12._hovered_1sjdm_18:hover ._actionButton_1sjdm_65{background:var(--ai-tile-hover-icon-bg,var(--ai-tile-bg-hover,var(--bg-control-neutral-hover-muted,#e0e6f0)))}._tile_1sjdm_12._selected_1sjdm_28 ._actionButton_1sjdm_65{background:var(--ai-tile-hover-icon-bg,linear-gradient(var(--ai-tile-bg-selected,var(--bg-control-accent-alpha,#2764d90f)), var(--ai-tile-bg-selected,var(--bg-control-accent-alpha,#2764d90f))), var(--ai-tile-bg,var(--bg-layer-raised,#fcfcfc)))}._tile_1sjdm_12._tileError_1sjdm_33 ._actionButton_1sjdm_65{background:var(--ai-tile-bg-error,var(--bg-error,#f3d6d8));color:var(--ai-tile-error-text,var(--text-error,#ae2f2f))}._tile_1sjdm_12._loading_1sjdm_86 ._actionButton_1sjdm_65,._tile_1sjdm_12 ._imageActionButton_1sjdm_87,._tile_1sjdm_12._selected_1sjdm_28 ._imageActionButton_1sjdm_87{background:var(--ai-tile-hover-icon-bg,var(--bg-layer-base,#f5f7fa));color:var(--ai-tile-hover-icon-color,var(--text-secondary,#57647a))}._tile_1sjdm_12._proxyFocus_1sjdm_96:has(:focus-visible){outline-style:solid}._tile_1sjdm_12._proxyFocus_1sjdm_96 ._actionButton_1sjdm_65:focus-visible{outline:none}._loading_1sjdm_86{cursor:progress}._headerIcon_1dmgi_1,._headerLabel_1dmgi_2{color:var(--ai-group-text,var(--text-secondary,#57647a))}._overlay_mzpdp_1{background:var(--ai-fd-bg,var(--bg-backdrop,#161b2d4d))}._icon_mzpdp_5{color:var(--ai-fd-icon,var(--text-accent,#1d4ed8))}._deniedIcon_mzpdp_9{color:var(--ai-fd-denied-icon,var(--text-error,#ae2f2f))}
|
|
2
|
+
/*$vite$:1*/.sr-only{height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;clip:rect(0,0,0,0);border-width:0;white-space:nowrap}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.visible{visibility:visible}.invisible{visibility:hidden}.collapse{visibility:collapse}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.end-1{inset-inline-end:.25rem}.top-1{top:.25rem}.z-10{z-index:10}.z-\[9999\]{z-index:9999}.-m-0\.5{margin:-.125rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.box-border{box-sizing:border-box}.line-clamp-2{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.size-\[100px\]{height:100px;width:100px}.h-full{height:100%}.w-full{width:100%}.min-w-0{min-width:0}.max-w-\[424px\]{max-width:424px}.max-w-\[532px\]{max-width:532px}.flex-1{flex:1 1 0%}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.grid-cols-\[repeat\(5\2c 100px\)\]{grid-template-columns:repeat(5,100px)}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.break-words{overflow-wrap:break-word}.rounded-\[11px\]{border-radius:11px}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0\.5{padding:.125rem}.p-3{padding:.75rem}.text-center{text-align:center}.opacity-0{opacity:0}.opacity-100{opacity:1}.outline-1{outline-width:1px}.outline-offset-1{outline-offset:1px}.ring{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-sm{--tw-backdrop-blur:blur(4px);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-200{transition-duration:.2s}.focus-visible\:outline:focus-visible{outline-style:solid;outline-width:1px}.group\/attachment-tile:hover .group-hover\/attachment-tile\:opacity-100{opacity:1}.group\/attachment-tile:focus-visible .group-focus-visible\/attachment-tile\:opacity-100{opacity:1}.group\/attachment-tile:has(:focus-visible) .group-has-\[\:focus-visible\]\/attachment-tile\:opacity-100{opacity:1}@media (max-width:1279px){.mobile\:opacity-100{opacity:1}}
|
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AttachmentErrorReason as e, AttachmentType as t, MIME_TYPE_EXT_MAP as n, RequestStatus as r, buildCssVars as i, getBaseMimeType as a, mergeClasses as o, normalizeMimeType as s } from "@epam/ai-dial-chat-shared";
|
|
2
2
|
import { useCallback as c, useEffect as l, useId as u, useMemo as d, useRef as f, useState as p } from "react";
|
|
3
|
-
import { IconClipboard as m, IconDownload as h, IconExternalLink as g, IconFile as _, IconFileDescription as v, IconFileTypeBmp as y, IconFileTypeCss as b, IconFileTypeCsv as x, IconFileTypeDoc as S, IconFileTypeDocx as C, IconFileTypeHtml as w, IconFileTypeJpg as T, IconFileTypeJs as E, IconFileTypeJsx as D, IconFileTypePdf as O, IconFileTypePhp as k, IconFileTypePng as A, IconFileTypePpt as j, IconFileTypeRs as M, IconFileTypeSql as N, IconFileTypeSvg as P, IconFileTypeTs as F, IconFileTypeTsx as I, IconFileTypeTxt as L, IconFileTypeVue as R, IconFileTypeXls as z, IconFileTypeXml as ee, IconFileTypeZip as te, IconFileX as ne, IconMusic as re, IconPaperclip as
|
|
3
|
+
import { IconClipboard as m, IconDownload as h, IconExternalLink as g, IconFile as _, IconFileDescription as v, IconFileTypeBmp as y, IconFileTypeCss as b, IconFileTypeCsv as x, IconFileTypeDoc as S, IconFileTypeDocx as C, IconFileTypeHtml as w, IconFileTypeJpg as T, IconFileTypeJs as E, IconFileTypeJsx as D, IconFileTypePdf as O, IconFileTypePhp as k, IconFileTypePng as A, IconFileTypePpt as j, IconFileTypeRs as M, IconFileTypeSql as N, IconFileTypeSvg as P, IconFileTypeTs as F, IconFileTypeTsx as I, IconFileTypeTxt as L, IconFileTypeVue as R, IconFileTypeXls as z, IconFileTypeXml as ee, IconFileTypeZip as te, IconFileX as ne, IconMusic as re, IconPaperclip as B, IconPhoto as V, IconReload as ie, IconTerminal2 as ae, IconVideo as oe, IconX as se } from "@tabler/icons-react";
|
|
4
4
|
import { DIAL_ICON_SIZE as H, DIAL_KIT_ICON_STROKE as U, DialItemType as ce, ElementSize as W, FileIcon as le, GhostIconButton as ue, Highlight as de, Skeleton as fe, SkeletonVariant as pe, Spinner as me, StaticIconButton as he } from "@epam/ai-dial-ui-kit";
|
|
5
5
|
import { Fragment as ge, jsx as G, jsxs as K } from "react/jsx-runtime";
|
|
6
6
|
//#region src/utils/attachment.ts
|
|
@@ -46,7 +46,7 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, _e = (e) =
|
|
|
46
46
|
case "image/png": return A;
|
|
47
47
|
case "image/svg+xml": return P;
|
|
48
48
|
case "image/bmp": return y;
|
|
49
|
-
default: return
|
|
49
|
+
default: return V;
|
|
50
50
|
}
|
|
51
51
|
if (t.startsWith("video/")) return oe;
|
|
52
52
|
if (t.startsWith("audio/")) return re;
|
|
@@ -81,7 +81,7 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, _e = (e) =
|
|
|
81
81
|
}
|
|
82
82
|
}, Ce = (e) => {
|
|
83
83
|
let { type: n, contentType: r } = e;
|
|
84
|
-
return n === t.Prompt ? ae : n === t.Pasted ? m : n === t.Image ?
|
|
84
|
+
return n === t.Prompt ? ae : n === t.Pasted ? m : n === t.Image ? V : Se(r ?? "");
|
|
85
85
|
}, we = (e) => {
|
|
86
86
|
let t = s(e), r = n[t];
|
|
87
87
|
if (r) return r;
|
|
@@ -113,7 +113,7 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, _e = (e) =
|
|
|
113
113
|
BottomIcon: d ? null : Ce(e),
|
|
114
114
|
typeLabel: d ? null : De(e, n)
|
|
115
115
|
};
|
|
116
|
-
}, Oe = 5, ke = "flex size-[100px] items-center justify-center rounded-xl border", Y = {
|
|
116
|
+
}, Oe = 5, ke = "flex size-[100px] items-center justify-center rounded-xl border", Ae = "outline-1 outline-offset-1 focus-visible:outline", Y = {
|
|
117
117
|
tray: "dial-ai-attachment-tray",
|
|
118
118
|
trayItem: "dial-ai-attachment-tray-item",
|
|
119
119
|
tile: "dial-ai-attachment-tile",
|
|
@@ -122,49 +122,51 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, _e = (e) =
|
|
|
122
122
|
tileType: "dial-ai-attachment-tile-type",
|
|
123
123
|
tileAction: "dial-ai-attachment-tile-action"
|
|
124
124
|
}, X = {
|
|
125
|
-
tile: "
|
|
126
|
-
hovered: "
|
|
127
|
-
selected: "
|
|
128
|
-
tileError: "
|
|
129
|
-
nameText: "
|
|
130
|
-
typeText: "
|
|
131
|
-
placeholderIcon: "
|
|
132
|
-
retryIcon: "
|
|
133
|
-
track: "
|
|
134
|
-
actionButton: "
|
|
135
|
-
|
|
136
|
-
|
|
125
|
+
tile: "_tile_1sjdm_12",
|
|
126
|
+
hovered: "_hovered_1sjdm_18",
|
|
127
|
+
selected: "_selected_1sjdm_28",
|
|
128
|
+
tileError: "_tileError_1sjdm_33",
|
|
129
|
+
nameText: "_nameText_1sjdm_38",
|
|
130
|
+
typeText: "_typeText_1sjdm_42",
|
|
131
|
+
placeholderIcon: "_placeholderIcon_1sjdm_46",
|
|
132
|
+
retryIcon: "_retryIcon_1sjdm_50",
|
|
133
|
+
track: "_track_1sjdm_54",
|
|
134
|
+
actionButton: "_actionButton_1sjdm_65",
|
|
135
|
+
loading: "_loading_1sjdm_86",
|
|
136
|
+
imageActionButton: "_imageActionButton_1sjdm_87",
|
|
137
|
+
proxyFocus: "_proxyFocus_1sjdm_96"
|
|
138
|
+
}, Z = ({ ariaLabel: e, errorTitle: t, errorDescId: n, onClick: r, id: i, icon: a, className: s, isAlwaysVisible: c }) => /* @__PURE__ */ G(he, {
|
|
137
139
|
icon: a,
|
|
138
140
|
size: W.Small,
|
|
139
|
-
className: o("opacity-0
|
|
141
|
+
className: o(c ? "opacity-100" : "opacity-0 group-hover/attachment-tile:opacity-100 group-focus-visible/attachment-tile:opacity-100 group-has-[:focus-visible]/attachment-tile:opacity-100", X.actionButton, s, Y.tileAction),
|
|
140
142
|
"aria-label": e,
|
|
141
143
|
"aria-describedby": t ? n : void 0,
|
|
142
144
|
onClick: (e) => {
|
|
143
145
|
e.stopPropagation(), r(i);
|
|
144
146
|
}
|
|
145
|
-
}),
|
|
146
|
-
icon: /* @__PURE__ */ G(
|
|
147
|
+
}), je = ({ ...e }) => /* @__PURE__ */ G(Z, {
|
|
148
|
+
icon: /* @__PURE__ */ G(ie, {
|
|
147
149
|
size: H.SM,
|
|
148
150
|
"aria-hidden": !0,
|
|
149
151
|
stroke: U
|
|
150
152
|
}),
|
|
151
153
|
className: X.retryIcon,
|
|
152
154
|
...e
|
|
153
|
-
}),
|
|
155
|
+
}), Me = ({ ...e }) => /* @__PURE__ */ G(Z, {
|
|
154
156
|
icon: /* @__PURE__ */ G(h, {
|
|
155
157
|
size: H.SM,
|
|
156
158
|
"aria-hidden": !0,
|
|
157
159
|
stroke: U
|
|
158
160
|
}),
|
|
159
161
|
...e
|
|
160
|
-
}),
|
|
162
|
+
}), Ne = ({ ...e }) => /* @__PURE__ */ G(Z, {
|
|
161
163
|
icon: /* @__PURE__ */ G(g, {
|
|
162
164
|
size: H.SM,
|
|
163
165
|
"aria-hidden": !0,
|
|
164
166
|
stroke: U
|
|
165
167
|
}),
|
|
166
168
|
...e
|
|
167
|
-
}),
|
|
169
|
+
}), Pe = ({ className: e, ...t }) => /* @__PURE__ */ G(Z, {
|
|
168
170
|
icon: /* @__PURE__ */ G(se, {
|
|
169
171
|
size: H.SM,
|
|
170
172
|
"aria-hidden": !0,
|
|
@@ -172,35 +174,35 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, _e = (e) =
|
|
|
172
174
|
}),
|
|
173
175
|
className: o("mobile:opacity-100", e),
|
|
174
176
|
...t
|
|
175
|
-
}),
|
|
177
|
+
}), Fe = {
|
|
176
178
|
[e.Network]: "Upload failed · network error",
|
|
177
179
|
[e.UnsupportedType]: "Upload failed · unsupported file type",
|
|
178
180
|
[e.FileTooLarge]: "Upload failed · file too large"
|
|
179
|
-
},
|
|
180
|
-
let { clickLabel: y = "Download attachment", expandLabel: b = "Expand pasted text", downloadLabel: x = "Download attachment", retryLabel: S = "Retry upload", removeLabel: C = "Remove attachment", openInNewTabLabel: w = "Open in new tab", sizeLabel: T, uploadingLabel: E = "Uploading", errorReasonLabels: D, genericErrorLabel: O = "Upload failed" } = s ?? {}, { typography: k, className: A } = l ?? {}, { id: j, name: M, status: N, errorReason: P } = t, F = N === r.Loading, I = N === r.Error, L = u(), R = I ? P && (D?.[P] ??
|
|
181
|
-
|
|
181
|
+
}, Ie = ({ attachment: t, searchQuery: n = "", onClick: i, onRetry: a, labels: s, styles: l, onDownload: f, isLink: p, cssVars: m, onExpand: h, isExpandable: g, onRemove: _, isSelected: v }) => {
|
|
182
|
+
let { clickLabel: y = "Download attachment", expandLabel: b = "Expand pasted text", downloadLabel: x = "Download attachment", retryLabel: S = "Retry upload", removeLabel: C = "Remove attachment", openInNewTabLabel: w = "Open in new tab", sizeLabel: T, uploadingLabel: E = "Uploading", errorReasonLabels: D, genericErrorLabel: O = "Upload failed" } = s ?? {}, { typography: k, className: A } = l ?? {}, { id: j, name: M, status: N, errorReason: P } = t, F = N === r.Loading, I = N === r.Error, L = u(), R = I ? P && (D?.[P] ?? Fe[P]) || O : "", { BottomIcon: z, typeLabel: ee } = J(t), te = Ee(t), ne = !I && !F && f && !p, re = I && !!a && P !== e.UnsupportedType && P !== e.FileTooLarge, B = !!g && h !== void 0, V = B || i !== void 0, ie = Number(!!ne) + Number(!!re) + Number(!!p) + Number(!!_), ae = !V && ie === 1, oe = () => {
|
|
183
|
+
B ? h(j) : i?.(j);
|
|
182
184
|
}, se = (e) => {
|
|
183
185
|
e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), oe());
|
|
184
186
|
}, W = d(() => _e(M), [M]), ue = c(() => {
|
|
185
187
|
window.open(t.referenceUrl, "_blank", "noopener,noreferrer");
|
|
186
|
-
}, [t]), fe = o(ke, "group/attachment-tile relative flex-col justify-between items-start gap-
|
|
188
|
+
}, [t]), fe = o(ke, "group/attachment-tile relative flex-col justify-between items-start gap-2 overflow-hidden p-3", X.tile, V && !I && !F && X.hovered, F && X.loading, v && X.selected, I && X.tileError, ae && X.proxyFocus, Y.tile, v && Y.tileSelected), pe = /* @__PURE__ */ G("div", {
|
|
187
189
|
title: W,
|
|
188
|
-
className: o(k?.nameClassName ?? "dial-tiny-text", "line-clamp-2 w-full min-w-0 break-words", X.nameText,
|
|
190
|
+
className: o(k?.nameClassName ?? "dial-tiny-text", "line-clamp-2 w-full min-w-0 break-words", X.nameText, Y.tileName),
|
|
189
191
|
children: n ? /* @__PURE__ */ G(de, {
|
|
190
192
|
text: W,
|
|
191
193
|
query: n,
|
|
192
194
|
maxLines: 2
|
|
193
195
|
}) : W
|
|
194
196
|
}), he = z && /* @__PURE__ */ K("div", {
|
|
195
|
-
className: o("flex w-full items-
|
|
197
|
+
className: o("flex w-full items-end gap-1", Y.tileType),
|
|
196
198
|
children: [te ? /* @__PURE__ */ G(le, {
|
|
197
199
|
type: ce.File,
|
|
198
200
|
name: M ?? "",
|
|
199
201
|
fileExtension: Te(t),
|
|
200
|
-
size: H.
|
|
202
|
+
size: H.MD,
|
|
201
203
|
decorative: !0
|
|
202
204
|
}) : /* @__PURE__ */ G(z, {
|
|
203
|
-
size: H.
|
|
205
|
+
size: H.MD,
|
|
204
206
|
className: X.typeText,
|
|
205
207
|
stroke: U,
|
|
206
208
|
"aria-hidden": !0
|
|
@@ -208,10 +210,10 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, _e = (e) =
|
|
|
208
210
|
className: o(k?.metaClassName ?? "dial-tiny-text", "min-w-0 flex-1 truncate", X.typeText),
|
|
209
211
|
children: T ? `${ee} · ${T}` : ee
|
|
210
212
|
})]
|
|
211
|
-
}), q =
|
|
213
|
+
}), q = V ? {
|
|
212
214
|
role: "button",
|
|
213
215
|
tabIndex: 0,
|
|
214
|
-
"aria-label":
|
|
216
|
+
"aria-label": B ? b : y,
|
|
215
217
|
onClick: oe,
|
|
216
218
|
onKeyDown: se
|
|
217
219
|
} : {}, ve = /* @__PURE__ */ K(ge, { children: [
|
|
@@ -220,38 +222,39 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, _e = (e) =
|
|
|
220
222
|
F && /* @__PURE__ */ G("div", {
|
|
221
223
|
role: "progressbar",
|
|
222
224
|
"aria-label": E,
|
|
223
|
-
className: o("absolute
|
|
225
|
+
className: o("absolute inset-0 flex items-center justify-center rounded-[11px]", X.track),
|
|
224
226
|
children: /* @__PURE__ */ G(me, { size: 32 })
|
|
225
227
|
}),
|
|
226
228
|
/* @__PURE__ */ K("div", {
|
|
227
|
-
className: "absolute end-1 top-1 flex
|
|
229
|
+
className: "absolute end-1 top-1 flex",
|
|
228
230
|
children: [
|
|
229
|
-
ne && /* @__PURE__ */ G(
|
|
231
|
+
ne && /* @__PURE__ */ G(Me, {
|
|
230
232
|
ariaLabel: x,
|
|
231
233
|
errorTitle: R,
|
|
232
234
|
errorDescId: L,
|
|
233
235
|
onClick: f,
|
|
234
236
|
id: j
|
|
235
237
|
}),
|
|
236
|
-
re && /* @__PURE__ */ G(
|
|
238
|
+
re && /* @__PURE__ */ G(je, {
|
|
237
239
|
ariaLabel: S,
|
|
238
240
|
errorTitle: R,
|
|
239
241
|
errorDescId: L,
|
|
240
242
|
onClick: a,
|
|
241
243
|
id: j
|
|
242
244
|
}),
|
|
243
|
-
p && /* @__PURE__ */ G(
|
|
245
|
+
p && /* @__PURE__ */ G(Ne, {
|
|
244
246
|
ariaLabel: w,
|
|
245
247
|
errorTitle: R,
|
|
246
248
|
errorDescId: L,
|
|
247
249
|
onClick: ue
|
|
248
250
|
}),
|
|
249
|
-
_ && /* @__PURE__ */ G(
|
|
251
|
+
_ && /* @__PURE__ */ G(Pe, {
|
|
250
252
|
ariaLabel: C,
|
|
251
253
|
errorTitle: R,
|
|
252
254
|
errorDescId: L,
|
|
253
255
|
onClick: _,
|
|
254
|
-
id: j
|
|
256
|
+
id: j,
|
|
257
|
+
isAlwaysVisible: F
|
|
255
258
|
})
|
|
256
259
|
]
|
|
257
260
|
}),
|
|
@@ -270,13 +273,13 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, _e = (e) =
|
|
|
270
273
|
...q,
|
|
271
274
|
"aria-busy": F,
|
|
272
275
|
style: m,
|
|
273
|
-
className: o(fe,
|
|
276
|
+
className: o(fe, V && "cursor-pointer", Ae),
|
|
274
277
|
children: ve
|
|
275
278
|
})
|
|
276
279
|
});
|
|
277
280
|
}, Q = /* @__PURE__ */ function(e) {
|
|
278
281
|
return e.Idle = "idle", e.Loading = "loading", e.Loaded = "loaded", e.Error = "error", e;
|
|
279
|
-
}({}),
|
|
282
|
+
}({}), Le = ({ enabled: e, src: t }) => {
|
|
280
283
|
let n = f(null), [r, i] = p("idle");
|
|
281
284
|
return l(() => {
|
|
282
285
|
i(e && t ? "loading" : "idle");
|
|
@@ -291,48 +294,50 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, _e = (e) =
|
|
|
291
294
|
imageRef: n,
|
|
292
295
|
imageLoadStatus: r
|
|
293
296
|
};
|
|
294
|
-
},
|
|
295
|
-
let { clickLabel: f = "Open attachment", expandLabel: p = "Expand pasted text", removeLabel: m = "Remove attachment", downloadLabel: h = "Download attachment" } = i ?? {}, { className:
|
|
296
|
-
enabled:
|
|
297
|
-
src:
|
|
298
|
-
}),
|
|
299
|
-
|
|
300
|
-
},
|
|
297
|
+
}, Re = ({ attachment: e, onExpand: n, onClick: r, labels: i, onRemove: a, cssVars: s, onDownload: c, styles: l, isSelected: u }) => {
|
|
298
|
+
let { clickLabel: f = "Open attachment", expandLabel: p = "Expand pasted text", removeLabel: m = "Remove attachment", downloadLabel: h = "Download attachment", uploadingLabel: g = "Uploading" } = i ?? {}, { className: _ } = l ?? {}, { id: v, name: y } = e, b = e.previewUrl ?? e.url, x = e.type === t.Pasted && n !== void 0, { isLoading: S, isError: C, isImage: w } = d(() => J(e), [e]), T = r !== void 0 && !x && !S && !C, E = x || T, D = !!c && !S, O = !E && Number(!!a) + Number(D) === 1, { imageRef: k, imageLoadStatus: A } = Le({
|
|
299
|
+
enabled: w,
|
|
300
|
+
src: b
|
|
301
|
+
}), j = () => {
|
|
302
|
+
x && n ? n(v) : T && r && r(v);
|
|
303
|
+
}, M = E ? {
|
|
301
304
|
role: "button",
|
|
302
305
|
tabIndex: 0,
|
|
303
|
-
"aria-label":
|
|
304
|
-
onClick:
|
|
306
|
+
"aria-label": x ? p : f,
|
|
307
|
+
onClick: j,
|
|
305
308
|
onKeyDown: (e) => {
|
|
306
|
-
e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(),
|
|
309
|
+
e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), j());
|
|
307
310
|
}
|
|
308
311
|
} : {};
|
|
309
312
|
return /* @__PURE__ */ G("div", {
|
|
310
|
-
className: o(ke, "group/attachment-tile",
|
|
311
|
-
...
|
|
313
|
+
className: o(ke, "group/attachment-tile", E && "cursor-pointer", X.tile, u && X.selected, S && X.loading, O && X.proxyFocus, Ae, _, Y.tile, u && Y.tileSelected),
|
|
314
|
+
...M,
|
|
315
|
+
"aria-busy": S,
|
|
312
316
|
style: s,
|
|
313
317
|
children: /* @__PURE__ */ K("div", {
|
|
314
318
|
className: "relative h-full w-full overflow-hidden",
|
|
315
319
|
children: [
|
|
316
320
|
/* @__PURE__ */ K("div", {
|
|
317
|
-
className: "absolute end-1 top-1 z-10 flex
|
|
318
|
-
children: [a && /* @__PURE__ */ G(
|
|
321
|
+
className: "absolute end-1 top-1 z-10 flex",
|
|
322
|
+
children: [a && /* @__PURE__ */ G(Pe, {
|
|
319
323
|
ariaLabel: m,
|
|
320
324
|
onClick: a,
|
|
321
|
-
id:
|
|
322
|
-
className: X.imageActionButton
|
|
323
|
-
|
|
325
|
+
id: v,
|
|
326
|
+
className: X.imageActionButton,
|
|
327
|
+
isAlwaysVisible: S
|
|
328
|
+
}), D && /* @__PURE__ */ G(Me, {
|
|
324
329
|
ariaLabel: h,
|
|
325
330
|
onClick: c,
|
|
326
|
-
id:
|
|
331
|
+
id: v,
|
|
327
332
|
className: X.imageActionButton
|
|
328
333
|
})]
|
|
329
334
|
}),
|
|
330
|
-
|
|
335
|
+
A !== Q.Loaded && /* @__PURE__ */ G(fe, {
|
|
331
336
|
variant: pe.Rectangular,
|
|
332
337
|
width: "100%",
|
|
333
338
|
height: "100%",
|
|
334
|
-
active:
|
|
335
|
-
overlay: /* @__PURE__ */ G(
|
|
339
|
+
active: A === Q.Loading,
|
|
340
|
+
overlay: /* @__PURE__ */ G(V, {
|
|
336
341
|
size: H.LG,
|
|
337
342
|
className: X.placeholderIcon,
|
|
338
343
|
"aria-hidden": !0,
|
|
@@ -341,17 +346,23 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, _e = (e) =
|
|
|
341
346
|
className: "absolute inset-0 rounded-xl"
|
|
342
347
|
}),
|
|
343
348
|
/* @__PURE__ */ G("img", {
|
|
344
|
-
ref:
|
|
345
|
-
src:
|
|
346
|
-
alt:
|
|
349
|
+
ref: k,
|
|
350
|
+
src: b,
|
|
351
|
+
alt: y,
|
|
347
352
|
loading: "lazy",
|
|
348
353
|
decoding: "async",
|
|
349
|
-
className: o("h-full w-full rounded-xl object-cover transition-opacity duration-200",
|
|
354
|
+
className: o("h-full w-full rounded-xl object-cover transition-opacity duration-200", A === Q.Loaded ? "opacity-100" : "opacity-0")
|
|
355
|
+
}),
|
|
356
|
+
S && /* @__PURE__ */ G("div", {
|
|
357
|
+
role: "progressbar",
|
|
358
|
+
"aria-label": g,
|
|
359
|
+
className: o("absolute inset-0 flex items-center justify-center rounded-xl", X.track),
|
|
360
|
+
children: /* @__PURE__ */ G(me, { size: 32 })
|
|
350
361
|
})
|
|
351
362
|
]
|
|
352
363
|
})
|
|
353
364
|
});
|
|
354
|
-
},
|
|
365
|
+
}, ze = ({ attachment: e, searchQuery: n = "", onRemove: r, onRetry: a, onExpand: o, onClick: s, onDownload: c, labels: l, styles: u, isSelected: f }) => {
|
|
355
366
|
let { colors: p } = u ?? {}, m = e.type === t.Pasted && o !== void 0, h = i({
|
|
356
367
|
"--ai-tile-bg": p?.background,
|
|
357
368
|
"--ai-tile-border": p?.border,
|
|
@@ -370,7 +381,7 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, _e = (e) =
|
|
|
370
381
|
"--ai-tile-hover-icon-color": p?.hoverIconColor,
|
|
371
382
|
"--ai-tile-progress-track": p?.trackBackground
|
|
372
383
|
}), { isImage: g, isLink: _ } = d(() => J(e), [e]);
|
|
373
|
-
return g ? /* @__PURE__ */ G(
|
|
384
|
+
return g ? /* @__PURE__ */ G(Re, {
|
|
374
385
|
attachment: e,
|
|
375
386
|
labels: l,
|
|
376
387
|
onClick: s,
|
|
@@ -380,7 +391,7 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, _e = (e) =
|
|
|
380
391
|
cssVars: h,
|
|
381
392
|
onDownload: c,
|
|
382
393
|
isSelected: f
|
|
383
|
-
}) : /* @__PURE__ */ G(
|
|
394
|
+
}) : /* @__PURE__ */ G(Ie, {
|
|
384
395
|
attachment: e,
|
|
385
396
|
searchQuery: n,
|
|
386
397
|
onClick: s,
|
|
@@ -395,16 +406,16 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, _e = (e) =
|
|
|
395
406
|
isExpandable: m,
|
|
396
407
|
isSelected: f
|
|
397
408
|
});
|
|
398
|
-
},
|
|
409
|
+
}, Be = ({ attachments: e, onRemove: t, onRetry: n, onExpand: r, onAttachmentClick: i, labels: a, styles: s }) => {
|
|
399
410
|
let { ariaLabel: c = "Attached files", removeLabel: l, retryLabel: u, clickLabel: d, expandLabel: f, uploadingLabel: p } = a ?? {}, { className: m, card: h } = s ?? {};
|
|
400
411
|
return e.length === 0 ? null : /* @__PURE__ */ G("div", {
|
|
401
412
|
role: "list",
|
|
402
413
|
"aria-label": c,
|
|
403
|
-
className: o("
|
|
414
|
+
className: o("-m-0.5 box-border flex min-w-0 gap-2 overflow-x-auto p-0.5", m, Y.tray),
|
|
404
415
|
children: e.map((e) => /* @__PURE__ */ G("div", {
|
|
405
416
|
role: "listitem",
|
|
406
417
|
className: Y.trayItem,
|
|
407
|
-
children: /* @__PURE__ */ G(
|
|
418
|
+
children: /* @__PURE__ */ G(ze, {
|
|
408
419
|
attachment: e,
|
|
409
420
|
onRemove: t,
|
|
410
421
|
onRetry: n,
|
|
@@ -421,13 +432,13 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, _e = (e) =
|
|
|
421
432
|
})
|
|
422
433
|
}, e.id))
|
|
423
434
|
});
|
|
424
|
-
},
|
|
435
|
+
}, Ve = {
|
|
425
436
|
headerIcon: "_headerIcon_1dmgi_1",
|
|
426
437
|
headerLabel: "_headerLabel_1dmgi_2"
|
|
427
|
-
},
|
|
428
|
-
let { ariaLabel: d = "Attachments", clickLabel: f = "Download attachment", downloadLabel: p = "Download attachment", retryLabel: m = "Retry upload", downloadAllLabel: g = "Download all", openInNewTabLabel: v, getHeaderLabel: y = (e) =>
|
|
438
|
+
}, He = (e, t) => `${e} ${t}${e === 1 ? "" : "s"}`, Ue = ({ attachments: e, onAttachmentClick: n, onDownloadAll: a, onRetry: s, labels: c, styles: l, selectedAttachmentId: u }) => {
|
|
439
|
+
let { ariaLabel: d = "Attachments", clickLabel: f = "Download attachment", downloadLabel: p = "Download attachment", retryLabel: m = "Retry upload", downloadAllLabel: g = "Download all", openInNewTabLabel: v, getHeaderLabel: y = (e) => He(e, "attachment"), promptLabel: b, pastedLabel: x, imageLabel: S } = c ?? {}, { typography: C, colors: w, className: T } = l ?? {}, E = i({ "--ai-group-text": w?.text });
|
|
429
440
|
if (e.length === 0) return null;
|
|
430
|
-
let D = e.some((e) => e.type === t.Image), O = e.some((e) => e.type !== t.Image), k = D && O, A = e.length >= 5, j = k ?
|
|
441
|
+
let D = e.some((e) => e.type === t.Image), O = e.some((e) => e.type !== t.Image), k = D && O, A = e.length >= 5, j = k ? B : D ? V : _, M = y(e.length), N = () => {
|
|
431
442
|
let t = e.filter((e) => e.status === r.Idle);
|
|
432
443
|
a ? a(t) : t.forEach((e) => n?.(e.id));
|
|
433
444
|
}, P = (t) => {
|
|
@@ -438,17 +449,17 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, _e = (e) =
|
|
|
438
449
|
role: "group",
|
|
439
450
|
"aria-label": d,
|
|
440
451
|
style: E,
|
|
441
|
-
className: o("flex flex-col gap-2", A ? "w-full min-w-0 max-w-[532px]" : "max-w-[424px]",
|
|
452
|
+
className: o("flex flex-col gap-2", A ? "w-full min-w-0 max-w-[532px]" : "max-w-[424px]", Ve.container, T),
|
|
442
453
|
children: [/* @__PURE__ */ K("div", {
|
|
443
454
|
className: "flex items-center justify-between",
|
|
444
455
|
children: [/* @__PURE__ */ K("div", {
|
|
445
456
|
className: "flex items-center gap-1",
|
|
446
457
|
children: [/* @__PURE__ */ G(j, {
|
|
447
458
|
size: H.SM,
|
|
448
|
-
className: o("shrink-0",
|
|
459
|
+
className: o("shrink-0", Ve.headerIcon),
|
|
449
460
|
"aria-hidden": !0
|
|
450
461
|
}), /* @__PURE__ */ G("span", {
|
|
451
|
-
className: o(C?.headerLabelClassName ?? "dial-tiny-semi-text",
|
|
462
|
+
className: o(C?.headerLabelClassName ?? "dial-tiny-semi-text", Ve.headerLabel),
|
|
452
463
|
children: M
|
|
453
464
|
})]
|
|
454
465
|
}), e.length >= 2 && (a || n) && /* @__PURE__ */ G(ue, {
|
|
@@ -467,7 +478,7 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, _e = (e) =
|
|
|
467
478
|
className: o("gap-2", A ? "grid grid-cols-[repeat(5,100px)]" : "flex flex-wrap"),
|
|
468
479
|
children: e.map((e, t) => /* @__PURE__ */ G("div", {
|
|
469
480
|
role: "listitem",
|
|
470
|
-
children: /* @__PURE__ */ G(
|
|
481
|
+
children: /* @__PURE__ */ G(ze, {
|
|
471
482
|
attachment: e,
|
|
472
483
|
onClick: n,
|
|
473
484
|
onDownload: a ? P : void 0,
|
|
@@ -486,24 +497,24 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, _e = (e) =
|
|
|
486
497
|
}, `${e.id}-${t}`))
|
|
487
498
|
})]
|
|
488
499
|
});
|
|
489
|
-
},
|
|
500
|
+
}, We = {
|
|
490
501
|
overlay: "_overlay_mzpdp_1",
|
|
491
502
|
icon: "_icon_mzpdp_5",
|
|
492
503
|
deniedIcon: "_deniedIcon_mzpdp_9"
|
|
493
|
-
},
|
|
504
|
+
}, Ge = ({ isVisible: e, isAttachmentsAllowed: t = !0, labels: n, styles: r }) => {
|
|
494
505
|
let { title: a, subtitle: s } = n ?? {}, { colors: c, typography: l } = r ?? {};
|
|
495
506
|
if (!e) return null;
|
|
496
507
|
let u = i({
|
|
497
508
|
"--ai-fd-bg": c?.background,
|
|
498
509
|
"--ai-fd-icon": c?.icon,
|
|
499
510
|
"--ai-fd-denied-icon": c?.deniedIcon
|
|
500
|
-
}), d = a ?? (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 ?
|
|
511
|
+
}), d = a ?? (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 ? We.icon : We.deniedIcon, m = (e) => {
|
|
501
512
|
e.preventDefault();
|
|
502
513
|
}, h = t ? v : ne;
|
|
503
514
|
return /* @__PURE__ */ G("div", {
|
|
504
515
|
role: "status",
|
|
505
516
|
"aria-live": "polite",
|
|
506
|
-
className: o("fixed inset-0 z-[9999] flex items-center justify-center backdrop-blur-sm",
|
|
517
|
+
className: o("fixed inset-0 z-[9999] flex items-center justify-center backdrop-blur-sm", We.overlay, t ? "pointer-events-none" : "pointer-events-auto cursor-not-allowed"),
|
|
507
518
|
onDragOver: t ? void 0 : m,
|
|
508
519
|
onDrop: t ? void 0 : m,
|
|
509
520
|
style: u,
|
|
@@ -527,10 +538,10 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, _e = (e) =
|
|
|
527
538
|
]
|
|
528
539
|
})
|
|
529
540
|
});
|
|
530
|
-
}, $ = (e) => String(e).padStart(2, "0"),
|
|
541
|
+
}, $ = (e) => String(e).padStart(2, "0"), Ke = (e) => `${e.getFullYear()}-${$(e.getMonth() + 1)}-${$(e.getDate())} ${$(e.getHours())}-${$(e.getMinutes())}-${$(e.getSeconds())}`, qe = (e, t, n) => {
|
|
531
542
|
let r = e.lastIndexOf("."), i = r > 0, a = i ? e.slice(0, r) : e, o = i ? e.slice(r) : "", s = n === 0 ? "" : ` (${n + 1})`;
|
|
532
|
-
return `${a} ${
|
|
533
|
-
},
|
|
543
|
+
return `${a} ${Ke(t)}${s}${o}`;
|
|
544
|
+
}, Je = (e, n, i = {}) => {
|
|
534
545
|
let { screenshotName: a = "Screenshot.png", pastedTextName: o = "Pasted text" } = i;
|
|
535
546
|
return { handlePaste: c((i) => {
|
|
536
547
|
if (!i.clipboardData) return;
|
|
@@ -540,7 +551,7 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, _e = (e) =
|
|
|
540
551
|
for (let e of s) {
|
|
541
552
|
let i = e.getAsFile();
|
|
542
553
|
if (!i) continue;
|
|
543
|
-
let s =
|
|
554
|
+
let s = qe(a, o, n.length), c = new File([i], s, { type: i.type }), l = {
|
|
544
555
|
id: q(),
|
|
545
556
|
name: s,
|
|
546
557
|
contentType: i.type,
|
|
@@ -556,7 +567,7 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, _e = (e) =
|
|
|
556
567
|
}
|
|
557
568
|
let l = i.clipboardData.getData("text/plain");
|
|
558
569
|
if (l.length > n) {
|
|
559
|
-
let n = `${o} ${
|
|
570
|
+
let n = `${o} ${Ke(/* @__PURE__ */ new Date())}.txt`, a = new File([l], n, { type: "text/plain" }), s = {
|
|
560
571
|
id: q(),
|
|
561
572
|
name: n,
|
|
562
573
|
contentType: "text/plain",
|
|
@@ -572,6 +583,6 @@ var q = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, _e = (e) =
|
|
|
572
583
|
a,
|
|
573
584
|
o
|
|
574
585
|
]) };
|
|
575
|
-
},
|
|
586
|
+
}, Ye = 100;
|
|
576
587
|
//#endregion
|
|
577
|
-
export { Oe as ATTACHMENT_COLLAPSE_THRESHOLD, Y as ATTACHMENT_INPUT_CLASS,
|
|
588
|
+
export { Oe as ATTACHMENT_COLLAPSE_THRESHOLD, Y as ATTACHMENT_INPUT_CLASS, ze as AttachmentCard, Ue as AttachmentGroup, Be as AttachmentTray, Ge as FileDndOverlay, Q as LazyImageLoadStatus, Ye as MAX_UPLOADS_PER_MINUTE, q as generateAttachmentId, J as getAttachmentCardState, Se as getAttachmentIcon, we as getExtFromContentType, _e as getNameWithoutExtension, xe as isMimeTypeAllowed, be as mimeTypesToExtensionLabels, Je as useClipboardPaste, Le as useLazyImageLoad };
|
|
@@ -38,13 +38,13 @@ export interface AttachmentCardColors {
|
|
|
38
38
|
backgroundSelected?: string;
|
|
39
39
|
/** Tile border color in the selected state. */
|
|
40
40
|
borderSelected?: string;
|
|
41
|
-
/** Tile focus
|
|
41
|
+
/** Tile focus ring color. Defaults to `--stroke-focus`. */
|
|
42
42
|
focusOutline?: string;
|
|
43
43
|
/** Tile background color in the error state. */
|
|
44
44
|
backgroundError?: string;
|
|
45
45
|
/** Tile border color in the error state. */
|
|
46
46
|
borderError?: string;
|
|
47
|
-
/**
|
|
47
|
+
/** Corner action icon color in the error state. Defaults to `--text-error`. */
|
|
48
48
|
errorText?: string;
|
|
49
49
|
/** File name text color. */
|
|
50
50
|
nameText?: string;
|
|
@@ -52,9 +52,9 @@ export interface AttachmentCardColors {
|
|
|
52
52
|
typeText?: string;
|
|
53
53
|
/** Image placeholder icon color while the preview loads. Defaults to `--text-secondary`. */
|
|
54
54
|
placeholderIcon?: string;
|
|
55
|
-
/**
|
|
55
|
+
/** Corner action button background, overriding the default of matching the tile's current background (not applied in the error state). */
|
|
56
56
|
hoverIconBackground?: string;
|
|
57
|
-
/**
|
|
57
|
+
/** Corner action icon color on image tiles and during upload. Defaults to `--text-secondary`. */
|
|
58
58
|
hoverIconColor?: string;
|
|
59
59
|
/** Upload progress track background color. */
|
|
60
60
|
trackBackground?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachment-card.d.ts","sourceRoot":"","sources":["../../src/models/attachment-card.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAEhD,wGAAwG;AACxG,MAAM,WAAW,oBAAoB;IACnC,wEAAwE;IACxE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wEAAwE;IACxE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kEAAkE;IAClE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,kFAAkF;AAClF,MAAM,WAAW,mBAAmB;IAClC,qDAAqD;IACrD,SAAS,EAAE,OAAO,CAAC;IACnB,8CAA8C;IAC9C,OAAO,EAAE,OAAO,CAAC;IACjB,wEAAwE;IACxE,OAAO,EAAE,OAAO,CAAC;IACjB,2DAA2D;IAC3D,MAAM,EAAE,OAAO,CAAC;IAChB,yDAAyD;IACzD,UAAU,EAAE,IAAI,GAAG,IAAI,CAAC;IACxB,sEAAsE;IACtE,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,wEAAwE;AACxE,MAAM,WAAW,oBAAoB;IACnC,kDAAkD;IAClD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8CAA8C;IAC9C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sCAAsC;IACtC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kCAAkC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mDAAmD;IACnD,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,+CAA+C;IAC/C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,
|
|
1
|
+
{"version":3,"file":"attachment-card.d.ts","sourceRoot":"","sources":["../../src/models/attachment-card.ts"],"names":[],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epam/ai-dial-attachment-input",
|
|
3
3
|
"description": "File attachment input components with upload validation, drag-and-drop, and progress tracking",
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.3",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"@tabler/icons-react": "^3.44.0"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
|
-
"@epam/ai-dial-chat-shared": "1.2.
|
|
23
|
+
"@epam/ai-dial-chat-shared": "1.2.3",
|
|
24
24
|
"react": "^19.2.8",
|
|
25
25
|
"@epam/ai-dial-ui-kit": "^0.15.4"
|
|
26
26
|
},
|