@open-dy/vibecoding-sdk-taro 0.0.1-beta.4 → 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (532) hide show
  1. package/dist/build/plugins/vite-tt-components-entry.d.ts +10 -0
  2. package/dist/build/plugins/vite-tt-components-entry.js +32 -0
  3. package/dist/build/plugins/vite-tt-components-entry.js.map +1 -0
  4. package/dist/build/taro.js +3 -1
  5. package/dist/build/taro.js.map +1 -1
  6. package/dist/reference/llms.txt +52 -2
  7. package/dist/reference/sdk-api/build/taro/BuildContext.md +7 -2
  8. package/dist/reference/sdk-api/build/taro/CreateMicroappTaroConfigOptions.md +1 -2
  9. package/dist/reference/sdk-api/build/taro/createMicroappTaroConfig.md +1 -2
  10. package/dist/reference/sdk-api/runtime/CreateMicroappClientOptions.md +7 -2
  11. package/dist/reference/sdk-api/runtime/createMicroappClient.md +7 -2
  12. package/dist/reference/sdk-api/ui/accordion/Accordion.md +114 -0
  13. package/dist/reference/sdk-api/ui/accordion/AccordionContent.md +100 -0
  14. package/dist/reference/sdk-api/ui/accordion/AccordionItem.md +107 -0
  15. package/dist/reference/sdk-api/ui/accordion/AccordionTrigger.md +100 -0
  16. package/dist/reference/sdk-api/ui/accordion/index.md +12 -0
  17. package/dist/reference/sdk-api/ui/alert/Alert.md +106 -0
  18. package/dist/reference/sdk-api/ui/alert/AlertAction.md +100 -0
  19. package/dist/reference/sdk-api/ui/alert/AlertDescription.md +100 -0
  20. package/dist/reference/sdk-api/ui/alert/AlertTitle.md +100 -0
  21. package/dist/reference/sdk-api/ui/alert/index.md +12 -0
  22. package/dist/reference/sdk-api/ui/alert-dialog/AlertDialog.md +58 -0
  23. package/dist/reference/sdk-api/ui/alert-dialog/AlertDialogAction.md +107 -0
  24. package/dist/reference/sdk-api/ui/alert-dialog/AlertDialogCancel.md +107 -0
  25. package/dist/reference/sdk-api/ui/alert-dialog/AlertDialogContent.md +106 -0
  26. package/dist/reference/sdk-api/ui/alert-dialog/AlertDialogDescription.md +100 -0
  27. package/dist/reference/sdk-api/ui/alert-dialog/AlertDialogFooter.md +100 -0
  28. package/dist/reference/sdk-api/ui/alert-dialog/AlertDialogHeader.md +100 -0
  29. package/dist/reference/sdk-api/ui/alert-dialog/AlertDialogOverlay.md +100 -0
  30. package/dist/reference/sdk-api/ui/alert-dialog/AlertDialogPortal.md +55 -0
  31. package/dist/reference/sdk-api/ui/alert-dialog/AlertDialogTitle.md +100 -0
  32. package/dist/reference/sdk-api/ui/alert-dialog/AlertDialogTrigger.md +118 -0
  33. package/dist/reference/sdk-api/ui/alert-dialog/index.md +19 -0
  34. package/dist/reference/sdk-api/ui/aspect-ratio/AspectRatio.md +106 -0
  35. package/dist/reference/sdk-api/ui/aspect-ratio/index.md +9 -0
  36. package/dist/reference/sdk-api/ui/avatar/Avatar.md +106 -0
  37. package/dist/reference/sdk-api/ui/avatar/AvatarBadge.md +100 -0
  38. package/dist/reference/sdk-api/ui/avatar/AvatarFallback.md +100 -0
  39. package/dist/reference/sdk-api/ui/avatar/AvatarGroup.md +100 -0
  40. package/dist/reference/sdk-api/ui/avatar/AvatarGroupCount.md +100 -0
  41. package/dist/reference/sdk-api/ui/avatar/AvatarImage.md +108 -0
  42. package/dist/reference/sdk-api/ui/avatar/index.md +14 -0
  43. package/dist/reference/sdk-api/ui/badge/Badge.md +114 -0
  44. package/dist/reference/sdk-api/ui/badge/badgeVariants.md +70 -0
  45. package/dist/reference/sdk-api/ui/badge/index.md +10 -0
  46. package/dist/reference/sdk-api/ui/button/Button.md +210 -0
  47. package/dist/reference/sdk-api/ui/button/ButtonProps.md +188 -0
  48. package/dist/reference/sdk-api/ui/button/buttonVariants.md +84 -0
  49. package/dist/reference/sdk-api/ui/button/index.md +11 -0
  50. package/dist/reference/sdk-api/ui/button-group/ButtonGroup.md +106 -0
  51. package/dist/reference/sdk-api/ui/button-group/ButtonGroupSeparator.md +106 -0
  52. package/dist/reference/sdk-api/ui/button-group/ButtonGroupText.md +106 -0
  53. package/dist/reference/sdk-api/ui/button-group/buttonGroupVariants.md +70 -0
  54. package/dist/reference/sdk-api/ui/button-group/index.md +12 -0
  55. package/dist/reference/sdk-api/ui/calendar/Calendar.md +144 -0
  56. package/dist/reference/sdk-api/ui/calendar/CalendarProps.md +118 -0
  57. package/dist/reference/sdk-api/ui/calendar/index.md +10 -0
  58. package/dist/reference/sdk-api/ui/card/Card.md +106 -0
  59. package/dist/reference/sdk-api/ui/card/CardAction.md +100 -0
  60. package/dist/reference/sdk-api/ui/card/CardContent.md +100 -0
  61. package/dist/reference/sdk-api/ui/card/CardDescription.md +100 -0
  62. package/dist/reference/sdk-api/ui/card/CardFooter.md +100 -0
  63. package/dist/reference/sdk-api/ui/card/CardHeader.md +100 -0
  64. package/dist/reference/sdk-api/ui/card/CardTitle.md +100 -0
  65. package/dist/reference/sdk-api/ui/card/index.md +15 -0
  66. package/dist/reference/sdk-api/ui/carousel/Carousel.md +108 -0
  67. package/dist/reference/sdk-api/ui/carousel/CarouselContent.md +100 -0
  68. package/dist/reference/sdk-api/ui/carousel/CarouselItem.md +100 -0
  69. package/dist/reference/sdk-api/ui/carousel/CarouselNext.md +219 -0
  70. package/dist/reference/sdk-api/ui/carousel/CarouselPrevious.md +219 -0
  71. package/dist/reference/sdk-api/ui/carousel/index.md +14 -0
  72. package/dist/reference/sdk-api/ui/carousel/useCarousel.md +46 -0
  73. package/dist/reference/sdk-api/ui/checkbox/Checkbox.md +109 -0
  74. package/dist/reference/sdk-api/ui/checkbox/index.md +9 -0
  75. package/dist/reference/sdk-api/ui/collapsible/Collapsible.md +108 -0
  76. package/dist/reference/sdk-api/ui/collapsible/CollapsibleContent.md +100 -0
  77. package/dist/reference/sdk-api/ui/collapsible/CollapsibleTrigger.md +119 -0
  78. package/dist/reference/sdk-api/ui/collapsible/index.md +11 -0
  79. package/dist/reference/sdk-api/ui/combobox/Combobox.md +124 -0
  80. package/dist/reference/sdk-api/ui/combobox/ComboboxChip.md +107 -0
  81. package/dist/reference/sdk-api/ui/combobox/ComboboxChips.md +100 -0
  82. package/dist/reference/sdk-api/ui/combobox/ComboboxChipsInput.md +107 -0
  83. package/dist/reference/sdk-api/ui/combobox/ComboboxCollection.md +100 -0
  84. package/dist/reference/sdk-api/ui/combobox/ComboboxContent.md +106 -0
  85. package/dist/reference/sdk-api/ui/combobox/ComboboxEmpty.md +100 -0
  86. package/dist/reference/sdk-api/ui/combobox/ComboboxGroup.md +100 -0
  87. package/dist/reference/sdk-api/ui/combobox/ComboboxInput.md +113 -0
  88. package/dist/reference/sdk-api/ui/combobox/ComboboxItem.md +106 -0
  89. package/dist/reference/sdk-api/ui/combobox/ComboboxLabel.md +100 -0
  90. package/dist/reference/sdk-api/ui/combobox/ComboboxList.md +105 -0
  91. package/dist/reference/sdk-api/ui/combobox/ComboboxSeparator.md +100 -0
  92. package/dist/reference/sdk-api/ui/combobox/ComboboxTrigger.md +100 -0
  93. package/dist/reference/sdk-api/ui/combobox/ComboboxValue.md +105 -0
  94. package/dist/reference/sdk-api/ui/combobox/index.md +24 -0
  95. package/dist/reference/sdk-api/ui/combobox/useComboboxAnchor.md +43 -0
  96. package/dist/reference/sdk-api/ui/dialog/Dialog.md +58 -0
  97. package/dist/reference/sdk-api/ui/dialog/DialogClose.md +100 -0
  98. package/dist/reference/sdk-api/ui/dialog/DialogContent.md +107 -0
  99. package/dist/reference/sdk-api/ui/dialog/DialogDescription.md +100 -0
  100. package/dist/reference/sdk-api/ui/dialog/DialogFooter.md +100 -0
  101. package/dist/reference/sdk-api/ui/dialog/DialogHeader.md +100 -0
  102. package/dist/reference/sdk-api/ui/dialog/DialogOverlay.md +100 -0
  103. package/dist/reference/sdk-api/ui/dialog/DialogPortal.md +55 -0
  104. package/dist/reference/sdk-api/ui/dialog/DialogTitle.md +100 -0
  105. package/dist/reference/sdk-api/ui/dialog/DialogTrigger.md +106 -0
  106. package/dist/reference/sdk-api/ui/dialog/index.md +18 -0
  107. package/dist/reference/sdk-api/ui/drawer/Drawer.md +59 -0
  108. package/dist/reference/sdk-api/ui/drawer/DrawerClose.md +100 -0
  109. package/dist/reference/sdk-api/ui/drawer/DrawerContent.md +100 -0
  110. package/dist/reference/sdk-api/ui/drawer/DrawerDescription.md +100 -0
  111. package/dist/reference/sdk-api/ui/drawer/DrawerFooter.md +100 -0
  112. package/dist/reference/sdk-api/ui/drawer/DrawerHeader.md +100 -0
  113. package/dist/reference/sdk-api/ui/drawer/DrawerOverlay.md +100 -0
  114. package/dist/reference/sdk-api/ui/drawer/DrawerPortal.md +55 -0
  115. package/dist/reference/sdk-api/ui/drawer/DrawerTitle.md +100 -0
  116. package/dist/reference/sdk-api/ui/drawer/DrawerTrigger.md +100 -0
  117. package/dist/reference/sdk-api/ui/drawer/index.md +18 -0
  118. package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenu.md +58 -0
  119. package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuCheckboxItem.md +107 -0
  120. package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuContent.md +106 -0
  121. package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuGroup.md +100 -0
  122. package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuItem.md +107 -0
  123. package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuLabel.md +106 -0
  124. package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuPortal.md +55 -0
  125. package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuRadioGroup.md +100 -0
  126. package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuRadioItem.md +106 -0
  127. package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuSeparator.md +100 -0
  128. package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuShortcut.md +100 -0
  129. package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuSub.md +58 -0
  130. package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuSubContent.md +100 -0
  131. package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuSubTrigger.md +106 -0
  132. package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuTrigger.md +119 -0
  133. package/dist/reference/sdk-api/ui/dropdown-menu/index.md +23 -0
  134. package/dist/reference/sdk-api/ui/empty/Empty.md +100 -0
  135. package/dist/reference/sdk-api/ui/empty/EmptyContent.md +100 -0
  136. package/dist/reference/sdk-api/ui/empty/EmptyDescription.md +100 -0
  137. package/dist/reference/sdk-api/ui/empty/EmptyHeader.md +100 -0
  138. package/dist/reference/sdk-api/ui/empty/EmptyMedia.md +106 -0
  139. package/dist/reference/sdk-api/ui/empty/EmptyTitle.md +100 -0
  140. package/dist/reference/sdk-api/ui/empty/index.md +14 -0
  141. package/dist/reference/sdk-api/ui/field/Field.md +106 -0
  142. package/dist/reference/sdk-api/ui/field/FieldContent.md +100 -0
  143. package/dist/reference/sdk-api/ui/field/FieldDescription.md +100 -0
  144. package/dist/reference/sdk-api/ui/field/FieldError.md +112 -0
  145. package/dist/reference/sdk-api/ui/field/FieldGroup.md +100 -0
  146. package/dist/reference/sdk-api/ui/field/FieldLabel.md +85 -0
  147. package/dist/reference/sdk-api/ui/field/FieldLegend.md +106 -0
  148. package/dist/reference/sdk-api/ui/field/FieldSeparator.md +105 -0
  149. package/dist/reference/sdk-api/ui/field/FieldSet.md +100 -0
  150. package/dist/reference/sdk-api/ui/field/FieldTitle.md +100 -0
  151. package/dist/reference/sdk-api/ui/field/index.md +18 -0
  152. package/dist/reference/sdk-api/ui/helpers/collectDataIconState.md +66 -0
  153. package/dist/reference/sdk-api/ui/helpers/index.md +9 -0
  154. package/dist/reference/sdk-api/ui/index.md +57 -0
  155. package/dist/reference/sdk-api/ui/input/Input.md +141 -0
  156. package/dist/reference/sdk-api/ui/input/index.md +9 -0
  157. package/dist/reference/sdk-api/ui/input-group/InputGroup.md +100 -0
  158. package/dist/reference/sdk-api/ui/input-group/InputGroupAddon.md +109 -0
  159. package/dist/reference/sdk-api/ui/input-group/InputGroupButton.md +220 -0
  160. package/dist/reference/sdk-api/ui/input-group/InputGroupInput.md +135 -0
  161. package/dist/reference/sdk-api/ui/input-group/InputGroupText.md +100 -0
  162. package/dist/reference/sdk-api/ui/input-group/InputGroupTextarea.md +126 -0
  163. package/dist/reference/sdk-api/ui/input-group/index.md +14 -0
  164. package/dist/reference/sdk-api/ui/input-otp/InputOTP.md +111 -0
  165. package/dist/reference/sdk-api/ui/input-otp/InputOTPGroup.md +100 -0
  166. package/dist/reference/sdk-api/ui/input-otp/InputOTPSeparator.md +100 -0
  167. package/dist/reference/sdk-api/ui/input-otp/InputOTPSlot.md +107 -0
  168. package/dist/reference/sdk-api/ui/input-otp/index.md +12 -0
  169. package/dist/reference/sdk-api/ui/item/Item.md +115 -0
  170. package/dist/reference/sdk-api/ui/item/ItemActions.md +100 -0
  171. package/dist/reference/sdk-api/ui/item/ItemContent.md +100 -0
  172. package/dist/reference/sdk-api/ui/item/ItemDescription.md +100 -0
  173. package/dist/reference/sdk-api/ui/item/ItemFooter.md +100 -0
  174. package/dist/reference/sdk-api/ui/item/ItemGroup.md +100 -0
  175. package/dist/reference/sdk-api/ui/item/ItemHeader.md +100 -0
  176. package/dist/reference/sdk-api/ui/item/ItemMedia.md +106 -0
  177. package/dist/reference/sdk-api/ui/item/ItemSeparator.md +106 -0
  178. package/dist/reference/sdk-api/ui/item/ItemTitle.md +100 -0
  179. package/dist/reference/sdk-api/ui/item/index.md +18 -0
  180. package/dist/reference/sdk-api/ui/label/Label.md +85 -0
  181. package/dist/reference/sdk-api/ui/label/index.md +9 -0
  182. package/dist/reference/sdk-api/ui/menubar/Menubar.md +100 -0
  183. package/dist/reference/sdk-api/ui/menubar/MenubarCheckboxItem.md +111 -0
  184. package/dist/reference/sdk-api/ui/menubar/MenubarContent.md +108 -0
  185. package/dist/reference/sdk-api/ui/menubar/MenubarGroup.md +100 -0
  186. package/dist/reference/sdk-api/ui/menubar/MenubarItem.md +109 -0
  187. package/dist/reference/sdk-api/ui/menubar/MenubarLabel.md +106 -0
  188. package/dist/reference/sdk-api/ui/menubar/MenubarMenu.md +55 -0
  189. package/dist/reference/sdk-api/ui/menubar/MenubarPortal.md +55 -0
  190. package/dist/reference/sdk-api/ui/menubar/MenubarRadioGroup.md +108 -0
  191. package/dist/reference/sdk-api/ui/menubar/MenubarRadioItem.md +110 -0
  192. package/dist/reference/sdk-api/ui/menubar/MenubarSeparator.md +100 -0
  193. package/dist/reference/sdk-api/ui/menubar/MenubarShortcut.md +100 -0
  194. package/dist/reference/sdk-api/ui/menubar/MenubarSub.md +58 -0
  195. package/dist/reference/sdk-api/ui/menubar/MenubarSubContent.md +108 -0
  196. package/dist/reference/sdk-api/ui/menubar/MenubarSubTrigger.md +107 -0
  197. package/dist/reference/sdk-api/ui/menubar/MenubarTrigger.md +100 -0
  198. package/dist/reference/sdk-api/ui/menubar/index.md +24 -0
  199. package/dist/reference/sdk-api/ui/navigation-menu/NavigationMenu.md +100 -0
  200. package/dist/reference/sdk-api/ui/navigation-menu/NavigationMenuContent.md +106 -0
  201. package/dist/reference/sdk-api/ui/navigation-menu/NavigationMenuIndicator.md +100 -0
  202. package/dist/reference/sdk-api/ui/navigation-menu/NavigationMenuItem.md +106 -0
  203. package/dist/reference/sdk-api/ui/navigation-menu/NavigationMenuLink.md +106 -0
  204. package/dist/reference/sdk-api/ui/navigation-menu/NavigationMenuList.md +100 -0
  205. package/dist/reference/sdk-api/ui/navigation-menu/NavigationMenuPositioner.md +100 -0
  206. package/dist/reference/sdk-api/ui/navigation-menu/NavigationMenuTrigger.md +120 -0
  207. package/dist/reference/sdk-api/ui/navigation-menu/index.md +17 -0
  208. package/dist/reference/sdk-api/ui/navigation-menu/navigationMenuTriggerStyle.md +64 -0
  209. package/dist/reference/sdk-api/ui/pagination/Pagination.md +100 -0
  210. package/dist/reference/sdk-api/ui/pagination/PaginationContent.md +100 -0
  211. package/dist/reference/sdk-api/ui/pagination/PaginationEllipsis.md +100 -0
  212. package/dist/reference/sdk-api/ui/pagination/PaginationItem.md +100 -0
  213. package/dist/reference/sdk-api/ui/pagination/PaginationLink.md +107 -0
  214. package/dist/reference/sdk-api/ui/pagination/PaginationNext.md +121 -0
  215. package/dist/reference/sdk-api/ui/pagination/PaginationPrevious.md +121 -0
  216. package/dist/reference/sdk-api/ui/pagination/index.md +15 -0
  217. package/dist/reference/sdk-api/ui/popover/Popover.md +58 -0
  218. package/dist/reference/sdk-api/ui/popover/PopoverAnchor.md +100 -0
  219. package/dist/reference/sdk-api/ui/popover/PopoverContent.md +108 -0
  220. package/dist/reference/sdk-api/ui/popover/PopoverDescription.md +100 -0
  221. package/dist/reference/sdk-api/ui/popover/PopoverHeader.md +100 -0
  222. package/dist/reference/sdk-api/ui/popover/PopoverTitle.md +100 -0
  223. package/dist/reference/sdk-api/ui/popover/PopoverTrigger.md +119 -0
  224. package/dist/reference/sdk-api/ui/popover/index.md +15 -0
  225. package/dist/reference/sdk-api/ui/portal/Portal.md +55 -0
  226. package/dist/reference/sdk-api/ui/portal/index.md +9 -0
  227. package/dist/reference/sdk-api/ui/progress/Progress.md +109 -0
  228. package/dist/reference/sdk-api/ui/progress/ProgressIndicator.md +107 -0
  229. package/dist/reference/sdk-api/ui/progress/ProgressLabel.md +100 -0
  230. package/dist/reference/sdk-api/ui/progress/ProgressTrack.md +100 -0
  231. package/dist/reference/sdk-api/ui/progress/ProgressValue.md +105 -0
  232. package/dist/reference/sdk-api/ui/progress/index.md +13 -0
  233. package/dist/reference/sdk-api/ui/radio-group/RadioGroup.md +108 -0
  234. package/dist/reference/sdk-api/ui/radio-group/RadioGroupItem.md +107 -0
  235. package/dist/reference/sdk-api/ui/radio-group/index.md +10 -0
  236. package/dist/reference/sdk-api/ui/resizable/ResizableHandle.md +107 -0
  237. package/dist/reference/sdk-api/ui/resizable/ResizablePanel.md +108 -0
  238. package/dist/reference/sdk-api/ui/resizable/ResizablePanelGroup.md +107 -0
  239. package/dist/reference/sdk-api/ui/resizable/index.md +11 -0
  240. package/dist/reference/sdk-api/ui/scroll-area/ScrollArea.md +159 -0
  241. package/dist/reference/sdk-api/ui/scroll-area/ScrollBar.md +106 -0
  242. package/dist/reference/sdk-api/ui/scroll-area/index.md +10 -0
  243. package/dist/reference/sdk-api/ui/select/Select.md +80 -0
  244. package/dist/reference/sdk-api/ui/select/SelectContent.md +106 -0
  245. package/dist/reference/sdk-api/ui/select/SelectGroup.md +100 -0
  246. package/dist/reference/sdk-api/ui/select/SelectItem.md +106 -0
  247. package/dist/reference/sdk-api/ui/select/SelectLabel.md +100 -0
  248. package/dist/reference/sdk-api/ui/select/SelectScrollDownButton.md +100 -0
  249. package/dist/reference/sdk-api/ui/select/SelectScrollUpButton.md +100 -0
  250. package/dist/reference/sdk-api/ui/select/SelectSeparator.md +100 -0
  251. package/dist/reference/sdk-api/ui/select/SelectTrigger.md +106 -0
  252. package/dist/reference/sdk-api/ui/select/SelectValue.md +106 -0
  253. package/dist/reference/sdk-api/ui/select/index.md +18 -0
  254. package/dist/reference/sdk-api/ui/separator/Separator.md +106 -0
  255. package/dist/reference/sdk-api/ui/separator/index.md +9 -0
  256. package/dist/reference/sdk-api/ui/sheet/Sheet.md +58 -0
  257. package/dist/reference/sdk-api/ui/sheet/SheetClose.md +100 -0
  258. package/dist/reference/sdk-api/ui/sheet/SheetContent.md +113 -0
  259. package/dist/reference/sdk-api/ui/sheet/SheetDescription.md +100 -0
  260. package/dist/reference/sdk-api/ui/sheet/SheetFooter.md +100 -0
  261. package/dist/reference/sdk-api/ui/sheet/SheetHeader.md +100 -0
  262. package/dist/reference/sdk-api/ui/sheet/SheetOverlay.md +100 -0
  263. package/dist/reference/sdk-api/ui/sheet/SheetPortal.md +55 -0
  264. package/dist/reference/sdk-api/ui/sheet/SheetTitle.md +100 -0
  265. package/dist/reference/sdk-api/ui/sheet/SheetTrigger.md +100 -0
  266. package/dist/reference/sdk-api/ui/sheet/index.md +18 -0
  267. package/dist/reference/sdk-api/ui/skeleton/Skeleton.md +100 -0
  268. package/dist/reference/sdk-api/ui/skeleton/index.md +9 -0
  269. package/dist/reference/sdk-api/ui/slider/Slider.md +116 -0
  270. package/dist/reference/sdk-api/ui/slider/index.md +9 -0
  271. package/dist/reference/sdk-api/ui/sonner/Toaster.md +43 -0
  272. package/dist/reference/sdk-api/ui/sonner/index.md +10 -0
  273. package/dist/reference/sdk-api/ui/sonner/toast.md +58 -0
  274. package/dist/reference/sdk-api/ui/spinner/Spinner.md +100 -0
  275. package/dist/reference/sdk-api/ui/spinner/index.md +9 -0
  276. package/dist/reference/sdk-api/ui/switch/Switch.md +110 -0
  277. package/dist/reference/sdk-api/ui/switch/index.md +9 -0
  278. package/dist/reference/sdk-api/ui/table/Table.md +100 -0
  279. package/dist/reference/sdk-api/ui/table/TableBody.md +100 -0
  280. package/dist/reference/sdk-api/ui/table/TableCaption.md +100 -0
  281. package/dist/reference/sdk-api/ui/table/TableCell.md +106 -0
  282. package/dist/reference/sdk-api/ui/table/TableFooter.md +100 -0
  283. package/dist/reference/sdk-api/ui/table/TableHead.md +106 -0
  284. package/dist/reference/sdk-api/ui/table/TableHeader.md +100 -0
  285. package/dist/reference/sdk-api/ui/table/TableRow.md +100 -0
  286. package/dist/reference/sdk-api/ui/table/index.md +16 -0
  287. package/dist/reference/sdk-api/ui/tabs/Tabs.md +109 -0
  288. package/dist/reference/sdk-api/ui/tabs/TabsContent.md +106 -0
  289. package/dist/reference/sdk-api/ui/tabs/TabsList.md +106 -0
  290. package/dist/reference/sdk-api/ui/tabs/TabsTrigger.md +107 -0
  291. package/dist/reference/sdk-api/ui/tabs/index.md +13 -0
  292. package/dist/reference/sdk-api/ui/tabs/tabsListVariants.md +70 -0
  293. package/dist/reference/sdk-api/ui/textarea/Textarea.md +126 -0
  294. package/dist/reference/sdk-api/ui/textarea/index.md +9 -0
  295. package/dist/reference/sdk-api/ui/toggle/Toggle.md +118 -0
  296. package/dist/reference/sdk-api/ui/toggle/index.md +10 -0
  297. package/dist/reference/sdk-api/ui/toggle/toggleVariants.md +71 -0
  298. package/dist/reference/sdk-api/ui/toggle-group/ToggleGroup.md +122 -0
  299. package/dist/reference/sdk-api/ui/toggle-group/ToggleGroupItem.md +116 -0
  300. package/dist/reference/sdk-api/ui/toggle-group/index.md +10 -0
  301. package/dist/reference/sdk-api.json +73810 -2
  302. package/dist/reference/sdk-api.md +50 -2
  303. package/dist/ui/accordion.d.ts +48 -0
  304. package/dist/ui/accordion.js +40 -0
  305. package/dist/ui/accordion.js.map +1 -1
  306. package/dist/ui/alert-dialog.d.ts +123 -0
  307. package/dist/ui/alert-dialog.js +114 -0
  308. package/dist/ui/alert-dialog.js.map +1 -1
  309. package/dist/ui/alert.d.ts +41 -0
  310. package/dist/ui/alert.js +41 -0
  311. package/dist/ui/alert.js.map +1 -1
  312. package/dist/ui/aspect-ratio.d.ts +11 -0
  313. package/dist/ui/aspect-ratio.js +10 -0
  314. package/dist/ui/aspect-ratio.js.map +1 -1
  315. package/dist/ui/avatar.d.ts +65 -0
  316. package/dist/ui/avatar.js +63 -0
  317. package/dist/ui/avatar.js.map +1 -1
  318. package/dist/ui/badge.d.ts +22 -0
  319. package/dist/ui/badge.js +22 -0
  320. package/dist/ui/badge.js.map +1 -1
  321. package/dist/ui/button-group.d.ts +45 -0
  322. package/dist/ui/button-group.js +43 -0
  323. package/dist/ui/button-group.js.map +1 -1
  324. package/dist/ui/button.d.ts +52 -0
  325. package/dist/ui/button.js +30 -0
  326. package/dist/ui/button.js.map +1 -1
  327. package/dist/ui/calendar.d.ts +44 -0
  328. package/dist/ui/calendar.js +19 -0
  329. package/dist/ui/calendar.js.map +1 -1
  330. package/dist/ui/card.d.ts +71 -0
  331. package/dist/ui/card.js +70 -0
  332. package/dist/ui/card.js.map +1 -1
  333. package/dist/ui/carousel.d.ts +71 -0
  334. package/dist/ui/carousel.js +66 -0
  335. package/dist/ui/carousel.js.map +1 -1
  336. package/dist/ui/checkbox.d.ts +14 -0
  337. package/dist/ui/checkbox.js +10 -0
  338. package/dist/ui/checkbox.js.map +1 -1
  339. package/dist/ui/collapsible.d.ts +37 -0
  340. package/dist/ui/collapsible.js +30 -0
  341. package/dist/ui/collapsible.js.map +1 -1
  342. package/dist/ui/combobox.d.ts +190 -0
  343. package/dist/ui/combobox.js +167 -0
  344. package/dist/ui/combobox.js.map +1 -1
  345. package/dist/ui/dialog.d.ts +109 -0
  346. package/dist/ui/dialog.js +100 -0
  347. package/dist/ui/dialog.js.map +1 -1
  348. package/dist/ui/drawer.d.ts +106 -0
  349. package/dist/ui/drawer.js +100 -0
  350. package/dist/ui/drawer.js.map +1 -1
  351. package/dist/ui/dropdown-menu.d.ts +171 -0
  352. package/dist/ui/dropdown-menu.js +150 -0
  353. package/dist/ui/dropdown-menu.js.map +1 -1
  354. package/dist/ui/empty.d.ts +61 -0
  355. package/dist/ui/empty.js +61 -0
  356. package/dist/ui/empty.js.map +1 -1
  357. package/dist/ui/field.d.ts +105 -0
  358. package/dist/ui/field.js +101 -0
  359. package/dist/ui/field.js.map +1 -1
  360. package/dist/ui/helpers.d.ts +11 -0
  361. package/dist/ui/helpers.js +11 -0
  362. package/dist/ui/helpers.js.map +1 -1
  363. package/dist/ui/input-group.d.ts +65 -0
  364. package/dist/ui/input-group.js +65 -0
  365. package/dist/ui/input-group.js.map +1 -1
  366. package/dist/ui/input-otp.d.ts +48 -0
  367. package/dist/ui/input-otp.js +40 -0
  368. package/dist/ui/input-otp.js.map +1 -1
  369. package/dist/ui/input.d.ts +24 -2
  370. package/dist/ui/input.js +20 -0
  371. package/dist/ui/input.js.map +1 -1
  372. package/dist/ui/item.d.ts +103 -0
  373. package/dist/ui/item.js +103 -0
  374. package/dist/ui/item.js.map +1 -1
  375. package/dist/ui/label.d.ts +10 -0
  376. package/dist/ui/label.js +10 -0
  377. package/dist/ui/label.js.map +1 -1
  378. package/dist/ui/menubar.d.ts +193 -0
  379. package/dist/ui/menubar.js +160 -0
  380. package/dist/ui/menubar.js.map +1 -1
  381. package/dist/ui/navigation-menu.d.ts +98 -0
  382. package/dist/ui/navigation-menu.js +90 -0
  383. package/dist/ui/navigation-menu.js.map +1 -1
  384. package/dist/ui/pagination.d.ts +76 -0
  385. package/dist/ui/pagination.js +73 -0
  386. package/dist/ui/pagination.js.map +1 -1
  387. package/dist/ui/popover.d.ts +81 -0
  388. package/dist/ui/popover.js +70 -0
  389. package/dist/ui/popover.js.map +1 -1
  390. package/dist/ui/portal.d.ts +11 -0
  391. package/dist/ui/portal.js +10 -0
  392. package/dist/ui/portal.js.map +1 -1
  393. package/dist/ui/progress.d.ts +53 -26
  394. package/dist/ui/progress.js +50 -26
  395. package/dist/ui/progress.js.map +1 -1
  396. package/dist/ui/radio-group.d.ts +25 -0
  397. package/dist/ui/radio-group.js +20 -0
  398. package/dist/ui/radio-group.js.map +1 -1
  399. package/dist/ui/resizable.d.ts +37 -0
  400. package/dist/ui/resizable.js +30 -0
  401. package/dist/ui/resizable.js.map +1 -1
  402. package/dist/ui/scroll-area.d.ts +22 -0
  403. package/dist/ui/scroll-area.js +21 -0
  404. package/dist/ui/scroll-area.js.map +1 -1
  405. package/dist/ui/select.d.ts +122 -0
  406. package/dist/ui/select.js +108 -0
  407. package/dist/ui/select.js.map +1 -1
  408. package/dist/ui/separator.d.ts +11 -0
  409. package/dist/ui/separator.js +10 -0
  410. package/dist/ui/separator.js.map +1 -1
  411. package/dist/ui/sheet.d.ts +107 -0
  412. package/dist/ui/sheet.js +101 -0
  413. package/dist/ui/sheet.js.map +1 -1
  414. package/dist/ui/skeleton.d.ts +10 -0
  415. package/dist/ui/skeleton.js +10 -0
  416. package/dist/ui/skeleton.js.map +1 -1
  417. package/dist/ui/slider.d.ts +21 -0
  418. package/dist/ui/slider.js +14 -0
  419. package/dist/ui/slider.js.map +1 -1
  420. package/dist/ui/sonner.d.ts +23 -0
  421. package/dist/ui/sonner.js +21 -0
  422. package/dist/ui/sonner.js.map +1 -1
  423. package/dist/ui/spinner.d.ts +10 -0
  424. package/dist/ui/spinner.js +10 -0
  425. package/dist/ui/spinner.js.map +1 -1
  426. package/dist/ui/switch.d.ts +15 -0
  427. package/dist/ui/switch.js +10 -0
  428. package/dist/ui/switch.js.map +1 -1
  429. package/dist/ui/table.d.ts +81 -0
  430. package/dist/ui/table.js +80 -0
  431. package/dist/ui/table.js.map +1 -1
  432. package/dist/ui/tabs.d.ts +59 -0
  433. package/dist/ui/tabs.js +51 -0
  434. package/dist/ui/tabs.js.map +1 -1
  435. package/dist/ui/textarea.d.ts +13 -0
  436. package/dist/ui/textarea.js +13 -0
  437. package/dist/ui/textarea.js.map +1 -1
  438. package/dist/ui/toggle-group.d.ts +34 -0
  439. package/dist/ui/toggle-group.js +24 -0
  440. package/dist/ui/toggle-group.js.map +1 -1
  441. package/dist/ui/toggle.d.ts +28 -0
  442. package/dist/ui/toggle.js +24 -0
  443. package/dist/ui/toggle.js.map +1 -1
  444. package/package.json +5 -3
  445. package/release-provenance.json +15 -0
  446. package/src/adapters/interest-card/eslint/eslint-plugin-custom-navigation.mjs +290 -0
  447. package/src/adapters/interest-card/eslint/taro.mjs +55 -0
  448. package/src/adapters/interest-card/runtime/microapp.ts +11 -0
  449. package/src/adapters/interest-card/types/taro.d.ts +28 -0
  450. package/src/build/config-overrides.ts +39 -0
  451. package/src/build/index.ts +5 -0
  452. package/src/build/plugins/app-config.ts +47 -0
  453. package/src/build/plugins/depend-card/analyze.ts +122 -0
  454. package/src/build/plugins/depend-card/source.ts +97 -0
  455. package/src/build/plugins/vite-depend-card.ts +168 -0
  456. package/src/build/plugins/vite-image-asset-import.ts +178 -0
  457. package/src/build/plugins/vite-inline-json.ts +149 -0
  458. package/src/build/plugins/vite-taro-source-location.ts +224 -0
  459. package/src/build/plugins/vite-tt-components-entry.ts +33 -0
  460. package/src/build/taro.ts +830 -0
  461. package/src/components/miniapp-open-card.ts +49 -0
  462. package/src/components/native-miniapp-open-card.ts +7 -0
  463. package/src/eslint/eslint-plugin-microapp-pages.mjs +659 -0
  464. package/src/eslint/server.mjs +69 -0
  465. package/src/eslint/taro.mjs +553 -0
  466. package/src/index.ts +2 -0
  467. package/src/internal/runtime/douyin-open-button.d.ts +29 -0
  468. package/src/internal/runtime/iframe-auth/identity.ts +236 -0
  469. package/src/internal/runtime/iframe-auth/index.ts +2 -0
  470. package/src/internal/runtime/iframe-auth/sync.ts +37 -0
  471. package/src/internal/vendor-modules.d.ts +8 -0
  472. package/src/lib/measure.ts +115 -0
  473. package/src/lib/platform.ts +11 -0
  474. package/src/lib/utils.ts +6 -0
  475. package/src/runtime/client.ts +246 -0
  476. package/src/runtime/default-client.ts +26 -0
  477. package/src/runtime/default-iframe-auth.ts +13 -0
  478. package/src/runtime/douyin-container-request.ts +367 -0
  479. package/src/runtime/douyin-login-request.ts +514 -0
  480. package/src/runtime/globals.d.ts +342 -0
  481. package/src/runtime/index.ts +4 -0
  482. package/src/runtime/network-url.ts +63 -0
  483. package/src/ui/accordion.tsx +226 -0
  484. package/src/ui/alert-dialog.tsx +407 -0
  485. package/src/ui/alert.tsx +149 -0
  486. package/src/ui/aspect-ratio.tsx +37 -0
  487. package/src/ui/avatar.tsx +238 -0
  488. package/src/ui/badge.tsx +77 -0
  489. package/src/ui/button-group.tsx +173 -0
  490. package/src/ui/button.tsx +215 -0
  491. package/src/ui/calendar.tsx +353 -0
  492. package/src/ui/card.tsx +217 -0
  493. package/src/ui/carousel.tsx +259 -0
  494. package/src/ui/checkbox.tsx +62 -0
  495. package/src/ui/collapsible.tsx +148 -0
  496. package/src/ui/combobox.tsx +650 -0
  497. package/src/ui/dialog.tsx +290 -0
  498. package/src/ui/drawer.tsx +272 -0
  499. package/src/ui/dropdown-menu.tsx +547 -0
  500. package/src/ui/empty.tsx +166 -0
  501. package/src/ui/field.tsx +427 -0
  502. package/src/ui/helpers.tsx +39 -0
  503. package/src/ui/index.ts +47 -0
  504. package/src/ui/input-group.tsx +320 -0
  505. package/src/ui/input-otp.tsx +189 -0
  506. package/src/ui/input.tsx +60 -0
  507. package/src/ui/item.tsx +338 -0
  508. package/src/ui/label.tsx +31 -0
  509. package/src/ui/menubar.tsx +835 -0
  510. package/src/ui/navigation-menu.tsx +341 -0
  511. package/src/ui/pagination.tsx +195 -0
  512. package/src/ui/popover.tsx +363 -0
  513. package/src/ui/portal.tsx +31 -0
  514. package/src/ui/progress.tsx +182 -0
  515. package/src/ui/radio-group.tsx +111 -0
  516. package/src/ui/resizable.tsx +410 -0
  517. package/src/ui/scroll-area.tsx +102 -0
  518. package/src/ui/select.tsx +471 -0
  519. package/src/ui/separator.tsx +37 -0
  520. package/src/ui/sheet.tsx +289 -0
  521. package/src/ui/skeleton.tsx +25 -0
  522. package/src/ui/slider.tsx +176 -0
  523. package/src/ui/sonner.tsx +40 -0
  524. package/src/ui/spinner.tsx +23 -0
  525. package/src/ui/switch.tsx +94 -0
  526. package/src/ui/table.tsx +240 -0
  527. package/src/ui/tabs.tsx +233 -0
  528. package/src/ui/tailwind.css +2 -0
  529. package/src/ui/textarea.tsx +49 -0
  530. package/src/ui/theme.css +234 -0
  531. package/src/ui/toggle-group.tsx +215 -0
  532. package/src/ui/toggle.tsx +113 -0
