@epam/ai-dial-attachment-input 1.2.0-dev.99 → 1.2.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"AttachmentCard.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentCard/AttachmentCard.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,EAAW,MAAM,OAAO,CAAC;AACzC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAKxE,8GAA8G;AAC9G,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAyElD,CAAC"}
1
+ {"version":3,"file":"AttachmentCard.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentCard/AttachmentCard.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,EAAW,MAAM,OAAO,CAAC;AACzC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAKxE,8GAA8G;AAC9G,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAwElD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"File.d.ts","sourceRoot":"","sources":["../../../../src/components/AttachmentCard/Attachments/File.tsx"],"names":[],"mappings":"AAMA,OAAO,EACL,KAAK,EAAE,EAKR,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAoB/E,2HAA2H;AAC3H,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAuPlD,CAAC"}
1
+ {"version":3,"file":"File.d.ts","sourceRoot":"","sources":["../../../../src/components/AttachmentCard/Attachments/File.tsx"],"names":[],"mappings":"AAMA,OAAO,EACL,KAAK,EAAE,EAMR,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAoB/E,2HAA2H;AAC3H,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAyQlD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../../../../src/components/AttachmentCard/Attachments/Image.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAElB,MAAM,2BAA2B,CAAC;AAQnC,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,EAA+B,MAAM,OAAO,CAAC;AAO5E,OAAO,KAAK,EACV,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,iCAAiC,CAAC;AAKzC,UAAU,oBAAoB;IAC5B,UAAU,EAAE,iBAAiB,CAAC;IAC9B,QAAQ,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,OAAO,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,QAAQ,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,uHAAuH;IACvH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,0EAA0E;AAC1E,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CAoIpD,CAAC"}
1
+ {"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../../../../src/components/AttachmentCard/Attachments/Image.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAElB,MAAM,2BAA2B,CAAC;AAQnC,OAAO,EACL,aAAa,EACb,KAAK,EAAE,EAIR,MAAM,OAAO,CAAC;AAOf,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,CA6IpD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"AttachmentGroup.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentGroup/AttachmentGroup.tsx"],"names":[],"mappings":"AAkBA,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,CAyIpD,CAAC"}
1
+ {"version":3,"file":"AttachmentGroup.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentGroup/AttachmentGroup.tsx"],"names":[],"mappings":"AAkBA,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,CA2IpD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"AttachmentTray.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentTray/AttachmentTray.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAGxE,gHAAgH;AAChH,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAiDlD,CAAC"}
1
+ {"version":3,"file":"AttachmentTray.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentTray/AttachmentTray.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAGxE,gHAAgH;AAChH,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAwDlD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"FileDndOverlay.d.ts","sourceRoot":"","sources":["../../../src/components/FileDndOverlay/FileDndOverlay.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAa,EAAE,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAGzE,uGAAuG;AACvG,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAsElD,CAAC"}
1
+ {"version":3,"file":"FileDndOverlay.d.ts","sourceRoot":"","sources":["../../../src/components/FileDndOverlay/FileDndOverlay.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAa,EAAE,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAGzE,uGAAuG;AACvG,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CA4ElD,CAAC"}
@@ -4,7 +4,7 @@ import { ClipboardEventHandler } from 'react';
4
4
  export interface UseClipboardPasteLabels {
5
5
  /** Name template a pasted image is derived from, with the paste timestamp inserted before the extension. Defaults to `'Screenshot.png'`. */
6
6
  screenshotName?: string;
7
- /** Default file name given to pasted plain text when it has no usable preview. Defaults to `'Pasted text'`. */
7
+ /** Name prefix of a pasted plain-text file, which gets the paste timestamp and a `.txt` extension appended. Defaults to `'Pasted text'`. */
8
8
  pastedTextName?: string;
9
9
  }
10
10
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"useClipboardPaste.d.ts","sourceRoot":"","sources":["../../src/hooks/useClipboardPaste.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE5D,OAAO,EAAE,qBAAqB,EAAe,MAAM,OAAO,CAAC;AAG3D,mFAAmF;AACnF,MAAM,WAAW,uBAAuB;IACtC,4IAA4I;IAC5I,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,+GAA+G;IAC/G,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AA6BD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB,GAC5B,eAAe,CAAC,WAAW,EAAE,UAAU,EAAE,KAAK,IAAI,EAClD,WAAW,MAAM,EACjB,SAAQ,uBAA4B,KACnC;IAAE,WAAW,EAAE,qBAAqB,CAAC,mBAAmB,CAAC,CAAA;CAwE3D,CAAC"}
1
+ {"version":3,"file":"useClipboardPaste.d.ts","sourceRoot":"","sources":["../../src/hooks/useClipboardPaste.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE5D,OAAO,EAAE,qBAAqB,EAAe,MAAM,OAAO,CAAC;AAG3D,mFAAmF;AACnF,MAAM,WAAW,uBAAuB;IACtC,4IAA4I;IAC5I,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,4IAA4I;IAC5I,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AA6BD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB,GAC5B,eAAe,CAAC,WAAW,EAAE,UAAU,EAAE,KAAK,IAAI,EAClD,WAAW,MAAM,EACjB,SAAQ,uBAA4B,KACnC;IAAE,WAAW,EAAE,qBAAqB,CAAC,mBAAmB,CAAC,CAAA;CAuE3D,CAAC"}
package/index.css CHANGED
@@ -1,2 +1,2 @@
1
- ._tile_s2es2_12{box-sizing:border-box;background:var(--ai-tile-bg,var(--bg-layer-raised,#fcfcfc));border-style:solid;border-color:var(--ai-tile-border,var(--stroke-secondary,#d1dbea))}._tile_s2es2_12._hovered_s2es2_18:hover{background:var(--ai-tile-bg-hover,var(--bg-control-neutral-hover-muted,#e0e6f0));border-color:var(--ai-tile-border-hover,var(--ai-tile-border,var(--stroke-secondary,#d1dbea)))}._tile_s2es2_12:focus-visible{outline-color:var(--ai-tile-focus-outline,var(--stroke-focus-black,#161b2d))}._selected_s2es2_28{background:var(--ai-tile-bg-selected,var(--bg-control-accent-alpha,#2764d90f));border-color:var(--ai-tile-border-selected,var(--stroke-accent-alpha,#2764d933))}._tileError_s2es2_33{background:var(--ai-tile-bg-error,var(--bg-error,#f3d6d8));border-color:var(--ai-tile-border-error,var(--stroke-error,#ae2f2f))}._nameText_s2es2_38{color:var(--ai-tile-name-text,var(--text-primary,#161b2d))}._typeText_s2es2_42{color:var(--ai-tile-type-text,var(--text-secondary,#57647a))}._retryIcon_s2es2_46{color:var(--ai-tile-error-text,var(--text-error,#ae2f2f))}._track_s2es2_50{background:var(--ai-tile-progress-track,var(--bg-backdrop,#161b2d4d))}._actionButton_s2es2_56{background:var(--ai-tile-hover-icon-bg,var(--bg-control-neutral-hover-muted,#e0e6f0))}._imageActionButton_s2es2_60{background:var(--ai-tile-hover-icon-bg,var(--bg-layer-base,#f5f7fa));color:var(--ai-tile-hover-icon-color,var(--text-secondary,#57647a))}._headerIcon_1dmgi_1,._headerLabel_1dmgi_2{color:var(--ai-group-text,var(--text-secondary,#57647a))}._overlay_mzpdp_1{background:var(--ai-fd-bg,var(--bg-backdrop,#161b2d4d))}._icon_mzpdp_5{color:var(--ai-fd-icon,var(--text-accent,#1d4ed8))}._deniedIcon_mzpdp_9{color:var(--ai-fd-denied-icon,var(--text-error,#ae2f2f))}
2
- /*$vite$:1*/.sr-only{height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;clip:rect(0,0,0,0);border-width:0;white-space:nowrap}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.visible{visibility:visible}.invisible{visibility:hidden}.collapse{visibility:collapse}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.end-1{inset-inline-end:.25rem}.start-\[-1px\]{inset-inline-start:-1px}.top-1{top:.25rem}.top-\[-1px\]{top:-1px}.z-10{z-index:10}.z-\[9999\]{z-index:9999}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.line-clamp-2{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.size-\[84px\]{height:84px;width:84px}.size-full{width:100%}.h-full,.size-full{height:100%}.w-full{width:100%}.min-w-0{min-width:0}.max-w-\[420px\]{max-width:420px}.max-w-\[492px\]{max-width:492px}.flex-1{flex:1 1 0%}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.grid-cols-\[repeat\(5\2c 83px\)\]{grid-template-columns:repeat(5,83px)}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:4px}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.object-cover{-o-object-fit:cover;object-fit:cover}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.pe-11{padding-inline-end:2.75rem}.pe-5{padding-inline-end:1.25rem}.text-center{text-align:center}.opacity-0{opacity:0}.opacity-100{opacity:1}.outline{outline-style:solid;outline-width:1px}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-sm{--tw-backdrop-blur:blur(4px);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-200{transition-duration:.2s}.focus-within\:outline:focus-within{outline-style:solid;outline-width:1px}.focus-within\:outline-1:focus-within{outline-width:1px}.focus-within\:outline-offset-1:focus-within{outline-offset:1px}.focus-visible\:opacity-100:focus-visible{opacity:1}.group\/attachment-tile:focus-within .group-focus-within\/attachment-tile\:opacity-100{opacity:1}.group\/attachment-tile:hover .group-hover\/attachment-tile\:opacity-100{opacity:1}
1
+ ._tile_1tdbq_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_1tdbq_12._hovered_1tdbq_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_1tdbq_12:focus-visible{outline-color:var(--ai-tile-focus-outline,var(--stroke-focus,#161b2d))}._selected_1tdbq_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_1tdbq_33{background:var(--ai-tile-bg-error,var(--bg-error,#f3d6d8));border-color:var(--ai-tile-border-error,var(--stroke-error,#ae2f2f))}._nameText_1tdbq_38{color:var(--ai-tile-name-text,var(--text-primary,#161b2d))}._typeText_1tdbq_42{color:var(--ai-tile-type-text,var(--text-secondary,#57647a))}._retryIcon_1tdbq_46{color:var(--ai-tile-error-text,var(--text-error,#ae2f2f))}._track_1tdbq_50{background:var(--ai-tile-progress-track,var(--bg-backdrop,#161b2d4d))}._actionButton_1tdbq_56{background:var(--ai-tile-hover-icon-bg,var(--bg-control-neutral-hover-muted,#e0e6f0))}._imageActionButton_1tdbq_60{background:var(--ai-tile-hover-icon-bg,var(--bg-layer-base,#f5f7fa));color:var(--ai-tile-hover-icon-color,var(--text-secondary,#57647a))}._headerIcon_1dmgi_1,._headerLabel_1dmgi_2{color:var(--ai-group-text,var(--text-secondary,#57647a))}._overlay_mzpdp_1{background:var(--ai-fd-bg,var(--bg-backdrop,#161b2d4d))}._icon_mzpdp_5{color:var(--ai-fd-icon,var(--text-accent,#1d4ed8))}._deniedIcon_mzpdp_9{color:var(--ai-fd-denied-icon,var(--text-error,#ae2f2f))}
2
+ /*$vite$:1*/.sr-only{height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;clip:rect(0,0,0,0);border-width:0;white-space:nowrap}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.visible{visibility:visible}.invisible{visibility:hidden}.collapse{visibility:collapse}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.end-1{inset-inline-end:.25rem}.start-\[-1px\]{inset-inline-start:-1px}.top-1{top:.25rem}.top-\[-1px\]{top:-1px}.z-10{z-index:10}.z-\[9999\]{z-index:9999}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.line-clamp-2{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.size-\[84px\]{height:84px;width:84px}.size-full{width:100%}.h-full,.size-full{height:100%}.w-full{width:100%}.min-w-0{min-width:0}.max-w-\[420px\]{max-width:420px}.max-w-\[492px\]{max-width:492px}.flex-1{flex:1 1 0%}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.grid-cols-\[repeat\(5\2c 83px\)\]{grid-template-columns:repeat(5,83px)}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:4px}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.object-cover{-o-object-fit:cover;object-fit:cover}.p-1\.5{padding:.375rem}.pe-11{padding-inline-end:2.75rem}.pe-5{padding-inline-end:1.25rem}.text-center{text-align:center}.opacity-0{opacity:0}.opacity-100{opacity:1}.outline{outline-style:solid;outline-width:1px}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-sm{--tw-backdrop-blur:blur(4px);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-200{transition-duration:.2s}.focus-within\:outline:focus-within{outline-style:solid;outline-width:1px}.focus-within\:outline-1:focus-within{outline-width:1px}.focus-within\:outline-offset-1:focus-within{outline-offset:1px}.focus-visible\:opacity-100:focus-visible{opacity:1}.group\/attachment-tile:focus-within .group-focus-within\/attachment-tile\:opacity-100{opacity:1}.group\/attachment-tile:hover .group-hover\/attachment-tile\:opacity-100{opacity:1}
package/index.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 ee, IconFileTypeXls as R, IconFileTypeXml as z, IconFileTypeZip as B, IconFileX as V, IconMusic as H, IconPaperclip as te, IconPhoto as U, IconReload as ne, IconTerminal2 as re, IconVideo as ie, IconX as ae } from "@tabler/icons-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 B, IconFileTypeZip as V, IconFileX as ee, IconMusic as te, IconPaperclip as ne, IconPhoto as H, IconReload as re, IconTerminal2 as ie, IconVideo as ae, IconX as U } from "@tabler/icons-react";
4
4
  import { DIAL_ICON_SIZE as W, DIAL_KIT_ICON_STROKE as G, ElementSize as oe, GhostIconButton as se, Highlight as ce, Skeleton as le, SkeletonVariant as ue, Spinner as de, StaticIconButton as fe } from "@epam/ai-dial-ui-kit";
5
5
  import { Fragment as pe, jsx as K, jsxs as q } from "react/jsx-runtime";
6
6
  //#region src/utils/attachment.ts
@@ -46,28 +46,28 @@ var me = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, he = (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 U;
49
+ default: return H;
50
50
  }
51
- if (t.startsWith("video/")) return ie;
52
- if (t.startsWith("audio/")) return H;
51
+ if (t.startsWith("video/")) return ae;
52
+ if (t.startsWith("audio/")) return te;
53
53
  switch (t) {
54
54
  case "application/pdf": return O;
55
55
  case "application/msword": return S;
56
56
  case "application/vnd.openxmlformats-officedocument.wordprocessingml.document": return C;
57
57
  case "application/vnd.ms-powerpoint": return j;
58
58
  case "application/vnd.openxmlformats-officedocument.presentationml.presentation": return j;
59
- case "application/vnd.ms-excel": return R;
60
- case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": return R;
59
+ case "application/vnd.ms-excel": return z;
60
+ case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": return z;
61
61
  case "application/zip":
62
62
  case "application/vnd.rar":
63
63
  case "application/x-7z-compressed":
64
64
  case "application/gzip":
65
- case "application/x-tar": return B;
65
+ case "application/x-tar": return V;
66
66
  case "text/csv": return x;
67
67
  case "text/plain": return L;
68
68
  case "text/html":
69
69
  case "application/xhtml+xml": return w;
70
- case "application/xml": return z;
70
+ case "application/xml": return B;
71
71
  case "application/sql": return N;
72
72
  case "text/javascript": return E;
73
73
  case "text/jsx": return D;
@@ -76,12 +76,12 @@ var me = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, he = (e)
76
76
  case "text/css": return b;
77
77
  case "text/x-php": return k;
78
78
  case "text/x-rustsrc": return M;
79
- case "text/x-vue": return ee;
79
+ case "text/x-vue": return R;
80
80
  default: return _;
81
81
  }
82
82
  }, xe = (e) => {
83
83
  let { type: n, contentType: r } = e;
84
- return n === t.Prompt ? re : n === t.Pasted ? m : n === t.Image ? U : be(r ?? "");
84
+ return n === t.Prompt ? ie : n === t.Pasted ? m : n === t.Image ? H : be(r ?? "");
85
85
  }, Se = (e) => {
86
86
  let t = s(e), r = n[t];
87
87
  if (r) return r;
@@ -118,16 +118,16 @@ var me = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, he = (e)
118
118
  tileType: "dial-ai-attachment-tile-type",
119
119
  tileAction: "dial-ai-attachment-tile-action"
120
120
  }, X = {
121
- tile: "_tile_s2es2_12",
122
- hovered: "_hovered_s2es2_18",
123
- selected: "_selected_s2es2_28",
124
- tileError: "_tileError_s2es2_33",
125
- nameText: "_nameText_s2es2_38",
126
- typeText: "_typeText_s2es2_42",
127
- retryIcon: "_retryIcon_s2es2_46",
128
- track: "_track_s2es2_50",
129
- actionButton: "_actionButton_s2es2_56",
130
- imageActionButton: "_imageActionButton_s2es2_60"
121
+ tile: "_tile_1tdbq_12",
122
+ hovered: "_hovered_1tdbq_18",
123
+ selected: "_selected_1tdbq_28",
124
+ tileError: "_tileError_1tdbq_33",
125
+ nameText: "_nameText_1tdbq_38",
126
+ typeText: "_typeText_1tdbq_42",
127
+ retryIcon: "_retryIcon_1tdbq_46",
128
+ track: "_track_1tdbq_50",
129
+ actionButton: "_actionButton_1tdbq_56",
130
+ imageActionButton: "_imageActionButton_1tdbq_60"
131
131
  }, Z = ({ ariaLabel: e, errorTitle: t, errorDescId: n, onClick: r, id: i, icon: a, className: s }) => /* @__PURE__ */ K(fe, {
132
132
  icon: a,
133
133
  size: oe.Small,
@@ -138,7 +138,7 @@ var me = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, he = (e)
138
138
  e.stopPropagation(), r(i);
139
139
  }
140
140
  }), Ee = ({ ...e }) => /* @__PURE__ */ K(Z, {
141
- icon: /* @__PURE__ */ K(ne, {
141
+ icon: /* @__PURE__ */ K(re, {
142
142
  size: W.SM,
143
143
  "aria-hidden": !0,
144
144
  stroke: G
@@ -160,7 +160,7 @@ var me = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, he = (e)
160
160
  }),
161
161
  ...e
162
162
  }), ke = ({ ...e }) => /* @__PURE__ */ K(Z, {
163
- icon: /* @__PURE__ */ K(ae, {
163
+ icon: /* @__PURE__ */ K(U, {
164
164
  size: W.SM,
165
165
  "aria-hidden": !0,
166
166
  stroke: G
@@ -170,93 +170,95 @@ var me = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, he = (e)
170
170
  [e.Network]: "Upload failed · network error",
171
171
  [e.UnsupportedType]: "Upload failed · unsupported file type",
172
172
  [e.FileTooLarge]: "Upload failed · file too large"
173
- }, je = ({ attachment: t, searchQuery: n = "", onClick: i, onRetry: a, labels: s, styles: l, onDownload: f, isPasted: p, isLink: m, cssVars: h, onExpand: g, isExpandable: _, onRemove: v, isSelected: y }) => {
174
- let { clickLabel: b = "Download attachment", retryLabel: x = "Retry upload", removeLabel: S = "Remove attachment", openInNewTabLabel: C = "Open in new tab", sizeLabel: w, uploadingLabel: T = "Uploading", errorReasonLabels: E, genericErrorLabel: D = "Upload failed" } = s ?? {}, { typography: O, className: k } = l ?? {}, { id: A, name: j, status: M, errorReason: N } = t, P = M === r.Loading, F = M === r.Error, I = u(), L = F ? N && (E?.[N] ?? Ae[N]) || D : "", { BottomIcon: ee, typeLabel: R } = J(t), z = !F && !P && f && !m, B = F && !!a && N !== e.UnsupportedType && N !== e.FileTooLarge, V = Number(!!z) + Number(!!B) + Number(!!m) + Number(!!v), H = V > 1 ? "pe-11" : V === 1 ? "pe-5" : void 0, te = (e) => {
175
- e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), i?.(t.id));
176
- }, U = d(() => p ? j : he(j), [p, j]), ne = c(() => {
173
+ }, je = ({ 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 }) => {
174
+ 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] ?? Ae[P]) || O : "", { BottomIcon: z, typeLabel: B } = J(t), V = !I && !F && f && !p, ee = I && !!a && P !== e.UnsupportedType && P !== e.FileTooLarge, te = Number(!!V) + Number(!!ee) + Number(!!p) + Number(!!_), ne = te > 1 ? "pe-11" : te === 1 ? "pe-5" : void 0, H = !!g && h !== void 0, re = H || i !== void 0, ie = () => {
175
+ H ? h(j) : i?.(j);
176
+ }, ae = (e) => {
177
+ e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), ie());
178
+ }, U = d(() => he(M), [M]), W = c(() => {
177
179
  window.open(t.referenceUrl, "_blank", "noopener,noreferrer");
178
- }, [t]), re = o(Te, "group/attachment-tile relative flex-col justify-between items-start gap-1 overflow-hidden p-1.5", X.tile, !F && X.hovered, y && X.selected, F && X.tileError, Y.tile, y && Y.tileSelected), ie = /* @__PURE__ */ K("div", {
180
+ }, [t]), G = o(Te, "group/attachment-tile relative flex-col justify-between items-start gap-1 overflow-hidden p-1.5", X.tile, !I && X.hovered, v && X.selected, I && X.tileError, Y.tile, v && Y.tileSelected), oe = /* @__PURE__ */ K("div", {
179
181
  title: U,
180
- className: o(O?.nameClassName ?? "dial-caption-text", "line-clamp-2 w-full min-w-0 break-words", X.nameText, !F && H, Y.tileName),
182
+ className: o(k?.nameClassName ?? "dial-caption-text", "line-clamp-2 w-full min-w-0 break-words", X.nameText, !I && ne, Y.tileName),
181
183
  children: n ? /* @__PURE__ */ K(ce, {
182
184
  text: U,
183
185
  query: n,
184
186
  maxLines: 2
185
187
  }) : U
186
- }), ae = ee && /* @__PURE__ */ q("div", {
187
- className: o("flex w-full items-center gap-1", F && H, Y.tileType),
188
- children: [/* @__PURE__ */ K(ee, {
188
+ }), se = z && /* @__PURE__ */ q("div", {
189
+ className: o("flex w-full items-center gap-1", I && ne, Y.tileType),
190
+ children: [/* @__PURE__ */ K(z, {
189
191
  size: 16,
190
192
  className: X.typeText,
191
193
  "aria-hidden": !0
192
194
  }), /* @__PURE__ */ K("span", {
193
- className: o(O?.metaClassName ?? "dial-caption-text", "min-w-0 flex-1 truncate", X.typeText),
194
- children: w ? `${R} · ${w}` : R
195
+ className: o(k?.metaClassName ?? "dial-caption-text", "min-w-0 flex-1 truncate", X.typeText),
196
+ children: T ? `${B} · ${T}` : B
195
197
  })]
196
- }), W = () => {
197
- _ && g ? g(A) : i && i(A);
198
- }, G = /* @__PURE__ */ q(pe, { children: [
199
- ie,
200
- ae,
201
- P && /* @__PURE__ */ K("div", {
198
+ }), le = re ? {
199
+ role: "button",
200
+ tabIndex: 0,
201
+ "aria-label": H ? b : y,
202
+ onClick: ie,
203
+ onKeyDown: ae
204
+ } : {}, ue = /* @__PURE__ */ q(pe, { children: [
205
+ oe,
206
+ se,
207
+ F && /* @__PURE__ */ K("div", {
202
208
  role: "progressbar",
203
- "aria-label": T,
209
+ "aria-label": E,
204
210
  className: o("absolute start-[-1px] top-[-1px] flex size-full items-center justify-center rounded", X.track),
205
211
  children: /* @__PURE__ */ K(de, { size: 32 })
206
212
  }),
207
213
  /* @__PURE__ */ q("div", {
208
214
  className: "absolute end-1 top-1 flex gap-1",
209
215
  children: [
210
- z && /* @__PURE__ */ K(De, {
211
- ariaLabel: b,
212
- errorTitle: L,
213
- errorDescId: I,
216
+ V && /* @__PURE__ */ K(De, {
217
+ ariaLabel: x,
218
+ errorTitle: R,
219
+ errorDescId: L,
214
220
  onClick: f,
215
- id: A
221
+ id: j
216
222
  }),
217
- B && /* @__PURE__ */ K(Ee, {
218
- ariaLabel: x,
219
- errorTitle: L,
220
- errorDescId: I,
223
+ ee && /* @__PURE__ */ K(Ee, {
224
+ ariaLabel: S,
225
+ errorTitle: R,
226
+ errorDescId: L,
221
227
  onClick: a,
222
- id: A
228
+ id: j
223
229
  }),
224
- m && /* @__PURE__ */ K(Oe, {
225
- ariaLabel: C,
226
- errorTitle: L,
227
- errorDescId: I,
228
- onClick: ne
230
+ p && /* @__PURE__ */ K(Oe, {
231
+ ariaLabel: w,
232
+ errorTitle: R,
233
+ errorDescId: L,
234
+ onClick: W
229
235
  }),
230
- v && /* @__PURE__ */ K(ke, {
231
- ariaLabel: S,
232
- errorTitle: L,
233
- errorDescId: I,
234
- onClick: v,
235
- id: A
236
+ _ && /* @__PURE__ */ K(ke, {
237
+ ariaLabel: C,
238
+ errorTitle: R,
239
+ errorDescId: L,
240
+ onClick: _,
241
+ id: j
236
242
  })
237
243
  ]
238
244
  }),
239
- F && /* @__PURE__ */ K("span", {
240
- id: I,
245
+ I && /* @__PURE__ */ K("span", {
246
+ id: L,
241
247
  role: "status",
242
248
  "aria-live": "polite",
243
249
  className: "sr-only",
244
- children: L
250
+ children: R
245
251
  })
246
252
  ] });
247
253
  return /* @__PURE__ */ K("div", {
248
- style: h,
249
- className: o("inline-flex", k),
254
+ style: m,
255
+ className: o("inline-flex", A),
250
256
  children: /* @__PURE__ */ K("div", {
251
- role: "button",
252
- tabIndex: 0,
253
- "aria-label": b,
254
- "aria-busy": P,
255
- onClick: W,
256
- onKeyDown: te,
257
- style: h,
258
- className: o(re, "cursor-pointer focus-within:outline focus-within:outline-1 focus-within:outline-offset-1"),
259
- children: G
257
+ ...le,
258
+ "aria-busy": F,
259
+ style: m,
260
+ className: o(G, re && "cursor-pointer", "focus-within:outline focus-within:outline-1 focus-within:outline-offset-1"),
261
+ children: ue
260
262
  })
261
263
  });
262
264
  }, Q = /* @__PURE__ */ function(e) {
@@ -277,22 +279,24 @@ var me = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, he = (e)
277
279
  imageLoadStatus: r
278
280
  };
279
281
  }, Ne = ({ attachment: e, onExpand: n, onClick: r, labels: i, onRemove: a, cssVars: s, onDownload: c, styles: l, isSelected: u }) => {
280
- let { clickLabel: f = "Open attachment", expandLabel: p = "Expand pasted text", removeLabel: m = "Remove attachment", downloadLabel: h = "Download attachment" } = i ?? {}, { className: g } = l ?? {}, { id: _, name: v } = e, y = e.previewUrl ?? e.url, b = e.type === t.Pasted && n !== void 0, { isLoading: x, isError: S, isImage: C } = d(() => J(e), [e]), w = r !== void 0 && !b && !x && !S, { imageRef: T, imageLoadStatus: E } = Me({
282
+ let { clickLabel: f = "Open attachment", expandLabel: p = "Expand pasted text", removeLabel: m = "Remove attachment", downloadLabel: h = "Download attachment" } = i ?? {}, { className: g } = l ?? {}, { id: _, name: v } = e, y = e.previewUrl ?? e.url, b = e.type === t.Pasted && n !== void 0, { isLoading: x, isError: S, isImage: C } = d(() => J(e), [e]), w = r !== void 0 && !b && !x && !S, T = b || w, { imageRef: E, imageLoadStatus: D } = Me({
281
283
  enabled: C,
282
284
  src: y
283
- }), D = () => {
285
+ }), O = () => {
284
286
  b && n ? n(_) : w && r && r(_);
285
- };
286
- return /* @__PURE__ */ K("div", {
287
- className: o(Te, "group/attachment-tile", w && "cursor-pointer", X.tile, u && X.selected, g, Y.tile, u && Y.tileSelected),
288
- onClick: D,
289
- onKeyDown: (e) => {
290
- e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), D());
291
- },
292
- tabIndex: 0,
287
+ }, k = T ? {
293
288
  role: "button",
289
+ tabIndex: 0,
290
+ "aria-label": b ? p : f,
291
+ onClick: O,
292
+ onKeyDown: (e) => {
293
+ e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), O());
294
+ }
295
+ } : {};
296
+ return /* @__PURE__ */ K("div", {
297
+ className: o(Te, "group/attachment-tile", T && "cursor-pointer", X.tile, u && X.selected, g, Y.tile, u && Y.tileSelected),
298
+ ...k,
294
299
  style: s,
295
- "aria-label": w ? f : b ? p : void 0,
296
300
  children: /* @__PURE__ */ q("div", {
297
301
  className: "relative h-full w-full overflow-hidden",
298
302
  children: [
@@ -310,12 +314,12 @@ var me = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, he = (e)
310
314
  className: X.imageActionButton
311
315
  })]
312
316
  }),
313
- E !== Q.Loaded && /* @__PURE__ */ K(le, {
317
+ D !== Q.Loaded && /* @__PURE__ */ K(le, {
314
318
  variant: ue.Rectangular,
315
319
  width: "100%",
316
320
  height: "100%",
317
- active: E === Q.Loading,
318
- overlay: /* @__PURE__ */ K(U, {
321
+ active: D === Q.Loading,
322
+ overlay: /* @__PURE__ */ K(H, {
319
323
  size: W.LG,
320
324
  className: X.typeText,
321
325
  "aria-hidden": !0,
@@ -324,18 +328,18 @@ var me = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, he = (e)
324
328
  className: "absolute inset-0 rounded-xl"
325
329
  }),
326
330
  /* @__PURE__ */ K("img", {
327
- ref: T,
331
+ ref: E,
328
332
  src: y,
329
333
  alt: v,
330
334
  loading: "lazy",
331
335
  decoding: "async",
332
- className: o("h-full w-full rounded-xl object-cover transition-opacity duration-200", E === Q.Loaded ? "opacity-100" : "opacity-0")
336
+ className: o("h-full w-full rounded-xl object-cover transition-opacity duration-200", D === Q.Loaded ? "opacity-100" : "opacity-0")
333
337
  })
334
338
  ]
335
339
  })
336
340
  });
337
341
  }, Pe = ({ attachment: e, searchQuery: n = "", onRemove: r, onRetry: a, onExpand: o, onClick: s, onDownload: c, labels: l, styles: u, isSelected: f }) => {
338
- let { colors: p } = u ?? {}, m = e.type === t.Pasted, h = m && o !== void 0, g = i({
342
+ let { colors: p } = u ?? {}, m = e.type === t.Pasted && o !== void 0, h = i({
339
343
  "--ai-tile-bg": p?.background,
340
344
  "--ai-tile-border": p?.border,
341
345
  "--ai-tile-bg-hover": p?.backgroundHover,
@@ -351,15 +355,15 @@ var me = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, he = (e)
351
355
  "--ai-tile-hover-icon-bg": p?.hoverIconBackground,
352
356
  "--ai-tile-hover-icon-color": p?.hoverIconColor,
353
357
  "--ai-tile-progress-track": p?.trackBackground
354
- }), { isImage: _, isLink: v } = d(() => J(e), [e]);
355
- return _ ? /* @__PURE__ */ K(Ne, {
358
+ }), { isImage: g, isLink: _ } = d(() => J(e), [e]);
359
+ return g ? /* @__PURE__ */ K(Ne, {
356
360
  attachment: e,
357
361
  labels: l,
358
362
  onClick: s,
359
363
  onExpand: o,
360
364
  styles: u,
361
365
  onRemove: r,
362
- cssVars: g,
366
+ cssVars: h,
363
367
  onDownload: c,
364
368
  isSelected: f
365
369
  }) : /* @__PURE__ */ K(je, {
@@ -369,21 +373,20 @@ var me = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, he = (e)
369
373
  onRetry: a,
370
374
  onRemove: r,
371
375
  onDownload: c,
372
- isLink: v,
373
- isPasted: m,
376
+ isLink: _,
374
377
  styles: u,
375
378
  labels: l,
376
379
  onExpand: o,
377
- cssVars: g,
378
- isExpandable: h,
380
+ cssVars: h,
381
+ isExpandable: m,
379
382
  isSelected: f
380
383
  });
381
384
  }, Fe = ({ attachments: e, onRemove: t, onRetry: n, onExpand: r, onAttachmentClick: i, labels: a, styles: s }) => {
382
- let { ariaLabel: c = "Attached files", removeLabel: l, retryLabel: u, clickLabel: d, uploadingLabel: f } = a ?? {}, { className: p, card: m } = s ?? {};
385
+ let { ariaLabel: c = "Attached files", removeLabel: l, retryLabel: u, clickLabel: d, expandLabel: f, uploadingLabel: p } = a ?? {}, { className: m, card: h } = s ?? {};
383
386
  return e.length === 0 ? null : /* @__PURE__ */ K("div", {
384
387
  role: "list",
385
388
  "aria-label": c,
386
- className: o("flex w-full min-w-0 gap-2 overflow-x-auto", p, Y.tray),
389
+ className: o("flex w-full min-w-0 gap-2 overflow-x-auto", m, Y.tray),
387
390
  children: e.map((e) => /* @__PURE__ */ K("div", {
388
391
  role: "listitem",
389
392
  className: Y.trayItem,
@@ -396,9 +399,10 @@ var me = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, he = (e)
396
399
  removeLabel: l,
397
400
  retryLabel: u,
398
401
  clickLabel: d,
399
- uploadingLabel: f
402
+ expandLabel: f,
403
+ uploadingLabel: p
400
404
  },
401
- styles: m,
405
+ styles: h,
402
406
  onClick: i
403
407
  })
404
408
  }, e.id))
@@ -407,31 +411,31 @@ var me = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, he = (e)
407
411
  headerIcon: "_headerIcon_1dmgi_1",
408
412
  headerLabel: "_headerLabel_1dmgi_2"
409
413
  }, Le = (e, t) => `${e} ${t}${e === 1 ? "" : "s"}`, Re = ({ attachments: e, onAttachmentClick: n, onDownloadAll: a, onRetry: s, labels: c, styles: l, selectedAttachmentId: u }) => {
410
- let { ariaLabel: d = "Attachments", clickLabel: f = "Download attachment", retryLabel: p = "Retry upload", downloadAllLabel: m = "Download all", openInNewTabLabel: g, getHeaderLabel: v = (e) => Le(e, "attachment"), promptLabel: y, pastedLabel: b, imageLabel: x } = c ?? {}, { typography: S, colors: C, className: w } = l ?? {}, T = i({ "--ai-group-text": C?.text });
414
+ 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) => Le(e, "attachment"), promptLabel: b, pastedLabel: x, imageLabel: S } = c ?? {}, { typography: C, colors: w, className: T } = l ?? {}, E = i({ "--ai-group-text": w?.text });
411
415
  if (e.length === 0) return null;
412
- 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 ? te : E ? U : _, j = v(e.length), M = () => {
416
+ 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 ? ne : D ? H : _, M = y(e.length), N = () => {
413
417
  let t = e.filter((e) => e.status === r.Idle);
414
418
  a ? a(t) : t.forEach((e) => n?.(e.id));
415
- }, N = (t) => {
419
+ }, P = (t) => {
416
420
  let n = e.find((e) => e.id === t);
417
421
  n && a?.([n]);
418
422
  };
419
423
  return /* @__PURE__ */ q("div", {
420
424
  role: "group",
421
425
  "aria-label": d,
422
- style: T,
423
- className: o("flex flex-col gap-1", k ? "w-full min-w-0 max-w-[492px]" : "max-w-[420px]", Ie.container, w),
426
+ style: E,
427
+ className: o("flex flex-col gap-1", A ? "w-full min-w-0 max-w-[492px]" : "max-w-[420px]", Ie.container, T),
424
428
  children: [/* @__PURE__ */ q("div", {
425
429
  className: "flex items-center justify-between",
426
430
  children: [/* @__PURE__ */ q("div", {
427
431
  className: "flex items-center gap-1",
428
- children: [/* @__PURE__ */ K(A, {
432
+ children: [/* @__PURE__ */ K(j, {
429
433
  size: W.SM,
430
434
  className: o("shrink-0", Ie.headerIcon),
431
435
  "aria-hidden": !0
432
436
  }), /* @__PURE__ */ K("span", {
433
- className: o(S?.headerLabelClassName ?? "dial-tiny-semi-text", Ie.headerLabel),
434
- children: j
437
+ className: o(C?.headerLabelClassName ?? "dial-tiny-semi-text", Ie.headerLabel),
438
+ children: M
435
439
  })]
436
440
  }), e.length >= 2 && (a || n) && /* @__PURE__ */ K(se, {
437
441
  icon: /* @__PURE__ */ K(h, {
@@ -440,27 +444,28 @@ var me = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, he = (e)
440
444
  stroke: G
441
445
  }),
442
446
  size: oe.Small,
443
- "aria-label": m,
444
- onClick: M
447
+ "aria-label": g,
448
+ onClick: N
445
449
  })]
446
450
  }), /* @__PURE__ */ K("div", {
447
451
  role: "list",
448
- "aria-label": j,
449
- className: o("gap-3", k ? "grid grid-cols-[repeat(5,83px)]" : "flex flex-wrap"),
452
+ "aria-label": M,
453
+ className: o("gap-3", A ? "grid grid-cols-[repeat(5,83px)]" : "flex flex-wrap"),
450
454
  children: e.map((e, t) => /* @__PURE__ */ K("div", {
451
455
  role: "listitem",
452
456
  children: /* @__PURE__ */ K(Pe, {
453
457
  attachment: e,
454
458
  onClick: n,
455
- onDownload: N,
459
+ onDownload: a ? P : void 0,
456
460
  onRetry: s,
457
461
  labels: {
458
462
  clickLabel: f,
459
- retryLabel: p,
460
- promptLabel: y,
461
- pastedLabel: b,
462
- imageLabel: x,
463
- openInNewTabLabel: g
463
+ downloadLabel: p,
464
+ retryLabel: m,
465
+ promptLabel: b,
466
+ pastedLabel: x,
467
+ imageLabel: S,
468
+ openInNewTabLabel: v
464
469
  },
465
470
  isSelected: e.id === u
466
471
  })
@@ -480,7 +485,7 @@ var me = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, he = (e)
480
485
  "--ai-fd-denied-icon": c?.deniedIcon
481
486
  }), 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 ? ze.icon : ze.deniedIcon, m = (e) => {
482
487
  e.preventDefault();
483
- }, h = t ? v : V;
488
+ }, h = t ? v : ee;
484
489
  return /* @__PURE__ */ K("div", {
485
490
  role: "status",
486
491
  "aria-live": "polite",
@@ -493,6 +498,7 @@ var me = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, he = (e)
493
498
  children: [
494
499
  /* @__PURE__ */ K(h, {
495
500
  size: 100,
501
+ stroke: 1,
496
502
  className: p,
497
503
  "aria-hidden": !0
498
504
  }),
@@ -536,15 +542,15 @@ var me = () => `${Date.now()}-${Math.random().toString(36).slice(2)}`, he = (e)
536
542
  }
537
543
  let l = i.clipboardData.getData("text/plain");
538
544
  if (l.length > n) {
539
- let n = l.trim(), a = (n.length > 80 ? `${n.slice(0, 80).trimEnd()}…` : n) || o, s = new File([l], a, { type: "text/plain" }), c = {
545
+ let n = `${o} ${Ve(/* @__PURE__ */ new Date())}.txt`, a = new File([l], n, { type: "text/plain" }), s = {
540
546
  id: me(),
541
- name: a,
547
+ name: n,
542
548
  contentType: "text/plain",
543
- file: s,
549
+ file: a,
544
550
  type: t.Pasted,
545
551
  status: r.Idle
546
552
  };
547
- i.preventDefault(), e([c]);
553
+ i.preventDefault(), e([s]);
548
554
  }
549
555
  }, [
550
556
  e,
@@ -79,15 +79,15 @@ export interface AttachmentCardLabels extends AttachmentTypeLabels {
79
79
  removeLabel?: string;
80
80
  /** Accessible label for the retry button (error state only). Defaults to `'Retry upload'`. */
81
81
  retryLabel?: string;
82
- /** Accessible label applied to the card root when it is interactive via `onClick`. Defaults to `'Open attachment'`. */
82
+ /** Accessible name of the card root when it is interactive via `onClick`. Defaults to `'Open attachment'` on an image tile and `'Download attachment'` on a file, link or pasted-text tile. Unused when the card has no `onClick`. */
83
83
  clickLabel?: string;
84
- /** Accessible label applied to the card root when it is interactive via `onExpand` (pasted-text cards). Defaults to `'Expand pasted text'`. */
84
+ /** Accessible name of the card root when it is interactive via `onExpand` (pasted-text cards; takes precedence over `clickLabel`). Defaults to `'Expand pasted text'`. */
85
85
  expandLabel?: string;
86
86
  /** Accessible label for the loading spinner shown while the attachment is uploading. Defaults to `'Loading attachment'`. */
87
87
  loadingLabel?: string;
88
88
  /** Accessible label for the file card's in-progress upload progress bar. Defaults to `'Uploading'`. */
89
89
  uploadingLabel?: string;
90
- /** Accessible label for the download button. Defaults to `'Download attachment'`. */
90
+ /** Accessible label for the corner download button on image and file tiles (rendered when `onDownload` is given). Defaults to `'Download attachment'`. */
91
91
  downloadLabel?: string;
92
92
  /** Accessible label for the open-in-new-tab button. Defaults to `'Open in new tab'`. */
93
93
  openInNewTabLabel?: string;
@@ -102,9 +102,9 @@ export interface AttachmentCardProps {
102
102
  onRemove?: (id: string) => void;
103
103
  /** Called when the user activates the retry button (error state only). */
104
104
  onRetry?: (id: string) => void;
105
- /** Called when the user clicks or activates a pasted-text card to expand its content back into the input. */
105
+ /** Called when the user clicks or keyboard-activates (Enter/Space) a pasted-text card to expand its content back into the input. Takes precedence over `onClick` on pasted-text cards. */
106
106
  onExpand?: (id: string) => void;
107
- /** Called when the user clicks or keyboard-activates the card. Receives the attachment `id`. */
107
+ /** Called when the user clicks or keyboard-activates (Enter/Space) the card. Receives the attachment `id`. When neither this nor an applicable `onExpand` is given, the card renders as a non-interactive element (no `role="button"`, no Tab stop). */
108
108
  onClick?: (id: string) => void;
109
109
  /** Localised accessible labels for the remove/retry actions, the interactive card root, and the non-extension attachment type names (prompt/pasted/image). */
110
110
  labels?: AttachmentCardLabels;
@@ -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,CAA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AAW,CAAC,EAAE,MAAM,CAAC;IACrB,wDAAwD;IACxD,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,0EAA0E;IAC1E,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,0LAA0L;IAC1L,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,wPAAwP;IACxP,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,8JAA8J;IAC9J,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,2DAA2D;IAC3D,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,wFAAwF;IACxF,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,uHAAuH;IACvH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB"}
@@ -3,8 +3,12 @@ import { CSSProperties } from 'react';
3
3
  import { AttachmentTypeLabels } from './attachment-card';
4
4
  /** Localised labels for the `FileAttachment` component. */
5
5
  export interface FileAttachmentLabels extends AttachmentTypeLabels {
6
- /** Accessible label for the download action. Defaults to `'Download attachment'`. */
6
+ /** Accessible name of the tile when it is interactive via `onClick`. Defaults to `'Download attachment'`. */
7
7
  clickLabel?: string;
8
+ /** Accessible label for the corner download action. Kept separate from `clickLabel` so a tile that is both clickable and downloadable exposes two distinctly named buttons. Defaults to `'Download attachment'`. */
9
+ downloadLabel?: string;
10
+ /** Accessible name of a pasted-text tile when it is interactive via `onExpand`. Defaults to `'Expand pasted text'`. */
11
+ expandLabel?: string;
8
12
  /** Accessible label for the retry action. Defaults to `'Retry upload'`. */
9
13
  retryLabel?: string;
10
14
  /** Accessible label for the remove action. Defaults to `'Remove attachment'`. */
@@ -54,8 +58,6 @@ export interface FileAttachmentProps {
54
58
  labels?: FileAttachmentLabels;
55
59
  /** Style overrides for the row. */
56
60
  styles?: FileAttachmentStyles;
57
- /** Whether the attachment is pasted (vs. prompt). Defaults to `false`. */
58
- isPasted?: boolean;
59
61
  /** Whether the attachment is a link (vs. a file). Defaults to `false`. */
60
62
  isLink?: boolean;
61
63
  /** CSS custom properties applied to the root element. */
@@ -1 +1 @@
1
- {"version":3,"file":"attachment-file-row.d.ts","sourceRoot":"","sources":["../../src/models/attachment-file-row.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,iBAAiB,EAClB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE9D,2DAA2D;AAC3D,MAAM,WAAW,oBAAqB,SAAQ,oBAAoB;IAChE,qFAAqF;IACrF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2EAA2E;IAC3E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iFAAiF;IACjF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4GAA4G;IAC5G,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,2KAA2K;IAC3K,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2FAA2F;IAC3F,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gJAAgJ;IAChJ,iBAAiB,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC,CAAC;IACnE,oIAAoI;IACpI,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,+DAA+D;AAC/D,MAAM,WAAW,wBAAwB;IACvC,yFAAyF;IACzF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iHAAiH;IACjH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,0DAA0D;AAC1D,MAAM,WAAW,oBAAoB;IACnC,kEAAkE;IAClE,UAAU,CAAC,EAAE,wBAAwB,CAAC;IACtC,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wDAAwD;AACxD,MAAM,WAAW,mBAAmB;IAClC,0DAA0D;IAC1D,UAAU,EAAE,iBAAiB,CAAC;IAC9B,mGAAmG;IACnG,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kEAAkE;IAClE,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,oDAAoD;IACpD,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,wDAAwD;IACxD,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,uDAAuD;IACvD,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,qDAAqD;IACrD,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,qIAAqI;IACrI,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,mCAAmC;IACnC,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,0EAA0E;IAC1E,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,yDAAyD;IACzD,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,iFAAiF;IACjF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,uHAAuH;IACvH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB"}
1
+ {"version":3,"file":"attachment-file-row.d.ts","sourceRoot":"","sources":["../../src/models/attachment-file-row.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,iBAAiB,EAClB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB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K,IAAI,CAAC;IAC/B,wDAAwD;IACxD,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,uDAAuD;IACvD,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,qDAAqD;IACrD,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,qIAAqI;IACrI,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,mCAAmC;IACnC,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,0EAA0E;IAC1E,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,yDAAyD;IACzD,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,iFAAiF;IACjF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,uHAAuH;IACvH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB"}
@@ -6,6 +6,8 @@ export interface AttachmentGroupLabels extends AttachmentTypeLabels {
6
6
  ariaLabel?: string;
7
7
  /** Accessible label for each tile/row's click action. Defaults to `'Download attachment'`. */
8
8
  clickLabel?: string;
9
+ /** Accessible label for each tile's own download button (rendered when `onDownloadAll` is given). Defaults to `'Download attachment'`. */
10
+ downloadLabel?: string;
9
11
  /** Accessible label for each row's retry action. Defaults to `'Retry upload'`. */
10
12
  retryLabel?: string;
11
13
  /** Label for the "download all" header action, shown whenever the group has 2+ attachments. Defaults to `'Download all'`. */
@@ -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,uEAAuE;AACvE,MAAM,WAAW,qBAAsB,SAAQ,oBAAoB;IACjE,0EAA0E;IAC1E,SAAS,CAAC,EAAE,MAA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{"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,0IAA0I;IAC1I,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,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"}
@@ -8,8 +8,10 @@ export interface AttachmentTrayLabels {
8
8
  removeLabel?: string;
9
9
  /** Accessible label for each card's retry button (error state only). */
10
10
  retryLabel?: string;
11
- /** Accessible label forwarded to each card's root when it is interactive. When omitted, the card's own default (`'Open attachment'`) applies. */
11
+ /** Accessible name forwarded to each card's root when it is interactive via `onAttachmentClick`. When omitted, the card's own default applies (`'Open attachment'` on image tiles, `'Download attachment'` on file, link and pasted-text tiles). */
12
12
  clickLabel?: string;
13
+ /** Accessible name forwarded to each pasted-text card's root when it is interactive via `onExpand`. Defaults to `'Expand pasted text'`. */
14
+ expandLabel?: string;
13
15
  /** Accessible label for each card's in-progress upload progress bar. Defaults to `'Uploading'`. */
14
16
  uploadingLabel?: string;
15
17
  }
@@ -28,9 +30,9 @@ export interface AttachmentTrayProps {
28
30
  onRemove?: (id: string) => void;
29
31
  /** Called when the user retries a failed attachment upload. */
30
32
  onRetry?: (id: string) => void;
31
- /** Called when the user clicks a pasted-text card to expand its content back into the input. */
33
+ /** Called when the user clicks or keyboard-activates a pasted-text card to expand its content back into the input. Takes precedence over `onAttachmentClick` on pasted-text cards. */
32
34
  onExpand?: (id: string) => void;
33
- /** Called when the user clicks or keyboard-activates an attachment card. Receives the full `DisplayAttachment` object. */
35
+ /** Called when the user clicks or keyboard-activates an attachment card. Receives the attachment `id`. When omitted, cards without an applicable `onExpand` are non-interactive. */
34
36
  onAttachmentClick?: (id: string) => void;
35
37
  /** Localised accessible labels for the tray region and each card's interactive elements. */
36
38
  labels?: AttachmentTrayLabels;
@@ -1 +1 @@
1
- {"version":3,"file":"attachment-tray.d.ts","sourceRoot":"","sources":["../../src/models/attachment-tray.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE9D,sEAAsE;AACtE,MAAM,WAAW,oBAAoB;IACnC,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wEAAwE;IACxE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iJAAiJ;IACjJ,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mGAAmG;IACnG,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,0DAA0D;AAC1D,MAAM,WAAW,oBAAoB;IACnC,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yEAAyE;IACzE,IAAI,CAAC,EAAE,oBAAoB,CAAC;CAC7B;AAED,wDAAwD;AACxD,MAAM,WAAW,mBAAmB;IAClC,0CAA0C;IAC1C,WAAW,EAAE,iBAAiB,EAAE,CAAC;IACjC,uDAAuD;IACvD,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,+DAA+D;IAC/D,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,gGAAgG;IAChG,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,0HAA0H;IAC1H,iBAAiB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,4FAA4F;IAC5F,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,oCAAoC;IACpC,MAAM,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;IACpC,MAAM,CAAC,EAAE,oBAAoB,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.2.0-dev.99",
4
+ "version": "1.2.0-rc.0",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "main": "./index.js",
@@ -20,9 +20,9 @@
20
20
  "@tabler/icons-react": "^3.44.0"
21
21
  },
22
22
  "peerDependencies": {
23
- "@epam/ai-dial-chat-shared": "1.2.0-dev.99",
23
+ "@epam/ai-dial-chat-shared": "1.2.0-rc.0",
24
24
  "react": "^19.2.8",
25
- "@epam/ai-dial-ui-kit": "^0.15.0-dev.12"
25
+ "@epam/ai-dial-ui-kit": "^0.15.0"
26
26
  },
27
27
  "repository": {
28
28
  "type": "git",