@oxy.so/bloom 4.7.0 → 4.9.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 (57) hide show
  1. package/docs/adoption-matrix.mdx +2 -2
  2. package/docs/ai-chat.mdx +21 -0
  3. package/docs/settings-modal.mdx +1 -1
  4. package/lib/commonjs/ai-chat/AiChatContainer.js +384 -77
  5. package/lib/commonjs/ai-chat/AiChatContainer.js.map +1 -1
  6. package/lib/commonjs/ai-chat/context.js +28 -1
  7. package/lib/commonjs/ai-chat/context.js.map +1 -1
  8. package/lib/commonjs/ai-chat/index.js +6 -0
  9. package/lib/commonjs/ai-chat/index.js.map +1 -1
  10. package/lib/commonjs/ai-chat/index.web.js +6 -0
  11. package/lib/commonjs/ai-chat/index.web.js.map +1 -1
  12. package/lib/commonjs/settings-modal/SettingsStorage.js +1 -1
  13. package/lib/commonjs/settings-modal/SettingsStorage.js.map +1 -1
  14. package/lib/module/ai-chat/AiChatContainer.js +386 -79
  15. package/lib/module/ai-chat/AiChatContainer.js.map +1 -1
  16. package/lib/module/ai-chat/context.js +26 -0
  17. package/lib/module/ai-chat/context.js.map +1 -1
  18. package/lib/module/ai-chat/index.js +1 -1
  19. package/lib/module/ai-chat/index.js.map +1 -1
  20. package/lib/module/ai-chat/index.web.js +1 -1
  21. package/lib/module/ai-chat/index.web.js.map +1 -1
  22. package/lib/module/settings-modal/SettingsStorage.js +1 -1
  23. package/lib/module/settings-modal/SettingsStorage.js.map +1 -1
  24. package/lib/typescript/commonjs/ai-chat/AiChatContainer.d.ts +24 -1
  25. package/lib/typescript/commonjs/ai-chat/AiChatContainer.d.ts.map +1 -1
  26. package/lib/typescript/commonjs/ai-chat/context.d.ts +32 -0
  27. package/lib/typescript/commonjs/ai-chat/context.d.ts.map +1 -1
  28. package/lib/typescript/commonjs/ai-chat/index.d.ts +2 -2
  29. package/lib/typescript/commonjs/ai-chat/index.d.ts.map +1 -1
  30. package/lib/typescript/commonjs/ai-chat/index.web.d.ts +2 -2
  31. package/lib/typescript/commonjs/ai-chat/index.web.d.ts.map +1 -1
  32. package/lib/typescript/commonjs/ai-chat/types.d.ts +17 -0
  33. package/lib/typescript/commonjs/ai-chat/types.d.ts.map +1 -1
  34. package/lib/typescript/commonjs/settings-modal/SettingsStorage.d.ts.map +1 -1
  35. package/lib/typescript/commonjs/settings-modal/types.d.ts +2 -1
  36. package/lib/typescript/commonjs/settings-modal/types.d.ts.map +1 -1
  37. package/lib/typescript/module/ai-chat/AiChatContainer.d.ts +24 -1
  38. package/lib/typescript/module/ai-chat/AiChatContainer.d.ts.map +1 -1
  39. package/lib/typescript/module/ai-chat/context.d.ts +32 -0
  40. package/lib/typescript/module/ai-chat/context.d.ts.map +1 -1
  41. package/lib/typescript/module/ai-chat/index.d.ts +2 -2
  42. package/lib/typescript/module/ai-chat/index.d.ts.map +1 -1
  43. package/lib/typescript/module/ai-chat/index.web.d.ts +2 -2
  44. package/lib/typescript/module/ai-chat/index.web.d.ts.map +1 -1
  45. package/lib/typescript/module/ai-chat/types.d.ts +17 -0
  46. package/lib/typescript/module/ai-chat/types.d.ts.map +1 -1
  47. package/lib/typescript/module/settings-modal/SettingsStorage.d.ts.map +1 -1
  48. package/lib/typescript/module/settings-modal/types.d.ts +2 -1
  49. package/lib/typescript/module/settings-modal/types.d.ts.map +1 -1
  50. package/package.json +1 -1
  51. package/src/ai-chat/AiChatContainer.tsx +343 -59
  52. package/src/ai-chat/context.ts +39 -0
  53. package/src/ai-chat/index.ts +2 -2
  54. package/src/ai-chat/index.web.ts +2 -2
  55. package/src/ai-chat/types.ts +17 -0
  56. package/src/settings-modal/SettingsStorage.tsx +6 -4
  57. package/src/settings-modal/types.ts +2 -1
@@ -79,3 +79,42 @@ export const AiChatShellContext = createContext<AiChatShellState | null>(null);
79
79
  export function useAiChatShell(): AiChatShellState | null {
80
80
  return useContext(AiChatShellContext);
81
81
  }
