@oxy.so/bloom 7.26.0 → 7.26.2
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 +9 -3
- package/docs/adoption-matrix.mdx +1 -1
- package/docs/overlay.mdx +9 -0
- package/docs/swipe-row.mdx +30 -3
- package/docs/theme.mdx +65 -12
- package/lib/commonjs/agent-creator/ShapeArc.js +81 -73
- package/lib/commonjs/agent-creator/ShapeArc.js.map +1 -1
- package/lib/commonjs/ai-chat/AiChatShell.js +2 -0
- package/lib/commonjs/ai-chat/AiChatShell.js.map +1 -1
- package/lib/commonjs/ai-chat/use-panel-interaction.js +6 -1
- package/lib/commonjs/ai-chat/use-panel-interaction.js.map +1 -1
- package/lib/commonjs/message-bubble/SwipeToReply.js +6 -1
- package/lib/commonjs/message-bubble/SwipeToReply.js.map +1 -1
- package/lib/commonjs/overlay/ModalKeyboard.js +3 -2
- package/lib/commonjs/overlay/ModalKeyboard.js.map +1 -1
- package/lib/commonjs/overlay/modal-keyboard.js +10 -2
- package/lib/commonjs/overlay/modal-keyboard.js.map +1 -1
- package/lib/commonjs/swipe-row/SwipeRow.js +10 -2
- package/lib/commonjs/swipe-row/SwipeRow.js.map +1 -1
- package/lib/module/agent-creator/ShapeArc.js +81 -73
- package/lib/module/agent-creator/ShapeArc.js.map +1 -1
- package/lib/module/ai-chat/AiChatShell.js +2 -0
- package/lib/module/ai-chat/AiChatShell.js.map +1 -1
- package/lib/module/ai-chat/use-panel-interaction.js +6 -1
- package/lib/module/ai-chat/use-panel-interaction.js.map +1 -1
- package/lib/module/message-bubble/SwipeToReply.js +6 -1
- package/lib/module/message-bubble/SwipeToReply.js.map +1 -1
- package/lib/module/overlay/ModalKeyboard.js +3 -2
- package/lib/module/overlay/ModalKeyboard.js.map +1 -1
- package/lib/module/overlay/modal-keyboard.js +10 -2
- package/lib/module/overlay/modal-keyboard.js.map +1 -1
- package/lib/module/swipe-row/SwipeRow.js +10 -2
- package/lib/module/swipe-row/SwipeRow.js.map +1 -1
- package/lib/typescript/commonjs/agent-creator/ShapeArc.d.ts.map +1 -1
- package/lib/typescript/commonjs/ai-chat/AiChatShell.d.ts.map +1 -1
- package/lib/typescript/commonjs/ai-chat/use-panel-interaction.d.ts.map +1 -1
- package/lib/typescript/commonjs/message-bubble/SwipeToReply.d.ts.map +1 -1
- package/lib/typescript/commonjs/overlay/ModalKeyboard.d.ts.map +1 -1
- package/lib/typescript/commonjs/overlay/modal-keyboard.d.ts +2 -1
- package/lib/typescript/commonjs/overlay/modal-keyboard.d.ts.map +1 -1
- package/lib/typescript/commonjs/swipe-row/SwipeRow.d.ts +9 -2
- package/lib/typescript/commonjs/swipe-row/SwipeRow.d.ts.map +1 -1
- package/lib/typescript/module/agent-creator/ShapeArc.d.ts.map +1 -1
- package/lib/typescript/module/ai-chat/AiChatShell.d.ts.map +1 -1
- package/lib/typescript/module/ai-chat/use-panel-interaction.d.ts.map +1 -1
- package/lib/typescript/module/message-bubble/SwipeToReply.d.ts.map +1 -1
- package/lib/typescript/module/overlay/ModalKeyboard.d.ts.map +1 -1
- package/lib/typescript/module/overlay/modal-keyboard.d.ts +2 -1
- package/lib/typescript/module/overlay/modal-keyboard.d.ts.map +1 -1
- package/lib/typescript/module/swipe-row/SwipeRow.d.ts +9 -2
- package/lib/typescript/module/swipe-row/SwipeRow.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/agent-creator/ShapeArc.tsx +5 -1
- package/src/ai-chat/AiChatShell.tsx +2 -0
- package/src/ai-chat/use-panel-interaction.ts +5 -1
- package/src/message-bubble/SwipeToReply.tsx +6 -2
- package/src/overlay/ModalKeyboard.tsx +3 -2
- package/src/overlay/modal-keyboard.ts +8 -2
- package/src/swipe-row/SwipeRow.tsx +13 -3
|
@@ -29,7 +29,11 @@ import type { MessageDirection } from './types';
|
|
|
29
29
|
* releases animate home, so the row never stays displaced.
|
|
30
30
|
*
|
|
31
31
|
* The pan activates only after `activeOffsetX`, so a vertical flick through the
|
|
32
|
-
* transcript is still a scroll and a tap is still a tap.
|
|
32
|
+
* transcript is still a scroll and a tap is still a tap. The detector also
|
|
33
|
+
* passes `touchAction="pan-y"`: RNGH's web default is `touch-action: none`,
|
|
34
|
+
* which would stop a touch browser scrolling the transcript from any bubble.
|
|
35
|
+
* The web path above never mounts the detector today, so this is inert until
|
|
36
|
+
* someone enables it — it is here so enabling it cannot freeze the transcript.
|
|
33
37
|
*/
|
|
34
38
|
|
|
35
39
|
const TRAVEL = 64;
|
|
@@ -103,7 +107,7 @@ export function SwipeToReply({
|
|
|
103
107
|
>
|
|
104
108
|
<RiArrowGoBackLine width={18} height={18} fill={paint.muted} />
|
|
105
109
|
</Animated.View>
|
|
106
|
-
<GestureDetector gesture={pan}>
|
|
110
|
+
<GestureDetector gesture={pan} touchAction="pan-y">
|
|
107
111
|
<Animated.View style={rowStyle}>{children}</Animated.View>
|
|
108
112
|
</GestureDetector>
|
|
109
113
|
</View>
|
|
@@ -59,11 +59,12 @@ export function ModalKeyboard({ panelRef, closing = false, dismissible, dismiss
|
|
|
59
59
|
// A frame later, so content that focuses itself on mount has done so.
|
|
60
60
|
const frame = requestAnimationFrame(() => {
|
|
61
61
|
const node = panel();
|
|
62
|
-
|
|
62
|
+
// A fast dismissal can restore the opener before this entry frame runs.
|
|
63
|
+
if (state.current.closing || !node || node.contains(document.activeElement) || !isTopmostOverlayLayer(layer)) return;
|
|
63
64
|
initialFocusWithin(node).focus({ preventScroll: true });
|
|
64
65
|
});
|
|
65
66
|
const onTab = (event: KeyboardEvent) => {
|
|
66
|
-
if (event.defaultPrevented || !isTopmostOverlayLayer(layer)) return;
|
|
67
|
+
if (state.current.closing || event.defaultPrevented || !isTopmostOverlayLayer(layer)) return;
|
|
67
68
|
wrapTab(event, panel());
|
|
68
69
|
};
|
|
69
70
|
// Capture: a text field in the panel stops its own keydowns.
|
|
@@ -71,15 +71,21 @@ export function initialFocusWithin(node: HTMLElement): HTMLElement {
|
|
|
71
71
|
/**
|
|
72
72
|
* Keep Tab inside `node`: from the last tabbable (or from outside) forward to
|
|
73
73
|
* the first, from the first (or from outside) backward to the last. Returns
|
|
74
|
-
* whether it moved focus.
|
|
74
|
+
* whether it moved focus. With no available controls, the focusable panel is
|
|
75
|
+
* the fallback until its actions become available again.
|
|
75
76
|
*/
|
|
76
77
|
export function wrapTab(event: KeyboardEvent, node: HTMLElement | null): boolean {
|
|
77
78
|
if (event.key !== 'Tab' || !node) return false;
|
|
78
79
|
const items = tabbablesWithin(node);
|
|
80
|
+
if (items.length === 0) {
|
|
81
|
+
event.preventDefault();
|
|
82
|
+
node.focus({ preventScroll: true });
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
79
85
|
const first = items[0];
|
|
80
86
|
const last = items[items.length - 1];
|
|
81
87
|
const active = document.activeElement;
|
|
82
|
-
const outside = !node.contains(active);
|
|
88
|
+
const outside = active === node || !node.contains(active);
|
|
83
89
|
if (event.shiftKey ? outside || active === first : outside || active === last) {
|
|
84
90
|
event.preventDefault();
|
|
85
91
|
(event.shiftKey ? last : first)?.focus();
|
|
@@ -35,8 +35,15 @@ import { SWIPE_ROW_MESSAGES } from './messages';
|
|
|
35
35
|
* gesture springs straight back.
|
|
36
36
|
*
|
|
37
37
|
* The gesture activates only past a horizontal threshold and FAILS on vertical
|
|
38
|
-
* travel, so a
|
|
39
|
-
*
|
|
38
|
+
* travel, so a vertical drag never turns into a swipe. That is NOT what keeps the
|
|
39
|
+
* list scrollable on web, though: RNGH stamps `touch-action: none` on the
|
|
40
|
+
* detector's view unless told otherwise, and rows tile the whole list, so a
|
|
41
|
+
* touch browser would be told never to scroll it — `failOffsetY` is a JS
|
|
42
|
+
* decision taken after the browser has already been told not to. The detector
|
|
43
|
+
* therefore passes `touchAction="pan-y"`: vertical panning stays the browser's
|
|
44
|
+
* (it cancels the pointer, and with it the pan, once it scrolls) and horizontal
|
|
45
|
+
* movement still reaches the pan. Native ignores the prop. Panes are laid UNDER
|
|
46
|
+
* the row and grow with it rather than sliding in from outside: the row is what
|
|
40
47
|
* moves, and the action underneath is revealed, not pushed.
|
|
41
48
|
*
|
|
42
49
|
* It owns the gesture and almost nothing else. It draws no row and knows no
|
|
@@ -235,7 +242,10 @@ export function SwipeRow({
|
|
|
235
242
|
{pane(right, 'right')}
|
|
236
243
|
</Animated.View>
|
|
237
244
|
) : null}
|
|
238
|
-
|
|
245
|
+
{/* `pan-y` is load-bearing on touch web — see the doc comment above.
|
|
246
|
+
Without it RNGH's default `none` makes the list unscrollable by touch
|
|
247
|
+
wherever a row is under the finger, which is everywhere. */}
|
|
248
|
+
<GestureDetector gesture={pan} touchAction="pan-y">
|
|
239
249
|
<Animated.View
|
|
240
250
|
style={[
|
|
241
251
|
{ backgroundColor: rowFill },
|