@orderly.network/trading 3.1.0 → 3.1.1

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.js CHANGED
@@ -8336,6 +8336,13 @@ var LazyOrderBookAndTradesWidget = React12__default.default.lazy(
8336
8336
  };
8337
8337
  })
8338
8338
  );
8339
+ function getClampedPanelWidth(size, minWidth, maxWidth) {
8340
+ const width = Number.parseFloat(size ?? "");
8341
+ if (!Number.isFinite(width)) {
8342
+ return minWidth;
8343
+ }
8344
+ return Math.min(Math.max(width, minWidth), maxWidth);
8345
+ }
8339
8346
  var DesktopLayout4 = (props) => {
8340
8347
  const {
8341
8348
  resizeable,
@@ -8782,6 +8789,18 @@ var DesktopLayout4 = (props) => {
8782
8789
  }
8783
8790
  return tradingViewAndOrderbookView;
8784
8791
  };
8792
+ const orderEntryPanelWidth = max4XL && horizontalDraggable ? getClampedPanelWidth(
8793
+ mainSplitSize,
8794
+ orderEntryMinWidth,
8795
+ orderEntryMaxWidth
8796
+ ) : orderEntryMinWidth;
8797
+ const orderBookPanelWidth = max4XL && horizontalDraggable ? getClampedPanelWidth(
8798
+ orderBookSplitSize,
8799
+ orderbookMinWidth,
8800
+ orderbookMaxWidth
8801
+ ) : orderbookMinWidth;
8802
+ const mainViewMinWidth = max4XL ? marketsWidth + tradingViewMinWidth + orderBookPanelWidth + space * 2 : tradingViewMinWidth + orderBookPanelWidth + space;
8803
+ const mainContentMinWidth = mainViewMinWidth + orderEntryPanelWidth + space + (!max4XL && marketLayout === "left" ? marketsWidth + space : 0);
8785
8804
  const mainView = /* @__PURE__ */ jsxRuntime.jsxs(
8786
8805
  ui.Flex,
8787
8806
  {
@@ -8789,7 +8808,7 @@ var DesktopLayout4 = (props) => {
8789
8808
  className: "oui-flex-1 oui-overflow-hidden",
8790
8809
  gap: 2,
8791
8810
  style: {
8792
- minWidth: max4XL ? marketsWidth + tradingViewMinWidth + orderbookMinWidth + space * 2 : tradingViewMinWidth + orderbookMinWidth + space
8811
+ minWidth: mainViewMinWidth
8793
8812
  },
8794
8813
  children: [
8795
8814
  symbolInfoBarView,
@@ -9068,7 +9087,7 @@ var DesktopLayout4 = (props) => {
9068
9087
  {
9069
9088
  style: {
9070
9089
  minHeight: minScreenHeight,
9071
- minWidth: 1440 - scrollBarWidth
9090
+ minWidth: max4XL ? Math.max(1440 - scrollBarWidth, mainContentMinWidth + space * 2) : 1440 - scrollBarWidth
9072
9091
  },
9073
9092
  className: ui.cn(
9074
9093
  props.className,
@@ -9097,6 +9116,7 @@ var DesktopLayout4 = (props) => {
9097
9116
  SplitLayout,
9098
9117
  {
9099
9118
  className: ui.cn("oui-flex oui-flex-1 oui-overflow-hidden"),
9119
+ style: max4XL ? { minWidth: mainContentMinWidth } : void 0,
9100
9120
  onSizeChange,
9101
9121
  disable: !horizontalDraggable,
9102
9122
  children: [
@@ -9247,12 +9267,12 @@ var MaybeEqual = () => {
9247
9267
  var MobileLayout4 = (props) => {
9248
9268
  const { t } = i18n.useTranslation();
9249
9269
  const { isRwa, open, closeTimeInterval } = hooks.useGetRwaSymbolInfo(props.symbol);
9250
- const { brokerId, brokerName, brokerNameRaw, displayName } = hooks.useBadgeBySymbol(
9251
- props.symbol
9252
- );
9270
+ const symbolsInfo = hooks.useSymbolsInfo();
9271
+ const isPreTge = Boolean(symbolsInfo[props.symbol]?.("is_pretge"));
9272
+ const { brokerId, brokerName, brokerNameRaw, displaySymbolName } = hooks.useBadgeBySymbol(props.symbol);
9253
9273
  const isCommunityListed = Boolean(brokerId ?? brokerName);
9254
9274
  const baseFromSymbol = props.symbol?.split("_")[1] ?? props.symbol ?? "";
9255
- const symbolWithBroker = brokerName != null ? `${baseFromSymbol}-${brokerNameRaw}` : displayName ?? props.symbol ?? "";
9275
+ const symbolWithBroker = brokerName != null ? `${baseFromSymbol}-${brokerNameRaw}` : displaySymbolName ?? props.symbol ?? "";
9256
9276
  React12.useEffect(() => {
9257
9277
  if (isRwa && !open) {
9258
9278
  showRwaOutsideMarketHoursNotify();
@@ -9353,6 +9373,7 @@ var MobileLayout4 = (props) => {
9353
9373
  visible: isCommunityListed,
9354
9374
  symbolWithBroker,
9355
9375
  brokerName: brokerNameRaw ?? brokerName ?? "",
9376
+ isPreTge,
9356
9377
  autoHeight: true,
9357
9378
  className: "oui-my-1"
9358
9379
  }