@epam/ai-dial-conversation-input 1.2.0-dev.98 → 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.
- package/components/AddAttachmentButton/AddAttachmentButton.d.ts +6 -0
- package/components/AddAttachmentButton/AddAttachmentButton.d.ts.map +1 -1
- package/components/BottomSheetShell/BottomSheetShell.d.ts +2 -2
- package/components/BottomSheetShell/BottomSheetShell.d.ts.map +1 -1
- package/components/ChatSettingsFields/ChatSettingsFields.d.ts.map +1 -1
- package/components/ChatSettingsModal/ChatSettingsModal.d.ts.map +1 -1
- package/components/ConversationInput/ConversationInput.d.ts.map +1 -1
- package/components/EditMessageInput/EditMessageInput.d.ts.map +1 -1
- package/components/Input/Input.d.ts +2 -3
- package/components/Input/Input.d.ts.map +1 -1
- package/components/Input/ModelSelectorControl.d.ts +3 -1
- package/components/Input/ModelSelectorControl.d.ts.map +1 -1
- package/components/ModelSelectorBottomSheet/ModelSelectorBottomSheet.d.ts +3 -0
- package/components/ModelSelectorBottomSheet/ModelSelectorBottomSheet.d.ts.map +1 -1
- package/components/ToolsChips/ToolsChips.d.ts +11 -0
- package/components/ToolsChips/ToolsChips.d.ts.map +1 -1
- package/components/VoiceBar/VoiceBar.d.ts +1 -3
- package/components/VoiceBar/VoiceBar.d.ts.map +1 -1
- package/hooks/useAttachments.d.ts +8 -1
- package/hooks/useAttachments.d.ts.map +1 -1
- package/hooks/useCommandMenu/useCommandMenu.d.ts +35 -5
- package/hooks/useCommandMenu/useCommandMenu.d.ts.map +1 -1
- package/hooks/useComposerSeed.d.ts +32 -0
- package/hooks/useComposerSeed.d.ts.map +1 -0
- package/hooks/useMentionSelectionMirror.d.ts +22 -0
- package/hooks/useMentionSelectionMirror.d.ts.map +1 -0
- package/hooks/useModelSelector.d.ts +7 -13
- package/hooks/useModelSelector.d.ts.map +1 -1
- package/hooks/useTextInsertion.d.ts +7 -1
- package/hooks/useTextInsertion.d.ts.map +1 -1
- package/hooks/useVoiceRecorder.d.ts.map +1 -1
- package/index.css +2 -2
- package/index.d.ts +3 -1
- package/index.d.ts.map +1 -1
- package/index.js +1574 -1311
- package/models/ConversationInput.d.ts +89 -17
- package/models/ConversationInput.d.ts.map +1 -1
- package/models/Input.d.ts +195 -41
- package/models/Input.d.ts.map +1 -1
- package/package.json +4 -5
- package/utils/highlight-mirror.d.ts +17 -0
- package/utils/highlight-mirror.d.ts.map +1 -0
- package/hooks/useBottomSheet.d.ts +0 -9
- package/hooks/useBottomSheet.d.ts.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AttachmentTrayStyles } from '@epam/ai-dial-attachment-input';
|
|
2
2
|
import { Attachment, AttachmentErrorReason, DeploymentItem, DisplayAttachment, ToolMenuItem, UploadedAttachmentResult } from '@epam/ai-dial-chat-shared';
|
|
3
3
|
import { ReactNode } from 'react';
|
|
4
|
-
import { ActionRowLayout, ChatSettingsConfig, CommandMenuConfig, InputColors, InputTypography, MenuOverlayConfig, ModelSelectorLabels, SendOnEnter, TextInsertion, ToolsChipLabels } from './Input';
|
|
4
|
+
import { ActionRowLayout, ChatSettingsConfig, CommandMenuConfig, HighlightedTextRange, InputColors, InputTypography, MenuOverlayConfig, ModelMenuStyles, ModelSelectorLabels, SendOnEnter, TextInsertion, ToolsChipLabels } from './Input';
|
|
5
5
|
import { TranscribeAudio } from './Voice';
|
|
6
6
|
/** CSS custom-property overrides for the `ConversationInput` component. */
|
|
7
7
|
export interface ConversationInputColors {
|
|
@@ -34,23 +34,64 @@ export interface ConversationInputStyles {
|
|
|
34
34
|
* `ATTACHMENT_INPUT_CLASS`.
|
|
35
35
|
*/
|
|
36
36
|
attachmentTray?: AttachmentTrayStyles;
|
|
37
|
+
/**
|
|
38
|
+
* Styling hooks for the model menu in both presentations — the desktop
|
|
39
|
+
* dropdown and the mobile sheet — so a host restyles its panel, search row
|
|
40
|
+
* and selected row without a descendant selector on
|
|
41
|
+
* `CONVERSATION_INPUT_CLASS.modelMenu*`.
|
|
42
|
+
*/
|
|
43
|
+
modelMenu?: ModelMenuStyles;
|
|
37
44
|
}
|
|
38
45
|
/** Props accepted by the `EditMessageInput` component. */
|
|
39
46
|
export interface EditMessageInputProps {
|
|
40
47
|
/** Initial message text pre-populated in the textarea. */
|
|
41
48
|
message?: string;
|
|
42
49
|
/**
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
50
|
+
* Optional token that forces the textarea to resync from `message`, even
|
|
51
|
+
* when `message` itself is the same string as before (e.g. the host
|
|
52
|
+
* spliced a mention into its own copy of the draft at a known position and
|
|
53
|
+
* needs the textarea to adopt it). Forwarded to the inner `Input`.
|
|
54
|
+
*/
|
|
55
|
+
messageRevision?: number;
|
|
56
|
+
/**
|
|
57
|
+
* Called with the textarea's current value on every change (typing,
|
|
58
|
+
* deleting, pasting, undo/redo) — not only on save. A host tracking live
|
|
59
|
+
* state derived from the draft (e.g. skill-mention anchors that must
|
|
60
|
+
* reconcile as the user edits around them) wires this; omit it to ignore
|
|
61
|
+
* keystrokes between saves.
|
|
46
62
|
*/
|
|
47
|
-
|
|
63
|
+
onChange?: (message: string) => void;
|
|
48
64
|
/**
|
|
49
|
-
*
|
|
50
|
-
*
|
|
65
|
+
* Ranges of `message` rendered as highlighted runs (e.g. a restored skill
|
|
66
|
+
* mention). Forwarded to the inner `Input`.
|
|
67
|
+
*/
|
|
68
|
+
activeMentions?: HighlightedTextRange[];
|
|
69
|
+
/**
|
|
70
|
+
* Called on Backspace with the caret collapsed at some position, to ask
|
|
71
|
+
* whether a tracked range ends exactly there — see `Input`'s prop of the
|
|
72
|
+
* same name. Forwarded to the inner `Input`.
|
|
73
|
+
*/
|
|
74
|
+
onBackspaceAtCaret?: (caretPosition: number) => HighlightedTextRange | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* One-shot caret placement applied whenever the internal message resyncs
|
|
77
|
+
* from a new `message` value (e.g. right after inserting a mention).
|
|
51
78
|
* Forwarded to the inner `Input`.
|
|
52
79
|
*/
|
|
53
|
-
|
|
80
|
+
caretPositionOverride?: number;
|
|
81
|
+
/**
|
|
82
|
+
* Host-injected slash-command menu, forwarded to the inner `Input` — see
|
|
83
|
+
* `Input`'s prop of the same name. Absent disables the mechanism during
|
|
84
|
+
* edit.
|
|
85
|
+
*/
|
|
86
|
+
commandMenu?: CommandMenuConfig;
|
|
87
|
+
/**
|
|
88
|
+
* Host-injected overlay entries for the `+` menu. `EditMessageInput` hides
|
|
89
|
+
* the inner `Input`'s own footer (`hideActionBar`) and renders its own
|
|
90
|
+
* external `AddAttachmentButton` instead, so these entries are forwarded to
|
|
91
|
+
* that button, not to `Input`. Absent renders no add-menu overlay entries
|
|
92
|
+
* during edit.
|
|
93
|
+
*/
|
|
94
|
+
menuOverlays?: MenuOverlayConfig[];
|
|
54
95
|
/** Pre-existing attachments from the original message, shown in the attachment tray. */
|
|
55
96
|
initialAttachments?: DisplayAttachment[];
|
|
56
97
|
/** Called when the user clicks the Cancel button. */
|
|
@@ -71,6 +112,10 @@ export interface EditMessageInputProps {
|
|
|
71
112
|
retryLabel?: string;
|
|
72
113
|
/** Accessible label for each attachment card's in-progress upload progress bar. Defaults to `'Uploading'`. */
|
|
73
114
|
uploadingLabel?: string;
|
|
115
|
+
/** Accessible name of each pasted-text attachment card, which expands its text back into the composer when activated. Defaults to `'Expand pasted text'`. */
|
|
116
|
+
expandLabel?: string;
|
|
117
|
+
/** Accessible name of each non-pasted attachment card when `onAttachmentClick` makes it interactive. Name it after what the host handler does (e.g. opening the attachment in a canvas). When omitted, the card default applies (`'Open attachment'` on image tiles, `'Download attachment'` on file and link tiles). Pasted-text cards keep `expandLabel`. */
|
|
118
|
+
clickLabel?: string;
|
|
74
119
|
/** Accessible label for the add-menu trigger button. */
|
|
75
120
|
addMenuTitle?: string;
|
|
76
121
|
/** Label for the attach-file menu item. */
|
|
@@ -157,6 +202,8 @@ export interface EditMessageInputProps {
|
|
|
157
202
|
}
|
|
158
203
|
/** Props accepted by the `ConversationInput` component. */
|
|
159
204
|
export interface ConversationInputProps {
|
|
205
|
+
/** Changing this token requests textarea focus without altering its value or caret. */
|
|
206
|
+
focusRequestId?: number;
|
|
160
207
|
/** Placeholder text shown inside the textarea when empty. */
|
|
161
208
|
placeholder?: string;
|
|
162
209
|
/**
|
|
@@ -184,6 +231,14 @@ export interface ConversationInputProps {
|
|
|
184
231
|
* when `message` itself is the same string as before.
|
|
185
232
|
*/
|
|
186
233
|
messageRevision?: number;
|
|
234
|
+
/**
|
|
235
|
+
* Called with the textarea's current value on every change (typing,
|
|
236
|
+
* deleting, pasting, undo/redo) — not only on send. A host tracking live
|
|
237
|
+
* state derived from the draft (e.g. skill-mention anchors that must
|
|
238
|
+
* reconcile as the user edits around them) wires this; omit it to ignore
|
|
239
|
+
* keystrokes between sends, as before this prop existed.
|
|
240
|
+
*/
|
|
241
|
+
onChange?: (message: string) => void;
|
|
187
242
|
/**
|
|
188
243
|
* Text inserted at the caret each time its `revision` changes, leaving the
|
|
189
244
|
* surrounding draft intact. Unlike `message`, this never replaces what the
|
|
@@ -195,6 +250,8 @@ export interface ConversationInputProps {
|
|
|
195
250
|
welcomeText?: string;
|
|
196
251
|
/** Optional description text rendered below the welcome heading. Ignored when `welcomeText` is absent. */
|
|
197
252
|
descriptionText?: string;
|
|
253
|
+
/** Slot rendered between the welcome heading and the input, e.g. conversation starters. */
|
|
254
|
+
belowWelcomeSlot?: ReactNode;
|
|
198
255
|
/** Called when the user submits a message (Enter or send button). Receives the current local attachments as the second argument. */
|
|
199
256
|
onSend?: (message: string, attachments: Attachment[]) => void;
|
|
200
257
|
/** Called immediately after an attachment is added. Returns the uploaded attachment URL and stored name. */
|
|
@@ -253,7 +310,17 @@ export interface ConversationInputProps {
|
|
|
253
310
|
retryLabel?: string;
|
|
254
311
|
/** Accessible label for each attachment card's in-progress upload progress bar. Defaults to `'Uploading'`. */
|
|
255
312
|
uploadingLabel?: string;
|
|
256
|
-
/**
|
|
313
|
+
/** Accessible name of each pasted-text attachment card, which expands its text back into the composer when activated. Defaults to `'Expand pasted text'`. */
|
|
314
|
+
expandLabel?: string;
|
|
315
|
+
/** Accessible name of each non-pasted attachment card when `onAttachmentClick` makes it interactive. Name it after what the host handler does (e.g. opening the attachment in a canvas). When omitted, the card default applies (`'Open attachment'` on image tiles, `'Download attachment'` on file and link tiles). Pasted-text cards keep `expandLabel`. */
|
|
316
|
+
clickLabel?: string;
|
|
317
|
+
/**
|
|
318
|
+
* When `true`, blocks typing, the attach menu, dictation, Enter-to-send,
|
|
319
|
+
* and dropped files (`pendingDropFiles` are consumed and discarded, never
|
|
320
|
+
* added to the tray). The send button still submits a message that is
|
|
321
|
+
* already populated (e.g. by a starter). Starter/action buttons and the
|
|
322
|
+
* model selector remain usable. Defaults to `false`.
|
|
323
|
+
*/
|
|
257
324
|
isInputDisabled?: boolean;
|
|
258
325
|
/**
|
|
259
326
|
* When `true`, the model selector renders in a disabled, non-interactive
|
|
@@ -404,17 +471,22 @@ export interface ConversationInputProps {
|
|
|
404
471
|
*/
|
|
405
472
|
menuOverlays?: MenuOverlayConfig[];
|
|
406
473
|
/**
|
|
407
|
-
*
|
|
408
|
-
*
|
|
409
|
-
* below. Forwarded to the inner `Input`.
|
|
474
|
+
* Ranges of `message` rendered as highlighted runs (e.g. a tracked skill
|
|
475
|
+
* mention). Forwarded to the inner `Input`.
|
|
410
476
|
*/
|
|
411
|
-
|
|
477
|
+
activeMentions?: HighlightedTextRange[];
|
|
412
478
|
/**
|
|
413
|
-
* Called
|
|
414
|
-
*
|
|
415
|
-
* to the inner `Input`.
|
|
479
|
+
* Called on Backspace with the caret collapsed at some position, to ask
|
|
480
|
+
* whether a tracked range ends exactly there — see `Input`'s prop of the
|
|
481
|
+
* same name. Forwarded to the inner `Input`.
|
|
482
|
+
*/
|
|
483
|
+
onBackspaceAtCaret?: (caretPosition: number) => HighlightedTextRange | undefined;
|
|
484
|
+
/**
|
|
485
|
+
* One-shot caret placement applied whenever the internal message resyncs
|
|
486
|
+
* from a new `message` value (e.g. right after inserting a mention).
|
|
487
|
+
* Forwarded to the inner `Input`.
|
|
416
488
|
*/
|
|
417
|
-
|
|
489
|
+
caretPositionOverride?: number;
|
|
418
490
|
/**
|
|
419
491
|
* Host-injected slash-command menu: typing `triggerPrefix` as the first
|
|
420
492
|
* character of an empty textarea — or pasting into an empty textarea a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConversationInput.d.ts","sourceRoot":"","sources":["../../src/models/ConversationInput.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,KAAK,EACV,UAAU,EACV,qBAAqB,EACrB,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,wBAAwB,EACzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EACV,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,WAAW,EACX,aAAa,EACb,eAAe,EAChB,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,2EAA2E;AAC3E,MAAM,WAAW,uBAAuB;IACtC,kCAAkC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+DAA+D;IAC/D,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gEAAgE;IAChE,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB;AAED,kEAAkE;AAClE,MAAM,WAAW,2BAA2B;IAC1C,qGAAqG;IACrG,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,4GAA4G;IAC5G,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,qEAAqE;IACrE,KAAK,CAAC,EAAE,eAAe,CAAC;CACzB;AAED,qFAAqF;AACrF,MAAM,WAAW,uBAAuB;IACtC,wDAAwD;IACxD,MAAM,CAAC,EAAE,uBAAuB,CAAC;IACjC,8DAA8D;IAC9D,UAAU,CAAC,EAAE,2BAA2B,CAAC;IACzC;;;;;OAKG;IACH,cAAc,CAAC,EAAE,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"ConversationInput.d.ts","sourceRoot":"","sources":["../../src/models/ConversationInput.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,KAAK,EACV,UAAU,EACV,qBAAqB,EACrB,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,wBAAwB,EACzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EACV,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,WAAW,EACX,aAAa,EACb,eAAe,EAChB,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,2EAA2E;AAC3E,MAAM,WAAW,uBAAuB;IACtC,kCAAkC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+DAA+D;IAC/D,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gEAAgE;IAChE,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB;AAED,kEAAkE;AAClE,MAAM,WAAW,2BAA2B;IAC1C,qGAAqG;IACrG,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,4GAA4G;IAC5G,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,qEAAqE;IACrE,KAAK,CAAC,EAAE,eAAe,CAAC;CACzB;AAED,qFAAqF;AACrF,MAAM,WAAW,uBAAuB;IACtC,wDAAwD;IACxD,MAAM,CAAC,EAAE,uBAAuB,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AAS,CAAC;IACtC;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAChC,4IAA4I;IAC5I,eAAe,CAAC,EAAE,SAAS,CAAC;IAC5B;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1D"}
|
package/models/Input.d.ts
CHANGED
|
@@ -40,12 +40,18 @@ export interface InputColors {
|
|
|
40
40
|
modelSelectorName?: string;
|
|
41
41
|
/** Model-selector chip version text color (desktop only). Defaults to `--text-secondary`. */
|
|
42
42
|
modelSelectorVersion?: string;
|
|
43
|
-
/** Voice bar
|
|
44
|
-
voiceError?: string;
|
|
45
|
-
/** Voice bar waveform and timer text color. Defaults to `--text-primary`. */
|
|
43
|
+
/** Voice bar waveform color. Defaults to `--text-primary`. */
|
|
46
44
|
voiceWaveform?: string;
|
|
47
|
-
/** Voice bar
|
|
45
|
+
/** Voice bar recording-dot color. Defaults to `--text-error`. */
|
|
48
46
|
voiceAccent?: string;
|
|
47
|
+
/** Background color of a tracked skill mention's highlighted run. Defaults to `--bg-control-accent-alpha`. */
|
|
48
|
+
mentionHighlightBg?: string;
|
|
49
|
+
/** Text color of a tracked skill mention's highlighted run. Defaults to `--text-accent`. */
|
|
50
|
+
mentionHighlightText?: string;
|
|
51
|
+
/** Background color of a tracked skill mention's highlighted run while unsupported. Defaults to `--bg-error`. */
|
|
52
|
+
mentionHighlightUnsupportedBg?: string;
|
|
53
|
+
/** Text color of a tracked skill mention's highlighted run while unsupported. Defaults to `--text-error`. */
|
|
54
|
+
mentionHighlightUnsupportedText?: string;
|
|
49
55
|
}
|
|
50
56
|
/** Typography overrides for the `Input` component. */
|
|
51
57
|
export interface InputTypography {
|
|
@@ -69,10 +75,51 @@ export interface ModelSelectorLabels {
|
|
|
69
75
|
/** Tooltip shown when the selected deployment is no longer available (e.g. removed from the catalog). Defaults to `'This deployment is no longer available'`. */
|
|
70
76
|
unavailableTooltip?: string;
|
|
71
77
|
}
|
|
78
|
+
/** Color overrides for the model menu, applied as CSS custom properties. */
|
|
79
|
+
export interface ModelMenuColors {
|
|
80
|
+
/**
|
|
81
|
+
* Background of the search row above the deployment list. Defaults to
|
|
82
|
+
* `--bg-layer-raised` in the desktop dropdown, where the row is sticky over
|
|
83
|
+
* scrolling items, and to transparent in the mobile sheet.
|
|
84
|
+
*/
|
|
85
|
+
searchHeaderBackground?: string;
|
|
86
|
+
/** Label and icon color of every deployment row. Defaults to `--text-primary`. */
|
|
87
|
+
itemText?: string;
|
|
88
|
+
/** Background of a hovered deployment row. Defaults to `--bg-control-accent-alpha-hover` on desktop and `--bg-layer-raised` in the sheet. */
|
|
89
|
+
itemHoverBackground?: string;
|
|
90
|
+
/** Background of the selected deployment row at rest. Defaults to none. */
|
|
91
|
+
selectedItemBackground?: string;
|
|
92
|
+
/** Label color of the selected deployment row. Defaults to `itemText`. */
|
|
93
|
+
selectedItemText?: string;
|
|
94
|
+
/** Color of the check mark on the selected row. Defaults to the row's text color on desktop and `--text-accent` in the sheet. */
|
|
95
|
+
checkIcon?: string;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Styling hooks for the model menu, applied in both presentations: the desktop
|
|
99
|
+
* dropdown and the mobile bottom sheet. Every class is merged after the
|
|
100
|
+
* component's own, so a conflicting utility replaces the default rather than
|
|
101
|
+
* landing beside it.
|
|
102
|
+
*/
|
|
103
|
+
export interface ModelMenuStyles {
|
|
104
|
+
/** Class on the menu panel: the dropdown overlay on desktop, the sheet on mobile. Also applied when `modelPickerOverlay` supplies the content. */
|
|
105
|
+
className?: string;
|
|
106
|
+
/** Class on the search row above the deployment list. */
|
|
107
|
+
searchHeaderClassName?: string;
|
|
108
|
+
/** Class on every deployment row. */
|
|
109
|
+
itemClassName?: string;
|
|
110
|
+
/** Class on the currently selected deployment row, additive to `itemClassName`. */
|
|
111
|
+
selectedItemClassName?: string;
|
|
112
|
+
/** Color overrides applied as CSS custom properties. */
|
|
113
|
+
colors?: ModelMenuColors;
|
|
114
|
+
}
|
|
72
115
|
/** Labels for the tool chips rendered in the conversation input. */
|
|
73
116
|
export interface ToolsChipLabels {
|
|
74
117
|
/** Returns the accessible label for a chip's × button, which drops the tool from the input. Receives the tool label. Defaults to `"Remove {toolLabel}"`. */
|
|
75
118
|
removeLabel?: (toolLabel: string) => string;
|
|
119
|
+
/** Visible state text shown after the tool label while the tool is on, e.g. `"ON"`. Renders only when `stateOffLabel` is also set. */
|
|
120
|
+
stateOnLabel?: string;
|
|
121
|
+
/** Visible state text shown after the tool label while the tool is off, e.g. `"OFF"`. Renders only when `stateOnLabel` is also set. */
|
|
122
|
+
stateOffLabel?: string;
|
|
76
123
|
}
|
|
77
124
|
/** A host-injected overlay entry for the `+` menu: a menu item whose submenu renders host-owned content. */
|
|
78
125
|
export interface MenuOverlayConfig {
|
|
@@ -82,8 +129,18 @@ export interface MenuOverlayConfig {
|
|
|
82
129
|
title: string;
|
|
83
130
|
/** Icon node rendered to the left of the menu-item label. */
|
|
84
131
|
icon: ReactNode;
|
|
85
|
-
/**
|
|
86
|
-
|
|
132
|
+
/**
|
|
133
|
+
* Renders the overlay panel content. Receives a callback the panel calls to
|
|
134
|
+
* close the whole menu once selection is complete, and the textarea's
|
|
135
|
+
* caret offset at the moment the overlay opened (0 when it cannot be
|
|
136
|
+
* determined) — e.g. so a selection made here can splice text in at that
|
|
137
|
+
* exact position via `message`/`messageRevision`/`caretPositionOverride`.
|
|
138
|
+
* The content is mounted inside a `role="menu"` container — the desktop
|
|
139
|
+
* submenu panel or the mobile sheet's wrapper — so selectable rows should
|
|
140
|
+
* be `role="menuitem"`: those are the rows the desktop submenu's
|
|
141
|
+
* ArrowUp/ArrowDown/Home/End navigation moves between.
|
|
142
|
+
*/
|
|
143
|
+
renderOverlay: (onClose: () => void, caretPosition: number) => ReactNode;
|
|
87
144
|
/** Accessible label for the back arrow in the mobile stacked bottom sheet. Defaults to `'Back'`. */
|
|
88
145
|
backLabel?: string;
|
|
89
146
|
}
|
|
@@ -91,18 +148,44 @@ export interface MenuOverlayConfig {
|
|
|
91
148
|
export interface CommandMenuContext {
|
|
92
149
|
/** Current query: the value typed after the trigger prefix, with no whitespace or second prefix character. */
|
|
93
150
|
query: string;
|
|
151
|
+
/** Character offset where the triggering word (prefix + query) starts in the textarea's current value. */
|
|
152
|
+
caretPosition: number;
|
|
94
153
|
/**
|
|
95
|
-
* Closes the menu.
|
|
96
|
-
* prefix and query from the textarea
|
|
97
|
-
*
|
|
154
|
+
* Closes the menu. `{ consumeQuery: true }` also removes the trigger
|
|
155
|
+
* prefix and query from the textarea; `{ returnFocus: false }` skips
|
|
156
|
+
* refocusing the textarea (see the host's own doc for when to use it).
|
|
98
157
|
*/
|
|
99
158
|
close: (options?: {
|
|
100
159
|
consumeQuery?: boolean;
|
|
160
|
+
returnFocus?: boolean;
|
|
101
161
|
}) => void;
|
|
162
|
+
/**
|
|
163
|
+
* Id the menu puts on its `role="listbox"` element. The textarea references
|
|
164
|
+
* it through `aria-controls` while the menu is open.
|
|
165
|
+
*/
|
|
166
|
+
listboxId: string;
|
|
167
|
+
/**
|
|
168
|
+
* Id of the option the keyboard currently has active, or `null` when none
|
|
169
|
+
* is. The textarea moves it through the menu's `role="option"` elements
|
|
170
|
+
* with ArrowDown/ArrowUp (wrapping at the ends) and exposes it through
|
|
171
|
+
* `aria-activedescendant`; the menu marks the matching option with
|
|
172
|
+
* `aria-selected="true"` and a visible highlight. Enter clicks the active
|
|
173
|
+
* option, so an option's `onClick` is its selection path for mouse and
|
|
174
|
+
* keyboard alike. Options must carry unique `id`s; one with
|
|
175
|
+
* `aria-disabled="true"` is skipped. Reset whenever the query changes.
|
|
176
|
+
*/
|
|
177
|
+
activeOptionId: string | null;
|
|
102
178
|
}
|
|
103
|
-
/**
|
|
179
|
+
/**
|
|
180
|
+
* Host-injected slash-command menu: an overlay opened by entering a trigger
|
|
181
|
+
* prefix as its own word anywhere in the textarea. While it is open the
|
|
182
|
+
* textarea drives it as a list autocomplete: ArrowDown/ArrowUp move the
|
|
183
|
+
* active option (instead of navigating message history), Enter takes the
|
|
184
|
+
* active option and never sends the message, and Escape closes the menu
|
|
185
|
+
* keeping the text.
|
|
186
|
+
*/
|
|
104
187
|
export interface CommandMenuConfig {
|
|
105
|
-
/** Prefix that opens the menu when
|
|
188
|
+
/** Prefix that opens the menu when it starts a whitespace-delimited word (e.g. `'/'`) — typed as the word's first character, or arriving in a paste that produces such a word. */
|
|
106
189
|
triggerPrefix: string;
|
|
107
190
|
/** Renders the menu content for the current query. */
|
|
108
191
|
renderMenu: (ctx: CommandMenuContext) => ReactNode;
|
|
@@ -115,6 +198,35 @@ export interface CommandMenuConfig {
|
|
|
115
198
|
/** Accessible name for the menu region. When absent, the content is rendered without a labeled wrapper. */
|
|
116
199
|
menuLabel?: string;
|
|
117
200
|
}
|
|
201
|
+
/**
|
|
202
|
+
* A range within `Input`'s current `message` text, rendered as a highlighted
|
|
203
|
+
* run (e.g. a skill mention's `/{name}` text). Positional only — beyond
|
|
204
|
+
* placement, `Input` attaches no meaning to what a range represents.
|
|
205
|
+
*/
|
|
206
|
+
export interface HighlightedTextRange {
|
|
207
|
+
/** Character offset where the highlighted run starts. */
|
|
208
|
+
start: number;
|
|
209
|
+
/** Length of the highlighted run. */
|
|
210
|
+
length: number;
|
|
211
|
+
/**
|
|
212
|
+
* Renders the run in its error styling instead of the default highlight
|
|
213
|
+
* (e.g. a skill mention selected on a deployment that doesn't support
|
|
214
|
+
* skills). Ignored when `render` is provided — the renderer owns its own
|
|
215
|
+
* error styling. Defaults to `false`.
|
|
216
|
+
*/
|
|
217
|
+
isUnsupported?: boolean;
|
|
218
|
+
/**
|
|
219
|
+
* Renders this range as host-owned content (e.g. `ChatSkill`, the same
|
|
220
|
+
* interactive chip a sent message renders it as) instead of the default
|
|
221
|
+
* highlight span. Unlike the rest of the mirror — which duplicates the
|
|
222
|
+
* textarea's own text purely for visual highlighting and stays inert
|
|
223
|
+
* (`pointer-events: none`, `aria-hidden`) — the returned node is rendered
|
|
224
|
+
* with real pointer events and outside `aria-hidden`, so hover/focus/click
|
|
225
|
+
* (a tooltip, a "View details" action) work exactly as they do once the
|
|
226
|
+
* mention is part of sent history.
|
|
227
|
+
*/
|
|
228
|
+
render?: () => ReactNode;
|
|
229
|
+
}
|
|
118
230
|
/** One-shot text hand-off that the `Input` inserts at the caret. */
|
|
119
231
|
export interface TextInsertion {
|
|
120
232
|
/** Text inserted at the caret, replacing whatever is selected. */
|
|
@@ -122,8 +234,20 @@ export interface TextInsertion {
|
|
|
122
234
|
/** Token that performs the insertion; bump it to insert the same text again. */
|
|
123
235
|
revision: number;
|
|
124
236
|
}
|
|
237
|
+
/**
|
|
238
|
+
* Imperative handle exposed by `Input` via `ref`. Lets a host that renders
|
|
239
|
+
* its own UI outside `Input` (e.g. `EditMessageInput`'s external add-menu
|
|
240
|
+
* button, which sits alongside `Input` rather than inside it) read the live
|
|
241
|
+
* caret position without owning the textarea itself.
|
|
242
|
+
*/
|
|
243
|
+
export interface InputHandle {
|
|
244
|
+
/** The textarea's current caret offset (its `selectionStart`), or the message's length when it cannot be read. */
|
|
245
|
+
getCaretPosition: () => number;
|
|
246
|
+
}
|
|
125
247
|
/** Props accepted by the `Input` component. */
|
|
126
248
|
export interface InputProps {
|
|
249
|
+
/** Changing this token requests textarea focus without altering its value or caret. */
|
|
250
|
+
focusRequestId?: number;
|
|
127
251
|
/**
|
|
128
252
|
* Message value. Sets the initial textarea content on mount and syncs the
|
|
129
253
|
* textarea whenever the value changes.
|
|
@@ -167,6 +291,8 @@ export interface InputProps {
|
|
|
167
291
|
* its `card` slot, for every tile in it.
|
|
168
292
|
*/
|
|
169
293
|
attachmentTray?: AttachmentTrayStyles;
|
|
294
|
+
/** Styling hooks for the model menu: its panel, search row and deployment rows. */
|
|
295
|
+
modelMenu?: ModelMenuStyles;
|
|
170
296
|
/** Label for the attach-file menu item. */
|
|
171
297
|
attachLabel?: string;
|
|
172
298
|
/**
|
|
@@ -185,6 +311,10 @@ export interface InputProps {
|
|
|
185
311
|
retryLabel?: string;
|
|
186
312
|
/** Accessible label for each attachment card's in-progress upload progress bar. Defaults to `'Uploading'`. */
|
|
187
313
|
uploadingLabel?: string;
|
|
314
|
+
/** Accessible name of each pasted-text attachment card, which expands its text back into the composer when activated. Defaults to `'Expand pasted text'`. */
|
|
315
|
+
expandLabel?: string;
|
|
316
|
+
/** Accessible name of each non-pasted attachment card when `onAttachmentClick` makes it interactive. Name it after what the host handler does (e.g. opening the attachment in a canvas). When omitted, the card default applies (`'Open attachment'` on image tiles, `'Download attachment'` on file and link tiles). Pasted-text cards keep `expandLabel`. */
|
|
317
|
+
clickLabel?: string;
|
|
188
318
|
/** Accessible label for the send button. */
|
|
189
319
|
sendLabel?: string;
|
|
190
320
|
/** Tooltip shown on hover over the send button. */
|
|
@@ -293,7 +423,13 @@ export interface InputProps {
|
|
|
293
423
|
canSend: boolean;
|
|
294
424
|
onSend: () => void;
|
|
295
425
|
}) => ReactNode;
|
|
296
|
-
/**
|
|
426
|
+
/**
|
|
427
|
+
* When `true`, blocks typing, the attach menu, dictation, Enter-to-send,
|
|
428
|
+
* and dropped files (`pendingDropFiles` are consumed and discarded, never
|
|
429
|
+
* added to the tray). The send button still submits a message that is
|
|
430
|
+
* already populated (e.g. by a starter). Starter/action buttons and the
|
|
431
|
+
* model selector remain usable. Defaults to `false`.
|
|
432
|
+
*/
|
|
297
433
|
isInputDisabled?: boolean;
|
|
298
434
|
/**
|
|
299
435
|
* When `true`, the model selector renders in a disabled, non-interactive
|
|
@@ -370,35 +506,53 @@ export interface InputProps {
|
|
|
370
506
|
*/
|
|
371
507
|
menuOverlays?: MenuOverlayConfig[];
|
|
372
508
|
/**
|
|
373
|
-
*
|
|
374
|
-
*
|
|
375
|
-
*
|
|
376
|
-
*
|
|
377
|
-
*
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
*
|
|
385
|
-
*
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
*
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
*
|
|
394
|
-
*
|
|
395
|
-
*
|
|
396
|
-
*
|
|
397
|
-
*
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
*
|
|
509
|
+
* Ranges of `message` rendered as highlighted runs — e.g. a host-tracked
|
|
510
|
+
* skill mention's `/{name}` text. The textarea's own text is rendered
|
|
511
|
+
* transparent (its caret stays visible and normally colored) and a
|
|
512
|
+
* non-interactive mirror underneath renders the same text with each range
|
|
513
|
+
* wrapped in a highlight span, so the highlighted text stays pixel-aligned
|
|
514
|
+
* with the real, editable characters underneath it. Carries no semantic
|
|
515
|
+
* meaning to `Input` beyond where to draw a highlight. Absent (or empty)
|
|
516
|
+
* renders the text area unchanged, with normal (non-transparent) text.
|
|
517
|
+
*/
|
|
518
|
+
activeMentions?: HighlightedTextRange[];
|
|
519
|
+
/**
|
|
520
|
+
* Called on Backspace with the caret collapsed at some position, to ask the
|
|
521
|
+
* host whether a tracked range ends exactly there. Returning a range makes
|
|
522
|
+
* `Input` delete that whole range in one native edit (preserving undo)
|
|
523
|
+
* instead of the browser's default single-character deletion; returning
|
|
524
|
+
* `undefined` leaves Backspace unhandled. Absent disables the mechanism
|
|
525
|
+
* entirely (ordinary Backspace behavior).
|
|
526
|
+
*/
|
|
527
|
+
onBackspaceAtCaret?: (caretPosition: number) => HighlightedTextRange | undefined;
|
|
528
|
+
/**
|
|
529
|
+
* One-shot caret placement applied whenever `messageRevision` changes (e.g.
|
|
530
|
+
* right after the host pushes a new `message` that inserted a mention at a
|
|
531
|
+
* known position) — moves the caret there once, after the value updates.
|
|
532
|
+
* Absent leaves the caret wherever the browser puts it after the value
|
|
533
|
+
* change.
|
|
534
|
+
*/
|
|
535
|
+
caretPositionOverride?: number;
|
|
536
|
+
/**
|
|
537
|
+
* Host-injected slash-command menu. When provided, an overlay opens above
|
|
538
|
+
* the input whenever the whitespace-delimited word at the caret becomes
|
|
539
|
+
* `triggerPrefix` alone or followed by a whitespace-free, prefix-free
|
|
540
|
+
* query — anywhere in the textarea, whether it was empty or already held
|
|
541
|
+
* text, and whether the word was typed or pasted. It stays open while that
|
|
542
|
+
* word keeps matching, and closes on unmatch, Escape, or an outside click.
|
|
543
|
+
* Escape is the one dismissal that latches: the menu stays closed over that
|
|
544
|
+
* same word until it stops matching and the trigger is typed or pasted
|
|
545
|
+
* again. An outside click only
|
|
546
|
+
* closes it for the moment — typing/deleting within the same still-matching
|
|
547
|
+
* word, or moving the caret back into it (a click, or refocusing the
|
|
548
|
+
* textarea), reopens it with no need to retype the trigger. A message can
|
|
549
|
+
* hold more than one command-shaped word at once; the menu always tracks
|
|
550
|
+
* whichever one the caret is actually in, re-evaluated on every such caret
|
|
551
|
+
* move rather than assumed from whichever word was active before. A paste
|
|
552
|
+
* that leaves any other word at the caret (e.g. `/s sdf`) inserts as a
|
|
553
|
+
* regular paste and opens nothing. Selection typically goes through
|
|
554
|
+
* `ctx.close({ consumeQuery: true })`, which removes the `/query` text from
|
|
555
|
+
* the textarea. Absent disables the mechanism.
|
|
402
556
|
*/
|
|
403
557
|
commandMenu?: CommandMenuConfig;
|
|
404
558
|
/** When `true`, focuses the textarea on mount. Defaults to `false`. */
|
package/models/Input.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../src/models/Input.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,KAAK,EACV,UAAU,EACV,qBAAqB,EACrB,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,YAAY,EACZ,wBAAwB,EACzB,MAAM,2BAA2B,CAAC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AM,WAAW,kBAAkB;IACjC,kEAAkE;IAClE,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,gGAAgG;IAChG,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,iEAAiE;IACjE,YAAY,EAAE,MAAM,CAAC;IACrB,oEAAoE;IACpE,WAAW,EAAE,MAAM,CAAC;IACpB,4DAA4D;IAC5D,MAAM,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC7C,kFAAkF;IAClF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kDAAkD;IAClD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4EAA4E;IAC5E,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,+GAA+G;IAC/G,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,qEAAqE;IACrE,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC,yEAAyE;IACzE,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC,wEAAwE;IACxE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,gFAAgF;IAChF,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,oEAAoE;IACpE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,4HAA4H;IAC5H,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7C,qDAAqD;IACrD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gEAAgE;IAChE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+FAA+F;IAC/F,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,kGAAkG;IAClG,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epam/ai-dial-conversation-input",
|
|
3
3
|
"description": "Conversation message input with model selection, attachments, voice input, and edit mode",
|
|
4
|
-
"version": "1.2.0-
|
|
4
|
+
"version": "1.2.0-rc.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -19,13 +19,12 @@
|
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"react-window": "^2.2.7",
|
|
21
21
|
"@tabler/icons-react": "^3.44.0",
|
|
22
|
-
"@epam/ai-dial-attachment-input": "1.2.0-
|
|
22
|
+
"@epam/ai-dial-attachment-input": "1.2.0-rc.0"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"@epam/ai-dial-chat-shared": "1.2.0-
|
|
25
|
+
"@epam/ai-dial-chat-shared": "1.2.0-rc.0",
|
|
26
26
|
"react": "^19.2.8",
|
|
27
|
-
"
|
|
28
|
-
"@epam/ai-dial-ui-kit": "^0.15.0-dev.12"
|
|
27
|
+
"@epam/ai-dial-ui-kit": "^0.15.0"
|
|
29
28
|
},
|
|
30
29
|
"repository": {
|
|
31
30
|
"type": "git",
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { HighlightedTextRange } from '../models/Input';
|
|
3
|
+
export interface MirrorInsertion {
|
|
4
|
+
offset: number;
|
|
5
|
+
/** A React element carrying its own `key`. */
|
|
6
|
+
node: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare const renderHighlightedText: (text: string, ranges: HighlightedTextRange[], insertions: MirrorInsertion[], mentionHighlightClassName: string, mentionHighlightUnsupportedClassName: string) => ReactNode[];
|
|
9
|
+
/**
|
|
10
|
+
* A DOM `Range` spanning `[start, end)` characters of `message` within the
|
|
11
|
+
* highlight mirror, or `null` when either boundary can't be located (see
|
|
12
|
+
* `locateMirrorOffset`). Used to read the exact, wrap-aware pixel rectangles
|
|
13
|
+
* of the current native text selection via `Range.getClientRects()`, rather
|
|
14
|
+
* than re-deriving line-wrapping by hand.
|
|
15
|
+
*/
|
|
16
|
+
export declare const buildMirrorSelectionRange: (root: HTMLElement, start: number, end: number) => Range | null;
|
|
17
|
+
//# sourceMappingURL=highlight-mirror.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"highlight-mirror.d.ts","sourceRoot":"","sources":["../../src/utils/highlight-mirror.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAO5D,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,8CAA8C;IAC9C,IAAI,EAAE,SAAS,CAAC;CACjB;AA2BD,eAAO,MAAM,qBAAqB,GAChC,MAAM,MAAM,EACZ,QAAQ,oBAAoB,EAAE,EAC9B,YAAY,eAAe,EAAE,EAC7B,2BAA2B,MAAM,EACjC,sCAAsC,MAAM,KAC3C,SAAS,EA6DX,CAAC;AAqCF;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,GACpC,MAAM,WAAW,EACjB,OAAO,MAAM,EACb,KAAK,MAAM,KACV,KAAK,GAAG,IASV,CAAC"}
|