react-native-screen-transitions 3.2.0-beta.2 → 3.2.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 (239) hide show
  1. package/README.md +346 -620
  2. package/lib/commonjs/blank-stack/components/stack-view.js +0 -2
  3. package/lib/commonjs/blank-stack/components/stack-view.js.map +1 -1
  4. package/lib/commonjs/blank-stack/components/stack-view.native.js +0 -2
  5. package/lib/commonjs/blank-stack/components/stack-view.native.js.map +1 -1
  6. package/lib/commonjs/component-stack/components/stack-view.js +16 -20
  7. package/lib/commonjs/component-stack/components/stack-view.js.map +1 -1
  8. package/lib/commonjs/native-stack/views/NativeStackView.native.js +3 -3
  9. package/lib/commonjs/native-stack/views/NativeStackView.native.js.map +1 -1
  10. package/lib/commonjs/shared/components/overlay/variations/float-overlay.js +1 -6
  11. package/lib/commonjs/shared/components/overlay/variations/float-overlay.js.map +1 -1
  12. package/lib/commonjs/shared/components/overlay/variations/overlay-host.js +16 -64
  13. package/lib/commonjs/shared/components/overlay/variations/overlay-host.js.map +1 -1
  14. package/lib/commonjs/shared/components/overlay/variations/screen-overlay.js +5 -8
  15. package/lib/commonjs/shared/components/overlay/variations/screen-overlay.js.map +1 -1
  16. package/lib/commonjs/shared/components/screen-lifecycle.js +29 -0
  17. package/lib/commonjs/shared/components/screen-lifecycle.js.map +1 -0
  18. package/lib/commonjs/shared/constants.js +4 -2
  19. package/lib/commonjs/shared/constants.js.map +1 -1
  20. package/lib/commonjs/shared/hooks/animation/use-screen-animation.js +3 -0
  21. package/lib/commonjs/shared/hooks/animation/use-screen-animation.js.map +1 -1
  22. package/lib/commonjs/shared/hooks/gestures/use-build-gestures.js.map +1 -1
  23. package/lib/commonjs/shared/hooks/lifecycle/use-close-transition.js +127 -0
  24. package/lib/commonjs/shared/hooks/lifecycle/use-close-transition.js.map +1 -0
  25. package/lib/commonjs/shared/hooks/lifecycle/use-open-transition.js +35 -0
  26. package/lib/commonjs/shared/hooks/lifecycle/use-open-transition.js.map +1 -0
  27. package/lib/commonjs/shared/hooks/lifecycle/use-screen-events.js +58 -0
  28. package/lib/commonjs/shared/hooks/lifecycle/use-screen-events.js.map +1 -0
  29. package/lib/commonjs/shared/hooks/navigation/use-history.js +24 -0
  30. package/lib/commonjs/shared/hooks/navigation/use-history.js.map +1 -0
  31. package/lib/commonjs/shared/hooks/navigation/use-screen-state.js +45 -0
  32. package/lib/commonjs/shared/hooks/navigation/use-screen-state.js.map +1 -0
  33. package/lib/commonjs/shared/hooks/use-stable-callback-value.js +0 -2
  34. package/lib/commonjs/shared/hooks/use-stable-callback-value.js.map +1 -1
  35. package/lib/commonjs/shared/index.js +14 -0
  36. package/lib/commonjs/shared/index.js.map +1 -1
  37. package/lib/commonjs/shared/providers/screen/keys.provider.js +0 -6
  38. package/lib/commonjs/shared/providers/screen/keys.provider.js.map +1 -1
  39. package/lib/commonjs/shared/providers/screen/screen-composer.js +9 -7
  40. package/lib/commonjs/shared/providers/screen/screen-composer.js.map +1 -1
  41. package/lib/commonjs/shared/providers/screen/styles.provider.js +1 -1
  42. package/lib/commonjs/shared/providers/screen/styles.provider.js.map +1 -1
  43. package/lib/commonjs/shared/providers/stack/direct.provider.js +9 -0
  44. package/lib/commonjs/shared/providers/stack/direct.provider.js.map +1 -1
  45. package/lib/commonjs/shared/providers/stack/managed.provider.js +9 -0
  46. package/lib/commonjs/shared/providers/stack/managed.provider.js.map +1 -1
  47. package/lib/commonjs/shared/stores/animation.store.js +3 -13
  48. package/lib/commonjs/shared/stores/animation.store.js.map +1 -1
  49. package/lib/commonjs/shared/stores/history.store.js +185 -0
  50. package/lib/commonjs/shared/stores/history.store.js.map +1 -0
  51. package/lib/commonjs/shared/types/index.js +3 -3
  52. package/lib/commonjs/shared/types/index.js.map +1 -1
  53. package/lib/commonjs/shared/types/stack.types.js +4 -0
  54. package/lib/commonjs/shared/types/stack.types.js.map +1 -1
  55. package/lib/commonjs/shared/utils/animation/start-screen-transition.js +10 -6
  56. package/lib/commonjs/shared/utils/animation/start-screen-transition.js.map +1 -1
  57. package/lib/commonjs/shared/utils/bounds/index.js +19 -4
  58. package/lib/commonjs/shared/utils/bounds/index.js.map +1 -1
  59. package/lib/module/blank-stack/components/stack-view.js +0 -2
  60. package/lib/module/blank-stack/components/stack-view.js.map +1 -1
  61. package/lib/module/blank-stack/components/stack-view.native.js +0 -2
  62. package/lib/module/blank-stack/components/stack-view.native.js.map +1 -1
  63. package/lib/module/component-stack/components/stack-view.js +16 -20
  64. package/lib/module/component-stack/components/stack-view.js.map +1 -1
  65. package/lib/module/native-stack/views/NativeStackView.native.js +3 -3
  66. package/lib/module/native-stack/views/NativeStackView.native.js.map +1 -1
  67. package/lib/module/shared/components/overlay/variations/float-overlay.js +1 -6
  68. package/lib/module/shared/components/overlay/variations/float-overlay.js.map +1 -1
  69. package/lib/module/shared/components/overlay/variations/overlay-host.js +16 -64
  70. package/lib/module/shared/components/overlay/variations/overlay-host.js.map +1 -1
  71. package/lib/module/shared/components/overlay/variations/screen-overlay.js +5 -8
  72. package/lib/module/shared/components/overlay/variations/screen-overlay.js.map +1 -1
  73. package/lib/module/shared/components/screen-lifecycle.js +24 -0
  74. package/lib/module/shared/components/screen-lifecycle.js.map +1 -0
  75. package/lib/module/shared/constants.js +3 -1
  76. package/lib/module/shared/constants.js.map +1 -1
  77. package/lib/module/shared/hooks/animation/use-screen-animation.js +3 -0
  78. package/lib/module/shared/hooks/animation/use-screen-animation.js.map +1 -1
  79. package/lib/module/shared/hooks/gestures/use-build-gestures.js.map +1 -1
  80. package/lib/module/shared/hooks/lifecycle/use-close-transition.js +122 -0
  81. package/lib/module/shared/hooks/lifecycle/use-close-transition.js.map +1 -0
  82. package/lib/module/shared/hooks/lifecycle/use-open-transition.js +32 -0
  83. package/lib/module/shared/hooks/lifecycle/use-open-transition.js.map +1 -0
  84. package/lib/module/shared/hooks/lifecycle/use-screen-events.js +54 -0
  85. package/lib/module/shared/hooks/lifecycle/use-screen-events.js.map +1 -0
  86. package/lib/module/shared/hooks/navigation/use-history.js +20 -0
  87. package/lib/module/shared/hooks/navigation/use-history.js.map +1 -0
  88. package/lib/module/shared/hooks/navigation/use-screen-state.js +41 -0
  89. package/lib/module/shared/hooks/navigation/use-screen-state.js.map +1 -0
  90. package/lib/module/shared/hooks/use-stable-callback-value.js +0 -3
  91. package/lib/module/shared/hooks/use-stable-callback-value.js.map +1 -1
  92. package/lib/module/shared/index.js +2 -0
  93. package/lib/module/shared/index.js.map +1 -1
  94. package/lib/module/shared/providers/screen/keys.provider.js +0 -6
  95. package/lib/module/shared/providers/screen/keys.provider.js.map +1 -1
  96. package/lib/module/shared/providers/screen/screen-composer.js +9 -7
  97. package/lib/module/shared/providers/screen/screen-composer.js.map +1 -1
  98. package/lib/module/shared/providers/screen/styles.provider.js +1 -1
  99. package/lib/module/shared/providers/screen/styles.provider.js.map +1 -1
  100. package/lib/module/shared/providers/stack/direct.provider.js +10 -1
  101. package/lib/module/shared/providers/stack/direct.provider.js.map +1 -1
  102. package/lib/module/shared/providers/stack/managed.provider.js +10 -1
  103. package/lib/module/shared/providers/stack/managed.provider.js.map +1 -1
  104. package/lib/module/shared/stores/animation.store.js +4 -14
  105. package/lib/module/shared/stores/animation.store.js.map +1 -1
  106. package/lib/module/shared/stores/history.store.js +181 -0
  107. package/lib/module/shared/stores/history.store.js.map +1 -0
  108. package/lib/module/shared/types/index.js +1 -1
  109. package/lib/module/shared/types/index.js.map +1 -1
  110. package/lib/module/shared/types/stack.types.js +5 -0
  111. package/lib/module/shared/types/stack.types.js.map +1 -1
  112. package/lib/module/shared/utils/animation/start-screen-transition.js +6 -2
  113. package/lib/module/shared/utils/animation/start-screen-transition.js.map +1 -1
  114. package/lib/module/shared/utils/bounds/index.js +19 -4
  115. package/lib/module/shared/utils/bounds/index.js.map +1 -1
  116. package/lib/typescript/blank-stack/components/stack-view.d.ts.map +1 -1
  117. package/lib/typescript/blank-stack/components/stack-view.native.d.ts.map +1 -1
  118. package/lib/typescript/blank-stack/types.d.ts +1 -8
  119. package/lib/typescript/blank-stack/types.d.ts.map +1 -1
  120. package/lib/typescript/component-stack/components/stack-view.d.ts.map +1 -1
  121. package/lib/typescript/component-stack/types.d.ts +1 -8
  122. package/lib/typescript/component-stack/types.d.ts.map +1 -1
  123. package/lib/typescript/native-stack/types.d.ts +2 -3
  124. package/lib/typescript/native-stack/types.d.ts.map +1 -1
  125. package/lib/typescript/native-stack/views/NativeStackView.native.d.ts.map +1 -1
  126. package/lib/typescript/shared/components/overlay/variations/float-overlay.d.ts.map +1 -1
  127. package/lib/typescript/shared/components/overlay/variations/overlay-host.d.ts +1 -6
  128. package/lib/typescript/shared/components/overlay/variations/overlay-host.d.ts.map +1 -1
  129. package/lib/typescript/shared/components/overlay/variations/screen-overlay.d.ts +4 -0
  130. package/lib/typescript/shared/components/overlay/variations/screen-overlay.d.ts.map +1 -1
  131. package/lib/typescript/shared/components/screen-lifecycle.d.ts +12 -0
  132. package/lib/typescript/shared/components/screen-lifecycle.d.ts.map +1 -0
  133. package/lib/typescript/shared/constants.d.ts +2 -1
  134. package/lib/typescript/shared/constants.d.ts.map +1 -1
  135. package/lib/typescript/shared/hooks/animation/use-screen-animation.d.ts.map +1 -1
  136. package/lib/typescript/shared/hooks/gestures/use-build-gestures.d.ts.map +1 -1
  137. package/lib/typescript/shared/hooks/lifecycle/use-close-transition.d.ts +13 -0
  138. package/lib/typescript/shared/hooks/lifecycle/use-close-transition.d.ts.map +1 -0
  139. package/lib/typescript/shared/hooks/lifecycle/use-open-transition.d.ts +11 -0
  140. package/lib/typescript/shared/hooks/lifecycle/use-open-transition.d.ts.map +1 -0
  141. package/lib/typescript/shared/hooks/lifecycle/use-screen-events.d.ts +7 -0
  142. package/lib/typescript/shared/hooks/lifecycle/use-screen-events.d.ts.map +1 -0
  143. package/lib/typescript/shared/hooks/navigation/use-history.d.ts +37 -0
  144. package/lib/typescript/shared/hooks/navigation/use-history.d.ts.map +1 -0
  145. package/lib/typescript/shared/hooks/navigation/use-screen-state.d.ts +40 -0
  146. package/lib/typescript/shared/hooks/navigation/use-screen-state.d.ts.map +1 -0
  147. package/lib/typescript/shared/hooks/use-stable-callback-value.d.ts.map +1 -1
  148. package/lib/typescript/shared/index.d.ts +22 -20
  149. package/lib/typescript/shared/index.d.ts.map +1 -1
  150. package/lib/typescript/shared/providers/screen/keys.provider.d.ts +2 -9
  151. package/lib/typescript/shared/providers/screen/keys.provider.d.ts.map +1 -1
  152. package/lib/typescript/shared/providers/screen/screen-composer.d.ts +1 -3
  153. package/lib/typescript/shared/providers/screen/screen-composer.d.ts.map +1 -1
  154. package/lib/typescript/shared/providers/stack/direct.provider.d.ts.map +1 -1
  155. package/lib/typescript/shared/providers/stack/managed.provider.d.ts.map +1 -1
  156. package/lib/typescript/shared/stores/animation.store.d.ts +3 -4
  157. package/lib/typescript/shared/stores/animation.store.d.ts.map +1 -1
  158. package/lib/typescript/shared/stores/history.store.d.ts +82 -0
  159. package/lib/typescript/shared/stores/history.store.d.ts.map +1 -0
  160. package/lib/typescript/shared/types/animation.types.d.ts +10 -6
  161. package/lib/typescript/shared/types/animation.types.d.ts.map +1 -1
  162. package/lib/typescript/shared/types/bounds.types.d.ts +1 -1
  163. package/lib/typescript/shared/types/bounds.types.d.ts.map +1 -1
  164. package/lib/typescript/shared/types/index.d.ts +2 -2
  165. package/lib/typescript/shared/types/index.d.ts.map +1 -1
  166. package/lib/typescript/shared/types/overlay.types.d.ts +21 -0
  167. package/lib/typescript/shared/types/overlay.types.d.ts.map +1 -1
  168. package/lib/typescript/shared/types/screen.types.d.ts +5 -4
  169. package/lib/typescript/shared/types/screen.types.d.ts.map +1 -1
  170. package/lib/typescript/shared/types/stack.types.d.ts +10 -0
  171. package/lib/typescript/shared/types/stack.types.d.ts.map +1 -1
  172. package/lib/typescript/shared/utils/animation/start-screen-transition.d.ts.map +1 -1
  173. package/lib/typescript/shared/utils/bounds/index.d.ts.map +1 -1
  174. package/package.json +1 -1
  175. package/src/blank-stack/components/stack-view.native.tsx +0 -2
  176. package/src/blank-stack/components/stack-view.tsx +0 -2
  177. package/src/blank-stack/types.ts +0 -10
  178. package/src/component-stack/components/stack-view.tsx +19 -23
  179. package/src/component-stack/types.ts +0 -10
  180. package/src/native-stack/types.ts +2 -3
  181. package/src/native-stack/views/NativeStackView.native.tsx +2 -3
  182. package/src/shared/__tests__/history.store.test.ts +550 -0
  183. package/src/shared/components/overlay/variations/float-overlay.tsx +2 -8
  184. package/src/shared/components/overlay/variations/overlay-host.tsx +18 -84
  185. package/src/shared/components/overlay/variations/screen-overlay.tsx +6 -15
  186. package/src/shared/components/screen-lifecycle.tsx +32 -0
  187. package/src/shared/constants.ts +4 -1
  188. package/src/shared/hooks/animation/use-screen-animation.tsx +7 -3
  189. package/src/shared/hooks/gestures/use-build-gestures.tsx +0 -2
  190. package/src/shared/hooks/lifecycle/use-close-transition.ts +147 -0
  191. package/src/shared/hooks/lifecycle/use-open-transition.ts +30 -0
  192. package/src/shared/hooks/lifecycle/use-screen-events.ts +62 -0
  193. package/src/shared/hooks/navigation/use-history.ts +63 -0
  194. package/src/shared/hooks/navigation/use-screen-state.tsx +99 -0
  195. package/src/shared/hooks/use-stable-callback-value.ts +0 -1
  196. package/src/shared/index.ts +5 -0
  197. package/src/shared/providers/screen/keys.provider.tsx +1 -25
  198. package/src/shared/providers/screen/screen-composer.tsx +7 -13
  199. package/src/shared/providers/screen/styles.provider.tsx +1 -1
  200. package/src/shared/providers/stack/direct.provider.tsx +11 -1
  201. package/src/shared/providers/stack/managed.provider.tsx +11 -1
  202. package/src/shared/stores/animation.store.ts +6 -20
  203. package/src/shared/stores/history.store.ts +201 -0
  204. package/src/shared/types/animation.types.ts +11 -6
  205. package/src/shared/types/bounds.types.ts +1 -0
  206. package/src/shared/types/index.ts +2 -7
  207. package/src/shared/types/overlay.types.ts +23 -0
  208. package/src/shared/types/screen.types.ts +5 -4
  209. package/src/shared/types/stack.types.ts +17 -1
  210. package/src/shared/utils/animation/start-screen-transition.ts +5 -2
  211. package/src/shared/utils/bounds/index.ts +35 -4
  212. package/lib/commonjs/native-stack/controllers/native-stack-lifecycle.js +0 -90
  213. package/lib/commonjs/native-stack/controllers/native-stack-lifecycle.js.map +0 -1
  214. package/lib/commonjs/shared/controller/managed-lifecycle.js +0 -78
  215. package/lib/commonjs/shared/controller/managed-lifecycle.js.map +0 -1
  216. package/lib/commonjs/shared/types/state.types.js +0 -9
  217. package/lib/commonjs/shared/types/state.types.js.map +0 -1
  218. package/lib/commonjs/shared/utils/read-shared-value.js +0 -17
  219. package/lib/commonjs/shared/utils/read-shared-value.js.map +0 -1
  220. package/lib/module/native-stack/controllers/native-stack-lifecycle.js +0 -83
  221. package/lib/module/native-stack/controllers/native-stack-lifecycle.js.map +0 -1
  222. package/lib/module/shared/controller/managed-lifecycle.js +0 -72
  223. package/lib/module/shared/controller/managed-lifecycle.js.map +0 -1
  224. package/lib/module/shared/types/state.types.js +0 -5
  225. package/lib/module/shared/types/state.types.js.map +0 -1
  226. package/lib/module/shared/utils/read-shared-value.js +0 -14
  227. package/lib/module/shared/utils/read-shared-value.js.map +0 -1
  228. package/lib/typescript/native-stack/controllers/native-stack-lifecycle.d.ts +0 -8
  229. package/lib/typescript/native-stack/controllers/native-stack-lifecycle.d.ts.map +0 -1
  230. package/lib/typescript/shared/controller/managed-lifecycle.d.ts +0 -9
  231. package/lib/typescript/shared/controller/managed-lifecycle.d.ts.map +0 -1
  232. package/lib/typescript/shared/types/state.types.d.ts +0 -3
  233. package/lib/typescript/shared/types/state.types.d.ts.map +0 -1
  234. package/lib/typescript/shared/utils/read-shared-value.d.ts +0 -7
  235. package/lib/typescript/shared/utils/read-shared-value.d.ts.map +0 -1
  236. package/src/native-stack/controllers/native-stack-lifecycle.tsx +0 -96
  237. package/src/shared/controller/managed-lifecycle.tsx +0 -73
  238. package/src/shared/types/state.types.ts +0 -2
  239. package/src/shared/utils/read-shared-value.ts +0 -15
