@kodiak-finance/orderly-react-app 2.9.1 → 2.9.2-alpha.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/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +30 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +31 -12
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -7
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { createContext, useContext, useMemo, useCallback, Component, useEffect, useState, useRef } from 'react';
|
|
1
2
|
import { useTrack, OrderlyConfigProvider, useAccount, ERROR_MSG_CODES, useLocalStorage, useTrackingInstance, useRestrictedInfo, MarketCategoriesConfigProvider, useEventEmitter, useSymbolsInfo, useOrderlyContext, useAllBrokers, useUpdatedRef, useDebouncedCallback, useStorageChain, useChains, useConfig, useWalletConnector, useKeyStore, useSessionStorage, useWalletSubscription, useSettleSubscription, useWS, useStorageLedgerAddress, formatSymbolWithBroker, parseJSON } from '@kodiak-finance/orderly-hooks';
|
|
2
|
-
import { LocaleProvider, TooltipProvider, ModalProvider, Toaster, Flex, cn, Text, Button, DARK_THEME_CSS_VARS, OrderlyThemeProvider, useCanLinkDevice, toast, modal, parseNumber } from '@kodiak-finance/orderly-ui';
|
|
3
|
-
import { createContext, useContext, useCallback, Component, useMemo, useEffect, useState, useRef } from 'react';
|
|
3
|
+
import { OrderlyPluginProvider, LocaleProvider, TooltipProvider, ModalProvider, Toaster, Flex, cn, Text, Button, DARK_THEME_CSS_VARS, OrderlyThemeProvider, useCanLinkDevice, toast, modal, parseNumber } from '@kodiak-finance/orderly-ui';
|
|
4
4
|
import { AccountStatusEnum, SDKError, ABSTRACT_CHAIN_ID_MAP, ChainNamespace, TrackerEventName, OrderStatus, AlgoOrderRootType } from '@kodiak-finance/orderly-types';
|
|
5
5
|
import { useTranslation, i18n, useLocaleCode, LocaleEnum } from '@kodiak-finance/orderly-i18n';
|
|
6
6
|
import { parseChainIdToNumber, windowGuard, praseChainIdToNumber, capitalizeString, getTimestamp } from '@kodiak-finance/orderly-utils';
|
|
@@ -774,6 +774,7 @@ var AppThemeProvider = (props) => {
|
|
|
774
774
|
}
|
|
775
775
|
);
|
|
776
776
|
};
|
|
777
|
+
var EMPTY_PLUGINS = [];
|
|
777
778
|
var ExecutionReportListener = () => {
|
|
778
779
|
useExecutionReport();
|
|
779
780
|
return null;
|
|
@@ -783,6 +784,7 @@ var OrderlyAppProvider = (props) => {
|
|
|
783
784
|
// dateFormatting,
|
|
784
785
|
components,
|
|
785
786
|
appIcons,
|
|
787
|
+
plugins,
|
|
786
788
|
themes,
|
|
787
789
|
onChainChanged,
|
|
788
790
|
defaultChain,
|
|
@@ -792,6 +794,14 @@ var OrderlyAppProvider = (props) => {
|
|
|
792
794
|
useTrack();
|
|
793
795
|
useBootstrap();
|
|
794
796
|
const uiLocale = useUILocale();
|
|
797
|
+
const pluginState = useMemo(
|
|
798
|
+
() => ({
|
|
799
|
+
config: { appIcons, brokerName: props.brokerName },
|
|
800
|
+
networkId: configProps.networkId
|
|
801
|
+
}),
|
|
802
|
+
[appIcons, props.brokerName, configProps.networkId]
|
|
803
|
+
);
|
|
804
|
+
const pluginsList = plugins ?? EMPTY_PLUGINS;
|
|
795
805
|
return /* @__PURE__ */ jsx(AppConfigProvider, { appIcons, brokerName: props.brokerName, children: /* @__PURE__ */ jsx(
|
|
796
806
|
AppThemeProvider,
|
|
797
807
|
{
|
|
@@ -799,17 +809,26 @@ var OrderlyAppProvider = (props) => {
|
|
|
799
809
|
overrides: props.overrides,
|
|
800
810
|
themes,
|
|
801
811
|
children: /* @__PURE__ */ jsxs(OrderlyConfigProvider, { ...configProps, children: [
|
|
802
|
-
/* @__PURE__ */
|
|
803
|
-
|
|
804
|
-
AppStateProvider,
|
|
812
|
+
/* @__PURE__ */ jsxs(
|
|
813
|
+
OrderlyPluginProvider,
|
|
805
814
|
{
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
815
|
+
plugins: pluginsList,
|
|
816
|
+
pluginState,
|
|
817
|
+
children: [
|
|
818
|
+
/* @__PURE__ */ jsx(ExecutionReportListener, {}),
|
|
819
|
+
/* @__PURE__ */ jsx(
|
|
820
|
+
AppStateProvider,
|
|
821
|
+
{
|
|
822
|
+
onChainChanged,
|
|
823
|
+
defaultChain,
|
|
824
|
+
restrictedInfo: props.restrictedInfo,
|
|
825
|
+
onRouteChange: props.onRouteChange,
|
|
826
|
+
widgetConfigs,
|
|
827
|
+
customAnnouncements: props.customAnnouncements,
|
|
828
|
+
children: /* @__PURE__ */ jsx(LocaleProvider, { locale: uiLocale, children: /* @__PURE__ */ jsx(TooltipProvider, { delayDuration: 300, children: /* @__PURE__ */ jsx(ModalProvider, { children: props.children }) }) })
|
|
829
|
+
}
|
|
830
|
+
)
|
|
831
|
+
]
|
|
813
832
|
}
|
|
814
833
|
),
|
|
815
834
|
/* @__PURE__ */ jsx(Toaster, {})
|