@funhub/platform 0.1.150 → 0.1.151

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.
Files changed (108) hide show
  1. package/dist/components/biz/business/banner/variants/basic-banner/inspector-schema.d.mts +5 -4
  2. package/dist/components/biz/business/banner/variants/basic-banner/inspector-schema.mjs +1 -1
  3. package/dist/components/biz/business/banner/variants/basic-banner/material.d.mts +3 -2
  4. package/dist/components/biz/business/banner-carousel/material.d.mts +3 -2
  5. package/dist/components/biz/business/banner-carousel/schema.d.mts +3 -2
  6. package/dist/components/biz/business/banner-carousel/schema.mjs +1 -1
  7. package/dist/components/biz/business/channel-list/material.d.mts +3 -2
  8. package/dist/components/biz/business/channel-list/schema.d.mts +3 -2
  9. package/dist/components/biz/business/channel-list/schema.mjs +1 -1
  10. package/dist/components/biz/business/detail/shared/registry.d.mts +17 -14
  11. package/dist/components/biz/business/detail/video-detail-actions/schema.mjs +1 -1
  12. package/dist/components/biz/business/detail/video-detail-info/material.d.mts +3 -2
  13. package/dist/components/biz/business/detail/video-detail-info/schema.d.mts +3 -2
  14. package/dist/components/biz/business/detail/video-detail-info/schema.mjs +1 -1
  15. package/dist/components/biz/business/detail/video-detail-info-title-tags-episodes/material.d.mts +3 -2
  16. package/dist/components/biz/business/detail/video-detail-info-title-tags-episodes/schema.d.mts +3 -2
  17. package/dist/components/biz/business/detail/video-detail-info-title-tags-episodes/schema.mjs +1 -1
  18. package/dist/components/biz/business/detail/video-detail-player/schema.mjs +1 -1
  19. package/dist/components/biz/business/detail/video-detail-player-bridge-only/schema.mjs +1 -1
  20. package/dist/components/biz/business/detail/video-detail-recommend/client.mjs +1 -1
  21. package/dist/components/biz/business/detail/video-detail-recommend/material.d.mts +11 -10
  22. package/dist/components/biz/business/detail/video-detail-recommend/schema.d.mts +11 -10
  23. package/dist/components/biz/business/detail/video-detail-recommend/schema.mjs +1 -1
  24. package/dist/components/biz/business/floating-ball/material.d.mts +3 -2
  25. package/dist/components/biz/business/floating-ball/schema.d.mts +5 -4
  26. package/dist/components/biz/business/floating-ball/schema.mjs +1 -1
  27. package/dist/components/biz/business/header-search/header-avatar-icon/schema.mjs +1 -1
  28. package/dist/components/biz/business/header-search/header-avatar-logo-search/material.d.mts +3 -2
  29. package/dist/components/biz/business/header-search/header-avatar-logo-search/schema.d.mts +3 -2
  30. package/dist/components/biz/business/header-search/header-avatar-logo-search/schema.mjs +1 -1
  31. package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/material.d.mts +3 -2
  32. package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/schema.d.mts +3 -2
  33. package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/schema.mjs +1 -1
  34. package/dist/components/biz/business/header-search/header-logo-search/material.d.mts +3 -2
  35. package/dist/components/biz/business/header-search/header-logo-search/schema.d.mts +3 -2
  36. package/dist/components/biz/business/header-search/header-logo-search/schema.mjs +1 -1
  37. package/dist/components/biz/business/header-search/header-search/schema.mjs +1 -1
  38. package/dist/components/biz/business/home-recommend/home-recommend-grid/inspector-schema.d.mts +13 -12
  39. package/dist/components/biz/business/home-recommend/home-recommend-grid/inspector-schema.mjs +1 -1
  40. package/dist/components/biz/business/home-recommend/home-recommend-grid/material.d.mts +13 -12
  41. package/dist/components/biz/business/home-recommend/home-recommend-waterfall/inspector-schema.d.mts +11 -10
  42. package/dist/components/biz/business/home-recommend/home-recommend-waterfall/inspector-schema.mjs +1 -1
  43. package/dist/components/biz/business/home-recommend/home-recommend-waterfall/material.d.mts +11 -10
  44. package/dist/components/biz/business/home-recommend/shared/home-recommend-base.mjs +1 -1
  45. package/dist/components/biz/business/home-recommend/shared/home-recommend-server-data.mjs +1 -1
  46. package/dist/components/biz/business/home-recommend/shared/home-recommend-video-detail.mjs +1 -1
  47. package/dist/components/biz/business/image-text-recommend/material.d.mts +15 -14
  48. package/dist/components/biz/business/image-text-recommend/schema.d.mts +15 -14
  49. package/dist/components/biz/business/image-text-recommend/schema.mjs +1 -1
  50. package/dist/components/biz/business/large-feature-grid/client.mjs +1 -1
  51. package/dist/components/biz/business/large-feature-grid/schema.mjs +1 -1
  52. package/dist/components/biz/business/marquee/material.d.mts +8 -7
  53. package/dist/components/biz/business/marquee/schema.d.mts +26 -24
  54. package/dist/components/biz/business/marquee/schema.mjs +1 -1
  55. package/dist/components/biz/business/profile/profile-header/schema.mjs +1 -1
  56. package/dist/components/biz/business/profile/profile-header/user-profile-avatar.mjs +1 -1
  57. package/dist/components/biz/business/profile/profile-main/schema.mjs +1 -1
  58. package/dist/components/biz/business/profile/profile-main/tabs/like-tab/client.d.mts +1 -1
  59. package/dist/components/biz/business/search-history/material.d.mts +3 -2
  60. package/dist/components/biz/business/search-history/schema.d.mts +3 -2
  61. package/dist/components/biz/business/search-history/schema.mjs +1 -1
  62. package/dist/components/biz/business/search-input/schema.mjs +1 -1
  63. package/dist/components/biz/business/shortcut-grid/material.d.mts +5 -4
  64. package/dist/components/biz/business/shortcut-grid/schema.d.mts +5 -4
  65. package/dist/components/biz/business/shortcut-grid/schema.mjs +1 -1
  66. package/dist/components/biz/business/tab-bar/schema.mjs +1 -1
  67. package/dist/components/biz/business/text-recommend/material.d.mts +4 -3
  68. package/dist/components/biz/business/text-recommend/schema.d.mts +4 -3
  69. package/dist/components/biz/business/text-recommend/schema.mjs +1 -1
  70. package/dist/components/biz/example/button/material.d.mts +9 -8
  71. package/dist/components/biz/example/button/schema.d.mts +21 -19
  72. package/dist/components/biz/example/button/schema.mjs +1 -1
  73. package/dist/components/pages/collection-add/page.mjs +1 -1
  74. package/dist/components/pages/collection-create/form.mjs +1 -1
  75. package/dist/components/pages/collection-detail/detail.mjs +1 -1
  76. package/dist/components/pages/login/verify.mjs +1 -1
  77. package/dist/components/pages/video-list/video-list-client.mjs +1 -1
  78. package/dist/components/ui/badge.d.mts +1 -1
  79. package/dist/components/ui/button.d.mts +2 -2
  80. package/dist/components/ui/dots-loading.d.mts +25 -0
  81. package/dist/components/ui/dots-loading.mjs +2 -0
  82. package/dist/hooks/use-first-row-height.d.mts +69 -0
  83. package/dist/hooks/use-first-row-height.mjs +2 -0
  84. package/dist/hooks/use-min-duration-loading.d.mts +18 -0
  85. package/dist/hooks/use-min-duration-loading.mjs +2 -0
  86. package/dist/hooks.d.mts +3 -1
  87. package/dist/hooks.mjs +1 -1
  88. package/dist/service/generated/client.d.mts +12 -4
  89. package/dist/service/generated/client.mjs +1 -1
  90. package/dist/service/generated/tanstack.d.mts +14 -4
  91. package/dist/service/generated/tanstack.mjs +1 -1
  92. package/dist/service/register-by-verify-email-code.d.mts +2 -2
  93. package/dist/service/register-by-verify-email-code.mjs +1 -1
  94. package/dist/service.d.mts +4 -4
  95. package/dist/service.mjs +1 -1
  96. package/dist/types.d.mts +548 -57
  97. package/dist/ui.d.mts +2 -1
  98. package/dist/ui.mjs +1 -1
  99. package/dist/utils/device-id.d.mts +14 -0
  100. package/dist/utils/device-id.mjs +2 -0
  101. package/dist/utils/http.mjs +1 -1
  102. package/dist/utils/schema/index.d.mts +1 -1
  103. package/dist/utils/schema/inspector.d.mts +43 -71
  104. package/dist/utils/schema/schema.d.mts +59 -53
  105. package/dist/utils/schema/schema.mjs +1 -1
  106. package/dist/utils.d.mts +3 -2
  107. package/dist/utils.mjs +1 -1
  108. package/package.json +1 -1
package/dist/ui.d.mts CHANGED
@@ -17,6 +17,7 @@ import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./component
17
17
  import { Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxLabel, ComboboxList, ComboboxSeparator, ComboboxTrigger, ComboboxValue, useComboboxAnchor } from "./components/ui/combobox.mjs";
18
18
  import { ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger } from "./components/ui/context-menu.mjs";
19
19
  import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger } from "./components/ui/dialog.mjs";
20
+ import { DotsLoading } from "./components/ui/dots-loading.mjs";
20
21
  import { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger } from "./components/ui/drawer.mjs";
21
22
  import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from "./components/ui/dropdown-menu.mjs";
22
23
  import { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, EmptyTitle, EmptyType } from "./components/ui/empty.mjs";
@@ -54,4 +55,4 @@ import { ToggleGroup, ToggleGroupItem } from "./components/ui/toggle-group.mjs";
54
55
  import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./components/ui/tooltip.mjs";
55
56
  import { WheelPicker, WheelPickerClassNames, WheelPickerOption, WheelPickerWrapper } from "./components/ui/wheel-picker.mjs";
56
57
  import { toast } from "sonner";
57
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertAction, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AspectRatio, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, BaseImageProps, Box, BoxAs, BoxComponentProps, BoxProps, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselApi, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxLabel, ComboboxList, ComboboxSeparator, ComboboxTrigger, ComboboxValue, CommonImageProps, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, EmptyTitle, EmptyType, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, HoverCard, HoverCardContent, HoverCardTrigger, Image, ImageProps, ImagePropsWithFill, ImagePropsWithSize, InfiniteScroll, InfiniteScrollProps, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, Kbd, KbdGroup, Label, List, ListItem, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, NativeSelect, NativeSelectOptGroup, NativeSelectOption, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, Progress, ProgressIndicator, ProgressLabel, ProgressTrack, ProgressValue, RadioGroup, RadioGroupItem, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Skeleton, Slider, Spinner, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Text, TextAs, TextComponentProps, TextProps, Textarea, Time, TimeMode, TimeProps, TimeValue, TimeValueUnit, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, WheelPicker, WheelPickerClassNames, WheelPickerOption, WheelPickerWrapper, badgeVariants, buttonGroupVariants, buttonVariants, normalizeTimeToMilliseconds, tabsListVariants, toast, toggleVariants, useCarousel, useComboboxAnchor };
58
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertAction, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AspectRatio, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, BaseImageProps, Box, BoxAs, BoxComponentProps, BoxProps, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselApi, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxLabel, ComboboxList, ComboboxSeparator, ComboboxTrigger, ComboboxValue, CommonImageProps, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DotsLoading, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, EmptyTitle, EmptyType, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, HoverCard, HoverCardContent, HoverCardTrigger, Image, ImageProps, ImagePropsWithFill, ImagePropsWithSize, InfiniteScroll, InfiniteScrollProps, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, Kbd, KbdGroup, Label, List, ListItem, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, NativeSelect, NativeSelectOptGroup, NativeSelectOption, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, Progress, ProgressIndicator, ProgressLabel, ProgressTrack, ProgressValue, RadioGroup, RadioGroupItem, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Skeleton, Slider, Spinner, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Text, TextAs, TextComponentProps, TextProps, Textarea, Time, TimeMode, TimeProps, TimeValue, TimeValueUnit, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, WheelPicker, WheelPickerClassNames, WheelPickerOption, WheelPickerWrapper, badgeVariants, buttonGroupVariants, buttonVariants, normalizeTimeToMilliseconds, tabsListVariants, toast, toggleVariants, useCarousel, useComboboxAnchor };
package/dist/ui.mjs CHANGED
@@ -1,2 +1,2 @@
1
1
 
