@oxyhq/bloom 0.48.0 → 0.49.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 (88) hide show
  1. package/lib/commonjs/bottom-sheet/BottomSheetBase.js +3 -1
  2. package/lib/commonjs/bottom-sheet/BottomSheetBase.js.map +1 -1
  3. package/lib/commonjs/dialog/Dialog.js +30 -4
  4. package/lib/commonjs/dialog/Dialog.js.map +1 -1
  5. package/lib/commonjs/dialog/Dialog.web.js +48 -14
  6. package/lib/commonjs/dialog/Dialog.web.js.map +1 -1
  7. package/lib/commonjs/dialog/DialogBottomSheet.js +30 -5
  8. package/lib/commonjs/dialog/DialogBottomSheet.js.map +1 -1
  9. package/lib/commonjs/dialog/DialogHeader.js +12 -6
  10. package/lib/commonjs/dialog/DialogHeader.js.map +1 -1
  11. package/lib/commonjs/dialog/DialogMorph.js +458 -0
  12. package/lib/commonjs/dialog/DialogMorph.js.map +1 -0
  13. package/lib/commonjs/dialog/index.js +7 -0
  14. package/lib/commonjs/dialog/index.js.map +1 -1
  15. package/lib/commonjs/dialog/index.web.js +7 -0
  16. package/lib/commonjs/dialog/index.web.js.map +1 -1
  17. package/lib/commonjs/settings-list/SettingsList.js +1 -1
  18. package/lib/commonjs/surfaces/SurfaceHost.js +1 -0
  19. package/lib/commonjs/surfaces/SurfaceHost.js.map +1 -1
  20. package/lib/module/bottom-sheet/BottomSheetBase.js +3 -1
  21. package/lib/module/bottom-sheet/BottomSheetBase.js.map +1 -1
  22. package/lib/module/dialog/Dialog.js +30 -4
  23. package/lib/module/dialog/Dialog.js.map +1 -1
  24. package/lib/module/dialog/Dialog.web.js +48 -15
  25. package/lib/module/dialog/Dialog.web.js.map +1 -1
  26. package/lib/module/dialog/DialogBottomSheet.js +31 -6
  27. package/lib/module/dialog/DialogBottomSheet.js.map +1 -1
  28. package/lib/module/dialog/DialogHeader.js +12 -6
  29. package/lib/module/dialog/DialogHeader.js.map +1 -1
  30. package/lib/module/dialog/DialogMorph.js +451 -0
  31. package/lib/module/dialog/DialogMorph.js.map +1 -0
  32. package/lib/module/dialog/index.js +1 -0
  33. package/lib/module/dialog/index.js.map +1 -1
  34. package/lib/module/dialog/index.web.js +1 -0
  35. package/lib/module/dialog/index.web.js.map +1 -1
  36. package/lib/module/settings-list/SettingsList.js +1 -1
  37. package/lib/module/surfaces/SurfaceHost.js +1 -0
  38. package/lib/module/surfaces/SurfaceHost.js.map +1 -1
  39. package/lib/typescript/commonjs/bottom-sheet/BottomSheetBase.d.ts +8 -1
  40. package/lib/typescript/commonjs/bottom-sheet/BottomSheetBase.d.ts.map +1 -1
  41. package/lib/typescript/commonjs/dialog/Dialog.d.ts.map +1 -1
  42. package/lib/typescript/commonjs/dialog/Dialog.web.d.ts.map +1 -1
  43. package/lib/typescript/commonjs/dialog/DialogBottomSheet.d.ts +2 -2
  44. package/lib/typescript/commonjs/dialog/DialogBottomSheet.d.ts.map +1 -1
  45. package/lib/typescript/commonjs/dialog/DialogHeader.d.ts.map +1 -1
  46. package/lib/typescript/commonjs/dialog/DialogMorph.d.ts +150 -0
  47. package/lib/typescript/commonjs/dialog/DialogMorph.d.ts.map +1 -0
  48. package/lib/typescript/commonjs/dialog/index.d.ts +2 -0
  49. package/lib/typescript/commonjs/dialog/index.d.ts.map +1 -1
  50. package/lib/typescript/commonjs/dialog/index.web.d.ts +2 -0
  51. package/lib/typescript/commonjs/dialog/index.web.d.ts.map +1 -1
  52. package/lib/typescript/commonjs/dialog/types.d.ts +30 -0
  53. package/lib/typescript/commonjs/dialog/types.d.ts.map +1 -1
  54. package/lib/typescript/commonjs/surfaces/SurfaceHost.d.ts.map +1 -1
  55. package/lib/typescript/commonjs/surfaces/types.d.ts +9 -0
  56. package/lib/typescript/commonjs/surfaces/types.d.ts.map +1 -1
  57. package/lib/typescript/module/bottom-sheet/BottomSheetBase.d.ts +8 -1
  58. package/lib/typescript/module/bottom-sheet/BottomSheetBase.d.ts.map +1 -1
  59. package/lib/typescript/module/dialog/Dialog.d.ts.map +1 -1
  60. package/lib/typescript/module/dialog/Dialog.web.d.ts.map +1 -1
  61. package/lib/typescript/module/dialog/DialogBottomSheet.d.ts +2 -2
  62. package/lib/typescript/module/dialog/DialogBottomSheet.d.ts.map +1 -1
  63. package/lib/typescript/module/dialog/DialogHeader.d.ts.map +1 -1
  64. package/lib/typescript/module/dialog/DialogMorph.d.ts +150 -0
  65. package/lib/typescript/module/dialog/DialogMorph.d.ts.map +1 -0
  66. package/lib/typescript/module/dialog/index.d.ts +2 -0
  67. package/lib/typescript/module/dialog/index.d.ts.map +1 -1
  68. package/lib/typescript/module/dialog/index.web.d.ts +2 -0
  69. package/lib/typescript/module/dialog/index.web.d.ts.map +1 -1
  70. package/lib/typescript/module/dialog/types.d.ts +30 -0
  71. package/lib/typescript/module/dialog/types.d.ts.map +1 -1
  72. package/lib/typescript/module/surfaces/SurfaceHost.d.ts.map +1 -1
  73. package/lib/typescript/module/surfaces/types.d.ts +9 -0
  74. package/lib/typescript/module/surfaces/types.d.ts.map +1 -1
  75. package/package.json +1 -1
  76. package/src/__tests__/DialogMorph.test.tsx +230 -0
  77. package/src/bottom-sheet/BottomSheetBase.tsx +13 -1
  78. package/src/dialog/Dialog.tsx +38 -11
  79. package/src/dialog/Dialog.web.tsx +40 -10
  80. package/src/dialog/DialogBottomSheet.tsx +35 -5
  81. package/src/dialog/DialogHeader.tsx +14 -5
  82. package/src/dialog/DialogMorph.tsx +576 -0
  83. package/src/dialog/index.ts +2 -0
  84. package/src/dialog/index.web.ts +2 -0
  85. package/src/dialog/types.ts +30 -0
  86. package/src/settings-list/SettingsList.tsx +1 -1
  87. package/src/surfaces/SurfaceHost.tsx +1 -0
  88. package/src/surfaces/types.ts +9 -0
