@open-dy/vibecoding-sdk-taro 0.0.1-beta.4 → 0.0.1-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/interest-card/eslint/eslint-plugin-custom-navigation.mjs +2 -290
- package/dist/adapters/interest-card/eslint/taro.mjs +8 -42
- package/dist/build/plugins/vite-tt-components-entry.d.ts +10 -0
- package/dist/build/plugins/vite-tt-components-entry.js +32 -0
- package/dist/build/plugins/vite-tt-components-entry.js.map +1 -0
- package/dist/build/taro.js +3 -1
- package/dist/build/taro.js.map +1 -1
- package/dist/components/miniapp-open-card.d.ts +46 -1
- package/dist/components/miniapp-open-card.js +14 -1
- package/dist/components/miniapp-open-card.js.map +1 -1
- package/dist/eslint/eslint-plugin-custom-navigation.mjs +290 -0
- package/dist/eslint/taro.mjs +11 -0
- package/dist/reference/llms.txt +76 -34
- package/dist/reference/sdk-api/build/taro/BuildContext.md +7 -2
- package/dist/reference/sdk-api/build/taro/CreateMicroappTaroConfigOptions.md +1 -2
- package/dist/reference/sdk-api/build/taro/createMicroappTaroConfig.md +1 -2
- package/dist/reference/sdk-api/components/miniapp-open-card/MiniappOpenCard.md +109 -0
- package/dist/reference/sdk-api/components/miniapp-open-card/MiniappOpenCardEnvVersion.md +38 -0
- package/dist/reference/sdk-api/components/miniapp-open-card/MiniappOpenCardErrorDetail.md +52 -0
- package/dist/reference/sdk-api/components/miniapp-open-card/MiniappOpenCardProps.md +76 -0
- package/dist/reference/sdk-api/components/miniapp-open-card/index.md +12 -0
- package/dist/reference/sdk-api/libraries/lucide-taro.md +151 -0
- package/dist/reference/sdk-api/runtime/CreateMicroappClientOptions.md +7 -2
- package/dist/reference/sdk-api/runtime/createMicroappClient.md +8 -3
- package/dist/reference/sdk-api/ui/accordion/Accordion.md +114 -0
- package/dist/reference/sdk-api/ui/accordion/AccordionContent.md +100 -0
- package/dist/reference/sdk-api/ui/accordion/AccordionItem.md +107 -0
- package/dist/reference/sdk-api/ui/accordion/AccordionTrigger.md +100 -0
- package/dist/reference/sdk-api/ui/accordion/index.md +12 -0
- package/dist/reference/sdk-api/ui/alert/Alert.md +106 -0
- package/dist/reference/sdk-api/ui/alert/AlertAction.md +100 -0
- package/dist/reference/sdk-api/ui/alert/AlertDescription.md +100 -0
- package/dist/reference/sdk-api/ui/alert/AlertTitle.md +100 -0
- package/dist/reference/sdk-api/ui/alert/index.md +12 -0
- package/dist/reference/sdk-api/ui/alert-dialog/AlertDialog.md +58 -0
- package/dist/reference/sdk-api/ui/alert-dialog/AlertDialogAction.md +107 -0
- package/dist/reference/sdk-api/ui/alert-dialog/AlertDialogCancel.md +107 -0
- package/dist/reference/sdk-api/ui/alert-dialog/AlertDialogContent.md +106 -0
- package/dist/reference/sdk-api/ui/alert-dialog/AlertDialogDescription.md +100 -0
- package/dist/reference/sdk-api/ui/alert-dialog/AlertDialogFooter.md +100 -0
- package/dist/reference/sdk-api/ui/alert-dialog/AlertDialogHeader.md +100 -0
- package/dist/reference/sdk-api/ui/alert-dialog/AlertDialogOverlay.md +100 -0
- package/dist/reference/sdk-api/ui/alert-dialog/AlertDialogPortal.md +55 -0
- package/dist/reference/sdk-api/ui/alert-dialog/AlertDialogTitle.md +100 -0
- package/dist/reference/sdk-api/ui/alert-dialog/AlertDialogTrigger.md +118 -0
- package/dist/reference/sdk-api/ui/alert-dialog/index.md +19 -0
- package/dist/reference/sdk-api/ui/aspect-ratio/AspectRatio.md +106 -0
- package/dist/reference/sdk-api/ui/aspect-ratio/index.md +9 -0
- package/dist/reference/sdk-api/ui/avatar/Avatar.md +106 -0
- package/dist/reference/sdk-api/ui/avatar/AvatarBadge.md +100 -0
- package/dist/reference/sdk-api/ui/avatar/AvatarFallback.md +100 -0
- package/dist/reference/sdk-api/ui/avatar/AvatarGroup.md +100 -0
- package/dist/reference/sdk-api/ui/avatar/AvatarGroupCount.md +100 -0
- package/dist/reference/sdk-api/ui/avatar/AvatarImage.md +108 -0
- package/dist/reference/sdk-api/ui/avatar/index.md +14 -0
- package/dist/reference/sdk-api/ui/badge/Badge.md +114 -0
- package/dist/reference/sdk-api/ui/badge/badgeVariants.md +70 -0
- package/dist/reference/sdk-api/ui/badge/index.md +10 -0
- package/dist/reference/sdk-api/ui/button/Button.md +210 -0
- package/dist/reference/sdk-api/ui/button/ButtonProps.md +188 -0
- package/dist/reference/sdk-api/ui/button/buttonVariants.md +84 -0
- package/dist/reference/sdk-api/ui/button/index.md +11 -0
- package/dist/reference/sdk-api/ui/button-group/ButtonGroup.md +106 -0
- package/dist/reference/sdk-api/ui/button-group/ButtonGroupSeparator.md +106 -0
- package/dist/reference/sdk-api/ui/button-group/ButtonGroupText.md +106 -0
- package/dist/reference/sdk-api/ui/button-group/buttonGroupVariants.md +70 -0
- package/dist/reference/sdk-api/ui/button-group/index.md +12 -0
- package/dist/reference/sdk-api/ui/calendar/Calendar.md +144 -0
- package/dist/reference/sdk-api/ui/calendar/CalendarProps.md +118 -0
- package/dist/reference/sdk-api/ui/calendar/index.md +10 -0
- package/dist/reference/sdk-api/ui/card/Card.md +106 -0
- package/dist/reference/sdk-api/ui/card/CardAction.md +100 -0
- package/dist/reference/sdk-api/ui/card/CardContent.md +100 -0
- package/dist/reference/sdk-api/ui/card/CardDescription.md +100 -0
- package/dist/reference/sdk-api/ui/card/CardFooter.md +100 -0
- package/dist/reference/sdk-api/ui/card/CardHeader.md +100 -0
- package/dist/reference/sdk-api/ui/card/CardTitle.md +100 -0
- package/dist/reference/sdk-api/ui/card/index.md +15 -0
- package/dist/reference/sdk-api/ui/carousel/Carousel.md +108 -0
- package/dist/reference/sdk-api/ui/carousel/CarouselContent.md +100 -0
- package/dist/reference/sdk-api/ui/carousel/CarouselItem.md +100 -0
- package/dist/reference/sdk-api/ui/carousel/CarouselNext.md +219 -0
- package/dist/reference/sdk-api/ui/carousel/CarouselPrevious.md +219 -0
- package/dist/reference/sdk-api/ui/carousel/index.md +14 -0
- package/dist/reference/sdk-api/ui/carousel/useCarousel.md +46 -0
- package/dist/reference/sdk-api/ui/checkbox/Checkbox.md +109 -0
- package/dist/reference/sdk-api/ui/checkbox/index.md +9 -0
- package/dist/reference/sdk-api/ui/collapsible/Collapsible.md +108 -0
- package/dist/reference/sdk-api/ui/collapsible/CollapsibleContent.md +100 -0
- package/dist/reference/sdk-api/ui/collapsible/CollapsibleTrigger.md +119 -0
- package/dist/reference/sdk-api/ui/collapsible/index.md +11 -0
- package/dist/reference/sdk-api/ui/combobox/Combobox.md +124 -0
- package/dist/reference/sdk-api/ui/combobox/ComboboxChip.md +107 -0
- package/dist/reference/sdk-api/ui/combobox/ComboboxChips.md +100 -0
- package/dist/reference/sdk-api/ui/combobox/ComboboxChipsInput.md +107 -0
- package/dist/reference/sdk-api/ui/combobox/ComboboxCollection.md +100 -0
- package/dist/reference/sdk-api/ui/combobox/ComboboxContent.md +106 -0
- package/dist/reference/sdk-api/ui/combobox/ComboboxEmpty.md +100 -0
- package/dist/reference/sdk-api/ui/combobox/ComboboxGroup.md +100 -0
- package/dist/reference/sdk-api/ui/combobox/ComboboxInput.md +113 -0
- package/dist/reference/sdk-api/ui/combobox/ComboboxItem.md +106 -0
- package/dist/reference/sdk-api/ui/combobox/ComboboxLabel.md +100 -0
- package/dist/reference/sdk-api/ui/combobox/ComboboxList.md +105 -0
- package/dist/reference/sdk-api/ui/combobox/ComboboxSeparator.md +100 -0
- package/dist/reference/sdk-api/ui/combobox/ComboboxTrigger.md +100 -0
- package/dist/reference/sdk-api/ui/combobox/ComboboxValue.md +105 -0
- package/dist/reference/sdk-api/ui/combobox/index.md +24 -0
- package/dist/reference/sdk-api/ui/combobox/useComboboxAnchor.md +43 -0
- package/dist/reference/sdk-api/ui/dialog/Dialog.md +58 -0
- package/dist/reference/sdk-api/ui/dialog/DialogClose.md +100 -0
- package/dist/reference/sdk-api/ui/dialog/DialogContent.md +107 -0
- package/dist/reference/sdk-api/ui/dialog/DialogDescription.md +100 -0
- package/dist/reference/sdk-api/ui/dialog/DialogFooter.md +100 -0
- package/dist/reference/sdk-api/ui/dialog/DialogHeader.md +100 -0
- package/dist/reference/sdk-api/ui/dialog/DialogOverlay.md +100 -0
- package/dist/reference/sdk-api/ui/dialog/DialogPortal.md +55 -0
- package/dist/reference/sdk-api/ui/dialog/DialogTitle.md +100 -0
- package/dist/reference/sdk-api/ui/dialog/DialogTrigger.md +106 -0
- package/dist/reference/sdk-api/ui/dialog/index.md +18 -0
- package/dist/reference/sdk-api/ui/drawer/Drawer.md +59 -0
- package/dist/reference/sdk-api/ui/drawer/DrawerClose.md +100 -0
- package/dist/reference/sdk-api/ui/drawer/DrawerContent.md +100 -0
- package/dist/reference/sdk-api/ui/drawer/DrawerDescription.md +100 -0
- package/dist/reference/sdk-api/ui/drawer/DrawerFooter.md +100 -0
- package/dist/reference/sdk-api/ui/drawer/DrawerHeader.md +100 -0
- package/dist/reference/sdk-api/ui/drawer/DrawerOverlay.md +100 -0
- package/dist/reference/sdk-api/ui/drawer/DrawerPortal.md +55 -0
- package/dist/reference/sdk-api/ui/drawer/DrawerTitle.md +100 -0
- package/dist/reference/sdk-api/ui/drawer/DrawerTrigger.md +100 -0
- package/dist/reference/sdk-api/ui/drawer/index.md +18 -0
- package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenu.md +58 -0
- package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuCheckboxItem.md +107 -0
- package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuContent.md +106 -0
- package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuGroup.md +100 -0
- package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuItem.md +107 -0
- package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuLabel.md +106 -0
- package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuPortal.md +55 -0
- package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuRadioGroup.md +100 -0
- package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuRadioItem.md +106 -0
- package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuSeparator.md +100 -0
- package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuShortcut.md +100 -0
- package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuSub.md +58 -0
- package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuSubContent.md +100 -0
- package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuSubTrigger.md +106 -0
- package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuTrigger.md +119 -0
- package/dist/reference/sdk-api/ui/dropdown-menu/index.md +23 -0
- package/dist/reference/sdk-api/ui/empty/Empty.md +100 -0
- package/dist/reference/sdk-api/ui/empty/EmptyContent.md +100 -0
- package/dist/reference/sdk-api/ui/empty/EmptyDescription.md +100 -0
- package/dist/reference/sdk-api/ui/empty/EmptyHeader.md +100 -0
- package/dist/reference/sdk-api/ui/empty/EmptyMedia.md +106 -0
- package/dist/reference/sdk-api/ui/empty/EmptyTitle.md +100 -0
- package/dist/reference/sdk-api/ui/empty/index.md +14 -0
- package/dist/reference/sdk-api/ui/field/Field.md +106 -0
- package/dist/reference/sdk-api/ui/field/FieldContent.md +100 -0
- package/dist/reference/sdk-api/ui/field/FieldDescription.md +100 -0
- package/dist/reference/sdk-api/ui/field/FieldError.md +112 -0
- package/dist/reference/sdk-api/ui/field/FieldGroup.md +100 -0
- package/dist/reference/sdk-api/ui/field/FieldLabel.md +85 -0
- package/dist/reference/sdk-api/ui/field/FieldLegend.md +106 -0
- package/dist/reference/sdk-api/ui/field/FieldSeparator.md +105 -0
- package/dist/reference/sdk-api/ui/field/FieldSet.md +100 -0
- package/dist/reference/sdk-api/ui/field/FieldTitle.md +100 -0
- package/dist/reference/sdk-api/ui/field/index.md +18 -0
- package/dist/reference/sdk-api/ui/helpers/collectDataIconState.md +66 -0
- package/dist/reference/sdk-api/ui/helpers/index.md +9 -0
- package/dist/reference/sdk-api/ui/index.md +57 -0
- package/dist/reference/sdk-api/ui/input/Input.md +141 -0
- package/dist/reference/sdk-api/ui/input/index.md +9 -0
- package/dist/reference/sdk-api/ui/input-group/InputGroup.md +100 -0
- package/dist/reference/sdk-api/ui/input-group/InputGroupAddon.md +109 -0
- package/dist/reference/sdk-api/ui/input-group/InputGroupButton.md +220 -0
- package/dist/reference/sdk-api/ui/input-group/InputGroupInput.md +135 -0
- package/dist/reference/sdk-api/ui/input-group/InputGroupText.md +100 -0
- package/dist/reference/sdk-api/ui/input-group/InputGroupTextarea.md +126 -0
- package/dist/reference/sdk-api/ui/input-group/index.md +14 -0
- package/dist/reference/sdk-api/ui/input-otp/InputOTP.md +111 -0
- package/dist/reference/sdk-api/ui/input-otp/InputOTPGroup.md +100 -0
- package/dist/reference/sdk-api/ui/input-otp/InputOTPSeparator.md +100 -0
- package/dist/reference/sdk-api/ui/input-otp/InputOTPSlot.md +107 -0
- package/dist/reference/sdk-api/ui/input-otp/index.md +12 -0
- package/dist/reference/sdk-api/ui/item/Item.md +115 -0
- package/dist/reference/sdk-api/ui/item/ItemActions.md +100 -0
- package/dist/reference/sdk-api/ui/item/ItemContent.md +100 -0
- package/dist/reference/sdk-api/ui/item/ItemDescription.md +100 -0
- package/dist/reference/sdk-api/ui/item/ItemFooter.md +100 -0
- package/dist/reference/sdk-api/ui/item/ItemGroup.md +100 -0
- package/dist/reference/sdk-api/ui/item/ItemHeader.md +100 -0
- package/dist/reference/sdk-api/ui/item/ItemMedia.md +106 -0
- package/dist/reference/sdk-api/ui/item/ItemSeparator.md +106 -0
- package/dist/reference/sdk-api/ui/item/ItemTitle.md +100 -0
- package/dist/reference/sdk-api/ui/item/index.md +18 -0
- package/dist/reference/sdk-api/ui/label/Label.md +85 -0
- package/dist/reference/sdk-api/ui/label/index.md +9 -0
- package/dist/reference/sdk-api/ui/menubar/Menubar.md +100 -0
- package/dist/reference/sdk-api/ui/menubar/MenubarCheckboxItem.md +111 -0
- package/dist/reference/sdk-api/ui/menubar/MenubarContent.md +108 -0
- package/dist/reference/sdk-api/ui/menubar/MenubarGroup.md +100 -0
- package/dist/reference/sdk-api/ui/menubar/MenubarItem.md +109 -0
- package/dist/reference/sdk-api/ui/menubar/MenubarLabel.md +106 -0
- package/dist/reference/sdk-api/ui/menubar/MenubarMenu.md +55 -0
- package/dist/reference/sdk-api/ui/menubar/MenubarPortal.md +55 -0
- package/dist/reference/sdk-api/ui/menubar/MenubarRadioGroup.md +108 -0
- package/dist/reference/sdk-api/ui/menubar/MenubarRadioItem.md +110 -0
- package/dist/reference/sdk-api/ui/menubar/MenubarSeparator.md +100 -0
- package/dist/reference/sdk-api/ui/menubar/MenubarShortcut.md +100 -0
- package/dist/reference/sdk-api/ui/menubar/MenubarSub.md +58 -0
- package/dist/reference/sdk-api/ui/menubar/MenubarSubContent.md +108 -0
- package/dist/reference/sdk-api/ui/menubar/MenubarSubTrigger.md +107 -0
- package/dist/reference/sdk-api/ui/menubar/MenubarTrigger.md +100 -0
- package/dist/reference/sdk-api/ui/menubar/index.md +24 -0
- package/dist/reference/sdk-api/ui/navigation-menu/NavigationMenu.md +100 -0
- package/dist/reference/sdk-api/ui/navigation-menu/NavigationMenuContent.md +106 -0
- package/dist/reference/sdk-api/ui/navigation-menu/NavigationMenuIndicator.md +100 -0
- package/dist/reference/sdk-api/ui/navigation-menu/NavigationMenuItem.md +106 -0
- package/dist/reference/sdk-api/ui/navigation-menu/NavigationMenuLink.md +106 -0
- package/dist/reference/sdk-api/ui/navigation-menu/NavigationMenuList.md +100 -0
- package/dist/reference/sdk-api/ui/navigation-menu/NavigationMenuPositioner.md +100 -0
- package/dist/reference/sdk-api/ui/navigation-menu/NavigationMenuTrigger.md +120 -0
- package/dist/reference/sdk-api/ui/navigation-menu/index.md +17 -0
- package/dist/reference/sdk-api/ui/navigation-menu/navigationMenuTriggerStyle.md +64 -0
- package/dist/reference/sdk-api/ui/pagination/Pagination.md +100 -0
- package/dist/reference/sdk-api/ui/pagination/PaginationContent.md +100 -0
- package/dist/reference/sdk-api/ui/pagination/PaginationEllipsis.md +100 -0
- package/dist/reference/sdk-api/ui/pagination/PaginationItem.md +100 -0
- package/dist/reference/sdk-api/ui/pagination/PaginationLink.md +107 -0
- package/dist/reference/sdk-api/ui/pagination/PaginationNext.md +121 -0
- package/dist/reference/sdk-api/ui/pagination/PaginationPrevious.md +121 -0
- package/dist/reference/sdk-api/ui/pagination/index.md +15 -0
- package/dist/reference/sdk-api/ui/popover/Popover.md +58 -0
- package/dist/reference/sdk-api/ui/popover/PopoverAnchor.md +100 -0
- package/dist/reference/sdk-api/ui/popover/PopoverContent.md +108 -0
- package/dist/reference/sdk-api/ui/popover/PopoverDescription.md +100 -0
- package/dist/reference/sdk-api/ui/popover/PopoverHeader.md +100 -0
- package/dist/reference/sdk-api/ui/popover/PopoverTitle.md +100 -0
- package/dist/reference/sdk-api/ui/popover/PopoverTrigger.md +119 -0
- package/dist/reference/sdk-api/ui/popover/index.md +15 -0
- package/dist/reference/sdk-api/ui/portal/Portal.md +55 -0
- package/dist/reference/sdk-api/ui/portal/index.md +9 -0
- package/dist/reference/sdk-api/ui/progress/Progress.md +109 -0
- package/dist/reference/sdk-api/ui/progress/ProgressIndicator.md +107 -0
- package/dist/reference/sdk-api/ui/progress/ProgressLabel.md +100 -0
- package/dist/reference/sdk-api/ui/progress/ProgressTrack.md +100 -0
- package/dist/reference/sdk-api/ui/progress/ProgressValue.md +105 -0
- package/dist/reference/sdk-api/ui/progress/index.md +13 -0
- package/dist/reference/sdk-api/ui/radio-group/RadioGroup.md +108 -0
- package/dist/reference/sdk-api/ui/radio-group/RadioGroupItem.md +107 -0
- package/dist/reference/sdk-api/ui/radio-group/index.md +10 -0
- package/dist/reference/sdk-api/ui/resizable/ResizableHandle.md +107 -0
- package/dist/reference/sdk-api/ui/resizable/ResizablePanel.md +108 -0
- package/dist/reference/sdk-api/ui/resizable/ResizablePanelGroup.md +107 -0
- package/dist/reference/sdk-api/ui/resizable/index.md +11 -0
- package/dist/reference/sdk-api/ui/scroll-area/ScrollArea.md +159 -0
- package/dist/reference/sdk-api/ui/scroll-area/ScrollBar.md +106 -0
- package/dist/reference/sdk-api/ui/scroll-area/index.md +10 -0
- package/dist/reference/sdk-api/ui/select/Select.md +80 -0
- package/dist/reference/sdk-api/ui/select/SelectContent.md +106 -0
- package/dist/reference/sdk-api/ui/select/SelectGroup.md +100 -0
- package/dist/reference/sdk-api/ui/select/SelectItem.md +106 -0
- package/dist/reference/sdk-api/ui/select/SelectLabel.md +100 -0
- package/dist/reference/sdk-api/ui/select/SelectScrollDownButton.md +100 -0
- package/dist/reference/sdk-api/ui/select/SelectScrollUpButton.md +100 -0
- package/dist/reference/sdk-api/ui/select/SelectSeparator.md +100 -0
- package/dist/reference/sdk-api/ui/select/SelectTrigger.md +106 -0
- package/dist/reference/sdk-api/ui/select/SelectValue.md +106 -0
- package/dist/reference/sdk-api/ui/select/index.md +18 -0
- package/dist/reference/sdk-api/ui/separator/Separator.md +106 -0
- package/dist/reference/sdk-api/ui/separator/index.md +9 -0
- package/dist/reference/sdk-api/ui/sheet/Sheet.md +58 -0
- package/dist/reference/sdk-api/ui/sheet/SheetClose.md +100 -0
- package/dist/reference/sdk-api/ui/sheet/SheetContent.md +113 -0
- package/dist/reference/sdk-api/ui/sheet/SheetDescription.md +100 -0
- package/dist/reference/sdk-api/ui/sheet/SheetFooter.md +100 -0
- package/dist/reference/sdk-api/ui/sheet/SheetHeader.md +100 -0
- package/dist/reference/sdk-api/ui/sheet/SheetOverlay.md +100 -0
- package/dist/reference/sdk-api/ui/sheet/SheetPortal.md +55 -0
- package/dist/reference/sdk-api/ui/sheet/SheetTitle.md +100 -0
- package/dist/reference/sdk-api/ui/sheet/SheetTrigger.md +100 -0
- package/dist/reference/sdk-api/ui/sheet/index.md +18 -0
- package/dist/reference/sdk-api/ui/skeleton/Skeleton.md +100 -0
- package/dist/reference/sdk-api/ui/skeleton/index.md +9 -0
- package/dist/reference/sdk-api/ui/slider/Slider.md +116 -0
- package/dist/reference/sdk-api/ui/slider/index.md +9 -0
- package/dist/reference/sdk-api/ui/sonner/Toaster.md +43 -0
- package/dist/reference/sdk-api/ui/sonner/index.md +10 -0
- package/dist/reference/sdk-api/ui/sonner/toast.md +58 -0
- package/dist/reference/sdk-api/ui/spinner/Spinner.md +100 -0
- package/dist/reference/sdk-api/ui/spinner/index.md +9 -0
- package/dist/reference/sdk-api/ui/switch/Switch.md +110 -0
- package/dist/reference/sdk-api/ui/switch/index.md +9 -0
- package/dist/reference/sdk-api/ui/table/Table.md +100 -0
- package/dist/reference/sdk-api/ui/table/TableBody.md +100 -0
- package/dist/reference/sdk-api/ui/table/TableCaption.md +100 -0
- package/dist/reference/sdk-api/ui/table/TableCell.md +106 -0
- package/dist/reference/sdk-api/ui/table/TableFooter.md +100 -0
- package/dist/reference/sdk-api/ui/table/TableHead.md +106 -0
- package/dist/reference/sdk-api/ui/table/TableHeader.md +100 -0
- package/dist/reference/sdk-api/ui/table/TableRow.md +100 -0
- package/dist/reference/sdk-api/ui/table/index.md +16 -0
- package/dist/reference/sdk-api/ui/tabs/Tabs.md +109 -0
- package/dist/reference/sdk-api/ui/tabs/TabsContent.md +106 -0
- package/dist/reference/sdk-api/ui/tabs/TabsList.md +106 -0
- package/dist/reference/sdk-api/ui/tabs/TabsTrigger.md +107 -0
- package/dist/reference/sdk-api/ui/tabs/index.md +13 -0
- package/dist/reference/sdk-api/ui/tabs/tabsListVariants.md +70 -0
- package/dist/reference/sdk-api/ui/textarea/Textarea.md +126 -0
- package/dist/reference/sdk-api/ui/textarea/index.md +9 -0
- package/dist/reference/sdk-api/ui/toggle/Toggle.md +118 -0
- package/dist/reference/sdk-api/ui/toggle/index.md +10 -0
- package/dist/reference/sdk-api/ui/toggle/toggleVariants.md +71 -0
- package/dist/reference/sdk-api/ui/toggle-group/ToggleGroup.md +122 -0
- package/dist/reference/sdk-api/ui/toggle-group/ToggleGroupItem.md +116 -0
- package/dist/reference/sdk-api/ui/toggle-group/index.md +10 -0
- package/dist/reference/sdk-api.json +74470 -146
- package/dist/reference/sdk-api.md +62 -3
- package/dist/ui/accordion.d.ts +48 -0
- package/dist/ui/accordion.js +40 -0
- package/dist/ui/accordion.js.map +1 -1
- package/dist/ui/alert-dialog.d.ts +123 -0
- package/dist/ui/alert-dialog.js +114 -0
- package/dist/ui/alert-dialog.js.map +1 -1
- package/dist/ui/alert.d.ts +41 -0
- package/dist/ui/alert.js +41 -0
- package/dist/ui/alert.js.map +1 -1
- package/dist/ui/aspect-ratio.d.ts +11 -0
- package/dist/ui/aspect-ratio.js +10 -0
- package/dist/ui/aspect-ratio.js.map +1 -1
- package/dist/ui/avatar.d.ts +65 -0
- package/dist/ui/avatar.js +63 -0
- package/dist/ui/avatar.js.map +1 -1
- package/dist/ui/badge.d.ts +22 -0
- package/dist/ui/badge.js +22 -0
- package/dist/ui/badge.js.map +1 -1
- package/dist/ui/button-group.d.ts +45 -0
- package/dist/ui/button-group.js +43 -0
- package/dist/ui/button-group.js.map +1 -1
- package/dist/ui/button.d.ts +52 -0
- package/dist/ui/button.js +30 -0
- package/dist/ui/button.js.map +1 -1
- package/dist/ui/calendar.d.ts +44 -0
- package/dist/ui/calendar.js +19 -0
- package/dist/ui/calendar.js.map +1 -1
- package/dist/ui/card.d.ts +71 -0
- package/dist/ui/card.js +70 -0
- package/dist/ui/card.js.map +1 -1
- package/dist/ui/carousel.d.ts +71 -0
- package/dist/ui/carousel.js +66 -0
- package/dist/ui/carousel.js.map +1 -1
- package/dist/ui/checkbox.d.ts +14 -0
- package/dist/ui/checkbox.js +10 -0
- package/dist/ui/checkbox.js.map +1 -1
- package/dist/ui/collapsible.d.ts +37 -0
- package/dist/ui/collapsible.js +30 -0
- package/dist/ui/collapsible.js.map +1 -1
- package/dist/ui/combobox.d.ts +190 -0
- package/dist/ui/combobox.js +167 -0
- package/dist/ui/combobox.js.map +1 -1
- package/dist/ui/dialog.d.ts +109 -0
- package/dist/ui/dialog.js +100 -0
- package/dist/ui/dialog.js.map +1 -1
- package/dist/ui/drawer.d.ts +106 -0
- package/dist/ui/drawer.js +100 -0
- package/dist/ui/drawer.js.map +1 -1
- package/dist/ui/dropdown-menu.d.ts +171 -0
- package/dist/ui/dropdown-menu.js +150 -0
- package/dist/ui/dropdown-menu.js.map +1 -1
- package/dist/ui/empty.d.ts +61 -0
- package/dist/ui/empty.js +61 -0
- package/dist/ui/empty.js.map +1 -1
- package/dist/ui/field.d.ts +105 -0
- package/dist/ui/field.js +101 -0
- package/dist/ui/field.js.map +1 -1
- package/dist/ui/helpers.d.ts +11 -0
- package/dist/ui/helpers.js +11 -0
- package/dist/ui/helpers.js.map +1 -1
- package/dist/ui/input-group.d.ts +65 -0
- package/dist/ui/input-group.js +65 -0
- package/dist/ui/input-group.js.map +1 -1
- package/dist/ui/input-otp.d.ts +48 -0
- package/dist/ui/input-otp.js +40 -0
- package/dist/ui/input-otp.js.map +1 -1
- package/dist/ui/input.d.ts +24 -2
- package/dist/ui/input.js +20 -0
- package/dist/ui/input.js.map +1 -1
- package/dist/ui/item.d.ts +103 -0
- package/dist/ui/item.js +103 -0
- package/dist/ui/item.js.map +1 -1
- package/dist/ui/label.d.ts +10 -0
- package/dist/ui/label.js +10 -0
- package/dist/ui/label.js.map +1 -1
- package/dist/ui/menubar.d.ts +193 -0
- package/dist/ui/menubar.js +160 -0
- package/dist/ui/menubar.js.map +1 -1
- package/dist/ui/navigation-menu.d.ts +98 -0
- package/dist/ui/navigation-menu.js +90 -0
- package/dist/ui/navigation-menu.js.map +1 -1
- package/dist/ui/pagination.d.ts +76 -0
- package/dist/ui/pagination.js +73 -0
- package/dist/ui/pagination.js.map +1 -1
- package/dist/ui/popover.d.ts +81 -0
- package/dist/ui/popover.js +70 -0
- package/dist/ui/popover.js.map +1 -1
- package/dist/ui/portal.d.ts +11 -0
- package/dist/ui/portal.js +10 -0
- package/dist/ui/portal.js.map +1 -1
- package/dist/ui/progress.d.ts +53 -26
- package/dist/ui/progress.js +50 -26
- package/dist/ui/progress.js.map +1 -1
- package/dist/ui/radio-group.d.ts +25 -0
- package/dist/ui/radio-group.js +20 -0
- package/dist/ui/radio-group.js.map +1 -1
- package/dist/ui/resizable.d.ts +37 -0
- package/dist/ui/resizable.js +30 -0
- package/dist/ui/resizable.js.map +1 -1
- package/dist/ui/scroll-area.d.ts +22 -0
- package/dist/ui/scroll-area.js +21 -0
- package/dist/ui/scroll-area.js.map +1 -1
- package/dist/ui/select.d.ts +122 -0
- package/dist/ui/select.js +108 -0
- package/dist/ui/select.js.map +1 -1
- package/dist/ui/separator.d.ts +11 -0
- package/dist/ui/separator.js +10 -0
- package/dist/ui/separator.js.map +1 -1
- package/dist/ui/sheet.d.ts +107 -0
- package/dist/ui/sheet.js +101 -0
- package/dist/ui/sheet.js.map +1 -1
- package/dist/ui/skeleton.d.ts +10 -0
- package/dist/ui/skeleton.js +10 -0
- package/dist/ui/skeleton.js.map +1 -1
- package/dist/ui/slider.d.ts +21 -0
- package/dist/ui/slider.js +14 -0
- package/dist/ui/slider.js.map +1 -1
- package/dist/ui/sonner.d.ts +23 -0
- package/dist/ui/sonner.js +21 -0
- package/dist/ui/sonner.js.map +1 -1
- package/dist/ui/spinner.d.ts +10 -0
- package/dist/ui/spinner.js +10 -0
- package/dist/ui/spinner.js.map +1 -1
- package/dist/ui/switch.d.ts +15 -0
- package/dist/ui/switch.js +10 -0
- package/dist/ui/switch.js.map +1 -1
- package/dist/ui/table.d.ts +81 -0
- package/dist/ui/table.js +80 -0
- package/dist/ui/table.js.map +1 -1
- package/dist/ui/tabs.d.ts +59 -0
- package/dist/ui/tabs.js +51 -0
- package/dist/ui/tabs.js.map +1 -1
- package/dist/ui/textarea.d.ts +13 -0
- package/dist/ui/textarea.js +13 -0
- package/dist/ui/textarea.js.map +1 -1
- package/dist/ui/toggle-group.d.ts +34 -0
- package/dist/ui/toggle-group.js +24 -0
- package/dist/ui/toggle-group.js.map +1 -1
- package/dist/ui/toggle.d.ts +28 -0
- package/dist/ui/toggle.js +24 -0
- package/dist/ui/toggle.js.map +1 -1
- package/package.json +4 -2
- package/release-provenance.json +15 -0
- package/src/adapters/interest-card/eslint/eslint-plugin-custom-navigation.mjs +2 -0
- package/src/adapters/interest-card/eslint/taro.mjs +21 -0
- package/src/adapters/interest-card/runtime/microapp.ts +11 -0
- package/src/adapters/interest-card/types/taro.d.ts +28 -0
- package/src/build/config-overrides.ts +39 -0
- package/src/build/index.ts +5 -0
- package/src/build/plugins/app-config.ts +47 -0
- package/src/build/plugins/depend-card/analyze.ts +122 -0
- package/src/build/plugins/depend-card/source.ts +97 -0
- package/src/build/plugins/vite-depend-card.ts +168 -0
- package/src/build/plugins/vite-image-asset-import.ts +178 -0
- package/src/build/plugins/vite-inline-json.ts +149 -0
- package/src/build/plugins/vite-taro-source-location.ts +224 -0
- package/src/build/plugins/vite-tt-components-entry.ts +33 -0
- package/src/build/taro.ts +830 -0
- package/src/components/miniapp-open-card.ts +94 -0
- package/src/components/native-miniapp-open-card.ts +7 -0
- package/src/eslint/eslint-plugin-custom-navigation.mjs +290 -0
- package/src/eslint/eslint-plugin-microapp-pages.mjs +659 -0
- package/src/eslint/server.mjs +69 -0
- package/src/eslint/taro.mjs +564 -0
- package/src/index.ts +2 -0
- package/src/internal/runtime/douyin-open-button.d.ts +29 -0
- package/src/internal/runtime/iframe-auth/identity.ts +236 -0
- package/src/internal/runtime/iframe-auth/index.ts +2 -0
- package/src/internal/runtime/iframe-auth/sync.ts +37 -0
- package/src/internal/vendor-modules.d.ts +8 -0
- package/src/lib/measure.ts +115 -0
- package/src/lib/platform.ts +11 -0
- package/src/lib/utils.ts +6 -0
- package/src/runtime/client.ts +246 -0
- package/src/runtime/default-client.ts +26 -0
- package/src/runtime/default-iframe-auth.ts +13 -0
- package/src/runtime/douyin-container-request.ts +367 -0
- package/src/runtime/douyin-login-request.ts +514 -0
- package/src/runtime/globals.d.ts +342 -0
- package/src/runtime/index.ts +4 -0
- package/src/runtime/network-url.ts +63 -0
- package/src/ui/accordion.tsx +226 -0
- package/src/ui/alert-dialog.tsx +407 -0
- package/src/ui/alert.tsx +149 -0
- package/src/ui/aspect-ratio.tsx +37 -0
- package/src/ui/avatar.tsx +238 -0
- package/src/ui/badge.tsx +77 -0
- package/src/ui/button-group.tsx +173 -0
- package/src/ui/button.tsx +215 -0
- package/src/ui/calendar.tsx +353 -0
- package/src/ui/card.tsx +217 -0
- package/src/ui/carousel.tsx +259 -0
- package/src/ui/checkbox.tsx +62 -0
- package/src/ui/collapsible.tsx +148 -0
- package/src/ui/combobox.tsx +650 -0
- package/src/ui/dialog.tsx +290 -0
- package/src/ui/drawer.tsx +272 -0
- package/src/ui/dropdown-menu.tsx +547 -0
- package/src/ui/empty.tsx +166 -0
- package/src/ui/field.tsx +427 -0
- package/src/ui/helpers.tsx +39 -0
- package/src/ui/index.ts +47 -0
- package/src/ui/input-group.tsx +320 -0
- package/src/ui/input-otp.tsx +189 -0
- package/src/ui/input.tsx +60 -0
- package/src/ui/item.tsx +338 -0
- package/src/ui/label.tsx +31 -0
- package/src/ui/menubar.tsx +835 -0
- package/src/ui/navigation-menu.tsx +341 -0
- package/src/ui/pagination.tsx +195 -0
- package/src/ui/popover.tsx +363 -0
- package/src/ui/portal.tsx +31 -0
- package/src/ui/progress.tsx +182 -0
- package/src/ui/radio-group.tsx +111 -0
- package/src/ui/resizable.tsx +410 -0
- package/src/ui/scroll-area.tsx +102 -0
- package/src/ui/select.tsx +471 -0
- package/src/ui/separator.tsx +37 -0
- package/src/ui/sheet.tsx +289 -0
- package/src/ui/skeleton.tsx +25 -0
- package/src/ui/slider.tsx +176 -0
- package/src/ui/sonner.tsx +40 -0
- package/src/ui/spinner.tsx +23 -0
- package/src/ui/switch.tsx +94 -0
- package/src/ui/table.tsx +240 -0
- package/src/ui/tabs.tsx +233 -0
- package/src/ui/tailwind.css +2 -0
- package/src/ui/textarea.tsx +49 -0
- package/src/ui/theme.css +234 -0
- package/src/ui/toggle-group.tsx +215 -0
- package/src/ui/toggle.tsx +113 -0
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 强制小程序页面使用自定义导航栏:app config 必须声明 navigationStyle: 'custom',
|
|
3
|
+
* page config 若声明 navigationStyle 也只能是 custom,每个页面必须显式声明导航前景色,
|
|
4
|
+
* 且每个页面入口必须接入顶部避让。
|
|
5
|
+
*/
|
|
6
|
+
import { createRequire } from 'node:module';
|
|
7
|
+
|
|
8
|
+
const ts = createRequire(import.meta.url)('typescript');
|
|
9
|
+
|
|
10
|
+
const CUSTOM = 'custom';
|
|
11
|
+
const NAVIGATION_TEXT_STYLES = new Set(['black', 'white']);
|
|
12
|
+
|
|
13
|
+
const CUSTOM_NAV_IMPORTS = new Set([
|
|
14
|
+
'@/components/custom-nav-space',
|
|
15
|
+
'@/hooks/use-custom-nav-layout',
|
|
16
|
+
'@/lib/custom-nav-layout',
|
|
17
|
+
]);
|
|
18
|
+
|
|
19
|
+
const FORBIDDEN_NAVIGATION_APIS = new Map([
|
|
20
|
+
['setNavigationBarTitle', '禁止修改导航栏标题'],
|
|
21
|
+
['setNavigationBarColor', '禁止修改导航栏颜色、前景色或状态栏样式'],
|
|
22
|
+
['showNavigationBarLoading', '禁止显示导航栏 loading'],
|
|
23
|
+
['hideNavigationBarLoading', '禁止隐藏导航栏 loading'],
|
|
24
|
+
['hideHomeButton', '禁止隐藏左上角首页或 logo 按钮'],
|
|
25
|
+
]);
|
|
26
|
+
|
|
27
|
+
function getPropertyName(prop) {
|
|
28
|
+
if (!ts.isPropertyAssignment(prop)) return null;
|
|
29
|
+
if (ts.isIdentifier(prop.name)) return prop.name.text;
|
|
30
|
+
if (ts.isStringLiteral(prop.name)) return prop.name.text;
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function getStringLiteral(node) {
|
|
35
|
+
if (ts.isStringLiteral(node) || ts.isNoSubstitutionTemplateLiteral(node)) {
|
|
36
|
+
return node.text;
|
|
37
|
+
}
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function getStaticPropertyName(node) {
|
|
42
|
+
if (!node.computed && node.property.type === 'Identifier') {
|
|
43
|
+
return node.property.name;
|
|
44
|
+
}
|
|
45
|
+
if (
|
|
46
|
+
node.computed &&
|
|
47
|
+
node.property.type === 'Literal' &&
|
|
48
|
+
typeof node.property.value === 'string'
|
|
49
|
+
) {
|
|
50
|
+
return node.property.value;
|
|
51
|
+
}
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function getPropertyKeyName(node) {
|
|
56
|
+
if (!node.computed && node.key.type === 'Identifier') {
|
|
57
|
+
return node.key.name;
|
|
58
|
+
}
|
|
59
|
+
if (node.key.type === 'Literal' && typeof node.key.value === 'string') {
|
|
60
|
+
return node.key.value;
|
|
61
|
+
}
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* @returns {{ windowStyle: string | null, pageStyle: string | null, windowTextStyle: string | null, pageTextStyle: string | null, invalid: Array<{ kind: string, value: string | null }> } | null}
|
|
67
|
+
*/
|
|
68
|
+
function extractNavigationStyles(filePath, text) {
|
|
69
|
+
const sf = ts.createSourceFile(filePath, text, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);
|
|
70
|
+
let result = null;
|
|
71
|
+
|
|
72
|
+
function fromObjectLiteral(obj) {
|
|
73
|
+
const out = {
|
|
74
|
+
windowStyle: null,
|
|
75
|
+
pageStyle: null,
|
|
76
|
+
windowTextStyle: null,
|
|
77
|
+
pageTextStyle: null,
|
|
78
|
+
invalid: [],
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
for (const prop of obj.properties) {
|
|
82
|
+
if (!ts.isPropertyAssignment(prop)) continue;
|
|
83
|
+
const key = getPropertyName(prop);
|
|
84
|
+
|
|
85
|
+
if (key === 'navigationStyle') {
|
|
86
|
+
const value = getStringLiteral(prop.initializer);
|
|
87
|
+
out.pageStyle = value;
|
|
88
|
+
if (value !== CUSTOM) {
|
|
89
|
+
out.invalid.push({ kind: 'page', value });
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (key === 'navigationBarTextStyle') {
|
|
94
|
+
out.pageTextStyle = getStringLiteral(prop.initializer);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if (key === 'window' && ts.isObjectLiteralExpression(prop.initializer)) {
|
|
98
|
+
for (const windowProp of prop.initializer.properties) {
|
|
99
|
+
if (!ts.isPropertyAssignment(windowProp)) continue;
|
|
100
|
+
const windowKey = getPropertyName(windowProp);
|
|
101
|
+
if (windowKey === 'navigationStyle') {
|
|
102
|
+
const value = getStringLiteral(windowProp.initializer);
|
|
103
|
+
out.windowStyle = value;
|
|
104
|
+
if (value !== CUSTOM) {
|
|
105
|
+
out.invalid.push({ kind: 'window', value });
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
if (windowKey === 'navigationBarTextStyle') {
|
|
109
|
+
out.windowTextStyle = getStringLiteral(windowProp.initializer);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return out;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function visit(node) {
|
|
119
|
+
if (result) return;
|
|
120
|
+
if (ts.isExportAssignment(node) && !node.isExportEquals && node.expression) {
|
|
121
|
+
const expr = node.expression;
|
|
122
|
+
if (
|
|
123
|
+
ts.isCallExpression(expr) &&
|
|
124
|
+
expr.arguments[0] &&
|
|
125
|
+
ts.isObjectLiteralExpression(expr.arguments[0])
|
|
126
|
+
) {
|
|
127
|
+
result = fromObjectLiteral(expr.arguments[0]);
|
|
128
|
+
} else if (ts.isObjectLiteralExpression(expr)) {
|
|
129
|
+
result = fromObjectLiteral(expr);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
ts.forEachChild(node, visit);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
visit(sf);
|
|
136
|
+
return result;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const CONFIG_MESSAGE =
|
|
140
|
+
'小程序页面必须使用自定义导航栏:navigationStyle 只能是 "custom",禁止改成 default 或其他值。' +
|
|
141
|
+
'页面顶部请用 <CustomNavSpace /> 或 useCustomNavLayout() 避让状态栏与胶囊。';
|
|
142
|
+
|
|
143
|
+
const TEXT_STYLE_MESSAGE =
|
|
144
|
+
'请根据该页面首次进入时顶部区域的实际明暗,显式设置 navigationBarTextStyle:' +
|
|
145
|
+
'浅色顶部使用 "black",深色顶部使用 "white"。';
|
|
146
|
+
|
|
147
|
+
/** @type {import('eslint').Rule.RuleModule} */
|
|
148
|
+
const requireCustomNavigationStyle = {
|
|
149
|
+
meta: {
|
|
150
|
+
type: 'problem',
|
|
151
|
+
docs: {
|
|
152
|
+
description: '强制自定义导航,并要求 app fallback 与每个页面显式声明导航前景色',
|
|
153
|
+
},
|
|
154
|
+
schema: [],
|
|
155
|
+
},
|
|
156
|
+
create(context) {
|
|
157
|
+
const filePath = context.filename.replace(/\\/g, '/');
|
|
158
|
+
const isApp = filePath.endsWith('/src/app.config.ts') || filePath.endsWith('src/app.config.ts');
|
|
159
|
+
const isPageConfig = /\/src\/pages\/.+\.config\.ts$/.test(filePath);
|
|
160
|
+
if (!isApp && !isPageConfig) return {};
|
|
161
|
+
|
|
162
|
+
return {
|
|
163
|
+
Program(node) {
|
|
164
|
+
const sourceText = context.sourceCode.getText(node);
|
|
165
|
+
const parsed = extractNavigationStyles(filePath, sourceText);
|
|
166
|
+
|
|
167
|
+
if (!parsed) {
|
|
168
|
+
context.report({
|
|
169
|
+
node,
|
|
170
|
+
message: `无法解析 ${isApp ? 'defineAppConfig' : 'definePageConfig'},请使用对象字面量声明。${CONFIG_MESSAGE}`,
|
|
171
|
+
});
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
if (isApp && parsed.windowStyle !== CUSTOM) {
|
|
176
|
+
context.report({
|
|
177
|
+
node,
|
|
178
|
+
message:
|
|
179
|
+
`src/app.config.ts 的 window.navigationStyle 必须为 "custom"(当前:${parsed.windowStyle ?? '未设置'})。${CONFIG_MESSAGE}`,
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
const textStyle = isApp ? parsed.windowTextStyle : parsed.pageTextStyle;
|
|
184
|
+
if (!NAVIGATION_TEXT_STYLES.has(textStyle)) {
|
|
185
|
+
context.report({
|
|
186
|
+
node,
|
|
187
|
+
message:
|
|
188
|
+
`${isApp ? 'src/app.config.ts 的 window' : '页面配置'}.navigationBarTextStyle ` +
|
|
189
|
+
`必须为 "black" 或 "white"(当前:${textStyle ?? '未设置'})。${TEXT_STYLE_MESSAGE}`,
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
for (const item of parsed.invalid) {
|
|
194
|
+
if (isApp && item.kind === 'window') continue;
|
|
195
|
+
context.report({
|
|
196
|
+
node,
|
|
197
|
+
message:
|
|
198
|
+
`禁止将 ${item.kind === 'window' ? 'window.' : ''}navigationStyle 设为 ${JSON.stringify(item.value)}。${CONFIG_MESSAGE}`,
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
};
|
|
203
|
+
},
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
/** @type {import('eslint').Rule.RuleModule} */
|
|
207
|
+
const pagesMustUseCustomNavSpace = {
|
|
208
|
+
meta: {
|
|
209
|
+
type: 'problem',
|
|
210
|
+
docs: {
|
|
211
|
+
description: '页面入口必须使用 CustomNavSpace 或 useCustomNavLayout 避让自定义导航栏区域',
|
|
212
|
+
},
|
|
213
|
+
schema: [],
|
|
214
|
+
},
|
|
215
|
+
create(context) {
|
|
216
|
+
const filePath = context.filename.replace(/\\/g, '/');
|
|
217
|
+
if (!/\/src\/pages\/.+\/index\.[jt]sx$/.test(filePath)) return {};
|
|
218
|
+
|
|
219
|
+
let used = false;
|
|
220
|
+
|
|
221
|
+
return {
|
|
222
|
+
ImportDeclaration(node) {
|
|
223
|
+
if (typeof node.source.value === 'string' && CUSTOM_NAV_IMPORTS.has(node.source.value)) {
|
|
224
|
+
used = true;
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
'Program:exit'(node) {
|
|
228
|
+
if (used) return;
|
|
229
|
+
context.report({
|
|
230
|
+
node,
|
|
231
|
+
message:
|
|
232
|
+
'小程序页面必须 import <CustomNavSpace /> 或 useCustomNavLayout() 做顶部避让,' +
|
|
233
|
+
'禁止改回原生导航,也禁止只用固定 pt-* / safe-area 代替。',
|
|
234
|
+
});
|
|
235
|
+
},
|
|
236
|
+
};
|
|
237
|
+
},
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
/** @type {import('eslint').Rule.RuleModule} */
|
|
241
|
+
const noNavigationControlApis = {
|
|
242
|
+
meta: {
|
|
243
|
+
type: 'problem',
|
|
244
|
+
docs: {
|
|
245
|
+
description: '禁止小程序页面调用会修改宿主导航栏或左上角按钮的 API',
|
|
246
|
+
},
|
|
247
|
+
schema: [],
|
|
248
|
+
},
|
|
249
|
+
create(context) {
|
|
250
|
+
function report(node, apiName) {
|
|
251
|
+
const reason = FORBIDDEN_NAVIGATION_APIS.get(apiName);
|
|
252
|
+
if (!reason) return;
|
|
253
|
+
|
|
254
|
+
context.report({
|
|
255
|
+
node,
|
|
256
|
+
message:
|
|
257
|
+
`小程序页面禁止使用 ${apiName}:${reason}。` +
|
|
258
|
+
'导航栏和左上角按钮由宿主及自定义导航模板统一管理。',
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
return {
|
|
263
|
+
MemberExpression(node) {
|
|
264
|
+
report(node.property, getStaticPropertyName(node));
|
|
265
|
+
},
|
|
266
|
+
ImportSpecifier(node) {
|
|
267
|
+
const importedName = node.imported.type === 'Identifier'
|
|
268
|
+
? node.imported.name
|
|
269
|
+
: node.imported.value;
|
|
270
|
+
report(node.imported, importedName);
|
|
271
|
+
},
|
|
272
|
+
Property(node) {
|
|
273
|
+
if (node.parent.type !== 'ObjectPattern') return;
|
|
274
|
+
report(node.key, getPropertyKeyName(node));
|
|
275
|
+
},
|
|
276
|
+
CallExpression(node) {
|
|
277
|
+
if (node.callee.type !== 'Identifier') return;
|
|
278
|
+
report(node.callee, node.callee.name);
|
|
279
|
+
},
|
|
280
|
+
};
|
|
281
|
+
},
|
|
282
|
+
};
|
|
283
|
+
|
|
284
|
+
export default {
|
|
285
|
+
rules: {
|
|
286
|
+
'require-custom-navigation-style': requireCustomNavigationStyle,
|
|
287
|
+
'pages-must-use-custom-nav-space': pagesMustUseCustomNavSpace,
|
|
288
|
+
'no-navigation-control-apis': noNavigationControlApis,
|
|
289
|
+
},
|
|
290
|
+
};
|
package/dist/eslint/taro.mjs
CHANGED
|
@@ -6,6 +6,7 @@ import reactHooksPlugin from 'eslint-plugin-react-hooks';
|
|
|
6
6
|
import importPlugin from 'eslint-plugin-import';
|
|
7
7
|
import globals from 'globals';
|
|
8
8
|
import microappPages from './eslint-plugin-microapp-pages.mjs';
|
|
9
|
+
import customNavigation from './eslint-plugin-custom-navigation.mjs';
|
|
9
10
|
|
|
10
11
|
const REMOTE_CSS_IMPORT_PATTERN =
|
|
11
12
|
/@import\s+(?:url\(\s*['"]?((?:https?:)?\/\/[^'")\s]+)['"]?\s*\)|['"]((?:https?:)?\/\/[^'"\s]+)['"])/g;
|
|
@@ -440,15 +441,25 @@ export function createMicroappTaroEslintConfig(options = {}) {
|
|
|
440
441
|
'tailwindcss/no-custom-classname': 'off',
|
|
441
442
|
},
|
|
442
443
|
},
|
|
444
|
+
{
|
|
445
|
+
files: ['src/**/*.{js,jsx,ts,tsx}'],
|
|
446
|
+
plugins: { customNavigation },
|
|
447
|
+
rules: {
|
|
448
|
+
'customNavigation/no-navigation-control-apis': 'error',
|
|
449
|
+
},
|
|
450
|
+
},
|
|
443
451
|
{
|
|
444
452
|
files: ['src/**/*.{js,jsx,ts,tsx}'],
|
|
445
453
|
ignores: ['src/network.ts'],
|
|
446
454
|
plugins: {
|
|
447
455
|
lucide: lucideColorCheckPlugin,
|
|
448
456
|
microappPages,
|
|
457
|
+
customNavigation,
|
|
449
458
|
tailwind: tailwindEnforcementPlugin,
|
|
450
459
|
},
|
|
451
460
|
rules: {
|
|
461
|
+
'customNavigation/require-custom-navigation-style': 'error',
|
|
462
|
+
'customNavigation/pages-must-use-custom-nav-space': 'error',
|
|
452
463
|
'microappPages/nav-url-in-app-pages': 'error',
|
|
453
464
|
// 'microappPages/page-dirs-in-app-pages': 'error',
|
|
454
465
|
'microappPages/declared-pages-must-exist': 'error',
|
package/dist/reference/llms.txt
CHANGED
|
@@ -1,36 +1,78 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
- `@open-dy/vibecoding-sdk-taro/ui/theme.css` — UI 样式资源入口。
|
|
14
|
-
- `@open-dy/vibecoding-sdk-taro/ui/tailwind.css` — UI 样式资源入口。
|
|
15
|
-
- `@open-dy/vibecoding-sdk-taro/components/miniapp-open-card` — 公开导出入口。
|
|
16
|
-
- `@open-dy/vibecoding-sdk-taro/build/taro` — SDK 公开 API。 ([docs](./sdk-api/build/taro/index.md))
|
|
17
|
-
- `@open-dy/vibecoding-sdk-taro/types/taro` — 平台类型声明入口。
|
|
18
|
-
- `@open-dy/vibecoding-sdk-taro/reference/sdk-api.md` — 已生成的机器可读或 Markdown 参考文档。
|
|
19
|
-
- `@open-dy/vibecoding-sdk-taro/reference/sdk-api.json` — 已生成的机器可读或 Markdown 参考文档。
|
|
20
|
-
- `@open-dy/vibecoding-sdk-taro/reference/llms.txt` — 已生成的机器可读或 Markdown 参考文档。
|
|
21
|
-
- `@open-dy/vibecoding-sdk-taro/reference/sdk-api/*` — 已生成的机器可读或 Markdown 参考文档。
|
|
22
|
-
- `@open-dy/vibecoding-sdk-taro/eslint/taro` — 场景化 ESLint 配置入口。
|
|
23
|
-
- `@open-dy/vibecoding-sdk-taro/eslint/server` — 场景化 ESLint 配置入口。
|
|
24
|
-
- `@open-dy/vibecoding-sdk-taro/build` — 构建能力聚合入口;详细契约见 build/taro 和 build/opencard。 ([docs](./sdk-api/build/taro/index.md))
|
|
1
|
+
# @open-dy/vibecoding-sdk-taro
|
|
2
|
+
|
|
3
|
+
> API documentation for @open-dy/vibecoding-sdk-taro, covering runtime APIs, build configuration and component contracts.
|
|
4
|
+
|
|
5
|
+
Start with the SDK overview, then follow the relevant API or module link. Import paths and types are documented on the linked pages.
|
|
6
|
+
|
|
7
|
+
Companion libraries are separate project dependencies, imported from their own package names.
|
|
8
|
+
|
|
9
|
+
## Documentation
|
|
10
|
+
|
|
11
|
+
- [SDK overview](./sdk-api.md): Complete public entry points and documentation directory.
|
|
12
|
+
- [API manifest](./sdk-api.json): Machine-readable signatures, parameters, return values and usage constraints.
|
|
25
13
|
|
|
26
14
|
## APIs
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
- [CreateMicroappClientOptions](./sdk-api/runtime/CreateMicroappClientOptions.md)
|
|
30
|
-
|
|
31
|
-
- [
|
|
32
|
-
|
|
33
|
-
- [
|
|
34
|
-
|
|
35
|
-
- [
|
|
36
|
-
|
|
15
|
+
|
|
16
|
+
- [createMicroappClient](./sdk-api/runtime/createMicroappClient.md): 创建普通小程序的网络入口;SDK 自动绑定项目 Taro 运行时。 Import: `@open-dy/vibecoding-sdk-taro/runtime`.
|
|
17
|
+
- [CreateMicroappClientOptions](./sdk-api/runtime/CreateMicroappClientOptions.md): 配置普通小程序 Network 的平台渠道。 Import: `@open-dy/vibecoding-sdk-taro/runtime`.
|
|
18
|
+
- [MiniappOpenCard](./sdk-api/components/miniapp-open-card/MiniappOpenCard.md): 承载同一 OpenCard;SDK 选择环境版本并为空初始化参数提供对象,错误类型直接报错。 Import: `@open-dy/vibecoding-sdk-taro/components/miniapp-open-card`.
|
|
19
|
+
- [MiniappOpenCardProps](./sdk-api/components/miniapp-open-card/MiniappOpenCardProps.md): 普通 Taro 宿主的内嵌卡属性;沿用 StandardProps,但不接受 children 或 envVersion。 Import: `@open-dy/vibecoding-sdk-taro/components/miniapp-open-card`.
|
|
20
|
+
- [MiniappOpenCardErrorDetail](./sdk-api/components/miniapp-open-card/MiniappOpenCardErrorDetail.md): 内嵌卡加载错误的事件 detail;可选错误字段由平台提供。 Import: `@open-dy/vibecoding-sdk-taro/components/miniapp-open-card`.
|
|
21
|
+
- [MiniappOpenCardEnvVersion](./sdk-api/components/miniapp-open-card/MiniappOpenCardEnvVersion.md): SDK 根据宿主环境选择的卡片版本;不是业务组件的可配置属性。 Import: `@open-dy/vibecoding-sdk-taro/components/miniapp-open-card`.
|
|
22
|
+
- [BuildContext](./sdk-api/build/taro/BuildContext.md): Taro 构建阶段共享的编译上下文。 Import: `@open-dy/vibecoding-sdk-taro/build/taro`.
|
|
23
|
+
- [CreateMicroappTaroConfigOptions](./sdk-api/build/taro/CreateMicroappTaroConfigOptions.md): 创建普通小程序 Taro 配置的选项。 Import: `@open-dy/vibecoding-sdk-taro/build/taro`.
|
|
24
|
+
- [createMicroappTaroConfig](./sdk-api/build/taro/createMicroappTaroConfig.md): 创建普通小程序的 Taro/Vite 构建配置。 Import: `@open-dy/vibecoding-sdk-taro/build/taro`.
|
|
25
|
+
|
|
26
|
+
## UI modules
|
|
27
|
+
|
|
28
|
+
- [accordion](./sdk-api/ui/accordion/index.md): API reference for the accordion module; Taro only.
|
|
29
|
+
- [alert-dialog](./sdk-api/ui/alert-dialog/index.md): API reference for the alert-dialog module; Taro only.
|
|
30
|
+
- [alert](./sdk-api/ui/alert/index.md): API reference for the alert module; Taro only.
|
|
31
|
+
- [aspect-ratio](./sdk-api/ui/aspect-ratio/index.md): API reference for the aspect-ratio module; Taro only.
|
|
32
|
+
- [avatar](./sdk-api/ui/avatar/index.md): API reference for the avatar module; Taro only.
|
|
33
|
+
- [badge](./sdk-api/ui/badge/index.md): API reference for the badge module; Taro only.
|
|
34
|
+
- [button-group](./sdk-api/ui/button-group/index.md): API reference for the button-group module; Taro only.
|
|
35
|
+
- [button](./sdk-api/ui/button/index.md): API reference for the button module; Taro only.
|
|
36
|
+
- [calendar](./sdk-api/ui/calendar/index.md): API reference for the calendar module; Taro only.
|
|
37
|
+
- [card](./sdk-api/ui/card/index.md): API reference for the card module; Taro only.
|
|
38
|
+
- [carousel](./sdk-api/ui/carousel/index.md): API reference for the carousel module; Taro only.
|
|
39
|
+
- [checkbox](./sdk-api/ui/checkbox/index.md): API reference for the checkbox module; Taro only.
|
|
40
|
+
- [collapsible](./sdk-api/ui/collapsible/index.md): API reference for the collapsible module; Taro only.
|
|
41
|
+
- [combobox](./sdk-api/ui/combobox/index.md): API reference for the combobox module; Taro only.
|
|
42
|
+
- [dialog](./sdk-api/ui/dialog/index.md): API reference for the dialog module; Taro only.
|
|
43
|
+
- [drawer](./sdk-api/ui/drawer/index.md): API reference for the drawer module; Taro only.
|
|
44
|
+
- [dropdown-menu](./sdk-api/ui/dropdown-menu/index.md): API reference for the dropdown-menu module; Taro only.
|
|
45
|
+
- [empty](./sdk-api/ui/empty/index.md): API reference for the empty module; Taro only.
|
|
46
|
+
- [field](./sdk-api/ui/field/index.md): API reference for the field module; Taro only.
|
|
47
|
+
- [helpers](./sdk-api/ui/helpers/index.md): API reference for the helpers module; Taro only.
|
|
48
|
+
- [input-group](./sdk-api/ui/input-group/index.md): API reference for the input-group module; Taro only.
|
|
49
|
+
- [input-otp](./sdk-api/ui/input-otp/index.md): API reference for the input-otp module; Taro only.
|
|
50
|
+
- [input](./sdk-api/ui/input/index.md): API reference for the input module; Taro only.
|
|
51
|
+
- [item](./sdk-api/ui/item/index.md): API reference for the item module; Taro only.
|
|
52
|
+
- [label](./sdk-api/ui/label/index.md): API reference for the label module; Taro only.
|
|
53
|
+
- [menubar](./sdk-api/ui/menubar/index.md): API reference for the menubar module; Taro only.
|
|
54
|
+
- [navigation-menu](./sdk-api/ui/navigation-menu/index.md): API reference for the navigation-menu module; Taro only.
|
|
55
|
+
- [pagination](./sdk-api/ui/pagination/index.md): API reference for the pagination module; Taro only.
|
|
56
|
+
- [popover](./sdk-api/ui/popover/index.md): API reference for the popover module; Taro only.
|
|
57
|
+
- [portal](./sdk-api/ui/portal/index.md): API reference for the portal module; Taro only.
|
|
58
|
+
- [progress](./sdk-api/ui/progress/index.md): API reference for the progress module; Taro only.
|
|
59
|
+
- [radio-group](./sdk-api/ui/radio-group/index.md): API reference for the radio-group module; Taro only.
|
|
60
|
+
- [resizable](./sdk-api/ui/resizable/index.md): API reference for the resizable module; Taro only.
|
|
61
|
+
- [scroll-area](./sdk-api/ui/scroll-area/index.md): API reference for the scroll-area module; Taro only.
|
|
62
|
+
- [select](./sdk-api/ui/select/index.md): API reference for the select module; Taro only.
|
|
63
|
+
- [separator](./sdk-api/ui/separator/index.md): API reference for the separator module; Taro only.
|
|
64
|
+
- [sheet](./sdk-api/ui/sheet/index.md): API reference for the sheet module; Taro only.
|
|
65
|
+
- [skeleton](./sdk-api/ui/skeleton/index.md): API reference for the skeleton module; Taro only.
|
|
66
|
+
- [slider](./sdk-api/ui/slider/index.md): API reference for the slider module; Taro only.
|
|
67
|
+
- [sonner](./sdk-api/ui/sonner/index.md): API reference for the sonner module; Taro only.
|
|
68
|
+
- [spinner](./sdk-api/ui/spinner/index.md): API reference for the spinner module; Taro only.
|
|
69
|
+
- [switch](./sdk-api/ui/switch/index.md): API reference for the switch module; Taro only.
|
|
70
|
+
- [table](./sdk-api/ui/table/index.md): API reference for the table module; Taro only.
|
|
71
|
+
- [tabs](./sdk-api/ui/tabs/index.md): API reference for the tabs module; Taro only.
|
|
72
|
+
- [textarea](./sdk-api/ui/textarea/index.md): API reference for the textarea module; Taro only.
|
|
73
|
+
- [toggle-group](./sdk-api/ui/toggle-group/index.md): API reference for the toggle-group module; Taro only.
|
|
74
|
+
- [toggle](./sdk-api/ui/toggle/index.md): API reference for the toggle module; Taro only.
|
|
75
|
+
|
|
76
|
+
## Companion libraries
|
|
77
|
+
|
|
78
|
+
- [@open-dy/lucide-taro](./sdk-api/libraries/lucide-taro.md): Taro 图标组件、属性、Provider 和 TabBar PNG 工具;独立依赖,OpenCard 不使用。
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<!-- Generated by build/src/sdk-reference/skill-reference.ts. Do not edit. -->
|
|
4
4
|
|
|
5
5
|
导入路径:`@open-dy/vibecoding-sdk-taro/build/taro`
|
|
6
|
-
|
|
6
|
+
源码:实际安装的 `@open-dy/vibecoding-sdk-taro` 包内 `src/build/taro.ts`(仅补缺或排错时读取)。
|
|
7
7
|
|
|
8
8
|
#### 说明
|
|
9
9
|
|
|
@@ -22,7 +22,12 @@ const context: BuildContext = { isH5: true, isTt: false, mode: 'development', pr
|
|
|
22
22
|
| 意图 | 描述 SDK 构建插件收到的 Taro 编译上下文。 |
|
|
23
23
|
| 适用时机 | 需要根据 H5、TT 或开发模式调整构建配置时。 |
|
|
24
24
|
| 避免 | 不要在业务页面中手动伪造该上下文或修改构建产物。 |
|
|
25
|
-
|
|
25
|
+
|
|
26
|
+
示例:
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
{ isH5: true, isTt: false, mode: 'development', projectRoot }
|
|
30
|
+
```
|
|
26
31
|
|
|
27
32
|
#### 声明
|
|
28
33
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<!-- Generated by build/src/sdk-reference/skill-reference.ts. Do not edit. -->
|
|
4
4
|
|
|
5
5
|
导入路径:`@open-dy/vibecoding-sdk-taro/build/taro`
|
|
6
|
-
|
|
6
|
+
源码:实际安装的 `@open-dy/vibecoding-sdk-taro` 包内 `src/build/taro.ts`(仅补缺或排错时读取)。
|
|
7
7
|
|
|
8
8
|
#### 说明
|
|
9
9
|
|
|
@@ -31,7 +31,6 @@ createMicroappTaroConfig({ projectRoot: process.cwd() })
|
|
|
31
31
|
| 意图 | 配置普通小程序的 Taro/Vite 构建入口。 |
|
|
32
32
|
| 适用时机 | 需要从项目构建脚本创建普通小程序配置时。 |
|
|
33
33
|
| 避免 | 不要在业务代码中直接调用 Taro/Vite 内部构建 API。 |
|
|
34
|
-
| 示例 | `createMicroappTaroConfig({ projectRoot: process.cwd() })` |
|
|
35
34
|
|
|
36
35
|
#### 声明
|
|
37
36
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<!-- Generated by build/src/sdk-reference/skill-reference.ts. Do not edit. -->
|
|
4
4
|
|
|
5
5
|
导入路径:`@open-dy/vibecoding-sdk-taro/build/taro`
|
|
6
|
-
|
|
6
|
+
源码:实际安装的 `@open-dy/vibecoding-sdk-taro` 包内 `src/build/taro.ts`(仅补缺或排错时读取)。
|
|
7
7
|
|
|
8
8
|
#### 说明
|
|
9
9
|
|
|
@@ -30,7 +30,6 @@ createMicroappTaroConfig({ projectRoot: process.cwd() })
|
|
|
30
30
|
| 意图 | 创建普通小程序的 Taro/Vite 构建配置。 |
|
|
31
31
|
| 适用时机 | 构建脚本需要加载普通小程序的 SDK 配置时。 |
|
|
32
32
|
| 避免 | 不要在业务页面调用该构建工厂,也不要绕过 SDK 修改代理配置。 |
|
|
33
|
-
| 示例 | `createMicroappTaroConfig({ projectRoot: process.cwd() })` |
|
|
34
33
|
|
|
35
34
|
#### 声明
|
|
36
35
|
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# MiniappOpenCard
|
|
2
|
+
|
|
3
|
+
<!-- Generated by build/src/sdk-reference/skill-reference.ts. Do not edit. -->
|
|
4
|
+
|
|
5
|
+
导入路径:`@open-dy/vibecoding-sdk-taro/components/miniapp-open-card`
|
|
6
|
+
源码:实际安装的 `@open-dy/vibecoding-sdk-taro` 包内 `src/components/miniapp-open-card.ts`(仅补缺或排错时读取)。
|
|
7
|
+
|
|
8
|
+
#### 说明
|
|
9
|
+
|
|
10
|
+
承载同一 OpenCard;SDK 选择环境版本并为空初始化参数提供对象,错误类型直接报错。
|
|
11
|
+
|
|
12
|
+
参数:
|
|
13
|
+
|
|
14
|
+
| 名称 | 说明 |
|
|
15
|
+
| --- | --- |
|
|
16
|
+
| `props` | 卡片标识、页面路径和生命周期回调。 |
|
|
17
|
+
|
|
18
|
+
返回:注入环境版本与初始化对象的原生卡片组件。
|
|
19
|
+
|
|
20
|
+
备注:development 使用 latest,preview 使用 preview,production、未知或无法读取的环境使用 current;业务不传 envVersion。
|
|
21
|
+
initData 省略时 SDK 传入空对象,传 null、数组、字符串或其他非普通对象会抛出 TypeError;业务示例显式传 {}。
|
|
22
|
+
宿主只承载卡片。封闭域请求、数据处理与结果 UI 留在卡内,不通过 initData 或事件把私域结果交给宿主。
|
|
23
|
+
|
|
24
|
+
示例:
|
|
25
|
+
|
|
26
|
+
```tsx
|
|
27
|
+
import { MiniappOpenCard } from '@open-dy/vibecoding-sdk-taro/components/miniapp-open-card'
|
|
28
|
+
export function EmbeddedCard({ openCardId }: { openCardId: string }) {
|
|
29
|
+
return <MiniappOpenCard appId={openCardId} path="pages/index/index" initData={{}} onError={(event) => console.error(event.detail.errMsg)} />
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
#### AI 使用约束
|
|
34
|
+
|
|
35
|
+
| 规则 | 内容 |
|
|
36
|
+
| --- | --- |
|
|
37
|
+
| 意图 | 在普通 Taro 宿主中渲染已确认的 OpenCard 页面。 |
|
|
38
|
+
| 适用时机 | 用户要求内嵌卡,或宿主需要通过同一封闭域卡片呈现其结果时。 |
|
|
39
|
+
| 避免 | 不要手写原生标签、传 envVersion 或把卡内私域结果转移到宿主。 |
|
|
40
|
+
|
|
41
|
+
示例:
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
createElement(MiniappOpenCard, { appId: OPEN_CARD_ID, path: 'pages/index/index', initData: {} })
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
#### 声明
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
function MiniappOpenCard(props: MiniappOpenCardProps);
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### MiniappOpenCard 的类型契约
|
|
54
|
+
|
|
55
|
+
#### 工厂签名
|
|
56
|
+
|
|
57
|
+
```ts
|
|
58
|
+
(props: MiniappOpenCardProps): React.ReactElement<MiniappOpenCardProps & { envVersion: MiniappOpenCardEnvVersion; }, string | React.JSXElementConstructor<any>>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
#### 参数
|
|
62
|
+
|
|
63
|
+
| 参数 | 类型 | 说明 |
|
|
64
|
+
| --- | --- | --- |
|
|
65
|
+
| props | `MiniappOpenCardProps` | 卡片标识、页面路径和生命周期回调。 |
|
|
66
|
+
|
|
67
|
+
##### props 字段
|
|
68
|
+
|
|
69
|
+
| 字段 | 类型 | 说明 |
|
|
70
|
+
| --- | --- | --- |
|
|
71
|
+
| appId | `string` | 已确认的目标 OpenCard 标识;承载当前工程时使用非空 OPEN_CARD_ID,不使用小程序 APP_ID。 |
|
|
72
|
+
| path | `string` | 目标卡片的真实页面路径,例如 pages/index/index。 |
|
|
73
|
+
| initData? | `Record<string, unknown> \| undefined` | 卡片初始化对象;省略时传空对象。禁止传 null、数组或 JSON 字符串。 |
|
|
74
|
+
| onLoad? | `BaseEventOrigFunction<Record<string, never>> \| undefined` | 卡片加载成功时调用;event.detail 为空对象。 |
|
|
75
|
+
| onError? | `BaseEventOrigFunction<MiniappOpenCardErrorDetail> \| undefined` | 卡片加载失败时调用;读取 event.detail 中的错误消息与平台可选错误字段。 |
|
|
76
|
+
| style? | `string \| React.CSSProperties \| undefined` | 组件的内联样式, 可以动态设置的内联样式 |
|
|
77
|
+
| id? | `string \| undefined` | 组件的唯一标示, 保持整个页面唯一 |
|
|
78
|
+
| className? | `string \| undefined` | 同 `class`,在 React/Preact 里一般使用 `className` 作为 `class` 的代称 |
|
|
79
|
+
| key? | `string \| number \| undefined` | 如果列表中项目的位置会动态改变或者有新的项目添加到列表中, 需要使用 `wx:key` 来指定列表中项目的唯一的标识符。 |
|
|
80
|
+
| hidden? | `boolean \| undefined` | 组件是否显示, 所有组件默认显示 |
|
|
81
|
+
| animation? | `TaroGeneral.IAnyObject \| { actions: TaroGeneral.IAnyObject[]; } \| undefined` | 动画属性 |
|
|
82
|
+
| ref? | `React.LegacyRef<any> \| undefined` | 引用 |
|
|
83
|
+
| dangerouslySetInnerHTML? | `{ __html: string; } \| undefined` | 渲染 HTML |
|
|
84
|
+
| compileMode? | `string \| boolean \| undefined` | 是否开启编译模式 或者 是否是编译模式的子渲染函数 |
|
|
85
|
+
| harmonyDirection? | `"row" \| "column" \| "flex" \| undefined` | 自定义容器组件的方向 |
|
|
86
|
+
| onTouchStart? | `((event: ITouchEvent) => void) \| undefined` | 手指触摸动作开始 |
|
|
87
|
+
| onTouchMove? | `((event: ITouchEvent) => void) \| undefined` | 手指触摸后移动 |
|
|
88
|
+
| onTouchCancel? | `((event: ITouchEvent) => void) \| undefined` | 手指触摸动作被打断,如来电提醒,弹窗 |
|
|
89
|
+
| onTouchEnd? | `((event: ITouchEvent) => void) \| undefined` | 手指触摸动作结束 |
|
|
90
|
+
| onClick? | `((event: ITouchEvent) => void) \| undefined` | 手指触摸后马上离开 |
|
|
91
|
+
| onLongPress? | `((event: CommonEvent) => void) \| undefined` | 手指触摸后,超过350ms再离开,如果指定了事件回调函数并触发了这个事件,tap事件将不被触发 |
|
|
92
|
+
| onLongClick? | `((event: CommonEvent) => void) \| undefined` | 手指触摸后,超过350ms再离开(推荐使用 longpress 事件代替) |
|
|
93
|
+
| onTransitionEnd? | `((event: CommonEvent) => void) \| undefined` | 会在 WXSS transition 或 Taro.createAnimation 动画结束后触发 |
|
|
94
|
+
| onAnimationStart? | `((event: CommonEvent) => void) \| undefined` | 会在一个 WXSS animation 动画开始时触发 |
|
|
95
|
+
| onAnimationIteration? | `((event: CommonEvent) => void) \| undefined` | 会在一个 WXSS animation 一次迭代结束时触发 |
|
|
96
|
+
| onAnimationEnd? | `((event: CommonEvent) => void) \| undefined` | 会在一个 WXSS animation 动画完成时触发 |
|
|
97
|
+
| onTouchForceChange? | `((event: CommonEvent) => void) \| undefined` | 在支持 3D Touch 的 iPhone 设备,重按时会触发 |
|
|
98
|
+
|
|
99
|
+
#### 返回值
|
|
100
|
+
|
|
101
|
+
- 类型:`React.ReactElement<MiniappOpenCardProps & { envVersion: MiniappOpenCardEnvVersion; }, string | React.JSXElementConstructor<any>>`
|
|
102
|
+
|
|
103
|
+
##### 字段
|
|
104
|
+
|
|
105
|
+
| 字段 | 类型 | 说明 |
|
|
106
|
+
| --- | --- | --- |
|
|
107
|
+
| type | `string \| React.JSXElementConstructor<any>` | |
|
|
108
|
+
| props | `MiniappOpenCardProps & { envVersion: MiniappOpenCardEnvVersion; }` | |
|
|
109
|
+
| key | `string \| null` | |
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# MiniappOpenCardEnvVersion
|
|
2
|
+
|
|
3
|
+
<!-- Generated by build/src/sdk-reference/skill-reference.ts. Do not edit. -->
|
|
4
|
+
|
|
5
|
+
导入路径:`@open-dy/vibecoding-sdk-taro/components/miniapp-open-card`
|
|
6
|
+
源码:实际安装的 `@open-dy/vibecoding-sdk-taro` 包内 `src/components/miniapp-open-card.ts`(仅补缺或排错时读取)。
|
|
7
|
+
|
|
8
|
+
#### 说明
|
|
9
|
+
|
|
10
|
+
SDK 根据宿主环境选择的卡片版本;不是业务组件的可配置属性。
|
|
11
|
+
|
|
12
|
+
示例:
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
const version: MiniappOpenCardEnvVersion = 'current'
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
#### AI 使用约束
|
|
19
|
+
|
|
20
|
+
| 规则 | 内容 |
|
|
21
|
+
| --- | --- |
|
|
22
|
+
| 意图 | 描述 SDK 自动选择的内嵌卡环境版本。 |
|
|
23
|
+
| 适用时机 | 需要理解宿主环境与卡片版本的对应关系时。 |
|
|
24
|
+
| 避免 | 不要向 MiniappOpenCard 传入 envVersion 覆盖环境选择。 |
|
|
25
|
+
|
|
26
|
+
#### 声明
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
export type MiniappOpenCardEnvVersion = 'current' | 'latest' | 'preview';
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### MiniappOpenCardEnvVersion 的类型契约
|
|
33
|
+
|
|
34
|
+
#### 类型
|
|
35
|
+
|
|
36
|
+
```ts
|
|
37
|
+
MiniappOpenCardEnvVersion
|
|
38
|
+
```
|