@skip-go/widget 2.4.4 → 2.4.5

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.
@@ -31,7 +31,7 @@ export declare function useSwapWidget(persistSwapWidgetState?: boolean): {
31
31
  onSourceAssetChange: (asset: Asset) => void;
32
32
  onSourceChainChange: (chain: Chain, injectAsset?: Asset) => Promise<void>;
33
33
  priceImpactThresholdReached: boolean;
34
- route: import("@skip-go/client/dist/shared-Squ-EH8u").R | undefined;
34
+ route: import("@skip-go/client/dist/shared-D1dMlI_1").R | undefined;
35
35
  routeError: string;
36
36
  routeLoading: boolean;
37
37
  routeWarningMessage: string | undefined;
package/build/index.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  export { SwapWidgetProvider, SwapWidgetProviderProps } from './provider';
2
2
  export { SwapWidget, SwapWidgetProps, SwapWidgetWithoutProviders, SwapWidgetWithoutProvidersProps, } from './ui';
3
- export { initializeSwapWidget } from './ui/WebComponent';
4
3
  export { useAssets } from './provider/assets';
5
4
  export { useChains, useChainByID } from './hooks/use-chains';
6
5
  export { MinimalWallet } from './hooks/use-make-wallets';
package/build/index.es.js CHANGED
@@ -5630,43 +5630,5 @@ const SwapWidget = ({ settings, onlyTestnet, defaultRoute, routeConfig, theme, c
5630
5630
  return (jsx(WithStyledShadowDom, { children: jsx(ThemeProvider, { theme: mergedThemes, children: jsx(SwapWidgetProvider, { ...swapWidgetProviderProps, children: jsx(SwapWidgetUI, { className: className, style: style, toasterProps: toasterProps, persistSwapWidgetState: persistSwapWidgetState }) }) }) }));
5631
5631
  };
5632
5632
 
5633
- function isJsonString(str) {
5634
- try {
5635
- JSON.parse(str);
5636
- }
5637
- catch (e) {
5638
- return false;
5639
- }
5640
- return true;
5641
- }
5642
- const camelize = (inputString) => inputString.replace(/-./g, (x) => x[1].toUpperCase());
5643
- const WidgetWithProvider = (props) => {
5644
- // @ts-ignore
5645
- const parsedProps = Array.from(props.container.attributes).map(({ name, value }) => {
5646
- return { key: name, value };
5647
- });
5648
- const realProps = parsedProps.reduce((accumulator, initialValue) => {
5649
- const { key, value } = initialValue;
5650
- accumulator[camelize(key)] = isJsonString(value)
5651
- ? JSON.parse(value)
5652
- : value;
5653
- return accumulator;
5654
- }, {});
5655
- return jsx(SwapWidget, { ...realProps });
5656
- };
5657
- const WEB_COMPONENT_NAME = 'skip-widget';
5658
- let initialized = false;
5659
- const initializeSwapWidget = () => {
5660
- if (!initialized && typeof window !== 'undefined') {
5661
- import('@r2wc/react-to-web-component').then(({ default: ReactToWebComponent }) => {
5662
- const WebComponent = ReactToWebComponent(WidgetWithProvider);
5663
- if (!customElements.get(WEB_COMPONENT_NAME)) {
5664
- customElements.define(WEB_COMPONENT_NAME, WebComponent);
5665
- }
5666
- initialized = true;
5667
- });
5668
- }
5669
- };
5670
-
5671
- export { SwapWidget, SwapWidgetProvider, SwapWidgetWithoutProviders, initializeSwapWidget, useAssets, useChainByID, useChains };
5633
+ export { SwapWidget, SwapWidgetProvider, SwapWidgetWithoutProviders, useAssets, useChainByID, useChains };
5672
5634
  //# sourceMappingURL=index.es.js.map