weifuwu 0.63.1 → 0.64.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -702,6 +702,28 @@ code {
702
702
  }
703
703
  }
704
704
 
705
+ @layer layout {
706
+ /* popup — 浮层基类(usePopup.portal 自动附加;Modal/Drawer 等手动浮层可选用)
707
+ *
708
+ * 宽度视口 clamp:任何浮层默认不横向溢出(375px 屏也能完整操作)。
709
+ * usePopup 已内联 maxWidth;本类兜底组件手动引用场景(audit 规则的目标选择器)。
710
+ */
711
+ .wf-popup {
712
+ max-width: min(var(--wf-popup-max, 480px), calc(100vw - 32px));
713
+ box-sizing: border-box;
714
+ }
715
+ }
716
+
717
+ @layer layout {
718
+ /* safe-area — iOS 刘海屏/Home 条安全区工具(env() 未生效环境自动为 0) */
719
+ .wf-safe-bottom {
720
+ padding-bottom: env(safe-area-inset-bottom);
721
+ }
722
+ .wf-safe-top {
723
+ padding-top: env(safe-area-inset-top);
724
+ }
725
+ }
726
+
705
727
  @layer layout {
706
728
  /* anchor — 定位锚点容器 */
707
729
  .wf-anchor {
@@ -2049,6 +2071,14 @@ code {
2049
2071
  color: var(--wf-color-text-tertiary);
2050
2072
  }
2051
2073
 
2074
+ /* 触屏(coarse):月份切换按钮 44px 命中区 */
2075
+ @media (pointer: coarse) {
2076
+ .wf-calendar-nav-btn {
2077
+ min-height: 44px;
2078
+ min-width: 44px;
2079
+ }
2080
+ }
2081
+
2052
2082
  /* weifuwu/components — Card */
2053
2083
 
2054
2084
  .wf-card {
@@ -2187,6 +2217,25 @@ code {
2187
2217
  transform: scale(1.25);
2188
2218
  }
2189
2219
 
2220
+ /* 触屏(coarse):箭头 44px;圆点保持视觉 8px,用 ::after 扩展命中区(视觉不变) */
2221
+ @media (pointer: coarse) {
2222
+ .wf-carousel-arrow {
2223
+ width: 44px;
2224
+ height: 44px;
2225
+ min-width: 44px;
2226
+ min-height: 44px;
2227
+ }
2228
+ .wf-carousel-dot {
2229
+ position: relative;
2230
+ }
2231
+ .wf-carousel-dot::after {
2232
+ content: '';
2233
+ position: absolute;
2234
+ inset: -14px;
2235
+ border-radius: 50%;
2236
+ }
2237
+ }
2238
+
2190
2239
  /* weifuwu/components — Cascader */
2191
2240
 
2192
2241
  .wf-cascader-wrap {
@@ -3240,6 +3289,34 @@ code {
3240
3289
  padding: 0 2px;
3241
3290
  }
3242
3291
 
3292
+ /* ── 移动端适配(P0):面板宽度视口 clamp + range 窄屏纵向堆叠 ── */
3293
+
3294
+ .wf-datepicker-dropdown {
3295
+ max-width: calc(100vw - 32px);
3296
+ }
3297
+
3298
+ .wf-time-picker {
3299
+ max-width: calc(100vw - 32px);
3300
+ }
3301
+
3302
+ .wf-datepicker-range-wrap {
3303
+ max-width: calc(100vw - 32px);
3304
+ }
3305
+
3306
+ /* range 双面板(240px×2 ≈ 500px)在 375px 屏溢出 → 窄屏纵向堆叠 */
3307
+ @media (max-width: 639px) {
3308
+ .wf-datepicker-range-wrap {
3309
+ flex-direction: column;
3310
+ max-height: 80vh;
3311
+ overflow-y: auto;
3312
+ }
3313
+ }
3314
+
3315
+ /* 时间选择列(时/分/秒)窄屏横向滚动 */
3316
+ .wf-time-body {
3317
+ overflow-x: auto;
3318
+ }
3319
+
3243
3320
  /* weifuwu/components — Descriptions */
3244
3321
 
3245
3322
  .wf-descriptions {
@@ -3477,6 +3554,14 @@ code {
3477
3554
  border-top: var(--wf-border-width, 1px) solid var(--wf-color-border);
3478
3555
  }
3479
3556
 
3557
+ /* 移动端适配(P2):小屏抽屉全宽(底部安全区) */
3558
+ @media (max-width: 639px) {
3559
+ .wf-drawer-panel {
3560
+ width: 100vw;
3561
+ max-width: 100vw;
3562
+ }
3563
+ }
3564
+
3480
3565
  /* weifuwu/components — Dropdown */
3481
3566
 
3482
3567
  .wf-dropdown {
@@ -3843,6 +3928,14 @@ code {
3843
3928
  border-top: 1px solid var(--wf-color-border);
3844
3929
  }
3845
3930
 
3931
+ /* 触屏(coarse):工具栏按钮 44px 命中区 */
3932
+ @media (pointer: coarse) {
3933
+ .wf-editor-toolbar button {
3934
+ min-height: 44px;
3935
+ min-width: 44px;
3936
+ }
3937
+ }
3938
+
3846
3939
  /* weifuwu/components — EmptyState */
3847
3940
 
3848
3941
  .wf-empty {
@@ -4915,6 +5008,25 @@ code {
4915
5008
  border-top: var(--wf-border-width) solid var(--wf-color-border);
4916
5009
  }
4917
5010
 
5011
+ /* ── 移动端适配(P2):min-width 视口 clamp(修 375px 屏 400px 溢出)+ 小屏 bottom-sheet ── */
5012
+
5013
+ .wf-modal-content {
5014
+ min-width: min(var(--wf-modal-width, 400px), calc(100vw - 32px));
5015
+ }
5016
+
5017
+ @media (max-width: 639px) {
5018
+ .wf-modal {
5019
+ align-items: flex-end; /* bottom-sheet 形态 */
5020
+ }
5021
+ .wf-modal-content {
5022
+ width: 100%;
5023
+ max-width: 100vw;
5024
+ max-height: 85vh;
5025
+ border-radius: var(--wf-radius-lg) var(--wf-radius-lg) 0 0;
5026
+ padding-bottom: env(safe-area-inset-bottom);
5027
+ }
5028
+ }
5029
+
4918
5030
  /* weifuwu/components — Notification */
4919
5031
 
4920
5032
  .wf-notification-container {
@@ -5111,6 +5223,23 @@ code {
5111
5223
  color: var(--wf-color-text-tertiary);
5112
5224
  }
5113
5225
 
5226
+ /* 触屏(coarse):页码 44px 命中区(覆盖全局 button min-height) */
5227
+ @media (pointer: coarse) {
5228
+ .wf-pagination-item {
5229
+ min-height: 44px;
5230
+ min-width: 44px;
5231
+ }
5232
+ }
5233
+
5234
+ /* 移动端适配(P2):窄屏页码横向滚动兜底(44px 命中区 + 折叠后仍可能溢出) */
5235
+ .wf-pagination {
5236
+ overflow-x: auto;
5237
+ scrollbar-width: none;
5238
+ }
5239
+ .wf-pagination::-webkit-scrollbar {
5240
+ display: none;
5241
+ }
5242
+
5114
5243
  /* weifuwu/components — PasswordInput(复用 Input 基础类) */
5115
5244
 
5116
5245
  .wf-password {
@@ -5816,6 +5945,15 @@ code {
5816
5945
  border-radius: var(--wf-radius-sm);
5817
5946
  }
5818
5947
 
5948
+ /* 触屏(coarse):搜索选项行 44px 命中区(非 button 元素,需显式覆盖) */
5949
+ @media (pointer: coarse) {
5950
+ .wf-select-search-opt {
5951
+ min-height: 44px;
5952
+ display: flex;
5953
+ align-items: center;
5954
+ }
5955
+ }
5956
+
5819
5957
  /* weifuwu/components — Skeleton */
5820
5958
 
5821
5959
  .wf-skeleton {
@@ -6277,6 +6415,15 @@ code {
6277
6415
  padding-top: var(--wf-space-md);
6278
6416
  }
6279
6417
 
6418
+ /* 移动端适配(P2):窄屏标签横向滚动(隐藏滚动条) */
6419
+ .wf-tab-list {
6420
+ overflow-x: auto;
6421
+ scrollbar-width: none;
6422
+ }
6423
+ .wf-tab-list::-webkit-scrollbar {
6424
+ display: none;
6425
+ }
6426
+
6280
6427
  /* weifuwu/components — Tag */
6281
6428
 
6282
6429
  .wf-tag {
@@ -7065,6 +7212,23 @@ code {
7065
7212
  cursor: not-allowed;
7066
7213
  }
7067
7214
 
7215
+ /* 触屏(coarse):移动按钮 44px 命中区 */
7216
+ @media (pointer: coarse) {
7217
+ .wf-transfer-btn {
7218
+ width: 44px;
7219
+ height: 44px;
7220
+ min-width: 44px;
7221
+ min-height: 44px;
7222
+ }
7223
+ }
7224
+
7225
+ /* 移动端适配(P2):窄屏双栏纵向堆叠(操作钮居中) */
7226
+ @media (max-width: 767px) {
7227
+ .wf-transfer {
7228
+ flex-direction: column;
7229
+ }
7230
+ }
7231
+
7068
7232
  /* weifuwu/components — Tree */
7069
7233
 
7070
7234
  .wf-tree {
package/dist/index.d.ts CHANGED
@@ -18,6 +18,7 @@ export type { EmailOptions, EmailMessage, EmailResult, EmailAdapter, EmailInject
18
18
  export { sendSmtp } from './email/smtp.ts';
19
19
  export type { SmtpConfig } from './email/smtp.ts';
20
20
  export { userSystem } from './user/index.ts';
21
+ export { hashPassword, verifyPassword } from './user/password.ts';
21
22
  export { messager } from './messager/index.ts';
22
23
  export type { UserSystemOptions, UserInjected, AuthApi, RegisterInput } from './user/index.ts';
23
24
  export type { MessagerOptions, MessagerInjected, MessagerClient, MessagerSystem, Message, Conversation } from './messager/index.ts';
package/dist/index.js CHANGED
@@ -6035,6 +6035,7 @@ export {
6035
6035
  created,
6036
6036
  email,
6037
6037
  forbidden,
6038
+ hashPassword,
6038
6039
  messager,
6039
6040
  noContent,
6040
6041
  notFound,
@@ -6055,5 +6056,6 @@ export {
6055
6056
  uiSsr,
6056
6057
  unauthorized,
6057
6058
  unprocessable,
6058
- userSystem
6059
+ userSystem,
6060
+ verifyPassword
6059
6061
  };
@@ -702,6 +702,28 @@ code {
702
702
  }
703
703
  }
704
704
 
705
+ @layer layout {
706
+ /* popup — 浮层基类(usePopup.portal 自动附加;Modal/Drawer 等手动浮层可选用)
707
+ *
708
+ * 宽度视口 clamp:任何浮层默认不横向溢出(375px 屏也能完整操作)。
709
+ * usePopup 已内联 maxWidth;本类兜底组件手动引用场景(audit 规则的目标选择器)。
710
+ */
711
+ .wf-popup {
712
+ max-width: min(var(--wf-popup-max, 480px), calc(100vw - 32px));
713
+ box-sizing: border-box;
714
+ }
715
+ }
716
+
717
+ @layer layout {
718
+ /* safe-area — iOS 刘海屏/Home 条安全区工具(env() 未生效环境自动为 0) */
719
+ .wf-safe-bottom {
720
+ padding-bottom: env(safe-area-inset-bottom);
721
+ }
722
+ .wf-safe-top {
723
+ padding-top: env(safe-area-inset-top);
724
+ }
725
+ }
726
+
705
727
  @layer layout {
706
728
  /* anchor — 定位锚点容器 */
707
729
  .wf-anchor {
@@ -0,0 +1,153 @@
1
+ # weifuwu/components 组件速查(对应 antd / Element Plus / shadcn-ui)
2
+
3
+ > **开发者迁移速查**:从 antd / Element Plus / shadcn-ui 迁到 weifuwu,按功能找到对应组件。
4
+ > 左侧是 **weifuwu 组件**(已提供),右侧是对应的三库组件 + 差异备注。
5
+ > 真实未实现清单(仅 4 项):见文末「weifuwu 尚未实现」。
6
+
7
+ ## 通用基础
8
+
9
+ | 功能 | weifuwu | antd | Element Plus | shadcn-ui | 差异说明 |
10
+ |------|---------|------|-------------|-----------|---------|
11
+ | 按钮 | `<Button variant size loading block>` | Button | Button | Button | 命名基本一致;weifuwu `variant`=primary/secondary/ghost/danger |
12
+ | 图标 | `<Icon name>`(自研 30+ stroke SVG) | Icon | Icon | lucide-react | weifuwu 零依赖、currentColor、1em 随字号;组件内部统一走 Icon |
13
+ | 文本排版 | `<Title/Text/Paragraph>` | Typography | Typography | — | 语义标签 + 语义色 `-text` 变体 + mark/code/删除线 |
14
+ | 分割线 | `<Divider>`(horizontal/vertical/带文字) | Divider | Divider | Separator | 等价 |
15
+ | 头像 | `<Avatar name src color size>` | Avatar | Avatar | Avatar | weifuwu 支持名字哈希色 + 指定色 |
16
+ | 头像组 | `<AvatarGroup items max size>` | Avatar.Group | 手动组合 | 手动组合 | weifuwu 独立组件,`max` 溢出显示 +N |
17
+ | 标签/标签组 | `<Label>`(required 星号)/ `<TagsInput>`(回车/逗号/去重) | Form.Item 标签 / Select tags | — | Label | Label 独立组件 |
18
+
19
+ ## 导航
20
+
21
+ | 功能 | weifuwu | antd | Element Plus | shadcn-ui | 差异说明 |
22
+ |------|---------|------|-------------|-----------|---------|
23
+ | 菜单/侧栏 | `<Menu items group activeKey onSelect>`(方向键导航) | Menu | Menu | NavigationMenu / Sidebar | 分组 group 已支持;**子菜单/折叠未实现** |
24
+ | 面包屑 | `<Breadcrumb items>` | Breadcrumb | Breadcrumb | Breadcrumb | 等价 |
25
+ | 标签页 | `<Tabs items active onChange>`(方向键 + 移动端横向滚动) | Tabs | Tabs | Tabs | 等价 |
26
+ | 分页 | `<Pagination total page onChange>`(页码折叠 + 移动端 44px) | Pagination | Pagination | Pagination | 等价 |
27
+ | 步骤条 | `<Steps items current>` | Steps | Steps | — | 等价 |
28
+ | 下拉菜单 | `<Dropdown items>`(danger variant) | Dropdown | Dropdown | DropdownMenu | 等价(usePopup:外部点击/Escape 关闭) |
29
+ | 水平菜单栏 | `<Menubar menus>`(←→↓ 键盘 + 触屏) | Menu 水平 | Menu | Menubar | 等价 |
30
+ | 页面标题 | `<PageHeader title sub>` | PageHeader(v5 移除) | PageHeader | — | weifuwu 保留独立组件 |
31
+ | 回到顶部 | `<BackTop threshold>` | FloatButton / BackTop | Backtop | — | 滚动超阈值显示 |
32
+ | 固定定位 | `<Affix offsetTop>` | Affix | Affix | — | useScrollPosition 实现 |
33
+ | 锚点 | 未实现 | Anchor | Anchor | — | 待补 |
34
+
35
+ ## 表单
36
+
37
+ | 功能 | weifuwu | antd | Element Plus | shadcn-ui | 差异说明 |
38
+ |------|---------|------|-------------|-----------|---------|
39
+ | 输入框 | `<Input label error hint variant>` | Input | Input | Input | weifuwu 自带 label/error/hint 包装(antd 需 Form.Item);`variant="borderless"` 内联编辑 |
40
+ | 文本域 | `<Textarea rows showCount maxLength>` | Input.TextArea | Input textarea | Textarea | weifuwu 独立组件 + 字数统计 |
41
+ | 选择器 | `<Select options searchable multiple>` | Select | Select | Select / Combobox | **searchable + 键盘 ↑↓ + multiple 已实现**(近 Combobox) |
42
+ | 复选框 | `<Checkbox checked label>` | Checkbox | Checkbox | Checkbox | 等价 |
43
+ | 复选组 | `<CheckboxGroup options value>` | Checkbox.Group | Checkbox 组 | — | 数组受控 + 栅格列数 |
44
+ | 单选 | `<RadioGroup options value>` | Radio.Group | Radio | RadioGroup | 等价 |
45
+ | 开关 | `<Switch checked>` | Switch | Switch | Switch | 等价 |
46
+ | 滑块 | `<Slider min max step>` | Slider | Slider | Slider | 等价 |
47
+ | 数字输入 | `<InputNumber min max step precision>`(增减按钮+clamp) | InputNumber | InputNumber | — | 等价 |
48
+ | 密码输入 | `<PasswordInput>`(眼睛切换) | Input.Password | Input show-password | — | weifuwu 独立组件 |
49
+ | 日期选择 | `<DatePicker mode="date\|datetime\|time\|range">`(四合一) | DatePicker / TimePicker / RangePicker | DatePicker / DateTimePicker / TimePicker | Calendar + DatePicker 组合 | **一个组件覆盖三库四个**;移动端 range 自动堆叠 |
50
+ | 评分 | `<Rate value>`(键盘方向键) | Rate | Rate | — | allowClear/readOnly |
51
+ | 验证码 | `<PinInput length>`(粘贴/回退/自动聚焦) | — | — | InputOTP | 等价 |
52
+ | 颜色选择 | `<ColorPicker value>`(预设色板 + hex) | ColorPicker | ColorPicker | — | Popover 弹层 |
53
+ | 标签输入 | `<TagsInput value onChange>`(回车/逗号/去重) | Select mode="tags" | 手动组合 | — | weifuwu 独立组件 |
54
+ | 搜索框 | `<SearchInput>` | Input.Search | Input search | — | weifuwu 独立组件 |
55
+ | 分段控件 | `<SegmentedControl options value>` | Segmented | — | ToggleGroup 近似 | weifuwu 独立组件 |
56
+ | 切换按钮 | `<Toggle>/<ToggleGroup>`(single/multiple) | — | — | ToggleGroup | shadcn 对齐 |
57
+ | 表单 | `<Form>` + `<Field label error>`(校验规则) | Form + Form.Item | Form + Form.Item | Form | weifuwu Field 轻量(无 Provider 样板) |
58
+ | 文件上传 | `<FileUpload drag multiple accept maxSize>` | Upload | Upload | — | 拖拽已支持;文件列表/预览/进度待增强 |
59
+
60
+ ## 数据展示
61
+
62
+ | 功能 | weifuwu | antd | Element Plus | shadcn-ui | 差异说明 |
63
+ |------|---------|------|-------------|-----------|---------|
64
+ | 表格 | `<Table columns data sortable onSort>` | Table | Table | Table | 列排序 + **行选择/筛选/列宽已实现**;虚拟表格待补 |
65
+ | 卡片 | `<Card clickable hover padding>` | Card | Card | Card | clickable/hover 抬升/active 选中态 |
66
+ | 标签 | `<Tag variant closable>` | Tag | Tag | Badge(variant) | closable 已支持 |
67
+ | 徽标 | `<Badge variant dot>`(8px 状态点) | Badge | Badge | Badge | `dot` = 状态点 |
68
+ | 列表 | `<List items renderItem empty>` | List | 手动 v-for | — | 通用列表 |
69
+ | 时间线 | `<Timeline items status>` | Timeline | Timeline | — | 节点状态色 + 图标 |
70
+ | 描述列表 | `<Descriptions items column bordered>`(dl/dt/dd 语义) | Descriptions | Descriptions | — | 等价 |
71
+ | 统计卡片 | `<StatCard label value trend animate>` | Statistic | Statistic | — | 卡片形态 + 点击 + 动画 |
72
+ | 图片 | `<Img src fallback lazy preview>` | Image | Image | — | **preview 点击放大已实现** |
73
+ | 图表 | `<Chart type data>`(自研零依赖) | — | — | Chart(recharts 包装) | 自研 line/bar/pie,无运行时依赖 |
74
+ | 骨架屏 | `<Skeleton variant count>` | Skeleton | Skeleton | Skeleton | 等价 |
75
+ | 空状态 | `<EmptyState icon text hint>` | Empty | Empty | — | icon 用 emoji/Icon + 操作区 |
76
+ | 结果页 | `<Result status title desc extra>` | Result | Result | — | 等价(success/error/warning/info) |
77
+ | 搜索高亮 | `<Highlight text query>`(`<mark>` 分词) | — | — | — | weifuwu 独有(配 SearchInput/Table) |
78
+ | 树 | `<Tree data checkable checkedKeys>` | Tree | Tree | — | 勾选父子联动 + indeterminate |
79
+ | 级联 | `<Cascader options value>` | Cascader | Cascader | — | 多列面板逐级推进 |
80
+ | 穿梭框 | `<Transfer data targetKeys>` | Transfer | Transfer | — | 双列表 + 移动;移动端自动堆叠 |
81
+ | 月历 | `<Calendar month year events>` | Calendar | Calendar | — | 事件点 + 月切换 |
82
+ | 虚拟列表 | `<VirtualList height itemHeight>` | — | — | — | spacer + 可见窗口,200 条只渲染 ~12 |
83
+
84
+ ## 反馈
85
+
86
+ | 功能 | weifuwu | antd | Element Plus | shadcn-ui | 差异说明 |
87
+ |------|---------|------|-------------|-----------|---------|
88
+ | 提示条 | `<Alert variant closable>` | Alert | Alert | Alert | 等价 |
89
+ | 模态框 | `<Modal open title onClose width>` | Modal | Dialog | Dialog | `open/onClose`(antd v5 同);焦点 trap + 归还;移动端 bottom-sheet |
90
+ | 确认框 | `<Confirm>` + `await confirm()` 命令式 | Popconfirm / Modal.confirm | Popconfirm / MessageBox | AlertDialog | 声明式 + 命令式双模式 |
91
+ | 抽屉 | `<Drawer position="left\|right\|top\|bottom">` | Drawer | Drawer | Sheet / Drawer | **四方向覆盖 shadcn Sheet + Drawer**;移动端全宽 |
92
+ | 气泡 | `<Popover position>`(视口夹紧) | Popover | Popover | Popover | 等价(usePopup:外部点击/Escape/tap 降级) |
93
+ | 悬浮提示 | `<Tooltip content position>`(string) | Tooltip | Tooltip | Tooltip | usePopup:桌面 hover / 触屏 tap |
94
+ | 悬停卡 | `<HoverCard content>`(富内容 + 延迟) | — | — | HoverCard | shadcn 对齐;触屏 tap |
95
+ | 右键菜单 | `<ContextMenu items>` | Dropdown context | — | ContextMenu | 桌面右键 + **触屏长按**双通道 |
96
+ | 消息 | `<Toast>` + `toast()` 命令式 | message | Message | Sonner | 命令式 `toast('已保存','success')` |
97
+ | 通知 | `<Notification>` + `notification.success()` | notification | Notification | — | 队列式通知 |
98
+ | 加载 | `<Loading>` | Spin | Loading | — | 等价 |
99
+ | 进度条 | `<ProgressBar value>` | Progress | Progress | Progress | 等价(线性) |
100
+ | 折叠 | `<Collapse items active>`(异步 loading + extra) | Collapse | Collapse | Collapse | 行内折叠(区别于 Accordion) |
101
+ | 手风琴 | `<Accordion items>` | Collapse accordion | Collapse accordion | Accordion | 单开折叠 |
102
+ | 复制按钮 | `<CopyButton value>`(clipboard + 降级 + 成功态) | — | — | — | Chat/CodeBlock 证据驱动 |
103
+ | 水印 | `<Watermark text>`(canvas 平铺 + overlay) | Watermark | — | — | 自研 |
104
+ | 二维码 | `<QRCode value>`(Reed-Solomon + 8 掩码) | QRCode | QRCode | — | **自研编码零依赖** |
105
+ | 轮播 | `<Carousel autoplay>`(箭头/圆点/循环 + 触摸) | Carousel | Carousel | — | 触摸滑动 + 触屏命中区 |
106
+ | 分割面板 | `<Resizable defaultSize>`(拖拽 + 键盘 + clamp) | Splitter | — | Resizable | 指针 + 方向键 |
107
+ | 回到顶部按钮 | `<BackTop>` | FloatButton.BackTop | Backtop | — | 滚动监听 |
108
+
109
+ ## AI / 特色(三库无,weifuwu 独有)
110
+
111
+ | 组件 | 说明 |
112
+ |------|------|
113
+ | `<AiChat>` | 完整 AI 对话界面(流式 token/工具卡/审批卡/自动滚动),配 `ctx.ui.useChat()`;移动端 `raiseOnKeyboard` |
114
+ | `<Markdown content>` | 零依赖安全子集 parser(无 raw HTML 注入,VNode 渲染天然转义) |
115
+ | `<CodeBlock code lang>` | 代码块 + 语言标签 + 复制按钮 |
116
+ | `<MessageBubble role status>` | 聊天气泡(独立复用,AiChat 抽取) |
117
+ | `<ToolCallCard>` | AI 工具调用状态机(running/ok/error) |
118
+ | `<ApprovalCard>` | HITL 人工审批卡片(pending/approved/rejected/timeout) |
119
+ | `<Editor>` | 富文本编辑器(contentEditable + 工具栏/表格/图片,零依赖) |
120
+ | `<ThemeSwitch>` | 明暗主题切换(CSS 变量驱动,配 `data-theme`) |
121
+ | `<InView>` | 交叉观察(进入视口触发,可做无限滚动) |
122
+ | `<AspectRatio>` | 宽高比容器(内容填满) |
123
+ | `<CopyButton>` | 复制(clipboard + execCommand 降级 + 成功状态机) |
124
+
125
+ ## 快速迁移路径(三库 → weifuwu)
126
+
127
+ ```tsx
128
+ // antd / shadcn 开发者
129
+ <Modal open={show} onClose={f}>…</Modal> // antd v5 同命名,直接迁移
130
+ <Select options={opts} value={v} onChange={f} /> // 同命名
131
+ <Button variant="primary">保存</Button> // antd type="primary" → variant
132
+
133
+ // Element Plus 开发者(v-model 模板语法 → value/onChange)
134
+ <Input :value="v" @input="f" /> // → <Input value={v} onInput={f} />
135
+ <ElDialog :visible="s" @close="f" /> // → <Modal open={s} onClose={f} />
136
+ <ElMessage>成功</ElMessage> // → toast('成功','success')
137
+
138
+ // shadcn 开发者(原子组合 → 成品)
139
+ <Dialog><DialogTrigger/>…</Dialog> // → <Modal open onClose> 一体组件
140
+ <Sheet><SheetTrigger/>…</Sheet> // → <Drawer position="bottom">
141
+ <Badge variant="secondary">x</Badge> // → <Tag variant="secondary">x</Tag>
142
+ ```
143
+
144
+ ## weifuwu 尚未实现(三库有)→ 待补清单
145
+
146
+ 仅 4 项:
147
+
148
+ - **Anchor**(锚点导航,三库均有)
149
+ - **Menu 子菜单/折叠**(分组 group 已支持,子级/折叠待补)
150
+ - **FileUpload 增强**(拖拽已支持;文件列表/预览/进度待补)
151
+ - **VirtualTable**(VirtualList 已有,表格虚拟化待补)
152
+
153
+ > 难度阶梯(L1-L6)与验证的 client 能力点:见 `design/components-cdd.md`;三库 → weifuwu 覆盖矩阵:见 `design/components-migration.md`。