react-native-smooth-clip-view 0.3.0 → 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 (199) hide show
  1. package/README.md +132 -388
  2. package/android/build.gradle +3 -3
  3. package/android/proguard-rules.pro +2 -2
  4. package/android/src/main/cpp/SmoothClipAndroid.h +9 -12
  5. package/android/src/main/cpp/SmoothClipBindings.cpp +300 -704
  6. package/android/src/main/cpp/SmoothClipRegistry.cpp +348 -594
  7. package/android/src/main/java/com/smoothclipview/ClipGeometryNormalizer.kt +36 -227
  8. package/android/src/main/java/com/smoothclipview/SmoothClipBindings.kt +16 -19
  9. package/android/src/main/java/com/smoothclipview/SmoothClipModule.kt +36 -294
  10. package/android/src/main/java/com/smoothclipview/SmoothClipView.kt +344 -488
  11. package/android/src/main/java/com/smoothclipview/SmoothClipViewManager.kt +75 -77
  12. package/cpp/SmoothClipAnimationCurve.h +237 -346
  13. package/cpp/SmoothClipRegistry.h +24 -52
  14. package/cpp/SmoothClipSharedGeometry.h +64 -94
  15. package/cpp/SmoothClipVelocityTracker.h +5 -5
  16. package/ios/SmoothClipGeometry.h +23 -34
  17. package/ios/SmoothClipRegistry.mm +206 -711
  18. package/ios/SmoothClipTurboModule.cpp +217 -715
  19. package/ios/SmoothClipTurboModule.h +54 -297
  20. package/ios/SmoothClipView.mm +599 -505
  21. package/ios/SmoothClipViewRegistry.h +2 -7
  22. package/lib/module/NativeSmoothClipModule.js.map +1 -1
  23. package/lib/module/SmoothClipView.ios.js +84 -17
  24. package/lib/module/SmoothClipView.ios.js.map +1 -1
  25. package/lib/module/SmoothClipView.js +1 -1
  26. package/lib/module/SmoothClipView.js.map +1 -1
  27. package/lib/module/SmoothClipViewNativeComponent.ts +20 -26
  28. package/lib/module/capabilities.native.js +1 -19
  29. package/lib/module/capabilities.native.js.map +1 -1
  30. package/lib/module/capabilityTypes.js +0 -9
  31. package/lib/module/capabilityTypes.js.map +1 -1
  32. package/lib/module/controllerInternals.js +28 -0
  33. package/lib/module/controllerInternals.js.map +1 -0
  34. package/lib/module/controllerLifecycle.js +9 -0
  35. package/lib/module/controllerLifecycle.js.map +1 -0
  36. package/lib/module/controllerTypes.js +4 -0
  37. package/lib/module/controllerTypes.js.map +1 -0
  38. package/lib/module/controllers.android.js +4 -0
  39. package/lib/module/controllers.android.js.map +1 -0
  40. package/lib/module/controllers.ios.js +4 -0
  41. package/lib/module/controllers.ios.js.map +1 -0
  42. package/lib/module/controllers.js +4 -0
  43. package/lib/module/controllers.js.map +1 -0
  44. package/lib/module/controllers.native.js +89 -0
  45. package/lib/module/controllers.native.js.map +1 -0
  46. package/lib/module/geometry.js +71 -51
  47. package/lib/module/geometry.js.map +1 -1
  48. package/lib/module/groupTypes.js +4 -0
  49. package/lib/module/{groupDriverTypes.js.map → groupTypes.js.map} +1 -1
  50. package/lib/module/groups.android.js +4 -0
  51. package/lib/module/groups.android.js.map +1 -0
  52. package/lib/module/groups.ios.js +4 -0
  53. package/lib/module/groups.ios.js.map +1 -0
  54. package/lib/module/groups.js +4 -0
  55. package/lib/module/groups.js.map +1 -0
  56. package/lib/module/groups.native.js +399 -0
  57. package/lib/module/groups.native.js.map +1 -0
  58. package/lib/module/ids.js +8 -0
  59. package/lib/module/ids.js.map +1 -0
  60. package/lib/module/index.js +3 -3
  61. package/lib/module/index.js.map +1 -1
  62. package/lib/module/nativeCompletion.js +37 -16
  63. package/lib/module/nativeCompletion.js.map +1 -1
  64. package/lib/module/presentationCodec.js +81 -0
  65. package/lib/module/presentationCodec.js.map +1 -0
  66. package/lib/typescript/src/NativeSmoothClipModule.d.ts +14 -23
  67. package/lib/typescript/src/NativeSmoothClipModule.d.ts.map +1 -1
  68. package/lib/typescript/src/SmoothClipView.d.ts +1 -1
  69. package/lib/typescript/src/SmoothClipView.d.ts.map +1 -1
  70. package/lib/typescript/src/SmoothClipView.ios.d.ts +18 -14
  71. package/lib/typescript/src/SmoothClipView.ios.d.ts.map +1 -1
  72. package/lib/typescript/src/SmoothClipViewNativeComponent.d.ts +10 -5
  73. package/lib/typescript/src/SmoothClipViewNativeComponent.d.ts.map +1 -1
  74. package/lib/typescript/src/capabilities.native.d.ts +1 -1
  75. package/lib/typescript/src/capabilities.native.d.ts.map +1 -1
  76. package/lib/typescript/src/capabilityTypes.d.ts +0 -6
  77. package/lib/typescript/src/capabilityTypes.d.ts.map +1 -1
  78. package/lib/typescript/src/controllerInternals.d.ts +14 -0
  79. package/lib/typescript/src/controllerInternals.d.ts.map +1 -0
  80. package/lib/typescript/src/controllerLifecycle.d.ts +3 -0
  81. package/lib/typescript/src/controllerLifecycle.d.ts.map +1 -0
  82. package/lib/typescript/src/controllerTypes.d.ts +62 -0
  83. package/lib/typescript/src/controllerTypes.d.ts.map +1 -0
  84. package/lib/typescript/src/controllers.android.d.ts +2 -0
  85. package/lib/typescript/src/controllers.android.d.ts.map +1 -0
  86. package/lib/typescript/src/controllers.d.ts +2 -0
  87. package/lib/typescript/src/controllers.d.ts.map +1 -0
  88. package/lib/typescript/src/controllers.ios.d.ts +2 -0
  89. package/lib/typescript/src/controllers.ios.d.ts.map +1 -0
  90. package/lib/typescript/src/controllers.native.d.ts +3 -0
  91. package/lib/typescript/src/controllers.native.d.ts.map +1 -0
  92. package/lib/typescript/src/geometry.d.ts +22 -12
  93. package/lib/typescript/src/geometry.d.ts.map +1 -1
  94. package/lib/typescript/src/groupTypes.d.ts +31 -0
  95. package/lib/typescript/src/groupTypes.d.ts.map +1 -0
  96. package/lib/typescript/src/groups.android.d.ts +2 -0
  97. package/lib/typescript/src/groups.android.d.ts.map +1 -0
  98. package/lib/typescript/src/groups.d.ts +2 -0
  99. package/lib/typescript/src/groups.d.ts.map +1 -0
  100. package/lib/typescript/src/groups.ios.d.ts +2 -0
  101. package/lib/typescript/src/groups.ios.d.ts.map +1 -0
  102. package/lib/typescript/src/groups.native.d.ts +3 -0
  103. package/lib/typescript/src/groups.native.d.ts.map +1 -0
  104. package/lib/typescript/src/ids.d.ts +2 -0
  105. package/lib/typescript/src/ids.d.ts.map +1 -0
  106. package/lib/typescript/src/index.d.ts +6 -6
  107. package/lib/typescript/src/index.d.ts.map +1 -1
  108. package/lib/typescript/src/nativeCompletion.d.ts +16 -6
  109. package/lib/typescript/src/nativeCompletion.d.ts.map +1 -1
  110. package/lib/typescript/src/presentationCodec.d.ts +10 -0
  111. package/lib/typescript/src/presentationCodec.d.ts.map +1 -0
  112. package/package.json +8 -3
  113. package/src/NativeSmoothClipModule.ts +41 -292
  114. package/src/SmoothClipView.ios.tsx +130 -23
  115. package/src/SmoothClipView.tsx +5 -1
  116. package/src/SmoothClipViewNativeComponent.ts +20 -26
  117. package/src/capabilities.native.ts +2 -52
  118. package/src/capabilityTypes.ts +0 -14
  119. package/src/controllerInternals.ts +52 -0
  120. package/src/controllerLifecycle.ts +6 -0
  121. package/src/controllerTypes.ts +87 -0
  122. package/src/controllers.android.ts +1 -0
  123. package/src/controllers.ios.ts +1 -0
  124. package/src/controllers.native.ts +104 -0
  125. package/src/controllers.ts +1 -0
  126. package/src/geometry.ts +118 -74
  127. package/src/groupTypes.ts +53 -0
  128. package/src/groups.android.ts +1 -0
  129. package/src/groups.ios.ts +1 -0
  130. package/src/groups.native.ts +604 -0
  131. package/src/groups.ts +1 -0
  132. package/src/ids.ts +6 -0
  133. package/src/index.ts +20 -28
  134. package/src/nativeCompletion.ts +67 -32
  135. package/src/presentationCodec.ts +134 -0
  136. package/lib/module/driverState.js +0 -82
  137. package/lib/module/driverState.js.map +0 -1
  138. package/lib/module/driverTypes.js +0 -4
  139. package/lib/module/driverTypes.js.map +0 -1
  140. package/lib/module/drivers.android.js +0 -6
  141. package/lib/module/drivers.android.js.map +0 -1
  142. package/lib/module/drivers.ios.js +0 -6
  143. package/lib/module/drivers.ios.js.map +0 -1
  144. package/lib/module/drivers.js +0 -4
  145. package/lib/module/drivers.js.map +0 -1
  146. package/lib/module/drivers.native.js +0 -756
  147. package/lib/module/drivers.native.js.map +0 -1
  148. package/lib/module/groupDriverTypes.js +0 -4
  149. package/lib/module/groupDrivers.android.js +0 -4
  150. package/lib/module/groupDrivers.android.js.map +0 -1
  151. package/lib/module/groupDrivers.ios.js +0 -4
  152. package/lib/module/groupDrivers.ios.js.map +0 -1
  153. package/lib/module/groupDrivers.js +0 -4
  154. package/lib/module/groupDrivers.js.map +0 -1
  155. package/lib/module/groupDrivers.native.js +0 -799
  156. package/lib/module/groupDrivers.native.js.map +0 -1
  157. package/lib/module/presentationProtocol.js +0 -15
  158. package/lib/module/presentationProtocol.js.map +0 -1
  159. package/lib/module/reactRequests.js +0 -56
  160. package/lib/module/reactRequests.js.map +0 -1
  161. package/lib/typescript/src/driverState.d.ts +0 -26
  162. package/lib/typescript/src/driverState.d.ts.map +0 -1
  163. package/lib/typescript/src/driverTypes.d.ts +0 -121
  164. package/lib/typescript/src/driverTypes.d.ts.map +0 -1
  165. package/lib/typescript/src/drivers.android.d.ts +0 -3
  166. package/lib/typescript/src/drivers.android.d.ts.map +0 -1
  167. package/lib/typescript/src/drivers.d.ts +0 -3
  168. package/lib/typescript/src/drivers.d.ts.map +0 -1
  169. package/lib/typescript/src/drivers.ios.d.ts +0 -3
  170. package/lib/typescript/src/drivers.ios.d.ts.map +0 -1
  171. package/lib/typescript/src/drivers.native.d.ts +0 -5
  172. package/lib/typescript/src/drivers.native.d.ts.map +0 -1
  173. package/lib/typescript/src/groupDriverTypes.d.ts +0 -66
  174. package/lib/typescript/src/groupDriverTypes.d.ts.map +0 -1
  175. package/lib/typescript/src/groupDrivers.android.d.ts +0 -2
  176. package/lib/typescript/src/groupDrivers.android.d.ts.map +0 -1
  177. package/lib/typescript/src/groupDrivers.d.ts +0 -2
  178. package/lib/typescript/src/groupDrivers.d.ts.map +0 -1
  179. package/lib/typescript/src/groupDrivers.ios.d.ts +0 -2
  180. package/lib/typescript/src/groupDrivers.ios.d.ts.map +0 -1
  181. package/lib/typescript/src/groupDrivers.native.d.ts +0 -4
  182. package/lib/typescript/src/groupDrivers.native.d.ts.map +0 -1
  183. package/lib/typescript/src/presentationProtocol.d.ts +0 -4
  184. package/lib/typescript/src/presentationProtocol.d.ts.map +0 -1
  185. package/lib/typescript/src/reactRequests.d.ts +0 -9
  186. package/lib/typescript/src/reactRequests.d.ts.map +0 -1
  187. package/src/driverState.ts +0 -118
  188. package/src/driverTypes.ts +0 -171
  189. package/src/drivers.android.ts +0 -8
  190. package/src/drivers.ios.ts +0 -8
  191. package/src/drivers.native.ts +0 -1599
  192. package/src/drivers.ts +0 -6
  193. package/src/groupDriverTypes.ts +0 -117
  194. package/src/groupDrivers.android.ts +0 -1
  195. package/src/groupDrivers.ios.ts +0 -1
  196. package/src/groupDrivers.native.ts +0 -1189
  197. package/src/groupDrivers.ts +0 -1
  198. package/src/presentationProtocol.ts +0 -28
  199. package/src/reactRequests.ts +0 -76
