weifuwu 0.85.0 → 0.87.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +56 -45
- package/content/apps/admin.md +55 -0
- package/content/apps/agent-platform.md +35 -0
- package/content/apps/auth.md +49 -0
- package/content/apps/multi.md +44 -0
- package/content/apps/todo.md +51 -0
- package/content/backend/ai.md +28 -0
- package/content/backend/auth.md +20 -0
- package/content/backend/email.md +23 -0
- package/content/backend/graphql.md +23 -0
- package/content/backend/http.md +23 -0
- package/content/backend/limit.md +23 -0
- package/content/backend/middleware.md +17 -0
- package/content/backend/queue.md +23 -0
- package/content/backend/redis.md +26 -0
- package/content/backend/router.md +23 -0
- package/content/backend/schedule.md +23 -0
- package/content/backend/sql.md +27 -0
- package/content/backend/sse.md +26 -0
- package/content/backend/ws.md +26 -0
- package/content/capabilities/app-node.md +21 -0
- package/content/capabilities/data.md +21 -0
- package/content/capabilities/events.md +21 -0
- package/content/capabilities/hooks.md +22 -0
- package/content/capabilities/i18n.md +21 -0
- package/content/capabilities/popup.md +21 -0
- package/content/capabilities/render-only.md +23 -0
- package/content/capabilities/router.md +22 -0
- package/content/capabilities/self-id.md +21 -0
- package/content/capabilities/store.md +21 -0
- package/content/capabilities/theme.md +21 -0
- package/content/capabilities/two-phase.md +21 -0
- package/content/components/accordion.md +50 -0
- package/content/components/actionsheet.md +46 -0
- package/content/components/affix.md +51 -0
- package/content/components/aichat.md +57 -0
- package/content/components/alert.md +52 -0
- package/content/components/alertgroup.md +45 -0
- package/content/components/anchor.md +52 -0
- package/content/components/app.md +37 -0
- package/content/components/approvalcard.md +56 -0
- package/content/components/appshell.md +50 -0
- package/content/components/aspectratio.md +47 -0
- package/content/components/authpage.md +61 -0
- package/content/components/autocomplete-v2.md +40 -0
- package/content/components/autocomplete.md +56 -0
- package/content/components/avatar.md +51 -0
- package/content/components/avatargroup.md +47 -0
- package/content/components/backtop.md +53 -0
- package/content/components/badge.md +55 -0
- package/content/components/breadcrumb.md +49 -0
- package/content/components/button.md +63 -0
- package/content/components/calendar-v2.md +40 -0
- package/content/components/calendar.md +50 -0
- package/content/components/card.md +58 -0
- package/content/components/carousel.md +52 -0
- package/content/components/cascader-v2.md +39 -0
- package/content/components/cascader.md +54 -0
- package/content/components/chart.md +53 -0
- package/content/components/chatinput.md +63 -0
- package/content/components/checkbox.md +51 -0
- package/content/components/checkboxgroup.md +52 -0
- package/content/components/citationcard.md +48 -0
- package/content/components/codeblock.md +48 -0
- package/content/components/codeeditor.md +47 -0
- package/content/components/collapse.md +49 -0
- package/content/components/colorpicker.md +50 -0
- package/content/components/command.md +50 -0
- package/content/components/confirm.md +57 -0
- package/content/components/contextmenu.md +48 -0
- package/content/components/copybutton.md +51 -0
- package/content/components/datepicker.md +52 -0
- package/content/components/descriptions-v2.md +39 -0
- package/content/components/descriptions.md +52 -0
- package/content/components/diffview-v2.md +39 -0
- package/content/components/diffview.md +50 -0
- package/content/components/divider.md +48 -0
- package/content/components/drawer.md +55 -0
- package/content/components/dropdown.md +53 -0
- package/content/components/editor.md +49 -0
- package/content/components/emptystate.md +51 -0
- package/content/components/exportcsv.md +38 -0
- package/content/components/field.md +54 -0
- package/content/components/filepreview-office.md +37 -0
- package/content/components/filepreview.md +49 -0
- package/content/components/filetree.md +56 -0
- package/content/components/fileupload-v2.md +39 -0
- package/content/components/fileupload.md +57 -0
- package/content/components/floatbutton.md +52 -0
- package/content/components/form-v2.md +41 -0
- package/content/components/form.md +60 -0
- package/content/components/grid.md +51 -0
- package/content/components/highlight-v2.md +39 -0
- package/content/components/highlight.md +46 -0
- package/content/components/hovercard.md +51 -0
- package/content/components/icon.md +50 -0
- package/content/components/imagecropper.md +45 -0
- package/content/components/img.md +56 -0
- package/content/components/infinitescroll-v2.md +40 -0
- package/content/components/infinitescroll.md +54 -0
- package/content/components/input.md +65 -0
- package/content/components/inputnumber.md +58 -0
- package/content/components/inview.md +56 -0
- package/content/components/jsonschemaform.md +53 -0
- package/content/components/jsonviewer-v2.md +39 -0
- package/content/components/jsonviewer.md +49 -0
- package/content/components/kanban.md +46 -0
- package/content/components/label.md +48 -0
- package/content/components/layout.md +54 -0
- package/content/components/layoutcontent.md +43 -0
- package/content/components/layoutheader.md +43 -0
- package/content/components/layoutsider.md +43 -0
- package/content/components/link.md +52 -0
- package/content/components/list.md +44 -0
- package/content/components/loading.md +45 -0
- package/content/components/logviewer-v2.md +39 -0
- package/content/components/logviewer.md +53 -0
- package/content/components/markdown.md +51 -0
- package/content/components/markdowneditor.md +47 -0
- package/content/components/math.md +42 -0
- package/content/components/mentions-v2.md +39 -0
- package/content/components/mentions.md +52 -0
- package/content/components/menu.md +56 -0
- package/content/components/menubar.md +44 -0
- package/content/components/messagebubble.md +50 -0
- package/content/components/modal.md +59 -0
- package/content/components/navmenu.md +47 -0
- package/content/components/notification.md +51 -0
- package/content/components/pageheader.md +53 -0
- package/content/components/pagination.md +49 -0
- package/content/components/paragraph.md +45 -0
- package/content/components/passwordinput.md +57 -0
- package/content/components/pininput-v2.md +39 -0
- package/content/components/pininput.md +50 -0
- package/content/components/pipeline.md +49 -0
- package/content/components/popconfirm.md +58 -0
- package/content/components/popover.md +61 -0
- package/content/components/progressbar.md +50 -0
- package/content/components/prompttemplate.md +49 -0
- package/content/components/qrcode.md +50 -0
- package/content/components/radiogroup.md +53 -0
- package/content/components/rate.md +53 -0
- package/content/components/reasoningblock.md +47 -0
- package/content/components/relationgraph.md +52 -0
- package/content/components/resizable.md +53 -0
- package/content/components/result.md +49 -0
- package/content/components/scrollbar.md +49 -0
- package/content/components/searchinput.md +51 -0
- package/content/components/segmentedcontrol.md +59 -0
- package/content/components/select-searchable.md +47 -0
- package/content/components/select.md +66 -0
- package/content/components/sessionlist.md +52 -0
- package/content/components/sheetgrid.md +44 -0
- package/content/components/skeleton.md +55 -0
- package/content/components/slidecanvas.md +44 -0
- package/content/components/slider.md +62 -0
- package/content/components/sortablelist.md +39 -0
- package/content/components/space.md +52 -0
- package/content/components/sparkline.md +52 -0
- package/content/components/statcard-countdown.md +39 -0
- package/content/components/statcard.md +56 -0
- package/content/components/steps.md +48 -0
- package/content/components/switch.md +50 -0
- package/content/components/tabbar.md +45 -0
- package/content/components/table-v2.md +40 -0
- package/content/components/table.md +66 -0
- package/content/components/tabs.md +56 -0
- package/content/components/tag.md +51 -0
- package/content/components/tagsinput-v2.md +39 -0
- package/content/components/tagsinput.md +54 -0
- package/content/components/text.md +45 -0
- package/content/components/textarea.md +57 -0
- package/content/components/themeswitch.md +69 -0
- package/content/components/timeline.md +50 -0
- package/content/components/title.md +45 -0
- package/content/components/toast.md +52 -0
- package/content/components/toggle-togglegroup.md +52 -0
- package/content/components/togglegroup.md +47 -0
- package/content/components/toolcallcard.md +51 -0
- package/content/components/tooltip.md +50 -0
- package/content/components/tour.md +50 -0
- package/content/components/transfer.md +52 -0
- package/content/components/tree-v2.md +39 -0
- package/content/components/tree.md +59 -0
- package/content/components/treeselect.md +54 -0
- package/content/components/typography.md +51 -0
- package/content/components/videoplayer.md +52 -0
- package/content/components/virtuallist.md +52 -0
- package/content/components/virtualtable-v2.md +39 -0
- package/content/components/virtualtable.md +55 -0
- package/content/components/watermark.md +53 -0
- package/content/components/wave.md +43 -0
- package/content/guides/ai-chat-family.md +24 -0
- package/content/guides/choose.md +67 -0
- package/content/guides/component-model.md +32 -0
- package/content/guides/component-standards.md +123 -0
- package/{docs/components.md → content/guides/components-guide.md} +153 -7
- package/{docs/custom-components.md → content/guides/custom-component.md} +70 -55
- package/{docs/data.md → content/guides/data-guide.md} +5 -2
- package/content/guides/file-preview-family.md +18 -0
- package/{docs → content/guides}/frontend.md +122 -52
- package/content/guides/layout-choice.md +64 -0
- package/{docs/layout.md → content/guides/layout-guide.md} +12 -8
- package/{docs/frontend-middleware.md → content/guides/middleware.md} +34 -3
- package/{docs/mobile.md → content/guides/mobile-guide.md} +20 -24
- package/content/guides/page-building.md +98 -0
- package/content/guides/production.md +37 -0
- package/content/guides/quality.md +60 -0
- package/{docs/realtime.md → content/guides/realtime-guide.md} +6 -3
- package/content/guides/render-only.md +44 -0
- package/{docs/saas.md → content/guides/saas-guide.md} +8 -5
- package/{docs/server.md → content/guides/server-guide.md} +5 -2
- package/content/guides/start.md +41 -0
- package/{docs → content/guides}/styling.md +5 -1
- package/{docs/frontend-ui-dom.md → content/guides/ui-dom-guide.md} +7 -1
- package/content/index.json +4344 -0
- package/content/index.md +181 -0
- package/content/layout/align.md +20 -0
- package/content/layout/anchor.md +19 -0
- package/content/layout/app-shell.md +23 -0
- package/content/layout/border.md +20 -0
- package/content/layout/center.md +19 -0
- package/content/layout/cluster.md +19 -0
- package/content/layout/container.md +19 -0
- package/content/layout/fill.md +19 -0
- package/content/layout/grid.md +19 -0
- package/content/layout/hidden.md +22 -0
- package/content/layout/layer.md +19 -0
- package/content/layout/position.md +22 -0
- package/content/layout/row.md +23 -0
- package/content/layout/safe-area.md +20 -0
- package/content/layout/scroll.md +21 -0
- package/content/layout/spacing.md +22 -0
- package/content/layout/split.md +19 -0
- package/content/layout/stack.md +19 -0
- package/content/layout/surface.md +23 -0
- package/content/layout/text.md +22 -0
- package/content/patterns/app-shell.md +34 -0
- package/content/patterns/dashboard.md +36 -0
- package/content/patterns/data-screen.md +30 -0
- package/content/patterns/detail-page.md +31 -0
- package/content/patterns/docs.md +34 -0
- package/content/patterns/focus-task.md +34 -0
- package/content/patterns/landing.md +35 -0
- package/content/patterns/list-page.md +32 -0
- package/content/patterns/mobile.md +31 -0
- package/content/patterns/settings-page.md +33 -0
- package/content/patterns/workspace.md +32 -0
- package/dist/cli/apps-typecheck.test.d.ts +11 -0
- package/dist/cli/docs.d.ts +2 -0
- package/dist/cli/docs.mjs +10961 -0
- package/dist/cli/home-flash.test.d.ts +1 -0
- package/dist/{components → client/components}/Accordion/Accordion.d.ts +1 -1
- package/dist/client/components/ActionSheet/ActionSheet.d.ts +37 -0
- package/dist/{components → client/components}/Affix/Affix.d.ts +1 -1
- package/dist/{components → client/components}/AiChat/AiChat.d.ts +3 -3
- package/dist/{components → client/components}/Alert/Alert.d.ts +1 -1
- package/dist/{components → client/components}/AlertGroup/AlertGroup.d.ts +1 -1
- package/dist/{components → client/components}/Anchor/Anchor.d.ts +1 -1
- package/dist/client/components/AppShell/AppShell.d.ts +55 -0
- package/dist/{components → client/components}/ApprovalCard/ApprovalCard.d.ts +2 -2
- package/dist/{components → client/components}/AspectRatio/AspectRatio.d.ts +1 -1
- package/dist/{components → client/components}/AuthPage/AuthPage.d.ts +2 -2
- package/dist/{components → client/components}/AutoComplete/AutoComplete.d.ts +1 -1
- package/dist/{components → client/components}/Avatar/Avatar.d.ts +1 -1
- package/dist/{components → client/components}/AvatarGroup/AvatarGroup.d.ts +1 -1
- package/dist/{components → client/components}/BackTop/BackTop.d.ts +1 -1
- package/dist/{components → client/components}/Badge/Badge.d.ts +1 -1
- package/dist/{components → client/components}/Breadcrumb/Breadcrumb.d.ts +1 -1
- package/dist/{components → client/components}/Button/Button.d.ts +1 -1
- package/dist/{components → client/components}/Calendar/Calendar.d.ts +1 -1
- package/dist/{components → client/components}/Card/Card.d.ts +1 -1
- package/dist/{components → client/components}/Carousel/Carousel.d.ts +1 -1
- package/dist/{components → client/components}/Cascader/Cascader.d.ts +1 -1
- package/dist/{components → client/components}/Chart/Chart.d.ts +1 -1
- package/dist/{components → client/components}/Chart/chart-utils.d.ts +5 -1
- package/dist/{components → client/components}/ChatInput/ChatInput.d.ts +7 -7
- package/dist/{components → client/components}/Checkbox/Checkbox.d.ts +1 -1
- package/dist/{components → client/components}/CheckboxGroup/CheckboxGroup.d.ts +1 -1
- package/dist/{components → client/components}/CitationCard/CitationCard.d.ts +3 -3
- package/dist/{components → client/components}/CodeBlock/CodeBlock.d.ts +1 -1
- package/dist/client/components/CodeEditor/CodeEditor.d.ts +18 -0
- package/dist/{components → client/components}/Collapse/Collapse.d.ts +1 -1
- package/dist/{components → client/components}/ColorPicker/ColorPicker.d.ts +1 -1
- package/dist/{components → client/components}/Command/Command.d.ts +1 -1
- package/dist/{components → client/components}/Confirm/Confirm.d.ts +2 -7
- package/dist/{components → client/components}/ContextMenu/ContextMenu.d.ts +1 -1
- package/dist/{components → client/components}/CopyButton/CopyButton.d.ts +1 -1
- package/dist/{components → client/components}/DatePicker/DatePicker.d.ts +2 -2
- package/dist/{components → client/components}/Descriptions/Descriptions.d.ts +1 -1
- package/dist/{components → client/components}/DiffView/DiffView.d.ts +1 -1
- package/dist/{components → client/components}/Divider/Divider.d.ts +1 -1
- package/dist/{components → client/components}/Drawer/Drawer.d.ts +1 -1
- package/dist/{components → client/components}/Dropdown/Dropdown.d.ts +1 -1
- package/dist/client/components/Editor/Editor.d.ts +14 -0
- package/dist/client/components/Editor/edit-events.d.ts +27 -0
- package/dist/client/components/Editor/model/apply.d.ts +23 -0
- package/dist/client/components/Editor/model/diff.d.ts +25 -0
- package/dist/client/components/Editor/model/dom.d.ts +27 -0
- package/dist/client/components/Editor/model/history.d.ts +21 -0
- package/dist/client/components/Editor/model/html.d.ts +16 -0
- package/dist/client/components/Editor/model/inverse.d.ts +20 -0
- package/dist/client/components/Editor/model/types.d.ts +116 -0
- package/dist/client/components/Editor/tools/table.d.ts +10 -0
- package/dist/{components → client/components}/Editor/tools/toolbar.d.ts +2 -2
- package/dist/client/components/Editor/tools/types.d.ts +40 -0
- package/dist/{components → client/components}/EmptyState/EmptyState.d.ts +1 -1
- package/dist/client/components/ExportCSV/ExportCSV.d.ts +30 -0
- package/dist/{components → client/components}/Field/Field.d.ts +1 -1
- package/dist/client/components/FilePreview/FilePreview.d.ts +42 -0
- package/dist/client/components/FilePreview/markdown.d.ts +23 -0
- package/dist/client/components/FileTree/FileTree.d.ts +57 -0
- package/dist/{components → client/components}/FileUpload/FileUpload.d.ts +1 -1
- package/dist/{components → client/components}/FloatButton/FloatButton.d.ts +1 -1
- package/dist/{components → client/components}/Form/Form.d.ts +1 -1
- package/dist/{components → client/components}/Grid/Grid.d.ts +1 -1
- package/dist/{components → client/components}/Highlight/Highlight.d.ts +1 -1
- package/dist/{components → client/components}/HoverCard/HoverCard.d.ts +5 -4
- package/dist/{components → client/components}/Icon/Icon.d.ts +2 -2
- package/dist/client/components/ImageCropper/ImageCropper.d.ts +17 -0
- package/dist/{components → client/components}/Img/Img.d.ts +1 -1
- package/dist/{components → client/components}/InView/InView.d.ts +1 -1
- package/dist/{components → client/components}/InfiniteScroll/InfiniteScroll.d.ts +1 -1
- package/dist/{components → client/components}/Input/Input.d.ts +1 -1
- package/dist/{components → client/components}/InputNumber/InputNumber.d.ts +1 -1
- package/dist/{components → client/components}/JSONViewer/JSONViewer.d.ts +1 -1
- package/dist/{components → client/components}/JsonSchemaForm/JsonSchemaForm.d.ts +3 -3
- package/dist/{components → client/components}/Kanban/Kanban.d.ts +1 -1
- package/dist/{components → client/components}/Label/Label.d.ts +1 -1
- package/dist/{components → client/components}/Layout/Layout.d.ts +1 -1
- package/dist/{components → client/components}/Link/Link.d.ts +1 -1
- package/dist/{components → client/components}/List/List.d.ts +1 -1
- package/dist/{components → client/components}/Loading/Loading.d.ts +1 -1
- package/dist/{components → client/components}/LogViewer/LogViewer.d.ts +1 -1
- package/dist/{components → client/components}/Markdown/Markdown.d.ts +1 -1
- package/dist/client/components/MarkdownEditor/MarkdownEditor.d.ts +18 -0
- package/dist/client/components/Math/Math.d.ts +15 -0
- package/dist/{components → client/components}/Mentions/Mentions.d.ts +1 -1
- package/dist/{components → client/components}/Menu/Menu.d.ts +1 -1
- package/dist/{components → client/components}/Menubar/Menubar.d.ts +1 -1
- package/dist/{components → client/components}/MessageBubble/MessageBubble.d.ts +1 -1
- package/dist/{components → client/components}/Modal/Modal.d.ts +1 -1
- package/dist/{components → client/components}/NavMenu/NavMenu.d.ts +2 -2
- package/dist/{components → client/components}/Notification/Notification.d.ts +7 -2
- package/dist/client/components/OfficeEditor/ai/ai-bridge.d.ts +39 -0
- package/dist/client/components/OfficeEditor/model/apply.d.ts +25 -0
- package/dist/client/components/OfficeEditor/model/types.d.ts +224 -0
- package/dist/{components → client/components}/PageHeader/PageHeader.d.ts +1 -1
- package/dist/{components → client/components}/Pagination/Pagination.d.ts +1 -1
- package/dist/{components → client/components}/PasswordInput/PasswordInput.d.ts +1 -1
- package/dist/{components → client/components}/PinInput/PinInput.d.ts +1 -1
- package/dist/{components → client/components}/Pipeline/Pipeline.d.ts +1 -1
- package/dist/{components → client/components}/Popconfirm/Popconfirm.d.ts +2 -2
- package/dist/{components → client/components}/Popover/Popover.d.ts +5 -4
- package/dist/{components → client/components}/ProgressBar/ProgressBar.d.ts +1 -1
- package/dist/client/components/PromptTemplate/PromptTemplate.d.ts +37 -0
- package/dist/{components → client/components}/QRCode/QRCode.d.ts +1 -1
- package/dist/{components → client/components}/RadioGroup/RadioGroup.d.ts +1 -1
- package/dist/{components → client/components}/Rate/Rate.d.ts +1 -1
- package/dist/{components → client/components}/ReasoningBlock/ReasoningBlock.d.ts +3 -3
- package/dist/client/components/RelationGraph/RelationGraph.d.ts +59 -0
- package/dist/{components → client/components}/Resizable/Resizable.d.ts +1 -1
- package/dist/{components → client/components}/Result/Result.d.ts +1 -1
- package/dist/{components → client/components}/Scrollbar/Scrollbar.d.ts +1 -1
- package/dist/{components → client/components}/SearchInput/SearchInput.d.ts +1 -1
- package/dist/{components → client/components}/SegmentedControl/SegmentedControl.d.ts +1 -1
- package/dist/{components → client/components}/Select/Select.d.ts +1 -1
- package/dist/{components → client/components}/SessionList/SessionList.d.ts +3 -3
- package/dist/client/components/SheetGrid/SheetGrid.d.ts +30 -0
- package/dist/{components → client/components}/Skeleton/Skeleton.d.ts +1 -1
- package/dist/client/components/SlideCanvas/SlideCanvas.d.ts +28 -0
- package/dist/client/components/Slider/Slider.d.ts +27 -0
- package/dist/client/components/SortableList/SortableList.d.ts +23 -0
- package/dist/{components → client/components}/Space/Space.d.ts +1 -1
- package/dist/{components → client/components}/Sparkline/Sparkline.d.ts +1 -1
- package/dist/{components → client/components}/StatCard/StatCard.d.ts +1 -1
- package/dist/{components → client/components}/Steps/Steps.d.ts +1 -1
- package/dist/{components → client/components}/Switch/Switch.d.ts +1 -1
- package/dist/client/components/TabBar/TabBar.d.ts +35 -0
- package/dist/{components → client/components}/Table/Table.d.ts +7 -1
- package/dist/client/components/Tabs/Tabs.d.ts +22 -0
- package/dist/{components → client/components}/Tag/Tag.d.ts +1 -1
- package/dist/{components → client/components}/TagsInput/TagsInput.d.ts +1 -1
- package/dist/{components → client/components}/Textarea/Textarea.d.ts +1 -1
- package/dist/{components → client/components}/ThemeSwitch/ThemeSwitch.d.ts +1 -1
- package/dist/{components → client/components}/Timeline/Timeline.d.ts +1 -1
- package/dist/{components → client/components}/Toast/Toast.d.ts +1 -1
- package/dist/{components → client/components}/ToggleGroup/ToggleGroup.d.ts +1 -1
- package/dist/{components → client/components}/ToolCallCard/ToolCallCard.d.ts +2 -2
- package/dist/{components → client/components}/Tooltip/Tooltip.d.ts +4 -3
- package/dist/{components → client/components}/Tour/Tour.d.ts +1 -1
- package/dist/{components → client/components}/Transfer/Transfer.d.ts +1 -1
- package/dist/{components → client/components}/Tree/Tree.d.ts +5 -1
- package/dist/{components → client/components}/TreeSelect/TreeSelect.d.ts +5 -1
- package/dist/{components → client/components}/Typography/Typography.d.ts +1 -1
- package/dist/client/components/VideoPlayer/VideoPlayer.d.ts +25 -0
- package/dist/{components → client/components}/VirtualList/VirtualList.d.ts +1 -1
- package/dist/{components → client/components}/VirtualTable/VirtualTable.d.ts +1 -1
- package/dist/{components → client/components}/Watermark/Watermark.d.ts +1 -1
- package/dist/client/components/Wave/Wave.d.ts +15 -0
- package/dist/{components → client/components}/index.d.ts +48 -2
- package/dist/client/components/index.js +57 -0
- package/dist/{components → client/components}/style.css +3554 -1896
- package/dist/{layout → client/layout}/weifuwu-layout.css +60 -6
- package/dist/client/office/docx.d.ts +33 -0
- package/dist/client/office/pptx.d.ts +24 -0
- package/dist/client/office/xlsx.d.ts +25 -0
- package/dist/client/office/xml-serialize.d.ts +18 -0
- package/dist/client/office/xml.d.ts +21 -0
- package/dist/client/office/zip.d.ts +21 -0
- package/dist/client/vdom/browser/Browser.d.ts +73 -0
- package/dist/client/vdom/browser/create-client-browser.d.ts +11 -0
- package/dist/client/vdom/commands.d.ts +19 -0
- package/dist/client/vdom/context/UIContext.d.ts +61 -0
- package/dist/client/vdom/context/data.d.ts +17 -0
- package/dist/client/vdom/core/async-guard.d.ts +20 -0
- package/dist/client/vdom/core/build.d.ts +36 -0
- package/dist/client/vdom/core/command/create.d.ts +25 -0
- package/dist/client/vdom/core/command/index.d.ts +15 -0
- package/dist/client/vdom/core/command/insert.d.ts +32 -0
- package/dist/client/vdom/core/command/lifecycle.d.ts +47 -0
- package/dist/client/vdom/core/command/props.d.ts +22 -0
- package/dist/client/vdom/core/diff/attrs.d.ts +10 -0
- package/dist/client/vdom/core/diff/children.d.ts +29 -0
- package/dist/client/vdom/core/diff/cleanup.d.ts +44 -0
- package/dist/client/vdom/core/diff/index.d.ts +22 -0
- package/dist/client/vdom/core/diff/output.d.ts +30 -0
- package/dist/client/vdom/core/diff/same.d.ts +22 -0
- package/dist/client/vdom/core/field/attributes.d.ts +15 -0
- package/dist/client/vdom/core/field/events.d.ts +54 -0
- package/dist/client/vdom/core/field/index.d.ts +19 -0
- package/dist/client/vdom/core/field/key.d.ts +16 -0
- package/dist/client/vdom/core/field/props.d.ts +15 -0
- package/dist/client/vdom/core/field/ref.d.ts +38 -0
- package/dist/client/vdom/core/field/style.d.ts +17 -0
- package/dist/client/vdom/core/node/children.d.ts +20 -0
- package/dist/client/vdom/core/node/component.d.ts +93 -0
- package/dist/client/vdom/core/node/fragment.d.ts +14 -0
- package/dist/client/vdom/core/node/hole.d.ts +22 -0
- package/dist/client/vdom/core/node/index.d.ts +35 -0
- package/dist/client/vdom/core/node/keyed.d.ts +64 -0
- package/dist/client/vdom/core/node/native.d.ts +20 -0
- package/dist/client/vdom/core/node/portal.d.ts +11 -0
- package/dist/client/vdom/core/patch/fields.d.ts +15 -0
- package/dist/client/vdom/core/patch/index.d.ts +51 -0
- package/dist/client/vdom/core/patch/processors.d.ts +75 -0
- package/dist/client/vdom/core/patch/state-machine.d.ts +38 -0
- package/dist/client/vdom/core/patch/verify.d.ts +17 -0
- package/dist/client/vdom/core/router.d.ts +31 -0
- package/dist/client/vdom/core/serve.d.ts +75 -0
- package/dist/client/vdom/core/ssr/absorb.d.ts +53 -0
- package/dist/client/vdom/core/ssr/html.d.ts +32 -0
- package/dist/client/vdom/core/ssr/index.d.ts +25 -0
- package/dist/client/vdom/core/transform/component.d.ts +23 -0
- package/dist/client/vdom/core/transform/element.d.ts +21 -0
- package/dist/client/vdom/core/transform/fragment.d.ts +21 -0
- package/dist/client/vdom/core/transform/hole.d.ts +13 -0
- package/dist/client/vdom/core/transform/index.d.ts +46 -0
- package/dist/client/vdom/core/transform/states.d.ts +22 -0
- package/dist/client/vdom/core/transform/table.d.ts +28 -0
- package/dist/client/vdom/core/transform/text.d.ts +10 -0
- package/dist/client/vdom/core/vnode.d.ts +45 -0
- package/dist/client/vdom/dev/effect-guard.d.ts +8 -0
- package/dist/client/vdom/hooks/ai-stream.d.ts +46 -0
- package/dist/client/vdom/hooks/basic.d.ts +42 -0
- package/dist/client/vdom/hooks/chat.d.ts +91 -0
- package/dist/client/vdom/hooks/controlled.d.ts +27 -0
- package/dist/client/vdom/hooks/drag-media.d.ts +52 -0
- package/dist/client/vdom/hooks/env.d.ts +119 -0
- package/dist/client/vdom/hooks/input.d.ts +43 -0
- package/dist/client/vdom/hooks/observe.d.ts +60 -0
- package/dist/client/vdom/hooks/popup-manager.d.ts +92 -0
- package/dist/client/vdom/hooks/popup.d.ts +52 -0
- package/dist/client/vdom/hooks/stable.d.ts +45 -0
- package/dist/client/vdom/index.d.ts +67 -0
- package/dist/client/vdom/index.js +8 -0
- package/dist/client/vdom/jsx-runtime.d.ts +28 -0
- package/dist/client/vdom/jsx-runtime.js +1 -0
- package/dist/client/vdom/middlewares/api.d.ts +38 -0
- package/dist/client/vdom/middlewares/auth-i18n.d.ts +66 -0
- package/dist/client/vdom/middlewares/ws.d.ts +37 -0
- package/dist/client/vdom/store.d.ts +49 -0
- package/dist/client/vdom/testing.d.ts +46 -0
- package/dist/client/vdom/testing.js +2 -0
- package/dist/dev/index.d.ts +12 -0
- package/dist/dev/index.js +4 -4
- package/dist/{ai → server/ai}/contracts.d.ts +1 -1
- package/dist/{ai → server/ai}/index.d.ts +2 -2
- package/dist/{ai → server/ai}/types.d.ts +1 -1
- package/dist/{core → server/core}/router.d.ts +2 -4
- package/dist/{db → server/db}/contracts.d.ts +1 -1
- package/dist/server/db/postgres-server.d.ts +37 -0
- package/dist/server/db/redis-server.d.ts +32 -0
- package/dist/server/db/server.d.ts +30 -0
- package/dist/server/db/test-servers.d.ts +21 -0
- package/dist/{email → server/email}/contracts.d.ts +1 -1
- package/dist/{index.js → server/index.js} +3147 -2462
- package/dist/{ui → server/ui}/index.d.ts +2 -2
- package/dist/{user → server/user}/token.d.ts +1 -1
- package/dist/shared/router/trie.d.ts +61 -0
- package/docs/components-map.md +16 -4
- package/docs/style-guide.md +14 -2
- package/examples/apps/admin/README.md +23 -0
- package/examples/apps/admin/api.ts +27 -0
- package/examples/apps/admin/app.tsx +144 -0
- package/examples/apps/admin/main.tsx +8 -0
- package/examples/apps/admin/server.ts +37 -0
- package/examples/apps/auth/README.md +23 -0
- package/examples/apps/auth/api.ts +49 -0
- package/examples/apps/auth/app.tsx +137 -0
- package/examples/apps/auth/main.tsx +8 -0
- package/examples/apps/auth/server.ts +37 -0
- package/examples/apps/multi/README.md +23 -0
- package/examples/apps/multi/app.tsx +83 -0
- package/examples/apps/multi/main.tsx +8 -0
- package/examples/apps/multi/server.ts +33 -0
- package/examples/apps/todo/README.md +23 -0
- package/examples/apps/todo/api.ts +26 -0
- package/examples/apps/todo/app.tsx +128 -0
- package/examples/apps/todo/main.tsx +9 -0
- package/examples/apps/todo/server.ts +39 -0
- package/examples/hello-world/README.md +9 -0
- package/examples/hello-world/client.ts +14 -0
- package/examples/hello-world/routes.tsx +26 -0
- package/examples/hello-world/server.ts +46 -0
- package/examples/patterns/AppShell.tsx +224 -0
- package/examples/patterns/Dashboard.tsx +153 -0
- package/examples/patterns/DataScreen.tsx +104 -0
- package/examples/patterns/DetailPage.tsx +79 -0
- package/examples/patterns/Docs.tsx +105 -0
- package/examples/patterns/FocusTask.tsx +67 -0
- package/examples/patterns/Landing.tsx +90 -0
- package/examples/patterns/ListPage.tsx +77 -0
- package/examples/patterns/Mobile.tsx +154 -0
- package/examples/patterns/SettingsPage.tsx +98 -0
- package/examples/patterns/SplitWorkspace.tsx +113 -0
- package/package.json +61 -29
- package/dist/components/Editor/Editor.d.ts +0 -13
- package/dist/components/Editor/tools/format.d.ts +0 -11
- package/dist/components/Editor/tools/table.d.ts +0 -7
- package/dist/components/Editor/tools/types.d.ts +0 -15
- package/dist/components/Slider/Slider.d.ts +0 -19
- package/dist/components/Tabs/Tabs.d.ts +0 -12
- package/dist/components/index.js +0 -15
- package/dist/ui-dom/Confirm.d.ts +0 -8
- package/dist/ui-dom/Notification.d.ts +0 -8
- package/dist/ui-dom/Toast.d.ts +0 -8
- package/dist/ui-dom/ai.d.ts +0 -59
- package/dist/ui-dom/browser.d.ts +0 -10
- package/dist/ui-dom/debug.d.ts +0 -21
- package/dist/ui-dom/hooks/chat.d.ts +0 -11
- package/dist/ui-dom/hooks/events.d.ts +0 -30
- package/dist/ui-dom/hooks/external.d.ts +0 -20
- package/dist/ui-dom/hooks/index.d.ts +0 -29
- package/dist/ui-dom/hooks/input.d.ts +0 -33
- package/dist/ui-dom/hooks/media.d.ts +0 -17
- package/dist/ui-dom/hooks/popup.d.ts +0 -30
- package/dist/ui-dom/hooks/stable.d.ts +0 -35
- package/dist/ui-dom/hooks/types.d.ts +0 -77
- package/dist/ui-dom/i18n.d.ts +0 -31
- package/dist/ui-dom/index.d.ts +0 -47
- package/dist/ui-dom/index.js +0 -41
- package/dist/ui-dom/jsx-runtime.d.ts +0 -4
- package/dist/ui-dom/jsx-runtime.js +0 -1
- package/dist/ui-dom/locale/en_US.d.ts +0 -55
- package/dist/ui-dom/locale/zh_CN.d.ts +0 -55
- package/dist/ui-dom/middleware/api.d.ts +0 -91
- package/dist/ui-dom/middleware/auth.d.ts +0 -30
- package/dist/ui-dom/middleware/ws.d.ts +0 -33
- package/dist/ui-dom/motion.d.ts +0 -8
- package/dist/ui-dom/popup-tracker.d.ts +0 -36
- package/dist/ui-dom/popup.d.ts +0 -42
- package/dist/ui-dom/store.d.ts +0 -24
- package/dist/ui-dom/testing.d.ts +0 -68
- package/dist/ui-dom/testing.js +0 -7
- package/dist/ui-dom/types.d.ts +0 -632
- package/dist/ui-dom/use-chat.d.ts +0 -95
- package/dist/ui-dom/vdom3/README.d.ts +0 -32
- package/dist/ui-dom/vdom3/app.d.ts +0 -20
- package/dist/ui-dom/vdom3/audit.d.ts +0 -29
- package/dist/ui-dom/vdom3/build.d.ts +0 -20
- package/dist/ui-dom/vdom3/commands.d.ts +0 -21
- package/dist/ui-dom/vdom3/comp-index.d.ts +0 -18
- package/dist/ui-dom/vdom3/delegate.d.ts +0 -48
- package/dist/ui-dom/vdom3/events.d.ts +0 -17
- package/dist/ui-dom/vdom3/index.d.ts +0 -42
- package/dist/ui-dom/vdom3/jsx.d.ts +0 -32
- package/dist/ui-dom/vdom3/record.d.ts +0 -16
- package/dist/ui-dom/vdom3/registry.d.ts +0 -30
- package/dist/ui-dom/vdom3/render.d.ts +0 -39
- package/dist/ui-dom/vdom3/replay.d.ts +0 -28
- package/dist/ui-dom/vdom3/root.d.ts +0 -24
- package/dist/ui-dom/vdom3/router.d.ts +0 -31
- package/dist/ui-dom/vdom3/scheduler.d.ts +0 -23
- package/dist/ui-dom/vdom3/ssr.d.ts +0 -27
- package/dist/ui-dom/vdom3/sync.d.ts +0 -22
- package/dist/ui-dom/vdom3/types.d.ts +0 -173
- package/dist/ui-dom/vdom3/ui.d.ts +0 -16
- package/dist/ui-dom/vdom3.js +0 -41
- package/dist/ui-dom/vnode.d.ts +0 -13
- /package/dist/{make-executable-schema.test.d.ts → cli/content-sync.test.d.ts} +0 -0
- /package/dist/{ui-dom/testing.test.d.ts → cli/docs-cli.test.d.ts} +0 -0
- /package/dist/{components → client/components}/CodeBlock/highlight.d.ts +0 -0
- /package/dist/{components → client/components}/DatePicker/calendar-utils.d.ts +0 -0
- /package/dist/{components → client/components}/DiffView/diff-utils.d.ts +0 -0
- /package/dist/{components → client/components}/Markdown/parser.d.ts +0 -0
- /package/dist/{components → client/components}/Pipeline/dag-utils.d.ts +0 -0
- /package/dist/{components → client/components}/QRCode/qr.d.ts +0 -0
- /package/dist/{components → client/components}/Sparkline/sparkline-utils.d.ts +0 -0
- /package/dist/{ai → server/ai}/agent.d.ts +0 -0
- /package/dist/{ai → server/ai}/client.d.ts +0 -0
- /package/dist/{ai → server/ai}/sse.d.ts +0 -0
- /package/dist/{core → server/core}/serve.d.ts +0 -0
- /package/dist/{core → server/core}/ws.d.ts +0 -0
- /package/dist/{db → server/db}/errors.d.ts +0 -0
- /package/dist/{db → server/db}/memory-redis.d.ts +0 -0
- /package/dist/{db → server/db}/memory-sql.d.ts +0 -0
- /package/dist/{db → server/db}/postgres/connection.d.ts +0 -0
- /package/dist/{db → server/db}/postgres/pool.d.ts +0 -0
- /package/dist/{db → server/db}/postgres/protocol.d.ts +0 -0
- /package/dist/{db → server/db}/postgres/schema.d.ts +0 -0
- /package/dist/{db → server/db}/query-builder.d.ts +0 -0
- /package/dist/{db → server/db}/query.d.ts +0 -0
- /package/dist/{db → server/db}/redis/client.d.ts +0 -0
- /package/dist/{db → server/db}/redis/commands.d.ts +0 -0
- /package/dist/{db → server/db}/redis/connection.d.ts +0 -0
- /package/dist/{db → server/db}/redis/pipeline.d.ts +0 -0
- /package/dist/{db → server/db}/redis/pool.d.ts +0 -0
- /package/dist/{db → server/db}/redis/resp.d.ts +0 -0
- /package/dist/{db → server/db}/redis/subscriber.d.ts +0 -0
- /package/dist/{db → server/db}/sql-parser.d.ts +0 -0
- /package/dist/{email → server/email}/index.d.ts +0 -0
- /package/dist/{email → server/email}/smtp.d.ts +0 -0
- /package/dist/{graphql.d.ts → server/graphql.d.ts} +0 -0
- /package/dist/{index.d.ts → server/index.d.ts} +0 -0
- /package/dist/{make-executable-schema.d.ts → server/make-executable-schema.d.ts} +0 -0
- /package/dist/{messager → server/messager}/index.d.ts +0 -0
- /package/dist/{middleware → server/middleware}/cors.d.ts +0 -0
- /package/dist/{middleware → server/middleware}/rate-limit.d.ts +0 -0
- /package/dist/{middleware → server/middleware}/static.d.ts +0 -0
- /package/dist/{postgres → server/postgres}/client.d.ts +0 -0
- /package/dist/{postgres → server/postgres}/index.d.ts +0 -0
- /package/dist/{postgres → server/postgres}/types.d.ts +0 -0
- /package/dist/{queue → server/queue}/index.d.ts +0 -0
- /package/dist/{redis → server/redis}/client.d.ts +0 -0
- /package/dist/{redis → server/redis}/index.d.ts +0 -0
- /package/dist/{redis → server/redis}/types.d.ts +0 -0
- /package/dist/{request.d.ts → server/request.d.ts} +0 -0
- /package/dist/{response.d.ts → server/response.d.ts} +0 -0
- /package/dist/{scheduler → server/scheduler}/cron.d.ts +0 -0
- /package/dist/{scheduler → server/scheduler}/index.d.ts +0 -0
- /package/dist/{types.d.ts → server/types.d.ts} +0 -0
- /package/dist/{ui → server/ui}/html-safe.d.ts +0 -0
- /package/dist/{user → server/user}/index.d.ts +0 -0
- /package/dist/{user → server/user}/password.d.ts +0 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import type { Component } from 'weifuwu/vdom'
|
|
2
|
+
import {Title,Paragraph, Anchor, BackTop, Breadcrumb, Button, CodeBlock, Divider, Icon, Tag, Space, } from 'weifuwu/components'
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
// ─────────────────────────────────────────────────────────────
|
|
6
|
+
// 模式 2:文档站(Docs Site)
|
|
7
|
+
//
|
|
8
|
+
// 顶部导航 + 左侧章节目录(Anchor 滚动跟随)+ 右侧正文(prose 排版)。
|
|
9
|
+
// 100% 原语 + 组件:wf-row / wf-gap-* / wf-prose / wf-container / wf-border-t
|
|
10
|
+
// Anchor(目录)、Breadcrumb(面包屑)、CodeBlock(代码)、Tag(版本)
|
|
11
|
+
// ─────────────────────────────────────────────────────────────
|
|
12
|
+
|
|
13
|
+
const SECTIONS = [
|
|
14
|
+
{ id: 'intro', title: '快速开始' },
|
|
15
|
+
{ id: 'install', title: '安装' },
|
|
16
|
+
{ id: 'usage', title: '基本用法' },
|
|
17
|
+
{ id: 'theme', title: '主题定制' },
|
|
18
|
+
{ id: 'ssr', title: '服务端渲染' },
|
|
19
|
+
{ id: 'api', title: 'API 参考' },
|
|
20
|
+
]
|
|
21
|
+
|
|
22
|
+
export const Docs: Component = async (_init, ctx) => {
|
|
23
|
+
let mainEl: HTMLElement | undefined
|
|
24
|
+
|
|
25
|
+
return async () => (
|
|
26
|
+
<div class="wf-stack wf-gap-none" style={{ minHeight: 'calc(100vh - 48px)' }}>
|
|
27
|
+
{/* 顶部导航 */}
|
|
28
|
+
<header class="wf-row wf-p-md wf-gap-lg wf-border-b wf-between">
|
|
29
|
+
<Space align="center">
|
|
30
|
+
<Icon name="book-open" size={18} />
|
|
31
|
+
<b class="wf-text-bold">weifuwu 文档</b>
|
|
32
|
+
<span class="wf-text-tertiary wf-text-sm">布局原语指南</span>
|
|
33
|
+
</Space>
|
|
34
|
+
<Space>
|
|
35
|
+
<Button size="sm" variant="ghost"><Icon name="github" size={14} /> GitHub</Button>
|
|
36
|
+
<Tag variant="primary">v0.69.0</Tag>
|
|
37
|
+
</Space>
|
|
38
|
+
</header>
|
|
39
|
+
|
|
40
|
+
{/* 主体:左目录 + 右正文 */}
|
|
41
|
+
<div class="wf-row wf-gap-none wf-fill wf-stretch wf-nowrap">
|
|
42
|
+
<aside class="wf-p-lg wf-border-r wf-sticky" style={{ width: 220, flexShrink: 0 }}>
|
|
43
|
+
<span class="wf-text-tertiary wf-text-sm wf-block wf-mb-sm">目录</span>
|
|
44
|
+
<Anchor
|
|
45
|
+
container={() => mainEl ?? window}
|
|
46
|
+
items={SECTIONS.map((s) => ({ href: `#${s.id}`, title: s.title }))}
|
|
47
|
+
/>
|
|
48
|
+
</aside>
|
|
49
|
+
|
|
50
|
+
<main
|
|
51
|
+
ref={(el: any) => { if (el) mainEl = el }}
|
|
52
|
+
class="wf-fill wf-p-lg wf-scroll"
|
|
53
|
+
>
|
|
54
|
+
<Breadcrumb items={[{ label: '首页' }, { label: '文档' }, { label: '布局指南' }]} />
|
|
55
|
+
<div class="wf-container wf-prose wf-mt-md" style={{ maxWidth: 720 }}>
|
|
56
|
+
<Title level={1}>快速开始</Title>
|
|
57
|
+
<Paragraph>
|
|
58
|
+
在 weifuwu 中,布局由原子原语(wf-stack / wf-row / wf-grid / wf-split…)与组件族组合而成。
|
|
59
|
+
原子原语只做一件事:把元素按某一种空间关系排列。组合它们即可搭建任意界面。
|
|
60
|
+
</Paragraph>
|
|
61
|
+
<CodeBlock lang="html" code={`<div class="wf-stack wf-gap-md">
|
|
62
|
+
<h1>标题</h1>
|
|
63
|
+
<p>纵向堆叠段落</p>
|
|
64
|
+
</div>`} />
|
|
65
|
+
|
|
66
|
+
<Divider />
|
|
67
|
+
|
|
68
|
+
<Title level={2}>安装</Title>
|
|
69
|
+
<Paragraph>安装 weifuwu 并引入布局样式:</Paragraph>
|
|
70
|
+
<CodeBlock lang="bash" code={`npm i weifuwu
|
|
71
|
+
# server.ts
|
|
72
|
+
app.get('/layout.css', (req, ctx) => ctx.ui.css('weifuwu/layout'))`} />
|
|
73
|
+
|
|
74
|
+
<Divider />
|
|
75
|
+
|
|
76
|
+
<Title level={2}>基本用法</Title>
|
|
77
|
+
<Paragraph>
|
|
78
|
+
原子原语可以像乐高一样自由嵌套:外层定空间关系,内层定内容呈现。
|
|
79
|
+
间距、断点、圆角、颜色均以 CSS 变量暴露(--wf-gap-*、--wf-bp-*、--wf-color-*),覆盖变量即换肤。
|
|
80
|
+
</Paragraph>
|
|
81
|
+
|
|
82
|
+
<Divider />
|
|
83
|
+
|
|
84
|
+
<Title level={2}>服务端渲染</Title>
|
|
85
|
+
<Paragraph>布局纯 CSS + 无状态组件,天然适配 SSR——路由级渲染时布局零成本。</Paragraph>
|
|
86
|
+
|
|
87
|
+
<Divider />
|
|
88
|
+
|
|
89
|
+
<Title level={2}>API 参考</Title>
|
|
90
|
+
<Paragraph>原子原语按用途分组:排列(stack/row/grid/split)、定位(fixed/sticky/fill)、装饰(surface/prose)等。</Paragraph>
|
|
91
|
+
</div>
|
|
92
|
+
</main>
|
|
93
|
+
</div>
|
|
94
|
+
|
|
95
|
+
{/* footer */}
|
|
96
|
+
<footer class="wf-cluster wf-p-md wf-border-t">
|
|
97
|
+
<span class="wf-text-tertiary wf-text-sm">weifuwu/layout · 58 布局原语 · 136 工具类 · 开源 MIT</span>
|
|
98
|
+
</footer>
|
|
99
|
+
|
|
100
|
+
{/* 返回顶部(BackTop——组件能力展示:target 指向壳内部滚动容器) */}
|
|
101
|
+
<BackTop target={() => ctx.browser?.query('.wf-fill.wf-scroll') as HTMLElement} />
|
|
102
|
+
</div>
|
|
103
|
+
)
|
|
104
|
+
}
|
|
105
|
+
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { Component } from 'weifuwu/vdom'
|
|
2
|
+
import {Text, Button, Card, Checkbox, Field, Form, Icon, Input, Space, Alert, Divider } from 'weifuwu/components'
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
// ─────────────────────────────────────────────────────────────
|
|
6
|
+
// 模式 8:聚焦任务页(Focus Task)
|
|
7
|
+
//
|
|
8
|
+
// 单任务页面:居中卡片承载表单——登录、注册、支付、审批通用。
|
|
9
|
+
// 100% 原语 + 组件:wf-fill + wf-center(视口居中)+ Card 承载
|
|
10
|
+
// Form / Field / Input / Checkbox / Button(weifuwu 表单全家桶)
|
|
11
|
+
// ─────────────────────────────────────────────────────────────
|
|
12
|
+
|
|
13
|
+
export const FocusTask: Component = async (_init, ctx) => {
|
|
14
|
+
let ok = false
|
|
15
|
+
let errors = {} as Record<string, string>
|
|
16
|
+
const rerender = () => ctx.render()
|
|
17
|
+
|
|
18
|
+
return async () => (
|
|
19
|
+
<div class="wf-fill wf-center wf-p-md wf-bg-secondary" style={{ minHeight: 'calc(100vh - 48px)' }}>
|
|
20
|
+
<Card padding="lg" style={{ width: '400px', maxWidth: '100%' }}>
|
|
21
|
+
<div class="wf-stack wf-gap-md wf-center">
|
|
22
|
+
{/* 品牌区 */}
|
|
23
|
+
<Space direction="vertical" size="sm" align="center">
|
|
24
|
+
<Icon name="lock" size={32} className="wf-text-primary" />
|
|
25
|
+
<b class="wf-text-bold wf-text-lg">登录 weifuwu</b>
|
|
26
|
+
<Text type="secondary" className="wf-text-sm">进入你的工作台</Text>
|
|
27
|
+
</Space>
|
|
28
|
+
|
|
29
|
+
<Form
|
|
30
|
+
validation={{
|
|
31
|
+
username: [{ required: true, message: '请输入用户名' }],
|
|
32
|
+
password: [{ required: true, message: '请输入密码' }],
|
|
33
|
+
}}
|
|
34
|
+
onError={(e) => { errors = e; rerender() }}
|
|
35
|
+
onSubmit={(v) => {
|
|
36
|
+
if (v.username === 'admin' && v.password === 'admin') {
|
|
37
|
+
ok = true; rerender()
|
|
38
|
+
}
|
|
39
|
+
}}
|
|
40
|
+
>
|
|
41
|
+
<div class="wf-stack wf-gap-md">
|
|
42
|
+
<Field label="用户名" required error={errors.username}>
|
|
43
|
+
<Input name="username" placeholder="请输入用户名" />
|
|
44
|
+
</Field>
|
|
45
|
+
<Field label="密码" required error={errors.password}>
|
|
46
|
+
<Input name="password" type="password" placeholder="请输入密码" />
|
|
47
|
+
</Field>
|
|
48
|
+
<div class="wf-row wf-between">
|
|
49
|
+
<Checkbox label="记住我" />
|
|
50
|
+
<Text className="wf-text-primary wf-text-sm wf-pointer">忘记密码?</Text>
|
|
51
|
+
</div>
|
|
52
|
+
<Button type="submit" variant="primary" block size="lg">登 录</Button>
|
|
53
|
+
</div>
|
|
54
|
+
</Form>
|
|
55
|
+
|
|
56
|
+
{ok && <Alert variant="success">登录成功(demo:admin / admin)</Alert>}
|
|
57
|
+
{!ok && (
|
|
58
|
+
<Divider>
|
|
59
|
+
<Text type="secondary" className="wf-text-sm">没有账号?<Text className="wf-text-primary wf-pointer">立即注册</Text></Text>
|
|
60
|
+
</Divider>
|
|
61
|
+
)}
|
|
62
|
+
</div>
|
|
63
|
+
</Card>
|
|
64
|
+
</div>
|
|
65
|
+
)
|
|
66
|
+
}
|
|
67
|
+
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { Component } from 'weifuwu/vdom'
|
|
2
|
+
import {Title,Paragraph,Text, Badge, BackTop, Button, Card, Divider, Icon, Link, Space, Avatar } from 'weifuwu/components'
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
// ─────────────────────────────────────────────────────────────
|
|
6
|
+
// 模式 5:营销落地页(Landing Page)
|
|
7
|
+
//
|
|
8
|
+
// Hero(全宽居中)+ 特性区(三列网格)+ CTA + Footer。
|
|
9
|
+
// 100% 原语 + 组件:wf-center / wf-container / wf-grid / wf-gap-*
|
|
10
|
+
// Badge、Card、Button、Tag
|
|
11
|
+
// ─────────────────────────────────────────────────────────────
|
|
12
|
+
|
|
13
|
+
const FEATURES = [
|
|
14
|
+
{ icon: 'layers' as const, title: '原子原语', desc: '66 个布局原语 + 156 个工具类组合任意界面,无框架锁定' },
|
|
15
|
+
{ icon: 'zap' as const, title: '零依赖前端', desc: '纯函数组件 + Proxy 状态驱动,无 npm 运行时依赖' },
|
|
16
|
+
{ icon: 'globe' as const, title: 'SSR 透明', desc: '路由级服务端渲染,hydration 零决策' },
|
|
17
|
+
{ icon: 'database' as const, title: '全栈一体', desc: 'DB / Redis / 队列 / AI / WebSocket 一个框架搞定' },
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
export const Landing: Component = async (_init, ctx) => (
|
|
21
|
+
async () => (
|
|
22
|
+
<div class="wf-stack wf-gap-none">
|
|
23
|
+
{/* 顶部导航 */}
|
|
24
|
+
<header class="wf-row wf-p-md wf-gap-lg wf-container wf-between wf-sticky wf-bg-secondary" style={{ maxWidth: 1100, top: 0 }}>
|
|
25
|
+
<Space align="center">
|
|
26
|
+
<Icon name="zap" size={20} className="wf-text-primary" />
|
|
27
|
+
<b class="wf-text-bold wf-text-lg">weifuwu</b>
|
|
28
|
+
</Space>
|
|
29
|
+
<Space size="lg" align="center">
|
|
30
|
+
<Link href="#features" underline={false} variant="muted">特性</Link>
|
|
31
|
+
<Link href="#docs" underline={false} variant="muted">文档</Link>
|
|
32
|
+
<Link href="#pricing" underline={false} variant="muted">定价</Link>
|
|
33
|
+
</Space>
|
|
34
|
+
<Button size="sm" variant="primary">开始使用</Button>
|
|
35
|
+
</header>
|
|
36
|
+
|
|
37
|
+
{/* Hero:全宽 + 居中 */}
|
|
38
|
+
<section class="wf-center wf-p-xl wf-bg-primary">
|
|
39
|
+
<div class="wf-stack wf-gap-md wf-text-center" style={{ maxWidth: 640 }}>
|
|
40
|
+
<Badge variant="primary">v0.69.0 已发布</Badge>
|
|
41
|
+
<Title level={1} className="wf-text-display">
|
|
42
|
+
一个框架,<br />构建完整应用
|
|
43
|
+
</Title>
|
|
44
|
+
<Paragraph className="wf-text-secondary" style={{ maxWidth: 480 }}>
|
|
45
|
+
后端中间件 + 前端响应式组件 + SSR,从数据库到像素,全程一个心智模型。
|
|
46
|
+
</Paragraph>
|
|
47
|
+
<div class="wf-cluster wf-gap-md">
|
|
48
|
+
<Button size="lg" variant="primary">免费开始</Button>
|
|
49
|
+
<Button size="lg" variant="ghost">查看文档 <Icon name="arrow-right" size={14} /></Button>
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
</section>
|
|
53
|
+
|
|
54
|
+
{/* 特性区 */}
|
|
55
|
+
<section class="wf-container wf-p-xl" style={{ maxWidth: 1100 }}>
|
|
56
|
+
<div class="wf-grid" style={{ '--wf-cols': 'repeat(auto-fill, minmax(240px, 1fr))' }}>
|
|
57
|
+
{FEATURES.map((f) => (
|
|
58
|
+
<Card outlined key={f.title} padding="lg">
|
|
59
|
+
<Space direction="vertical" size="md">
|
|
60
|
+
<Icon name={f.icon} size={28} className="wf-text-primary" />
|
|
61
|
+
<b>{f.title}</b>
|
|
62
|
+
<Text type="secondary" className="wf-text-sm">{f.desc}</Text>
|
|
63
|
+
</Space>
|
|
64
|
+
</Card>
|
|
65
|
+
))}
|
|
66
|
+
</div>
|
|
67
|
+
</section>
|
|
68
|
+
|
|
69
|
+
{/* CTA */}
|
|
70
|
+
<section class="wf-center wf-p-xl wf-bg-secondary">
|
|
71
|
+
<div class="wf-stack wf-gap-md wf-center wf-text-center">
|
|
72
|
+
<Title level={2}>准备构建你的下一个应用?</Title>
|
|
73
|
+
<Paragraph className="wf-text-secondary">npm i weifuwu — 5 分钟跑通全栈</Paragraph>
|
|
74
|
+
<Button variant="primary" size="lg"><Icon name="zap" size={16} /> 立即上手</Button>
|
|
75
|
+
</div>
|
|
76
|
+
</section>
|
|
77
|
+
|
|
78
|
+
{/* Footer */}
|
|
79
|
+
<BackTop target={() => ctx.browser?.query('.wf-fill.wf-scroll') as HTMLElement} />
|
|
80
|
+
<footer class="wf-row wf-p-md wf-gap-lg wf-border-t wf-container wf-between" style={{ maxWidth: 1100 }}>
|
|
81
|
+
<Text type="secondary" className="wf-text-sm">© 2026 weifuwu</Text>
|
|
82
|
+
<Space align="center" size="sm">
|
|
83
|
+
<Avatar size="sm" name="W" />
|
|
84
|
+
<Text type="secondary" className="wf-text-sm">Made with weifuwu</Text>
|
|
85
|
+
</Space>
|
|
86
|
+
</footer>
|
|
87
|
+
</div>
|
|
88
|
+
)
|
|
89
|
+
)
|
|
90
|
+
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { Component } from 'weifuwu/vdom'
|
|
2
|
+
import { PageHeader, SearchInput, Table, Tag, Pagination, Button, Icon, EmptyState, Card } from 'weifuwu/components'
|
|
3
|
+
|
|
4
|
+
// ─────────────────────────────────────────────────────────────
|
|
5
|
+
// 模式 9:列表页(List Page)
|
|
6
|
+
//
|
|
7
|
+
// 最常见的业务页面:搜索 + 表格 + 分页 + 状态标签组合。
|
|
8
|
+
// 复制此文件即可得到一个标准的"列表页":
|
|
9
|
+
// - PageHeader(标题 + 操作区)
|
|
10
|
+
// - SearchInput(搜索过滤——客户端即时过滤)
|
|
11
|
+
// - Table(列配置 + 状态 Tag 渲染)
|
|
12
|
+
// - Pagination(分页——当前为前端分页,接 API 时分页参数同理)
|
|
13
|
+
// 改造:换 columns/data → 自己的业务列表。
|
|
14
|
+
// ─────────────────────────────────────────────────────────────
|
|
15
|
+
|
|
16
|
+
const ORDERS = [
|
|
17
|
+
{ id: 'SO-1001', customer: '张伟', amount: 1280, status: '已支付', date: '2026-08-10' },
|
|
18
|
+
{ id: 'SO-1002', customer: '李娜', amount: 560, status: '待支付', date: '2026-08-11' },
|
|
19
|
+
{ id: 'SO-1003', customer: '王强', amount: 3200, status: '已发货', date: '2026-08-12' },
|
|
20
|
+
{ id: 'SO-1004', customer: '赵敏', amount: 890, status: '已支付', date: '2026-08-13' },
|
|
21
|
+
{ id: 'SO-1005', customer: '陈杰', amount: 2100, status: '待支付', date: '2026-08-14' },
|
|
22
|
+
{ id: 'SO-1006', customer: '刘洋', amount: 450, status: '已支付', date: '2026-08-15' },
|
|
23
|
+
{ id: 'SO-1007', customer: '孙丽', amount: 1750, status: '已发货', date: '2026-08-16' },
|
|
24
|
+
{ id: 'SO-1008', customer: '周涛', amount: 980, status: '已支付', date: '2026-08-17' },
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
const statusTag = (s: string) =>
|
|
28
|
+
s === '已支付' ? <Tag variant="success">{s}</Tag> : s === '已发货' ? <Tag variant="primary">{s}</Tag> : <Tag>{s}</Tag>
|
|
29
|
+
|
|
30
|
+
export const ListPage: Component = async (_init: any, ctx: any) => {
|
|
31
|
+
let q = ''
|
|
32
|
+
let page = 1
|
|
33
|
+
const PAGE_SIZE = 5
|
|
34
|
+
return async (_p: any) => {
|
|
35
|
+
const filtered = ORDERS.filter((o) => !q || o.customer.toLowerCase().includes(q.toLowerCase()) || o.id.toLowerCase().includes(q.toLowerCase()))
|
|
36
|
+
const total = filtered.length
|
|
37
|
+
const pages = Math.max(1, Math.ceil(total / PAGE_SIZE))
|
|
38
|
+
const cur = Math.min(page, pages)
|
|
39
|
+
const rows = filtered.slice((cur - 1) * PAGE_SIZE, cur * PAGE_SIZE)
|
|
40
|
+
return (
|
|
41
|
+
<div class="wf-container wf-stack" style="--wf-max:960px;--wf-gap:16px;padding:24px 16px">
|
|
42
|
+
<PageHeader title="订单列表" sub={`共 ${total} 条订单`}>
|
|
43
|
+
<div class="wf-row wf-gap-sm">
|
|
44
|
+
<SearchInput placeholder="搜索客户/订单号…" value={q}
|
|
45
|
+
onInput={(e: any) => { q = (e.target as HTMLInputElement).value; page = 1; ctx.render() }}
|
|
46
|
+
onClear={() => { q = ''; page = 1; ctx.render() }} />
|
|
47
|
+
<Button variant="primary" onClick={() => ctx.render()}>
|
|
48
|
+
<Icon name="plus" size={14} /> 新建订单
|
|
49
|
+
</Button>
|
|
50
|
+
</div>
|
|
51
|
+
</PageHeader>
|
|
52
|
+
|
|
53
|
+
{rows.length === 0 ? (
|
|
54
|
+
<Card><EmptyState text={q ? `无匹配「${q}」的订单` : '暂无订单'} /></Card>
|
|
55
|
+
) : (
|
|
56
|
+
<Table
|
|
57
|
+
columns={[
|
|
58
|
+
{ key: 'id', label: '订单号' },
|
|
59
|
+
{ key: 'customer', label: '客户' },
|
|
60
|
+
{ key: 'amount', label: '金额', render: (v: any) => `¥${Number(v).toLocaleString()}` },
|
|
61
|
+
{ key: 'date', label: '日期' },
|
|
62
|
+
{ key: 'status', label: '状态', render: (v: any) => statusTag(v) },
|
|
63
|
+
{ key: 'id', label: '操作', render: () => <a class="wf-link" style="cursor:pointer">查看</a> },
|
|
64
|
+
]}
|
|
65
|
+
data={rows}
|
|
66
|
+
/>
|
|
67
|
+
)}
|
|
68
|
+
|
|
69
|
+
<div class="wf-row wf-between">
|
|
70
|
+
<span class="wf-text-xs wf-text-tertiary">第 {cur}/{pages} 页 · 每页 {PAGE_SIZE} 条</span>
|
|
71
|
+
<Pagination total={total} page={cur} pageSize={PAGE_SIZE}
|
|
72
|
+
onChange={(p: number) => { page = p; ctx.render() }} />
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
)
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import type { Component } from 'weifuwu/vdom'
|
|
2
|
+
import { Text, Avatar, Badge, Divider, Icon, List, SearchInput, Space, TabBar } from 'weifuwu/components'
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
// ─────────────────────────────────────────────────────────────
|
|
6
|
+
// 模式 6:移动端布局(Mobile App Shell)
|
|
7
|
+
//
|
|
8
|
+
// App 壳:顶部导航(wf-safe-top 避让刘海)+ 内容列表 + 底部 Tab
|
|
9
|
+
// (wf-safe-bottom 避让手势条)。固定视口(390px 居中)模拟手机屏。
|
|
10
|
+
// 100% 原语 + 组件:wf-safe-top/bottom、wf-fill、wf-row/gap、wf-center
|
|
11
|
+
// SearchInput(搜索)、List(消息流)、Badge(未读数)
|
|
12
|
+
// ─────────────────────────────────────────────────────────────
|
|
13
|
+
|
|
14
|
+
const CONTACTS = [
|
|
15
|
+
{ name: '张伟', role: '产品经理', online: true },
|
|
16
|
+
{ name: '李娜', role: '设计师', online: true },
|
|
17
|
+
{ name: '王强', role: '后端工程师', online: false },
|
|
18
|
+
{ name: '赵敏', role: '测试', online: true },
|
|
19
|
+
{ name: '陈晨', role: '运营', online: false },
|
|
20
|
+
]
|
|
21
|
+
|
|
22
|
+
const DISCOVER = [
|
|
23
|
+
{ title: '前端周刊', meta: '12 篇新文章', icon: 'file-text' },
|
|
24
|
+
{ title: 'AI 助手', meta: '对话式工具', icon: 'zap' },
|
|
25
|
+
{ title: '设计资源', meta: '图标 / 插画', icon: 'layers' },
|
|
26
|
+
{ title: '开源项目', meta: 'weifuwu 生态', icon: 'github' },
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
const CHATS = [
|
|
30
|
+
{ name: '产品讨论组', msg: '王强:新的布局原语文档已更新', time: '10:24', unread: 3 },
|
|
31
|
+
{ name: '张伟', msg: '收到,明天下午评审', time: '09:58', unread: 0 },
|
|
32
|
+
{ name: '前端小分队', msg: '李娜:PR #128 已合并 🎉', time: '昨天', unread: 12 },
|
|
33
|
+
{ name: '服务端同学', msg: '部署脚本已就绪', time: '昨天', unread: 0 },
|
|
34
|
+
{ name: '设计同步', msg: '新图标包已上传 Figma', time: '周一', unread: 5 },
|
|
35
|
+
]
|
|
36
|
+
|
|
37
|
+
const TABS = [
|
|
38
|
+
{ key: '消息', icon: 'message' as const, label: '消息' },
|
|
39
|
+
{ key: '通讯录', icon: 'users' as const, label: '通讯录' },
|
|
40
|
+
{ key: '发现', icon: 'grid' as const, label: '发现' },
|
|
41
|
+
{ key: '我', icon: 'user' as const, label: '我' },
|
|
42
|
+
]
|
|
43
|
+
|
|
44
|
+
export const Mobile: Component = async (_init, ctx) => {
|
|
45
|
+
let query = ''
|
|
46
|
+
let tab = '消息'
|
|
47
|
+
const rerender = () => ctx.render()
|
|
48
|
+
|
|
49
|
+
return async () => {
|
|
50
|
+
const filtered = CHATS.filter((c) => c.name.includes(query) || c.msg.includes(query))
|
|
51
|
+
return (
|
|
52
|
+
<div class="wf-center wf-p-lg wf-bg-tertiary" style={{ minHeight: 'calc(100vh - 48px)' }}>
|
|
53
|
+
{/* 手机视口(390×640 模拟屏——唯一允许的视口容器内联) */}
|
|
54
|
+
<div class="wf-stack wf-gap-none wf-border wf-rounded-lg wf-elevate wf-bg-primary" style={{ width: 390, maxWidth: '100%', height: 640, overflow: 'hidden' }}>
|
|
55
|
+
{/* 顶部导航(安全区避让) */}
|
|
56
|
+
<div class="wf-safe-top wf-row wf-p-md wf-gap-sm wf-border-b wf-between">
|
|
57
|
+
<Icon name="chevron-left" size={18} />
|
|
58
|
+
<b class="wf-text-bold">消息</b>
|
|
59
|
+
<Icon name="plus" size={18} />
|
|
60
|
+
</div>
|
|
61
|
+
|
|
62
|
+
{/* 搜索(输入过滤列表) */}
|
|
63
|
+
<div class="wf-p-md wf-border-b">
|
|
64
|
+
<SearchInput
|
|
65
|
+
placeholder="搜索会话"
|
|
66
|
+
onInput={(e) => { query = (e.target as HTMLInputElement).value; rerender() }}
|
|
67
|
+
onClear={() => { query = ''; rerender() }}
|
|
68
|
+
/>
|
|
69
|
+
</div>
|
|
70
|
+
|
|
71
|
+
{/* 内容区(按底部 Tab 切换) */}
|
|
72
|
+
<div class="wf-fill wf-scroll">
|
|
73
|
+
{tab === '消息' && (
|
|
74
|
+
<List
|
|
75
|
+
divided
|
|
76
|
+
items={filtered}
|
|
77
|
+
renderItem={(c) => (
|
|
78
|
+
<div class="wf-row wf-p-md wf-gap-md">
|
|
79
|
+
<Avatar name={c.name[0]} size="md" />
|
|
80
|
+
<div class="wf-fill wf-stack wf-gap-none" style={{ minWidth: 0 }}>
|
|
81
|
+
<div class="wf-row wf-gap-none wf-between">
|
|
82
|
+
<Text className="wf-text-sm" strong>{c.name}</Text>
|
|
83
|
+
<Text type="secondary" className="wf-text-xs">{c.time}</Text>
|
|
84
|
+
</div>
|
|
85
|
+
<Text type="secondary" className="wf-text-sm wf-truncate">{c.msg}</Text>
|
|
86
|
+
</div>
|
|
87
|
+
{c.unread > 0 && <Badge variant="danger" dot={false}>{c.unread}</Badge>}
|
|
88
|
+
</div>
|
|
89
|
+
)}
|
|
90
|
+
/>
|
|
91
|
+
)}
|
|
92
|
+
{tab === '通讯录' && (
|
|
93
|
+
<List
|
|
94
|
+
divided
|
|
95
|
+
items={CONTACTS}
|
|
96
|
+
renderItem={(c) => (
|
|
97
|
+
<div class="wf-row wf-p-md wf-gap-md">
|
|
98
|
+
<Avatar name={c.name[0]} size="md" />
|
|
99
|
+
<div class="wf-fill">
|
|
100
|
+
<Text className="wf-text-sm" strong>{c.name}</Text>
|
|
101
|
+
<Text type="secondary" className="wf-text-xs wf-block">{c.role}</Text>
|
|
102
|
+
</div>
|
|
103
|
+
{c.online && <span class="wf-badge-dot wf-badge-dot--success" />}
|
|
104
|
+
</div>
|
|
105
|
+
)}
|
|
106
|
+
/>
|
|
107
|
+
)}
|
|
108
|
+
{tab === '发现' && (
|
|
109
|
+
<List
|
|
110
|
+
divided
|
|
111
|
+
items={DISCOVER}
|
|
112
|
+
renderItem={(d) => (
|
|
113
|
+
<div class="wf-row wf-p-md wf-gap-md">
|
|
114
|
+
<Icon name={d.icon as any} size={20} className="wf-text-primary" />
|
|
115
|
+
<div class="wf-fill">
|
|
116
|
+
<Text className="wf-text-sm" strong>{d.title}</Text>
|
|
117
|
+
<Text type="secondary" className="wf-text-xs wf-block">{d.meta}</Text>
|
|
118
|
+
</div>
|
|
119
|
+
<Icon name="chevron-right" size={16} className="wf-text-tertiary" />
|
|
120
|
+
</div>
|
|
121
|
+
)}
|
|
122
|
+
/>
|
|
123
|
+
)}
|
|
124
|
+
{tab === '我' && (
|
|
125
|
+
<div class="wf-stack wf-gap-md wf-p-md">
|
|
126
|
+
<div class="wf-row wf-gap-md">
|
|
127
|
+
<Avatar name="我" size="lg" />
|
|
128
|
+
<div class="wf-stack wf-gap-none">
|
|
129
|
+
<Text strong>管理员</Text>
|
|
130
|
+
<Text type="secondary" className="wf-text-xs">ID: 10086</Text>
|
|
131
|
+
</div>
|
|
132
|
+
</div>
|
|
133
|
+
{['账号与安全', '通知设置', '隐私', '关于'].map((item) => (
|
|
134
|
+
<div key={item} class="wf-between wf-p-sm wf-border-b">
|
|
135
|
+
<Text className="wf-text-sm">{item}</Text>
|
|
136
|
+
<Icon name="chevron-right" size={14} className="wf-text-tertiary" />
|
|
137
|
+
</div>
|
|
138
|
+
))}
|
|
139
|
+
</div>
|
|
140
|
+
)}
|
|
141
|
+
</div>
|
|
142
|
+
|
|
143
|
+
{/* 底部 Tab(TabBar 组件——safe-area 避让 + 受控激活 + 键盘方向键) */}
|
|
144
|
+
<TabBar
|
|
145
|
+
items={TABS}
|
|
146
|
+
activeKey={tab}
|
|
147
|
+
onChange={(k: string) => { tab = k; rerender() }}
|
|
148
|
+
/>
|
|
149
|
+
</div>
|
|
150
|
+
</div>
|
|
151
|
+
)
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import type { Component } from 'weifuwu/vdom'
|
|
2
|
+
import { PageHeader, Tabs, Form, Field, Input, Switch, Select, Button, Alert, Space } from 'weifuwu/components'
|
|
3
|
+
|
|
4
|
+
// ─────────────────────────────────────────────────────────────
|
|
5
|
+
// 模式 11:设置页(Settings Page)
|
|
6
|
+
//
|
|
7
|
+
// 多分区设置:Tabs 分块 + Form 表单 + 开关项 + 保存反馈。
|
|
8
|
+
// 复制此文件即可得到一个标准的"设置页":
|
|
9
|
+
// - PageHeader(标题 + 保存按钮)
|
|
10
|
+
// - Tabs(基本设置 / 通知 / 安全——分区)
|
|
11
|
+
// - Form + Field(表单校验)
|
|
12
|
+
// - Switch(开关项——通知开关)
|
|
13
|
+
// - Alert(保存成功反馈)
|
|
14
|
+
// 改造:换分区/字段 → 自己的设置项。
|
|
15
|
+
// ─────────────────────────────────────────────────────────────
|
|
16
|
+
|
|
17
|
+
export const SettingsPage: Component = async (_init: any, ctx: any) => {
|
|
18
|
+
let tab = 'basic'
|
|
19
|
+
let saved = false
|
|
20
|
+
let saving = false
|
|
21
|
+
let name = '团队工作台'
|
|
22
|
+
let email = 'admin@acme.cn'
|
|
23
|
+
let notifyOrder = true
|
|
24
|
+
let notifyDigest = false
|
|
25
|
+
let twoFactor = true
|
|
26
|
+
|
|
27
|
+
const save = () => {
|
|
28
|
+
saving = true
|
|
29
|
+
saved = false
|
|
30
|
+
ctx.render()
|
|
31
|
+
setTimeout(() => { saving = false; saved = true; ctx.render() }, 800)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return async (_p: any) => (
|
|
35
|
+
<div class="wf-container wf-stack" style="--wf-max:760px;--wf-gap:16px;padding:24px 16px">
|
|
36
|
+
<PageHeader title="系统设置" sub="工作区偏好、通知与安全">
|
|
37
|
+
<Button variant="primary" loading={saving} onClick={save}>保存设置</Button>
|
|
38
|
+
</PageHeader>
|
|
39
|
+
|
|
40
|
+
{saved && <Alert variant="success">设置已保存</Alert>}
|
|
41
|
+
|
|
42
|
+
<Tabs
|
|
43
|
+
items={[
|
|
44
|
+
{ key: 'basic', label: '基本设置' },
|
|
45
|
+
{ key: 'notify', label: '通知' },
|
|
46
|
+
{ key: 'security', label: '安全' },
|
|
47
|
+
]}
|
|
48
|
+
active={tab}
|
|
49
|
+
onChange={(k: string) => { tab = k; saved = false; ctx.render() }}
|
|
50
|
+
/>
|
|
51
|
+
|
|
52
|
+
{tab === 'basic' && (
|
|
53
|
+
<div class="wf-stack wf-gap-sm" style="max-width:480px">
|
|
54
|
+
<Field label="工作区名称" hint="团队成员可见">
|
|
55
|
+
<Input value={name} onInput={(e: any) => { name = (e.target as HTMLInputElement).value; ctx.render() }} />
|
|
56
|
+
</Field>
|
|
57
|
+
<Field label="管理员邮箱" required>
|
|
58
|
+
<Input type="email" value={email} onInput={(e: any) => { email = (e.target as HTMLInputElement).value; ctx.render() }} />
|
|
59
|
+
</Field>
|
|
60
|
+
</div>
|
|
61
|
+
)}
|
|
62
|
+
|
|
63
|
+
{tab === 'notify' && (
|
|
64
|
+
<div class="wf-stack wf-gap-sm" style="max-width:480px">
|
|
65
|
+
<div class="wf-surface wf-border wf-rounded-sm wf-p-sm wf-row wf-between">
|
|
66
|
+
<div class="wf-stack wf-gap-xs">
|
|
67
|
+
<b class="wf-text-sm">订单通知</b>
|
|
68
|
+
<span class="wf-text-xs wf-text-secondary">新订单到达时推送</span>
|
|
69
|
+
</div>
|
|
70
|
+
<Switch checked={notifyOrder} onChange={(v: boolean) => { notifyOrder = v; ctx.render() }} />
|
|
71
|
+
</div>
|
|
72
|
+
<div class="wf-surface wf-border wf-rounded-sm wf-p-sm wf-row wf-between">
|
|
73
|
+
<div class="wf-stack wf-gap-xs">
|
|
74
|
+
<b class="wf-text-sm">每日摘要</b>
|
|
75
|
+
<span class="wf-text-xs wf-text-secondary">每天早上 9 点发送昨日汇总</span>
|
|
76
|
+
</div>
|
|
77
|
+
<Switch checked={notifyDigest} onChange={(v: boolean) => { notifyDigest = v; ctx.render() }} />
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
)}
|
|
81
|
+
|
|
82
|
+
{tab === 'security' && (
|
|
83
|
+
<div class="wf-stack wf-gap-sm" style="max-width:480px">
|
|
84
|
+
<div class="wf-surface wf-border wf-rounded-sm wf-p-sm wf-row wf-between">
|
|
85
|
+
<div class="wf-stack wf-gap-xs">
|
|
86
|
+
<b class="wf-text-sm">两步验证</b>
|
|
87
|
+
<span class="wf-text-xs wf-text-secondary">登录时要求验证码</span>
|
|
88
|
+
</div>
|
|
89
|
+
<Switch checked={twoFactor} onChange={(v: boolean) => { twoFactor = v; ctx.render() }} />
|
|
90
|
+
</div>
|
|
91
|
+
<Field label="登录密码">
|
|
92
|
+
<Input type="password" placeholder="输入新密码(留空不修改)" />
|
|
93
|
+
</Field>
|
|
94
|
+
</div>
|
|
95
|
+
)}
|
|
96
|
+
</div>
|
|
97
|
+
)
|
|
98
|
+
}
|