@oxyhq/bloom 0.79.0 → 0.80.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 (147) hide show
  1. package/README.md +3 -3
  2. package/lib/commonjs/provider/index.js +11 -7
  3. package/lib/commonjs/provider/index.js.map +1 -1
  4. package/lib/commonjs/scroll/context.js +96 -0
  5. package/lib/commonjs/scroll/context.js.map +1 -0
  6. package/lib/commonjs/scroll/expo-router/index.js +133 -0
  7. package/lib/commonjs/scroll/expo-router/index.js.map +1 -0
  8. package/lib/commonjs/scroll/index.js +85 -21
  9. package/lib/commonjs/scroll/index.js.map +1 -1
  10. package/lib/commonjs/scroll/index.web.js +221 -121
  11. package/lib/commonjs/scroll/index.web.js.map +1 -1
  12. package/lib/commonjs/scroll/scrollable.native.js +58 -0
  13. package/lib/commonjs/scroll/scrollable.native.js.map +1 -0
  14. package/lib/commonjs/scroll/scrollable.web.js +9 -3
  15. package/lib/commonjs/scroll/scrollable.web.js.map +1 -1
  16. package/lib/commonjs/scroll/store.js +47 -25
  17. package/lib/commonjs/scroll/store.js.map +1 -1
  18. package/lib/commonjs/tabs/Tabs.js +263 -63
  19. package/lib/commonjs/tabs/Tabs.js.map +1 -1
  20. package/lib/commonjs/tabs/expo-router/RouterTabs.js +215 -0
  21. package/lib/commonjs/tabs/expo-router/RouterTabs.js.map +1 -0
  22. package/lib/commonjs/tabs/expo-router/index.js +13 -0
  23. package/lib/commonjs/tabs/expo-router/index.js.map +1 -0
  24. package/lib/commonjs/theme/color-policy.js +11 -10
  25. package/lib/commonjs/theme/color-policy.js.map +1 -1
  26. package/lib/module/provider/index.js +10 -6
  27. package/lib/module/provider/index.js.map +1 -1
  28. package/lib/module/scroll/context.js +90 -0
  29. package/lib/module/scroll/context.js.map +1 -0
  30. package/lib/module/scroll/expo-router/index.js +128 -0
  31. package/lib/module/scroll/expo-router/index.js.map +1 -0
  32. package/lib/module/scroll/index.js +80 -21
  33. package/lib/module/scroll/index.js.map +1 -1
  34. package/lib/module/scroll/index.web.js +218 -122
  35. package/lib/module/scroll/index.web.js.map +1 -1
  36. package/lib/module/scroll/scrollable.native.js +54 -0
  37. package/lib/module/scroll/scrollable.native.js.map +1 -0
  38. package/lib/module/scroll/scrollable.web.js +9 -3
  39. package/lib/module/scroll/scrollable.web.js.map +1 -1
  40. package/lib/module/scroll/store.js +47 -25
  41. package/lib/module/scroll/store.js.map +1 -1
  42. package/lib/module/tabs/Tabs.js +271 -65
  43. package/lib/module/tabs/Tabs.js.map +1 -1
  44. package/lib/module/tabs/expo-router/RouterTabs.js +210 -0
  45. package/lib/module/tabs/expo-router/RouterTabs.js.map +1 -0
  46. package/lib/module/tabs/expo-router/index.js +10 -0
  47. package/lib/module/tabs/expo-router/index.js.map +1 -0
  48. package/lib/module/theme/color-policy.js +11 -10
  49. package/lib/module/theme/color-policy.js.map +1 -1
  50. package/lib/typescript/commonjs/provider/index.d.ts +7 -5
  51. package/lib/typescript/commonjs/provider/index.d.ts.map +1 -1
  52. package/lib/typescript/commonjs/scroll/context.d.ts +14 -0
  53. package/lib/typescript/commonjs/scroll/context.d.ts.map +1 -0
  54. package/lib/typescript/commonjs/scroll/expo-router/index.d.ts +7 -0
  55. package/lib/typescript/commonjs/scroll/expo-router/index.d.ts.map +1 -0
  56. package/lib/typescript/commonjs/scroll/index.d.ts +14 -23
  57. package/lib/typescript/commonjs/scroll/index.d.ts.map +1 -1
  58. package/lib/typescript/commonjs/scroll/index.web.d.ts +17 -19
  59. package/lib/typescript/commonjs/scroll/index.web.d.ts.map +1 -1
  60. package/lib/typescript/commonjs/scroll/scrollable.native.d.ts +23 -0
  61. package/lib/typescript/commonjs/scroll/scrollable.native.d.ts.map +1 -0
  62. package/lib/typescript/commonjs/scroll/scrollable.web.d.ts +18 -5
  63. package/lib/typescript/commonjs/scroll/scrollable.web.d.ts.map +1 -1
  64. package/lib/typescript/commonjs/scroll/store.d.ts +41 -22
  65. package/lib/typescript/commonjs/scroll/store.d.ts.map +1 -1
  66. package/lib/typescript/commonjs/scroll/types.d.ts +82 -12
  67. package/lib/typescript/commonjs/scroll/types.d.ts.map +1 -1
  68. package/lib/typescript/commonjs/tabs/Tabs.d.ts +41 -1
  69. package/lib/typescript/commonjs/tabs/Tabs.d.ts.map +1 -1
  70. package/lib/typescript/commonjs/tabs/expo-router/RouterTabs.d.ts +80 -0
  71. package/lib/typescript/commonjs/tabs/expo-router/RouterTabs.d.ts.map +1 -0
  72. package/lib/typescript/commonjs/tabs/expo-router/index.d.ts +9 -0
  73. package/lib/typescript/commonjs/tabs/expo-router/index.d.ts.map +1 -0
  74. package/lib/typescript/commonjs/tabs/types.d.ts +48 -4
  75. package/lib/typescript/commonjs/tabs/types.d.ts.map +1 -1
  76. package/lib/typescript/commonjs/theme/color-policy.d.ts.map +1 -1
  77. package/lib/typescript/module/provider/index.d.ts +7 -5
  78. package/lib/typescript/module/provider/index.d.ts.map +1 -1
  79. package/lib/typescript/module/scroll/context.d.ts +14 -0
  80. package/lib/typescript/module/scroll/context.d.ts.map +1 -0
  81. package/lib/typescript/module/scroll/expo-router/index.d.ts +7 -0
  82. package/lib/typescript/module/scroll/expo-router/index.d.ts.map +1 -0
  83. package/lib/typescript/module/scroll/index.d.ts +14 -23
  84. package/lib/typescript/module/scroll/index.d.ts.map +1 -1
  85. package/lib/typescript/module/scroll/index.web.d.ts +17 -19
  86. package/lib/typescript/module/scroll/index.web.d.ts.map +1 -1
  87. package/lib/typescript/module/scroll/scrollable.native.d.ts +23 -0
  88. package/lib/typescript/module/scroll/scrollable.native.d.ts.map +1 -0
  89. package/lib/typescript/module/scroll/scrollable.web.d.ts +18 -5
  90. package/lib/typescript/module/scroll/scrollable.web.d.ts.map +1 -1
  91. package/lib/typescript/module/scroll/store.d.ts +41 -22
  92. package/lib/typescript/module/scroll/store.d.ts.map +1 -1
  93. package/lib/typescript/module/scroll/types.d.ts +82 -12
  94. package/lib/typescript/module/scroll/types.d.ts.map +1 -1
  95. package/lib/typescript/module/tabs/Tabs.d.ts +41 -1
  96. package/lib/typescript/module/tabs/Tabs.d.ts.map +1 -1
  97. package/lib/typescript/module/tabs/expo-router/RouterTabs.d.ts +80 -0
  98. package/lib/typescript/module/tabs/expo-router/RouterTabs.d.ts.map +1 -0
  99. package/lib/typescript/module/tabs/expo-router/index.d.ts +9 -0
  100. package/lib/typescript/module/tabs/expo-router/index.d.ts.map +1 -0
  101. package/lib/typescript/module/tabs/types.d.ts +48 -4
  102. package/lib/typescript/module/tabs/types.d.ts.map +1 -1
  103. package/lib/typescript/module/theme/color-policy.d.ts.map +1 -1
  104. package/package.json +29 -1
  105. package/src/__tests__/BloomProvider.web.test.tsx +8 -15
  106. package/src/__tests__/Tabs.test.tsx +187 -0
  107. package/src/__tests__/optional-peer-imports.test.ts +7 -2
  108. package/src/__tests__/scroll-expo-router-adapter.test.tsx +164 -0
  109. package/src/__tests__/scroll-native.test.tsx +465 -0
  110. package/src/__tests__/scroll-store.test.ts +41 -17
  111. package/src/__tests__/scroll-web.test.tsx +797 -108
  112. package/src/provider/index.tsx +10 -7
  113. package/src/scroll/context.tsx +107 -0
  114. package/src/scroll/expo-router/index.ts +140 -0
  115. package/src/scroll/index.ts +92 -25
  116. package/src/scroll/index.web.tsx +255 -162
  117. package/src/scroll/scrollable.native.ts +64 -0
  118. package/src/scroll/scrollable.web.ts +30 -8
  119. package/src/scroll/store.ts +47 -25
  120. package/src/scroll/types.ts +82 -12
  121. package/src/tabs/Tabs.tsx +352 -77
  122. package/src/tabs/expo-router/RouterTabs.tsx +268 -0
  123. package/src/tabs/expo-router/index.ts +8 -0
  124. package/src/tabs/types.ts +48 -4
  125. package/src/theme/__tests__/__fixtures__/golden-resolved-tokens.json +5 -5
  126. package/src/theme/__tests__/__snapshots__/visual-gallery.test.tsx.snap +11 -11
  127. package/src/theme/__tests__/policy-legibility.test.ts +10 -7
  128. package/src/theme/color-policy.ts +11 -10
  129. package/lib/commonjs/provider/scroll-provider.js +0 -13
  130. package/lib/commonjs/provider/scroll-provider.js.map +0 -1
  131. package/lib/commonjs/provider/scroll-provider.web.js +0 -13
  132. package/lib/commonjs/provider/scroll-provider.web.js.map +0 -1
  133. package/lib/module/provider/scroll-provider.js +0 -16
  134. package/lib/module/provider/scroll-provider.js.map +0 -1
  135. package/lib/module/provider/scroll-provider.web.js +0 -5
  136. package/lib/module/provider/scroll-provider.web.js.map +0 -1
  137. package/lib/typescript/commonjs/provider/scroll-provider.d.ts +0 -14
  138. package/lib/typescript/commonjs/provider/scroll-provider.d.ts.map +0 -1
  139. package/lib/typescript/commonjs/provider/scroll-provider.web.d.ts +0 -3
  140. package/lib/typescript/commonjs/provider/scroll-provider.web.d.ts.map +0 -1
  141. package/lib/typescript/module/provider/scroll-provider.d.ts +0 -14
  142. package/lib/typescript/module/provider/scroll-provider.d.ts.map +0 -1
  143. package/lib/typescript/module/provider/scroll-provider.web.d.ts +0 -3
  144. package/lib/typescript/module/provider/scroll-provider.web.d.ts.map +0 -1
  145. package/src/__tests__/scroll-native.test.ts +0 -25
  146. package/src/provider/scroll-provider.ts +0 -13
  147. package/src/provider/scroll-provider.web.ts +0 -2
