react-native-smooth-clip-view 0.2.9 → 0.4.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 (193) hide show
  1. package/README.md +132 -349
  2. package/android/build.gradle +8 -4
  3. package/android/proguard-rules.pro +3 -3
  4. package/android/src/main/cpp/SmoothClipAndroid.h +13 -6
  5. package/android/src/main/cpp/SmoothClipBindings.cpp +605 -123
  6. package/android/src/main/cpp/SmoothClipRegistry.cpp +975 -209
  7. package/android/src/main/java/com/smoothclipview/ClipGeometryNormalizer.kt +192 -118
  8. package/android/src/main/java/com/smoothclipview/SmoothClipBindings.kt +22 -4
  9. package/android/src/main/java/com/smoothclipview/SmoothClipModule.kt +81 -56
  10. package/android/src/main/java/com/smoothclipview/SmoothClipView.kt +449 -240
  11. package/android/src/main/java/com/smoothclipview/SmoothClipViewManager.kt +150 -38
  12. package/cpp/SmoothClipAnimationCurve.h +317 -397
  13. package/cpp/SmoothClipRegistry.h +84 -20
  14. package/cpp/SmoothClipSharedGeometry.h +131 -22
  15. package/cpp/SmoothClipVelocityTracker.h +16 -12
  16. package/ios/SmoothClipGeometry.h +188 -21
  17. package/ios/SmoothClipRegistry.mm +869 -368
  18. package/ios/SmoothClipRegistrySnapshot.h +13 -0
  19. package/ios/SmoothClipTurboModule.cpp +513 -156
  20. package/ios/SmoothClipTurboModule.h +123 -56
  21. package/ios/SmoothClipView.mm +1074 -449
  22. package/ios/SmoothClipViewRegistry.h +3 -7
  23. package/ios/reactnativesmoothclipview.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  24. package/ios/reactnativesmoothclipview.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  25. package/lib/module/NativeSmoothClipModule.js.map +1 -1
  26. package/lib/module/SmoothClipView.ios.js +94 -11
  27. package/lib/module/SmoothClipView.ios.js.map +1 -1
  28. package/lib/module/SmoothClipView.js +1 -46
  29. package/lib/module/SmoothClipView.js.map +1 -1
  30. package/lib/module/SmoothClipViewNativeComponent.ts +32 -12
  31. package/lib/module/capabilities.js +4 -0
  32. package/lib/module/capabilities.js.map +1 -0
  33. package/lib/module/capabilities.native.js +18 -0
  34. package/lib/module/capabilities.native.js.map +1 -0
  35. package/lib/module/capabilityTypes.js +2 -0
  36. package/lib/module/capabilityTypes.js.map +1 -0
  37. package/lib/module/controllerInternals.js +28 -0
  38. package/lib/module/controllerInternals.js.map +1 -0
  39. package/lib/module/controllerLifecycle.js +9 -0
  40. package/lib/module/controllerLifecycle.js.map +1 -0
  41. package/lib/module/controllerTypes.js +4 -0
  42. package/lib/module/controllerTypes.js.map +1 -0
  43. package/lib/module/controllers.android.js +4 -0
  44. package/lib/module/controllers.android.js.map +1 -0
  45. package/lib/module/controllers.ios.js +4 -0
  46. package/lib/module/controllers.ios.js.map +1 -0
  47. package/lib/module/controllers.js +4 -0
  48. package/lib/module/controllers.js.map +1 -0
  49. package/lib/module/controllers.native.js +89 -0
  50. package/lib/module/controllers.native.js.map +1 -0
  51. package/lib/module/geometry.js +180 -30
  52. package/lib/module/geometry.js.map +1 -1
  53. package/lib/module/groupTypes.js +4 -0
  54. package/lib/module/groupTypes.js.map +1 -0
  55. package/lib/module/groups.android.js +4 -0
  56. package/lib/module/groups.android.js.map +1 -0
  57. package/lib/module/groups.ios.js +4 -0
  58. package/lib/module/groups.ios.js.map +1 -0
  59. package/lib/module/groups.js +4 -0
  60. package/lib/module/groups.js.map +1 -0
  61. package/lib/module/groups.native.js +399 -0
  62. package/lib/module/groups.native.js.map +1 -0
  63. package/lib/module/ids.js +8 -0
  64. package/lib/module/ids.js.map +1 -0
  65. package/lib/module/index.js +4 -3
  66. package/lib/module/index.js.map +1 -1
  67. package/lib/module/nativeCompletion.js +37 -16
  68. package/lib/module/nativeCompletion.js.map +1 -1
  69. package/lib/module/presentationCodec.js +81 -0
  70. package/lib/module/presentationCodec.js.map +1 -0
  71. package/lib/typescript/src/NativeSmoothClipModule.d.ts +20 -4
  72. package/lib/typescript/src/NativeSmoothClipModule.d.ts.map +1 -1
  73. package/lib/typescript/src/SmoothClipView.d.ts +2 -10
  74. package/lib/typescript/src/SmoothClipView.d.ts.map +1 -1
  75. package/lib/typescript/src/SmoothClipView.ios.d.ts +139 -4
  76. package/lib/typescript/src/SmoothClipView.ios.d.ts.map +1 -1
  77. package/lib/typescript/src/SmoothClipViewNativeComponent.d.ts +16 -3
  78. package/lib/typescript/src/SmoothClipViewNativeComponent.d.ts.map +1 -1
  79. package/lib/typescript/src/capabilities.d.ts +3 -0
  80. package/lib/typescript/src/capabilities.d.ts.map +1 -0
  81. package/lib/typescript/src/capabilities.native.d.ts +3 -0
  82. package/lib/typescript/src/capabilities.native.d.ts.map +1 -0
  83. package/lib/typescript/src/capabilityTypes.d.ts +4 -0
  84. package/lib/typescript/src/capabilityTypes.d.ts.map +1 -0
  85. package/lib/typescript/src/controllerInternals.d.ts +14 -0
  86. package/lib/typescript/src/controllerInternals.d.ts.map +1 -0
  87. package/lib/typescript/src/controllerLifecycle.d.ts +3 -0
  88. package/lib/typescript/src/controllerLifecycle.d.ts.map +1 -0
  89. package/lib/typescript/src/controllerTypes.d.ts +62 -0
  90. package/lib/typescript/src/controllerTypes.d.ts.map +1 -0
  91. package/lib/typescript/src/controllers.android.d.ts +2 -0
  92. package/lib/typescript/src/controllers.android.d.ts.map +1 -0
  93. package/lib/typescript/src/controllers.d.ts +2 -0
  94. package/lib/typescript/src/controllers.d.ts.map +1 -0
  95. package/lib/typescript/src/controllers.ios.d.ts +2 -0
  96. package/lib/typescript/src/controllers.ios.d.ts.map +1 -0
  97. package/lib/typescript/src/controllers.native.d.ts +3 -0
  98. package/lib/typescript/src/controllers.native.d.ts.map +1 -0
  99. package/lib/typescript/src/geometry.d.ts +49 -5
  100. package/lib/typescript/src/geometry.d.ts.map +1 -1
  101. package/lib/typescript/src/groupTypes.d.ts +31 -0
  102. package/lib/typescript/src/groupTypes.d.ts.map +1 -0
  103. package/lib/typescript/src/groups.android.d.ts +2 -0
  104. package/lib/typescript/src/groups.android.d.ts.map +1 -0
  105. package/lib/typescript/src/groups.d.ts +2 -0
  106. package/lib/typescript/src/groups.d.ts.map +1 -0
  107. package/lib/typescript/src/groups.ios.d.ts +2 -0
  108. package/lib/typescript/src/groups.ios.d.ts.map +1 -0
  109. package/lib/typescript/src/groups.native.d.ts +3 -0
  110. package/lib/typescript/src/groups.native.d.ts.map +1 -0
  111. package/lib/typescript/src/ids.d.ts +2 -0
  112. package/lib/typescript/src/ids.d.ts.map +1 -0
  113. package/lib/typescript/src/index.d.ts +8 -5
  114. package/lib/typescript/src/index.d.ts.map +1 -1
  115. package/lib/typescript/src/nativeCompletion.d.ts +16 -6
  116. package/lib/typescript/src/nativeCompletion.d.ts.map +1 -1
  117. package/lib/typescript/src/presentationCodec.d.ts +10 -0
  118. package/lib/typescript/src/presentationCodec.d.ts.map +1 -0
  119. package/package.json +17 -13
  120. package/src/NativeSmoothClipModule.ts +80 -56
  121. package/src/SmoothClipView.ios.tsx +142 -16
  122. package/src/SmoothClipView.tsx +6 -76
  123. package/src/SmoothClipViewNativeComponent.ts +32 -12
  124. package/src/capabilities.native.ts +19 -0
  125. package/src/capabilities.ts +2 -0
  126. package/src/capabilityTypes.ts +3 -0
  127. package/src/controllerInternals.ts +52 -0
  128. package/src/controllerLifecycle.ts +6 -0
  129. package/src/controllerTypes.ts +87 -0
  130. package/src/controllers.android.ts +1 -0
  131. package/src/controllers.ios.ts +1 -0
  132. package/src/controllers.native.ts +104 -0
  133. package/src/controllers.ts +1 -0
  134. package/src/geometry.ts +293 -45
  135. package/src/groupTypes.ts +53 -0
  136. package/src/groups.android.ts +1 -0
  137. package/src/groups.ios.ts +1 -0
  138. package/src/groups.native.ts +604 -0
  139. package/src/groups.ts +1 -0
  140. package/src/ids.ts +6 -0
  141. package/src/index.ts +32 -12
  142. package/src/nativeCompletion.ts +67 -32
  143. package/src/presentationCodec.ts +134 -0
  144. package/lib/module/SmoothClipView.web.js +0 -54
  145. package/lib/module/SmoothClipView.web.js.map +0 -1
  146. package/lib/module/driverState.js +0 -110
  147. package/lib/module/driverState.js.map +0 -1
  148. package/lib/module/driverTypes.js +0 -4
  149. package/lib/module/driverTypes.js.map +0 -1
  150. package/lib/module/drivers.android.js +0 -6
  151. package/lib/module/drivers.android.js.map +0 -1
  152. package/lib/module/drivers.ios.js +0 -6
  153. package/lib/module/drivers.ios.js.map +0 -1
  154. package/lib/module/drivers.js +0 -284
  155. package/lib/module/drivers.js.map +0 -1
  156. package/lib/module/drivers.native.js +0 -556
  157. package/lib/module/drivers.native.js.map +0 -1
  158. package/lib/module/index.web.js +0 -8
  159. package/lib/module/index.web.js.map +0 -1
  160. package/lib/module/reactRequests.js +0 -56
  161. package/lib/module/reactRequests.js.map +0 -1
  162. package/lib/module/webClipPath.js +0 -25
  163. package/lib/module/webClipPath.js.map +0 -1
  164. package/lib/typescript/src/SmoothClipView.web.d.ts +0 -10
  165. package/lib/typescript/src/SmoothClipView.web.d.ts.map +0 -1
  166. package/lib/typescript/src/driverState.d.ts +0 -31
  167. package/lib/typescript/src/driverState.d.ts.map +0 -1
  168. package/lib/typescript/src/driverTypes.d.ts +0 -107
  169. package/lib/typescript/src/driverTypes.d.ts.map +0 -1
  170. package/lib/typescript/src/drivers.android.d.ts +0 -3
  171. package/lib/typescript/src/drivers.android.d.ts.map +0 -1
  172. package/lib/typescript/src/drivers.d.ts +0 -5
  173. package/lib/typescript/src/drivers.d.ts.map +0 -1
  174. package/lib/typescript/src/drivers.ios.d.ts +0 -3
  175. package/lib/typescript/src/drivers.ios.d.ts.map +0 -1
  176. package/lib/typescript/src/drivers.native.d.ts +0 -5
  177. package/lib/typescript/src/drivers.native.d.ts.map +0 -1
  178. package/lib/typescript/src/index.web.d.ts +0 -9
  179. package/lib/typescript/src/index.web.d.ts.map +0 -1
  180. package/lib/typescript/src/reactRequests.d.ts +0 -9
  181. package/lib/typescript/src/reactRequests.d.ts.map +0 -1
  182. package/lib/typescript/src/webClipPath.d.ts +0 -7
  183. package/lib/typescript/src/webClipPath.d.ts.map +0 -1
  184. package/src/SmoothClipView.web.tsx +0 -66
  185. package/src/driverState.ts +0 -158
  186. package/src/driverTypes.ts +0 -140
  187. package/src/drivers.android.ts +0 -8
  188. package/src/drivers.ios.ts +0 -8
  189. package/src/drivers.native.ts +0 -899
  190. package/src/drivers.ts +0 -427
  191. package/src/index.web.ts +0 -23
  192. package/src/reactRequests.ts +0 -76
  193. package/src/webClipPath.ts +0 -30
