weifuwu 0.77.0 → 0.79.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 +8 -6
- package/dist/components/AlertGroup/AlertGroup.d.ts +1 -1
- package/dist/components/Anchor/Anchor.d.ts +1 -1
- package/dist/components/AuthPage/AuthPage.d.ts +36 -0
- package/dist/components/AutoComplete/AutoComplete.d.ts +3 -1
- package/dist/components/AvatarGroup/AvatarGroup.d.ts +1 -1
- package/dist/components/Calendar/Calendar.d.ts +1 -1
- package/dist/components/Carousel/Carousel.d.ts +1 -1
- package/dist/components/Cascader/Cascader.d.ts +1 -1
- package/dist/components/ChatInput/ChatInput.d.ts +51 -0
- package/dist/components/ColorPicker/ColorPicker.d.ts +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts +2 -0
- package/dist/components/FloatButton/FloatButton.d.ts +1 -1
- package/dist/components/Grid/Grid.d.ts +1 -1
- package/dist/components/InputNumber/InputNumber.d.ts +1 -1
- package/dist/components/JSONViewer/JSONViewer.d.ts +1 -1
- package/dist/components/Link/Link.d.ts +1 -1
- package/dist/components/List/List.d.ts +3 -0
- package/dist/components/LogViewer/LogViewer.d.ts +1 -1
- package/dist/components/Markdown/parser.d.ts +1 -1
- package/dist/components/Mentions/Mentions.d.ts +1 -1
- package/dist/components/Menu/Menu.d.ts +1 -1
- package/dist/components/Menubar/Menubar.d.ts +1 -1
- package/dist/components/MessageBubble/MessageBubble.d.ts +1 -1
- package/dist/components/NavMenu/NavMenu.d.ts +1 -1
- package/dist/components/Popconfirm/Popconfirm.d.ts +1 -1
- package/dist/components/Result/Result.d.ts +1 -1
- package/dist/components/Scrollbar/Scrollbar.d.ts +1 -1
- package/dist/components/SearchInput/SearchInput.d.ts +1 -0
- package/dist/components/Slider/Slider.d.ts +1 -0
- package/dist/components/TagsInput/TagsInput.d.ts +1 -1
- package/dist/components/Timeline/Timeline.d.ts +1 -1
- package/dist/components/Transfer/Transfer.d.ts +1 -1
- package/dist/components/TreeSelect/TreeSelect.d.ts +2 -0
- package/dist/components/VirtualList/VirtualList.d.ts +3 -1
- package/dist/components/VirtualTable/VirtualTable.d.ts +1 -1
- package/dist/components/Watermark/Watermark.d.ts +1 -1
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.js +12 -12
- package/dist/components/style.css +77 -23
- package/dist/index.js +74 -3
- package/dist/ui-dom/index.js +11 -11
- package/dist/ui-dom/jsx-runtime.js +1 -1
- package/dist/ui-dom/testing.js +1 -1
- package/dist/ui-dom/types.d.ts +2 -0
- package/dist/ui-dom/vdom/audit.d.ts +20 -0
- package/dist/ui-dom/vdom/diff.d.ts +3 -7
- package/dist/ui-dom/vdom/render.d.ts +5 -3
- package/dist/ui-dom/vdom/transform.d.ts +47 -0
- package/dist/ui-dom/vnode.d.ts +8 -1
- package/docs/components-map.md +3 -1
- package/docs/components.md +7 -4
- package/docs/custom-components.md +8 -0
- package/docs/frontend-ui-dom.md +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# weifuwu
|
|
2
2
|
|
|
3
|
-
**自托管全栈框架** — 一个 npm 包 = 后端 HTTP + 前端 VDOM +
|
|
3
|
+
**自托管全栈框架** — 一个 npm 包 = 后端 HTTP + 前端 VDOM + 115 组件 + CSS 设计系统 + SaaS 地基(认证 / 消息 / 队列 / AI)。全自研、零构建、消灭样板。
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
6
|
npm install weifuwu # 一个依赖,完整应用栈
|
|
@@ -24,7 +24,7 @@ npm install weifuwu # 一个依赖,完整应用栈
|
|
|
24
24
|
|----|------|------|
|
|
25
25
|
| 后端 | `weifuwu` | Trie 路由 / 中间件链 / serve / 自研 PG+Redis / SSR / GraphQL / WebSocket |
|
|
26
26
|
| 前端 | `weifuwu/ui-dom` | **UIRouter(纯路由 + ctx 注入链)+ uiServe(渲染运行时)+ SSR/hydration**——handler=异步组件 / 中间件两阶段 / ctx.params 对齐后端;**weifuwu/components 直接复用**(VNode 契约唯一来源 ui-dom,见 `docs/frontend-ui-dom.md`) |
|
|
27
|
-
| 组件 | `weifuwu/components` |
|
|
27
|
+
| 组件 | `weifuwu/components` | 115 个 HTML 原语组件(表单/表格/弹层/AiChat…),引用 `--wf-*` 主题变量 |
|
|
28
28
|
| 样式 | `weifuwu/layout` | 58 布局原语 + 136 工具类 + 167 主题 Token,零自定义 CSS 文件 |
|
|
29
29
|
| SaaS 地基 | 随包内置 | rateLimit / email / userSystem / messager / queue / ai → `ctx.*` 一行接入 |
|
|
30
30
|
|
|
@@ -93,6 +93,8 @@ npm install weifuwu # 一个依赖,完整应用栈
|
|
|
93
93
|
|
|
94
94
|
**render-only 确定性渲染** — 渲染唯一触发 `ctx.ui.render()`(闭包绑定组件),状态是普通对象(`let` + `render()`);跨组件共享用 `createStore` + `ctx.ui.useExternal()`。行为可静态推导,无隐式触发(详见[组件库](docs/components.md))。
|
|
95
95
|
|
|
96
|
+
**VDOM 输出透明(写 JSX,看 DOM 即真相)** — VDOM 对用户输入零 magic:条件渲染的 false 在 DOM 里是诊断占位注释(`<!--wf-hole: false-->`),数组项 key 与组件实例 id 直接落 DOM(`data-wf-key` / `data-wf-id`)——devtools 看到的 DOM 就是引擎决策的可读输出;非法输入占位 + warn,不崩溃不静默。转化契约唯一清晰(design/vdom-transform-rules.md):用户写什么,vnode 就是什么,DOM 就长什么样。
|
|
97
|
+
|
|
96
98
|
**中间件注入一切** — 后端和前端共用同一理念:中间件向 `ctx` 注入能力(`ctx.sql` / `ctx.redis` / `ctx.api` / `ctx.auth` / `ctx.i18n` / `ctx.limit` / `ctx.email` / `ctx.queue` / `ctx.ai` / `ctx.msg` 等),Handler/组件从 `ctx` 读取。
|
|
97
99
|
|
|
98
100
|
**async 工厂组件** — `async (initProps, ctx) => (props) => Promise<VNode>`(weifuwu **唯一组件形态**——同步组件已不支持):工厂层声明数据(`await ctx.data.get`)、mount 初始化状态(`let` + `render()`)、render 输出视图。异步在工厂边界与 renderFn,数据经闭包注入,写数据像写同步代码。三条纪律见[核心概念 · async 组件](#核心概念)。
|
|
@@ -109,7 +111,7 @@ npm install weifuwu # 一个依赖,完整应用栈
|
|
|
109
111
|
|
|
110
112
|
**自研数据层** — `ctx.sql`(PG v3 协议)与 `ctx.redis`(RESP2 协议)为**自研客户端**:确定性输出、行为可预测、统一错误模型。jsonb 自动解码、TTL 安全 API、schema 写前校验——高频痛点(双重编码/parseRow 样板/`'EX'` 参数顺序)从根上消除。
|
|
111
113
|
|
|
112
|
-
> **实践验证**:多租户 AI 平台(`apps/agent-platform`——14 页 + 部门聊天 + 知识库 + HITL 审批)已完全运行在框架上:auth(userSystem)/ AI 引擎(ai)/ 实时消息(messager)/ UI(
|
|
114
|
+
> **实践验证**:多租户 AI 平台(`apps/agent-platform`——14 页 + 部门聊天 + 知识库 + HITL 审批)已完全运行在框架上:auth(userSystem)/ AI 引擎(ai)/ 实时消息(messager)/ UI(115 组件)/ 数据管道(ctx.api)零自研替代。框架哲学(中间件注入、诚实裁剪、机制与策略分离)经受住了真实复杂应用的检验——这也是我们确定「哪些进框架、哪些留应用层」的依据。
|
|
113
115
|
|
|
114
116
|
---
|
|
115
117
|
|
|
@@ -225,7 +227,7 @@ uiServe(app, { root: '#root', hydrate: true })
|
|
|
225
227
|
### 30 秒体验(跑现有 demo)
|
|
226
228
|
|
|
227
229
|
```bash
|
|
228
|
-
# ① 组件 cheatsheet——
|
|
230
|
+
# ① 组件 cheatsheet——115 组件全部可交互预览(零依赖,5 秒起)
|
|
229
231
|
cd apps/components-demo && node server.ts
|
|
230
232
|
# 打开 http://localhost:3000
|
|
231
233
|
|
|
@@ -313,7 +315,7 @@ cd apps/agent-platform && npm run seed && npm run dev
|
|
|
313
315
|
| 资源 | CDN 地址 | 说明 |
|
|
314
316
|
|------|---------|------|
|
|
315
317
|
| `weifuwu/ui-dom` | `https://unpkg.com/weifuwu@latest/dist/ui-dom/index.js` | 前端运行时(UIRouter, uiServe, h, 状态管理等) |
|
|
316
|
-
| `weifuwu/components` | `https://unpkg.com/weifuwu@latest/dist/components/index.js` |
|
|
318
|
+
| `weifuwu/components` | `https://unpkg.com/weifuwu@latest/dist/components/index.js` | 115 个 UI 组件(Button, Card, Table, Modal, Icon 等) |
|
|
317
319
|
| `weifuwu/components` | `https://unpkg.com/weifuwu@latest/dist/components/style.css` | 组件 CSS + 167 个主题 Token + 58 个布局原语 + 136 个工具类 |
|
|
318
320
|
| 独立布局系统 | `https://unpkg.com/weifuwu@latest/dist/layout/weifuwu-layout.css` | 仅 CSS 布局,不依赖 JS |
|
|
319
321
|
|
|
@@ -396,7 +398,7 @@ cd apps/agent-platform && npm run seed && npm run dev
|
|
|
396
398
|
| **UIHandler**(路由) | `async (location, ctx) => VNode` | ✅ 整体 | 每次路由变化执行 |
|
|
397
399
|
| **Component**(唯一形态) | `async (initProps, ctx) => (props) => Promise<VNode>` | ✅ 工厂 + renderFn | mount 一次 + render 每次;同步组件已不支持(类型强制 Promise) |
|
|
398
400
|
|
|
399
|
-
异步只在两个边界——路由 handler(整页)和组件工厂(数据声明)+ renderFn(强制异步)。渲染器按「返回值 instanceof Promise」统一判别:主路径 `buildVNode` async 预构建(await 全部工厂,兄弟并行)→
|
|
401
|
+
异步只在两个边界——路由 handler(整页)和组件工厂(数据声明)+ renderFn(强制异步)。渲染器按「返回值 instanceof Promise」统一判别:主路径 `buildVNode` async 预构建(await 全部工厂,兄弟并行)→ 原子落地(无**中间态**占位、无补全回调——注意:数组内 false/null 的静态诊断占位 `<!--wf-hole-->` 是另一回事,见「VDOM 输出透明」);运行时首次挂载的 async 组件同样在 buildVNode 阶段 await;骨架屏 `uiServe({ loading })` + `handle.ready`。
|
|
400
402
|
### 两阶段组件(新手必读:为什么是两层)
|
|
401
403
|
|
|
402
404
|
组件 = `async (initProps, ctx) => (props) => Promise<VNode>`——**外层 = 初始化(只执行一次,可 await 数据),内层 = 渲染(每次状态/props 变化时执行,强制异步)**。类比:外层是对象的构造函数,内层是它的 render 方法。
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* 锚点导航(长文页):items 列表 + 滚动高亮跟随 + 点击平滑滚动。
|
|
5
5
|
* 滚动侦听:ctx.ui.useScrollPosition(全局/容器 scroll 监听 + rAF 节流,内置方案)。
|
|
6
|
-
*
|
|
6
|
+
* 裁剪(CS-05,见 design/components-cuts.md):嵌套滚动容器、滚动容器非视口(container 未提供时仅视口)、自动生成标题锚点。
|
|
7
7
|
*/
|
|
8
8
|
import type { Component } from '../../ui-dom/vnode.ts';
|
|
9
9
|
export interface AnchorItem {
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* weifuwu/components — AuthPage
|
|
3
|
+
*
|
|
4
|
+
* 认证页骨架(登录/注册复用——agent-platform Login/Register 抽取)。
|
|
5
|
+
* 布局:居中卡片 + logo + 标题/副标题 + 表单插槽 + 错误条 + 提交 loading + 底部链接。
|
|
6
|
+
*
|
|
7
|
+
* 纯骨架:表单字段(children)与提交逻辑(onSubmit)由消费方提供——
|
|
8
|
+
* 认证流程(token 存储/跳转)不进组件(业务自配,框架 ctx.auth 可组合)。
|
|
9
|
+
*
|
|
10
|
+
* 使用两阶段模型 + render-only。无状态(props 驱动)。
|
|
11
|
+
*/
|
|
12
|
+
import type { Component, VNode } from '../../ui-dom/vnode.ts';
|
|
13
|
+
import type { HookEnv } from '../../ui-dom/hooks/types.ts';
|
|
14
|
+
export interface AuthPageProps {
|
|
15
|
+
/** 标题(如「登录」) */
|
|
16
|
+
title: string;
|
|
17
|
+
/** 副标题(如「多租户 AI 平台」) */
|
|
18
|
+
subtitle?: string;
|
|
19
|
+
/** logo / 头像位(VNode——Avatar 或图片) */
|
|
20
|
+
logo?: VNode | null;
|
|
21
|
+
/** 表单字段插槽 */
|
|
22
|
+
children?: any;
|
|
23
|
+
/** 底部链接位(登录↔注册切换) */
|
|
24
|
+
footer?: VNode | null;
|
|
25
|
+
/** 提交按钮文案 */
|
|
26
|
+
submitLabel: string;
|
|
27
|
+
/** 提交中——按钮 loading + 禁用 */
|
|
28
|
+
loading?: boolean;
|
|
29
|
+
/** 错误文案(Alert 错误条渲染) */
|
|
30
|
+
error?: string | null;
|
|
31
|
+
/** 表单提交回调(preventDefault 已处理) */
|
|
32
|
+
onSubmit?: () => void;
|
|
33
|
+
}
|
|
34
|
+
export declare const AuthPage: Component<AuthPageProps, {
|
|
35
|
+
ui: HookEnv;
|
|
36
|
+
}>;
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* value={query} onChange={setQuery}
|
|
11
11
|
* />
|
|
12
12
|
*
|
|
13
|
-
* 裁剪(CS-05):不做分组/虚拟化候选(Select searchable 覆盖分组场景);
|
|
13
|
+
* 裁剪(CS-05,见 design/components-cuts.md):不做分组/虚拟化候选(Select searchable 覆盖分组场景);
|
|
14
14
|
* 自定义渲染用 `renderOption` 透传。
|
|
15
15
|
*/
|
|
16
16
|
import type { Component } from '../../ui-dom/vnode.ts';
|
|
@@ -27,6 +27,8 @@ export interface AutoCompleteProps {
|
|
|
27
27
|
open?: boolean;
|
|
28
28
|
onOpenChange?: (open: boolean) => void;
|
|
29
29
|
disabled?: boolean;
|
|
30
|
+
/** 错误态(F2 状态矩阵——输入类基线) */
|
|
31
|
+
error?: string;
|
|
30
32
|
/** 过滤函数(默认包含匹配) */
|
|
31
33
|
filter?: (options: AutoCompleteOption[], query: string) => AutoCompleteOption[];
|
|
32
34
|
renderOption?: (option: AutoCompleteOption) => any;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* 堆叠头像组(负 margin 重叠)+ max 溢出显示 +N。
|
|
5
5
|
* 用于群聊成员、协作人列表。
|
|
6
|
-
*
|
|
6
|
+
* 裁剪(CS-05,见 design/components-cuts.md):hover 展开 tooltip(Tooltip 可组合)。
|
|
7
7
|
*/
|
|
8
8
|
import type { Component } from '../../ui-dom/vnode.ts';
|
|
9
9
|
import { type AvatarProps } from '../Avatar/Avatar.ts';
|
|
@@ -17,5 +17,5 @@ export interface CalendarProps {
|
|
|
17
17
|
'aria-label'?: string;
|
|
18
18
|
}
|
|
19
19
|
/** 月历(对应 antd/EP Calendar):月视图网格 + 事件点 + 月切换 + 日期选择。
|
|
20
|
-
*
|
|
20
|
+
* 裁剪(CS-05,见 design/components-cuts.md):周/日视图、拖拽创建事件、事件详情弹层。 */
|
|
21
21
|
export declare const Calendar: Component<CalendarProps>;
|
|
@@ -13,5 +13,5 @@ export interface CarouselProps {
|
|
|
13
13
|
className?: string;
|
|
14
14
|
}
|
|
15
15
|
/** 轮播(对应 antd/EP/shadcn Carousel):横向滑动 + 箭头/圆点 + 自动播放 + 触摸滑动。
|
|
16
|
-
*
|
|
16
|
+
* 裁剪(CS-05,见 design/components-cuts.md):垂直模式、多图联动、淡入淡出(fade 用 CSS 可配)。 */
|
|
17
17
|
export declare const Carousel: Component<CarouselProps>;
|
|
@@ -21,5 +21,5 @@ export interface CascaderProps {
|
|
|
21
21
|
'aria-label'?: string;
|
|
22
22
|
}
|
|
23
23
|
/** 级联选择(对应 antd/EP Cascader):多列面板逐级选择,点击叶子完成 + 可选搜索。
|
|
24
|
-
*
|
|
24
|
+
* 裁剪(CS-05,见 design/components-cuts.md):hover 展开、任意层级配置、异步加载。 */
|
|
25
25
|
export declare const Cascader: Component<CascaderProps>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* weifuwu/components — ChatInput
|
|
3
|
+
*
|
|
4
|
+
* 独立复用的聊天输入条(从 AiChat 抽取——消 AiChat 内置 + 消费方手搓双重复)。
|
|
5
|
+
* 纯输入层:不自带聊天逻辑(useChat 组合在消费方——AiChat 传入 chat handle,
|
|
6
|
+
* 业务页传入自己的发送/停止回调)。
|
|
7
|
+
*
|
|
8
|
+
* 能力:
|
|
9
|
+
* - 单行 input(默认)/ 多行 textarea(multiline——Enter 发送 / Shift+Enter 换行)
|
|
10
|
+
* - §5.3 受控输入纪律:内部 keyword(IME 组合期间不回流传受控 value——中文输入法不打断)
|
|
11
|
+
* - streaming → 发送按钮变「停止」(onStop)
|
|
12
|
+
* - error 且非流式 → 「重试」按钮(onRetry)
|
|
13
|
+
* - disabled 输入/按钮;actions 插槽(附件/知识库等扩展位)
|
|
14
|
+
*
|
|
15
|
+
* 使用两阶段模型 + render-only。状态:内部 keyword(useControlledInput Map 缓存)。
|
|
16
|
+
*/
|
|
17
|
+
import type { Component, VNode } from '../../ui-dom/vnode.ts';
|
|
18
|
+
import type { HookEnv } from '../../ui-dom/hooks/types.ts';
|
|
19
|
+
export interface ChatInputLabels {
|
|
20
|
+
send: string;
|
|
21
|
+
stop: string;
|
|
22
|
+
retry: string;
|
|
23
|
+
placeholder: string;
|
|
24
|
+
}
|
|
25
|
+
export interface ChatInputProps {
|
|
26
|
+
/** 受控值(共享输入态——ChatInput 不持有聊天逻辑) */
|
|
27
|
+
value: string;
|
|
28
|
+
/** 值变化(IME 安全:组合期间不触发) */
|
|
29
|
+
onChange: (v: string) => void;
|
|
30
|
+
/** 发送(Enter 或按钮)——入参为当前输入文本(trim 后非空才触发) */
|
|
31
|
+
onSend: (text: string) => void;
|
|
32
|
+
/** 流式状态——true 时按钮变「停止」 */
|
|
33
|
+
streaming?: boolean;
|
|
34
|
+
/** 停止回调(streaming 时按钮触发) */
|
|
35
|
+
onStop?: () => void;
|
|
36
|
+
/** 错误——非流式时显示「重试」按钮 */
|
|
37
|
+
error?: string | null;
|
|
38
|
+
/** 重试回调 */
|
|
39
|
+
onRetry?: () => void;
|
|
40
|
+
/** 禁用(输入 + 按钮) */
|
|
41
|
+
disabled?: boolean;
|
|
42
|
+
/** 多行 textarea(Enter 发送 / Shift+Enter 换行);默认 false = 单行 input */
|
|
43
|
+
multiline?: boolean;
|
|
44
|
+
/** 标签(i18n 覆盖) */
|
|
45
|
+
labels?: Partial<ChatInputLabels>;
|
|
46
|
+
/** 扩展位(附件/知识库/模型选择等) */
|
|
47
|
+
actions?: VNode | null;
|
|
48
|
+
}
|
|
49
|
+
export declare const ChatInput: Component<ChatInputProps, {
|
|
50
|
+
ui: HookEnv;
|
|
51
|
+
}>;
|
|
@@ -12,5 +12,5 @@ export interface ColorPickerProps {
|
|
|
12
12
|
'aria-label'?: string;
|
|
13
13
|
}
|
|
14
14
|
/** 颜色选择(对应 antd/EP ColorPicker 预设版):触发按钮 + 色板弹层 + hex 输入。
|
|
15
|
-
*
|
|
15
|
+
* 裁剪(CS-05,见 design/components-cuts.md):不做吸管/自由取色/透明度(预设色板 + hex 输入覆盖 90% 场景)。 */
|
|
16
16
|
export declare const ColorPicker: Component<ColorPickerProps>;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* <FloatButton icon={...} onClick={...} />
|
|
10
10
|
* </FloatButtonGroup>
|
|
11
11
|
*
|
|
12
|
-
* 裁剪(CS-05):不做拖拽悬浮(Resizable 可组合);回顶用 BackTop 语义更清晰。
|
|
12
|
+
* 裁剪(CS-05,见 design/components-cuts.md):不做拖拽悬浮(Resizable 可组合);回顶用 BackTop 语义更清晰。
|
|
13
13
|
*/
|
|
14
14
|
import type { Component } from '../../ui-dom/vnode.ts';
|
|
15
15
|
export type FloatButtonPosition = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* </Grid>
|
|
11
11
|
* <Grid flex gap={8} direction="row">...</Grid>
|
|
12
12
|
*
|
|
13
|
-
* 裁剪(CS-05):不做响应式断点 props(useBreakpoint 由用户驱动);
|
|
13
|
+
* 裁剪(CS-05,见 design/components-cuts.md):不做响应式断点 props(useBreakpoint 由用户驱动);
|
|
14
14
|
* gutter 仅水平(垂直 gutter 低频)。
|
|
15
15
|
*/
|
|
16
16
|
import type { Component } from '../../ui-dom/vnode.ts';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* 数字输入:min/max/step + 增减按钮 + precision 格式化 + 长按连增。
|
|
5
5
|
* 受控 value: number | null;空值 → null;输入 clamp 到 min/max。
|
|
6
|
-
*
|
|
6
|
+
* 裁剪(CS-05,见 design/components-cuts.md):千分位货币格式(业务自拼)。
|
|
7
7
|
*/
|
|
8
8
|
import type { Component } from '../../ui-dom/vnode.ts';
|
|
9
9
|
export interface InputNumberProps {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* 结构化 JSON 浏览(工具调用 args / API 响应):递归树 + 折叠 + 类型色 + 路径复制 + 懒展开。
|
|
5
5
|
* 零依赖(无 raw JSON.parse 展示——VNode 渲染天然转义)。
|
|
6
|
-
*
|
|
6
|
+
* 裁剪(CS-05,见 design/components-cuts.md):JSON 编辑、超大对象流式渲染(懒展开覆盖 100 键级)。
|
|
7
7
|
*/
|
|
8
8
|
import type { Component } from '../../ui-dom/vnode.ts';
|
|
9
9
|
export interface JSONViewerProps {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* <Link href="/docs" variant="primary" icon="→">文档</Link>
|
|
8
8
|
*
|
|
9
|
-
* 裁剪(CS-05):不做 hover 弹层预览/图标内置枚举(icon 任意 VNode)。
|
|
9
|
+
* 裁剪(CS-05,见 design/components-cuts.md):不做 hover 弹层预览/图标内置枚举(icon 任意 VNode)。
|
|
10
10
|
*/
|
|
11
11
|
import type { Component } from '../../ui-dom/vnode.ts';
|
|
12
12
|
export interface LinkProps {
|
|
@@ -8,6 +8,9 @@ import type { Component } from '../../ui-dom/vnode.ts';
|
|
|
8
8
|
export interface ListProps<T = any> {
|
|
9
9
|
items: T[];
|
|
10
10
|
renderItem: (item: T, index: number) => any;
|
|
11
|
+
/** 自定义项 key(可选,默认数组下标)——renderItem 渲染有内部状态的组件且列表动态增删/重排时传
|
|
12
|
+
* 身份跟随内容的 key(如项 id),否则默认下标 = 位置身份,增删后项状态会继承错位(规则表 §3) */
|
|
13
|
+
keyBy?: (item: T, index: number) => string | number;
|
|
11
14
|
divided?: boolean;
|
|
12
15
|
header?: any;
|
|
13
16
|
footer?: any;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* 日志流查看器(Agent 执行日志 / CI 输出):ANSI 着色 + 虚拟滚动 + 自动跟随。
|
|
5
5
|
* 复用 VirtualList 滚动基座(useScrollPosition + rAF 节流)。
|
|
6
|
-
*
|
|
6
|
+
* 裁剪(CS-05,见 design/components-cuts.md):正则高亮、多日志源合并、搜索定位。
|
|
7
7
|
*/
|
|
8
8
|
import type { Component } from '../../ui-dom/vnode.ts';
|
|
9
9
|
export interface LogViewerProps {
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* 支持块级:标题(#~####) / 段落 / 列表(有序·无序·GFM 任务) / 围栏代码块 / 引用 / 分割线 / GFM 表格
|
|
8
8
|
* 支持行内:**粗体** / *斜体* / ~~删除线~~ / `行内代码` / [文本](链接)
|
|
9
9
|
*
|
|
10
|
-
*
|
|
10
|
+
* 诚实裁剪(CS-05,见 design/components-cuts.md):脚注/raw HTML/自动链接/语法高亮(raw HTML 安全红线——VNode 天然转义;语法高亮破零依赖)
|
|
11
11
|
*/
|
|
12
12
|
export interface MdInline {
|
|
13
13
|
type: 'text' | 'code' | 'bold' | 'italic' | 'del' | 'link';
|
|
@@ -15,5 +15,5 @@ export interface MentionsProps {
|
|
|
15
15
|
size?: 'sm' | 'md' | 'lg';
|
|
16
16
|
}
|
|
17
17
|
/** @提及输入(对应 antd Mentions):输入 prefix + 关键词弹出候选,点击/Enter 插入。
|
|
18
|
-
*
|
|
18
|
+
* 裁剪(CS-05,见 design/components-cuts.md):不做多 prefix/自定义高亮渲染/远程搜索(options 静态传入)。 */
|
|
19
19
|
export declare const Mentions: Component<MentionsProps>;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* 导航菜单(侧栏导航):分组项 + 图标 + 选中态 + 方向键导航 + Enter 激活 + 子菜单 + 折叠。
|
|
5
5
|
* 用于 SaaS 应用侧边导航(替代手写 nav-item 循环)。
|
|
6
|
-
*
|
|
6
|
+
* 裁剪(CS-05,见 design/components-cuts.md):水平菜单栏(Menubar,独立组件)、子菜单自动互斥。折叠态子菜单浮层已实现(usePopup 基座)。
|
|
7
7
|
*/
|
|
8
8
|
import type { Component } from '../../ui-dom/vnode.ts';
|
|
9
9
|
export interface MenuItem {
|
|
@@ -18,5 +18,5 @@ export interface MenubarProps {
|
|
|
18
18
|
'aria-label'?: string;
|
|
19
19
|
}
|
|
20
20
|
/** 水平菜单栏(对应 shadcn Menubar):trigger 点击展开下拉,←→ 切换菜单,Escape 关闭。
|
|
21
|
-
*
|
|
21
|
+
* 裁剪(CS-05,见 design/components-cuts.md):hover 展开、子菜单、可拖拽菜单。 */
|
|
22
22
|
export declare const Menubar: Component<MenubarProps>;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* 独立消息气泡(从 AiChat 气泡层抽取,业务聊天页复用)。
|
|
5
5
|
* 复用 layout 的 wf-bubble 原语:user → --own,assistant → --ai。
|
|
6
6
|
* content 支持文本或任意 VNode(可与 Markdown 组合)。
|
|
7
|
-
*
|
|
7
|
+
* 裁剪(CS-05,见 design/components-cuts.md):不做打字指示动画(Loading 已有)。
|
|
8
8
|
*/
|
|
9
9
|
import type { Component } from '../../ui-dom/vnode.ts';
|
|
10
10
|
export type MessageBubbleRole = 'user' | 'assistant';
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* 弹层纪律(AGENTS.md):子菜单/嵌套子菜单全部经 usePopup 组合器
|
|
10
10
|
* (createPortal + fixed + 视口夹紧 + Escape + 外部点击)——不 absolute 定位。
|
|
11
11
|
*
|
|
12
|
-
* 裁剪(CS-05):不做 hover 延迟微调/子菜单动画曲线定制;
|
|
12
|
+
* 裁剪(CS-05,见 design/components-cuts.md):不做 hover 延迟微调/子菜单动画曲线定制;
|
|
13
13
|
* 折叠态交还 useBreakpoint 由用户驱动。
|
|
14
14
|
*/
|
|
15
15
|
import type { Component } from '../../ui-dom/vnode.ts';
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*
|
|
12
12
|
* - 受控 open/onOpenChange;非受控点击触发
|
|
13
13
|
* - 确认后自动关闭(onConfirm 后 setOpen(false))
|
|
14
|
-
* - 裁剪(CS-05):不做气泡内表单/自定义箭头
|
|
14
|
+
* - 裁剪(CS-05,见 design/components-cuts.md):不做气泡内表单/自定义箭头
|
|
15
15
|
*/
|
|
16
16
|
import type { Component } from '../../ui-dom/vnode.ts';
|
|
17
17
|
import type { Placement } from '../../ui-dom/popup.ts';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* 结果页:status + title + desc + extra(操作按钮区)。
|
|
5
5
|
* 用于注册完成/操作成功/404/403 页。
|
|
6
|
-
*
|
|
6
|
+
* 裁剪(CS-05,见 design/components-cuts.md):不做内置路由跳转(页面自身处理)。
|
|
7
7
|
*/
|
|
8
8
|
import type { Component } from '../../ui-dom/vnode.ts';
|
|
9
9
|
export type ResultStatus = 'success' | 'error' | 'warning' | 'info';
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* <Scrollbar maxHeight={300}>长内容</Scrollbar>
|
|
8
8
|
*
|
|
9
|
-
* 裁剪(CS-05):不做虚拟滚动/拖动滚动条 thumb(VirtualList 覆盖虚拟化)。
|
|
9
|
+
* 裁剪(CS-05,见 design/components-cuts.md):不做虚拟滚动/拖动滚动条 thumb(VirtualList 覆盖虚拟化)。
|
|
10
10
|
*/
|
|
11
11
|
import type { Component } from '../../ui-dom/vnode.ts';
|
|
12
12
|
export interface ScrollbarProps {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* 标签输入:回车/逗号添加、Backspace 删除、去重、maxTags 限制。
|
|
5
5
|
* 中文输入法 composition 感知(输入法候选词确认的 Enter 不触发添加)。
|
|
6
|
-
*
|
|
6
|
+
* 裁剪(CS-05,见 design/components-cuts.md):不做下拉建议(组合 Select searchable)。
|
|
7
7
|
*/
|
|
8
8
|
import type { Component } from '../../ui-dom/vnode.ts';
|
|
9
9
|
export interface TagsInputProps {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* 时间线:节点(状态色圆点/自定义)+ 标题 + 时间 + 内容 + 连接线。
|
|
5
5
|
* 竖向(left/alternate)+ 横向(horizontal)。
|
|
6
6
|
* 用于执行日志、审批历史、审计记录、步骤进度。
|
|
7
|
-
*
|
|
7
|
+
* 裁剪(CS-05,见 design/components-cuts.md):不做折叠节点。
|
|
8
8
|
*/
|
|
9
9
|
import type { Component } from '../../ui-dom/vnode.ts';
|
|
10
10
|
export type TimelineStatus = 'default' | 'info' | 'success' | 'warning' | 'error';
|
|
@@ -9,12 +9,14 @@ export interface VirtualListProps {
|
|
|
9
9
|
/** 可见区外额外渲染数量 */
|
|
10
10
|
overscan?: number;
|
|
11
11
|
keyBy?: (item: any, index: number) => string | number;
|
|
12
|
+
/** 空数据占位(F2 状态矩阵——容器类基线) */
|
|
13
|
+
emptyText?: string;
|
|
12
14
|
className?: string;
|
|
13
15
|
}
|
|
14
16
|
/**
|
|
15
17
|
* 虚拟列表(对应 EP VirtualTable):固定高度 items 只渲染可见窗口,
|
|
16
18
|
* spacer 撑总高 + 绝对定位可见项。1000+ 条列表性能关键。
|
|
17
|
-
*
|
|
19
|
+
* 裁剪(CS-05,见 design/components-cuts.md):动态高度(ResizeObserver 测量)、滚动平滑(sticky 场景)。
|
|
18
20
|
* 滚动跟随:ctx.ui.useScrollPosition(内置全局 scroll 监听 + rAF 节流)——
|
|
19
21
|
* 像素级 scrollTop 响应式,无组件自建 scroll 监听。
|
|
20
22
|
*/
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* 复用 VirtualList 滚动基座(useScrollPosition 像素级 scrollTop + rAF 节流)。
|
|
6
6
|
* 排序:受控 sortKey/sortOrder + onSort(与 Table 同款模式)。
|
|
7
7
|
* 行选择:rowSelection(受控 selectedRowKeys + onChange,复选框列)。
|
|
8
|
-
*
|
|
8
|
+
* 裁剪(CS-05,见 design/components-cuts.md):列虚拟化(横向)、行编辑、单元格合并、树形表格。
|
|
9
9
|
*/
|
|
10
10
|
import type { Component } from '../../ui-dom/vnode.ts';
|
|
11
11
|
import type { TableColumn } from '../Table/Table.ts';
|
|
@@ -15,5 +15,5 @@ export interface WatermarkProps {
|
|
|
15
15
|
className?: string;
|
|
16
16
|
}
|
|
17
17
|
/** 水印(对应 antd Watermark):canvas 绘制平铺文字 + overlay 覆盖内容(pointer-events none)。
|
|
18
|
-
*
|
|
18
|
+
* 裁剪(CS-05,见 design/components-cuts.md):图片水印、多行文字、动态旋转。 */
|
|
19
19
|
export declare const Watermark: Component<WatermarkProps>;
|
|
@@ -102,6 +102,10 @@ export { ApprovalCard } from './ApprovalCard/ApprovalCard.ts';
|
|
|
102
102
|
export type { ApprovalCardProps, ApprovalStatus } from './ApprovalCard/ApprovalCard.ts';
|
|
103
103
|
export { AiChat } from './AiChat/AiChat.ts';
|
|
104
104
|
export type { AiChatProps, AiChatLabels } from './AiChat/AiChat.ts';
|
|
105
|
+
export { ChatInput } from './ChatInput/ChatInput.ts';
|
|
106
|
+
export type { ChatInputProps, ChatInputLabels } from './ChatInput/ChatInput.ts';
|
|
107
|
+
export { AuthPage } from './AuthPage/AuthPage.ts';
|
|
108
|
+
export type { AuthPageProps } from './AuthPage/AuthPage.ts';
|
|
105
109
|
export { Markdown } from './Markdown/Markdown.ts';
|
|
106
110
|
export type { MarkdownProps } from './Markdown/Markdown.ts';
|
|
107
111
|
export { parseMarkdown, parseInline } from './Markdown/parser.ts';
|