@@ -0,0 +1,458 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.DIALOG_MORPH_FADE_DURATION = exports.DIALOG_MORPH_DURATION = void 0;
7
+ exports.DialogMorphContent = DialogMorphContent;
8
+ exports.useDialogFrame = useDialogFrame;
9
+ exports.useDialogMorph = useDialogMorph;
10
+ var _react = _interopRequireWildcard(require("react"));
11
+ var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reanimated"));
12
+ var _jsxRuntime = require("react/jsx-runtime");
13
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
14
+ // ---------------------------------------------------------------------------
15
+ // Size morphing — the panel reshapes across an IN-PLACE content swap.
16
+ //
17
+ // A surface has two axes. DEPTH: a new surface is presented on top (its own
18
+ // backdrop / z-layer) — untouched by this module. NAV-WITHIN: the content
19
+ // INSIDE one surface is swapped for another screen. Without morphing that swap
20
+ // hard-cuts: the panel jumps from the outgoing screen's size to the incoming
21
+ // one's in a single frame. Morphing animates the panel between the two sizes
22
+ // while the incoming content fades in, so navigating within a surface reads as
23
+ // ONE container reshaping.
24
+ //
25
+ // The Dialog cannot see a nav-within swap from its props: the content that
26
+ // changes lives deep inside `children` (a host that subscribes to its own
27
+ // route store), so the Dialog re-renders nothing. The content therefore
28
+ // DECLARES its identity through {@link useDialogFrame} — the same
29
+ // external-channel bridge `useDialogHeader` uses for the nav bar — and the
30
+ // surface runs the morph when that identity changes.
31
+ //
32
+ // Geometry, per placement:
33
+ // - centered card — height grows/shrinks about its centre (the backdrop
34
+ // centres it), and `maxWidth` morphs too when the surface changes it.
35
+ // - bottom sheet — height grows/shrinks from its anchored bottom edge.
36
+ // - side sheet — fixed geometry (pinned top/bottom, fixed width), so
37
+ // there is nothing to morph; those placements never mount this.
38
+ // ---------------------------------------------------------------------------
39
+
40
+ /** Panel reshape duration (ms) between two content frames. */
41
+ const DIALOG_MORPH_DURATION = exports.DIALOG_MORPH_DURATION = 260;
42
+
43
+ /**
44
+ * Incoming-frame fade-in (ms). Deliberately shorter than the reshape so the new
45
+ * content has landed by the time the panel finishes settling.
46
+ */
47
+ const DIALOG_MORPH_FADE_DURATION = exports.DIALOG_MORPH_FADE_DURATION = 150;
48
+
49
+ /**
50
+ * How long the panel stays pinned at the outgoing size waiting for the incoming
51
+ * frame to report its own. A frame whose content measures IDENTICALLY never
52
+ * re-reports (nothing resized), so the pin is released on this timeout — there
53
+ * was no size change to morph.
54
+ */
55
+ const MORPH_MEASURE_TIMEOUT_MS = 200;
56
+
57
+ /** Reshape easing — matches the ease-out the rest of the Dialog motion uses. */
58
+ const MORPH_EASING = _reactNativeReanimated.Easing.out(_reactNativeReanimated.Easing.cubic);
59
+
60
+ /**
61
+ * Largest plausible gap between the panel box and its content (borders, the
62
+ * scroll container's padding). A bigger difference means the sample is not
63
+ * chrome — the panel is capped, or the content wrapper is being stretched — so
64
+ * it is dropped rather than baked into the next reshape target.
65
+ */
66
+ const MAX_PANEL_CHROME = 96;
67
+
68
+ /**
69
+ * Below this, an incoming frame is treated as having NO natural height rather
70
+ * than a tiny one: content that fills the space it is given (a list that flexes
71
+ * to its container) measures ~0 inside a content-sized wrapper, and reshaping
72
+ * the panel down to that would collapse the surface. Such a frame keeps the
73
+ * panel's normal sizing instead.
74
+ */
75
+ const MIN_MEASURABLE_CONTENT = 40;
76
+
77
+ /**
78
+ * The identity of the content currently rendered inside a Dialog surface,
79
+ * declared by that content via {@link useDialogFrame}.
80
+ */
81
+
82
+ /**
83
+ * The bridge between a surface's content (which knows WHEN it swapped) and the
84
+ * surface (which owns the panel). Deliberately not a React store: the surface
85
+ * does not need to re-render on a frame change — it drives shared values.
86
+ */
87
+
88
+ function createFrameChannel() {
89
+ let last = null;
90
+ let handler = null;
91
+ let frameListener = null;
92
+ return {
93
+ setFrame: frame => {
94
+ const previous = last;
95
+ last = frame;
96
+ frameListener?.(frame);
97
+ if (previous && previous.key !== frame.key) handler?.(frame, previous);
98
+ },
99
+ setHandler: next => {
100
+ handler = next;
101
+ return () => {
102
+ if (handler === next) handler = null;
103
+ };
104
+ },
105
+ setFrameListener: next => {
106
+ frameListener = next;
107
+ if (last) next(last);
108
+ return () => {
109
+ if (frameListener === next) frameListener = null;
110
+ };
111
+ }
112
+ };
113
+ }
114
+ const DialogFrameContext = /*#__PURE__*/(0, _react.createContext)(null);
115
+
116
+ /**
117
+ * Declare the identity of the content currently rendered inside a Dialog
118
+ * surface. When the `key` changes while the surface stays open, the surface
119
+ * MORPHS its panel from the outgoing content's size to the incoming one's
120
+ * instead of hard-cutting.
121
+ *
122
+ * Called by the host that owns the surface's content (the SDK's `SurfaceScreen`
123
+ * declares `route#step`). No-op outside a morph-capable Dialog surface — a side
124
+ * sheet, or a plain confirm dialog — so a host can call it unconditionally.
125
+ *
126
+ * EXACTLY ONE host per surface may declare frames: two writers with different
127
+ * identities would each read the other's key as a swap and morph on every
128
+ * render. A screen that wants its own sub-views to morph must fold them into
129
+ * the surface host's key rather than declaring a second frame.
130
+ */
131
+ function useDialogFrame(frame) {
132
+ const channel = (0, _react.useContext)(DialogFrameContext);
133
+ const key = frame?.key;
134
+ const morph = frame?.morph;
135
+ const sizeHeight = frame?.size?.height;
136
+ const sizeMaxWidth = frame?.size?.maxWidth;
137
+ // Declared in the commit's layout phase, BEFORE the browser paints the new
138
+ // content: that is what lets the surface pin the panel at the outgoing size
139
+ // in the same frame the swap commits (the panel's own layout for the incoming
140
+ // content is not reported until after this). Depend on the size PRIMITIVES (not
141
+ // the object) so a fresh `size` object each render does not re-fire the effect.
142
+ (0, _react.useLayoutEffect)(() => {
143
+ if (!channel || key === undefined) return;
144
+ const size = sizeHeight !== undefined || sizeMaxWidth !== undefined ? {
145
+ height: sizeHeight,
146
+ maxWidth: sizeMaxWidth
147
+ } : undefined;
148
+ channel.setFrame({
149
+ key,
150
+ morph,
151
+ size
152
+ });
153
+ }, [channel, key, morph, sizeHeight, sizeMaxWidth]);
154
+ }
155
+
156
+ /** Options a surface passes when it wires up morphing for its panel. */
157
+
158
+ /**
159
+ * Wire size morphing into one Dialog surface. Returns the panel/content styles
160
+ * and the two measurement callbacks the surface must attach.
161
+ *
162
+ * While idle the panel style resolves to `height: 'auto'` — byte-for-byte the
163
+ * natural sizing every placement had before morphing existed — so first open,
164
+ * dismissal, and a responsive placement swap are untouched. The height is only
165
+ * driven for the ~260ms of an actual reshape, then released back to natural.
166
+ *
167
+ * A frame that declares an explicit `size` is different: that size is DERIVED
168
+ * state the panel rests at at EVERY layout (`declaredHeight`/`declaredMaxWidth`),
169
+ * not a one-shot animation target — so a placement swap (which re-lays the panel
170
+ * out WITHOUT a key change, so the animation never re-runs) still settles at the
171
+ * declared size instead of falling back to natural.
172
+ */
173
+ function useDialogMorph({
174
+ enabled,
175
+ measurable,
176
+ maxHeight,
177
+ maxWidth
178
+ }) {
179
+ const channel = (0, _react.useMemo)(() => createFrameChannel(), []);
180
+
181
+ /** 1 while the panel height is driven by an in-flight morph animation. */
182
+ const pinned = (0, _reactNativeReanimated.useSharedValue)(0);
183
+ const height = (0, _reactNativeReanimated.useSharedValue)(0);
184
+ /** 1 while `maxWidth` is driven by an in-flight morph animation. */
185
+ const widthPinned = (0, _reactNativeReanimated.useSharedValue)(0);
186
+ const width = (0, _reactNativeReanimated.useSharedValue)(0);
187
+ /**
188
+ * The ACTIVE frame's declared explicit size (0 = none) — the panel's RESTING
189
+ * size, re-derived on every `setFrame` so it survives a placement swap. `height`
190
+ * is clamped to the viewport; `maxWidth` widens the centered card.
191
+ */
192
+ const declaredHeight = (0, _reactNativeReanimated.useSharedValue)(0);
193
+ const declaredMaxWidth = (0, _reactNativeReanimated.useSharedValue)(0);
194
+ /** Incoming-frame opacity. Rests at 1; dips to 0 and fades back on a swap. */
195
+ const fade = (0, _reactNativeReanimated.useSharedValue)(1);
196
+
197
+ /** Last laid-out panel height — the size a morph starts FROM. */
198
+ const panelHeight = (0, _react.useRef)(0);
199
+ /** Last laid-out height of the content wrapper — the content's NATURAL height. */
200
+ const contentHeight = (0, _react.useRef)(0);
201
+ /**
202
+ * Panel box height MINUS its scroll content height, sampled while idle and
203
+ * unclamped: the panel's own chrome (borders, scroll-container padding).
204
+ * Self-calibrating, so no placement has to hard-code its own box math.
205
+ */
206
+ const chrome = (0, _react.useRef)(0);
207
+ /** True between a frame change and the moment the incoming size arrives. */
208
+ const awaitingSize = (0, _react.useRef)(false);
209
+ const releaseTimer = (0, _react.useRef)(null);
210
+ /** Mirrors of render-time values the (stable) callbacks below need to read. */
211
+ const maxHeightRef = (0, _react.useRef)(maxHeight);
212
+ maxHeightRef.current = maxHeight;
213
+ const measurableRef = (0, _react.useRef)(measurable);
214
+ measurableRef.current = measurable;
215
+ const enabledRef = (0, _react.useRef)(enabled);
216
+ enabledRef.current = enabled;
217
+ /**
218
+ * The EFFECTIVE `maxWidth` of the CURRENT frame — its explicit `size.maxWidth`
219
+ * if it declared one, else the surface `maxWidth`. Held so the next frame change
220
+ * knows the width to morph FROM. The handler owns it (not a passive effect) so a
221
+ * per-frame width is not clobbered mid-flow.
222
+ */
223
+ const activeMaxWidth = (0, _react.useRef)(maxWidth);
224
+
225
+ // Keep the active frame's DECLARED size current on every render/layout — this
226
+ // is the panel's resting size, so it survives a placement swap (which remounts
227
+ // this surface and fires the listener immediately with the current frame). A
228
+ // frame with no explicit size resets these to 0 (natural sizing). A LAYOUT
229
+ // effect so the seed lands BEFORE paint on a placement-swap remount (the child
230
+ // `SurfaceScreen`'s `setFrame` layout-effect runs first, setting the channel's
231
+ // last frame; registering here then fires immediately with it — no small-size
232
+ // flash). NOTE: must NOT touch `activeMaxWidth` — the listener runs BEFORE the
233
+ // key-change handler in the same `setFrame`, and the handler needs the PREVIOUS
234
+ // frame's width as the animation's FROM.
235
+ (0, _react.useLayoutEffect)(() => {
236
+ return channel.setFrameListener(frame => {
237
+ declaredHeight.value = frame.size?.height ?? 0;
238
+ declaredMaxWidth.value = frame.size?.maxWidth ?? 0;
239
+ });
240
+ }, [channel, declaredHeight, declaredMaxWidth]);
241
+ const clearReleaseTimer = (0, _react.useCallback)(() => {
242
+ if (releaseTimer.current === null) return;
243
+ clearTimeout(releaseTimer.current);
244
+ releaseTimer.current = null;
245
+ }, []);
246
+
247
+ /** Hand the panel back to natural sizing. */
248
+ const release = (0, _react.useCallback)(() => {
249
+ awaitingSize.current = false;
250
+ clearReleaseTimer();
251
+ (0, _reactNativeReanimated.cancelAnimation)(height);
252
+ pinned.value = 0;
253
+ }, [clearReleaseTimer, height, pinned]);
254
+
255
+ /** Start the reshape once the incoming frame's natural height is known. */
256
+ const settle = (0, _react.useCallback)(naturalContentHeight => {
257
+ if (!awaitingSize.current) return;
258
+ awaitingSize.current = false;
259
+ clearReleaseTimer();
260
+ if (naturalContentHeight < MIN_MEASURABLE_CONTENT) {
261
+ release();
262
+ return;
263
+ }
264
+ const from = height.value;
265
+ const to = Math.max(0, Math.min(naturalContentHeight + chrome.current, maxHeightRef.current));
266
+ if (Math.abs(to - from) < 1) {
267
+ release();
268
+ return;
269
+ }
270
+ height.value = (0, _reactNativeReanimated.withTiming)(to, {
271
+ duration: DIALOG_MORPH_DURATION,
272
+ easing: MORPH_EASING
273
+ }, finished => {
274
+ 'worklet';
275
+
276
+ // Release only on a clean finish — a cancel means a newer morph has
277
+ // already taken the pin over.
278
+ if (finished) pinned.value = 0;
279
+ });
280
+ }, [clearReleaseTimer, height, pinned, release]);
281
+
282
+ // The morph runner. Registered on the channel the content writes into.
283
+ (0, _react.useEffect)(() => {
284
+ return channel.setHandler(next => {
285
+ if (!enabledRef.current) return;
286
+
287
+ // The incoming frame always fades in, morph or not — a hard content cut
288
+ // inside a surface that stays put is the jarring part.
289
+ (0, _reactNativeReanimated.cancelAnimation)(fade);
290
+ fade.value = 0;
291
+ fade.value = (0, _reactNativeReanimated.withTiming)(1, {
292
+ duration: DIALOG_MORPH_FADE_DURATION,
293
+ easing: MORPH_EASING
294
+ });
295
+ if (next.morph === false) {
296
+ release();
297
+ return;
298
+ }
299
+
300
+ // Pin at the size the panel is CURRENTLY painted at. `panelHeight` is
301
+ // still the outgoing frame's: this runs in the swap's layout phase, before
302
+ // the incoming content's layout is reported.
303
+ const from = panelHeight.current;
304
+
305
+ // Width, where the placement allows it: ANIMATE the panel's maxWidth from
306
+ // the outgoing frame's effective width to the incoming one's (its explicit
307
+ // `size.maxWidth`, else the surface `maxWidth`). The resting width is the
308
+ // DERIVED `declaredMaxWidth`, so we release `widthPinned` on finish — nothing
309
+ // snaps, and a placement swap re-settles at the declared width on its own.
310
+ const fromWidth = activeMaxWidth.current;
311
+ const toWidth = next.size?.maxWidth ?? maxWidth;
312
+ activeMaxWidth.current = toWidth;
313
+ if (fromWidth !== undefined && toWidth !== undefined && fromWidth !== toWidth) {
314
+ (0, _reactNativeReanimated.cancelAnimation)(width);
315
+ width.value = fromWidth;
316
+ widthPinned.value = 1;
317
+ width.value = (0, _reactNativeReanimated.withTiming)(toWidth, {
318
+ duration: DIALOG_MORPH_DURATION,
319
+ easing: MORPH_EASING
320
+ }, finished => {
321
+ 'worklet';
322
+
323
+ if (finished) widthPinned.value = 0;
324
+ });
325
+ }
326
+
327
+ // Height. An EXPLICIT `size.height` animates the panel DIRECTLY to it (grows
328
+ // or shrinks even a non-measurable / own-scroller frame to a big declared
329
+ // size); otherwise the panel can only reshape when the surface owns the
330
+ // scroll container (`measurable`) and we measure the incoming content. The
331
+ // resting height is the DERIVED `declaredHeight`, so we release the pin on
332
+ // finish — no snap to 'auto', and a placement swap re-settles there itself.
333
+ if (next.size?.height !== undefined) {
334
+ if (from <= 0) return;
335
+ (0, _reactNativeReanimated.cancelAnimation)(height);
336
+ height.value = from;
337
+ pinned.value = 1;
338
+ const to = Math.max(0, Math.min(next.size.height, maxHeightRef.current));
339
+ height.value = (0, _reactNativeReanimated.withTiming)(to, {
340
+ duration: DIALOG_MORPH_DURATION,
341
+ easing: MORPH_EASING
342
+ }, finished => {
343
+ 'worklet';
344
+
345
+ if (finished) pinned.value = 0;
346
+ });
347
+ return;
348
+ }
349
+ if (!measurableRef.current) {
350
+ release();
351
+ return;
352
+ }
353
+ if (from <= 0) return;
354
+ (0, _reactNativeReanimated.cancelAnimation)(height);
355
+ height.value = from;
356
+ pinned.value = 1;
357
+ awaitingSize.current = true;
358
+ clearReleaseTimer();
359
+ releaseTimer.current = setTimeout(release, MORPH_MEASURE_TIMEOUT_MS);
360
+ });
361
+ }, [channel, clearReleaseTimer, fade, height, maxWidth, pinned, release, width, widthPinned]);
362
+ (0, _react.useEffect)(() => () => {
363
+ clearReleaseTimer();
364
+ (0, _reactNativeReanimated.cancelAnimation)(height);
365
+ (0, _reactNativeReanimated.cancelAnimation)(width);
366
+ (0, _reactNativeReanimated.cancelAnimation)(fade);
367
+ }, [clearReleaseTimer, fade, height, width]);
368
+
369
+ /** Re-derive the panel's own chrome height whenever it can be sampled cleanly. */
370
+ const calibrate = (0, _react.useCallback)(() => {
371
+ if (!measurableRef.current) return;
372
+ if (pinned.value === 1 || awaitingSize.current) return;
373
+ if (panelHeight.current <= 0 || contentHeight.current <= 0) return;
374
+ const delta = panelHeight.current - contentHeight.current;
375
+ // A panel SHORTER than its content is capped, and one far taller is not
376
+ // reporting chrome at all — neither says anything usable.
377
+ if (delta < 0 || delta > MAX_PANEL_CHROME) return;
378
+ chrome.current = delta;
379
+ }, [pinned]);
380
+
381
+ /** Attach to the panel: tracks the size a morph starts from. */
382
+ const onPanelLayout = (0, _react.useCallback)(event => {
383
+ panelHeight.current = event.nativeEvent.layout.height;
384
+ calibrate();
385
+ }, [calibrate]);
386
+
387
+ /**
388
+ * Attached to the content wrapper, which lives INSIDE the surface's scroll
389
+ * container and is sized by its own content — so it reports the natural height
390
+ * of the incoming frame even while the panel is pinned at the outgoing one,
391
+ * which is exactly what a pinned panel cannot measure for itself.
392
+ */
393
+ const onContentLayout = (0, _react.useCallback)(event => {
394
+ const natural = event.nativeEvent.layout.height;
395
+ contentHeight.current = natural;
396
+ if (awaitingSize.current) {
397
+ settle(natural);
398
+ return;
399
+ }
400
+ calibrate();
401
+ }, [calibrate, settle]);
402
+ const panelStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => {
403
+ // Height: the in-flight animation while pinned, else the RESTING size — the
404
+ // active frame's `declaredHeight` when it has one (survives a placement swap),
405
+ // else natural (`'auto'`).
406
+ const resolvedHeight = pinned.value === 1 ? height.value : declaredHeight.value > 0 ? declaredHeight.value : 'auto';
407
+ // Width only varies on a placement that HAS a `maxWidth` (the centered card).
408
+ // A full-bleed placement (bottom sheet, `maxWidth === undefined`) is never
409
+ // width-capped — only height matters there. On the centered card the width is
410
+ // the in-flight animation while pinned, else the frame's declared width (which
411
+ // survives a placement swap), else the surface `maxWidth`.
412
+ if (maxWidth === undefined) return {
413
+ height: resolvedHeight
414
+ };
415
+ const resolvedMaxWidth = widthPinned.value === 1 ? width.value : declaredMaxWidth.value > 0 ? declaredMaxWidth.value : maxWidth;
416
+ return {
417
+ height: resolvedHeight,
418
+ maxWidth: resolvedMaxWidth
419
+ };
420
+ // RN-Web has no worklets babel plugin: every shared value the mapper READS
421
+ // must be listed here or it runs once and freezes at the first frame.
422
+ }, [pinned, height, declaredHeight, widthPinned, width, declaredMaxWidth, maxWidth]);
423
+ const contentStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => ({
424
+ opacity: fade.value
425
+ }), [fade]);
426
+ return {
427
+ channel,
428
+ onPanelLayout,
429
+ onContentLayout,
430
+ panelStyle,
431
+ contentStyle
432
+ };
433
+ }
434
+ /**
435
+ * Wraps a surface's content: publishes the frame channel to it (so it can
436
+ * declare swaps via {@link useDialogFrame}), measures the content's natural
437
+ * height, and carries the incoming-frame fade.
438
+ *
439
+ * MUST be rendered inside the surface's scroll content and MUST NOT be given a
440
+ * growing/stretching style: it is sized by its own content, which is what lets
441
+ * it report the incoming frame's natural height while the panel is still pinned
442
+ * at the outgoing one.
443
+ */
444
+ function DialogMorphContent({
445
+ morph,
446
+ style,
447
+ children
448
+ }) {
449
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(DialogFrameContext.Provider, {
450
+ value: morph.channel,
451
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
452
+ onLayout: morph.onContentLayout,
453
+ style: [style, morph.contentStyle],
454
+ children: children
455
+ })
456
+ });
457
+ }
458
+ //# sourceMappingURL=DialogMorph.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNativeReanimated","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","DIALOG_MORPH_DURATION","exports","DIALOG_MORPH_FADE_DURATION","MORPH_MEASURE_TIMEOUT_MS","MORPH_EASING","Easing","out","cubic","MAX_PANEL_CHROME","MIN_MEASURABLE_CONTENT","createFrameChannel","last","handler","frameListener","setFrame","frame","previous","key","setHandler","next","setFrameListener","DialogFrameContext","createContext","useDialogFrame","channel","useContext","morph","sizeHeight","size","height","sizeMaxWidth","maxWidth","useLayoutEffect","undefined","useDialogMorph","enabled","measurable","maxHeight","useMemo","pinned","useSharedValue","widthPinned","width","declaredHeight","declaredMaxWidth","fade","panelHeight","useRef","contentHeight","chrome","awaitingSize","releaseTimer","maxHeightRef","current","measurableRef","enabledRef","activeMaxWidth","value","clearReleaseTimer","useCallback","clearTimeout","release","cancelAnimation","settle","naturalContentHeight","from","to","Math","max","min","abs","withTiming","duration","easing","finished","useEffect","fromWidth","toWidth","setTimeout","calibrate","delta","onPanelLayout","event","nativeEvent","layout","onContentLayout","natural","panelStyle","useAnimatedStyle","resolvedHeight","resolvedMaxWidth","contentStyle","opacity","DialogMorphContent","style","children","jsx","Provider","View","onLayout"],"sourceRoot":"../../../src","sources":["d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AH,uCAAgB,EACnC,OAAO;IAAEI,OAAO,EAAE/C,IAAI,CAACY;EAAM,CAAC,CAAC,EAC/B,CAACZ,IAAI,CACP,CAAC;EAED,OAAO;IACLrB,OAAO;IACPyD,aAAa;IACbI,eAAe;IACfE,UAAU;IACVI;EACF,CAAC;AACH;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,kBAAkBA,CAAC;EACjCnE,KAAK;EACLoE,KAAK;EACLC;AAKF,CAAC,EAAsB;EACrB,oBACE,IAAAnH,WAAA,CAAAoH,GAAA,EAAC3E,kBAAkB,CAAC4E,QAAQ;IAACxC,KAAK,EAAE/B,KAAK,CAACF,OAAQ;IAAAuE,QAAA,eAChD,IAAAnH,WAAA,CAAAoH,GAAA,EAACrH,sBAAA,CAAAY,OAAQ,CAAC2G,IAAI;MAACC,QAAQ,EAAEzE,KAAK,CAAC2D,eAAgB;MAACS,KAAK,EAAE,CAACA,KAAK,EAAEpE,KAAK,CAACiE,YAAY,CAAE;MAAAI,QAAA,EAChFA;IAAQ,CACI;EAAC,CACW,CAAC;AAElC","ignoreList":[]}
@@ -39,6 +39,12 @@ Object.defineProperty(exports, "useDialogControl", {
39
39
  return _context.useDialogControl;
40
40
  }
41
41
  });
