react-native-smooth-clip-view 0.4.1 → 0.4.3

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 (47) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/README.md +92 -5
  3. package/android/src/main/cpp/SmoothClipAndroid.h +2 -1
  4. package/android/src/main/cpp/SmoothClipBindings.cpp +22 -8
  5. package/android/src/main/cpp/SmoothClipRegistry.cpp +85 -10
  6. package/android/src/main/java/com/smoothclipview/ClipGeometryNormalizer.kt +23 -0
  7. package/android/src/main/java/com/smoothclipview/SmoothClipBindings.kt +8 -0
  8. package/android/src/main/java/com/smoothclipview/SmoothClipModule.kt +39 -1
  9. package/android/src/main/java/com/smoothclipview/SmoothClipView.kt +124 -32
  10. package/android/src/main/java/com/smoothclipview/SmoothClipViewManager.kt +16 -0
  11. package/cpp/SmoothClipAnimationCurve.h +21 -10
  12. package/cpp/SmoothClipRegistry.h +2 -0
  13. package/cpp/SmoothClipSharedGeometry.h +20 -0
  14. package/cpp/SmoothClipVelocityTracker.h +6 -0
  15. package/ios/SmoothClipRegistry.mm +173 -17
  16. package/ios/SmoothClipTurboModule.cpp +17 -6
  17. package/ios/SmoothClipTurboModule.h +3 -1
  18. package/ios/SmoothClipView.mm +408 -20
  19. package/lib/module/NativeSmoothClipModule.js.map +1 -1
  20. package/lib/module/SmoothClipView.ios.js +3 -0
  21. package/lib/module/SmoothClipView.ios.js.map +1 -1
  22. package/lib/module/SmoothClipViewNativeComponent.ts +5 -1
  23. package/lib/module/geometry.js +22 -2
  24. package/lib/module/geometry.js.map +1 -1
  25. package/lib/module/presentationCodec.js +5 -3
  26. package/lib/module/presentationCodec.js.map +1 -1
  27. package/lib/typescript/src/NativeSmoothClipModule.d.ts +1 -1
  28. package/lib/typescript/src/NativeSmoothClipModule.d.ts.map +1 -1
  29. package/lib/typescript/src/SmoothClipView.ios.d.ts.map +1 -1
  30. package/lib/typescript/src/SmoothClipViewNativeComponent.d.ts +3 -1
  31. package/lib/typescript/src/SmoothClipViewNativeComponent.d.ts.map +1 -1
  32. package/lib/typescript/src/controllerTypes.d.ts +5 -1
  33. package/lib/typescript/src/controllerTypes.d.ts.map +1 -1
  34. package/lib/typescript/src/geometry.d.ts +9 -0
  35. package/lib/typescript/src/geometry.d.ts.map +1 -1
  36. package/lib/typescript/src/index.d.ts +1 -1
  37. package/lib/typescript/src/index.d.ts.map +1 -1
  38. package/lib/typescript/src/presentationCodec.d.ts +1 -1
  39. package/lib/typescript/src/presentationCodec.d.ts.map +1 -1
  40. package/package.json +2 -1
  41. package/src/NativeSmoothClipModule.ts +3 -1
  42. package/src/SmoothClipView.ios.tsx +3 -0
  43. package/src/SmoothClipViewNativeComponent.ts +5 -1
  44. package/src/controllerTypes.ts +5 -1
  45. package/src/geometry.ts +35 -0
  46. package/src/index.ts +1 -0
  47. package/src/presentationCodec.ts +8 -2
@@ -5,7 +5,7 @@ import type { CanonicalSmoothClipPresentation } from './geometry';
5
5
  * Versionless native packet layout. Keep this as the single JS codec used by
6
6
  * drivers, groups, snapshots, and cancellation.
7
7
  */
8
- export const PRESENTATION_STRIDE = 21;
8
+ export const PRESENTATION_STRIDE = 23;
9
9
 
10
10
  export function appendPresentationPacket(
11
11
  values: number[],
@@ -41,7 +41,9 @@ export function appendPresentationPacket(
41
41
  boxShadow?.offsetX ?? 0,
42
42
  boxShadow?.offsetY ?? 0,
43
43
  boxShadow?.blurRadius ?? 0,
44
- boxShadow?.spreadDistance ?? 0
44
+ boxShadow?.spreadDistance ?? 0,
45
+ Number(presentation.rotation.slice(0, -3)),
46
+ presentation.opacity
45
47
  );
46
48
  }
47
49
 
@@ -87,6 +89,8 @@ export function presentationFromPacket(
87
89
  blue > 1 ||
88
90
  alpha < 0 ||
89
91
  alpha > 1 ||
92
+ (values[offset + 22] as number) < 0 ||
93
+ (values[offset + 22] as number) > 1 ||
90
94
  blurRadius < 0
91
95
  ) {
92
96
  return null;
@@ -119,6 +123,8 @@ export function presentationFromPacket(
119
123
  contentTranslateX: values[offset + 9] as number,
120
124
  contentTranslateY: values[offset + 10] as number,
121
125
  contentScale,
126
+ rotation: `${values[offset + 21] as number}rad`,
127
+ opacity: values[offset + 22] as number,
122
128
  ...(shadowEnabled
123
129
  ? {
124
130
  boxShadow: {