@coinbase/cds-mobile-visualization 3.4.0-beta.11 → 3.4.0-beta.12

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/CHANGELOG.md CHANGED
@@ -8,6 +8,12 @@ All notable changes to this project will be documented in this file.
8
8
 
9
9
  <!-- template-start -->
10
10
 
11
+ ## 3.4.0-beta.12 (1/8/2026 PST)
12
+
13
+ #### 🐞 Fixes
14
+
15
+ - Fix pulse with spread operator broken on new react-native architecture. [[#296](https://github.com/coinbase/cds/pull/296)]
16
+
11
17
  ## 3.4.0-beta.11 (1/7/2026 PST)
12
18
 
13
19
  #### 🐞 Fixes
@@ -1 +1 @@
1
- {"version":3,"file":"DefaultScrubberBeacon.d.ts","sourceRoot":"","sources":["../../../src/chart/scrubber/DefaultScrubberBeacon.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAkBzE,MAAM,MAAM,0BAA0B,GAAG,mBAAmB,CAAC;AAE7D,eAAO,MAAM,qBAAqB,wJAgLjC,CAAC"}
1
+ {"version":3,"file":"DefaultScrubberBeacon.d.ts","sourceRoot":"","sources":["../../../src/chart/scrubber/DefaultScrubberBeacon.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAkBzE,MAAM,MAAM,0BAA0B,GAAG,mBAAmB,CAAC;AAE7D,eAAO,MAAM,qBAAqB,wJAmLjC,CAAC"}
@@ -1,6 +1,5 @@
1
- function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
- import { forwardRef, memo, useImperativeHandle, useMemo } from 'react';
3
- import { cancelAnimation, Easing, useAnimatedReaction, useDerivedValue, useSharedValue, withRepeat, withSequence } from 'react-native-reanimated';
1
+ import { forwardRef, memo, useEffect, useImperativeHandle, useMemo } from 'react';
2
+ import { cancelAnimation, Easing, useAnimatedReaction, useDerivedValue, useSharedValue, withDelay, withRepeat, withSequence, withTiming } from 'react-native-reanimated';
4
3
  import { useTheme } from '@coinbase/cds-mobile';
5
4
  import { Circle, Group } from '@shopify/react-native-skia';
6
5
  import { useCartesianChartContext } from '../ChartProvider';
@@ -60,6 +59,14 @@ export const DefaultScrubberBeacon = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((
60
59
  }, [transitions == null ? void 0 : transitions.pulseRepeatDelay]);
61
60
  const pulseOpacity = useSharedValue(0);
62
61
  const pulseRadius = useSharedValue(pulseRadiusStart);
62
+
63
+ // Convert idlePulse prop to SharedValue so useAnimatedReaction can detect changes.
64
+ // In the new React Native architecture, regular JS props are captured by value in worklets
65
+ // and won't update when the prop changes.
66
+ const idlePulseShared = useSharedValue(idlePulse != null ? idlePulse : false);
67
+ useEffect(() => {
68
+ idlePulseShared.value = idlePulse != null ? idlePulse : false;
69
+ }, [idlePulse, idlePulseShared]);
63
70
  const animatedX = useSharedValue(0);
64
71
  const animatedY = useSharedValue(0);
65
72
 
@@ -103,41 +110,34 @@ export const DefaultScrubberBeacon = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((
103
110
  useImperativeHandle(ref, () => ({
104
111
  pulse: () => {
105
112
  // Only trigger manual pulse when idlePulse is not enabled
106
- if (!idlePulse) {
113
+ if (!idlePulseShared.value) {
107
114
  cancelAnimation(pulseOpacity);
108
115
  cancelAnimation(pulseRadius);
109
116
 
110
117
  // Manual pulse without delay
111
- const immediatePulseTransition = _extends({}, pulseTransition, {
112
- delay: 0
113
- });
114
118
  pulseOpacity.value = pulseOpacityStart;
115
119
  pulseRadius.value = pulseRadiusStart;
116
- pulseOpacity.value = buildTransition(pulseOpacityEnd, immediatePulseTransition);
117
- pulseRadius.value = buildTransition(pulseRadiusEnd, immediatePulseTransition);
120
+ pulseOpacity.value = buildTransition(pulseOpacityEnd, pulseTransition);
121
+ pulseRadius.value = buildTransition(pulseRadiusEnd, pulseTransition);
118
122
  }
119
123
  }
120
- }), [idlePulse, pulseOpacity, pulseRadius, pulseTransition]);
124
+ }), [idlePulseShared, pulseOpacity, pulseRadius, pulseTransition]);
121
125
 
122
126
  // Watch idlePulse changes and control continuous pulse
123
- useAnimatedReaction(() => idlePulse, (current, previous) => {
127
+ useAnimatedReaction(() => idlePulseShared.value, (current, previous) => {
124
128
  if (!animate) return;
125
129
  if (current) {
126
130
  // Start continuous pulse when idlePulse is enabled
127
- // Create instant transition to reset pulse after delay
128
- const instantTransition = {
129
- type: 'timing',
130
- duration: 0
131
- };
132
- const resetWithDelay = _extends({}, instantTransition, {
133
- delay: pulseRepeatDelay
134
- });
135
131
  pulseOpacity.value = pulseOpacityStart;
136
132
  pulseRadius.value = pulseRadiusStart;
137
- pulseOpacity.value = withRepeat(withSequence(buildTransition(pulseOpacityEnd, pulseTransition), buildTransition(pulseOpacityStart, resetWithDelay)), -1,
133
+ pulseOpacity.value = withRepeat(withSequence(buildTransition(pulseOpacityEnd, pulseTransition), withDelay(pulseRepeatDelay, withTiming(pulseOpacityStart, {
134
+ duration: 0
135
+ }))), -1,
138
136
  // infinite loop
139
137
  false);
140
- pulseRadius.value = withRepeat(withSequence(buildTransition(pulseRadiusEnd, pulseTransition), buildTransition(pulseRadiusStart, resetWithDelay)), -1,
138
+ pulseRadius.value = withRepeat(withSequence(buildTransition(pulseRadiusEnd, pulseTransition), withDelay(pulseRepeatDelay, withTiming(pulseRadiusStart, {
139
+ duration: 0
140
+ }))), -1,
141
141
  // infinite loop
142
142
  false);
143
143
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coinbase/cds-mobile-visualization",
3
- "version": "3.4.0-beta.11",
3
+ "version": "3.4.0-beta.12",
4
4
  "description": "Coinbase Design System - Mobile Visualization Native",
5
5
  "repository": {
6
6
  "type": "git",