2
- import{Accordion as e,AccordionContent as t,AccordionItem as n,AccordionTrigger as r}from"./components/ui/accordion.mjs";import{Alert as i,AlertAction as a,AlertDescription as o,AlertTitle as s}from"./components/ui/alert.mjs";import{Button as c,buttonVariants as l}from"./components/ui/button.mjs";import{AlertDialog as u,AlertDialogAction as d,AlertDialogCancel as f,AlertDialogContent as p,AlertDialogDescription as m,AlertDialogFooter as h,AlertDialogHeader as g,AlertDialogMedia as _,AlertDialogOverlay as v,AlertDialogPortal as y,AlertDialogTitle as b,AlertDialogTrigger as x}from"./components/ui/alert-dialog.mjs";import{AspectRatio as S}from"./components/ui/aspect-ratio.mjs";import{Image as C}from"./components/ui/image.mjs";import{Avatar as w,AvatarBadge as T,AvatarFallback as E,AvatarGroup as D,AvatarGroupCount as O,AvatarImage as k}from"./components/ui/avatar.mjs";import{Badge as A,badgeVariants as j}from"./components/ui/badge.mjs";import{Box as M}from"./components/ui/box.mjs";import{Breadcrumb as N,BreadcrumbEllipsis as P,BreadcrumbItem as F,BreadcrumbLink as I,BreadcrumbList as L,BreadcrumbPage as R,BreadcrumbSeparator as z}from"./components/ui/breadcrumb.mjs";import{Separator as B}from"./components/ui/separator.mjs";import{ButtonGroup as V,ButtonGroupSeparator as H,ButtonGroupText as U,buttonGroupVariants as W}from"./components/ui/button-group.mjs";import{Card as G,CardAction as K,CardContent as q,CardDescription as J,CardFooter as Y,CardHeader as X,CardTitle as Z}from"./components/ui/card.mjs";import{Carousel as Q,CarouselContent as $,CarouselItem as ee,CarouselNext as te,CarouselPrevious as ne,useCarousel as re}from"./components/ui/carousel.mjs";import{Checkbox as ie}from"./components/ui/checkbox.mjs";import{Collapsible as ae,CollapsibleContent as oe,CollapsibleTrigger as se}from"./components/ui/collapsible.mjs";import{Input as ce}from"./components/ui/input.mjs";import{Textarea as le}from"./components/ui/textarea.mjs";import{InputGroup as ue,InputGroupAddon as de,InputGroupButton as fe,InputGroupInput as pe,InputGroupText as me,InputGroupTextarea as he}from"./components/ui/input-group.mjs";import{Combobox as ge,ComboboxChip as _e,ComboboxChips as ve,ComboboxChipsInput as ye,ComboboxCollection as be,ComboboxContent as xe,ComboboxEmpty as Se,ComboboxGroup as Ce,ComboboxInput as we,ComboboxItem as Te,ComboboxLabel as Ee,ComboboxList as De,ComboboxSeparator as Oe,ComboboxTrigger as ke,ComboboxValue as Ae,useComboboxAnchor as je}from"./components/ui/combobox.mjs";import{ContextMenu as Me,ContextMenuCheckboxItem as Ne,ContextMenuContent as Pe,ContextMenuGroup as Fe,ContextMenuItem as Ie,ContextMenuLabel as Le,ContextMenuPortal as Re,ContextMenuRadioGroup as ze,ContextMenuRadioItem as Be,ContextMenuSeparator as Ve,ContextMenuShortcut as He,ContextMenuSub as Ue,ContextMenuSubContent as We,ContextMenuSubTrigger as Ge,ContextMenuTrigger as Ke}from"./components/ui/context-menu.mjs";import{Dialog as qe,DialogClose as Je,DialogContent as Ye,DialogDescription as Xe,DialogFooter as Ze,DialogHeader as Qe,DialogOverlay as $e,DialogPortal as et,DialogTitle as tt,DialogTrigger as nt}from"./components/ui/dialog.mjs";import{Drawer as rt,DrawerClose as it,DrawerContent as at,DrawerDescription as ot,DrawerFooter as st,DrawerHeader as ct,DrawerOverlay as lt,DrawerPortal as ut,DrawerTitle as dt,DrawerTrigger as ft}from"./components/ui/drawer.mjs";import{DropdownMenu as pt,DropdownMenuCheckboxItem as mt,DropdownMenuContent as ht,DropdownMenuGroup as gt,DropdownMenuItem as _t,DropdownMenuLabel as vt,DropdownMenuPortal as yt,DropdownMenuRadioGroup as bt,DropdownMenuRadioItem as xt,DropdownMenuSeparator as St,DropdownMenuShortcut as Ct,DropdownMenuSub as wt,DropdownMenuSubContent as Tt,DropdownMenuSubTrigger as Et,DropdownMenuTrigger as Dt}from"./components/ui/dropdown-menu.mjs";import{Empty as Ot,EmptyContent as kt,EmptyDescription as At,EmptyHeader as jt,EmptyMedia as Mt,EmptyState as Nt,EmptyTitle as Pt}from"./components/ui/empty.mjs";import{Label as Ft}from"./components/ui/label.mjs";import{Field as It,FieldContent as Lt,FieldDescription as Rt,FieldError as zt,FieldGroup as Bt,FieldLabel as Vt,FieldLegend as Ht,FieldSeparator as Ut,FieldSet as Wt,FieldTitle as Gt}from"./components/ui/field.mjs";import{HoverCard as Kt,HoverCardContent as qt,HoverCardTrigger as Jt}from"./components/ui/hover-card.mjs";import{InfiniteScroll as Yt}from"./components/ui/infinite-scroll.mjs";import{Item as Xt,ItemActions as Zt,ItemContent as Qt,ItemDescription as $t,ItemFooter as en,ItemGroup as tn,ItemHeader as nn,ItemMedia as rn,ItemSeparator as an,ItemTitle as on}from"./components/ui/item.mjs";import{Kbd as sn,KbdGroup as cn}from"./components/ui/kbd.mjs";import{List as ln,ListItem as un}from"./components/ui/list.mjs";import{Menubar as dn,MenubarCheckboxItem as fn,MenubarContent as pn,MenubarGroup as mn,MenubarItem as hn,MenubarLabel as gn,MenubarMenu as _n,MenubarPortal as vn,MenubarRadioGroup as yn,MenubarRadioItem as bn,MenubarSeparator as xn,MenubarShortcut as Sn,MenubarSub as Cn,MenubarSubContent as wn,MenubarSubTrigger as Tn,MenubarTrigger as En}from"./components/ui/menubar.mjs";import{NativeSelect as Dn,NativeSelectOptGroup as On,NativeSelectOption as kn}from"./components/ui/native-select.mjs";import{Pagination as An,PaginationContent as jn,PaginationEllipsis as Mn,PaginationItem as Nn,PaginationLink as Pn,PaginationNext as Fn,PaginationPrevious as In}from"./components/ui/pagination.mjs";import{Popover as Ln,PopoverContent as Rn,PopoverDescription as zn,PopoverHeader as Bn,PopoverTitle as Vn,PopoverTrigger as Hn}from"./components/ui/popover.mjs";import{Progress as Un,ProgressIndicator as Wn,ProgressLabel as Gn,ProgressTrack as Kn,ProgressValue as qn}from"./components/ui/progress.mjs";import{RadioGroup as Jn,RadioGroupItem as Yn}from"./components/ui/radio-group.mjs";import{ScrollArea as Xn,ScrollBar as Zn}from"./components/ui/scroll-area.mjs";import{Select as Qn,SelectContent as $n,SelectGroup as er,SelectItem as tr,SelectLabel as nr,SelectScrollDownButton as rr,SelectScrollUpButton as ir,SelectSeparator as ar,SelectTrigger as or,SelectValue as sr}from"./components/ui/select.mjs";import{Sheet as cr,SheetClose as lr,SheetContent as ur,SheetDescription as dr,SheetFooter as fr,SheetHeader as pr,SheetTitle as mr,SheetTrigger as hr}from"./components/ui/sheet.mjs";import{Skeleton as gr}from"./components/ui/skeleton.mjs";import{Slider as _r}from"./components/ui/slider.mjs";import{Toaster as vr}from"./components/ui/sonner.mjs";import{Spinner as yr}from"./components/ui/spinner.mjs";import{Switch as br}from"./components/ui/switch.mjs";import{Table as xr,TableBody as Sr,TableCaption as Cr,TableCell as wr,TableFooter as Tr,TableHead as Er,TableHeader as Dr,TableRow as Or}from"./components/ui/table.mjs";import{Tabs as kr,TabsContent as Ar,TabsList as jr,TabsTrigger as Mr,tabsListVariants as Nr}from"./components/ui/tabs.mjs";import{Text as Pr}from"./components/ui/text.mjs";import{Time as Fr,normalizeTimeToMilliseconds as Ir}from"./components/ui/time.mjs";import{Toggle as Lr,toggleVariants as Rr}from"./components/ui/toggle.mjs";import{ToggleGroup as zr,ToggleGroupItem as Br}from"./components/ui/toggle-group.mjs";import{Tooltip as Vr,TooltipContent as Hr,TooltipProvider as Ur,TooltipTrigger as Wr}from"./components/ui/tooltip.mjs";import{WheelPicker as Gr,WheelPickerWrapper as Kr}from"./components/ui/wheel-picker.mjs";import{toast as qr}from"sonner";export{e as Accordion,t as AccordionContent,n as AccordionItem,r as AccordionTrigger,i as Alert,a as AlertAction,o as AlertDescription,u as AlertDialog,d as AlertDialogAction,f as AlertDialogCancel,p as AlertDialogContent,m as AlertDialogDescription,h as AlertDialogFooter,g as AlertDialogHeader,_ as AlertDialogMedia,v as AlertDialogOverlay,y as AlertDialogPortal,b as AlertDialogTitle,x as AlertDialogTrigger,s as AlertTitle,S as AspectRatio,w as Avatar,T as AvatarBadge,E as AvatarFallback,D as AvatarGroup,O as AvatarGroupCount,k as AvatarImage,A as Badge,M as Box,N as Breadcrumb,P as BreadcrumbEllipsis,F as BreadcrumbItem,I as BreadcrumbLink,L as BreadcrumbList,R as BreadcrumbPage,z as BreadcrumbSeparator,c as Button,V as ButtonGroup,H as ButtonGroupSeparator,U as ButtonGroupText,G as Card,K as CardAction,q as CardContent,J as CardDescription,Y as CardFooter,X as CardHeader,Z as CardTitle,Q as Carousel,$ as CarouselContent,ee as CarouselItem,te as CarouselNext,ne as CarouselPrevious,ie as Checkbox,ae as Collapsible,oe as CollapsibleContent,se as CollapsibleTrigger,ge as Combobox,_e as ComboboxChip,ve as ComboboxChips,ye as ComboboxChipsInput,be as ComboboxCollection,xe as ComboboxContent,Se as ComboboxEmpty,Ce as ComboboxGroup,we as ComboboxInput,Te as ComboboxItem,Ee as ComboboxLabel,De as ComboboxList,Oe as ComboboxSeparator,ke as ComboboxTrigger,Ae as ComboboxValue,Me as ContextMenu,Ne as ContextMenuCheckboxItem,Pe as ContextMenuContent,Fe as ContextMenuGroup,Ie as ContextMenuItem,Le as ContextMenuLabel,Re as ContextMenuPortal,ze as ContextMenuRadioGroup,Be as ContextMenuRadioItem,Ve as ContextMenuSeparator,He as ContextMenuShortcut,Ue as ContextMenuSub,We as ContextMenuSubContent,Ge as ContextMenuSubTrigger,Ke as ContextMenuTrigger,qe as Dialog,Je as DialogClose,Ye as DialogContent,Xe as DialogDescription,Ze as DialogFooter,Qe as DialogHeader,$e as DialogOverlay,et as DialogPortal,tt as DialogTitle,nt as DialogTrigger,rt as Drawer,it as DrawerClose,at as DrawerContent,ot as DrawerDescription,st as DrawerFooter,ct as DrawerHeader,lt as DrawerOverlay,ut as DrawerPortal,dt as DrawerTitle,ft as DrawerTrigger,pt as DropdownMenu,mt as DropdownMenuCheckboxItem,ht as DropdownMenuContent,gt as DropdownMenuGroup,_t as DropdownMenuItem,vt as DropdownMenuLabel,yt as DropdownMenuPortal,bt as DropdownMenuRadioGroup,xt as DropdownMenuRadioItem,St as DropdownMenuSeparator,Ct as DropdownMenuShortcut,wt as DropdownMenuSub,Tt as DropdownMenuSubContent,Et as DropdownMenuSubTrigger,Dt as DropdownMenuTrigger,Ot as Empty,kt as EmptyContent,At as EmptyDescription,jt as EmptyHeader,Mt as EmptyMedia,Nt as EmptyState,Pt as EmptyTitle,It as Field,Lt as FieldContent,Rt as FieldDescription,zt as FieldError,Bt as FieldGroup,Vt as FieldLabel,Ht as FieldLegend,Ut as FieldSeparator,Wt as FieldSet,Gt as FieldTitle,Kt as HoverCard,qt as HoverCardContent,Jt as HoverCardTrigger,C as Image,Yt as InfiniteScroll,ce as Input,ue as InputGroup,de as InputGroupAddon,fe as InputGroupButton,pe as InputGroupInput,me as InputGroupText,he as InputGroupTextarea,Xt as Item,Zt as ItemActions,Qt as ItemContent,$t as ItemDescription,en as ItemFooter,tn as ItemGroup,nn as ItemHeader,rn as ItemMedia,an as ItemSeparator,on as ItemTitle,sn as Kbd,cn as KbdGroup,Ft as Label,ln as List,un as ListItem,dn as Menubar,fn as MenubarCheckboxItem,pn as MenubarContent,mn as MenubarGroup,hn as MenubarItem,gn as MenubarLabel,_n as MenubarMenu,vn as MenubarPortal,yn as MenubarRadioGroup,bn as MenubarRadioItem,xn as MenubarSeparator,Sn as MenubarShortcut,Cn as MenubarSub,wn as MenubarSubContent,Tn as MenubarSubTrigger,En as MenubarTrigger,Dn as NativeSelect,On as NativeSelectOptGroup,kn as NativeSelectOption,An as Pagination,jn as PaginationContent,Mn as PaginationEllipsis,Nn as PaginationItem,Pn as PaginationLink,Fn as PaginationNext,In as PaginationPrevious,Ln as Popover,Rn as PopoverContent,zn as PopoverDescription,Bn as PopoverHeader,Vn as PopoverTitle,Hn as PopoverTrigger,Un as Progress,Wn as ProgressIndicator,Gn as ProgressLabel,Kn as ProgressTrack,qn as ProgressValue,Jn as RadioGroup,Yn as RadioGroupItem,Xn as ScrollArea,Zn as ScrollBar,Qn as Select,$n as SelectContent,er as SelectGroup,tr as SelectItem,nr as SelectLabel,rr as SelectScrollDownButton,ir as SelectScrollUpButton,ar as SelectSeparator,or as SelectTrigger,sr as SelectValue,B as Separator,cr as Sheet,lr as SheetClose,ur as SheetContent,dr as SheetDescription,fr as SheetFooter,pr as SheetHeader,mr as SheetTitle,hr as SheetTrigger,gr as Skeleton,_r as Slider,yr as Spinner,br as Switch,xr as Table,Sr as TableBody,Cr as TableCaption,wr as TableCell,Tr as TableFooter,Er as TableHead,Dr as TableHeader,Or as TableRow,kr as Tabs,Ar as TabsContent,jr as TabsList,Mr as TabsTrigger,Pr as Text,le as Textarea,Fr as Time,vr as Toaster,Lr as Toggle,zr as ToggleGroup,Br as ToggleGroupItem,Vr as Tooltip,Hr as TooltipContent,Ur as TooltipProvider,Wr as TooltipTrigger,Gr as WheelPicker,Kr as WheelPickerWrapper,j as badgeVariants,W as buttonGroupVariants,l as buttonVariants,Ir as normalizeTimeToMilliseconds,Nr as tabsListVariants,qr as toast,Rr as toggleVariants,re as useCarousel,je as useComboboxAnchor};
2
+ import{Accordion as e,AccordionContent as t,AccordionItem as n,AccordionTrigger as r}from"./components/ui/accordion.mjs";import{Alert as i,AlertAction as a,AlertDescription as o,AlertTitle as s}from"./components/ui/alert.mjs";import{Button as c,buttonVariants as l}from"./components/ui/button.mjs";import{AlertDialog as u,AlertDialogAction as d,AlertDialogCancel as f,AlertDialogContent as p,AlertDialogDescription as m,AlertDialogFooter as h,AlertDialogHeader as g,AlertDialogMedia as _,AlertDialogOverlay as v,AlertDialogPortal as y,AlertDialogTitle as b,AlertDialogTrigger as x}from"./components/ui/alert-dialog.mjs";import{AspectRatio as S}from"./components/ui/aspect-ratio.mjs";import{Image as C}from"./components/ui/image.mjs";import{Avatar as w,AvatarBadge as T,AvatarFallback as E,AvatarGroup as D,AvatarGroupCount as O,AvatarImage as k}from"./components/ui/avatar.mjs";import{Badge as A,badgeVariants as j}from"./components/ui/badge.mjs";import{Box as M}from"./components/ui/box.mjs";import{Breadcrumb as N,BreadcrumbEllipsis as P,BreadcrumbItem as F,BreadcrumbLink as I,BreadcrumbList as L,BreadcrumbPage as R,BreadcrumbSeparator as z}from"./components/ui/breadcrumb.mjs";import{Separator as B}from"./components/ui/separator.mjs";import{ButtonGroup as V,ButtonGroupSeparator as H,ButtonGroupText as U,buttonGroupVariants as W}from"./components/ui/button-group.mjs";import{Card as G,CardAction as K,CardContent as q,CardDescription as J,CardFooter as Y,CardHeader as X,CardTitle as Z}from"./components/ui/card.mjs";import{Carousel as Q,CarouselContent as $,CarouselItem as ee,CarouselNext as te,CarouselPrevious as ne,useCarousel as re}from"./components/ui/carousel.mjs";import{Checkbox as ie}from"./components/ui/checkbox.mjs";import{Collapsible as ae,CollapsibleContent as oe,CollapsibleTrigger as se}from"./components/ui/collapsible.mjs";import{Input as ce}from"./components/ui/input.mjs";import{Textarea as le}from"./components/ui/textarea.mjs";import{InputGroup as ue,InputGroupAddon as de,InputGroupButton as fe,InputGroupInput as pe,InputGroupText as me,InputGroupTextarea as he}from"./components/ui/input-group.mjs";import{Combobox as ge,ComboboxChip as _e,ComboboxChips as ve,ComboboxChipsInput as ye,ComboboxCollection as be,ComboboxContent as xe,ComboboxEmpty as Se,ComboboxGroup as Ce,ComboboxInput as we,ComboboxItem as Te,ComboboxLabel as Ee,ComboboxList as De,ComboboxSeparator as Oe,ComboboxTrigger as ke,ComboboxValue as Ae,useComboboxAnchor as je}from"./components/ui/combobox.mjs";import{ContextMenu as Me,ContextMenuCheckboxItem as Ne,ContextMenuContent as Pe,ContextMenuGroup as Fe,ContextMenuItem as Ie,ContextMenuLabel as Le,ContextMenuPortal as Re,ContextMenuRadioGroup as ze,ContextMenuRadioItem as Be,ContextMenuSeparator as Ve,ContextMenuShortcut as He,ContextMenuSub as Ue,ContextMenuSubContent as We,ContextMenuSubTrigger as Ge,ContextMenuTrigger as Ke}from"./components/ui/context-menu.mjs";import{Dialog as qe,DialogClose as Je,DialogContent as Ye,DialogDescription as Xe,DialogFooter as Ze,DialogHeader as Qe,DialogOverlay as $e,DialogPortal as et,DialogTitle as tt,DialogTrigger as nt}from"./components/ui/dialog.mjs";import{DotsLoading as rt}from"./components/ui/dots-loading.mjs";import{Drawer as it,DrawerClose as at,DrawerContent as ot,DrawerDescription as st,DrawerFooter as ct,DrawerHeader as lt,DrawerOverlay as ut,DrawerPortal as dt,DrawerTitle as ft,DrawerTrigger as pt}from"./components/ui/drawer.mjs";import{DropdownMenu as mt,DropdownMenuCheckboxItem as ht,DropdownMenuContent as gt,DropdownMenuGroup as _t,DropdownMenuItem as vt,DropdownMenuLabel as yt,DropdownMenuPortal as bt,DropdownMenuRadioGroup as xt,DropdownMenuRadioItem as St,DropdownMenuSeparator as Ct,DropdownMenuShortcut as wt,DropdownMenuSub as Tt,DropdownMenuSubContent as Et,DropdownMenuSubTrigger as Dt,DropdownMenuTrigger as Ot}from"./components/ui/dropdown-menu.mjs";import{Empty as kt,EmptyContent as At,EmptyDescription as jt,EmptyHeader as Mt,EmptyMedia as Nt,EmptyState as Pt,EmptyTitle as Ft}from"./components/ui/empty.mjs";import{Label as It}from"./components/ui/label.mjs";import{Field as Lt,FieldContent as Rt,FieldDescription as zt,FieldError as Bt,FieldGroup as Vt,FieldLabel as Ht,FieldLegend as Ut,FieldSeparator as Wt,FieldSet as Gt,FieldTitle as Kt}from"./components/ui/field.mjs";import{HoverCard as qt,HoverCardContent as Jt,HoverCardTrigger as Yt}from"./components/ui/hover-card.mjs";import{InfiniteScroll as Xt}from"./components/ui/infinite-scroll.mjs";import{Item as Zt,ItemActions as Qt,ItemContent as $t,ItemDescription as en,ItemFooter as tn,ItemGroup as nn,ItemHeader as rn,ItemMedia as an,ItemSeparator as on,ItemTitle as sn}from"./components/ui/item.mjs";import{Kbd as cn,KbdGroup as ln}from"./components/ui/kbd.mjs";import{List as un,ListItem as dn}from"./components/ui/list.mjs";import{Menubar as fn,MenubarCheckboxItem as pn,MenubarContent as mn,MenubarGroup as hn,MenubarItem as gn,MenubarLabel as _n,MenubarMenu as vn,MenubarPortal as yn,MenubarRadioGroup as bn,MenubarRadioItem as xn,MenubarSeparator as Sn,MenubarShortcut as Cn,MenubarSub as wn,MenubarSubContent as Tn,MenubarSubTrigger as En,MenubarTrigger as Dn}from"./components/ui/menubar.mjs";import{NativeSelect as On,NativeSelectOptGroup as kn,NativeSelectOption as An}from"./components/ui/native-select.mjs";import{Pagination as jn,PaginationContent as Mn,PaginationEllipsis as Nn,PaginationItem as Pn,PaginationLink as Fn,PaginationNext as In,PaginationPrevious as Ln}from"./components/ui/pagination.mjs";import{Popover as Rn,PopoverContent as zn,PopoverDescription as Bn,PopoverHeader as Vn,PopoverTitle as Hn,PopoverTrigger as Un}from"./components/ui/popover.mjs";import{Progress as Wn,ProgressIndicator as Gn,ProgressLabel as Kn,ProgressTrack as qn,ProgressValue as Jn}from"./components/ui/progress.mjs";import{RadioGroup as Yn,RadioGroupItem as Xn}from"./components/ui/radio-group.mjs";import{ScrollArea as Zn,ScrollBar as Qn}from"./components/ui/scroll-area.mjs";import{Select as $n,SelectContent as er,SelectGroup as tr,SelectItem as nr,SelectLabel as rr,SelectScrollDownButton as ir,SelectScrollUpButton as ar,SelectSeparator as or,SelectTrigger as sr,SelectValue as cr}from"./components/ui/select.mjs";import{Sheet as lr,SheetClose as ur,SheetContent as dr,SheetDescription as fr,SheetFooter as pr,SheetHeader as mr,SheetTitle as hr,SheetTrigger as gr}from"./components/ui/sheet.mjs";import{Skeleton as _r}from"./components/ui/skeleton.mjs";import{Slider as vr}from"./components/ui/slider.mjs";import{Toaster as yr}from"./components/ui/sonner.mjs";import{Spinner as br}from"./components/ui/spinner.mjs";import{Switch as xr}from"./components/ui/switch.mjs";import{Table as Sr,TableBody as Cr,TableCaption as wr,TableCell as Tr,TableFooter as Er,TableHead as Dr,TableHeader as Or,TableRow as kr}from"./components/ui/table.mjs";import{Tabs as Ar,TabsContent as jr,TabsList as Mr,TabsTrigger as Nr,tabsListVariants as Pr}from"./components/ui/tabs.mjs";import{Text as Fr}from"./components/ui/text.mjs";import{Time as Ir,normalizeTimeToMilliseconds as Lr}from"./components/ui/time.mjs";import{Toggle as Rr,toggleVariants as zr}from"./components/ui/toggle.mjs";import{ToggleGroup as Br,ToggleGroupItem as Vr}from"./components/ui/toggle-group.mjs";import{Tooltip as Hr,TooltipContent as Ur,TooltipProvider as Wr,TooltipTrigger as Gr}from"./components/ui/tooltip.mjs";import{WheelPicker as Kr,WheelPickerWrapper as qr}from"./components/ui/wheel-picker.mjs";import{toast as Jr}from"sonner";export{e as Accordion,t as AccordionContent,n as AccordionItem,r as AccordionTrigger,i as Alert,a as AlertAction,o as AlertDescription,u as AlertDialog,d as AlertDialogAction,f as AlertDialogCancel,p as AlertDialogContent,m as AlertDialogDescription,h as AlertDialogFooter,g as AlertDialogHeader,_ as AlertDialogMedia,v as AlertDialogOverlay,y as AlertDialogPortal,b as AlertDialogTitle,x as AlertDialogTrigger,s as AlertTitle,S as AspectRatio,w as Avatar,T as AvatarBadge,E as AvatarFallback,D as AvatarGroup,O as AvatarGroupCount,k as AvatarImage,A as Badge,M as Box,N as Breadcrumb,P as BreadcrumbEllipsis,F as BreadcrumbItem,I as BreadcrumbLink,L as BreadcrumbList,R as BreadcrumbPage,z as BreadcrumbSeparator,c as Button,V as ButtonGroup,H as ButtonGroupSeparator,U as ButtonGroupText,G as Card,K as CardAction,q as CardContent,J as CardDescription,Y as CardFooter,X as CardHeader,Z as CardTitle,Q as Carousel,$ as CarouselContent,ee as CarouselItem,te as CarouselNext,ne as CarouselPrevious,ie as Checkbox,ae as Collapsible,oe as CollapsibleContent,se as CollapsibleTrigger,ge as Combobox,_e as ComboboxChip,ve as ComboboxChips,ye as ComboboxChipsInput,be as ComboboxCollection,xe as ComboboxContent,Se as ComboboxEmpty,Ce as ComboboxGroup,we as ComboboxInput,Te as ComboboxItem,Ee as ComboboxLabel,De as ComboboxList,Oe as ComboboxSeparator,ke as ComboboxTrigger,Ae as ComboboxValue,Me as ContextMenu,Ne as ContextMenuCheckboxItem,Pe as ContextMenuContent,Fe as ContextMenuGroup,Ie as ContextMenuItem,Le as ContextMenuLabel,Re as ContextMenuPortal,ze as ContextMenuRadioGroup,Be as ContextMenuRadioItem,Ve as ContextMenuSeparator,He as ContextMenuShortcut,Ue as ContextMenuSub,We as ContextMenuSubContent,Ge as ContextMenuSubTrigger,Ke as ContextMenuTrigger,qe as Dialog,Je as DialogClose,Ye as DialogContent,Xe as DialogDescription,Ze as DialogFooter,Qe as DialogHeader,$e as DialogOverlay,et as DialogPortal,tt as DialogTitle,nt as DialogTrigger,rt as DotsLoading,it as Drawer,at as DrawerClose,ot as DrawerContent,st as DrawerDescription,ct as DrawerFooter,lt as DrawerHeader,ut as DrawerOverlay,dt as DrawerPortal,ft as DrawerTitle,pt as DrawerTrigger,mt as DropdownMenu,ht as DropdownMenuCheckboxItem,gt as DropdownMenuContent,_t as DropdownMenuGroup,vt as DropdownMenuItem,yt as DropdownMenuLabel,bt as DropdownMenuPortal,xt as DropdownMenuRadioGroup,St as DropdownMenuRadioItem,Ct as DropdownMenuSeparator,wt as DropdownMenuShortcut,Tt as DropdownMenuSub,Et as DropdownMenuSubContent,Dt as DropdownMenuSubTrigger,Ot as DropdownMenuTrigger,kt as Empty,At as EmptyContent,jt as EmptyDescription,Mt as EmptyHeader,Nt as EmptyMedia,Pt as EmptyState,Ft as EmptyTitle,Lt as Field,Rt as FieldContent,zt as FieldDescription,Bt as FieldError,Vt as FieldGroup,Ht as FieldLabel,Ut as FieldLegend,Wt as FieldSeparator,Gt as FieldSet,Kt as FieldTitle,qt as HoverCard,Jt as HoverCardContent,Yt as HoverCardTrigger,C as Image,Xt as InfiniteScroll,ce as Input,ue as InputGroup,de as InputGroupAddon,fe as InputGroupButton,pe as InputGroupInput,me as InputGroupText,he as InputGroupTextarea,Zt as Item,Qt as ItemActions,$t as ItemContent,en as ItemDescription,tn as ItemFooter,nn as ItemGroup,rn as ItemHeader,an as ItemMedia,on as ItemSeparator,sn as ItemTitle,cn as Kbd,ln as KbdGroup,It as Label,un as List,dn as ListItem,fn as Menubar,pn as MenubarCheckboxItem,mn as MenubarContent,hn as MenubarGroup,gn as MenubarItem,_n as MenubarLabel,vn as MenubarMenu,yn as MenubarPortal,bn as MenubarRadioGroup,xn as MenubarRadioItem,Sn as MenubarSeparator,Cn as MenubarShortcut,wn as MenubarSub,Tn as MenubarSubContent,En as MenubarSubTrigger,Dn as MenubarTrigger,On as NativeSelect,kn as NativeSelectOptGroup,An as NativeSelectOption,jn as Pagination,Mn as PaginationContent,Nn as PaginationEllipsis,Pn as PaginationItem,Fn as PaginationLink,In as PaginationNext,Ln as PaginationPrevious,Rn as Popover,zn as PopoverContent,Bn as PopoverDescription,Vn as PopoverHeader,Hn as PopoverTitle,Un as PopoverTrigger,Wn as Progress,Gn as ProgressIndicator,Kn as ProgressLabel,qn as ProgressTrack,Jn as ProgressValue,Yn as RadioGroup,Xn as RadioGroupItem,Zn as ScrollArea,Qn as ScrollBar,$n as Select,er as SelectContent,tr as SelectGroup,nr as SelectItem,rr as SelectLabel,ir as SelectScrollDownButton,ar as SelectScrollUpButton,or as SelectSeparator,sr as SelectTrigger,cr as SelectValue,B as Separator,lr as Sheet,ur as SheetClose,dr as SheetContent,fr as SheetDescription,pr as SheetFooter,mr as SheetHeader,hr as SheetTitle,gr as SheetTrigger,_r as Skeleton,vr as Slider,br as Spinner,xr as Switch,Sr as Table,Cr as TableBody,wr as TableCaption,Tr as TableCell,Er as TableFooter,Dr as TableHead,Or as TableHeader,kr as TableRow,Ar as Tabs,jr as TabsContent,Mr as TabsList,Nr as TabsTrigger,Fr as Text,le as Textarea,Ir as Time,yr as Toaster,Rr as Toggle,Br as ToggleGroup,Vr as ToggleGroupItem,Hr as Tooltip,Ur as TooltipContent,Wr as TooltipProvider,Gr as TooltipTrigger,Kr as WheelPicker,qr as WheelPickerWrapper,j as badgeVariants,W as buttonGroupVariants,l as buttonVariants,Lr as normalizeTimeToMilliseconds,Pr as tabsListVariants,Jr as toast,zr as toggleVariants,re as useCarousel,je as useComboboxAnchor};
@@ -0,0 +1,14 @@
1
+
2
+ //#region utils/device-id.d.ts
3
+ /**
4
+ * 获取或生成设备标识(仅客户端)。
5
+ *
6
+ * - 优先从 localStorage 读取(同一浏览器会话可稳定复用)。
7
+ * - 未命中时生成浏览器指纹(哈希)并写回。
8
+ * - 若指纹生成失败(极端环境/策略限制),降级为 `generateUUID()`。
9
+ *
10
+ * 注意:该值用于请求头 `x-device-id`,不应在服务端调用。
11
+ */
12
+ declare function getOrCreateDeviceId(): string;
13
+ //#endregion
14
+ export { getOrCreateDeviceId };
@@ -0,0 +1,2 @@
1
+
2
+ import{generateUUID as e,isClient as t}from"./common.mjs";import n from"crypto-js";const r=`funhub-device-id`;function i(){if(!t())return``;try{let t=window.localStorage.getItem(r);if(t&&t.trim().length>=8)return t.trim();let n=a()||e();return window.localStorage.setItem(r,n),n}catch{return e()}}function a(){try{let e=o(),t=JSON.stringify(e);return n.SHA256(t).toString(n.enc.Hex)}catch(e){return console.warn(`[device-id] build fingerprint failed`,e),``}}function o(){return{navigator:s(),screen:c(),time:l(),canvas:u(),webgl:d()}}function s(){let e=typeof navigator<`u`?navigator:void 0;if(!e)return{};let t=Array.isArray(e.languages)?e.languages:[],n=e.platform,r=e.deviceMemory;return{userAgent:String(e.userAgent||``),language:String(e.language||``),languages:t.map(e=>String(e||``)),platform:typeof n==`string`?n:``,cookieEnabled:!!e.cookieEnabled,doNotTrack:String(e.doNotTrack??``),hardwareConcurrency:Number(e.hardwareConcurrency??0)||0,deviceMemory:Number(r??0)||0,maxTouchPoints:Number(e.maxTouchPoints??0)||0}}function c(){let e=typeof screen<`u`?screen:void 0;return{width:e?.width??0,height:e?.height??0,availWidth:e?.availWidth??0,availHeight:e?.availHeight??0,colorDepth:e?.colorDepth??0,pixelDepth:e?.pixelDepth??0,devicePixelRatio:typeof window<`u`?window.devicePixelRatio??1:1}}function l(){return{timezone:(()=>{try{return Intl.DateTimeFormat().resolvedOptions().timeZone||``}catch{return``}})(),timezoneOffset:new Date().getTimezoneOffset()}}function u(){try{if(typeof document>`u`)return``;let e=document.createElement(`canvas`);e.width=320,e.height=160;let t=e.getContext(`2d`);if(!t)return``;t.fillStyle=`#f3f4f6`,t.fillRect(0,0,e.width,e.height),t.textBaseline=`top`,t.font=`16px Arial`,t.fillStyle=`#111827`,t.fillText(`funhub:device-id`,12,12),t.fillStyle=`#ef4444`,t.fillText(`canvas-fp`,13,13),t.globalCompositeOperation=`multiply`,t.fillStyle=`rgba(59, 130, 246, 0.7)`,t.beginPath(),t.arc(240,70,28,0,Math.PI*2),t.closePath(),t.fill(),t.fillStyle=`rgba(34, 197, 94, 0.7)`,t.fillRect(210,88,60,32);let r=e.toDataURL();return n.MD5(r).toString(n.enc.Hex)}catch{return``}}function d(){try{if(typeof document>`u`)return``;let e=document.createElement(`canvas`),t=e.getContext(`webgl`)||e.getContext(`experimental-webgl`);if(!t)return``;let r=t.getExtension(`WEBGL_debug_renderer_info`),i=r?t.getParameter(r.UNMASKED_VENDOR_WEBGL):``,a=r?t.getParameter(r.UNMASKED_RENDERER_WEBGL):``,o={vendor:String(t.getParameter(t.VENDOR)||``),renderer:String(t.getParameter(t.RENDERER)||``),version:String(t.getParameter(t.VERSION)||``),shadingLanguageVersion:String(t.getParameter(t.SHADING_LANGUAGE_VERSION)||``),unmaskedVendor:String(i||``),unmaskedRenderer:String(a||``),maxTextureSize:Number(t.getParameter(t.MAX_TEXTURE_SIZE)??0)||0,maxCubeMapTextureSize:Number(t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE)??0)||0};return n.MD5(JSON.stringify(o)).toString(n.enc.Hex)}catch{return``}}export{i as getOrCreateDeviceId};
@@ -1,2 +1,2 @@
1
1
 