@@ -1,556 +0,0 @@
1
- "use strict";
2
-
3
- // The shared NATIVE driver: iOS and Android both execute this file, via the
4
- // one-line re-exports in drivers.ios.ts / drivers.android.ts that Metro's
5
- // platform resolution picks up from index.ts's `./drivers` import. Only the
6
- // `./smoothClipNative` import below is platform-split. drivers.ts (no
7
- // suffix) is the web/Reanimated fallback, not this driver's sibling.
8
- import { useEffect, useRef } from 'react';
9
- import { Platform } from 'react-native';
10
- import { useSharedValue } from 'react-native-reanimated';
11
- import { isRNRuntime, scheduleOnRN, scheduleOnUI } from 'react-native-worklets';
12
- import NativeSmoothClipModule from './smoothClipNative';
13
- import { allocateDriverId, attachDriverState, createDriverState, detachDriverState, getDriverState, setDriverState } from "./driverState.js";
14
- import { completeNativeAnimation, synchronizeNativeCompletion } from "./nativeCompletion.js";
15
- import { clipPresentationEquals, createClipPresentation, isFiniteClipPresentation } from "./geometry.js";
16
- import { createReactRequest, rejectDriverRequests, resolveReactRequest } from "./reactRequests.js";
17
- const INTERACTIVE = 0;
18
- const NATIVE = 1;
19
-
20
- // Only Android consumes the Reanimated start stamp (its frame-clock anchor —
21
- // docs/android-frame-clock-anchor.md). iOS's TurboModule reads its declared
22
- // parameters positionally and drops the trailing argument, so capturing the
23
- // stamp there is a wasted native _getAnimationTimestamp() call per animateTo.
24
- // Resolved once at module scope; the worklet captures the primitive.
25
- const NEEDS_START_STAMP = Platform.OS === 'android';
26
-
27
- // Widened like the animate* functions below: one trailing argument beyond the
28
- // TurboModule spec — whether this write should record an `'inherit'` velocity
29
- // sample. Android's JSI bindings read it (absent means record, the pre-flag
30
- // behavior); the iOS TurboModule reads its declared parameters positionally
31
- // and drops it, so iOS always records.
32
-
33
- const setPresentationHostFunction = NativeSmoothClipModule.setClipPresentation;
34
- const beginInteractionHostFunction = NativeSmoothClipModule.beginInteraction;
35
-
36
- // The animate* host functions take one argument beyond the TurboModule spec:
37
- // the Reanimated-rule start stamp in milliseconds (see animateOnUI). Android's
38
- // JSI bindings read it as an optional trailing argument; the iOS TurboModule
39
- // reads its declared parameters positionally and ignores extras, so the
40
- // codegen spec stays untouched and both platforms take the same call. A
41
- // narrower function is assignable to the widened type, so no cast is needed.
42
-
43
- const animateTimingHostFunction = NativeSmoothClipModule.animateTiming;
44
- const animateSpringHostFunction = NativeSmoothClipModule.animateSpring;
45
- const animateKeyframesHostFunction = NativeSmoothClipModule.animateKeyframes;
46
- const rejectAnimationHostFunction = NativeSmoothClipModule.rejectAnimation;
47
- const cancelAnimationHostFunction = NativeSmoothClipModule.cancelAnimation;
48
- const destroyDriverHostFunction = NativeSmoothClipModule.destroyDriver;
49
-
50
- // Workaround for react-native-worklets 0.10: the RN-side serialization cache
51
- // hands out one remote-function registry id per function forever, but the
52
- // registry entry is deleted as soon as any transient UI-side proxy of that
53
- // function is garbage collected. A later scheduleOnRN for the same function
54
- // then reads `undefined` from the registry and aborts in Value::getObject.
55
- // Pinning one UI-side reference for the app lifetime keeps the proxy — and
56
- // with it the registry entry — alive. Remove once worklets decouples registry
57
- // cleanup from proxy lifetime.
58
- scheduleOnUI(resolver => {
59
- 'worklet';
60
-
61
- globalThis.__smoothClipPinnedResolver = resolver;
62
- }, resolveReactRequest);
63
- function reduceMotionCode(value) {
64
- switch (value) {
65
- case 'always':
66
- return 1;
67
- case 'never':
68
- return 2;
69
- default:
70
- return 0;
71
- }
72
- }
73
- function animationIsFinite(animation) {
74
- 'worklet';
75
-
76
- if (animation.from !== undefined && !isFiniteClipPresentation(animation.from)) {
77
- // Silently dropping an invalid explicit start would re-open the exact
78
- // stale-start handoff `from` exists to close — reject the whole call.
79
- return false;
80
- }
81
- if (animation.type === 'timing') {
82
- const [x1,, x2] = animation.controlPoints;
83
- return Number.isFinite(animation.duration) && animation.controlPoints.every(Number.isFinite) &&
84
- // A cubic-bezier easing is only defined for x within [0,1] (the CSS /
85
- // CoreAnimation / Reanimated Easing.bezier contract). Out-of-range x
86
- // makes the Android parameter solve meaningless while CoreAnimation
87
- // silently clamps — reject like any other invalid input instead of
88
- // diverging per platform.
89
- x1 >= 0 && x1 <= 1 && x2 >= 0 && x2 <= 1;
90
- }
91
- if (animation.type === 'spring') {
92
- return [animation.mass ?? 1, animation.stiffness ?? 100, animation.damping ?? 10, animation.initialVelocity === 'inherit' ? 0 : animation.initialVelocity ?? 0].every(Number.isFinite);
93
- }
94
- // Keyframe frames validate inside flattenFiniteKeyframes — one traversal
95
- // both checks and flattens, instead of walking every frame twice. The type
96
- // check is statically always-true for the TS union but load-bearing for JS
97
- // callers: an unrecognized type must reject here, or it would skip the
98
- // keyframe gate entirely and hand native a null frames array.
99
- return animation.type === 'keyframes';
100
- }
101
- function presentationFromNative(values, fallback, offset = 0) {
102
- 'worklet';
103
-
104
- if (values.length < offset + 7) return fallback;
105
- const presentation = {
106
- clip: {
107
- x: values[offset],
108
- y: values[offset + 1],
109
- width: values[offset + 2],
110
- height: values[offset + 3],
111
- radius: values[offset + 4]
112
- },
113
- contentTranslateX: values[offset + 5],
114
- contentTranslateY: values[offset + 6]
115
- };
116
- return isFiniteClipPresentation(presentation) ? presentation : fallback;
117
- }
118
-
119
- // Validates and flattens the keyframe list in one traversal (the flat number
120
- // array is the wire format the native side reads back positionally). Returns
121
- // null when any frame is invalid — same rejection contract the two-pass
122
- // validate-then-flatten had.
123
- function flattenFiniteKeyframes(target, animation) {
124
- 'worklet';
125
-
126
- if (!Number.isFinite(animation.duration) || animation.frames.length < 2) {
127
- return null;
128
- }
129
- const values = [];
130
- let previousOffset = -1;
131
- for (const frame of animation.frames) {
132
- const {
133
- offset,
134
- presentation
135
- } = frame;
136
- if (!Number.isFinite(offset) || offset < 0 || offset > 1 || offset <= previousOffset || !isFiniteClipPresentation(presentation)) {
137
- return null;
138
- }
139
- previousOffset = offset;
140
- const {
141
- clip,
142
- contentTranslateX,
143
- contentTranslateY
144
- } = presentation;
145
- values.push(offset, clip.x, clip.y, clip.width, clip.height, clip.radius, contentTranslateX, contentTranslateY);
146
- }
147
- if (animation.frames[0]?.offset !== 0 || previousOffset !== 1 || !clipPresentationEquals(animation.frames[animation.frames.length - 1]?.presentation ?? null, target)) {
148
- return null;
149
- }
150
- return values;
151
- }
152
- function uiOnly() {
153
- 'worklet';
154
-
155
- throw new Error('[SmoothClipView] driver.ui methods must run on the UI runtime. Use driver.react from React code.');
156
- }
157
- export function useSmoothClipDriver(initialValue, options = {}) {
158
- const initialPresentation = 'clip' in initialValue ? initialValue : createClipPresentation(initialValue);
159
- const presentation = useSharedValue(initialPresentation);
160
- const ownership = useSharedValue(INTERACTIVE);
161
- const suppressDeliveries = useSharedValue(0);
162
- const activeAnimationId = useSharedValue(0);
163
- // Non-zero after a setScalars hot write: driver.presentation is then stale,
164
- // so animateTo must start from the native registry's latest value instead
165
- // of snapping back to the stale SharedValue.
166
- const scalarsStale = useSharedValue(0);
167
- // Non-zero between the effect cleanup's native teardown and the next effect
168
- // run. Native cannot tell "this driver was never seeded" from "this driver
169
- // was destroyed and erased" — both are a missing registry entry — so the
170
- // animation entry points would happily create a fresh state for a call that
171
- // arrives after the hook is gone, leaving a latch that no view starts and no
172
- // destroy cancels. Only the UI side knows the difference, so it is decided
173
- // here.
174
- const disposed = useSharedValue(0);
175
- const callbackRef = useRef(options.onAnimationComplete);
176
- const driverRef = useRef(null);
177
- callbackRef.current = options.onAnimationComplete;
178
- if (driverRef.current === null) {
179
- const driverId = allocateDriverId();
180
- const reduceMotion = reduceMotionCode(options.reduceMotion ?? 'system');
181
- // Captured once, like reduceMotion. Only the per-frame setScalars stream
182
- // consults it; set(), the fused animateTo `from` seed, and the effect's
183
- // declarative deliveries always record, so every once-per-call channel
184
- // keeps its pre-flag 'inherit' behavior.
185
- const velocityTracking = options.velocityTracking === true;
186
- const seedPresentation = next => {
187
- 'worklet';
188
-
189
- if (clipPresentationEquals(presentation.value, next)) return;
190
- suppressDeliveries.value += 1;
191
- presentation.value = next;
192
- // The listener runs synchronously inside that assignment, so the credit
193
- // is either spent by now or was never spendable. deliver() returns before
194
- // the decrement whenever the value dedupes against `last` — which happens
195
- // exactly when native already holds it, e.g. freezing a latch back to the
196
- // value it started from. An unspent credit would then swallow the next
197
- // real declarative write and leave native a geometry behind for good.
198
- if (suppressDeliveries.value > 0) suppressDeliveries.value -= 1;
199
- };
200
- const beginOnUI = () => {
201
- 'worklet';
202
-
203
- if (disposed.value !== 0) return presentation.value;
204
- const current = presentationFromNative(beginInteractionHostFunction(driverId), presentation.value);
205
- activeAnimationId.value = 0;
206
- ownership.value = INTERACTIVE;
207
- scalarsStale.value = 0;
208
- seedPresentation(current);
209
- return current;
210
- };
211
- const setOnUI = next => {
212
- 'worklet';
213
-
214
- if (disposed.value !== 0 || !isFiniteClipPresentation(next)) return;
215
- activeAnimationId.value = 0;
216
- ownership.value = INTERACTIVE;
217
- scalarsStale.value = 0;
218
- const {
219
- clip,
220
- contentTranslateX,
221
- contentTranslateY
222
- } = next;
223
- // Always records: only the per-frame setScalars hot path is gated by
224
- // velocityTracking. set() already pays full validation and a SharedValue
225
- // seed per call, so the sample recording is noise here.
226
- setPresentationHostFunction(driverId, clip.x, clip.y, clip.width, clip.height, clip.radius, contentTranslateX, contentTranslateY, true, false);
227
- seedPresentation(next);
228
- };
229
- const setScalarsOnUI = (x, y, width, height, radius, contentTranslateX, contentTranslateY, overridePendingAnimation = false, forceRecordVelocity = false) => {
230
- 'worklet';
231
-
232
- // Resolved in the body, not as a default-parameter initializer: the
233
- // worklets Babel plugin only captures closure variables referenced
234
- // inside the function body, so `= velocityTracking` up in the parameter
235
- // list would throw "Property 'velocityTracking' doesn't exist" on the
236
- // UI runtime.
237
- const recordVelocity = forceRecordVelocity || velocityTracking;
238
- // Number.isFinite (not a fused arithmetic gate): it also rejects
239
- // non-number types, which arithmetic would coerce past the gate and
240
- // into a UI-runtime throw from the binding's asNumber. The gate must
241
- // stay on this side of the bridge: the native binding drops non-finite
242
- // writes silently, and flipping the ownership SharedValues below for a
243
- // write native never applied would let the deliver listener record
244
- // values native has not observed — a later identical declarative write
245
- // then dedupes against them and is swallowed for good.
246
- if (disposed.value !== 0 || !Number.isFinite(x) || !Number.isFinite(y) || !Number.isFinite(width) || !Number.isFinite(height) || !Number.isFinite(radius) || !Number.isFinite(contentTranslateX) || !Number.isFinite(contentTranslateY)) {
247
- return;
248
- }
249
- if (activeAnimationId.value !== 0) activeAnimationId.value = 0;
250
- if (ownership.value !== INTERACTIVE) ownership.value = INTERACTIVE;
251
- if (scalarsStale.value === 0) scalarsStale.value = 1;
252
- setPresentationHostFunction(driverId, x, y, width, height, radius, contentTranslateX, contentTranslateY, true, overridePendingAnimation, recordVelocity);
253
- };
254
- const animateOnUI = (target, animation) => {
255
- 'worklet';
256
-
257
- // Cleanup owns the terminal state. Check it before validation so even an
258
- // invalid stale call cannot mint a native rejection id/completion against
259
- // a driver whose listener and registry entry are already gone.
260
- if (disposed.value !== 0) return 0;
261
- const keyframeValues = animation.type === 'keyframes' ? flattenFiniteKeyframes(target, animation) : null;
262
- if (!isFiniteClipPresentation(target) || !animationIsFinite(animation) || animation.type === 'keyframes' && keyframeValues === null) {
263
- return rejectAnimationHostFunction(driverId);
264
- }
265
- // Past the hook's cleanup the native entry is gone for good, and an
266
- // interactive start here would recreate it as a latch nothing can ever
267
- // start or cancel. Reject before any side effect — not via
268
- // rejectAnimation, which would mint an id and a completion for a driver
269
- // whose JS state is already detached. This is the "unsupported dispatch"
270
- // arm of the documented 0 contract.
271
- const from = animation.from;
272
- if (from !== undefined) {
273
- // Fused hot write: exactly setScalars(from…) issued immediately
274
- // before the handoff, so native's latest value — the animation
275
- // start below — is the caller's explicit presentation. Also
276
- // re-grabs from a running animation, which the implicit
277
- // interactive-start path would silently skip. Always records a
278
- // velocity sample regardless of velocityTracking: this is one write
279
- // per animateTo, not the per-frame stream the flag exists to keep
280
- // cheap, and an unrecorded seed would invalidate the history a
281
- // set()-driven drag just recorded (the tracker's coalesce and
282
- // identical-re-record rules were designed for exactly this write).
283
- setScalarsOnUI(from.clip.x, from.clip.y, from.clip.width, from.clip.height, from.clip.radius, from.contentTranslateX, from.contentTranslateY, true, true);
284
- }
285
-
286
- // After a setScalars hot write the SharedValue no longer matches what
287
- // is on screen; passing it as the start would snap the animation back.
288
- // Without an interactive start, native resolves the start from its own
289
- // latest value instead.
290
- const scalarsWereStale = scalarsStale.value !== 0;
291
- const hasInteractiveStart = ownership.value === INTERACTIVE && !scalarsWereStale;
292
- const start = presentation.value;
293
- ownership.value = NATIVE;
294
- presentation.value = target;
295
- scalarsStale.value = 0;
296
- const startClip = start.clip;
297
- const targetClip = target.clip;
298
- // Reanimated stamps a parallel animation's t0 on this same runtime as
299
- // `__frameTimestamp || _getAnimationTimestamp()` (valueSetter.ts).
300
- // Capturing the identical value here and handing it to the integrator
301
- // keeps clip and content phase-locked in every branch — including a
302
- // start issued from CALLBACK_INPUT (batched gesture moves), where the
303
- // dispatching frame's stamp is EARLIER than the call: the native min()
304
- // anchor alone would adopt that frame stamp while Reanimated, outside
305
- // its rAF flush where __frameTimestamp is cleared, keeps the wall
306
- // clock — a lead lasting the whole animation. NaN when the globals are
307
- // absent (tests, non-worklets runtimes): native then falls back to its
308
- // own clock plus the min() anchor, the pre-stamp behavior. On iOS the
309
- // stamp is always NaN: Core Animation anchors at commit time and the
310
- // TurboModule discards the argument, so the capture would only cost.
311
- const workletGlobal = globalThis;
312
- const startedAtMs = !NEEDS_START_STAMP ? Number.NaN : workletGlobal.__frameTimestamp || (typeof workletGlobal._getAnimationTimestamp === 'function' ? workletGlobal._getAnimationTimestamp() : Number.NaN);
313
- let animationId;
314
- if (animation.type === 'timing') {
315
- const [x1, y1, x2, y2] = animation.controlPoints;
316
- animationId = animateTimingHostFunction(driverId, hasInteractiveStart, startClip.x, startClip.y, startClip.width, startClip.height, startClip.radius, start.contentTranslateX, start.contentTranslateY, targetClip.x, targetClip.y, targetClip.width, targetClip.height, targetClip.radius, target.contentTranslateX, target.contentTranslateY, Math.max(0, animation.duration), x1, y1, x2, y2, reduceMotion, startedAtMs);
317
- } else if (animation.type === 'spring') {
318
- const inheritVelocity = animation.initialVelocity === undefined || animation.initialVelocity === 'inherit';
319
- animationId = animateSpringHostFunction(driverId, hasInteractiveStart, startClip.x, startClip.y, startClip.width, startClip.height, startClip.radius, start.contentTranslateX, start.contentTranslateY, targetClip.x, targetClip.y, targetClip.width, targetClip.height, targetClip.radius, target.contentTranslateX, target.contentTranslateY, Math.max(0.0001, animation.mass ?? 1), Math.max(0.0001, animation.stiffness ?? 100), Math.max(0, animation.damping ?? 10), inheritVelocity ? 0 : animation.initialVelocity, inheritVelocity, reduceMotion, startedAtMs);
320
- } else {
321
- animationId = animateKeyframesHostFunction(driverId, hasInteractiveStart, startClip.x, startClip.y, startClip.width, startClip.height, startClip.radius, start.contentTranslateX, start.contentTranslateY, targetClip.x, targetClip.y, targetClip.width, targetClip.height, targetClip.radius, target.contentTranslateX, target.contentTranslateY, Math.max(0, animation.duration),
322
- // Non-null here: the validation gate above rejected null before any
323
- // side effect.
324
- keyframeValues, reduceMotion, startedAtMs);
325
- }
326
- if (animationId === 0) {
327
- // The 0 sentinel: off-main, invalid-id, or otherwise unsupported
328
- // dispatch. A missing driver is accepted when this call carries the
329
- // authoritative interactive start above; a start-less missing-state
330
- // request remains unsupported rather than inventing zero geometry.
331
- // Validation failures never get here: they reject before any side
332
- // effect, with a fresh id and one finished:false completion once the
333
- // native entry exists — in the pre-seed window rejectAnimation has no
334
- // entry and returns the bare 0 sentinel with no completion instead.
335
- ownership.value = INTERACTIVE;
336
- presentation.value = start;
337
- if (scalarsWereStale) scalarsStale.value = 1;
338
- activeAnimationId.value = 0;
339
- return rejectAnimationHostFunction(driverId);
340
- }
341
- activeAnimationId.value = animationId;
342
- return animationId;
343
- };
344
- const cancelOnUI = (animationId = 0, behavior = 'current') => {
345
- 'worklet';
346
-
347
- // Past the hook's cleanup the native entry is gone; the call would fail
348
- // defined (handled=false) but it is the last driver.ui path that still
349
- // crosses into native after the tombstone. Guard it like the rest.
350
- if (disposed.value !== 0) return presentation.value;
351
- const values = cancelAnimationHostFunction(driverId, animationId, behavior === 'target' ? 1 : 0);
352
- if (values.length < 8 || values[0] !== 1) return presentation.value;
353
- const current = presentationFromNative(values, presentation.value, 1);
354
- activeAnimationId.value = 0;
355
- ownership.value = INTERACTIVE;
356
- scalarsStale.value = 0;
357
- seedPresentation(current);
358
- return current;
359
- };
360
- const driver = {
361
- kind: 'hybrid',
362
- presentation,
363
- ui: {
364
- beginInteraction() {
365
- 'worklet';
366
-
367
- if (isRNRuntime()) return uiOnly();
368
- return beginOnUI();
369
- },
370
- set(next) {
371
- 'worklet';
372
-
373
- if (isRNRuntime()) return uiOnly();
374
- setOnUI(next);
375
- },
376
- setScalars(x, y, width, height, radius, contentTranslateX, contentTranslateY) {
377
- 'worklet';
378
-
379
- if (isRNRuntime()) return uiOnly();
380
- setScalarsOnUI(x, y, width, height, radius, contentTranslateX, contentTranslateY);
381
- },
382
- animateTo(target, animation) {
383
- 'worklet';
384
-
385
- if (isRNRuntime()) return uiOnly();
386
- return animateOnUI(target, animation);
387
- },
388
- cancel(animationId = 0, behavior = 'current') {
389
- 'worklet';
390
-
391
- if (isRNRuntime()) return uiOnly();
392
- return cancelOnUI(animationId, behavior);
393
- }
394
- },
395
- react: {
396
- beginInteraction() {
397
- const {
398
- requestId,
399
- promise
400
- } = createReactRequest(driverId);
401
- scheduleOnUI(() => {
402
- 'worklet';
403
-
404
- const result = beginOnUI();
405
- scheduleOnRN(resolveReactRequest, driverId, requestId, result);
406
- });
407
- return promise;
408
- },
409
- set(next) {
410
- // Teardown resolves (undefined) rather than rejects: `set` is a
411
- // documented fire-and-forget call, and a promise discarded with
412
- // `void` must not become an unhandled rejection at unmount.
413
- const {
414
- requestId,
415
- promise
416
- } = createReactRequest(driverId, false, {
417
- value: undefined
418
- });
419
- scheduleOnUI(() => {
420
- 'worklet';
421
-
422
- setOnUI(next);
423
- scheduleOnRN(resolveReactRequest, driverId, requestId, undefined);
424
- });
425
- return promise;
426
- },
427
- animateTo(target, animation) {
428
- // Teardown resolves with the documented 0 rejection sentinel (see
429
- // `set` above): the README's own example voids this promise.
430
- const {
431
- requestId,
432
- promise
433
- } = createReactRequest(driverId, true, {
434
- value: 0
435
- });
436
- scheduleOnUI(() => {
437
- 'worklet';
438
-
439
- const result = animateOnUI(target, animation);
440
- scheduleOnRN(resolveReactRequest, driverId, requestId, result, true);
441
- });
442
- return promise;
443
- },
444
- cancel(animationId = 0, behavior = 'current') {
445
- const {
446
- requestId,
447
- promise
448
- } = createReactRequest(driverId, true);
449
- scheduleOnUI(() => {
450
- 'worklet';
451
-
452
- const result = cancelOnUI(animationId, behavior);
453
- scheduleOnRN(resolveReactRequest, driverId, requestId, result, true);
454
- });
455
- return promise;
456
- }
457
- }
458
- };
459
- setDriverState(driver, createDriverState(driverId, initialPresentation, presentation, callbackRef, activeAnimationId, ownership));
460
- driverRef.current = driver;
461
- }
462
- const driver = driverRef.current;
463
- useEffect(() => {
464
- const currentDriver = driverRef.current;
465
- if (!currentDriver) return undefined;
466
- const state = getDriverState(currentDriver);
467
- const {
468
- driverId
469
- } = state;
470
- // Re-attach on every effect run: StrictMode/<Activity> replay the effect
471
- // after its cleanup detached this state and destroyed the native driver.
472
- // The authoritative seed below recreates the native entry in that case.
473
- attachDriverState(state);
474
- const subscription = NativeSmoothClipModule.onClipAnimationComplete(result => {
475
- if (result.driverId !== driverId) return;
476
- synchronizeNativeCompletion(activeAnimationId, ownership, result.animationId, result.finished);
477
- completeNativeAnimation(driverId, result.animationId, result.finished);
478
- });
479
- scheduleOnUI((source, listenerId, nativeDriverId, owner, suppressed, active, stale, gone, setter) => {
480
- 'worklet';
481
-
482
- // First, before the listener or the seed: this effect run owns the
483
- // driver again, so a StrictMode/<Activity> replay must clear the
484
- // previous cleanup's tombstone or every later write would be rejected.
485
- gone.value = 0;
486
- let last = null;
487
- const deliver = next => {
488
- if (!isFiniteClipPresentation(next) || clipPresentationEquals(last, next)) {
489
- return;
490
- }
491
- // Record `last` only for values native has actually observed:
492
- // deliveries dropped during native ownership must stay eligible
493
- // for re-delivery once interactive ownership returns.
494
- if (owner.value !== INTERACTIVE) return;
495
- if (suppressed.value > 0) {
496
- suppressed.value -= 1;
497
- last = next;
498
- return;
499
- }
500
- last = next;
501
- if (stale.value !== 0) stale.value = 0;
502
- const {
503
- clip,
504
- contentTranslateX,
505
- contentTranslateY
506
- } = next;
507
- // Declarative deliveries always record velocity samples — only the
508
- // setScalars hot path is gated by the velocityTracking option.
509
- setter(nativeDriverId, clip.x, clip.y, clip.width, clip.height, clip.radius, contentTranslateX, contentTranslateY, false, false);
510
- };
511
- source.addListener(listenerId, deliver);
512
- // Authoritative take-ownership seed. Creates the native entry before
513
- // any view mounts on the ordinary path, and revives a driver destroyed
514
- // by an effect-replay cleanup (StrictMode/<Activity>) on later runs.
515
- // An animation worklet can win the scheduling race and create a latch
516
- // first; Native ownership then marks that intent as newer, so this
517
- // passive seed must not clear its active id or replay the target value.
518
- const current = source.value;
519
- if (owner.value === INTERACTIVE && isFiniteClipPresentation(current)) {
520
- active.value = 0;
521
- owner.value = INTERACTIVE;
522
- stale.value = 0;
523
- last = current;
524
- setter(nativeDriverId, current.clip.x, current.clip.y, current.clip.width, current.clip.height, current.clip.radius, current.contentTranslateX, current.contentTranslateY, true, false);
525
- }
526
- }, presentation, driverId, driverId, ownership, suppressDeliveries, activeAnimationId, scalarsStale, disposed, setPresentationHostFunction);
527
- return () => {
528
- subscription.remove();
529
- rejectDriverRequests(driverId);
530
- detachDriverState(state);
531
- scheduleOnUI((source, listenerId, nativeDriverId, owner, active, stale, suppressed, gone, destroy) => {
532
- 'worklet';
533
-
534
- source.removeListener(listenerId);
535
- destroy(nativeDriverId);
536
- // StrictMode replays the effect with these same SharedValues. Reset
537
- // the UI-side tombstone only after native teardown so the next setup
538
- // can seed or animate without inheriting stale Native ownership.
539
- active.value = 0;
540
- owner.value = INTERACTIVE;
541
- stale.value = 0;
542
- // Defensive: seedPresentation now reclaims its own unspent credit at
543
- // the point of issue, so this should already be 0. Kept because the
544
- // failure mode — one declarative write silently dropped for the rest
545
- // of the next hook's life — is invisible until someone reports a
546
- // stale clip rect.
547
- suppressed.value = 0;
548
- // Last: the native entry is now erased, so until the next effect run
549
- // clears this, any call that would recreate it is rejected instead.
550
- gone.value = 1;
551
- }, presentation, driverId, driverId, ownership, activeAnimationId, scalarsStale, suppressDeliveries, disposed, destroyDriverHostFunction);
552
- };
553
- }, [activeAnimationId, disposed, ownership, presentation, scalarsStale, suppressDeliveries]);
554
- return driver;
555
- }
556
- //# sourceMappingURL=drivers.native.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["useEffect","useRef","Platform","useSharedValue","isRNRuntime","scheduleOnRN","scheduleOnUI","NativeSmoothClipModule","allocateDriverId","attachDriverState","createDriverState","detachDriverState","getDriverState","setDriverState","completeNativeAnimation","synchronizeNativeCompletion","clipPresentationEquals","createClipPresentation","isFiniteClipPresentation","createReactRequest","rejectDriverRequests","resolveReactRequest","INTERACTIVE","NATIVE","NEEDS_START_STAMP","OS","setPresentationHostFunction","setClipPresentation","beginInteractionHostFunction","beginInteraction","animateTimingHostFunction","animateTiming","animateSpringHostFunction","animateSpring","animateKeyframesHostFunction","animateKeyframes","rejectAnimationHostFunction","rejectAnimation","cancelAnimationHostFunction","cancelAnimation","destroyDriverHostFunction","destroyDriver","resolver","globalThis","__smoothClipPinnedResolver","reduceMotionCode","value","animationIsFinite","animation","from","undefined","type","x1","x2","controlPoints","Number","isFinite","duration","every","mass","stiffness","damping","initialVelocity","presentationFromNative","values","fallback","offset","length","presentation","clip","x","y","width","height","radius","contentTranslateX","contentTranslateY","flattenFiniteKeyframes","target","frames","previousOffset","frame","push","uiOnly","Error","useSmoothClipDriver","initialValue","options","initialPresentation","ownership","suppressDeliveries","activeAnimationId","scalarsStale","disposed","callbackRef","onAnimationComplete","driverRef","current","driverId","reduceMotion","velocityTracking","seedPresentation","next","beginOnUI","setOnUI","setScalarsOnUI","overridePendingAnimation","forceRecordVelocity","recordVelocity","animateOnUI","keyframeValues","scalarsWereStale","hasInteractiveStart","start","startClip","targetClip","workletGlobal","startedAtMs","NaN","__frameTimestamp","_getAnimationTimestamp","animationId","y1","y2","Math","max","inheritVelocity","cancelOnUI","behavior","driver","kind","ui","set","setScalars","animateTo","cancel","react","requestId","promise","result","currentDriver","state","subscription","onClipAnimationComplete","finished","source","listenerId","nativeDriverId","owner","suppressed","active","stale","gone","setter","last","deliver","addListener","remove","destroy","removeListener"],"sourceRoot":"../../src","sources":["drivers.native.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,MAAM,QAAQ,OAAO;AACzC,SAASC,QAAQ,QAAQ,cAAc;AACvC,SAASC,cAAc,QAA0B,yBAAyB;AAC1E,SAASC,WAAW,EAAEC,YAAY,EAAEC,YAAY,QAAQ,uBAAuB;AAC/E,OAAOC,sBAAsB,MAAM,oBAAoB;AAUvD,SACEC,gBAAgB,EAChBC,iBAAiB,EACjBC,iBAAiB,EACjBC,iBAAiB,EACjBC,cAAc,EACdC,cAAc,QACT,kBAAe;AACtB,SACEC,uBAAuB,EACvBC,2BAA2B,QACtB,uBAAoB;AAC3B,SACEC,sBAAsB,EACtBC,sBAAsB,EACtBC,wBAAwB,QAGnB,eAAY;AACnB,SACEC,kBAAkB,EAClBC,oBAAoB,EACpBC,mBAAmB,QACd,oBAAiB;AAExB,MAAMC,WAAW,GAAG,CAAC;AACrB,MAAMC,MAAM,GAAG,CAAC;;AAEhB;AACA;AACA;AACA;AACA;AAC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,KAAK,CAACtG,KAAK,GAAGxB,WAAW;QACzBiI,KAAK,CAACzG,KAAK,GAAG,CAAC;QACf;QACA;QACA;QACA;QACA;QACAuG,UAAU,CAACvG,KAAK,GAAG,CAAC;QACpB;QACA;QACA0G,IAAI,CAAC1G,KAAK,GAAG,CAAC;MAChB,CAAC,EACDsB,YAAY,EACZ8B,QAAQ,EACRA,QAAQ,EACRT,SAAS,EACTE,iBAAiB,EACjBC,YAAY,EACZF,kBAAkB,EAClBG,QAAQ,EACRrD,yBACF,CAAC;IACH,CAAC;EACH,CAAC,EAAE,CACDmD,iBAAiB,EACjBE,QAAQ,EACRJ,SAAS,EACTrB,YAAY,EACZwB,YAAY,EACZF,kBAAkB,CACnB,CAAC;EAEF,OAAOuC,MAAM;AACf","ignoreList":[]}
@@ -1,8 +0,0 @@
1
- "use strict";
2
-
3
- export { SmoothClipView } from "./SmoothClipView.web.js";
4
- export { useSmoothClipDriver } from './drivers';
5
- export { ClipEasings } from "./easings.js";
6
- export { normalizeClipGeometry } from "./geometry.js";
7
- export { createClipPresentation } from "./geometry.js";
8
- //# sourceMappingURL=index.web.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["SmoothClipView","useSmoothClipDriver","ClipEasings","normalizeClipGeometry","createClipPresentation"],"sourceRoot":"../../src","sources":["index.web.ts"],"mappings":";;AAAA,SAASA,cAAc,QAAQ,yBAAsB;AAErD,SAASC,mBAAmB,QAAQ,WAAW;AAa/C,SAASC,WAAW,QAAQ,cAAW;AACvC,SAASC,qBAAqB,QAAQ,eAAY;AAClD,SAASC,sBAAsB,QAAQ,eAAY","ignoreList":[]}