react-native-smooth-clip-view 0.1.0 → 0.2.1
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.
- package/README.md +171 -43
- package/SmoothClipView.podspec +8 -2
- package/android/CMakeLists.txt +39 -0
- package/android/build.gradle +69 -2
- package/android/proguard-rules.pro +6 -0
- package/android/src/main/cpp/SmoothClipAndroid.h +59 -0
- package/android/src/main/cpp/SmoothClipBindings.cpp +428 -0
- package/android/src/main/cpp/SmoothClipRegistry.cpp +945 -0
- package/android/src/main/java/com/smoothclipview/ClipGeometryNormalizer.kt +25 -0
- package/android/src/main/java/com/smoothclipview/SmoothClipBindings.kt +55 -0
- package/android/src/main/java/com/smoothclipview/SmoothClipModule.kt +128 -0
- package/android/src/main/java/com/smoothclipview/SmoothClipView.kt +164 -30
- package/android/src/main/java/com/smoothclipview/SmoothClipViewManager.kt +107 -10
- package/android/src/main/java/com/smoothclipview/SmoothClipViewPackage.kt +18 -2
- package/cpp/SmoothClipRegistry.h +93 -0
- package/cpp/SmoothClipSharedGeometry.h +50 -0
- package/ios/SmoothClipModuleProvider.h +9 -0
- package/ios/SmoothClipModuleProvider.mm +16 -0
- package/ios/SmoothClipRegistry.mm +754 -0
- package/ios/SmoothClipTurboModule.cpp +290 -0
- package/ios/SmoothClipTurboModule.h +132 -0
- package/ios/SmoothClipView.mm +976 -85
- package/ios/SmoothClipViewRegistry.h +27 -0
- package/lib/module/NativeSmoothClipModule.js +5 -0
- package/lib/module/NativeSmoothClipModule.js.map +1 -0
- package/lib/module/SmoothClipView.android.js +4 -0
- package/lib/module/SmoothClipView.android.js.map +1 -0
- package/lib/module/SmoothClipView.ios.js +34 -0
- package/lib/module/SmoothClipView.ios.js.map +1 -0
- package/lib/module/SmoothClipView.js +26 -12
- package/lib/module/SmoothClipView.js.map +1 -1
- package/lib/module/SmoothClipView.web.js +28 -12
- package/lib/module/SmoothClipView.web.js.map +1 -1
- package/lib/module/SmoothClipViewNativeComponent.ts +14 -1
- package/lib/module/driverState.js +102 -0
- package/lib/module/driverState.js.map +1 -0
- package/lib/module/driverTypes.js +4 -0
- package/lib/module/driverTypes.js.map +1 -0
- package/lib/module/drivers.android.js +4 -0
- package/lib/module/drivers.android.js.map +1 -0
- package/lib/module/drivers.ios.js +380 -0
- package/lib/module/drivers.ios.js.map +1 -0
- package/lib/module/drivers.js +276 -0
- package/lib/module/drivers.js.map +1 -0
- package/lib/module/geometry.js +19 -0
- package/lib/module/geometry.js.map +1 -1
- package/lib/module/index.js +2 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.web.js +2 -0
- package/lib/module/index.web.js.map +1 -1
- package/lib/module/nativeCompletion.js +21 -0
- package/lib/module/nativeCompletion.js.map +1 -0
- package/lib/module/reactRequests.js +50 -0
- package/lib/module/reactRequests.js.map +1 -0
- package/lib/module/smoothClipNative.android.js +15 -0
- package/lib/module/smoothClipNative.android.js.map +1 -0
- package/lib/module/smoothClipNative.js +8 -0
- package/lib/module/smoothClipNative.js.map +1 -0
- package/lib/typescript/src/NativeSmoothClipModule.d.ts +19 -0
- package/lib/typescript/src/NativeSmoothClipModule.d.ts.map +1 -0
- package/lib/typescript/src/SmoothClipView.android.d.ts +3 -0
- package/lib/typescript/src/SmoothClipView.android.d.ts.map +1 -0
- package/lib/typescript/src/SmoothClipView.d.ts +5 -6
- package/lib/typescript/src/SmoothClipView.d.ts.map +1 -1
- package/lib/typescript/src/SmoothClipView.ios.d.ts +9 -0
- package/lib/typescript/src/SmoothClipView.ios.d.ts.map +1 -0
- package/lib/typescript/src/SmoothClipView.web.d.ts +5 -7
- package/lib/typescript/src/SmoothClipView.web.d.ts.map +1 -1
- package/lib/typescript/src/SmoothClipViewNativeComponent.d.ts +4 -0
- package/lib/typescript/src/SmoothClipViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/driverState.d.ts +31 -0
- package/lib/typescript/src/driverState.d.ts.map +1 -0
- package/lib/typescript/src/driverTypes.d.ts +61 -0
- package/lib/typescript/src/driverTypes.d.ts.map +1 -0
- package/lib/typescript/src/drivers.android.d.ts +3 -0
- package/lib/typescript/src/drivers.android.d.ts.map +1 -0
- package/lib/typescript/src/drivers.d.ts +5 -0
- package/lib/typescript/src/drivers.d.ts.map +1 -0
- package/lib/typescript/src/drivers.ios.d.ts +5 -0
- package/lib/typescript/src/drivers.ios.d.ts.map +1 -0
- package/lib/typescript/src/geometry.d.ts +8 -0
- package/lib/typescript/src/geometry.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +4 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/index.web.d.ts +4 -1
- package/lib/typescript/src/index.web.d.ts.map +1 -1
- package/lib/typescript/src/nativeCompletion.d.ts +7 -0
- package/lib/typescript/src/nativeCompletion.d.ts.map +1 -0
- package/lib/typescript/src/reactRequests.d.ts +7 -0
- package/lib/typescript/src/reactRequests.d.ts.map +1 -0
- package/lib/typescript/src/smoothClipNative.android.d.ts +4 -0
- package/lib/typescript/src/smoothClipNative.android.d.ts.map +1 -0
- package/lib/typescript/src/smoothClipNative.d.ts +3 -0
- package/lib/typescript/src/smoothClipNative.d.ts.map +1 -0
- package/package.json +12 -7
- package/src/NativeSmoothClipModule.ts +104 -0
- package/src/SmoothClipView.android.tsx +2 -0
- package/src/SmoothClipView.ios.tsx +36 -0
- package/src/SmoothClipView.tsx +31 -27
- package/src/SmoothClipView.web.tsx +26 -22
- package/src/SmoothClipViewNativeComponent.ts +14 -1
- package/src/driverState.ts +150 -0
- package/src/driverTypes.ts +91 -0
- package/src/drivers.android.ts +6 -0
- package/src/drivers.ios.ts +665 -0
- package/src/drivers.ts +416 -0
- package/src/geometry.ts +39 -0
- package/src/index.ts +19 -1
- package/src/index.web.ts +19 -1
- package/src/nativeCompletion.ts +37 -0
- package/src/reactRequests.ts +64 -0
- package/src/smoothClipNative.android.ts +20 -0
- package/src/smoothClipNative.ts +5 -0
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useEffect, useRef } from 'react';
|
|
4
|
+
import { cancelAnimation as cancelReanimatedAnimation, Easing, ReduceMotion, useAnimatedReaction, useSharedValue, withSpring, withTiming } from 'react-native-reanimated';
|
|
5
|
+
import { scheduleOnRN, scheduleOnUI } from 'react-native-worklets';
|
|
6
|
+
import { allocateDriverId, attachDriverState, createDriverState, deliverDriverCompletion, detachDriverState, finishDriverAnimation, getDriverState, setDriverState, snapshotDriverViews } from "./driverState.js";
|
|
7
|
+
import { createClipPresentation, clipPresentationEquals, isFiniteClipPresentation } from "./geometry.js";
|
|
8
|
+
import { createReactRequest, rejectDriverRequests, resolveReactRequest } from "./reactRequests.js";
|
|
9
|
+
function toReanimatedReduceMotion(value) {
|
|
10
|
+
switch (value) {
|
|
11
|
+
case 'always':
|
|
12
|
+
return ReduceMotion.Always;
|
|
13
|
+
case 'never':
|
|
14
|
+
return ReduceMotion.Never;
|
|
15
|
+
default:
|
|
16
|
+
return ReduceMotion.System;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function animationIsFinite(animation) {
|
|
20
|
+
'worklet';
|
|
21
|
+
|
|
22
|
+
if (animation.type === 'timing') {
|
|
23
|
+
return Number.isFinite(animation.duration) && animation.controlPoints.every(Number.isFinite);
|
|
24
|
+
}
|
|
25
|
+
if (animation.type === 'spring') {
|
|
26
|
+
return [animation.mass ?? 1, animation.stiffness ?? 100, animation.damping ?? 10, animation.initialVelocity === 'inherit' ? 0 : animation.initialVelocity ?? 0].every(Number.isFinite);
|
|
27
|
+
}
|
|
28
|
+
let previousOffset = -1;
|
|
29
|
+
if (!Number.isFinite(animation.duration) || animation.frames.length < 2) {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
for (const frame of animation.frames) {
|
|
33
|
+
if (!Number.isFinite(frame.offset) || frame.offset < 0 || frame.offset > 1 || frame.offset <= previousOffset || !isFiniteClipPresentation(frame.presentation)) {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
previousOffset = frame.offset;
|
|
37
|
+
}
|
|
38
|
+
return animation.frames[0]?.offset === 0 && previousOffset === 1;
|
|
39
|
+
}
|
|
40
|
+
function interpolatePresentation(from, to, progress) {
|
|
41
|
+
'worklet';
|
|
42
|
+
|
|
43
|
+
const mix = (start, end) => start + (end - start) * progress;
|
|
44
|
+
return {
|
|
45
|
+
clip: {
|
|
46
|
+
x: mix(from.clip.x, to.clip.x),
|
|
47
|
+
y: mix(from.clip.y, to.clip.y),
|
|
48
|
+
width: mix(from.clip.width, to.clip.width),
|
|
49
|
+
height: mix(from.clip.height, to.clip.height),
|
|
50
|
+
radius: mix(from.clip.radius, to.clip.radius)
|
|
51
|
+
},
|
|
52
|
+
contentTranslateX: mix(from.contentTranslateX, to.contentTranslateX),
|
|
53
|
+
contentTranslateY: mix(from.contentTranslateY, to.contentTranslateY)
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
function finishFallback(driverId, animationId, finished) {
|
|
57
|
+
deliverDriverCompletion(driverId, animationId, finishDriverAnimation(driverId, animationId, finished));
|
|
58
|
+
}
|
|
59
|
+
export function useSmoothClipDriver(initialValue, options = {}) {
|
|
60
|
+
const initialPresentation = 'clip' in initialValue ? initialValue : createClipPresentation(initialValue);
|
|
61
|
+
const presentation = useSharedValue(initialPresentation);
|
|
62
|
+
const activeAnimationId = useSharedValue(0);
|
|
63
|
+
const nextAnimationId = useSharedValue(0);
|
|
64
|
+
const latestTarget = useSharedValue(initialPresentation);
|
|
65
|
+
const animationStart = useSharedValue(initialPresentation);
|
|
66
|
+
const animationProgress = useSharedValue(0);
|
|
67
|
+
const keyframes = useSharedValue([]);
|
|
68
|
+
const callbackRef = useRef(options.onAnimationComplete);
|
|
69
|
+
const driverRef = useRef(null);
|
|
70
|
+
callbackRef.current = options.onAnimationComplete;
|
|
71
|
+
useAnimatedReaction(() => animationProgress.value, progress => {
|
|
72
|
+
const frames = keyframes.value;
|
|
73
|
+
if (frames.length >= 2) {
|
|
74
|
+
let upperIndex = 1;
|
|
75
|
+
while (upperIndex < frames.length - 1 && progress > (frames[upperIndex]?.offset ?? 1)) {
|
|
76
|
+
upperIndex += 1;
|
|
77
|
+
}
|
|
78
|
+
const lower = frames[upperIndex - 1];
|
|
79
|
+
const upper = frames[upperIndex];
|
|
80
|
+
if (!lower || !upper) return;
|
|
81
|
+
const span = upper.offset - lower.offset;
|
|
82
|
+
const localProgress = span <= 0 ? 1 : (progress - lower.offset) / span;
|
|
83
|
+
presentation.value = interpolatePresentation(lower.presentation, upper.presentation, Math.min(1, Math.max(0, localProgress)));
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
presentation.value = interpolatePresentation(animationStart.value, latestTarget.value, progress);
|
|
87
|
+
}, [animationProgress, animationStart, keyframes, latestTarget, presentation]);
|
|
88
|
+
if (driverRef.current === null) {
|
|
89
|
+
const driverId = allocateDriverId();
|
|
90
|
+
const reduceMotion = toReanimatedReduceMotion(options.reduceMotion ?? 'system');
|
|
91
|
+
const beginOnUI = () => {
|
|
92
|
+
'worklet';
|
|
93
|
+
|
|
94
|
+
cancelReanimatedAnimation(animationProgress);
|
|
95
|
+
activeAnimationId.value = 0;
|
|
96
|
+
return presentation.value;
|
|
97
|
+
};
|
|
98
|
+
const setOnUI = next => {
|
|
99
|
+
'worklet';
|
|
100
|
+
|
|
101
|
+
if (!isFiniteClipPresentation(next)) return;
|
|
102
|
+
cancelReanimatedAnimation(animationProgress);
|
|
103
|
+
activeAnimationId.value = 0;
|
|
104
|
+
latestTarget.value = next;
|
|
105
|
+
presentation.value = next;
|
|
106
|
+
};
|
|
107
|
+
const animateOnUI = (next, animation) => {
|
|
108
|
+
'worklet';
|
|
109
|
+
|
|
110
|
+
nextAnimationId.value = nextAnimationId.value % 0x7ffffffe + 1;
|
|
111
|
+
const animationId = nextAnimationId.value;
|
|
112
|
+
if (!isFiniteClipPresentation(next) || !animationIsFinite(animation)) {
|
|
113
|
+
scheduleOnRN(finishFallback, driverId, animationId, false);
|
|
114
|
+
return animationId;
|
|
115
|
+
}
|
|
116
|
+
activeAnimationId.value = animationId;
|
|
117
|
+
animationStart.value = presentation.value;
|
|
118
|
+
latestTarget.value = next;
|
|
119
|
+
keyframes.value = [];
|
|
120
|
+
animationProgress.value = 0;
|
|
121
|
+
scheduleOnRN(snapshotDriverViews, driverId, animationId);
|
|
122
|
+
const onComplete = finished => {
|
|
123
|
+
'worklet';
|
|
124
|
+
|
|
125
|
+
if (activeAnimationId.value === animationId) {
|
|
126
|
+
activeAnimationId.value = 0;
|
|
127
|
+
}
|
|
128
|
+
scheduleOnRN(finishFallback, driverId, animationId, finished === true);
|
|
129
|
+
};
|
|
130
|
+
if (animation.type === 'timing') {
|
|
131
|
+
const [x1, y1, x2, y2] = animation.controlPoints;
|
|
132
|
+
animationProgress.value = withTiming(1, {
|
|
133
|
+
duration: Math.max(0, animation.duration),
|
|
134
|
+
easing: Easing.bezier(x1, y1, x2, y2),
|
|
135
|
+
reduceMotion
|
|
136
|
+
}, onComplete);
|
|
137
|
+
} else if (animation.type === 'spring') {
|
|
138
|
+
const configuredVelocity = animation.initialVelocity;
|
|
139
|
+
animationProgress.value = withSpring(1, {
|
|
140
|
+
damping: animation.damping ?? 10,
|
|
141
|
+
mass: animation.mass ?? 1,
|
|
142
|
+
reduceMotion,
|
|
143
|
+
stiffness: animation.stiffness ?? 100,
|
|
144
|
+
// The fallback driver cannot sample native presentation motion,
|
|
145
|
+
// so 'inherit' (and undefined) degrade to zero launch velocity.
|
|
146
|
+
velocity: typeof configuredVelocity === 'number' ? configuredVelocity : 0
|
|
147
|
+
}, onComplete);
|
|
148
|
+
} else {
|
|
149
|
+
if (!clipPresentationEquals(animation.frames[animation.frames.length - 1]?.presentation ?? null, next)) {
|
|
150
|
+
scheduleOnRN(finishFallback, driverId, animationId, false);
|
|
151
|
+
activeAnimationId.value = 0;
|
|
152
|
+
return animationId;
|
|
153
|
+
}
|
|
154
|
+
keyframes.value = animation.frames;
|
|
155
|
+
animationProgress.value = withTiming(1, {
|
|
156
|
+
duration: Math.max(0, animation.duration),
|
|
157
|
+
easing: Easing.linear,
|
|
158
|
+
reduceMotion
|
|
159
|
+
}, onComplete);
|
|
160
|
+
}
|
|
161
|
+
return animationId;
|
|
162
|
+
};
|
|
163
|
+
const cancelOnUI = (animationId = 0, behavior = 'current') => {
|
|
164
|
+
'worklet';
|
|
165
|
+
|
|
166
|
+
if (animationId !== 0 && animationId !== activeAnimationId.value) {
|
|
167
|
+
return presentation.value;
|
|
168
|
+
}
|
|
169
|
+
cancelReanimatedAnimation(animationProgress);
|
|
170
|
+
activeAnimationId.value = 0;
|
|
171
|
+
if (behavior === 'target') presentation.value = latestTarget.value;
|
|
172
|
+
return presentation.value;
|
|
173
|
+
};
|
|
174
|
+
const setScalarsOnUI = (x, y, width, height, radius, contentTranslateX, contentTranslateY) => {
|
|
175
|
+
'worklet';
|
|
176
|
+
|
|
177
|
+
setOnUI({
|
|
178
|
+
clip: {
|
|
179
|
+
x,
|
|
180
|
+
y,
|
|
181
|
+
width,
|
|
182
|
+
height,
|
|
183
|
+
radius
|
|
184
|
+
},
|
|
185
|
+
contentTranslateX,
|
|
186
|
+
contentTranslateY
|
|
187
|
+
});
|
|
188
|
+
};
|
|
189
|
+
const driver = {
|
|
190
|
+
kind: 'hybrid',
|
|
191
|
+
presentation,
|
|
192
|
+
// Every worklet here shares the single JS runtime, so unlike the native
|
|
193
|
+
// driver there is no runtime guard on `ui`: calling it from React code
|
|
194
|
+
// is harmless in this fallback.
|
|
195
|
+
ui: {
|
|
196
|
+
beginInteraction: beginOnUI,
|
|
197
|
+
set: setOnUI,
|
|
198
|
+
setScalars: setScalarsOnUI,
|
|
199
|
+
animateTo: animateOnUI,
|
|
200
|
+
cancel: cancelOnUI
|
|
201
|
+
},
|
|
202
|
+
react: {
|
|
203
|
+
beginInteraction() {
|
|
204
|
+
const {
|
|
205
|
+
requestId,
|
|
206
|
+
promise
|
|
207
|
+
} = createReactRequest(driverId);
|
|
208
|
+
scheduleOnUI(() => {
|
|
209
|
+
'worklet';
|
|
210
|
+
|
|
211
|
+
const result = beginOnUI();
|
|
212
|
+
scheduleOnRN(resolveReactRequest, driverId, requestId, result);
|
|
213
|
+
});
|
|
214
|
+
return promise;
|
|
215
|
+
},
|
|
216
|
+
set(next) {
|
|
217
|
+
const {
|
|
218
|
+
requestId,
|
|
219
|
+
promise
|
|
220
|
+
} = createReactRequest(driverId);
|
|
221
|
+
scheduleOnUI(() => {
|
|
222
|
+
'worklet';
|
|
223
|
+
|
|
224
|
+
setOnUI(next);
|
|
225
|
+
scheduleOnRN(resolveReactRequest, driverId, requestId, undefined);
|
|
226
|
+
});
|
|
227
|
+
return promise;
|
|
228
|
+
},
|
|
229
|
+
animateTo(next, animation) {
|
|
230
|
+
const {
|
|
231
|
+
requestId,
|
|
232
|
+
promise
|
|
233
|
+
} = createReactRequest(driverId, true);
|
|
234
|
+
scheduleOnUI(() => {
|
|
235
|
+
'worklet';
|
|
236
|
+
|
|
237
|
+
const result = animateOnUI(next, animation);
|
|
238
|
+
scheduleOnRN(resolveReactRequest, driverId, requestId, result, true);
|
|
239
|
+
});
|
|
240
|
+
return promise;
|
|
241
|
+
},
|
|
242
|
+
cancel(animationId = 0, behavior = 'current') {
|
|
243
|
+
const {
|
|
244
|
+
requestId,
|
|
245
|
+
promise
|
|
246
|
+
} = createReactRequest(driverId, true);
|
|
247
|
+
scheduleOnUI(() => {
|
|
248
|
+
'worklet';
|
|
249
|
+
|
|
250
|
+
const result = cancelOnUI(animationId, behavior);
|
|
251
|
+
scheduleOnRN(resolveReactRequest, driverId, requestId, result, true);
|
|
252
|
+
});
|
|
253
|
+
return promise;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
};
|
|
257
|
+
setDriverState(driver, createDriverState(driverId, initialPresentation, presentation, callbackRef, activeAnimationId));
|
|
258
|
+
driverRef.current = driver;
|
|
259
|
+
}
|
|
260
|
+
const driver = driverRef.current;
|
|
261
|
+
useEffect(() => {
|
|
262
|
+
const currentDriver = driverRef.current;
|
|
263
|
+
if (!currentDriver) return undefined;
|
|
264
|
+
const state = getDriverState(currentDriver);
|
|
265
|
+
// Re-attach on effect replays (StrictMode/<Activity>) after a cleanup
|
|
266
|
+
// detached this state.
|
|
267
|
+
attachDriverState(state);
|
|
268
|
+
return () => {
|
|
269
|
+
cancelReanimatedAnimation(animationProgress);
|
|
270
|
+
rejectDriverRequests(state.driverId);
|
|
271
|
+
detachDriverState(state);
|
|
272
|
+
};
|
|
273
|
+
}, [animationProgress]);
|
|
274
|
+
return driver;
|
|
275
|
+
}
|
|
276
|
+
//# sourceMappingURL=drivers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useEffect","useRef","cancelAnimation","cancelReanimatedAnimation","Easing","ReduceMotion","useAnimatedReaction","useSharedValue","withSpring","withTiming","scheduleOnRN","scheduleOnUI","allocateDriverId","attachDriverState","createDriverState","deliverDriverCompletion","detachDriverState","finishDriverAnimation","getDriverState","setDriverState","snapshotDriverViews","createClipPresentation","clipPresentationEquals","isFiniteClipPresentation","createReactRequest","rejectDriverRequests","resolveReactRequest","toReanimatedReduceMotion","value","Always","Never","System","animationIsFinite","animation","type","Number","isFinite","duration","controlPoints","every","mass","stiffness","damping","initialVelocity","previousOffset","frames","length","frame","offset","presentation","interpolatePresentation","from","to","progress","mix","start","end","clip","x","y","width","height","radius","contentTranslateX","contentTranslateY","finishFallback","driverId","animationId","finished","useSmoothClipDriver","initialValue","options","initialPresentation","activeAnimationId","nextAnimationId","latestTarget","animationStart","animationProgress","keyframes","callbackRef","onAnimationComplete","driverRef","current","upperIndex","lower","upper","span","localProgress","Math","min","max","reduceMotion","beginOnUI","setOnUI","next","animateOnUI","onComplete","x1","y1","x2","y2","easing","bezier","configuredVelocity","velocity","linear","cancelOnUI","behavior","setScalarsOnUI","driver","kind","ui","beginInteraction","set","setScalars","animateTo","cancel","react","requestId","promise","result","undefined","currentDriver","state"],"sourceRo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B,CAACkG,KAAK,CAACzD,QAAQ,CAAC;MACpClD,iBAAiB,CAAC2G,KAAK,CAAC;IAC1B,CAAC;EACH,CAAC,EAAE,CAAC9C,iBAAiB,CAAC,CAAC;EACvB,OAAOgC,MAAM;AACf","ignoreList":[]}
|
package/lib/module/geometry.js
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
export function createClipPresentation(clip, contentTranslateX = 0, contentTranslateY = 0) {
|
|
4
|
+
'worklet';
|
|
5
|
+
|
|
6
|
+
return {
|
|
7
|
+
clip,
|
|
8
|
+
contentTranslateX,
|
|
9
|
+
contentTranslateY
|
|
10
|
+
};
|
|
11
|
+
}
|
|
3
12
|
export function isFiniteClipGeometry(geometry) {
|
|
4
13
|
'worklet';
|
|
5
14
|
|
|
@@ -10,6 +19,16 @@ export function clipGeometryEquals(first, second) {
|
|
|
10
19
|
|
|
11
20
|
return first !== null && first.x === second.x && first.y === second.y && first.width === second.width && first.height === second.height && first.radius === second.radius;
|
|
12
21
|
}
|
|
22
|
+
export function isFiniteClipPresentation(presentation) {
|
|
23
|
+
'worklet';
|
|
24
|
+
|
|
25
|
+
return isFiniteClipGeometry(presentation.clip) && Number.isFinite(presentation.contentTranslateX) && Number.isFinite(presentation.contentTranslateY);
|
|
26
|
+
}
|
|
27
|
+
export function clipPresentationEquals(first, second) {
|
|
28
|
+
'worklet';
|
|
29
|
+
|
|
30
|
+
return first !== null && clipGeometryEquals(first.clip, second.clip) && first.contentTranslateX === second.contentTranslateX && first.contentTranslateY === second.contentTranslateY;
|
|
31
|
+
}
|
|
13
32
|
|
|
14
33
|
/**
|
|
15
34
|
* Mirrors the native geometry contract for tests and non-native fallbacks.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isFiniteClipGeometry","geometry","Number","isFinite","x","y","width","height","radius","clipGeometryEquals","first","second","normalizeClipGeometry","bounds","values","every","boundsWidth","Math","max","boundsHeight","requestedWidth","requestedHeight","left","min","top","right","bottom"],"sourceRoot":"../../src","sources":["geometry.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"names":["createClipPresentation","clip","contentTranslateX","contentTranslateY","isFiniteClipGeometry","geometry","Number","isFinite","x","y","width","height","radius","clipGeometryEquals","first","second","isFiniteClipPresentation","presentation","clipPresentationEquals","normalizeClipGeometry","bounds","values","every","boundsWidth","Math","max","boundsHeight","requestedWidth","requestedHeight","left","min","top","right","bottom"],"sourceRoot":"../../src","sources":["geometry.ts"],"mappings":";;AAmBA,OAAO,SAASA,sBAAsBA,CACpCC,IAAkB,EAClBC,iBAAiB,GAAG,CAAC,EACrBC,iBAAiB,GAAG,CAAC,EACG;EACxB,SAAS;;EACT,OAAO;IAAEF,IAAI;IAAEC,iBAAiB;IAAEC;EAAkB,CAAC;AACvD;AAEA,OAAO,SAASC,oBAAoBA,CAACC,QAAsB,EAAW;EACpE,SAAS;;EACT,OACEC,MAAM,CAACC,QAAQ,CAACF,QAAQ,CAACG,CAAC,CAAC,IAC3BF,MAAM,CAACC,QAAQ,CAACF,QAAQ,CAACI,CAAC,CAAC,IAC3BH,MAAM,CAACC,QAAQ,CAACF,QAAQ,CAACK,KAAK,CAAC,IAC/BJ,MAAM,CAACC,QAAQ,CAACF,QAAQ,CAACM,MAAM,CAAC,IAChCL,MAAM,CAACC,QAAQ,CAACF,QAAQ,CAACO,MAAM,CAAC;AAEpC;AAEA,OAAO,SAASC,kBAAkBA,CAChCC,KAA0B,EAC1BC,MAAoB,EACX;EACT,SAAS;;EACT,OACED,KAAK,KAAK,IAAI,IACdA,KAAK,CAACN,CAAC,KAAKO,MAAM,CAACP,CAAC,IACpBM,KAAK,CAACL,CAAC,KAAKM,MAAM,CAACN,CAAC,IACpBK,KAAK,CAACJ,KAAK,KAAKK,MAAM,CAACL,KAAK,IAC5BI,KAAK,CAACH,MAAM,KAAKI,MAAM,CAACJ,MAAM,IAC9BG,KAAK,CAACF,MAAM,KAAKG,MAAM,CAACH,MAAM;A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
|
4
|
+
export { useSmoothClipDriver } from './drivers';
|
|
4
5
|
export { normalizeClipGeometry } from "./geometry.js";
|
|
6
|
+
export { createClipPresentation } from "./geometry.js";
|
|
5
7
|
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SmoothClipView","normalizeClipGeometry"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,SAASA,cAAc,QAAQ,kBAAkB;AAEjD,SAASC,qBAAqB,QAAQ,eAAY","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["SmoothClipView","useSmoothClipDriver","normalizeClipGeometry","createClipPresentation"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,SAASA,cAAc,QAAQ,kBAAkB;AAEjD,SAASC,mBAAmB,QAAQ,WAAW;AAa/C,SAASC,qBAAqB,QAAQ,eAAY;AAClD,SAASC,sBAAsB,QAAQ,eAAY","ignoreList":[]}
|
package/lib/module/index.web.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
export { SmoothClipView } from "./SmoothClipView.web.js";
|
|
4
|
+
export { useSmoothClipDriver } from './drivers';
|
|
4
5
|
export { normalizeClipGeometry } from "./geometry.js";
|
|
6
|
+
export { createClipPresentation } from "./geometry.js";
|
|
5
7
|
//# sourceMappingURL=index.web.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SmoothClipView","normalizeClipGeometry"],"sourceRoot":"../../src","sources":["index.web.ts"],"mappings":";;AAAA,SAASA,cAAc,QAAQ,yBAAsB;AAErD,SAASC,qBAAqB,QAAQ,eAAY","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["SmoothClipView","useSmoothClipDriver","normalizeClipGeometry","createClipPresentation"],"sourceRoot":"../../src","sources":["index.web.ts"],"mappings":";;AAAA,SAASA,cAAc,QAAQ,yBAAsB;AAErD,SAASC,mBAAmB,QAAQ,WAAW;AAa/C,SAASC,qBAAqB,QAAQ,eAAY;AAClD,SAASC,sBAAsB,QAAQ,eAAY","ignoreList":[]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { scheduleOnUI } from 'react-native-worklets';
|
|
4
|
+
import { deliverDriverCompletion } from "./driverState.js";
|
|
5
|
+
export function completeNativeAnimation(driverId, animationId, finished) {
|
|
6
|
+
deliverDriverCompletion(driverId, animationId, finished);
|
|
7
|
+
}
|
|
8
|
+
export function synchronizeNativeCompletion(activeAnimationId, ownership, animationId, _finished) {
|
|
9
|
+
// Unfinished completions must also release ownership: native emits
|
|
10
|
+
// finished:false when the last participating view unmounts or the system
|
|
11
|
+
// strips the animation. Superseded ids are already filtered by the
|
|
12
|
+
// active-id comparison below, so no finished-based gate is needed.
|
|
13
|
+
scheduleOnUI((active, owner, completedId) => {
|
|
14
|
+
'worklet';
|
|
15
|
+
|
|
16
|
+
if (active.value !== completedId) return;
|
|
17
|
+
active.value = 0;
|
|
18
|
+
owner.value = 0;
|
|
19
|
+
}, activeAnimationId, ownership, animationId);
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=nativeCompletion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["scheduleOnUI","deliverDriverCompletion","completeNativeAnimation","driverId","animationId","finished","synchronizeNativeCompletion","activeAnimationId","ownership","_finished","active","owner","completedId","value"],"sourceRoot":"../../src","sources":["nativeCompletion.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,uBAAuB;AACpD,SAASC,uBAAuB,QAAQ,kBAAe;AAEvD,OAAO,SAASC,uBAAuBA,CACrCC,QAAgB,EAChBC,WAAmB,EACnBC,QAAiB,EACX;EACNJ,uBAAuB,CAACE,QAAQ,EAAEC,WAAW,EAAEC,QAAQ,CAAC;AAC1D;AAEA,OAAO,SAASC,2BAA2BA,CACzCC,iBAAoC,EACpCC,SAA4B,EAC5BJ,WAAmB,EACnBK,SAAkB,EACZ;EACN;EACA;EACA;EACA;EACAT,YAAY,CACV,CACEU,MAAyB,EACzBC,KAAwB,EACxBC,WAAmB,KAChB;IACH,SAAS;;IACT,IAAIF,MAAM,CAACG,KAAK,KAAKD,WAAW,EAAE;IAClCF,MAAM,CAACG,KAAK,GAAG,CAAC;IAChBF,KAAK,CAACE,KAAK,GAAG,CAAC;EACjB,CAAC,EACDN,iBAAiB,EACjBC,SAAS,EACTJ,WACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { deferDriverCompletions, releaseDriverCompletions } from "./driverState.js";
|
|
4
|
+
const requests = new Map();
|
|
5
|
+
const requestsByDriver = new Map();
|
|
6
|
+
let nextRequestId = 0;
|
|
7
|
+
export function createReactRequest(driverId, deferCompletions = false) {
|
|
8
|
+
nextRequestId = nextRequestId % 0x7ffffffe + 1;
|
|
9
|
+
const requestId = nextRequestId;
|
|
10
|
+
let resolveRequest;
|
|
11
|
+
let rejectRequest;
|
|
12
|
+
const promise = new Promise((resolve, reject) => {
|
|
13
|
+
resolveRequest = resolve;
|
|
14
|
+
rejectRequest = reject;
|
|
15
|
+
});
|
|
16
|
+
requests.set(requestId, {
|
|
17
|
+
resolve: resolveRequest,
|
|
18
|
+
reject: rejectRequest
|
|
19
|
+
});
|
|
20
|
+
const driverRequests = requestsByDriver.get(driverId) ?? new Set();
|
|
21
|
+
driverRequests.add(requestId);
|
|
22
|
+
requestsByDriver.set(driverId, driverRequests);
|
|
23
|
+
if (deferCompletions) deferDriverCompletions(driverId);
|
|
24
|
+
return {
|
|
25
|
+
requestId,
|
|
26
|
+
promise
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export function resolveReactRequest(driverId, requestId, value, releaseCompletions = false) {
|
|
30
|
+
const request = requests.get(requestId);
|
|
31
|
+
requests.delete(requestId);
|
|
32
|
+
const driverRequests = requestsByDriver.get(driverId);
|
|
33
|
+
driverRequests?.delete(requestId);
|
|
34
|
+
if (driverRequests?.size === 0) requestsByDriver.delete(driverId);
|
|
35
|
+
request?.resolve(value);
|
|
36
|
+
if (releaseCompletions) {
|
|
37
|
+
queueMicrotask(() => releaseDriverCompletions(driverId));
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export function rejectDriverRequests(driverId) {
|
|
41
|
+
const driverRequests = requestsByDriver.get(driverId);
|
|
42
|
+
if (!driverRequests) return;
|
|
43
|
+
for (const requestId of driverRequests) {
|
|
44
|
+
const request = requests.get(requestId);
|
|
45
|
+
requests.delete(requestId);
|
|
46
|
+
request?.reject(new Error('[SmoothClipView] Driver was destroyed.'));
|
|
47
|
+
}
|
|
48
|
+
requestsByDriver.delete(driverId);
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=reactRequests.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["deferDriverCompletions","releaseDriverCompletions","requests","Map","requestsByDriver","nextRequestId","createReactRequest","driverId","deferCompletions","requestId","resolveRequest","rejectRequest","promise","Promise","resolve","reject","set","driverRequests","get","Set","add","resolveReactRequest","value","releaseCompletions","request","delete","size","queueMicrotask","rejectDriverRequests","Error"],"sourceRoot":"../../src","sources":["reactRequests.ts"],"mappings":";;AAAA,SACEA,sBAAsB,EACtBC,wBAAwB,QACnB,kBAAe;AAOtB,MAAMC,QAAQ,GAAG,IAAIC,GAAG,CAAyB,CAAC;AAClD,MAAMC,gBAAgB,GAAG,IAAID,GAAG,CAAsB,CAAC;AACvD,IAAIE,aAAa,GAAG,CAAC;AAErB,OAAO,SAASC,kBAAkBA,CAChCC,QAAgB,EAChBC,gBAAgB,GAAG,KAAK,EACoB;EAC5CH,aAAa,GAAIA,aAAa,GAAG,UAAU,GAAI,CAAC;EAChD,MAAMI,SAAS,GAAGJ,aAAa;EAC/B,IAAIK,cAAmC;EACvC,IAAIC,aAAsC;EAC1C,MAAMC,OAAO,GAAG,IAAIC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D,IAAI,CAACU,cAAc,EAAE;EACrB,KAAK,MAAMR,SAAS,IAAIQ,cAAc,EAAE;IACtC,MAAMO,OAAO,GAAGtB,QAAQ,CAACgB,GAAG,CAACT,SAAS,CAAC;IACvCP,QAAQ,CAACuB,MAAM,CAAChB,SAAS,CAAC;IAC1Be,OAAO,EAAET,MAAM,CAAC,IAAIc,KAAK,CAAC,wCAAwC,CAAC,CAAC;EACtE;EACAzB,gBAAgB,CAACqB,MAAM,CAAClB,QAAQ,CAAC;AACnC","ignoreList":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { TurboModuleRegistry } from 'react-native';
|
|
4
|
+
// A Java/Kotlin TurboModule host function cannot be invoked synchronously from
|
|
5
|
+
// the Worklets UI runtime. The Android module therefore installs worklet-callable
|
|
6
|
+
// C++ host functions via TurboModuleWithJSIBindings. Resolving the module runs
|
|
7
|
+
// that installer synchronously (see TurboModuleManager), after which the driver
|
|
8
|
+
// uses the installed `global.__SmoothClipView` on both the UI and JS runtimes.
|
|
9
|
+
TurboModuleRegistry.getEnforcing('NativeSmoothClipModule');
|
|
10
|
+
const bindings = global.__SmoothClipView;
|
|
11
|
+
if (bindings == null) {
|
|
12
|
+
throw new Error('[SmoothClipView] Native JSI bindings are not installed. Rebuild the Android app after updating this package.');
|
|
13
|
+
}
|
|
14
|
+
export default bindings;
|
|
15
|
+
//# sourceMappingURL=smoothClipNative.android.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["TurboModuleRegistry","getEnforcing","bindings","global","__SmoothClipView","Error"],"sourceRoot":"../../src","sources":["smoothClipNative.android.ts"],"mappings":";;AAAA,SAASA,mBAAmB,QAAQ,cAAc;AAGlD;AACA;AACA;AACA;AACA;AACAA,mBAAmB,CAACC,YAAY,CAAO,wBAAwB,CAAC;AAEhE,MAAMC,QAAQ,GAAIC,MAAM,CACrBC,gBAAgB;AAEnB,IAAIF,QAAQ,IAAI,IAAI,EAAE;EACpB,MAAM,IAAIG,KAAK,CACb,8GACF,CAAC;AACH;AAEA,eAAeH,QAAQ","ignoreList":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import NativeSmoothClipModule from "./NativeSmoothClipModule.js";
|
|
4
|
+
|
|
5
|
+
// iOS/default: the C++ TurboModule host functions are already worklet-callable,
|
|
6
|
+
// so the driver captures them directly from the module.
|
|
7
|
+
export default NativeSmoothClipModule;
|
|
8
|
+
//# sourceMappingURL=smoothClipNative.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["NativeSmoothClipModule"],"sourceRoot":"../../src","sources":["smoothClipNative.ts"],"mappings":";;AAAA,OAAOA,sBAAsB,MAAM,6BAA0B;;AAE7D;AACA;AACA,eAAeA,sBAAsB","ignoreList":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { CodegenTypes, TurboModule } from 'react-native';
|
|
2
|
+
export interface Spec extends TurboModule {
|
|
3
|
+
readonly onClipAnimationComplete: CodegenTypes.EventEmitter<Readonly<{
|
|
4
|
+
driverId: CodegenTypes.Double;
|
|
5
|
+
animationId: CodegenTypes.Int32;
|
|
6
|
+
finished: boolean;
|
|
7
|
+
}>>;
|
|
8
|
+
setClipPresentation(driverId: CodegenTypes.Double, x: CodegenTypes.Double, y: CodegenTypes.Double, width: CodegenTypes.Double, height: CodegenTypes.Double, radius: CodegenTypes.Double, contentTranslateX: CodegenTypes.Double, contentTranslateY: CodegenTypes.Double, takeOwnership: boolean): void;
|
|
9
|
+
beginInteraction(driverId: CodegenTypes.Double): ReadonlyArray<CodegenTypes.Double>;
|
|
10
|
+
animateTiming(driverId: CodegenTypes.Double, hasInteractiveStart: boolean, startX: CodegenTypes.Double, startY: CodegenTypes.Double, startWidth: CodegenTypes.Double, startHeight: CodegenTypes.Double, startRadius: CodegenTypes.Double, startContentTranslateX: CodegenTypes.Double, startContentTranslateY: CodegenTypes.Double, x: CodegenTypes.Double, y: CodegenTypes.Double, width: CodegenTypes.Double, height: CodegenTypes.Double, radius: CodegenTypes.Double, contentTranslateX: CodegenTypes.Double, contentTranslateY: CodegenTypes.Double, durationMs: CodegenTypes.Double, controlPoint1X: CodegenTypes.Double, controlPoint1Y: CodegenTypes.Double, controlPoint2X: CodegenTypes.Double, controlPoint2Y: CodegenTypes.Double, reduceMotion: CodegenTypes.Int32): CodegenTypes.Int32;
|
|
11
|
+
animateSpring(driverId: CodegenTypes.Double, hasInteractiveStart: boolean, startX: CodegenTypes.Double, startY: CodegenTypes.Double, startWidth: CodegenTypes.Double, startHeight: CodegenTypes.Double, startRadius: CodegenTypes.Double, startContentTranslateX: CodegenTypes.Double, startContentTranslateY: CodegenTypes.Double, x: CodegenTypes.Double, y: CodegenTypes.Double, width: CodegenTypes.Double, height: CodegenTypes.Double, radius: CodegenTypes.Double, contentTranslateX: CodegenTypes.Double, contentTranslateY: CodegenTypes.Double, mass: CodegenTypes.Double, stiffness: CodegenTypes.Double, damping: CodegenTypes.Double, initialVelocity: CodegenTypes.Double, inheritVelocity: boolean, reduceMotion: CodegenTypes.Int32): CodegenTypes.Int32;
|
|
12
|
+
animateKeyframes(driverId: CodegenTypes.Double, hasInteractiveStart: boolean, startX: CodegenTypes.Double, startY: CodegenTypes.Double, startWidth: CodegenTypes.Double, startHeight: CodegenTypes.Double, startRadius: CodegenTypes.Double, startContentTranslateX: CodegenTypes.Double, startContentTranslateY: CodegenTypes.Double, x: CodegenTypes.Double, y: CodegenTypes.Double, width: CodegenTypes.Double, height: CodegenTypes.Double, radius: CodegenTypes.Double, contentTranslateX: CodegenTypes.Double, contentTranslateY: CodegenTypes.Double, durationMs: CodegenTypes.Double, frames: ReadonlyArray<CodegenTypes.Double>, reduceMotion: CodegenTypes.Int32): CodegenTypes.Int32;
|
|
13
|
+
rejectAnimation(driverId: CodegenTypes.Double): CodegenTypes.Int32;
|
|
14
|
+
cancelAnimation(driverId: CodegenTypes.Double, animationId: CodegenTypes.Int32, behavior: CodegenTypes.Int32): ReadonlyArray<CodegenTypes.Double>;
|
|
15
|
+
destroyDriver(driverId: CodegenTypes.Double): void;
|
|
16
|
+
}
|
|
17
|
+
declare const _default: Spec;
|
|
18
|
+
export default _default;
|
|
19
|
+
//# sourceMappingURL=NativeSmoothClipModule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativeSmoothClipModule.d.ts","sourceRoot":"","sources":["../../../src/NativeSmoothClipModule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAG9D,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,QAAQ,CAAC,uBAAuB,EAAE,YAAY,CAAC,YAAY,CACzD,QAAQ,CAAC;QACP,QAAQ,EAAE,YAAY,CAAC,MAAM,CAAC;QAC9B,WAAW,EAAE,YAAY,CAAC,KAAK,CAAC;QAChC,QAAQ,EAAE,OAAO,CAAC;KACnB,CAAC,CACH,CAAC;IACF,mBAAmB,CACjB,QAAQ,EAAE,YAAY,CAAC,MAAM,EAC7B,CAAC,EAAE,YAAY,CAAC,MAAM,EACtB,CAAC,EAAE,YAAY,CAAC,MAAM,EACtB,KAAK,EAAE,YAAY,CAAC,MAAM,EAC1B,MAAM,EAAE,YAAY,CAAC,MAAM,EAC3B,MAAM,EAAE,YAAY,CAAC,MAAM,EAC3B,iBAAiB,EAAE,YAAY,CAAC,MAAM,EACtC,iBAAiB,EAAE,YAAY,CAAC,MAAM,EACtC,aAAa,EAAE,OAAO,GACrB,IAAI,CAAC;IACR,gBAAgB,CACd,QAAQ,EAAE,YAAY,CAAC,MAAM,GAC5B,aAAa,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;IACtC,aAAa,CACX,QAAQ,EAAE,YAAY,CAAC,MAAM,EAC7B,mBAAmB,EAAE,OAAO,EAC5B,MAAM,EAAE,YAAY,CAAC,MAAM,EAC3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EAC7B,WAAW,EAAE,YAAY,CAAC,KAAK,EAC/B,QAAQ,EAAE,YAAY,CAAC,KAAK,GAC3B,aAAa,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;IACtC,aAAa,CAAC,QAAQ,EAAE,YAAY,CAAC,MAAM,GAAG,IAAI,CAAC;CACpD;;AAED,wBAAgF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SmoothClipView.android.d.ts","sourceRoot":"","sources":["../../../src/SmoothClipView.android.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAsB,CAAC;AACtD,YAAY,EAAE,mBAAmB,EAAE,MAAM,yBAAsB,CAAC"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
import type
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
3
|
import { type ViewProps } from 'react-native';
|
|
4
|
-
import {
|
|
5
|
-
import { type ClipGeometry } from './geometry.js';
|
|
4
|
+
import type { SmoothClipDriver } from './driverTypes.js';
|
|
6
5
|
export type SmoothClipViewProps = ViewProps & {
|
|
7
|
-
|
|
8
|
-
animatedClip: SharedValue<ClipGeometry>;
|
|
6
|
+
driver: SmoothClipDriver;
|
|
9
7
|
children?: ReactNode;
|
|
10
8
|
};
|
|
11
|
-
|
|
9
|
+
/** Android fallback. iOS resolves SmoothClipView.ios.tsx instead. */
|
|
10
|
+
export declare function SmoothClipView({ driver, children, ...viewProps }: SmoothClipViewProps): React.JSX.Element;
|
|
12
11
|
//# sourceMappingURL=SmoothClipView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SmoothClipView.d.ts","sourceRoot":"","sources":["../../../src/SmoothClipView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"SmoothClipView.d.ts","sourceRoot":"","sources":["../../../src/SmoothClipView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,SAAS,EAAa,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAM9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAe,CAAC;AAUtD,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG;IAC5C,MAAM,EAAE,gBAAgB,CAAC;IACzB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF,qEAAqE;AACrE,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,QAAQ,EACR,GAAG,SAAS,EACb,EAAE,mBAAmB,qBA+CrB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { type ViewProps } from 'react-native';
|
|
3
|
+
import type { SmoothClipDriver } from './driverTypes.js';
|
|
4
|
+
export type SmoothClipViewProps = ViewProps & {
|
|
5
|
+
driver: SmoothClipDriver;
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
};
|
|
8
|
+
export declare function SmoothClipView({ driver, children, ...viewProps }: SmoothClipViewProps): import("react").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=SmoothClipView.ios.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SmoothClipView.ios.d.ts","sourceRoot":"","sources":["../../../src/SmoothClipView.ios.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAe,CAAC;AAMtD,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG;IAC5C,MAAM,EAAE,gBAAgB,CAAC;IACzB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,QAAQ,EACR,GAAG,SAAS,EACb,EAAE,mBAAmB,+BAkBrB"}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
2
|
import { type ViewProps } from 'react-native';
|
|
3
|
-
import {
|
|
4
|
-
import { type ClipGeometry } from './geometry.js';
|
|
3
|
+
import type { SmoothClipDriver } from './driverTypes.js';
|
|
5
4
|
export type SmoothClipViewProps = ViewProps & {
|
|
6
|
-
|
|
7
|
-
animatedClip: SharedValue<ClipGeometry>;
|
|
5
|
+
driver: SmoothClipDriver;
|
|
8
6
|
children?: ReactNode;
|
|
9
7
|
};
|
|
10
|
-
/**
|
|
11
|
-
export declare function SmoothClipView({
|
|
8
|
+
/** Fixed-layout CSS fallback. */
|
|
9
|
+
export declare function SmoothClipView({ driver, children, style, ...viewProps }: SmoothClipViewProps): import("react").JSX.Element;
|
|
12
10
|
//# sourceMappingURL=SmoothClipView.web.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SmoothClipView.web.d.ts","sourceRoot":"","sources":["../../../src/SmoothClipView.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"SmoothClipView.web.d.ts","sourceRoot":"","sources":["../../../src/SmoothClipView.web.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAa,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,KAAK,SAAS,EAAkB,MAAM,cAAc,CAAC;AAM9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAe,CAAC;AAKtD,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG;IAC5C,MAAM,EAAE,gBAAgB,CAAC;IACzB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF,iCAAiC;AACjC,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,QAAQ,EACR,KAAK,EACL,GAAG,SAAS,EACb,EAAE,mBAAmB,+BA0CrB"}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import { type CodegenTypes, type HostComponent, type ViewProps } from 'react-native';
|
|
2
2
|
export interface NativeProps extends ViewProps {
|
|
3
|
+
driverId: CodegenTypes.Double;
|
|
3
4
|
initialClipX: CodegenTypes.Double;
|
|
4
5
|
initialClipY: CodegenTypes.Double;
|
|
5
6
|
initialClipWidth: CodegenTypes.Double;
|
|
6
7
|
initialClipHeight: CodegenTypes.Double;
|
|
7
8
|
initialClipRadius: CodegenTypes.Double;
|
|
9
|
+
initialContentTranslateX: CodegenTypes.Double;
|
|
10
|
+
initialContentTranslateY: CodegenTypes.Double;
|
|
8
11
|
}
|
|
9
12
|
interface NativeCommands {
|
|
10
13
|
setClipGeometry: (viewRef: React.ElementRef<HostComponent<NativeProps>>, x: CodegenTypes.Double, y: CodegenTypes.Double, width: CodegenTypes.Double, height: CodegenTypes.Double, radius: CodegenTypes.Double) => void;
|
|
14
|
+
setClipPresentation: (viewRef: React.ElementRef<HostComponent<NativeProps>>, x: CodegenTypes.Double, y: CodegenTypes.Double, width: CodegenTypes.Double, height: CodegenTypes.Double, radius: CodegenTypes.Double, contentTranslateX: CodegenTypes.Double, contentTranslateY: CodegenTypes.Double) => void;
|
|
11
15
|
}
|
|
12
16
|
export declare const Commands: NativeCommands;
|
|
13
17
|
declare const _default: HostComponent<NativeProps>;
|