@@ -13,14 +13,9 @@ void registerView(
13
13
  SmoothClipView *view,
14
14
  Presentation initialPresentation);
15
15
  void unregisterView(uint64_t driverId, SmoothClipView *view);
16
- // Re-runs the mid-animation join for a registered view whose animation
17
- // install was deferred because it had no layout yet. Returns false when the
18
- // driver or its active animation no longer exists.
19
- bool joinActiveAnimation(uint64_t driverId, SmoothClipView *view);
20
16
  // Called when a registered view first becomes able to produce a visible
21
- // frame (has layout AND is attached to a window). Starts a latched animation
22
- // — rebasing its clock so no progress is burned while the view was
23
- // detached — or completes a deferred install for an already-running one.
17
+ // frame (has layout AND is attached to a window). Starts a pre-ready animation
18
+ // with its full duration so no progress is burned while the view was detached.
24
19
  // A CA animation committed while the host's layer tree is detached (e.g. a
25
20
  // transparentModal subtree before its view controller is presented) does not
26
21
  // survive the attach commit; installs must therefore wait for this signal.
@@ -1 +1 @@
1
- {"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeSmoothClipModule.ts"],"mappings":";;AACA,SAASA,mBAAmB,QAAQ,cAAc;AA0XlD,eAAeA,mBAAmB,CAACC,YAAY,CAAO,wBAAwB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeSmoothClipModule.ts"],"mappings":";;AACA,SAASA,mBAAmB,QAAQ,cAAc;AA+HlD,eAAeA,mBAAmB,CAACC,YAAY,CAAO,wBAAwB,CAAC","ignoreList":[]}
@@ -1,37 +1,91 @@
1
1
  "use strict";
