react-native-smooth-clip-view 0.2.4 → 0.2.6

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 (40) hide show
  1. package/README.md +62 -25
  2. package/android/CMakeLists.txt +0 -1
  3. package/android/src/main/cpp/SmoothClipAndroid.h +5 -0
  4. package/android/src/main/cpp/SmoothClipBindings.cpp +28 -8
  5. package/android/src/main/cpp/SmoothClipRegistry.cpp +198 -189
  6. package/android/src/main/java/com/smoothclipview/ClipGeometryNormalizer.kt +61 -11
  7. package/android/src/main/java/com/smoothclipview/SmoothClipBindings.kt +20 -0
  8. package/android/src/main/java/com/smoothclipview/SmoothClipModule.kt +1 -0
  9. package/android/src/main/java/com/smoothclipview/SmoothClipView.kt +105 -34
  10. package/cpp/SmoothClipAnimationCurve.h +468 -0
  11. package/cpp/SmoothClipAnimationId.h +32 -0
  12. package/cpp/SmoothClipRegistry.h +11 -1
  13. package/cpp/SmoothClipVelocityTracker.h +32 -15
  14. package/ios/SmoothClipRegistry.mm +246 -97
  15. package/ios/SmoothClipTurboModule.cpp +4 -2
  16. package/ios/SmoothClipTurboModule.h +2 -1
  17. package/ios/SmoothClipView.mm +73 -16
  18. package/lib/module/NativeSmoothClipModule.js.map +1 -1
  19. package/lib/module/drivers.android.js +3 -1
  20. package/lib/module/drivers.android.js.map +1 -1
  21. package/lib/module/drivers.ios.js +3 -391
  22. package/lib/module/drivers.ios.js.map +1 -1
  23. package/lib/module/drivers.native.js +470 -0
  24. package/lib/module/drivers.native.js.map +1 -0
  25. package/lib/typescript/src/NativeSmoothClipModule.d.ts +1 -1
  26. package/lib/typescript/src/NativeSmoothClipModule.d.ts.map +1 -1
  27. package/lib/typescript/src/driverTypes.d.ts +6 -3
  28. package/lib/typescript/src/driverTypes.d.ts.map +1 -1
  29. package/lib/typescript/src/drivers.android.d.ts +2 -2
  30. package/lib/typescript/src/drivers.android.d.ts.map +1 -1
  31. package/lib/typescript/src/drivers.ios.d.ts +2 -4
  32. package/lib/typescript/src/drivers.ios.d.ts.map +1 -1
  33. package/lib/typescript/src/drivers.native.d.ts +5 -0
  34. package/lib/typescript/src/drivers.native.d.ts.map +1 -0
  35. package/package.json +1 -1
  36. package/src/NativeSmoothClipModule.ts +2 -1
  37. package/src/driverTypes.ts +6 -3
  38. package/src/drivers.android.ts +4 -2
  39. package/src/drivers.ios.ts +4 -687
  40. package/src/drivers.native.ts +805 -0
@@ -1 +1 @@
1
- {"version":3,"file":"drivers.ios.d.ts","sourceRoot":"","sources":["../../../src/drivers.ios.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAEV,sBAAsB,EAEtB,gBAAgB,EAChB,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,kBAAe,CAAC;AAavB,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAC5B,MAAM,eAAY,CAAC;AAiJpB,wBAAgB,mBAAmB,CACjC,YAAY,EAAE,YAAY,GAAG,sBAAsB,EACnD,OAAO,GAAE,uBAA4B,GACpC,gBAAgB,CAyflB;AAED,YAAY,EACV,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,GACpB,CAAC"}
1
+ {"version":3,"file":"drivers.ios.d.ts","sourceRoot":"","sources":["../../../src/drivers.ios.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAkB,CAAC;AACvD,YAAY,EACV,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,qBAAkB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { KeyframedClipAnimation, SmoothClipDriver, SmoothClipDriverOptions, SpringClipAnimation, TimingClipAnimation } from './driverTypes.js';
2
+ import { type ClipGeometry, type SmoothClipPresentation } from './geometry.js';
3
+ export declare function useSmoothClipDriver(initialValue: ClipGeometry | SmoothClipPresentation, options?: SmoothClipDriverOptions): SmoothClipDriver;
4
+ export type { KeyframedClipAnimation, SpringClipAnimation, TimingClipAnimation, };
5
+ //# sourceMappingURL=drivers.native.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drivers.native.d.ts","sourceRoot":"","sources":["../../../src/drivers.native.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAEV,sBAAsB,EAEtB,gBAAgB,EAChB,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,kBAAe,CAAC;AAavB,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAC5B,MAAM,eAAY,CAAC;AAiKpB,wBAAgB,mBAAmB,CACjC,YAAY,EAAE,YAAY,GAAG,sBAAsB,EACnD,OAAO,GAAE,uBAA4B,GACpC,gBAAgB,CAslBlB;AAED,YAAY,EACV,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,GACpB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-smooth-clip-view",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
4
4
  "description": "Layout-free animated rounded clipping for React Native Fabric",
5
5
  "main": "./lib/module/index.js",
6
6
  "module": "./lib/module/index.js",
@@ -18,7 +18,8 @@ export interface Spec extends TurboModule {
18
18
  radius: CodegenTypes.Double,
19
19
  contentTranslateX: CodegenTypes.Double,
20
20
  contentTranslateY: CodegenTypes.Double,
21
- takeOwnership: boolean
21
+ takeOwnership: boolean,
22
+ overridePendingAnimation: boolean
22
23
  ): void;
23
24
  beginInteraction(
24
25
  driverId: CodegenTypes.Double
@@ -13,9 +13,12 @@ type ClipAnimationBase = Readonly<{
13
13
  * reached native — a gated per-frame reaction may not have flushed it.
14
14
  * Also re-grabs from a running animation (which an implicit interactive
15
15
  * start would silently skip). Non-finite `from` rejects the whole call.
16
- * `driver.presentation.value` is not written from `from` (it stays stale
17
- * until success sets it to the target). Against a held pending-animation
18
- * latch the seed is dropped by design — latch intent wins.
16
+ * On the native drivers `driver.presentation.value` is not written from
17
+ * `from` (it stays stale until success sets it to the target); the web
18
+ * fallback does write it — its presentation SharedValue is the render
19
+ * channel itself. Against a held pending-animation latch, explicit `from`
20
+ * is newer intent: the fused write cancels that latch once unfinished,
21
+ * applies `from`, and starts the replacement from that native value.
19
22
  *
20
23
  * Keyframes interpolate absolutely, so pass `frames[0].presentation` —
21
24
  * the seed renders it before the first animation frame, making the
@@ -1,6 +1,8 @@
1
- export { useSmoothClipDriver } from './drivers.ios';
1
+ // Platform re-export only — the implementation is shared with iOS.
2
+ // Edit drivers.native.ts, not this file.
3
+ export { useSmoothClipDriver } from './drivers.native';
2
4
  export type {
3
5
  KeyframedClipAnimation,
4
6
  SpringClipAnimation,
5
7
  TimingClipAnimation,
6
- } from './drivers.ios';
8
+ } from './drivers.native';