@classic-homes/charts-react 0.1.30 → 0.1.32

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/dist/index.cjs CHANGED
@@ -362,20 +362,22 @@ function useChart({
362
362
  const chartRef = (0, import_react4.useRef)(null);
363
363
  const currentTheme = useChartTheme(theme);
364
364
  const reducedMotion = useReducedMotion();
365
+ const onReadyRef = (0, import_react4.useRef)(onReady);
366
+ onReadyRef.current = onReady;
365
367
  (0, import_react4.useEffect)(() => {
366
368
  if (!containerRef.current) return;
367
369
  if (chartRef.current) {
368
370
  chartRef.current.dispose();
369
371
  }
370
372
  chartRef.current = echarts2.init(containerRef.current, currentTheme);
371
- if (onReady && chartRef.current) {
372
- onReady(chartRef.current);
373
+ if (onReadyRef.current && chartRef.current) {
374
+ onReadyRef.current(chartRef.current);
373
375
  }
374
376
  return () => {
375
377
  chartRef.current?.dispose();
376
378
  chartRef.current = null;
377
379
  };
378
- }, [currentTheme, onReady]);
380
+ }, [currentTheme]);
379
381
  (0, import_react4.useEffect)(() => {
380
382
  if (!chartRef.current) return;
381
383
  const shouldAnimate = animation ?? !reducedMotion;
package/dist/index.js CHANGED
@@ -309,20 +309,22 @@ function useChart({
309
309
  const chartRef = useRef2(null);
310
310
  const currentTheme = useChartTheme(theme);
311
311
  const reducedMotion = useReducedMotion();
312
+ const onReadyRef = useRef2(onReady);
313
+ onReadyRef.current = onReady;
312
314
  useEffect4(() => {
313
315
  if (!containerRef.current) return;
314
316
  if (chartRef.current) {
315
317
  chartRef.current.dispose();
316
318
  }
317
319
  chartRef.current = echarts2.init(containerRef.current, currentTheme);
318
- if (onReady && chartRef.current) {
319
- onReady(chartRef.current);
320
+ if (onReadyRef.current && chartRef.current) {
321
+ onReadyRef.current(chartRef.current);
320
322
  }
321
323
  return () => {
322
324
  chartRef.current?.dispose();
323
325
  chartRef.current = null;
324
326
  };
325
- }, [currentTheme, onReady]);
327
+ }, [currentTheme]);
326
328
  useEffect4(() => {
327
329
  if (!chartRef.current) return;
328
330
  const shouldAnimate = animation ?? !reducedMotion;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@classic-homes/charts-react",
3
- "version": "0.1.30",
3
+ "version": "0.1.32",
4
4
  "description": "React ECharts components for Classic Theme",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -13,6 +13,7 @@
13
13
  "require": "./dist/index.js"
14
14
  }
15
15
  },
16
+ "sideEffects": false,
16
17
  "files": [
17
18
  "dist"
18
19
  ],
@@ -33,6 +34,18 @@
33
34
  "react": "^18.0.0 || ^19.0.0",
34
35
  "react-dom": "^18.0.0 || ^19.0.0"
35
36
  },
37
+ "keywords": [
38
+ "charts",
39
+ "echarts",
40
+ "react",
41
+ "design-system"
42
+ ],
43
+ "license": "MIT",
44
+ "repository": {
45
+ "type": "git",
46
+ "url": "https://github.com/Classic-Homes/classic-theme.git",
47
+ "directory": "packages/charts-react"
48
+ },
36
49
  "devDependencies": {
37
50
  "@types/react": "^18.2.0",
38
51
  "@types/react-dom": "^18.2.0",