@idealyst/animate 1.2.59 → 1.2.61

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@idealyst/animate",
3
- "version": "1.2.59",
3
+ "version": "1.2.61",
4
4
  "description": "Cross-platform animation hooks for React and React Native",
5
5
  "readme": "README.md",
6
6
  "main": "src/index.ts",
@@ -30,7 +30,7 @@
30
30
  "publish:npm": "npm publish"
31
31
  },
32
32
  "peerDependencies": {
33
- "@idealyst/theme": "^1.2.59",
33
+ "@idealyst/theme": "^1.2.61",
34
34
  "react": ">=16.8.0",
35
35
  "react-native": ">=0.60.0",
36
36
  "react-native-reanimated": ">=3.0.0",
@@ -48,7 +48,7 @@
48
48
  }
49
49
  },
50
50
  "devDependencies": {
51
- "@idealyst/theme": "^1.2.59",
51
+ "@idealyst/theme": "^1.2.61",
52
52
  "@types/react": "^19.1.0",
53
53
  "react": "^19.1.0",
54
54
  "react-native": "^0.80.1",
@@ -133,9 +133,8 @@ export function useAnimatedStyle(
133
133
  return result;
134
134
  }, [normalizedTransform]);
135
135
 
136
- // Animate function
137
- const animate = (sharedValue: any, targetValue: any, isString = false) => {
138
- 'worklet';
136
+ // Create animation wrapper - called from JS thread, returns animation modifier
137
+ const animate = (targetValue: any, isString = false) => {
139
138
  if (useSpring && !isString) {
140
139
  const config = springConfig(springType as any);
141
140
  return finalDelay > 0
@@ -157,54 +156,54 @@ export function useAnimatedStyle(
157
156
  useEffect(() => {
158
157
  // Visual properties
159
158
  if (style.opacity !== undefined) {
160
- opacity.value = animate(opacity, style.opacity);
159
+ opacity.value = animate(style.opacity);
161
160
  }
162
161
  if (style.backgroundColor !== undefined) {
163
- backgroundColor.value = animate(backgroundColor, style.backgroundColor, true);
162
+ backgroundColor.value = animate(style.backgroundColor, true);
164
163
  }
165
164
  if (style.borderColor !== undefined) {
166
- borderColor.value = animate(borderColor, style.borderColor, true);
165
+ borderColor.value = animate(style.borderColor, true);
167
166
  }
168
167
  if (style.borderWidth !== undefined) {
169
- borderWidth.value = animate(borderWidth, style.borderWidth);
168
+ borderWidth.value = animate(style.borderWidth);
170
169
  }
171
170
  if (style.borderRadius !== undefined) {
172
- borderRadius.value = animate(borderRadius, style.borderRadius);
171
+ borderRadius.value = animate(style.borderRadius);
173
172
  }
174
173
 
175
174
  // Layout properties
176
175
  if (style.top !== undefined) {
177
- top.value = animate(top, style.top);
176
+ top.value = animate(style.top);
178
177
  }
179
178
  if (style.right !== undefined) {
180
- right.value = animate(right, style.right);
179
+ right.value = animate(style.right);
181
180
  }
182
181
  if (style.bottom !== undefined) {
183
- bottom.value = animate(bottom, style.bottom);
182
+ bottom.value = animate(style.bottom);
184
183
  }
185
184
  if (style.left !== undefined) {
186
- left.value = animate(left, style.left);
185
+ left.value = animate(style.left);
187
186
  }
188
187
  if (style.width !== undefined) {
189
- width.value = animate(width, style.width);
188
+ width.value = animate(style.width);
190
189
  }
191
190
  if (style.height !== undefined) {
192
- height.value = animate(height, style.height);
191
+ height.value = animate(style.height);
193
192
  }
194
193
 
195
194
  // Update transform values
196
- translateX.value = animate(translateX, transforms.translateX);
197
- translateY.value = animate(translateY, transforms.translateY);
198
- scale.value = animate(scale, transforms.scale);
199
- scaleX.value = animate(scaleX, transforms.scaleX);
200
- scaleY.value = animate(scaleY, transforms.scaleY);
201
- rotate.value = animate(rotate, transforms.rotate, true);
202
- rotateX.value = animate(rotateX, transforms.rotateX, true);
203
- rotateY.value = animate(rotateY, transforms.rotateY, true);
204
- rotateZ.value = animate(rotateZ, transforms.rotateZ, true);
205
- skewX.value = animate(skewX, transforms.skewX, true);
206
- skewY.value = animate(skewY, transforms.skewY, true);
207
- perspective.value = animate(perspective, transforms.perspective);
195
+ translateX.value = animate(transforms.translateX);
196
+ translateY.value = animate(transforms.translateY);
197
+ scale.value = animate(transforms.scale);
198
+ scaleX.value = animate(transforms.scaleX);
199
+ scaleY.value = animate(transforms.scaleY);
200
+ rotate.value = animate(transforms.rotate, true);
201
+ rotateX.value = animate(transforms.rotateX, true);
202
+ rotateY.value = animate(transforms.rotateY, true);
203
+ rotateZ.value = animate(transforms.rotateZ, true);
204
+ skewX.value = animate(transforms.skewX, true);
205
+ skewY.value = animate(transforms.skewY, true);
206
+ perspective.value = animate(transforms.perspective);
208
207
  }, [
209
208
  style.opacity,
210
209
  style.backgroundColor,
@@ -222,6 +221,7 @@ export function useAnimatedStyle(
222
221
 
223
222
  // Create animated style - only include properties that were specified
224
223
  const animatedStyle = useReanimatedStyle(() => {
224
+ 'worklet';
225
225
  const result: Record<string, any> = {
226
226
  opacity: opacity.value,
227
227
  backgroundColor: backgroundColor.value,