2
- import{getCookie as e,isClient as t}from"./common.mjs";import{useBlockedModalStore as n}from"../store/modules/blocked-modal-store.mjs";import{useUserStore as r}from"../store/modules/user-store.mjs";import{toast as i}from"sonner";const a=process.env.NEXT_PUBLIC_API_BASE||``;let o=!1,s=!1,c=null;var l=class extends Error{constructor(e,t,n){super(t),this.status=e,this.response=n}};function u(e){if(!e)return``;let t=new URLSearchParams;Object.entries(e).forEach(([e,n])=>{n!=null&&t.append(e,String(n))});let n=t.toString();return n?`?${n}`:``}function d(e=1e4,t){let n=new AbortController,r=setTimeout(()=>n.abort(),e);return t&&t.addEventListener(`abort`,()=>n.abort()),{signal:n.signal,clear:()=>clearTimeout(r)}}function f(){t()&&(s||(s=!0,r.getState().logout(),setTimeout(()=>{s=!1},1e3)))}var p=class{constructor(){this.baseURL=a,this.defaultConfig={method:`GET`,timeout:1e4,cache:`default`}}async buildHeaders(e){return{"Content-Type":`application/json`,...e}}buildURL(e,t){return`${e.startsWith(`http`)?e:`${this.baseURL}${e.startsWith(`/`)?``:`/`}${e}`}${u(t)}`}async executeOnce(a){let{url:s,method:u=`GET`,data:p,params:m,timeout:h,cache:g,revalidate:_,tags:v,signal:y}=a,b=await this.buildHeaders(a.headers),x=``,S=u===`GET`||u===`HEAD`;if(t()){x=await e(`token`);let t=await e(`userId`);if(x&&(b.Authorization=`Bearer ${x}`),t&&(b[`X-User-Id`]=t),c?.token&&c.token!==x&&(c=null),x&&c?.token===x)throw f(),new l(403,`账号已被封禁`,{code:403,message:`账号已被封禁`,data:{blocked_remark:c.blockedRemark,blocked_end_time:c.blockedEndTime}})}let C;!S&&p!==void 0&&(p instanceof FormData?(delete b[`Content-Type`],C=p):C=JSON.stringify(p));let{signal:w,clear:T}=d(h,y),E=this.buildURL(s,m);try{let e=await fetch(E,{method:u,headers:b,body:C,cache:g,signal:w,next:{revalidate:_??0,tags:v}}),a=e.status===401||e.status===403;if(!e.ok&&!a)throw new l(e.status,e.statusText,await e.text());let s=await e.json(),d=a&&e.status===401||s?.code===401,p=a&&e.status===403||s?.code===403;if(d)if(t())o||(o=!0,i.error(`登录已过期,请重新登录`),r.getState().logout(),setTimeout(()=>{o=!1},3e3));else throw new l(s.code,s.message,s);if(p){let e=typeof s?.data?.blocked_remark==`string`?s.data.blocked_remark:``,r=Number(s?.data?.blocked_end_time),i={blockedRemark:e,blockedEndTime:Number.isFinite(r)&&r>0?Math.floor(r):0};if(t()){let e=x,t=c?.token===e;e&&(c={token:e,...i}),t||n.getState().open(i),f()}throw new l(s.code,s.message,s)}if(s.code!==0)throw new l(s.code,s.message,s);return s}finally{T()}}async request(e){let t={...this.defaultConfig,...e};return await this.executeOnce(t)}get(e,t){return this.request({...t,method:`GET`,url:e})}post(e,t){return this.request({...t,method:`POST`,url:e})}put(e,t){return this.request({...t,method:`PUT`,url:e})}delete(e,t){return this.request({...t,method:`DELETE`,url:e})}patch(e,t){return this.request({...t,method:`PATCH`,url:e})}};const m=new p;export{p as HttpClient,l as HttpError,m as default};
2
+ import{getCookie as e,isClient as t}from"./common.mjs";import{getOrCreateDeviceId as n}from"./device-id.mjs";import{useBlockedModalStore as r}from"../store/modules/blocked-modal-store.mjs";import{useUserStore as i}from"../store/modules/user-store.mjs";import{toast as a}from"sonner";const o=process.env.NEXT_PUBLIC_API_BASE||``;let s=!1,c=!1,l=null;var u=class extends Error{constructor(e,t,n){super(t),this.status=e,this.response=n}};function d(e){if(!e)return``;let t=new URLSearchParams;Object.entries(e).forEach(([e,n])=>{n!=null&&t.append(e,String(n))});let n=t.toString();return n?`?${n}`:``}function f(e=1e4,t){let n=new AbortController,r=setTimeout(()=>n.abort(),e);return t&&t.addEventListener(`abort`,()=>n.abort()),{signal:n.signal,clear:()=>clearTimeout(r)}}function p(){t()&&(c||(c=!0,i.getState().logout(),setTimeout(()=>{c=!1},1e3)))}var m=class{constructor(){this.baseURL=o,this.defaultConfig={method:`GET`,timeout:1e4,cache:`default`}}async buildHeaders(e){return{"Content-Type":`application/json`,...e}}buildURL(e,t){return`${e.startsWith(`http`)?e:`${this.baseURL}${e.startsWith(`/`)?``:`/`}${e}`}${d(t)}`}async executeOnce(o){let{url:c,method:d=`GET`,data:m,params:h,timeout:g,cache:_,revalidate:v,tags:y,signal:b}=o,x=await this.buildHeaders(o.headers),S=``,C=d===`GET`||d===`HEAD`;if(t()){if(!x[`x-device-id`]){let e=n();e&&(x[`x-device-id`]=e)}S=await e(`token`);let t=await e(`userId`);if(S&&(x.Authorization=`Bearer ${S}`),t&&(x[`X-User-Id`]=t),l?.token&&l.token!==S&&(l=null),S&&l?.token===S)throw p(),new u(403,`账号已被封禁`,{code:403,message:`账号已被封禁`,data:{blocked_remark:l.blockedRemark,blocked_end_time:l.blockedEndTime}})}let w;!C&&m!==void 0&&(m instanceof FormData?(delete x[`Content-Type`],w=m):w=JSON.stringify(m));let{signal:T,clear:E}=f(g,b),D=this.buildURL(c,h);try{let e=await fetch(D,{method:d,headers:x,body:w,cache:_,signal:T,next:{revalidate:v??0,tags:y}}),n=e.status===401||e.status===403;if(!e.ok&&!n)throw new u(e.status,e.statusText,await e.text());let o=await e.json(),c=n&&e.status===401||o?.code===401,f=n&&e.status===403||o?.code===403;if(c)if(t())s||(s=!0,a.error(`登录已过期,请重新登录`),i.getState().logout(),setTimeout(()=>{s=!1},3e3));else throw new u(o.code,o.message,o);if(f){let e=typeof o?.data?.blocked_remark==`string`?o.data.blocked_remark:``,n=Number(o?.data?.blocked_end_time),i={blockedRemark:e,blockedEndTime:Number.isFinite(n)&&n>0?Math.floor(n):0};if(t()){let e=S,t=l?.token===e;e&&(l={token:e,...i}),t||r.getState().open(i),p()}throw new u(o.code,o.message,o)}if(o.code!==0)throw new u(o.code,o.message,o);return o}finally{E()}}async request(e){let t={...this.defaultConfig,...e};return await this.executeOnce(t)}get(e,t){return this.request({...t,method:`GET`,url:e})}post(e,t){return this.request({...t,method:`POST`,url:e})}put(e,t){return this.request({...t,method:`PUT`,url:e})}delete(e,t){return this.request({...t,method:`DELETE`,url:e})}patch(e,t){return this.request({...t,method:`PATCH`,url:e})}};const h=new m;export{m as HttpClient,u as HttpError,h as default};
@@ -1,4 +1,4 @@
1
1
 
