@coinbase/cds-mobile 9.12.2 → 9.13.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.
- package/CHANGELOG.md +12 -0
- package/dts/visualizations/chart/CartesianChart.d.ts +2 -1
- package/dts/visualizations/chart/CartesianChart.d.ts.map +1 -1
- package/dts/visualizations/chart/Path.d.ts +4 -0
- package/dts/visualizations/chart/Path.d.ts.map +1 -1
- package/dts/visualizations/chart/line/LineChart.d.ts +4 -0
- package/dts/visualizations/chart/line/LineChart.d.ts.map +1 -1
- package/dts/visualizations/chart/line/ReferenceLine.d.ts +5 -0
- package/dts/visualizations/chart/line/ReferenceLine.d.ts.map +1 -1
- package/dts/visualizations/chart/scrubber/ScrubberProvider.d.ts.map +1 -1
- package/dts/visualizations/chart/utils/transition.d.ts.map +1 -1
- package/esm/visualizations/chart/Path.js +105 -31
- package/esm/visualizations/chart/line/LineChart.js +4 -0
- package/esm/visualizations/chart/line/ReferenceLine.js +5 -2
- package/esm/visualizations/chart/line/__stories__/LineChart.stories.js +21 -0
- package/esm/visualizations/chart/scrubber/ScrubberProvider.js +40 -24
- package/esm/visualizations/chart/utils/transition.js +7 -3
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,18 @@ All notable changes to this project will be documented in this file.
|
|
|
8
8
|
|
|
9
9
|
<!-- template-start -->
|
|
10
10
|
|
|
11
|
+
## 9.13.0 (8/11/2026 PST)
|
|
12
|
+
|
|
13
|
+
#### 🚀 Updates
|
|
14
|
+
|
|
15
|
+
- Add a lightweight static render path for non-animated LineChart/CartesianChart (animate={false} uses a cheap rectangular clip instead of the anti-aliased path clip); ScrubberProvider now skips the pan gesture and animated reaction when scrubbing is disabled; add a strokeWidth prop to ReferenceLine. [[#840](https://github.com/coinbase/cds/pull/840)]
|
|
16
|
+
|
|
17
|
+
## 9.12.3 (8/10/2026 PST)
|
|
18
|
+
|
|
19
|
+
#### 🐞 Fixes
|
|
20
|
+
|
|
21
|
+
- Fix: reuse initial path on mobile charts. [[#837](https://github.com/coinbase/cds/pull/837)]
|
|
22
|
+
|
|
11
23
|
## 9.12.2 (8/10/2026 PST)
|
|
12
24
|
|
|
13
25
|
#### 🐞 Fixes
|
|
@@ -22,7 +22,8 @@ export type CartesianChartBaseProps = Omit<BoxBaseProps, 'fontFamily'> &
|
|
|
22
22
|
*/
|
|
23
23
|
layout?: CartesianChartLayout;
|
|
24
24
|
/**
|
|
25
|
-
* Whether to animate the chart.
|
|
25
|
+
* Whether to animate the chart. When `false`, lines render via a lightweight static path
|
|
26
|
+
* (a cheap rectangular clip) suited to non-interactive charts like row sparklines.
|
|
26
27
|
* @default true
|
|
27
28
|
*/
|
|
28
29
|
animate?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CartesianChart.d.ts","sourceRoot":"","sources":["../../../src/visualizations/chart/CartesianChart.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkE,MAAM,OAAO,CAAC;AACvF,OAAO,EAA0B,KAAK,SAAS,EAAE,KAAK,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAEjG,OAAO,EAAgB,KAAK,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAEvF,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAI/D,OAAO,EAEL,KAAK,8BAA8B,EACpC,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAoB,KAAK,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAC3F,OAAO,EAEL,KAAK,wBAAwB,EAO9B,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,KAAK,UAAU,EAKf,KAAK,cAAc,EACnB,KAAK,MAAM,EACZ,MAAM,eAAe,CAAC;AACvB,OAAO,EAAmC,KAAK,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAwE7F,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,YAAY,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F,CAAC"}
|
|
@@ -118,5 +118,9 @@ export type PathProps = PathBaseProps &
|
|
|
118
118
|
*/
|
|
119
119
|
clipRect?: Rect;
|
|
120
120
|
};
|
|
121
|
+
/**
|
|
122
|
+
* Renders a chart path. Delegates to a lightweight static renderer when the chart is not
|
|
123
|
+
* animating (no reanimated hooks, cheap rect clip) and to the animated renderer otherwise.
|
|
124
|
+
*/
|
|
121
125
|
export declare const Path: import('react').NamedExoticComponent<PathProps>;
|
|
122
126
|
//# sourceMappingURL=Path.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Path.d.ts","sourceRoot":"","sources":["../../../src/visualizations/chart/Path.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iCAAiC,CAAC;AAC5D,OAAO,EACL,KAAK,YAAY,EAGjB,KAAK,SAAS,IAAI,aAAa,EAGhC,MAAM,4BAA4B,CAAC;AAIpC,OAAO,EAIL,KAAK,UAAU,EAEhB,MAAM,oBAAoB,CAAC;AAG5B;;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;AAEF,MAAM,MAAM,SAAS,GAAG,aAAa,GACnC,IAAI,CACF,aAAa,EACX,WAAW,GACX,WAAW,GACX,UAAU,GACV,QAAQ,GACR,YAAY,GACZ,QAAQ,GACR,QAAQ,GACR,WAAW,GACX,YAAY,GACZ,aAAa,GACb,aA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IACH,aAAa,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,aAAa,GACnC,IAAI,CACF,aAAa,EACX,WAAW,GACX,WAAW,GACX,UAAU,GACV,QAAQ,GACR,YAAY,GACZ,QAAQ,GACR,QAAQ,GACR,WAAW,GACX,YAAY,GACZ,aAAa,GACb,aAAa,GACb,OAAO,GACP,WAAW,CACd,GAAG;IACF;;;;;;;;;;;;;;;;;OAiBG;IACH,WAAW,CAAC,EAAE;QACZ;;;WAGG;QACH,KAAK,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;QAC1B;;;;WAIG;QACH,YAAY,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;QACjC;;;WAGG;QACH,MAAM,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;KAC5B,CAAC;IACF;;;;OAIG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;;OAGG;IACH,CAAC,CAAC,EAAE,YAAY,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACrC;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,IAAI,CAAC;CACjB,CAAC;AAmUJ;;;GAGG;AACH,eAAO,MAAM,IAAI,iDAoBhB,CAAC"}
|
|
@@ -77,6 +77,10 @@ export type LineChartProps = LineChartBaseProps &
|
|
|
77
77
|
*/
|
|
78
78
|
scrubberAccessibilityLabelStep?: number;
|
|
79
79
|
};
|
|
80
|
+
/**
|
|
81
|
+
* A line chart built on `CartesianChart`. For non-interactive usage (e.g. row sparklines), pass
|
|
82
|
+
* `animate={false}` for a lightweight static render (cheap rectangular clip, no entrance animation).
|
|
83
|
+
*/
|
|
80
84
|
export declare const LineChart: import('react').MemoExoticComponent<
|
|
81
85
|
({
|
|
82
86
|
ref,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LineChart.d.ts","sourceRoot":"","sources":["../../../../src/visualizations/chart/line/LineChart.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAEL,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;AAU9C,MAAM,MAAM,UAAU,GAAG,MAAM,GAC7B,OAAO,CACL,IAAI,CACF,SAAS,EACP,OAAO,GACP,UAAU,GACV,UAAU,GACV,cAAc,GACd,MAAM,GACN,eAAe,GACf,eAAe,GACf,QAAQ,GACR,aAAa,GACb,eAAe,GACf,SAAS,GACT,QAAQ,GACR,cAAc,GACd,YAAY,GACZ,aAAa,CAChB,CACF,CAAC;AAEJ,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,uBAAuB,EAAE,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAC,GAC1F,IAAI,CACF,SAAS,EACP,UAAU,GACV,UAAU,GACV,MAAM,GACN,eAAe,GACf,eAAe,GACf,OAAO,GACP,QAAQ,GACR,aAAa,GACb,eAAe,GACf,cAAc,GACd,YAAY,GACZ,aAAa,GACb,SAAS,CACZ,GAAG;IACF;;;OAGG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IAC3B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB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,GACd,YAAY,GACZ,aAAa,CAChB,CACF,CAAC;AAEJ,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,uBAAuB,EAAE,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAC,GAC1F,IAAI,CACF,SAAS,EACP,UAAU,GACV,UAAU,GACV,MAAM,GACN,eAAe,GACf,eAAe,GACf,OAAO,GACP,QAAQ,GACR,aAAa,GACb,eAAe,GACf,cAAc,GACd,YAAY,GACZ,aAAa,GACb,SAAS,CACZ,GAAG;IACF;;;OAGG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IAC3B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC,wBAAwB,CAAC,GAAG,UAAU,CAAC;IACvD;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC,wBAAwB,CAAC,GAAG,UAAU,CAAC;CACxD,CAAC;AAEJ,MAAM,MAAM,cAAc,GAAG,kBAAkB,GAC7C,IAAI,CAAC,mBAAmB,EAAE,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,gCAAgC,CAAC,GAAG;IAC3F;;;OAGG;IACH,8BAA8B,CAAC,EAAE,MAAM,CAAC;CACzC,CAAC;AAEJ;;;GAGG;AACH,eAAO,MAAM,SAAS,uTA0BjB,cAAc,GAAG;IAClB,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;CACvB,6CAiHF,CAAC"}
|
|
@@ -97,6 +97,11 @@ export type ReferenceLineBaseProps = {
|
|
|
97
97
|
* @default theme.color.bgLine
|
|
98
98
|
*/
|
|
99
99
|
stroke?: string;
|
|
100
|
+
/**
|
|
101
|
+
* Width of the line.
|
|
102
|
+
* @default the line component's default (2)
|
|
103
|
+
*/
|
|
104
|
+
strokeWidth?: number;
|
|
100
105
|
/**
|
|
101
106
|
* Opacity applied to both the line and label.
|
|
102
107
|
* @default 1
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReferenceLine.d.ts","sourceRoot":"","sources":["../../../../src/visualizations/chart/line/ReferenceLine.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAI/D,OAAO,KAAK,EACV,iBAAiB,EACjB,cAAc,EACd,uBAAuB,EACvB,qBAAqB,EACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAMjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE5C,MAAM,MAAM,gCAAgC,GAAG,IAAI,CACjD,cAAc,EACZ,GAAG,GACH,GAAG,GACH,UAAU,GACV,OAAO,GACP,OAAO,GACP,YAAY,GACZ,cAAc,GACd,sBAAsB,GACtB,qBAAqB,GACrB,mBAAmB,GACnB,MAAM,GACN,YAAY,GACZ,cAAc,GACd,SAAS,GACT,IAAI,GACJ,IAAI,GACJ,UAAU,GACV,oBAAoB,CACvB,GAAG;IACF;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,KAAK,CAAC,EAAE,CAAC,gCAAgC,CAAC,CAAC;AAErF,MAAM,MAAM,sBAAsB,GAAG;IACnC;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B;;;OAGG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B;;;OAGG;IACH,cAAc,CAAC,EAAE,2BAA2B,CAAC;IAC7C;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;OAEG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IACnC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,wBAAwB,CAAC,EAAE,uBAAuB,CAAC;IACnD;;OAEG;IACH,sBAAsB,CAAC,EAAE,qBAAqB,CAAC;IAC/C;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IACvC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,OAAO,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;CAChC,CAAC;AAEF,KAAK,4BAA4B,GAAG,sBAAsB,GAAG;IAC3D;;OAEG;IACH,KAAK,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAC5B;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,aAAa,CAAC,EAAE,uBAAuB,CAAC;IACxC,KAAK,CAAC,EAAE,KAAK,CAAC;CACf,CAAC;AAEF,KAAK,0BAA0B,GAAG,sBAAsB,GAAG;IACzD;;OAEG;IACH,KAAK,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAC5B;;;OAGG;IACH,aAAa,CAAC,EAAE,qBAAqB,CAAC;IACtC,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,OAAO,CAAC,EAAE,KAAK,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,4BAA4B,GAAG,0BAA0B,CAAC;AAE3F,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"ReferenceLine.d.ts","sourceRoot":"","sources":["../../../../src/visualizations/chart/line/ReferenceLine.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAI/D,OAAO,KAAK,EACV,iBAAiB,EACjB,cAAc,EACd,uBAAuB,EACvB,qBAAqB,EACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,UAAU,EAAE,M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AC,MAAM,CAAC,CAAC;CAChC,CAAC;AAEF,KAAK,4BAA4B,GAAG,sBAAsB,GAAG;IAC3D;;OAEG;IACH,KAAK,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAC5B;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,aAAa,CAAC,EAAE,uBAAuB,CAAC;IACxC,KAAK,CAAC,EAAE,KAAK,CAAC;CACf,CAAC;AAEF,KAAK,0BAA0B,GAAG,sBAAsB,GAAG;IACzD;;OAEG;IACH,KAAK,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAC5B;;;OAGG;IACH,aAAa,CAAC,EAAE,qBAAqB,CAAC;IACtC,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,OAAO,CAAC,EAAE,KAAK,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,4BAA4B,GAAG,0BAA0B,CAAC;AAE3F,eAAO,MAAM,aAAa,0DAoJzB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScrubberProvider.d.ts","sourceRoot":"","sources":["../../../../src/visualizations/chart/scrubber/ScrubberProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAOpD,OAAO,EAAmB,KAAK,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAI9E,MAAM,MAAM,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,iBAAiB,CAAC,CAAC,GAAG;IAC3F,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;OAEG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;;OAGG;IACH,wBAAwB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;CAChE,CAAC;
|
|
1
|
+
{"version":3,"file":"ScrubberProvider.d.ts","sourceRoot":"","sources":["../../../../src/visualizations/chart/scrubber/ScrubberProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAOpD,OAAO,EAAmB,KAAK,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAI9E,MAAM,MAAM,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,iBAAiB,CAAC,CAAC,GAAG;IAC3F,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;OAEG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;;OAGG;IACH,wBAAwB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;CAChE,CAAC;AAwKF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAM5D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transition.d.ts","sourceRoot":"","sources":["../../../../src/visualizations/chart/utils/transition.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAKhB,KAAK,gBAAgB,EAErB,KAAK,gBAAgB,EACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAsB,KAAK,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAG7E;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,UAAU,GAAG,CACrB,CAAC;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,GAAG,gBAAgB,CAAC,GACvC,CAAC;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,GAAG,gBAAgB,CAAC,CAC1C,GAAG;IACF;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,UAI/B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,UAG/B,CAAC;AAEF;;GAEG;AACH,eAAO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,KAAG,WAAW,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"transition.d.ts","sourceRoot":"","sources":["../../../../src/visualizations/chart/utils/transition.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAKhB,KAAK,gBAAgB,EAErB,KAAK,gBAAgB,EACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAsB,KAAK,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAG7E;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,UAAU,GAAG,CACrB,CAAC;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,GAAG,gBAAgB,CAAC,GACvC,CAAC;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,GAAG,gBAAgB,CAAC,CAC1C,GAAG;IACF;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,UAI/B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,UAG/B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,+BAA+B,MAAM,CAAC;AAEnD;;GAEG;AACH,eAAO,MAAM,4BAA4B,MAAM,CAAC;AAEhD;;;GAGG;AACH,eAAO,MAAM,+BAA+B,EAAE,UAI7C,CAAC;AAOF;;;;GAIG;AACH,eAAO,MAAM,aAAa,GACxB,OAAO,UAAU,GAAG,IAAI,GAAG,SAAS,EACpC,SAAS,OAAO,EAChB,cAAc,UAAU,KACvB,UAAU,GAAG,IAGf,CAAC;AAGF;;GAEG;AACH,KAAK,YAAY,CAAC,CAAC,IAAI,CACrB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EAAE,EACf,MAAM,EAAE,CAAC,EAAE,EACX,OAAO,EAAE,iBAAiB,EAC1B,MAAM,EAAE,CAAC,KACN,CAAC,CAAC;AAEP,eAAO,MAAM,eAAe,GAAI,CAAC,EAC/B,SAAS,MAAM,CAAC,EAChB,OAAO,WAAW,CAAC,MAAM,CAAC,EAC1B,cAAc,YAAY,CAAC,CAAC,CAAC,EAC7B,OAAO,MAAM,EAAE,EACf,QAAQ,CAAC,EAAE,EACX,UAAU,iBAAiB,mBAc5B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,eAAe,GAAI,aAAa,MAAM,EAAE,YAAY,UAAU,GAAG,IAAI,KAAG,MA4BpF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,iBAAiB,GAAI,wDAK/B;IACD;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,WAAW,CAAC,EAAE;QACZ;;;;WAIG;QACH,KAAK,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;QAC1B;;;WAGG;QACH,MAAM,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;KAC5B,CAAC;IACF;;;OAGG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB,KAAG,WAAW,CAAC,MAAM,CAoHrB,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
const _excluded = ["d", "initialPath", "fill", "fillOpacity", "stroke", "strokeOpacity", "strokeWidth", "strokeCap", "strokeJoin", "children", "transitions"],
|
|
2
|
-
_excluded2 = ["animate", "clipRect", "clipPath", "clipOffset", "d", "initialPath", "fill", "fillOpacity", "stroke", "strokeOpacity", "strokeWidth", "strokeCap", "strokeJoin", "children", "transitions", "transition"]
|
|
2
|
+
_excluded2 = ["animate", "clipRect", "clipPath", "clipOffset", "d", "initialPath", "fill", "fillOpacity", "stroke", "strokeOpacity", "strokeWidth", "strokeCap", "strokeJoin", "children", "transitions", "transition"],
|
|
3
|
+
_excluded3 = ["clipRect", "clipPath", "clipOffset", "d", "fill", "fillOpacity", "stroke", "strokeOpacity", "strokeWidth", "strokeCap", "strokeJoin", "children"],
|
|
4
|
+
_excluded4 = ["animate", "initialPath", "transition", "transitions"];
|
|
3
5
|
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); }
|
|
4
6
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
5
7
|
import { memo, useEffect, useMemo } from 'react';
|
|
@@ -66,7 +68,9 @@ const AnimatedPath = /*#__PURE__*/memo(_ref => {
|
|
|
66
68
|
}))]
|
|
67
69
|
});
|
|
68
70
|
});
|
|
69
|
-
|
|
71
|
+
|
|
72
|
+
// Animated path: reanimated clip-reveal + shared values. Used when the chart animates (default).
|
|
73
|
+
const AnimatedChartPath = /*#__PURE__*/memo(props => {
|
|
70
74
|
const {
|
|
71
75
|
animate: animateProp,
|
|
72
76
|
clipRect,
|
|
@@ -183,28 +187,93 @@ export const Path = /*#__PURE__*/memo(props => {
|
|
|
183
187
|
// Return undefined here since we'll use animatedClipPath directly
|
|
184
188
|
return undefined;
|
|
185
189
|
}, [clipPathProp, animateClip, targetClipPath]);
|
|
190
|
+
const content = /*#__PURE__*/_jsx(AnimatedPath, {
|
|
191
|
+
d: d,
|
|
192
|
+
fill: fill,
|
|
193
|
+
fillOpacity: fillOpacity,
|
|
194
|
+
initialPath: initialPath,
|
|
195
|
+
stroke: stroke,
|
|
196
|
+
strokeCap: strokeCap,
|
|
197
|
+
strokeJoin: strokeJoin,
|
|
198
|
+
strokeOpacity: strokeOpacity,
|
|
199
|
+
strokeWidth: strokeWidth,
|
|
200
|
+
transitions: {
|
|
201
|
+
enter: enterTransition,
|
|
202
|
+
update: updateTransition
|
|
203
|
+
},
|
|
204
|
+
children: children
|
|
205
|
+
});
|
|
186
206
|
|
|
187
|
-
//
|
|
188
|
-
const
|
|
207
|
+
// Determine which clip path to use
|
|
208
|
+
const finalClipPath = animateClip && resolvedClipPath === undefined ? animatedClipPath : resolvedClipPath;
|
|
209
|
+
|
|
210
|
+
// If finalClipPath is null, render without clipping
|
|
211
|
+
if (finalClipPath === null) {
|
|
212
|
+
return /*#__PURE__*/_jsx(Group, {
|
|
213
|
+
opacity: animateEnterOpacity ? enterOpacity : undefined,
|
|
214
|
+
children: content
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
return /*#__PURE__*/_jsx(Group, {
|
|
218
|
+
clip: finalClipPath,
|
|
219
|
+
opacity: animateEnterOpacity ? enterOpacity : undefined,
|
|
220
|
+
children: content
|
|
221
|
+
});
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
// Non-animated path: skips the clip-reveal animation and uses a cheap rectangular clip.
|
|
225
|
+
const StaticChartPath = /*#__PURE__*/memo(_ref2 => {
|
|
226
|
+
let {
|
|
227
|
+
clipRect,
|
|
228
|
+
clipPath: clipPathProp,
|
|
229
|
+
clipOffset = 0,
|
|
230
|
+
d = '',
|
|
231
|
+
fill,
|
|
232
|
+
fillOpacity,
|
|
233
|
+
stroke,
|
|
234
|
+
strokeOpacity,
|
|
235
|
+
strokeWidth,
|
|
236
|
+
strokeCap,
|
|
237
|
+
strokeJoin,
|
|
238
|
+
children
|
|
239
|
+
} = _ref2,
|
|
240
|
+
pathProps = _objectWithoutPropertiesLoose(_ref2, _excluded3);
|
|
241
|
+
const context = useCartesianChartContext();
|
|
242
|
+
const rect = clipRect != null ? clipRect : context.drawingArea;
|
|
243
|
+
|
|
244
|
+
// Derived (not memoized) so an animated `d` — e.g. a reference line — still tracks scrubbing.
|
|
245
|
+
const path = useDerivedValue(() => {
|
|
189
246
|
var _Skia$Path$MakeFromSV;
|
|
190
247
|
const dValue = unwrapAnimatedValue(d);
|
|
191
248
|
if (!dValue) return Skia.Path.Make();
|
|
192
249
|
return (_Skia$Path$MakeFromSV = Skia.Path.MakeFromSVGString(dValue)) != null ? _Skia$Path$MakeFromSV : Skia.Path.Make();
|
|
193
250
|
}, [d]);
|
|
251
|
+
|
|
252
|
+
// Rect clip routes to canvas.clipRect (a cheap GPU scissor), not the anti-aliased path clip.
|
|
253
|
+
const clip = useMemo(() => {
|
|
254
|
+
if (clipPathProp !== undefined) return clipPathProp;
|
|
255
|
+
if (!rect) return null;
|
|
256
|
+
return {
|
|
257
|
+
x: rect.x - clipOffset,
|
|
258
|
+
y: rect.y - clipOffset,
|
|
259
|
+
width: rect.width + clipOffset * 2,
|
|
260
|
+
height: rect.height + clipOffset * 2
|
|
261
|
+
};
|
|
262
|
+
}, [clipPathProp, rect, clipOffset]);
|
|
194
263
|
const isFilled = fill !== undefined && fill !== 'none';
|
|
195
264
|
const isStroked = stroke !== undefined && stroke !== 'none';
|
|
196
|
-
const content =
|
|
265
|
+
const content = /*#__PURE__*/_jsxs(_Fragment, {
|
|
197
266
|
children: [isFilled && /*#__PURE__*/_jsx(SkiaPath, _extends({
|
|
198
267
|
color: fill,
|
|
199
268
|
opacity: fillOpacity,
|
|
200
|
-
path:
|
|
269
|
+
path: path,
|
|
201
270
|
style: "fill"
|
|
202
271
|
}, pathProps, {
|
|
203
272
|
children: children
|
|
204
273
|
})), isStroked && /*#__PURE__*/_jsx(SkiaPath, _extends({
|
|
205
274
|
color: stroke,
|
|
206
275
|
opacity: strokeOpacity,
|
|
207
|
-
path:
|
|
276
|
+
path: path,
|
|
208
277
|
strokeCap: strokeCap,
|
|
209
278
|
strokeJoin: strokeJoin,
|
|
210
279
|
strokeWidth: strokeWidth,
|
|
@@ -212,36 +281,41 @@ export const Path = /*#__PURE__*/memo(props => {
|
|
|
212
281
|
}, pathProps, {
|
|
213
282
|
children: children
|
|
214
283
|
}))]
|
|
215
|
-
}) : /*#__PURE__*/_jsx(AnimatedPath, {
|
|
216
|
-
d: d,
|
|
217
|
-
fill: fill,
|
|
218
|
-
fillOpacity: fillOpacity,
|
|
219
|
-
initialPath: initialPath,
|
|
220
|
-
stroke: stroke,
|
|
221
|
-
strokeCap: strokeCap,
|
|
222
|
-
strokeJoin: strokeJoin,
|
|
223
|
-
strokeOpacity: strokeOpacity,
|
|
224
|
-
strokeWidth: strokeWidth,
|
|
225
|
-
transitions: {
|
|
226
|
-
enter: enterTransition,
|
|
227
|
-
update: updateTransition
|
|
228
|
-
},
|
|
229
|
-
children: children
|
|
230
284
|
});
|
|
231
|
-
|
|
232
|
-
// Determine which clip path to use
|
|
233
|
-
const finalClipPath = animateClip && resolvedClipPath === undefined ? animatedClipPath : resolvedClipPath;
|
|
234
|
-
|
|
235
|
-
// If finalClipPath is null, render without clipping
|
|
236
|
-
if (finalClipPath === null) {
|
|
285
|
+
if (clip === null) {
|
|
237
286
|
return /*#__PURE__*/_jsx(Group, {
|
|
238
|
-
opacity: animateEnterOpacity ? enterOpacity : undefined,
|
|
239
287
|
children: content
|
|
240
288
|
});
|
|
241
289
|
}
|
|
242
290
|
return /*#__PURE__*/_jsx(Group, {
|
|
243
|
-
clip:
|
|
244
|
-
opacity: animateEnterOpacity ? enterOpacity : undefined,
|
|
291
|
+
clip: clip,
|
|
245
292
|
children: content
|
|
246
293
|
});
|
|
294
|
+
});
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Renders a chart path. Delegates to a lightweight static renderer when the chart is not
|
|
298
|
+
* animating (no reanimated hooks, cheap rect clip) and to the animated renderer otherwise.
|
|
299
|
+
*/
|
|
300
|
+
export const Path = /*#__PURE__*/memo(_ref3 => {
|
|
301
|
+
let {
|
|
302
|
+
animate: animateProp,
|
|
303
|
+
initialPath,
|
|
304
|
+
transition,
|
|
305
|
+
transitions
|
|
306
|
+
} = _ref3,
|
|
307
|
+
staticProps = _objectWithoutPropertiesLoose(_ref3, _excluded4);
|
|
308
|
+
const context = useCartesianChartContext();
|
|
309
|
+
const animate = animateProp != null ? animateProp : context.animate;
|
|
310
|
+
if (animate) {
|
|
311
|
+
return /*#__PURE__*/_jsx(AnimatedChartPath, _extends({
|
|
312
|
+
animate: animateProp,
|
|
313
|
+
initialPath: initialPath,
|
|
314
|
+
transition: transition,
|
|
315
|
+
transitions: transitions
|
|
316
|
+
}, staticProps));
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
// Animation-only props are omitted from the static renderer.
|
|
320
|
+
return /*#__PURE__*/_jsx(StaticChartPath, _extends({}, staticProps));
|
|
247
321
|
});
|
|
@@ -17,6 +17,10 @@ const getDefaultScrubberAccessibilityStep = function (dataLength, sampleCount) {
|
|
|
17
17
|
if (dataLength <= 0) return 1;
|
|
18
18
|
return Math.max(1, Math.ceil(dataLength / sampleCount));
|
|
19
19
|
};
|
|
20
|
+
/**
|
|
21
|
+
* A line chart built on `CartesianChart`. For non-interactive usage (e.g. row sparklines), pass
|
|
22
|
+
* `animate={false}` for a lightweight static render (cheap rectangular clip, no entrance animation).
|
|
23
|
+
*/
|
|
20
24
|
export const LineChart = /*#__PURE__*/memo(_ref => {
|
|
21
25
|
let {
|
|
22
26
|
ref,
|
|
@@ -24,6 +24,7 @@ export const ReferenceLine = /*#__PURE__*/memo(_ref => {
|
|
|
24
24
|
labelVerticalAlignment,
|
|
25
25
|
labelBoundsInset,
|
|
26
26
|
stroke,
|
|
27
|
+
strokeWidth,
|
|
27
28
|
opacity = 1
|
|
28
29
|
} = _ref;
|
|
29
30
|
const theme = useTheme();
|
|
@@ -81,7 +82,8 @@ export const ReferenceLine = /*#__PURE__*/memo(_ref => {
|
|
|
81
82
|
animate: false,
|
|
82
83
|
d: horizontalLine,
|
|
83
84
|
stroke: effectiveLineStroke,
|
|
84
|
-
strokeOpacity: opacity
|
|
85
|
+
strokeOpacity: opacity,
|
|
86
|
+
strokeWidth: strokeWidth
|
|
85
87
|
}), label && /*#__PURE__*/_jsx(LabelComponent, {
|
|
86
88
|
boundsInset: labelBoundsInset,
|
|
87
89
|
dx: labelDx,
|
|
@@ -113,7 +115,8 @@ export const ReferenceLine = /*#__PURE__*/memo(_ref => {
|
|
|
113
115
|
animate: false,
|
|
114
116
|
d: verticalLine,
|
|
115
117
|
stroke: effectiveLineStroke,
|
|
116
|
-
strokeOpacity: opacity
|
|
118
|
+
strokeOpacity: opacity,
|
|
119
|
+
strokeWidth: strokeWidth
|
|
117
120
|
}), label && /*#__PURE__*/_jsx(LabelComponent, {
|
|
118
121
|
boundsInset: labelBoundsInset,
|
|
119
122
|
dx: labelDx,
|
|
@@ -1794,6 +1794,27 @@ function ExampleNavigator() {
|
|
|
1794
1794
|
data: [10, 22, 29, 45, 98, 45, 22, 52, 21, 4, 68, 20, 21, 58]
|
|
1795
1795
|
}]
|
|
1796
1796
|
})
|
|
1797
|
+
}, {
|
|
1798
|
+
title: 'Lightweight (Static)',
|
|
1799
|
+
component: /*#__PURE__*/_jsx(LineChart, {
|
|
1800
|
+
animate: false,
|
|
1801
|
+
height: 200,
|
|
1802
|
+
series: [{
|
|
1803
|
+
id: 'prices',
|
|
1804
|
+
data: [-20, 12, -8, 34, -15, 28, -4, 40, -25, 18, -10, 30, -18, 22]
|
|
1805
|
+
}],
|
|
1806
|
+
yAxis: {
|
|
1807
|
+
domain: {
|
|
1808
|
+
min: -40,
|
|
1809
|
+
max: 45
|
|
1810
|
+
}
|
|
1811
|
+
},
|
|
1812
|
+
children: /*#__PURE__*/_jsx(ReferenceLine, {
|
|
1813
|
+
LineComponent: DottedLine,
|
|
1814
|
+
dataY: 0,
|
|
1815
|
+
strokeWidth: 2
|
|
1816
|
+
})
|
|
1817
|
+
})
|
|
1797
1818
|
}, {
|
|
1798
1819
|
title: 'Horizontal Layout',
|
|
1799
1820
|
component: /*#__PURE__*/_jsx(HorizontalLayoutLineChart, {})
|
|
@@ -1,3 +1,4 @@
|
|
|
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); }
|
|
1
2
|
import React, { useCallback, useMemo } from 'react';
|
|
2
3
|
import { Platform } from 'react-native';
|
|
3
4
|
import { Gesture, GestureDetector } from 'react-native-gesture-handler';
|
|
@@ -8,14 +9,10 @@ import { ScrubberContext } from '../utils/context';
|
|
|
8
9
|
import { getPointOnSerializableScale } from '../utils/point';
|
|
9
10
|
import { invertSerializableScale } from '../utils/scale';
|
|
10
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
* It depends on a ChartContext in order to provide accurate touch tracking.
|
|
14
|
-
*/
|
|
15
|
-
export const ScrubberProvider = _ref => {
|
|
12
|
+
// Sets up the pan gesture + animated reaction. Only mounted when scrubbing is enabled.
|
|
13
|
+
const EnabledScrubberProvider = _ref => {
|
|
16
14
|
let {
|
|
17
15
|
children,
|
|
18
|
-
enableScrubbing,
|
|
19
16
|
onScrubberPositionChange,
|
|
20
17
|
allowOverflowGestures
|
|
21
18
|
} = _ref;
|
|
@@ -119,31 +116,50 @@ export const ScrubberProvider = _ref => {
|
|
|
119
116
|
scrubberPosition.value = newScrubberPosition;
|
|
120
117
|
}
|
|
121
118
|
}).onEnd(function onEnd() {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
scrubberPosition.value = undefined;
|
|
125
|
-
}
|
|
119
|
+
runOnJS(handleStartEndHaptics)();
|
|
120
|
+
scrubberPosition.value = undefined;
|
|
126
121
|
}).onTouchesCancelled(function onTouchesCancelled() {
|
|
127
|
-
|
|
128
|
-
scrubberPosition.value = undefined;
|
|
129
|
-
}
|
|
122
|
+
scrubberPosition.value = undefined;
|
|
130
123
|
});
|
|
131
|
-
}, [allowOverflowGestures, handleStartEndHaptics, getDataIndexFromPosition, categoryAxisIsX, scrubberPosition
|
|
124
|
+
}, [allowOverflowGestures, handleStartEndHaptics, getDataIndexFromPosition, categoryAxisIsX, scrubberPosition]);
|
|
132
125
|
const contextValue = useMemo(() => ({
|
|
133
|
-
enableScrubbing:
|
|
126
|
+
enableScrubbing: true,
|
|
134
127
|
scrubberPosition
|
|
135
|
-
}), [
|
|
136
|
-
|
|
128
|
+
}), [scrubberPosition]);
|
|
129
|
+
return /*#__PURE__*/_jsx(GestureDetector, {
|
|
130
|
+
gesture: longPressGesture,
|
|
131
|
+
children: /*#__PURE__*/_jsx(ScrubberContext.Provider, {
|
|
132
|
+
value: contextValue,
|
|
133
|
+
children: children
|
|
134
|
+
})
|
|
135
|
+
});
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
// Supplies the ScrubberContext without the gesture/animated reaction (the common, disabled case).
|
|
139
|
+
const DisabledScrubberProvider = _ref2 => {
|
|
140
|
+
let {
|
|
141
|
+
children
|
|
142
|
+
} = _ref2;
|
|
143
|
+
const scrubberPosition = useSharedValue(undefined);
|
|
144
|
+
const contextValue = useMemo(() => ({
|
|
145
|
+
enableScrubbing: false,
|
|
146
|
+
scrubberPosition
|
|
147
|
+
}), [scrubberPosition]);
|
|
148
|
+
return /*#__PURE__*/_jsx(ScrubberContext.Provider, {
|
|
137
149
|
value: contextValue,
|
|
138
150
|
children: children
|
|
139
151
|
});
|
|
152
|
+
};
|
|
140
153
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
154
|
+
/**
|
|
155
|
+
* A component which encapsulates the ScrubberContext.
|
|
156
|
+
* It depends on a ChartContext in order to provide accurate touch tracking.
|
|
157
|
+
*/
|
|
158
|
+
export const ScrubberProvider = props => {
|
|
159
|
+
if (props.enableScrubbing) {
|
|
160
|
+
return /*#__PURE__*/_jsx(EnabledScrubberProvider, _extends({}, props));
|
|
147
161
|
}
|
|
148
|
-
return
|
|
162
|
+
return /*#__PURE__*/_jsx(DisabledScrubberProvider, {
|
|
163
|
+
children: props.children
|
|
164
|
+
});
|
|
149
165
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useEffect, useMemo, useRef } from 'react';
|
|
1
|
+
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
2
2
|
import { useAnimatedReaction, useSharedValue, withDelay, withSpring, withTiming } from 'react-native-reanimated';
|
|
3
3
|
import { notifyChange, Skia } from '@shopify/react-native-skia';
|
|
4
4
|
import { interpolatePath } from 'd3-interpolate-path';
|
|
@@ -166,7 +166,6 @@ export const buildTransition = (targetValue, transition) => {
|
|
|
166
166
|
* });
|
|
167
167
|
*/
|
|
168
168
|
export const usePathTransition = _ref => {
|
|
169
|
-
var _Skia$Path$MakeFromSV;
|
|
170
169
|
let {
|
|
171
170
|
currentPath,
|
|
172
171
|
initialPath,
|
|
@@ -183,7 +182,12 @@ export const usePathTransition = _ref => {
|
|
|
183
182
|
const isFirstAnimation = useRef(!!initialPath);
|
|
184
183
|
const interpolatorRef = useRef(null);
|
|
185
184
|
const progress = useSharedValue(0);
|
|
186
|
-
|
|
185
|
+
|
|
186
|
+
// Re-renders must not re-parse SVG; lazy useState seeds useSharedValue on mount only.
|
|
187
|
+
const [initialSkiaPath] = useState(() => {
|
|
188
|
+
var _Skia$Path$MakeFromSV;
|
|
189
|
+
return (_Skia$Path$MakeFromSV = Skia.Path.MakeFromSVGString(initialPath != null ? initialPath : currentPath)) != null ? _Skia$Path$MakeFromSV : Skia.Path.Make();
|
|
190
|
+
});
|
|
187
191
|
const normalizedStartShared = useSharedValue(initialSkiaPath);
|
|
188
192
|
const normalizedEndShared = useSharedValue(initialSkiaPath);
|
|
189
193
|
const fallbackPathShared = useSharedValue(initialSkiaPath);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coinbase/cds-mobile",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.13.0",
|
|
4
4
|
"description": "Coinbase Design System - Mobile",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -218,7 +218,7 @@
|
|
|
218
218
|
"react-native-worklets": "0.5.2"
|
|
219
219
|
},
|
|
220
220
|
"dependencies": {
|
|
221
|
-
"@coinbase/cds-common": "^9.
|
|
221
|
+
"@coinbase/cds-common": "^9.13.0",
|
|
222
222
|
"@coinbase/cds-icons": "^5.21.0",
|
|
223
223
|
"@coinbase/cds-illustrations": "^4.47.0",
|
|
224
224
|
"@coinbase/cds-lottie-files": "^3.3.4",
|