@oxy.so/bloom 22.1.0 → 22.1.3
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/dialog.mdx +4 -0
- package/docs/list.mdx +11 -1
- package/docs/swipe-row.mdx +30 -0
- package/docs/task-catalog.json +1 -1
- package/docs/task-catalog.mdx +1 -1
- package/lib/commonjs/bottom-bar/BottomBarBase.js +6 -1
- package/lib/commonjs/bottom-bar/BottomBarBase.js.map +1 -1
- package/lib/commonjs/dialog/DetailDialogBase.js +25 -27
- package/lib/commonjs/dialog/DetailDialogBase.js.map +1 -1
- package/lib/commonjs/list/ListPerson.js +6 -9
- package/lib/commonjs/list/ListPerson.js.map +1 -1
- package/lib/commonjs/list/VirtualList.web.js +6 -0
- package/lib/commonjs/list/VirtualList.web.js.map +1 -1
- package/lib/commonjs/list/row-measurement.web.js +74 -0
- package/lib/commonjs/list/row-measurement.web.js.map +1 -0
- package/lib/commonjs/mail-thread/MailMessage.js +1 -1
- package/lib/commonjs/mail-thread/MailMessage.js.map +1 -1
- package/lib/commonjs/swipe-row/SwipeRow.js +6 -1
- package/lib/commonjs/swipe-row/SwipeRow.js.map +1 -1
- package/lib/commonjs/swipe-row/SwipeRowBubble.js +7 -8
- package/lib/commonjs/swipe-row/SwipeRowBubble.js.map +1 -1
- package/lib/module/bottom-bar/BottomBarBase.js +6 -1
- package/lib/module/bottom-bar/BottomBarBase.js.map +1 -1
- package/lib/module/dialog/DetailDialogBase.js +25 -27
- package/lib/module/dialog/DetailDialogBase.js.map +1 -1
- package/lib/module/list/ListPerson.js +7 -10
- package/lib/module/list/ListPerson.js.map +1 -1
- package/lib/module/list/VirtualList.web.js +8 -1
- package/lib/module/list/VirtualList.web.js.map +1 -1
- package/lib/module/list/row-measurement.web.js +70 -0
- package/lib/module/list/row-measurement.web.js.map +1 -0
- package/lib/module/mail-thread/MailMessage.js +1 -1
- package/lib/module/mail-thread/MailMessage.js.map +1 -1
- package/lib/module/swipe-row/SwipeRow.js +6 -1
- package/lib/module/swipe-row/SwipeRow.js.map +1 -1
- package/lib/module/swipe-row/SwipeRowBubble.js +8 -9
- package/lib/module/swipe-row/SwipeRowBubble.js.map +1 -1
- package/lib/typescript/commonjs/bottom-bar/BottomBarBase.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/DetailDialogBase.d.ts.map +1 -1
- package/lib/typescript/commonjs/list/ListPerson.d.ts.map +1 -1
- package/lib/typescript/commonjs/list/VirtualList.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/list/row-measurement.web.d.ts +9 -0
- package/lib/typescript/commonjs/list/row-measurement.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/mail-thread/MailMessage.d.ts.map +1 -1
- package/lib/typescript/commonjs/swipe-row/SwipeRowBubble.d.ts.map +1 -1
- package/lib/typescript/module/bottom-bar/BottomBarBase.d.ts.map +1 -1
- package/lib/typescript/module/dialog/DetailDialogBase.d.ts.map +1 -1
- package/lib/typescript/module/list/ListPerson.d.ts.map +1 -1
- package/lib/typescript/module/list/VirtualList.web.d.ts.map +1 -1
- package/lib/typescript/module/list/row-measurement.web.d.ts +9 -0
- package/lib/typescript/module/list/row-measurement.web.d.ts.map +1 -0
- package/lib/typescript/module/mail-thread/MailMessage.d.ts.map +1 -1
- package/lib/typescript/module/swipe-row/SwipeRowBubble.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/bottom-bar/BottomBarBase.tsx +10 -1
- package/src/dialog/DetailDialogBase.tsx +29 -32
- package/src/list/ListPerson.tsx +12 -7
- package/src/list/VirtualList.web.tsx +9 -0
- package/src/list/row-measurement.web.ts +86 -0
- package/src/mail-thread/MailMessage.tsx +3 -1
- package/src/swipe-row/SwipeRow.tsx +5 -4
- package/src/swipe-row/SwipeRowBubble.tsx +12 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VirtualList.web.d.ts","sourceRoot":"","sources":["../../../../src/list/VirtualList.web.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA8B/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAmB,MAAM,YAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"VirtualList.web.d.ts","sourceRoot":"","sources":["../../../../src/list/VirtualList.web.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA8B/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAmB,MAAM,YAAS,CAAC;AAqgBpF,QAAA,MAAM,WAAW,EAaX,CAAC,CAAC,EACN,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAA;CAAE,KAChE,KAAK,CAAC,YAAY,CAAC;AACxB,eAAe,WAAW,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type Virtualizer } from '@tanstack/react-virtual';
|
|
2
|
+
type RowVirtualizer = Virtualizer<HTMLElement | Window, HTMLDivElement>;
|
|
3
|
+
/** A panel's in-flight box is not a new intrinsic size for its retained rows. */
|
|
4
|
+
export declare function createStableRowMeasurement(isActive: () => boolean): {
|
|
5
|
+
measure(node: HTMLDivElement, entry: ResizeObserverEntry | undefined, instance: RowVirtualizer): number;
|
|
6
|
+
cancel(): void;
|
|
7
|
+
};
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=row-measurement.web.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"row-measurement.web.d.ts","sourceRoot":"","sources":["../../../../src/list/row-measurement.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAG3E,KAAK,cAAc,GAAG,WAAW,CAAC,WAAW,GAAG,MAAM,EAAE,cAAc,CAAC,CAAC;AAExE,iFAAiF;AACjF,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,MAAM,OAAO;kBAmDtD,cAAc,SACb,mBAAmB,GAAG,SAAS,YAC5B,cAAc;;EA0B7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MailMessage.d.ts","sourceRoot":"","sources":["../../../../src/mail-thread/MailMessage.tsx"],"names":[],"mappings":"AAkCA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAS,CAAC;AAEhD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,WAAW,CAAC,EAC1B,MAAM,EACN,EAAE,EACF,EAAE,EACF,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,eAAuB,EACvB,gBAAgB,EAChB,MAAc,EACd,OAAe,EACf,eAAe,EACf,WAAW,EACX,QAAQ,EACR,OAAO,EACP,OAAO,EACP,UAAU,EACV,SAAS,EACT,IAAI,EACJ,OAAO,EACP,KAAK,EACL,MAAM,GACP,EAAE,gBAAgB,+
|
|
1
|
+
{"version":3,"file":"MailMessage.d.ts","sourceRoot":"","sources":["../../../../src/mail-thread/MailMessage.tsx"],"names":[],"mappings":"AAkCA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAS,CAAC;AAEhD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,WAAW,CAAC,EAC1B,MAAM,EACN,EAAE,EACF,EAAE,EACF,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,eAAuB,EACvB,gBAAgB,EAChB,MAAc,EACd,OAAe,EACf,eAAe,EACf,WAAW,EACX,QAAQ,EACR,OAAO,EACP,OAAO,EACP,UAAU,EACV,SAAS,EACT,IAAI,EACJ,OAAO,EACP,KAAK,EACL,MAAM,GACP,EAAE,gBAAgB,+BAsOlB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwipeRowBubble.d.ts","sourceRoot":"","sources":["../../../../src/swipe-row/SwipeRowBubble.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SwipeRowBubble.d.ts","sourceRoot":"","sources":["../../../../src/swipe-row/SwipeRowBubble.tsx"],"names":[],"mappings":"AACA,OAAiB,EAGf,KAAK,WAAW,EACjB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAS,CAAC;AAE9C,0FAA0F;AAC1F,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,IAAI,EACJ,KAAK,EACL,KAAK,EACL,OAAO,EACP,WAAW,EACX,UAAU,EACV,QAAQ,EACR,UAAU,EACV,UAAU,EACV,OAAO,EACP,IAAI,EACJ,MAAM,GACP,EAAE;IACD,MAAM,EAAE,cAAc,CAAC;IACvB,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAChC,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,+BA+DA"}
|
package/package.json
CHANGED
|
@@ -571,7 +571,16 @@ export function BottomBarBase({
|
|
|
571
571
|
{...(dock ? {} : actionMeasurement)}
|
|
572
572
|
style={{
|
|
573
573
|
flexShrink: 0,
|
|
574
|
-
|
|
574
|
+
// Measure the intrinsic action independently of the animated
|
|
575
|
+
// outer width. A hidden desktop bar reports zero; feeding that
|
|
576
|
+
// back into this measurer locks it at zero on compact reveal.
|
|
577
|
+
...(dock || fillAction
|
|
578
|
+
? {}
|
|
579
|
+
: IS_WEB
|
|
580
|
+
? { width: cssLength('max-content') }
|
|
581
|
+
: actionWidth == null
|
|
582
|
+
? {}
|
|
583
|
+
: { width: actionWidth }),
|
|
575
584
|
}}
|
|
576
585
|
>
|
|
577
586
|
<SearchPresentationContext.Provider value={adaptiveAction ? searchHost : null}>
|
|
@@ -94,7 +94,7 @@ export function createDetailDialog({
|
|
|
94
94
|
);
|
|
95
95
|
return (
|
|
96
96
|
<Motion>
|
|
97
|
-
<
|
|
97
|
+
<Screen
|
|
98
98
|
style={{
|
|
99
99
|
flex: 1,
|
|
100
100
|
minHeight: 0,
|
|
@@ -104,38 +104,35 @@ export function createDetailDialog({
|
|
|
104
104
|
backgroundColor: colors.card,
|
|
105
105
|
}}
|
|
106
106
|
testID={`${testID}-surface`}
|
|
107
|
+
kind={contentKind}
|
|
108
|
+
scroll={scrollable ? 'content' : 'none'}
|
|
109
|
+
navigationScope="isolated"
|
|
110
|
+
headerPlacement={scrollable ? 'overlay' : 'inset'}
|
|
111
|
+
header={
|
|
112
|
+
<PageHeader
|
|
113
|
+
testID={`${testID}-header`}
|
|
114
|
+
title={header}
|
|
115
|
+
subtitle={subtitle}
|
|
116
|
+
actions={
|
|
117
|
+
<>
|
|
118
|
+
{actions}
|
|
119
|
+
<Button
|
|
120
|
+
appearance="outline"
|
|
121
|
+
tone="neutral"
|
|
122
|
+
iconOnly
|
|
123
|
+
icon={<RiCloseLine />}
|
|
124
|
+
accessibilityLabel={closeLabel ?? common.close}
|
|
125
|
+
onPress={() => close()}
|
|
126
|
+
/>
|
|
127
|
+
</>
|
|
128
|
+
}
|
|
129
|
+
/>
|
|
130
|
+
}
|
|
131
|
+
bottomBar={footer}
|
|
132
|
+
bottomBarKeyboardBehavior={footerKeyboardBehavior}
|
|
107
133
|
>
|
|
108
|
-
<
|
|
109
|
-
|
|
110
|
-
scroll={scrollable ? 'content' : 'none'}
|
|
111
|
-
navigationScope="isolated"
|
|
112
|
-
headerPlacement={scrollable ? 'overlay' : 'inset'}
|
|
113
|
-
header={
|
|
114
|
-
<PageHeader
|
|
115
|
-
testID={`${testID}-header`}
|
|
116
|
-
title={header}
|
|
117
|
-
subtitle={subtitle}
|
|
118
|
-
actions={
|
|
119
|
-
<>
|
|
120
|
-
{actions}
|
|
121
|
-
<Button
|
|
122
|
-
appearance="outline"
|
|
123
|
-
tone="neutral"
|
|
124
|
-
iconOnly
|
|
125
|
-
icon={<RiCloseLine />}
|
|
126
|
-
accessibilityLabel={closeLabel ?? common.close}
|
|
127
|
-
onPress={() => close()}
|
|
128
|
-
/>
|
|
129
|
-
</>
|
|
130
|
-
}
|
|
131
|
-
/>
|
|
132
|
-
}
|
|
133
|
-
bottomBar={footer}
|
|
134
|
-
bottomBarKeyboardBehavior={footerKeyboardBehavior}
|
|
135
|
-
>
|
|
136
|
-
<BodyViewport body={body} scrollable={scrollable} testID={testID} />
|
|
137
|
-
</Screen>
|
|
138
|
-
</StyledView>
|
|
134
|
+
<BodyViewport body={body} scrollable={scrollable} testID={testID} />
|
|
135
|
+
</Screen>
|
|
139
136
|
</Motion>
|
|
140
137
|
);
|
|
141
138
|
}
|
package/src/list/ListPerson.tsx
CHANGED
|
@@ -38,7 +38,12 @@ export function ListPerson({
|
|
|
38
38
|
return (
|
|
39
39
|
<Shell
|
|
40
40
|
{...props}
|
|
41
|
-
label={
|
|
41
|
+
label={
|
|
42
|
+
props.label ??
|
|
43
|
+
[name, subtitle, typeof props.supporting === 'string' ? props.supporting : undefined]
|
|
44
|
+
.filter(Boolean)
|
|
45
|
+
.join(', ')
|
|
46
|
+
}
|
|
42
47
|
leading={
|
|
43
48
|
props.leading !== undefined ? (
|
|
44
49
|
props.leading
|
|
@@ -56,11 +61,11 @@ export function ListPerson({
|
|
|
56
61
|
</View>
|
|
57
62
|
)
|
|
58
63
|
}
|
|
59
|
-
content
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
+
// Explicit content, including null, replaces the entire default identity block.
|
|
65
|
+
supporting={props.content !== undefined ? undefined : props.supporting}
|
|
66
|
+
title={
|
|
67
|
+
props.content !== undefined ? undefined : (
|
|
68
|
+
<>
|
|
64
69
|
<Text variant="body-medium" numberOfLines={1} style={textStyle} testID={id('name')}>
|
|
65
70
|
{name}
|
|
66
71
|
</Text>
|
|
@@ -74,7 +79,7 @@ export function ListPerson({
|
|
|
74
79
|
{subtitle}
|
|
75
80
|
</Text>
|
|
76
81
|
) : null}
|
|
77
|
-
|
|
82
|
+
</>
|
|
78
83
|
)
|
|
79
84
|
}
|
|
80
85
|
trailing={
|
|
@@ -67,6 +67,7 @@ import {
|
|
|
67
67
|
} from '@tanstack/react-virtual';
|
|
68
68
|
|
|
69
69
|
import type { VirtualListHandle, VirtualListProps, VirtualListSlot } from './types';
|
|
70
|
+
import { createStableRowMeasurement } from './row-measurement.web';
|
|
70
71
|
|
|
71
72
|
// Rows in these lists (user rows, pack cards) are short and fairly uniform; a
|
|
72
73
|
// small estimate + per-row measurement keeps the mounted node count bounded.
|
|
@@ -220,6 +221,13 @@ function VirtualListWebInner<T>(
|
|
|
220
221
|
const viewport = useScreenViewport();
|
|
221
222
|
const scroller = viewport?.kind === 'element' ? viewport.scrollRef : null;
|
|
222
223
|
const active = viewport?.active !== false;
|
|
224
|
+
const activeRef = React.useRef(active);
|
|
225
|
+
activeRef.current = active;
|
|
226
|
+
const rowMeasurement = React.useMemo(
|
|
227
|
+
() => createStableRowMeasurement(() => activeRef.current),
|
|
228
|
+
[],
|
|
229
|
+
);
|
|
230
|
+
React.useLayoutEffect(() => () => rowMeasurement.cancel(), [rowMeasurement, active]);
|
|
223
231
|
const [scrollElement, setScrollElement] = React.useState<HTMLElement | null>(null);
|
|
224
232
|
// Parent host refs attach after child layout effects. Publish the resolved
|
|
225
233
|
// element after commit so TanStack binds it even without another app render.
|
|
@@ -298,6 +306,7 @@ function VirtualListWebInner<T>(
|
|
|
298
306
|
scrollMargin,
|
|
299
307
|
useFlushSync: false,
|
|
300
308
|
rangeExtractor,
|
|
309
|
+
measureElement: rowMeasurement.measure,
|
|
301
310
|
getItemKey: keyExtractor ? (row: number) => itemKey(firstItemOf(row)) : undefined,
|
|
302
311
|
};
|
|
303
312
|
// Owner changes and inactivity detach observers, not the measurement model.
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { measureElement, type Virtualizer } from '@tanstack/react-virtual';
|
|
2
|
+
import { panelGeometryTransitions } from '../app-shell/panel-transitions';
|
|
3
|
+
|
|
4
|
+
type RowVirtualizer = Virtualizer<HTMLElement | Window, HTMLDivElement>;
|
|
5
|
+
|
|
6
|
+
/** A panel's in-flight box is not a new intrinsic size for its retained rows. */
|
|
7
|
+
export function createStableRowMeasurement(isActive: () => boolean) {
|
|
8
|
+
const pending = new Map<HTMLDivElement, RowVirtualizer>();
|
|
9
|
+
let generation = 0;
|
|
10
|
+
let waiting = false;
|
|
11
|
+
|
|
12
|
+
const transitionsFor = (node: HTMLElement) => {
|
|
13
|
+
const owners: HTMLElement[] = [];
|
|
14
|
+
for (let parent = node.parentElement; parent; parent = parent.parentElement) {
|
|
15
|
+
if (
|
|
16
|
+
parent.hasAttribute('data-bloom-panel-owner') ||
|
|
17
|
+
parent.hasAttribute('data-bloom-reading-envelope') ||
|
|
18
|
+
parent.hasAttribute('data-bloom-shell-frame')
|
|
19
|
+
)
|
|
20
|
+
owners.push(parent);
|
|
21
|
+
}
|
|
22
|
+
return panelGeometryTransitions(owners);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const flushWhenSettled = (request: number) => {
|
|
26
|
+
if (request !== generation) return;
|
|
27
|
+
if (!isActive()) {
|
|
28
|
+
pending.clear();
|
|
29
|
+
waiting = false;
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const animations = new Set(
|
|
33
|
+
[...pending.keys()].filter((node) => node.isConnected).flatMap(transitionsFor),
|
|
34
|
+
);
|
|
35
|
+
if (animations.size) {
|
|
36
|
+
void Promise.allSettled([...animations].map((animation) => animation.finished)).then(() =>
|
|
37
|
+
flushWhenSettled(request),
|
|
38
|
+
);
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
const rows = [...pending];
|
|
42
|
+
pending.clear();
|
|
43
|
+
waiting = false;
|
|
44
|
+
for (const [node, instance] of rows) {
|
|
45
|
+
if (!node.isConnected || node.getBoundingClientRect().width <= 0) continue;
|
|
46
|
+
const index = instance.indexFromElement(node);
|
|
47
|
+
if (index < 0 || index >= instance.options.count) continue;
|
|
48
|
+
const key = instance.options.getItemKey(index);
|
|
49
|
+
if (instance.elementsCache.get(key) !== node) continue;
|
|
50
|
+
// A final RO entry can arrive before transition.finished. Re-read the
|
|
51
|
+
// settled box once; measureElement's no-entry path intentionally caches.
|
|
52
|
+
instance.resizeItem(index, node.offsetHeight);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
return {
|
|
57
|
+
measure(
|
|
58
|
+
node: HTMLDivElement,
|
|
59
|
+
entry: ResizeObserverEntry | undefined,
|
|
60
|
+
instance: RowVirtualizer,
|
|
61
|
+
) {
|
|
62
|
+
const index = instance.indexFromElement(node);
|
|
63
|
+
const key = instance.options.getItemKey(index);
|
|
64
|
+
const previous = instance.itemSizeCache.get(key) ?? instance.options.estimateSize(index);
|
|
65
|
+
if (!isActive()) return previous;
|
|
66
|
+
const width = entry?.borderBoxSize?.[0]?.inlineSize ?? node.getBoundingClientRect().width;
|
|
67
|
+
// Keep observing: the next nonzero box reports itself without a timer.
|
|
68
|
+
if (width <= 0) return previous;
|
|
69
|
+
if (transitionsFor(node).length) {
|
|
70
|
+
pending.set(node, instance);
|
|
71
|
+
if (!waiting) {
|
|
72
|
+
waiting = true;
|
|
73
|
+
flushWhenSettled(generation);
|
|
74
|
+
}
|
|
75
|
+
return previous;
|
|
76
|
+
}
|
|
77
|
+
pending.delete(node);
|
|
78
|
+
return measureElement(node, entry, instance);
|
|
79
|
+
},
|
|
80
|
+
cancel() {
|
|
81
|
+
generation++;
|
|
82
|
+
pending.clear();
|
|
83
|
+
waiting = false;
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
}
|
|
@@ -135,7 +135,9 @@ export function MailMessage({
|
|
|
135
135
|
// that the group keeps the glyphs and drops the words, which is what
|
|
136
136
|
// `Button` is built for — the accessible name is the label either
|
|
137
137
|
// way, so nothing is lost by the labels going.
|
|
138
|
-
const compactReplies = !replyLabelsFit(
|
|
138
|
+
const compactReplies = !replyLabelsFit(
|
|
139
|
+
width === null ? null : Math.max(0, width - MAIL_BODY_INSET - geo.paddingHorizontal),
|
|
140
|
+
);
|
|
139
141
|
return (
|
|
140
142
|
<Card
|
|
141
143
|
appearance="solid"
|
|
@@ -488,10 +488,11 @@ function SwipeScrollGate({ children }: { children: ReactNode }) {
|
|
|
488
488
|
const gesture = useMemo(
|
|
489
489
|
() =>
|
|
490
490
|
pan
|
|
491
|
-
?
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
491
|
+
? // Let the ScrollView intercept actual travel before claiming the stream.
|
|
492
|
+
// Activating on DOWN cancels its child Pressables on Android, so taps
|
|
493
|
+
// on attachments never reach their actions. The row still waits for
|
|
494
|
+
// this gesture, and cannot interrupt it once scrolling starts.
|
|
495
|
+
Gesture.Native().blocksExternalGesture(pan).disallowInterruption(true)
|
|
495
496
|
: null,
|
|
496
497
|
[pan],
|
|
497
498
|
);
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { useCallback } from 'react';
|
|
2
1
|
import { Pressable } from 'react-native';
|
|
3
|
-
import Animated, {
|
|
2
|
+
import Animated, {
|
|
3
|
+
useAnimatedStyle,
|
|
4
|
+
useDerivedValue,
|
|
5
|
+
type SharedValue,
|
|
6
|
+
} from 'react-native-reanimated';
|
|
4
7
|
import { Text } from '../typography';
|
|
5
8
|
import { bubbleGeometry } from './bubble-geometry';
|
|
6
9
|
import type { SwipeRowAction } from './types';
|
|
@@ -36,8 +39,9 @@ export function SwipeRowBubble({
|
|
|
36
39
|
testID?: string;
|
|
37
40
|
}) {
|
|
38
41
|
const sign = side === 'left' ? 1 : -1;
|
|
39
|
-
|
|
40
|
-
|
|
42
|
+
// Native mapper subscriptions do not traverse a captured function's closure.
|
|
43
|
+
// Share the derived shape so both styles subscribe to every drag update.
|
|
44
|
+
const geometry = useDerivedValue(() => {
|
|
41
45
|
return bubbleGeometry(
|
|
42
46
|
Math.max(0, sign * translateX.value),
|
|
43
47
|
count * actionWidth,
|
|
@@ -48,18 +52,18 @@ export function SwipeRowBubble({
|
|
|
48
52
|
);
|
|
49
53
|
}, [actionWidth, count, index, primary, rowWidth, sign, translateX]);
|
|
50
54
|
const style = useAnimatedStyle(() => {
|
|
51
|
-
const shape = geometry
|
|
55
|
+
const shape = geometry.value;
|
|
52
56
|
return {
|
|
53
57
|
width: shape.width,
|
|
54
58
|
marginLeft: index === 0 ? shape.gap : 0,
|
|
55
59
|
marginRight: shape.gap,
|
|
56
60
|
transform: [{ scaleY: shape.scaleY }],
|
|
57
61
|
};
|
|
58
|
-
}, [geometry, index
|
|
62
|
+
}, [geometry, index]);
|
|
59
63
|
const labelStyle = useAnimatedStyle(() => {
|
|
60
|
-
const width = Math.max(0, Math.min(96, geometry
|
|
64
|
+
const width = Math.max(0, Math.min(96, geometry.value.width - 64));
|
|
61
65
|
return { width, opacity: Math.min(1, width / 32) };
|
|
62
|
-
}, [geometry
|
|
66
|
+
}, [geometry]);
|
|
63
67
|
const Icon = action.icon;
|
|
64
68
|
return (
|
|
65
69
|
<Animated.View
|