react-native-terra-ui 0.7.2 → 0.8.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 (252) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +1 -1
  3. package/lib/module/components/avatar/Avatar.js +20 -20
  4. package/lib/module/components/avatar/Avatar.js.map +1 -1
  5. package/lib/module/components/button/Button.js +11 -11
  6. package/lib/module/components/button/Button.js.map +1 -1
  7. package/lib/module/components/chip/Chip.js +32 -32
  8. package/lib/module/components/chip/Chip.js.map +1 -1
  9. package/lib/module/components/empty-state/EmptyState.js +3 -3
  10. package/lib/module/components/empty-state/EmptyState.js.map +1 -1
  11. package/lib/module/components/header/variants/LargeTitleHeader/index.js +30 -32
  12. package/lib/module/components/header/variants/LargeTitleHeader/index.js.map +1 -1
  13. package/lib/module/components/header/variants/TitleHeader/index.js +26 -18
  14. package/lib/module/components/header/variants/TitleHeader/index.js.map +1 -1
  15. package/lib/module/components/icon/Icon.js +3 -3
  16. package/lib/module/components/page-indicator/hooks/use-page-indicator-colors.js +2 -2
  17. package/lib/module/components/screen/Screen.js +63 -34
  18. package/lib/module/components/screen/Screen.js.map +1 -1
  19. package/lib/module/components/screen/ScreenContext.js +28 -9
  20. package/lib/module/components/screen/ScreenContext.js.map +1 -1
  21. package/lib/module/components/screen/ScreenFlatList.js +4 -162
  22. package/lib/module/components/screen/ScreenFlatList.js.map +1 -1
  23. package/lib/module/components/screen/ScreenList.js +81 -97
  24. package/lib/module/components/screen/ScreenList.js.map +1 -1
  25. package/lib/module/components/screen/ScreenScrollView.js +64 -115
  26. package/lib/module/components/screen/ScreenScrollView.js.map +1 -1
  27. package/lib/module/components/screen/hooks/use-screen-ref.js +18 -0
  28. package/lib/module/components/screen/hooks/use-screen-ref.js.map +1 -0
  29. package/lib/module/components/screen/hooks/use-screen-scroll-handler.js +19 -0
  30. package/lib/module/components/screen/hooks/use-screen-scroll-handler.js.map +1 -0
  31. package/lib/module/components/screen/index.js.map +1 -1
  32. package/lib/module/components/screen/parts/ScreenFrame.js +47 -0
  33. package/lib/module/components/screen/parts/ScreenFrame.js.map +1 -0
  34. package/lib/module/components/screen/parts/ScreenHeaderAppearance.js +43 -0
  35. package/lib/module/components/screen/parts/ScreenHeaderAppearance.js.map +1 -0
  36. package/lib/module/components/screen/parts/ScreenPlaceholder.js +11 -13
  37. package/lib/module/components/screen/parts/ScreenPlaceholder.js.map +1 -1
  38. package/lib/module/components/screen/parts/ScreenSafeArea.android.js +27 -0
  39. package/lib/module/components/screen/parts/ScreenSafeArea.android.js.map +1 -0
  40. package/lib/module/components/screen/parts/ScreenSafeArea.js +26 -0
  41. package/lib/module/components/screen/parts/ScreenSafeArea.js.map +1 -0
  42. package/lib/module/components/screen/utils.js +18 -9
  43. package/lib/module/components/screen/utils.js.map +1 -1
  44. package/lib/module/components/spinner/Spinner.js +2 -2
  45. package/lib/module/components/text/Text.js +1 -1
  46. package/lib/module/components/toast/Toast.js +13 -13
  47. package/lib/module/components/toast/Toast.js.map +1 -1
  48. package/lib/module/components/toolbar/Toolbar.js +2 -2
  49. package/lib/module/context/ThemeProvider.js +22 -39
  50. package/lib/module/context/ThemeProvider.js.map +1 -1
  51. package/lib/module/context/index.js +1 -1
  52. package/lib/module/context/index.js.map +1 -1
  53. package/lib/module/theme/breakpoints.js +1 -1
  54. package/lib/module/theme/define-config.js +21 -0
  55. package/lib/module/theme/define-config.js.map +1 -0
  56. package/lib/module/theme/diagnostics.js +13 -0
  57. package/lib/module/theme/diagnostics.js.map +1 -0
  58. package/lib/module/theme/errors.js +15 -0
  59. package/lib/module/theme/errors.js.map +1 -0
  60. package/lib/module/theme/index.js +7 -1
  61. package/lib/module/theme/index.js.map +1 -1
  62. package/lib/module/theme/legacy-tokens.js +119 -0
  63. package/lib/module/theme/legacy-tokens.js.map +1 -0
  64. package/lib/module/theme/registry.js +122 -130
  65. package/lib/module/theme/registry.js.map +1 -1
  66. package/lib/module/theme/resolve-config.js +346 -0
  67. package/lib/module/theme/resolve-config.js.map +1 -0
  68. package/lib/module/theme/runtime.js +57 -12
  69. package/lib/module/theme/runtime.js.map +1 -1
  70. package/lib/module/theme/screen-margin.js +6 -14
  71. package/lib/module/theme/screen-margin.js.map +1 -1
  72. package/lib/module/theme/screen-padding.js +17 -0
  73. package/lib/module/theme/screen-padding.js.map +1 -0
  74. package/lib/module/theme/selection-store.js +75 -0
  75. package/lib/module/theme/selection-store.js.map +1 -0
  76. package/lib/module/theme/theme.js +81 -36
  77. package/lib/module/theme/theme.js.map +1 -1
  78. package/lib/module/theme/tokens/canonical-color-keys.js +102 -0
  79. package/lib/module/theme/tokens/canonical-color-keys.js.map +1 -0
  80. package/lib/module/theme/tokens/dark.js +72 -88
  81. package/lib/module/theme/tokens/dark.js.map +1 -1
  82. package/lib/module/theme/tokens/light.js +69 -83
  83. package/lib/module/theme/tokens/light.js.map +1 -1
  84. package/lib/module/theme/tokens/primitives.js +14 -14
  85. package/lib/module/theme/tokens/primitives.js.map +1 -1
  86. package/lib/module/theme/tokens/validate.js +238 -0
  87. package/lib/module/theme/tokens/validate.js.map +1 -0
  88. package/lib/module/theme/unistyles-adapter.js +77 -0
  89. package/lib/module/theme/unistyles-adapter.js.map +1 -0
  90. package/lib/module/utils/accent-generator.js +476 -0
  91. package/lib/module/utils/accent-generator.js.map +1 -0
  92. package/lib/module/utils/accent-utils.js +52 -35
  93. package/lib/module/utils/accent-utils.js.map +1 -1
  94. package/lib/module/utils/color-utils.js +224 -7
  95. package/lib/module/utils/color-utils.js.map +1 -1
  96. package/lib/module/utils/deep-merge.js +1 -1
  97. package/lib/module/utils/deep-merge.js.map +1 -1
  98. package/lib/module/utils/resolve-theme-color.js +2 -2
  99. package/lib/typescript/src/components/chip/types.d.ts +1 -1
  100. package/lib/typescript/src/components/empty-state/EmptyState.d.ts +1 -1
  101. package/lib/typescript/src/components/empty-state/EmptyState.d.ts.map +1 -1
  102. package/lib/typescript/src/components/header/variants/LargeTitleHeader/index.d.ts +6 -5
  103. package/lib/typescript/src/components/header/variants/LargeTitleHeader/index.d.ts.map +1 -1
  104. package/lib/typescript/src/components/header/variants/TitleHeader/index.d.ts +11 -5
  105. package/lib/typescript/src/components/header/variants/TitleHeader/index.d.ts.map +1 -1
  106. package/lib/typescript/src/components/icon/Icon.d.ts +2 -2
  107. package/lib/typescript/src/components/screen/Screen.d.ts +45 -16
  108. package/lib/typescript/src/components/screen/Screen.d.ts.map +1 -1
  109. package/lib/typescript/src/components/screen/ScreenContext.d.ts +42 -26
  110. package/lib/typescript/src/components/screen/ScreenContext.d.ts.map +1 -1
  111. package/lib/typescript/src/components/screen/ScreenFlatList.d.ts +5 -46
  112. package/lib/typescript/src/components/screen/ScreenFlatList.d.ts.map +1 -1
  113. package/lib/typescript/src/components/screen/ScreenList.d.ts +62 -50
  114. package/lib/typescript/src/components/screen/ScreenList.d.ts.map +1 -1
  115. package/lib/typescript/src/components/screen/ScreenScrollView.d.ts +18 -58
  116. package/lib/typescript/src/components/screen/ScreenScrollView.d.ts.map +1 -1
  117. package/lib/typescript/src/components/screen/hooks/use-screen-ref.d.ts +5 -0
  118. package/lib/typescript/src/components/screen/hooks/use-screen-ref.d.ts.map +1 -0
  119. package/lib/typescript/src/components/screen/hooks/use-screen-scroll-handler.d.ts +53 -0
  120. package/lib/typescript/src/components/screen/hooks/use-screen-scroll-handler.d.ts.map +1 -0
  121. package/lib/typescript/src/components/screen/index.d.ts +2 -2
  122. package/lib/typescript/src/components/screen/index.d.ts.map +1 -1
  123. package/lib/typescript/src/components/screen/parts/ScreenFrame.d.ts +6 -0
  124. package/lib/typescript/src/components/screen/parts/ScreenFrame.d.ts.map +1 -0
  125. package/lib/typescript/src/components/screen/parts/ScreenHeaderAppearance.d.ts +21 -0
  126. package/lib/typescript/src/components/screen/parts/ScreenHeaderAppearance.d.ts.map +1 -0
  127. package/lib/typescript/src/components/screen/parts/ScreenPlaceholder.d.ts +6 -8
  128. package/lib/typescript/src/components/screen/parts/ScreenPlaceholder.d.ts.map +1 -1
  129. package/lib/typescript/src/components/screen/parts/ScreenSafeArea.android.d.ts +7 -0
  130. package/lib/typescript/src/components/screen/parts/ScreenSafeArea.android.d.ts.map +1 -0
  131. package/lib/typescript/src/components/screen/parts/ScreenSafeArea.d.ts +6 -0
  132. package/lib/typescript/src/components/screen/parts/ScreenSafeArea.d.ts.map +1 -0
  133. package/lib/typescript/src/components/screen/types.d.ts +27 -32
  134. package/lib/typescript/src/components/screen/types.d.ts.map +1 -1
  135. package/lib/typescript/src/components/screen/utils.d.ts +9 -8
  136. package/lib/typescript/src/components/screen/utils.d.ts.map +1 -1
  137. package/lib/typescript/src/components/text/Text.d.ts +1 -1
  138. package/lib/typescript/src/components/text/Text.d.ts.map +1 -1
  139. package/lib/typescript/src/components/toolbar/Toolbar.d.ts +2 -2
  140. package/lib/typescript/src/context/ThemeProvider.d.ts +29 -12
  141. package/lib/typescript/src/context/ThemeProvider.d.ts.map +1 -1
  142. package/lib/typescript/src/context/index.d.ts +1 -1
  143. package/lib/typescript/src/context/index.d.ts.map +1 -1
  144. package/lib/typescript/src/theme/breakpoints.d.ts +1 -1
  145. package/lib/typescript/src/theme/define-config.d.ts +23 -0
  146. package/lib/typescript/src/theme/define-config.d.ts.map +1 -0
  147. package/lib/typescript/src/theme/diagnostics.d.ts +4 -0
  148. package/lib/typescript/src/theme/diagnostics.d.ts.map +1 -0
  149. package/lib/typescript/src/theme/errors.d.ts +10 -0
  150. package/lib/typescript/src/theme/errors.d.ts.map +1 -0
  151. package/lib/typescript/src/theme/index.d.ts +10 -2
  152. package/lib/typescript/src/theme/index.d.ts.map +1 -1
  153. package/lib/typescript/src/theme/legacy-tokens.d.ts +187 -0
  154. package/lib/typescript/src/theme/legacy-tokens.d.ts.map +1 -0
  155. package/lib/typescript/src/theme/registry.d.ts +12 -17
  156. package/lib/typescript/src/theme/registry.d.ts.map +1 -1
  157. package/lib/typescript/src/theme/resolve-config.d.ts +99 -0
  158. package/lib/typescript/src/theme/resolve-config.d.ts.map +1 -0
  159. package/lib/typescript/src/theme/runtime.d.ts +25 -4
  160. package/lib/typescript/src/theme/runtime.d.ts.map +1 -1
  161. package/lib/typescript/src/theme/screen-margin.d.ts +6 -14
  162. package/lib/typescript/src/theme/screen-margin.d.ts.map +1 -1
  163. package/lib/typescript/src/theme/screen-padding.d.ts +15 -0
  164. package/lib/typescript/src/theme/screen-padding.d.ts.map +1 -0
  165. package/lib/typescript/src/theme/selection-store.d.ts +41 -0
  166. package/lib/typescript/src/theme/selection-store.d.ts.map +1 -0
  167. package/lib/typescript/src/theme/theme.d.ts +54 -1
  168. package/lib/typescript/src/theme/theme.d.ts.map +1 -1
  169. package/lib/typescript/src/theme/tokens/canonical-color-keys.d.ts +95 -0
  170. package/lib/typescript/src/theme/tokens/canonical-color-keys.d.ts.map +1 -0
  171. package/lib/typescript/src/theme/tokens/dark.d.ts +56 -63
  172. package/lib/typescript/src/theme/tokens/dark.d.ts.map +1 -1
  173. package/lib/typescript/src/theme/tokens/light.d.ts +56 -71
  174. package/lib/typescript/src/theme/tokens/light.d.ts.map +1 -1
  175. package/lib/typescript/src/theme/tokens/primitives.d.ts +11 -10
  176. package/lib/typescript/src/theme/tokens/primitives.d.ts.map +1 -1
  177. package/lib/typescript/src/theme/tokens/validate.d.ts +34 -0
  178. package/lib/typescript/src/theme/tokens/validate.d.ts.map +1 -0
  179. package/lib/typescript/src/theme/types.d.ts +166 -86
  180. package/lib/typescript/src/theme/types.d.ts.map +1 -1
  181. package/lib/typescript/src/theme/unistyles-adapter.d.ts +33 -0
  182. package/lib/typescript/src/theme/unistyles-adapter.d.ts.map +1 -0
  183. package/lib/typescript/src/utils/accent-generator.d.ts +103 -0
  184. package/lib/typescript/src/utils/accent-generator.d.ts.map +1 -0
  185. package/lib/typescript/src/utils/accent-utils.d.ts +15 -2
  186. package/lib/typescript/src/utils/accent-utils.d.ts.map +1 -1
  187. package/lib/typescript/src/utils/color-utils.d.ts +59 -2
  188. package/lib/typescript/src/utils/color-utils.d.ts.map +1 -1
  189. package/lib/typescript/src/utils/deep-merge.d.ts +1 -0
  190. package/lib/typescript/src/utils/deep-merge.d.ts.map +1 -1
  191. package/lib/typescript/src/utils/resolve-theme-color.d.ts +2 -2
  192. package/package.json +1 -1
  193. package/src/components/avatar/Avatar.tsx +20 -20
  194. package/src/components/button/Button.tsx +11 -11
  195. package/src/components/chip/Chip.tsx +32 -32
  196. package/src/components/chip/types.ts +1 -1
  197. package/src/components/empty-state/EmptyState.tsx +4 -4
  198. package/src/components/header/variants/LargeTitleHeader/index.tsx +31 -30
  199. package/src/components/header/variants/TitleHeader/index.tsx +33 -22
  200. package/src/components/icon/Icon.tsx +4 -4
  201. package/src/components/page-indicator/hooks/use-page-indicator-colors.ts +2 -2
  202. package/src/components/screen/Screen.tsx +89 -43
  203. package/src/components/screen/ScreenContext.tsx +48 -28
  204. package/src/components/screen/ScreenFlatList.tsx +5 -191
  205. package/src/components/screen/ScreenList.tsx +197 -175
  206. package/src/components/screen/ScreenScrollView.tsx +92 -167
  207. package/src/components/screen/hooks/use-screen-ref.ts +24 -0
  208. package/src/components/screen/hooks/use-screen-scroll-handler.ts +31 -0
  209. package/src/components/screen/index.ts +8 -2
  210. package/src/components/screen/parts/ScreenFrame.tsx +49 -0
  211. package/src/components/screen/parts/ScreenHeaderAppearance.tsx +52 -0
  212. package/src/components/screen/parts/ScreenPlaceholder.tsx +16 -16
  213. package/src/components/screen/parts/ScreenSafeArea.android.tsx +22 -0
  214. package/src/components/screen/parts/ScreenSafeArea.tsx +20 -0
  215. package/src/components/screen/types.ts +29 -32
  216. package/src/components/screen/utils.ts +24 -11
  217. package/src/components/spinner/Spinner.tsx +2 -2
  218. package/src/components/text/Text.tsx +2 -2
  219. package/src/components/toast/Toast.tsx +13 -13
  220. package/src/components/toolbar/Toolbar.tsx +4 -4
  221. package/src/context/ThemeProvider.tsx +47 -51
  222. package/src/context/index.ts +1 -1
  223. package/src/theme/breakpoints.ts +1 -1
  224. package/src/theme/define-config.ts +27 -0
  225. package/src/theme/diagnostics.ts +11 -0
  226. package/src/theme/errors.ts +14 -0
  227. package/src/theme/index.ts +40 -1
  228. package/src/theme/legacy-tokens.ts +227 -0
  229. package/src/theme/registry.ts +119 -137
  230. package/src/theme/resolve-config.ts +406 -0
  231. package/src/theme/runtime.ts +52 -14
  232. package/src/theme/screen-margin.ts +6 -25
  233. package/src/theme/screen-padding.ts +26 -0
  234. package/src/theme/selection-store.ts +76 -0
  235. package/src/theme/theme.ts +104 -39
  236. package/src/theme/tokens/canonical-color-keys.ts +107 -0
  237. package/src/theme/tokens/dark.ts +91 -98
  238. package/src/theme/tokens/light.ts +88 -93
  239. package/src/theme/tokens/primitives.ts +14 -14
  240. package/src/theme/tokens/validate.ts +271 -0
  241. package/src/theme/types.ts +184 -95
  242. package/src/theme/unistyles-adapter.ts +75 -0
  243. package/src/utils/accent-generator.ts +530 -0
  244. package/src/utils/accent-utils.ts +66 -39
  245. package/src/utils/color-utils.ts +225 -8
  246. package/src/utils/deep-merge.ts +1 -1
  247. package/src/utils/resolve-theme-color.ts +2 -2
  248. package/lib/module/components/screen/parts/BottomSafeArea.js +0 -62
  249. package/lib/module/components/screen/parts/BottomSafeArea.js.map +0 -1
  250. package/lib/typescript/src/components/screen/parts/BottomSafeArea.d.ts +0 -30
  251. package/lib/typescript/src/components/screen/parts/BottomSafeArea.d.ts.map +0 -1
  252. package/src/components/screen/parts/BottomSafeArea.tsx +0 -59