2
- import { INSPECTOR_META_KEY, InferSchemaProps, MaterialComponentMode, MaterialComponentProps, SchemaHasDefaultValue, defineArrayItemPropSchema, defineCheckboxPropSchema, defineColorPropSchema, defineComponentPropsSchema, defineDatetimePropSchema, defineNumberPropSchema, defineObjectPropSchema, defineSelectEnumPropSchema, defineSelectPropSchema, defineSwitchPropSchema, defineTextPropSchema, defineTextareaPropSchema, defineTimeRangePropSchema, getSchemaDefaultProps, withInspectorMeta } from "./schema.mjs";
2
+ import { ComponentPropsSchemaBuilderHelpers, INSPECTOR_META_KEY, InferSchemaProps, MaterialComponentMode, MaterialComponentProps, SchemaHasDefaultValue, array, boolean, datetime, defineComponentPropsSchema, enumSchema, getSchemaDefaultProps, number, object, string, timeRange, withInspectorMeta } from "./schema.mjs";
3
3
  import { DefineMaterialOption, MaterialCategory, OverwriteMaterialOption, defineMaterial, overwriteMaterial } from "./material.mjs";
4
4
  import { MaterialMap, generateMaterialMap, generateMaterialMapGroupByCategory } from "./utils.mjs";
