@kodiak-finance/orderly-react-app 2.9.1-alpha.5 → 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 CHANGED
@@ -1,5 +1,5 @@
1
1
  import react, { ReactNode, ComponentType, PropsWithChildren, Component, ErrorInfo } from 'react';
2
- import { ExtensionPosition, OrderlyThemeProviderProps } from '@kodiak-finance/orderly-ui';
2
+ import { OrderlyPlugin, PluginRegistrationFn, ExtensionPosition, OrderlyThemeProviderProps } from '@kodiak-finance/orderly-ui';
3
3
  import { ConfigProviderProps, ExclusiveConfigProviderProps, Chains, WalletState, RestrictedInfoReturns, MarketCategoryConfig, RestrictedInfoOptions, OrderValidationResult } from '@kodiak-finance/orderly-hooks';
4
4
  import { Chain, NetworkId, AccountStatusEnum, API } from '@kodiak-finance/orderly-types';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
@@ -16,6 +16,8 @@ type AppLogos = Partial<{
16
16
  type OrderlyAppConfig = {
17
17
  appIcons?: AppLogos;
18
18
  dateFormatting?: string;
19
+ /** Plugins for the new interceptor system (registerPlugin descriptors or registration fns) */
20
+ plugins?: (OrderlyPlugin | PluginRegistrationFn)[];
19
21
  components?: {
20
22
  [position in ExtensionPosition]: ComponentType;
21
23
  };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import react, { ReactNode, ComponentType, PropsWithChildren, Component, ErrorInfo } from 'react';
2
- import { ExtensionPosition, OrderlyThemeProviderProps } from '@kodiak-finance/orderly-ui';
2
+ import { OrderlyPlugin, PluginRegistrationFn, ExtensionPosition, OrderlyThemeProviderProps } from '@kodiak-finance/orderly-ui';
3
3
  import { ConfigProviderProps, ExclusiveConfigProviderProps, Chains, WalletState, RestrictedInfoReturns, MarketCategoryConfig, RestrictedInfoOptions, OrderValidationResult } from '@kodiak-finance/orderly-hooks';
4
4
  import { Chain, NetworkId, AccountStatusEnum, API } from '@kodiak-finance/orderly-types';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
@@ -16,6 +16,8 @@ type AppLogos = Partial<{
16
16
  type OrderlyAppConfig = {
17
17
  appIcons?: AppLogos;
18
18
  dateFormatting?: string;
19
+ /** Plugins for the new interceptor system (registerPlugin descriptors or registration fns) */
20
+ plugins?: (OrderlyPlugin | PluginRegistrationFn)[];
19
21
  components?: {
20
22
  [position in ExtensionPosition]: ComponentType;
21
23
  };
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
+ var react = require('react');
3
4
  var orderlyHooks = require('@kodiak-finance/orderly-hooks');
4
5
  var orderlyUi = require('@kodiak-finance/orderly-ui');
5
- var react = require('react');
6
6
  var orderlyTypes = require('@kodiak-finance/orderly-types');
7
7
  var orderlyI18n = require('@kodiak-finance/orderly-i18n');
8
8
  var orderlyUtils = require('@kodiak-finance/orderly-utils');
@@ -776,6 +776,7 @@ var AppThemeProvider = (props) => {
776
776
  }
777
777
  );
778
778
  };
779
+ var EMPTY_PLUGINS = [];
779
780
  var ExecutionReportListener = () => {
780
781
  useExecutionReport();
781
782
  return null;
@@ -785,6 +786,7 @@ var OrderlyAppProvider = (props) => {
785
786
  // dateFormatting,
786
787
  components,
787
788
  appIcons,
789
+ plugins,
788
790
  themes,
789
791
  onChainChanged,
790
792
  defaultChain,
@@ -794,6 +796,14 @@ var OrderlyAppProvider = (props) => {
794
796
  orderlyHooks.useTrack();
795
797
  useBootstrap();
796
798
  const uiLocale = useUILocale();
799
+ const pluginState = react.useMemo(
800
+ () => ({
801
+ config: { appIcons, brokerName: props.brokerName },
802
+ networkId: configProps.networkId
803
+ }),
804
+ [appIcons, props.brokerName, configProps.networkId]
805
+ );
806
+ const pluginsList = plugins ?? EMPTY_PLUGINS;
797
807
  return /* @__PURE__ */ jsxRuntime.jsx(AppConfigProvider, { appIcons, brokerName: props.brokerName, children: /* @__PURE__ */ jsxRuntime.jsx(
798
808
  AppThemeProvider,
799
809
  {
@@ -801,17 +811,26 @@ var OrderlyAppProvider = (props) => {
801
811
  overrides: props.overrides,
802
812
  themes,
803
813
  children: /* @__PURE__ */ jsxRuntime.jsxs(orderlyHooks.OrderlyConfigProvider, { ...configProps, children: [
804
- /* @__PURE__ */ jsxRuntime.jsx(ExecutionReportListener, {}),
805
- /* @__PURE__ */ jsxRuntime.jsx(
806
- AppStateProvider,
814
+ /* @__PURE__ */ jsxRuntime.jsxs(
815
+ orderlyUi.OrderlyPluginProvider,
807
816
  {
808
- onChainChanged,
809
- defaultChain,
810
- restrictedInfo: props.restrictedInfo,
811
- onRouteChange: props.onRouteChange,
812
- widgetConfigs,
813
- customAnnouncements: props.customAnnouncements,
814
- children: /* @__PURE__ */ jsxRuntime.jsx(orderlyUi.LocaleProvider, { locale: uiLocale, children: /* @__PURE__ */ jsxRuntime.jsx(orderlyUi.TooltipProvider, { delayDuration: 300, children: /* @__PURE__ */ jsxRuntime.jsx(orderlyUi.ModalProvider, { children: props.children }) }) })
817
+ plugins: pluginsList,
818
+ pluginState,
819
+ children: [
820
+ /* @__PURE__ */ jsxRuntime.jsx(ExecutionReportListener, {}),
821
+ /* @__PURE__ */ jsxRuntime.jsx(
822
+ AppStateProvider,
823
+ {
824
+ onChainChanged,
825
+ defaultChain,
826
+ restrictedInfo: props.restrictedInfo,
827
+ onRouteChange: props.onRouteChange,
828
+ widgetConfigs,
829
+ customAnnouncements: props.customAnnouncements,
830
+ children: /* @__PURE__ */ jsxRuntime.jsx(orderlyUi.LocaleProvider, { locale: uiLocale, children: /* @__PURE__ */ jsxRuntime.jsx(orderlyUi.TooltipProvider, { delayDuration: 300, children: /* @__PURE__ */ jsxRuntime.jsx(orderlyUi.ModalProvider, { children: props.children }) }) })
831
+ }
832
+ )
833
+ ]
815
834
  }
816
835
  ),
817
836
  /* @__PURE__ */ jsxRuntime.jsx(orderlyUi.Toaster, {})