@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.
Files changed (134) hide show
  1. package/docs/adoption-matrix.mdx +3 -3
  2. package/docs/ai-chat.mdx +32 -1
  3. package/docs/composer-panel.mdx +4 -0
  4. package/lib/commonjs/ai-chat/AiChat.js +2 -1
  5. package/lib/commonjs/ai-chat/AiChat.js.map +1 -1
  6. package/lib/commonjs/ai-chat/AiChat.web.js +2 -1
  7. package/lib/commonjs/ai-chat/AiChat.web.js.map +1 -1
  8. package/lib/commonjs/ai-chat/AiChatControls.js +60 -4
  9. package/lib/commonjs/ai-chat/AiChatControls.js.map +1 -1
  10. package/lib/commonjs/ai-chat/AiChatFeedbackRowBase.js +40 -12
  11. package/lib/commonjs/ai-chat/AiChatFeedbackRowBase.js.map +1 -1
  12. package/lib/commonjs/ai-chat/AiChatMessages.js +31 -5
  13. package/lib/commonjs/ai-chat/AiChatMessages.js.map +1 -1
  14. package/lib/commonjs/ai-chat/bindAiChat.js +10 -0
  15. package/lib/commonjs/ai-chat/bindAiChat.js.map +1 -1
  16. package/lib/commonjs/ai-chat/index.js +1 -1
  17. package/lib/commonjs/ai-chat/index.js.map +1 -1
  18. package/lib/commonjs/ai-chat/index.web.js +1 -1
  19. package/lib/commonjs/ai-chat/index.web.js.map +1 -1
  20. package/lib/commonjs/ai-chat/shared.js +11 -2
  21. package/lib/commonjs/ai-chat/shared.js.map +1 -1
  22. package/lib/commonjs/composer-panel/AttachmentStrip.js +108 -8
  23. package/lib/commonjs/composer-panel/AttachmentStrip.js.map +1 -1
  24. package/lib/commonjs/composer-panel/ComposerPanelBase.js +6 -2
  25. package/lib/commonjs/composer-panel/ComposerPanelBase.js.map +1 -1
  26. package/lib/commonjs/composer-panel/ComposerPillBase.js +2 -1
  27. package/lib/commonjs/composer-panel/ComposerPillBase.js.map +1 -1
  28. package/lib/commonjs/composer-panel/shared.js +2 -0
  29. package/lib/commonjs/composer-panel/shared.js.map +1 -1
  30. package/lib/commonjs/composer-panel/use-attachment-queue.js +5 -2
  31. package/lib/commonjs/composer-panel/use-attachment-queue.js.map +1 -1
  32. package/lib/module/ai-chat/AiChat.js +1 -0
  33. package/lib/module/ai-chat/AiChat.js.map +1 -1
  34. package/lib/module/ai-chat/AiChat.web.js +1 -0
  35. package/lib/module/ai-chat/AiChat.web.js.map +1 -1
  36. package/lib/module/ai-chat/AiChatControls.js +58 -4
  37. package/lib/module/ai-chat/AiChatControls.js.map +1 -1
  38. package/lib/module/ai-chat/AiChatFeedbackRowBase.js +41 -13
  39. package/lib/module/ai-chat/AiChatFeedbackRowBase.js.map +1 -1
  40. package/lib/module/ai-chat/AiChatMessages.js +30 -4
  41. package/lib/module/ai-chat/AiChatMessages.js.map +1 -1
  42. package/lib/module/ai-chat/bindAiChat.js +11 -1
  43. package/lib/module/ai-chat/bindAiChat.js.map +1 -1
  44. package/lib/module/ai-chat/index.js +2 -2
  45. package/lib/module/ai-chat/index.js.map +1 -1
  46. package/lib/module/ai-chat/index.web.js +2 -2
  47. package/lib/module/ai-chat/index.web.js.map +1 -1
  48. package/lib/module/ai-chat/shared.js +11 -2
  49. package/lib/module/ai-chat/shared.js.map +1 -1
  50. package/lib/module/composer-panel/AttachmentStrip.js +108 -8
  51. package/lib/module/composer-panel/AttachmentStrip.js.map +1 -1
  52. package/lib/module/composer-panel/ComposerPanelBase.js +6 -2
  53. package/lib/module/composer-panel/ComposerPanelBase.js.map +1 -1
  54. package/lib/module/composer-panel/ComposerPillBase.js +2 -1
  55. package/lib/module/composer-panel/ComposerPillBase.js.map +1 -1
  56. package/lib/module/composer-panel/shared.js +2 -0
  57. package/lib/module/composer-panel/shared.js.map +1 -1
  58. package/lib/module/composer-panel/use-attachment-queue.js +5 -2
  59. package/lib/module/composer-panel/use-attachment-queue.js.map +1 -1
  60. package/lib/typescript/commonjs/ai-chat/AiChat.d.ts +4 -0
  61. package/lib/typescript/commonjs/ai-chat/AiChat.d.ts.map +1 -1
  62. package/lib/typescript/commonjs/ai-chat/AiChat.web.d.ts +4 -0
  63. package/lib/typescript/commonjs/ai-chat/AiChat.web.d.ts.map +1 -1
  64. package/lib/typescript/commonjs/ai-chat/AiChatControls.d.ts +22 -1
  65. package/lib/typescript/commonjs/ai-chat/AiChatControls.d.ts.map +1 -1
  66. package/lib/typescript/commonjs/ai-chat/AiChatFeedbackRowBase.d.ts +5 -2
  67. package/lib/typescript/commonjs/ai-chat/AiChatFeedbackRowBase.d.ts.map +1 -1
  68. package/lib/typescript/commonjs/ai-chat/AiChatMessages.d.ts +1 -1
  69. package/lib/typescript/commonjs/ai-chat/AiChatMessages.d.ts.map +1 -1
  70. package/lib/typescript/commonjs/ai-chat/bindAiChat.d.ts +5 -1
  71. package/lib/typescript/commonjs/ai-chat/bindAiChat.d.ts.map +1 -1
  72. package/lib/typescript/commonjs/ai-chat/index.d.ts +3 -3
  73. package/lib/typescript/commonjs/ai-chat/index.d.ts.map +1 -1
  74. package/lib/typescript/commonjs/ai-chat/index.web.d.ts +3 -3
  75. package/lib/typescript/commonjs/ai-chat/index.web.d.ts.map +1 -1
  76. package/lib/typescript/commonjs/ai-chat/shared.d.ts +2 -2
  77. package/lib/typescript/commonjs/ai-chat/shared.d.ts.map +1 -1
  78. package/lib/typescript/commonjs/ai-chat/types.d.ts +43 -5
  79. package/lib/typescript/commonjs/ai-chat/types.d.ts.map +1 -1
  80. package/lib/typescript/commonjs/composer-panel/AttachmentStrip.d.ts +10 -1
  81. package/lib/typescript/commonjs/composer-panel/AttachmentStrip.d.ts.map +1 -1
  82. package/lib/typescript/commonjs/composer-panel/ComposerPanelBase.d.ts +1 -1
  83. package/lib/typescript/commonjs/composer-panel/ComposerPanelBase.d.ts.map +1 -1
  84. package/lib/typescript/commonjs/composer-panel/shared.d.ts +3 -0
  85. package/lib/typescript/commonjs/composer-panel/shared.d.ts.map +1 -1
  86. package/lib/typescript/commonjs/composer-panel/types.d.ts +11 -0
  87. package/lib/typescript/commonjs/composer-panel/types.d.ts.map +1 -1
  88. package/lib/typescript/commonjs/composer-panel/use-attachment-queue.d.ts.map +1 -1
  89. package/lib/typescript/module/ai-chat/AiChat.d.ts +4 -0
  90. package/lib/typescript/module/ai-chat/AiChat.d.ts.map +1 -1
  91. package/lib/typescript/module/ai-chat/AiChat.web.d.ts +4 -0
  92. package/lib/typescript/module/ai-chat/AiChat.web.d.ts.map +1 -1
  93. package/lib/typescript/module/ai-chat/AiChatControls.d.ts +22 -1
  94. package/lib/typescript/module/ai-chat/AiChatControls.d.ts.map +1 -1
  95. package/lib/typescript/module/ai-chat/AiChatFeedbackRowBase.d.ts +5 -2
  96. package/lib/typescript/module/ai-chat/AiChatFeedbackRowBase.d.ts.map +1 -1
  97. package/lib/typescript/module/ai-chat/AiChatMessages.d.ts +1 -1
  98. package/lib/typescript/module/ai-chat/AiChatMessages.d.ts.map +1 -1
  99. package/lib/typescript/module/ai-chat/bindAiChat.d.ts +5 -1
  100. package/lib/typescript/module/ai-chat/bindAiChat.d.ts.map +1 -1
  101. package/lib/typescript/module/ai-chat/index.d.ts +3 -3
  102. package/lib/typescript/module/ai-chat/index.d.ts.map +1 -1
  103. package/lib/typescript/module/ai-chat/index.web.d.ts +3 -3
  104. package/lib/typescript/module/ai-chat/index.web.d.ts.map +1 -1
  105. package/lib/typescript/module/ai-chat/shared.d.ts +2 -2
  106. package/lib/typescript/module/ai-chat/shared.d.ts.map +1 -1
  107. package/lib/typescript/module/ai-chat/types.d.ts +43 -5
  108. package/lib/typescript/module/ai-chat/types.d.ts.map +1 -1
  109. package/lib/typescript/module/composer-panel/AttachmentStrip.d.ts +10 -1
  110. package/lib/typescript/module/composer-panel/AttachmentStrip.d.ts.map +1 -1
  111. package/lib/typescript/module/composer-panel/ComposerPanelBase.d.ts +1 -1
  112. package/lib/typescript/module/composer-panel/ComposerPanelBase.d.ts.map +1 -1
  113. package/lib/typescript/module/composer-panel/shared.d.ts +3 -0
  114. package/lib/typescript/module/composer-panel/shared.d.ts.map +1 -1
  115. package/lib/typescript/module/composer-panel/types.d.ts +11 -0
  116. package/lib/typescript/module/composer-panel/types.d.ts.map +1 -1
  117. package/lib/typescript/module/composer-panel/use-attachment-queue.d.ts.map +1 -1
  118. package/package.json +1 -1
  119. package/src/ai-chat/AiChat.tsx +1 -0
  120. package/src/ai-chat/AiChat.web.tsx +1 -0
  121. package/src/ai-chat/AiChatControls.tsx +58 -3
  122. package/src/ai-chat/AiChatFeedbackRowBase.tsx +45 -17
  123. package/src/ai-chat/AiChatMessages.tsx +24 -1
  124. package/src/ai-chat/bindAiChat.tsx +19 -2
  125. package/src/ai-chat/index.ts +3 -1
  126. package/src/ai-chat/index.web.ts +3 -1
  127. package/src/ai-chat/shared.ts +11 -2
  128. package/src/ai-chat/types.ts +45 -5
  129. package/src/composer-panel/AttachmentStrip.tsx +98 -6
  130. package/src/composer-panel/ComposerPanelBase.tsx +4 -0
  131. package/src/composer-panel/ComposerPillBase.tsx +1 -0
  132. package/src/composer-panel/shared.ts +5 -0
  133. package/src/composer-panel/types.ts +11 -0
  134. 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>
@@ -690,6 +690,7 @@ const DEFAULT_PANEL_LABELS = {
690
690
  send: 'Send message',
691
691
  stop: 'Stop generating',
692
692
  remove: 'Remove',
693
+ retry: 'Retry',
693
694
  };
694
695
 
695
696
  /**
@@ -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
- /** Anything carrying a progress value — the closed ring at 100 included — is still the queue's. */
8
- const inFlight = (attachment: ComposerPanelAttachment) => attachment.progress !== undefined;
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(