@oxy.so/bloom 4.19.1 → 4.21.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 +6 -6
- package/docs/ai-chat.mdx +32 -1
- package/docs/button.mdx +1 -1
- package/docs/composer-panel.mdx +4 -0
- package/docs/design-tokens.mdx +22 -0
- package/docs/dialog.mdx +5 -0
- package/lib/commonjs/accordion/Accordion.js +7 -3
- package/lib/commonjs/accordion/Accordion.js.map +1 -1
- 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/button/Button.js +37 -1
- package/lib/commonjs/button/Button.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/commonjs/design-tokens/theme-css.js +24 -2
- package/lib/commonjs/design-tokens/theme-css.js.map +1 -1
- package/lib/commonjs/design-tokens/theme.css +8 -8
- package/lib/commonjs/dialog/DialogBottomSheet.js +19 -3
- package/lib/commonjs/dialog/DialogBottomSheet.js.map +1 -1
- package/lib/commonjs/dialog/DialogHeader.js +78 -6
- package/lib/commonjs/dialog/DialogHeader.js.map +1 -1
- package/lib/module/accordion/Accordion.js +7 -3
- package/lib/module/accordion/Accordion.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/button/Button.js +38 -2
- package/lib/module/button/Button.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/module/design-tokens/theme-css.js +23 -2
- package/lib/module/design-tokens/theme-css.js.map +1 -1
- package/lib/module/design-tokens/theme.css +8 -8
- package/lib/module/dialog/DialogBottomSheet.js +19 -3
- package/lib/module/dialog/DialogBottomSheet.js.map +1 -1
- package/lib/module/dialog/DialogHeader.js +76 -5
- package/lib/module/dialog/DialogHeader.js.map +1 -1
- package/lib/typescript/commonjs/accordion/Accordion.d.ts.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/button/Button.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/commonjs/design-tokens/theme-css.d.ts +9 -1
- package/lib/typescript/commonjs/design-tokens/theme-css.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/DialogBottomSheet.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/DialogHeader.d.ts +24 -0
- package/lib/typescript/commonjs/dialog/DialogHeader.d.ts.map +1 -1
- package/lib/typescript/module/accordion/Accordion.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/button/Button.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/lib/typescript/module/design-tokens/theme-css.d.ts +9 -1
- package/lib/typescript/module/design-tokens/theme-css.d.ts.map +1 -1
- package/lib/typescript/module/dialog/DialogBottomSheet.d.ts.map +1 -1
- package/lib/typescript/module/dialog/DialogHeader.d.ts +24 -0
- package/lib/typescript/module/dialog/DialogHeader.d.ts.map +1 -1
- package/package.json +5 -2
- package/src/accordion/Accordion.tsx +9 -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/button/Button.tsx +41 -3
- 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
- package/src/design-tokens/theme-css.ts +23 -2
- package/src/design-tokens/theme.css +8 -8
- package/src/dialog/DialogBottomSheet.tsx +21 -0
- package/src/dialog/DialogHeader.tsx +94 -11
package/docs/adoption-matrix.mdx
CHANGED
|
@@ -122,7 +122,7 @@ The classification is an EQUALITY in `src/__tests__/adoption-matrix.test.ts`, no
|
|
|
122
122
|
| `agent-log` | `@oxy.so/bloom/agent-log` + barrel | universal | `agent-log.mdx` | yes | 1 | | | | |
|
|
123
123
|
| `agent-progress` | `@oxy.so/bloom/agent-progress` + barrel | universal | `agent-progress.mdx` | yes | 1 | | | | reads |
|
|
124
124
|
| `agent-thinking` | `@oxy.so/bloom/agent-thinking` + barrel | universal | `agent-thinking.mdx` | yes | 1 | | | | |
|
|
125
|
-
| `ai-chat` | `@oxy.so/bloom/ai-chat` + barrel | web fork | `ai-chat.mdx` | yes |
|
|
125
|
+
| `ai-chat` | `@oxy.so/bloom/ai-chat` + barrel | web fork | `ai-chat.mdx` | yes | 10 | | | | reads |
|
|
126
126
|
| `ai-profile-card` | `@oxy.so/bloom/ai-profile-card` + barrel | universal | `ai-profile-card.mdx` | yes | 1 | | | | reads |
|
|
127
127
|
| `alert-dialog` | `@oxy.so/bloom/alert-dialog` + barrel | web fork | `alert-dialog.mdx` | yes | 1 | | | | |
|
|
128
128
|
| `animated-check` | `@oxy.so/bloom/animated-check` + barrel | universal | `animated-check.mdx` | yes | 2 | | | | |
|
|
@@ -172,8 +172,8 @@ The classification is an EQUALITY in `src/__tests__/adoption-matrix.test.ts`, no
|
|
|
172
172
|
| `data-table` | `@oxy.so/bloom/data-table` + barrel | universal | `data-table.mdx` | yes | 3 | | | | reads |
|
|
173
173
|
| `date-picker` | `@oxy.so/bloom/date-picker` + barrel | universal | `date-picker.mdx` | yes | 4 | reads | reads | | reads |
|
|
174
174
|
| `delivery-slot` | `@oxy.so/bloom/delivery-slot` + barrel | universal | `delivery-slot.mdx` | yes | 2 | reads | | | |
|
|
175
|
-
| `design-tokens` | `@oxy.so/bloom/design-tokens` + barrel | universal | `design-tokens.mdx` | yes |
|
|
176
|
-
| `dialog` | `@oxy.so/bloom/dialog` + barrel | web fork | `dialog.mdx` | yes |
|
|
175
|
+
| `design-tokens` | `@oxy.so/bloom/design-tokens` + barrel | universal | `design-tokens.mdx` | yes | 4 | | | | |
|
|
176
|
+
| `dialog` | `@oxy.so/bloom/dialog` + barrel | web fork | `dialog.mdx` | yes | 18 | | | | |
|
|
177
177
|
| `directions` | `@oxy.so/bloom/directions` + barrel | universal | `directions.mdx` | yes | 2 | | | | |
|
|
178
178
|
| `divider` | `@oxy.so/bloom/divider` + barrel | universal | `divider.mdx` | yes | 1 | | | | |
|
|
179
179
|
| `dot-grid-meter` | `@oxy.so/bloom/dot-grid-meter` + barrel | universal | `dot-grid-meter.mdx` | yes | 2 | | | | |
|
|
@@ -195,7 +195,7 @@ The classification is an EQUALITY in `src/__tests__/adoption-matrix.test.ts`, no
|
|
|
195
195
|
| `hooks` | `@oxy.so/bloom/hooks` + barrel | universal | `hooks.mdx` | yes | 11 | | | | reads |
|
|
196
196
|
| `hover-card` | `@oxy.so/bloom/hover-card` + barrel | web fork | `hover-card.mdx` | yes | 2 | | | reads | reads |
|
|
197
197
|
| `icon-circle` | `@oxy.so/bloom/icon-circle` + barrel | universal | `icon-circle.mdx` | yes | 1 | | | | |
|
|
198
|
-
| `icons` | `@oxy.so/bloom/icons` + barrel | universal | `icons.mdx` | yes |
|
|
198
|
+
| `icons` | `@oxy.so/bloom/icons` + barrel | universal | `icons.mdx` | yes | 52 | | | | |
|
|
199
199
|
| `image-aspect-ratio-cache` | `@oxy.so/bloom/image-aspect-ratio-cache` + barrel | universal | `image-aspect-ratio-cache.mdx` | yes | 1 | | | | |
|
|
200
200
|
| `image-resolver` | `@oxy.so/bloom/image-resolver` + barrel | universal | `image-resolver.mdx` | yes | 7 | | | | |
|
|
201
201
|
| `important-alerts-card` | `@oxy.so/bloom/important-alerts-card` + barrel | universal | `important-alerts-card.mdx` | yes | 1 | | | | |
|
|
@@ -290,7 +290,7 @@ The classification is an EQUALITY in `src/__tests__/adoption-matrix.test.ts`, no
|
|
|
290
290
|
| `stay-filters` | `@oxy.so/bloom/stay-filters` + barrel | universal | `stay-filters.mdx` | yes | 4 | n/a¹ | | | |
|
|
291
291
|
| `stay-search` | `@oxy.so/bloom/stay-search` + barrel | universal | `stay-search.mdx` | yes | 4 | | | | |
|
|
292
292
|
| `stepper` | `@oxy.so/bloom/stepper` + barrel | universal | `stepper.mdx` | yes | 3 | reads | | | |
|
|
293
|
-
| `styles` | `@oxy.so/bloom/styles` + barrel | universal | `styles.mdx` | yes |
|
|
293
|
+
| `styles` | `@oxy.so/bloom/styles` + barrel | universal | `styles.mdx` | yes | 67 | **UNCLASSIFIED** | | | |
|
|
294
294
|
| `subtle-hover` | `@oxy.so/bloom/subtle-hover` + barrel | universal | `subtle-hover.mdx` | yes | 1 | | | | |
|
|
295
295
|
| `surfaces` | `@oxy.so/bloom/surfaces` + barrel | web fork | `alert.mdx` | yes | 2 | | | | |
|
|
296
296
|
| `swipe-row` | `@oxy.so/bloom/swipe-row` + barrel | universal | `swipe-row.mdx` | yes | 1 | | | | |
|
|
@@ -304,7 +304,7 @@ The classification is an EQUALITY in `src/__tests__/adoption-matrix.test.ts`, no
|
|
|
304
304
|
| `tenancy` | `@oxy.so/bloom/tenancy` + barrel | universal | `tenancy.mdx` | yes | 3 | | n/a¹ | | |
|
|
305
305
|
| `text-field` | `@oxy.so/bloom/text-field` + barrel | universal | `text-field.mdx` | yes | 13 | reads | reads | | |
|
|
306
306
|
| `textarea` | `@oxy.so/bloom/textarea` + barrel | universal | `textarea.mdx` | yes | 4 | reads | reads | | n/a¹ |
|
|
307
|
-
| `theme` | `@oxy.so/bloom/theme` + barrel | web fork | `theme.mdx` | yes |
|
|
307
|
+
| `theme` | `@oxy.so/bloom/theme` + barrel | web fork | `theme.mdx` | yes | 306 | | | n/a¹ | reads |
|
|
308
308
|
| `theme-toggle` | `@oxy.so/bloom/theme-toggle` + barrel | universal | `theme-toggle.mdx` | yes | 1 | n/a¹ | | | |
|
|
309
309
|
| `toast` | `@oxy.so/bloom/toast` + barrel | universal | `toast.mdx` | yes | 17 | | | | |
|
|
310
310
|
| `tooltip` | `@oxy.so/bloom/tooltip` + barrel | web fork | `tooltip.mdx` | yes | 1 | | | | |
|
package/docs/ai-chat.mdx
CHANGED
|
@@ -17,7 +17,7 @@ The pieces of the AI chat and AI image generation screens. Everything is data an
|
|
|
17
17
|
| `AiChatThread` | The bottom-anchored, self-following scroll of turns — with the follow, upward pagination and `ref` a host with history needs |
|
|
18
18
|
| `AiChatUserMessage` / `AiChatAssistantMessage` | The turns, with the staggered blur-in |
|
|
19
19
|
| `AiChatMessageLine`, `AiChatBulletList`, `AiChatBullet`, `AiChatStrong`, `AiChatLinkChip` | A reply's blocks and inline runs |
|
|
20
|
-
| `AiChatFeedbackRow` | Like / dislike / copy with tooltips |
|
|
20
|
+
| `AiChatFeedbackRow` | Like / dislike / copy with tooltips, plus your own `actions` |
|
|
21
21
|
| `AiChatImageGeneration` | An image generating: dot wave, split-flap countdown, radial reveal, feedback and toast |
|
|
22
22
|
| `AiChatCodePanel` | Changes / Browser panel: uncommitted-changes card and a numbered code view |
|
|
23
23
|
| `AiChatGalleryPanel` | Gallery / Styles panel: masonry wall of generations that expand in place |
|
|
@@ -145,6 +145,7 @@ At rest the chrome is in the flow and covers nothing, so `useAiChatChromeInsets(
|
|
|
145
145
|
## Turns
|
|
146
146
|
|
|
147
147
|
- **User** — pushed right with a 6px bleed past the column, as wide as its text up to half the column + 6; radius 16, background-primary, px 12 / py 11, shadow-card.
|
|
148
|
+
- **User actions** — `actions` draws the feedback row's buttons under the card, 8 below and right-aligned, 6 apart (copy, edit). On a web pointer (`@media (hover: hover)`) they fade in over 150ms while the turn is hovered or holds focus — opacity only, so they stay in the tab order and the accessibility tree, and tabbing into one reveals the row. Native and touch web always show them.
|
|
148
149
|
- **Assistant** — full width, blocks 8 apart, with `AiChatFeedbackRow` last (`feedback={false}` drops it).
|
|
149
150
|
- **Blocks** — `AiChatMessageLine` (body-regular; `tone="secondary"` for status lines; `block` for a card), `AiChatBulletList` (a 5px disc in a 21px indent, items 8 apart), `AiChatStrong` (body-medium), `AiChatLinkChip` (inline, radius 8, px 4 / py 3, accent-100 with a 16px link glyph and caption-2-medium accent-500). A bare string child becomes a line; any other element a block line.
|
|
150
151
|
- **Motion** — a turn fades in over 400ms while its blocks rise 6px, un-blur 6px (web) and fade in, 500ms `cubic-bezier(0.25, 0.1, 0.25, 1)`, 180ms apart; a bullet list staggers its own items from its slot. `animate={false}` mounts settled (history), as does reduced motion.
|
|
@@ -153,6 +154,36 @@ At rest the chrome is in the flow and covers nothing, so `useAiChatChromeInsets(
|
|
|
153
154
|
|
|
154
155
|
28px squares 6 apart: radius 8, p 6, background-tertiary, background-secondary-hover on hover with the 16px glyph deepening to icon-primary. Each has a `sm` tooltip above after 200ms (keyboard focus raises it too; a press does not). Copy swaps the glyph for a check (blur, 75% scale, fade, 200ms) and holds the tooltip open reading "Copied!" for 1.6s, then dismisses it even if the pointer is still there.
|
|
155
156
|
|
|
157
|
+
The confirmation follows the copy, not the press. `onCopy` returns `AiChatCopyResult` (`void | boolean | Promise<void | boolean>`): a handler returning nothing or `true` confirms at once, as before; a promise confirms when it resolves (only the latest press's); `false`, a throw or a rejection confirms nothing — a blocked clipboard is not a "Copied!".
|
|
158
|
+
|
|
159
|
+
`actions` (on the row, or through `AiChatAssistantMessage`'s `feedbackProps`) appends buttons after copy on the same surface:
|
|
160
|
+
|
|
161
|
+
```ts
|
|
162
|
+
interface AiChatTurnAction {
|
|
163
|
+
key: string; // React key; `${testID}-${key}` names the button
|
|
164
|
+
label: string; // accessible name and tooltip
|
|
165
|
+
icon: AiChatIconComponent; // RiVolumeUpLine, not <RiVolumeUpLine />
|
|
166
|
+
onPress: () => void;
|
|
167
|
+
active?: boolean; // a toggle: hover surface + primary glyph, aria-pressed
|
|
168
|
+
disabled?: boolean; // 50% opacity, disabled, aria-disabled
|
|
169
|
+
}
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
Leave `active` undefined for a plain button: `false` is a toggle that is off, announced "not pressed". `AiChatUserMessage` takes the same `actions`.
|
|
173
|
+
|
|
174
|
+
```tsx
|
|
175
|
+
<AiChatAssistantMessage
|
|
176
|
+
feedbackProps={{
|
|
177
|
+
onCopy: () => Clipboard.setStringAsync(text),
|
|
178
|
+
actions: [
|
|
179
|
+
{ key: 'speak', label: 'Read aloud', icon: RiVolumeUpLine, onPress: toggleSpeech, active: speaking },
|
|
180
|
+
{ key: 'regenerate', label: 'Regenerate', icon: RiRefreshLine, onPress: regenerate, disabled: busy },
|
|
181
|
+
],
|
|
182
|
+
}}>
|
|
183
|
+
{reply}
|
|
184
|
+
</AiChatAssistantMessage>
|
|
185
|
+
```
|
|
186
|
+
|
|
156
187
|
## Image generation
|
|
157
188
|
|
|
158
189
|
- The frame unfolds from 0 to 250 tall (550ms `cubic-bezier(0.22, 1, 0.36, 1)`) while it fades in and un-blurs, pushing the thread up instead of popping in.
|
package/docs/button.mdx
CHANGED
|
@@ -24,7 +24,7 @@ The Color roles prototype assigns `accent` to identity and links, `support` to c
|
|
|
24
24
|
|
|
25
25
|
An `icon` without children makes a square action. Labelled actions use `leadingIcon` and `trailingIcon`, each an icon component receiving width, height and fill. `leading` and `trailing` are custom content slots.
|
|
26
26
|
|
|
27
|
-
`loading` blocks activation while preserving the mounted label's width. `disabled` also blocks activation. A control drawing no text needs `accessibilityLabel`. Native touch targets retain the padding around compact visuals
|
|
27
|
+
`loading` blocks activation while preserving the mounted label's width. `disabled` also blocks activation. A control drawing no text needs `accessibilityLabel`. Native touch targets retain the padding around compact visuals: vertical hit slop brings every size to 44pt on iOS and 48dp (Material's floor) on Android, so a 44dp `lg` button gets 2dp above and below on Android. Web has real button, anchor and form semantics (`type="submit"` or `"reset"`). Activation is always `onPress`.
|
|
28
28
|
|
|
29
29
|
The pressable is the parent's layout child: `className` and `style` are applied there, without an extra wrapper. Web styles flatten RN style arrays and register their interaction CSS using constructed stylesheets. `asChild` composes an existing web link; disabled state guards the composed handler.
|
|
30
30
|
|
package/docs/composer-panel.mdx
CHANGED
|
@@ -116,11 +116,14 @@ interface ComposerPanelAttachment {
|
|
|
116
116
|
src?: string; // image thumbnail URI
|
|
117
117
|
icon?: ReactNode; // your own 24px artwork for a non-image tile
|
|
118
118
|
progress?: number; // 0–100 draws the ring; omit once landed
|
|
119
|
+
error?: string; // the upload failed: shown on the tile, progress ignored
|
|
119
120
|
}
|
|
120
121
|
```
|
|
121
122
|
|
|
122
123
|
While `progress` is set the tile's content dims to 60%, the accent ring draws clockwise from top-centre over the 1px border (closed at 100) and the percentage sits top-right (white over a photo). Once `progress` is removed the percentage blurs out as the dismiss blurs in on the same spot; the dismiss is out of the accessibility tree until then. Tiles scale and blur in on arrival and out on removal (280ms).
|
|
123
124
|
|
|
125
|
+
A tile with an `error` has **failed**: the ring and the percentage go (any `progress` is ignored), it fills with the error subtle surface under an error-foreground border, and the message sits in 9/11 medium, two lines at most, where the name was — the warning glyph above it. The tile is named `"<name>: <error>"` (also its web `title`, since two lines at 9px hold little), and the dismiss is back as on a landed tile. With `onAttachmentRetry` a retry button (a 24px disc, `labels.retry` + the file name: "Retry Photo.png") takes the glyph's place and calls it with the tile's id; the panel does not clear the error — send the tile back with `progress` and no `error` to start again. `ComposerAttachments`' simulated queue skips a failed file.
|
|
126
|
+
|
|
124
127
|
Non-image tiles default to Remix file glyphs — illustrated plugin icons use SVG filters react-native-svg cannot draw; pass `icon` (and `image` on add-menu rows) for your own artwork.
|
|
125
128
|
|
|
126
129
|
## Providers
|
|
@@ -189,6 +192,7 @@ Every control is named: the triggers announce their current value ("Permission:
|
|
|
189
192
|
| `effortLevels` | `string[]` | the default six | `[]` drops the effort axis. |
|
|
190
193
|
| `listening` / `defaultListening` / `onListeningChange` | `boolean` | `false` | Voice input toggle. |
|
|
191
194
|
| `attachments` / `onRemoveAttachment` | `ComposerPanelAttachment[]` / `(id) => void` | — | |
|
|
195
|
+
| `onAttachmentRetry` | `(id) => void` | — | Draws a retry button on every failed (`error`) tile. |
|
|
192
196
|
| `status` | `ReactNode` | — | Usually `<ComposerPanelStatusTab />`. |
|
|
193
197
|
| `inputRef` | `RefObject<TextInput>` | — | The prompt field. |
|
|
194
198
|
| `labels`, `modelPickerLabels` | objects | English | Localisation. |
|
package/docs/design-tokens.mdx
CHANGED
|
@@ -307,6 +307,28 @@ nine pairs on `Theme.chartColors`.
|
|
|
307
307
|
| `headerBold` | 28 / 34 | 700 | display |
|
|
308
308
|
| `buttonLarge` | 17 / 22 | 600 | sans |
|
|
309
309
|
|
|
310
|
+
**Line-height tokens are unitless ratios, never px.** `theme.css` ships
|
|
311
|
+
`--text-body--line-height: calc(22 / 15)`, the form Tailwind uses for its own
|
|
312
|
+
scale (`--text-sm--line-height: calc(1.25 / 0.875)`). On the web the two forms
|
|
313
|
+
paint the same 22px. On native they do not. Tailwind v4 emits
|
|
314
|
+
`line-height: var(--tw-leading, var(--text-body--line-height))`,
|
|
315
|
+
react-native-css (3.0.7) compiles it to `lineHeight(var(…))`, and that runtime
|
|
316
|
+
resolver multiplies whatever number arrives by the font-size. A `22px` token
|
|
317
|
+
therefore rendered `text-body` at `{ fontSize: 15, lineHeight: 330 }` on
|
|
318
|
+
Android: every className-styled text row grew about 15× taller, so a pill-shaped
|
|
319
|
+
row became a giant circle. Keep new line-height tokens in this form (`lineHeightRatio()` in
|
|
320
|
+
`design-tokens/theme-css.ts`). `typography-native-line-height.test.tsx` runs
|
|
321
|
+
the real Tailwind → react-native-css pipeline and renders each role.
|
|
322
|
+
|
|
323
|
+
A related upstream gap: an arbitrary `leading-[22px]` compiled by
|
|
324
|
+
react-native-css resolves to **no** line-height on native. Use a role token. That is a separate
|
|
325
|
+
react-native-css issue; do not rely on the arbitrary form there.
|
|
326
|
+
|
|
327
|
+
The test compiles through react-native-css, so Bloom pins `lightningcss` to
|
|
328
|
+
1.30.1 in `package.json#overrides`, as the apps do. react-native-css 3.0.x
|
|
329
|
+
cannot read lightningcss 1.32's AST ("expected an object-like struct named
|
|
330
|
+
Specifier").
|
|
331
|
+
|
|
310
332
|
### Media and creator surfaces
|
|
311
333
|
|
|
312
334
|
Media, library, queue, creator and property-insight palettes resolve structural
|
package/docs/dialog.mdx
CHANGED
|
@@ -137,6 +137,11 @@ Per-placement behavior:
|
|
|
137
137
|
- `left` / `right` — animated side-sheet anchored to that PHYSICAL viewport edge.
|
|
138
138
|
- `start` / `end` — the same side-sheet on the LOGICAL edge: `start` is the left in a left-to-right layout and the right in a right-to-left one (`end` the reverse), read from `useIsRtl()`, and the panel slides in from that edge. The matching `inset` side applies (`inset.right` for `start` in RTL). On native the panel is positioned with `insetInlineStart`/`insetInlineEnd`, which Yoga resolves against `I18nManager` — a physical `left`/`right` would be swapped by React Native's default `swapLeftAndRightInRTL`. On web the drawer is portaled outside any `dir` context, so it takes the physical edge `useIsRtl()` names. An app that ships Arabic or Hebrew wants `start`/`end`: `{ base: 'bottom', md: 'start' }` is the mirrored store drawer.
|
|
139
139
|
- `bottom` — reuses the cross-platform `BottomSheet` on BOTH web and native (drag-to-dismiss + internal scroll work everywhere). Custom `children` on bottom placement are rendered in a NON-scrollable body — children own scrolling.
|
|
140
|
+
The sheet is flush with the bottom of the window, so the Dialog ends its content with a spacer the height of the bottom safe area (the Android gesture bar, the iOS home indicator). This spacer is inside the scroll content. Content keeps its own padding; do not add `insets.bottom` yourself. Without the spacer, the last row sat under the gesture bar. A body taller than the sheet could not scroll it out, because the scroll range ended where the bar began.
|
|
141
|
+
|
|
142
|
+
## Nav header: the title beside the ✕
|
|
143
|
+
|
|
144
|
+
In `header` mode the large title normally starts below the 52px nav row. When that row would hold **only** the close button, the title starts level with the ✕ and wraps before it. That means no `onBack`, `left`, `right`, `actions` or `primaryAction`, and no `titleContent` or `tone: 'onImage'`. The row's scrim fades in once content scrolls under it. Without this, every entry view of a flow began with an empty band above its title. As soon as a back button or trailing actions appear, the title returns to its own row below the bar. `isInlineCloseHeader()` in `dialog/DialogHeader.tsx` is the rule.
|
|
140
145
|
|
|
141
146
|
### `DialogAction`
|
|
142
147
|
|
|
@@ -102,6 +102,11 @@ const AccordionItemComponent = ({
|
|
|
102
102
|
|
|
103
103
|
// ---- Accordion Trigger ----
|
|
104
104
|
|
|
105
|
+
/** The trigger's label box: fills the row, sized from its content (`flexBasis: 'auto'`). */
|
|
106
|
+
const TRIGGER_LABEL_STYLE = {
|
|
107
|
+
flexGrow: 1,
|
|
108
|
+
flexShrink: 1
|
|
109
|
+
};
|
|
105
110
|
const AccordionTriggerComponent = ({
|
|
106
111
|
children,
|
|
107
112
|
icon,
|
|
@@ -163,9 +168,8 @@ const AccordionTriggerComponent = ({
|
|
|
163
168
|
,
|
|
164
169
|
"aria-expanded": isExpanded,
|
|
165
170
|
children: [icon, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
},
|
|
171
|
+
testID: "accordion-trigger-label",
|
|
172
|
+
style: TRIGGER_LABEL_STYLE,
|
|
169
173
|
children: typeof children === 'string' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
170
174
|
style: [{
|
|
171
175
|
fontSize: 15,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_RiArrowDownSLine","_useTheme","_useInteractionState","_tokens","_nativeDriver","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","AccordionContext","createContext","expandedValues","Set","toggle","type","AccordionItemContext","value","isExpanded","disabled","AccordionComponent","onValueChange","children","style","testID","useMemo","Array","isArray","useCallback","itemValue","next","undefined","delete","add","from","contextValue","jsx","Provider","View","AccordionItemComponent","useContext","theme","useTheme","itemContext","borderBottomWidth","borderBottomColor","colors","borderLight","AccordionTriggerComponent","icon","textStyle","rotateAnim","useRef","Animated","Value","current","state","pressed","onIn","onPressIn","onOut","onPressOut","useInteractionState","useEffect","spring","toValue","useNativeDriver","SUPPORTS_NATIVE_DRIVER","animation","snappy","start","handlePress","rotation","interpolate","inputRange","outputRange","jsxs","Pressable","flexDirection","alignItems","paddingVertical","space","md","paddingHorizontal","xs","gap","sm","opacity","DISABLED_OPACITY","onPress","accessibilityRole","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_RiArrowDownSLine","_useTheme","_useInteractionState","_tokens","_nativeDriver","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","AccordionContext","createContext","expandedValues","Set","toggle","type","AccordionItemContext","value","isExpanded","disabled","AccordionComponent","onValueChange","children","style","testID","useMemo","Array","isArray","useCallback","itemValue","next","undefined","delete","add","from","contextValue","jsx","Provider","View","AccordionItemComponent","useContext","theme","useTheme","itemContext","borderBottomWidth","borderBottomColor","colors","borderLight","TRIGGER_LABEL_STYLE","flexGrow","flexShrink","AccordionTriggerComponent","icon","textStyle","rotateAnim","useRef","Animated","Value","current","state","pressed","onIn","onPressIn","onOut","onPressOut","useInteractionState","useEffect","spring","toValue","useNativeDriver","SUPPORTS_NATIVE_DRIVER","animation","snappy","start","handlePress","rotation","interpolate","inputRange","outputRange","jsxs","Pressable","flexDirection","alignItems","paddingVertical","space","md","paddingHorizontal","xs","gap","sm","opacity","DISABLED_OPACITY","onPress","accessibilityRole","Text","fontSize","fontWeight","color","text","transform","rotate","RiArrowDownSLine","size","fill","textSecondary","AccordionContentComponent","heightAnim","contentHeight","setContentHeight","useState","handleContentLayout","event","nativeEvent","layout","height","prev","Math","abs","gentle","maxHeight","overflow","onLayout","paddingBottom","Accordion","exports","memo","displayName","AccordionItem","AccordionTrigger","AccordionContent"],"sourceRoot":"../../../src","sources":["accordion/Accordion.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAUA,IAAAC,YAAA,GAAAD,OAAA;AASA,IAAAE,iBAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,oBAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,aAAA,GAAAN,OAAA;AAAiE,IAAAO,WAAA,GAAAP,OAAA;AAAA,SAAAD,wBAAAS,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAX,uBAAA,YAAAA,CAAAS,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,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
|
5
5
|
});
|
|
6
|
-
exports.AiChatImageGeneration = exports.AiChatGalleryPanel = exports.AiChatFeedbackRow = exports.AiChatContainer = exports.AiChatAssistantMessage = void 0;
|
|
6
|
+
exports.AiChatUserMessage = exports.AiChatImageGeneration = exports.AiChatGalleryPanel = exports.AiChatFeedbackRow = exports.AiChatContainer = exports.AiChatAssistantMessage = void 0;
|
|
7
7
|
var _contentPanel = require("../content-panel");
|
|
8
8
|
var _tooltip = require("../tooltip");
|
|
9
9
|
var _bindAiChat = require("./bindAiChat.js");
|
|
@@ -19,6 +19,7 @@ const parts = (0, _bindAiChat.bindAiChat)({
|
|
|
19
19
|
ContentPanel: _contentPanel.ContentPanel
|
|
20
20
|
});
|
|
21
21
|
const AiChatFeedbackRow = exports.AiChatFeedbackRow = parts.AiChatFeedbackRow;
|
|
22
|
+
const AiChatUserMessage = exports.AiChatUserMessage = parts.AiChatUserMessage;
|
|
22
23
|
const AiChatAssistantMessage = exports.AiChatAssistantMessage = parts.AiChatAssistantMessage;
|
|
23
24
|
const AiChatImageGeneration = exports.AiChatImageGeneration = parts.AiChatImageGeneration;
|
|
24
25
|
const AiChatGalleryPanel = exports.AiChatGalleryPanel = parts.AiChatGalleryPanel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_contentPanel","require","_tooltip","_bindAiChat","parts","bindAiChat","Tooltip","TooltipTrigger","TooltipTextBubble","ContentPanel","AiChatFeedbackRow","exports","AiChatAssistantMessage","AiChatImageGeneration","AiChatGalleryPanel","AiChatContainer"],"sourceRoot":"../../../src","sources":["ai-chat/AiChat.tsx"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA,MAAMG,KAAK,GAAG,IAAAC,sBAAU,EAAC;EAAEC,OAAO,EAAPA,gBAAO;EAAEC,cAAc,EAAdA,uBAAc;EAAEC,iBAAiB,EAAjBA,0BAAiB;EAAEC,YAAY,EAAZA;AAAa,CAAC,CAAC;AAE/E,MAAMC,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAGN,KAAK,CAACM,iBAAiB;AACjD,MAAME,
|
|
1
|
+
{"version":3,"names":["_contentPanel","require","_tooltip","_bindAiChat","parts","bindAiChat","Tooltip","TooltipTrigger","TooltipTextBubble","ContentPanel","AiChatFeedbackRow","exports","AiChatUserMessage","AiChatAssistantMessage","AiChatImageGeneration","AiChatGalleryPanel","AiChatContainer"],"sourceRoot":"../../../src","sources":["ai-chat/AiChat.tsx"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA,MAAMG,KAAK,GAAG,IAAAC,sBAAU,EAAC;EAAEC,OAAO,EAAPA,gBAAO;EAAEC,cAAc,EAAdA,uBAAc;EAAEC,iBAAiB,EAAjBA,0BAAiB;EAAEC,YAAY,EAAZA;AAAa,CAAC,CAAC;AAE/E,MAAMC,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAGN,KAAK,CAACM,iBAAiB;AACjD,MAAME,iBAAiB,GAAAD,OAAA,CAAAC,iBAAA,GAAGR,KAAK,CAACQ,iBAAiB;AACjD,MAAMC,sBAAsB,GAAAF,OAAA,CAAAE,sBAAA,GAAGT,KAAK,CAACS,sBAAsB;AAC3D,MAAMC,qBAAqB,GAAAH,OAAA,CAAAG,qBAAA,GAAGV,KAAK,CAACU,qBAAqB;AACzD,MAAMC,kBAAkB,GAAAJ,OAAA,CAAAI,kBAAA,GAAGX,KAAK,CAACW,kBAAkB;AACnD,MAAMC,eAAe,GAAAL,OAAA,CAAAK,eAAA,GAAGZ,KAAK,CAACY,eAAe","ignoreList":[]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.AiChatImageGeneration = exports.AiChatGalleryPanel = exports.AiChatFeedbackRow = exports.AiChatContainer = exports.AiChatAssistantMessage = void 0;
|
|
6
|
+
exports.AiChatUserMessage = exports.AiChatImageGeneration = exports.AiChatGalleryPanel = exports.AiChatFeedbackRow = exports.AiChatContainer = exports.AiChatAssistantMessage = void 0;
|
|
7
7
|
var _indexWeb = require("../content-panel/index.web.js");
|
|
8
8
|
var _indexWeb2 = require("../tooltip/index.web.js");
|
|
9
9
|
var _bindAiChat = require("./bindAiChat.js");
|
|
@@ -19,6 +19,7 @@ const parts = (0, _bindAiChat.bindAiChat)({
|
|
|
19
19
|
ContentPanel: _indexWeb.ContentPanel
|
|
20
20
|
});
|
|
21
21
|
const AiChatFeedbackRow = exports.AiChatFeedbackRow = parts.AiChatFeedbackRow;
|
|
22
|
+
const AiChatUserMessage = exports.AiChatUserMessage = parts.AiChatUserMessage;
|
|
22
23
|
const AiChatAssistantMessage = exports.AiChatAssistantMessage = parts.AiChatAssistantMessage;
|
|
23
24
|
const AiChatImageGeneration = exports.AiChatImageGeneration = parts.AiChatImageGeneration;
|
|
24
25
|
const AiChatGalleryPanel = exports.AiChatGalleryPanel = parts.AiChatGalleryPanel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_indexWeb","require","_indexWeb2","_bindAiChat","parts","bindAiChat","Tooltip","TooltipTrigger","TooltipTextBubble","ContentPanel","AiChatFeedbackRow","exports","AiChatAssistantMessage","AiChatImageGeneration","AiChatGalleryPanel","AiChatContainer"],"sourceRoot":"../../../src","sources":["ai-chat/AiChat.web.tsx"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA,MAAMG,KAAK,GAAG,IAAAC,sBAAU,EAAC;EAAEC,OAAO,EAAPA,kBAAO;EAAEC,cAAc,EAAdA,yBAAc;EAAEC,iBAAiB,EAAjBA,4BAAiB;EAAEC,YAAY,EAAZA;AAAa,CAAC,CAAC;AAE/E,MAAMC,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAGN,KAAK,CAACM,iBAAiB;AACjD,MAAME,
|
|
1
|
+
{"version":3,"names":["_indexWeb","require","_indexWeb2","_bindAiChat","parts","bindAiChat","Tooltip","TooltipTrigger","TooltipTextBubble","ContentPanel","AiChatFeedbackRow","exports","AiChatUserMessage","AiChatAssistantMessage","AiChatImageGeneration","AiChatGalleryPanel","AiChatContainer"],"sourceRoot":"../../../src","sources":["ai-chat/AiChat.web.tsx"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA,MAAMG,KAAK,GAAG,IAAAC,sBAAU,EAAC;EAAEC,OAAO,EAAPA,kBAAO;EAAEC,cAAc,EAAdA,yBAAc;EAAEC,iBAAiB,EAAjBA,4BAAiB;EAAEC,YAAY,EAAZA;AAAa,CAAC,CAAC;AAE/E,MAAMC,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAGN,KAAK,CAACM,iBAAiB;AACjD,MAAME,iBAAiB,GAAAD,OAAA,CAAAC,iBAAA,GAAGR,KAAK,CAACQ,iBAAiB;AACjD,MAAMC,sBAAsB,GAAAF,OAAA,CAAAE,sBAAA,GAAGT,KAAK,CAACS,sBAAsB;AAC3D,MAAMC,qBAAqB,GAAAH,OAAA,CAAAG,qBAAA,GAAGV,KAAK,CAACU,qBAAqB;AACzD,MAAMC,kBAAkB,GAAAJ,OAAA,CAAAI,kBAAA,GAAGX,KAAK,CAACW,kBAAkB;AACnD,MAAMC,eAAe,GAAAL,OAAA,CAAAK,eAAA,GAAGZ,KAAK,CAACY,eAAe","ignoreList":[]}
|
|
@@ -6,11 +6,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.GlyphAction = GlyphAction;
|
|
7
7
|
exports.SurfaceAction = SurfaceAction;
|
|
8
8
|
exports.SwapGlyph = SwapGlyph;
|
|
9
|
+
exports.TurnActionButton = TurnActionButton;
|
|
9
10
|
exports.WithTooltip = WithTooltip;
|
|
11
|
+
exports.turnActionSurface = turnActionSurface;
|
|
10
12
|
exports.useHoverTooltip = useHoverTooltip;
|
|
11
13
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
14
|
var _reactNative = require("react-native");
|
|
13
15
|
var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reanimated"));
|
|
16
|
+
var _tokens = require("../styles/tokens.js");
|
|
14
17
|
var _context = require("./context.js");
|
|
15
18
|
var _shared = require("./shared.js");
|
|
16
19
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -192,14 +195,19 @@ function SurfaceAction({
|
|
|
192
195
|
hoverBackground,
|
|
193
196
|
palette,
|
|
194
197
|
glyph,
|
|
198
|
+
active,
|
|
199
|
+
disabled = false,
|
|
195
200
|
style,
|
|
196
201
|
testID
|
|
197
202
|
}) {
|
|
203
|
+
const isToggle = active !== undefined;
|
|
198
204
|
const tip = useHoverTooltip({
|
|
199
205
|
open: tooltipOpen,
|
|
200
206
|
onOpenChange: onTooltipOpenChange
|
|
201
207
|
});
|
|
202
|
-
const [
|
|
208
|
+
const [hoveredRaw, setHovered] = (0, _react.useState)(false);
|
|
209
|
+
const hovered = hoveredRaw && !disabled;
|
|
210
|
+
const lit = hovered || active === true;
|
|
203
211
|
// A press focuses the control too; only keyboard focus should raise the tooltip.
|
|
204
212
|
const pointerDown = (0, _react.useRef)(false);
|
|
205
213
|
const surface = {
|
|
@@ -208,7 +216,8 @@ function SurfaceAction({
|
|
|
208
216
|
alignItems: 'center',
|
|
209
217
|
padding,
|
|
210
218
|
borderRadius: radius,
|
|
211
|
-
backgroundColor:
|
|
219
|
+
backgroundColor: lit ? hoverBackground : background,
|
|
220
|
+
opacity: disabled ? _tokens.DISABLED_OPACITY : 1,
|
|
212
221
|
'--bloom-ai-chat-ring': palette.ring
|
|
213
222
|
};
|
|
214
223
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(WithTooltip, {
|
|
@@ -219,7 +228,21 @@ function SurfaceAction({
|
|
|
219
228
|
...(0, _shared.dataHook)('bloomAiChatControl'),
|
|
220
229
|
testID: testID,
|
|
221
230
|
accessibilityRole: "button",
|
|
222
|
-
accessibilityLabel: label
|
|
231
|
+
accessibilityLabel: label
|
|
232
|
+
// BOTH spellings of the toggle state: react-native-web drops
|
|
233
|
+
// `accessibilityState` and React Native has no `aria-pressed`.
|
|
234
|
+
,
|
|
235
|
+
...(isToggle ? {
|
|
236
|
+
'aria-pressed': active
|
|
237
|
+
} : null),
|
|
238
|
+
accessibilityState: {
|
|
239
|
+
disabled,
|
|
240
|
+
...(isToggle ? {
|
|
241
|
+
selected: active
|
|
242
|
+
} : null)
|
|
243
|
+
},
|
|
244
|
+
"aria-disabled": disabled || undefined,
|
|
245
|
+
disabled: disabled,
|
|
223
246
|
onPressIn: () => {
|
|
224
247
|
pointerDown.current = true;
|
|
225
248
|
tip.onHoverOut();
|
|
@@ -241,7 +264,40 @@ function SurfaceAction({
|
|
|
241
264
|
},
|
|
242
265
|
onBlur: () => tip.setOpen(false),
|
|
243
266
|
style: [surface, style],
|
|
244
|
-
children: glyph(
|
|
267
|
+
children: glyph(lit ? palette.iconPrimary : palette.iconSecondary)
|
|
268
|
+
})
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/** The feedback row's button surface: 28 square, radius 8, p 6, tertiary → secondary-hover. */
|
|
273
|
+
function turnActionSurface(palette) {
|
|
274
|
+
return {
|
|
275
|
+
padding: 6,
|
|
276
|
+
radius: 8,
|
|
277
|
+
background: palette.tertiary,
|
|
278
|
+
hoverBackground: palette.secondaryHover,
|
|
279
|
+
palette
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/** One caller-supplied turn action, drawn as a feedback-row button. */
|
|
284
|
+
function TurnActionButton({
|
|
285
|
+
action,
|
|
286
|
+
palette,
|
|
287
|
+
testID
|
|
288
|
+
}) {
|
|
289
|
+
const Icon = action.icon;
|
|
290
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(SurfaceAction, {
|
|
291
|
+
...turnActionSurface(palette),
|
|
292
|
+
testID: testID ? `${testID}-${action.key}` : undefined,
|
|
293
|
+
label: action.label,
|
|
294
|
+
onPress: action.onPress,
|
|
295
|
+
active: action.active,
|
|
296
|
+
disabled: action.disabled,
|
|
297
|
+
glyph: color => /*#__PURE__*/(0, _jsxRuntime.jsx)(Icon, {
|
|
298
|
+
width: 16,
|
|
299
|
+
height: 16,
|
|
300
|
+
fill: color
|
|
245
301
|
})
|
|
246
302
|
});
|
|
247
303
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeReanimated","_context","_shared","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","EASE_OUT","Easing","bezier","useHoverTooltip","delay","open","controlled","onOpenChange","inner","setInner","useState","timer","useRef","changeRef","current","isControlled","undefined","setOpen","useCallback","next","clear","clearTimeout","useEffect","onHoverIn","setTimeout","onHoverOut","WithTooltip","label","children","Tooltip","TooltipTrigger","TooltipTextBubble","useAiChatPlatform","jsxs","position","visible","onVisibleChange","jsx","size","GlyphAction","icon","Icon","onPress","palette","flip","hover","testID","hovered","setLit","lit","style","flexShrink","ring","Pressable","dataHook","accessibilityRole","accessibilityLabel","onFocus","onBlur","View","transform","scaleX","width","height","fill","iconHover","iconSecondary","SwapGlyph","shown","reducedMotion","useReducedMotion","progress","useSharedValue","target","value","withTiming","duration","easing","useAnimatedStyle","opacity","scale","IS_WEB","filter","pointerEvents","top","left","alignItems","justifyContent","SurfaceAction","tooltip","tooltipOpen","onTooltipOpenChange","padding","radius","background","hoverBackground","glyph","tip","setHovered","pointerDown","surface","flexDirection","borderRadius","backgroundColor","onPressIn","onPressOut","iconPrimary"],"sourceRoot":"../../../src","sources":["ai-chat/AiChatControls.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeReanimated","_tokens","_context","_shared","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","EASE_OUT","Easing","bezier","useHoverTooltip","delay","open","controlled","onOpenChange","inner","setInner","useState","timer","useRef","changeRef","current","isControlled","undefined","setOpen","useCallback","next","clear","clearTimeout","useEffect","onHoverIn","setTimeout","onHoverOut","WithTooltip","label","children","Tooltip","TooltipTrigger","TooltipTextBubble","useAiChatPlatform","jsxs","position","visible","onVisibleChange","jsx","size","GlyphAction","icon","Icon","onPress","palette","flip","hover","testID","hovered","setLit","lit","style","flexShrink","ring","Pressable","dataHook","accessibilityRole","accessibilityLabel","onFocus","onBlur","View","transform","scaleX","width","height","fill","iconHover","iconSecondary","SwapGlyph","shown","reducedMotion","useReducedMotion","progress","useSharedValue","target","value","withTiming","duration","easing","useAnimatedStyle","opacity","scale","IS_WEB","filter","pointerEvents","top","left","alignItems","justifyContent","SurfaceAction","tooltip","tooltipOpen","onTooltipOpenChange","padding","radius","background","hoverBackground","glyph","active","disabled","isToggle","tip","hoveredRaw","setHovered","pointerDown","surface","flexDirection","borderRadius","backgroundColor","DISABLED_OPACITY","accessibilityState","selected","onPressIn","onPressOut","iconPrimary","turnActionSurface","tertiary","secondaryHover","TurnActionButton","action","key","color"],"sourceRoot":"../../../src","sources":["ai-chat/AiChatControls.tsx"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAH,uBAAA,CAAAC,OAA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,gBAAgBA,CAAC;EAC/BC,MAAM;EACN3E,OAAO;EACPG;AAKF,CAAC,EAAE;EACD,MAAML,IAAI,GAAG6E,MAAM,CAAC9E,IAAI;EACxB,oBACE,IAAA5D,WAAA,CAAAyD,GAAA,EAACmD,aAAa;IAAA,GACR0B,iBAAiB,CAACvE,OAAO,CAAC;IAC9BG,MAAM,EAAEA,MAAM,GAAG,GAAGA,MAAM,IAAIwE,MAAM,CAACC,GAAG,EAAE,GAAGvG,SAAU;IACvDW,KAAK,EAAE2F,MAAM,CAAC3F,KAAM;IACpBe,OAAO,EAAE4E,MAAM,CAAC5E,OAAQ;IACxBuD,MAAM,EAAEqB,MAAM,CAACrB,MAAO;IACtBC,QAAQ,EAAEoB,MAAM,CAACpB,QAAS;IAC1BF,KAAK,EAAGwB,KAAK,iBAAK,IAAA5I,WAAA,CAAAyD,GAAA,EAACI,IAAI;MAACqB,KAAK,EAAE,EAAG;MAACC,MAAM,EAAE,EAAG;MAACC,IAAI,EAAEwD;IAAM,CAAE;EAAE,CAChE,CAAC;AAEN","ignoreList":[]}
|
|
@@ -31,12 +31,16 @@ const DEFAULT_LABELS = {
|
|
|
31
31
|
* tooltip a `sm` tooltip above, after a 200ms hover
|
|
32
32
|
* copy the copy glyph blurs, scales to 75% and fades out as a check comes
|
|
33
33
|
* in (200ms ease-out); the tooltip is held open reading "Copied!"
|
|
34
|
-
* for 1.6s, then dismissed even if the pointer is still over it
|
|
34
|
+
* for 1.6s, then dismissed even if the pointer is still over it — once
|
|
35
|
+
* the copy HAPPENED: an async handler is waited for, and a `false`,
|
|
36
|
+
* a throw or a rejection shows nothing
|
|
37
|
+
* actions the caller's extra buttons after copy, on the same surface
|
|
35
38
|
*/
|
|
36
39
|
function AiChatFeedbackRowBase({
|
|
37
40
|
onLike,
|
|
38
41
|
onDislike,
|
|
39
42
|
onCopy,
|
|
43
|
+
actions,
|
|
40
44
|
labels,
|
|
41
45
|
style,
|
|
42
46
|
testID
|
|
@@ -50,12 +54,19 @@ function AiChatFeedbackRowBase({
|
|
|
50
54
|
const [copied, setCopied] = (0, _react.useState)(false);
|
|
51
55
|
const [copyTooltipOpen, setCopyTooltipOpen] = (0, _react.useState)(false);
|
|
52
56
|
const timer = (0, _react.useRef)(null);
|
|
53
|
-
|
|
54
|
-
|
|
57
|
+
|
|
58
|
+
// The latest press: a slower, earlier copy settling late must not confirm.
|
|
59
|
+
const attempt = (0, _react.useRef)(0);
|
|
60
|
+
const mounted = (0, _react.useRef)(true);
|
|
61
|
+
(0, _react.useEffect)(() => {
|
|
62
|
+
mounted.current = true;
|
|
63
|
+
return () => {
|
|
64
|
+
mounted.current = false;
|
|
65
|
+
if (timer.current) clearTimeout(timer.current);
|
|
66
|
+
};
|
|
55
67
|
}, []);
|
|
56
|
-
const
|
|
68
|
+
const confirm = () => {
|
|
57
69
|
if (timer.current) clearTimeout(timer.current);
|
|
58
|
-
onCopy?.();
|
|
59
70
|
setCopied(true);
|
|
60
71
|
setCopyTooltipOpen(true);
|
|
61
72
|
timer.current = setTimeout(() => {
|
|
@@ -63,13 +74,23 @@ function AiChatFeedbackRowBase({
|
|
|
63
74
|
setCopyTooltipOpen(false);
|
|
64
75
|
}, _shared.CONFIRM_MS);
|
|
65
76
|
};
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
77
|
+
const copy = () => {
|
|
78
|
+
const id = ++attempt.current;
|
|
79
|
+
let result;
|
|
80
|
+
try {
|
|
81
|
+
result = onCopy?.();
|
|
82
|
+
} catch {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
if (isPromiseLike(result)) {
|
|
86
|
+
result.then(ok => {
|
|
87
|
+
if (ok !== false && mounted.current && id === attempt.current) confirm();
|
|
88
|
+
}, () => undefined);
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
if (result !== false) confirm();
|
|
72
92
|
};
|
|
93
|
+
const surface = (0, _AiChatControls.turnActionSurface)(palette);
|
|
73
94
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
74
95
|
testID: testID,
|
|
75
96
|
style: [{
|
|
@@ -128,7 +149,14 @@ function AiChatFeedbackRowBase({
|
|
|
128
149
|
})
|
|
129
150
|
})]
|
|
130
151
|
})
|
|
131
|
-
})
|
|
152
|
+
}), actions?.map(action => /*#__PURE__*/(0, _jsxRuntime.jsx)(_AiChatControls.TurnActionButton, {
|
|
153
|
+
action: action,
|
|
154
|
+
palette: palette,
|
|
155
|
+
testID: testID
|
|
156
|
+
}, action.key))]
|
|
132
157
|
});
|
|
133
158
|
}
|
|
159
|
+
function isPromiseLike(value) {
|
|
160
|
+
return typeof value?.then === 'function';
|
|
161
|
+
}
|
|
134
162
|
//# sourceMappingURL=AiChatFeedbackRowBase.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_RiCheckLine","_RiFileCopyLine","_RiThumbDownLine","_RiThumbUpLine","_AiChatControls","_shared","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","DEFAULT_LABELS","like","dislike","copy","copied","AiChatFeedbackRowBase","onLike","onDislike","onCopy","labels","style","testID","useAiChatWebCss","palette","useAiChatPalette","l","useMemo","setCopied","useState","copyTooltipOpen","setCopyTooltipOpen","timer","useRef","useEffect","current","clearTimeout","setTimeout","CONFIRM_MS","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_RiCheckLine","_RiFileCopyLine","_RiThumbDownLine","_RiThumbUpLine","_AiChatControls","_shared","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","DEFAULT_LABELS","like","dislike","copy","copied","AiChatFeedbackRowBase","onLike","onDislike","onCopy","actions","labels","style","testID","useAiChatWebCss","palette","useAiChatPalette","l","useMemo","setCopied","useState","copyTooltipOpen","setCopyTooltipOpen","timer","useRef","attempt","mounted","useEffect","current","clearTimeout","confirm","setTimeout","CONFIRM_MS","id","result","isPromiseLike","then","ok","undefined","surface","turnActionSurface","jsxs","View","flexDirection","alignItems","gap","children","jsx","SurfaceAction","label","onPress","glyph","color","RiThumbUpLine","width","height","fill","RiThumbDownLine","tooltip","tooltipOpen","onTooltipOpenChange","SwapGlyph","shown","size","RiFileCopyLine","RiCheckLine","map","action","TurnActionButton","key","value"],"sourceRoot":"../../../src","sources":["ai-chat/AiChatFeedbackRowBase.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AACA,IAAAI,gBAAA,GAAAJ,OAAA;AACA,IAAAK,cAAA,GAAAL,OAAA;AACA,IAAAM,eAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AAAyE,IAAAQ,WAAA,GAAAR,OAAA;AAAA,SAAAD,wBAAAU,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAZ,uBAAA,YAAAA,CAAAU,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,C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