weifuwu 0.89.1 → 0.90.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 +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/index.d.ts +4 -0
- package/dist/client/components/index.js +39 -39
- package/dist/client/components/style.css +238 -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 +1 -3
- 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
|
@@ -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(键盘弹起/缩放跟踪)
|