@@ -3,38 +3,30 @@ import { z } from "zod";
3
3
 
4
4
  //#region utils/schema/inspector.d.ts
5
5
  type InspectorFieldOption<T> = Omit<T, 'type'>;
6
- declare const textInspectorFieldSchema: z.ZodObject<{
7
- type: z.ZodLiteral<"text">;
6
+ declare const stringInspectorFieldSchema: z.ZodObject<{
7
+ type: z.ZodLiteral<"string">;
8
+ fieldType: z.ZodOptional<z.ZodEnum<{
9
+ select: "select";
10
+ input: "input";
11
+ textarea: "textarea";
12
+ color: "color";
13
+ }>>;
8
14
  defaultValue: z.ZodOptional<z.ZodString>;
9
- label: z.ZodString;
15
+ label: z.ZodOptional<z.ZodString>;
10
16
  description: z.ZodOptional<z.ZodString>;
11
17
  }, z.core.$strip>;
12
- type TextInspectorFieldOption = InspectorFieldOption<z.infer<typeof textInspectorFieldSchema>>;
13
- declare const textareaInspectorFieldSchema: z.ZodObject<{
14
- type: z.ZodLiteral<"textarea">;
15
- defaultValue: z.ZodOptional<z.ZodString>;
16
- label: z.ZodString;
17
- description: z.ZodOptional<z.ZodString>;
18
- }, z.core.$strip>;
19
- type TextareaInspectorFieldOption = InspectorFieldOption<z.infer<typeof textareaInspectorFieldSchema>>;
18
+ type StringInspectorFieldOption = InspectorFieldOption<z.infer<typeof stringInspectorFieldSchema>>;
20
19
  declare const numberInspectorFieldSchema: z.ZodObject<{
21
20
  type: z.ZodLiteral<"number">;
22
21
  defaultValue: z.ZodOptional<z.ZodNumber>;
23
- label: z.ZodString;
22
+ label: z.ZodOptional<z.ZodString>;
24
23
  description: z.ZodOptional<z.ZodString>;
25
24
  }, z.core.$strip>;
26
25
  type NumberInspectorFieldOption = InspectorFieldOption<z.infer<typeof numberInspectorFieldSchema>>;
27
- declare const colorInspectorFieldSchema: z.ZodObject<{
28
- type: z.ZodLiteral<"color">;
29
- defaultValue: z.ZodOptional<z.ZodString>;
30
- label: z.ZodString;
31
- description: z.ZodOptional<z.ZodString>;
32
- }, z.core.$strip>;
33
- type ColorInspectorFieldOption = InspectorFieldOption<z.infer<typeof colorInspectorFieldSchema>>;
34
26
  declare const datetimeInspectorFieldSchema: z.ZodObject<{
35
27
  type: z.ZodLiteral<"datetime">;
36
28
  defaultValue: z.ZodOptional<z.ZodString>;
37
- label: z.ZodString;
29
+ label: z.ZodOptional<z.ZodString>;
38
30
  description: z.ZodOptional<z.ZodString>;
39
31
  }, z.core.$strip>;
40
32
  type DatetimeInspectorFieldOption = InspectorFieldOption<z.infer<typeof datetimeInspectorFieldSchema>>;
@@ -44,69 +36,55 @@ declare const timeRangeInspectorFieldSchema: z.ZodObject<{
44
36
  start: z.ZodString;
45
37
  end: z.ZodString;
46
38
  }, z.core.$strip>>;
47
- label: z.ZodString;
39
+ label: z.ZodOptional<z.ZodString>;
48
40
  description: z.ZodOptional<z.ZodString>;
49
41
  }, z.core.$strip>;
50
42
  type TimeRangeInspectorFieldOption = InspectorFieldOption<z.infer<typeof timeRangeInspectorFieldSchema>>;
