@epam/ai-dial-attachment-input 1.0.0-dev.513 → 1.0.0-dev.515
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/AttachmentCard.d.ts.map +1 -1
- package/components/AttachmentCard/Attachments/Actions.d.ts +29 -0
- package/components/AttachmentCard/Attachments/Actions.d.ts.map +1 -0
- package/components/AttachmentCard/Attachments/Audio.d.ts +16 -0
- package/components/AttachmentCard/Attachments/Audio.d.ts.map +1 -0
- package/components/{AttachmentFileRow/AttachmentFileRow.d.ts → AttachmentCard/Attachments/File.d.ts} +3 -3
- package/components/AttachmentCard/Attachments/File.d.ts.map +1 -0
- package/components/AttachmentCard/Attachments/Image.d.ts +17 -0
- package/components/AttachmentCard/Attachments/Image.d.ts.map +1 -0
- package/components/AttachmentGroup/AttachmentGroup.d.ts.map +1 -1
- package/components/AttachmentMoreTile/AttachmentMoreTile.d.ts.map +1 -1
- package/components/AttachmentTray/AttachmentTray.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 +1 -1
- package/index.d.ts +0 -2
- package/index.d.ts.map +1 -1
- package/index.js +391 -462
- package/models/attachment-card.d.ts +30 -47
- package/models/attachment-card.d.ts.map +1 -1
- package/models/attachment-file-row.d.ts +28 -51
- package/models/attachment-file-row.d.ts.map +1 -1
- package/models/attachment-group.d.ts +4 -12
- package/models/attachment-group.d.ts.map +1 -1
- package/models/attachment-tray.d.ts +1 -1
- package/models/attachment-tray.d.ts.map +1 -1
- package/package.json +2 -2
- package/utils/attachment.d.ts +2 -2
- package/utils/attachment.d.ts.map +1 -1
- package/components/AttachmentFileRow/AttachmentFileRow.d.ts.map +0 -1
|
@@ -9,7 +9,7 @@ export interface AttachmentTypeLabels {
|
|
|
9
9
|
/** Label shown for an image attachment. Defaults to `'Image'`. */
|
|
10
10
|
imageLabel?: string;
|
|
11
11
|
}
|
|
12
|
-
/** Derived display state an AttachmentCard
|
|
12
|
+
/** Derived display state an AttachmentCard needs to render a given attachment. */
|
|
13
13
|
export interface AttachmentCardState {
|
|
14
14
|
/** Whether the attachment is currently uploading. */
|
|
15
15
|
isLoading: boolean;
|
|
@@ -17,53 +17,43 @@ export interface AttachmentCardState {
|
|
|
17
17
|
isError: boolean;
|
|
18
18
|
/** Whether the attachment should render as a previewable image tile. */
|
|
19
19
|
isImage: boolean;
|
|
20
|
+
/** Whether the attachment should render as a link tile. */
|
|
21
|
+
isLink: boolean;
|
|
20
22
|
/** Whether the attachment should render as an audio player tile. */
|
|
21
23
|
isAudio: boolean;
|
|
22
|
-
/** Whether action buttons (remove/retry) should always be shown, not just on hover/focus. */
|
|
23
|
-
areActionsVisible: boolean;
|
|
24
24
|
/** Icon component representing the attachment's type. */
|
|
25
|
-
BottomIcon: Icon;
|
|
25
|
+
BottomIcon: Icon | null;
|
|
26
26
|
/** Human-readable type/status label rendered next to `BottomIcon`. */
|
|
27
|
-
typeLabel: string;
|
|
28
|
-
/** CSS class(es) applied to the card for its current color state (error/selected/type). */
|
|
29
|
-
cardColorClass: string;
|
|
30
|
-
/** CSS class(es) applied to the remove/retry action buttons for the current state. */
|
|
31
|
-
removeBtnClass: string;
|
|
27
|
+
typeLabel: string | null;
|
|
32
28
|
}
|
|
33
29
|
/** CSS custom-property overrides for the `AttachmentCard` component. */
|
|
34
30
|
export interface AttachmentCardColors {
|
|
35
|
-
/**
|
|
36
|
-
border?: string;
|
|
37
|
-
/** Card background color in the default state. */
|
|
31
|
+
/** Tile background color in the default state. */
|
|
38
32
|
background?: string;
|
|
33
|
+
/** Tile border color in the default state. */
|
|
34
|
+
border?: string;
|
|
35
|
+
/** Tile border color on hover. */
|
|
36
|
+
borderHover?: string;
|
|
37
|
+
/** Tile focus outline color. */
|
|
38
|
+
focusOutline?: string;
|
|
39
|
+
/** Tile background color in the error state. */
|
|
40
|
+
backgroundError?: string;
|
|
41
|
+
/** Tile border color in the error state. */
|
|
42
|
+
borderError?: string;
|
|
43
|
+
/** File name/type text color in the error state. */
|
|
44
|
+
errorText?: string;
|
|
39
45
|
/** File name text color. */
|
|
40
46
|
nameText?: string;
|
|
41
|
-
/**
|
|
42
|
-
|
|
43
|
-
/** Card border color in the error state. */
|
|
44
|
-
borderError?: string;
|
|
45
|
-
/** Card background color in the selected state. */
|
|
46
|
-
backgroundSelected?: string;
|
|
47
|
-
/** Card border color in the selected state. */
|
|
48
|
-
borderSelected?: string;
|
|
49
|
-
/** Card background color on hover (prompt/pasted cards). */
|
|
50
|
-
backgroundHover?: string;
|
|
51
|
-
/** Loading overlay background color. */
|
|
52
|
-
loadingOverlayBackground?: string;
|
|
53
|
-
/** Action button (remove/retry/download) icon color. */
|
|
54
|
-
actionColor?: string;
|
|
55
|
-
/** Action button background color on hover. */
|
|
56
|
-
actionBackgroundHover?: string;
|
|
57
|
-
/** Focus outline color. */
|
|
58
|
-
focusOutline?: string;
|
|
59
|
-
/** Remove/retry button background color. */
|
|
60
|
-
removeBackground?: string;
|
|
61
|
-
/** Remove/retry button icon color. */
|
|
62
|
-
removeColor?: string;
|
|
47
|
+
/** Type/meta text color. */
|
|
48
|
+
typeText?: string;
|
|
63
49
|
/** Hover download icon background color. */
|
|
64
50
|
hoverIconBackground?: string;
|
|
65
51
|
/** Hover download icon color. */
|
|
66
52
|
hoverIconColor?: string;
|
|
53
|
+
/** Upload progress track background color. */
|
|
54
|
+
trackBackground?: string;
|
|
55
|
+
/** Upload progress indeterminate fill color. */
|
|
56
|
+
fillBackground?: string;
|
|
67
57
|
}
|
|
68
58
|
/** Typography overrides for the `AttachmentCard` component. */
|
|
69
59
|
export interface AttachmentCardTypography {
|
|
@@ -80,8 +70,6 @@ export interface AttachmentCardStyles {
|
|
|
80
70
|
colors?: AttachmentCardColors;
|
|
81
71
|
/** Typography overrides for text elements inside the card. */
|
|
82
72
|
typography?: AttachmentCardTypography;
|
|
83
|
-
/** Tailwind border-radius utility class applied to the card and its inner layers (e.g. `'rounded'`, `'rounded-lg'`). Defaults to `'rounded-xl'`. */
|
|
84
|
-
roundedClassName?: string;
|
|
85
73
|
/** Extra class name(s) merged onto the root element. */
|
|
86
74
|
className?: string;
|
|
87
75
|
}
|
|
@@ -99,6 +87,10 @@ export interface AttachmentCardLabels extends AttachmentTypeLabels {
|
|
|
99
87
|
loadingLabel?: string;
|
|
100
88
|
/** Status message announced to assistive tech when the upload fails. Defaults to `'Upload failed'`. */
|
|
101
89
|
uploadFailedStatusLabel?: string;
|
|
90
|
+
/** Accessible label for the download button. Defaults to `'Download attachment'`. */
|
|
91
|
+
downloadLabel?: string;
|
|
92
|
+
/** Accessible label for the open-in-new-tab button. Defaults to `'Open in new tab'`. */
|
|
93
|
+
openInNewTabLabel?: string;
|
|
102
94
|
}
|
|
103
95
|
/** Props accepted by the `AttachmentCard` component. */
|
|
104
96
|
export interface AttachmentCardProps {
|
|
@@ -112,22 +104,13 @@ export interface AttachmentCardProps {
|
|
|
112
104
|
onRetry?: (id: string) => void;
|
|
113
105
|
/** Called when the user clicks or activates a pasted-text card to expand its content back into the input. */
|
|
114
106
|
onExpand?: (id: string) => void;
|
|
115
|
-
/** Renders the card in selected state (accent border + tinted background). */
|
|
116
|
-
isSelected?: boolean;
|
|
117
|
-
/** Forces action buttons to be always visible regardless of hover/focus state. */
|
|
118
|
-
shouldAlwaysShowActions?: boolean;
|
|
119
107
|
/** Called when the user clicks or keyboard-activates the card. Receives the attachment `id`. */
|
|
120
108
|
onClick?: (id: string) => void;
|
|
121
109
|
/** Localised accessible labels for the remove/retry actions, the interactive card root, and the non-extension attachment type names (prompt/pasted/image). */
|
|
122
110
|
labels?: AttachmentCardLabels;
|
|
123
111
|
/** Color, typography, and shape overrides for the card. */
|
|
124
112
|
styles?: AttachmentCardStyles;
|
|
125
|
-
/**
|
|
126
|
-
|
|
127
|
-
* the existing whole-card click-to-download interaction. Opt-in so the
|
|
128
|
-
* composer (which uses remove/retry actions, not download) is unaffected.
|
|
129
|
-
* Defaults to `false`.
|
|
130
|
-
*/
|
|
131
|
-
showHoverDownloadIcon?: boolean;
|
|
113
|
+
/** Called when the user activates the download button. Receives the attachment `id`. */
|
|
114
|
+
onDownload?: (id: string) => void;
|
|
132
115
|
}
|
|
133
116
|
//# sourceMappingURL=attachment-card.d.ts.map
|
|
@@ -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,
|
|
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,CA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
1
|
-
import { AttachmentErrorReason,
|
|
1
|
+
import { AttachmentErrorReason, DisplayAttachment } from '@epam/ai-dial-chat-shared';
|
|
2
|
+
import { CSSProperties } from 'react';
|
|
2
3
|
import { AttachmentTypeLabels } from './attachment-card';
|
|
3
|
-
/** Localised labels for the `
|
|
4
|
-
export interface
|
|
4
|
+
/** Localised labels for the `FileAttachment` component. */
|
|
5
|
+
export interface FileAttachmentLabels extends AttachmentTypeLabels {
|
|
5
6
|
/** Accessible label for the download action. Defaults to `'Download attachment'`. */
|
|
6
7
|
clickLabel?: string;
|
|
7
8
|
/** Accessible label for the retry action. Defaults to `'Retry upload'`. */
|
|
@@ -15,69 +16,45 @@ export interface AttachmentFileRowLabels extends AttachmentTypeLabels {
|
|
|
15
16
|
/** Fallback error title used when `errorReason` is absent or has no entry in `errorReasonLabels`. Defaults to `'Upload failed'`. */
|
|
16
17
|
genericErrorLabel?: string;
|
|
17
18
|
}
|
|
18
|
-
/**
|
|
19
|
-
export interface
|
|
20
|
-
/** Tile background color in the default state. */
|
|
21
|
-
background?: string;
|
|
22
|
-
/** Tile border color in the default state. */
|
|
23
|
-
border?: string;
|
|
24
|
-
/** Tile border color on hover. */
|
|
25
|
-
borderHover?: string;
|
|
26
|
-
/** Tile focus outline color. */
|
|
27
|
-
focusOutline?: string;
|
|
28
|
-
/** Tile background color in the error state. */
|
|
29
|
-
backgroundError?: string;
|
|
30
|
-
/** Tile border color in the error state. */
|
|
31
|
-
borderError?: string;
|
|
32
|
-
/** File name/type text color in the error state. */
|
|
33
|
-
errorText?: string;
|
|
34
|
-
/** File name text color. */
|
|
35
|
-
nameText?: string;
|
|
36
|
-
/** Type/meta text color. */
|
|
37
|
-
typeText?: string;
|
|
38
|
-
/** Hover download icon background color. */
|
|
39
|
-
hoverIconBackground?: string;
|
|
40
|
-
/** Hover download icon color. */
|
|
41
|
-
hoverIconColor?: string;
|
|
42
|
-
/** Upload progress track background color. */
|
|
43
|
-
trackBackground?: string;
|
|
44
|
-
/** Upload progress indeterminate fill color. */
|
|
45
|
-
fillBackground?: string;
|
|
46
|
-
}
|
|
47
|
-
/** Typography overrides for the `AttachmentFileRow` component. */
|
|
48
|
-
export interface AttachmentFileRowTypography {
|
|
19
|
+
/** Typography overrides for the `FileAttachment` component. */
|
|
20
|
+
export interface FileAttachmentTypography {
|
|
49
21
|
/** Typography class applied to the file name text. Defaults to `'dial-caption-text'`. */
|
|
50
22
|
nameClassName?: string;
|
|
51
23
|
/** Typography class applied to the bottom meta label (file type / status). Defaults to `'dial-caption-text'`. */
|
|
52
24
|
metaClassName?: string;
|
|
53
|
-
/** Color overrides applied as CSS custom properties. */
|
|
54
|
-
colors?: AttachmentFileRowColors;
|
|
55
25
|
}
|
|
56
|
-
/** Style overrides for the `
|
|
57
|
-
export interface
|
|
58
|
-
/** Color overrides applied as CSS custom properties. */
|
|
59
|
-
colors?: AttachmentFileRowColors;
|
|
26
|
+
/** Style overrides for the `FileAttachment` component. */
|
|
27
|
+
export interface FileAttachmentStyles {
|
|
60
28
|
/** Typography overrides for the file name and meta label text. */
|
|
61
|
-
typography?:
|
|
29
|
+
typography?: FileAttachmentTypography;
|
|
62
30
|
/** Extra class name(s) merged onto the root element. */
|
|
63
31
|
className?: string;
|
|
64
32
|
}
|
|
65
|
-
/** Props accepted by the `
|
|
66
|
-
export interface
|
|
33
|
+
/** Props accepted by the `FileAttachment` component. */
|
|
34
|
+
export interface FileAttachmentProps {
|
|
67
35
|
/** The non-previewable attachment this row represents. */
|
|
68
36
|
attachment: DisplayAttachment;
|
|
69
37
|
/** Called when the user clicks the row or its download button. */
|
|
70
|
-
onClick?: (
|
|
38
|
+
onClick?: (id: string) => void;
|
|
71
39
|
/** Called when the user retries a failed upload. */
|
|
72
40
|
onRetry?: (id: string) => void;
|
|
41
|
+
/** Called when the user expands a pasted attachment. */
|
|
42
|
+
onExpand?: (id: string) => void;
|
|
43
|
+
/** Called when the user clicks the download button. */
|
|
44
|
+
onDownload?: (id: string) => void;
|
|
45
|
+
/** Called when the user clicks the remove button. */
|
|
46
|
+
onRemove?: (id: string) => void;
|
|
73
47
|
/** Localised labels for the download/retry actions, size text, and the non-extension attachment type names (prompt/pasted/image). */
|
|
74
|
-
labels?:
|
|
48
|
+
labels?: FileAttachmentLabels;
|
|
75
49
|
/** Style overrides for the row. */
|
|
76
|
-
styles?:
|
|
77
|
-
/**
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
50
|
+
styles?: FileAttachmentStyles;
|
|
51
|
+
/** Whether the attachment is pasted (vs. prompt). Defaults to `false`. */
|
|
52
|
+
isPasted?: boolean;
|
|
53
|
+
/** Whether the attachment is a link (vs. a file). Defaults to `false`. */
|
|
54
|
+
isLink?: boolean;
|
|
55
|
+
/** CSS custom properties applied to the root element. */
|
|
56
|
+
cssVars?: CSSProperties;
|
|
57
|
+
/** Whether the attachment is expandable (vs. clickable). Defaults to `false`. */
|
|
58
|
+
isExpandable?: boolean;
|
|
82
59
|
}
|
|
83
60
|
//# sourceMappingURL=attachment-file-row.d.ts.map
|
|
@@ -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,
|
|
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,CA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nB,0EAA0E;IAC1E,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,yDAAyD;IACzD,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,iFAAiF;IACjF,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DisplayAttachment } from '@epam/ai-dial-chat-shared';
|
|
2
2
|
import { AttachmentTypeLabels } from './attachment-card';
|
|
3
3
|
/** How the unified attachment tile grid should render for a given total attachment count. */
|
|
4
4
|
export declare enum AttachmentTilesLayout {
|
|
@@ -30,6 +30,8 @@ export interface AttachmentGroupLabels extends AttachmentTypeLabels {
|
|
|
30
30
|
showLessLabel?: string;
|
|
31
31
|
/** Label for the "download all" header action, shown whenever the group has 2+ attachments. Defaults to `'Download all'`. */
|
|
32
32
|
downloadAllLabel?: string;
|
|
33
|
+
/** Accessible label for each tile's open-in-new-tab button. Defaults to `'Open in new tab'`. */
|
|
34
|
+
openInNewTabLabel?: string;
|
|
33
35
|
/**
|
|
34
36
|
* Resolves the header count label (e.g. `'3 attachments'`) for a given
|
|
35
37
|
* attachment count. Defaults to English `'{count} attachment'` /
|
|
@@ -50,8 +52,6 @@ export interface AttachmentGroupColors {
|
|
|
50
52
|
export interface AttachmentGroupTypography {
|
|
51
53
|
/** Typography class applied to the header's attachment-count label. Defaults to `'dial-tiny-semi-text'`. */
|
|
52
54
|
headerLabelClassName?: string;
|
|
53
|
-
/** Color overrides applied as CSS custom properties. */
|
|
54
|
-
colors?: AttachmentGroupColors;
|
|
55
55
|
}
|
|
56
56
|
/** Style overrides for the `AttachmentGroup` component. */
|
|
57
57
|
export interface AttachmentGroupStyles {
|
|
@@ -67,7 +67,7 @@ export interface AttachmentGroupProps {
|
|
|
67
67
|
/** The message's full attachment list (images and files together). */
|
|
68
68
|
attachments: DisplayAttachment[];
|
|
69
69
|
/** Called when the user clicks/activates a previewable image tile or a file row (downloads it). */
|
|
70
|
-
onAttachmentClick?: (
|
|
70
|
+
onAttachmentClick?: (id: string) => void;
|
|
71
71
|
/**
|
|
72
72
|
* Called with every currently downloadable attachment when the user
|
|
73
73
|
* activates the "download all" header action. Falls back to invoking
|
|
@@ -76,17 +76,9 @@ export interface AttachmentGroupProps {
|
|
|
76
76
|
onDownloadAll?: (attachments: DisplayAttachment[]) => void;
|
|
77
77
|
/** Called when the user retries a failed upload. */
|
|
78
78
|
onRetry?: (id: string) => void;
|
|
79
|
-
/** Resolves the human-readable size label for an attachment, when derivable. Omitted from display when absent. */
|
|
80
|
-
getSizeLabel?: (attachment: DisplayAttachment) => string | undefined;
|
|
81
79
|
/** Localised accessible labels for the group region, its actions, and the non-extension attachment type names (prompt/pasted/image), forwarded to each tile. */
|
|
82
80
|
labels?: AttachmentGroupLabels;
|
|
83
81
|
/** Style overrides for the group. */
|
|
84
82
|
styles?: AttachmentGroupStyles;
|
|
85
|
-
/**
|
|
86
|
-
* File tile surface color theme, matching the markdown code block's own
|
|
87
|
-
* light/dark surface (never plain white). Forwarded to each
|
|
88
|
-
* non-previewable file tile. Defaults to `'dark'`.
|
|
89
|
-
*/
|
|
90
|
-
theme?: CodeBlockTheme;
|
|
91
83
|
}
|
|
92
84
|
//# sourceMappingURL=attachment-group.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachment-group.d.ts","sourceRoot":"","sources":["../../src/models/attachment-group.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"attachment-group.d.ts","sourceRoot":"","sources":["../../src/models/attachment-group.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE9D,6FAA6F;AAC7F,oBAAY,qBAAqB;IAC/B,sBAAsB;IACtB,IAAI,SAAS;IACb,mEAAmE;IACnE,UAAU,gBAAgB;IAC1B,oFA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E,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;CAChC"}
|
|
@@ -26,7 +26,7 @@ export interface AttachmentTrayProps {
|
|
|
26
26
|
/** Called when the user clicks a pasted-text card to expand its content back into the input. */
|
|
27
27
|
onExpand?: (id: string) => void;
|
|
28
28
|
/** Called when the user clicks or keyboard-activates an attachment card. Receives the full `DisplayAttachment` object. */
|
|
29
|
-
onAttachmentClick?: (
|
|
29
|
+
onAttachmentClick?: (id: string) => void;
|
|
30
30
|
/** Localised accessible labels for the tray region and each card's interactive elements. */
|
|
31
31
|
labels?: AttachmentTrayLabels;
|
|
32
32
|
/** Style overrides for the tray. */
|
|
@@ -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;AAEnE,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;CACrB;AAED,0DAA0D;AAC1D,MAAM,WAAW,oBAAoB;IACnC,wDAA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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,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.0.0-dev.
|
|
4
|
+
"version": "1.0.0-dev.515",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
|
-
"@epam/ai-dial-chat-shared": "1.0.0-dev.
|
|
20
|
+
"@epam/ai-dial-chat-shared": "1.0.0-dev.515",
|
|
21
21
|
"@epam/ai-dial-ui-kit": "0.12.0-dev.28",
|
|
22
22
|
"@tabler/icons-react": "^3.44.0",
|
|
23
23
|
"react": "^19.0.0"
|
package/utils/attachment.d.ts
CHANGED
|
@@ -42,8 +42,8 @@ export declare const isMimeTypeAllowed: (mimeType: string, allowedTypes: string[
|
|
|
42
42
|
export declare const getAttachmentIcon: (contentType: string) => Icon;
|
|
43
43
|
/** Derives a bare file extension (no leading dot) from a MIME type, e.g. `'application/pdf'` -> `'pdf'`. */
|
|
44
44
|
export declare const getExtFromContentType: (contentType: string) => string | undefined;
|
|
45
|
-
/** Derives the display state (icons, labels, color classes) an AttachmentCard
|
|
46
|
-
export declare const getAttachmentCardState: (attachment: DisplayAttachment,
|
|
45
|
+
/** Derives the display state (icons, labels, color classes) an AttachmentCard needs to render a given attachment. */
|
|
46
|
+
export declare const getAttachmentCardState: (attachment: DisplayAttachment, typeLabels?: AttachmentTypeLabels) => AttachmentCardState;
|
|
47
47
|
/** Decides how the unified tile grid should render for `totalCount` attachments, given whether the group is expanded. */
|
|
48
48
|
export declare const getAttachmentTilesPlan: (totalCount: number, isExpanded: boolean) => AttachmentTilesPlan;
|
|
49
49
|
//# sourceMappingURL=attachment.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachment.d.ts","sourceRoot":"","sources":["../../src/utils/attachment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"attachment.d.ts","sourceRoot":"","sources":["../../src/utils/attachment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAMnE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAoChD,OAAO,KAAK,EACV,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,4BAA4B,CAAC;AAEpC;;;GAGG;AACH,eAAO,MAAM,oBAAoB,QAAO,MACgB,CAAC;AAEzD;;GAEG;AACH,eAAO,MAAM,uBAAuB,GAAI,MAAM,MAAM,KAAG,MAGtD,CAAC;AASF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,0BAA0B,GACrC,OAAO,MAAM,EAAE,EACf,iBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAwB,KAC5D,MAUF,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,GAC5B,UAAU,MAAM,EAChB,cAAc,MAAM,EAAE,KACrB,OAUF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAI,aAAa,MAAM,KAAG,IA0FvD,CAAC;AAUF,4GAA4G;AAC5G,eAAO,MAAM,qBAAqB,GAChC,aAAa,MAAM,KAClB,MAAM,GAAG,SAUX,CAAC;AA0BF,qHAAqH;AACrH,eAAO,MAAM,sBAAsB,GACjC,YAAY,iBAAiB,EAC7B,aAAY,oBAAyB,KACpC,mBAmBF,CAAC;AAEF,yHAAyH;AACzH,eAAO,MAAM,sBAAsB,GACjC,YAAY,MAAM,EAClB,YAAY,OAAO,KAClB,mBAoBF,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AttachmentFileRow.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentFileRow/AttachmentFileRow.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,KAAK,EAAE,EAA8C,MAAM,OAAO,CAAC;AAC5E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAU/E;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CAqOxD,CAAC"}
|