@@ -0,0 +1,210 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * expo-router bindings for the in-screen tab strip.
5
+ *
6
+ * This subpath (`@oxyhq/bloom/tabs/expo-router`) is the ONLY place in the tabs
7
+ * feature allowed to import `expo-router`, which is why it is a separate entry:
8
+ * the core `@oxyhq/bloom/tabs` stays usable in an app with a different router,
9
+ * or none, and the optional peer is never pulled into a bundle that does not
10
+ * ask for it. Same split as `tab-bar` / `tab-bar/expo-router` and
11
+ * `scroll` / `scroll/expo-router`.
12
+ *
13
+ * Everything routing-shaped lives here on purpose: which tab the route means,
14
+ * what a committed swipe navigates to, and which links to warm. The strip
15
+ * itself stays presentational and knows only about measured geometry.
16
+ */
17
+ import { useCallback, useEffect, useMemo, useRef } from 'react';
18
+ import { Gesture, GestureDetector } from 'react-native-gesture-handler';
19
+ import { runOnJS } from 'react-native-reanimated';
20
+ import { router, usePathname } from 'expo-router';
21
+ import { Tabs, TabsTrigger } from "../Tabs.js";
22
+ import { jsx as _jsx } from "react/jsx-runtime";
23
+ /**
24
+ * Resolve which item the current route belongs to.
25
+ *
26
+ * LONGEST matching prefix, on a segment boundary — not an exact match. All
27
+ * three properties matter:
28
+ *
29
+ * - A prefix is needed because a tab may own a subtree (`/feeds/1/topics` and
30
+ * anything under it), and an exact match would drop the underline the moment
31
+ * the user goes one level deeper.
32
+ * - LONGEST is needed because the default tab's href is a prefix of every
33
+ * sibling's (`/@ana` vs `/@ana/replies`), so a first-match rule would light
34
+ * up the default tab on every tab.
35
+ * - The segment boundary is what stops `/feeds/12` from matching `/feeds/1`.
36
+ *
37
+ * Returns `undefined` when nothing matches, which is a real state — a strip
38
+ * rendered by a LAYOUT keeps rendering while a child route outside the tab set
39
+ * is showing — and leaves the underline hidden rather than parked on a lie.
40
+ */
41
+ function matchActiveValue(items, pathname) {
42
+ let best;
43
+ for (const item of items) {
44
+ // `Href` is a string or an object; only a string form can be compared to a
45
+ // pathname, and an object form describes params we cannot resolve here.
46
+ if (typeof item.href !== 'string') continue;
47
+ // Compare paths only: a query string describes what the tab shows, not
48
+ // which tab it is, and a trailing slash is the same route either way.
49
+ const [path = ''] = item.href.split('?');
50
+ const href = path.replace(/\/$/, '');
51
+ const isMatch = pathname === href || pathname.startsWith(`${href}/`);
52
+ if (!isMatch) continue;
53
+ if (!best || href.length > best.length) {
54
+ best = {
55
+ value: item.value,
56
+ length: href.length
57
+ };
58
+ }
59
+ }
60
+ return best?.value;
61
+ }
62
+
63
+ /**
64
+ * A tab strip whose selection IS the route.
65
+ *
66
+ * Render it in the LAYOUT that owns the tabs, above the `<Slot/>` that renders
67
+ * them — not inside the tab screens themselves. That placement is the whole
68
+ * point, and it is load-bearing twice over: a strip inside the screens is
69
+ * unmounted and rebuilt by every navigation, so its underline has nothing to
70
+ * animate from and the chrome blanks while the incoming route's chunk loads;
71
+ * and a GESTURE inside the screens would be destroyed by the very navigation it
72
+ * commits, mid-release.
73
+ *
74
+ * ```tsx
75
+ * // app/(app)/[username]/_layout.tsx
76
+ * <RouterTabs
77
+ * items={[
78
+ * { value: 'posts', label: 'Posts', href: `/${username}` },
79
+ * { value: 'replies', label: 'Replies', href: `/${username}/replies` },
80
+ * ]}
81
+ * />
82
+ * <Slot />
83
+ * ```
84
+ */
85
+ export function RouterTabs({
86
+ items,
87
+ onReselect,
88
+ swipeEnabled = true,
89
+ ...tabsProps
90
+ }) {
91
+ const pathname = usePathname();
92
+ const activeValue = useMemo(() => matchActiveValue(items, pathname), [items, pathname]);
93
+ const dragRef = useRef(null);
94
+ // What releasing right now would commit. A ref rather than state: it is
95
+ // written on every frame of the drag and read once, and re-rendering the
96
+ // strip mid-gesture would fight the animation the gesture is driving.
97
+ const pendingRef = useRef(null);
98
+ const navigateTo = useCallback(value => {
99
+ const target = items.find(item => item.value === value);
100
+ if (!target) return;
101
+ // PUSH, not replace: a history entry per tab is what makes Back return to
102
+ // the tab the reader came from instead of leaving the screen entirely.
103
+ router.push(target.href);
104
+ }, [items]);
105
+ const handlePress = useCallback(item => {
106
+ if (item.value === activeValue) {
107
+ onReselect?.(item.value);
108
+ return;
109
+ }
110
+ navigateTo(item.value);
111
+ }, [activeValue, onReselect, navigateTo]);
112
+ const onDrag = useCallback(translationX => {
113
+ pendingRef.current = dragRef.current?.drag(translationX) ?? null;
114
+ }, []);
115
+
116
+ // `onEnd` does not fire for every terminated gesture, and `onFinalize` fires
117
+ // for all of them — including after `onEnd`. Guarding on the ref being
118
+ // non-null is what makes the second call a no-op instead of a double commit.
119
+ const releasedRef = useRef(true);
120
+ const onRelease = useCallback(() => {
121
+ if (releasedRef.current) return;
122
+ releasedRef.current = true;
123
+ const committed = pendingRef.current;
124
+ pendingRef.current = null;
125
+ // The underline commits first and instantly: it lives in the layout, it
126
+ // survives the swap, and it is the honest signal the gesture was accepted.
127
+ // The content area arrives when its chunk does.
128
+ dragRef.current?.release(committed);
129
+ if (committed !== null) navigateTo(committed);
130
+ }, [navigateTo]);
131
+ const onBegin = useCallback(() => {
132
+ releasedRef.current = false;
133
+ }, []);
134
+ const panGesture = useMemo(() => Gesture.Pan()
135
+ // Horizontal intent only. This is a hint to the gesture system and is
136
+ // NOT what protects vertical scrolling on web — see `touchAction` below.
137
+ .activeOffsetX([-12, 12]).failOffsetY([-12, 12]).onBegin(() => {
138
+ runOnJS(onBegin)();
139
+ }).onUpdate(event => {
140
+ runOnJS(onDrag)(event.translationX);
141
+ }).onFinalize(() => {
142
+ runOnJS(onRelease)();
143
+ }), [onBegin, onDrag, onRelease]);
144
+
145
+ // Warm every OTHER tab's async chunk. That fetch is the ~300ms the content
146
+ // area would otherwise spend empty after a commit, and a swipe offers no
147
+ // hover to warm on, so it is done up front rather than on interaction.
148
+ //
149
+ // `router.prefetch` — the public imperative API (declared in expo-router's
150
+ // `global-state/router.d.ts`) — rather than wrapping each trigger in
151
+ // `<Link prefetch asChild>`. Both reasons are about the WRAPPER, not about
152
+ // prefetching: `asChild` is Radix's `Slot`, which COMPOSES event handlers, so
153
+ // the trigger's own `onPress` and the link's navigation would both run — and
154
+ // the link's push knows nothing about `onReselect`, so re-tapping the active
155
+ // tab would push a duplicate entry and make Back appear to do nothing. It
156
+ // also injects an `href` a `Pressable` ignores. The prefetching itself is
157
+ // identical: `<Link prefetch>` renders `<Prefetch href/>` beside its element
158
+ // and does nothing else.
159
+ //
160
+ // Known trade: a real `<Link>` would render a web anchor, which is what gives
161
+ // middle-click and open-in-new-tab. A tab strip arguably wants that; getting
162
+ // both needs the trigger to render an anchor itself, which is a change to the
163
+ // core rather than to this file.
164
+ useEffect(() => {
165
+ for (const item of items) {
166
+ if (item.value === activeValue || item.disabled) continue;
167
+ router.prefetch(item.href);
168
+ }
169
+ }, [items, activeValue]);
170
+ const strip =
171
+ /*#__PURE__*/
172
+ // `hasSelection` is what stops the underline asserting a tab while a
173
+ // NON-TAB sibling route is showing — the layout that renders this strip
174
+ // renders those too (a profile's `/followers` beside its tab routes).
175
+ _jsx(Tabs, {
176
+ ...tabsProps,
177
+ ref: dragRef,
178
+ hasSelection: activeValue !== undefined,
179
+ children: items.map(item => /*#__PURE__*/_jsx(TabsTrigger, {
180
+ value: item.value,
181
+ label: item.label,
182
+ icon: item.icon,
183
+ count: item.count,
184
+ disabled: item.disabled
185
+ // Focus, never a press, is what drives the underline — so a deep
186
+ // link, a browser Back and a back gesture animate exactly like a tap.
187
+ ,
188
+ isFocused: item.value === activeValue,
189
+ onPress: () => handlePress(item)
190
+ }, item.value))
191
+ });
192
+ if (!swipeEnabled) return strip;
193
+ return (
194
+ /*#__PURE__*/
195
+ // `touchAction="pan-y"` is MANDATORY and is the landmine of this file.
196
+ // RNGH sets the detector's view to `touch-action: none` on web
197
+ // (`GestureHandlerWebDelegate.js`), which disables browser-native VERTICAL
198
+ // scrolling on that element. `failOffsetY` above does not protect against
199
+ // it: that is a JS decision taken after `touch-action` has already told the
200
+ // browser not to scroll. Removing this prop is silent on native and breaks
201
+ // scrolling on mobile web.
202
+ _jsx(GestureDetector, {
203
+ gesture: panGesture,
204
+ touchAction: "pan-y",
205
+ children: strip
206
+ })
207
+ );
208
+ }
209
+ RouterTabs.displayName = 'RouterTabs';
210
+ //# sourceMappingURL=RouterTabs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useCallback","useEffect","useMemo","useRef","Gesture","GestureDetector","runOnJS","router","usePathname","Tabs","TabsTrigger","jsx","_jsx","matchActiveValue","items","pathname","best","item","href","path","split","replace","isMatch","startsWith","length","value","RouterTabs","onReselect","swipeEnabled","tabsProps","activeValue","dragRef","pendingRef","navigateTo","target","find","push","handlePress","onDrag","translationX","current","drag","releasedRef","onRelease","committed","release","onBegin","panGesture","Pan","activeOffsetX","failOffsetY","onUpdate","event","onFinalize","disabled","prefetch","strip","ref","hasSelection","undefined","children","map","label","icon","count","isFocused","onPress","gesture","touchAction","displayName"],"sourceRoot":"../../../../src","sources":["tabs/exp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tabs/expo-router`. The component lives in a sibling
5
+ * module because this file is the published entry path and must stay stable;
6
+ * the split also keeps the router binding in one place, which is what the
7
+ * optional-peer allowlist asserts about.
8
+ */
9
+ export { RouterTabs } from "./RouterTabs.js";
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["RouterTabs"],"sourceRoot":"../../../../src","sources":["tabs/expo-router/index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,UAAU,QAAQ,iBAAc","ignoreList":[]}
@@ -207,16 +207,17 @@ function vividHueNear(hue) {
207
207
  * why 11 of the 13 presets carry white and exactly the two light ones do not.
208
208
  */
209
209
  function whiteLabelTone(palette, seedTone, isDark) {
210
- // ONE rule, both modes. The fill comes down to the tone a white label needs,
211
- // unless the descent costs more than the budget and destroys the colour then
212
- // it keeps its own tone and takes a black label. Exempting dark, so the fill
213
- // could stay on the brand hex, is what left every Follow button, avatar and
214
- // chat bubble with a black label there while light had eleven white ones: an
215
- // asymmetry nobody chose, visible in every component at once because they all
216
- // read the same token.
217
- const target = isDark ? DARK_FILL_TONE : LIGHT_FILL_TONE;
218
- const candidate = Math.max(target, seedTone - TONE_BUDGET);
219
- return contrastOf(palette.tone(candidate), true) >= AA ? candidate : Math.max(seedTone, isDark ? DARK_SEED_FLOOR : 0);
210
+ // LIGHT: every fill comes down, no exemption. On a near-white page a bright
211
+ // colour has nothing to read against a lime at its own tone 90 is a pale
212
+ // smear there, indistinguishable from the same colour in dark, which is not a
213
+ // theme at all. Coming down is what makes faircoin a deep green in light and a
214
+ // bright lime in dark.
215
+ if (!isDark) return LIGHT_FILL_TONE;
216
+ // DARK: the budget applies. Most brands come down to where white fits, but a
217
+ // seed that is already light cannot without ceasing to be itself, so it keeps
218
+ // its own tone and takes a black label. That is the eleven-and-two pattern.
219
+ const candidate = Math.max(DARK_FILL_TONE, seedTone - TONE_BUDGET);
220
+ return contrastOf(palette.tone(candidate), true) >= AA ? candidate : Math.max(seedTone, DARK_SEED_FLOOR);
220
221
  }
221
222
 
222
223
  /**
@@ -1 +1 @@
1
- {"version":3,"names":["argbFromHex","Hct","TonalPalette","blueFromArgb","greenFromArgb","redFromArgb","STATUS_SEEDS","success","error","warning","info","AA","rgb","argb","rgba","alpha","contrastOf","onWhite","channel","v","c","Math","pow","luminance","foregroundFor","noLegibleForeground","LIGHT_FILL_TONE","DARK_FILL_TONE","TONE_BUDGET","DARK_SEED_FLOOR","DARK_ACCENT_FLOOR","ACCENT_CHROMA","TEXT_TONE","light","dark","TEXT_CHROMA","SUBTLE_SOURCE_TONE","SUBTLE_ALPHA","SPLIT_ROTATIONS","VIVID_SNAP_WINDOW","VIVID_SNAP_MIN_GAIN","MIN_ACCENT_SEPARATION","DESTRUCTIVE_PROXIMITY","hueDistance","a","b","d","abs","min","peakTone","hue","palette","fromHueAndChroma","bestTone","bestChroma","tone","chroma","fromInt","peakChroma","vividHueNear","baseChroma","bestHue","delta","candidate","whiteLabelTone","seedTone","isDark","target","max","accentTone","peak","fillPair","startTone","fill","foreground","accentHues","seedHue","firstRotation","secondRotation","geometricA","geometricB","geometricStandout","quiet","snapped","standout","errorHue","secondary","tertiary","buildPolicyTokens","seedHex","roles","pinned","seed","brandPalette","primary","tokens","surfaceContainer","surfaceContainerLowest","surfaceContainerHigh","onSurfaceVariant","hues","role","pin","undefined","fillPalette","textPalette","vividPalette","pair","i","hex","Object","entries","status"],"sourceRoot":"../../../src","sources":["theme/color-policy.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,WAAW,QAAyB,yBAAgB;AAC7D,SAASC,GAAG,QAAQ,uBAAoB;AACxC,SAASC,YAAY,QAAQ,iCAA8B;AAC3D,SAASC,YAAY,EAAEC,aAAa,EAAEC,WAAW,QAAQ,+BAA4B;;AAErF;AACA,OAAO,MAAMC,YAA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AAM,CAAC,KAAKM,IAAI,EAAE,CAAC,GAAGM,IAAI,CAAClC,IAAI;IAC/BsB,MAAM,CAAC,KAAKM,IAAI,aAAa,CAAC,GAAGM,IAAI,CAACjC,UAAU;IAChDqB,MAAM,CAAC,KAAKM,IAAI,OAAO,CAAC,GAAGzF,GAAG,CAC5BV,YAAY,CAACkD,gBAAgB,CAAC4D,MAAM,CAAC9D,GAAG,EAAEf,WAAW,CAAC,CAACoB,IAAI,CACzDW,MAAM,GAAGlC,SAAS,CAACE,IAAI,GAAGF,SAAS,CAACC,KACtC,CACF,CAAC;IACD;IACA;IACA;IACA;IACA8D,MAAM,CAAC,KAAKM,IAAI,SAAS,CAAC,GAAGvF,IAAI,CAC/BqC,OAAO,CAACI,IAAI,CAACyD,MAAM,CAACzD,IAAI,CAAC,EACzBW,MAAM,GAAG7B,YAAY,CAACH,IAAI,GAAGG,YAAY,CAACJ,KAC5C,CAAC;EACH;EAEA,OAAO8D,MAAM;AACf","ignoreList":[]}
1
+ {"version":3,"names":["argbFromHex","Hct","TonalPalette","blueFromArgb","greenFromArgb","redFromArgb","STATUS_SEEDS","success","error","warning","info","AA","rgb","argb","rgba","alpha","contrastOf","onWhite","channel","v","c","Math","pow","luminance","foregroundFor","noLegibleForeground","LIGHT_FILL_TONE","DARK_FILL_TONE","TONE_BUDGET","DARK_SEED_FLOOR","DARK_ACCENT_FLOOR","ACCENT_CHROMA","TEXT_TONE","light","dark","TEXT_CHROMA","SUBTLE_SOURCE_TONE","SUBTLE_ALPHA","SPLIT_ROTATIONS","VIVID_SNAP_WINDOW","VIVID_SNAP_MIN_GAIN","MIN_ACCENT_SEPARATION","DESTRUCTIVE_PROXIMITY","hueDistance","a","b","d","abs","min","peakTone","hue","palette","fromHueAndChroma","bestTone","bestChroma","tone","chroma","fromInt","peakChroma","vividHueNear","baseChroma","bestHue","delta","candidate","whiteLabelTone","seedTone","isDark","max","accentTone","peak","fillPair","startTone","fill","foreground","accentHues","seedHue","firstRotation","secondRotation","geometricA","geometricB","geometricStandout","quiet","snapped","standout","errorHue","secondary","tertiary","buildPolicyTokens","seedHex","roles","pinned","seed","brandPalette","primary","tokens","surfaceContainer","surfaceContainerLowest","surfaceContainerHigh","onSurfaceVariant","hues","role","pin","undefined","fillPalette","textPalette","vividPalette","pair","i","hex","Object","entries","status"],"sourceRoot":"../../../src","sources":["theme/color-policy.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,WAAW,QAAyB,yBAAgB;AAC7D,SAASC,GAAG,QAAQ,uBAAoB;AACxC,SAASC,YAAY,QAAQ,iCAA8B;AAC3D,SAASC,YAAY,EAAEC,aAAa,EAAEC,WAAW,QAAQ,+BAA4B;;AAErF;AACA,OAAO,MAAMC,YAAY,GAAG;EAC1BC,OAAO,EAAE,SAAS;EAClBC,KAAK,EAAE,SAAS;EAChBC,OAAO,EAAE,SAAS;EAClBC,IAAI,EAAE;AACR,CAAU;;AAEV;;AAMA;;AAGA,MAAMC,EAAE,GAAG,GAAG;AAEd,MAAMC,GAAG,GAAIC,IAAY,IACvB,OAAOR,WAAW,CAACQ,IAAI,CAAC,IAAIT,aAAa,CAACS,IAAI,CAAC,IAAIV,YAAY,CAACU,IAAI,CAAC,GAAG;;AAE1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,IAAI,GAAGA,CAACD,IAAY,EAAEE,KAAa,KACvC,QAAQV,WAAW,CAACQ,IAAI,CAAC,KAAKT,aAAa,CAACS,IAAI,CAAC,KAAKV,YAAY,CAACU,IAAI,CAAC,KAAKE,KAAK,GAAG;;AAEvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,UAAUA,CAACH,IAAY,EAAEI,OAAgB,EAAU;EAC1D,MAAMC,OAAO,GAAIC,CAAS,IAAa;IACrC,MAAMC,CAAC,GAAGD,CAAC,GAAG,G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EAAE,EAAE,CAAC,CAACpD,IAAI,CAACW,MAAM,GAAG,EAAE,GAAG,EAAE,CACpF,CAAC;EACH;;EAEA;EACA;EACA;EACA;EACA,KAAK,MAAM,CAACkC,IAAI,EAAEQ,GAAG,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACxG,YAAY,CAAC,EAAE;IACtD,MAAMyG,MAAM,GAAG9G,GAAG,CAACwD,OAAO,CAACzD,WAAW,CAAC4G,GAAG,CAAC,CAAC;IAC5C,MAAMzD,OAAO,GAAGjD,YAAY,CAACkD,gBAAgB,CAAC2D,MAAM,CAAC7D,GAAG,EAAE6D,MAAM,CAACvD,MAAM,CAAC;IACxE,MAAMkD,IAAI,GAAGpC,QAAQ,CAACnB,OAAO,EAAEe,MAAM,GAAGvC,cAAc,GAAGD,eAAe,CAAC;IACzEoE,MAAM,CAAC,KAAKM,IAAI,EAAE,CAAC,GAAGM,IAAI,CAAClC,IAAI;IAC/BsB,MAAM,CAAC,KAAKM,IAAI,aAAa,CAAC,GAAGM,IAAI,CAACjC,UAAU;IAChDqB,MAAM,CAAC,KAAKM,IAAI,OAAO,CAAC,GAAGxF,GAAG,CAC5BV,YAAY,CAACkD,gBAAgB,CAAC2D,MAAM,CAAC7D,GAAG,EAAEf,WAAW,CAAC,CAACoB,IAAI,CACzDW,MAAM,GAAGlC,SAAS,CAACE,IAAI,GAAGF,SAAS,CAACC,KACtC,CACF,CAAC;IACD;IACA;IACA;IACA;IACA6D,MAAM,CAAC,KAAKM,IAAI,SAAS,CAAC,GAAGtF,IAAI,CAC/BqC,OAAO,CAACI,IAAI,CAACwD,MAAM,CAACxD,IAAI,CAAC,EACzBW,MAAM,GAAG7B,YAAY,CAACH,IAAI,GAAGG,YAAY,CAACJ,KAC5C,CAAC;EACH;EAEA,OAAO6D,MAAM;AACf","ignoreList":[]}
@@ -18,11 +18,13 @@
18
18
  * Nesting extra contexts costs nothing at runtime — the win is that scope is no
19
19
  * longer a per-app decision.
20
20
  *
21
- * EXPO/EXPO-ROUTER APPS ONLY. The scroll-restoration provider it mounts imports
22
- * `expo-router` (its web implementation keys offsets on the focused route), so
23
- * a Vite/SPA consumer that has no expo-router cannot resolve this module. Those
24
- * apps keep mounting `BloomThemeProvider` (and any other piece they need)
25
- * directly that is not a lesser path, just the one without a router.
21
+ * EXPO/EXPO-ROUTER APPS ONLY, and now for one narrow reason: it binds the
22
+ * scroll store to the expo-router ADAPTER, which is the only module in the
23
+ * scroll primitive that imports `expo-router`. The scroll core itself is
24
+ * router-agnostic, so a Vite/SPA consumer can mount
25
+ * `<ScrollRestorationProvider adapter={...}>` from `@oxyhq/bloom/scroll` with
26
+ * an adapter for its own router — alongside `BloomThemeProvider` and whatever
27
+ * else it needs — rather than going without.
26
28
  *
27
29
  * NOT included, on purpose — these are OUTLETS, not state, and their placement
28
30
  * in the tree is a real app decision (z-order, safe areas, and mounting a
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/provider/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAyB,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAG9E,OAAO,EAAsB,KAAK,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAG5E,MAAM,WAAW,kBAAmB,SAAQ,IAAI,CAAC,uBAAuB,EAAE,UAAU,CAAC;IACnF,QAAQ,EAAE,SAAS,CAAC;IACpB;;;;OAIG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,wFAAwF;IACxF,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,aAAa,EACb,OAAc,EACd,GAAG,UAAU,EACd,EAAE,kBAAkB,2CAcpB;yBAnBe,aAAa"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/provider/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAyB,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAG9E,OAAO,EAAsB,KAAK,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAI5E,MAAM,WAAW,kBAAmB,SAAQ,IAAI,CAAC,uBAAuB,EAAE,UAAU,CAAC;IACnF,QAAQ,EAAE,SAAS,CAAC;IACpB;;;;OAIG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,wFAAwF;IACxF,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,aAAa,EACb,OAAc,EACd,GAAG,UAAU,EACd,EAAE,kBAAkB,2CAcpB;yBAnBe,aAAa"}
@@ -0,0 +1,14 @@
1
+ import { ScrollOffsetStore } from './store';
2
+ import type { ScrollRestorationProviderProps, ScrollRouterAdapter } from './types';
3
+ export interface ScrollRestorationContextValue {
4
+ store: ScrollOffsetStore;
5
+ adapter: ScrollRouterAdapter;
6
+ }
7
+ /**
8
+ * Holds the offset map and the router binding for the subtree. One provider
9
+ * near the app root is enough; the store lives as long as the provider, so
10
+ * offsets survive navigating away and back (including browser Back/Forward).
11
+ */
12
+ export declare function ScrollRestorationProvider({ children, adapter, }: ScrollRestorationProviderProps): import("react/jsx-runtime").JSX.Element;
13
+ export declare function useScrollRestorationContext(): ScrollRestorationContextValue;
14
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../src/scroll/context.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,KAAK,EACV,8BAA8B,EAC9B,mBAAmB,EACpB,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,6BAA6B;IAC5C,KAAK,EAAE,iBAAiB,CAAC;IACzB,OAAO,EAAE,mBAAmB,CAAC;CAC9B;AAMD;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,EACxC,QAAQ,EACR,OAAO,GACR,EAAE,8BAA8B,2CAWhC;AAED,wBAAgB,2BAA2B,IAAI,6BAA6B,CAQ3E"}
@@ -0,0 +1,7 @@
1
+ import type { ScrollRouterAdapter } from '../types';
2
+ /**
3
+ * The adapter to hand `<ScrollRestorationProvider adapter={...}>` in an
4
+ * expo-router app. A module-level constant, as the adapter contract requires.
5
+ */
6
+ export declare const expoRouterScrollAdapter: ScrollRouterAdapter;
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/scroll/expo-router/index.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAqB,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAkHvE;;;GAGG;AACH,eAAO,MAAM,uBAAuB,EAAE,mBAGrC,CAAC"}
@@ -1,27 +1,18 @@
1
+ import type { ScrollRestorationBinding, ScrollRestorationTarget, UseScrollRestorationOptions } from './types';
2
+ export { ScrollRestorationProvider } from './context';
3
+ export type { ScreenFocusEffect, ScrollableHandle, ScrollRestorationBinding, ScrollRestorationProviderProps, ScrollRestorationTarget, ScrollRouterAdapter, UseScrollRestorationOptions, } from './types';
1
4
  /**
2
- * Native variant of the scroll-restoration primitive a deliberate no-op.
5
+ * Preserve and restore the scroll offset of `target` across content changes,
6
+ * keyed by the content its screen is showing plus an optional `options.key`.
3
7
  *
4
- * React Navigation's native-stack keeps every screen mounted while it is in the
5
- * stack, so a list's scroll position survives a push/pop for free. There is
6
- * nothing to save or restore. We still ship the full API surface (provider +
7
- * hook) so consumers write one set of call sites that compile and run on every
8
- * platform; on native the provider just renders its children and the hook does
9
- * nothing.
10
- *
11
- * Web bundlers select `./index.web` via the `"browser"` export condition in
12
- * `package.json`; native bundlers fall through to this file.
13
- */
14
- import type { ReactElement } from 'react';
15
- import type { ScrollRestorationProviderProps, ScrollRestorationTarget, UseScrollRestorationOptions } from './types';
16
- export type { ScrollableHandle, ScrollRestorationProviderProps, ScrollRestorationTarget, UseScrollRestorationOptions, } from './types';
17
- /**
18
- * No-op provider. Renders children unchanged — native scroll persistence is
19
- * handled by the navigator, so no per-route state is kept.
20
- */
21
- export declare function ScrollRestorationProvider({ children, }: ScrollRestorationProviderProps): ReactElement;
22
- /**
23
- * No-op hook. Accepts the same arguments as the web implementation so call
24
- * sites are identical across platforms.
8
+ * Behaviour (native):
9
+ * - Offsets are recorded from the returned `onScroll` binding, which the caller
10
+ * wires onto the list. There is no other way to observe a list's offset.
11
+ * - When the storage key changes a re-keyed list, a remount, or `enabled`
12
+ * turning on the saved offset is applied, or 0 when the key was never seen.
13
+ * - A push/pop that re-focuses the same screen scrolls nothing. The navigator
14
+ * already preserved the position, and re-applying it would at best be a
15
+ * no-op and at worst fight a list that has legitimately moved on.
25
16
  */
26
- export declare function useScrollRestoration(_target: ScrollRestorationTarget, _options?: UseScrollRestorationOptions): void;
17
+ export declare function useScrollRestoration(target: ScrollRestorationTarget, options?: UseScrollRestorationOptions): ScrollRestorationBinding;
27
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/scroll/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,KAAK,EACV,8BAA8B,EAC9B,uBAAuB,EACvB,2BAA2B,EAC5B,MAAM,SAAS,CAAC;AAEjB,YAAY,EACV,gBAAgB,EAChB,8BAA8B,EAC9B,uBAAuB,EACvB,2BAA2B,GAC5B,MAAM,SAAS,CAAC;AAEjB;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,EACxC,QAAQ,GACT,EAAE,8BAA8B,GAAG,YAAY,CAE/C;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,uBAAuB,EAChC,QAAQ,CAAC,EAAE,2BAA2B,GACrC,IAAI,CAEN"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/scroll/index.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EACV,wBAAwB,EACxB,uBAAuB,EACvB,2BAA2B,EAC5B,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AAEtD,YAAY,EACV,iBAAiB,EACjB,gBAAgB,EAChB,wBAAwB,EACxB,8BAA8B,EAC9B,uBAAuB,EACvB,mBAAmB,EACnB,2BAA2B,GAC5B,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,uBAAuB,EAC/B,OAAO,CAAC,EAAE,2BAA2B,GACpC,wBAAwB,CAyD1B"}
@@ -1,26 +1,24 @@
1
- import type { ScrollRestorationProviderProps, ScrollRestorationTarget, UseScrollRestorationOptions } from './types';
2
- export type { ScrollableHandle, ScrollRestorationProviderProps, ScrollRestorationTarget, UseScrollRestorationOptions, } from './types';
3
- /**
4
- * Holds the per-route offset map for the subtree. One provider near the app
5
- * root is enough; the store lives for the document's lifetime so offsets
6
- * survive navigating away and back (including browser Back/Forward).
7
- */
8
- export declare function ScrollRestorationProvider({ children, }: ScrollRestorationProviderProps): import("react/jsx-runtime").JSX.Element;
1
+ import type { ScrollRestorationBinding, ScrollRestorationTarget, UseScrollRestorationOptions } from './types';
2
+ export { ScrollRestorationProvider } from './context';
3
+ export type { ScreenFocusEffect, ScrollableHandle, ScrollRestorationBinding, ScrollRestorationProviderProps, ScrollRestorationTarget, ScrollRouterAdapter, UseScrollRestorationOptions, } from './types';
9
4
  /**
10
5
  * Preserve and restore the scroll offset of `target` across navigation, keyed
11
- * by the active route (plus an optional `options.key` for routes that host
12
- * multiple scrollables).
6
+ * by the content its screen is showing plus an optional `options.key`.
13
7
  *
14
8
  * Behaviour (web):
15
9
  * - On every scroll while the screen is focused, the current offset is recorded
16
- * in memory and persisted. This live stream of saves is the source of truth.
17
- * - On focus, the saved offset is re-applied across a bounded run of animation
18
- * frames, stopping as soon as the write sticks (the list has re-rendered its
19
- * rows and grown tall enough) or {@link RESTORE_FRAME_CAP} is reached. A
20
- * saved offset of 0 is a no-op (nothing to restore).
21
- * - On blur, the LAST OBSERVED offset is persisted as a final safety net — not
22
- * a fresh `scrollTop` read, which the navigator may already have forced to 0
23
- * while collapsing the hidden screen.
10
+ * under the key that was live when the listener was attached. This stream of
11
+ * saves is the source of truth.
12
+ * - On focus and again whenever the key changes while the screen STAYS
13
+ * focused, which is how an in-screen tab or folder swap is seen at all — the
14
+ * offset saved for the new key is re-applied across a bounded run of
15
+ * animation frames, stopping as soon as the write sticks or
16
+ * {@link RESTORE_FRAME_CAP} is reached. Content never seen this session is
17
+ * written to 0 once instead; a write to 0 always sticks, so it needs no loop.
18
+ * - On blur (and on a key change), the LAST OBSERVED offset is persisted under
19
+ * the OUTGOING key as a final safety net — not a fresh `scrollTop` read,
20
+ * which the navigator may already have forced to 0 while collapsing the
21
+ * hidden screen.
24
22
  */