51
- declare const selectInspectorFieldSchema: z.ZodObject<{
52
- type: z.ZodLiteral<"select">;
53
- defaultValue: z.ZodOptional<z.ZodString>;
54
- label: z.ZodString;
55
- description: z.ZodOptional<z.ZodString>;
56
- }, z.core.$strip>;
57
- type SelectInspectorFieldOption = InspectorFieldOption<z.infer<typeof selectInspectorFieldSchema>>;
58
- declare const checkboxInspectorFieldSchema: z.ZodObject<{
59
- type: z.ZodLiteral<"checkbox">;
60
- defaultValue: z.ZodOptional<z.ZodBoolean>;
61
- label: z.ZodString;
62
- description: z.ZodOptional<z.ZodString>;
63
- }, z.core.$strip>;
64
- type CheckboxInspectorFieldOption = InspectorFieldOption<z.infer<typeof checkboxInspectorFieldSchema>>;
65
- declare const switchInspectorFieldSchema: z.ZodObject<{
66
- type: z.ZodLiteral<"switch">;
43
+ declare const booleanInspectorFieldSchema: z.ZodObject<{
44
+ type: z.ZodLiteral<"boolean">;
45
+ fieldType: z.ZodOptional<z.ZodEnum<{
46
+ switch: "switch";
47
+ checkbox: "checkbox";
48
+ }>>;
67
49
  defaultValue: z.ZodOptional<z.ZodBoolean>;
68
- label: z.ZodString;
50
+ label: z.ZodOptional<z.ZodString>;
69
51
  description: z.ZodOptional<z.ZodString>;
70
52
  }, z.core.$strip>;
71
- type SwitchInspectorFieldOption = InspectorFieldOption<z.infer<typeof switchInspectorFieldSchema>>;
53
+ type BooleanInspectorFieldOption = InspectorFieldOption<z.infer<typeof booleanInspectorFieldSchema>>;
72
54
  declare const arrayInspectorFieldSchema: z.ZodObject<{
73
55
  type: z.ZodLiteral<"array">;
74
56
  defaultValue: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
75
- label: z.ZodString;
57
+ label: z.ZodOptional<z.ZodString>;
76
58
  description: z.ZodOptional<z.ZodString>;
77
59
  }, z.core.$strip>;
78
60
  type ArrayInspectorFieldOption = InspectorFieldOption<z.infer<typeof arrayInspectorFieldSchema>>;
79
61
  declare const objectInspectorFieldSchema: z.ZodObject<{
80
62
  type: z.ZodLiteral<"object">;
81
63
  defaultValue: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
82
- label: z.ZodString;
64
+ label: z.ZodOptional<z.ZodString>;
83
65
  description: z.ZodOptional<z.ZodString>;
84
66
  }, z.core.$strip>;
85
67
  type ObjectInspectorFieldOption = InspectorFieldOption<z.infer<typeof objectInspectorFieldSchema>>;
86
68
  declare const componentInspectorFieldMetaSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
87
- type: z.ZodLiteral<"text">;
69
+ type: z.ZodLiteral<"string">;
70
+ fieldType: z.ZodOptional<z.ZodEnum<{
71
+ select: "select";
72
+ input: "input";
73
+ textarea: "textarea";
74
+ color: "color";
75
+ }>>;
88
76
  defaultValue: z.ZodOptional<z.ZodString>;
89
- label: z.ZodString;
90
- description: z.ZodOptional<z.ZodString>;
91
- }, z.core.$strip>, z.ZodObject<{
92
- type: z.ZodLiteral<"textarea">;
93
- defaultValue: z.ZodOptional<z.ZodString>;
94
- label: z.ZodString;
77
+ label: z.ZodOptional<z.ZodString>;
95
78
  description: z.ZodOptional<z.ZodString>;
96
79
  }, z.core.$strip>, z.ZodObject<{
97
80
  type: z.ZodLiteral<"number">;
98
81
  defaultValue: z.ZodOptional<z.ZodNumber>;
99
- label: z.ZodString;
100
- description: z.ZodOptional<z.ZodString>;
101
- }, z.core.$strip>, z.ZodObject<{
102
- type: z.ZodLiteral<"color">;
103
- defaultValue: z.ZodOptional<z.ZodString>;
104
- label: z.ZodString;
82
+ label: z.ZodOptional<z.ZodString>;
105
83
  description: z.ZodOptional<z.ZodString>;
106
84
  }, z.core.$strip>, z.ZodObject<{
107
85
  type: z.ZodLiteral<"datetime">;
108
86
  defaultValue: z.ZodOptional<z.ZodString>;
109
- label: z.ZodString;
87
+ label: z.ZodOptional<z.ZodString>;
110
88
  description: z.ZodOptional<z.ZodString>;
111
89
  }, z.core.$strip>, z.ZodObject<{
112
90
  type: z.ZodLiteral<"timeRange">;
@@ -114,34 +92,28 @@ declare const componentInspectorFieldMetaSchema: z.ZodDiscriminatedUnion<[z.ZodO
114
92
  start: z.ZodString;
115
93
  end: z.ZodString;
116
94
  }, z.core.$strip>>;
117
- label: z.ZodString;
118
- description: z.ZodOptional<z.ZodString>;
119
- }, z.core.$strip>, z.ZodObject<{
120
- type: z.ZodLiteral<"select">;
121
- defaultValue: z.ZodOptional<z.ZodString>;
122
- label: z.ZodString;
123
- description: z.ZodOptional<z.ZodString>;
124
- }, z.core.$strip>, z.ZodObject<{
125
- type: z.ZodLiteral<"checkbox">;
126
- defaultValue: z.ZodOptional<z.ZodBoolean>;
127
- label: z.ZodString;
95
+ label: z.ZodOptional<z.ZodString>;
128
96
  description: z.ZodOptional<z.ZodString>;
129
97
  }, z.core.$strip>, z.ZodObject<{
130
- type: z.ZodLiteral<"switch">;
98
+ type: z.ZodLiteral<"boolean">;
99
+ fieldType: z.ZodOptional<z.ZodEnum<{
100
+ switch: "switch";
101
+ checkbox: "checkbox";
102
+ }>>;
131
103
  defaultValue: z.ZodOptional<z.ZodBoolean>;
132
- label: z.ZodString;
104
+ label: z.ZodOptional<z.ZodString>;
133
105
  description: z.ZodOptional<z.ZodString>;
134
106
  }, z.core.$strip>, z.ZodObject<{
135
107
  type: z.ZodLiteral<"array">;
136
108
  defaultValue: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
137
- label: z.ZodString;
109
+ label: z.ZodOptional<z.ZodString>;
138
110
  description: z.ZodOptional<z.ZodString>;
139
111
  }, z.core.$strip>, z.ZodObject<{
140
112
  type: z.ZodLiteral<"object">;
141
113
  defaultValue: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
142
- label: z.ZodString;
114
+ label: z.ZodOptional<z.ZodString>;
143
115
  description: z.ZodOptional<z.ZodString>;
144
116
  }, z.core.$strip>], "type">;
145
117
  type ComponentInspectorFieldMeta = z.infer<typeof componentInspectorFieldMetaSchema>;
146
118
  //#endregion
147
- export { ArrayInspectorFieldOption, CheckboxInspectorFieldOption, ColorInspectorFieldOption, ComponentInspectorFieldMeta, DatetimeInspectorFieldOption, NumberInspectorFieldOption, ObjectInspectorFieldOption, SelectInspectorFieldOption, SwitchInspectorFieldOption, TextInspectorFieldOption, TextareaInspectorFieldOption, TimeRangeInspectorFieldOption };
119
+ export { ArrayInspectorFieldOption, BooleanInspectorFieldOption, ComponentInspectorFieldMeta, DatetimeInspectorFieldOption, NumberInspectorFieldOption, ObjectInspectorFieldOption, StringInspectorFieldOption, TimeRangeInspectorFieldOption };
@@ -1,5 +1,5 @@
1
1
 
2
- import { ArrayInspectorFieldOption, CheckboxInspectorFieldOption, ColorInspectorFieldOption, ComponentInspectorFieldMeta, DatetimeInspectorFieldOption, NumberInspectorFieldOption, ObjectInspectorFieldOption, SelectInspectorFieldOption, SwitchInspectorFieldOption, TextInspectorFieldOption, TextareaInspectorFieldOption, TimeRangeInspectorFieldOption } from "./inspector.mjs";
2
+ import { ArrayInspectorFieldOption, BooleanInspectorFieldOption, ComponentInspectorFieldMeta, DatetimeInspectorFieldOption, NumberInspectorFieldOption, ObjectInspectorFieldOption, StringInspectorFieldOption, TimeRangeInspectorFieldOption } from "./inspector.mjs";
3
3
  import { z } from "zod";
4
4
 
5
5
  //#region utils/schema/schema.d.ts
@@ -12,6 +12,16 @@ type MaterialComponentMode = z.infer<typeof materialComponentModeSchema>;
12
12
  type MaterialComponentProps<T = object> = {
13
13
  mode: MaterialComponentMode;
14
14
  } & T;
15
+ interface ComponentPropsSchemaBuilderHelpers {
16
+ string: typeof string;
17
+ number: typeof number;
18
+ boolean: typeof boolean;
19
+ datetime: typeof datetime;
20
+ timeRange: typeof timeRange;
21
+ enum: typeof enumSchema;
22
+ array: typeof array;
23
+ object: typeof object;
24
+ }
15
25
  /**
16
26
  * 关联inspector meta
17
27
  * @param schema
@@ -21,21 +31,15 @@ type MaterialComponentProps<T = object> = {
21
31
  declare function withInspectorMeta<T extends z.ZodTypeAny>(schema: T, inspectorMeta: ComponentInspectorFieldMeta): T;
22
32
  /**
23
33
  * 定义组件props schema
24
- * 使用defineXXXPropSchema定义defaultValue时,目前仅限于在第一层定义
25
- * @param shape
34
+ * 使用字段 schema helper 定义 defaultValue 时,目前仅限于在第一层定义
26
35
  * @returns
27
36
  */
28
- declare function defineComponentPropsSchema<const TShape extends z.ZodRawShape>(shape: TShape): z.ZodObject<(keyof TShape & "mode" extends never ? { -readonly [P in keyof TShape]: TShape[P] } & {
29
- mode: z.ZodOptional<z.ZodEnum<{
30
- renderer: "renderer";
31
- editor: "editor";
32
- }>>;
33
- } : { [K in keyof { -readonly [P in keyof TShape]: TShape[P] } as K extends "mode" ? never : K]: { -readonly [P in keyof TShape]: TShape[P] }[K] } & {
34
- mode: z.ZodOptional<z.ZodEnum<{
35
- renderer: "renderer";
36
- editor: "editor";
37
- }>>;
38
- }) extends infer T ? { [k in keyof T]: T[k] } : never, z.core.$strip>;
37
+ declare function defineComponentPropsSchema<const TShape extends z.ZodRawShape>(shape: TShape): z.ZodObject<TShape & {
38
+ mode: z.ZodOptional<typeof materialComponentModeSchema>;
39
+ }>;
40
+ declare function defineComponentPropsSchema<const TShape extends z.ZodRawShape>(builder: (t: ComponentPropsSchemaBuilderHelpers) => TShape): z.ZodObject<TShape & {
41
+ mode: z.ZodOptional<typeof materialComponentModeSchema>;
42
+ }>;
39
43
  interface SchemaHasDefaultValue {
40
44
  readonly __schemaHasDefaultValueBrand: never;
41
45
  }
@@ -49,27 +53,36 @@ type MaybeSchemaWithDefaultValue<TSchema extends z.ZodTypeAny, TOption extends {
49
53
  }> = TOption extends {
50
54
  defaultValue: infer TDefaultValue;
51
55
  } ? [TDefaultValue] extends [undefined] ? TSchema : TSchema & SchemaHasDefaultValue : TSchema;
