weifuwu 0.75.0 → 0.76.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 +13 -13
- package/dist/ai/types.d.ts +2 -0
- package/dist/components/AiChat/AiChat.d.ts +5 -1
- package/dist/components/ApprovalCard/ApprovalCard.d.ts +5 -2
- package/dist/components/CitationCard/CitationCard.d.ts +38 -0
- package/dist/components/Command/Command.d.ts +1 -1
- package/dist/components/JsonSchemaForm/JsonSchemaForm.d.ts +48 -0
- package/dist/components/ReasoningBlock/ReasoningBlock.d.ts +25 -0
- package/dist/components/Select/Select.d.ts +11 -1
- package/dist/components/SessionList/SessionList.d.ts +42 -0
- package/dist/components/TreeSelect/TreeSelect.d.ts +3 -2
- package/dist/components/index.d.ts +10 -2
- package/dist/components/index.js +14 -14
- package/dist/components/style.css +608 -20
- package/dist/index.js +140 -311
- package/dist/layout/weifuwu-layout.css +9 -0
- package/dist/test/client/setup.d.ts +12 -0
- package/dist/ui/index.d.ts +2 -2
- package/dist/ui-dom/Confirm.d.ts +5 -41
- package/dist/ui-dom/Notification.d.ts +8 -70
- package/dist/ui-dom/Toast.d.ts +8 -43
- package/dist/ui-dom/hooks/chat.d.ts +11 -0
- package/dist/ui-dom/hooks/events.d.ts +30 -0
- package/dist/ui-dom/hooks/external.d.ts +20 -0
- package/dist/ui-dom/hooks/index.d.ts +31 -0
- package/dist/ui-dom/hooks/input.d.ts +33 -0
- package/dist/ui-dom/hooks/media.d.ts +17 -0
- package/dist/ui-dom/hooks/popup.d.ts +37 -0
- package/dist/ui-dom/hooks/stable.d.ts +39 -0
- package/dist/ui-dom/hooks/test/hooks.test.d.ts +1 -0
- package/dist/ui-dom/hooks/types.d.ts +78 -0
- package/dist/ui-dom/index.d.ts +19 -17
- package/dist/ui-dom/index.js +11 -11
- package/dist/ui-dom/jsx-runtime.js +1 -1
- package/dist/ui-dom/store.d.ts +24 -0
- package/dist/ui-dom/testing.d.ts +74 -0
- package/dist/ui-dom/testing.js +1 -0
- package/dist/ui-dom/testing.test.d.ts +1 -0
- package/dist/ui-dom/types.d.ts +28 -11
- package/dist/ui-dom/use-chat.d.ts +19 -14
- package/dist/ui-dom/vdom/build.d.ts +34 -0
- package/dist/ui-dom/vdom/diff.d.ts +34 -0
- package/dist/ui-dom/vdom/hydration.d.ts +17 -0
- package/dist/ui-dom/vdom/index.d.ts +23 -0
- package/dist/ui-dom/vdom/mount.d.ts +49 -0
- package/dist/ui-dom/vdom/registry.d.ts +27 -0
- package/dist/ui-dom/vdom/render.d.ts +13 -0
- package/dist/ui-dom/vdom/scheduler.d.ts +13 -0
- package/dist/ui-dom/vdom/serve.d.ts +30 -0
- package/dist/ui-dom/vdom/ssr.d.ts +44 -0
- package/dist/ui-dom/vnode.d.ts +9 -26
- package/docs/components-map.md +18 -1
- package/docs/components.md +9 -4
- package/docs/custom-components.md +14 -8
- package/docs/frontend.md +2 -2
- package/docs/layout.md +2 -2
- package/package.json +5 -1
- package/dist/ui/ssr.d.ts +0 -35
- package/dist/ui-dom/diff.d.ts +0 -28
- package/dist/ui-dom/hydration.d.ts +0 -13
- package/dist/ui-dom/reactive.d.ts +0 -6
- package/dist/ui-dom/registry.d.ts +0 -27
- package/dist/ui-dom/render.d.ts +0 -46
- package/dist/ui-dom/serve.d.ts +0 -28
- package/dist/ui-dom/ssr.d.ts +0 -57
- package/dist/ui-dom/ui.d.ts +0 -78
package/dist/ui/ssr.d.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 服务端 SSR 字符串遍历器 — async 工厂组件(形态 C)的 HTML 序列化
|
|
3
|
-
*
|
|
4
|
-
* 支持:
|
|
5
|
-
* - 同步组件(mount → render → VNode → HTML)
|
|
6
|
-
* - async 工厂组件(await 工厂 → 数据进 HTML;服务端不缓存定义,数据 per-request)
|
|
7
|
-
* - Fragment / Portal(内联子节点)
|
|
8
|
-
* - innerHTML prop(原样输出)、class/style 对象序列化
|
|
9
|
-
* - 事件处理器 / ref 剥离、文本自动转义(XSS)
|
|
10
|
-
* - 服务端 ctx shim($ no-op dirty、ctx.data 预取、selfId 隔离)
|
|
11
|
-
*
|
|
12
|
-
* 产物为 HtmlSafe 标记的安全 HTML 片段,可直接内联进 ctx.ui.html 模板。
|
|
13
|
-
*/
|
|
14
|
-
import type { Component, AsyncComponent } from '../ui-dom/vnode.ts';
|
|
15
|
-
import { HtmlSafe } from './html-safe.ts';
|
|
16
|
-
export { HtmlSafe } from './html-safe.ts';
|
|
17
|
-
export interface SsrOptions {
|
|
18
|
-
/** 服务端数据存储:ctx.data 预取结果写入此处,调用方序列化进 __DATA__ */
|
|
19
|
-
data?: Map<string, unknown>;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* SSR 渲染组件 → HTML 片段(HtmlSafe 标记,可直接内联进 ctx.ui.html 模板,不二次转义)。
|
|
23
|
-
*
|
|
24
|
-
* ```ts
|
|
25
|
-
* const data = new Map()
|
|
26
|
-
* const html = await ctx.ui.ssr(BlogPage, { slug }, { data })
|
|
27
|
-
* return ctx.ui.html`
|
|
28
|
-
* <div id="root">${html}</div>
|
|
29
|
-
* ${ctx.ui.ssrData(data)}
|
|
30
|
-
* `
|
|
31
|
-
* ```
|
|
32
|
-
*/
|
|
33
|
-
export declare function ssrToString(Comp: Component | AsyncComponent, props: Record<string, any>, serverCtx: any, opts?: SsrOptions): Promise<HtmlSafe>;
|
|
34
|
-
/** 序列化数据存储 → window.__DATA__ 脚本(防 XSS:转义 <) */
|
|
35
|
-
export declare function serializeData(data: Map<string, unknown>): string;
|
package/dist/ui-dom/diff.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* weifuwu/ui-dom 增量 diff — patchValue 及全部 diff 辅助
|
|
3
|
-
*
|
|
4
|
-
* 从 render.ts 拆出(P2 结构拆分)。依赖方向:
|
|
5
|
-
* diff.ts → render.ts(renderValue/mountComponent/patchPortal/renderPortal)
|
|
6
|
-
* diff.ts → registry.ts(callRefCleanup)
|
|
7
|
-
* render.ts 不依赖 diff.ts(单向,无环)
|
|
8
|
-
*/
|
|
9
|
-
import type { VNodeChild } from './vnode.ts';
|
|
10
|
-
import type { WfuiContext } from './types.ts';
|
|
11
|
-
export declare function patchValue(parent: Node, oldNode: Node | null, oldInput: VNodeChild, newInput: VNodeChild, ctx: WfuiContext): Node | null;
|
|
12
|
-
export declare function patchProps(el: Element, oldProps: Record<string, unknown> | null, newProps: Record<string, unknown>): void;
|
|
13
|
-
/** 为无 key 的子节点自动分配位置 key,确保 keyed diff 正确性 */
|
|
14
|
-
export declare function ensureKeys(oldChildren: VNodeChild[], newChildren: VNodeChild[]): void;
|
|
15
|
-
/**
|
|
16
|
-
* 将 children 映射到它们实际产生的 DOM 节点(每个 child 一个 Node[])。
|
|
17
|
-
*
|
|
18
|
-
* 1 VNode ≠ 1 DOM 节点:Fragment 展开成多个直属节点(_childNodes),
|
|
19
|
-
* null/boolean/Portal 产生 0 个。explicitNodes 提供限定范围(Fragment 子项
|
|
20
|
-
* 用其自身 _childNodes),否则从 source(parent.childNodes 或给定快照)按计数游标分配。
|
|
21
|
-
*/
|
|
22
|
-
export declare function mapChildDomNodes(source: Node[], children: VNodeChild[]): (Node[] | null)[];
|
|
23
|
-
export declare function normalize(children: VNodeChild): VNodeChild[];
|
|
24
|
-
/**
|
|
25
|
-
* keyed 子节点 diff。返回每个 new child 的 DOM 节点范围(newNodes,可为空)。
|
|
26
|
-
* oldNodes:old children → 实际 DOM 节点(mapChildDomNodes 结果)。
|
|
27
|
-
*/
|
|
28
|
-
export declare function patchKeyedChildren(parent: Node, oldChildren: VNodeChild[], newChildren: VNodeChild[], ctx: WfuiContext, oldNodes?: (Node[] | null)[], rangeStart?: Node | null): (Node[] | null)[];
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* weifuwu/ui-dom Hydration(游标收养)— 收养服务端 HTML,不重建 DOM
|
|
3
|
-
*
|
|
4
|
-
* 从 render.ts 拆出(P2 结构拆分)。依赖:render.ts(flattenChildren/SVG 常量)、
|
|
5
|
-
* diff.ts(patchProps)、registry.ts(idRegistry/nextComponentId/resolveAsyncFactory)。
|
|
6
|
-
*/
|
|
7
|
-
import type { VNode } from './vnode.ts';
|
|
8
|
-
import type { WfuiContext } from './types.ts';
|
|
9
|
-
/**
|
|
10
|
-
* Hydration 挂载入口:收养 container 内现有服务端 HTML。
|
|
11
|
-
* 渲染完收尾:删除服务端有、客户端没有的残留 DOM。
|
|
12
|
-
*/
|
|
13
|
-
export declare function hydrateVNode(container: Element, vnode: VNode, ctx: WfuiContext): Promise<void>;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* weifuwu/ui-dom 注册表 — 工厂版(serve 创建局部实例,隔离于 createApp 的模块级状态)
|
|
3
|
-
*
|
|
4
|
-
* 复制自 client/registry.ts(算法相同),但**无模块级单例**——uiServe 创建实例
|
|
5
|
-
* 注入 ctx.__registry,render/diff/ui 经 getRegistry(ctx) 读取,与 createApp 零交叉。
|
|
6
|
-
*/
|
|
7
|
-
import type { VNode } from './vnode.ts';
|
|
8
|
-
type UnmountHook = (id: string) => void;
|
|
9
|
-
/** 注册表实例状态 */
|
|
10
|
-
export interface Registry {
|
|
11
|
-
idCounter: number;
|
|
12
|
-
idRegistry: Map<string, VNode>;
|
|
13
|
-
unmountHooks: UnmountHook[];
|
|
14
|
-
}
|
|
15
|
-
/** 创建局部注册表(uiServe 每实例一个——组件 id/dirty/卸载钩子与 createApp 隔离) */
|
|
16
|
-
export declare function createRegistry(): Registry;
|
|
17
|
-
/** 从 ctx 取注入的注册表(render/diff/ui 统一入口;serve 注入 __registry) */
|
|
18
|
-
export declare function getRegistry(ctx: any): Registry;
|
|
19
|
-
/** 指定实例生成组件 ID */
|
|
20
|
-
export declare function nextComponentIdFor(reg: Registry): string;
|
|
21
|
-
/** 指定实例注册卸载钩子(组件从 idRegistry 注销时触发) */
|
|
22
|
-
export declare function onComponentUnmountFor(reg: Registry, hook: UnmountHook): () => void;
|
|
23
|
-
/** 包裹 ref 回调调用——用户 ref 逻辑抛错时不中断渲染/卸载管线 */
|
|
24
|
-
export declare function safeCallRef(ref: Function, arg: any, phase: 'mount' | 'cleanup', name?: string): void;
|
|
25
|
-
/** 通知 ref 清理 + Portal 子容器清理(指定实例) */
|
|
26
|
-
export declare function callRefCleanupFor(input: any, reg: Registry): void;
|
|
27
|
-
export {};
|
package/dist/ui-dom/render.d.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* weifuwu/ui-dom 渲染器 — VNode → DOM + patchValue diff
|
|
3
|
-
*
|
|
4
|
-
* render(vnode, ctx) → 首次渲染,返回 DOM
|
|
5
|
-
* patchValue(el, old, new, ctx) → 增量更新
|
|
6
|
-
*
|
|
7
|
-
* 支持:
|
|
8
|
-
* - key 属性(keyed diff)
|
|
9
|
-
* - ref / keyed diff
|
|
10
|
-
*
|
|
11
|
-
* 状态管理:组件使用闭包变量 + ctx.ui.render() 手动触发重渲染。
|
|
12
|
-
*/
|
|
13
|
-
import type { VNode, VNodeChild, Component, AsyncComponent } from './vnode.ts';
|
|
14
|
-
import type { WfuiContext } from './types.ts';
|
|
15
|
-
export declare const SVG_NS = "http://www.w3.org/2000/svg";
|
|
16
|
-
export declare const SVG_TAGS: Set<string>;
|
|
17
|
-
export declare function render(input: VNodeChild, ctx: WfuiContext): Node | null;
|
|
18
|
-
export declare function renderValue(v: VNodeChild, ctx: WfuiContext): Node | null;
|
|
19
|
-
/**
|
|
20
|
-
* 异步组件工厂缓存:同一工厂只执行一次,多实例/多渲染共享。
|
|
21
|
-
* resolved 记录已解析的定义(同步快速路径用)。
|
|
22
|
-
* (缓存本体在 registry.ts,本文件仅保留依赖 render 的调度函数)
|
|
23
|
-
*/
|
|
24
|
-
/**
|
|
25
|
-
* 占位完成后整树重渲染(async 工厂已解析,diff 收敛到目标位置)。
|
|
26
|
-
* 优先走 serve 的调度(重新执行 handler → 新树 → diff 传递 _asyncDef);
|
|
27
|
-
* 无 serve 注入(SSR/独立渲染)时回退 ui.render(['_wf_root'])。
|
|
28
|
-
*/
|
|
29
|
-
export declare function scheduleFullReRender(ctx: WfuiContext): void;
|
|
30
|
-
/**
|
|
31
|
-
* 同步 mount 组件(async 工厂占位策略):
|
|
32
|
-
* - 同步组件 → def(props, ctx) → render fn → 输出 VNode
|
|
33
|
-
* - async 工厂已解析 → 同同步组件
|
|
34
|
-
* - async 工厂未解析 → 占位(返回 null)+ 启动工厂 + 完成后整树重渲染
|
|
35
|
-
*/
|
|
36
|
-
export declare function mountComponent(Comp: Component | AsyncComponent, props: VNode['props'], vnode: VNode, ctx: WfuiContext): VNode | null;
|
|
37
|
-
/** 首次渲染 Portal:创建远程容器、渲染子节点(不返回占位节点) */
|
|
38
|
-
export declare function renderPortal(vnode: VNode, ctx: WfuiContext): void;
|
|
39
|
-
/** 更新 Portal:复用远程容器,patch 子节点(不操作父 DOM) */
|
|
40
|
-
export declare function patchPortal(oldV: VNode | null, newV: VNode, ctx: WfuiContext): void;
|
|
41
|
-
/** 展平嵌套数组 */
|
|
42
|
-
export declare function flattenChildren(children: VNodeChild): VNodeChild[];
|
|
43
|
-
export declare function mountVNode(container: Element, vnode: VNode, ctx: WfuiContext): void;
|
|
44
|
-
export { patchValue } from './diff.ts';
|
|
45
|
-
/** 模块级兼容(无 ctx 场景——独立清理,不影响活跃 registry) */
|
|
46
|
-
export declare function callRefCleanup(input: any): void;
|
package/dist/ui-dom/serve.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* weifuwu/ui-dom serve — 渲染运行时(VDOM 落地机制)
|
|
3
|
-
*
|
|
4
|
-
* 定稿架构:serveUI = VDOM(落地,对齐后端 serve(router) = HTTP 传输)。
|
|
5
|
-
*
|
|
6
|
-
* uiServe(router, { root }) 调用时路由已全部注册——serve 负责:
|
|
7
|
-
* 1. 创建渲染运行时:局部 registry + createUi(19 原语)+ popup-tracker + ctx.data/browser
|
|
8
|
-
* 2. 监听 popstate/hashchange → router.match(params 注入)→ 中间件链 → handler → vnode
|
|
9
|
-
* 3. renderValue / patchValue diff/patch DOM;组件 $ dirty → renderByIds(局部 registry)
|
|
10
|
-
*
|
|
11
|
-
* 与 createApp 隔离:registry/popup-tracker/dirty 集合全部局部实例(client 零改动)。
|
|
12
|
-
*/
|
|
13
|
-
import type { UIRouter } from './router.ts';
|
|
14
|
-
import type { WfuiContext } from './types.ts';
|
|
15
|
-
/** uiServe 选项 */
|
|
16
|
-
export interface UIServeOptions {
|
|
17
|
-
root: string | Element;
|
|
18
|
-
hydrate?: boolean;
|
|
19
|
-
}
|
|
20
|
-
/** serve 句柄 */
|
|
21
|
-
export interface UIServeHandle<C extends object = {}> {
|
|
22
|
-
/** 释放全部资源(监听/渲染状态/注册表) */
|
|
23
|
-
close(): void;
|
|
24
|
-
/** 当前 ctx(调试/测试用)——含 UIRouter ctx 注入的类型扩展 */
|
|
25
|
-
ctx: WfuiContext & C;
|
|
26
|
-
}
|
|
27
|
-
/** uiServe — 绑定唯一根节点 + URL 驱动渲染(= VDOM 落地,对齐 serve(router)) */
|
|
28
|
-
export declare function uiServe<RC extends object = {}>(router: UIRouter<RC>, options: UIServeOptions): UIServeHandle<RC>;
|
package/dist/ui-dom/ssr.d.ts
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 服务端 SSR 字符串遍历器 — async 工厂组件(形态 C)的 HTML 序列化
|
|
3
|
-
*
|
|
4
|
-
* 支持:
|
|
5
|
-
* - 同步组件(mount → render → VNode → HTML)
|
|
6
|
-
* - async 工厂组件(await 工厂 → 数据进 HTML;服务端不缓存定义,数据 per-request)
|
|
7
|
-
* - Fragment / Portal(内联子节点)
|
|
8
|
-
* - innerHTML prop(原样输出)、class/style 对象序列化
|
|
9
|
-
* - 事件处理器 / ref 剥离、文本自动转义(XSS)
|
|
10
|
-
* - 服务端 ctx shim($ no-op dirty、ctx.data 预取、selfId 隔离)
|
|
11
|
-
*
|
|
12
|
-
* 产物为 HtmlSafe 标记的安全 HTML 片段,可直接内联进 ctx.ui.html 模板。
|
|
13
|
-
*/
|
|
14
|
-
import type { Component, AsyncComponent } from './vnode.ts';
|
|
15
|
-
export interface SsrOptions {
|
|
16
|
-
/** 服务端数据存储:ctx.data 预取结果写入此处,调用方序列化进 __DATA__ */
|
|
17
|
-
data?: Map<string, unknown>;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* SSR 渲染组件 → HTML 片段(HtmlSafe 标记,可直接内联进 ctx.ui.html 模板,不二次转义)。
|
|
21
|
-
*
|
|
22
|
-
* ```ts
|
|
23
|
-
* const data = new Map()
|
|
24
|
-
* const html = await ctx.ui.ssr(BlogPage, { slug }, { data })
|
|
25
|
-
* return ctx.ui.html`
|
|
26
|
-
* <div id="root">${html}</div>
|
|
27
|
-
* ${ctx.ui.ssrData(data)}
|
|
28
|
-
* `
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
31
|
-
export declare function ssrToString(Comp: Component | AsyncComponent, props: Record<string, any>, serverCtx: any, opts?: SsrOptions): Promise<string>;
|
|
32
|
-
/** 序列化数据存储 → window.__DATA__ 脚本(防 XSS:转义 <) */
|
|
33
|
-
export declare function serializeData(data: Map<string, unknown>): string;
|
|
34
|
-
import type { UIRouter } from './router.ts';
|
|
35
|
-
export interface SsrPageResult {
|
|
36
|
-
html: string;
|
|
37
|
-
/** __DATA__ 脚本(hydration 种子) */
|
|
38
|
-
dataScript: string;
|
|
39
|
-
/** 完整 HTML(含 dataScript) */
|
|
40
|
-
page: string;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* SSR 渲染路由页面 → 完整 HTML(Node 无 DOM)。
|
|
44
|
-
* 执行 router 匹配 → 中间件链 → handler(async 组件)→ vnode → renderSsr。
|
|
45
|
-
*
|
|
46
|
-
* ```ts
|
|
47
|
-
* const { page } = await ssrPage(router, { url: '/users/42' })
|
|
48
|
-
* // 客户端 uiServe(router, { root, hydrate: true }) 收养
|
|
49
|
-
* ```
|
|
50
|
-
*/
|
|
51
|
-
export declare function ssrPage(router: UIRouter, opts: {
|
|
52
|
-
url: string;
|
|
53
|
-
title?: string;
|
|
54
|
-
lang?: string;
|
|
55
|
-
rootId?: string;
|
|
56
|
-
styles?: string[];
|
|
57
|
-
}): Promise<SsrPageResult>;
|
package/dist/ui-dom/ui.d.ts
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* weifuwu/ui-dom ctx.ui 工厂 — createApp 注入的 UI 能力
|
|
3
|
-
*
|
|
4
|
-
* 从 app.ts 拆出(P2 结构拆分)。createUi(deps) 返回完整 ui 对象:
|
|
5
|
-
* render / dirty / $ / useChat / useMedia / useBreakpoint / usePopupPosition / selfId
|
|
6
|
-
*
|
|
7
|
-
* 内部状态(_selfId/_selfVNode/_dirtySet/_ctxVersion)集中建模为 UiInternal,
|
|
8
|
-
* 消除 app.ts 中散落的 `as any`——跨模块状态误用由编译器拦截。
|
|
9
|
-
*/
|
|
10
|
-
import type { WfuiContext, PopupPosition } from './types.ts';
|
|
11
|
-
import type { VNode } from './vnode.ts';
|
|
12
|
-
/** 内部 UI 状态(ctx.ui 扩展字段)——跨模块共享,编译器可检查 */
|
|
13
|
-
export interface UiInternal {
|
|
14
|
-
_selfId?: string;
|
|
15
|
-
_selfVNode?: VNode;
|
|
16
|
-
_dirtySet: Set<string>;
|
|
17
|
-
_ctxVersion: number;
|
|
18
|
-
bumpCtxVersion(): void;
|
|
19
|
-
/** 异步批处理调度标记(dirty 微任务防重入) */
|
|
20
|
-
_dirtyScheduled?: boolean;
|
|
21
|
-
/** 渲染期调 render() 的推迟标记(防重入——见 ui.ts render 实现) */
|
|
22
|
-
_pendingRender?: boolean;
|
|
23
|
-
/** 渲染期调 dirty() 的推迟标记(防重入——见 ui.ts dirty 实现) */
|
|
24
|
-
_pendingDirty?: boolean;
|
|
25
|
-
/** ctx.ui.$() 的 WeakMap 缓存(每组件一个 $ 容器) */
|
|
26
|
-
_$cache?: Record<string, any>;
|
|
27
|
-
/** mount 阶段标记(内部——mountComponent 包裹) */
|
|
28
|
-
setMounting: (v: boolean) => void;
|
|
29
|
-
endMounting: () => void;
|
|
30
|
-
/** ErrorBoundary 注入的错误处理器(子组件 render 抛错时调用) */
|
|
31
|
-
_errorHandler?: (err: unknown) => void;
|
|
32
|
-
}
|
|
33
|
-
/** createUi 依赖(由 createApp 注入 app 级闭包状态) */
|
|
34
|
-
export interface UiDeps {
|
|
35
|
-
ctx: WfuiContext;
|
|
36
|
-
renderByIds: (ids: string[]) => void;
|
|
37
|
-
getSelfId: (ui: WfuiContext['ui'] | undefined) => string | undefined;
|
|
38
|
-
dirtyBatch: Set<string>;
|
|
39
|
-
dirtySet: Set<string>;
|
|
40
|
-
mediaRegistry: Map<string, {
|
|
41
|
-
mql?: MediaQueryList;
|
|
42
|
-
handler?: (e: MediaQueryListEvent) => void;
|
|
43
|
-
mqls?: Array<{
|
|
44
|
-
mql: MediaQueryList;
|
|
45
|
-
handler: () => void;
|
|
46
|
-
}>;
|
|
47
|
-
}>;
|
|
48
|
-
popupTrackers: Map<string, {
|
|
49
|
-
pos: PopupPosition;
|
|
50
|
-
getEl: () => HTMLElement | null;
|
|
51
|
-
isOpen: () => boolean;
|
|
52
|
-
compute: (rect: DOMRect) => {
|
|
53
|
-
top: number;
|
|
54
|
-
left: number;
|
|
55
|
-
width?: number;
|
|
56
|
-
};
|
|
57
|
-
}>;
|
|
58
|
-
scrollTrackers: Map<string, {
|
|
59
|
-
handle: {
|
|
60
|
-
y: number;
|
|
61
|
-
};
|
|
62
|
-
getScroller: () => HTMLElement | Window;
|
|
63
|
-
}>;
|
|
64
|
-
schedulePopupRecompute: () => void;
|
|
65
|
-
/** 惰性挂载全局 scroll/resize 监听(幂等) */
|
|
66
|
-
ensurePopupListeners: () => void;
|
|
67
|
-
destroyPopupListeners: () => void;
|
|
68
|
-
/** 渲染保护期(dirty 被忽略) */
|
|
69
|
-
isRendering: () => boolean;
|
|
70
|
-
/** mount 阶段(组件工厂执行——$ 初始化赋值丢弃) */
|
|
71
|
-
isMounting: () => boolean;
|
|
72
|
-
/** mount 阶段标记置位/恢复(mountComponent 包裹) */
|
|
73
|
-
setMounting: (v: boolean) => void;
|
|
74
|
-
endMounting: () => void;
|
|
75
|
-
/** 注册表实例(serve 注入局部;缺省 ctx.__registry) */
|
|
76
|
-
registry?: import('./registry.ts').Registry;
|
|
77
|
-
}
|
|
78
|
-
export declare function createUi(deps: UiDeps): WfuiContext['ui'] & UiInternal;
|