diff --git a/core/react/src/index.ts b/core/react/src/index.ts index 260cf48..39e5c82 100644 --- a/core/react/src/index.ts +++ b/core/react/src/index.ts @@ -15,7 +15,7 @@ export const store = create( })) ); -subStateChange(Emitter, store); +subStateChange(Emitter, store) export const useStatus = () => store(selectors.status); export const useChainId = () => store(selectors.chainId); diff --git a/examples/docs/index.html b/dev-examples/docs/index.html similarity index 100% rename from examples/docs/index.html rename to dev-examples/docs/index.html diff --git a/examples/docs/package.json b/dev-examples/docs/package.json similarity index 100% rename from examples/docs/package.json rename to dev-examples/docs/package.json diff --git a/examples/docs/postcss.config.js b/dev-examples/docs/postcss.config.js similarity index 100% rename from examples/docs/postcss.config.js rename to dev-examples/docs/postcss.config.js diff --git a/examples/docs/src/assets/cfx.svg b/dev-examples/docs/src/assets/cfx.svg similarity index 100% rename from examples/docs/src/assets/cfx.svg rename to dev-examples/docs/src/assets/cfx.svg diff --git a/examples/docs/src/assets/close.svg b/dev-examples/docs/src/assets/close.svg similarity index 100% rename from examples/docs/src/assets/close.svg rename to dev-examples/docs/src/assets/close.svg diff --git a/examples/docs/src/assets/code.svg b/dev-examples/docs/src/assets/code.svg similarity index 100% rename from examples/docs/src/assets/code.svg rename to dev-examples/docs/src/assets/code.svg diff --git a/examples/docs/src/assets/dark-mode.svg b/dev-examples/docs/src/assets/dark-mode.svg similarity index 100% rename from examples/docs/src/assets/dark-mode.svg rename to dev-examples/docs/src/assets/dark-mode.svg diff --git a/examples/docs/src/assets/fluentAdvance1.jpg b/dev-examples/docs/src/assets/fluentAdvance1.jpg similarity index 100% rename from examples/docs/src/assets/fluentAdvance1.jpg rename to dev-examples/docs/src/assets/fluentAdvance1.jpg diff --git a/examples/docs/src/assets/fluentAdvance2.jpg b/dev-examples/docs/src/assets/fluentAdvance2.jpg similarity index 100% rename from examples/docs/src/assets/fluentAdvance2.jpg rename to dev-examples/docs/src/assets/fluentAdvance2.jpg diff --git a/examples/docs/src/assets/light-mode.svg b/dev-examples/docs/src/assets/light-mode.svg similarity index 100% rename from examples/docs/src/assets/light-mode.svg rename to dev-examples/docs/src/assets/light-mode.svg diff --git a/examples/docs/src/assets/logo.svg b/dev-examples/docs/src/assets/logo.svg similarity index 100% rename from examples/docs/src/assets/logo.svg rename to dev-examples/docs/src/assets/logo.svg diff --git a/examples/docs/src/assets/metamask-fox.svg b/dev-examples/docs/src/assets/metamask-fox.svg similarity index 100% rename from examples/docs/src/assets/metamask-fox.svg rename to dev-examples/docs/src/assets/metamask-fox.svg diff --git a/examples/docs/src/assets/success.svg b/dev-examples/docs/src/assets/success.svg similarity index 100% rename from examples/docs/src/assets/success.svg rename to dev-examples/docs/src/assets/success.svg diff --git a/examples/docs/src/components/Animation/index.tsx b/dev-examples/docs/src/components/Animation/index.tsx similarity index 100% rename from examples/docs/src/components/Animation/index.tsx rename to dev-examples/docs/src/components/Animation/index.tsx diff --git a/examples/docs/src/components/Code/index.css b/dev-examples/docs/src/components/Code/index.css similarity index 100% rename from examples/docs/src/components/Code/index.css rename to dev-examples/docs/src/components/Code/index.css diff --git a/examples/docs/src/components/Code/index.tsx b/dev-examples/docs/src/components/Code/index.tsx similarity index 100% rename from examples/docs/src/components/Code/index.tsx rename to dev-examples/docs/src/components/Code/index.tsx diff --git a/examples/docs/src/components/List/index.tsx b/dev-examples/docs/src/components/List/index.tsx similarity index 100% rename from examples/docs/src/components/List/index.tsx rename to dev-examples/docs/src/components/List/index.tsx diff --git a/examples/docs/src/components/Mask/index.tsx b/dev-examples/docs/src/components/Mask/index.tsx similarity index 100% rename from examples/docs/src/components/Mask/index.tsx rename to dev-examples/docs/src/components/Mask/index.tsx diff --git a/examples/docs/src/components/Popup/Popup.tsx b/dev-examples/docs/src/components/Popup/Popup.tsx similarity index 100% rename from examples/docs/src/components/Popup/Popup.tsx rename to dev-examples/docs/src/components/Popup/Popup.tsx diff --git a/examples/docs/src/components/Popup/index.tsx b/dev-examples/docs/src/components/Popup/index.tsx similarity index 100% rename from examples/docs/src/components/Popup/index.tsx rename to dev-examples/docs/src/components/Popup/index.tsx diff --git a/examples/docs/src/components/tools/Modal/index.css b/dev-examples/docs/src/components/tools/Modal/index.css similarity index 100% rename from examples/docs/src/components/tools/Modal/index.css rename to dev-examples/docs/src/components/tools/Modal/index.css diff --git a/examples/docs/src/components/tools/Modal/index.tsx b/dev-examples/docs/src/components/tools/Modal/index.tsx similarity index 100% rename from examples/docs/src/components/tools/Modal/index.tsx rename to dev-examples/docs/src/components/tools/Modal/index.tsx diff --git a/examples/docs/src/components/tools/Toast/index.tsx b/dev-examples/docs/src/components/tools/Toast/index.tsx similarity index 100% rename from examples/docs/src/components/tools/Toast/index.tsx rename to dev-examples/docs/src/components/tools/Toast/index.tsx diff --git a/examples/docs/src/favicon.ico b/dev-examples/docs/src/favicon.ico similarity index 100% rename from examples/docs/src/favicon.ico rename to dev-examples/docs/src/favicon.ico diff --git a/examples/docs/src/hooks/useClickOutside.ts b/dev-examples/docs/src/hooks/useClickOutside.ts similarity index 100% rename from examples/docs/src/hooks/useClickOutside.ts rename to dev-examples/docs/src/hooks/useClickOutside.ts diff --git a/examples/docs/src/hooks/useCurrentLib.ts b/dev-examples/docs/src/hooks/useCurrentLib.ts similarity index 100% rename from examples/docs/src/hooks/useCurrentLib.ts rename to dev-examples/docs/src/hooks/useCurrentLib.ts diff --git a/examples/docs/src/hooks/useI18n.ts b/dev-examples/docs/src/hooks/useI18n.ts similarity index 100% rename from examples/docs/src/hooks/useI18n.ts rename to dev-examples/docs/src/hooks/useI18n.ts diff --git a/examples/docs/src/hooks/useMeasure.ts b/dev-examples/docs/src/hooks/useMeasure.ts similarity index 100% rename from examples/docs/src/hooks/useMeasure.ts rename to dev-examples/docs/src/hooks/useMeasure.ts diff --git a/examples/docs/src/hooks/useMode.ts b/dev-examples/docs/src/hooks/useMode.ts similarity index 100% rename from examples/docs/src/hooks/useMode.ts rename to dev-examples/docs/src/hooks/useMode.ts diff --git a/examples/docs/src/index.css b/dev-examples/docs/src/index.css similarity index 100% rename from examples/docs/src/index.css rename to dev-examples/docs/src/index.css diff --git a/examples/docs/src/main.tsx b/dev-examples/docs/src/main.tsx similarity index 100% rename from examples/docs/src/main.tsx rename to dev-examples/docs/src/main.tsx diff --git a/examples/docs/src/pages/API/Catalogue/Basic/BasicUsage.tsx b/dev-examples/docs/src/pages/API/Catalogue/Basic/BasicUsage.tsx similarity index 100% rename from examples/docs/src/pages/API/Catalogue/Basic/BasicUsage.tsx rename to dev-examples/docs/src/pages/API/Catalogue/Basic/BasicUsage.tsx diff --git a/examples/docs/src/pages/API/Catalogue/Basic/Install.tsx b/dev-examples/docs/src/pages/API/Catalogue/Basic/Install.tsx similarity index 100% rename from examples/docs/src/pages/API/Catalogue/Basic/Install.tsx rename to dev-examples/docs/src/pages/API/Catalogue/Basic/Install.tsx diff --git a/examples/docs/src/pages/API/Catalogue/Basic/index.tsx b/dev-examples/docs/src/pages/API/Catalogue/Basic/index.tsx similarity index 100% rename from examples/docs/src/pages/API/Catalogue/Basic/index.tsx rename to dev-examples/docs/src/pages/API/Catalogue/Basic/index.tsx diff --git a/examples/docs/src/pages/API/Catalogue/FAQ/FluentAndMetaMask.tsx b/dev-examples/docs/src/pages/API/Catalogue/FAQ/FluentAndMetaMask.tsx similarity index 100% rename from examples/docs/src/pages/API/Catalogue/FAQ/FluentAndMetaMask.tsx rename to dev-examples/docs/src/pages/API/Catalogue/FAQ/FluentAndMetaMask.tsx diff --git a/examples/docs/src/pages/API/Catalogue/FAQ/FluentHostMetaMask.tsx b/dev-examples/docs/src/pages/API/Catalogue/FAQ/FluentHostMetaMask.tsx similarity index 100% rename from examples/docs/src/pages/API/Catalogue/FAQ/FluentHostMetaMask.tsx rename to dev-examples/docs/src/pages/API/Catalogue/FAQ/FluentHostMetaMask.tsx diff --git a/examples/docs/src/pages/API/Catalogue/FAQ/OnlyFluent.tsx b/dev-examples/docs/src/pages/API/Catalogue/FAQ/OnlyFluent.tsx similarity index 100% rename from examples/docs/src/pages/API/Catalogue/FAQ/OnlyFluent.tsx rename to dev-examples/docs/src/pages/API/Catalogue/FAQ/OnlyFluent.tsx diff --git a/examples/docs/src/pages/API/Catalogue/FAQ/index.tsx b/dev-examples/docs/src/pages/API/Catalogue/FAQ/index.tsx similarity index 100% rename from examples/docs/src/pages/API/Catalogue/FAQ/index.tsx rename to dev-examples/docs/src/pages/API/Catalogue/FAQ/index.tsx diff --git a/examples/docs/src/pages/API/Catalogue/Function/AddChain.tsx b/dev-examples/docs/src/pages/API/Catalogue/Function/AddChain.tsx similarity index 100% rename from examples/docs/src/pages/API/Catalogue/Function/AddChain.tsx rename to dev-examples/docs/src/pages/API/Catalogue/Function/AddChain.tsx diff --git a/examples/docs/src/pages/API/Catalogue/Function/Connect.tsx b/dev-examples/docs/src/pages/API/Catalogue/Function/Connect.tsx similarity index 100% rename from examples/docs/src/pages/API/Catalogue/Function/Connect.tsx rename to dev-examples/docs/src/pages/API/Catalogue/Function/Connect.tsx diff --git a/examples/docs/src/pages/API/Catalogue/Function/PersonalSign.tsx b/dev-examples/docs/src/pages/API/Catalogue/Function/PersonalSign.tsx similarity index 100% rename from examples/docs/src/pages/API/Catalogue/Function/PersonalSign.tsx rename to dev-examples/docs/src/pages/API/Catalogue/Function/PersonalSign.tsx diff --git a/examples/docs/src/pages/API/Catalogue/Function/SendTransaction.tsx b/dev-examples/docs/src/pages/API/Catalogue/Function/SendTransaction.tsx similarity index 100% rename from examples/docs/src/pages/API/Catalogue/Function/SendTransaction.tsx rename to dev-examples/docs/src/pages/API/Catalogue/Function/SendTransaction.tsx diff --git a/examples/docs/src/pages/API/Catalogue/Function/SwitchChain.tsx b/dev-examples/docs/src/pages/API/Catalogue/Function/SwitchChain.tsx similarity index 100% rename from examples/docs/src/pages/API/Catalogue/Function/SwitchChain.tsx rename to dev-examples/docs/src/pages/API/Catalogue/Function/SwitchChain.tsx diff --git a/examples/docs/src/pages/API/Catalogue/Function/TypedSign.tsx b/dev-examples/docs/src/pages/API/Catalogue/Function/TypedSign.tsx similarity index 100% rename from examples/docs/src/pages/API/Catalogue/Function/TypedSign.tsx rename to dev-examples/docs/src/pages/API/Catalogue/Function/TypedSign.tsx diff --git a/examples/docs/src/pages/API/Catalogue/Function/WatchAsset.tsx b/dev-examples/docs/src/pages/API/Catalogue/Function/WatchAsset.tsx similarity index 100% rename from examples/docs/src/pages/API/Catalogue/Function/WatchAsset.tsx rename to dev-examples/docs/src/pages/API/Catalogue/Function/WatchAsset.tsx diff --git a/examples/docs/src/pages/API/Catalogue/Function/index.tsx b/dev-examples/docs/src/pages/API/Catalogue/Function/index.tsx similarity index 100% rename from examples/docs/src/pages/API/Catalogue/Function/index.tsx rename to dev-examples/docs/src/pages/API/Catalogue/Function/index.tsx diff --git a/examples/docs/src/pages/API/Catalogue/Hooks/UseAccount.tsx b/dev-examples/docs/src/pages/API/Catalogue/Hooks/UseAccount.tsx similarity index 100% rename from examples/docs/src/pages/API/Catalogue/Hooks/UseAccount.tsx rename to dev-examples/docs/src/pages/API/Catalogue/Hooks/UseAccount.tsx diff --git a/examples/docs/src/pages/API/Catalogue/Hooks/UseBalance.tsx b/dev-examples/docs/src/pages/API/Catalogue/Hooks/UseBalance.tsx similarity index 100% rename from examples/docs/src/pages/API/Catalogue/Hooks/UseBalance.tsx rename to dev-examples/docs/src/pages/API/Catalogue/Hooks/UseBalance.tsx diff --git a/examples/docs/src/pages/API/Catalogue/Hooks/UseChainId.tsx b/dev-examples/docs/src/pages/API/Catalogue/Hooks/UseChainId.tsx similarity index 100% rename from examples/docs/src/pages/API/Catalogue/Hooks/UseChainId.tsx rename to dev-examples/docs/src/pages/API/Catalogue/Hooks/UseChainId.tsx diff --git a/examples/docs/src/pages/API/Catalogue/Hooks/UseStatus.tsx b/dev-examples/docs/src/pages/API/Catalogue/Hooks/UseStatus.tsx similarity index 100% rename from examples/docs/src/pages/API/Catalogue/Hooks/UseStatus.tsx rename to dev-examples/docs/src/pages/API/Catalogue/Hooks/UseStatus.tsx diff --git a/examples/docs/src/pages/API/Catalogue/Hooks/index.tsx b/dev-examples/docs/src/pages/API/Catalogue/Hooks/index.tsx similarity index 100% rename from examples/docs/src/pages/API/Catalogue/Hooks/index.tsx rename to dev-examples/docs/src/pages/API/Catalogue/Hooks/index.tsx diff --git a/examples/docs/src/pages/API/Catalogue/Others/CompleteDetectApi.tsx b/dev-examples/docs/src/pages/API/Catalogue/Others/CompleteDetectApi.tsx similarity index 100% rename from examples/docs/src/pages/API/Catalogue/Others/CompleteDetectApi.tsx rename to dev-examples/docs/src/pages/API/Catalogue/Others/CompleteDetectApi.tsx diff --git a/examples/docs/src/pages/API/Catalogue/Others/ProviderApi.tsx b/dev-examples/docs/src/pages/API/Catalogue/Others/ProviderApi.tsx similarity index 100% rename from examples/docs/src/pages/API/Catalogue/Others/ProviderApi.tsx rename to dev-examples/docs/src/pages/API/Catalogue/Others/ProviderApi.tsx diff --git a/examples/docs/src/pages/API/Catalogue/Others/index.tsx b/dev-examples/docs/src/pages/API/Catalogue/Others/index.tsx similarity index 100% rename from examples/docs/src/pages/API/Catalogue/Others/index.tsx rename to dev-examples/docs/src/pages/API/Catalogue/Others/index.tsx diff --git a/examples/docs/src/pages/API/Catalogue/Utils/TrackBalanceChangeOnce-Util.tsx b/dev-examples/docs/src/pages/API/Catalogue/Utils/TrackBalanceChangeOnce-Util.tsx similarity index 100% rename from examples/docs/src/pages/API/Catalogue/Utils/TrackBalanceChangeOnce-Util.tsx rename to dev-examples/docs/src/pages/API/Catalogue/Utils/TrackBalanceChangeOnce-Util.tsx diff --git a/examples/docs/src/pages/API/Catalogue/Utils/Unit.tsx b/dev-examples/docs/src/pages/API/Catalogue/Utils/Unit.tsx similarity index 100% rename from examples/docs/src/pages/API/Catalogue/Utils/Unit.tsx rename to dev-examples/docs/src/pages/API/Catalogue/Utils/Unit.tsx diff --git a/examples/docs/src/pages/API/Catalogue/Utils/index.tsx b/dev-examples/docs/src/pages/API/Catalogue/Utils/index.tsx similarity index 100% rename from examples/docs/src/pages/API/Catalogue/Utils/index.tsx rename to dev-examples/docs/src/pages/API/Catalogue/Utils/index.tsx diff --git a/examples/docs/src/pages/API/Catalogue/index.css b/dev-examples/docs/src/pages/API/Catalogue/index.css similarity index 100% rename from examples/docs/src/pages/API/Catalogue/index.css rename to dev-examples/docs/src/pages/API/Catalogue/index.css diff --git a/examples/docs/src/pages/API/Catalogue/index.tsx b/dev-examples/docs/src/pages/API/Catalogue/index.tsx similarity index 100% rename from examples/docs/src/pages/API/Catalogue/index.tsx rename to dev-examples/docs/src/pages/API/Catalogue/index.tsx diff --git a/examples/docs/src/pages/API/Menu/index.tsx b/dev-examples/docs/src/pages/API/Menu/index.tsx similarity index 100% rename from examples/docs/src/pages/API/Menu/index.tsx rename to dev-examples/docs/src/pages/API/Menu/index.tsx diff --git a/examples/docs/src/pages/API/index.tsx b/dev-examples/docs/src/pages/API/index.tsx similarity index 100% rename from examples/docs/src/pages/API/index.tsx rename to dev-examples/docs/src/pages/API/index.tsx diff --git a/examples/docs/src/pages/Demo/AddSwitch/index.tsx b/dev-examples/docs/src/pages/Demo/AddSwitch/index.tsx similarity index 100% rename from examples/docs/src/pages/Demo/AddSwitch/index.tsx rename to dev-examples/docs/src/pages/Demo/AddSwitch/index.tsx diff --git a/examples/docs/src/pages/Demo/Connect/index.module.css b/dev-examples/docs/src/pages/Demo/Connect/index.module.css similarity index 100% rename from examples/docs/src/pages/Demo/Connect/index.module.css rename to dev-examples/docs/src/pages/Demo/Connect/index.module.css diff --git a/examples/docs/src/pages/Demo/Connect/index.tsx b/dev-examples/docs/src/pages/Demo/Connect/index.tsx similarity index 100% rename from examples/docs/src/pages/Demo/Connect/index.tsx rename to dev-examples/docs/src/pages/Demo/Connect/index.tsx diff --git a/examples/docs/src/pages/Demo/ConnectBoth/WalletCard.tsx b/dev-examples/docs/src/pages/Demo/ConnectBoth/WalletCard.tsx similarity index 100% rename from examples/docs/src/pages/Demo/ConnectBoth/WalletCard.tsx rename to dev-examples/docs/src/pages/Demo/ConnectBoth/WalletCard.tsx diff --git a/examples/docs/src/pages/Demo/ConnectBoth/index.tsx b/dev-examples/docs/src/pages/Demo/ConnectBoth/index.tsx similarity index 100% rename from examples/docs/src/pages/Demo/ConnectBoth/index.tsx rename to dev-examples/docs/src/pages/Demo/ConnectBoth/index.tsx diff --git a/examples/docs/src/pages/Demo/ConnectSwitch/index.tsx b/dev-examples/docs/src/pages/Demo/ConnectSwitch/index.tsx similarity index 100% rename from examples/docs/src/pages/Demo/ConnectSwitch/index.tsx rename to dev-examples/docs/src/pages/Demo/ConnectSwitch/index.tsx diff --git a/examples/docs/src/pages/Demo/SendTransaction/index.tsx b/dev-examples/docs/src/pages/Demo/SendTransaction/index.tsx similarity index 100% rename from examples/docs/src/pages/Demo/SendTransaction/index.tsx rename to dev-examples/docs/src/pages/Demo/SendTransaction/index.tsx diff --git a/examples/docs/src/pages/Demo/Sign/index.tsx b/dev-examples/docs/src/pages/Demo/Sign/index.tsx similarity index 100% rename from examples/docs/src/pages/Demo/Sign/index.tsx rename to dev-examples/docs/src/pages/Demo/Sign/index.tsx diff --git a/examples/docs/src/pages/Demo/index.tsx b/dev-examples/docs/src/pages/Demo/index.tsx similarity index 100% rename from examples/docs/src/pages/Demo/index.tsx rename to dev-examples/docs/src/pages/Demo/index.tsx diff --git a/examples/docs/src/pages/Guide/index.css b/dev-examples/docs/src/pages/Guide/index.css similarity index 100% rename from examples/docs/src/pages/Guide/index.css rename to dev-examples/docs/src/pages/Guide/index.css diff --git a/examples/docs/src/pages/Guide/index.tsx b/dev-examples/docs/src/pages/Guide/index.tsx similarity index 100% rename from examples/docs/src/pages/Guide/index.tsx rename to dev-examples/docs/src/pages/Guide/index.tsx diff --git a/examples/docs/src/pages/Navbar/index.tsx b/dev-examples/docs/src/pages/Navbar/index.tsx similarity index 100% rename from examples/docs/src/pages/Navbar/index.tsx rename to dev-examples/docs/src/pages/Navbar/index.tsx diff --git a/examples/docs/src/router/index.tsx b/dev-examples/docs/src/router/index.tsx similarity index 100% rename from examples/docs/src/router/index.tsx rename to dev-examples/docs/src/router/index.tsx diff --git a/examples/docs/src/utils/body-scroll-lock/index.ts b/dev-examples/docs/src/utils/body-scroll-lock/index.ts similarity index 100% rename from examples/docs/src/utils/body-scroll-lock/index.ts rename to dev-examples/docs/src/utils/body-scroll-lock/index.ts diff --git a/examples/docs/src/utils/body-scroll-lock/util.ts b/dev-examples/docs/src/utils/body-scroll-lock/util.ts similarity index 100% rename from examples/docs/src/utils/body-scroll-lock/util.ts rename to dev-examples/docs/src/utils/body-scroll-lock/util.ts diff --git a/examples/docs/src/utils/isDOMElement.ts b/dev-examples/docs/src/utils/isDOMElement.ts similarity index 100% rename from examples/docs/src/utils/isDOMElement.ts rename to dev-examples/docs/src/utils/isDOMElement.ts diff --git a/examples/docs/src/utils/runAsync.ts b/dev-examples/docs/src/utils/runAsync.ts similarity index 100% rename from examples/docs/src/utils/runAsync.ts rename to dev-examples/docs/src/utils/runAsync.ts diff --git a/examples/docs/src/vite-env.d.ts b/dev-examples/docs/src/vite-env.d.ts similarity index 100% rename from examples/docs/src/vite-env.d.ts rename to dev-examples/docs/src/vite-env.d.ts diff --git a/examples/docs/tailwind.config.js b/dev-examples/docs/tailwind.config.js similarity index 100% rename from examples/docs/tailwind.config.js rename to dev-examples/docs/tailwind.config.js diff --git a/examples/docs/tsconfig.json b/dev-examples/docs/tsconfig.json similarity index 100% rename from examples/docs/tsconfig.json rename to dev-examples/docs/tsconfig.json diff --git a/examples/docs/tsconfig.node.json b/dev-examples/docs/tsconfig.node.json similarity index 100% rename from examples/docs/tsconfig.node.json rename to dev-examples/docs/tsconfig.node.json diff --git a/examples/docs/vite.config.ts b/dev-examples/docs/vite.config.ts similarity index 100% rename from examples/docs/vite.config.ts rename to dev-examples/docs/vite.config.ts diff --git a/examples/example-react/index.html b/dev-examples/example-react/index.html similarity index 100% rename from examples/example-react/index.html rename to dev-examples/example-react/index.html diff --git a/examples/example-react/package.json b/dev-examples/example-react/package.json similarity index 100% rename from examples/example-react/package.json rename to dev-examples/example-react/package.json diff --git a/examples/example-react/src/App.tsx b/dev-examples/example-react/src/App.tsx similarity index 100% rename from examples/example-react/src/App.tsx rename to dev-examples/example-react/src/App.tsx diff --git a/examples/example-react/src/main.tsx b/dev-examples/example-react/src/main.tsx similarity index 100% rename from examples/example-react/src/main.tsx rename to dev-examples/example-react/src/main.tsx diff --git a/examples/example-react/src/vite-env.d.ts b/dev-examples/example-react/src/vite-env.d.ts similarity index 100% rename from examples/example-react/src/vite-env.d.ts rename to dev-examples/example-react/src/vite-env.d.ts diff --git a/examples/example-react/tsconfig.json b/dev-examples/example-react/tsconfig.json similarity index 100% rename from examples/example-react/tsconfig.json rename to dev-examples/example-react/tsconfig.json diff --git a/examples/example-react/tsconfig.node.json b/dev-examples/example-react/tsconfig.node.json similarity index 100% rename from examples/example-react/tsconfig.node.json rename to dev-examples/example-react/tsconfig.node.json diff --git a/examples/example-react/vite.config.ts b/dev-examples/example-react/vite.config.ts similarity index 100% rename from examples/example-react/vite.config.ts rename to dev-examples/example-react/vite.config.ts diff --git a/examples/example-svelte/README.md b/dev-examples/example-svelte/README.md similarity index 100% rename from examples/example-svelte/README.md rename to dev-examples/example-svelte/README.md diff --git a/examples/example-svelte/index.html b/dev-examples/example-svelte/index.html similarity index 100% rename from examples/example-svelte/index.html rename to dev-examples/example-svelte/index.html diff --git a/examples/example-svelte/package.json b/dev-examples/example-svelte/package.json similarity index 100% rename from examples/example-svelte/package.json rename to dev-examples/example-svelte/package.json diff --git a/examples/example-svelte/public/favicon.ico b/dev-examples/example-svelte/public/favicon.ico similarity index 100% rename from examples/example-svelte/public/favicon.ico rename to dev-examples/example-svelte/public/favicon.ico diff --git a/examples/example-svelte/src/App.svelte b/dev-examples/example-svelte/src/App.svelte similarity index 100% rename from examples/example-svelte/src/App.svelte rename to dev-examples/example-svelte/src/App.svelte diff --git a/examples/example-svelte/src/assets/svelte.png b/dev-examples/example-svelte/src/assets/svelte.png similarity index 100% rename from examples/example-svelte/src/assets/svelte.png rename to dev-examples/example-svelte/src/assets/svelte.png diff --git a/examples/example-svelte/src/lib/Counter.svelte b/dev-examples/example-svelte/src/lib/Counter.svelte similarity index 100% rename from examples/example-svelte/src/lib/Counter.svelte rename to dev-examples/example-svelte/src/lib/Counter.svelte diff --git a/examples/example-svelte/src/main.ts b/dev-examples/example-svelte/src/main.ts similarity index 100% rename from examples/example-svelte/src/main.ts rename to dev-examples/example-svelte/src/main.ts diff --git a/examples/example-svelte/src/vite-env.d.ts b/dev-examples/example-svelte/src/vite-env.d.ts similarity index 100% rename from examples/example-svelte/src/vite-env.d.ts rename to dev-examples/example-svelte/src/vite-env.d.ts diff --git a/examples/example-svelte/svelte.config.js b/dev-examples/example-svelte/svelte.config.js similarity index 100% rename from examples/example-svelte/svelte.config.js rename to dev-examples/example-svelte/svelte.config.js diff --git a/examples/example-svelte/tsconfig.json b/dev-examples/example-svelte/tsconfig.json similarity index 100% rename from examples/example-svelte/tsconfig.json rename to dev-examples/example-svelte/tsconfig.json diff --git a/examples/example-svelte/tsconfig.node.json b/dev-examples/example-svelte/tsconfig.node.json similarity index 100% rename from examples/example-svelte/tsconfig.node.json rename to dev-examples/example-svelte/tsconfig.node.json diff --git a/examples/example-svelte/vite.config.ts b/dev-examples/example-svelte/vite.config.ts similarity index 100% rename from examples/example-svelte/vite.config.ts rename to dev-examples/example-svelte/vite.config.ts diff --git a/examples/example-vue3/README.md b/dev-examples/example-vue3/README.md similarity index 100% rename from examples/example-vue3/README.md rename to dev-examples/example-vue3/README.md diff --git a/examples/example-vue3/index.html b/dev-examples/example-vue3/index.html similarity index 100% rename from examples/example-vue3/index.html rename to dev-examples/example-vue3/index.html diff --git a/examples/example-vue3/package.json b/dev-examples/example-vue3/package.json similarity index 100% rename from examples/example-vue3/package.json rename to dev-examples/example-vue3/package.json diff --git a/examples/example-vue3/public/favicon.ico b/dev-examples/example-vue3/public/favicon.ico similarity index 100% rename from examples/example-vue3/public/favicon.ico rename to dev-examples/example-vue3/public/favicon.ico diff --git a/examples/example-vue3/src/App.vue b/dev-examples/example-vue3/src/App.vue similarity index 100% rename from examples/example-vue3/src/App.vue rename to dev-examples/example-vue3/src/App.vue diff --git a/examples/example-vue3/src/env.d.ts b/dev-examples/example-vue3/src/env.d.ts similarity index 100% rename from examples/example-vue3/src/env.d.ts rename to dev-examples/example-vue3/src/env.d.ts diff --git a/examples/example-vue3/src/main.ts b/dev-examples/example-vue3/src/main.ts similarity index 100% rename from examples/example-vue3/src/main.ts rename to dev-examples/example-vue3/src/main.ts diff --git a/examples/example-vue3/tsconfig.json b/dev-examples/example-vue3/tsconfig.json similarity index 100% rename from examples/example-vue3/tsconfig.json rename to dev-examples/example-vue3/tsconfig.json diff --git a/examples/example-vue3/tsconfig.node.json b/dev-examples/example-vue3/tsconfig.node.json similarity index 100% rename from examples/example-vue3/tsconfig.node.json rename to dev-examples/example-vue3/tsconfig.node.json diff --git a/examples/example-vue3/vite.config.ts b/dev-examples/example-vue3/vite.config.ts similarity index 100% rename from examples/example-vue3/vite.config.ts rename to dev-examples/example-vue3/vite.config.ts diff --git a/examples/ReactDemo/.eslintrc.cjs b/examples/ReactDemo/.eslintrc.cjs new file mode 100644 index 0000000..d6c9537 --- /dev/null +++ b/examples/ReactDemo/.eslintrc.cjs @@ -0,0 +1,18 @@ +module.exports = { + root: true, + env: { browser: true, es2020: true }, + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/recommended', + 'plugin:react-hooks/recommended', + ], + ignorePatterns: ['dist', '.eslintrc.cjs'], + parser: '@typescript-eslint/parser', + plugins: ['react-refresh'], + rules: { + 'react-refresh/only-export-components': [ + 'warn', + { allowConstantExport: true }, + ], + }, +} diff --git a/examples/ReactDemo/.gitignore b/examples/ReactDemo/.gitignore new file mode 100644 index 0000000..a547bf3 --- /dev/null +++ b/examples/ReactDemo/.gitignore @@ -0,0 +1,24 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/examples/ReactDemo/README.md b/examples/ReactDemo/README.md new file mode 100644 index 0000000..0d6babe --- /dev/null +++ b/examples/ReactDemo/README.md @@ -0,0 +1,30 @@ +# React + TypeScript + Vite + +This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. + +Currently, two official plugins are available: + +- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh +- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh + +## Expanding the ESLint configuration + +If you are developing a production application, we recommend updating the configuration to enable type aware lint rules: + +- Configure the top-level `parserOptions` property like this: + +```js +export default { + // other rules... + parserOptions: { + ecmaVersion: 'latest', + sourceType: 'module', + project: ['./tsconfig.json', './tsconfig.node.json'], + tsconfigRootDir: __dirname, + }, +} +``` + +- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked` +- Optionally add `plugin:@typescript-eslint/stylistic-type-checked` +- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list diff --git a/examples/ReactDemo/index.html b/examples/ReactDemo/index.html new file mode 100644 index 0000000..5a8c2ec --- /dev/null +++ b/examples/ReactDemo/index.html @@ -0,0 +1,13 @@ + + +
+ + + +account: {account}
+chainId: {chainId}
+balance: {`${balance?.toDecimalStandardUnit()} CFX`}
+ + + > + )} + {!isChainMatch && ( + <> +Current Chain is not Target Chain -- {TargetChain === TargetChains.eSpaceMainnet ? 'eSpaceMainnet' : 'eSpaceTestnet'}
+ + > + )} + > + ); +}); + +export default BasicUsage; diff --git a/examples/ReactDemo/src/main.tsx b/examples/ReactDemo/src/main.tsx new file mode 100644 index 0000000..e63eef4 --- /dev/null +++ b/examples/ReactDemo/src/main.tsx @@ -0,0 +1,9 @@ +import React from 'react' +import ReactDOM from 'react-dom/client' +import App from './App.tsx' + +ReactDOM.createRoot(document.getElementById('root')!).render( +account: ${account}
+chainId: ${chainId}
+balance: ${balance?.toDecimalStandardUnit()} CFX
+ + + `; + const sendTransactionBtn = document.querySelectorCurrent Chain is not Target Chain -- ${TargetChain === TargetChains.eSpaceMainnet ? 'eSpaceMainnet' : 'eSpaceTestnet'}
+ + `; + const switchBtn = document.querySelector