@oxy.so/bloom 4.19.1 → 4.20.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/docs/adoption-matrix.mdx +3 -3
- package/docs/ai-chat.mdx +32 -1
- package/docs/composer-panel.mdx +4 -0
- package/lib/commonjs/ai-chat/AiChat.js +2 -1
- package/lib/commonjs/ai-chat/AiChat.js.map +1 -1
- package/lib/commonjs/ai-chat/AiChat.web.js +2 -1
- package/lib/commonjs/ai-chat/AiChat.web.js.map +1 -1
- package/lib/commonjs/ai-chat/AiChatControls.js +60 -4
- package/lib/commonjs/ai-chat/AiChatControls.js.map +1 -1
- package/lib/commonjs/ai-chat/AiChatFeedbackRowBase.js +40 -12
- package/lib/commonjs/ai-chat/AiChatFeedbackRowBase.js.map +1 -1
- package/lib/commonjs/ai-chat/AiChatMessages.js +31 -5
- package/lib/commonjs/ai-chat/AiChatMessages.js.map +1 -1
- package/lib/commonjs/ai-chat/bindAiChat.js +10 -0
- package/lib/commonjs/ai-chat/bindAiChat.js.map +1 -1
- package/lib/commonjs/ai-chat/index.js +1 -1
- package/lib/commonjs/ai-chat/index.js.map +1 -1
- package/lib/commonjs/ai-chat/index.web.js +1 -1
- package/lib/commonjs/ai-chat/index.web.js.map +1 -1
- package/lib/commonjs/ai-chat/shared.js +11 -2
- package/lib/commonjs/ai-chat/shared.js.map +1 -1
- package/lib/commonjs/composer-panel/AttachmentStrip.js +108 -8
- package/lib/commonjs/composer-panel/AttachmentStrip.js.map +1 -1
- package/lib/commonjs/composer-panel/ComposerPanelBase.js +6 -2
- package/lib/commonjs/composer-panel/ComposerPanelBase.js.map +1 -1
- package/lib/commonjs/composer-panel/ComposerPillBase.js +2 -1
- package/lib/commonjs/composer-panel/ComposerPillBase.js.map +1 -1
- package/lib/commonjs/composer-panel/shared.js +2 -0
- package/lib/commonjs/composer-panel/shared.js.map +1 -1
- package/lib/commonjs/composer-panel/use-attachment-queue.js +5 -2
- package/lib/commonjs/composer-panel/use-attachment-queue.js.map +1 -1
- package/lib/module/ai-chat/AiChat.js +1 -0
- package/lib/module/ai-chat/AiChat.js.map +1 -1
- package/lib/module/ai-chat/AiChat.web.js +1 -0
- package/lib/module/ai-chat/AiChat.web.js.map +1 -1
- package/lib/module/ai-chat/AiChatControls.js +58 -4
- package/lib/module/ai-chat/AiChatControls.js.map +1 -1
- package/lib/module/ai-chat/AiChatFeedbackRowBase.js +41 -13
- package/lib/module/ai-chat/AiChatFeedbackRowBase.js.map +1 -1
- package/lib/module/ai-chat/AiChatMessages.js +30 -4
- package/lib/module/ai-chat/AiChatMessages.js.map +1 -1
- package/lib/module/ai-chat/bindAiChat.js +11 -1
- package/lib/module/ai-chat/bindAiChat.js.map +1 -1
- package/lib/module/ai-chat/index.js +2 -2
- package/lib/module/ai-chat/index.js.map +1 -1
- package/lib/module/ai-chat/index.web.js +2 -2
- package/lib/module/ai-chat/index.web.js.map +1 -1
- package/lib/module/ai-chat/shared.js +11 -2
- package/lib/module/ai-chat/shared.js.map +1 -1
- package/lib/module/composer-panel/AttachmentStrip.js +108 -8
- package/lib/module/composer-panel/AttachmentStrip.js.map +1 -1
- package/lib/module/composer-panel/ComposerPanelBase.js +6 -2
- package/lib/module/composer-panel/ComposerPanelBase.js.map +1 -1
- package/lib/module/composer-panel/ComposerPillBase.js +2 -1
- package/lib/module/composer-panel/ComposerPillBase.js.map +1 -1
- package/lib/module/composer-panel/shared.js +2 -0
- package/lib/module/composer-panel/shared.js.map +1 -1
- package/lib/module/composer-panel/use-attachment-queue.js +5 -2
- package/lib/module/composer-panel/use-attachment-queue.js.map +1 -1
- package/lib/typescript/commonjs/ai-chat/AiChat.d.ts +4 -0
- package/lib/typescript/commonjs/ai-chat/AiChat.d.ts.map +1 -1
- package/lib/typescript/commonjs/ai-chat/AiChat.web.d.ts +4 -0
- package/lib/typescript/commonjs/ai-chat/AiChat.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/ai-chat/AiChatControls.d.ts +22 -1
- package/lib/typescript/commonjs/ai-chat/AiChatControls.d.ts.map +1 -1
- package/lib/typescript/commonjs/ai-chat/AiChatFeedbackRowBase.d.ts +5 -2
- package/lib/typescript/commonjs/ai-chat/AiChatFeedbackRowBase.d.ts.map +1 -1
- package/lib/typescript/commonjs/ai-chat/AiChatMessages.d.ts +1 -1
- package/lib/typescript/commonjs/ai-chat/AiChatMessages.d.ts.map +1 -1
- package/lib/typescript/commonjs/ai-chat/bindAiChat.d.ts +5 -1
- package/lib/typescript/commonjs/ai-chat/bindAiChat.d.ts.map +1 -1
- package/lib/typescript/commonjs/ai-chat/index.d.ts +3 -3
- package/lib/typescript/commonjs/ai-chat/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ai-chat/index.web.d.ts +3 -3
- package/lib/typescript/commonjs/ai-chat/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/ai-chat/shared.d.ts +2 -2
- package/lib/typescript/commonjs/ai-chat/shared.d.ts.map +1 -1
- package/lib/typescript/commonjs/ai-chat/types.d.ts +43 -5
- package/lib/typescript/commonjs/ai-chat/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/composer-panel/AttachmentStrip.d.ts +10 -1
- package/lib/typescript/commonjs/composer-panel/AttachmentStrip.d.ts.map +1 -1
- package/lib/typescript/commonjs/composer-panel/ComposerPanelBase.d.ts +1 -1
- package/lib/typescript/commonjs/composer-panel/ComposerPanelBase.d.ts.map +1 -1
- package/lib/typescript/commonjs/composer-panel/shared.d.ts +3 -0
- package/lib/typescript/commonjs/composer-panel/shared.d.ts.map +1 -1
- package/lib/typescript/commonjs/composer-panel/types.d.ts +11 -0
- package/lib/typescript/commonjs/composer-panel/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/composer-panel/use-attachment-queue.d.ts.map +1 -1
- package/lib/typescript/module/ai-chat/AiChat.d.ts +4 -0
- package/lib/typescript/module/ai-chat/AiChat.d.ts.map +1 -1
- package/lib/typescript/module/ai-chat/AiChat.web.d.ts +4 -0
- package/lib/typescript/module/ai-chat/AiChat.web.d.ts.map +1 -1
- package/lib/typescript/module/ai-chat/AiChatControls.d.ts +22 -1
- package/lib/typescript/module/ai-chat/AiChatControls.d.ts.map +1 -1
- package/lib/typescript/module/ai-chat/AiChatFeedbackRowBase.d.ts +5 -2
- package/lib/typescript/module/ai-chat/AiChatFeedbackRowBase.d.ts.map +1 -1
- package/lib/typescript/module/ai-chat/AiChatMessages.d.ts +1 -1
- package/lib/typescript/module/ai-chat/AiChatMessages.d.ts.map +1 -1
- package/lib/typescript/module/ai-chat/bindAiChat.d.ts +5 -1
- package/lib/typescript/module/ai-chat/bindAiChat.d.ts.map +1 -1
- package/lib/typescript/module/ai-chat/index.d.ts +3 -3
- package/lib/typescript/module/ai-chat/index.d.ts.map +1 -1
- package/lib/typescript/module/ai-chat/index.web.d.ts +3 -3
- package/lib/typescript/module/ai-chat/index.web.d.ts.map +1 -1
- package/lib/typescript/module/ai-chat/shared.d.ts +2 -2
- package/lib/typescript/module/ai-chat/shared.d.ts.map +1 -1
- package/lib/typescript/module/ai-chat/types.d.ts +43 -5
- package/lib/typescript/module/ai-chat/types.d.ts.map +1 -1
- package/lib/typescript/module/composer-panel/AttachmentStrip.d.ts +10 -1
- package/lib/typescript/module/composer-panel/AttachmentStrip.d.ts.map +1 -1
- package/lib/typescript/module/composer-panel/ComposerPanelBase.d.ts +1 -1
- package/lib/typescript/module/composer-panel/ComposerPanelBase.d.ts.map +1 -1
- package/lib/typescript/module/composer-panel/shared.d.ts +3 -0
- package/lib/typescript/module/composer-panel/shared.d.ts.map +1 -1
- package/lib/typescript/module/composer-panel/types.d.ts +11 -0
- package/lib/typescript/module/composer-panel/types.d.ts.map +1 -1
- package/lib/typescript/module/composer-panel/use-attachment-queue.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/ai-chat/AiChat.tsx +1 -0
- package/src/ai-chat/AiChat.web.tsx +1 -0
- package/src/ai-chat/AiChatControls.tsx +58 -3
- package/src/ai-chat/AiChatFeedbackRowBase.tsx +45 -17
- package/src/ai-chat/AiChatMessages.tsx +24 -1
- package/src/ai-chat/bindAiChat.tsx +19 -2
- package/src/ai-chat/index.ts +3 -1
- package/src/ai-chat/index.web.ts +3 -1
- package/src/ai-chat/shared.ts +11 -2
- package/src/ai-chat/types.ts +45 -5
- package/src/composer-panel/AttachmentStrip.tsx +98 -6
- package/src/composer-panel/ComposerPanelBase.tsx +4 -0
- package/src/composer-panel/ComposerPillBase.tsx +1 -0
- package/src/composer-panel/shared.ts +5 -0
- package/src/composer-panel/types.ts +11 -0
- package/src/composer-panel/use-attachment-queue.ts +5 -2
|
@@ -50,6 +50,7 @@ const DEFAULT_LABELS: Required<ComposerPanelLabels> = {
|
|
|
50
50
|
send: 'Send message',
|
|
51
51
|
stop: 'Stop generating',
|
|
52
52
|
remove: 'Remove',
|
|
53
|
+
retry: 'Retry',
|
|
53
54
|
};
|
|
54
55
|
|
|
55
56
|
/**
|
|
@@ -143,6 +144,7 @@ export function ComposerPanelBase({
|
|
|
143
144
|
onListeningChange,
|
|
144
145
|
attachments,
|
|
145
146
|
onRemoveAttachment,
|
|
147
|
+
onAttachmentRetry,
|
|
146
148
|
status,
|
|
147
149
|
emptyAction,
|
|
148
150
|
onKeyPress: onKeyPressProp,
|
|
@@ -235,7 +237,9 @@ export function ComposerPanelBase({
|
|
|
235
237
|
attachments={attachments ?? []}
|
|
236
238
|
palette={palette}
|
|
237
239
|
onRemove={onRemoveAttachment}
|
|
240
|
+
onRetry={onAttachmentRetry}
|
|
238
241
|
removeLabel={labels.remove}
|
|
242
|
+
retryLabel={labels.retry}
|
|
239
243
|
/>
|
|
240
244
|
</View>
|
|
241
245
|
</Collapse>
|
|
@@ -74,6 +74,9 @@ export interface ComposerPalette {
|
|
|
74
74
|
accent500: string;
|
|
75
75
|
/** `border-focus-ring`. */
|
|
76
76
|
focusRing: string;
|
|
77
|
+
/** A failed tile: the error subtle surface and its paired foreground. */
|
|
78
|
+
errorSurface: string;
|
|
79
|
+
errorText: string;
|
|
77
80
|
/** `shadow-xs`, `shadow-dropdown` and the card's raw Figma shadow. */
|
|
78
81
|
shadowXs: string;
|
|
79
82
|
shadowDropdown: string;
|
|
@@ -121,6 +124,8 @@ export function resolveComposerPalette(theme: Theme): ComposerPalette {
|
|
|
121
124
|
accent400: c.primary,
|
|
122
125
|
accent500: c.primarySubtleForeground,
|
|
123
126
|
focusRing: c.primary,
|
|
127
|
+
errorSurface: c.errorSubtle,
|
|
128
|
+
errorText: c.errorSubtleForeground,
|
|
124
129
|
shadowXs: dark ? BUTTON_SHADOW.dark : BUTTON_SHADOW.light,
|
|
125
130
|
shadowDropdown: dark ? MENU_SHADOW.dark : MENU_SHADOW.light,
|
|
126
131
|
shadowCard: '0 1px 0.5px 0 rgba(0, 0, 0, 0.02), 0 4px 2px 0 rgba(0, 0, 0, 0.02)',
|
|
@@ -80,6 +80,13 @@ export interface ComposerPanelAttachment {
|
|
|
80
80
|
* once the file has landed — that also reveals the dismiss.
|
|
81
81
|
*/
|
|
82
82
|
progress?: number;
|
|
83
|
+
/**
|
|
84
|
+
* The upload failed, and why ("Too large", "Network error"). The tile turns
|
|
85
|
+
* to the error surface and shows this in place of the name; the ring and the
|
|
86
|
+
* percentage go (any `progress` is ignored) and the dismiss comes back. With
|
|
87
|
+
* `ComposerPanel`'s `onAttachmentRetry` it also gets a retry button.
|
|
88
|
+
*/
|
|
89
|
+
error?: string;
|
|
83
90
|
}
|
|
84
91
|
|
|
85
92
|
// ---------------------------------------------------------------------------
|
|
@@ -195,6 +202,8 @@ export interface ComposerPanelLabels {
|
|
|
195
202
|
stop?: string;
|
|
196
203
|
/** Default `'Remove'` — prefixed to the file name on a tile's dismiss. */
|
|
197
204
|
remove?: string;
|
|
205
|
+
/** Default `'Retry'` — prefixed to the file name on a failed tile's retry. */
|
|
206
|
+
retry?: string;
|
|
198
207
|
}
|
|
199
208
|
|
|
200
209
|
export interface ComposerPanelProps {
|
|
@@ -256,6 +265,8 @@ export interface ComposerPanelProps {
|
|
|
256
265
|
/** Tiles above the prompt. Each one's `progress` drives its upload ring. */
|
|
257
266
|
attachments?: ReadonlyArray<ComposerPanelAttachment>;
|
|
258
267
|
onRemoveAttachment?: (id: string) => void;
|
|
268
|
+
/** Draws a retry button on every tile with an `error`; called with its id. */
|
|
269
|
+
onAttachmentRetry?: (id: string) => void;
|
|
259
270
|
|
|
260
271
|
/** The tab on the card's top edge — typically `<ComposerPanelStatusTab />`. */
|
|
261
272
|
status?: ReactNode;
|
|
@@ -4,8 +4,11 @@ import type { ComposerAttachmentsProps, ComposerPanelAttachment } from './types'
|
|
|
4
4
|
|
|
5
5
|
const TICK_MS = 50;
|
|
6
6
|
|
|
7
|
-
/**
|
|
8
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Anything carrying a progress value — the closed ring at 100 included — is
|
|
9
|
+
* still the queue's, unless it failed: a failed file is done with.
|
|
10
|
+
*/
|
|
11
|
+
const inFlight = (attachment: ComposerPanelAttachment) => attachment.progress !== undefined && !attachment.error;
|
|
9
12
|
|
|
10
13
|
/** Keep the parent's order; keep our progress for files we already know. */
|
|
11
14
|
function reconcile(
|