42
+ Object.defineProperty(exports, "useDialogFrame", {
43
+ enumerable: true,
44
+ get: function () {
45
+ return _DialogMorph.useDialogFrame;
46
+ }
47
+ });
42
48
  Object.defineProperty(exports, "useDialogHeader", {
43
49
  enumerable: true,
44
50
  get: function () {
@@ -50,4 +56,5 @@ var _BloomDialogProvider = require("./BloomDialogProvider");
50
56
  var _alert = require("./alert.js");
51
57
  var _context = require("./context.js");
52
58
  var _DialogHeader = require("./DialogHeader.js");
59
+ var _DialogMorph = require("./DialogMorph.js");
53
60
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_Dialog","require","_BloomDialogProvider","_alert","_context","_DialogHeader"],"sourceRoot":"../../../src","sources":["dialog/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,oBAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA","ignoreList":[]}
1
+ {"version":3,"names":["_Dialog","require","_BloomDialogProvider","_alert","_context","_DialogHeader","_DialogMorph"],"sourceRoot":"../../../src","sources":["dialog/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,oBAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA","ignoreList":[]}
@@ -45,6 +45,12 @@ Object.defineProperty(exports, "useDialogControl", {
45
45
  return _context.useDialogControl;
46
46
  }
47
47
  });
48
+ Object.defineProperty(exports, "useDialogFrame", {
49
+ enumerable: true,
50
+ get: function () {
51
+ return _DialogMorph.useDialogFrame;
52
+ }
53
+ });
48
54
  Object.defineProperty(exports, "useDialogHeader", {
49
55
  enumerable: true,
50
56
  get: function () {
@@ -56,4 +62,5 @@ var _BloomDialogProviderWeb = require("./BloomDialogProvider.web.js");
56
62
  var _alert = require("./alert.js");
57
63
  var _context = require("./context.js");
58
64
  var _DialogHeader = require("./DialogHeader.js");
65
+ var _DialogMorph = require("./DialogMorph.js");
59
66
  //# sourceMappingURL=index.web.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_DialogWeb","require","_BloomDialogProviderWeb","_alert","_context","_DialogHeader"],"sourceRoot":"../../../src","sources":["dialog/index.web.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,uBAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA","ignoreList":[]}
1
+ {"version":3,"names":["_DialogWeb","require","_BloomDialogProviderWeb","_alert","_context","_DialogHeader","_DialogMorph"],"sourceRoot":"../../../src","sources":["dialog/index.web.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,uBAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA","ignoreList":[]}
@@ -183,7 +183,7 @@ const styles = _reactNative.StyleSheet.create({
183
183
  itemContainer: {
184
184
  flexDirection: 'row',
185
185
  alignItems: 'center',
186
- paddingHorizontal: 16,
186
+ paddingHorizontal: 12,
187
187
  paddingVertical: 10,
188
188
  minHeight: 44,
189
189
  gap: 12
@@ -30,6 +30,7 @@ function placementFor(p) {
30
30
  contentPadding: p.contentPadding,
31
31
  header: p.header,
32
32
  scrollable: p.scrollable,
33
+ morph: p.morph,
33
34
  style: p.style,
34
35
  panelStyle: p.panelStyle,
35
36
  panelClassName: p.panelClassName,
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_context","_surfaceStore","_useSurface","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","DEFAULT_PLACEMENT","base","md","placementFor","p","placement","width","maxWidth","maxHeightRatio","inset","showHandle","dismissOnBackdrop","contentPadding","header","scrollable","style","panelStyle","panelClassName","containerStyle","containerClassName","label","testID","createSurfaceHost","Dialog","SurfaceLayer","entry","index","control","useDialogControl","id","status","controls","useMemo","dismiss","result","requestDismiss","present","render","opts","useEffect","open","close","handleClose","useCallback","finalizeClose","presentation","jsx","onClose","layer","startOpen","children","SurfaceContext","Provider","value","SurfaceHost","stack","useSyncExternalStore","subscribe","getSnapshot","useAndroidBackDismissesTop","useEscapeDismissesTop","Fragment","map","displayName","SurfaceProvider","resetSurfaces","jsxs","Platform","OS","sub","BackHandler","addEventListener","top","length","remove","window","document","handler","key","stopImmediatePropagation","preventDefault","removeEventListener"],"sourceRoot":"../../../src","sources":["surfaces/SurfaceHost.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAMA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,QAAA,GAAAF,OAAA;AAEA,IAAAG,aAAA,GAAAH,OAAA;AAQA,IAAAI,WAAA,GAAAJ,OAAA;AAA8C,IAAAK,WAAA,GAAAL,OAAA;AAAA,SAAAD,wBAAAO,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAT,uBAAA,YAAAA,CAAAO,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,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAA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AAY,CAAClC,iBAAiB,KAAK,KAAK,EAAE;MAClD9B,CAAC,CAACkG,wBAAwB,CAAC,CAAC;MAC5BlG,CAAC,CAACmG,cAAc,CAAC,CAAC;MAClB,IAAA7C,4BAAc,EAACqC,GAAG,CAAC3C,EAAE,CAAC;IACxB,CAAC;IACD8C,MAAM,CAACJ,gBAAgB,CAAC,SAAS,EAAEM,OAAO,EAAE,IAAI,CAAC;IACjD,OAAO,MAAMF,MAAM,CAACM,mBAAmB,CAAC,SAAS,EAAEJ,OAAO,EAAE,IAAI,CAAC;EACnE,CAAC,EAAE,EAAE,CAAC;AACR","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_context","_surfaceStore","_useSurface","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","DEFAULT_PLACEMENT","base","md","placementFor","p","placement","width","maxWidth","maxHeightRatio","inset","showHandle","dismissOnBackdrop","contentPadding","header","scrollable","morph","style","panelStyle","panelClassName","containerStyle","containerClassName","label","testID","createSurfaceHost","Dialog","SurfaceLayer","entry","index","control","useDialogControl","id","status","controls","useMemo","dismiss","result","requestDismiss","present","render","opts","useEffect","open","close","handleClose","useCallback","finalizeClose","presentation","jsx","onClose","layer","startOpen","children","SurfaceContext","Provider","value","SurfaceHost","stack","useSyncExternalStore","subscribe","getSnapshot","useAndroidBackDismissesTop","useEscapeDismissesTop","Fragment","map","displayName","SurfaceProvider","resetSurfaces","jsxs","Platform","OS","sub","BackHandler","addEventListener","top","length","remove","window","document","handler","key","stopImmediatePropagation","preventDefault","removeEventListener"],"sourceRoot":"../../../src","sources":["surfaces/SurfaceHost.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAMA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,QAAA,GAAAF,OAAA;AAEA,IAAAG,aAAA,GAAAH,OAA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,CAACnC,iBAAiB,KAAK,KAAK,EAAE,OAAO,IAAI;MAC7D,IAAAyB,4BAAc,EAACqC,GAAG,CAAC3C,EAAE,CAAC;MACtB,OAAO,IAAI;IACb,CAAC,CAAC;IACF,OAAO,MAAMwC,GAAG,CAACK,MAAM,CAAC,CAAC;EAC3B,CAAC,EAAE,EAAE,CAAC;AACR;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAASd,qBAAqBA,CAAA,EAAS;EACrC,IAAArB,gBAAS,EAAC,MAAM;IACd,IAAI4B,qBAAQ,CAACC,EAAE,KAAK,KAAK,EAAE;IAC3B,IAAI,OAAOO,MAAM,KAAK,WAAW,IAAI,OAAOC,QAAQ,KAAK,WAAW,EAAE;IACtE,MAAMC,OAAO,GAAIjG,CAAgB,IAAK;MACpC,IAAIA,CAAC,CAACkG,GAAG,KAAK,QAAQ,EAAE;MACxB,MAAMvB,KAAK,GAAG,IAAAG,yBAAW,EAAC,CAAC;MAC3B,MAAMc,GAAG,GAAGjB,KAAK,CAACA,KAAK,CAACkB,MAAM,GAAG,CAAC,CAAC;MACnC,IAAI,CAACD,GAAG,EAAE;MACV,IAAIA,GAAG,CAAC3B,YAAY,CAACnC,iBAAiB,KAAK,KAAK,EAAE;MAClD9B,CAAC,CAACmG,wBAAwB,CAAC,CAAC;MAC5BnG,CAAC,CAACoG,cAAc,CAAC,CAAC;MAClB,IAAA7C,4BAAc,EAACqC,GAAG,CAAC3C,EAAE,CAAC;IACxB,CAAC;IACD8C,MAAM,CAACJ,gBAAgB,CAAC,SAAS,EAAEM,OAAO,EAAE,IAAI,CAAC;IACjD,OAAO,MAAMF,MAAM,CAACM,mBAAmB,CAAC,SAAS,EAAEJ,OAAO,EAAE,IAAI,CAAC;EACnE,CAAC,EAAE,EAAE,CAAC;AACR","ignoreList":[]}
@@ -68,7 +68,8 @@ export const BottomSheetBase = /*#__PURE__*/forwardRef((props, ref) => {
68
68
  dynamicBackdrop = false,
69
69
  handleComponent,
70
70
  scrollY: externalScrollY,
71
- headerOverlay
71
+ headerOverlay,
72
+ onLayout
72
73
  } = props;
73
74
  const insets = useSafeAreaInsets();
74
75
  const theme = useTheme();
@@ -641,6 +642,7 @@ export const BottomSheetBase = /*#__PURE__*/forwardRef((props, ref) => {
641
642
  }), /*#__PURE__*/_jsx(GestureDetector, {
642
643
  gesture: panGesture,
643
644
  children: /*#__PURE__*/_jsxs(Animated.View, {
645
+ onLayout: onLayout,
644
646
  style: [dynamicStyles.sheet, sheetMarginStyle, sheetStyle, sheetHeightStyle, style],
645
647
  children: [backgroundComponent?.({
646
648
  style: styles.background