@orderly.network/ui 2.8.6 → 2.8.7-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +3 -3
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +14 -1
- package/dist/index.d.ts +14 -1
- package/dist/index.js +117 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +117 -1
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -8813,6 +8813,122 @@ function useObserverElement(element, callback) {
|
|
|
8813
8813
|
};
|
|
8814
8814
|
}, [element]);
|
|
8815
8815
|
}
|
|
8816
|
+
function useLongPress(callback, longPressTime = 600) {
|
|
8817
|
+
const timeoutRef = useRef(null);
|
|
8818
|
+
const targetRef = useRef(null);
|
|
8819
|
+
const startPositionRef = useRef(null);
|
|
8820
|
+
const isLongPressTriggeredRef = useRef(false);
|
|
8821
|
+
const clearLongPress = useCallback(() => {
|
|
8822
|
+
if (timeoutRef.current) {
|
|
8823
|
+
clearTimeout(timeoutRef.current);
|
|
8824
|
+
timeoutRef.current = null;
|
|
8825
|
+
}
|
|
8826
|
+
targetRef.current = null;
|
|
8827
|
+
startPositionRef.current = null;
|
|
8828
|
+
isLongPressTriggeredRef.current = false;
|
|
8829
|
+
}, []);
|
|
8830
|
+
const startLongPress = useCallback(
|
|
8831
|
+
(e) => {
|
|
8832
|
+
clearLongPress();
|
|
8833
|
+
if ("touches" in e) {
|
|
8834
|
+
e.preventDefault();
|
|
8835
|
+
}
|
|
8836
|
+
targetRef.current = e.currentTarget;
|
|
8837
|
+
const clientX = "touches" in e ? e.touches[0]?.clientX : e.clientX;
|
|
8838
|
+
const clientY = "touches" in e ? e.touches[0]?.clientY : e.clientY;
|
|
8839
|
+
startPositionRef.current = { x: clientX, y: clientY };
|
|
8840
|
+
isLongPressTriggeredRef.current = false;
|
|
8841
|
+
timeoutRef.current = setTimeout(() => {
|
|
8842
|
+
if (targetRef.current && startPositionRef.current) {
|
|
8843
|
+
isLongPressTriggeredRef.current = true;
|
|
8844
|
+
callback();
|
|
8845
|
+
}
|
|
8846
|
+
clearLongPress();
|
|
8847
|
+
}, longPressTime);
|
|
8848
|
+
},
|
|
8849
|
+
[callback, longPressTime, clearLongPress]
|
|
8850
|
+
);
|
|
8851
|
+
const handleMouseDown = useCallback(
|
|
8852
|
+
(e) => {
|
|
8853
|
+
if (e.button !== 0)
|
|
8854
|
+
return;
|
|
8855
|
+
startLongPress(e);
|
|
8856
|
+
},
|
|
8857
|
+
[startLongPress]
|
|
8858
|
+
);
|
|
8859
|
+
const handleMouseUp = useCallback(() => {
|
|
8860
|
+
clearLongPress();
|
|
8861
|
+
}, [clearLongPress]);
|
|
8862
|
+
const handleMouseMove = useCallback(
|
|
8863
|
+
(e) => {
|
|
8864
|
+
if (isLongPressTriggeredRef.current)
|
|
8865
|
+
return;
|
|
8866
|
+
if (startPositionRef.current) {
|
|
8867
|
+
const deltaX = Math.abs(e.clientX - startPositionRef.current.x);
|
|
8868
|
+
const deltaY = Math.abs(e.clientY - startPositionRef.current.y);
|
|
8869
|
+
const threshold = 5;
|
|
8870
|
+
if (deltaX > threshold || deltaY > threshold) {
|
|
8871
|
+
clearLongPress();
|
|
8872
|
+
}
|
|
8873
|
+
}
|
|
8874
|
+
},
|
|
8875
|
+
[clearLongPress]
|
|
8876
|
+
);
|
|
8877
|
+
const handleMouseLeave = useCallback(() => {
|
|
8878
|
+
clearLongPress();
|
|
8879
|
+
}, [clearLongPress]);
|
|
8880
|
+
const handleContextMenu = useCallback((e) => {
|
|
8881
|
+
if (timeoutRef.current || isLongPressTriggeredRef.current) {
|
|
8882
|
+
e.preventDefault();
|
|
8883
|
+
e.stopPropagation();
|
|
8884
|
+
}
|
|
8885
|
+
}, []);
|
|
8886
|
+
const handleTouchStart = useCallback(
|
|
8887
|
+
(e) => {
|
|
8888
|
+
startLongPress(e);
|
|
8889
|
+
},
|
|
8890
|
+
[startLongPress]
|
|
8891
|
+
);
|
|
8892
|
+
const handleTouchEnd = useCallback(() => {
|
|
8893
|
+
clearLongPress();
|
|
8894
|
+
}, [clearLongPress]);
|
|
8895
|
+
const handleTouchMove = useCallback(
|
|
8896
|
+
(e) => {
|
|
8897
|
+
if (timeoutRef.current) {
|
|
8898
|
+
e.preventDefault();
|
|
8899
|
+
}
|
|
8900
|
+
if (isLongPressTriggeredRef.current)
|
|
8901
|
+
return;
|
|
8902
|
+
if (startPositionRef.current && e.touches[0]) {
|
|
8903
|
+
const deltaX = Math.abs(
|
|
8904
|
+
e.touches[0].clientX - startPositionRef.current.x
|
|
8905
|
+
);
|
|
8906
|
+
const deltaY = Math.abs(
|
|
8907
|
+
e.touches[0].clientY - startPositionRef.current.y
|
|
8908
|
+
);
|
|
8909
|
+
const threshold = 5;
|
|
8910
|
+
if (deltaX > threshold || deltaY > threshold) {
|
|
8911
|
+
clearLongPress();
|
|
8912
|
+
}
|
|
8913
|
+
}
|
|
8914
|
+
},
|
|
8915
|
+
[clearLongPress]
|
|
8916
|
+
);
|
|
8917
|
+
const handleTouchCancel = useCallback(() => {
|
|
8918
|
+
clearLongPress();
|
|
8919
|
+
}, [clearLongPress]);
|
|
8920
|
+
return {
|
|
8921
|
+
onMouseDown: handleMouseDown,
|
|
8922
|
+
onMouseUp: handleMouseUp,
|
|
8923
|
+
onMouseMove: handleMouseMove,
|
|
8924
|
+
onMouseLeave: handleMouseLeave,
|
|
8925
|
+
onContextMenu: handleContextMenu,
|
|
8926
|
+
onTouchStart: handleTouchStart,
|
|
8927
|
+
onTouchEnd: handleTouchEnd,
|
|
8928
|
+
onTouchMove: handleTouchMove,
|
|
8929
|
+
onTouchCancel: handleTouchCancel
|
|
8930
|
+
};
|
|
8931
|
+
}
|
|
8816
8932
|
var AlertDialog = (props) => {
|
|
8817
8933
|
const [locale] = useLocale("dialog");
|
|
8818
8934
|
const {
|
|
@@ -11286,6 +11402,6 @@ var DotStatus = (props) => {
|
|
|
11286
11402
|
};
|
|
11287
11403
|
DotStatus.displayName = "DotStatus";
|
|
11288
11404
|
|
|
11289
|
-
export { ActionSheet, AddCircleIcon, AffiliateIcon, AlertDialog, ArrowDownShortIcon, ArrowDownSquareFillIcon, ArrowDownUpIcon, ArrowLeftRightIcon, ArrowLeftRightSquareFill, ArrowLeftShortIcon, ArrowRightShortIcon, ArrowRightUpSquareFillIcon, ArrowUpShortIcon, ArrowUpSquareFillIcon, AssetIcon, Avatar, Badge, BarChartIcon, BattleActiveIcon, BattleIcon, BattleInactiveIcon, BattleSolidActiveIcon, BattleSolidInactiveIcon, BellIcon, Box, Button, Calendar, CalendarIcon, CalendarMinusIcon, Card, CardBase, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CaretDownIcon, CaretLeftIcon, CaretRightIcon, CaretUpIcon, ChainIcon, CheckIcon, CheckSquareEmptyIcon, Checkbox, CheckedCircleFillIcon, CheckedSquareFillIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CircleOutlinedIcon, CloseCircleFillIcon, CloseIcon, CloseRoundFillIcon, CloseSquareFillIcon, collapse_default as Collapse, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, ConfirmDialog, CopyIcon, DataFilter, DataTable, DatePicker2 as DatePicker, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Divider, DotStatus, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRoot, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuTrigger, EVMAvatar, EarnActiveIcon, EarnIcon, EarnInactiveIcon, EditIcon, Either, EmptyDataState, EmptyStateIcon, EsOrderlyIcon, ExclamationFillIcon, ExtensionPositionEnum, ExtensionSlot, EyeCloseIcon, EyeIcon, FeeTierIcon, Flex, GradientText, Grid2 as Grid, HoverCard, HoverCardContent, HoverCardRoot, HoverCardTrigger, Icon, InfoCircleIcon, Input2 as Input, InputAdditional, LeaderboardActiveIcon, LeaderboardInactiveIcon, LeftNavVaultsIcon, ListView, LocaleContext, LocaleProvider, Logo, MarketsActiveIcon, MarketsInactiveIcon, Marquee, ModalContext, ModalIdContext, ModalProvider, MultiSortHeader, NewsFillIcon, tailwind_exports as OUITailwind, OrderlyIcon, OrderlyThemeProvider, PaginationItems, PeopleIcon, PerpsIcon, PersonIcon, Picker, PlusIcon, Popover, PopoverAnchor, PopoverContent, PopoverRoot, PopoverTrigger, PopupUnionIcon, PortfolioActiveIcon, PortfolioInactiveIcon, QuestionFillIcon, ReduceIcon, ReferralSolidIcon, RefreshIcon, ScrollArea, ScrollBar, ScrollIndicator, Select2 as Select, SelectItem, SelectedChoicesFillIcon, ServerFillIcon, SettingFillIcon, SettingIcon, ShareIcon, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, SimpleDialog, SimpleDialogFooter, SimpleDropdownMenu, SimpleSheet, Slider, SortingAscIcon, SortingDescIcon, SortingIcon, Spinner, SpotIcon, SquareOutlinedIcon, StarChildChatActiveIcon, StarChildChatInactiveIcon, Statistic, StatisticLabel, SwapHorizIcon, Switch, TabPanel, features_exports as TableFeatures, Tabs, TabsBase, TabsContent, TabsList, TabsTrigger, Text2 as Text, TextField, ThrottledButton, ToastTile, Toaster, TokenIcon, Tooltip, TooltipArrow, TooltipContent, TooltipPortal, TooltipProvider, TooltipRoot, TooltipTrigger, TraderMobileIcon, TradingActiveIcon, TradingIcon, TradingInactiveIcon, TradingLeftNavIcon, TradingRewardsIcon, TriggerDialog, VaultsIcon, VectorIcon, WalletIcon, WoofiStakeIcon, boxVariants, buttonVariants, capitalizeFirstLetter, convertValueToPercentage, dotStatusVariants, formatAddress, gradientTextVariants, formatter_exports as inputFormatter, installExtension, modal, parseNumber, registerSimpleDialog, registerSimpleSheet, scrollAreaVariants, setExtensionBuilder, startViewTransition, statisticVariants, textVariants, tv, useLocale, useMediaQuery, useModal, useMultiSort, useObserverElement, useOrderlyTheme, usePagination, useScreen };
|
|
11405
|
+
export { ActionSheet, AddCircleIcon, AffiliateIcon, AlertDialog, ArrowDownShortIcon, ArrowDownSquareFillIcon, ArrowDownUpIcon, ArrowLeftRightIcon, ArrowLeftRightSquareFill, ArrowLeftShortIcon, ArrowRightShortIcon, ArrowRightUpSquareFillIcon, ArrowUpShortIcon, ArrowUpSquareFillIcon, AssetIcon, Avatar, Badge, BarChartIcon, BattleActiveIcon, BattleIcon, BattleInactiveIcon, BattleSolidActiveIcon, BattleSolidInactiveIcon, BellIcon, Box, Button, Calendar, CalendarIcon, CalendarMinusIcon, Card, CardBase, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CaretDownIcon, CaretLeftIcon, CaretRightIcon, CaretUpIcon, ChainIcon, CheckIcon, CheckSquareEmptyIcon, Checkbox, CheckedCircleFillIcon, CheckedSquareFillIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CircleOutlinedIcon, CloseCircleFillIcon, CloseIcon, CloseRoundFillIcon, CloseSquareFillIcon, collapse_default as Collapse, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, ConfirmDialog, CopyIcon, DataFilter, DataTable, DatePicker2 as DatePicker, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Divider, DotStatus, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRoot, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuTrigger, EVMAvatar, EarnActiveIcon, EarnIcon, EarnInactiveIcon, EditIcon, Either, EmptyDataState, EmptyStateIcon, EsOrderlyIcon, ExclamationFillIcon, ExtensionPositionEnum, ExtensionSlot, EyeCloseIcon, EyeIcon, FeeTierIcon, Flex, GradientText, Grid2 as Grid, HoverCard, HoverCardContent, HoverCardRoot, HoverCardTrigger, Icon, InfoCircleIcon, Input2 as Input, InputAdditional, LeaderboardActiveIcon, LeaderboardInactiveIcon, LeftNavVaultsIcon, ListView, LocaleContext, LocaleProvider, Logo, MarketsActiveIcon, MarketsInactiveIcon, Marquee, ModalContext, ModalIdContext, ModalProvider, MultiSortHeader, NewsFillIcon, tailwind_exports as OUITailwind, OrderlyIcon, OrderlyThemeProvider, PaginationItems, PeopleIcon, PerpsIcon, PersonIcon, Picker, PlusIcon, Popover, PopoverAnchor, PopoverContent, PopoverRoot, PopoverTrigger, PopupUnionIcon, PortfolioActiveIcon, PortfolioInactiveIcon, QuestionFillIcon, ReduceIcon, ReferralSolidIcon, RefreshIcon, ScrollArea, ScrollBar, ScrollIndicator, Select2 as Select, SelectItem, SelectedChoicesFillIcon, ServerFillIcon, SettingFillIcon, SettingIcon, ShareIcon, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, SimpleDialog, SimpleDialogFooter, SimpleDropdownMenu, SimpleSheet, Slider, SortingAscIcon, SortingDescIcon, SortingIcon, Spinner, SpotIcon, SquareOutlinedIcon, StarChildChatActiveIcon, StarChildChatInactiveIcon, Statistic, StatisticLabel, SwapHorizIcon, Switch, TabPanel, features_exports as TableFeatures, Tabs, TabsBase, TabsContent, TabsList, TabsTrigger, Text2 as Text, TextField, ThrottledButton, ToastTile, Toaster, TokenIcon, Tooltip, TooltipArrow, TooltipContent, TooltipPortal, TooltipProvider, TooltipRoot, TooltipTrigger, TraderMobileIcon, TradingActiveIcon, TradingIcon, TradingInactiveIcon, TradingLeftNavIcon, TradingRewardsIcon, TriggerDialog, VaultsIcon, VectorIcon, WalletIcon, WoofiStakeIcon, boxVariants, buttonVariants, capitalizeFirstLetter, convertValueToPercentage, dotStatusVariants, formatAddress, gradientTextVariants, formatter_exports as inputFormatter, installExtension, modal, parseNumber, registerSimpleDialog, registerSimpleSheet, scrollAreaVariants, setExtensionBuilder, startViewTransition, statisticVariants, textVariants, tv, useLocale, useLongPress, useMediaQuery, useModal, useMultiSort, useObserverElement, useOrderlyTheme, usePagination, useScreen };
|
|
11290
11406
|
//# sourceMappingURL=out.js.map
|
|
11291
11407
|
//# sourceMappingURL=index.mjs.map
|