@@ -2,19 +2,27 @@
2
2
 
3
3
  import { createContext, useCallback, useContext, useMemo, useState } from "react";
4
4
  import { useAnimatedRef, useAnimatedScrollHandler, useSharedValue } from "react-native-reanimated";
5
+
6
+ /** Internal animated ref shared by the screen's primary scroll container. */
5
7
  import { jsx as _jsx } from "react/jsx-runtime";
6
- /** `PortalHost` name shared by `Screen.ScrollView` / `Screen.FlatList` and header variants that portal content into them. */
8
+ /** Local portal target for scrollable header content. */
7
9
  export const SCREEN_HEADER_PORTAL_HOST = "screen-header";
10
+
11
+ /** Shared configuration and UI-thread scroll values returned by `useScreen`. */
12
+
8
13
  export const ScreenContext = /*#__PURE__*/createContext(null);
14
+
15
+ /** Internal provider inputs resolved by the Screen root. */
16
+
9
17
  /**
10
18
  * Owns the screen's shared scroll ref, offset, snap offsets, and header collapse
11
- * metrics. Header variants call {@link ScreenContextValue.setHeaderCollapseHeight};
12
- * scroll containers bind the ref via {@link useScreen}.
19
+ * metrics. Scroll containers bind the ref via {@link useScreen}.
13
20
  */
