@orderly.network/ui-scaffold 2.10.2 → 3.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +85 -36
- package/dist/index.d.ts +85 -36
- package/dist/index.js +6 -20
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -25
- package/dist/index.mjs.map +1 -1
- package/package.json +12 -11
package/dist/index.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import React6, { forwardRef, createContext,
|
|
1
|
+
import React6, { forwardRef, createContext, useRef, useEffect, useMemo, useCallback, useState, cloneElement, useContext, isValidElement } from 'react';
|
|
2
2
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
|
-
import {
|
|
3
|
+
import { injectable, tv, Flex, Text, Tooltip, Button, cn, DropdownMenuRoot, DropdownMenuTrigger, DropdownMenuPortal, DropdownMenuContent, DropdownMenuGroup, EVMAvatar, Divider, DropdownMenuItem, ChevronDownIcon, Box, PopoverRoot, PopoverAnchor, PopoverContent, SimpleDialog, Checkbox, useObserverElement, useScreen, modal, SimpleSheet, Logo, toast, VectorIcon, PeopleIcon, SwapHorizIcon, Sheet, SheetContent, ChevronLeftIcon, Dialog, DialogContent, DialogHeader, DialogTitle, DialogBody, Spinner, ChainIcon, ScrollArea, formatAddress, Popover, Grid, CopyIcon, TextField, inputFormatter, EyeIcon, EyeCloseIcon, SimpleDialogFooter, TooltipProvider, TooltipRoot, TooltipTrigger, BellIcon, TooltipContent, PopoverTrigger, PopupUnionIcon, CloseRoundFillIcon, SpotIcon, PerpsIcon, SelectedChoicesFillIcon } from '@orderly.network/ui';
|
|
4
4
|
import { useTranslation, i18n, useLocaleContext, Trans } from '@orderly.network/i18n';
|
|
5
|
-
import {
|
|
5
|
+
import { useAccount, useLocalStorage, useConfig, useTrack, useWalletConnector, useIndexPricesStream, WsNetworkStatus, useChains, useSubAccountQuery, useWsStatus, OrderlyContext, useMemoizedFn, useCollateral, usePositionStream, useMarginRatio, useLeverage, useMaintenanceStatus, useEventEmitter } from '@orderly.network/hooks';
|
|
6
6
|
import { useAppContext, useAppConfig } from '@orderly.network/react-app';
|
|
7
7
|
import { AccountStatusEnum, ABSTRACT_CHAIN_ID_MAP, EMPTY_LIST, TrackerEventName, EMPTY_OBJECT } from '@orderly.network/types';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { ChainSelectorDialogId, ChainSelectorWidget, ChainSelectorSheetId } from '@orderly.network/ui-chain-selector';
|
|
9
|
+
import { WalletConnectorModalId, WalletConnectorSheetId } from '@orderly.network/ui-connector';
|
|
10
10
|
import { Decimal, getTimestamp, windowGuard } from '@orderly.network/utils';
|
|
11
11
|
import jsQR from 'jsqr';
|
|
12
12
|
import { qrcode } from '@akamfoad/qr';
|
|
@@ -971,21 +971,14 @@ var useAccountMenu = () => {
|
|
|
971
971
|
isMobile
|
|
972
972
|
};
|
|
973
973
|
};
|
|
974
|
+
var InjectableAccountMenu = injectable(AccountMenu, "Account.AccountMenu");
|
|
974
975
|
var AccountMenuWidget = () => {
|
|
975
976
|
const state = useAccountMenu();
|
|
976
977
|
return /* @__PURE__ */ jsx(AccountMenu, { ...state });
|
|
977
978
|
};
|
|
978
|
-
installExtension({
|
|
979
|
-
name: "account-menu",
|
|
980
|
-
scope: ["*"],
|
|
981
|
-
positions: [ExtensionPositionEnum.AccountMenu],
|
|
982
|
-
builder: useAccountMenu,
|
|
983
|
-
__isInternal: true
|
|
984
|
-
})((props) => {
|
|
985
|
-
return /* @__PURE__ */ jsx(AccountMenu, { ...props });
|
|
986
|
-
});
|
|
987
979
|
var WalletConnectButtonExtension = () => {
|
|
988
|
-
|
|
980
|
+
const state = useAccountMenu();
|
|
981
|
+
return /* @__PURE__ */ jsx(InjectableAccountMenu, { ...state });
|
|
989
982
|
};
|
|
990
983
|
var useChainMenuScript = () => {
|
|
991
984
|
const [open2, setOpen] = useState(false);
|
|
@@ -1668,7 +1661,7 @@ var calculateAccountValue = (holdings, unsettlePnl, indexPrices) => {
|
|
|
1668
1661
|
if (!price) {
|
|
1669
1662
|
return acc;
|
|
1670
1663
|
}
|
|
1671
|
-
return
|
|
1664
|
+
return new Decimal(holding2.holding).times(price).add(holding2.isolated_margin ?? 0).add(acc).toNumber();
|
|
1672
1665
|
}, 0);
|
|
1673
1666
|
return holding + unsettlePnl;
|
|
1674
1667
|
};
|
|
@@ -5495,16 +5488,9 @@ var MainNavMenus = (props) => {
|
|
|
5495
5488
|
index
|
|
5496
5489
|
)) });
|
|
5497
5490
|
};
|
|
5498
|
-
|
|
5499
|
-
name: "default-main-nav-menus",
|
|
5500
|
-
scope: ["*"],
|
|
5501
|
-
positions: [ExtensionPositionEnum.MainMenus],
|
|
5502
|
-
__isInternal: true
|
|
5503
|
-
})((props) => {
|
|
5504
|
-
return /* @__PURE__ */ jsx(MainNavMenus, { ...props });
|
|
5505
|
-
});
|
|
5491
|
+
var InjectableMainNavMenus = injectable(MainNavMenus, "Layout.MainMenus");
|
|
5506
5492
|
var MainNavMenusExtension = (props) => {
|
|
5507
|
-
return /* @__PURE__ */ jsx(
|
|
5493
|
+
return /* @__PURE__ */ jsx(InjectableMainNavMenus, { ...props });
|
|
5508
5494
|
};
|
|
5509
5495
|
var MainNav = (props) => {
|
|
5510
5496
|
const { className, classNames, campaigns, campaignPosition } = props;
|