@@ -0,0 +1,659 @@
1
+ /**
2
+ * 校验小程序页面路由与 app.config.ts 中 pages 一致,避免「写了跳转 / 建了页面但未注册」。
3
+ */
4
+ import fs from 'node:fs';
5
+ import path from 'node:path';
6
+ import { createRequire } from 'node:module';
7
+
8
+ /** TypeScript 为 CJS 包,在 ESLint 的 ESM 插件里用 require 才能拿到完整的 ts 命名空间 API */
9
+ const ts = createRequire(import.meta.url)('typescript');
10
+
11
+ const NAV_METHODS = new Set([
12
+ 'navigateTo',
13
+ 'redirectTo',
14
+ 'reLaunch',
15
+ 'switchTab',
16
+ ]);
17
+ const PAGE_SOURCE_EXTENSIONS = ['.tsx', '.ts', '.jsx', '.js'];
18
+
19
+ /** @param {string} route */
20
+ function normalizeRoute(route) {
21
+ if (!route || typeof route !== 'string') return '';
22
+ const noQuery = route.split('?')[0];
23
+ return noQuery.replace(/^\/+/, '').replace(/\/+$/, '');
24
+ }
25
+
26
+ function splitTailwindClassToken(token) {
27
+ let bracketDepth = 0;
28
+ let lastSeparatorIndex = -1;
29
+
30
+ for (let index = 0; index < token.length; index += 1) {
31
+ const char = token[index];
32
+
33
+ if (char === '[') bracketDepth += 1;
34
+ if (char === ']') bracketDepth -= 1;
35
+ if (char === ':' && bracketDepth === 0) lastSeparatorIndex = index;
36
+ }
37
+
38
+ return lastSeparatorIndex >= 0
39
+ ? token.slice(lastSeparatorIndex + 1)
40
+ : token;
41
+ }
42
+
43
+ function collectStaticStrings(node, result = []) {
44
+ if (!node) return result;
45
+
46
+ if (node.type === 'Literal' && typeof node.value === 'string') {
47
+ result.push(node.value);
48
+ return result;
49
+ }
50
+
51
+ if (node.type === 'TemplateLiteral') {
52
+ for (const quasi of node.quasis) {
53
+ if (quasi.value.cooked) result.push(quasi.value.cooked);
54
+ }
55
+
56
+ for (const expression of node.expressions) {
57
+ collectStaticStrings(expression, result);
58
+ }
59
+
60
+ return result;
61
+ }
62
+
63
+ for (const key of [
64
+ 'left',
65
+ 'right',
66
+ 'argument',
67
+ 'callee',
68
+ 'test',
69
+ 'consequent',
70
+ 'alternate',
71
+ 'object',
72
+ 'property',
73
+ ]) {
74
+ collectStaticStrings(node[key], result);
75
+ }
76
+
77
+ for (const key of ['arguments', 'elements', 'expressions']) {
78
+ if (Array.isArray(node[key])) {
79
+ for (const child of node[key]) collectStaticStrings(child, result);
80
+ }
81
+ }
82
+
83
+ return result;
84
+ }
85
+
86
+ function routeFromPageFilename(filePath) {
87
+ const normalized = filePath.replace(/\\/g, '/');
88
+ const match = normalized.match(/\/src\/pages\/(.+)\/index\.[jt]sx?$/);
89
+ if (!match) return '';
90
+
91
+ return normalizeRoute(`pages/${match[1]}/index`);
92
+ }
93
+
94
+ function getPageFileCandidates(cwd, route) {
95
+ const normalized = normalizeRoute(route);
96
+ return PAGE_SOURCE_EXTENSIONS.map((extension) =>
97
+ path.join(cwd, 'src', `${normalized}${extension}`));
98
+ }
99
+
100
+ function formatRelativeCandidates(cwd, candidates) {
101
+ return candidates.map((candidate) => path.relative(cwd, candidate));
102
+ }
103
+
104
+ function buildMissingPageSuggestion(route) {
105
+ const normalized = normalizeRoute(route);
106
+ const indexRoute = normalized.endsWith('/index') ? normalized : `${normalized}/index`;
107
+ const indexSource = `src/${indexRoute}.tsx`;
108
+ const directSource = `src/${normalized}.tsx`;
109
+
110
+ if (normalized.endsWith('/index')) {
111
+ return (
112
+ `如果实际页面文件是 ${indexSource},请保持 pages 中声明为 '${indexRoute}';` +
113
+ ` 否则请创建 ${directSource} / .ts / .jsx / .js 中的一个。`
114
+ );
115
+ }
116
+
117
+ return (
118
+ `如果实际页面文件是 ${indexSource},请把 pages 中的 '${normalized}' 改成 '${indexRoute}';` +
119
+ ` 如果你本来想声明单文件页面,请创建 ${directSource} / .ts / .jsx / .js 中的一个。`
120
+ );
121
+ }
122
+
123
+ function isDirectReturnedJsxElementAttribute(node) {
124
+ const element = node.parent?.parent;
125
+ if (element?.type !== 'JSXElement') return false;
126
+
127
+ let parent = element.parent;
128
+ while (
129
+ parent &&
130
+ [
131
+ 'ParenthesizedExpression',
132
+ 'ChainExpression',
133
+ 'TSAsExpression',
134
+ 'TSTypeAssertion',
135
+ 'TSNonNullExpression',
136
+ 'ConditionalExpression',
137
+ 'LogicalExpression',
138
+ ].includes(parent.type)
139
+ ) {
140
+ parent = parent.parent;
141
+ }
142
+
143
+ return parent?.type === 'ReturnStatement' || parent?.type === 'ArrowFunctionExpression';
144
+ }
145
+
146
+ /**
147
+ * @param {string} pagesRoot absolute path to src/pages
148
+ * @returns {string[]}
149
+ */
150
+ function collectPageRoutesFromDisk(pagesRoot) {
151
+ const routes = [];
152
+ if (!fs.existsSync(pagesRoot)) return routes;
153
+
154
+ function walk(dir, parts) {
155
+ for (const name of fs.readdirSync(dir)) {
156
+ const full = path.join(dir, name);
157
+ if (!fs.statSync(full).isDirectory()) continue;
158
+ const nextParts = [...parts, name];
159
+ const indexTsx = path.join(full, 'index.tsx');
160
+ const indexTs = path.join(full, 'index.ts');
161
+ if (fs.existsSync(indexTsx) || fs.existsSync(indexTs)) {
162
+ routes.push(`pages/${nextParts.join('/')}/index`);
163
+ }
164
+ walk(full, nextParts);
165
+ }
166
+ }
167
+
168
+ walk(pagesRoot, []);
169
+ return routes;
170
+ }
171
+
172
+ /**
173
+ * @param {string} filePath
174
+ * @param {string} text
175
+ * @returns {string[] | null}
176
+ */
177
+ function extractPagesFromAppConfigSource(filePath, text) {
178
+ const sf = ts.createSourceFile(
179
+ filePath,
180
+ text,
181
+ ts.ScriptTarget.Latest,
182
+ true,
183
+ ts.ScriptKind.TS
184
+ );
185
+
186
+ /** @type {string[] | null} */
187
+ let pages = null;
188
+
189
+ function fromObjectLiteral(obj) {
190
+ let foundPagesKey = false;
191
+ const out = [];
192
+ for (const prop of obj.properties) {
193
+ if (!ts.isPropertyAssignment(prop)) continue;
194
+ const key =
195
+ ts.isIdentifier(prop.name) ? prop.name.text
196
+ : ts.isStringLiteral(prop.name) ? prop.name.text
197
+ : null;
198
+ if (key !== 'pages' || !ts.isArrayLiteralExpression(prop.initializer)) continue;
199
+ foundPagesKey = true;
200
+ for (const el of prop.initializer.elements) {
201
+ if (ts.isStringLiteral(el) || ts.isNoSubstitutionTemplateLiteral(el)) {
202
+ out.push(el.text);
203
+ }
204
+ }
205
+ }
206
+ return foundPagesKey ? out : null;
207
+ }
208
+
209
+ function visit(node) {
210
+ if (pages !== null) return;
211
+
212
+ // TS 5.x 将「export default expr」解析为 ExportAssignment(isExportEquals === false),
213
+ // 不再使用 ExportDefaultDeclaration / isExportDefaultDeclaration。
214
+ if (ts.isExportAssignment(node) && !node.isExportEquals && node.expression) {
215
+ const expr = node.expression;
216
+ if (ts.isCallExpression(expr) && expr.arguments[0]) {
217
+ const arg0 = expr.arguments[0];
218
+ if (ts.isObjectLiteralExpression(arg0)) {
219
+ pages = fromObjectLiteral(arg0);
220
+ }
221
+ } else if (ts.isObjectLiteralExpression(expr)) {
222
+ pages = fromObjectLiteral(expr);
223
+ }
224
+ }
225
+
226
+ ts.forEachChild(node, visit);
227
+ }
228
+
229
+ visit(sf);
230
+ return pages;
231
+ }
232
+
233
+ /**
234
+ * @param {string} filePath
235
+ * @param {string} text
236
+ * @returns {{ hasTabBar: boolean; pagePaths: string[] } | null}
237
+ */
238
+ function extractTabBarFromAppConfigSource(filePath, text) {
239
+ const sf = ts.createSourceFile(
240
+ filePath,
241
+ text,
242
+ ts.ScriptTarget.Latest,
243
+ true,
244
+ ts.ScriptKind.TS
245
+ );
246
+
247
+ /** @type {{ hasTabBar: boolean; pagePaths: string[] } | null} */
248
+ let tabBar = null;
249
+
250
+ function getPropertyName(prop) {
251
+ return ts.isIdentifier(prop.name) ? prop.name.text
252
+ : ts.isStringLiteral(prop.name) ? prop.name.text
253
+ : null;
254
+ }
255
+
256
+ function getStringProperty(obj, propertyName) {
257
+ for (const prop of obj.properties) {
258
+ if (!ts.isPropertyAssignment(prop) || getPropertyName(prop) !== propertyName) continue;
259
+ if (ts.isStringLiteral(prop.initializer) || ts.isNoSubstitutionTemplateLiteral(prop.initializer)) {
260
+ return prop.initializer.text;
261
+ }
262
+ }
263
+
264
+ return null;
265
+ }
266
+
267
+ function fromObjectLiteral(obj) {
268
+ let foundTabBar = false;
269
+ const pagePaths = [];
270
+
271
+ for (const prop of obj.properties) {
272
+ if (!ts.isPropertyAssignment(prop) || getPropertyName(prop) !== 'tabBar') continue;
273
+ foundTabBar = true;
274
+ if (!ts.isObjectLiteralExpression(prop.initializer)) continue;
275
+
276
+ for (const tabBarProp of prop.initializer.properties) {
277
+ if (!ts.isPropertyAssignment(tabBarProp) || getPropertyName(tabBarProp) !== 'list') continue;
278
+ if (!ts.isArrayLiteralExpression(tabBarProp.initializer)) continue;
279
+
280
+ for (const item of tabBarProp.initializer.elements) {
281
+ if (!ts.isObjectLiteralExpression(item)) continue;
282
+ const pagePath = getStringProperty(item, 'pagePath');
283
+ if (pagePath) pagePaths.push(pagePath);
284
+ }
285
+ }
286
+ }
287
+
288
+ return foundTabBar ? { hasTabBar: true, pagePaths } : { hasTabBar: false, pagePaths: [] };
289
+ }
290
+
291
+ function visit(node) {
292
+ if (tabBar !== null) return;
293
+
294
+ if (ts.isExportAssignment(node) && !node.isExportEquals && node.expression) {
295
+ const expr = node.expression;
296
+ if (ts.isCallExpression(expr) && expr.arguments[0]) {
297
+ const arg0 = expr.arguments[0];
298
+ if (ts.isObjectLiteralExpression(arg0)) {
299
+ tabBar = fromObjectLiteral(arg0);
300
+ }
301
+ } else if (ts.isObjectLiteralExpression(expr)) {
302
+ tabBar = fromObjectLiteral(expr);
303
+ }
304
+ }
305
+
306
+ ts.forEachChild(node, visit);
307
+ }
308
+
309
+ visit(sf);
310
+ return tabBar;
311
+ }
312
+
313
+ /** @type {Map<string, { pages: string[]; mtime: number } | { error: string }>} */
314
+ const pagesCache = new Map();
315
+
316
+ /** @type {Map<string, { hasTabBar: boolean; pagePaths: string[]; mtime: number } | { error: string }>} */
317
+ const tabBarCache = new Map();
318
+
319
+ /** 解析 app.config 失败时,每个 cwd 只提示一次,避免每个 navigateTo 都报错 */
320
+ const appConfigParseErrorLogged = new Set();
321
+
322
+ function loadRegisteredPages(cwd) {
323
+ const appConfigPath = path.join(cwd, 'src/app.config.ts');
324
+ if (!fs.existsSync(appConfigPath)) {
325
+ return { pages: [], skip: true };
326
+ }
327
+
328
+ try {
329
+ const st = fs.statSync(appConfigPath);
330
+ const cacheKey = appConfigPath;
331
+ const cached = pagesCache.get(cacheKey);
332
+ if (cached && !('error' in cached) && cached.mtime === st.mtimeMs) {
333
+ return { pages: cached.pages, skip: false };
334
+ }
335
+
336
+ const text = fs.readFileSync(appConfigPath, 'utf8');
337
+ const parsed = extractPagesFromAppConfigSource(appConfigPath, text);
338
+ if (!parsed) {
339
+ pagesCache.set(cacheKey, { error: '无法解析 pages 数组' });
340
+ return { pages: [], skip: true, parseError: true };
341
+ }
342
+
343
+ const normalized = parsed.map(p => normalizeRoute(p));
344
+ pagesCache.set(cacheKey, { pages: normalized, mtime: st.mtimeMs });
345
+ return { pages: normalized, skip: false };
346
+ } catch (e) {
347
+ return { pages: [], skip: true, parseError: true };
348
+ }
349
+ }
350
+
351
+ function loadTabBarPages(cwd) {
352
+ const appConfigPath = path.join(cwd, 'src/app.config.ts');
353
+ if (!fs.existsSync(appConfigPath)) {
354
+ return { hasTabBar: false, pagePaths: [], skip: true };
355
+ }
356
+
357
+ try {
358
+ const st = fs.statSync(appConfigPath);
359
+ const cached = tabBarCache.get(appConfigPath);
360
+ if (cached && !('error' in cached) && cached.mtime === st.mtimeMs) {
361
+ return { hasTabBar: cached.hasTabBar, pagePaths: cached.pagePaths, skip: false };
362
+ }
363
+
364
+ const text = fs.readFileSync(appConfigPath, 'utf8');
365
+ const parsed = extractTabBarFromAppConfigSource(appConfigPath, text);
366
+ if (!parsed) {
367
+ tabBarCache.set(appConfigPath, { error: '无法解析 tabBar 配置' });
368
+ return { hasTabBar: false, pagePaths: [], skip: true, parseError: true };
369
+ }
370
+
371
+ const normalized = parsed.pagePaths.map(p => normalizeRoute(p));
372
+ tabBarCache.set(appConfigPath, {
373
+ hasTabBar: parsed.hasTabBar,
374
+ pagePaths: normalized,
375
+ mtime: st.mtimeMs,
376
+ });
377
+
378
+ return { hasTabBar: parsed.hasTabBar, pagePaths: normalized, skip: false };
379
+ } catch (e) {
380
+ return { hasTabBar: false, pagePaths: [], skip: true, parseError: true };
381
+ }
382
+ }
383
+
384
+ function isStaticUrlString(node) {
385
+ if (!node) return null;
386
+ if (node.type === 'Literal' && typeof node.value === 'string') return node.value;
387
+ if (node.type === 'TemplateLiteral' && node.expressions.length === 0 && node.quasis.length === 1) {
388
+ return node.quasis[0].value.cooked ?? node.quasis[0].value.raw;
389
+ }
390
+ return null;
391
+ }
392
+
393
+ function getUrlFromNavigateArg(arg) {
394
+ if (!arg || arg.type !== 'ObjectExpression') return null;
395
+ for (const prop of arg.properties) {
396
+ if (prop.type !== 'Property' || prop.key == null) continue;
397
+ const key =
398
+ prop.key.type === 'Identifier' ? prop.key.name
399
+ : prop.key.type === 'Literal' && typeof prop.key.value === 'string' ? prop.key.value
400
+ : null;
401
+ if (key !== 'url') continue;
402
+ return isStaticUrlString(prop.value);
403
+ }
404
+ return null;
405
+ }
406
+
407
+ /** @type {import('eslint').Rule.RuleModule} */
408
+ const navUrlInAppPages = {
409
+ meta: {
410
+ type: 'problem',
411
+ docs: {
412
+ description:
413
+ 'Taro.navigateTo / redirectTo / reLaunch / switchTab 的静态 url 必须在 src/app.config.ts 的 pages 中注册',
414
+ },
415
+ schema: [],
416
+ },
417
+ create(context) {
418
+ const cwd = context.cwd ?? process.cwd();
419
+ const taroDefaultName = new Map(); // local name -> true
420
+ const taroNavLocals = new Set();
421
+
422
+ return {
423
+ ImportDeclaration(node) {
424
+ if (node.source.value !== '@tarojs/taro') return;
425
+ for (const sp of node.specifiers) {
426
+ if (sp.type === 'ImportDefaultSpecifier') {
427
+ taroDefaultName.set(sp.local.name, true);
428
+ }
429
+ if (sp.type === 'ImportNamespaceSpecifier') {
430
+ taroDefaultName.set(sp.local.name, true);
431
+ }
432
+ if (sp.type === 'ImportSpecifier' && sp.imported && sp.imported.type === 'Identifier') {
433
+ const name = sp.imported.name;
434
+ if (NAV_METHODS.has(name)) {
435
+ taroNavLocals.add(sp.local.name);
436
+ }
437
+ }
438
+ }
439
+ },
440
+
441
+ CallExpression(node) {
442
+ const callee = node.callee;
443
+ let method = null;
444
+
445
+ if (callee.type === 'MemberExpression' && !callee.computed && callee.property.type === 'Identifier') {
446
+ const obj = callee.object;
447
+ const prop = callee.property.name;
448
+ if (!NAV_METHODS.has(prop)) return;
449
+ if (obj.type === 'Identifier' && taroDefaultName.has(obj.name)) {
450
+ method = prop;
451
+ }
452
+ } else if (callee.type === 'Identifier' && taroNavLocals.has(callee.name)) {
453
+ method = callee.name;
454
+ }
455
+
456
+ if (!method) return;
457
+
458
+ const arg0 = node.arguments[0];
459
+ if (!arg0 || arg0.type !== 'ObjectExpression') return;
460
+
461
+ const rawUrl = getUrlFromNavigateArg(arg0);
462
+ if (rawUrl == null) return;
463
+
464
+ const { pages, skip, parseError } = loadRegisteredPages(cwd);
465
+ if (skip) {
466
+ if (parseError && !appConfigParseErrorLogged.has(cwd)) {
467
+ appConfigParseErrorLogged.add(cwd);
468
+ context.report({
469
+ node,
470
+ message:
471
+ '无法读取或解析 src/app.config.ts 中的 pages,请确认 defineAppConfig({ pages: [...] }) 写法正确。',
472
+ });
473
+ }
474
+ return;
475
+ }
476
+
477
+ const normalized = normalizeRoute(rawUrl);
478
+ if (!normalized) return;
479
+
480
+ if (!pages.includes(normalized)) {
481
+ context.report({
482
+ node,
483
+ message:
484
+ `路由未在 app.config.ts 的 pages 中注册:「${normalized}」。请把该路径加入 pages 数组后再跳转(当前已注册:${pages.length ? pages.join(', ') : '无'})。`,
485
+ });
486
+ }
487
+ },
488
+ };
489
+ },
490
+ };
491
+
492
+ /** @type {import('eslint').Rule.RuleModule} */
493
+ const pageDirsInAppPages = {
494
+ meta: {
495
+ type: 'problem',
496
+ docs: {
497
+ description: 'src/pages 下每个含 index 的页面目录必须在 app.config.ts 的 pages 中注册',
498
+ },
499
+ schema: [],
500
+ },
501
+ create(context) {
502
+ const filePath = context.filename.replace(/\\/g, '/');
503
+ if (!filePath.endsWith('src/app.config.ts')) {
504
+ return {};
505
+ }
506
+
507
+ return {
508
+ Program(node) {
509
+ const cwd = context.cwd ?? process.cwd();
510
+ const pagesRoot = path.join(cwd, 'src/pages');
511
+ const diskRoutes = collectPageRoutesFromDisk(pagesRoot);
512
+ const sc = context.sourceCode;
513
+ const sourceText = sc.getText(node);
514
+ const declared = extractPagesFromAppConfigSource(filePath, sourceText);
515
+
516
+ if (!declared) {
517
+ context.report({
518
+ node,
519
+ message:
520
+ '无法从本文件解析 pages 数组,请使用 defineAppConfig({ pages: [ \'pages/...\' ] }) 形式声明。',
521
+ });
522
+ return;
523
+ }
524
+
525
+ const declaredSet = new Set(declared.map(p => normalizeRoute(p)));
526
+
527
+ for (const route of diskRoutes) {
528
+ const n = normalizeRoute(route);
529
+ const shorthand = n.replace(/\/index$/, '');
530
+ if (shorthand !== n && declaredSet.has(shorthand)) {
531
+ continue;
532
+ }
533
+ if (!declaredSet.has(n)) {
534
+ context.report({
535
+ node,
536
+ message: `磁盘上存在页面「${n}」,但未在 pages 数组中注册。请添加 '${route}'(或等价路径)。`,
537
+ });
538
+ }
539
+ }
540
+ },
541
+ };
542
+ },
543
+ };
544
+
545
+ /** @type {import('eslint').Rule.RuleModule} */
546
+ const declaredPagesMustExist = {
547
+ meta: {
548
+ type: 'problem',
549
+ docs: {
550
+ description: 'app.config.ts 中声明的 pages 必须映射到真实页面文件',
551
+ },
552
+ schema: [],
553
+ },
554
+ create(context) {
555
+ const filePath = context.filename.replace(/\\/g, '/');
556
+ if (!filePath.endsWith('src/app.config.ts')) {
557
+ return {};
558
+ }
559
+
560
+ return {
561
+ Program(node) {
562
+ const cwd = context.cwd ?? process.cwd();
563
+ const sc = context.sourceCode;
564
+ const sourceText = sc.getText(node);
565
+ const declared = extractPagesFromAppConfigSource(filePath, sourceText);
566
+
567
+ if (!declared) {
568
+ context.report({
569
+ node,
570
+ message:
571
+ '无法从本文件解析 pages 数组,请使用 defineAppConfig({ pages: [ \'pages/...\' ] }) 形式声明。',
572
+ });
573
+ return;
574
+ }
575
+
576
+ for (const route of declared) {
577
+ const normalized = normalizeRoute(route);
578
+ const candidates = getPageFileCandidates(cwd, normalized);
579
+ const exists = candidates.some((candidate) => fs.existsSync(candidate));
580
+
581
+ if (exists) continue;
582
+
583
+ context.report({
584
+ node,
585
+ message:
586
+ `src/app.config.ts 的 pages 配置有误:声明了不存在的页面「${normalized}」。` +
587
+ ` Taro 这里需要填写完整的“路径 + 文件名”。` +
588
+ ` ${buildMissingPageSuggestion(normalized)}` +
589
+ ` 当前尝试匹配:${formatRelativeCandidates(cwd, candidates).join(', ')}。`,
590
+ });
591
+ }
592
+ },
593
+ };
594
+ },
595
+ };
596
+
597
+ /** @type {import('eslint').Rule.RuleModule} */
598
+ const noScreenHeightInTabBarPage = {
599
+ meta: {
600
+ type: 'problem',
601
+ docs: {
602
+ description:
603
+ 'TabBar 页面根容器禁止使用 min-h-screen / h-screen,避免超过 taro-tabbar__panel 已计算的可用高度',
604
+ },
605
+ schema: [],
606
+ },
607
+ create(context) {
608
+ const cwd = context.cwd ?? process.cwd();
609
+ const pageRoute = routeFromPageFilename(context.filename);
610
+ if (!pageRoute) return {};
611
+
612
+ const { hasTabBar, pagePaths, skip } = loadTabBarPages(cwd);
613
+ if (skip || !hasTabBar || !pagePaths.includes(pageRoute)) return {};
614
+
615
+ function reportScreenHeightClass(node, className) {
616
+ const violating = className
617
+ .split(/\s+/)
618
+ .map(token => token.trim())
619
+ .filter(Boolean)
620
+ .filter(token => /^(?:!)?(?:min-h-screen|h-screen)$/.test(splitTailwindClassToken(token)));
621
+
622
+ if (violating.length === 0) return;
623
+
624
+ context.report({
625
+ node,
626
+ message:
627
+ `TabBar 页面高度规范:检测到 [${violating.join(', ')}]。` +
628
+ 'Taro TabBar 页面已由 taro-tabbar__panel 计算可用高度,页面根容器请改用 h-full flex flex-col,内容区使用 flex-1 overflow-auto。',
629
+ });
630
+ }
631
+
632
+ return {
633
+ JSXAttribute(node) {
634
+ if (node.name?.name !== 'className') return;
635
+ if (!isDirectReturnedJsxElementAttribute(node)) return;
636
+
637
+ if (node.value?.type === 'Literal' && typeof node.value.value === 'string') {
638
+ reportScreenHeightClass(node, node.value.value);
639
+ return;
640
+ }
641
+
642
+ if (node.value?.type !== 'JSXExpressionContainer') return;
643
+
644
+ for (const className of collectStaticStrings(node.value.expression)) {
645
+ reportScreenHeightClass(node, className);
646
+ }
647
+ },
648
+ };
649
+ },
650
+ };
651
+
652
+ export default {
653
+ rules: {
654
+ 'nav-url-in-app-pages': navUrlInAppPages,
655
+ 'page-dirs-in-app-pages': pageDirsInAppPages,
656
+ 'declared-pages-must-exist': declaredPagesMustExist,
657
+ 'no-screen-height-in-tabbar-page': noScreenHeightInTabBarPage,
658
+ },
659
+ };