52
- declare function defineTextPropSchema<const TOption extends TextInspectorFieldOption & {
53
- required?: boolean;
54
- }>(option: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z.ZodString, TOption['required']>, TOption>;
55
- declare function defineTextareaPropSchema<const TOption extends TextareaInspectorFieldOption & {
56
- required?: boolean;
57
- }>(option: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z.ZodString, TOption['required']>, TOption>;
58
- declare function defineNumberPropSchema<const TOption extends NumberInspectorFieldOption & {
59
- required?: boolean;
60
- }>(option: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z.ZodNumber, TOption['required']>, TOption>;
61
- declare function defineColorPropSchema<const TOption extends ColorInspectorFieldOption & {
56
+ type SchemaHelperOption<TInspectorOption extends {
57
+ defaultValue?: unknown;
58
+ label?: string;
59
+ }> = Omit<TInspectorOption, 'defaultValue' | 'label'> & {
60
+ defaultValue?: undefined;
61
+ label?: string;
62
62
  required?: boolean;
63
- }>(option: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z.ZodString, TOption['required']>, TOption>;
63
+ };
64
+ type OptionWithDefaultValue<TOption extends object, TDefaultValue> = [TDefaultValue] extends [undefined] ? TOption : TOption & {
65
+ defaultValue: TDefaultValue;
66
+ };
67
+ type StringSchemaHelperOption = SchemaHelperOption<StringInspectorFieldOption>;
68
+ declare function string(): z.ZodString;
69
+ declare function string<const TOption extends StringSchemaHelperOption>(option: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z.ZodString, TOption['required']>, TOption>;
70
+ declare function string<const TDefaultValue extends string | undefined, const TOption extends StringSchemaHelperOption>(defaultValue: TDefaultValue, option?: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z.ZodString, TOption['required']>, OptionWithDefaultValue<TOption, TDefaultValue>>;
71
+ type NumberSchemaHelperOption = SchemaHelperOption<NumberInspectorFieldOption>;
72
+ declare function number(): z.ZodNumber;
73
+ declare function number<const TOption extends NumberSchemaHelperOption>(option: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z.ZodNumber, TOption['required']>, TOption>;
74
+ declare function number<const TDefaultValue extends number | undefined, const TOption extends NumberSchemaHelperOption>(defaultValue: TDefaultValue, option?: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z.ZodNumber, TOption['required']>, OptionWithDefaultValue<TOption, TDefaultValue>>;
64
75
  /**
65
76
  * 定义日期时间字段schema,用于时间段选择。
66
77
  * 值为 ISO 8601 或 YYYY-MM-DD HH:mm:ss 格式字符串。
78
+ * @param defaultValue 默认值
67
79
  * @param option inspector 字段配置
68
80
  * @returns zod schema
69
81
  */
70
- declare function defineDatetimePropSchema<const TOption extends DatetimeInspectorFieldOption & {
71
- required?: boolean;
72
- }>(option: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z.ZodString, TOption['required']>, TOption>;
82
+ type DatetimeSchemaHelperOption = SchemaHelperOption<DatetimeInspectorFieldOption>;
83
+ declare function datetime(): z.ZodString;
84
+ declare function datetime<const TOption extends DatetimeSchemaHelperOption>(option: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z.ZodString, TOption['required']>, TOption>;
85
+ declare function datetime<const TDefaultValue extends string | undefined, const TOption extends DatetimeSchemaHelperOption>(defaultValue: TDefaultValue, option?: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z.ZodString, TOption['required']>, OptionWithDefaultValue<TOption, TDefaultValue>>;
73
86
  /** 时间段结构:{ start: 开始时间, end: 结束时间 },格式 YYYY-MM-DD HH:mm:ss */
74
87
  declare const timeRangeShape: {
75
88
  readonly start: z.ZodString;
@@ -82,36 +95,29 @@ interface TimeRangeValue {
82
95
  interface TimeRangeInspectorOption extends Omit<TimeRangeInspectorFieldOption, 'defaultValue'> {
83
96
  defaultValue?: TimeRangeValue;
84
97
  }
98
+ type TimeRangeSchemaHelperOption = SchemaHelperOption<TimeRangeInspectorOption>;
85
99
  /**
86
100
  * 定义时间段字段schema,用于开始时间+结束时间范围选择。
87
- * @param option inspector 字段配置
88
101
  * @returns zod schema
89
102
  */
90
- declare function defineTimeRangePropSchema<const TOption extends TimeRangeInspectorOption & {
91
- required?: boolean;
92
- }>(option: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z.ZodObject<typeof timeRangeShape>, TOption['required']>, TOption>;
93
- declare function defineSelectPropSchema<const TOption extends SelectInspectorFieldOption & {
94
- required?: boolean;
95
- }>(option: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z.ZodString, TOption['required']>, TOption>;
103
+ declare function timeRange(): z.ZodObject<typeof timeRangeShape>;
104
+ declare function timeRange<const TOption extends TimeRangeSchemaHelperOption>(option: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z.ZodObject<typeof timeRangeShape>, TOption['required']>, TOption>;
105
+ declare function timeRange<const TDefaultValue extends TimeRangeValue | undefined, const TOption extends TimeRangeSchemaHelperOption>(defaultValue: TDefaultValue, option?: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z.ZodObject<typeof timeRangeShape>, TOption['required']>, OptionWithDefaultValue<TOption, TDefaultValue>>;
96
106
  type StringTuple = readonly [string, ...string[]];
97
- type SelectEnumInspectorFieldOption<TValues extends StringTuple> = Omit<SelectInspectorFieldOption, 'defaultValue'> & {
98
- defaultValue?: TValues[number];
107
+ type EnumSchemaHelperOption = Omit<SchemaHelperOption<StringInspectorFieldOption>, 'fieldType'> & {
108
+ fieldType?: 'select';
99
109
  };
100
110
  /**
101
111
  * 基于字符串元组定义select字段schema。
102
- * @param values 可选值元组
103
- * @param option inspector 字段配置
104
112
  * @returns zod schema
105
113
  */
106
- declare function defineSelectEnumPropSchema<const TValues extends StringTuple, const TOption extends SelectEnumInspectorFieldOption<TValues> & {
107
- required?: boolean;
108
- }>(values: TValues, option: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z.ZodType<TValues[number]>, TOption['required']>, TOption>;
109
- declare function defineCheckboxPropSchema<const TOption extends CheckboxInspectorFieldOption & {
110
- required?: boolean;
111
- }>(option: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z.ZodBoolean, TOption['required']>, TOption>;
112
- declare function defineSwitchPropSchema<const TOption extends SwitchInspectorFieldOption & {
113
- required?: boolean;
114
- }>(option: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z.ZodBoolean, TOption['required']>, TOption>;
114
+ declare function enumSchema<const TValues extends StringTuple>(values: TValues): z.ZodType<TValues[number]>;
115
+ declare function enumSchema<const TValues extends StringTuple, const TOption extends EnumSchemaHelperOption>(values: TValues, option: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z.ZodType<TValues[number]>, TOption['required']>, TOption>;
116
+ declare function enumSchema<const TValues extends StringTuple, const TDefaultValue extends TValues[number] | undefined, const TOption extends EnumSchemaHelperOption>(values: TValues, defaultValue: TDefaultValue, option?: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z.ZodType<TValues[number]>, TOption['required']>, OptionWithDefaultValue<TOption, TDefaultValue>>;
117
+ type BooleanSchemaHelperOption = SchemaHelperOption<BooleanInspectorFieldOption>;
118
+ declare function boolean(): z.ZodBoolean;
119
+ declare function boolean<const TOption extends BooleanSchemaHelperOption>(option: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z.ZodBoolean, TOption['required']>, TOption>;
120
+ declare function boolean<const TDefaultValue extends boolean | undefined, const TOption extends BooleanSchemaHelperOption>(defaultValue: TDefaultValue, option?: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z.ZodBoolean, TOption['required']>, OptionWithDefaultValue<TOption, TDefaultValue>>;
115
121
  type SchemaShape<TSchema extends z.ZodObject<z.ZodRawShape>> = TSchema extends z.ZodObject<infer TShape> ? TShape : never;
116
122
  type SchemaFieldDefaultValue<TFieldSchema> = TFieldSchema extends z.ZodTypeAny ? TFieldSchema extends SchemaHasDefaultValue ? Exclude<z.infer<TFieldSchema>, undefined> : never : never;
117
123
  type SchemaDefaultProps<TSchema extends z.ZodObject<z.ZodRawShape>> = { [Key in keyof SchemaShape<TSchema> as [SchemaFieldDefaultValue<SchemaShape<TSchema>[Key]>] extends [never] ? never : Key]: SchemaFieldDefaultValue<SchemaShape<TSchema>[Key]> };
@@ -130,20 +136,20 @@ type ObjectPropInspectorOption<TShape extends z.ZodRawShape> = Omit<ObjectInspec
130
136
  /**
131
137
  * 定义数组字段schema,支持声明数组项schema。
132
138
  * @param itemSchema 数组项schema
133
- * @param option inspector 字段配置
134
139
  * @returns zod schema
135
140
  */
136
- declare function defineArrayItemPropSchema<TItemSchema extends z.ZodTypeAny, const TOption extends ArrayItemInspectorOption<TItemSchema> & {
141
+ declare function array<TItemSchema extends z.ZodTypeAny>(itemSchema: TItemSchema): z.ZodArray<TItemSchema>;
142
+ declare function array<TItemSchema extends z.ZodTypeAny, const TOption extends ArrayItemInspectorOption<TItemSchema> & {
137
143
  required?: boolean;
138
144
  }>(itemSchema: TItemSchema, option: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z.ZodArray<TItemSchema>, TOption['required']>, TOption>;
139
145
  /**
140
146
  * 定义对象字段schema,支持声明对象shape。
141
147
  * @param shape 对象字段shape
142
- * @param option inspector 字段配置
143
148
  * @returns zod schema
144
149
  */
145
- declare function defineObjectPropSchema<const TShape extends z.ZodRawShape, const TOption extends ObjectPropInspectorOption<TShape> & {
150
+ declare function object<const TShape extends z.ZodRawShape>(shape: TShape): z.ZodObject<TShape>;
151
+ declare function object<const TShape extends z.ZodRawShape, const TOption extends ObjectPropInspectorOption<TShape> & {
146
152
  required?: boolean;
147
153
  }>(shape: TShape, option: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z.ZodObject<TShape>, TOption['required']>, TOption>;
148
154
  //#endregion
149
- export { INSPECTOR_META_KEY, InferSchemaProps, MaterialComponentMode, MaterialComponentProps, SchemaHasDefaultValue, defineArrayItemPropSchema, defineCheckboxPropSchema, defineColorPropSchema, defineComponentPropsSchema, defineDatetimePropSchema, defineNumberPropSchema, defineObjectPropSchema, defineSelectEnumPropSchema, defineSelectPropSchema, defineSwitchPropSchema, defineTextPropSchema, defineTextareaPropSchema, defineTimeRangePropSchema, getSchemaDefaultProps, withInspectorMeta };
155
+ export { ComponentPropsSchemaBuilderHelpers, INSPECTOR_META_KEY, InferSchemaProps, MaterialComponentMode, MaterialComponentProps, SchemaHasDefaultValue, array, boolean, datetime, defineComponentPropsSchema, enumSchema, getSchemaDefaultProps, number, object, string, timeRange, withInspectorMeta };
@@ -1,2 +1,2 @@
1
1
 
2
- import{z as e}from"zod";const t=`inspector`,n=e.enum([`renderer`,`editor`]);function r(e,n){return e.meta({...e.meta()??{},[t]:n})}function i(t){return e.object(t).extend({mode:n.optional()})}function a(e,t){return t===!1?e.optional():e}function o(e,t){return t.defaultValue,e}function s(t){let{required:n=!0,...i}=t;return o(r(a(e.string(),n),{type:`text`,...i}),t)}function c(t){let{required:n=!0,...i}=t;return o(r(a(e.string(),n),{type:`textarea`,...i}),t)}function l(t){let{required:n=!0,...i}=t;return o(r(a(e.number(),n),{type:`number`,...i}),t)}function u(t){let{required:n=!0,...i}=t;return o(r(a(e.string(),n),{type:`color`,...i}),t)}function d(t){let{required:n=!0,...i}=t;return o(r(a(e.string(),n),{type:`datetime`,...i}),t)}const f={start:e.string(),end:e.string()};function p(t){let{required:n=!0,...i}=t;return o(r(a(e.object(f),n),{type:`timeRange`,...i}),t)}function m(t){let{required:n=!0,...i}=t;return o(r(a(e.string(),n),{type:`select`,...i}),t)}function h(t,n){let{required:i=!0,...s}=n;return o(r(a(e.enum(t),i),{type:`select`,...s}),n)}function g(t){let{required:n=!0,...i}=t;return o(r(a(e.boolean(),n),{type:`checkbox`,...i}),t)}function _(t){let{required:n=!0,...i}=t;return o(r(a(e.boolean(),n),{type:`switch`,...i}),t)}function v(e){let n=e,r=new Set;for(;n&&!r.has(n);){r.add(n);let e=n.meta()?.[t];if(e)return e;let i=n.unwrap;if(typeof i!=`function`)break;let a=i.call(n);if(!a||a===n)break;n=a}}function y(e){let t={};for(let[n,r]of Object.entries(e.shape)){let e=v(r);e?.defaultValue!==void 0&&(t[n]=e.defaultValue)}return t}function b(t,n){let{required:i=!0,...s}=n;return o(r(a(e.array(t),i),{type:`array`,...s}),n)}function x(t,n){let{required:i=!0,...s}=n;return o(r(a(e.object(t),i),{type:`object`,...s}),n)}export{t as INSPECTOR_META_KEY,b as defineArrayItemPropSchema,g as defineCheckboxPropSchema,u as defineColorPropSchema,i as defineComponentPropsSchema,d as defineDatetimePropSchema,l as defineNumberPropSchema,x as defineObjectPropSchema,h as defineSelectEnumPropSchema,m as defineSelectPropSchema,_ as defineSwitchPropSchema,s as defineTextPropSchema,c as defineTextareaPropSchema,p as defineTimeRangePropSchema,y as getSchemaDefaultProps,r as withInspectorMeta};
2
+ import{z as e}from"zod";const t=`inspector`,n=e.enum([`renderer`,`editor`]);function r(e,n){return e.meta({...e.meta()??{},[t]:n})}function i(t){let r=typeof t==`function`?t(g()):t;return e.object(r).extend({mode:n.optional()})}function a(e,t){return t===!1?e.optional():e}function o(e,t){return t.defaultValue,e}function s(e){return!e||typeof e!=`object`||Array.isArray(e)?!1:[`label`,`required`,`description`,`fieldType`].some(t=>t in e)}function c(e,t){return t===void 0?s(e)?{option:e,defaultValue:void 0}:{option:{},defaultValue:e}:{option:t,defaultValue:e}}function l(t,n){let{defaultValue:i,option:s}=c(t,n),l={...s,...i===void 0?{}:{defaultValue:i}},{required:u=!0,...d}=l;return o(r(a(e.string(),u),{type:`string`,fieldType:`input`,...d}),l)}function u(t,n){let{defaultValue:i,option:s}=c(t,n),l={...s,...i===void 0?{}:{defaultValue:i}},{required:u=!0,...d}=l;return o(r(a(e.number(),u),{type:`number`,...d}),l)}function d(t,n){let{defaultValue:i,option:s}=c(t,n),l={...s,...i===void 0?{}:{defaultValue:i}},{required:u=!0,...d}=l;return o(r(a(e.string(),u),{type:`datetime`,...d}),l)}const f={start:e.string(),end:e.string()};function p(t,n){let{defaultValue:i,option:s}=c(t,n),l={...s,...i===void 0?{}:{defaultValue:i}},{required:u=!0,...d}=l;return o(r(a(e.object(f),u),{type:`timeRange`,...d}),l)}function m(t,n,i){let{defaultValue:s,option:l}=c(n,i),u={...l,...s===void 0?{}:{defaultValue:s}},{required:d=!0,...f}=u;return o(r(a(e.enum(t),d),{type:`string`,fieldType:`select`,...f}),u)}function h(t,n){let{defaultValue:i,option:s}=c(t,n),l={...s,...i===void 0?{}:{defaultValue:i}},{required:u=!0,...d}=l;return o(r(a(e.boolean(),u),{type:`boolean`,...d}),l)}function g(){return{string:l,number:u,boolean:h,datetime:d,timeRange:p,enum:m,array:y,object:b}}function _(e){let n=e,r=new Set;for(;n&&!r.has(n);){r.add(n);let e=n.meta()?.[t];if(e)return e;let i=n.unwrap;if(typeof i!=`function`)break;let a=i.call(n);if(!a||a===n)break;n=a}}function v(e){let t={};for(let[n,r]of Object.entries(e.shape)){let e=_(r);e?.defaultValue!==void 0&&(t[n]=e.defaultValue)}return t}function y(t,n){let i=n??{},{required:s=!0,...c}=i;return o(r(a(e.array(t),s),{type:`array`,...c}),i)}function b(t,n){let i=n??{},{required:s=!0,...c}=i;return o(r(a(e.object(t),s),{type:`object`,...c}),i)}export{t as INSPECTOR_META_KEY,y as array,h as boolean,d as datetime,i as defineComponentPropsSchema,m as enumSchema,v as getSchemaDefaultProps,u as number,b as object,l as string,p as timeRange,r as withInspectorMeta};
package/dist/utils.d.mts CHANGED
@@ -3,13 +3,14 @@ import { clearMyChannelsFromStorage, loadHiddenChannelIdsFromStorage, loadMyChan
3
3
  import { cn } from "./utils/cn.mjs";
4
4
  import { debounceFun, formatVideoDuration, generateDynamicSign, generateUUID, getAtUserElement, getCookie, getCurrentSecondTime, getUserId, hashPassword, isClient, isMobileDevice, numToString, parseResolution, parseTextAtUserIds, randomString, removeCookie, replaceAtUserElement, replaceAtUserElementHtmlStr, secondToTime, setCookie, stringToNumber, stripHtmlTags, updateUrlParams } from "./utils/common.mjs";
5
5
  import { decryptImageToArrayBuffer, decryptImageToUint8Array, decryptImageUrl, guessImageContentTypeFromUrl, isEncryptedImageUrl, resolveImageUrl, shouldProbeImageUrl, shouldUseApiResDirectly } from "./utils/decrypt-image-client.mjs";
6
+ import { getOrCreateDeviceId } from "./utils/device-id.mjs";
6
7
  import { eventBus } from "./utils/event-bus.mjs";
7
8
  import { checkFollowStatus, followUser, getAppId, getCurrentUserId, unfollowUser } from "./utils/follow-service.mjs";
8
9
  import { getResUrl } from "./utils/get-res-url.mjs";
9
10
  import { disablePageScroll, enablePageScroll, normalizeClassName, pxToVw } from "./utils/helper.mjs";
10
11
  import { HttpClient, HttpError, RequestConfig, RequestMethod, ResponseData, httpClient } from "./utils/http.mjs";
11
12
  import { ImageCompressionQualityRule, compressImage, defaultImageCompressionMaxSizeMB, defaultImageCompressionQuality, getImageCompressionQuality, imageCompressionQualityRules } from "./utils/image-compression.mjs";
12
- import { INSPECTOR_META_KEY, InferSchemaProps, MaterialComponentMode, MaterialComponentProps, SchemaHasDefaultValue, defineArrayItemPropSchema, defineCheckboxPropSchema, defineColorPropSchema, defineComponentPropsSchema, defineDatetimePropSchema, defineNumberPropSchema, defineObjectPropSchema, defineSelectEnumPropSchema, defineSelectPropSchema, defineSwitchPropSchema, defineTextPropSchema, defineTextareaPropSchema, defineTimeRangePropSchema, getSchemaDefaultProps, withInspectorMeta } from "./utils/schema/schema.mjs";
13
+ import { ComponentPropsSchemaBuilderHelpers, INSPECTOR_META_KEY, InferSchemaProps, MaterialComponentMode, MaterialComponentProps, SchemaHasDefaultValue, array, boolean, datetime, defineComponentPropsSchema, enumSchema, getSchemaDefaultProps, number, object, string, timeRange, withInspectorMeta } from "./utils/schema/schema.mjs";
13
14
  import { DefineMaterialOption, MaterialCategory, OverwriteMaterialOption, defineMaterial, overwriteMaterial } from "./utils/schema/material.mjs";
14
15
  import { MaterialMap, generateMaterialMap, generateMaterialMapGroupByCategory } from "./utils/schema/utils.mjs";
15
16
  import "./utils/schema/index.mjs";
@@ -20,4 +21,4 @@ import { PresignedUploadInfo, UploadToS3Options, UploadToS3Result, uploadToS3Wit
20
21
  import { base64ToUint8Array, uint8ArrayToBase64, uint8ArrayToNumberArray } from "./utils/uint8.mjs";
21
22
  import { UploadFileResult, encryptBncBuffer, uploadFile } from "./utils/upload-file.mjs";
22
23
  import { CompatibleRouter, useRouter } from "./utils/use-compatible-router.mjs";
23
- export { CompatibleRouter, DefineMaterialOption, eventBus as EventBus, HttpClient, HttpError, INSPECTOR_META_KEY, ImageCompressionQualityRule, InferSchemaProps, MaterialCategory, MaterialComponentMode, MaterialComponentProps, MaterialMap, OverwriteMaterialOption, PASSWORD_ALLOWED_SPECIAL_CHARS, PASSWORD_MAX_LENGTH, PASSWORD_MIN_LENGTH, PasswordValidationResult, PasswordValidationType, PresignedUploadInfo, RequestConfig, RequestMethod, ResponseData, SchemaHasDefaultValue, UploadFileResult, UploadToS3Options, UploadToS3Result, base64ToUint8Array, checkFollowStatus, clearMyChannelsFromStorage, cn, components, compressImage, createInputAndSelectFile, debounceFun, decryptImageToArrayBuffer, decryptImageToUint8Array, decryptImageUrl, defaultImageCompressionMaxSizeMB, defaultImageCompressionQuality, defineArrayItemPropSchema, defineCheckboxPropSchema, defineColorPropSchema, defineComponentPropsSchema, defineDatetimePropSchema, defineMaterial, defineNumberPropSchema, defineObjectPropSchema, defineSelectEnumPropSchema, defineSelectPropSchema, defineSwitchPropSchema, defineTextPropSchema, defineTextareaPropSchema, defineTimeRangePropSchema, disablePageScroll, enablePageScroll, encryptBncBuffer, followUser, formatVideoDuration, generateDynamicSign, generateMaterialMap, generateMaterialMapGroupByCategory, generateUUID, getAppId, getAtUserElement, getCookie, getCoverImage, getCurrentSecondTime, getCurrentUserId, getFirstInvalidPasswordChar, getImageCompressionQuality, getImageResolutionFromFile, getPasswordCharacterTypeCount, getPasswordValidationErrorText, getResUrl, getSchemaDefaultProps, getUserId, guessImageContentTypeFromUrl, hashPassword, httpClient, imageCompressionQualityRules, isClient, isEncryptedImageUrl, isMobileDevice, loadComponent, loadHiddenChannelIdsFromStorage, loadMyChannelsFromStorage, normalizeClassName, numToString, overwriteMaterial, parseResolution, parseTextAtUserIds, pxToVw, randomString, removeCookie, replaceAtUserElement, replaceAtUserElementHtmlStr, resolveImageUrl, rewriteComponent, saveHiddenChannelIdsToStorage, secondToTime, setCookie, shouldProbeImageUrl, shouldUseApiResDirectly, stringToNumber, stripHtmlTags, uint8ArrayToBase64, uint8ArrayToNumberArray, unfollowUser, updateUrlParams, uploadFile, uploadToS3WithPresignedUrl, useRouter, validatePasswordPair, withInspectorMeta };
24
+ export { CompatibleRouter, ComponentPropsSchemaBuilderHelpers, DefineMaterialOption, eventBus as EventBus, HttpClient, HttpError, INSPECTOR_META_KEY, ImageCompressionQualityRule, InferSchemaProps, MaterialCategory, MaterialComponentMode, MaterialComponentProps, MaterialMap, OverwriteMaterialOption, PASSWORD_ALLOWED_SPECIAL_CHARS, PASSWORD_MAX_LENGTH, PASSWORD_MIN_LENGTH, PasswordValidationResult, PasswordValidationType, PresignedUploadInfo, RequestConfig, RequestMethod, ResponseData, SchemaHasDefaultValue, UploadFileResult, UploadToS3Options, UploadToS3Result, array, base64ToUint8Array, boolean, checkFollowStatus, clearMyChannelsFromStorage, cn, components, compressImage, createInputAndSelectFile, datetime, debounceFun, decryptImageToArrayBuffer, decryptImageToUint8Array, decryptImageUrl, defaultImageCompressionMaxSizeMB, defaultImageCompressionQuality, defineComponentPropsSchema, defineMaterial, disablePageScroll, enablePageScroll, encryptBncBuffer, enumSchema as enum, enumSchema, followUser, formatVideoDuration, generateDynamicSign, generateMaterialMap, generateMaterialMapGroupByCategory, generateUUID, getAppId, getAtUserElement, getCookie, getCoverImage, getCurrentSecondTime, getCurrentUserId, getFirstInvalidPasswordChar, getImageCompressionQuality, getImageResolutionFromFile, getOrCreateDeviceId, getPasswordCharacterTypeCount, getPasswordValidationErrorText, getResUrl, getSchemaDefaultProps, getUserId, guessImageContentTypeFromUrl, hashPassword, httpClient, imageCompressionQualityRules, isClient, isEncryptedImageUrl, isMobileDevice, loadComponent, loadHiddenChannelIdsFromStorage, loadMyChannelsFromStorage, normalizeClassName, numToString, number, object, overwriteMaterial, parseResolution, parseTextAtUserIds, pxToVw, randomString, removeCookie, replaceAtUserElement, replaceAtUserElementHtmlStr, resolveImageUrl, rewriteComponent, saveHiddenChannelIdsToStorage, secondToTime, setCookie, shouldProbeImageUrl, shouldUseApiResDirectly, string, stringToNumber, stripHtmlTags, timeRange, uint8ArrayToBase64, uint8ArrayToNumberArray, unfollowUser, updateUrlParams, uploadFile, uploadToS3WithPresignedUrl, useRouter, validatePasswordPair, withInspectorMeta };