From d780d7ba6912a3ac0740930ab6b643b20e6a8574 Mon Sep 17 00:00:00 2001 From: samfairbairn Date: Sun, 5 May 2024 23:03:07 -0700 Subject: [PATCH] test graph --- packages/storykit/package.json | 2 +- packages/storykit/rollup.config.js | 9 +++++++++ .../storykit/src/components/IPAGraph/forceGraph2d.ts | 3 --- .../components/IPARoyaltyChart/IPARoyaltyChart.tsx | 12 +++++++++++- packages/storykit/src/components/index.ts | 2 +- 5 files changed, 22 insertions(+), 6 deletions(-) delete mode 100644 packages/storykit/src/components/IPAGraph/forceGraph2d.ts diff --git a/packages/storykit/package.json b/packages/storykit/package.json index bcd4d78..8120327 100644 --- a/packages/storykit/package.json +++ b/packages/storykit/package.json @@ -1,7 +1,7 @@ { "name": "@storyprotocol/storykit", "author": "storyprotocol engineering ", - "version": "0.1.6-mrtest.8", + "version": "0.1.6-mrtest.9", "type": "module", "exports": { ".": { diff --git a/packages/storykit/rollup.config.js b/packages/storykit/rollup.config.js index 51ccd4d..be1a84a 100644 --- a/packages/storykit/rollup.config.js +++ b/packages/storykit/rollup.config.js @@ -16,14 +16,23 @@ const config = [ file: packageJson.exports["."].default, format: "cjs", sourcemap: true, + // globals: { + // react: "React", + // "react-dom": "ReactDOM", + // "react-apexcharts": "ApexCharts", + // }, }, { file: packageJson.exports["."].module, format: "esm", sourcemap: true, + // globals: { + // "react-apexcharts": "ApexCharts", + // }, }, ], plugins: [peerDepsExternal(), resolve(), commonjs(), typescript(), terser(), postcss()], + // external: ["react/jsx-runtime", "react-apexcharts"], external: ["react/jsx-runtime"], }, { diff --git a/packages/storykit/src/components/IPAGraph/forceGraph2d.ts b/packages/storykit/src/components/IPAGraph/forceGraph2d.ts deleted file mode 100644 index 35353f5..0000000 --- a/packages/storykit/src/components/IPAGraph/forceGraph2d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import ForceGraph2D from "react-force-graph-2d" - -export default ForceGraph2D diff --git a/packages/storykit/src/components/IPARoyaltyChart/IPARoyaltyChart.tsx b/packages/storykit/src/components/IPARoyaltyChart/IPARoyaltyChart.tsx index 295a858..10dcae2 100644 --- a/packages/storykit/src/components/IPARoyaltyChart/IPARoyaltyChart.tsx +++ b/packages/storykit/src/components/IPARoyaltyChart/IPARoyaltyChart.tsx @@ -1,22 +1,32 @@ import { shortenAddress } from "@/lib/utils" import { useIPAssetContext } from "@/providers" import { useEffect, useState } from "react" +// import Chart from "react-apexcharts" import { Address } from "viem" import "../../global.css" function IPARoyaltyChart() { + // const Chart = dynamic(() => import("react-apexcharts"), { ssr: false }) + const { royaltyData } = useIPAssetContext() + // console.log("Chart", Chart) + // eslint-disable-next-line @typescript-eslint/no-explicit-any const [Chart, setChart] = useState(null) useEffect(() => { import("react-apexcharts").then((Component) => setChart(Component)) }, []) - + console.log("Chart", Chart) + // eslint-disable-next-line @typescript-eslint/no-explicit-any + // let ApexChart = Chart ? (Chart as unknown as any)?.default || Chart : null let ApexChart = Chart + console.log("ApexChart 1", ApexChart) if (ApexChart?.default) ApexChart = ApexChart.default + console.log("ApexChart 2", ApexChart) if (ApexChart?.default) ApexChart = ApexChart.default + console.log("ApexChart 3", ApexChart) if (royaltyData?.targetAncestors) { const chart = { diff --git a/packages/storykit/src/components/index.ts b/packages/storykit/src/components/index.ts index 3ce02dc..86eb281 100644 --- a/packages/storykit/src/components/index.ts +++ b/packages/storykit/src/components/index.ts @@ -2,4 +2,4 @@ export * from "./Button" // export * from "./IPAssetWidget" export * from "./IPAGraph" export * from "./IPAPolicies" -export * from "./IPARoyaltyChart" +// export * from "./IPARoyaltyChart"