2
2
 
3
- import { forwardRef } from 'react';
4
- import { getDriverState } from "./driverState.js";
5
- import { getSmoothClipCapabilities } from './capabilities';
6
- import { canonicalizeClipPresentation } from "./geometry.js";
7
- import { assertInitialPresentationProtocol } from "./presentationProtocol.js";
3
+ /* eslint-disable no-bitwise -- color channels use packed RRGGBBAA integers */
4
+ import { forwardRef, useEffect } from 'react';
5
+ import { StyleSheet } from 'react-native';
6
+ import { getControllerRef, unwrapSmoothClipRef } from "./controllerInternals.js";
8
7
  import NativeSmoothClipView from './SmoothClipViewNativeComponent';
9
8
  import { jsx as _jsx } from "react/jsx-runtime";
10
- export const SmoothClipView = /*#__PURE__*/forwardRef(function SmoothClipViewComponent({
11
- driver,
9
+ let reportedIndependentShadow = false;
10
+ const mountedControllers = new WeakMap();
11
+ function useSingleControllerHost(controller) {
12
+ useEffect(() => {
13
+ const mounted = mountedControllers.get(controller) ?? 0;
14
+ if (__DEV__ && mounted > 0) {
15
+ throw new Error('[SmoothClipView] One controller cannot drive two mounted hosts. Create one controller per SmoothClipView.');
16
+ }
17
+ mountedControllers.set(controller, mounted + 1);
18
+ return () => {
19
+ const current = mountedControllers.get(controller) ?? 1;
20
+ if (current <= 1) mountedControllers.delete(controller);else mountedControllers.set(controller, current - 1);
21
+ };
22
+ }, [controller]);
23
+ }
24
+ function filterContainsDropShadow(filter) {
25
+ if (typeof filter === 'string') return /drop-shadow\s*\(/i.test(filter);
26
+ return Array.isArray(filter) && filter.some(entry => typeof entry === 'object' && entry !== null && 'dropShadow' in entry);
27
+ }
28
+ function removeDropShadowFilter(filter) {
29
+ if (typeof filter === 'string') {
30
+ const remaining = filter.replace(/drop-shadow\((?:[^()]|\([^()]*\))*\)/gi, '').trim();
31
+ return remaining === '' ? undefined : remaining;
32
+ }
33
+ if (Array.isArray(filter)) {
34
+ const remaining = filter.filter(entry => !(typeof entry === 'object' && entry !== null && 'dropShadow' in entry));
35
+ return remaining.length === 0 ? undefined : remaining;
36
+ }
37
+ return filter;
38
+ }
39
+
40
+ /** Prevents React Native from installing a second, aperture-independent shadow. */
41
+ export function sanitizeSmoothClipStyle(style) {
42
+ const flat = StyleSheet.flatten(style);
43
+ if (flat == null) return style;
44
+ const hasIndependentShadow = flat.boxShadow !== undefined || flat.shadowColor !== undefined || flat.shadowOffset !== undefined || flat.shadowOpacity !== undefined || flat.shadowRadius !== undefined || flat.elevation !== undefined || filterContainsDropShadow(flat.filter);
45
+ if (!hasIndependentShadow) return style;
46
+ if (__DEV__ && !reportedIndependentShadow) {
47
+ reportedIndependentShadow = true;
48
+ console.error('[SmoothClipView] Shadow style properties are not rendered on the host. ' + 'Put the shadow in SmoothClipPresentation.boxShadow so it follows the clip aperture.');
49
+ }
50
+ const sanitized = {
51
+ ...flat
52
+ };
53
+ delete sanitized.boxShadow;
54
+ delete sanitized.shadowColor;
55
+ delete sanitized.shadowOffset;
56
+ delete sanitized.shadowOpacity;
57
+ delete sanitized.shadowRadius;
58
+ delete sanitized.elevation;
59
+ if (filterContainsDropShadow(sanitized.filter)) {
60
+ const filter = removeDropShadowFilter(sanitized.filter);
61
+ if (filter === undefined) delete sanitized.filter;else sanitized.filter = filter;
62
+ }
63
+ return sanitized;
64
+ }
65
+ export function renderSmoothClipView({
66
+ controller,
12
67
  children,
68
+ style,
13
69
  ...viewProps
14
70
  }, forwardedRef) {
15
71
  const {
16
- driverId,
17
- initialPresentation
18
- } = getDriverState(driver);
19
- const canonical = canonicalizeClipPresentation(initialPresentation);
20
- if (canonical === null) return null;
72
+ ref,
73
+ initialFrame: canonical
74
+ } = getControllerRef(controller);
75
+ const driverId = unwrapSmoothClipRef(ref)?.id ?? 0;
21
76
  const {
22
77
  clip
23
78
  } = canonical;
24
- const protocolVersion = getSmoothClipCapabilities().presentationProtocolVersion;
25
- assertInitialPresentationProtocol(canonical, protocolVersion);
79
+ const shadow = canonical.boxShadow;
80
+ const color = shadow?.color ?? 0;
26
81
  const nativeProps = {
27
82
  ...viewProps,
83
+ style: sanitizeSmoothClipStyle(style),
28
84
  driverId,
29
85
  initialClipX: clip.x,
30
86
  initialClipY: clip.y,
31
87
  initialClipWidth: clip.width,
32
88
  initialClipHeight: clip.height,
33
- initialClipRadius: clip.radius,
34
- presentationVersion: protocolVersion,
35
89
  initialClipTopLeftRadius: clip.topLeftRadius,
36
90
  initialClipTopRightRadius: clip.topRightRadius,
37
91
  initialClipBottomRightRadius: clip.bottomRightRadius,
@@ -39,12 +93,25 @@ export const SmoothClipView = /*#__PURE__*/forwardRef(function SmoothClipViewCom
39
93
  initialClipCurve: clip.curve === 'continuous' ? 1 : 0,
40
94
  initialContentTranslateX: canonical.contentTranslateX,
41
95
  initialContentTranslateY: canonical.contentTranslateY,
42
- initialContentScale: canonical.contentScale
96
+ initialContentScale: canonical.contentScale,
97
+ initialClipBoxShadowEnabled: shadow !== undefined,
98
+ initialClipBoxShadowRed: (color >>> 24 & 0xff) / 255,
99
+ initialClipBoxShadowGreen: (color >>> 16 & 0xff) / 255,
100
+ initialClipBoxShadowBlue: (color >>> 8 & 0xff) / 255,
101
+ initialClipBoxShadowAlpha: (color & 0xff) / 255,
102
+ initialClipBoxShadowOffsetX: shadow?.offsetX ?? 0,
103
+ initialClipBoxShadowOffsetY: shadow?.offsetY ?? 0,
104
+ initialClipBoxShadowBlurRadius: shadow?.blurRadius ?? 0,
105
+ initialClipBoxShadowSpreadDistance: shadow?.spreadDistance ?? 0
43
106
  };
44
107
  return /*#__PURE__*/_jsx(NativeSmoothClipView, {
45
108
  ref: forwardedRef,
46
109
  ...nativeProps,
47
110
  children: children
48
111
  });
112
+ }
113
+ export const SmoothClipView = /*#__PURE__*/forwardRef(function SmoothClipViewComponent(props, forwardedRef) {
114
+ useSingleControllerHost(props.controller);
115
+ return renderSmoothClipView(props, forwardedRef);
49
116
  });
50
117
  //# sourceMappingURL=SmoothClipView.ios.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["forwardRef","getDriverState","getSmoothClipCapabilities","canonicalizeClipPresentation","assertInitialPresentationProtocol","NativeSmoothClipView","jsx","_jsx","SmoothClipView","SmoothClipViewComponent","driver","children","viewProps","forwardedRef","driverId","initialPresentation","canonical","clip","protocolVersion","presentationProtocolVersion","nativeProps","initialClipX","x","initialClipY","y","initialClipWidth","width","initialClipHeight","height","initialClipRadius","radius","presentationVersion","initialClipTopLeftRadius","topLeftRadius","initialClipTopRightRadius","topRightRadius","initialClipBottomRightRadius","bottomRightRadius","initialClipBottomLeftRadius","bottomLeftRadius","initialClipCurve","curve","initialContentTranslateX","contentTranslateX","initialContentTranslateY","contentTranslateY","initialContentScale","contentScale","ref"],"sourceRoot":"../../src","sources":["SmoothClipView.ios.tsx"],"mappings":";;AAAA,SAASA,UAAU,QAA2C,OAAO;AAGrE,SAASC,cAAc,QAAQ,kBAAe;AAC9C,SAASC,yBAAyB,QAAQ,gBAAgB;AAC1D,SAASC,4BAA4B,QAAQ,eAAY;AACzD,SAASC,iCAAiC,QAAQ,2BAAwB;AAC1E,OAAOC,oBAAoB,MAEpB,iCAAiC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAOzC,OAAO,MAAMC,cAAc,gBAAGR,UAAU,CAGtC,SAASS,uBAAuBA,CAChC;EAAEC,MAAM;EAAEC,QAAQ;EAAE,GAAGC;AAAU,CAAC,EAClCC,YAAY,EACZ;EACA,MAAM;IAAEC,QAAQ;IAAEC;EAAoB,CAAC,GAAGd,cAAc,CAACS,MAAM,CAAC;EAChE,MAAMM,SAAS,GAAGb,4BAA4B,CAACY,mBAAmB,CAAC;EACnE,IAAIC,SAAS,KAAK,IAAI,EAAE,OAAO,IAAI;EACnC,MAAM;IAAEC;EAAK,CAAC,GAAGD,SAAS;EAC1B,MAAME,eAAe,GACnBhB,yBAAyB,CAAC,CAAC,CAACiB,2BAA2B;EACzDf,iCAAiC,CAACY,SAAS,EAAEE,eAAe,CAAC;EAC7D,MAAME,WAAwB,GAAG;IAC/B,GAAGR,SAAS;IACZE,QAAQ;IACRO,YAAY,EAAEJ,IAAI,CAACK,CAAC;IACpBC,YAAY,EAAEN,IAAI,CAACO,CAAC;IACpBC,gBAAgB,EAAER,IAAI,CAACS,KAAK;IAC5BC,iBAAiB,EAAEV,IAAI,CAACW,MAAM;IAC9BC,iBAAiB,EAAEZ,IAAI,CAACa,MAAM;IAC9BC,mBAAmB,EAAEb,eAAe;IACpCc,wBAAwB,EAAEf,IAAI,CAACgB,aAAa;IAC5CC,yBAAyB,EAAEjB,IAAI,CAACkB,cAAc;IAC9CC,4BAA4B,EAAEnB,IAAI,CAACoB,iBAAiB;IACpDC,2BAA2B,EAAErB,IAAI,CAACsB,gBAAgB;IAClDC,gBAAgB,EAAEvB,IAAI,CAACwB,KAAK,KAAK,YAAY,GAAG,CAAC,GAAG,CAAC;IACrDC,wBAAwB,EAAE1B,SAAS,CAAC2B,iBAAiB;IACrDC,wBAAwB,EAAE5B,SAAS,CAAC6B,iBAAiB;IACrDC,mBAAmB,EAAE9B,SAAS,CAAC+B;EACjC,CAAC;EAED,oBACExC,IAAA,CAACF,oBAAoB;IAAC2C,GAAG,EAAEnC,YAAa;IAAA,GAAKO,WAAW;IAAAT,QAAA,EACrDA;EAAQ,CACW,CAAC;AAE3B,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["forwardRef","useEffect","StyleSheet","getControllerRef","unwrapSmoothClipRef","NativeSmoothClipView","jsx","_jsx","reportedIndependentShadow","mountedControllers","WeakMap","useSingleControllerHost","controller","mounted","get","__DEV__","Error","set","current","delete","filterContainsDropShadow","filter","test","Array","isArray","some","entry","removeDropShadowFilter","remaining","replace","trim","undefined","length","sanitizeSmoothClipStyle","style","flat","flatten","hasIndependentShadow","boxShadow","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","console","error","sanitized","renderSmoothClipView","children","viewProps","forwardedRef","ref","initialFrame","canonical","driverId","id","clip","shadow","color","nativeProps","initialClipX","x","initialClipY","y","initialClipWidth","width","initialClipHeight","height","initialClipTopLeftRadius","topLeftRadius","initialClipTopRightRadius","topRightRadius","initialClipBottomRightRadius","bottomRightRadius","initialClipBottomLeftRadius","bottomLeftRadius","initialClipCurve","curve","initialContentTranslateX","contentTranslateX","initialContentTranslateY","contentTranslateY","initialContentScale","contentScale","initialClipBoxShadowEnabled","initialClipBoxShadowRed","initialClipBoxShadowGreen","initialClipBoxShadowBlue","initialClipBoxShadowAlpha","initialClipBoxShadowOffsetX","offsetX","initialClipBoxShadowOffsetY","offsetY","initialClipBoxShadowBlurRadius","blurRadius","initialClipBoxShadowSpreadDistance","spreadDistance","SmoothClipView","SmoothClipViewComponent","props"],"sourceRoot":"../../src","sources":["SmoothClipView.ios.tsx"],"mappings":";;AAAA;AACA,SACEA,UAAU,EACVC,SAAS,QAKJ,OAAO;AACd,SAASC,UAAU,QAAwC,cAAc;AAEzE,SAASC,gBAAgB,EAAEC,mBAAmB,QAAQ,0BAAuB;AAC7E,OAAOC,oBAAoB,MAEpB,iCAAiC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAOzC,IAAIC,yBAAyB,GAAG,KAAK;AACrC,MAAMC,kBAAkB,GAAG,IAAIC,OAAO,CAA+B,CAAC;AAEtE,SAASC,uBAAuBA,CAACC,UAAgC,EAAQ;EACvEX,SAAS,CAAC,MAAM;IACd,MAAMY,OAAO,GAAGJ,kBAAkB,CAACK,GAAG,CAACF,UAAU,CAAC,IAAI,CAAC;IACvD,IAAIG,OAAO,IAAIF,OAAO,GAAG,CAAC,EAAE;MAC1B,MAAM,IAAIG,KAAK,CACb,2GACF,CAAC;IACH;IACAP,kBAAkB,CAACQ,GAAG,CAACL,UAAU,EAAEC,OAAO,GAAG,CAAC,CAAC;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,CAAE7B,KAAK,KAAK,CAAC,GAAI,IAAI,IAAI,GAAG;IACtD8B,yBAAyB,EAAE,CAAC9B,KAAK,GAAG,IAAI,IAAI,GAAG;IAC/C+B,2BAA2B,EAAEhC,MAAM,EAAEiC,OAAO,IAAI,CAAC;IACjDC,2BAA2B,EAAElC,MAAM,EAAEmC,OAAO,IAAI,CAAC;IACjDC,8BAA8B,EAAEpC,MAAM,EAAEqC,UAAU,IAAI,CAAC;IACvDC,kCAAkC,EAAEtC,MAAM,EAAEuC,cAAc,IAAI;EAChE,CAAC;EAED,oBACEzF,IAAA,CAACF,oBAAoB;IAAC8C,GAAG,EAAED,YAAa;IAAA,GAAKS,WAAW;IAAAX,QAAA,EACrDA;EAAQ,CACW,CAAC;AAE3B;AAEA,OAAO,MAAMiD,cAAc,gBAAGjG,UAAU,CAGtC,SAASkG,uBAAuBA,CAACC,KAAK,EAAEjD,YAAY,EAAE;EACtDvC,uBAAuB,CAACwF,KAAK,CAACvF,UAAU,CAAC;EACzC,OAAOmC,oBAAoB,CAACoD,KAAK,EAAEjD,YAAY,CAAC;AAClD,CAAC,CAAC","ignoreList":[]}
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
 
3
- export { SmoothClipView } from "./SmoothClipView.ios.js";
3
+ export { renderSmoothClipView, sanitizeSmoothClipStyle, SmoothClipView } from "./SmoothClipView.ios.js";
4
4
  //# sourceMappingURL=SmoothClipView.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["SmoothClipView"],"sourceRoot":"../../src","sources":["SmoothClipView.tsx"],"mappings":";;AAAA,SAASA,cAAc,QAAQ,yBAAsB","ignoreList":[]}
1
+ {"version":3,"names":["renderSmoothClipView","sanitizeSmoothClipStyle","SmoothClipView"],"sourceRoot":"../../src","sources":["SmoothClipView.tsx"],"mappings":";;AAAA,SACEA,oBAAoB,EACpBC,uBAAuB,EACvBC,cAAc,QACT,yBAAsB","ignoreList":[]}
@@ -12,8 +12,6 @@ export interface NativeProps extends ViewProps {
12
12
  initialClipY: CodegenTypes.Double;
13
13
  initialClipWidth: CodegenTypes.Double;
14
14
  initialClipHeight: CodegenTypes.Double;
15
- initialClipRadius: CodegenTypes.Double;
16
- presentationVersion: CodegenTypes.Int32;
17
15
  initialClipTopLeftRadius: CodegenTypes.Double;
18
16
  initialClipTopRightRadius: CodegenTypes.Double;
19
17
  initialClipBottomRightRadius: CodegenTypes.Double;
@@ -22,28 +20,19 @@ export interface NativeProps extends ViewProps {
22
20
  initialContentTranslateX: CodegenTypes.Double;
23
21
  initialContentTranslateY: CodegenTypes.Double;
24
22
  initialContentScale: CodegenTypes.Double;
23
+ initialClipBoxShadowEnabled: boolean;
24
+ initialClipBoxShadowRed: CodegenTypes.Double;
25
+ initialClipBoxShadowGreen: CodegenTypes.Double;
26
+ initialClipBoxShadowBlue: CodegenTypes.Double;
27
+ initialClipBoxShadowAlpha: CodegenTypes.Double;
28
+ initialClipBoxShadowOffsetX: CodegenTypes.Double;
29
+ initialClipBoxShadowOffsetY: CodegenTypes.Double;
30
+ initialClipBoxShadowBlurRadius: CodegenTypes.Double;
31
+ initialClipBoxShadowSpreadDistance: CodegenTypes.Double;
25
32
  }
26
33
 
27
34
  interface NativeCommands {
28
- setClipGeometry: (
29
- viewRef: React.ElementRef<HostComponent<NativeProps>>,
30
- x: CodegenTypes.Double,
31
- y: CodegenTypes.Double,
32
- width: CodegenTypes.Double,
33
- height: CodegenTypes.Double,
34
- radius: CodegenTypes.Double
35
- ) => void;
36
35
  setClipPresentation: (
37
- viewRef: React.ElementRef<HostComponent<NativeProps>>,
38
- x: CodegenTypes.Double,
39
- y: CodegenTypes.Double,
40
- width: CodegenTypes.Double,
41
- height: CodegenTypes.Double,
42
- radius: CodegenTypes.Double,
43
- contentTranslateX: CodegenTypes.Double,
44
- contentTranslateY: CodegenTypes.Double
45
- ) => void;
46
- setClipPresentationV2: (
47
36
  viewRef: React.ElementRef<HostComponent<NativeProps>>,
48
37
  x: CodegenTypes.Double,
49
38
  y: CodegenTypes.Double,
@@ -56,16 +45,21 @@ interface NativeCommands {
56
45
  curveCode: CodegenTypes.Int32,
57
46
  contentTranslateX: CodegenTypes.Double,
58
47
  contentTranslateY: CodegenTypes.Double,
59
- contentScale: CodegenTypes.Double
48
+ contentScale: CodegenTypes.Double,
49
+ shadowEnabled: boolean,
50
+ shadowRed: CodegenTypes.Double,
51
+ shadowGreen: CodegenTypes.Double,
52
+ shadowBlue: CodegenTypes.Double,
53
+ shadowAlpha: CodegenTypes.Double,
54
+ shadowOffsetX: CodegenTypes.Double,
55
+ shadowOffsetY: CodegenTypes.Double,
56
+ shadowBlurRadius: CodegenTypes.Double,
57
+ shadowSpreadDistance: CodegenTypes.Double
60
58
  ) => void;
61
59
  }
62
60
 
63
61
  export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({
64
- supportedCommands: [
65
- 'setClipGeometry',
66
- 'setClipPresentation',
67
- 'setClipPresentationV2',
68
- ],
62
+ supportedCommands: ['setClipPresentation'],
69
63
  });
70
64
 
71
65
  export default codegenNativeComponent<NativeProps>(
@@ -1,34 +1,16 @@
1
1
  "use strict";
2
2
 
3
3
  import NativeSmoothClipModule from './smoothClipNative';
4
- import { SMOOTH_CLIP_V1_CAPABILITIES } from "./capabilityTypes.js";
5
4
  let cached;
6
5
  export function getSmoothClipCapabilities() {
7
6
  if (cached) return cached;
8
- const module = NativeSmoothClipModule;
9
- let version = 1;
10
- try {
11
- version = module.getPresentationProtocolVersion?.() === 2 ? 2 : 1;
12
- } catch {
13
- version = 1;
14
- }
15
- if (version !== 2) {
16
- cached = SMOOTH_CLIP_V1_CAPABILITIES;
17
- return cached;
18
- }
19
7
  let autonomousComplexPathAnimation = false;
20
8
  try {
21
- autonomousComplexPathAnimation = module.supportsAutonomousComplexPathAnimation?.() === true;
9
+ autonomousComplexPathAnimation = NativeSmoothClipModule.supportsAutonomousComplexPathAnimation() === true;
22
10
  } catch {
23
11
  autonomousComplexPathAnimation = false;
24
12
  }
25
- const groups = typeof module.beginGroupInteractionV2 === 'function' && typeof module.snapshotGroupV2 === 'function' && typeof module.setClipPresentationBatchV2 === 'function' && typeof module.animateTimingGroupV2 === 'function' && typeof module.animateSpringGroupV2 === 'function' && typeof module.animateKeyframesGroupV2 === 'function' && typeof module.cancelAnimationGroupV2 === 'function' && typeof module.onClipGroupAnimationComplete === 'function';
26
13
  cached = {
27
- presentationProtocolVersion: 2,
28
- groups,
29
- perCornerRadii: true,
30
- continuousCurve: true,
31
- contentScale: true,
32
14
  autonomousComplexPathAnimation
33
15
  };
34
16
  return cached;
@@ -1 +1 @@
1
- {"version":3,"names":["NativeSmoothClipModule","SMOOTH_CLIP_V1_CAPABILITIES","cached","getSmoothClipCapabilities","module","version","getPresentationProtocolVersion","autonomousComplexPathAnimation","supportsAutonomousComplexPathAnimation","groups","beginGroupInteractionV2","snapshotGroupV2","setClipPresentationBatchV2","animateTimingGroupV2","animateSpringGroupV2","animateKeyframesGroupV2","cancelAnimationGroupV2","onClipGroupAnimationComplete","presentationProtocolVersion","perCornerRadii","continuousCurve","contentScale"],"sourceRoot":"../../src","sources":["capabilities.native.ts"],"mappings":";;AAAA,OAAOA,sBAAsB,MAAM,oBAAoB;AACvD,SACEC,2BAA2B,QAEtB,sBAAmB;AAO1B,IAAIC,MAA0C;AAE9C,OAAO,SAASC,yBAAyBA,CAAA,EAA2B;EAClE,IAAID,MAAM,EAAE,OAAOA,MAAM;EACzB,MAAME,MAAM,GAAGJ,sBAAyC;EACxD,IAAIK,OAAO,GAAG,CAAC;EACf,IAAI;IACFA,OAAO,GAAGD,MAAM,CAACE,8BAA8B,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC;EACnE,CAAC,CAAC,MAAM;IACND,OAAO,GAAG,CAAC;EACb;EACA,IAAIA,OAAO,KAAK,CAAC,EAAE;IACjBH,MAAM,GAAGD,2BAA2B;IACpC,OAAOC,MAAM;EACf;EACA,IAAIK,8BAA8B,GAAG,KAAK;EAC1C,IAAI;IACFA,8BAA8B,GAC5BH,MAAM,CAACI,sCAAsC,GAAG,CAAC,KAAK,IAAI;EAC9D,CAAC,CAAC,MAAM;IACND,8BAA8B,GAAG,KAAK;EACxC;EACA,MAAME,MAAM,GACV,OACEL,MAAM,CASNM,uBAAuB,KAAK,UAAU,IACxC,OAAQN,MAAM,CAA2CO,eAAe,KACtE,UAAU,IACZ,OAAQP,MAAM,CACXQ,0BAA0B,KAAK,UAAU,IAC5C,OAAQR,MAAM,CACXS,oBAAoB,KAAK,UAAU,IACtC,OAAQT,MAAM,CACXU,oBAAoB,KAAK,UAAU,IACtC,OAAQV,MAAM,CACXW,uBAAuB,KAAK,UAAU,IACzC,OAAQX,MAAM,CACXY,sBAAsB,KAAK,UAAU,IACxC,OAAQZ,MAAM,CACXa,4BAA4B,KAAK,UAAU;EAChDf,MAAM,GAAG;IACPgB,2BAA2B,EAAE,CAAC;IAC9BT,MAAM;IACNU,cAAc,EAAE,IAAI;IACpBC,eAAe,EAAE,IAAI;IACrBC,YAAY,EAAE,IAAI;IAClBd;EACF,CAAC;EACD,OAAOL,MAAM;AACf","ignoreList":[]}
1
+ {"version":3,"names":["NativeSmoothClipModule","cached","getSmoothClipCapabilities","autonomousComplexPathAnimation","supportsAutonomousComplexPathAnimation"],"sourceRoot":"../../src","sources":["capabilities.native.ts"],"mappings":";;AAAA,OAAOA,sBAAsB,MAAM,oBAAoB;AAGvD,IAAIC,MAA0C;AAE9C,OAAO,SAASC,yBAAyBA,CAAA,EAA2B;EAClE,IAAID,MAAM,EAAE,OAAOA,MAAM;EACzB,IAAIE,8BAA8B,GAAG,KAAK;EAC1C,IAAI;IACFA,8BAA8B,GAC5BH,sBAAsB,CAACI,sCAAsC,CAAC,CAAC,KAAK,IAAI;EAC5E,CAAC,CAAC,MAAM;IACND,8BAA8B,GAAG,KAAK;EACxC;EACAF,MAAM,GAAG;IACPE;EACF,CAAC;EACD,OAAOF,MAAM;AACf","ignoreList":[]}
@@ -1,11 +1,2 @@
1
1
  "use strict";
2
-
3
- export const SMOOTH_CLIP_V1_CAPABILITIES = {
4
- presentationProtocolVersion: 1,
5
- groups: false,
6
- perCornerRadii: false,
7
- continuousCurve: false,
8
- contentScale: false,
9
- autonomousComplexPathAnimation: false
10
- };
11
2
  //# sourceMappingURL=capabilityTypes.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["SMOOTH_CLIP_V1_CAPABILITIES","presentationProtocolVersion","groups","perCornerRadii","continuousCurve","contentScale","autonomousComplexPathAnimation"],"sourceRoot":"../../src","sources":["capabilityTypes.ts"],"mappings":";;AASA,OAAO,MAAMA,2BAAmD,GAAG;EACjEC,2BAA2B,EAAE,CAAC;EAC9BC,MAAM,EAAE,KAAK;EACbC,cAAc,EAAE,KAAK;EACrBC,eAAe,EAAE,KAAK;EACtBC,YAAY,EAAE,KAAK;EACnBC,8BAA8B,EAAE;AAClC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":[],"sourceRoot":"../../src","sources":["capabilityTypes.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ const controllers = new WeakMap();
4
+ export function setControllerRef(controller, value) {
5
+ controllers.set(controller, value);
6
+ }
7
+ export function getControllerRef(controller) {
8
+ const value = controllers.get(controller);
9
+ if (!value) {
10
+ throw new Error('[SmoothClipView] Controllers must be created by useSmoothClipController.');
11
+ }
12
+ return value;
13
+ }
14
+ export function unwrapSmoothClipRef(ref) {
15
+ 'worklet';
16
+
17
+ const internal = ref;
18
+ if (internal === undefined || !Number.isSafeInteger(internal.id) || internal.id <= 0) {
19
+ return undefined;
20
+ }
21
+ return internal;
22
+ }
23
+ export function createSmoothClipRef(id) {
24
+ return {
25
+ id
26
+ };
27
+ }
28
+ //# sourceMappingURL=controllerInternals.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["controllers","WeakMap","setControllerRef","controller","value","set","getControllerRef","get","Error","unwrapSmoothClipRef","ref","internal","undefined","Number","isSafeInteger","id","createSmoothClipRef"],"sourceRoot":"../../src","sources":["controllerInternals.ts"],"mappings":";;AAUA,MAAMA,WAAW,GAAG,IAAIC,OAAO,CAG7B,CAAC;AAEH,OAAO,SAASC,gBAAgBA,CAC9BC,UAAgC,EAChCC,KAAmC,EAC7B;EACNJ,WAAW,CAACK,GAAG,CAACF,UAAU,EAAEC,KAAK,CAAC;AACpC;AAEA,OAAO,SAASE,gBAAgBA,CAC9BH,UAAgC,EACF;EAC9B,MAAMC,KAAK,GAAGJ,WAAW,CAACO,GAAG,CAACJ,UAAU,CAAC;EACzC,IAAI,CAACC,KAAK,EAAE;IACV,MAAM,IAAII,KAAK,CACb,0EACF,CAAC;EACH;EACA,OAAOJ,KAAK;AACd;AAEA,OAAO,SAASK,mBAAmBA,CACjCC,GAA8B,EACK;EACnC,SAAS;;EACT,MAAMC,QAAQ,GAAGD,GAAwC;EACzD,IACEC,QAAQ,KAAKC,SAAS,IACtB,CAACC,MAAM,CAACC,aAAa,CAACH,QAAQ,CAACI,EAAE,CAAC,IAClCJ,QAAQ,CAACI,EAAE,IAAI,CAAC,EAChB;IACA,OAAOH,SAAS;EAClB;EACA,OAAOD,QAAQ;AACjB;AAEA,OAAO,SAASK,mBAAmBA,CAACD,EAAU,EAAiB;EAC7D,OAAO;IAAEA;EAAG,CAAC;AACf","ignoreList":[]}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+
3
+ import NativeSmoothClipModule from "./NativeSmoothClipModule.js";
4
+
5
+ /** Destroy from the React Native runtime; native forwards to the UI thread. */
6
+ export function destroyController(controllerId) {
7
+ NativeSmoothClipModule.destroyDriver(controllerId);
8
+ }
9
+ //# sourceMappingURL=controllerLifecycle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NativeSmoothClipModule","destroyController","controllerId","destroyDriver"],"sourceRoot":"../../src","sources":["controllerLifecycle.ts"],"mappings":";;AAAA,OAAOA,sBAAsB,MAAM,6BAA0B;;AAE7D;AACA,OAAO,SAASC,iBAAiBA,CAACC,YAAoB,EAAQ;EAC5DF,sBAAsB,CAACG,aAAa,CAACD,YAAY,CAAC;AACpD","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ export {};
4
+ //# sourceMappingURL=controllerTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../src","sources":["controllerTypes.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ export { useSmoothClipController } from "./controllers.native.js";
4
+ //# sourceMappingURL=controllers.android.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useSmoothClipController"],"sourceRoot":"../../src","sources":["controllers.android.ts"],"mappings":";;AAAA,SAASA,uBAAuB,QAAQ,yBAAsB","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ export { useSmoothClipController } from "./controllers.native.js";
4
+ //# sourceMappingURL=controllers.ios.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useSmoothClipController"],"sourceRoot":"../../src","sources":["controllers.ios.ts"],"mappings":";;AAAA,SAASA,uBAAuB,QAAQ,yBAAsB","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ export { useSmoothClipController } from "./controllers.native.js";
4
+ //# sourceMappingURL=controllers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useSmoothClipController"],"sourceRoot":"../../src","sources":["controllers.ts"],"mappings":";;AAAA,SAASA,uBAAuB,QAAQ,yBAAsB","ignoreList":[]}
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+
3
+ import { useEffect, useRef } from 'react';
4
+ import { scheduleOnUI } from 'react-native-worklets';
5
+ import { createSmoothClipRef, setControllerRef } from "./controllerInternals.js";
6
+ import { destroyController } from "./controllerLifecycle.js";
7
+ import { allocateSmoothClipId } from "./ids.js";
8
+ import { canonicalizeClipPresentation, createClipPresentation } from "./geometry.js";
9
+ import { useSmoothClipGroup } from "./groups.native.js";
10
+ import { presentationPacket } from "./presentationCodec.js";
11
+ import NativeSmoothClipModule from './smoothClipNative';
12
+ const setClipPresentationHostFunction = NativeSmoothClipModule.setClipPresentation;
13
+ export function useSmoothClipController(initialValue, options = {}) {
14
+ // A controller is intentionally a one-member transaction group. This keeps
15
+ // validation, native dispatch, cancellation, completion, and lifecycle races
16
+ // on the same path as multi-member transitions.
17
+ const group = useSmoothClipGroup(options);
18
+ const initialRequested = 'clip' in initialValue ? initialValue : createClipPresentation(initialValue);
19
+ const canonicalInitial = canonicalizeClipPresentation(initialRequested);
20
+ if (canonicalInitial === null) {
21
+ throw new Error('[SmoothClipView] Initial presentation must be finite.');
22
+ }
23
+ const initialFrameRef = useRef(null);
24
+ initialFrameRef.current ??= canonicalInitial;
25
+ const initialFrame = initialFrameRef.current;
26
+ const idRef = useRef(0);
27
+ const controllerRef = useRef(null);
28
+ if (idRef.current === 0) idRef.current = allocateSmoothClipId();
29
+ const controllerId = idRef.current;
30
+ if (controllerRef.current === null) {
31
+ const ref = createSmoothClipRef(controllerId);
32
+ const controller = {
33
+ ref,
34
+ ui: {
35
+ beginInteraction() {
36
+ 'worklet';
37
+
38
+ return group.ui.beginInteraction([ref])[0]?.frame ?? initialFrame;
39
+ },
40
+ setFrame(frame) {
41
+ 'worklet';
42
+
43
+ group.ui.setFrames([{
44
+ clip: ref,
45
+ frame
46
+ }]);
47
+ },
48
+ animateTo(target, animation, completionTag = 0) {
49
+ 'worklet';
50
+
51
+ return group.ui.animateTo([{
52
+ clip: ref,
53
+ target
54
+ }], animation, completionTag);
55
+ },
56
+ cancel(run) {
57
+ 'worklet';
58
+
59
+ return group.ui.cancel(run)[0]?.frame ?? initialFrame;
60
+ }
61
+ },
62
+ react: {
63
+ animateTo(target, animation) {
64
+ return group.react.animateTo([{
65
+ clip: ref,
66
+ target
67
+ }], animation);
68
+ }
69
+ }
70
+ };
71
+ setControllerRef(controller, {
72
+ ref,
73
+ initialFrame
74
+ });
75
+ controllerRef.current = controller;
76
+ }
77
+ useEffect(() => {
78
+ scheduleOnUI((id, frame) => {
79
+ 'worklet';
80
+
81
+ setClipPresentationHostFunction(id, presentationPacket(frame), true, false);
82
+ }, controllerId, initialFrame);
83
+ return () => {
84
+ destroyController(controllerId);
85
+ };
86
+ }, [controllerId, initialFrame]);
87
+ return controllerRef.current;
88
+ }
89
+ //# sourceMappingURL=controllers.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useEffect","useRef","scheduleOnUI","createSmoothClipRef","setControllerRef","destroyController","allocateSmoothClipId","canonicalizeClipPresentation","createClipPresentation","useSmoothClipGroup","presentationPacket","NativeSmoothClipModule","setClipPresentationHostFunction","setClipPresentation","useSmoothClipController","initialValue","options","group","initialRequested","canonicalInitial","Error","initialFrameRef","current","initialFrame","idRef","controllerRef","controllerId","ref","controller","ui","beginInteraction","frame","setFrame","setFrames","clip","animateTo","target","animation","completionTag","cancel","run","react","id"],"sourceRoot":"../../src","sources":["controllers.native.ts"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,MAAM,QAAQ,OAAO;AACzC,SAASC,YAAY,QAAQ,uBAAuB;AAMpD,SAASC,mBAAmB,EAAEC,gBAAgB,QAAQ,0BAAuB;AAC7E,SAASC,iBAAiB,QAAQ,0BAAuB;AACzD,SAASC,oBAAoB,QAAQ,UAAO;AAC5C,SACEC,4BAA4B,EAC5BC,sBAAsB,QAEjB,eAAY;AACnB,SAASC,kBAAkB,QAAQ,oBAAiB;AACpD,SAASC,kBAAkB,QAAQ,wBAAqB;AACxD,OAAOC,sBAAsB,MAAM,oBAAoB;AAEvD,MAAMC,+BAA+B,GACnCD,sBAAsB,CAACE,mBAAmB;AAE5C,OAAO,SAASC,uBAAuBA,CACrCC,YAAoC,EACpCC,OAAoC,GAAG,CAAC,CAAC,EACnB;EACtB;EACA;EACA;EACA,MAAMC,KAAK,GAAGR,kBAAkB,CAACO,OAAO,CAAC;EACzC,MAAME,gBAAgB,GACpB,MAAM,IAAIH,YAAY,GAClBA,YAAY,GACZP,sBAAsB,CAACO,YAAY,CA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