weifuwu 0.89.1 → 0.90.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.
- package/README.md +99 -461
- package/dist/client/components/AlertGroup/AlertGroup.d.ts +1 -1
- package/dist/client/components/Anchor/Anchor.d.ts +1 -1
- package/dist/client/components/AutoComplete/AutoComplete.d.ts +1 -1
- package/dist/client/components/AvatarGroup/AvatarGroup.d.ts +1 -1
- package/dist/client/components/BackTop/BackTop.d.ts +12 -5
- package/dist/client/components/Button/Button.d.ts +2 -0
- package/dist/client/components/Calendar/Calendar.d.ts +1 -1
- package/dist/client/components/Carousel/Carousel.d.ts +1 -1
- package/dist/client/components/Cascader/Cascader.d.ts +1 -1
- package/dist/client/components/CodeEditor/CodeEditor.d.ts +1 -1
- package/dist/client/components/ColorPicker/ColorPicker.d.ts +1 -1
- package/dist/client/components/DropZone/DropZone.d.ts +27 -0
- package/dist/client/components/Editor/Editor.d.ts +1 -1
- package/dist/client/components/Editor/edit-events.d.ts +1 -1
- package/dist/client/components/Editor/model/types.d.ts +1 -1
- package/dist/client/components/Editor/tools/table.d.ts +1 -1
- package/dist/client/components/Editor/tools/types.d.ts +1 -1
- package/dist/client/components/FilePreview/FilePreview.d.ts +1 -1
- package/dist/client/components/FloatButton/FloatButton.d.ts +1 -1
- package/dist/client/components/Grid/Grid.d.ts +1 -1
- package/dist/client/components/Img/Img.d.ts +7 -0
- package/dist/client/components/InputNumber/InputNumber.d.ts +1 -1
- package/dist/client/components/JSONViewer/JSONViewer.d.ts +1 -1
- package/dist/client/components/Link/Link.d.ts +1 -1
- package/dist/client/components/LogViewer/LogViewer.d.ts +1 -1
- package/dist/client/components/Markdown/parser.d.ts +1 -1
- package/dist/client/components/Math/Math.d.ts +1 -1
- package/dist/client/components/Mentions/Mentions.d.ts +1 -1
- package/dist/client/components/Menu/Menu.d.ts +1 -1
- package/dist/client/components/Menubar/Menubar.d.ts +1 -1
- package/dist/client/components/MessageBubble/MessageBubble.d.ts +1 -1
- package/dist/client/components/NavBar/NavBar.d.ts +32 -0
- package/dist/client/components/NavMenu/NavMenu.d.ts +1 -1
- package/dist/client/components/OfficeEditor/ai/ai-bridge.d.ts +1 -1
- package/dist/client/components/OfficeEditor/model/types.d.ts +1 -1
- package/dist/client/components/Popconfirm/Popconfirm.d.ts +1 -1
- package/dist/client/components/Result/Result.d.ts +1 -1
- package/dist/client/components/Scrollbar/Scrollbar.d.ts +1 -1
- package/dist/client/components/SheetGrid/SheetGrid.d.ts +1 -1
- package/dist/client/components/SlideCanvas/SlideCanvas.d.ts +1 -1
- package/dist/client/components/TagsInput/TagsInput.d.ts +1 -1
- package/dist/client/components/Timeline/Timeline.d.ts +1 -1
- package/dist/client/components/Transfer/Transfer.d.ts +1 -1
- package/dist/client/components/VirtualList/VirtualList.d.ts +1 -1
- package/dist/client/components/VirtualTable/VirtualTable.d.ts +1 -1
- package/dist/client/components/Watermark/Watermark.d.ts +1 -1
- package/dist/client/components/WordCloud/WordCloud.d.ts +79 -0
- package/dist/client/components/index.d.ts +6 -0
- package/dist/client/components/index.js +37 -37
- package/dist/client/components/style.css +307 -18
- package/dist/client/layout/weifuwu-layout.css +35 -16
- package/dist/client/office/docx.d.ts +1 -1
- package/dist/client/office/xlsx.d.ts +1 -1
- package/dist/client/vdom/core/async-guard.d.ts +1 -1
- package/dist/client/vdom/core/patch/state-machine.d.ts +1 -1
- package/dist/client/vdom/core/router.d.ts +1 -1
- package/dist/client/vdom/core/ssr/html.d.ts +1 -1
- package/dist/client/vdom/core/v2/cycle.d.ts +4 -2
- package/dist/client/vdom/core/v2/diff.d.ts +9 -0
- package/dist/client/vdom/core/v2/integrate.d.ts +1 -1
- package/dist/client/vdom/core/v2/schedule.d.ts +1 -1
- package/dist/client/vdom/core/vnode.d.ts +1 -1
- package/dist/client/vdom/hooks/drag-media.d.ts +4 -1
- package/dist/client/vdom/hooks/popup-manager.d.ts +1 -1
- package/dist/client/vdom/hooks/stable.d.ts +1 -1
- package/dist/client/vdom/index.js +3 -3
- package/dist/client/vdom/testing.js +2 -2
- package/dist/server/ai/client.d.ts +1 -1
- package/dist/server/ai/sse.d.ts +1 -1
- package/dist/server/ai/types.d.ts +2 -2
- package/dist/server/db/contracts.d.ts +5 -0
- package/dist/server/db/postgres/connection.d.ts +6 -0
- package/dist/server/index.js +32 -2
- package/dist/server/postgres/types.d.ts +3 -0
- package/docs/client.md +170 -0
- package/docs/server.md +112 -0
- package/package.json +2 -4
- package/docs/ai-contract.md +0 -418
- package/docs/compat-three-library.md +0 -290
- package/docs/components-map.md +0 -227
- package/docs/environment.md +0 -50
- package/docs/examples.md +0 -121
- package/docs/style-guide.md +0 -248
|
@@ -848,6 +848,15 @@ body.wf-dragging {
|
|
|
848
848
|
align-items: var(--wf-align, center);
|
|
849
849
|
gap: var(--wf-gap, var(--wf-gap-md));
|
|
850
850
|
}
|
|
851
|
+
|
|
852
|
+
.wf-justify-center {
|
|
853
|
+
display: flex;
|
|
854
|
+
justify-content: center;
|
|
855
|
+
}
|
|
856
|
+
:where(.wf-justify-center) {
|
|
857
|
+
align-items: var(--wf-align, center);
|
|
858
|
+
gap: var(--wf-gap, var(--wf-gap-md));
|
|
859
|
+
}
|
|
851
860
|
}
|
|
852
861
|
|
|
853
862
|
@layer layout {
|
|
@@ -1350,6 +1359,7 @@ body.wf-dragging {
|
|
|
1350
1359
|
.wf-padding-xl { padding: var(--wf-space-xl); }
|
|
1351
1360
|
|
|
1352
1361
|
/* ── padding: 轴 ── */
|
|
1362
|
+
.wf-padding-x-xs { padding-left: var(--wf-space-xs); padding-right: var(--wf-space-xs); }
|
|
1353
1363
|
.wf-padding-x-sm { padding-left: var(--wf-space-sm); padding-right: var(--wf-space-sm); }
|
|
1354
1364
|
.wf-padding-x-md { padding-left: var(--wf-space-md); padding-right: var(--wf-space-md); }
|
|
1355
1365
|
|
|
@@ -1384,6 +1394,9 @@ body.wf-dragging {
|
|
|
1384
1394
|
.wf-margin-left-sm { margin-left: var(--wf-space-sm); }
|
|
1385
1395
|
.wf-margin-x-auto { margin-left: auto; margin-right: auto; }
|
|
1386
1396
|
|
|
1397
|
+
/* ── margin: y 轴 ── */
|
|
1398
|
+
.wf-margin-y-xs { margin-top: var(--wf-space-xs); margin-bottom: var(--wf-space-xs); }
|
|
1399
|
+
|
|
1387
1400
|
/* ── gap:直接设置 gap 属性(不设 --wf-gap 变量——变量会继承污染子孙:
|
|
1388
1401
|
壳 root wf-gap-none 曾让 KPI grid 的 gap: var(--wf-gap) = 0 卡无间距) ── */
|
|
1389
1402
|
.wf-gap-none { gap: 0; }
|
|
@@ -1399,22 +1412,6 @@ body.wf-dragging {
|
|
|
1399
1412
|
.wf-height-full { height: 100%; }
|
|
1400
1413
|
}
|
|
1401
1414
|
|
|
1402
|
-
@layer utilities {
|
|
1403
|
-
/* hidden — 隐藏元素(响应式显隐唯一模式:`wf-hidden wf-flex@lg` 窄隐宽显) */
|
|
1404
|
-
.wf-hidden {
|
|
1405
|
-
display: none;
|
|
1406
|
-
}
|
|
1407
|
-
@media (min-width: 1024px) { .wf-hidden\@lg { display: none; } }
|
|
1408
|
-
|
|
1409
|
-
/* dim — 视觉淡化(运行中/历史态/次要操作) */
|
|
1410
|
-
.wf-dim {
|
|
1411
|
-
opacity: 0.7;
|
|
1412
|
-
}
|
|
1413
|
-
|
|
1414
|
-
/* cursor — 交互指针(裸值词) */
|
|
1415
|
-
.wf-pointer { cursor: pointer; }
|
|
1416
|
-
}
|
|
1417
|
-
|
|
1418
1415
|
@layer utilities {
|
|
1419
1416
|
/* block — 块级显示 */
|
|
1420
1417
|
.wf-block {
|
|
@@ -1435,6 +1432,28 @@ body.wf-dragging {
|
|
|
1435
1432
|
@media (min-width: 1024px) { .wf-flex\@lg { display: flex; } }
|
|
1436
1433
|
}
|
|
1437
1434
|
|
|
1435
|
+
@layer utilities {
|
|
1436
|
+
/* hidden — 隐藏元素。两种响应式组合:
|
|
1437
|
+
* `wf-hidden wf-flex@lg`(窄隐宽显——基础类无 !important,被 media 内 wf-flex@lg 覆盖)
|
|
1438
|
+
* `wf-flex wf-hidden@lg`(宽隐窄显——media 变体 !important,胜组件自身 display)
|
|
1439
|
+
* !important 原因(CHAT-UX 波次 2 L4):@layer 顺序下 utilities 永远输给 components
|
|
1440
|
+
* (@layer tokens,base,layout,utilities,components 顶层声明定死)——.wf-btn 的
|
|
1441
|
+
* display:inline-flex 无条件压过 hidden 变体——面板按钮桌面隐藏失效实证;
|
|
1442
|
+
* 源顺序洗牌无法修复(层叠顺序优先于源顺序)——!important 是唯一出路 */
|
|
1443
|
+
.wf-hidden {
|
|
1444
|
+
display: none;
|
|
1445
|
+
}
|
|
1446
|
+
@media (min-width: 1024px) { .wf-hidden\@lg { display: none !important; } }
|
|
1447
|
+
|
|
1448
|
+
/* dim — 视觉淡化(运行中/历史态/次要操作) */
|
|
1449
|
+
.wf-dim {
|
|
1450
|
+
opacity: 0.7;
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
/* cursor — 交互指针(裸值词) */
|
|
1454
|
+
.wf-pointer { cursor: pointer; }
|
|
1455
|
+
}
|
|
1456
|
+
|
|
1438
1457
|
@layer layout {
|
|
1439
1458
|
/* popup — 浮层基类(usePopup.portal 自动附加;Modal/Drawer 等手动浮层可选用)
|
|
1440
1459
|
*
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* weifuwu/office/docx — docx ↔ ODES DocState 双向转换(前端/服务端通用——零依赖)
|
|
3
3
|
*
|
|
4
4
|
* 参考算法:office2json(unzip → XML 树 → 路径提取 w:body → w:p → w:r → w:t),
|
|
5
|
-
* 增强提取到 ODES IR
|
|
5
|
+
* 增强提取到 ODES IR():
|
|
6
6
|
* - 段落属性:pStyle → h1/h2/h3、jc → 对齐(裁剪:样式名映射子集)
|
|
7
7
|
* - 内联格式:rPr b/i/u → marks(区间)
|
|
8
8
|
* - 表格:w:tbl → Editor 表格 embed 快照(HTML 复用现有模型)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* weifuwu/office/xlsx — xlsx ↔ ODES WorkbookState 双向转换(前端/服务端通用——零依赖)
|
|
3
3
|
*
|
|
4
4
|
* 参考算法:office2json(sheet1.xml → sheetData → row → c{t,v} + sharedStrings),
|
|
5
|
-
* 增强提取到 ODES IR
|
|
5
|
+
* 增强提取到 ODES IR():
|
|
6
6
|
* - 多 sheet:workbook.xml(sheet 名 + rId)→ rels → 各 sheetN.xml
|
|
7
7
|
* - 单元格引用:c@r(A1——office2json 丢弃——ODES 必须)
|
|
8
8
|
* - 类型:c@t(s=shared/n=number/b=bool/f=formula)→ SheetCell.kind
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* 与 createDevVerifier(生产 dev 检查)共用——消灭双实现漂移(isConnected
|
|
6
6
|
* 类误报的根治——规格只有一份——两边行为恒等)。
|
|
7
7
|
*
|
|
8
|
-
* 规格(
|
|
8
|
+
* 规格( §2.1/§3):
|
|
9
9
|
* ABSENT → CREATED → INSERTED → ACTIVE(close)→ REMOVED
|
|
10
10
|
* - create 族:ABSENT → CREATED(同形复用不变)
|
|
11
11
|
* - insert:CREATED → INSERTED(INSERTED/ACTIVE = 幂等 skip)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* vdom core — route 阶段(UIRouter——应用唯一入口——公共面)
|
|
3
3
|
*
|
|
4
|
-
* 设计(
|
|
4
|
+
* 设计( §2):Handler 签名字面同构后端——
|
|
5
5
|
* `(req: Request, ctx) => Response`——原生 Request/Response——
|
|
6
6
|
* 路由核心 = shared Trie(src/shared/router/trie.ts——前后端共用)——
|
|
7
7
|
* 静态段优先 → :param → * 通配——params 注入 req。
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* vdom core — commandToHtml(命令事件流 → HTML——流式 SSR 核心)
|
|
3
3
|
*
|
|
4
|
-
* 设计(
|
|
4
|
+
* 设计( §3):服务端消费同一 handler 的 Response——
|
|
5
5
|
* `res.body.pipeThrough(commandToHtml())` → HTTP 流式响应(边构建边吐
|
|
6
6
|
* HTML——React Fizz 同模式):
|
|
7
7
|
* - create(attrs 序列化面)→ 开标签(属性转义——style 对象 → CSS 文本)
|
|
@@ -32,8 +32,10 @@ export interface RenderCycleDeps {
|
|
|
32
32
|
diff(oldTree: VNode, nextTree: VNode): Observable<Command>;
|
|
33
33
|
/** 命令应用(applier.apply——副作用终态) */
|
|
34
34
|
apply(cmd: Command): void;
|
|
35
|
-
/** unmount 命令 →
|
|
36
|
-
|
|
35
|
+
/** unmount 命令 → 段销毁(返回是否实际销毁——幂等防御)。
|
|
36
|
+
* **beforeEpoch(2027-10——nav 链残留实修补正)**:只处理「该周期之前」
|
|
37
|
+
* 创建的段——unmount 目标永远是旧树段——同槽位 id 复用的新段不是目标 */
|
|
38
|
+
dispose(compId: string, beforeEpoch: number): boolean;
|
|
37
39
|
/** serve 活性(unmount 后周期零副作用) */
|
|
38
40
|
active(): boolean;
|
|
39
41
|
}
|
|
@@ -23,7 +23,16 @@ export interface Segment {
|
|
|
23
23
|
* 平行数组 */
|
|
24
24
|
destroy$: import('../../observable/index.ts').Subject<void>;
|
|
25
25
|
disposed: boolean;
|
|
26
|
+
/** **创建纪元(2027-10——nav 链残留实修补正)**:createSegment 打上创建
|
|
27
|
+
* 时全局纪元(渲染周期开始时递推)——cleanup 阶段(unmount 防御性
|
|
28
|
+
* dispose)只处理「当前周期之前」创建的段——unmount 命令目标永远是
|
|
29
|
+
* 旧树段——同槽位 id 复用的新段不是目标(accordion→index→actionsheet
|
|
30
|
+
* 实证:nav1 生成期的 unmount root.0.1.0 在 cleanup 阶段误杀同周期
|
|
31
|
+
* 新挂载的 index 段 → 旧输出无物可清 → 组件列表残留) */
|
|
32
|
+
epoch: number;
|
|
26
33
|
}
|
|
34
|
+
/** 渲染周期开始(纪元递推——返回新纪元) */
|
|
35
|
+
export declare function nextSegmentEpoch(): number;
|
|
27
36
|
export type SegmentMap = Map<string, Segment>;
|
|
28
37
|
/** 创建段(mount——工厂执行——hooks 环境已注入 ctx.ui) */
|
|
29
38
|
export declare function createSegment(factory: Component, props: Record<string, unknown>, ctx: UIContext, compId: string, requestSegmentRender?: () => void): Segment;
|
|
@@ -29,7 +29,7 @@ export type VNodeChild = VNode | string | number | boolean | null | undefined |
|
|
|
29
29
|
/** renderFn——每次渲染(读最新 props——**纯同步**——2027-08 断代:
|
|
30
30
|
* 异步边界 = useAsyncData/订阅 hooks——renderFn 无 async) */
|
|
31
31
|
export type RenderFn<P = Record<string, unknown>> = (props: P) => VNode | null | (VNode | null)[];
|
|
32
|
-
/** 组件(两阶段——**同步**)——2027-08 断代(
|
|
32
|
+
/** 组件(两阶段——**同步**)——2027-08 断代(Observable 架构 波次 5):
|
|
33
33
|
* - 工厂 = **同步** mount(一次——初始化状态/订阅——**无 mounting 窗口**——
|
|
34
34
|
* 同步执行不存在「半挂载」可观察状态——mouting 竞态类 bug 结构性消灭)
|
|
35
35
|
* - renderFn = 每次渲染(ctx.render()/props 变化触发——**纯同步**)
|
|
@@ -22,8 +22,9 @@ export interface DragDrop {
|
|
|
22
22
|
onDragStart: (e: DragEvent) => void;
|
|
23
23
|
onDragEnd: (e: DragEvent) => void;
|
|
24
24
|
};
|
|
25
|
-
/**
|
|
25
|
+
/** 放置目标属性(onDragEnter + dragover preventDefault + drop 解析) */
|
|
26
26
|
dropProps: {
|
|
27
|
+
onDragEnter: (e: DragEvent) => void;
|
|
27
28
|
onDragOver: (e: DragEvent) => void;
|
|
28
29
|
onDragLeave: (e: DragEvent) => void;
|
|
29
30
|
onDrop: (e: DragEvent) => void;
|
|
@@ -32,6 +33,8 @@ export interface DragDrop {
|
|
|
32
33
|
export interface DragDropOptions {
|
|
33
34
|
onDragStart?: (e: DragEvent, data?: unknown) => void;
|
|
34
35
|
onDragEnd?: (e: DragEvent) => void;
|
|
36
|
+
/** 拖入(DropZone 深度计数用——dragenter 气泡自子元素——与 dragleave 配对计数防闪烁) */
|
|
37
|
+
onDragEnter?: (e: DragEvent) => void;
|
|
35
38
|
onDragOver?: (e: DragEvent) => void;
|
|
36
39
|
onDragLeave?: (e: DragEvent) => void;
|
|
37
40
|
onDrop?: (e: DragEvent, data?: unknown) => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* vdom 命令式弹窗内核(2027-03——一个形态:ctx.popup.open——toast 心智)
|
|
3
3
|
*
|
|
4
|
-
* 设计(
|
|
4
|
+
* 设计(docs/client.md):
|
|
5
5
|
* - **唯一形态**:openPopup(opts) → PopupHandle——调用点构建内容——内核
|
|
6
6
|
* 自管理挂载/更新/卸载/销毁(挂载/卸载/销毁在实例内——无框架机制依赖)
|
|
7
7
|
* - **每次 openPopup = 独立实例**(普通闭包状态——非 hook 状态——无共享
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* vdom hooks — stable(useTween/useDrag/useVisualViewport/useReducedMotion)
|
|
3
3
|
*
|
|
4
|
-
* P1 契约补齐(
|
|
4
|
+
* P1 契约补齐( §1.1)——组件库消费缺口:
|
|
5
5
|
* - useTween(StatCard 数值动画——rAF + ease + reduced-motion 直落)
|
|
6
6
|
* - useDrag(Resizable/ImageCropper——pointerdown 捕获拖拽)
|
|
7
7
|
* - useVisualViewport(键盘弹起/缩放跟踪)
|