@orderly.network/markets 3.0.0-beta.1 → 3.0.0-beta.10

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.mjs CHANGED
@@ -1,8 +1,8 @@
1
- import React6, { memo, createContext, useState, useRef, useEffect, useCallback, useMemo, useContext } from 'react';
1
+ import React6, { createContext, memo, useState, useRef, useCallback, useEffect, useMemo, createElement, useContext, isValidElement } from 'react';
2
2
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
3
- import { useSymbolsInfo, useMarkets, MarketsType, useFundingRateHistory, useFundingRates, useQuery, useMarketsStream, useLocalStorage, useGetRwaSymbolInfo, useTickerStream, useFundingRate, useMarketsStore, useFundingDetails, useSessionStorage, useFundingRateBySymbol, usePositionStream, isCurrentlyTrading } from '@orderly.network/hooks';
4
- import { Flex, TokenIcon, Text, Box, cn, Marquee, Checkbox, Divider, useEmblaCarousel, useScreen, Badge, Tooltip, CloseIcon, CheckedSquareFillIcon, CheckSquareEmptyIcon, Button, DropdownMenuRoot, DropdownMenuTrigger, DropdownMenuPortal, DropdownMenuContent, Input, CloseCircleFillIcon, PlusIcon, DataTable, usePagination, Tabs, TabPanel, EmptyDataState, NewsFillIcon, modal, RwaIcon, GradientText, EmptyStateIcon, Picker, Select } from '@orderly.network/ui';
3
+ import { useSymbolsInfo, useBadgeBySymbol, useMarkets, MarketsType, isCurrentlyTrading, useFundingRate, useFundingDetails, useFundingRateBySymbol, usePositionStream, useFundingRateHistory, useFundingRates, useQuery, useMarketsStream, useLocalStorage, useGetRwaSymbolInfo, useTickerStream, useMarketsStore, useSessionStorage, useMarketCategoriesConfig, useMarketList, useRwaSymbolsInfo, useConfig, useAllBrokers } from '@orderly.network/hooks';
5
4
  import { useTranslation, Trans, i18n } from '@orderly.network/i18n';
5
+ import { injectable, Flex, TokenIcon, Text, SymbolBadge as SymbolBadge$1, Tooltip, Box, cn, Marquee, Checkbox, Divider, useScreen, WarningIcon, NewsFillIcon, CloseIcon, modal, GradientText, useEmblaCarousel, Badge, CheckedSquareFillIcon, CheckSquareEmptyIcon, Button, DropdownMenuRoot, DropdownMenuTrigger, DropdownMenuPortal, DropdownMenuContent, Input, CloseCircleFillIcon, PlusIcon, DataTable, usePagination, Tabs, TabPanel, EmptyDataState, RwaIcon, EmptyStateIcon, Picker, Select } from '@orderly.network/ui';
6
6
  import { Decimal, formatSymbol } from '@orderly.network/utils';
7
7
  import { pick } from 'ramda';
8
8
  import { LeftNavUI } from '@orderly.network/ui-scaffold';
@@ -21,7 +21,7 @@ var init_marketsProvider = __esm({
21
21
  "src/components/marketsProvider/index.tsx"() {
22
22
  MarketsContext = createContext({});
23
23
  MarketsProvider = (props) => {
24
- const { symbol, comparisonProps, children, onSymbolChange } = props;
24
+ const { symbol, comparisonProps, children, onSymbolChange, tabs } = props;
25
25
  const [searchValue, setSearchValue] = useState("");
26
26
  const clearSearchValue = useCallback(() => {
27
27
  setSearchValue("");
@@ -33,9 +33,17 @@ var init_marketsProvider = __esm({
33
33
  clearSearchValue,
34
34
  symbol,
35
35
  onSymbolChange,
36
- comparisonProps
36
+ comparisonProps,
37
+ tabs
37
38
  };
38
- }, [searchValue, symbol, onSymbolChange, setSearchValue, comparisonProps]);
39
+ }, [
40
+ searchValue,
41
+ symbol,
42
+ onSymbolChange,
43
+ setSearchValue,
44
+ comparisonProps,
45
+ tabs
46
+ ]);
39
47
  return /* @__PURE__ */ jsx(MarketsContext.Provider, { value: memoizedValue, children });
40
48
  };
41
49
  useMarketsContext = () => {
@@ -43,14 +51,63 @@ var init_marketsProvider = __esm({
43
51
  };
44
52
  }
45
53
  });
54
+ var RwaDotTooltip;
55
+ var init_rwaDotTooltip = __esm({
56
+ "src/components/rwaDotTooltip.tsx"() {
57
+ RwaDotTooltip = ({ record }) => {
58
+ const { t } = useTranslation();
59
+ const isInTradingHours = isCurrentlyTrading(
60
+ record.rwaNextClose,
61
+ record.rwaStatus
62
+ );
63
+ if (!record.isRwa) {
64
+ return null;
65
+ }
66
+ return /* @__PURE__ */ jsx(
67
+ Tooltip,
68
+ {
69
+ content: /* @__PURE__ */ jsx(Text, { color: isInTradingHours ? "success" : "danger", children: isInTradingHours ? t("trading.rwa.marketHours") : t("trading.rwa.outsideMarketHours") }),
70
+ children: /* @__PURE__ */ jsx(Box, { py: 2, px: 1, children: /* @__PURE__ */ jsx(
71
+ Box,
72
+ {
73
+ width: 4,
74
+ height: 4,
75
+ r: "full",
76
+ className: isInTradingHours ? "oui-bg-success" : "oui-bg-danger"
77
+ }
78
+ ) })
79
+ }
80
+ );
81
+ };
82
+ }
83
+ });
84
+ var BrokerIdBadge, SymbolBadge;
85
+ var init_symbolBadge = __esm({
86
+ "src/components/symbolBadge.tsx"() {
87
+ BrokerIdBadge = (props) => {
88
+ const { brokerId, brokerName, brokerNameRaw } = useBadgeBySymbol(
89
+ props.symbol
90
+ );
91
+ const badge = brokerName ?? brokerId ?? void 0;
92
+ return /* @__PURE__ */ jsx(SymbolBadge$1, { badge, fullName: brokerNameRaw });
93
+ };
94
+ SymbolBadge = BrokerIdBadge;
95
+ }
96
+ });
46
97
  var SymbolDisplay;
47
98
  var init_symbolDisplay = __esm({
48
99
  "src/components/symbolDisplay.tsx"() {
100
+ init_rwaDotTooltip();
101
+ init_symbolBadge();
49
102
  SymbolDisplay = memo((props) => {
50
- const { children, size = "xs", ...rest } = props;
103
+ const { children, size = "xs", showBadge = true, record, ...rest } = props;
51
104
  const symbol = children;
52
105
  const symbolsInfo = useSymbolsInfo();
53
106
  const displayName = symbolsInfo[symbol]("displayName");
107
+ const suffix = record?.isRwa || showBadge ? /* @__PURE__ */ jsxs(Flex, { gapX: 0, itemAlign: "center", children: [
108
+ record?.isRwa && /* @__PURE__ */ jsx(RwaDotTooltip, { record }),
109
+ showBadge && /* @__PURE__ */ jsx(SymbolBadge, { symbol })
110
+ ] }) : null;
54
111
  if (displayName) {
55
112
  return /* @__PURE__ */ jsxs(Flex, { gapX: 1, className: props.className, children: [
56
113
  props.showIcon && /* @__PURE__ */ jsx(TokenIcon, { size, symbol }),
@@ -62,14 +119,25 @@ var init_symbolDisplay = __esm({
62
119
  className: "oui-whitespace-nowrap oui-break-normal",
63
120
  children: displayName
64
121
  }
65
- )
122
+ ),
123
+ suffix
66
124
  ] });
67
125
  }
68
- return /* @__PURE__ */ jsx(Text.formatted, { size: "xs", rule: "symbol", weight: "semibold", ...rest, children: symbol });
126
+ return /* @__PURE__ */ jsx(
127
+ Text.formatted,
128
+ {
129
+ size: "xs",
130
+ rule: "symbol",
131
+ weight: "semibold",
132
+ suffix,
133
+ ...rest,
134
+ children: symbol
135
+ }
136
+ );
69
137
  });
70
138
  }
71
139
  });
