@widgetic/design-system 0.5.40 → 0.5.42
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/README.md +73 -0
- package/dist/components/ContentRefreshOverlay.svelte +103 -0
- package/dist/components/ContentRefreshOverlay.svelte.d.ts +18 -0
- package/dist/components/EmptyState.svelte +6 -2
- package/dist/components/chat/Composer.svelte +380 -19
- package/dist/components/chat/Composer.svelte.d.ts +88 -1
- package/dist/components/chat/PlanCard.svelte +218 -88
- package/dist/components/chat/PlanCard.svelte.d.ts +11 -0
- package/dist/components/chat/QuestionCard.svelte +180 -70
- package/dist/components/chat/QuestionCard.svelte.d.ts +28 -2
- package/dist/components/chat/QuestionCardSummary.svelte +96 -0
- package/dist/components/chat/QuestionCardSummary.svelte.d.ts +20 -0
- package/dist/components/chat/QueueCard.svelte +185 -0
- package/dist/components/chat/QueueCard.svelte.d.ts +40 -0
- package/dist/components/chat/composerLogic.d.ts +31 -0
- package/dist/components/chat/composerLogic.js +37 -0
- package/dist/components/chat/composerReferences.d.ts +28 -0
- package/dist/components/chat/composerReferences.js +23 -0
- package/dist/components/chat/index.d.ts +8 -3
- package/dist/components/chat/index.js +10 -2
- package/dist/components/chat/questionCardLogic.d.ts +40 -3
- package/dist/components/chat/questionCardLogic.js +54 -3
- package/dist/components/chat/queueCardLogic.d.ts +7 -0
- package/dist/components/chat/queueCardLogic.js +5 -0
- package/dist/components/creator/CreatorBar.svelte +54 -1
- package/dist/components/creator/CreatorBar.svelte.d.ts +5 -0
- package/dist/components/creator/index.d.ts +1 -2
- package/dist/components/creator/index.js +2 -0
- package/dist/components/index.d.ts +8 -7
- package/dist/components/index.js +8 -6
- package/dist/components/modals/BaseModal.svelte +23 -4
- package/dist/components/modals/BaseModal.svelte.d.ts +5 -0
- package/dist/components/navigation/breadcrumbSlideIn.d.ts +6 -2
- package/dist/components/navigation/breadcrumbSlideIn.js +6 -6
- package/dist/components/search-input/SearchInput.svelte +317 -14
- package/dist/components/search-input/SearchInput.svelte.d.ts +3 -0
- package/dist/components/search-input/index.d.ts +1 -0
- package/dist/components/search-input/index.js +1 -0
- package/dist/components/search-input/index2.d.ts +4 -0
- package/dist/components/search-input/recentSearches.d.ts +16 -0
- package/dist/components/search-input/recentSearches.js +141 -0
- package/dist/components/shell/NavRow.svelte +53 -10
- package/dist/components/shell/NavRow.svelte.d.ts +23 -2
- package/dist/components/shell/NotificationRow.svelte +3 -2
- package/dist/components/shell/ProfileRow.svelte +6 -4
- package/dist/components/shell/ProfileRow.svelte.d.ts +2 -2
- package/dist/components/shell/SettingsDialog.svelte +23 -1
- package/dist/components/shell/WidgetRow.svelte +4 -3
- package/dist/components/shell/WidgetRow.svelte.d.ts +2 -2
- package/dist/components/toast/ToasterModal.svelte +8 -3
- package/dist/components/toast/ToasterModal.svelte.d.ts +2 -0
- package/dist/components/ui/accordion/accordion-trigger.svelte +19 -0
- package/dist/components/ui/button/button.svelte +4 -2
- package/dist/components/ui/chip/chip.svelte +39 -1
- package/dist/components/ui/chip/chip.svelte.d.ts +8 -0
- package/dist/components/ui/chip/chipProgress.d.ts +14 -0
- package/dist/components/ui/chip/chipProgress.js +21 -0
- package/dist/components/ui/dialog/dialog-content.svelte +24 -2
- package/dist/components/ui/dropdown-menu/dropdown-menu-content.svelte +2 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte +2 -1
- package/dist/components/ui/hover-card/hover-card-content.svelte +2 -1
- package/dist/components/ui/icon-button/icon-button.svelte +2 -0
- package/dist/components/ui/icon-button/icon-button.svelte.d.ts +5 -0
- package/dist/components/ui/number-controls/index.d.ts +2 -0
- package/dist/components/ui/number-controls/index.js +2 -0
- package/dist/components/ui/number-controls/number-controls.svelte +530 -0
- package/dist/components/ui/number-controls/number-controls.svelte.d.ts +46 -0
- package/dist/components/ui/number-controls/numberControlsSteps.d.ts +17 -0
- package/dist/components/ui/number-controls/numberControlsSteps.js +23 -0
- package/dist/components/ui/number-controls/numberControlsValueArea.d.ts +29 -0
- package/dist/components/ui/number-controls/numberControlsValueArea.js +51 -0
- package/dist/components/ui/popover/popover-content.svelte +2 -1
- package/dist/components/ui/select/select-content.svelte +2 -1
- package/dist/components/ui/text-flip/index.d.ts +1 -0
- package/dist/components/ui/text-flip/index.js +1 -0
- package/dist/components/ui/text-flip/text-flip.svelte +103 -0
- package/dist/components/ui/text-flip/text-flip.svelte.d.ts +15 -0
- package/dist/components/ui/text-flip/textFlipLogic.d.ts +49 -0
- package/dist/components/ui/text-flip/textFlipLogic.js +151 -0
- package/dist/components/ui/tooltip/tooltip-content.svelte +1 -1
- package/dist/inline-completion/completionAnswer.d.ts +11 -0
- package/dist/inline-completion/completionAnswer.js +49 -0
- package/dist/inline-completion/completionCache.d.ts +24 -0
- package/dist/inline-completion/completionCache.js +47 -0
- package/dist/inline-completion/completionController.d.ts +61 -0
- package/dist/inline-completion/completionController.js +280 -0
- package/dist/inline-completion/completionKeys.d.ts +21 -0
- package/dist/inline-completion/completionKeys.js +19 -0
- package/dist/inline-completion/completionText.d.ts +53 -0
- package/dist/inline-completion/completionText.js +79 -0
- package/dist/inline-completion/completionTypes.d.ts +71 -0
- package/dist/inline-completion/completionTypes.js +5 -0
- package/dist/inline-completion/gatewayCompletion.d.ts +37 -0
- package/dist/inline-completion/gatewayCompletion.js +77 -0
- package/dist/inline-completion/ghostTap.d.ts +19 -0
- package/dist/inline-completion/ghostTap.js +20 -0
- package/dist/inline-completion/hintMemory.d.ts +43 -0
- package/dist/inline-completion/hintMemory.js +90 -0
- package/dist/inline-completion/httpSource.d.ts +40 -0
- package/dist/inline-completion/httpSource.js +149 -0
- package/dist/inline-completion/index.d.ts +30 -0
- package/dist/inline-completion/index.js +20 -0
- package/dist/inline-completion/inlineCompletionAction.d.ts +54 -0
- package/dist/inline-completion/inlineCompletionAction.js +310 -0
- package/dist/inline-completion/outcomeReporter.d.ts +49 -0
- package/dist/inline-completion/outcomeReporter.js +139 -0
- package/dist/inline-completion/promiseLike.d.ts +9 -0
- package/dist/inline-completion/promiseLike.js +9 -0
- package/dist/prompt-references/ReferenceMenu.svelte +344 -0
- package/dist/prompt-references/ReferenceMenu.svelte.d.ts +26 -0
- package/dist/prompt-references/index.d.ts +27 -0
- package/dist/prompt-references/index.js +20 -0
- package/dist/prompt-references/neutralizingSource.d.ts +21 -0
- package/dist/prompt-references/neutralizingSource.js +29 -0
- package/dist/prompt-references/promptReferences.d.ts +28 -0
- package/dist/prompt-references/promptReferences.js +766 -0
- package/dist/prompt-references/referenceBadge.d.ts +61 -0
- package/dist/prompt-references/referenceBadge.js +82 -0
- package/dist/prompt-references/referenceBadgePainter.d.ts +31 -0
- package/dist/prompt-references/referenceBadgePainter.js +106 -0
- package/dist/prompt-references/referenceEditing.d.ts +60 -0
- package/dist/prompt-references/referenceEditing.js +135 -0
- package/dist/prompt-references/referenceLabels.d.ts +56 -0
- package/dist/prompt-references/referenceLabels.js +215 -0
- package/dist/prompt-references/referenceMeasure.d.ts +12 -0
- package/dist/prompt-references/referenceMeasure.js +63 -0
- package/dist/prompt-references/referenceMenuHost.svelte.d.ts +29 -0
- package/dist/prompt-references/referenceMenuHost.svelte.js +43 -0
- package/dist/prompt-references/referenceMenuKeys.d.ts +26 -0
- package/dist/prompt-references/referenceMenuKeys.js +49 -0
- package/dist/prompt-references/referenceMenuPlacement.d.ts +63 -0
- package/dist/prompt-references/referenceMenuPlacement.js +66 -0
- package/dist/prompt-references/referenceTokens.d.ts +175 -0
- package/dist/prompt-references/referenceTokens.js +332 -0
- package/dist/prompt-references/referenceTrigger.d.ts +52 -0
- package/dist/prompt-references/referenceTrigger.js +100 -0
- package/dist/prompt-references/referenceTypes.d.ts +38 -0
- package/dist/prompt-references/referenceTypes.js +4 -0
- package/dist/prompt-references/sentReferences.d.ts +50 -0
- package/dist/prompt-references/sentReferences.js +122 -0
- package/dist/styles/tokens.css +126 -1
- package/dist/textarea-overlay/index.d.ts +9 -0
- package/dist/textarea-overlay/index.js +7 -0
- package/dist/textarea-overlay/mirrorSegments.d.ts +31 -0
- package/dist/textarea-overlay/mirrorSegments.js +47 -0
- package/dist/textarea-overlay/mirrorSizing.d.ts +39 -0
- package/dist/textarea-overlay/mirrorSizing.js +40 -0
- package/dist/textarea-overlay/textareaOverlay.d.ts +25 -0
- package/dist/textarea-overlay/textareaOverlay.js +277 -0
- package/dist/utils/modalEnterKey.d.ts +139 -0
- package/dist/utils/modalEnterKey.js +276 -0
- package/dist/utils/modalFocusTrap.d.ts +7 -0
- package/dist/utils/modalFocusTrap.js +22 -0
- package/dist/utils/overlayMotion.d.ts +10 -0
- package/dist/utils/overlayMotion.js +12 -3
- package/dist/utils/reducedMotion.d.ts +9 -0
- package/dist/utils/reducedMotion.js +13 -0
- package/dist/utils/revealOpeningSection.d.ts +51 -0
- package/dist/utils/revealOpeningSection.js +109 -0
- package/package.json +16 -1
- package/dist/components/ui/number-stepper/index.d.ts +0 -3
- package/dist/components/ui/number-stepper/index.js +0 -3
- package/dist/components/ui/number-stepper/number-stepper.svelte +0 -212
- package/dist/components/ui/number-stepper/number-stepper.svelte.d.ts +0 -24
- package/dist/components/ui/number-stepper/numberStepperSteps.d.ts +0 -26
- package/dist/components/ui/number-stepper/numberStepperSteps.js +0 -45
|
@@ -4,12 +4,91 @@
|
|
|
4
4
|
<script lang="ts" module>
|
|
5
5
|
import type { Snippet } from 'svelte';
|
|
6
6
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
7
|
+
import type {
|
|
8
|
+
InlineCompletionEvent,
|
|
9
|
+
InlineCompletionLogger,
|
|
10
|
+
InlineCompletionSource
|
|
11
|
+
} from '../../inline-completion/index.js';
|
|
12
|
+
import type {
|
|
13
|
+
CollectedReference,
|
|
14
|
+
PromptReferencesLogger,
|
|
15
|
+
ReferenceHoverEvent,
|
|
16
|
+
ReferenceItem
|
|
17
|
+
} from '../../prompt-references/index.js';
|
|
7
18
|
|
|
8
19
|
export type ComposerMessages = {
|
|
9
20
|
send: string;
|
|
10
21
|
stop: string;
|
|
22
|
+
/** The label of the primary control while an agent works and a message is typed: it adds the message to the queue. */
|
|
23
|
+
queue: string;
|
|
11
24
|
attach: string;
|
|
12
25
|
characterLimit: string;
|
|
26
|
+
/**
|
|
27
|
+
* What Tab does with the grey text after the caret, shown beside the send button while a suggestion shows, until the person
|
|
28
|
+
* has taken one suggestion (then they know, and the hint stays away for good in this browser).
|
|
29
|
+
*/
|
|
30
|
+
completionHint: string;
|
|
31
|
+
/** The same for a touch screen, which has no Tab key: the grey text is tapped. */
|
|
32
|
+
completionHintTouch: string;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/** Ghost-text suggestions for the box (see `@widgetic/design-system/inline-completion`). */
|
|
36
|
+
export type ComposerCompletion = {
|
|
37
|
+
/** Where suggestions come from. Without one (null, undefined) the box behaves as it always did. */
|
|
38
|
+
source: InlineCompletionSource | null | undefined;
|
|
39
|
+
debounceMs?: number;
|
|
40
|
+
dismissalLimit?: number;
|
|
41
|
+
/** Called once per transition (shown, accepted, dismissed, diverged, paused), for a host that measures them. */
|
|
42
|
+
onEvent?: (event: InlineCompletionEvent) => void;
|
|
43
|
+
/** A debug line per transition. Default: `console.debug` with the `[inline-completion]` prefix. */
|
|
44
|
+
log?: InlineCompletionLogger;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/** The words the box says about files a message may refer to. The design system holds no English: the host passes them. */
|
|
48
|
+
export type ComposerReferenceMessages = {
|
|
49
|
+
/** The line under the box while a file is attached: how to refer to it ("Type # to reference an attached file"). */
|
|
50
|
+
hint: string;
|
|
51
|
+
/** What a screen reader calls the list of files the `#` menu opens ("Attached files"). */
|
|
52
|
+
menuLabel: string;
|
|
53
|
+
/** What the X of a badge is called, with `{name}` for the file's name ("Remove {name}"). */
|
|
54
|
+
remove: string;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/** Files a message may refer to with `#` (see `@widgetic/design-system/prompt-references`). */
|
|
58
|
+
export type ComposerReferences = {
|
|
59
|
+
/** The files that can be referenced, in tray order. A file without a label is not in the list. */
|
|
60
|
+
items: readonly ReferenceItem[];
|
|
61
|
+
messages: ComposerReferenceMessages;
|
|
62
|
+
/** The pointer is on a badge, or the keys are on a menu row: the host rings the same file in its tray. `label: null` when it left. */
|
|
63
|
+
onHover?: (event: ReferenceHoverEvent) => void;
|
|
64
|
+
/** The character that starts a reference. Default `#`. */
|
|
65
|
+
triggerCharacter?: string;
|
|
66
|
+
/** The most references one message may carry (the request's own cap). Default: no cap. */
|
|
67
|
+
maxReferences?: number;
|
|
68
|
+
/** A debug line per transition. Default: `console.debug` with the `[prompt-references]` prefix. */
|
|
69
|
+
log?: PromptReferencesLogger;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
/** What a send tells the host besides the text. It is given only when the box was given `references`. */
|
|
73
|
+
export type ComposerSendOptions = {
|
|
74
|
+
/** The attached files the text names, once each and in order of first appearance; `id` is the one the host gave the item. */
|
|
75
|
+
references: CollectedReference[];
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* A queued message is being edited in the composer: the text above the pill is that message, the pill says so and closes the
|
|
80
|
+
* edit (the changes are dropped), and the primary control is a check that saves them. Enter saves, Escape closes.
|
|
81
|
+
*/
|
|
82
|
+
export type ComposerEditing = {
|
|
83
|
+
/** The pill ("Editing"). */
|
|
84
|
+
label: string;
|
|
85
|
+
/** The label of the pill's close mark ("Discard changes"). */
|
|
86
|
+
closeLabel: string;
|
|
87
|
+
/** The label of the check ("Save changes"). */
|
|
88
|
+
confirmLabel: string;
|
|
89
|
+
onClose: () => void;
|
|
90
|
+
/** Called with the trimmed text. */
|
|
91
|
+
onConfirm: (text: string) => void;
|
|
13
92
|
};
|
|
14
93
|
|
|
15
94
|
export type ComposerModelOption = {
|
|
@@ -17,6 +96,14 @@
|
|
|
17
96
|
label: string;
|
|
18
97
|
};
|
|
19
98
|
|
|
99
|
+
// Numbers the hint under the box, so a textarea points at the hint of its own composer when several share a page.
|
|
100
|
+
let referenceHintCount = 0;
|
|
101
|
+
|
|
102
|
+
function nextReferenceHintId(): string {
|
|
103
|
+
referenceHintCount += 1;
|
|
104
|
+
return `composer-reference-hint-${referenceHintCount}`;
|
|
105
|
+
}
|
|
106
|
+
|
|
20
107
|
export type ComposerProps = HTMLAttributes<HTMLDivElement> & {
|
|
21
108
|
ref?: HTMLDivElement | null;
|
|
22
109
|
class?: string;
|
|
@@ -31,13 +118,35 @@
|
|
|
31
118
|
selectedModelId?: string | null;
|
|
32
119
|
onSelectModel?: (modelId: string) => void;
|
|
33
120
|
messages?: Partial<ComposerMessages>;
|
|
34
|
-
|
|
121
|
+
/**
|
|
122
|
+
* The text is what a person reads: a reference is the word `#hero_banner`, whatever room its badge takes in the box. With
|
|
123
|
+
* `references`, `options.references` lists the attached files the text names; without it there is no second argument.
|
|
124
|
+
*/
|
|
125
|
+
onSend?: (text: string, options?: ComposerSendOptions) => void;
|
|
35
126
|
onStop?: () => void;
|
|
127
|
+
/**
|
|
128
|
+
* Takes a message typed while an agent works (`busy`): the host puts it in a queue. Given, the primary control is a send
|
|
129
|
+
* control while a text is typed (it queues) and Stop while none is, and Enter never stops. Left out, a busy composer can only
|
|
130
|
+
* stop, as before.
|
|
131
|
+
*/
|
|
132
|
+
onQueue?: (text: string) => void;
|
|
133
|
+
/** Set while a queued message is being edited in the composer; `null` or left out otherwise. */
|
|
134
|
+
editing?: ComposerEditing | null;
|
|
36
135
|
/** Figma side panel uses arrow-up on the primary send control; default is paper-plane. */
|
|
37
136
|
sendIcon?: 'send' | 'arrow-up';
|
|
38
137
|
leading?: Snippet;
|
|
39
138
|
trailing?: Snippet;
|
|
40
139
|
attachments?: Snippet;
|
|
140
|
+
/**
|
|
141
|
+
* Ghost text after the caret, taken with Tab (or a tap): a likely continuation of what is typed. Without it the box is as it
|
|
142
|
+
* was. Enter still sends, and the suggestion goes away with the message.
|
|
143
|
+
*/
|
|
144
|
+
completion?: ComposerCompletion;
|
|
145
|
+
/**
|
|
146
|
+
* Files attached to the message that its text may refer to: `#` after a space lists them with their pictures, and a choice
|
|
147
|
+
* becomes a badge (picture, name, X) inside the text. Without it the box is as it was: no menu, no badges, no listeners.
|
|
148
|
+
*/
|
|
149
|
+
references?: ComposerReferences;
|
|
41
150
|
/** Bounce + white tooltip on the send control (publish-before-send nudge). */
|
|
42
151
|
sendAttention?: {
|
|
43
152
|
bounce: boolean;
|
|
@@ -52,23 +161,51 @@
|
|
|
52
161
|
import IconChevronDown from '@tabler/icons-svelte/icons/chevron-down';
|
|
53
162
|
import IconPlayerStop from '@tabler/icons-svelte/icons/player-stop';
|
|
54
163
|
import IconArrowUp from '@tabler/icons-svelte/icons/arrow-up';
|
|
164
|
+
import IconPencil from '@tabler/icons-svelte/icons/pencil';
|
|
55
165
|
import IconSend from '@tabler/icons-svelte/icons/send';
|
|
56
166
|
import { cn } from '../../utils.js';
|
|
57
167
|
import { Button } from '../ui/button/index.js';
|
|
168
|
+
import { Chip } from '../ui/chip/index.js';
|
|
58
169
|
import { IconButton } from '../ui/icon-button/index.js';
|
|
59
170
|
import HintTooltip from '../tooltip/HintTooltip.svelte';
|
|
60
171
|
import * as DropdownMenu from '../ui/dropdown-menu';
|
|
61
|
-
import { canSendText, clampTextareaHeight, shouldSendOnKeyDown } from './composerLogic.js';
|
|
62
172
|
import {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
173
|
+
canSendText,
|
|
174
|
+
clampTextareaHeight,
|
|
175
|
+
completionAnnouncement,
|
|
176
|
+
composerPrimaryAction,
|
|
177
|
+
enterKeyAction,
|
|
178
|
+
isQueueableText,
|
|
179
|
+
shouldSendOnKeyDown
|
|
180
|
+
} from './composerLogic.js';
|
|
181
|
+
import { selectedModelLabel, shouldShowComposerModelMenu } from './composerModelMenuLogic.js';
|
|
182
|
+
import {
|
|
183
|
+
completionHintMemory,
|
|
184
|
+
inlineCompletion,
|
|
185
|
+
type GhostView,
|
|
186
|
+
type InlineCompletionParams
|
|
187
|
+
} from '../../inline-completion/index.js';
|
|
188
|
+
import {
|
|
189
|
+
promptReferences,
|
|
190
|
+
type PromptReferencesAction,
|
|
191
|
+
type PromptReferencesParams,
|
|
192
|
+
type ReferenceMenuStatus
|
|
193
|
+
} from '../../prompt-references/index.js';
|
|
194
|
+
import {
|
|
195
|
+
messageText,
|
|
196
|
+
neutralizingSource,
|
|
197
|
+
referencesOfMessage,
|
|
198
|
+
type NeutralizingSettings
|
|
199
|
+
} from './composerReferences.js';
|
|
66
200
|
|
|
67
201
|
const defaultMessages: ComposerMessages = {
|
|
68
202
|
send: 'Send message',
|
|
69
203
|
stop: 'Stop generating',
|
|
204
|
+
queue: 'Add to queue',
|
|
70
205
|
attach: 'Add attachment',
|
|
71
|
-
characterLimit: 'Message is too long'
|
|
206
|
+
characterLimit: 'Message is too long',
|
|
207
|
+
completionHint: 'Tab to accept',
|
|
208
|
+
completionHintTouch: 'Tap the suggestion to accept'
|
|
72
209
|
};
|
|
73
210
|
|
|
74
211
|
let {
|
|
@@ -87,10 +224,14 @@
|
|
|
87
224
|
messages: messagesProp,
|
|
88
225
|
onSend,
|
|
89
226
|
onStop,
|
|
227
|
+
onQueue,
|
|
228
|
+
editing = null,
|
|
90
229
|
sendIcon = 'send',
|
|
91
230
|
leading,
|
|
92
231
|
trailing,
|
|
93
232
|
attachments,
|
|
233
|
+
completion,
|
|
234
|
+
references,
|
|
94
235
|
sendAttention,
|
|
95
236
|
...restProps
|
|
96
237
|
}: ComposerProps = $props();
|
|
@@ -103,11 +244,159 @@
|
|
|
103
244
|
let textareaRef = $state<HTMLTextAreaElement | null>(null);
|
|
104
245
|
let isComposing = $state(false);
|
|
105
246
|
|
|
106
|
-
|
|
107
|
-
|
|
247
|
+
// Files the message may refer to. A badge takes room in the box (spaces that are not sent), so what is counted, checked and sent
|
|
248
|
+
// is the text without them: a message is what a person reads, "fix #hero_banner". Without `references` this is `value` itself.
|
|
249
|
+
const referencesOn = $derived(references !== undefined);
|
|
250
|
+
const sendableValue = $derived(messageText(value, referencesOn));
|
|
251
|
+
const referenceHintId = nextReferenceHintId();
|
|
252
|
+
const referenceHintShown = $derived(
|
|
253
|
+
references !== undefined && references.items.length > 0 && references.messages.hint !== ''
|
|
254
|
+
);
|
|
255
|
+
// Whether the `#` menu is open: the grey suggestion of the same box goes while it is.
|
|
256
|
+
let referenceMenuOpen = $state(false);
|
|
257
|
+
|
|
258
|
+
const overLimit = $derived(maxLength != null && sendableValue.trim().length > maxLength);
|
|
259
|
+
|
|
260
|
+
// The suggestion that shows after the caret now (null when none): the hint beside the send button follows it.
|
|
261
|
+
let completionGhost = $state<GhostView | null>(null);
|
|
262
|
+
// Whether the person is on a touch screen (no Tab key there) when a suggestion shows: read each time one does, since a
|
|
263
|
+
// device that is both can change its mind.
|
|
264
|
+
let completionOnTouch = $state(false);
|
|
265
|
+
const completionHint = $derived(hintForInput(completionOnTouch));
|
|
266
|
+
// Whether the person has taken a suggestion before: the hint is for the first time only. The action notes the first one taken in
|
|
267
|
+
// the browser's shared memory; it is read each time a suggestion appears, so one taken in another box or tab is known by then.
|
|
268
|
+
let completionHintLearned = $state(false);
|
|
269
|
+
|
|
270
|
+
function pointerIsCoarse(): boolean {
|
|
271
|
+
return (
|
|
272
|
+
typeof window !== 'undefined' && window.matchMedia?.('(pointer: coarse)').matches === true
|
|
273
|
+
);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
function hintForInput(onTouch: boolean): string {
|
|
277
|
+
return onTouch ? messages.completionHintTouch : messages.completionHint;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
function showCompletionGhost(ghost: GhostView | null) {
|
|
281
|
+
if (ghost !== null) {
|
|
282
|
+
completionOnTouch = pointerIsCoarse();
|
|
283
|
+
completionHintLearned = completionHintMemory.learned;
|
|
284
|
+
}
|
|
285
|
+
completionGhost = ghost;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
// What a suggestion service is allowed to see of the files attached now, read at each request: the wrapper below is made once for
|
|
289
|
+
// a source, so files coming and going do not start the box's suggestions over.
|
|
290
|
+
function readNeutralizingSettings(): NeutralizingSettings {
|
|
291
|
+
return {
|
|
292
|
+
labels: (references?.items ?? []).map((item) => item.label),
|
|
293
|
+
triggerCharacter: references?.triggerCharacter
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
// Where the suggestions come from. With `references`, a file's name never reaches the service: each reference in the text is the
|
|
298
|
+
// neutral word `#file` by then. Without them the source is used as it is.
|
|
299
|
+
const completionSource = $derived(
|
|
300
|
+
referencesOn
|
|
301
|
+
? neutralizingSource(completion?.source, readNeutralizingSettings)
|
|
302
|
+
: (completion?.source ?? null)
|
|
303
|
+
);
|
|
304
|
+
|
|
305
|
+
// What the ghost-text action is told. `value` is there so a text the page changes by itself (the box clears after a send) is
|
|
306
|
+
// noticed and the suggestion goes with it. The ghost stays while the assistant builds (`busy`), and goes while the box is
|
|
307
|
+
// disabled and while the `#` menu is open (one popup at a time, and the menu owns the keys).
|
|
308
|
+
const completionParams = $derived<InlineCompletionParams>({
|
|
309
|
+
source: completionSource,
|
|
310
|
+
value,
|
|
311
|
+
disabled: disabled || referenceMenuOpen,
|
|
312
|
+
// Written here, in this file, so the class is found where the design system's styles are built.
|
|
313
|
+
ghostClass: 'text-muted-foreground',
|
|
314
|
+
debounceMs: completion?.debounceMs,
|
|
315
|
+
dismissalLimit: completion?.dismissalLimit,
|
|
316
|
+
// Told before the ghost is reported to `showCompletionGhost`, so the hint is chosen here from the device as it is now.
|
|
317
|
+
announce: (ghostText) =>
|
|
318
|
+
completionAnnouncement(sendableValue, ghostText, hintForInput(pointerIsCoarse())),
|
|
319
|
+
onChange: showCompletionGhost,
|
|
320
|
+
onEvent: completion?.onEvent,
|
|
321
|
+
log: completion?.log
|
|
322
|
+
});
|
|
323
|
+
|
|
324
|
+
function showReferenceMenuStatus(status: ReferenceMenuStatus) {
|
|
325
|
+
referenceMenuOpen = status.open;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
// What the `#` action is told. `value` is there so a text the page changes by itself (the box clears after a send, a draft is
|
|
329
|
+
// restored) repaints the badges. Null while the box is given no `references`.
|
|
330
|
+
const referenceParams = $derived<PromptReferencesParams | null>(
|
|
331
|
+
references
|
|
332
|
+
? {
|
|
333
|
+
items: references.items,
|
|
334
|
+
messages: {
|
|
335
|
+
menuLabel: references.messages.menuLabel,
|
|
336
|
+
remove: references.messages.remove
|
|
337
|
+
},
|
|
338
|
+
value,
|
|
339
|
+
triggerCharacter: references.triggerCharacter,
|
|
340
|
+
enabled: !disabled,
|
|
341
|
+
onHover: references.onHover,
|
|
342
|
+
onMenuChange: showReferenceMenuStatus,
|
|
343
|
+
logger: references.log
|
|
344
|
+
}
|
|
345
|
+
: null
|
|
108
346
|
);
|
|
109
347
|
|
|
110
|
-
|
|
348
|
+
/**
|
|
349
|
+
* The `#` action on the box, only while there are `references` to offer: a composer without them gets no listener, no layer
|
|
350
|
+
* on its textarea and no menu, and one that is given them later (or loses them) gains (or loses) the action on the spot.
|
|
351
|
+
*/
|
|
352
|
+
function referencesOnBox(node: HTMLTextAreaElement, params: PromptReferencesParams | null) {
|
|
353
|
+
let action: PromptReferencesAction | null = params ? promptReferences(node, params) : null;
|
|
354
|
+
return {
|
|
355
|
+
update(next: PromptReferencesParams | null) {
|
|
356
|
+
if (next && action) {
|
|
357
|
+
action.update(next);
|
|
358
|
+
} else if (next) {
|
|
359
|
+
action = promptReferences(node, next);
|
|
360
|
+
} else if (action) {
|
|
361
|
+
action.destroy();
|
|
362
|
+
action = null;
|
|
363
|
+
// A menu that was open goes with the action, and so the hold it had on the suggestions.
|
|
364
|
+
referenceMenuOpen = false;
|
|
365
|
+
}
|
|
366
|
+
},
|
|
367
|
+
destroy() {
|
|
368
|
+
action?.destroy();
|
|
369
|
+
action = null;
|
|
370
|
+
}
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
// What the primary control does now: save an edit of a queued message, queue what is typed while an agent works, stop the
|
|
375
|
+
// agent (nothing typed), or send. A host that gives no `onQueue` keeps the old pair: Stop while busy, Send otherwise.
|
|
376
|
+
const primaryAction = $derived(
|
|
377
|
+
composerPrimaryAction({
|
|
378
|
+
busy,
|
|
379
|
+
editing: editing != null,
|
|
380
|
+
canQueue: onQueue != null,
|
|
381
|
+
hasQueueableText: isQueueableText(sendableValue, maxLength)
|
|
382
|
+
})
|
|
383
|
+
);
|
|
384
|
+
const primaryLabel = $derived(
|
|
385
|
+
primaryAction === 'stop'
|
|
386
|
+
? messages.stop
|
|
387
|
+
: primaryAction === 'queue'
|
|
388
|
+
? messages.queue
|
|
389
|
+
: primaryAction === 'confirmEdit'
|
|
390
|
+
? (editing?.confirmLabel ?? messages.send)
|
|
391
|
+
: messages.send
|
|
392
|
+
);
|
|
393
|
+
const sendEnabled = $derived(
|
|
394
|
+
primaryAction === 'stop'
|
|
395
|
+
? !disabled
|
|
396
|
+
: primaryAction === 'queue' || primaryAction === 'confirmEdit'
|
|
397
|
+
? !disabled && isQueueableText(sendableValue, maxLength)
|
|
398
|
+
: canSendText(sendableValue, { disabled, allowEmpty, maxLength })
|
|
399
|
+
);
|
|
111
400
|
|
|
112
401
|
function autosize() {
|
|
113
402
|
const el = textareaRef;
|
|
@@ -116,29 +405,64 @@
|
|
|
116
405
|
el.style.height = `${clampTextareaHeight(el.scrollHeight)}px`;
|
|
117
406
|
}
|
|
118
407
|
|
|
119
|
-
|
|
120
|
-
|
|
408
|
+
/**
|
|
409
|
+
* Does what the primary control does. A press of the control and the Enter key differ in one thing only: with a queue,
|
|
410
|
+
* Enter on an empty text while an agent works does nothing (Stop is a button).
|
|
411
|
+
*/
|
|
412
|
+
function handleSend(source: 'control' | 'enter' = 'control') {
|
|
413
|
+
const action = source === 'enter' ? enterKeyAction(primaryAction, onQueue != null) : primaryAction;
|
|
414
|
+
if (action === 'none') return;
|
|
415
|
+
if (action === 'stop') {
|
|
121
416
|
if (!disabled) onStop?.();
|
|
122
417
|
return;
|
|
123
418
|
}
|
|
124
419
|
if (!sendEnabled || overLimit) return;
|
|
125
|
-
const text =
|
|
420
|
+
const text = sendableValue.trim();
|
|
421
|
+
if (action === 'confirmEdit' || action === 'queue') {
|
|
422
|
+
// A queued message, and a saved edit of one, is never empty
|
|
423
|
+
if (text.length === 0) return;
|
|
424
|
+
try {
|
|
425
|
+
if (action === 'confirmEdit') editing?.onConfirm(text);
|
|
426
|
+
else onQueue?.(text);
|
|
427
|
+
} catch (error) {
|
|
428
|
+
console.error(error);
|
|
429
|
+
}
|
|
430
|
+
return;
|
|
431
|
+
}
|
|
126
432
|
if (!allowEmpty && text.length === 0) return;
|
|
127
433
|
try {
|
|
128
|
-
|
|
434
|
+
if (references) {
|
|
435
|
+
// The references are read from the box's own text (the badges and their rooms), the message from the text without rooms.
|
|
436
|
+
onSend?.(text, {
|
|
437
|
+
references: referencesOfMessage(value, references.items, {
|
|
438
|
+
max: references.maxReferences,
|
|
439
|
+
triggerCharacter: references.triggerCharacter
|
|
440
|
+
})
|
|
441
|
+
});
|
|
442
|
+
} else {
|
|
443
|
+
onSend?.(text);
|
|
444
|
+
}
|
|
129
445
|
} catch (error) {
|
|
130
446
|
console.error(error);
|
|
131
447
|
}
|
|
132
448
|
}
|
|
133
449
|
|
|
134
450
|
function handleKeyDown(event: KeyboardEvent) {
|
|
451
|
+
// Another listener of the box has taken the key (the `#` menu chooses a file with Enter): the key does not send.
|
|
452
|
+
if (event.defaultPrevented) return;
|
|
135
453
|
if (event.isComposing || isComposing) {
|
|
136
454
|
if (event.key === 'Enter') event.preventDefault();
|
|
137
455
|
return;
|
|
138
456
|
}
|
|
457
|
+
// Escape closes the edit of a queued message, as the close mark of the pill does: the changes are dropped
|
|
458
|
+
if (event.key === 'Escape' && editing) {
|
|
459
|
+
event.preventDefault();
|
|
460
|
+
editing.onClose();
|
|
461
|
+
return;
|
|
462
|
+
}
|
|
139
463
|
if (!shouldSendOnKeyDown(event.key, event.shiftKey, false)) return;
|
|
140
464
|
event.preventDefault();
|
|
141
|
-
handleSend();
|
|
465
|
+
handleSend('enter');
|
|
142
466
|
}
|
|
143
467
|
|
|
144
468
|
$effect(() => {
|
|
@@ -156,11 +480,22 @@
|
|
|
156
480
|
)}
|
|
157
481
|
{...restProps}
|
|
158
482
|
>
|
|
483
|
+
{#if editing}
|
|
484
|
+
<!-- A queued message is in the text below: this pill says so, and its mark closes the edit and drops the changes. -->
|
|
485
|
+
<div class="flex items-center" data-testid="composer-editing">
|
|
486
|
+
<Chip label={editing.label} showRemove removeLabel={editing.closeLabel} onRemove={editing.onClose}>
|
|
487
|
+
{#snippet leading()}
|
|
488
|
+
<IconPencil class="size-4 stroke-2" aria-hidden="true" />
|
|
489
|
+
{/snippet}
|
|
490
|
+
</Chip>
|
|
491
|
+
</div>
|
|
492
|
+
{/if}
|
|
159
493
|
{#if attachments}
|
|
160
494
|
<div class="flex flex-wrap gap-1.5 overflow-hidden">{@render attachments()}</div>
|
|
161
495
|
{/if}
|
|
162
496
|
|
|
163
|
-
|
|
497
|
+
<!-- Positioned, so the layer the suggestion is painted on (a sibling of the textarea) is measured against this box. -->
|
|
498
|
+
<div class="relative min-h-12 w-full px-1 pt-1">
|
|
164
499
|
<textarea
|
|
165
500
|
bind:this={textareaRef}
|
|
166
501
|
bind:value
|
|
@@ -169,6 +504,9 @@
|
|
|
169
504
|
{placeholder}
|
|
170
505
|
{disabled}
|
|
171
506
|
aria-invalid={overLimit ? true : undefined}
|
|
507
|
+
aria-describedby={referenceHintShown ? referenceHintId : undefined}
|
|
508
|
+
use:inlineCompletion={completionParams}
|
|
509
|
+
use:referencesOnBox={referenceParams}
|
|
172
510
|
oninput={autosize}
|
|
173
511
|
onkeydown={handleKeyDown}
|
|
174
512
|
oncompositionstart={() => {
|
|
@@ -181,6 +519,16 @@
|
|
|
181
519
|
{#if overLimit}
|
|
182
520
|
<p class="text-caption text-destructive mt-1" role="status">{messages.characterLimit}</p>
|
|
183
521
|
{/if}
|
|
522
|
+
{#if referenceHintShown && references}
|
|
523
|
+
<!-- How to refer to an attached file: shown while a file is attached, so the way in is not a secret. -->
|
|
524
|
+
<p
|
|
525
|
+
id={referenceHintId}
|
|
526
|
+
class="text-caption text-muted-foreground mt-1"
|
|
527
|
+
data-testid="composer-reference-hint"
|
|
528
|
+
>
|
|
529
|
+
{references.messages.hint}
|
|
530
|
+
</p>
|
|
531
|
+
{/if}
|
|
184
532
|
</div>
|
|
185
533
|
|
|
186
534
|
<div class="flex items-center gap-2">
|
|
@@ -221,6 +569,16 @@
|
|
|
221
569
|
</DropdownMenu.Content>
|
|
222
570
|
</DropdownMenu.Root>
|
|
223
571
|
{/if}
|
|
572
|
+
{#if completionGhost && !completionHintLearned}
|
|
573
|
+
<!-- What Tab does with the grey text, until the person has taken one suggestion (then they know). A screen reader hears it with the suggestion itself, so it is hidden from it here. -->
|
|
574
|
+
<span
|
|
575
|
+
class="text-caption text-muted-foreground ms-auto min-w-0 truncate pe-1"
|
|
576
|
+
aria-hidden="true"
|
|
577
|
+
data-testid="composer-completion-hint"
|
|
578
|
+
>
|
|
579
|
+
{completionHint}
|
|
580
|
+
</span>
|
|
581
|
+
{/if}
|
|
224
582
|
</div>
|
|
225
583
|
{#if trailing}
|
|
226
584
|
{@render trailing()}
|
|
@@ -235,15 +593,18 @@
|
|
|
235
593
|
{#snippet trigger({ props })}
|
|
236
594
|
<IconButton
|
|
237
595
|
{...props}
|
|
238
|
-
variant=
|
|
596
|
+
variant={primaryAction === 'stop' ? 'inverse' : 'primary'}
|
|
239
597
|
data-testid="composer-send"
|
|
598
|
+
data-action={primaryAction}
|
|
240
599
|
class={sendAttention?.bounce ? 'wc-composer-send-bounce' : undefined}
|
|
241
|
-
label={
|
|
600
|
+
label={primaryLabel}
|
|
242
601
|
disabled={!sendEnabled}
|
|
243
|
-
onclick={handleSend}
|
|
602
|
+
onclick={() => handleSend('control')}
|
|
244
603
|
>
|
|
245
|
-
{#if
|
|
604
|
+
{#if primaryAction === 'stop'}
|
|
246
605
|
<IconPlayerStop class="size-4 stroke-2" aria-hidden="true" />
|
|
606
|
+
{:else if primaryAction === 'confirmEdit'}
|
|
607
|
+
<IconCheck class="size-4 stroke-2" aria-hidden="true" />
|
|
247
608
|
{:else if sendIcon === 'arrow-up'}
|
|
248
609
|
<IconArrowUp class="size-4 stroke-2" aria-hidden="true" />
|
|
249
610
|
{:else}
|
|
@@ -1,10 +1,75 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
2
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
import type { InlineCompletionEvent, InlineCompletionLogger, InlineCompletionSource } from '../../inline-completion/index.js';
|
|
4
|
+
import type { CollectedReference, PromptReferencesLogger, ReferenceHoverEvent, ReferenceItem } from '../../prompt-references/index.js';
|
|
3
5
|
export type ComposerMessages = {
|
|
4
6
|
send: string;
|
|
5
7
|
stop: string;
|
|
8
|
+
/** The label of the primary control while an agent works and a message is typed: it adds the message to the queue. */
|
|
9
|
+
queue: string;
|
|
6
10
|
attach: string;
|
|
7
11
|
characterLimit: string;
|
|
12
|
+
/**
|
|
13
|
+
* What Tab does with the grey text after the caret, shown beside the send button while a suggestion shows, until the person
|
|
14
|
+
* has taken one suggestion (then they know, and the hint stays away for good in this browser).
|
|
15
|
+
*/
|
|
16
|
+
completionHint: string;
|
|
17
|
+
/** The same for a touch screen, which has no Tab key: the grey text is tapped. */
|
|
18
|
+
completionHintTouch: string;
|
|
19
|
+
};
|
|
20
|
+
/** Ghost-text suggestions for the box (see `@widgetic/design-system/inline-completion`). */
|
|
21
|
+
export type ComposerCompletion = {
|
|
22
|
+
/** Where suggestions come from. Without one (null, undefined) the box behaves as it always did. */
|
|
23
|
+
source: InlineCompletionSource | null | undefined;
|
|
24
|
+
debounceMs?: number;
|
|
25
|
+
dismissalLimit?: number;
|
|
26
|
+
/** Called once per transition (shown, accepted, dismissed, diverged, paused), for a host that measures them. */
|
|
27
|
+
onEvent?: (event: InlineCompletionEvent) => void;
|
|
28
|
+
/** A debug line per transition. Default: `console.debug` with the `[inline-completion]` prefix. */
|
|
29
|
+
log?: InlineCompletionLogger;
|
|
30
|
+
};
|
|
31
|
+
/** The words the box says about files a message may refer to. The design system holds no English: the host passes them. */
|
|
32
|
+
export type ComposerReferenceMessages = {
|
|
33
|
+
/** The line under the box while a file is attached: how to refer to it ("Type # to reference an attached file"). */
|
|
34
|
+
hint: string;
|
|
35
|
+
/** What a screen reader calls the list of files the `#` menu opens ("Attached files"). */
|
|
36
|
+
menuLabel: string;
|
|
37
|
+
/** What the X of a badge is called, with `{name}` for the file's name ("Remove {name}"). */
|
|
38
|
+
remove: string;
|
|
39
|
+
};
|
|
40
|
+
/** Files a message may refer to with `#` (see `@widgetic/design-system/prompt-references`). */
|
|
41
|
+
export type ComposerReferences = {
|
|
42
|
+
/** The files that can be referenced, in tray order. A file without a label is not in the list. */
|
|
43
|
+
items: readonly ReferenceItem[];
|
|
44
|
+
messages: ComposerReferenceMessages;
|
|
45
|
+
/** The pointer is on a badge, or the keys are on a menu row: the host rings the same file in its tray. `label: null` when it left. */
|
|
46
|
+
onHover?: (event: ReferenceHoverEvent) => void;
|
|
47
|
+
/** The character that starts a reference. Default `#`. */
|
|
48
|
+
triggerCharacter?: string;
|
|
49
|
+
/** The most references one message may carry (the request's own cap). Default: no cap. */
|
|
50
|
+
maxReferences?: number;
|
|
51
|
+
/** A debug line per transition. Default: `console.debug` with the `[prompt-references]` prefix. */
|
|
52
|
+
log?: PromptReferencesLogger;
|
|
53
|
+
};
|
|
54
|
+
/** What a send tells the host besides the text. It is given only when the box was given `references`. */
|
|
55
|
+
export type ComposerSendOptions = {
|
|
56
|
+
/** The attached files the text names, once each and in order of first appearance; `id` is the one the host gave the item. */
|
|
57
|
+
references: CollectedReference[];
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* A queued message is being edited in the composer: the text above the pill is that message, the pill says so and closes the
|
|
61
|
+
* edit (the changes are dropped), and the primary control is a check that saves them. Enter saves, Escape closes.
|
|
62
|
+
*/
|
|
63
|
+
export type ComposerEditing = {
|
|
64
|
+
/** The pill ("Editing"). */
|
|
65
|
+
label: string;
|
|
66
|
+
/** The label of the pill's close mark ("Discard changes"). */
|
|
67
|
+
closeLabel: string;
|
|
68
|
+
/** The label of the check ("Save changes"). */
|
|
69
|
+
confirmLabel: string;
|
|
70
|
+
onClose: () => void;
|
|
71
|
+
/** Called with the trimmed text. */
|
|
72
|
+
onConfirm: (text: string) => void;
|
|
8
73
|
};
|
|
9
74
|
export type ComposerModelOption = {
|
|
10
75
|
id: string;
|
|
@@ -24,13 +89,35 @@ export type ComposerProps = HTMLAttributes<HTMLDivElement> & {
|
|
|
24
89
|
selectedModelId?: string | null;
|
|
25
90
|
onSelectModel?: (modelId: string) => void;
|
|
26
91
|
messages?: Partial<ComposerMessages>;
|
|
27
|
-
|
|
92
|
+
/**
|
|
93
|
+
* The text is what a person reads: a reference is the word `#hero_banner`, whatever room its badge takes in the box. With
|
|
94
|
+
* `references`, `options.references` lists the attached files the text names; without it there is no second argument.
|
|
95
|
+
*/
|
|
96
|
+
onSend?: (text: string, options?: ComposerSendOptions) => void;
|
|
28
97
|
onStop?: () => void;
|
|
98
|
+
/**
|
|
99
|
+
* Takes a message typed while an agent works (`busy`): the host puts it in a queue. Given, the primary control is a send
|
|
100
|
+
* control while a text is typed (it queues) and Stop while none is, and Enter never stops. Left out, a busy composer can only
|
|
101
|
+
* stop, as before.
|
|
102
|
+
*/
|
|
103
|
+
onQueue?: (text: string) => void;
|
|
104
|
+
/** Set while a queued message is being edited in the composer; `null` or left out otherwise. */
|
|
105
|
+
editing?: ComposerEditing | null;
|
|
29
106
|
/** Figma side panel uses arrow-up on the primary send control; default is paper-plane. */
|
|
30
107
|
sendIcon?: 'send' | 'arrow-up';
|
|
31
108
|
leading?: Snippet;
|
|
32
109
|
trailing?: Snippet;
|
|
33
110
|
attachments?: Snippet;
|
|
111
|
+
/**
|
|
112
|
+
* Ghost text after the caret, taken with Tab (or a tap): a likely continuation of what is typed. Without it the box is as it
|
|
113
|
+
* was. Enter still sends, and the suggestion goes away with the message.
|
|
114
|
+
*/
|
|
115
|
+
completion?: ComposerCompletion;
|
|
116
|
+
/**
|
|
117
|
+
* Files attached to the message that its text may refer to: `#` after a space lists them with their pictures, and a choice
|
|
118
|
+
* becomes a badge (picture, name, X) inside the text. Without it the box is as it was: no menu, no badges, no listeners.
|
|
119
|
+
*/
|
|
120
|
+
references?: ComposerReferences;
|
|
34
121
|
/** Bounce + white tooltip on the send control (publish-before-send nudge). */
|
|
35
122
|
sendAttention?: {
|
|
36
123
|
bounce: boolean;
|