25
- export declare function useScrollRestoration(target: ScrollRestorationTarget, options?: UseScrollRestorationOptions): void;
23
+ export declare function useScrollRestoration(target: ScrollRestorationTarget, options?: UseScrollRestorationOptions): ScrollRestorationBinding;
26
24
  //# sourceMappingURL=index.web.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../../src/scroll/index.web.tsx"],"names":[],"mappings":"AAgDA,OAAO,KAAK,EACV,8BAA8B,EAC9B,uBAAuB,EACvB,2BAA2B,EAC5B,MAAM,SAAS,CAAC;AAEjB,YAAY,EACV,gBAAgB,EAChB,8BAA8B,EAC9B,uBAAuB,EACvB,2BAA2B,GAC5B,MAAM,SAAS,CAAC;AAmCjB;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,EACxC,QAAQ,GACT,EAAE,8BAA8B,2CAOhC;AAYD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,uBAAuB,EAC/B,OAAO,CAAC,EAAE,2BAA2B,GACpC,IAAI,CAqGN"}
1
+ {"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../../src/scroll/index.web.tsx"],"names":[],"mappings":"AA6CA,OAAO,KAAK,EACV,wBAAwB,EACxB,uBAAuB,EACvB,2BAA2B,EAC5B,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AAEtD,YAAY,EACV,iBAAiB,EACjB,gBAAgB,EAChB,wBAAwB,EACxB,8BAA8B,EAC9B,uBAAuB,EACvB,mBAAmB,EACnB,2BAA2B,GAC5B,MAAM,SAAS,CAAC;AA0DjB;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,uBAAuB,EAC/B,OAAO,CAAC,EAAE,2BAA2B,GACpC,wBAAwB,CAgM1B"}
@@ -0,0 +1,23 @@
1
+ import type { ScrollRestorationTarget } from './types';
2
+ /**
3
+ * The write half of a scrollable, on native. There is no read half: native
4
+ * offers no way to sample a list's offset from outside it, so offsets arrive
5
+ * through the `onScroll` binding the hook returns instead.
6
+ */
7
+ export interface NativeScroller {
8
+ setOffset: (offset: number) => void;
9
+ }
10
+ /**
11
+ * Build a {@link NativeScroller} for a target.
12
+ *
13
+ * `scrollToOffset` (`FlatList`, `FlashList`) is preferred over `scrollTo`
14
+ * (`ScrollView`) because a list exposes both shapes on some versions and only
15
+ * the former accounts for the list's own header. The `'window'` sentinel has no
16
+ * native meaning — there is no document scroller — so it resolves to a no-op
17
+ * rather than an error: a call site shared with web legitimately passes it.
18
+ *
19
+ * The handle is re-resolved on every write; it is never cached, because a ref
20
+ * can be swapped or detached between the schedule and the write.
21
+ */
22
+ export declare function createScroller(target: ScrollRestorationTarget): NativeScroller;
23
+ //# sourceMappingURL=scrollable.native.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scrollable.native.d.ts","sourceRoot":"","sources":["../../../../src/scroll/scrollable.native.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAoB,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAEzE;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACrC;AAsBD;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,uBAAuB,GAC9B,cAAc,CAkBhB"}
@@ -8,17 +8,30 @@ export interface ResolvedScroller {
8
8
  getOffset: () => number;
9
9
  setOffset: (offset: number) => void;
10
10
  /**
11
- * Whether the scroll container can currently hold a non-zero offset, i.e.
12
- * its content is taller than its viewport (`scrollHeight > clientHeight`).
11
+ * The largest offset the container can currently hold `scrollHeight -
12
+ * clientHeight`, clamped at 0. Answers two questions the save path needs:
13
+ * whether a 0 read is real (`maxOffset > 0`) and whether an offset is sitting
14
+ * exactly at the bottom, which is the signature of a browser clamp.
13
15
  *
14
16
  * React Navigation's web stack collapses a hidden background screen so its
15
17
  * content height drops to the viewport height; while collapsed the container
16
18
  * cannot be scrolled and its `scrollTop` is forced to 0. The hook uses this
17
19
  * to ignore a spurious 0 read coming from a collapsed container rather than
18
- * persisting it over a previously-saved good offset. The `'window'` scroller
19
- * is never collapsed by the navigator, so it always reports `true`.
20
+ * persisting it over a previously-saved good offset.
21
+ *
22
+ * The DOCUMENT collapses the same way, so the `'window'` sentinel answers the
23
+ * same question honestly rather than hardcoding `true`. It used to, on the
24
+ * premise that the navigator never collapses the document — false under a
25
+ * tabbed navigator, where every tab stays MOUNTED and non-focused ones are
26
+ * `display: none` (expo-router's `ui/TabSlot`, and react-native-screens' web
27
+ * `Screen` at `activityState === 0`). Measured in Chrome 150: switching from
28
+ * a tall tab to a short one drops `documentElement.scrollHeight` from 8040 to
29
+ * the 800px viewport, forces `scrollY` to 0 and dispatches two `scroll`
30
+ * events — which the outgoing tab's still-attached listener would otherwise
31
+ * persist as 0 over its real offset, because blur is emitted from an effect
32
+ * that has not run yet.
20
33
  */
21
- canScroll: () => boolean;
34
+ getMaxOffset: () => number;
22
35
  }
23
36
  /**
24
37
  * Build a {@link ResolvedScroller} for a target. The window sentinel reads and
@@ -1 +1 @@
1
- {"version":3,"file":"scrollable.web.d.ts","sourceRoot":"","sources":["../../../../src/scroll/scrollable.web.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAoB,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAEzE;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,MAAM,CAAC;IACxB,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC;;;;;;;;;;OAUG;IACH,SAAS,EAAE,MAAM,OAAO,CAAC;CAC1B;AAuCD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,uBAAuB,GAAG,gBAAgB,CAyBhF"}
1
+ {"version":3,"file":"scrollable.web.d.ts","sourceRoot":"","sources":["../../../../src/scroll/scrollable.web.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAoB,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAEzE;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,MAAM,CAAC;IACxB,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,YAAY,EAAE,MAAM,MAAM,CAAC;CAC5B;AAuCD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,uBAAuB,GAAG,gBAAgB,CAkChF"}