72
- var EditIcon, TrashIcon, AllMarketsIcon, NewListingsIcon, FavoritesIcon, UnFavoritesIcon, SearchIcon, MoveToTopIcon, OrderlyIcon, FavoritesIcon2, UnFavoritesIcon2, TopIcon, DeleteIcon, AddIcon, ActiveAddIcon, ExpandIcon, CollapseIcon, FilterIcon, TriangleDownIcon, ArrowLeftIcon;
140
+ var EditIcon, TrashIcon, AllMarketsIcon, NewListingsIcon, FavoritesIcon, UnFavoritesIcon, SearchIcon, MoveToTopIcon, OrderlyIcon, FavoritesIcon2, UnFavoritesIcon2, TopIcon, DeleteIcon, AddIcon, ActiveAddIcon, FilterIcon, TriangleDownIcon, ArrowLeftIcon;
73
141
  var init_icons = __esm({
74
142
  "src/icons.tsx"() {
75
143
  EditIcon = (props) => /* @__PURE__ */ jsxs(
@@ -366,30 +434,6 @@ var init_icons = __esm({
366
434
  ]
367
435
  }
368
436
  );
369
- ExpandIcon = (props) => /* @__PURE__ */ jsx(
370
- "svg",
371
- {
372
- width: "16",
373
- height: "16",
374
- viewBox: "0 0 16 16",
375
- fill: "currentColor",
376
- xmlns: "http://www.w3.org/2000/svg",
377
- ...props,
378
- children: /* @__PURE__ */ jsx("path", { d: "M6.326 8.826a.84.84 0 0 0-.6.234L2.16 12.627v-2.135H.492v4.167c0 .46.373.833.834.833h4.166v-1.667H3.357l3.567-3.567a.857.857 0 0 0 0-1.198.84.84 0 0 0-.598-.234M10.502.492V2.16h2.135L9.07 5.726a.857.857 0 0 0 0 1.199.86.86 0 0 0 1.197 0l3.568-3.568v2.135h1.667V1.326a.834.834 0 0 0-.834-.834z" })
379
- }
380
- );
381
- CollapseIcon = (props) => /* @__PURE__ */ jsx(
382
- "svg",
383
- {
384
- width: "16",
385
- height: "16",
386
- viewBox: "0 0 16 16",
387
- fill: "currentColor",
388
- xmlns: "http://www.w3.org/2000/svg",
389
- ...props,
390
- children: /* @__PURE__ */ jsx("path", { d: "M14.668.492a.85.85 0 0 0-.599.234l-3.567 3.568V2.159H8.835v4.167c0 .46.373.833.833.833h4.167V5.492H11.7l3.569-3.567a.86.86 0 0 0 0-1.199.85.85 0 0 0-.6-.234m-12.5 8.334v1.666h2.135L.736 14.06a.86.86 0 0 0 0 1.198.86.86 0 0 0 1.198 0l3.568-3.567v2.134h1.666V9.66a.834.834 0 0 0-.833-.833z" })
391
- }
392
- );
393
437
  FilterIcon = (props) => /* @__PURE__ */ jsx(
394
438
  "svg",
395
439
  {
@@ -1076,6 +1120,101 @@ var init_marketsHeader_widget = __esm({
1076
1120
  };
1077
1121
  }
1078
1122
  });
1123
+ function createCommunityBrokerFilter(selected) {
1124
+ return (data) => selected === "all" ? data?.filter((m) => Boolean(m?.broker_id)) : data?.filter((m) => m?.broker_id === selected);
1125
+ }
1126
+ function useCommunityTabs() {
1127
+ const brokerId = useConfig("brokerId");
1128
+ const [brokers] = useAllBrokers();
1129
+ const [allMarkets] = useMarkets(MarketsType.ALL);
1130
+ const lastSignatureRef = useRef("");
1131
+ const lastValueRef = useRef([]);
1132
+ return useMemo(() => {
1133
+ const brokerIdSet = /* @__PURE__ */ new Set();
1134
+ for (const m of allMarkets ?? []) {
1135
+ const id = m?.broker_id;
1136
+ if (typeof id === "string" && id.length) {
1137
+ brokerIdSet.add(id);
1138
+ }
1139
+ }
1140
+ const entries = Array.from(
1141
+ brokerIdSet
1142
+ ).map((id) => ({
1143
+ id,
1144
+ name: brokers?.[id]
1145
+ }));
1146
+ const sorted = entries.map(({ id, name }) => ({
1147
+ id,
1148
+ label: name ?? id,
1149
+ sortKey: (name ?? id).toLowerCase()
1150
+ })).sort((a, b) => a.sortKey.localeCompare(b.sortKey));
1151
+ if (brokerId) {
1152
+ const idx = sorted.findIndex((x) => x.id === brokerId);
1153
+ if (idx > 0) {
1154
+ const [cur] = sorted.splice(idx, 1);
1155
+ sorted.unshift(cur);
1156
+ }
1157
+ }
1158
+ const signature = sorted.map((x) => `${x.id}:${x.label}`).join("|");
1159
+ if (signature === lastSignatureRef.current) {
1160
+ return lastValueRef.current;
1161
+ }
1162
+ lastSignatureRef.current = signature;
1163
+ lastValueRef.current = sorted;
1164
+ return sorted;
1165
+ }, [allMarkets, brokers, brokerId]);
1166
+ }
1167
+ var init_useCommunityTabs = __esm({
1168
+ "src/hooks/useCommunityTabs.ts"() {
1169
+ }
1170
+ });
1171
+ var CommunityBrokerTabs;
1172
+ var init_communityBrokerTabs_ui = __esm({
1173
+ "src/components/communityBrokerTabs/communityBrokerTabs.ui.tsx"() {
1174
+ init_useCommunityTabs();
1175
+ CommunityBrokerTabs = (props) => {
1176
+ const {
1177
+ storageKey,
1178
+ className,
1179
+ classNames,
1180
+ variant = "contained",
1181
+ size = "sm",
1182
+ showScrollIndicator,
1183
+ allTitle,
1184
+ renderPanel
1185
+ } = props;
1186
+ const { t } = useTranslation();
1187
+ const [communitySubTab, setCommunitySubTab] = useLocalStorage(
1188
+ storageKey,
1189
+ "all"
1190
+ );
1191
+ const communityBrokerTabs = useCommunityTabs();
1192
+ return /* @__PURE__ */ jsxs(
1193
+ Tabs,
1194
+ {
1195
+ variant,
1196
+ size,
1197
+ value: communitySubTab,
1198
+ onValueChange: setCommunitySubTab,
1199
+ classNames,
1200
+ className,
1201
+ showScrollIndicator,
1202
+ children: [
1203
+ /* @__PURE__ */ jsx(TabPanel, { title: allTitle ?? t("common.all"), value: "all", children: renderPanel("all") }),
1204
+ communityBrokerTabs.map((b) => /* @__PURE__ */ jsx(TabPanel, { title: b.label, value: b.id, children: renderPanel(b.id) }, b.id))
1205
+ ]
1206
+ }
1207
+ );
1208
+ };
1209
+ }
1210
+ });
1211
+
1212
+ // src/components/communityBrokerTabs/index.ts
1213
+ var init_communityBrokerTabs = __esm({
1214
+ "src/components/communityBrokerTabs/index.ts"() {
1215
+ init_communityBrokerTabs_ui();
1216
+ }
1217
+ });
1079
1218
  var CollapseMarkets;
1080
1219
  var init_collapseMarkets = __esm({
1081
1220
  "src/components/collapseMarkets/index.tsx"() {
@@ -1176,6 +1315,7 @@ var init_collapseMarkets = __esm({
1176
1315
  var FavoritesDropdownMenu;
1177
1316
  var init_favoritesDropdownMenu_ui = __esm({
1178
1317
  "src/components/favoritesDropdownMenu/favoritesDropdownMenu.ui.tsx"() {
1318
+ init_symbolBadge();
1179
1319
  FavoritesDropdownMenu = (props) => {
1180
1320
  const {
1181
1321
  symbol,
@@ -1287,9 +1427,10 @@ var init_favoritesDropdownMenu_ui = __esm({
1287
1427
  Text.formatted,
1288
1428
  {
1289
1429
  rule: "symbol",
1290
- formatString: "base-type",
1430
+ formatString: "base",
1291
1431
  size: "base",
1292
1432
  showIcon: true,
1433
+ suffix: /* @__PURE__ */ jsx(SymbolBadge, { symbol }),
1293
1434
  children: symbol
1294
1435
  }
1295
1436
  )
@@ -1501,185 +1642,233 @@ var init_favoritesDropdownMenu = __esm({
1501
1642
  init_favoritesDropdownMenu_widget();
1502
1643
  }
1503
1644
  });
1504
- var RwaDotTooltip;
1505
- var init_rwaDotTooltip = __esm({
1506
- "src/components/rwaDotTooltip.tsx"() {
1507
- RwaDotTooltip = ({ record }) => {
1508
- const { t } = useTranslation();
1509
- const isInTradingHours = isCurrentlyTrading(
1510
- record.rwaNextClose,
1511
- record.rwaStatus
1512
- );
1513
- if (!record.isRwa) {
1514
- return null;
1645
+ function getSymbolColumn(favorite, isFavoriteList = false, options) {
1646
+ return {
1647
+ title: i18n.t("common.symbol"),
1648
+ dataIndex: "symbol",
1649
+ width: 150,
1650
+ onSort: true,
1651
+ render: (value, record) => {
1652
+ let favoritesIcon;
1653
+ if (!isFavoriteList) {
1654
+ favoritesIcon = /* @__PURE__ */ jsx(FavoritesDropdownMenuWidget, { row: record, favorite, children: /* @__PURE__ */ jsx(
1655
+ Flex,
1656
+ {
1657
+ width: 12,
1658
+ height: 12,
1659
+ justify: "center",
1660
+ itemAlign: "center",
1661
+ className: "oui-mr-1 oui-cursor-pointer",
1662
+ children: record.isFavorite ? /* @__PURE__ */ jsx(FavoritesIcon2, { className: "oui-size-3" }) : /* @__PURE__ */ jsx(UnFavoritesIcon2, { className: "oui-size-3" })
1663
+ }
1664
+ ) });
1515
1665
  }
1666
+ const stackLeverageInSecondRow = options?.stackLeverageInSecondRow;
1667
+ return /* @__PURE__ */ jsxs(Flex, { gapX: 1, itemAlign: "center", children: [
1668
+ favoritesIcon,
1669
+ /* @__PURE__ */ jsxs(
1670
+ Flex,
1671
+ {
1672
+ direction: stackLeverageInSecondRow ? "column" : "row",
1673
+ itemAlign: stackLeverageInSecondRow ? "start" : "center",
1674
+ gapY: stackLeverageInSecondRow ? 1 : void 0,
1675
+ gapX: stackLeverageInSecondRow ? void 0 : 1,
1676
+ children: [
1677
+ /* @__PURE__ */ jsxs(Flex, { gapX: 1, itemAlign: "center", children: [
1678
+ /* @__PURE__ */ jsx(TokenIcon, { symbol: value, className: "oui-size-[18px]" }),
1679
+ /* @__PURE__ */ jsx(SymbolDisplay, { formatString: "base", size: "2xs", record, children: value })
1680
+ ] }),
1681
+ typeof record.leverage === "number" && /* @__PURE__ */ jsxs(Badge, { size: "xs", color: "primary", children: [
1682
+ record.leverage,
1683
+ "x"
1684
+ ] })
1685
+ ]
1686
+ }
1687
+ )
1688
+ ] });
1689
+ }
1690
+ };
1691
+ }
1692
+ function getLastColumn() {
1693
+ return {
1694
+ title: i18n.t("markets.column.last"),
1695
+ dataIndex: "24h_close",
1696
+ align: "right",
1697
+ onSort: true,
1698
+ width: 100,
1699
+ render: (value, record) => {
1700
+ return /* @__PURE__ */ jsx(Text.numeral, { dp: record.quote_dp || 2, size: "2xs", children: value });
1701
+ }
1702
+ };
1703
+ }
1704
+ function get24hPercentageColumn() {
1705
+ return {
1706
+ title: i18n.t("markets.column.24hPercentage"),
1707
+ dataIndex: "change",
1708
+ align: "right",
1709
+ onSort: true,
1710
+ width: 80,
1711
+ render: (value) => {
1516
1712
  return /* @__PURE__ */ jsx(
1517
- Tooltip,
1713
+ Text.numeral,
1518
1714
  {
1519
- content: /* @__PURE__ */ jsx(Text, { color: isInTradingHours ? "success" : "danger", children: isInTradingHours ? t("trading.rwa.marketHours") : t("trading.rwa.outsideMarketHours") }),
1520
- children: /* @__PURE__ */ jsx(Box, { p: 2, children: /* @__PURE__ */ jsx(
1521
- Box,
1522
- {
1523
- width: 4,
1524
- height: 4,
1525
- r: "full",
1526
- className: isInTradingHours ? "oui-bg-success" : "oui-bg-danger"
1527
- }
1528
- ) })
1715
+ rule: "percentages",
1716
+ coloring: true,
1717
+ rm: Decimal.ROUND_DOWN,
1718
+ showIdentifier: true,
1719
+ size: "2xs",
1720
+ children: value
1529
1721
  }
1530
1722
  );
1531
- };
1532
- }
1533
- });
1534
- var useSideMarketsColumns;
1535
- var init_column = __esm({
1536
- "src/components/sideMarkets/column.tsx"() {
1537
- init_icons();
1538
- init_favoritesDropdownMenu();
1539
- init_rwaDotTooltip();
1540
- init_symbolDisplay();
1541
- useSideMarketsColumns = (favorite, isFavoriteList = false) => {
1542
- const { t } = useTranslation();
1543
- return [
1723
+ }
1724
+ };
1725
+ }
1726
+ function get24hVolOIColumn() {
1727
+ return {
1728
+ title: i18n.t("markets.column.24hVolOI"),
1729
+ dataIndex: "24h_amount",
1730
+ align: "right",
1731
+ className: "oui-h-[36px]",
1732
+ width: 100,
1733
+ multiSort: {
1734
+ fields: [
1544
1735
  {
1545
- title: `${t("markets.column.market")} / ${t("common.volume")}`,
1546
- dataIndex: "24h_amount",
1547
- multiSort: {
1548
- fields: [
1549
- {
1550
- sortKey: "symbol",
1551
- label: t("markets.column.market")
1552
- },
1553
- {
1554
- sortKey: "24h_amount",
1555
- label: t("common.volume")
1556
- }
1557
- ]
1558
- },
1559
- className: "oui-h-[36px]",
1560
- render: (value, record) => {
1561
- let favoritesIcon;
1562
- if (!isFavoriteList) {
1563
- favoritesIcon = /* @__PURE__ */ jsx(FavoritesDropdownMenuWidget, { row: record, favorite, children: /* @__PURE__ */ jsx(
1564
- Flex,
1565
- {
1566
- width: 12,
1567
- height: 12,
1568
- justify: "center",
1569
- itemAlign: "center",
1570
- className: "oui-mr-1 oui-cursor-pointer",
1571
- children: record.isFavorite ? /* @__PURE__ */ jsx(FavoritesIcon2, { className: "oui-size-3" }) : /* @__PURE__ */ jsx(UnFavoritesIcon2, { className: "oui-size-3" })
1572
- }
1573
- ) });
1574
- }
1575
- return /* @__PURE__ */ jsxs(Flex, { children: [
1576
- favoritesIcon,
1577
- /* @__PURE__ */ jsxs(Flex, { direction: "column", itemAlign: "start", gapY: 1, children: [
1578
- /* @__PURE__ */ jsxs(Flex, { gapX: 1, children: [
1579
- /* @__PURE__ */ jsx(TokenIcon, { symbol: record.symbol, className: "oui-size-[18px]" }),
1580
- /* @__PURE__ */ jsx(SymbolDisplay, { formatString: "base", size: "2xs", children: record.symbol }),
1581
- /* @__PURE__ */ jsx(RwaDotTooltip, { record }),
1582
- /* @__PURE__ */ jsxs(Badge, { size: "xs", color: "primary", children: [
1583
- record.leverage,
1584
- "x"
1585
- ] })
1586
- ] }),
1587
- /* @__PURE__ */ jsx(
1588
- Text.numeral,
1589
- {
1590
- intensity: 54,
1591
- size: "2xs",
1592
- rule: "human",
1593
- dp: 2,
1594
- rm: Decimal.ROUND_DOWN,
1595
- children: value
1596
- }
1597
- )
1598
- ] })
1599
- ] });
1600
- }
1736
+ sortKey: "24h_amount",
1737
+ label: i18n.t("markets.column.24hVol")
1601
1738
  },
1602
1739
  {
1603
- title: t("markets.column.price&Change"),
1604
- dataIndex: "change",
1605
- align: "right",
1606
- onSort: true,
1607
- className: "oui-h-[36px]",
1608
- render: (value, record) => {
1609
- const onDelSymbol = (e) => {
1610
- favorite.updateSymbolFavoriteState(
1611
- record,
1612
- favorite.selectedFavoriteTab,
1613
- true
1614
- );
1615
- e.stopPropagation();
1616
- };
1617
- const iconCls = "oui-w-4 oui-h-4 oui-text-base-contrast-54 hover:oui-text-base-contrast";
1618
- const actions = /* @__PURE__ */ jsx(
1619
- "div",
1620
- {
1621
- className: cn(
1622
- "oui-absolute oui-right-0 oui-top-[6.5px]",
1623
- "oui-hidden group-hover:oui-block"
1624
- ),
1625
- children: /* @__PURE__ */ jsxs(
1626
- Flex,
1627
- {
1628
- className: cn(
1629
- "oui-inline-flex",
1630
- "oui-bg-primary-darken oui-py-[6px]"
1631
- ),
1632
- r: "base",
1633
- width: 52,
1634
- justify: "center",
1635
- itemAlign: "end",
1636
- gapX: 2,
1637
- children: [
1638
- /* @__PURE__ */ jsx(
1639
- TopIcon,
1640
- {
1641
- className: iconCls,
1642
- onClick: (e) => {
1643
- e.stopPropagation();
1644
- favorite.pinToTop(record);
1645
- }
1646
- }
1647
- ),
1648
- /* @__PURE__ */ jsx(DeleteIcon, { className: iconCls, onClick: onDelSymbol })
1649
- ]
1650
- }
1651
- )
1652
- }
1653
- );
1654
- return /* @__PURE__ */ jsxs("div", { className: "oui-relative", children: [
1655
- isFavoriteList && actions,
1656
- /* @__PURE__ */ jsxs(
1657
- Flex,
1740
+ sortKey: "openInterest",
1741
+ label: i18n.t("markets.column.OI")
1742
+ }
1743
+ ]
1744
+ },
1745
+ render: (value, record) => /* @__PURE__ */ jsxs(Flex, { direction: "column", itemAlign: "end", gapY: 1, children: [
1746
+ /* @__PURE__ */ jsx(Text.numeral, { rule: "human", dp: 2, rm: Decimal.ROUND_DOWN, children: value }),
1747
+ /* @__PURE__ */ jsx(
1748
+ Text.numeral,
1749
+ {
1750
+ rule: "human",
1751
+ dp: 2,
1752
+ rm: Decimal.ROUND_DOWN,
1753
+ size: "2xs",
1754
+ intensity: 54,
1755
+ children: record.openInterest
1756
+ }
1757
+ )
1758
+ ] })
1759
+ };
1760
+ }
1761
+ function getLastAnd24hPercentageColumn(favorite, isFavoriteList = false) {
1762
+ return {
1763
+ title: i18n.t("markets.column.last&24hPercentage"),
1764
+ dataIndex: "change",
1765
+ align: "right",
1766
+ onSort: true,
1767
+ className: "oui-h-[36px]",
1768
+ width: 100,
1769
+ render: (value, record) => {
1770
+ const onDelSymbol = (e) => {
1771
+ favorite.updateSymbolFavoriteState(
1772
+ record,
1773
+ favorite.selectedFavoriteTab,
1774
+ true
1775
+ );
1776
+ e.stopPropagation();
1777
+ };
1778
+ const iconCls = "oui-w-4 oui-h-4 oui-text-base-contrast-54 hover:oui-text-base-contrast";
1779
+ const actions = /* @__PURE__ */ jsx(
1780
+ "div",
1781
+ {
1782
+ className: cn(
1783
+ "oui-absolute oui-right-0 oui-top-[6.5px]",
1784
+ "oui-hidden group-hover:oui-block"
1785
+ ),
1786
+ children: /* @__PURE__ */ jsxs(
1787
+ Flex,
1788
+ {
1789
+ className: cn(
1790
+ "oui-inline-flex",
1791
+ "oui-bg-primary-darken oui-py-[6px]"
1792
+ ),
1793
+ r: "base",
1794
+ width: 52,
1795
+ justify: "center",
1796
+ itemAlign: "end",
1797
+ gapX: 2,
1798
+ children: [
1799
+ /* @__PURE__ */ jsx(
1800
+ TopIcon,
1801
+ {
1802
+ className: iconCls,
1803
+ onClick: (e) => {
1804
+ e.stopPropagation();
1805
+ favorite.pinToTop(record);
1806
+ }
1807
+ }
1808
+ ),
1809
+ /* @__PURE__ */ jsx(DeleteIcon, { className: iconCls, onClick: onDelSymbol })
1810
+ ]
1811
+ }
1812
+ )
1813
+ }
1814
+ );
1815
+ return /* @__PURE__ */ jsxs("div", { className: "oui-relative", children: [
1816
+ isFavoriteList && actions,
1817
+ /* @__PURE__ */ jsxs(
1818
+ Flex,
1819
+ {
1820
+ direction: "column",
1821
+ justify: "end",
1822
+ itemAlign: "end",
1823
+ gapY: 1,
1824
+ className: cn(isFavoriteList && "group-hover:oui-invisible"),
1825
+ children: [
1826
+ /* @__PURE__ */ jsx(Text.numeral, { dp: record.quote_dp || 2, size: "2xs", children: record["24h_close"] }),
1827
+ /* @__PURE__ */ jsx(
1828
+ Text.numeral,
1658
1829
  {
1659
- direction: "column",
1660
- justify: "end",
1661
- itemAlign: "end",
1662
- gapY: 1,
1663
- className: cn(isFavoriteList && "group-hover:oui-invisible"),
1664
- children: [
1665
- /* @__PURE__ */ jsx(Text.numeral, { dp: record.quote_dp || 2, size: "2xs", children: record["24h_close"] }),
1666
- /* @__PURE__ */ jsx(
1667
- Text.numeral,
1668
- {
1669
- rule: "percentages",
1670
- coloring: true,
1671
- rm: Decimal.ROUND_DOWN,
1672
- showIdentifier: true,
1673
- size: "2xs",
1674
- children: value
1675
- }
1676
- )
1677
- ]
1830
+ rule: "percentages",
1831
+ coloring: true,
1832
+ rm: Decimal.ROUND_DOWN,
1833
+ showIdentifier: true,
1834
+ size: "2xs",
1835
+ children: value
1678
1836
  }
1679
1837
  )
1680
- ] });
1838
+ ]
1681
1839
  }
1682
- }
1840
+ )
1841
+ ] });
1842
+ }
1843
+ };
1844
+ }
1845
+ var init_column = __esm({
1846
+ "src/components/shared/column.tsx"() {
1847
+ init_icons();
1848
+ init_icons();
1849
+ init_favoritesDropdownMenu();
1850
+ init_symbolDisplay();
1851
+ }
1852
+ });
1853
+
1854
+ // src/components/sideMarkets/column.tsx
1855
+ var useSideMarketsColumns;
1856
+ var init_column2 = __esm({
1857
+ "src/components/sideMarkets/column.tsx"() {
1858
+ init_column();
1859
+ useSideMarketsColumns = (favorite, isFavoriteList = false) => {
1860
+ const symbolCol = getSymbolColumn(favorite, isFavoriteList, {
1861
+ stackLeverageInSecondRow: true
1862
+ });
1863
+ const volOiCol = get24hVolOIColumn();
1864
+ const lastPctCol = getLastAnd24hPercentageColumn(favorite, isFavoriteList);
1865
+ return [
1866
+ {
1867
+ ...symbolCol,
1868
+ width: 115
1869
+ },
1870
+ volOiCol,
1871
+ lastPctCol
1683
1872
  ];
1684
1873
  };
1685
1874
  }
@@ -1689,7 +1878,7 @@ var init_marketsList_ui = __esm({
1689
1878
  "src/components/marketsList/marketsList.ui.tsx"() {
1690
1879
  init_collapseMarkets();
1691
1880
  init_marketsProvider();
1692
- init_column();
1881
+ init_column2();
1693
1882
  MarketsList = (props) => {
1694
1883
  const {
1695
1884
  loading,
@@ -1750,7 +1939,7 @@ var init_marketsList_ui = __esm({
1750
1939
  });
1751
1940
 
1752
1941
  // src/type.ts
1753
- var MarketsPageTab, MarketsTabName, FundingTabName;
1942
+ var MarketsPageTab, MarketsTabName, CommunitySubTabName, FundingTabName;
1754
1943
  var init_type = __esm({
1755
1944
  "src/type.ts"() {
1756
1945
  MarketsPageTab = /* @__PURE__ */ ((MarketsPageTab2) => {
@@ -1764,8 +1953,15 @@ var init_type = __esm({
1764
1953
  MarketsTabName2["All"] = "all";
1765
1954
  MarketsTabName2["Rwa"] = "rwa";
1766
1955
  MarketsTabName2["NewListing"] = "newListing";
1956
+ MarketsTabName2["Community"] = "community";
1767
1957
  return MarketsTabName2;
1768
1958
  })(MarketsTabName || {});
1959
+ CommunitySubTabName = /* @__PURE__ */ ((CommunitySubTabName2) => {
1960
+ CommunitySubTabName2["All"] = "all";
1961
+ CommunitySubTabName2["MyListings"] = "myListings";
1962
+ CommunitySubTabName2["OtherListings"] = "otherListings";
1963
+ return CommunitySubTabName2;
1964
+ })(CommunitySubTabName || {});
1769
1965
  FundingTabName = /* @__PURE__ */ ((FundingTabName2) => {
1770
1966
  FundingTabName2["Overview"] = "overview";
1771
1967
  FundingTabName2["Comparison"] = "comparison";
@@ -1781,6 +1977,7 @@ var init_marketsList_script = __esm({
1781
1977
  init_marketsProvider();
1782
1978
  MarketsTypeMap = {
1783
1979
  ["all" /* All */]: MarketsType.ALL,
1980
+ ["community" /* Community */]: MarketsType.COMMUNITY,
1784
1981
  ["rwa" /* Rwa */]: MarketsType.RWA,
1785
1982
  ["favorites" /* Favorites */]: MarketsType.FAVORITES,
1786
1983
  ["recent" /* Recent */]: MarketsType.RECENT,
@@ -1880,18 +2077,7 @@ var init_rwaTab = __esm({
1880
2077
  };
1881
2078
  RwaTab = () => {
1882
2079
  const { t } = useTranslation();
1883
- return /* @__PURE__ */ jsxs(Flex, { gap: 1, children: [
1884
- /* @__PURE__ */ jsx(Text, { children: t("common.rwa") }),
1885
- /* @__PURE__ */ jsx(
1886
- Box,
1887
- {
1888
- r: "base",
1889
- px: 2,
1890
- className: "oui-bg-gradient-to-r oui-from-[rgb(var(--oui-gradient-brand-start)_/_0.12)] oui-to-[rgb(var(--oui-gradient-brand-end)_/_0.12)]",
1891
- children: /* @__PURE__ */ jsx(GradientText, { color: "brand", children: t("common.new") })
1892
- }
1893
- )
1894
- ] });
2080
+ return /* @__PURE__ */ jsx(Flex, { gap: 1, children: /* @__PURE__ */ jsx(Text, { children: t("common.rwa") }) });
1895
2081
  };
1896
2082
  }
1897
2083
  });
@@ -1953,231 +2139,6 @@ var init_searchInput = __esm({
1953
2139
  };
1954
2140
  }
1955
2141
  });
1956
- function getSymbolColumn(favorite, isFavoriteList = false) {
1957
- return {
1958
- title: i18n.t("common.symbol"),
1959
- dataIndex: "symbol",
1960
- width: 150,
1961
- onSort: true,
1962
- render: (value, record) => {
1963
- let favoritesIcon;
1964
- if (!isFavoriteList) {
1965
- favoritesIcon = /* @__PURE__ */ jsx(FavoritesDropdownMenuWidget, { row: record, favorite, children: /* @__PURE__ */ jsx(
1966
- Flex,
1967
- {
1968
- width: 12,
1969
- height: 12,
1970
- justify: "center",
1971
- itemAlign: "center",
1972
- className: "oui-mr-1 oui-cursor-pointer",
1973
- children: record.isFavorite ? /* @__PURE__ */ jsx(FavoritesIcon2, { className: "oui-size-3" }) : /* @__PURE__ */ jsx(UnFavoritesIcon2, { className: "oui-size-3" })
1974
- }
1975
- ) });
1976
- }
1977
- return /* @__PURE__ */ jsxs(Flex, { gapX: 1, children: [
1978
- favoritesIcon,
1979
- /* @__PURE__ */ jsxs(Flex, { direction: "column", itemAlign: "start", gapY: 1, children: [
1980
- /* @__PURE__ */ jsxs(Flex, { gapX: 1, itemAlign: "center", children: [
1981
- /* @__PURE__ */ jsx(TokenIcon, { symbol: value, className: "oui-size-[18px]" }),
1982
- /* @__PURE__ */ jsx(SymbolDisplay, { formatString: "base", size: "2xs", children: value }),
1983
- /* @__PURE__ */ jsx(RwaDotTooltip, { record })
1984
- ] }),
1985
- /* @__PURE__ */ jsxs(Badge, { size: "xs", color: "primary", children: [
1986
- record.leverage,
1987
- "x"
1988
- ] })
1989
- ] })
1990
- ] });
1991
- }
1992
- };
1993
- }
1994
- function getLastColumn() {
1995
- return {
1996
- title: i18n.t("markets.column.last"),
1997
- dataIndex: "24h_close",
1998
- align: "right",
1999
- onSort: true,
2000
- width: 100,
2001
- render: (value, record) => {
2002
- return /* @__PURE__ */ jsx(Text.numeral, { dp: record.quote_dp || 2, size: "2xs", children: value });
2003
- }
2004
- };
2005
- }
2006
- function get24hPercentageColumn() {
2007
- return {
2008
- title: i18n.t("markets.column.24hPercentage"),
2009
- dataIndex: "change",
2010
- align: "right",
2011
- onSort: true,
2012
- width: 80,
2013
- render: (value) => {
2014
- return /* @__PURE__ */ jsx(
2015
- Text.numeral,
2016
- {
2017
- rule: "percentages",
2018
- coloring: true,
2019
- rm: Decimal.ROUND_DOWN,
2020
- showIdentifier: true,
2021
- size: "2xs",
2022
- children: value
2023
- }
2024
- );
2025
- }
2026
- };
2027
- }
2028
- function get24hVolOIColumn() {
2029
- return {
2030
- title: i18n.t("markets.column.24hVolOI"),
2031
- dataIndex: "24h_amount",
2032
- align: "right",
2033
- className: "oui-h-[36px]",
2034
- width: 100,
2035
- multiSort: {
2036
- fields: [
2037
- {
2038
- sortKey: "24h_amount",
2039
- label: i18n.t("markets.column.24hVol")
2040
- },
2041
- {
2042
- sortKey: "openInterest",
2043
- label: i18n.t("markets.column.OI")
2044
- }
2045
- ]
2046
- },
2047
- render: (value, record) => /* @__PURE__ */ jsxs(Flex, { direction: "column", itemAlign: "end", gapY: 1, children: [
2048
- /* @__PURE__ */ jsx(Text.numeral, { rule: "human", dp: 2, rm: Decimal.ROUND_DOWN, children: value }),
2049
- /* @__PURE__ */ jsx(
2050
- Text.numeral,
2051
- {
2052
- rule: "human",
2053
- dp: 2,
2054
- rm: Decimal.ROUND_DOWN,
2055
- size: "2xs",
2056
- intensity: 54,
2057
- children: record.openInterest
2058
- }
2059
- )
2060
- ] })
2061
- };
2062
- }
2063
- function getLastAnd24hPercentageColumn(favorite, isFavoriteList = false) {
2064
- return {
2065
- title: i18n.t("markets.column.last&24hPercentage"),
2066
- dataIndex: "change",
2067
- align: "right",
2068
- onSort: true,
2069
- className: "oui-h-[36px]",
2070
- width: 100,
2071
- render: (value, record) => {
2072
- const onDelSymbol = (e) => {
2073
- favorite.updateSymbolFavoriteState(
2074
- record,
2075
- favorite.selectedFavoriteTab,
2076
- true
2077
- );
2078
- e.stopPropagation();
2079
- };
2080
- const iconCls = "oui-w-4 oui-h-4 oui-text-base-contrast-54 hover:oui-text-base-contrast";
2081
- const actions = /* @__PURE__ */ jsx(
2082
- "div",
2083
- {
2084
- className: cn(
2085
- "oui-absolute oui-right-0 oui-top-[6.5px]",
2086
- "oui-hidden group-hover:oui-block"
2087
- ),
2088
- children: /* @__PURE__ */ jsxs(
2089
- Flex,
2090
- {
2091
- className: cn(
2092
- "oui-inline-flex",
2093
- "oui-bg-primary-darken oui-py-[6px]"
2094
- ),
2095
- r: "base",
2096
- width: 52,
2097
- justify: "center",
2098
- itemAlign: "end",
2099
- gapX: 2,
2100
- children: [
2101
- /* @__PURE__ */ jsx(
2102
- TopIcon,
2103
- {
2104
- className: iconCls,
2105
- onClick: (e) => {
2106
- e.stopPropagation();
2107
- favorite.pinToTop(record);
2108
- }
2109
- }
2110
- ),
2111
- /* @__PURE__ */ jsx(DeleteIcon, { className: iconCls, onClick: onDelSymbol })
2112
- ]
2113
- }
2114
- )
2115
- }
2116
- );
2117
- return /* @__PURE__ */ jsxs("div", { className: "oui-relative", children: [
2118
- isFavoriteList && actions,
2119
- /* @__PURE__ */ jsxs(
2120
- Flex,
2121
- {
2122
- direction: "column",
2123
- justify: "end",
2124
- itemAlign: "end",
2125
- gapY: 1,
2126
- className: cn(isFavoriteList && "group-hover:oui-invisible"),
2127
- children: [
2128
- /* @__PURE__ */ jsx(Text.numeral, { dp: record.quote_dp || 2, size: "2xs", children: record["24h_close"] }),
2129
- /* @__PURE__ */ jsx(
2130
- Text.numeral,
2131
- {
2132
- rule: "percentages",
2133
- coloring: true,
2134
- rm: Decimal.ROUND_DOWN,
2135
- showIdentifier: true,
2136
- size: "2xs",
2137
- children: value
2138
- }
2139
- )
2140
- ]
2141
- }
2142
- )
2143
- ] });
2144
- }
2145
- };
2146
- }
2147
- function getMarkIndexColumn() {
2148
- return {
2149
- title: i18n.t("markets.column.mark&Index"),
2150
- dataIndex: "mark_price",
2151
- align: "right",
2152
- className: "oui-h-[36px]",
2153
- width: 100,
2154
- multiSort: {
2155
- fields: [
2156
- {
2157
- sortKey: "mark_price",
2158
- label: i18n.t("markets.column.mark")
2159
- },
2160
- {
2161
- sortKey: "index_price",
2162
- label: i18n.t("markets.column.index")
2163
- }
2164
- ]
2165
- },
2166
- render: (value, record) => /* @__PURE__ */ jsxs(Flex, { direction: "column", itemAlign: "end", gapY: 1, children: [
2167
- /* @__PURE__ */ jsx(Text.numeral, { dp: record.quote_dp || 2, size: "2xs", children: value }),
2168
- /* @__PURE__ */ jsx(Text.numeral, { dp: record.quote_dp || 2, size: "2xs", intensity: 54, children: record.index_price })
2169
- ] })
2170
- };
2171
- }
2172
- var init_column2 = __esm({
2173
- "src/components/shared/column.tsx"() {
2174
- init_icons();
2175
- init_icons();
2176
- init_favoritesDropdownMenu();
2177
- init_rwaDotTooltip();
2178
- init_symbolDisplay();
2179
- }
2180
- });
2181
2142
  var FavoritesEmpty;
2182
2143
  var init_favoritesEmpty = __esm({
2183
2144
  "src/components/favoritesEmpty/index.tsx"() {
@@ -2629,31 +2590,181 @@ var init_useFavoritesExtraProps = __esm({
2629
2590
  init_marketsProvider();
2630
2591
  }
2631
2592
  });
2593
+ function isBuiltInMarketTab(tab) {
2594
+ return "type" in tab;
2595
+ }
2596
+ function isCustomMarketTab(tab) {
2597
+ return "id" in tab;
2598
+ }
2599
+ function tabKey(tab, index) {
2600
+ return isBuiltInMarketTab(tab) ? tab.type : tab.id || `category_${index}`;
2601
+ }
2602
+ function resolveIcon(icon) {
2603
+ if (typeof icon === "string") {
2604
+ return createElement("img", {
2605
+ src: icon,
2606
+ alt: "",
2607
+ style: { width: 16, height: 16 }
2608
+ });
2609
+ }
2610
+ return icon;
2611
+ }
2612
+ function resolveSuffix(suffix) {
2613
+ if (typeof suffix === "undefined" || suffix === null) {
2614
+ return void 0;
2615
+ }
2616
+ if (typeof suffix === "string") {
2617
+ return /* @__PURE__ */ jsx("span", { className: "oui-ml-1 oui-inline-flex oui-items-center oui-rounded oui-bg-gradient-to-r oui-from-[rgb(var(--oui-gradient-brand-start)_/_0.12)] oui-to-[rgb(var(--oui-gradient-brand-end)_/_0.12)] oui-px-2", children: /* @__PURE__ */ jsx(GradientText, { color: "brand", children: suffix }) });
2618
+ }
2619
+ return /* @__PURE__ */ jsx("span", { className: "oui-ml-1", children: suffix });
2620
+ }
2621
+ function composeTabTitle(label, options) {
2622
+ const icon = options?.icon;
2623
+ const suffix = resolveSuffix(options?.suffix);
2624
+ const hasLabel = typeof label !== "undefined" && label !== null && label !== "";
2625
+ if (!hasLabel) {
2626
+ if (!icon) {
2627
+ return suffix ?? null;
2628
+ }
2629
+ return suffix ? /* @__PURE__ */ jsxs("span", { className: "oui-inline-flex oui-items-center oui-gap-x-1", children: [
2630
+ icon,
2631
+ suffix
2632
+ ] }) : icon;
2633
+ }
2634
+ if (icon) {
2635
+ return /* @__PURE__ */ jsxs("span", { className: "oui-inline-flex oui-items-center oui-gap-x-1", children: [
2636
+ icon,
2637
+ label,
2638
+ suffix
2639
+ ] });
2640
+ }
2641
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
2642
+ label,
2643
+ suffix
2644
+ ] });
2645
+ }
2646
+ function resolveTabTriggerIcon(tab, fallbackIcon) {
2647
+ const resolvedIcon = typeof tab.icon !== "undefined" ? resolveIcon(tab.icon) : fallbackIcon;
2648
+ return isValidElement(resolvedIcon) ? resolvedIcon : void 0;
2649
+ }
2650
+ function resolveTabTitle(tab, titleOverrides, rwaTitle) {
2651
+ if (isBuiltInMarketTab(tab) && tab.type === "favorites") {
2652
+ return /* @__PURE__ */ jsx(FavoritesIcon, {});
2653
+ }
2654
+ if (isBuiltInMarketTab(tab) && tab.type === "rwa") {
2655
+ return rwaTitle;
2656
+ }
2657
+ if (isBuiltInMarketTab(tab) && titleOverrides[tab.type]) {
2658
+ return tab.name ?? titleOverrides[tab.type];
2659
+ }
2660
+ return composeTabTitle(tab.name, {
2661
+ icon: resolveIcon(tab.icon),
2662
+ suffix: tab.suffix
2663
+ });
2664
+ }
2665
+ function useBuiltInTitles() {
2666
+ const { t } = useTranslation();
2667
+ return useMemo(
2668
+ () => Object.fromEntries(
2669
+ Object.entries(BUILT_IN_TITLE_MAP).map(([key, i18nKey]) => [
2670
+ key,
2671
+ t(i18nKey)
2672
+ ])
2673
+ ),
2674
+ [t]
2675
+ );
2676
+ }
2677
+ function getCustomTabDataFilter(tab) {
2678
+ if (!tab) return void 0;
2679
+ return (data) => data.filter((item) => tab.match(item));
2680
+ }
2681
+ function useCustomTabDataFilters(tabs) {
2682
+ return useMemo(() => {
2683
+ if (!tabs) return {};
2684
+ const result = {};
2685
+ tabs.forEach((tab, i) => {
2686
+ if (isCustomMarketTab(tab)) {
2687
+ result[tabKey(tab, i)] = (data) => data.filter((item) => tab.match(item));
2688
+ }
2689
+ });
2690
+ return result;
2691
+ }, [tabs]);
2692
+ }
2693
+ var BUILT_IN_TITLE_MAP;
2694
+ var init_tabUtils = __esm({
2695
+ "src/components/shared/tabUtils.tsx"() {
2696
+ init_icons();
2697
+ BUILT_IN_TITLE_MAP = {
2698
+ community: "markets.community",
2699
+ all: "common.all",
2700
+ newListing: "markets.newListings",
2701
+ recent: "markets.recent"
2702
+ };
2703
+ }
2704
+ });
2632
2705
  var MobileMarketsDataList;
2633
2706
  var init_marketsDataList_mobile_ui = __esm({
2634
2707
  "src/pages/home/marketsDataList/marketsDataList.mobile.ui.tsx"() {
2708
+ init_communityBrokerTabs();
2635
2709
  init_marketsList();
2710
+ init_marketsProvider();
2636
2711
  init_rwaTab();
2637
2712
  init_searchInput();
2638
- init_column2();
2713
+ init_column();
2639
2714
  init_useFavoritesExtraProps();
2715
+ init_tabUtils();
2716
+ init_useCommunityTabs();
2640
2717
  init_icons();
2641
2718
  init_type();
2642
2719
  MobileMarketsDataList = (props) => {
2643
2720
  const { activeTab, onTabChange, tabSort, onTabSort } = props;
2644
2721
  const { t } = useTranslation();
2722
+ const { tabs } = useMarketsContext();
2723
+ const tabDataFilters = useCustomTabDataFilters(tabs);
2645
2724
  const getColumns = useCallback(
2646
2725
  (favorite, isFavoriteList = false) => {
2647
2726
  return [
2648
- getSymbolColumn(favorite, isFavoriteList),
2727
+ getSymbolColumn(favorite, isFavoriteList, {
2728
+ stackLeverageInSecondRow: true
2729
+ }),
2649
2730
  get24hVolOIColumn(),
2650
- getLastAnd24hPercentageColumn(favorite, isFavoriteList),
2651
- getMarkIndexColumn()
2731
+ getLastAnd24hPercentageColumn(favorite, isFavoriteList)
2652
2732
  ];
2653
2733
  },
2654
2734
  []
2655
2735
  );
2656
2736
  const { getFavoritesProps } = useFavoritesProps();
2737
+ const builtInMeta = useMemo(
2738
+ () => ({
2739
+ favorites: {
2740
+ title: /* @__PURE__ */ jsx(FavoritesIcon, {}),
2741
+ value: "favorites",
2742
+ tabName: "favorites" /* Favorites */
2743
+ },
2744
+ community: {
2745
+ title: t("markets.community"),
2746
+ value: "community"
2747
+ },
2748
+ all: {
2749
+ title: t("markets.allMarkets"),
2750
+ icon: /* @__PURE__ */ jsx(AllMarketsIcon, {}),
2751
+ value: "all",
2752
+ tabName: "all" /* All */
2753
+ },
2754
+ rwa: {
2755
+ title: /* @__PURE__ */ jsx(RwaIconTab, {}),
2756
+ value: "rwa",
2757
+ tabName: "rwa" /* Rwa */
2758
+ },
2759
+ newListing: {
2760
+ title: t("markets.newListings"),
2761
+ icon: /* @__PURE__ */ jsx(NewListingsIcon, {}),
2762
+ value: "new",
2763
+ tabName: "newListing" /* NewListing */
2764
+ }
2765
+ }),
2766
+ [t]
2767
+ );
2657
2768
  const renderTab = (type) => {
2658
2769
  return /* @__PURE__ */ jsxs(Fragment, { children: [
2659
2770
  /* @__PURE__ */ jsx(
@@ -2680,7 +2791,20 @@ var init_marketsDataList_mobile_ui = __esm({
2680
2791
  )
2681
2792
  ] });
2682
2793
  };
2683
- return /* @__PURE__ */ jsx(Box, { id: "oui-markets-list", intensity: 900, py: 3, mt: 2, r: "2xl", children: /* @__PURE__ */ jsxs(
2794
+ const renderCommunityList = (selected) => {
2795
+ return /* @__PURE__ */ jsx(
2796
+ MarketsListWidget,
2797
+ {
2798
+ type: "all" /* All */,
2799
+ initialSort: tabSort["community" /* Community */],
2800
+ onSort: onTabSort("community" /* Community */),
2801
+ getColumns,
2802
+ rowClassName: "!oui-h-[34px]",
2803
+ dataFilter: createCommunityBrokerFilter(selected)
2804
+ }
2805
+ );
2806
+ };
2807
+ return /* @__PURE__ */ jsx(Box, { id: "oui-markets-list", intensity: 900, py: 3, mt: 2, r: "2xl", children: /* @__PURE__ */ jsx(
2684
2808
  Tabs,
2685
2809
  {
2686
2810
  variant: "contained",
@@ -2691,28 +2815,85 @@ var init_marketsDataList_mobile_ui = __esm({
2691
2815
  scrollIndicator: "oui-mx-3"
2692
2816
  },
2693
2817
  showScrollIndicator: true,
2694
- children: [
2695
- /* @__PURE__ */ jsx(TabPanel, { title: /* @__PURE__ */ jsx(FavoritesIcon, {}), value: "favorites", children: renderTab("favorites" /* Favorites */) }),
2696
- /* @__PURE__ */ jsx(
2697
- TabPanel,
2698
- {
2699
- title: t("markets.allMarkets"),
2700
- icon: /* @__PURE__ */ jsx(AllMarketsIcon, {}),
2701
- value: "all",
2702
- children: renderTab("all" /* All */)
2703
- }
2704
- ),
2705
- /* @__PURE__ */ jsx(TabPanel, { title: /* @__PURE__ */ jsx(RwaIconTab, {}), value: "rwa", children: renderTab("rwa" /* Rwa */) }),
2706
- /* @__PURE__ */ jsx(
2818
+ children: tabs?.map((tab, index) => {
2819
+ const key = tabKey(tab, index);
2820
+ const isBuiltIn = isBuiltInMarketTab(tab);
2821
+ const meta = isBuiltIn ? builtInMeta[tab.type] : void 0;
2822
+ if (isBuiltIn && meta) {
2823
+ const title = tab.type === "favorites" ? composeTabTitle(tab.name, {
2824
+ icon: resolveTabTriggerIcon(tab, /* @__PURE__ */ jsx(FavoritesIcon, {})),
2825
+ suffix: tab.suffix
2826
+ }) : tab.type === "rwa" ? resolveTabTitle(tab, {}, /* @__PURE__ */ jsx(RwaIconTab, {})) : composeTabTitle(tab.name ?? meta.title, {
2827
+ suffix: tab.suffix
2828
+ });
2829
+ return /* @__PURE__ */ jsx(
2830
+ TabPanel,
2831
+ {
2832
+ title,
2833
+ icon: tab.type === "favorites" || tab.type === "rwa" ? void 0 : resolveTabTriggerIcon(tab, meta.icon),
2834
+ value: meta.value,
2835
+ children: tab.type === "community" ? /* @__PURE__ */ jsxs(Fragment, { children: [
2836
+ /* @__PURE__ */ jsx(
2837
+ SearchInput,
2838
+ {
2839
+ classNames: {
2840
+ root: cn("oui-mx-3 oui-mb-4 oui-mt-5", "oui-mb-2")
2841
+ }
2842
+ }
2843
+ ),
2844
+ /* @__PURE__ */ jsx(
2845
+ CommunityBrokerTabs,
2846
+ {
2847
+ storageKey: "orderly_mobile_markets_datalist_community_sel_sub_tab",
2848
+ size: "md",
2849
+ classNames: {
2850
+ tabsList: "oui-px-3 oui-pt-1 oui-pb-2",
2851
+ tabsContent: "oui-h-full",
2852
+ scrollIndicator: "oui-mx-3"
2853
+ },
2854
+ className: "oui-mobileMarketsDataList-community-tabs",
2855
+ showScrollIndicator: true,
2856
+ renderPanel: renderCommunityList
2857
+ }
2858
+ )
2859
+ ] }) : renderTab(meta.tabName)
2860
+ },
2861
+ key
2862
+ );
2863
+ }
2864
+ return /* @__PURE__ */ jsxs(
2707
2865
  TabPanel,
2708
2866
  {
2709
- title: t("markets.newListings"),
2710
- icon: /* @__PURE__ */ jsx(NewListingsIcon, {}),
2711
- value: "new",
2712
- children: renderTab("newListing" /* NewListing */)
2713
- }
2714
- )
2715
- ]
2867
+ title: composeTabTitle(tab.name ?? key, {
2868
+ icon: resolveTabTriggerIcon(tab),
2869
+ suffix: tab.suffix
2870
+ }),
2871
+ value: key,
2872
+ children: [
2873
+ /* @__PURE__ */ jsx(
2874
+ SearchInput,
2875
+ {
2876
+ classNames: {
2877
+ root: cn("oui-mx-3 oui-mb-4 oui-mt-5", "oui-mb-2")
2878
+ }
2879
+ }
2880
+ ),
2881
+ /* @__PURE__ */ jsx(
2882
+ MarketsListWidget,
2883
+ {
2884
+ type: "all" /* All */,
2885
+ dataFilter: (data) => tabDataFilters[key]?.(data) ?? data,
2886
+ initialSort: tabSort[key],
2887
+ onSort: onTabSort(key),
2888
+ getColumns,
2889
+ rowClassName: "!oui-h-[34px]"
2890
+ }
2891
+ )
2892
+ ]
2893
+ },
2894
+ key
2895
+ );
2896
+ })
2716
2897
  }
2717
2898
  ) });
2718
2899
  };
@@ -2837,26 +3018,6 @@ var init_column3 = __esm({
2837
3018
  return /* @__PURE__ */ jsx(Text.numeral, { dp: record.quote_dp || 2, currency: "$", children: value });
2838
3019
  }
2839
3020
  },
2840
- {
2841
- title: t("markets.column.mark"),
2842
- dataIndex: "mark_price",
2843
- width: 100,
2844
- align: "right",
2845
- onSort: true,
2846
- render: (value, record) => {
2847
- return /* @__PURE__ */ jsx(Text.numeral, { dp: record.quote_dp || 2, currency: "$", children: value });
2848
- }
2849
- },
2850
- {
2851
- title: t("markets.column.index"),
2852
- dataIndex: "index_price",
2853
- width: 100,
2854
- align: "right",
2855
- onSort: true,
2856
- render: (value, record) => {
2857
- return /* @__PURE__ */ jsx(Text.numeral, { dp: record.quote_dp || 2, currency: "$", children: value });
2858
- }
2859
- },
2860
3021
  {
2861
3022
  title: t("markets.column.24hChange"),
2862
3023
  dataIndex: "change",
@@ -3147,7 +3308,7 @@ var init_marketsListFull_script = __esm({
3147
3308
  rwa: MarketsType.RWA
3148
3309
  };
3149
3310
  useMarketsListFullScript = (options) => {
3150
- const { type = "all" } = options;
3311
+ const { type = "all", dataFilter } = options;
3151
3312
  const [loading, setLoading] = useState(true);
3152
3313
  const { setPage, pagination } = usePagination({
3153
3314
  pageSize: 100
@@ -3156,9 +3317,10 @@ var init_marketsListFull_script = __esm({
3156
3317
  const { searchValue } = useMarketsContext();
3157
3318
  const { onSort, getSortedList, sort } = useSort(options.initialSort);
3158
3319
  const dataSource = useMemo(() => {
3159
- const searchList = searchBySymbol(data, searchValue, "base-type");
3320
+ const filtered = typeof dataFilter === "function" ? dataFilter(data) : data;
3321
+ const searchList = searchBySymbol(filtered, searchValue, "base-type");
3160
3322
  return getSortedList(searchList);
3161
- }, [data, getSortedList, searchValue]);
3323
+ }, [data, dataFilter, getSortedList, searchValue]);
3162
3324
  useEffect(() => {
3163
3325
  setLoading(false);
3164
3326
  }, [data]);
@@ -3214,11 +3376,15 @@ var init_marketsListFull = __esm({
3214
3376
  init_marketsListFull_widget();
3215
3377
  }
3216
3378
  });
3217
- var LazySearchInput, LazyFavoritesListFullWidget, LazyMarketsListFullWidget, MarketsDataList;
3379
+ var LazySearchInput, LazyFavoritesListFullWidget, LazyMarketsListFullWidget, DEFAULT_SORT, MarketsDataList;
3218
3380
  var init_marketsDataList_ui = __esm({
3219
3381
  "src/pages/home/marketsDataList/marketsDataList.ui.tsx"() {
3382
+ init_communityBrokerTabs();
3220
3383
  init_favoritesEmpty();
3384
+ init_marketsProvider();
3221
3385
  init_rwaTab();
3386
+ init_tabUtils();
3387
+ init_useCommunityTabs();
3222
3388
  init_icons();
3223
3389
  init_type();
3224
3390
  LazySearchInput = React6.lazy(
@@ -3236,10 +3402,53 @@ var init_marketsDataList_ui = __esm({
3236
3402
  return { default: mod.MarketsListFullWidget };
3237
3403
  })
3238
3404
  );
3405
+ DEFAULT_SORT = { sortKey: "24h_amount", sortOrder: "desc" };
3239
3406
  MarketsDataList = (props) => {
3240
3407
  const { searchValue, activeTab, onTabChange } = props;
3241
3408
  const { t } = useTranslation();
3242
- return /* @__PURE__ */ jsx(Box, { id: "oui-markets-list", intensity: 900, p: 6, r: "2xl", children: /* @__PURE__ */ jsxs(
3409
+ const { tabs } = useMarketsContext();
3410
+ const tabDataFilters = useCustomTabDataFilters(tabs);
3411
+ const builtInMeta = useMemo(
3412
+ () => ({
3413
+ favorites: {
3414
+ title: /* @__PURE__ */ jsx(FavoritesIcon, {}),
3415
+ value: "favorites",
3416
+ testid: "oui-testid-markets-favorites-tab",
3417
+ initialSort: DEFAULT_SORT
3418
+ },
3419
+ community: {
3420
+ title: t("markets.community"),
3421
+ value: "community",
3422
+ testid: "oui-testid-markets-community-tab",
3423
+ initialSort: DEFAULT_SORT
3424
+ },
3425
+ all: {
3426
+ title: t("markets.allMarkets"),
3427
+ icon: /* @__PURE__ */ jsx(AllMarketsIcon, {}),
3428
+ value: "all",
3429
+ testid: "oui-testid-markets-all-tab",
3430
+ listType: "all",
3431
+ initialSort: DEFAULT_SORT
3432
+ },
3433
+ rwa: {
3434
+ title: /* @__PURE__ */ jsx(RwaIconTab, {}),
3435
+ value: "rwa",
3436
+ testid: "oui-testid-markets-rwa-tab",
3437
+ listType: "rwa",
3438
+ initialSort: DEFAULT_SORT
3439
+ },
3440
+ newListing: {
3441
+ title: t("markets.newListings"),
3442
+ icon: /* @__PURE__ */ jsx(NewListingsIcon, {}),
3443
+ value: "new",
3444
+ testid: "oui-testid-markets-newListing-tab",
3445
+ listType: "new",
3446
+ initialSort: { sortKey: "created_time", sortOrder: "desc" }
3447
+ }
3448
+ }),
3449
+ [t]
3450
+ );
3451
+ return /* @__PURE__ */ jsx(Box, { id: "oui-markets-list", intensity: 900, p: 6, r: "2xl", children: /* @__PURE__ */ jsx(
3243
3452
  Tabs,
3244
3453
  {
3245
3454
  variant: "contained",
@@ -3249,93 +3458,98 @@ var init_marketsDataList_ui = __esm({
3249
3458
  trailing: /* @__PURE__ */ jsx(React6.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazySearchInput, { classNames: { root: "oui-my-1 oui-w-[240px]" } }) }),
3250
3459
  classNames: {
3251
3460
  tabsList: "oui-tabs-markets-list",
3252
- tabsContent: "oui-tabs-markets-content"
3461
+ tabsContent: "oui-tabs-markets-content",
3462
+ scrollIndicator: "oui-mr-3"
3253
3463
  },
3254
3464
  className: "oui-markets-list-tabs",
3255
- children: [
3256
- /* @__PURE__ */ jsx(
3257
- TabPanel,
3258
- {
3259
- classNames: {
3260
- trigger: "oui-tabs-favorites-trigger",
3261
- content: "oui-tabs-favorites-content"
3262
- },
3263
- title: /* @__PURE__ */ jsx(FavoritesIcon, {}),
3264
- value: "favorites",
3265
- testid: "oui-testid-markets-favorites-tab",
3266
- children: /* @__PURE__ */ jsx(React6.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
3267
- LazyFavoritesListFullWidget,
3268
- {
3269
- emptyView: !searchValue && /* @__PURE__ */ jsx(
3270
- FavoritesEmpty,
3271
- {
3272
- onClick: () => onTabChange("all" /* All */)
3273
- }
3274
- )
3275
- }
3276
- ) })
3277
- }
3278
- ),
3279
- /* @__PURE__ */ jsx(
3280
- TabPanel,
3281
- {
3282
- classNames: {
3283
- trigger: "oui-tabs-all-trigger",
3284
- content: "oui-tabs-all-content"
3285
- },
3286
- title: t("markets.allMarkets"),
3287
- icon: /* @__PURE__ */ jsx(AllMarketsIcon, {}),
3288
- value: "all",
3289
- testid: "oui-testid-markets-all-tab",
3290
- children: /* @__PURE__ */ jsx(React6.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
3291
- LazyMarketsListFullWidget,
3292
- {
3293
- type: "all",
3294
- initialSort: { sortKey: "24h_amount", sortOrder: "desc" }
3295
- }
3296
- ) })
3297
- }
3298
- ),
3299
- /* @__PURE__ */ jsx(
3300
- TabPanel,
3301
- {
3302
- classNames: {
3303
- trigger: "oui-tabs-rwa-trigger",
3304
- content: "oui-tabs-rwa-content"
3465
+ showScrollIndicator: true,
3466
+ children: tabs?.map((tab, index) => {
3467
+ const key = tabKey(tab, index);
3468
+ const isBuiltIn = isBuiltInMarketTab(tab);
3469
+ const meta = isBuiltIn ? builtInMeta[tab.type] : void 0;
3470
+ if (isBuiltIn && meta) {
3471
+ const title = tab.type === "favorites" ? composeTabTitle(tab.name, {
3472
+ icon: resolveTabTriggerIcon(tab, /* @__PURE__ */ jsx(FavoritesIcon, {})),
3473
+ suffix: tab.suffix
3474
+ }) : tab.type === "rwa" ? resolveTabTitle(tab, {}, /* @__PURE__ */ jsx(RwaIconTab, {})) : composeTabTitle(tab.name ?? meta.title, {
3475
+ suffix: tab.suffix
3476
+ });
3477
+ return /* @__PURE__ */ jsx(
3478
+ TabPanel,
3479
+ {
3480
+ classNames: {
3481
+ trigger: `oui-tabs-${meta.value}-trigger`,
3482
+ content: `oui-tabs-${meta.value}-content`
3483
+ },
3484
+ title,
3485
+ icon: tab.type === "favorites" || tab.type === "rwa" ? void 0 : resolveTabTriggerIcon(tab, meta.icon),
3486
+ value: meta.value,
3487
+ testid: meta.testid,
3488
+ children: /* @__PURE__ */ jsx(React6.Suspense, { fallback: null, children: tab.type === "favorites" ? /* @__PURE__ */ jsx(
3489
+ LazyFavoritesListFullWidget,
3490
+ {
3491
+ emptyView: !searchValue && /* @__PURE__ */ jsx(
3492
+ FavoritesEmpty,
3493
+ {
3494
+ onClick: () => onTabChange("all" /* All */)
3495
+ }
3496
+ )
3497
+ }
3498
+ ) : tab.type === "community" ? /* @__PURE__ */ jsx(
3499
+ CommunityBrokerTabs,
3500
+ {
3501
+ storageKey: "orderly_markets_datalist_community_sel_sub_tab",
3502
+ size: "md",
3503
+ classNames: {
3504
+ tabsList: "oui-px-3 oui-pt-1 oui-pb-2",
3505
+ tabsContent: "oui-h-full"
3506
+ },
3507
+ className: "oui-marketsDataList-community-tabs",
3508
+ showScrollIndicator: true,
3509
+ renderPanel: (selected) => /* @__PURE__ */ jsx(React6.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
3510
+ LazyMarketsListFullWidget,
3511
+ {
3512
+ type: "all",
3513
+ initialSort: meta.initialSort,
3514
+ dataFilter: createCommunityBrokerFilter(selected)
3515
+ }
3516
+ ) })
3517
+ }
3518
+ ) : /* @__PURE__ */ jsx(
3519
+ LazyMarketsListFullWidget,
3520
+ {
3521
+ type: meta.listType,
3522
+ initialSort: meta.initialSort
3523
+ }
3524
+ ) })
3305
3525
  },
3306
- title: /* @__PURE__ */ jsx(RwaIconTab, {}),
3307
- value: "rwa",
3308
- testid: "oui-testid-markets-rwa-tab",
3309
- children: /* @__PURE__ */ jsx(React6.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
3310
- LazyMarketsListFullWidget,
3311
- {
3312
- type: "rwa",
3313
- initialSort: { sortKey: "24h_amount", sortOrder: "desc" }
3314
- }
3315
- ) })
3316
- }
3317
- ),
3318
- /* @__PURE__ */ jsx(
3526
+ key
3527
+ );
3528
+ }
3529
+ return /* @__PURE__ */ jsx(
3319
3530
  TabPanel,
3320
3531
  {
3321
3532
  classNames: {
3322
- trigger: "oui-tabs-newListings-trigger",
3323
- content: "oui-tabs-newListings-content"
3533
+ trigger: `oui-tabs-${key}-trigger`,
3534
+ content: `oui-tabs-${key}-content`
3324
3535
  },
3325
- title: t("markets.newListings"),
3326
- icon: /* @__PURE__ */ jsx(NewListingsIcon, {}),
3327
- value: "new",
3328
- testid: "oui-testid-markets-newListings-tab",
3536
+ title: composeTabTitle(tab.name ?? key, {
3537
+ icon: resolveTabTriggerIcon(tab),
3538
+ suffix: tab.suffix
3539
+ }),
3540
+ value: key,
3329
3541
  children: /* @__PURE__ */ jsx(React6.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
3330
3542
  LazyMarketsListFullWidget,
3331
3543
  {
3332
- type: "new",
3333
- initialSort: { sortKey: "created_time", sortOrder: "desc" }
3544
+ type: "all",
3545
+ initialSort: DEFAULT_SORT,
3546
+ dataFilter: tabDataFilters[key]
3334
3547
  }
3335
3548
  ) })
3336
- }
3337
- )
3338
- ]
3549
+ },
3550
+ key
3551
+ );
3552
+ })
3339
3553
  }
3340
3554
  ) });
3341
3555
  };
@@ -3372,10 +3586,13 @@ var init_marketsDataList = __esm({
3372
3586
  var LazySearchInput2, LazyMarketsListWidget, cls, ExpandMarkets;
3373
3587
  var init_expandMarkets_ui = __esm({
3374
3588
  "src/components/expandMarkets/expandMarkets.ui.tsx"() {
3375
- init_icons();
3589
+ init_useCommunityTabs();
3376
3590
  init_type();
3591
+ init_communityBrokerTabs();
3592
+ init_marketsProvider();
3377
3593
  init_rwaTab();
3378
3594
  init_useFavoritesExtraProps();
3595
+ init_tabUtils();
3379
3596
  LazySearchInput2 = React6.lazy(
3380
3597
  () => Promise.resolve().then(() => (init_searchInput(), searchInput_exports)).then((mod) => {
3381
3598
  return { default: mod.SearchInput };
@@ -3386,28 +3603,31 @@ var init_expandMarkets_ui = __esm({
3386
3603
  return { default: mod.MarketsListWidget };
3387
3604
  })
3388
3605
  );
3389
- cls = "oui-h-[calc(100%_-_36px)]";
3606
+ cls = "oui-h-full";
3390
3607
  ExpandMarkets = (props) => {
3391
3608
  const { activeTab, onTabChange, tabSort, onTabSort } = props;
3392
- const { t } = useTranslation();
3393
3609
  const { getFavoritesProps, renderEmptyView } = useFavoritesProps();
3394
- const renderTab = (type) => {
3610
+ const builtInTitles = useBuiltInTitles();
3611
+ const { tabs } = useMarketsContext();
3612
+ const tabDataFilters = useCustomTabDataFilters(tabs);
3613
+ const renderBuiltInContent = (type) => {
3614
+ const tabType = type;
3395
3615
  return /* @__PURE__ */ jsx("div", { className: cls, children: /* @__PURE__ */ jsx(React6.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
3396
3616
  LazyMarketsListWidget,
3397
3617
  {
3398
- type,
3618
+ type: tabType,
3399
3619
  initialSort: tabSort[type],
3400
- onSort: onTabSort(type),
3620
+ onSort: onTabSort(tabType),
3401
3621
  tableClassNames: {
3402
3622
  root: "oui-expandMarkets-list",
3403
3623
  scroll: cn(
3404
3624
  "oui-px-1",
3405
- type === "favorites" /* Favorites */ ? "oui-pb-9" : "oui-pb-2"
3625
+ tabType === "favorites" /* Favorites */ ? "oui-pb-9" : "oui-pb-2"
3406
3626
  )
3407
3627
  },
3408
- ...getFavoritesProps(type),
3628
+ ...getFavoritesProps(tabType),
3409
3629
  emptyView: renderEmptyView({
3410
- type,
3630
+ type: tabType,
3411
3631
  onClick: () => {
3412
3632
  onTabChange("all" /* All */);
3413
3633
  }
@@ -3415,6 +3635,48 @@ var init_expandMarkets_ui = __esm({
3415
3635
  }
3416
3636
  ) }) });
3417
3637
  };
3638
+ const renderCommunityContent = () => {
3639
+ return /* @__PURE__ */ jsx(
3640
+ CommunityBrokerTabs,
3641
+ {
3642
+ storageKey: "orderly_expand_markets_community_sel_sub_tab",
3643
+ classNames: {
3644
+ tabsList: "oui-px-3 oui-pt-1 oui-pb-2",
3645
+ tabsContent: "oui-h-full"
3646
+ },
3647
+ className: cn("oui-expandMarkets-community-tabs", cls),
3648
+ showScrollIndicator: true,
3649
+ renderPanel: (selected) => /* @__PURE__ */ jsx("div", { className: cls, children: /* @__PURE__ */ jsx(React6.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
3650
+ LazyMarketsListWidget,
3651
+ {
3652
+ type: "all" /* All */,
3653
+ initialSort: tabSort["community" /* Community */],
3654
+ onSort: onTabSort("community" /* Community */),
3655
+ tableClassNames: {
3656
+ root: "oui-expandMarkets-list",
3657
+ scroll: cn("oui-px-1", "oui-pb-2")
3658
+ },
3659
+ dataFilter: createCommunityBrokerFilter(selected)
3660
+ }
3661
+ ) }) })
3662
+ }
3663
+ );
3664
+ };
3665
+ const renderCustomContent = (key) => {
3666
+ return /* @__PURE__ */ jsx("div", { className: cls, children: /* @__PURE__ */ jsx(React6.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
3667
+ LazyMarketsListWidget,
3668
+ {
3669
+ type: "all" /* All */,
3670
+ dataFilter: (data) => tabDataFilters[key]?.(data) ?? data,
3671
+ initialSort: tabSort[key],
3672
+ onSort: onTabSort(key),
3673
+ tableClassNames: {
3674
+ root: "oui-expandMarkets-list",
3675
+ scroll: cn("oui-px-1", "oui-pb-2")
3676
+ }
3677
+ }
3678
+ ) }) });
3679
+ };
3418
3680
  return /* @__PURE__ */ jsxs(
3419
3681
  Box,
3420
3682
  {
@@ -3430,7 +3692,7 @@ var init_expandMarkets_ui = __esm({
3430
3692
  classNames: { root: "oui-expandMarkets-search-input" }
3431
3693
  }
3432
3694
  ) }) }),
3433
- /* @__PURE__ */ jsxs(
3695
+ /* @__PURE__ */ jsx(
3434
3696
  Tabs,
3435
3697
  {
3436
3698
  variant: "contained",
@@ -3444,68 +3706,24 @@ var init_expandMarkets_ui = __esm({
3444
3706
  },
3445
3707
  className: cn("oui-expandMarkets-tabs", cls),
3446
3708
  showScrollIndicator: true,
3447
- children: [
3448
- /* @__PURE__ */ jsx(
3449
- TabPanel,
3450
- {
3451
- classNames: {
3452
- trigger: "oui-tabs-favorites-trigger",
3453
- content: "oui-tabs-favorites-content"
3454
- },
3455
- title: /* @__PURE__ */ jsx(FavoritesIcon, {}),
3456
- value: "favorites" /* Favorites */,
3457
- children: renderTab("favorites" /* Favorites */)
3458
- }
3459
- ),
3460
- /* @__PURE__ */ jsx(
3461
- TabPanel,
3462
- {
3463
- classNames: {
3464
- trigger: "oui-tabs-all-trigger",
3465
- content: "oui-tabs-all-content"
3466
- },
3467
- title: t("common.all"),
3468
- value: "all" /* All */,
3469
- children: renderTab("all" /* All */)
3470
- }
3471
- ),
3472
- /* @__PURE__ */ jsx(
3473
- TabPanel,
3474
- {
3475
- classNames: {
3476
- trigger: "oui-tabs-rwa-trigger",
3477
- content: "oui-tabs-rwa-content"
3478
- },
3479
- title: /* @__PURE__ */ jsx(RwaTab, {}),
3480
- value: "rwa" /* Rwa */,
3481
- children: renderTab("rwa" /* Rwa */)
3482
- }
3483
- ),
3484
- /* @__PURE__ */ jsx(
3485
- TabPanel,
3486
- {
3487
- classNames: {
3488
- trigger: "oui-tabs-newListings-trigger",
3489
- content: "oui-tabs-newListings-content"
3490
- },
3491
- title: t("markets.newListings"),
3492
- value: "newListing" /* NewListing */,
3493
- children: renderTab("newListing" /* NewListing */)
3494
- }
3495
- ),
3496
- /* @__PURE__ */ jsx(
3709
+ children: tabs?.map((tab, index) => {
3710
+ const key = tabKey(tab, index);
3711
+ const isBuiltIn = isBuiltInMarketTab(tab);
3712
+ const isCommunity = isBuiltIn && tab.type === "community" /* Community */;
3713
+ return /* @__PURE__ */ jsx(
3497
3714
  TabPanel,
3498
3715
  {
3499
3716
  classNames: {
3500
- trigger: "oui-tabs-recent-trigger",
3501
- content: "oui-tabs-recent-content"
3717
+ trigger: `oui-tabs-${key}-trigger`,
3718
+ content: `oui-tabs-${key}-content`
3502
3719
  },
3503
- title: t("markets.recent"),
3504
- value: "recent" /* Recent */,
3505
- children: renderTab("recent" /* Recent */)
3506
- }
3507
- )
3508
- ]
3720
+ title: resolveTabTitle(tab, builtInTitles, /* @__PURE__ */ jsx(RwaTab, {})),
3721
+ value: key,
3722
+ children: isCommunity ? renderCommunityContent() : isBuiltIn ? renderBuiltInContent(tab.type) : renderCustomContent(key)
3723
+ },
3724
+ key
3725
+ );
3726
+ })
3509
3727
  }
3510
3728
  )
3511
3729
  ]
@@ -3562,10 +3780,94 @@ var init_expandMarkets_script = __esm({
3562
3780
  init_useTabSort();
3563
3781
  }
3564
3782
  });
3783
+
3784
+ // src/registry/builtInTabRegistry.ts
3785
+ var builtInTabs, componentDefaultTabs;
3786
+ var init_builtInTabRegistry = __esm({
3787
+ "src/registry/builtInTabRegistry.ts"() {
3788
+ builtInTabs = {
3789
+ favorites: { type: "favorites" },
3790
+ community: {
3791
+ type: "community",
3792
+ isVisible: (symbolList) => {
3793
+ return symbolList.some((m) => Boolean(m?.broker_id));
3794
+ }
3795
+ },
3796
+ all: { type: "all" },
3797
+ rwa: { type: "rwa" },
3798
+ newListing: { type: "newListing" },
3799
+ recent: { type: "recent" }
3800
+ };
3801
+ componentDefaultTabs = {
3802
+ marketsSheet: [
3803
+ { type: "favorites" },
3804
+ { type: "all" },
3805
+ { type: "rwa" },
3806
+ { ...builtInTabs.community }
3807
+ ],
3808
+ expandMarkets: [
3809
+ { type: "favorites" },
3810
+ { type: "all" },
3811
+ { type: "rwa" },
3812
+ { ...builtInTabs.community },
3813
+ { type: "newListing" },
3814
+ { type: "recent" }
3815
+ ],
3816
+ dropDownMarkets: [
3817
+ { type: "favorites" },
3818
+ { type: "all" },
3819
+ { type: "rwa" },
3820
+ { ...builtInTabs.community },
3821
+ { type: "newListing" },
3822
+ { type: "recent" }
3823
+ ],
3824
+ subMenuMarkets: [
3825
+ { type: "favorites" },
3826
+ { type: "all" },
3827
+ { type: "rwa" },
3828
+ { ...builtInTabs.community },
3829
+ { type: "newListing" },
3830
+ { type: "recent" }
3831
+ ],
3832
+ marketsDataList: [
3833
+ { type: "favorites" },
3834
+ { type: "all" },
3835
+ { type: "rwa" },
3836
+ { ...builtInTabs.community },
3837
+ { type: "newListing" }
3838
+ ],
3839
+ horizontalMarkets: [
3840
+ { type: "all" },
3841
+ { type: "recent" },
3842
+ { type: "newListing" },
3843
+ { type: "favorites" }
3844
+ ]
3845
+ };
3846
+ }
3847
+ });
3848
+ function useMarketCategories(componentKey) {
3849
+ const marketTabs = useMarketCategoriesConfig();
3850
+ const { i18n: i18n2 } = useTranslation();
3851
+ const symbolList = useMarketList();
3852
+ const rwaSymbolsInfo = useRwaSymbolsInfo();
3853
+ return useMemo(() => {
3854
+ const original = componentDefaultTabs[componentKey];
3855
+ const resolved = marketTabs ? marketTabs(original, { componentKey, builtIn: builtInTabs }) : original;
3856
+ return resolved.filter(
3857
+ (tab) => tab.isVisible?.(symbolList, { rwaSymbolsInfo }) ?? true
3858
+ );
3859
+ }, [marketTabs, componentKey, i18n2.language, symbolList, rwaSymbolsInfo]);
3860
+ }
3861
+ var init_useMarketCategories = __esm({
3862
+ "src/components/shared/hooks/useMarketCategories.ts"() {
3863
+ init_builtInTabRegistry();
3864
+ }
3865
+ });
3565
3866
  var ExpandMarketsWidget;
3566
3867
  var init_expandMarkets_widget = __esm({
3567
3868
  "src/components/expandMarkets/expandMarkets.widget.tsx"() {
3568
3869
  init_marketsProvider();
3870
+ init_useMarketCategories();
3569
3871
  init_expandMarkets_script();
3570
3872
  init_expandMarkets_ui();
3571
3873
  ExpandMarketsWidget = (props) => {
@@ -3573,11 +3875,13 @@ var init_expandMarkets_widget = __esm({
3573
3875
  activeTab: props.activeTab,
3574
3876
  onTabChange: props.onTabChange
3575
3877
  });
3878
+ const tabs = useMarketCategories("expandMarkets");
3576
3879
  return /* @__PURE__ */ jsx(
3577
3880
  MarketsProvider,
3578
3881
  {
3579
3882
  symbol: props.symbol,
3580
3883
  onSymbolChange: props.onSymbolChange,
3884
+ tabs,
3581
3885
  children: /* @__PURE__ */ jsx(ExpandMarkets, { ...state })
3582
3886
  }
3583
3887
  );
@@ -3622,7 +3926,7 @@ var init_columns = __esm({
3622
3926
  title: t("markets.column.market"),
3623
3927
  dataIndex: "symbol",
3624
3928
  onSort: true,
3625
- width: 135,
3929
+ width: 180,
3626
3930
  className: isMobile ? "oui-pl-0" : void 0,
3627
3931
  render: (value, record) => {
3628
3932
  if (isMobile) {
@@ -4012,7 +4316,7 @@ var init_columns2 = __esm({
4012
4316
  {
4013
4317
  title: t("markets.column.market"),
4014
4318
  dataIndex: "symbol",
4015
- width: 150,
4319
+ width: 220,
4016
4320
  onSort: true,
4017
4321
  className: isMobile ? "oui-pl-0" : void 0,
4018
4322
  render: (value, record) => {
@@ -4263,53 +4567,17 @@ var init_fundingComparison = __esm({
4263
4567
  // src/components/sideMarkets/sideMarkets.ui.tsx
4264
4568
  var sideMarkets_ui_exports = {};
4265
4569
  __export(sideMarkets_ui_exports, {
4266
- SideMarkets: () => SideMarkets,
4267
- SideMarketsHeader: () => SideMarketsHeader
4570
+ SideMarkets: () => SideMarkets
4268
4571
  });
4269
- var SideMarketsHeader, SideMarkets;
4572
+ var SideMarkets;
4270
4573
  var init_sideMarkets_ui = __esm({
4271
4574
  "src/components/sideMarkets/sideMarkets.ui.tsx"() {
4272
- init_icons();
4273
4575
  init_expandMarkets();
4274
4576
  init_marketsList();
4275
4577
  init_marketsProvider();
4276
4578
  init_useFavoritesExtraProps();
4277
- SideMarketsHeader = (props) => {
4278
- const { resizeable, panelSize, onPanelSizeChange } = props;
4279
- const { t } = useTranslation();
4280
- const cls3 = cn(
4281
- "oui-text-base-contrast-36",
4282
- resizeable ? "oui-cursor-pointer hover:oui-text-base-contrast-80" : "oui-cursor-not-allowed"
4283
- );
4284
- return /* @__PURE__ */ jsxs(
4285
- Flex,
4286
- {
4287
- className: panelSize === "small" ? "oui-absolute oui-end-[-20px] oui-z-50" : "oui-relative",
4288
- justify: panelSize === "large" ? "between" : "center",
4289
- width: "100%",
4290
- px: 3,
4291
- children: [
4292
- panelSize === "large" && /* @__PURE__ */ jsx(Text, { size: "base", intensity: 80, children: t("common.markets") }),
4293
- panelSize === "large" && /* @__PURE__ */ jsx(
4294
- "div",
4295
- {
4296
- onClick: resizeable ? () => onPanelSizeChange?.("middle") : void 0,
4297
- children: /* @__PURE__ */ jsx(CollapseIcon, { className: cls3 })
4298
- }
4299
- ),
4300
- (panelSize === "middle" || panelSize === "small") && /* @__PURE__ */ jsx(
4301
- "div",
4302
- {
4303
- onClick: resizeable ? () => onPanelSizeChange?.("large") : void 0,
4304
- children: /* @__PURE__ */ jsx(ExpandIcon, { className: cls3 })
4305
- }
4306
- )
4307
- ]
4308
- }
4309
- );
4310
- };
4311
4579
  SideMarkets = (props) => {
4312
- const { panelSize, activeTab, onTabChange, className, tabSort } = props;
4580
+ const { activeTab, onTabChange, className, tabSort, panelSize } = props;
4313
4581
  const { symbol, onSymbolChange } = useMarketsContext();
4314
4582
  const { getFavoritesProps } = useFavoritesProps();
4315
4583
  const renderContent = () => {
@@ -4334,34 +4602,12 @@ var init_sideMarkets_ui = __esm({
4334
4602
  }
4335
4603
  );
4336
4604
  };
4337
- return /* @__PURE__ */ jsxs(
4338
- Flex,
4605
+ return /* @__PURE__ */ jsx(
4606
+ Box,
4339
4607
  {
4340
- id: "oui-side-markets",
4341
- className: cn("oui-relative oui-font-semibold", className),
4342
- direction: "column",
4343
- gapY: 5,
4344
- height: "100%",
4345
4608
  width: "100%",
4346
- children: [
4347
- /* @__PURE__ */ jsx(
4348
- SideMarketsHeader,
4349
- {
4350
- ...pick(["resizeable", "panelSize", "onPanelSizeChange"], props)
4351
- }
4352
- ),
4353
- /* @__PURE__ */ jsx(
4354
- Box,
4355
- {
4356
- width: "100%",
4357
- className: cn(
4358
- panelSize === "large" && "oui-h-[calc(100%_-_56px)]",
4359
- panelSize === "middle" && "oui-h-[calc(100%_-_52px)]"
4360
- ),
4361
- children: renderContent()
4362
- }
4363
- )
4364
- ]
4609
+ height: "100%",
4610
+ children: renderContent()
4365
4611
  }
4366
4612
  );
4367
4613
  };
@@ -4371,7 +4617,7 @@ var useDropDownMarketsColumns;
4371
4617
  var init_column4 = __esm({
4372
4618
  "src/components/dropDownMarkets/column.tsx"() {
4373
4619
  init_icons();
4374
- init_column2();
4620
+ init_column();
4375
4621
  useDropDownMarketsColumns = () => {
4376
4622
  const { t } = useTranslation();
4377
4623
  return useCallback(
@@ -4466,12 +4712,15 @@ var init_column4 = __esm({
4466
4712
  var DropDownMarkets, DropDownMarketsConetnt;
4467
4713
  var init_dropDownMarkets_ui = __esm({
4468
4714
  "src/components/dropDownMarkets/dropDownMarkets.ui.tsx"() {
4469
- init_icons();
4715
+ init_useCommunityTabs();
4470
4716
  init_type();
4717
+ init_communityBrokerTabs();
4471
4718
  init_marketsList();
4719
+ init_marketsProvider();
4472
4720
  init_rwaTab();
4473
4721
  init_searchInput();
4474
4722
  init_useFavoritesExtraProps();
4723
+ init_tabUtils();
4475
4724
  init_column4();
4476
4725
  DropDownMarkets = (props) => {
4477
4726
  return /* @__PURE__ */ jsxs(DropdownMenuRoot, { open: props.open, onOpenChange: props.onOpenChange, children: [
@@ -4495,8 +4744,8 @@ var init_dropDownMarkets_ui = __esm({
4495
4744
  };
4496
4745
  DropDownMarketsConetnt = (props) => {
4497
4746
  const { activeTab, onTabChange, tabSort, onTabSort } = props;
4498
- const { t } = useTranslation();
4499
4747
  const getColumns = useDropDownMarketsColumns();
4748
+ const builtInTitles = useBuiltInTitles();
4500
4749
  const search = /* @__PURE__ */ jsxs(Flex, { className: "oui-dropDownMarkets-search", mx: 3, gapX: 3, pt: 3, pb: 2, children: [
4501
4750
  /* @__PURE__ */ jsx(
4502
4751
  SearchInput,
@@ -4518,22 +4767,24 @@ var init_dropDownMarkets_ui = __esm({
4518
4767
  ] });
4519
4768
  const cls3 = "oui-h-[calc(100%_-_36px)]";
4520
4769
  const { getFavoritesProps, renderEmptyView } = useFavoritesProps();
4521
- const renderTab = (type) => {
4770
+ const { tabs } = useMarketsContext();
4771
+ const tabDataFilters = useCustomTabDataFilters(tabs);
4772
+ const renderBuiltInContent = (tabType) => {
4522
4773
  return /* @__PURE__ */ jsx("div", { className: cls3, children: /* @__PURE__ */ jsx(
4523
4774
  MarketsListWidget,
4524
4775
  {
4525
- type,
4526
- initialSort: tabSort[type],
4527
- onSort: onTabSort(type),
4776
+ type: tabType,
4777
+ initialSort: tabSort[tabType],
4778
+ onSort: onTabSort(tabType),
4528
4779
  getColumns,
4529
4780
  tableClassNames: {
4530
4781
  root: cn("oui-dropDownMarkets-list", "!oui-bg-base-8"),
4531
4782
  scroll: "oui-pb-5 oui-px-1"
4532
4783
  },
4533
4784
  rowClassName: "!oui-h-[34px]",
4534
- ...getFavoritesProps(type),
4785
+ ...getFavoritesProps(tabType),
4535
4786
  emptyView: renderEmptyView({
4536
- type,
4787
+ type: tabType,
4537
4788
  onClick: () => {
4538
4789
  onTabChange("all" /* All */);
4539
4790
  }
@@ -4541,6 +4792,52 @@ var init_dropDownMarkets_ui = __esm({
4541
4792
  }
4542
4793
  ) });
4543
4794
  };
4795
+ const renderCommunityContent = () => {
4796
+ return /* @__PURE__ */ jsx(
4797
+ CommunityBrokerTabs,
4798
+ {
4799
+ storageKey: "orderly_dropdown_markets_community_sel_sub_tab",
4800
+ classNames: {
4801
+ tabsList: "oui-px-3 oui-pt-1 oui-pb-2",
4802
+ tabsContent: "oui-h-full"
4803
+ },
4804
+ className: cn("oui-dropDownMarkets-community-tabs", cls3),
4805
+ showScrollIndicator: true,
4806
+ renderPanel: (selected) => /* @__PURE__ */ jsx("div", { className: cls3, children: /* @__PURE__ */ jsx(
4807
+ MarketsListWidget,
4808
+ {
4809
+ type: "all" /* All */,
4810
+ initialSort: tabSort["community" /* Community */],
4811
+ onSort: onTabSort("community" /* Community */),
4812
+ getColumns,
4813
+ tableClassNames: {
4814
+ root: cn("oui-dropDownMarkets-list", "!oui-bg-base-8"),
4815
+ scroll: "oui-pb-5 oui-px-1"
4816
+ },
4817
+ rowClassName: "!oui-h-[34px]",
4818
+ dataFilter: createCommunityBrokerFilter(selected)
4819
+ }
4820
+ ) })
4821
+ }
4822
+ );
4823
+ };
4824
+ const renderCustomContent = (key) => {
4825
+ return /* @__PURE__ */ jsx("div", { className: cls3, children: /* @__PURE__ */ jsx(
4826
+ MarketsListWidget,
4827
+ {
4828
+ type: "all" /* All */,
4829
+ dataFilter: (data) => tabDataFilters[key]?.(data) ?? data,
4830
+ initialSort: tabSort[key],
4831
+ onSort: onTabSort(key),
4832
+ getColumns,
4833
+ tableClassNames: {
4834
+ root: cn("oui-dropDownMarkets-list", "!oui-bg-base-8"),
4835
+ scroll: "oui-pb-5 oui-px-1"
4836
+ },
4837
+ rowClassName: "!oui-h-[34px]"
4838
+ }
4839
+ ) });
4840
+ };
4544
4841
  return /* @__PURE__ */ jsxs(
4545
4842
  Box,
4546
4843
  {
@@ -4552,7 +4849,7 @@ var init_dropDownMarkets_ui = __esm({
4552
4849
  intensity: 800,
4553
4850
  children: [
4554
4851
  search,
4555
- /* @__PURE__ */ jsxs(
4852
+ /* @__PURE__ */ jsx(
4556
4853
  Tabs,
4557
4854
  {
4558
4855
  variant: "contained",
@@ -4560,72 +4857,31 @@ var init_dropDownMarkets_ui = __esm({
4560
4857
  value: activeTab,
4561
4858
  onValueChange: onTabChange,
4562
4859
  classNames: {
4563
- tabsList: "oui-my-[6px] oui-px-3",
4564
- tabsContent: "oui-h-full"
4860
+ tabsListContainer: "oui-px-3",
4861
+ tabsList: "oui-my-[6px]",
4862
+ tabsContent: "oui-h-full",
4863
+ scrollIndicator: "oui-mx-0"
4565
4864
  },
4566
4865
  className: cn("oui-dropDownMarkets-tabs", cls3),
4567
- children: [
4568
- /* @__PURE__ */ jsx(
4569
- TabPanel,
4570
- {
4571
- classNames: {
4572
- trigger: "oui-tabs-favorites-trigger",
4573
- content: "oui-tabs-favorites-content"
4574
- },
4575
- title: /* @__PURE__ */ jsx(FavoritesIcon, {}),
4576
- value: "favorites" /* Favorites */,
4577
- children: renderTab("favorites" /* Favorites */)
4578
- }
4579
- ),
4580
- /* @__PURE__ */ jsx(
4581
- TabPanel,
4582
- {
4583
- classNames: {
4584
- trigger: "oui-tabs-all-trigger",
4585
- content: "oui-tabs-all-content"
4586
- },
4587
- title: t("common.all"),
4588
- value: "all" /* All */,
4589
- children: renderTab("all" /* All */)
4590
- }
4591
- ),
4592
- /* @__PURE__ */ jsx(
4593
- TabPanel,
4594
- {
4595
- classNames: {
4596
- trigger: "oui-tabs-rwa-trigger",
4597
- content: "oui-tabs-rwa-content"
4598
- },
4599
- title: /* @__PURE__ */ jsx(RwaTab, {}),
4600
- value: "rwa" /* Rwa */,
4601
- children: renderTab("rwa" /* Rwa */)
4602
- }
4603
- ),
4604
- /* @__PURE__ */ jsx(
4605
- TabPanel,
4606
- {
4607
- classNames: {
4608
- trigger: "oui-tabs-newListings-trigger",
4609
- content: "oui-tabs-newListings-content"
4610
- },
4611
- title: t("markets.newListings"),
4612
- value: "newListing" /* NewListing */,
4613
- children: renderTab("newListing" /* NewListing */)
4614
- }
4615
- ),
4616
- /* @__PURE__ */ jsx(
4866
+ showScrollIndicator: true,
4867
+ children: tabs?.map((tab, index) => {
4868
+ const key = tabKey(tab, index);
4869
+ const isBuiltIn = isBuiltInMarketTab(tab);
4870
+ const isCommunity = isBuiltIn && tab.type === "community" /* Community */;
4871
+ return /* @__PURE__ */ jsx(
4617
4872
  TabPanel,
4618
4873
  {
4619
4874
  classNames: {
4620
- trigger: "oui-tabs-recent-trigger",
4621
- content: "oui-tabs-recent-content"
4875
+ trigger: `oui-tabs-${key}-trigger`,
4876
+ content: `oui-tabs-${key}-content`
4622
4877
  },
4623
- title: t("markets.recent"),
4624
- value: "recent" /* Recent */,
4625
- children: renderTab("recent" /* Recent */)
4626
- }
4627
- )
4628
- ]
4878
+ title: resolveTabTitle(tab, builtInTitles, /* @__PURE__ */ jsx(RwaTab, {})),
4879
+ value: key,
4880
+ children: isCommunity ? renderCommunityContent() : isBuiltIn ? renderBuiltInContent(tab.type) : renderCustomContent(key)
4881
+ },
4882
+ key
4883
+ );
4884
+ })
4629
4885
  }
4630
4886
  )
4631
4887
  ]
@@ -4674,15 +4930,18 @@ var DropDownMarketsWidget;
4674
4930
  var init_dropDownMarkets_widget = __esm({
4675
4931
  "src/components/dropDownMarkets/dropDownMarkets.widget.tsx"() {
4676
4932
  init_marketsProvider();
4933
+ init_useMarketCategories();
4677
4934
  init_dropDownMarkets_script();
4678
4935
  init_dropDownMarkets_ui();
4679
4936
  DropDownMarketsWidget = (props) => {
4680
4937
  const state = useDropDownMarketsScript();
4938
+ const tabs = useMarketCategories("dropDownMarkets");
4681
4939
  return /* @__PURE__ */ jsx(
4682
4940
  MarketsProvider,
4683
4941
  {
4684
4942
  symbol: props.symbol,
4685
4943
  onSymbolChange: props.onSymbolChange,
4944
+ tabs,
4686
4945
  children: /* @__PURE__ */ jsx(DropDownMarkets, { ...state, contentClassName: props.contentClassName, children: props.children })
4687
4946
  }
4688
4947
  );
@@ -4823,26 +5082,47 @@ var init_marketItem_ui = __esm({
4823
5082
  MarketItem.displayName = "MarketItem";
4824
5083
  }
4825
5084
  });
4826
- var marketTypeBase, MarketTypeFilter;
5085
+ var MarketTypeFilter;
4827
5086
  var init_marketTypeFilter_ui = __esm({
4828
5087
  "src/components/horizontalMarkets/marketTypeFilter.ui.tsx"() {
4829
5088
  init_icons();
4830
- marketTypeBase = [
4831
- { value: "recent", label: "Recent", translationKey: "Recent" },
4832
- { value: "all", label: "All Markets", translationKey: "All" },
4833
- { value: "newListing", label: "New Listing", translationKey: "New listing" }
4834
- ];
5089
+ init_tabUtils();
4835
5090
  MarketTypeFilter = (props) => {
4836
5091
  const {
4837
5092
  selectedMarketType,
4838
5093
  onMarketTypeChange,
4839
5094
  className,
4840
- position = "bottom"
5095
+ position = "bottom",
5096
+ tabs
4841
5097
  } = props;
5098
+ const { t } = useTranslation();
5099
+ const orderedOptions = React6.useMemo(() => {
5100
+ if (!tabs) return [];
5101
+ return tabs.filter(
5102
+ (tab) => isCustomMarketTab(tab) || isBuiltInMarketTab(tab) && tab.type !== "favorites"
5103
+ );
5104
+ }, [tabs]);
5105
+ const hasFavoritesTab = React6.useMemo(() => {
5106
+ return tabs?.some(
5107
+ (tab) => isBuiltInMarketTab(tab) && tab.type === "favorites"
5108
+ );
5109
+ }, [tabs]);
4842
5110
  const [isOpen, setIsOpen] = useState(false);
4843
5111
  const dropdownRef = useRef(null);
4844
5112
  const [, favorite] = useMarkets(MarketsType.FAVORITES);
4845
5113
  const hasFavorites = (favorite?.favorites?.length || 0) > 0;
5114
+ const titleOverrides = React6.useMemo(
5115
+ () => ({
5116
+ all: t("markets.allMarkets"),
5117
+ newListing: t("markets.newListings"),
5118
+ recent: t("markets.recent")
5119
+ }),
5120
+ [t]
5121
+ );
5122
+ const getOptionLabel = useCallback(
5123
+ (tab) => resolveTabTitle(tab, titleOverrides, t("common.rwa")),
5124
+ [t, titleOverrides]
5125
+ );
4846
5126
  useEffect(() => {
4847
5127
  const handleClickOutside = (event) => {
4848
5128
  if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
@@ -4908,41 +5188,46 @@ var init_marketTypeFilter_ui = __esm({
4908
5188
  wrap: "wrap",
4909
5189
  gapY: 1,
4910
5190
  className: "oui-gap-x-2 md:oui-gap-x-3",
4911
- children: marketTypeBase.map((option) => /* @__PURE__ */ jsxs(
4912
- Flex,
4913
- {
4914
- className: cn("oui-cursor-pointer"),
4915
- itemAlign: "center",
4916
- onClick: () => handleOptionClick(option.value),
4917
- children: [
4918
- /* @__PURE__ */ jsx(
4919
- Checkbox,
4920
- {
4921
- "data-testid": `oui-testid-marketType-${option.value}-checkBox`,
4922
- id: `toggle_market_type_${option.value}`,
4923
- className: "oui-peer",
4924
- color: "white",
4925
- checked: selectedMarketType === option.value
4926
- }
4927
- ),
4928
- /* @__PURE__ */ jsx(
4929
- "label",
4930
- {
4931
- htmlFor: `toggle_market_type_${option.value}`,
4932
- className: cn(
4933
- "oui-text-2xs oui-ml-1",
4934
- "oui-break-normal oui-whitespace-nowrap oui-cursor-pointer"
4935
- ),
4936
- children: option.translationKey
4937
- }
4938
- )
4939
- ]
4940
- },
4941
- option.value
4942
- ))
5191
+ children: orderedOptions.map((tab) => {
5192
+ const optionValue = isCustomMarketTab(tab) ? tab.id : tab.type;
5193
+ const isActive = selectedMarketType === optionValue;
5194
+ const htmlId = `toggle_market_type_${optionValue}`;
5195
+ return /* @__PURE__ */ jsxs(
5196
+ Flex,
5197
+ {
5198
+ className: cn("oui-cursor-pointer"),
5199
+ itemAlign: "center",
5200
+ onClick: () => handleOptionClick(optionValue),
5201
+ children: [
5202
+ /* @__PURE__ */ jsx(
5203
+ Checkbox,
5204
+ {
5205
+ "data-testid": `oui-testid-marketType-${optionValue}-checkBox`,
5206
+ id: htmlId,
5207
+ className: "oui-peer",
5208
+ color: "white",
5209
+ checked: isActive
5210
+ }
5211
+ ),
5212
+ /* @__PURE__ */ jsx(
5213
+ "label",
5214
+ {
5215
+ htmlFor: htmlId,
5216
+ className: cn(
5217
+ "oui-text-2xs oui-ml-1",
5218
+ "oui-break-normal oui-whitespace-nowrap oui-cursor-pointer"
5219
+ ),
5220
+ children: getOptionLabel(tab)
5221
+ }
5222
+ )
5223
+ ]
5224
+ },
5225
+ optionValue
5226
+ );
5227
+ })
4943
5228
  }
4944
5229
  ),
4945
- hasFavorites && /* @__PURE__ */ jsxs(Fragment, { children: [
5230
+ hasFavoritesTab && hasFavorites && /* @__PURE__ */ jsxs(Fragment, { children: [
4946
5231
  /* @__PURE__ */ jsx(
4947
5232
  Divider,
4948
5233
  {
@@ -5021,6 +5306,7 @@ __export(horizontalMarkets_ui_exports, {
5021
5306
  var HorizontalMarkets;
5022
5307
  var init_horizontalMarkets_ui = __esm({
5023
5308
  "src/components/horizontalMarkets/horizontalMarkets.ui.tsx"() {
5309
+ init_marketsProvider();
5024
5310
  init_marketItem_ui();
5025
5311
  init_marketTypeFilter_ui();
5026
5312
  HorizontalMarkets = React6.memo((props) => {
@@ -5034,6 +5320,7 @@ var init_horizontalMarkets_ui = __esm({
5034
5320
  className,
5035
5321
  dropdownPos
5036
5322
  } = props;
5323
+ const { tabs } = useMarketsContext();
5037
5324
  const renderMarketItem = React6.useCallback(
5038
5325
  (symbol, index) => {
5039
5326
  const data = tickerData[symbol];
@@ -5092,7 +5379,8 @@ var init_horizontalMarkets_ui = __esm({
5092
5379
  {
5093
5380
  selectedMarketType,
5094
5381
  onMarketTypeChange,
5095
- position: dropdownPos
5382
+ position: dropdownPos,
5383
+ tabs
5096
5384
  }
5097
5385
  ),
5098
5386
  /* @__PURE__ */ jsx(
@@ -5309,12 +5597,15 @@ init_favoritesTabs();
5309
5597
  init_expandMarkets();
5310
5598
 
5311
5599
  // src/components/subMenuMarkets/subMenuMarkets.ui.tsx
5312
- init_icons();
5600
+ init_useCommunityTabs();
5313
5601
  init_type();
5602
+ init_communityBrokerTabs();
5314
5603
  init_favoritesTabs();
5315
5604
  init_marketsList();
5605
+ init_marketsProvider();
5316
5606
  init_rwaTab();
5317
5607
  init_useFavoritesExtraProps();
5608
+ init_tabUtils();
5318
5609
  init_symbolDisplay();
5319
5610
  var LIST_ROW_COMPACT = "oui-h-auto";
5320
5611
  var TABLE_CLASSNAMES = {
@@ -5351,8 +5642,10 @@ var MarketTabPanel = ({
5351
5642
  };
5352
5643
  var SubMenuMarkets = (props) => {
5353
5644
  const { activeTab, onTabChange, className, tabSort, onTabSort } = props;
5354
- const { t } = useTranslation();
5355
5645
  const { getFavoritesProps } = useFavoritesProps();
5646
+ const builtInTitles = useBuiltInTitles();
5647
+ const { tabs } = useMarketsContext();
5648
+ const tabDataFilters = useCustomTabDataFilters(tabs);
5356
5649
  const getColumns = (_favorite, _isFavoritesList) => {
5357
5650
  return [
5358
5651
  {
@@ -5370,7 +5663,72 @@ var SubMenuMarkets = (props) => {
5370
5663
  ] }) });
5371
5664
  }
5372
5665
  }
5373
- ];
5666
+ ];
5667
+ };
5668
+ const renderBuiltInContent = (tabType) => {
5669
+ if (tabType === "favorites" /* Favorites */) {
5670
+ const favProps = getFavoritesProps("favorites" /* Favorites */);
5671
+ return /* @__PURE__ */ jsx(
5672
+ MarketTabPanel,
5673
+ {
5674
+ type: "favorites" /* Favorites */,
5675
+ getColumns,
5676
+ dataFilter: favProps?.dataFilter,
5677
+ renderHeader: (favorite) => /* @__PURE__ */ jsx(Box, { className: "oui-px-1 oui-my-1", children: /* @__PURE__ */ jsx(FavoritesTabWidget, { favorite, size: "sm" }) }),
5678
+ initialSort: tabSort["favorites" /* Favorites */],
5679
+ onSort: onTabSort("favorites" /* Favorites */),
5680
+ emptyView: /* @__PURE__ */ jsx(EmptyDataState, {})
5681
+ }
5682
+ );
5683
+ }
5684
+ return /* @__PURE__ */ jsx(
5685
+ MarketTabPanel,
5686
+ {
5687
+ type: tabType,
5688
+ getColumns,
5689
+ initialSort: tabSort[tabType],
5690
+ onSort: onTabSort(tabType)
5691
+ }
5692
+ );
5693
+ };
5694
+ const renderCommunityContent = () => {
5695
+ return /* @__PURE__ */ jsx(
5696
+ CommunityBrokerTabs,
5697
+ {
5698
+ storageKey: "orderly_submenu_markets_community_sel_sub_tab",
5699
+ classNames: {
5700
+ tabsList: "oui-px-1 oui-pt-1 oui-pb-2",
5701
+ tabsContent: "oui-h-full",
5702
+ scrollIndicator: "oui-mx-1"
5703
+ },
5704
+ className: cn("oui-subMenuMarkets-community-tabs", cls2),
5705
+ showScrollIndicator: true,
5706
+ renderPanel: (selected) => /* @__PURE__ */ jsx(
5707
+ MarketTabPanel,
5708
+ {
5709
+ type: "all" /* All */,
5710
+ getColumns,
5711
+ dataFilter: createCommunityBrokerFilter(selected),
5712
+ initialSort: tabSort["community" /* Community */],
5713
+ onSort: onTabSort("community" /* Community */)
5714
+ }
5715
+ )
5716
+ }
5717
+ );
5718
+ };
5719
+ const renderCustomContent = (key) => {
5720
+ return /* @__PURE__ */ jsx("div", { className: cls2, children: /* @__PURE__ */ jsx(
5721
+ MarketsListWidget,
5722
+ {
5723
+ type: "all" /* All */,
5724
+ getColumns,
5725
+ tableClassNames: TABLE_CLASSNAMES,
5726
+ rowClassName: LIST_ROW_COMPACT,
5727
+ dataFilter: (data) => tabDataFilters[key]?.(data) ?? data,
5728
+ initialSort: tabSort[key],
5729
+ onSort: onTabSort(key)
5730
+ }
5731
+ ) });
5374
5732
  };
5375
5733
  return /* @__PURE__ */ jsxs(
5376
5734
  Box,
@@ -5382,7 +5740,7 @@ var SubMenuMarkets = (props) => {
5382
5740
  height: "100%",
5383
5741
  children: [
5384
5742
  /* @__PURE__ */ jsx(Box, { className: "oui-p-1", children: /* @__PURE__ */ jsx(React6.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazySearchInput3, {}) }) }),
5385
- /* @__PURE__ */ jsxs(
5743
+ /* @__PURE__ */ jsx(
5386
5744
  Tabs,
5387
5745
  {
5388
5746
  variant: "contained",
@@ -5396,114 +5754,24 @@ var SubMenuMarkets = (props) => {
5396
5754
  },
5397
5755
  className: cn(cls2, "oui-subMenuMarkets-tabs oui-my-1.5"),
5398
5756
  showScrollIndicator: true,
5399
- children: [
5400
- /* @__PURE__ */ jsx(
5401
- TabPanel,
5402
- {
5403
- classNames: {
5404
- trigger: "oui-tabs-favorites-trigger",
5405
- content: "oui-tabs-favorites-content"
5406
- },
5407
- title: /* @__PURE__ */ jsx(FavoritesIcon, {}),
5408
- value: "favorites" /* Favorites */,
5409
- children: (() => {
5410
- const favProps = getFavoritesProps("favorites" /* Favorites */);
5411
- return /* @__PURE__ */ jsx(
5412
- MarketTabPanel,
5413
- {
5414
- type: "favorites" /* Favorites */,
5415
- getColumns,
5416
- dataFilter: favProps?.dataFilter,
5417
- renderHeader: (favorite) => /* @__PURE__ */ jsx(Box, { className: "oui-px-1 oui-my-1", children: /* @__PURE__ */ jsx(FavoritesTabWidget, { favorite, size: "sm" }) }),
5418
- initialSort: tabSort["favorites" /* Favorites */],
5419
- onSort: onTabSort("favorites" /* Favorites */),
5420
- emptyView: /* @__PURE__ */ jsx(EmptyDataState, {})
5421
- }
5422
- );
5423
- })()
5424
- }
5425
- ),
5426
- /* @__PURE__ */ jsx(
5427
- TabPanel,
5428
- {
5429
- classNames: {
5430
- trigger: "oui-tabs-all-trigger",
5431
- content: "oui-tabs-all-content"
5432
- },
5433
- title: t("common.all"),
5434
- value: "all" /* All */,
5435
- children: /* @__PURE__ */ jsx(
5436
- MarketTabPanel,
5437
- {
5438
- type: "all" /* All */,
5439
- getColumns,
5440
- initialSort: tabSort["all" /* All */],
5441
- onSort: onTabSort("all" /* All */)
5442
- }
5443
- )
5444
- }
5445
- ),
5446
- /* @__PURE__ */ jsx(
5447
- TabPanel,
5448
- {
5449
- classNames: {
5450
- trigger: "oui-tabs-rwa-trigger",
5451
- content: "oui-tabs-rwa-content"
5452
- },
5453
- title: /* @__PURE__ */ jsx(RwaIconTab, {}),
5454
- value: "rwa" /* Rwa */,
5455
- children: /* @__PURE__ */ jsx(
5456
- MarketTabPanel,
5457
- {
5458
- type: "rwa" /* Rwa */,
5459
- getColumns,
5460
- initialSort: tabSort["rwa" /* Rwa */],
5461
- onSort: onTabSort("rwa" /* Rwa */)
5462
- }
5463
- )
5464
- }
5465
- ),
5466
- /* @__PURE__ */ jsx(
5467
- TabPanel,
5468
- {
5469
- classNames: {
5470
- trigger: "oui-tabs-newListings-trigger",
5471
- content: "oui-tabs-newListings-content"
5472
- },
5473
- title: t("markets.newListings"),
5474
- value: "newListing" /* NewListing */,
5475
- children: /* @__PURE__ */ jsx(
5476
- MarketTabPanel,
5477
- {
5478
- type: "newListing" /* NewListing */,
5479
- getColumns,
5480
- initialSort: tabSort["newListing" /* NewListing */],
5481
- onSort: onTabSort("newListing" /* NewListing */)
5482
- }
5483
- )
5484
- }
5485
- ),
5486
- /* @__PURE__ */ jsx(
5757
+ children: tabs?.map((tab, index) => {
5758
+ const key = tabKey(tab, index);
5759
+ const isBuiltIn = isBuiltInMarketTab(tab);
5760
+ const isCommunity = isBuiltIn && tab.type === "community" /* Community */;
5761
+ return /* @__PURE__ */ jsx(
5487
5762
  TabPanel,
5488
5763
  {
5489
5764
  classNames: {
5490
- trigger: "oui-tabs-recent-trigger",
5491
- content: "oui-tabs-recent-content"
5765
+ trigger: `oui-tabs-${key}-trigger`,
5766
+ content: `oui-tabs-${key}-content`
5492
5767
  },
5493
- title: t("markets.recent"),
5494
- value: "recent" /* Recent */,
5495
- children: /* @__PURE__ */ jsx(
5496
- MarketTabPanel,
5497
- {
5498
- type: "recent" /* Recent */,
5499
- getColumns,
5500
- initialSort: tabSort["recent" /* Recent */],
5501
- onSort: onTabSort("recent" /* Recent */)
5502
- }
5503
- )
5504
- }
5505
- )
5506
- ]
5768
+ title: resolveTabTitle(tab, builtInTitles, /* @__PURE__ */ jsx(RwaIconTab, {})),
5769
+ value: key,
5770
+ children: isCommunity ? renderCommunityContent() : isBuiltIn ? renderBuiltInContent(tab.type) : renderCustomContent(key)
5771
+ },
5772
+ key
5773
+ );
5774
+ })
5507
5775
  }
5508
5776
  )
5509
5777
  ]
@@ -5513,6 +5781,7 @@ var SubMenuMarkets = (props) => {
5513
5781
 
5514
5782
  // src/components/subMenuMarkets/subMenuMarkets.widget.tsx
5515
5783
  init_marketsProvider();
5784
+ init_useMarketCategories();
5516
5785
 
5517
5786
  // src/components/subMenuMarkets/subMenuMarkets.script.ts
5518
5787
  init_constant();
@@ -5557,11 +5826,13 @@ var SubMenuMarketsWidget = (props) => {
5557
5826
  activeTab: props.activeTab,
5558
5827
  onTabChange: props.onTabChange
5559
5828
  });
5829
+ const tabs = useMarketCategories("subMenuMarkets");
5560
5830
  return /* @__PURE__ */ jsx(
5561
5831
  MarketsProvider,
5562
5832
  {
5563
5833
  symbol: props.symbol,
5564
5834
  onSymbolChange: props.onSymbolChange,
5835
+ tabs,
5565
5836
  children: /* @__PURE__ */ jsx(
5566
5837
  SubMenuMarkets,
5567
5838
  {
@@ -5591,7 +5862,6 @@ init_type();
5591
5862
  init_useTabSort();
5592
5863
  var SIDE_MARKETS_SEL_TAB_KEY2 = "orderly_side_markets_sel_tab_key";
5593
5864
  var useSideMarketsScript = (options) => {
5594
- const [panelSize, setPanelSize] = useState(options?.panelSize);
5595
5865
  const [activeTab, setActiveTab] = useLocalStorage(
5596
5866
  SIDE_MARKETS_SEL_TAB_KEY2,
5597
5867
  "all" /* All */
@@ -5599,26 +5869,25 @@ var useSideMarketsScript = (options) => {
5599
5869
  const { tabSort } = useTabSort({
5600
5870
  storageKey: SIDE_MARKETS_TAB_SORT_STORAGE_KEY
5601
5871
  });
5602
- const onPanelSizeChange = useCallback(
5872
+ const panelSize = useMemo(() => {
5873
+ if (options?.collapsed) {
5874
+ return "small";
5875
+ }
5876
+ return options?.panelSize || "large";
5877
+ }, [options?.collapsed, options?.panelSize]);
5878
+ useCallback(
5603
5879
  (size) => {
5604
5880
  if (typeof options?.onPanelSizeChange === "function") {
5605
5881
  options.onPanelSizeChange(size);
5606
- } else {
5607
- setPanelSize(size);
5608
5882
  }
5609
5883
  },
5610
5884
  [options?.onPanelSizeChange]
5611
5885
  );
5612
- useEffect(() => {
5613
- setPanelSize(options?.panelSize);
5614
- }, [options?.panelSize]);
5615
5886
  return {
5616
- resizeable: options?.resizeable ?? true,
5617
- panelSize,
5618
- onPanelSizeChange,
5619
5887
  activeTab,
5620
5888
  onTabChange: setActiveTab,
5621
- tabSort
5889
+ tabSort,
5890
+ panelSize
5622
5891
  };
5623
5892
  };
5624
5893
 
@@ -5630,9 +5899,7 @@ var LazySideMarkets = React6.lazy(
5630
5899
  })
5631
5900
  );
5632
5901
  var SideMarketsWidget = (props) => {
5633
- const state = useSideMarketsScript(
5634
- pick(["resizeable", "panelSize", "onPanelSizeChange"], props)
5635
- );
5902
+ const state = useSideMarketsScript(props);
5636
5903
  return /* @__PURE__ */ jsx(MarketsProvider, { ...pick(["symbol", "onSymbolChange"], props), children: /* @__PURE__ */ jsx(React6.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazySideMarkets, { ...state, className: props.className }) }) });
5637
5904
  };
5638
5905
 
@@ -5640,18 +5907,23 @@ var SideMarketsWidget = (props) => {
5640
5907
  init_dropDownMarkets();
5641
5908
 
5642
5909
  // src/components/marketsSheet/marketsSheet.ui.tsx
5643
- init_icons();
5910
+ init_useCommunityTabs();
5644
5911
  init_type();
5912
+ init_communityBrokerTabs();
5645
5913
  init_marketsList();
5914
+ init_marketsProvider();
5646
5915
  init_rwaTab();
5647
5916
  init_searchInput();
5648
5917
  init_useFavoritesExtraProps();
5918
+ init_tabUtils();
5649
5919
 
5650
5920
  // src/components/marketsSheet/column.tsx
5651
- init_column2();
5921
+ init_column();
5652
5922
  var getMarketsSheetColumns = (favorite, isFavoriteList = false) => {
5653
5923
  return [
5654
- getSymbolColumn(favorite, isFavoriteList),
5924
+ getSymbolColumn(favorite, isFavoriteList, {
5925
+ stackLeverageInSecondRow: true
5926
+ }),
5655
5927
  get24hVolOIColumn(),
5656
5928
  getLastAnd24hPercentageColumn(favorite, isFavoriteList)
5657
5929
  ];
@@ -5660,14 +5932,17 @@ var MarketsSheet = (props) => {
5660
5932
  const { className, tabSort, onTabSort } = props;
5661
5933
  const { t } = useTranslation();
5662
5934
  const { getFavoritesProps, renderEmptyView } = useFavoritesProps();
5663
- const renderTab = (type) => {
5664
- const isFavorites = type === "favorites" /* Favorites */;
5935
+ const { tabs } = useMarketsContext();
5936
+ const builtInTitles = useBuiltInTitles();
5937
+ const tabDataFilters = useCustomTabDataFilters(tabs);
5938
+ const renderBuiltInContent = (tabType) => {
5939
+ const isFavorites = tabType === "favorites" /* Favorites */;
5665
5940
  return /* @__PURE__ */ jsx(
5666
5941
  MarketsListWidget,
5667
5942
  {
5668
- type,
5669
- initialSort: tabSort[type],
5670
- onSort: onTabSort(type),
5943
+ type: tabType,
5944
+ initialSort: tabSort[tabType],
5945
+ onSort: onTabSort(tabType),
5671
5946
  getColumns: getMarketsSheetColumns,
5672
5947
  tableClassNames: {
5673
5948
  root: cn("oui-marketsSheet-list", "!oui-bg-base-8"),
@@ -5677,12 +5952,65 @@ var MarketsSheet = (props) => {
5677
5952
  )
5678
5953
  },
5679
5954
  emptyView: renderEmptyView({
5680
- type,
5955
+ type: tabType,
5681
5956
  onClick: () => {
5682
5957
  props.onTabChange("all" /* All */);
5683
5958
  }
5684
5959
  }),
5685
- ...getFavoritesProps(type)
5960
+ ...getFavoritesProps(tabType)
5961
+ }
5962
+ );
5963
+ };
5964
+ const renderCommunityContent = () => {
5965
+ return /* @__PURE__ */ jsx(
5966
+ CommunityBrokerTabs,
5967
+ {
5968
+ storageKey: "orderly_markets_sheet_community_sel_sub_tab",
5969
+ classNames: {
5970
+ tabsList: "oui-px-3 oui-pt-1 oui-pb-2",
5971
+ tabsContent: "oui-h-full"
5972
+ },
5973
+ className: cn(
5974
+ "oui-marketsSheet-community-tabs",
5975
+ "oui-h-[calc(100%_-_36px)]"
5976
+ ),
5977
+ showScrollIndicator: true,
5978
+ renderPanel: (selected) => /* @__PURE__ */ jsx(
5979
+ MarketsListWidget,
5980
+ {
5981
+ type: "all" /* All */,
5982
+ initialSort: tabSort["community" /* Community */],
5983
+ onSort: onTabSort("community" /* Community */),
5984
+ getColumns: getMarketsSheetColumns,
5985
+ tableClassNames: {
5986
+ root: cn("oui-marketsSheet-list", "!oui-bg-base-8"),
5987
+ scroll: cn(
5988
+ "oui-pb-[env(safe-area-inset-bottom,_20px)]",
5989
+ "oui-h-[calc(100%_-_40px)]"
5990
+ )
5991
+ },
5992
+ dataFilter: createCommunityBrokerFilter(selected)
5993
+ }
5994
+ )
5995
+ }
5996
+ );
5997
+ };
5998
+ const renderCustomContent = (key) => {
5999
+ return /* @__PURE__ */ jsx(
6000
+ MarketsListWidget,
6001
+ {
6002
+ type: "all" /* All */,
6003
+ dataFilter: (data) => tabDataFilters[key]?.(data) ?? data,
6004
+ initialSort: tabSort[key],
6005
+ onSort: onTabSort(key),
6006
+ getColumns: getMarketsSheetColumns,
6007
+ tableClassNames: {
6008
+ root: cn("oui-marketsSheet-list", "!oui-bg-base-8"),
6009
+ scroll: cn(
6010
+ "oui-pb-[env(safe-area-inset-bottom,_20px)]",
6011
+ "oui-h-[calc(100%_-_40px)]"
6012
+ )
6013
+ }
5686
6014
  }
5687
6015
  );
5688
6016
  };
@@ -5701,7 +6029,7 @@ var MarketsSheet = (props) => {
5701
6029
  }
5702
6030
  )
5703
6031
  ] }),
5704
- /* @__PURE__ */ jsxs(
6032
+ /* @__PURE__ */ jsx(
5705
6033
  Tabs,
5706
6034
  {
5707
6035
  variant: "contained",
@@ -5715,44 +6043,24 @@ var MarketsSheet = (props) => {
5715
6043
  },
5716
6044
  className: cn("oui-marketsSheet-tabs", "oui-h-[calc(100%_-_92px)]"),
5717
6045
  showScrollIndicator: true,
5718
- children: [
5719
- /* @__PURE__ */ jsx(
5720
- TabPanel,
5721
- {
5722
- classNames: {
5723
- trigger: "oui-tabs-favorites-trigger",
5724
- content: "oui-tabs-favorites-content"
5725
- },
5726
- title: /* @__PURE__ */ jsx(FavoritesIcon, {}),
5727
- value: "favorites" /* Favorites */,
5728
- children: renderTab("favorites" /* Favorites */)
5729
- }
5730
- ),
5731
- /* @__PURE__ */ jsx(
5732
- TabPanel,
5733
- {
5734
- classNames: {
5735
- trigger: "oui-tabs-all-trigger",
5736
- content: "oui-tabs-all-content"
5737
- },
5738
- title: t("common.all"),
5739
- value: "all" /* All */,
5740
- children: renderTab("all" /* All */)
5741
- }
5742
- ),
5743
- /* @__PURE__ */ jsx(
6046
+ children: tabs?.map((tab, index) => {
6047
+ const key = tabKey(tab, index);
6048
+ const isBuiltIn = isBuiltInMarketTab(tab);
6049
+ const isCommunity = isBuiltIn && tab.type === "community" /* Community */;
6050
+ return /* @__PURE__ */ jsx(
5744
6051
  TabPanel,
5745
6052
  {
5746
6053
  classNames: {
5747
- trigger: "oui-tabs-rwa-trigger",
5748
- content: "oui-tabs-rwa-content"
6054
+ trigger: `oui-tabs-${key}-trigger`,
6055
+ content: `oui-tabs-${key}-content`
5749
6056
  },
5750
- title: /* @__PURE__ */ jsx(RwaTab, {}),
5751
- value: "rwa" /* Rwa */,
5752
- children: renderTab("rwa" /* Rwa */)
5753
- }
5754
- )
5755
- ]
6057
+ title: resolveTabTitle(tab, builtInTitles, /* @__PURE__ */ jsx(RwaTab, {})),
6058
+ value: key,
6059
+ children: isCommunity ? renderCommunityContent() : isBuiltIn ? renderBuiltInContent(tab.type) : renderCustomContent(key)
6060
+ },
6061
+ key
6062
+ );
6063
+ })
5756
6064
  }
5757
6065
  )
5758
6066
  ]
@@ -5783,13 +6091,16 @@ function useMarketsSheetScript() {
5783
6091
 
5784
6092
  // src/components/marketsSheet/marketsSheet.widget.tsx
5785
6093
  init_marketsProvider();
6094
+ init_useMarketCategories();
5786
6095
  var MarketsSheetWidget = (props) => {
5787
6096
  const state = useMarketsSheetScript();
6097
+ const tabs = useMarketCategories("marketsSheet");
5788
6098
  return /* @__PURE__ */ jsx(
5789
6099
  MarketsProvider,
5790
6100
  {
5791
6101
  symbol: props.symbol,
5792
6102
  onSymbolChange: props.onSymbolChange,
6103
+ tabs,
5793
6104
  children: /* @__PURE__ */ jsx(MarketsSheet, { ...state, className: props.className })
5794
6105
  }
5795
6106
  );
@@ -5797,6 +6108,7 @@ var MarketsSheetWidget = (props) => {
5797
6108
 
5798
6109
  // src/components/symbolInfoBar/symbolInfoBar.ui.tsx
5799
6110
  init_icons();
6111
+ init_symbolBadge();
5800
6112
  init_symbolDisplay();
5801
6113
  var RwaTooltip = (props) => {
5802
6114
  const { isRwa, open, closeTimeInterval, openTimeInterval } = props;
@@ -5953,7 +6265,7 @@ var SymbolInfoBar = (props) => {
5953
6265
  className: "oui-h-5 oui-cursor-pointer oui-gap-x-[6px]",
5954
6266
  onClick: onSymbol,
5955
6267
  children: [
5956
- /* @__PURE__ */ jsx(SymbolDisplay, { formatString: "base", size: "sm", children: symbol }),
6268
+ /* @__PURE__ */ jsx(SymbolDisplay, { formatString: "base", size: "sm", showBadge: false, children: symbol }),
5957
6269
  /* @__PURE__ */ jsx(TriangleDownIcon, { className: "oui-size-[14px] oui-text-base-contrast-54" })
5958
6270
  ]
5959
6271
  }
@@ -5961,32 +6273,37 @@ var SymbolInfoBar = (props) => {
5961
6273
  return /* @__PURE__ */ jsxs(
5962
6274
  Flex,
5963
6275
  {
6276
+ intensity: 900,
6277
+ mx: 1,
6278
+ px: 3,
6279
+ py: 2,
5964
6280
  className: cn(
5965
6281
  "oui-symbol-info-bar-mobile",
5966
- "oui-h-full oui-font-semibold",
6282
+ "oui-h-full oui-font-semibold oui-rounded-xl",
5967
6283
  props.className
5968
6284
  ),
5969
6285
  children: [
5970
6286
  /* @__PURE__ */ jsxs(Flex, { gapX: 3, className: "oui-h-full oui-flex-1 oui-overflow-hidden", children: [
5971
6287
  /* @__PURE__ */ jsxs(Flex, { gapX: 3, children: [
5972
6288
  /* @__PURE__ */ jsx(TokenIcon, { symbol, size: "xs" }),
5973
- /* @__PURE__ */ jsxs(Flex, { direction: "column", itemAlign: "start", children: [
6289
+ /* @__PURE__ */ jsxs(Flex, { direction: "column", itemAlign: "start", gap: 1, children: [
5974
6290
  symbolView,
5975
6291
  /* @__PURE__ */ jsxs(Flex, { gap: 1, children: [
5976
6292
  /* @__PURE__ */ jsxs(Badge, { size: "xs", color: "primary", children: [
5977
6293
  leverage,
5978
6294
  "x"
5979
6295
  ] }),
5980
- /* @__PURE__ */ jsx(
5981
- RwaTooltip,
5982
- {
5983
- isRwa,
5984
- open,
5985
- closeTimeInterval,
5986
- openTimeInterval
5987
- }
5988
- )
5989
- ] })
6296
+ /* @__PURE__ */ jsx(SymbolBadge, { symbol })
6297
+ ] }),
6298
+ /* @__PURE__ */ jsx(
6299
+ RwaTooltip,
6300
+ {
6301
+ isRwa,
6302
+ open,
6303
+ closeTimeInterval,
6304
+ openTimeInterval
6305
+ }
6306
+ )
5990
6307
  ] })
5991
6308
  ] }),
5992
6309
  /* @__PURE__ */ jsx(Divider, { className: "oui-h-[38px]", direction: "vertical", intensity: 8 }),
@@ -6196,6 +6513,7 @@ var FundingRateHintWidget = (props) => {
6196
6513
  };
6197
6514
 
6198
6515
  // src/components/symbolInfoBarFull/symbolInfoBarFull.ui.tsx
6516
+ init_symbolBadge();
6199
6517
  init_symbolDisplay();
6200
6518
  var LazyDropDownMarketsWidget = React6.lazy(
6201
6519
  () => Promise.resolve().then(() => (init_dropDownMarkets(), dropDownMarkets_exports)).then((mod) => {
@@ -6212,6 +6530,91 @@ var LazyDataItem = React6.lazy(
6212
6530
  return { default: mod.DataItem };
6213
6531
  })
6214
6532
  );
6533
+ var RISK_NOTICE_LEARN_MORE_URL = "https://orderly.network";
6534
+ var SymbolInfoBarRiskNotice = ({ className, visible, symbolWithBroker, brokerName, autoHeight }) => {
6535
+ const { t } = useTranslation();
6536
+ if (!visible) return null;
6537
+ return /* @__PURE__ */ jsx(
6538
+ "a",
6539
+ {
6540
+ href: RISK_NOTICE_LEARN_MORE_URL,
6541
+ target: "_blank",
6542
+ rel: "noopener noreferrer",
6543
+ className: cn(
6544
+ "oui-symbol-info-bar-risk-notice oui-w-full oui-bg-warning-darken/10 oui-rounded-none oui-text-warning-darken hover:oui-cursor-pointer oui-block",
6545
+ className
6546
+ ),
6547
+ children: /* @__PURE__ */ jsxs(
6548
+ Flex,
6549
+ {
6550
+ itemAlign: "center",
6551
+ gap: 2,
6552
+ className: autoHeight ? "oui-min-h-0 oui-py-2 oui-px-2" : "oui-h-[46px] oui-px-3",
6553
+ children: [
6554
+ /* @__PURE__ */ jsx(WarningIcon, { className: "oui-shrink-0 oui-size-4 oui-text-warning-darken" }),
6555
+ /* @__PURE__ */ jsxs(Text, { size: "xs", className: "oui-text-warning-darken oui-flex-1", children: [
6556
+ t("markets.symbolInfoBar.riskNotice.content", {
6557
+ symbolWithBroker,
6558
+ brokerName
6559
+ }),
6560
+ " ",
6561
+ /* @__PURE__ */ jsx("span", { className: "oui-underline", children: t("common.learnMore") })
6562
+ ] })
6563
+ ]
6564
+ }
6565
+ )
6566
+ }
6567
+ );
6568
+ };
6569
+ var SymbolInfoBarDesktop = ({
6570
+ className,
6571
+ trailing,
6572
+ leftSection,
6573
+ priceSection,
6574
+ scrollableContent,
6575
+ containerRef,
6576
+ leadingVisible,
6577
+ tailingVisible,
6578
+ onScroll
6579
+ }) => /* @__PURE__ */ jsxs(
6580
+ Flex,
6581
+ {
6582
+ intensity: 900,
6583
+ r: "2xl",
6584
+ px: 3,
6585
+ className: cn(
6586
+ "oui-symbol-info-bar-desktop",
6587
+ "oui-font-semibold",
6588
+ "oui-flex-1 oui-w-full",
6589
+ "oui-py-2",
6590
+ className
6591
+ ),
6592
+ style: {
6593
+ transform: "translateZ(0)",
6594
+ willChange: "transform"
6595
+ },
6596
+ children: [
6597
+ /* @__PURE__ */ jsxs(Flex, { gapX: 6, className: "oui-h-full oui-flex-1 oui-overflow-hidden", children: [
6598
+ /* @__PURE__ */ jsx(Flex, { gapX: 1, className: "oui-flex-none oui-shrink-0", children: leftSection }),
6599
+ /* @__PURE__ */ jsx(Divider, { className: "oui-h-[26px]", direction: "vertical", intensity: 8 }),
6600
+ priceSection,
6601
+ /* @__PURE__ */ jsxs("div", { className: "oui-relative oui-h-full oui-overflow-hidden", children: [
6602
+ /* @__PURE__ */ jsx(
6603
+ "div",
6604
+ {
6605
+ ref: containerRef,
6606
+ className: "oui-hide-scrollbar oui-h-full oui-overflow-x-auto",
6607
+ children: scrollableContent
6608
+ }
6609
+ ),
6610
+ /* @__PURE__ */ jsx(ScrollIndicator2, { leading: true, onClick: onScroll, visible: leadingVisible }),
6611
+ /* @__PURE__ */ jsx(ScrollIndicator2, { tailing: true, onClick: onScroll, visible: tailingVisible })
6612
+ ] })
6613
+ ] }),
6614
+ trailing
6615
+ ]
6616
+ }
6617
+ );
6215
6618
  var SymbolInfoBarFull = (props) => {
6216
6619
  const {
6217
6620
  symbol,
@@ -6237,6 +6640,10 @@ var SymbolInfoBarFull = (props) => {
6237
6640
  showCountdown
6238
6641
  } = props;
6239
6642
  const { t } = useTranslation();
6643
+ const { brokerId, brokerName, brokerNameRaw, displayName } = useBadgeBySymbol(symbol);
6644
+ const isCommunityListed = Boolean(brokerId ?? brokerName);
6645
+ const baseFromSymbol = symbol?.split("_")[1] ?? symbol;
6646
+ const symbolWithBroker = brokerName != null ? `${baseFromSymbol}-${brokerNameRaw}` : displayName ?? symbol;
6240
6647
  const favoriteIcon = /* @__PURE__ */ jsx(React6.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyFavoritesDropdownMenuWidget, { row: { symbol }, favorite, children: /* @__PURE__ */ jsx(
6241
6648
  Flex,
6242
6649
  {
@@ -6261,7 +6668,7 @@ var SymbolInfoBarFull = (props) => {
6261
6668
  contentClassName: "oui-w-[580px] oui-h-[496px]",
6262
6669
  symbol: props.symbol,
6263
6670
  onSymbolChange: props.onSymbolChange,
6264
- children: /* @__PURE__ */ jsxs(Flex, { gapX: 1, className: "oui-cursor-pointer", children: [
6671
+ children: /* @__PURE__ */ jsx(Flex, { direction: "column", gap: 1, children: /* @__PURE__ */ jsxs(Flex, { gapX: 1, className: "oui-cursor-pointer", children: [
6265
6672
  /* @__PURE__ */ jsx(TokenIcon, { symbol, className: "oui-size-4" }),
6266
6673
  /* @__PURE__ */ jsx(
6267
6674
  SymbolDisplay,
@@ -6269,22 +6676,26 @@ var SymbolInfoBarFull = (props) => {
6269
6676
  formatString: "base",
6270
6677
  size: "xs",
6271
6678
  className: "oui-text-base-contrast",
6679
+ showBadge: false,
6272
6680
  children: symbol
6273
6681
  }
6274
6682
  ),
6275
6683
  /* @__PURE__ */ jsx(TriangleDownIcon, { className: "oui-text-base-contrast-54" })
6276
- ] })
6684
+ ] }) })
6277
6685
  }
6278
6686
  ),
6279
- isRwa && /* @__PURE__ */ jsx(
6280
- RwaTooltip,
6281
- {
6282
- isRwa,
6283
- open,
6284
- closeTimeInterval,
6285
- openTimeInterval
6286
- }
6287
- )
6687
+ /* @__PURE__ */ jsxs(Flex, { gap: 1, children: [
6688
+ /* @__PURE__ */ jsx(SymbolBadge, { symbol }),
6689
+ isRwa && /* @__PURE__ */ jsx(
6690
+ RwaTooltip,
6691
+ {
6692
+ isRwa,
6693
+ open,
6694
+ closeTimeInterval,
6695
+ openTimeInterval
6696
+ }
6697
+ )
6698
+ ] })
6288
6699
  ]
6289
6700
  }
6290
6701
  ) });
@@ -6313,129 +6724,92 @@ var SymbolInfoBarFull = (props) => {
6313
6724
  }
6314
6725
  )
6315
6726
  ] });
6316
- return /* @__PURE__ */ jsxs(Flex, { direction: "column", className: "oui-h-full oui-w-full", children: [
6317
- /* @__PURE__ */ jsxs(
6318
- Flex,
6727
+ const leftSection = /* @__PURE__ */ jsxs(Fragment, { children: [
6728
+ favoriteIcon,
6729
+ symbolView
6730
+ ] });
6731
+ const priceSection = /* @__PURE__ */ jsx(
6732
+ Tooltip,
6733
+ {
6734
+ content: t("markets.symbolInfoBar.lastPrice.tooltip"),
6735
+ className: "oui-max-w-[240px]",
6736
+ children: /* @__PURE__ */ jsx("span", { className: "oui-cursor-pointer oui-border-b oui-border-dashed oui-border-line-12 oui-inline-block", children: price })
6737
+ }
6738
+ );
6739
+ const scrollableContent = /* @__PURE__ */ jsxs(Flex, { gapX: 8, height: "100%", children: [
6740
+ /* @__PURE__ */ jsx("div", { ref: leadingElementRef, children: /* @__PURE__ */ jsx(React6.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyDataItem, { label: t("markets.column.24hChange"), value: change }) }) }),
6741
+ /* @__PURE__ */ jsx(React6.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
6742
+ LazyDataItem,
6319
6743
  {
6320
- className: cn(
6321
- "oui-symbol-info-bar-desktop",
6322
- "oui-font-semibold",
6323
- "oui-flex-1 oui-w-full",
6324
- props.className
6744
+ label: t("markets.symbolInfoBar.Mark"),
6745
+ value: /* @__PURE__ */ jsx(
6746
+ Text.numeral,
6747
+ {
6748
+ dp: quotoDp,
6749
+ "data-testid": "oui-testid-tokenInfo-markPrice-value",
6750
+ children: data?.["mark_price"]
6751
+ }
6325
6752
  ),
6326
- style: {
6327
- transform: "translateZ(0)",
6328
- willChange: "transform"
6329
- },
6330
- children: [
6331
- /* @__PURE__ */ jsxs(Flex, { gapX: 6, className: "oui-h-full oui-flex-1 oui-overflow-hidden", children: [
6332
- /* @__PURE__ */ jsxs(Flex, { gapX: 1, children: [
6333
- favoriteIcon,
6334
- symbolView
6335
- ] }),
6336
- /* @__PURE__ */ jsx(
6337
- Divider,
6338
- {
6339
- className: "oui-h-[26px]",
6340
- direction: "vertical",
6341
- intensity: 8
6342
- }
6343
- ),
6344
- /* @__PURE__ */ jsx(
6345
- Tooltip,
6346
- {
6347
- content: t("markets.symbolInfoBar.lastPrice.tooltip"),
6348
- className: "oui-max-w-[240px]",
6349
- children: /* @__PURE__ */ jsx("span", { className: "oui-cursor-pointer oui-border-b oui-border-dashed oui-border-line-12 oui-inline-block", children: price })
6350
- }
6351
- ),
6352
- /* @__PURE__ */ jsxs("div", { className: "oui-relative oui-h-full oui-overflow-hidden", children: [
6353
- /* @__PURE__ */ jsx(
6354
- "div",
6355
- {
6356
- ref: containerRef,
6357
- className: "oui-hide-scrollbar oui-h-full oui-overflow-x-auto",
6358
- children: /* @__PURE__ */ jsxs(Flex, { gapX: 8, height: "100%", children: [
6359
- /* @__PURE__ */ jsx("div", { ref: leadingElementRef, children: /* @__PURE__ */ jsx(React6.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
6360
- LazyDataItem,
6361
- {
6362
- label: t("markets.column.24hChange"),
6363
- value: change
6364
- }
6365
- ) }) }),
6366
- /* @__PURE__ */ jsx(React6.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
6367
- LazyDataItem,
6368
- {
6369
- label: t("markets.symbolInfoBar.Mark"),
6370
- value: /* @__PURE__ */ jsx(
6371
- Text.numeral,
6372
- {
6373
- dp: quotoDp,
6374
- "data-testid": "oui-testid-tokenInfo-markPrice-value",
6375
- children: data?.["mark_price"]
6376
- }
6377
- ),
6378
- hint: t("markets.symbolInfoBar.Mark.tooltip")
6379
- }
6380
- ) }),
6381
- /* @__PURE__ */ jsx(React6.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
6382
- LazyDataItem,
6383
- {
6384
- label: t("markets.symbolInfoBar.Index"),
6385
- value: /* @__PURE__ */ jsx(Text.numeral, { dp: quotoDp, children: data?.["index_price"] }),
6386
- hint: t("markets.symbolInfoBar.Index.tooltip")
6387
- }
6388
- ) }),
6389
- /* @__PURE__ */ jsx(React6.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
6390
- LazyDataItem,
6391
- {
6392
- label: t("markets.symbolInfoBar.24hVolume"),
6393
- value: /* @__PURE__ */ jsx(Text.numeral, { rule: "human", dp: 2, children: data?.["24h_amount"] }),
6394
- hint: t("markets.symbolInfoBar.24hVolume.tooltip")
6395
- }
6396
- ) }),
6397
- /* @__PURE__ */ jsx(React6.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
6398
- LazyDataItem,
6399
- {
6400
- label: t("markets.symbolInfoBar.predFundingRate"),
6401
- value: /* @__PURE__ */ jsx(FundingRate, { symbol }),
6402
- hint: /* @__PURE__ */ jsx(FundingRateHintWidget, { symbol })
6403
- }
6404
- ) }),
6405
- /* @__PURE__ */ jsx("div", { ref: tailingElementRef, children: /* @__PURE__ */ jsx(React6.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
6406
- LazyDataItem,
6407
- {
6408
- label: t("markets.openInterest"),
6409
- value: /* @__PURE__ */ jsxs(Fragment, { children: [
6410
- /* @__PURE__ */ jsx(Text.numeral, { rule: "human", dp: 2, children: openInterest }),
6411
- /* @__PURE__ */ jsx(Text, { intensity: 36, children: ` USDC` })
6412
- ] }),
6413
- hint: t("markets.openInterest.tooltip")
6414
- }
6415
- ) }) })
6416
- ] })
6417
- }
6418
- ),
6419
- /* @__PURE__ */ jsx(
6420
- ScrollIndicator2,
6421
- {
6422
- leading: true,
6423
- onClick: onScoll,
6424
- visible: leadingVisible
6425
- }
6426
- ),
6427
- /* @__PURE__ */ jsx(
6428
- ScrollIndicator2,
6429
- {
6430
- tailing: true,
6431
- onClick: onScoll,
6432
- visible: tailingVisible
6433
- }
6434
- )
6435
- ] })
6436
- ] }),
6437
- props.trailing
6438
- ]
6753
+ hint: t("markets.symbolInfoBar.Mark.tooltip")
6754
+ }
6755
+ ) }),
6756
+ /* @__PURE__ */ jsx(React6.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
6757
+ LazyDataItem,
6758
+ {
6759
+ label: t("markets.symbolInfoBar.Index"),
6760
+ value: /* @__PURE__ */ jsx(Text.numeral, { dp: quotoDp, children: data?.["index_price"] }),
6761
+ hint: t("markets.symbolInfoBar.Index.tooltip")
6762
+ }
6763
+ ) }),
6764
+ /* @__PURE__ */ jsx(React6.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
6765
+ LazyDataItem,
6766
+ {
6767
+ label: t("markets.symbolInfoBar.24hVolume"),
6768
+ value: /* @__PURE__ */ jsx(Text.numeral, { rule: "human", dp: 2, children: data?.["24h_amount"] }),
6769
+ hint: t("markets.symbolInfoBar.24hVolume.tooltip")
6770
+ }
6771
+ ) }),
6772
+ /* @__PURE__ */ jsx(React6.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
6773
+ LazyDataItem,
6774
+ {
6775
+ label: t("markets.symbolInfoBar.predFundingRate"),
6776
+ value: /* @__PURE__ */ jsx(FundingRate, { symbol }),
6777
+ hint: /* @__PURE__ */ jsx(FundingRateHintWidget, { symbol })
6778
+ }
6779
+ ) }),
6780
+ /* @__PURE__ */ jsx("div", { ref: tailingElementRef, children: /* @__PURE__ */ jsx(React6.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
6781
+ LazyDataItem,
6782
+ {
6783
+ label: t("markets.openInterest"),
6784
+ value: /* @__PURE__ */ jsxs(Fragment, { children: [
6785
+ /* @__PURE__ */ jsx(Text.numeral, { rule: "human", dp: 2, children: openInterest }),
6786
+ /* @__PURE__ */ jsx(Text, { intensity: 36, children: ` USDC` })
6787
+ ] }),
6788
+ hint: t("markets.openInterest.tooltip")
6789
+ }
6790
+ ) }) })
6791
+ ] });
6792
+ return /* @__PURE__ */ jsxs(Flex, { direction: "column", className: "oui-h-full oui-w-full", gapY: 1, children: [
6793
+ /* @__PURE__ */ jsx(
6794
+ SymbolInfoBarRiskNotice,
6795
+ {
6796
+ visible: isCommunityListed,
6797
+ symbolWithBroker,
6798
+ brokerName: brokerNameRaw ?? brokerName ?? ""
6799
+ }
6800
+ ),
6801
+ /* @__PURE__ */ jsx(
6802
+ SymbolInfoBarDesktop,
6803
+ {
6804
+ className: props.className,
6805
+ trailing: props.trailing,
6806
+ leftSection,
6807
+ priceSection,
6808
+ scrollableContent,
6809
+ containerRef,
6810
+ leadingVisible,
6811
+ tailingVisible,
6812
+ onScroll: onScoll
6439
6813
  }
6440
6814
  ),
6441
6815
  showCountdown && /* @__PURE__ */ jsx(
@@ -6628,42 +7002,69 @@ function useSymbolInfoBarFullScript(options) {
6628
7002
  openTimeInterval
6629
7003
  };
6630
7004
  }
7005
+ var SymbolInfoBarFullInjectable = injectable(
7006
+ SymbolInfoBarFull,
7007
+ "Trading.SymbolInfoBar.Desktop"
7008
+ );
6631
7009
  var SymbolInfoBarFullWidget = (props) => {
6632
7010
  const { symbol, ...rest } = props;
6633
7011
  const state = useSymbolInfoBarFullScript({ symbol });
6634
- return /* @__PURE__ */ jsx(SymbolInfoBarFull, { ...state, ...rest });
7012
+ return /* @__PURE__ */ jsx(SymbolInfoBarFullInjectable, { ...state, ...rest });
6635
7013
  };
6636
7014
 
6637
7015
  // src/components/horizontalMarkets/horizontalMarkets.widget.tsx
6638
7016
  init_marketsProvider();
7017
+ init_useMarketCategories();
6639
7018
 
6640
7019
  // src/components/horizontalMarkets/horizontalMarkets.script.ts
6641
7020
  init_constant();
6642
7021
  init_utils();
6643
7022
  init_marketsProvider();
6644
7023
  init_useTabSort();
7024
+ init_tabUtils();
6645
7025
  var useHorizontalMarketsScript = (options) => {
6646
7026
  const {
6647
7027
  symbols: optionSymbols,
6648
7028
  maxItems: optionMaxItems,
6649
7029
  defaultMarketType
6650
7030
  } = options || {};
6651
- const { symbol: currentSymbol, onSymbolChange } = useMarketsContext();
7031
+ const { symbol: currentSymbol, onSymbolChange, tabs } = useMarketsContext();
6652
7032
  const [selectedMarketType, setSelectedMarketType] = useLocalStorage(
6653
7033
  SIDE_MARKETS_SEL_TAB_KEY,
6654
7034
  defaultMarketType || "all"
6655
7035
  );
7036
+ const availableMarketTypes = useMemo(
7037
+ () => tabs?.map((tab, index) => tabKey(tab, index)) ?? ["all"],
7038
+ [tabs]
7039
+ );
6656
7040
  const MarketsTypeMap3 = {
6657
7041
  all: MarketsType.ALL,
6658
7042
  recent: MarketsType.RECENT,
6659
7043
  newListing: MarketsType.NEW_LISTING,
6660
7044
  favorites: MarketsType.FAVORITES
6661
7045
  };
6662
- const marketTypeKey = selectedMarketType || "all";
7046
+ const isCustomCategory = typeof selectedMarketType === "string" && !MarketsTypeMap3[selectedMarketType];
7047
+ const marketTypeKey = isCustomCategory ? "all" : selectedMarketType || "all";
6663
7048
  const [markets, favorite] = useMarkets(
6664
7049
  MarketsTypeMap3[marketTypeKey] || MarketsType.ALL
6665
7050
  );
7051
+ useEffect(() => {
7052
+ if (!availableMarketTypes.includes(selectedMarketType)) {
7053
+ setSelectedMarketType(availableMarketTypes[0] ?? "all");
7054
+ }
7055
+ }, [availableMarketTypes, selectedMarketType, setSelectedMarketType]);
7056
+ const customCategoryFilter = useMemo(() => {
7057
+ if (!isCustomCategory || !tabs) return null;
7058
+ const customTabs = tabs.filter(isCustomMarketTab);
7059
+ const tab = customTabs.find(
7060
+ (item, index) => tabKey(item, index) === selectedMarketType
7061
+ );
7062
+ return tab ? getCustomTabDataFilter(tab) ?? null : null;
7063
+ }, [isCustomCategory, tabs, selectedMarketType]);
6666
7064
  const filteredMarkets = useMemo(() => {
7065
+ if (isCustomCategory && customCategoryFilter) {
7066
+ return customCategoryFilter(markets);
7067
+ }
6667
7068
  if (selectedMarketType === "favorites") {
6668
7069
  const { favorites, selectedFavoriteTab } = favorite;
6669
7070
  const symbolsInTab = favorites?.filter(
@@ -6685,7 +7086,9 @@ var useHorizontalMarketsScript = (options) => {
6685
7086
  favorite.favorites,
6686
7087
  favorite.selectedFavoriteTab,
6687
7088
  favorite.recent,
6688
- selectedMarketType
7089
+ selectedMarketType,
7090
+ isCustomCategory,
7091
+ customCategoryFilter
6689
7092
  ]);
6690
7093
  const { tabSort } = useTabSort({
6691
7094
  storageKey: SIDE_MARKETS_TAB_SORT_STORAGE_KEY
@@ -6770,7 +7173,8 @@ var HorizontalMarketsWidget = (props) => {
6770
7173
  dropdownPos,
6771
7174
  ...providerProps
6772
7175
  } = props;
6773
- return /* @__PURE__ */ jsx(MarketsProvider, { ...providerProps, children: /* @__PURE__ */ jsx(
7176
+ const tabs = useMarketCategories("horizontalMarkets");
7177
+ return /* @__PURE__ */ jsx(MarketsProvider, { ...providerProps, tabs, children: /* @__PURE__ */ jsx(
6774
7178
  HorizontalMarketsInner,
6775
7179
  {
6776
7180
  symbols,
@@ -6790,7 +7194,7 @@ init_marketItem_ui();
6790
7194
  // src/deprecated/newListingList/newListingList.ui.tsx
6791
7195
  init_collapseMarkets();
6792
7196
  init_marketsProvider();
6793
- init_column();
7197
+ init_column2();
6794
7198
  var NewListingList = (props) => {
6795
7199
  const { dataSource, favorite, onSort, loading, getColumns, collapsed } = props;
6796
7200
  const { symbol, onSymbolChange } = useMarketsContext();
@@ -6859,7 +7263,7 @@ var NewListingListWidget = (props) => {
6859
7263
  init_collapseMarkets();
6860
7264
  init_favoritesTabs();
6861
7265
  init_marketsProvider();
6862
- init_column();
7266
+ init_column2();
6863
7267
  var FavoritesList = (props) => {
6864
7268
  const { dataSource, favorite, onSort, loading, getColumns, collapsed } = props;
6865
7269
  const { symbol, onSymbolChange } = useMarketsContext();
@@ -6940,7 +7344,7 @@ var FavoritesListWidget = (props) => {
6940
7344
  // src/deprecated/recentList/recentList.ui.tsx
6941
7345
  init_collapseMarkets();
6942
7346
  init_marketsProvider();
6943
- init_column();
7347
+ init_column2();
6944
7348
  var RecentList = (props) => {
6945
7349
  const { dataSource, favorite, onSort, loading, getColumns, collapsed } = props;
6946
7350
  const { symbol, onSymbolChange } = useMarketsContext();
@@ -7010,6 +7414,7 @@ init_type();
7010
7414
 
7011
7415
  // src/pages/home/page.tsx
7012
7416
  init_marketsProvider();
7417
+ init_useMarketCategories();
7013
7418
  init_type();
7014
7419
  var LazyMarketsHeaderWidget = React6.lazy(
7015
7420
  () => Promise.resolve().then(() => (init_marketsHeader_widget(), marketsHeader_widget_exports)).then((mod) => {
@@ -7031,6 +7436,7 @@ var MarketsHomePage = (props) => {
7031
7436
  const [activeTab, setActiveTab] = useState(
7032
7437
  "markets" /* Markets */
7033
7438
  );
7439
+ const tabs = useMarketCategories("marketsDataList");
7034
7440
  return /* @__PURE__ */ jsx(
7035
7441
  MarketsProvider,
7036
7442
  {
@@ -7038,6 +7444,7 @@ var MarketsHomePage = (props) => {
7038
7444
  onSymbolChange: props.onSymbolChange,
7039
7445
  navProps: props.navProps,
7040
7446
  comparisonProps: props.comparisonProps,
7447
+ tabs,
7041
7448
  children: /* @__PURE__ */ jsx(
7042
7449
  "div",
7043
7450
  {
@@ -7161,7 +7568,8 @@ var MarketsMobileContent = (props) => {
7161
7568
  // src/index.ts
7162
7569
  init_marketsProvider();
7163
7570
  init_symbolDisplay();
7571
+ init_builtInTabRegistry();
7164
7572
 
7165
- export { CollapseMarkets, DropDownMarkets, DropDownMarketsConetnt, DropDownMarketsWidget, ExpandMarkets, ExpandMarketsWidget, FavoritesDropdownMenu, FavoritesDropdownMenuWidget, FavoritesList, FavoritesListFull, FavoritesListFullWidget, FavoritesListWidget, FavoritesTab, FavoritesTabWidget, FundingComparison, FundingComparisonWidget, FundingOverview, FundingOverviewWidget, FundingTabName, HorizontalMarkets, HorizontalMarketsWidget, MarketItem, MarketTypeFilter, MarketsDataList, MarketsDataListWidget, MarketsHeader, MarketsHeaderWidget, MarketsHomePage, MarketsList, MarketsListFull, MarketsListFullWidget, MarketsListWidget, MarketsPageTab, MarketsProvider, MarketsSheet, MarketsSheetWidget, MarketsTabName, NewListingList, NewListingListWidget, RecentList, RecentListWidget, SideMarkets, SideMarketsWidget, SubMenuMarkets, SubMenuMarketsWidget, SymbolDisplay, SymbolInfoBar, SymbolInfoBarFull, SymbolInfoBarFullWidget, SymbolInfoBarWidget, useDropDownMarketsColumns, useDropDownMarketsScript, useExpandMarketsScript, useFavoritesDropdownMenuScript, useFavoritesListFullScript, useFavoritesListScript, useFavoritesTabScript, useFundingComparisonScript, useFundingOverviewScript, useHorizontalMarketsScript, useMarketsDataListScript, useMarketsHeaderScript, useMarketsListFullScript, useMarketsListScript, useMarketsSheetScript, useNewListingListScript, useRecentListScript, useSideMarketsScript, useSubMenuMarketsScript, useSymbolInfoBarFullScript, useSymbolInfoBarScript };
7573
+ export { CollapseMarkets, CommunitySubTabName, DropDownMarkets, DropDownMarketsConetnt, DropDownMarketsWidget, ExpandMarkets, ExpandMarketsWidget, FavoritesDropdownMenu, FavoritesDropdownMenuWidget, FavoritesList, FavoritesListFull, FavoritesListFullWidget, FavoritesListWidget, FavoritesTab, FavoritesTabWidget, FundingComparison, FundingComparisonWidget, FundingOverview, FundingOverviewWidget, FundingTabName, HorizontalMarkets, HorizontalMarketsWidget, MarketItem, MarketTypeFilter, MarketsDataList, MarketsDataListWidget, MarketsHeader, MarketsHeaderWidget, MarketsHomePage, MarketsList, MarketsListFull, MarketsListFullWidget, MarketsListWidget, MarketsPageTab, MarketsProvider, MarketsSheet, MarketsSheetWidget, MarketsTabName, NewListingList, NewListingListWidget, RecentList, RecentListWidget, SideMarkets, SideMarketsWidget, SubMenuMarkets, SubMenuMarketsWidget, SymbolDisplay, SymbolInfoBar, SymbolInfoBarFull, SymbolInfoBarFullWidget, SymbolInfoBarRiskNotice, SymbolInfoBarWidget, builtInTabs, useDropDownMarketsColumns, useDropDownMarketsScript, useExpandMarketsScript, useFavoritesDropdownMenuScript, useFavoritesListFullScript, useFavoritesListScript, useFavoritesTabScript, useFundingComparisonScript, useFundingOverviewScript, useHorizontalMarketsScript, useMarketsDataListScript, useMarketsHeaderScript, useMarketsListFullScript, useMarketsListScript, useMarketsSheetScript, useNewListingListScript, useRecentListScript, useSideMarketsScript, useSubMenuMarketsScript, useSymbolInfoBarFullScript, useSymbolInfoBarScript };
7166
7574
  //# sourceMappingURL=index.mjs.map
7167
7575
  //# sourceMappingURL=index.mjs.map