82
+
83
+ /**
84
+ * The heights an `AiChatContainer floatingChrome` measures for the chrome it
85
+ * floats over its `children`: the header block at the top and the footer
86
+ * (`AgentThinking` + composer, with its fade strip) at the bottom, px.
87
+ */
88
+ export interface AiChatChromeInsets {
89
+ top: number;
90
+ bottom: number;
91
+ }
92
+
93
+ /** Where the thread is, reported to the container so each edge knows when to fade. */
94
+ export interface AiChatScrollMetrics {
95
+ offset: number;
96
+ viewport: number;
97
+ content: number;
98
+ }
99
+
100
+ /**
101
+ * What a floating-chrome container hands its `children`. Internal: the thread
102
+ * reads `insets` and reports its scroll; hosts read only the insets, through
103
+ * `useAiChatChromeInsets()`.
104
+ */
105
+ export interface AiChatFloatingChrome {
106
+ insets: AiChatChromeInsets;
107
+ reportScroll: (metrics: AiChatScrollMetrics) => void;
108
+ }
109
+
110
+ export const AiChatFloatingChromeContext = createContext<AiChatFloatingChrome | null>(null);
111
+
112
+ /**
113
+ * Inside `AiChatContainer floatingChrome`: how much of the top and bottom of the
114
+ * card the floating header and composer cover, so a custom child (an empty
115
+ * state, a scroller of its own) can keep its resting content clear of them.
116
+ * `null` anywhere else — outside a container, or in one that stacks its chrome.
117
+ */
118
+ export function useAiChatChromeInsets(): AiChatChromeInsets | null {
119
+ return useContext(AiChatFloatingChromeContext)?.insets ?? null;
120
+ }
@@ -15,8 +15,8 @@ export {
15
15
  AiChatUserMessage,
16
16
  } from './AiChatMessages';
17
17
  export { AiChatMobileHeader, AiChatResizeHandle, AiChatShell } from './AiChatShell';
18
- export { useAiChatShell } from './context';
19
- export type { AiChatShellState } from './context';
18
+ export { useAiChatChromeInsets, useAiChatShell } from './context';
19
+ export type { AiChatChromeInsets, AiChatShellState } from './context';
20
20
  export type {
21
21
  AiChatAssistantMessageProps,
22
22
  AiChatBulletListProps,
@@ -20,8 +20,8 @@ export {
20
20
  AiChatUserMessage,
21
21
  } from './AiChatMessages';
22
22
  export { AiChatMobileHeader, AiChatResizeHandle, AiChatShell } from './AiChatShell';
23
- export { useAiChatShell } from './context';
24
- export type { AiChatShellState } from './context';
23
+ export { useAiChatChromeInsets, useAiChatShell } from './context';
24
+ export type { AiChatChromeInsets, AiChatShellState } from './context';
25
25
  export type {
26
26
  AiChatAssistantMessageProps,
27
27
  AiChatBulletListProps,
@@ -317,6 +317,23 @@ export interface AiChatContainerProps {
317
317
  * `false` leaves the root transparent.
318
318
  */
319
319
  surface?: boolean;
320
+ /**
321
+ * Float the header and the composer OVER the transcript instead of stacking
322
+ * them around it. Default `false`: header row, thread, footer, as siblings.
323
+ *
324
+ * With it, `children` fill the whole card and scroll BEHIND both: the header
325
+ * slot and breadcrumb row are pinned to the top with no band of their own,
326
+ * the footer (`AgentThinking` + `composer`) to the bottom. Each edge paints a
327
+ * fade of the card's surface only while the transcript actually runs under
328
+ * it, ramping in over the first px of overlap. An `AiChatThread` inside pads
329
+ * its content by the measured heights of both, so the first and last turns
330
+ * rest clear of them; a custom child reads the same numbers from
331
+ * `useAiChatChromeInsets()`.
332
+ *
333
+ * The fades are background-secondary; with `surface={false}` there is no
334
+ * known colour to fade to, so the chrome floats without them.
335
+ */
336
+ floatingChrome?: boolean;
320
337
  labels?: AiChatContainerLabels;
321
338
  style?: StyleProp<ViewStyle>;
322
339
  testID?: string;
@@ -446,10 +446,12 @@ export function SettingsStoragePage({
446
446
 
447
447
  return (
448
448
  <View testID={testID} style={[styles.page, settingsRingVars(palette), style]}>
449
- <FileUpload
450
- {...upload}
451
- testID={testID ? `${testID}-dropzone` : undefined}
452
- />
449
+ {upload === false ? null : (
450
+ <FileUpload
451
+ {...upload}
452
+ testID={testID ? `${testID}-dropzone` : undefined}
453
+ />
454
+ )}
453
455
 
454
456
  <View style={[styles.table, { borderColor: palette.separator }]} testID={testID ? `${testID}-table` : undefined}>
455
457
  <View style={styles.toolbar}>
@@ -320,8 +320,9 @@ export interface SettingsStoragePageProps {
320
320
  * The dropzone's props — Bloom's `FileUpload`. Omitted, it runs a
321
321
  * self-simulating demo; pass `file`/`progress`/`onFileSelected` for a real
322
322
  * upload, and add the finished file to `files` from `onUploadComplete`.
323
+ * `false` drops the dropzone: a read-only store of what already exists.
323
324
  */
324
- upload?: Omit<FileUploadProps, 'style' | 'testID'>;
325
+ upload?: Omit<FileUploadProps, 'style' | 'testID'> | false;
325
326
  kinds?: SettingsFileKind[];
326
327
  selectedIds?: string[];
327
328
  defaultSelectedIds?: string[];