@coinbase/cds-mobile-visualization 3.4.0-beta.7 → 3.4.0-beta.8
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.8 (12/2/2025 PST)
|
|
12
|
+
|
|
13
|
+
#### 🐞 Fixes
|
|
14
|
+
|
|
15
|
+
- Fix reanimated animation warning. [[#211](https://github.com/coinbase/cds/pull/211)]
|
|
16
|
+
|
|
11
17
|
## 3.4.0-beta.7 (12/2/2025 PST)
|
|
12
18
|
|
|
13
19
|
#### 🐞 Fixes
|
package/dts/chart/Path.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Path.d.ts","sourceRoot":"","sources":["../../src/chart/Path.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EACL,KAAK,YAAY,EAGjB,KAAK,SAAS,IAAI,aAAa,EAGhC,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAKrD;;GAEG;AACH,eAAO,MAAM,2BAA2B,MAAM,CAAC;AAE/C,MAAM,MAAM,aAAa,GAAG;IAC1B;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,aAAa,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;CACtC,CAAC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,CAAC"}
|
package/esm/chart/Path.js
CHANGED
|
@@ -15,7 +15,6 @@ import { unwrapAnimatedValue } from './utils';
|
|
|
15
15
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
16
|
export const pathEnterTransitionDuration = 500;
|
|
17
17
|
const AnimatedPath = /*#__PURE__*/memo(_ref => {
|
|
18
|
-
var _d$value;
|
|
19
18
|
let {
|
|
20
19
|
d = '',
|
|
21
20
|
initialPath,
|
|
@@ -31,8 +30,11 @@ const AnimatedPath = /*#__PURE__*/memo(_ref => {
|
|
|
31
30
|
} = _ref,
|
|
32
31
|
pathProps = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
33
32
|
const isDAnimated = typeof d !== 'string';
|
|
33
|
+
|
|
34
|
+
// When d is animated, usePathTransition handles static path transitions.
|
|
35
|
+
// For animated d values, we skip usePathTransition and use useDerivedValue directly.
|
|
34
36
|
const animatedPath = usePathTransition({
|
|
35
|
-
currentPath: isDAnimated ?
|
|
37
|
+
currentPath: isDAnimated ? '' : d,
|
|
36
38
|
initialPath,
|
|
37
39
|
transition
|
|
38
40
|
});
|
|
@@ -40,8 +42,8 @@ const AnimatedPath = /*#__PURE__*/memo(_ref => {
|
|
|
40
42
|
const isStroked = stroke !== undefined && stroke !== 'none';
|
|
41
43
|
const activePath = useDerivedValue(() => {
|
|
42
44
|
if (isDAnimated) {
|
|
43
|
-
var _d$
|
|
44
|
-
return (_d$
|
|
45
|
+
var _d$value;
|
|
46
|
+
return (_d$value = d.value) != null ? _d$value : Skia.Path.Make();
|
|
45
47
|
}
|
|
46
48
|
return animatedPath.value;
|
|
47
49
|
});
|
|
@@ -162,53 +162,24 @@ export const usePathTransition = _ref => {
|
|
|
162
162
|
initialPath,
|
|
163
163
|
transition = defaultTransition
|
|
164
164
|
} = _ref;
|
|
165
|
-
|
|
165
|
+
// Track the previous path - updated in useEffect AFTER render,
|
|
166
|
+
// so during render it naturally holds the "from" path value
|
|
166
167
|
const previousPathRef = useRef(initialPath != null ? initialPath : currentPath);
|
|
167
|
-
const targetPathRef = useRef(currentPath);
|
|
168
168
|
const progress = useSharedValue(0);
|
|
169
|
-
const {
|
|
170
|
-
fromPath,
|
|
171
|
-
toPath
|
|
172
|
-
} = useMemo(() => {
|
|
173
|
-
const isNewPath = targetPathRef.current !== currentPath;
|
|
174
|
-
if (!isNewPath) {
|
|
175
|
-
return {
|
|
176
|
-
fromPath: previousPathRef.current,
|
|
177
|
-
toPath: targetPathRef.current
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
const currentProgress = progress.value;
|
|
181
|
-
const isInterrupting = currentProgress > 0 && currentProgress < 1;
|
|
182
|
-
if (isInterrupting) {
|
|
183
|
-
// Animation was interrupted - capture current interpolated path
|
|
184
|
-
const pathInterpolator = interpolatePath(previousPathRef.current, targetPathRef.current);
|
|
185
|
-
const currentInterpolatedPath = pathInterpolator(currentProgress);
|
|
186
|
-
return {
|
|
187
|
-
fromPath: currentInterpolatedPath,
|
|
188
|
-
toPath: currentPath
|
|
189
|
-
};
|
|
190
|
-
}
|
|
191
169
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
fromPath: startPath,
|
|
196
|
-
toPath: currentPath
|
|
197
|
-
};
|
|
198
|
-
}, [currentPath, initialPath, progress]);
|
|
170
|
+
// During render: previousPathRef still has old value, currentPath is new
|
|
171
|
+
const fromPath = previousPathRef.current;
|
|
172
|
+
const toPath = currentPath;
|
|
199
173
|
useEffect(() => {
|
|
200
|
-
const
|
|
201
|
-
|
|
174
|
+
const shouldAnimate = previousPathRef.current !== currentPath;
|
|
175
|
+
if (shouldAnimate) {
|
|
176
|
+
// Update ref for next path change (happens after this render)
|
|
177
|
+
previousPathRef.current = currentPath;
|
|
202
178
|
|
|
203
|
-
|
|
204
|
-
if (isPathChange || isInitialAnimation) {
|
|
205
|
-
// Update refs for next render
|
|
206
|
-
previousPathRef.current = fromPath;
|
|
207
|
-
targetPathRef.current = toPath;
|
|
179
|
+
// Animate from old path to new path
|
|
208
180
|
progress.value = 0;
|
|
209
181
|
progress.value = buildTransition(1, transition);
|
|
210
|
-
isInitialRender.current = false;
|
|
211
182
|
}
|
|
212
|
-
}, [currentPath,
|
|
183
|
+
}, [currentPath, transition, progress]);
|
|
213
184
|
return useD3PathInterpolation(progress, fromPath, toPath);
|
|
214
185
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coinbase/cds-mobile-visualization",
|
|
3
|
-
"version": "3.4.0-beta.
|
|
3
|
+
"version": "3.4.0-beta.8",
|
|
4
4
|
"description": "Coinbase Design System - Mobile Visualization Native",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
"CHANGELOG"
|
|
33
33
|
],
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@coinbase/cds-common": "^8.
|
|
35
|
+
"@coinbase/cds-common": "^8.27.2",
|
|
36
36
|
"@coinbase/cds-lottie-files": "^3.3.3",
|
|
37
|
-
"@coinbase/cds-mobile": "^8.
|
|
37
|
+
"@coinbase/cds-mobile": "^8.27.2",
|
|
38
38
|
"@coinbase/cds-utils": "^2.3.4",
|
|
39
39
|
"@shopify/react-native-skia": "^1.12.4 || ^2.0.0",
|
|
40
40
|
"react": "^18.3.1",
|
|
@@ -53,9 +53,9 @@
|
|
|
53
53
|
"@babel/preset-env": "^7.28.0",
|
|
54
54
|
"@babel/preset-react": "^7.27.1",
|
|
55
55
|
"@babel/preset-typescript": "^7.27.1",
|
|
56
|
-
"@coinbase/cds-common": "^8.
|
|
56
|
+
"@coinbase/cds-common": "^8.27.2",
|
|
57
57
|
"@coinbase/cds-lottie-files": "^3.3.3",
|
|
58
|
-
"@coinbase/cds-mobile": "^8.
|
|
58
|
+
"@coinbase/cds-mobile": "^8.27.2",
|
|
59
59
|
"@coinbase/cds-utils": "^2.3.4",
|
|
60
60
|
"@figma/code-connect": "^1.3.4",
|
|
61
61
|
"@shopify/react-native-skia": "1.12.4",
|