14
21
  export function ScreenScrollProvider({
15
22
  background = "transparent",
16
23
  children,
17
- margins = "all",
24
+ contentPadding = "all",
25
+ safeArea = "auto",
18
26
  hasHeader = false
19
27
  }) {
20
28
  const scrollY = useSharedValue(0);
@@ -33,7 +41,9 @@ export function ScreenScrollProvider({
33
41
  });
34
42
  const value = useMemo(() => ({
35
43
  background,
36
- margins,
44
+ contentPadding,
45
+ safeArea,
46
+ margins: contentPadding,
37
47
  hasHeader,
38
48
  scrollY,
39
49
  headerCollapseHeight,
@@ -41,7 +51,7 @@ export function ScreenScrollProvider({
41
51
  setHeaderCollapseHeight,
42
52
  scrollRef,
43
53
  scrollHandler
44
- }), [background, margins, hasHeader, scrollY, headerCollapseHeight, headerSnapOffsets, setHeaderCollapseHeight, scrollRef, scrollHandler]);
54
+ }), [background, contentPadding, safeArea, hasHeader, scrollY, headerCollapseHeight, headerSnapOffsets, setHeaderCollapseHeight, scrollRef, scrollHandler]);
45
55
  return /*#__PURE__*/_jsx(ScreenContext.Provider, {
46
56
  value: value,
47
57
  children: children
@@ -49,14 +59,23 @@ export function ScreenScrollProvider({
49
59
  }
50
60
 
51
61
  /**
52
- * Access the enclosing `Screen`'s shared scroll state, ref, and snap offsets.
62
+ * Reads the nearest `Screen`'s configuration, shared scroll state, and ref.
63
+ * Read `scrollY.value` in Reanimated worklets to animate without React renders.
64
+ * The ref belongs to the primary scroll container, not the screen root.
53
65
  *
54
66
  * @example
55
67
  * ```tsx
56
- * const { scrollY, scrollRef, headerSnapOffsets } = useScreen();
68
+ * function FadingContent() {
69
+ * const { scrollY } = useScreen();
70
+ * const style = useAnimatedStyle(() => ({
71
+ * opacity: interpolate(scrollY.value, [0, 100], [1, 0], "clamp"),
72
+ * }));
73
+ * return <Animated.View style={style}>{content}</Animated.View>;
74
+ * }
57
75
  * ```
58
76
  *
59
- * @throws if called outside a `Screen`.
77
+ * @returns The nearest Screen's configuration and scroll state.
78
+ * @throws Error when called outside a Screen provider.
60
79
  */
61
80
  export function useScreen() {
62
81
  const context = useContext(ScreenContext);
@@ -1 +1 @@
1
- {"version":3,"names":["createContext","useCallback","useContext","useMemo","useState","useAnimatedRef","useAnimatedScrollHandler","useSharedValue","jsx","_jsx","SCREEN_HEADER_PORTAL_HOST","ScreenContext","ScreenScrollProvider","background","children","margins","hasHeader","scrollY","headerCollapseHeight","headerSnapOffsets","setHeaderSnapOffsets","scrollRef","setHeaderCollapseHeight","height","rounded","Math","round","value","undefined","scrollHandler","onScroll","event","contentOffset","y","Provider","useScreen","context","Error"],"sourceRoot":"../../../../src","sources":["components/screen/ScreenContext.tsx"],"mappings":";;AAAA,SAASA,aAAa,EAAkBC,WAAW,EAAEC,UAAU,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAEjG,SAIEC,cAAc,EACdC,wBAAwB,EACxBC,cAAc,QACT,yBAAyB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAMjC;AACA,OAAO,MAAMC,yBAAyB,GAAG,eAAe;AAsCxD,OAAO,MAAMC,aAAa,gBAAGX,aAAa,CAA4B,IAAI,CAAC;AAY3E;AACA;AACA;AACA;AACA;AACA,OAAO,SAASY,oBAAoBA,CAAC;EACnCC,UAAU,GAAG,aAAa;EAC1BC,QAAQ;EACRC,OAAO,GAAG,KAAK;EACfC,SAAS,GAAG;AACa,CAAC,EAAE;EAC5B,MAAMC,OAAO,GAAGV,cAAc,CAAC,CAAC,CAAC;EACjC,MAAMW,oBAAoB,GAAGX,cAAc,CAAC,CAAC,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AAC,kDAAkD,CAAC;EACrE;EACA,OAAOD,OAAO;AAChB","ignoreList":[]}
1
+ {"version":3,"names":["createContext","useCallback","useContext","useMemo","useState","useAnimatedRef","useAnimatedScrollHandler","useSharedValue","jsx","_jsx","SCREEN_HEADER_PORTAL_HOST","ScreenContext","ScreenScrollProvider","background","children","contentPadding","safeArea","hasHeader","scrollY","headerCollapseHeight","headerSnapOffsets","setHeaderSnapOffsets","scrollRef","setHeaderCollapseHeight","height","rounded","Math","round","value","undefined","scrollHandler","onScroll","event","contentOffset","y","margins","Provider","useScreen","context","Error"],"sourceRoot":"../../../../src","sources":["components/screen/ScreenContext.tsx"],"mappings":";;AAAA,SAASA,aAAa,EAAkBC,WAAW,EAAEC,UAAU,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAEjG,SAIEC,cAAc,EACdC,wBAAwB,EACxBC,cAAc,QACT,yBAAyB;;AAIhC;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAGA;AACA,OAAO,MAAMC,yBAAyB,GAAG,eAAe;;AAExD;;AAwCA,OAAO,MAAMC,aAAa,gBAAGX,aAAa,CAA4B,IAAI,CAAC;;AAE3E;;AAaA;AACA;AACA;AACA;AACA,OAAO,SAASY,oBAAoBA,CAAC;EACnCC,UAAU,GAAG,aAAa;EAC1BC,QAAQ;EACRC,cAAc,GAAG,KAAK;EACtBC,QAAQ,GAAG,MAAM;EACjBC,SAAS,GAAG;AACa,CAAC,EAAE;EAC5B,MAAMC,OAAO,GAAGX,cAAc,CAAC,CAAC,CAAC;EACjC,MAAMY,oBAAoB,GAAGZ,cAAc,CAAC,CAAC,CAAC;EAC9C,MAAM,CAACa,iBAAiB,EAAEC,oBAAoB,CAAC,GAAGjB,QAAQ,CAAW,CAAC;EACtE,MAAMkB,SAAS,GAAGjB,cAAc,CAAsB,CAAC;EAEvD,MAAMkB,uBAAuB,GAAGtB,WAAW,CACxCuB,MAAc,IAAK;IAClB,MAAMC,OAAO,GAAGC,IAAI,CAACC,KAAK,CAACH,MAAM,CAAC;IAClCL,oBAAoB,CAACS,KAAK,GAAGH,OAAO;IACpCJ,oBAAoB,CAACI,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,EAAEA,OAAO,CAAC,GAAGI,SAAS,CAAC;EAC9D,CAAC,EACD,CAACV,oBAAoB,CACvB,CAAC;EAED,MAAMW,aAAa,GAAGxB,wBAAwB,CAAC;IAC7CyB,QAAQ,EAAGC,KAAK,IAAK;MACnBd,OAAO,CAACU,KAAK,GAAGI,KAAK,CAACC,aAAa,CAACC,CAAC;IACvC;EACF,CAAC,CAAC;EAEF,MAAMN,KAAK,GAAGzB,OAAO,CACnB,OAAO;IACLU,UAAU;IACVE,cAAc;IACdC,QAAQ;IACRmB,OAAO,EAAEpB,cAAc;IACvBE,SAAS;IACTC,OAAO;IACPC,oBAAoB;IACpBC,iBAAiB;IACjBG,uBAAuB;IACvBD,SAAS;IACTQ;EACF,CAAC,CAAC,EACF,CACEjB,UAAU,EACVE,cAAc,EACdC,QAAQ,EACRC,SAAS,EACTC,OAAO,EACPC,oBAAoB,EACpBC,iBAAiB,EACjBG,uBAAuB,EACvBD,SAAS,EACTQ,aAAa,CAEjB,CAAC;EAED,oBAAOrB,IAAA,CAACE,aAAa,CAACyB,QAAQ;IAACR,KAAK,EAAEA,KAAM;IAAAd,QAAA,EAAEA;EAAQ,CAAyB,CAAC;AAClF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASuB,SAASA,CAAA,EAAuB;EAC9C,MAAMC,OAAO,GAAGpC,UAAU,CAACS,aAAa,CAAC;EACzC,IAAI,CAAC2B,OAAO,EAAE;IACZ,MAAM,IAAIC,KAAK,CAAC,kDAAkD,CAAC;EACrE;EACA,OAAOD,OAAO;AAChB","ignoreList":[]}
@@ -1,167 +1,9 @@
1
1
  "use strict";
2
2
 
3
- import { View } from "react-native-unistyles/components/native/View";
4
- import Animated, { useAnimatedScrollHandler, useComposedEventHandler } from "react-native-reanimated";
5
- import { StyleSheet } from "react-native-unistyles";
6
- import { resolveScreenMargin } from "../../theme/screen-margin.js";
7
- import { PortalHost } from "../portal/index.js";
8
- import { BottomSafeArea } from "./parts/BottomSafeArea.js";
9
- import { renderScreenPlaceholder } from "./parts/ScreenPlaceholder.js";
10
- import { SCREEN_HEADER_PORTAL_HOST, useScreen } from "./ScreenContext.js";
11
- import { hasXMargin, hasYMargin, renderListHeader } from "./utils.js";
3
+ import { ScreenList } from "./ScreenList.js";
12
4
 
13
- /**
14
- * @deprecated Use {@link ScreenListProps} (`Screen.List`) instead —
15
- * `Screen.List` renders `FlatList` by default and binds the screen's shared
16
- * scroll ref exactly as `Screen.FlatList` does, but also lets a screen swap in
17
- * any other FlatList-shaped list (e.g. `FlashList`) via its `as` prop.
18
- */
19
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
20
- /**
21
- * `FlatList` variant of `Screen.ScrollView`: binds the screen's shared scroll
22
- * ref, mirrors offset into `scrollY`, hosts the portal target above the list,
23
- * and applies token-driven content padding.
24
- *
25
- * Shares `loading` / `LoadingComponent` / `EmptyComponent` / `margins` /
26
- * `horizontal` with `Screen.ScrollView`, so a screen can swap one container for
27
- * another without relearning its API.
28
- *
29
- * @deprecated Use {@link ScreenList} (`Screen.List`) instead — it renders
30
- * `FlatList` by default and behaves identically, but also accepts an `as`
31
- * prop for swapping in another list implementation later without changing
32
- * the surrounding API.
33
- *
34
- * @example
35
- * ```tsx
36
- * <Screen.FlatList data={items} renderItem={({ item }) => <Row item={item} />} />
37
- * ```
38
- *
39
- * @example Loading and empty placeholders
40
- * ```tsx
41
- * <Screen.FlatList
42
- * data={items}
43
- * loading={isLoading}
44
- * EmptyComponent={<EmptyState icon="status.info" title="Nothing yet" fill />}
45
- * renderItem={({ item }) => <Row item={item} />}
46
- * />
47
- * ```
48
- */
49
- export function ScreenFlatList({
50
- data,
51
- style,
52
- contentContainerStyle,
53
- ListHeaderComponent,
54
- ListFooterComponent,
55
- ListEmptyComponent,
56
- horizontal = false,
57
- loading = false,
58
- LoadingComponent,
59
- EmptyComponent,
60
- margins,
61
- bottomInset,
62
- onScroll,
63
- ...rest
64
- }) {
65
- const {
66
- background,
67
- scrollRef,
68
- scrollHandler,
69
- headerSnapOffsets,
70
- margins: screenMargins,
71
- hasHeader
72
- } = useScreen();
73
- const resolvedMargins = margins ?? screenMargins;
74
- // The placeholder rides in on `ListEmptyComponent` rather than replacing the
75
- // list, so the header portal, scroll binding and snap offsets all stay put.
76
- // While loading the list is fed an empty `data` so that slot is the one that
77
- // renders.
78
- const placeholder = renderScreenPlaceholder({
79
- loading,
80
- LoadingComponent,
81
- EmptyComponent,
82
- isEmpty: !data || data.length === 0
83
- });
84
- const jsScrollHandler = useAnimatedScrollHandler(event => {
85
- if (onScroll) onScroll(event);
86
- }, [onScroll]);
87
- const composedHandler = useComposedEventHandler([scrollHandler, jsScrollHandler]);
5
+ /** @deprecated Use ScreenListProps. */
88
6
 
89
- // A caller naming its own `bottomInset` has taken the bottom over entirely,
90
- // and a horizontal list has no bottom edge to clear.
91
- const needsBottomSafeArea = bottomInset === undefined && !horizontal;
92
- const footerComponent = /*#__PURE__*/_jsxs(_Fragment, {
93
- children: [renderListHeader(ListFooterComponent), needsBottomSafeArea ? /*#__PURE__*/_jsx(BottomSafeArea, {}) : null]
94
- });
95
- const headerComponent = /*#__PURE__*/_jsxs(_Fragment, {
96
- children: [/*#__PURE__*/_jsx(View, {
97
- style: styles.headerWrapper(resolvedMargins),
98
- children: /*#__PURE__*/_jsx(PortalHost, {
99
- name: SCREEN_HEADER_PORTAL_HOST
100
- })
101
- }), renderListHeader(ListHeaderComponent)]
102
- });
103
- return /*#__PURE__*/_jsx(Animated.FlatList, {
104
- ref: scrollRef,
105
- data: loading ? [] : data,
106
- style: [{
107
- backgroundColor: background
108
- }, style],
109
- horizontal: horizontal,
110
- contentInsetAdjustmentBehavior: hasHeader ? "never" : undefined,
111
- contentContainerStyle: [styles.content(resolvedMargins, hasHeader, bottomInset), contentContainerStyle],
112
- ListHeaderComponent: headerComponent,
113
- ListFooterComponent: footerComponent,
114
- ListEmptyComponent: placeholder ?? ListEmptyComponent,
115
- showsVerticalScrollIndicator: false,
116
- scrollEventThrottle: 16,
117
- snapToOffsets: headerSnapOffsets,
118
- ...rest,
119
- onScroll: composedHandler
120
- });
121
- }
122
-
123
- // `resolveScreenMargin` is called *inside* each dynamic function below, not
124
- // hoisted to the factory's top level — the Babel plugin only attributes a
125
- // runtime dependency (here, breakpoint) to a style key when the `rt`/
126
- // `runtime` read it derives from sits inside that key's own value. Hoisting
127
- // it would silently drop the dependency, so the margin would freeze at
128
- // whatever breakpoint was active on mount and never update on rotation.
129
- const styles = StyleSheet.create((theme, runtime) => ({
130
- scrollContent: {
131
- flexGrow: 1
132
- },
133
- content: (margins, hasHeader, bottomInset) => {
134
- const {
135
- x: marginX,
136
- y: marginY
137
- } = resolveScreenMargin(theme, runtime.breakpoint);
138
- return {
139
- flexGrow: 1,
140
- // The header is absolutely positioned, so the list reserves its full
141
- // height — bar plus top safe area. This assumes the scroll view does not
142
- // also get UIKit's automatic inset adjustment: on a native tab screen
143
- // that means `disableAutomaticContentInsets` on the tab, or the two
144
- // insets are counted twice.
145
- paddingTop: (hasHeader ? theme.layout.header.height + runtime.insets.top : 0) + (hasYMargin(margins) ? marginY : 0),
146
- paddingHorizontal: hasXMargin(margins) ? marginX : 0,
147
- // The safe area is `BottomSafeArea`'s job; counting it here as well
148
- // would leave a gap the height of the gesture bar.
149
- paddingBottom: bottomInset ?? (hasYMargin(margins) ? marginY : 0),
150
- uni__dependencies: [0, 3, 9]
151
- };
152
- },
153
- safeArea: {
154
- height: runtime.insets.top,
155
- uni__dependencies: [9]
156
- },
157
- headerWrapper: margins => {
158
- const {
159
- x: marginX
160
- } = resolveScreenMargin(theme, runtime.breakpoint);
161
- return {
162
- marginHorizontal: hasXMargin(margins) ? -marginX : 0,
163
- uni__dependencies: [0, 3]
164
- };
165
- }
166
- }));
7
+ /** @deprecated Use Screen.List, which exposes the same native FlatList and ref. */
8
+ export const ScreenFlatList = ScreenList;
167
9
  //# sourceMappingURL=ScreenFlatList.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Animated","useAnimatedScrollHandler","useComposedEventHandler","StyleSheet","resolveScreenMargin","PortalHost","BottomSafeArea","renderScreenPlaceholder","SCREEN_HEADER_PORTAL_HOST","useScreen","hasXMargin","hasYMargin","renderListHeader","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","ScreenFlatList","data","style","contentContainerStyle","ListHeaderComponent","ListFooterComponent","ListEmptyComponent","horizontal","loading","LoadingComponent","EmptyComponent","margins","bottomInset","onScroll","rest","background","scrollRef","scrollHandler","headerSnapOffsets","screenMargins","hasHeader","resolvedMargins","placeholder","isEmpty","length","jsScrollHandler","event","composedHandler","needsBottomSafeArea","undefined","footerComponent","children","headerComponent","View","styles","headerWrapper","name","FlatList","ref","backgroundColor","contentInsetAdjustmentBehavior","content","showsVerticalScrollIndicator","scrollEventThrottle","snapToOffsets","create","theme","runtime","scrollContent","flexGrow","x","marginX","y","marginY","breakpoint","paddingTop","layout","header","height","insets","top","paddingHorizontal","paddingBottom","uni__dependencies","safeArea","marginHorizontal"],"sourceRoot":"../../../../src","sources":["components/screen/ScreenFlatList.tsx"],"mappings":";;;AAEA,OAAOA,QAAQ,IAEbC,wBAAwB,EACxBC,uBAAuB,QAClB,yBAAyB;AAChC,SAASC,UAAU,QAAQ,wBAAwB;AAEnD,SAASC,mBAAmB;AAC5B,SAASC,UAAU;AACnB,SAASC,cAAc;AACvB,SAASC,uBAAuB;AAChC,SAASC,yBAAyB,EAAEC,SAAS;AAE7C,SAASC,UAAU,EAAEC,UAAU,EAAEC,gBAAgB;;AAEjD;AACA;AACA;AACA;AACA;AACA;AALA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAA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kB,EAAER,WAA+B,KAAK;IACxF,MAAM;MAAEsC,CAAC,EAAEC,OAAO;MAAEC,CAAC,EAAEC;IAAQ,CAAC,GAAGpE,mBAAmB,CAAC6D,KAAK,EAAEC,OAAO,CAACO,UAAU,CAAC;IACjF,OAAO;MACLL,QAAQ,EAAE,CAAC;MACX;MACA;MACA;MACA;MACA;MACAM,UAAU,EACR,CAACnC,SAAS,GAAG0B,KAAK,CAACU,MAAM,CAACC,MAAM,CAACC,MAAM,GAAGX,OAAO,CAACY,MAAM,CAACC,GAAG,GAAG,CAAC,KAC/DpE,UAAU,CAACmB,OAAO,CAAC,GAAG0C,OAAO,GAAG,CAAC,CAAC;MACrCQ,iBAAiB,EAAEtE,UAAU,CAACoB,OAAO,CAAC,GAAGwC,OAAO,GAAG,CAAC;MACpD;MACA;MACAW,aAAa,EAAElD,WAAW,KAAKpB,UAAU,CAACmB,OAAO,CAAC,GAAG0C,OAAO,GAAG,CAAC,CAAC;MAAAU,iBAAA;IACnE,CAAC;EACH,CAAC;EACDC,QAAQ,EAAE;IACRN,MAAM,EAAEX,OAAO,CAACY,MAAM,CAACC,GAAG;IAAAG,iBAAA;EAC5B,CAAC;EACD5B,aAAa,EAAGxB,OAAsB,IAAK;IACzC,MAAM;MAAEuC,CAAC,EAAEC;IAAQ,CAAC,GAAGlE,mBAAmB,CAAC6D,KAAK,EAAEC,OAAO,CAACO,UAAU,CAAC;IACrE,OAAO;MACLW,gBAAgB,EAAE1E,UAAU,CAACoB,OAAO,CAAC,GAAG,CAACwC,OAAO,GAAG,CAAC;MAAAY,iBAAA;IACtD,CAAC;EACH;AACF,CAAC,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["ScreenList","ScreenFlatList"],"sourceRoot":"../../../../src","sources":["components/screen/ScreenFlatList.tsx"],"mappings":";;AAAA,SAASA,UAAU;;AAEnB;;AAEA;AACA,OAAO,MAAMC,cAAiC,GAAGD,UAAU","ignoreList":[]}
@@ -2,39 +2,30 @@
2
2
 
3
3
  import { View } from "react-native-unistyles/components/native/View";
4
4
  import { FlatList } from "react-native-unistyles/components/native/FlatList";
5
- import { useMemo } from "react";
6
- import Animated, { useAnimatedScrollHandler, useComposedEventHandler } from "react-native-reanimated";
5
+ import { forwardRef, useMemo } from "react";
6
+ import Animated from "react-native-reanimated";
7
7
  import { StyleSheet } from "react-native-unistyles";
8
- import { resolveScreenMargin } from "../../theme/screen-margin.js";
8
+ import { resolveScreenPadding } from "../../theme/screen-padding.js";
9
9
  import { PortalHost } from "../portal/index.js";
10
- import { BottomSafeArea } from "./parts/BottomSafeArea.js";
10
+ import { useScreenRef } from "./hooks/use-screen-ref.js";
11
+ import { useScreenScrollHandler } from "./hooks/use-screen-scroll-handler.js";
11
12
  import { renderScreenPlaceholder } from "./parts/ScreenPlaceholder.js";
12
13
  import { SCREEN_HEADER_PORTAL_HOST, useScreen } from "./ScreenContext.js";
13
- import { hasXMargin, hasYMargin, renderListHeader } from "./utils.js";
14
+ import { hasHorizontalPadding, hasVerticalPadding, renderListComponent } from "./utils.js";
15
+
16
+ /** Minimal row information supported by custom list adapters. FlatList also supplies separators. */
17
+
18
+ /** Native viewability token with the item inferred from data. */
19
+
20
+ /** Native FlatList props with item inference retained across callbacks and refs. */
21
+
22
+ /** Props an adapter must accept and forward to its scrollable list implementation. */
23
+
24
+ /** Custom lists must accept the adapter contract and forward a ref for Reanimated. */
25
+
26
+ /** Screen list props, optionally parameterized by a custom adapter component. */
14
27
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
15
- /**
16
- * Polymorphic list container — renders whichever list `as` names (defaults
17
- * to `FlatList`), applying the same margin/header/safe-area/scroll-handler
18
- * chrome regardless of which one it is. A screen can swap list
19
- * implementations by changing `as`, without relearning the surrounding API.
20
- *
21
- * @example
22
- * ```tsx
23
- * <Screen.List data={items} renderItem={({ item }) => <Row item={item} />} />
24
- * ```
25
- *
26
- * @example Any other list component
27
- * ```tsx
28
- * import { FlashList } from '@shopify/flash-list';
29
- *
30
- * <Screen.List
31
- * as={FlashList}
32
- * data={items}
33
- * renderItem={({ item }) => <Row item={item} />}
34
- * />
35
- * ```
36
- */
37
- export function ScreenList({
28
+ const ScreenListBase = /*#__PURE__*/forwardRef(function ScreenList({
38
29
  as,
39
30
  data,
40
31
  renderItem,
@@ -44,117 +35,110 @@ export function ScreenList({
44
35
  ListFooterComponent,
45
36
  ListEmptyComponent,
46
37
  horizontal = false,
38
+ isLoading,
47
39
  loading = false,
40
+ loadingContent,
48
41
  LoadingComponent,
42
+ emptyContent,
49
43
  EmptyComponent,
44
+ contentPadding,
50
45
  margins,
51
46
  bottomInset,
47
+ extraBottomPadding = 0,
48
+ scrollHandler: externalScrollHandler,
52
49
  onScroll,
53
50
  ...rest
54
- }) {
55
- const isDefaultFlatList = as === undefined;
51
+ }, ref) {
52
+ const isDefaultFlatList = as === undefined || as === FlatList;
56
53
  const Component = as ?? FlatList;
57
-
58
- // `Animated.createAnimatedComponent` should only run once per component,
59
- // not on every render — `as` is arbitrary here (not a fixed module-scope
60
- // reference like `Screen.FlatList` uses), so it's memoized on the resolved
61
- // component instead of hoisted to module scope.
54
+ // Stable wrappers preserve the native list and its scroll position across renders.
62
55
  const AnimatedComponent = useMemo(() => Animated.createAnimatedComponent(Component), [Component]);
63
56
  const {
64
57
  background,
65
58
  scrollRef,
66
59
  scrollHandler,
67
60
  headerSnapOffsets,
68
- margins: screenMargins,
61
+ contentPadding: screenPadding,
69
62
  hasHeader
70
63
  } = useScreen();
71
- const resolvedMargins = margins ?? screenMargins;
72
- // The placeholder rides in on `ListEmptyComponent` rather than replacing the
73
- // list, so the header portal, scroll binding and snap offsets all stay put.
74
- // While loading the list is fed an empty `data` so that slot is the one that
75
- // renders.
64
+ const mergedRef = useScreenRef(isDefaultFlatList ? scrollRef : undefined, ref);
65
+ const resolvedPadding = contentPadding ?? margins ?? screenPadding;
66
+ const resolvedLoading = isLoading ?? loading;
76
67
  const placeholder = renderScreenPlaceholder({
77
- loading,
78
- LoadingComponent,
79
- EmptyComponent,
68
+ isLoading: resolvedLoading,
69
+ loadingContent: loadingContent !== undefined ? loadingContent : LoadingComponent ?? undefined,
70
+ emptyContent: emptyContent !== undefined ? emptyContent : EmptyComponent,
80
71
  isEmpty: !data || data.length === 0
81
72
  });
82
- const jsScrollHandler = useAnimatedScrollHandler(event => {
83
- if (onScroll) onScroll(event);
84
- }, [onScroll]);
85
- const composedHandler = useComposedEventHandler([scrollHandler, jsScrollHandler]);
86
-
87
- // A caller naming its own `bottomInset` has taken the bottom over entirely,
88
- // and a horizontal list has no bottom edge to clear.
89
- const needsBottomSafeArea = bottomInset === undefined && !horizontal;
90
- const footerComponent = /*#__PURE__*/_jsxs(_Fragment, {
91
- children: [renderListHeader(ListFooterComponent), needsBottomSafeArea ? /*#__PURE__*/_jsx(BottomSafeArea, {}) : null]
92
- });
93
- const headerComponent = /*#__PURE__*/_jsxs(_Fragment, {
73
+ const composedScrollHandler = useScreenScrollHandler(scrollHandler, onScroll, externalScrollHandler);
74
+ const header = /*#__PURE__*/_jsxs(_Fragment, {
94
75
  children: [/*#__PURE__*/_jsx(View, {
95
- style: styles.headerWrapper(resolvedMargins),
76
+ style: styles.headerWrapper(resolvedPadding),
96
77
  children: /*#__PURE__*/_jsx(PortalHost, {
97
78
  name: SCREEN_HEADER_PORTAL_HOST
98
79
  })
99
- }), renderListHeader(ListHeaderComponent)]
80
+ }), renderListComponent(ListHeaderComponent)]
100
81
  });
101
82
  return /*#__PURE__*/_jsx(AnimatedComponent, {
102
- ref: isDefaultFlatList ? scrollRef : undefined,
103
- data: loading ? [] : data,
83
+ ref: mergedRef,
84
+ data: resolvedLoading ? [] : data,
104
85
  renderItem: renderItem,
105
86
  style: [{
106
87
  backgroundColor: background
107
88
  }, style],
108
89
  horizontal: horizontal,
109
- contentInsetAdjustmentBehavior: hasHeader ? "never" : undefined,
110
- contentContainerStyle: [styles.content(resolvedMargins, hasHeader, bottomInset), contentContainerStyle],
111
- ListHeaderComponent: headerComponent,
112
- ListFooterComponent: footerComponent,
90
+ contentInsetAdjustmentBehavior: "never",
91
+ automaticallyAdjustContentInsets: false,
92
+ automaticallyAdjustsScrollIndicatorInsets: false,
93
+ contentContainerStyle: [styles.content(resolvedPadding, hasHeader, bottomInset, extraBottomPadding), contentContainerStyle],
94
+ ListHeaderComponent: header,
95
+ ListFooterComponent: ListFooterComponent,
113
96
  ListEmptyComponent: placeholder ?? ListEmptyComponent,
114
97
  showsVerticalScrollIndicator: false,
115
98
  scrollEventThrottle: 16,
116
99
  snapToOffsets: headerSnapOffsets,
117
100
  ...rest,
118
- onScroll: composedHandler
101
+ onScroll: composedScrollHandler
119
102
  });
120
- }
121
- ScreenList.displayName = "Screen.List";
103
+ });
122
104
 
123
- // `resolveScreenMargin` is called *inside* each dynamic function below, not
124
- // hoisted to the factory's top level the Babel plugin only attributes a
125
- // runtime dependency (here, breakpoint) to a style key when the `rt`/
126
- // `runtime` read it derives from sits inside that key's own value. Hoisting
127
- // it would silently drop the dependency, so the margin would freeze at
128
- // whatever breakpoint was active on mount and never update on rotation.
105
+ /**
106
+ * Virtualized Screen content. FlatList is the default and its native ref and
107
+ * item callbacks retain their types. Native refreshing keeps rows visible;
108
+ * isLoading replaces them with loadingContent (a Spinner by default).
109
+ *
110
+ * Custom `as` components must implement ScreenListAdapterProps, forward their
111
+ * ref, and forward the supplied scroll events, styles, and header/footer slots.
112
+ * Their native ref is forwarded to callers; useScreen().scrollRef is FlatList-only here.
113
+ * JS onScroll receives nativeEvent data without SyntheticEvent methods.
114
+ *
115
+ * @example
116
+ * ```tsx
117
+ * <Screen safeArea="auto">
118
+ * <Screen.List data={items} renderItem={({ item }) => <Row item={item} />}
119
+ * isLoading={isLoading} refreshing={isRefreshing} onRefresh={refresh} />
120
+ * </Screen>
121
+ * ```
122
+ */
123
+ export const ScreenList = ScreenListBase;
124
+ ScreenList.displayName = "Screen.List";
129
125
  const styles = StyleSheet.create((theme, runtime) => ({
130
- content: (margins, hasHeader, bottomInset) => {
126
+ content: (padding, hasHeader, bottomInset, extraBottomPadding) => {
131
127
  const {
132
- x: marginX,
133
- y: marginY
134
- } = resolveScreenMargin(theme, runtime.breakpoint);
128
+ x,
129
+ y
130
+ } = resolveScreenPadding(theme, runtime.breakpoint);
135
131
  return {
136
132
  flexGrow: 1,
137
- // The header is absolutely positioned, so the list reserves its full
138
- // height bar plus top safe area. This assumes the scroll view does not
139
- // also get UIKit's automatic inset adjustment: on a native tab screen
140
- // that means `disableAutomaticContentInsets` on the tab, or the two
141
- // insets are counted twice.
142
- paddingTop: (hasHeader ? theme.layout.header.height + runtime.insets.top : 0) + (hasYMargin(margins) ? marginY : 0),
143
- paddingHorizontal: hasXMargin(margins) ? marginX : 0,
144
- // The safe area is `BottomSafeArea`'s job; counting it here as well
145
- // would leave a gap the height of the gesture bar.
146
- paddingBottom: bottomInset ?? (hasYMargin(margins) ? marginY : 0),
147
- uni__dependencies: [0, 3, 9]
148
- };
149
- },
150
- headerWrapper: margins => {
151
- const {
152
- x: marginX
153
- } = resolveScreenMargin(theme, runtime.breakpoint);
154
- return {
155
- marginHorizontal: hasXMargin(margins) ? -marginX : 0,
133
+ paddingTop: (hasHeader ? theme.layout.header.height : 0) + (hasVerticalPadding(padding) ? y : 0),
134
+ paddingHorizontal: hasHorizontalPadding(padding) ? x : 0,
135
+ paddingBottom: (bottomInset ?? (hasVerticalPadding(padding) ? y : 0)) + extraBottomPadding,
156
136
  uni__dependencies: [0, 3]
157
137
  };
158
- }
138
+ },
139
+ headerWrapper: padding => ({
140
+ marginHorizontal: hasHorizontalPadding(padding) ? -resolveScreenPadding(theme, runtime.breakpoint).x : 0,
141
+ uni__dependencies: [0, 3]
142
+ })
159
143
  }));
160
144
  //# sourceMappingURL=ScreenList.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useMemo","Animated","useAnimatedScrollHandler","useComposedEventHandler","StyleSheet","resolveScreenMargin","PortalHost","BottomSafeArea","renderScreenPlaceholder","SCREEN_HEADER_PORTAL_HOST","useScreen","hasXMargin","hasYMargin","renderListHeader","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","ScreenList","as","data","renderItem","style","contentContainerStyle","ListHeaderComponent","ListFooterComponent","ListEmptyComponent","horizontal","loading","LoadingComponent","EmptyComponent","margins","bottomInset","onScroll","rest","isDefaultFlatList","undefined","Component","FlatList","AnimatedComponent","createAnimatedComponent","background","scrollRef","scrollHandler","headerSnapOffsets","screenMargins","hasHeader","resolvedMargins","placeholder","isEmpty","length","jsScrollHandler","event","composedHandler","needsBottomSafeArea","footerComponent","children","headerComponent","View","styles","headerWrapper","name","ref","backgroundColor","contentInsetAdjustmentBehavior","content","showsVerticalScrollIndicator","scrollEventThrottle","snapToOffsets","displayName","create","theme","runtime","x","marginX","y","marginY","breakpoint","flexGrow","paddingTop","layout","header","height","insets","top","paddingHorizontal","paddingBottom","uni__dependencies","marginHorizontal"],"sourceRoot":"../../../../src","sources":["components/screen/ScreenList.tsx"],"mappings":";;;;AAAA,SAKEA,OAAO,QACF,OAAO;AAUd,OAAOC,QAAQ,IAEbC,wBAAwB,EACxBC,uBAAuB,QAClB,yBAAyB;AAChC,SAASC,UAAU,QAAQ,wBAAwB;AAEnD,SAASC,mBAAmB;AAC5B,SAASC,UAAU;AACnB,SAASC,cAAc;AACvB,SAASC,uBAAuB;AAChC,SAASC,yBAAyB,EAAEC,SAAS;AAE7C,SAASC,UAAU,EAAEC,UAAU,EAA4BC,gBAAgB;AAAkB,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAmD7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,UAAUA,CAAwD;EAChFC,EAAE;EACFC,IAAI;EACJC,UAAU;EACVC,KAAK;EACLC,qBAAqB;EACrBC,mBAAmB;EACnBC,mBAAmB;E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ClC,OAAsB,EAAEe,SAAkB,EAAEd,WAA+B,KAAK;IACxF,MAAM;MAAEyC,CAAC,EAAEC,OAAO;MAAEC,CAAC,EAAEC;IAAQ,CAAC,GAAGzE,mBAAmB,CAACoE,KAAK,EAAEC,OAAO,CAACK,UAAU,CAAC;IACjF,OAAO;MACLC,QAAQ,EAAE,CAAC;MACX;MACA;MACA;MACA;MACA;MACAC,UAAU,EACR,CAACjC,SAAS,GAAGyB,KAAK,CAACS,MAAM,CAACC,MAAM,CAACC,MAAM,GAAGV,OAAO,CAACW,MAAM,CAACC,GAAG,GAAG,CAAC,KAC/D1E,UAAU,CAACqB,OAAO,CAAC,GAAG6C,OAAO,GAAG,CAAC,CAAC;MACrCS,iBAAiB,EAAE5E,UAAU,CAACsB,OAAO,CAAC,GAAG2C,OAAO,GAAG,CAAC;MACpD;MACA;MACAY,aAAa,EAAEtD,WAAW,KAAKtB,UAAU,CAACqB,OAAO,CAAC,GAAG6C,OAAO,GAAG,CAAC,CAAC;MAAAW,iBAAA;IACnE,CAAC;EACH,CAAC;EACD3B,aAAa,EAAG7B,OAAsB,IAAK;IACzC,MAAM;MAAE0C,CAAC,EAAEC;IAAQ,CAAC,GAAGvE,mBAAmB,CAACoE,KAAK,EAAEC,OAAO,CAACK,UAAU,CAAC;IACrE,OAAO;MACLW,gBAAgB,EAAE/E,UAAU,CAACsB,OAAO,CAAC,GAAG,CAAC2C,OAAO,GAAG,CAAC;MAAAa,iBAAA;IACtD,CAAC;EACH;AACF,CAAC,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["forwardRef","useMemo","Animated","StyleSheet","resolveScreenPadding","PortalHost","useScreenRef","useScreenScrollHandler","renderScreenPlaceholder","SCREEN_HEADER_PORTAL_HOST","useScreen","hasHorizontalPadding","hasVerticalPadding","renderListComponent","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","ScreenListBase","ScreenList","as","data","renderItem","style","contentContainerStyle","ListHeaderComponent","ListFooterComponent","ListEmptyComponent","horizontal","isLoading","loading","loadingContent","LoadingComponent","emptyContent","EmptyComponent","contentPadding","margins","bottomInset","extraBottomPadding","scrollHandler","externalScrollHandler","onScroll","rest","ref","isDefaultFlatList","undefined","FlatList","Component","AnimatedComponent","createAnimatedComponent","background","scrollRef","headerSnapOffsets","screenPadding","hasHeader","mergedRef","resolvedPadding","resolvedLoading","placeholder","isEmpty","length","composedScrollHandler","header","children","View","styles","headerWrapper","name","backgroundColor","contentInsetAdjustmentBehavior","automaticallyAdjustContentInsets","automaticallyAdjustsScrollIndicatorInsets","content","showsVerticalScrollIndicator","scrollEventThrottle","snapToOffsets","displayName","create","theme","runtime","padding","x","y","breakpoint","flexGrow","paddingTop","layout","height","paddingHorizontal","paddingBottom","uni__dependencies","marginHorizontal"],"sourceRoot":"../../../../src","sources":["components/screen/ScreenList.tsx"],"mappings":";;;;AAAA,SAKEA,UAAU,EAIVC,OAAO,QACF,OAAO;AAGd,OAAOC,QAAQ,MAAM,yBAAyB;AAC9C,SAASC,UAAU,QAAQ,wBAAwB;AAEnD,SAASC,oBAAoB;AAC7B,SAASC,UAAU;AACnB,SAASC,YAAY;AACrB,SAASC,sBAAsB;AAC/B,SAASC,uBAAuB;AAChC,SAASC,yBAAyB,EAAEC,SAAS;AAE7C,SAASC,oBAAoB,EAAEC,kBAAkB,EAAEC,mBAAmB;;AAEtE;;AAKA;;AAgBA;;AAyBA;;AA+BA;;AAiBA;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAiBA,MAAMC,cAAc,gBAAGpB,UAAU,CAAC,SAASqB,UAAUA,CACnD;EACEC,EAAE;EACFC,IAAI;EACJC,UAAU;EACVC,KAAK;EACLC,qBAAqB;EACrBC,mBAAmB;EACnBC,mBAAmB;EACnBC,kBAAkB;EAClBC,UAAU,GAAG,KAAK;EAClBC,SAAS;EACTC,OAAO,GAAG,KAAK;EACfC,cAAc;EACdC,gBAAgB;EAChB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