@@ -15,8 +15,14 @@ export interface BaseStackRoute {
15
15
  * Both React Navigation helpers and ComponentNavigation satisfy this.
16
16
  */
17
17
  export interface BaseStackNavigation {
18
- getState: () => { routes: Array<{ key: string }>; key: string };
18
+ getState: () => {
19
+ routes: Array<{ key: string }>;
20
+ key: string;
21
+ index: number;
22
+ };
19
23
  dispatch: (action: any) => void;
24
+ addListener?: (event: any, callback: any) => () => void;
25
+ emit?: (event: any) => any;
20
26
  }
21
27
 
22
28
  /**
@@ -57,6 +63,16 @@ export interface BaseStackState<
57
63
  key: string;
58
64
  }
59
65
 
66
+ /**
67
+ * Generic descriptor map - keyed by route key.
68
+ * Use this instead of defining stack-specific DescriptorMap types.
69
+ */
70
+ export type DescriptorMap<
71
+ TDescriptor extends BaseStackDescriptor = BaseStackDescriptor,
72
+ > = {
73
+ [key: string]: TDescriptor;
74
+ };
75
+
60
76
  export enum StackType {
61
77
  NATIVE = "native",
62
78
  BLANK = "blank",
@@ -1,7 +1,7 @@
1
1
  import { runOnJS } from "react-native-reanimated";
2
+ import { FALSE, TRUE } from "../../constants";
2
3
  import type { AnimationStoreMap } from "../../stores/animation.store";
3
4
  import type { TransitionSpec } from "../../types/animation.types";
4
- import { FALSE, TRUE } from "../../types/state.types";
5
5
  import { animate } from "./animate";
6
6
 
7
7
  interface StartScreenTransitionProps {
@@ -32,10 +32,13 @@ export const startScreenTransition = ({
32
32
  ? { ...config, velocity: initialVelocity }
33
33
  : config;
34
34
 
35
- const { progress, animating, closing } = animations;
35
+ const { progress, animating, closing, entering } = animations;
36
36
 
37
37
  if (target === "close") {
38
38
  closing.set(TRUE);
39
+ entering.set(FALSE);
40
+ } else {
41
+ entering.set(TRUE);
39
42
  }
40
43
 
41
44
  if (!config) {
@@ -230,17 +230,48 @@ export const createBounds = (
230
230
  const interpolateBounds = (
231
231
  tag: string,
232
232
  property: keyof MeasuredDimensions,
233
+ fallbackOrTargetKey?: number | string,
233
234
  fallback?: number,
234
235
  ): number => {
235
236
  "worklet";
236
- const link = getLink(tag);
237
237
  const entering = !props.next;
238
238
  const range = entering ? ENTER_RANGE : EXIT_RANGE;
239
239
 
240
- const sourceValue = link?.source?.bounds?.[property] ?? fallback ?? 0;
241
- const destValue = link?.destination?.bounds?.[property] ?? fallback ?? 0;
240
+ // If third param is a string, it's a targetKey (snapshot approach)
241
+ if (typeof fallbackOrTargetKey === "string") {
242
+ const targetKey = fallbackOrTargetKey;
243
+ const currentKey = props.current?.route?.key;
244
+ const fb = fallback ?? 0;
245
+
246
+ const currentSnapshot = currentKey
247
+ ? BoundStore.getSnapshot(tag, currentKey)
248
+ : null;
249
+ const targetSnapshot = BoundStore.getSnapshot(tag, targetKey);
250
+
251
+ const currentValue = currentSnapshot?.bounds?.[property] ?? fb;
252
+ const targetValue = targetSnapshot?.bounds?.[property] ?? fb;
253
+
254
+ return interpolate(
255
+ props.progress,
256
+ range,
257
+ [targetValue, currentValue],
258
+ "clamp",
259
+ );
260
+ }
261
+
262
+ // Otherwise, use link approach (existing behavior)
263
+ const link = getLink(tag);
264
+ const fb = fallbackOrTargetKey ?? 0;
265
+
266
+ const sourceValue = link?.source?.bounds?.[property] ?? fb;
267
+ const destValue = link?.destination?.bounds?.[property] ?? fb;
242
268
 
243
- return interpolate(props.progress, range, [sourceValue, destValue], "clamp");
269
+ return interpolate(
270
+ props.progress,
271
+ range,
272
+ [sourceValue, destValue],
273
+ "clamp",
274
+ );
244
275
  };
245
276
 
246
277
  return Object.assign(boundsFunction, {
@@ -1,90 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.NativeStackScreenLifecycleController = void 0;
7
- var _react = require("react");
8
- var _reactNativeReanimated = require("react-native-reanimated");
9
- var _useHighRefreshRate = require("../../shared/hooks/animation/use-high-refresh-rate");
10
- var _useSharedValueState = require("../../shared/hooks/reanimated/use-shared-value-state");
11
- var _useStableCallback = _interopRequireDefault(require("../../shared/hooks/use-stable-callback"));
12
- var _gestures = require("../../shared/providers/gestures.provider");
13
- var _keys = require("../../shared/providers/screen/keys.provider");
14
- var _animation = require("../../shared/stores/animation.store");
15
- var _state = require("../../shared/types/state.types");
16
- var _startScreenTransition = require("../../shared/utils/animation/start-screen-transition");
17
- var _resetStoresForScreen = require("../../shared/utils/reset-stores-for-screen");
18
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
19
- /** biome-ignore-all lint/style/noNonNullAssertion: <Lifecycles are rendered right under the gesture provider> */
20
-
21
- /**
22
- * Lifecycle controller built out for Native Stack implementation.
23
- */
24
- const NativeStackScreenLifecycleController = ({
25
- children
26
- }) => {
27
- const {
28
- current
29
- } = (0, _keys.useKeys)();
30
- const {
31
- ancestorContext
32
- } = (0, _gestures.useGestureContext)();
33
- const isAncestorDismissingViaGesture = (0, _useSharedValueState.useSharedValueState)((0, _reactNativeReanimated.useDerivedValue)(() => {
34
- "worklet";
35
-
36
- return ancestorContext?.gestureAnimationValues.isDismissing?.value ?? false;
37
- }));
38
- const animations = _animation.AnimationStore.getAll(current.route.key);
39
- const {
40
- deactivateHighRefreshRate,
41
- activateHighRefreshRate
42
- } = (0, _useHighRefreshRate.useHighRefreshRate)(current);
43
- const handleBeforeRemove = (0, _useStableCallback.default)(e => {
44
- const isEnabled = current.options.enableTransitions;
45
- const isFirstScreen = current.navigation.getState().index === 0;
46
-
47
- // If transitions are disabled, or an ancestor is dismissing via gesture, or this is the first screen of the stack, reset the stores
48
- if (!isEnabled || isAncestorDismissingViaGesture || isFirstScreen) {
49
- animations.closing.set(_state.TRUE);
50
- (0, _resetStoresForScreen.resetStoresForScreen)(current);
51
- return;
52
- }
53
- e.preventDefault();
54
- activateHighRefreshRate();
55
- const onAnimationFinish = finished => {
56
- deactivateHighRefreshRate();
57
- if (finished) {
58
- current.navigation.dispatch(e.data.action);
59
-
60
- // we'll ensure the dispatch is complete before resetting stores
61
- requestAnimationFrame(() => {
62
- (0, _resetStoresForScreen.resetStoresForScreen)(current);
63
- });
64
- }
65
- };
66
- (0, _startScreenTransition.startScreenTransition)({
67
- target: "close",
68
- spec: current.options.transitionSpec,
69
- onAnimationFinish,
70
- animations
71
- });
72
- });
73
- const handleInitialize = (0, _useStableCallback.default)(() => {
74
- activateHighRefreshRate();
75
- (0, _startScreenTransition.startScreenTransition)({
76
- target: "open",
77
- spec: current.options.transitionSpec,
78
- animations,
79
- onAnimationFinish: deactivateHighRefreshRate
80
- });
81
- });
82
- (0, _react.useEffect)(() => {
83
- const unsubscribe = current.navigation.addListener("beforeRemove", handleBeforeRemove);
84
- return unsubscribe;
85
- }, [current.navigation, handleBeforeRemove]);
86
- (0, _react.useLayoutEffect)(handleInitialize, []);
87
- return children;
88
- };
89
- exports.NativeStackScreenLifecycleController = NativeStackScreenLifecycleController;
90
- //# sourceMappingURL=native-stack-lifecycle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_react","require","_reactNativeReanimated","_useHighRefreshRate","_useSharedValueState","_useStableCallback","_interopRequireDefault","_gestures","_keys","_animation","_state","_startScreenTransition","_resetStoresForScreen","e","__esModule","default","NativeStackScreenLifecycleController","children","current","useKeys","ancestorContext","useGestureContext","isAncestorDismissingViaGesture","useSharedValueState","useDerivedValue","gestureAnimationValues","isDismissing","value","animations","AnimationStore","getAll","route","key","deactivateHighRefreshRate","activateHighRefreshRate","useHighRefreshRate","handleBeforeRemove","useStableCallback","isEnabled","options","enableTransitions","isFirstScreen","navigation","getState","index","closing","set","TRUE","resetStoresForScreen","preventDefault","onAnimationFinish","finished","dispatch","data","action","requestAnimationFrame","startScreenTransition","target","spec","transitionSpec","handleInitialize","useEffect","unsubscribe","addListener","useLayoutEffect","exports"],"sourceRoot":"../../../../src","sources":["native-stack/controllers/native-stack-lifecycle.tsx"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,sBAAA,GAAAD,OAAA;AACA,IAAAE,mBAAA,GAAAF,OAAA;AACA,IAAAG,oBAAA,GAAAH,OAAA;AACA,IAAAI,kBAAA,GAAAC,sBAAA,CAAAL,OAAA;A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strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.ManagedLifecycle = void 0;
7
- var _react = require("react");
8
- var _reactNativeReanimated = require("react-native-reanimated");
9
- var _useHighRefreshRate = require("../hooks/animation/use-high-refresh-rate");
10
- var _useStableCallback = _interopRequireDefault(require("../hooks/use-stable-callback"));
11
- var _keys = require("../providers/screen/keys.provider");
12
- var _managed = require("../providers/stack/managed.provider");
13
- var _animation = require("../stores/animation.store");
14
- var _startScreenTransition = require("../utils/animation/start-screen-transition");
15
- var _resetStoresForScreen = require("../utils/reset-stores-for-screen");
16
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17
- /**
18
- * Lifecycle controller built out for Blank Stack implementation.
19
- */
20
- const ManagedLifecycle = ({
21
- children
22
- }) => {
23
- const {
24
- current
25
- } = (0, _keys.useKeys)();
26
- const {
27
- handleCloseRoute,
28
- closingRouteKeysShared
29
- } = (0, _managed.useManagedStackContext)();
30
- const animations = _animation.AnimationStore.getAll(current.route.key);
31
- const {
32
- deactivateHighRefreshRate,
33
- activateHighRefreshRate
34
- } = (0, _useHighRefreshRate.useHighRefreshRate)(current);
35
- const handleInitialize = (0, _useStableCallback.default)(() => {
36
- activateHighRefreshRate();
37
- (0, _startScreenTransition.startScreenTransition)({
38
- target: "open",
39
- spec: current.options.transitionSpec,
40
- animations,
41
- onAnimationFinish: deactivateHighRefreshRate
42
- });
43
- });
44
- const handleCloseEnd = (0, _useStableCallback.default)(finished => {
45
- if (!finished) {
46
- return;
47
- }
48
- handleCloseRoute({
49
- route: current.route
50
- });
51
- requestAnimationFrame(() => {
52
- deactivateHighRefreshRate();
53
- (0, _resetStoresForScreen.resetStoresForScreen)(current);
54
- });
55
- });
56
- (0, _reactNativeReanimated.useAnimatedReaction)(() => ({
57
- keys: closingRouteKeysShared.value
58
- }), ({
59
- keys
60
- }) => {
61
- if (!keys.includes(current.route.key)) {
62
- return;
63
- }
64
- (0, _reactNativeReanimated.runOnJS)(activateHighRefreshRate)();
65
- (0, _startScreenTransition.startScreenTransition)({
66
- target: "close",
67
- spec: current.options.transitionSpec,
68
- animations,
69
- onAnimationFinish: handleCloseEnd
70
- });
71
- });
72
- (0, _react.useLayoutEffect)(() => {
73
- handleInitialize();
74
- }, [handleInitialize]);
75
- return children;
76
- };
77
- exports.ManagedLifecycle = ManagedLifecycle;
78
- //# sourceMappingURL=managed-lifecycle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_react","require","_reactNativeReanimated","_useHighRefreshRate","_useStableCallback","_interopRequireDefault","_keys","_managed","_animation","_startScreenTransition","_resetStoresForScreen","e","__esModule","default","ManagedLifecycle","children","current","useKeys","handleCloseRoute","closingRouteKeysShared","useManagedStackContext","animations","AnimationStore","getAll","route","key","deactivateHighRefreshRate","activateHighRefreshRate","useHighRefreshRate","handleInitialize","useStableCallback","startScreenTransition","target","spec","options","transitionSpec","onAnimationFinish","handleCloseEnd","finished","requestAnimationFrame","resetStoresForScreen","useAnimatedReaction","keys","value","includes","runOnJS","useLayoutEffect","exports"],"sourceRoot":"../../../../src","sources":["shared/controller/managed-lifecycle.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,sBAAA,GAAAD,OAAA;AAEA,IAAAE,mBAAA,GAAAF,OAAA;AACA,IAAAG,kBAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,UAAA,GAAAP,OAAA;AACA,IAAAQ,sBAAA,GAAAR,OAAA;AACA,IAAAS,qBAAA,GAAAT,OAAA;AAAwE,SAAAI,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAMxE;AACA;AACA;AACO,MAAMG,gBAAgB,GAAGA,CAAC;EAAEC;AAAgB,CAAC,KAAK;EACxD,MAAM;IAAEC;EAA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AAO,CAACkB,OAAO,CAACC,cAAc;MACpCd,UAAU;MACVe,iBAAiB,EAAEC;IACpB,CAAC,CAAC;EACH,CACD,CAAC;EAED,IAAAS,sBAAe,EAAC,MAAM;IACrBjB,gBAAgB,CAAC,CAAC;EACnB,CAAC,EAAE,CAACA,gBAAgB,CAAC,CAAC;EAEtB,OAAOd,QAAQ;AAChB,CAAC;AAACgC,OAAA,CAAAjC,gBAAA,GAAAA,gBAAA","ignoreList":[]}
@@ -1,9 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.TRUE = exports.FALSE = void 0;
7
- const TRUE = exports.TRUE = 1;
8
- const FALSE = exports.FALSE = 0;
9
- //# sourceMappingURL=state.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["TRUE","exports","FALSE"],"sourceRoot":"../../../../src","sources":["shared/types/state.types.ts"],"mappings":";;;;;;AAAO,MAAMA,IAAI,GAAAC,OAAA,CAAAD,IAAA,GAAG,CAAC;AACd,MAAME,KAAK,GAAAD,OAAA,CAAAC,KAAA,GAAG,CAAC","ignoreList":[]}
@@ -1,17 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.readSharedValue = void 0;
7
- var _reactNativeReanimated = require("react-native-reanimated");
8
- /**
9
- * Safely read a SharedValue from the UI thread.
10
- * Avoids the "cannot read .value inside component render" warning.
11
- */
12
- const readSharedValue = exports.readSharedValue = (0, _reactNativeReanimated.executeOnUIRuntimeSync)(sv => {
13
- "worklet";
14
-
15
- return sv.value;
16
- });
17
- //# sourceMappingURL=read-shared-value.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_reactNativeReanimated","require","readSharedValue","exports","executeOnUIRuntimeSync","sv","value"],"sourceRoot":"../../../../src","sources":["shared/utils/read-shared-value.ts"],"mappings":";;;;;;AAAA,IAAAA,sBAAA,GAAAC,OAAA;AAKA;AACA;AACA;AACA;AACO,MAAMC,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAG,IAAAE,6CAAsB,EAChDC,EAAkB,IAAQ;EAC7B,SAAS;;EACT,OAAOA,EAAE,CAACC,KAAK;AAChB,CACD,CAAC","ignoreList":[]}
@@ -1,83 +0,0 @@
1
- "use strict";
2
-
3
- /** biome-ignore-all lint/style/noNonNullAssertion: <Lifecycles are rendered right under the gesture provider> */
4
- import { useEffect, useLayoutEffect } from "react";
5
- import { useDerivedValue } from "react-native-reanimated";
6
- import { useHighRefreshRate } from "../../shared/hooks/animation/use-high-refresh-rate";
7
- import { useSharedValueState } from "../../shared/hooks/reanimated/use-shared-value-state";
8
- import useStableCallback from "../../shared/hooks/use-stable-callback";
9
- import { useGestureContext } from "../../shared/providers/gestures.provider";
10
- import { useKeys } from "../../shared/providers/screen/keys.provider";
11
- import { AnimationStore } from "../../shared/stores/animation.store";
12
- import { TRUE } from "../../shared/types/state.types";
13
- import { startScreenTransition } from "../../shared/utils/animation/start-screen-transition";
14
- import { resetStoresForScreen } from "../../shared/utils/reset-stores-for-screen";
15
- /**
16
- * Lifecycle controller built out for Native Stack implementation.
17
- */
18
- export const NativeStackScreenLifecycleController = ({
19
- children
20
- }) => {
21
- const {
22
- current
23
- } = useKeys();
24
- const {
25
- ancestorContext
26
- } = useGestureContext();
27
- const isAncestorDismissingViaGesture = useSharedValueState(useDerivedValue(() => {
28
- "worklet";
29
-
30
- return ancestorContext?.gestureAnimationValues.isDismissing?.value ?? false;
31
- }));
32
- const animations = AnimationStore.getAll(current.route.key);
33
- const {
34
- deactivateHighRefreshRate,
35
- activateHighRefreshRate
36
- } = useHighRefreshRate(current);
37
- const handleBeforeRemove = useStableCallback(e => {
38
- const isEnabled = current.options.enableTransitions;
39
- const isFirstScreen = current.navigation.getState().index === 0;
40
-
41
- // If transitions are disabled, or an ancestor is dismissing via gesture, or this is the first screen of the stack, reset the stores
42
- if (!isEnabled || isAncestorDismissingViaGesture || isFirstScreen) {
43
- animations.closing.set(TRUE);
44
- resetStoresForScreen(current);
45
- return;
46
- }
47
- e.preventDefault();
48
- activateHighRefreshRate();
49
- const onAnimationFinish = finished => {
50
- deactivateHighRefreshRate();
51
- if (finished) {
52
- current.navigation.dispatch(e.data.action);
53
-
54
- // we'll ensure the dispatch is complete before resetting stores
55
- requestAnimationFrame(() => {
56
- resetStoresForScreen(current);
57
- });
58
- }
59
- };
60
- startScreenTransition({
61
- target: "close",
62
- spec: current.options.transitionSpec,
63
- onAnimationFinish,
64
- animations
65
- });
66
- });
67
- const handleInitialize = useStableCallback(() => {
68
- activateHighRefreshRate();
69
- startScreenTransition({
70
- target: "open",
71
- spec: current.options.transitionSpec,
72
- animations,
73
- onAnimationFinish: deactivateHighRefreshRate
74
- });
75
- });
76
- useEffect(() => {
77
- const unsubscribe = current.navigation.addListener("beforeRemove", handleBeforeRemove);
78
- return unsubscribe;
79
- }, [current.navigation, handleBeforeRemove]);
80
- useLayoutEffect(handleInitialize, []);
81
- return children;
82
- };
83
- //# sourceMappingURL=native-stack-lifecycle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["useEffect","useLayoutEffect","useDerivedValue","useHighRefreshRate","useSharedValueState","useStableCallback","useGestureContext","useKeys","AnimationStore","TRUE","startScreenTransition","resetStoresForScreen","NativeStackScreenLifecycleController","children","current","ancestorContext","isAncestorDismissingViaGesture","gestureAnimationValues","isDismissing","value","animations","getAll","route","key","deactivateHighRefreshRate","activateHighRefreshRate","handleBeforeRemove","e","isEnabled","options","enableTransitions","isFirstScreen","navigation","getState","index","closing","set","preventDefault","onAnimationFinish","finished","dispatch","data","action","requestAnimationFrame","target","spec","transitionSpec","handleInitialize","unsubscribe","addListener"],"sourceRoot":"../../../../src","sources":["native-stack/controllers/native-stack-lifecycle.tsx"],"mappings":";;AAAA;AACA,SAASA,SAAS,EAAEC,eAAe,QAAQ,OAAO;AAClD,SAASC,eAAe,QAAQ,yBAAyB;AACzD,SAASC,kBAAkB,QAAQ,oDAAoD;AACvF,SAASC,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AAc,CAAC,CAAC;IAClBZ,uBAAuB,CAAC,CAAC;IACzB,MAAMa,iBAAiB,GAAIC,QAAiB,IAAK;MAChDf,yBAAyB,CAAC,CAAC;MAC3B,IAAIe,QAAQ,EAAE;QACbzB,OAAO,CAACkB,UAAU,CAACQ,QAAQ,CAACb,CAAC,CAACc,IAAI,CAACC,MAAM,CAAC;;QAE1C;QACAC,qBAAqB,CAAC,MAAM;UAC3BhC,oBAAoB,CAACG,OAAO,CAAC;QAC9B,CAAC,CAAC;MACH;IACD,CAAC;IAEDJ,qBAAqB,CAAC;MACrBkC,MAAM,EAAE,OAAO;MACfC,IAAI,EAAE/B,OAAO,CAACe,OAAO,CAACiB,cAAc;MACpCR,iBAAiB;MACjBlB;IACD,CAAC,CAAC;EACH,CAAC,CAAC;EAEF,MAAM2B,gBAAgB,GAAG1C,iBAAiB,CAAC,MAAM;IAChDoB,uBAAuB,CAAC,CAAC;IACzBf,qBAAqB,CAAC;MACrBkC,MAAM,EAAE,MAAM;MACdC,IAAI,EAAE/B,OAAO,CAACe,OAAO,CAACiB,cAAc;MACpC1B,UAAU;MACVkB,iBAAiB,EAAEd;IACpB,CAAC,CAAC;EACH,CAAC,CAAC;EAEFxB,SAAS,CAAC,MAAM;IACf,MAAMgD,WAAW,GAAGlC,OAAO,CAACkB,UAAU,CAACiB,WAAW,CACjD,cAAc,EACdvB,kBACD,CAAC;IAED,OAAOsB,WAAW;EACnB,CAAC,EAAE,CAAClC,OAAO,CAACkB,UAAU,EAAEN,kBAAkB,CAAC,CAAC;EAE5CzB,eAAe,CAAC8C,gBAAgB,EAAE,EAAE,CAAC;EAErC,OAAOlC,QAAQ;AAChB,CAAC","ignoreList":[]}
@@ -1,72 +0,0 @@
1
- "use strict";
2
-
3
- import { useLayoutEffect } from "react";
4
- import { runOnJS, useAnimatedReaction } from "react-native-reanimated";
5
- import { useHighRefreshRate } from "../hooks/animation/use-high-refresh-rate";
6
- import useStableCallback from "../hooks/use-stable-callback";
7
- import { useKeys } from "../providers/screen/keys.provider";
8
- import { useManagedStackContext } from "../providers/stack/managed.provider";
9
- import { AnimationStore } from "../stores/animation.store";
10
- import { startScreenTransition } from "../utils/animation/start-screen-transition";
11
- import { resetStoresForScreen } from "../utils/reset-stores-for-screen";
12
- /**
13
- * Lifecycle controller built out for Blank Stack implementation.
14
- */
15
- export const ManagedLifecycle = ({
16
- children
17
- }) => {
18
- const {
19
- current
20
- } = useKeys();
21
- const {
22
- handleCloseRoute,
23
- closingRouteKeysShared
24
- } = useManagedStackContext();
25
- const animations = AnimationStore.getAll(current.route.key);
26
- const {
27
- deactivateHighRefreshRate,
28
- activateHighRefreshRate
29
- } = useHighRefreshRate(current);
30
- const handleInitialize = useStableCallback(() => {
31
- activateHighRefreshRate();
32
- startScreenTransition({
33
- target: "open",
34
- spec: current.options.transitionSpec,
35
- animations,
36
- onAnimationFinish: deactivateHighRefreshRate
37
- });
38
- });
39
- const handleCloseEnd = useStableCallback(finished => {
40
- if (!finished) {
41
- return;
42
- }
43
- handleCloseRoute({
44
- route: current.route
45
- });
46
- requestAnimationFrame(() => {
47
- deactivateHighRefreshRate();
48
- resetStoresForScreen(current);
49
- });
50
- });
51
- useAnimatedReaction(() => ({
52
- keys: closingRouteKeysShared.value
53
- }), ({
54
- keys
55
- }) => {
56
- if (!keys.includes(current.route.key)) {
57
- return;
58
- }
59
- runOnJS(activateHighRefreshRate)();
60
- startScreenTransition({
61
- target: "close",
62
- spec: current.options.transitionSpec,
63
- animations,
64
- onAnimationFinish: handleCloseEnd
65
- });
66
- });
67
- useLayoutEffect(() => {
68
- handleInitialize();
69
- }, [handleInitialize]);
70
- return children;
71
- };
72
- //# sourceMappingURL=managed-lifecycle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["useLayoutEffect","runOnJS","useAnimatedReaction","useHighRefreshRate","useStableCallback","useKeys","useManagedStackContext","AnimationStore","startScreenTransition","resetStoresForScreen","ManagedLifecycle","children","current","handleCloseRoute","closingRouteKeysShared","animations","getAll","route","key","deactivateHighRefreshRate","activateHighRefreshRate","handleInitialize","target","spec","options","transitionSpec","onAnimationFinish","handleCloseEnd","finished","requestAnimationFrame","keys","value","includes"],"sourceRoot":"../../../../src","sources":["shared/controller/managed-lifecycle.tsx"],"mappings":";;AAAA,SAASA,eAAe,QAAQ,OAAO;AACvC,SAASC,OAAO,EAAEC,mBAAmB,QAAQ,yBAAyB;AAEtE,SAASC,kBAAkB,QAAQ,0CAA0C;AAC7E,OAAOC,iBAAiB,MAAM,8BAA8B;AAC5D,SAASC,OAAO,QAAQ,mCAAmC;AAC3D,SAASC,sBAAsB,QAAQ,qCAAqC;AAC5E,SAASC,cAAc,QAAQ,2BAA2B;AAC1D,SAASC,qBAAqB,QAAQ,4CAA4C;AAClF,SAASC,oBAAoB,QAAQ,kCAAkC;AAMvE;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,GAAGA,CAAC;EAAEC;AAAgB,CAAC,KAAK;EACxD,MAAM;IAAEC;EAAQ,CAAC,GAAGP,OAAO,CAAuB,CAAC;EACnD,MAAM;IAAEQ,gBAAgB;IAAEC;EAAuB,CAAC,GAAGR,sBAAsB,CAAC,CAAC;EAE7E,MAAMS,UAAU,GAAGR,cAAc,CAACS,MAAM,CAACJ,OAAO,CAACK,KAAK,CAACC,GAAG,CAAC;EAE3D,MAAM;IAAEC,yBAAyB;IAAEC;EAAwB,CAAC,GAC3DjB,kBAAkB,CAACS,OAAO,CAAC;EAE5B,MAAMS,gBAAgB,GAAGjB,iBAAiB,CAAC,MAAM;IAChDgB,uBAAuB,CAAC,CAAC;IACzBZ,qBAAqB,CAAC;MACrBc,MAAM,EAAE,MAAM;MACdC,IAAI,EAAEX,OAAO,CAACY,OAAO,CAACC,cAAc;MACpCV,UAAU;MACVW,iBAAiB,EAAEP;IACpB,CAAC,CAAC;EACH,CAAC,CAAC;EAEF,MAAMQ,cAAc,GAAGvB,iBAAiB,CAAEwB,QAAiB,IAAK;IAC/D,IAAI,CAACA,QAAQ,EAAE;MACd;IACD;IACAf,gBAAgB,CAAC;MAAEI,KAAK,EAAEL,OAAO,CAACK;IAAM,CAAC,CAAC;IAC1CY,qBAAqB,CAAC,MAAM;MAC3BV,yBAAyB,CAAC,CAAC;MAC3BV,oBAAoB,CAACG,OAAO,CAAC;IAC9B,CAAC,CAAC;EACH,CAAC,CAAC;EAEFV,mBAAmB,CAClB,OAAO;IACN4B,IAAI,EAAEhB,sBAAsB,CAACiB;EAC9B,CAAC,CAAC,EACF,CAAC;IAAED;EAAK,CAAC,KAAK;IACb,IAAI,CAACA,IAAI,CAACE,QAAQ,CAACpB,OAAO,CAACK,KAAK,CAACC,GAAG,CAAC,EAAE;MACtC;IACD;IAEAjB,OAAO,CAACmB,uBAAuB,CAAC,CAAC,CAAC;IAClCZ,qBAAqB,CAAC;MACrBc,MAAM,EAAE,OAAO;MACfC,IAAI,EAAEX,OAAO,CAACY,OAAO,CAACC,cAAc;MACpCV,UAAU;MACVW,iBAAiB,EAAEC;IACpB,CAAC,CAAC;EACH,CACD,CAAC;EAED3B,eAAe,CAAC,MAAM;IACrBqB,gBAAgB,CAAC,CAAC;EACnB,CAAC,EAAE,CAACA,gBAAgB,CAAC,CAAC;EAEtB,OAAOV,QAAQ;AAChB,CAAC","ignoreList":[]}
@@ -1,5 +0,0 @@
1
- "use strict";
2
-
3
- export const TRUE = 1;
4
- export const FALSE = 0;
5
- //# sourceMappingURL=state.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["TRUE","FALSE"],"sourceRoot":"../../../../src","sources":["shared/types/state.types.ts"],"mappings":";;AAAA,OAAO,MAAMA,IAAI,GAAG,CAAC;AACrB,OAAO,MAAMC,KAAK,GAAG,CAAC","ignoreList":[]}
@@ -1,14 +0,0 @@
1
- "use strict";
2
-
3
- import { executeOnUIRuntimeSync } from "react-native-reanimated";
4
-
5
- /**
6
- * Safely read a SharedValue from the UI thread.
7
- * Avoids the "cannot read .value inside component render" warning.
8
- */
9
- export const readSharedValue = executeOnUIRuntimeSync(sv => {
10
- "worklet";
11
-
12
- return sv.value;
13
- });
14
- //# sourceMappingURL=read-shared-value.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["executeOnUIRuntimeSync","readSharedValue","sv","value"],"sourceRoot":"../../../../src","sources":["shared/utils/read-shared-value.ts"],"mappings":";;AAAA,SACCA,sBAAsB,QAEhB,yBAAyB;;AAEhC;AACA;AACA;AACA;AACA,OAAO,MAAMC,eAAe,GAAGD,sBAAsB,CAChDE,EAAkB,IAAQ;EAC7B,SAAS;;EACT,OAAOA,EAAE,CAACC,KAAK;AAChB,CACD,CAAC","ignoreList":[]}
@@ -1,8 +0,0 @@
1
- export interface Props {
2
- children: React.ReactNode;
3
- }
4
- /**
5
- * Lifecycle controller built out for Native Stack implementation.
6
- */
7
- export declare const NativeStackScreenLifecycleController: ({ children }: Props) => import("react").ReactNode;
8
- //# sourceMappingURL=native-stack-lifecycle.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"native-stack-lifecycle.d.ts","sourceRoot":"","sources":["../../../../src/native-stack/controllers/native-stack-lifecycle.tsx"],"names":[],"mappings":"AAcA,MAAM,WAAW,KAAK;IACrB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B;AAED;;GAEG;AACH,eAAO,MAAM,oCAAoC,GAAI,cAAc,KAAK,8BA0EvE,CAAC"}
@@ -1,9 +0,0 @@
1
- interface Props {
2
- children: React.ReactNode;
3
- }
4
- /**
5
- * Lifecycle controller built out for Blank Stack implementation.
6
- */
7
- export declare const ManagedLifecycle: ({ children }: Props) => import("react").ReactNode;
8
- export {};
9
- //# sourceMappingURL=managed-lifecycle.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"managed-lifecycle.d.ts","sourceRoot":"","sources":["../../../../src/shared/controller/managed-lifecycle.tsx"],"names":[],"mappings":"AAWA,UAAU,KAAK;IACd,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B;AAED;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAAI,cAAc,KAAK,8BAsDnD,CAAC"}
@@ -1,3 +0,0 @@
1
- export declare const TRUE = 1;
2
- export declare const FALSE = 0;
3
- //# sourceMappingURL=state.types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"state.types.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/state.types.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI,IAAI,CAAC;AACtB,eAAO,MAAM,KAAK,IAAI,CAAC"}
@@ -1,7 +0,0 @@
1
- import { type SharedValue } from "react-native-reanimated";
2
- /**
3
- * Safely read a SharedValue from the UI thread.
4
- * Avoids the "cannot read .value inside component render" warning.
5
- */
6
- export declare const readSharedValue: <T>(sv: SharedValue<T>) => T;
7
- //# sourceMappingURL=read-shared-value.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"read-shared-value.d.ts","sourceRoot":"","sources":["../../../../src/shared/utils/read-shared-value.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,KAAK,WAAW,EAChB,MAAM,yBAAyB,CAAC;AAEjC;;;GAGG;AACH,eAAO,MAAM,eAAe,GAC1B,CAAC,0BAIF,CAAC"}