weifuwu 0.70.0 → 0.72.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 +66 -55
- package/dist/components/Accordion/Accordion.d.ts +1 -1
- package/dist/components/Affix/Affix.d.ts +1 -1
- package/dist/components/AiChat/AiChat.d.ts +2 -2
- package/dist/components/Alert/Alert.d.ts +1 -1
- package/dist/components/AlertGroup/AlertGroup.d.ts +1 -1
- package/dist/components/Anchor/Anchor.d.ts +1 -1
- package/dist/components/ApprovalCard/ApprovalCard.d.ts +3 -1
- package/dist/components/AspectRatio/AspectRatio.d.ts +1 -1
- package/dist/components/AutoComplete/AutoComplete.d.ts +1 -1
- package/dist/components/Avatar/Avatar.d.ts +1 -1
- package/dist/components/AvatarGroup/AvatarGroup.d.ts +1 -1
- package/dist/components/BackTop/BackTop.d.ts +1 -1
- package/dist/components/Badge/Badge.d.ts +7 -1
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +1 -1
- package/dist/components/Button/Button.d.ts +1 -1
- package/dist/components/Calendar/Calendar.d.ts +1 -1
- package/dist/components/Card/Card.d.ts +1 -1
- package/dist/components/Carousel/Carousel.d.ts +1 -1
- package/dist/components/Cascader/Cascader.d.ts +7 -3
- package/dist/components/Chart/Chart.d.ts +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +1 -1
- package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +1 -1
- package/dist/components/CodeBlock/CodeBlock.d.ts +1 -1
- package/dist/components/Collapse/Collapse.d.ts +1 -1
- package/dist/components/ColorPicker/ColorPicker.d.ts +1 -1
- package/dist/components/Command/Command.d.ts +1 -1
- package/dist/components/Confirm/Confirm.d.ts +2 -2
- package/dist/components/ContextMenu/ContextMenu.d.ts +1 -1
- package/dist/components/CopyButton/CopyButton.d.ts +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts +1 -1
- package/dist/components/Descriptions/Descriptions.d.ts +1 -1
- package/dist/components/DiffView/DiffView.d.ts +1 -1
- package/dist/components/Divider/Divider.d.ts +1 -1
- package/dist/components/Drawer/Drawer.d.ts +1 -1
- package/dist/components/Dropdown/Dropdown.d.ts +1 -1
- package/dist/components/Editor/Editor.d.ts +1 -1
- package/dist/components/Editor/tools/toolbar.d.ts +1 -1
- package/dist/components/EmptyState/EmptyState.d.ts +3 -2
- package/dist/components/Field/Field.d.ts +1 -1
- package/dist/components/FileUpload/FileUpload.d.ts +1 -1
- package/dist/components/FloatButton/FloatButton.d.ts +1 -1
- package/dist/components/Form/Form.d.ts +1 -1
- package/dist/components/Grid/Grid.d.ts +1 -1
- package/dist/components/Highlight/Highlight.d.ts +1 -1
- package/dist/components/HoverCard/HoverCard.d.ts +2 -2
- package/dist/components/Icon/Icon.d.ts +1 -1
- package/dist/components/Img/Img.d.ts +1 -1
- package/dist/components/InView/InView.d.ts +1 -1
- package/dist/components/InfiniteScroll/InfiniteScroll.d.ts +1 -1
- package/dist/components/Input/Input.d.ts +1 -1
- package/dist/components/InputNumber/InputNumber.d.ts +3 -3
- package/dist/components/JSONViewer/JSONViewer.d.ts +1 -1
- package/dist/components/Kanban/Kanban.d.ts +1 -1
- package/dist/components/Label/Label.d.ts +1 -1
- package/dist/components/Layout/Layout.d.ts +3 -1
- package/dist/components/Link/Link.d.ts +1 -1
- package/dist/components/List/List.d.ts +1 -1
- package/dist/components/Loading/Loading.d.ts +1 -1
- package/dist/components/LogViewer/LogViewer.d.ts +1 -1
- package/dist/components/Markdown/Markdown.d.ts +1 -1
- package/dist/components/Markdown/parser.d.ts +11 -5
- package/dist/components/Mentions/Mentions.d.ts +1 -1
- package/dist/components/Menu/Menu.d.ts +2 -2
- package/dist/components/Menubar/Menubar.d.ts +1 -1
- package/dist/components/MessageBubble/MessageBubble.d.ts +1 -1
- package/dist/components/Modal/Modal.d.ts +1 -1
- package/dist/components/NavMenu/NavMenu.d.ts +1 -1
- package/dist/components/Notification/Notification.d.ts +2 -2
- package/dist/components/PageHeader/PageHeader.d.ts +1 -1
- package/dist/components/Pagination/Pagination.d.ts +1 -1
- package/dist/components/PasswordInput/PasswordInput.d.ts +1 -1
- package/dist/components/PinInput/PinInput.d.ts +1 -1
- package/dist/components/Pipeline/Pipeline.d.ts +1 -1
- package/dist/components/Popconfirm/Popconfirm.d.ts +2 -2
- package/dist/components/Popover/Popover.d.ts +2 -2
- package/dist/components/ProgressBar/ProgressBar.d.ts +6 -1
- package/dist/components/QRCode/QRCode.d.ts +1 -1
- package/dist/components/RadioGroup/RadioGroup.d.ts +1 -1
- package/dist/components/Rate/Rate.d.ts +3 -1
- package/dist/components/Resizable/Resizable.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 -1
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +1 -1
- package/dist/components/Select/Select.d.ts +1 -1
- package/dist/components/Skeleton/Skeleton.d.ts +1 -1
- package/dist/components/Slider/Slider.d.ts +1 -1
- package/dist/components/Space/Space.d.ts +1 -1
- package/dist/components/Sparkline/Sparkline.d.ts +3 -1
- package/dist/components/StatCard/StatCard.d.ts +5 -3
- package/dist/components/Steps/Steps.d.ts +1 -1
- package/dist/components/Switch/Switch.d.ts +1 -1
- package/dist/components/Table/Table.d.ts +1 -1
- package/dist/components/Tabs/Tabs.d.ts +1 -1
- package/dist/components/Tag/Tag.d.ts +1 -1
- package/dist/components/TagsInput/TagsInput.d.ts +1 -1
- package/dist/components/Textarea/Textarea.d.ts +1 -1
- package/dist/components/ThemeSwitch/ThemeSwitch.d.ts +1 -1
- package/dist/components/Timeline/Timeline.d.ts +6 -5
- package/dist/components/Toast/Toast.d.ts +2 -2
- package/dist/components/ToggleGroup/ToggleGroup.d.ts +1 -1
- package/dist/components/ToolCallCard/ToolCallCard.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +2 -2
- package/dist/components/Tour/Tour.d.ts +1 -1
- package/dist/components/Transfer/Transfer.d.ts +7 -3
- package/dist/components/Tree/Tree.d.ts +4 -2
- package/dist/components/TreeSelect/TreeSelect.d.ts +1 -1
- package/dist/components/Typography/Typography.d.ts +1 -1
- package/dist/components/VirtualList/VirtualList.d.ts +1 -1
- package/dist/components/VirtualTable/VirtualTable.d.ts +10 -2
- package/dist/components/Watermark/Watermark.d.ts +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +13 -13
- package/dist/components/style.css +803 -320
- package/dist/dev/index.js +1 -1
- package/dist/index.js +12 -5
- package/dist/layout/weifuwu-layout.css +133 -15
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/ssr-page.d.ts +1 -1
- package/dist/ui/ssr.d.ts +1 -1
- package/dist/ui-dom/Confirm.d.ts +44 -0
- package/dist/ui-dom/Notification.d.ts +70 -0
- package/dist/ui-dom/Toast.d.ts +43 -0
- package/dist/{client → ui-dom}/diff.d.ts +7 -6
- package/dist/ui-dom/index.d.ts +33 -0
- package/dist/ui-dom/index.js +18 -0
- package/dist/ui-dom/jsx-runtime.d.ts +4 -0
- package/dist/ui-dom/jsx-runtime.js +1 -0
- package/dist/ui-dom/popup-tracker.d.ts +36 -0
- package/dist/ui-dom/registry.d.ts +39 -0
- package/dist/{client → ui-dom}/render.d.ts +14 -6
- package/dist/ui-dom/router.d.ts +66 -0
- package/dist/ui-dom/serve.d.ts +28 -0
- package/dist/ui-dom/ssr.d.ts +56 -0
- package/dist/{client → ui-dom}/types.d.ts +63 -18
- package/dist/{client → ui-dom}/ui.d.ts +9 -1
- package/dist/{client → ui-dom}/vnode.d.ts +24 -16
- package/docs/components.md +2 -2
- package/docs/custom-components.md +2 -0
- package/docs/frontend-middleware.md +3 -1
- package/docs/frontend-ui-dom.md +110 -0
- package/docs/frontend.md +3 -1
- package/docs/layout.md +37 -9
- package/docs/realtime.md +2 -0
- package/docs/saas.md +2 -0
- package/package.json +7 -7
- package/dist/client/app.d.ts +0 -26
- package/dist/client/error-boundary.d.ts +0 -23
- package/dist/client/index.d.ts +0 -54
- package/dist/client/index.js +0 -6
- package/dist/client/registry.d.ts +0 -34
- package/dist/client/router.d.ts +0 -26
- package/dist/client/type-flow.test.d.ts +0 -7
- /package/dist/{client → ui-dom}/ai.d.ts +0 -0
- /package/dist/{client → ui-dom}/browser.d.ts +0 -0
- /package/dist/{client → ui-dom}/focus-trap.d.ts +0 -0
- /package/dist/{client → ui-dom}/hydration.d.ts +0 -0
- /package/dist/{client → ui-dom}/i18n.d.ts +0 -0
- /package/dist/{client → ui-dom}/locale/en_US.d.ts +0 -0
- /package/dist/{client → ui-dom}/locale/zh_CN.d.ts +0 -0
- /package/dist/{client → ui-dom}/middleware/api.d.ts +0 -0
- /package/dist/{client → ui-dom}/middleware/auth.d.ts +0 -0
- /package/dist/{client → ui-dom}/middleware/ws.d.ts +0 -0
- /package/dist/{client → ui-dom}/motion.d.ts +0 -0
- /package/dist/{client → ui-dom}/popup.d.ts +0 -0
- /package/dist/{client → ui-dom}/reactive.d.ts +0 -0
- /package/dist/{client → ui-dom}/route-match.d.ts +0 -0
- /package/dist/{client → ui-dom}/scroll-lock.d.ts +0 -0
- /package/dist/{client → ui-dom}/use-chat.d.ts +0 -0
|
@@ -18,17 +18,23 @@ export interface UiInternal {
|
|
|
18
18
|
bumpCtxVersion(): void;
|
|
19
19
|
/** 异步批处理调度标记(dirty 微任务防重入) */
|
|
20
20
|
_dirtyScheduled?: boolean;
|
|
21
|
+
/** 渲染期调 render() 的推迟标记(防重入——见 ui.ts render 实现) */
|
|
22
|
+
_pendingRender?: boolean;
|
|
23
|
+
/** 渲染期调 dirty() 的推迟标记(防重入——见 ui.ts dirty 实现) */
|
|
24
|
+
_pendingDirty?: boolean;
|
|
21
25
|
/** ctx.ui.$() 的 WeakMap 缓存(每组件一个 $ 容器) */
|
|
22
26
|
_$cache?: Record<string, any>;
|
|
23
27
|
/** mount 阶段标记(内部——mountComponent 包裹) */
|
|
24
28
|
setMounting: (v: boolean) => void;
|
|
25
29
|
endMounting: () => void;
|
|
30
|
+
/** ErrorBoundary 注入的错误处理器(子组件 render 抛错时调用) */
|
|
31
|
+
_errorHandler?: (err: unknown) => void;
|
|
26
32
|
}
|
|
27
33
|
/** createUi 依赖(由 createApp 注入 app 级闭包状态) */
|
|
28
34
|
export interface UiDeps {
|
|
29
35
|
ctx: WfuiContext;
|
|
30
36
|
renderByIds: (ids: string[]) => void;
|
|
31
|
-
getSelfId: (ui:
|
|
37
|
+
getSelfId: (ui: WfuiContext['ui'] | undefined) => string | undefined;
|
|
32
38
|
dirtyBatch: Set<string>;
|
|
33
39
|
dirtySet: Set<string>;
|
|
34
40
|
mediaRegistry: Map<string, {
|
|
@@ -66,5 +72,7 @@ export interface UiDeps {
|
|
|
66
72
|
/** mount 阶段标记置位/恢复(mountComponent 包裹) */
|
|
67
73
|
setMounting: (v: boolean) => void;
|
|
68
74
|
endMounting: () => void;
|
|
75
|
+
/** 注册表实例(serve 注入局部;缺省 ctx.__registry) */
|
|
76
|
+
registry?: import('./registry.ts').Registry;
|
|
69
77
|
}
|
|
70
78
|
export declare function createUi(deps: UiDeps): WfuiContext['ui'] & UiInternal;
|
|
@@ -8,19 +8,24 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import type { WfuiContext } from './types.ts';
|
|
10
10
|
export type VNodeType = string | Component<any, any> | AsyncComponent | typeof Fragment | typeof Portal;
|
|
11
|
+
/**
|
|
12
|
+
* VNode 子节点合法值——组件可返回/渲染的多态内容。
|
|
13
|
+
* 递归联合:string/number/VNode/array/null/boolean 任意组合。
|
|
14
|
+
*/
|
|
15
|
+
export type VNodeChild = VNode | string | number | boolean | null | undefined | VNodeChild[];
|
|
11
16
|
export interface VNode {
|
|
12
17
|
type: VNodeType;
|
|
13
18
|
props: Record<string, any>;
|
|
14
19
|
key?: string;
|
|
15
20
|
el?: Node;
|
|
16
21
|
/** 子 VNode 缓存(用于 patchValue diff,避免重复执行组件) */
|
|
17
|
-
_child?:
|
|
22
|
+
_child?: VNode | VNode[] | null;
|
|
18
23
|
/** 远程 DOM 容器(Portal 等 remote VNode 的 DOM 所在处) */
|
|
19
24
|
_remoteEl?: HTMLElement | undefined;
|
|
20
25
|
/** VNode 的 DOM 归属:'local' 在父 DOM 树下,'remote' 在别处 */
|
|
21
26
|
_placement?: 'local' | 'remote';
|
|
22
27
|
/** 两阶段组件的 render 函数(mount 返回的函数) */
|
|
23
|
-
_render?: (props:
|
|
28
|
+
_render?: (props: Record<string, unknown>) => VNode | null;
|
|
24
29
|
/** 组件实例 ID(如 '_wf_0') */
|
|
25
30
|
_id?: string;
|
|
26
31
|
/** 自定义组件 ID(ctx.ui.selfId() 注册,跨组件精准刷新) */
|
|
@@ -29,6 +34,8 @@ export interface VNode {
|
|
|
29
34
|
_parentNode?: Node;
|
|
30
35
|
/** 组件输出的第一个 DOM 节点 */
|
|
31
36
|
_refNode?: Node | null;
|
|
37
|
+
/** Fragment 展开后的多个直属 DOM 节点范围(diff 对齐用,见 diff.ts) */
|
|
38
|
+
_childNodes?: Node[];
|
|
32
39
|
/** 组件 mount/render 时的 ctx 版本号(供三态 skip 判定) */
|
|
33
40
|
_ctxVersion?: number;
|
|
34
41
|
}
|
|
@@ -70,26 +77,27 @@ export declare const Fragment: unique symbol;
|
|
|
70
77
|
/** Portal — 将子 VNode 渲染到 document.body 下的独立容器 */
|
|
71
78
|
export declare const Portal: unique symbol;
|
|
72
79
|
/** JSX 类型声明 — 使 TypeScript 理解自定义 JSX 运行时 */
|
|
73
|
-
declare global {
|
|
74
|
-
namespace JSX {
|
|
75
|
-
type Element = VNode | null;
|
|
76
|
-
type ElementType = string | Component<any>;
|
|
77
|
-
interface IntrinsicAttributes {
|
|
78
|
-
key?: string | number;
|
|
79
|
-
}
|
|
80
|
-
interface IntrinsicElements {
|
|
81
|
-
[tag: string]: any;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
80
|
export declare function jsx(type: VNodeType, props: Record<string, any> | null, key?: string | null): VNode;
|
|
86
81
|
export declare const jsxs: typeof jsx;
|
|
87
82
|
export declare function jsxDEV(type: VNodeType, props: Record<string, any> | null, key?: string | null): VNode;
|
|
88
83
|
/** `h`(hyperscript)支持 variadic children: `h('div', {class:'x'}, child1, child2)` */
|
|
89
|
-
export declare function h(type: VNodeType, props: Record<string, any> | null, ...children:
|
|
84
|
+
export declare function h(type: VNodeType, props: Record<string, any> | null, ...children: VNodeChild[]): VNode;
|
|
90
85
|
export declare function isNative(vnode: VNode): boolean;
|
|
91
86
|
export declare function isComponent(vnode: VNode): boolean;
|
|
92
87
|
export declare function isFragment(vnode: VNode): boolean;
|
|
93
88
|
export declare function isPortal(vnode: VNode): boolean;
|
|
94
89
|
/** Portal VNode — 子节点渲染到 document.body#__wf_portal 中 */
|
|
95
|
-
export declare function createPortal(children:
|
|
90
|
+
export declare function createPortal(children: VNodeChild, portalKey?: string): VNode;
|
|
91
|
+
/** JSX 类型声明 — ui-dom 是 jsxImportSource(client 壳不再声明) */
|
|
92
|
+
declare global {
|
|
93
|
+
namespace JSX {
|
|
94
|
+
type Element = import('./vnode.ts').VNode | null;
|
|
95
|
+
type ElementType = string | ((props: any, ctx: any) => any) | typeof Fragment | typeof Portal;
|
|
96
|
+
interface IntrinsicElements {
|
|
97
|
+
[tag: string]: any;
|
|
98
|
+
}
|
|
99
|
+
interface IntrinsicAttributes {
|
|
100
|
+
key?: string | number;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
package/docs/components.md
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
> 本页为 weifuwu 官方文档拆分页 · [返回 README](../README.md)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
109 个 HTML 原语组件。每个是 `(_init, ctx) => (props) => VNode`(两阶段组件,与前端框架同一模型),引用 `--wf-*` CSS 变量做主题。另含 `confirm()` / `toast()` 命令式中间件。
|
|
6
6
|
|
|
7
7
|
> **组件速查(weifuwu 组件 ↔ antd / Element Plus / shadcn-ui 对应 + 迁移示例)**:见 [`docs/components-map.md`](components-map.md)——从其他组件库迁来的开发者按功能直接找对应组件。
|
|
8
8
|
> **自定义组件开发**:见 [docs/custom-components.md](custom-components.md)——usePopup/useControlled/对话框/AI 组件/类型纪律逐步指南。
|
|
9
9
|
|
|
10
10
|
```ts
|
|
11
11
|
import { Button, Input, Table, Modal, Toast } from 'weifuwu/components'
|
|
12
|
-
import 'weifuwu/components/style.css' // 包含 Token +
|
|
12
|
+
import 'weifuwu/components/style.css' // 包含 Token + 57 布局原语 + 136 工具类 + 组件样式,一次性引入
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
### 使用示例
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# ui-dom — 前端路由(UIRouter + uiServe,试验性)
|
|
2
|
+
|
|
3
|
+
> **试验性**:`src/ui-dom/` 是定稿架构(`design/ui-architecture.md`)的落地——
|
|
4
|
+
> **UIRouter(纯路由)+ uiServe(渲染运行时)**,复用 `weifuwu/components`
|
|
5
|
+
> (VNode 契约共享,组件零修改)。渲染算法复制自 client(局部 registry 隔离,
|
|
6
|
+
> 不与 createApp 交叉)。当前未随 npm 包发布,源码直用。
|
|
7
|
+
>
|
|
8
|
+
> 概念对齐:**req = window.location**,**res = VNode**(数据结构),
|
|
9
|
+
> **uiServe = VDOM**(落地机制),**params/query 在 ctx**(对齐后端 `ctx.params`)。
|
|
10
|
+
|
|
11
|
+
## 快速开始
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
import { UIRouter, uiServe, h } from './src/ui-dom/index.ts'
|
|
15
|
+
import { toast } from './src/ui-dom/Toast.ts'
|
|
16
|
+
import { Button } from './src/components/index.ts'
|
|
17
|
+
|
|
18
|
+
const app = new UIRouter()
|
|
19
|
+
|
|
20
|
+
app.use(toast()) // ctx 注入链(对齐后端 app.use——注入 ctx.toast)
|
|
21
|
+
|
|
22
|
+
// handler = 异步组件:async (location, ctx) => VNode($ 有效)
|
|
23
|
+
app.get('/', async (location, ctx) => {
|
|
24
|
+
const info = await ctx.data.get('/api/info', async () => ({ title: '首页' }))
|
|
25
|
+
const $ = ctx.ui.$()
|
|
26
|
+
$.clicks = $.clicks ?? 0
|
|
27
|
+
return h('div', {},
|
|
28
|
+
h('h2', {}, info.title),
|
|
29
|
+
h(Button, { onClick: () => $.clicks++ }, `点击 ${$.clicks} 次`),
|
|
30
|
+
h(Button, { variant: 'secondary', onClick: () => ctx.toast?.('提示', 'success') }, '弹 toast'),
|
|
31
|
+
)
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
app.get('/users/:id', (location, ctx) => h('div', {}, `用户 ${ctx.params.id}`))
|
|
35
|
+
app.notFound(() => h('div', {}, '404'))
|
|
36
|
+
|
|
37
|
+
uiServe(app, { root: '#root' }) // 装配点:路由已注册 → serve 监听 URL → 渲染
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## 核心概念
|
|
41
|
+
|
|
42
|
+
### req / res / 落地分离
|
|
43
|
+
|
|
44
|
+
| 概念 | 含义 |
|
|
45
|
+
|------|------|
|
|
46
|
+
| req | `window.location`(浏览器原生,不包装) |
|
|
47
|
+
| res | `VNode`(handler 返回的数据结构) |
|
|
48
|
+
| uiServe | VDOM 落地(renderValue/patchValue diff·patch DOM) |
|
|
49
|
+
| ssrPage | 服务端落地(renderSsr → HTML + `__DATA__`) |
|
|
50
|
+
|
|
51
|
+
handler 只产 VNode,落地由 serve 决定——SSR 与 SPA 是两种落地,同一 router 定义共享。
|
|
52
|
+
|
|
53
|
+
### UIRouter 三态 use(对齐后端 app.use)
|
|
54
|
+
|
|
55
|
+
| 形态 | 签名 | 用途 |
|
|
56
|
+
|------|------|------|
|
|
57
|
+
| ctx 注入 | `use(mw: AppMiddleware)` | `(ctx) => ctx`——注入 ctx.toast/confirm 等(类型累积 `UIRouter<C & O>`) |
|
|
58
|
+
| 渲染中间件 | `use(mw: UIMiddleware)` | `(location, ctx, children) => (location, ctx) => vnode`——layout/SSR 包装 children |
|
|
59
|
+
| 子路由 | `use(prefix, sub)` | 独立路由树(sub 的中间件/notFound/嵌套均生效) |
|
|
60
|
+
|
|
61
|
+
运行时按 `arg.length` 区分(1 参 = ctx 注入;3 参 = 渲染)。
|
|
62
|
+
|
|
63
|
+
### components 复用(零修改)
|
|
64
|
+
|
|
65
|
+
VNode 契约与 client 共享(Fragment/Portal symbol 同一份)——components 产的 VNode
|
|
66
|
+
直接被 ui-dom 渲染器识别。渲染算法(render/diff/createUi 19 原语)复制到 ui-dom,
|
|
67
|
+
**registry/popup-tracker/dirty 集合局部实例**(不与 createApp 交叉)。
|
|
68
|
+
|
|
69
|
+
命令式工厂(toast/confirm/notification)复制到 ui-dom(`src/ui-dom/Toast.ts` 等):
|
|
70
|
+
components 版 import client 的 mountVNode(模块级 registry)会注册错——ui-dom 版用局部。
|
|
71
|
+
|
|
72
|
+
### $ 响应式(两层)
|
|
73
|
+
|
|
74
|
+
| 层级 | 触发 | 重渲染范围 |
|
|
75
|
+
|------|------|-----------|
|
|
76
|
+
| 路由实例级 `$`(handler 的 `ctx.ui.$()`) | 赋值 | 重渲染 handler(data 缓存命中) |
|
|
77
|
+
| 组件级 `$`(子组件 `ctx.ui.$()`) | 赋值 | **仅该组件**(父 handler 不重跑) |
|
|
78
|
+
|
|
79
|
+
## SSR + hydration(端到端)
|
|
80
|
+
|
|
81
|
+
```tsx
|
|
82
|
+
// 服务端(Node 无 DOM):ssrPage → 完整 HTML + __DATA__
|
|
83
|
+
import { ssrPage } from './src/ui-dom/ssr.ts'
|
|
84
|
+
import { app } from './router.ts' // 路由定义两端共享
|
|
85
|
+
|
|
86
|
+
const { page } = await ssrPage(app, { url: '/users/42' })
|
|
87
|
+
|
|
88
|
+
// 客户端:uiServe hydrate(收养服务端 HTML + __DATA__ 种子命中不重取数)
|
|
89
|
+
uiServe(app, { root: '#root', hydrate: true })
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
- SSR 时 `ctx.data.get` 写入 dataStore → `__DATA__` 脚本;hydrate 从种子同步命中
|
|
93
|
+
- renderSsr:组件两阶段 + asyncComponent await(数据 per-request)/ Portal 内联 / 事件剥离
|
|
94
|
+
- SSR 确定性:ui 19 原语 shim 全 no-op(不启动监听/会话);渲染期非确定性由开发者规避
|
|
95
|
+
|
|
96
|
+
## ctx 注入
|
|
97
|
+
|
|
98
|
+
| 字段 | 说明 |
|
|
99
|
+
|------|------|
|
|
100
|
+
| `ctx.params` / `ctx.query` | 路由参数 / URL query(顶层,对齐后端) |
|
|
101
|
+
| `ctx.data.get/set/has` | 数据管道(缓存 + in-flight 合并 + `__DATA__` 种子) |
|
|
102
|
+
| `ctx.ui.*` | 19 原语(`$`/`dirty`/`render`/`usePopup`/`useChat`/`useInView`…) |
|
|
103
|
+
| `ctx.browser.*` | 环境抽象(复制自 client) |
|
|
104
|
+
| `ctx.toast` / `ctx.confirm` / `ctx.notification` | 命令式注入(`app.use(toast())` 等) |
|
|
105
|
+
|
|
106
|
+
## demo
|
|
107
|
+
|
|
108
|
+
`apps/ui-router-demo`:UIRouter + uiServe + components(Button/Input/Tag/Dropdown)
|
|
109
|
+
+ toast 注入 + 嵌套路由 + SSR/hydrate 端到端。
|
|
110
|
+
启动:`node apps/ui-router-demo/server.ts` → http://localhost:3100
|
package/docs/frontend.md
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
# 前端 API 核心(weifuwu/
|
|
1
|
+
# 前端 API 核心(weifuwu/ui-dom)
|
|
2
|
+
|
|
3
|
+
> ⚠️ **`weifuwu/client` 已删除**——本页为历史文档。前端运行时唯一入口是 **`weifuwu/ui-dom`**(UIRouter 纯路由 + uiServe 渲染运行时 + SSR/hydration),权威参考见 **[docs/frontend-ui-dom.md](frontend-ui-dom.md)**。本页的 createApp/router/RouteView 用法已失效,对应新 API 为 `uiServe` / `UIRouter`。
|
|
2
4
|
|
|
3
5
|
> 以下为完整 API 参考,按需查阅。新手建议先阅读 README 的「核心概念」和「快速开始」。
|
|
4
6
|
|
package/docs/layout.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> 本页为 weifuwu 官方文档拆分页 · [返回 README](../README.md)
|
|
4
4
|
|
|
5
|
-
纯 CSS
|
|
5
|
+
纯 CSS 57 个布局原语 + 136 个工具类 + 167 个主题 Token。不绑定任何 JS 框架。
|
|
6
6
|
|
|
7
7
|
> **学习路径与命名规范**:见 [`design/style-guide.md`](../design/style-guide.md)——统一语法 `wf-<域>-<名>`、三档学习(组件 → 10 核心原语 → 完整速查)、场景速查、变量定制。
|
|
8
8
|
|
|
@@ -25,7 +25,7 @@ app.get('/layout.css', (req, ctx) => ctx.ui.css('weifuwu/layout'))
|
|
|
25
25
|
|
|
26
26
|
也支持相对路径:`ctx.ui.css('./src/style.css')`。
|
|
27
27
|
|
|
28
|
-
##
|
|
28
|
+
## 57 个布局原语
|
|
29
29
|
|
|
30
30
|
| 类别 | 原语 | 效果 |
|
|
31
31
|
|------|------|------|
|
|
@@ -44,11 +44,12 @@ app.get('/layout.css', (req, ctx) => ctx.ui.css('weifuwu/layout'))
|
|
|
44
44
|
| | `wf-bottom` | align-items: flex-end |
|
|
45
45
|
| | `wf-stretch` | align-items: stretch |
|
|
46
46
|
| **弹性** | `wf-fill` | flex: 1 + min-width: 0 |
|
|
47
|
-
| | `wf-
|
|
47
|
+
| | `wf-flex-none` | flex: none(`wf-fixed` 为兼容别名——易与 position:fixed 混淆,推荐新名) |
|
|
48
48
|
| | `wf-auto` | flex: auto |
|
|
49
49
|
| | `wf-shrink` | min-width/height: 0 |
|
|
50
50
|
| **Z轴** | `wf-cover` | position: fixed + inset: 0 |
|
|
51
|
-
| | `wf-
|
|
51
|
+
| | `wf-pin` | position: fixed(角标/浮层锚点,坐标由 inline 控制——相对视口) |
|
|
52
|
+
| | `wf-pop` | position: absolute(容器内角标:配合 `wf-layer`/`wf-anchor` 父级) |
|
|
52
53
|
| | `wf-anchor` | position: relative |
|
|
53
54
|
| | `wf-layer` | position: relative + z-index |
|
|
54
55
|
| | `wf-sticky` | position: sticky |
|
|
@@ -60,17 +61,24 @@ app.get('/layout.css', (req, ctx) => ctx.ui.css('weifuwu/layout'))
|
|
|
60
61
|
| | `wf-scroll` | overflow: auto |
|
|
61
62
|
| | `wf-clip` | overflow: hidden |
|
|
62
63
|
| **显隐** | `wf-hidden` `wf-hidden@sm/md/lg` | display: none |
|
|
64
|
+
| | `wf-flex` `wf-flex@sm/md/lg` | display: flex(响应式显隐的 flex 容器恢复用——见「组合规则」) |
|
|
63
65
|
| | `wf-block` `wf-block@sm/md/lg` | display: block |
|
|
64
66
|
| | `wf-inline` | display: inline |
|
|
65
67
|
| | `wf-inline-block` | display: inline-block |
|
|
66
68
|
| | `wf-contents` | display: contents |
|
|
67
|
-
|
|
|
69
|
+
| | `wf-dim` | opacity 0.7(运行中/历史态淡化) |
|
|
70
|
+
| **间距** | `wf-p-*` / `wf-px-*` / `wf-py-*`(xs~2xl,另有 `wf-p-0`) | padding:全/水平/垂直,引用 `--wf-space-*` |
|
|
71
|
+
| | `wf-m-0` | margin: 0 |
|
|
68
72
|
| | `wf-mt-*` / `wf-mb-*` / `wf-my-*`(xs~2xl) | margin:top/bottom/垂直 |
|
|
69
|
-
| | `wf-
|
|
73
|
+
| | `wf-pt-*` / `wf-pb-*`(xs~2xl) | padding:单侧顶/底(分隔条场景) |
|
|
74
|
+
| | `wf-mx-auto` / `wf-my-auto` / `wf-mt-auto` / `wf-mb-auto` | margin: auto 居中 / flex 列推底 |
|
|
70
75
|
| | `wf-gap-*`(xs~2xl) | 为 flex/grid 原语设置 `--wf-gap` |
|
|
71
76
|
| **尺寸** | `wf-w-full` / `wf-h-full` / `wf-w-auto` | 宽/高 100%、auto |
|
|
77
|
+
| | `wf-w-xs…xl` / `wf-w-max` / `wf-w-md-auto` | 固定宽阶(`--wf-space-*` 派生)/ max-content / md 起 auto |
|
|
72
78
|
| **边框** | `wf-border` / `wf-border-t/b/l/r` | 1px 边框(`--wf-border-width` + `--wf-color-border`) |
|
|
73
|
-
| **面工具** | `wf-bg-secondary/tertiary/brand/success/warning/error/info` | 语义背景色(`--wf-color-*-bg`) |
|
|
79
|
+
| **面工具** | `wf-bg-secondary/tertiary/brand/success/warning/error/info`(`wf-bg-primary` 为 brand 别名) | 语义背景色(`--wf-color-*-bg`) |
|
|
80
|
+
| | `wf-elevate` | 抬升阴影(`--wf-shadow-*`) |
|
|
81
|
+
| | `wf-panel-in` | 内凹面板(次级背景 + 内边距) |
|
|
74
82
|
| | `wf-pill` | 胶囊圆角(999px,状态徽章/标签/色块) |
|
|
75
83
|
| | `wf-rounded-sm` `wf-rounded` `wf-rounded-md` `wf-rounded-lg` | 圆角工具(`--wf-radius-*`) |
|
|
76
84
|
| **气泡** | `wf-bubble` / `wf-bubble--own` / `wf-bubble--ai` | 聊天气泡(pre-wrap + 折行内建) |
|
|
@@ -84,13 +92,33 @@ app.get('/layout.css', (req, ctx) => ctx.ui.css('weifuwu/layout'))
|
|
|
84
92
|
| | `wf-main` | 主内容区(padding + min-width: 0) |
|
|
85
93
|
| | `wf-text-*` 排版工具 | 见下文「排版工具」 |
|
|
86
94
|
|
|
95
|
+
### 组合规则(冲突防线)
|
|
96
|
+
|
|
97
|
+
原语分两类:**布局身份类**(display/position/flex-direction——stack/row/grid/nav/center/cover/pop…)
|
|
98
|
+
与**叠加工具类**(gap/对齐/显隐——叠加在身份类上)。规则:
|
|
99
|
+
|
|
100
|
+
1. **同一元素只带一个布局身份类**——两个身份类设置同一属性不同值时 import 顺序定胜负,
|
|
101
|
+
静默失效(事故例:`wf-nav wf-row` → nav 的 column 胜,横向失效;`wf-grid wf-stack` → stack 胜,网格失效)。
|
|
102
|
+
`style-audit` 静态扫描 class 组合,命中即红。
|
|
103
|
+
2. **对齐工具可叠加**:`wf-top/right/bottom/stretch/between/around/evenly` 专门用于覆盖
|
|
104
|
+
`wf-row` 等的默认对齐(后导入获胜,组合合法)。`wf-nowrap` 专门关 `wf-row` 的 wrap。
|
|
105
|
+
3. **`wf-center` 是 column 双轴居中**(不是 justify-center)——要“行内水平居中”用 `wf-cluster`,
|
|
106
|
+
不要 `wf-row wf-center`(center 的 column 方向会静默覆盖 row)。
|
|
107
|
+
4. **响应式显隐用 `wf-flex@bp` 恢复**:`wf-hidden wf-flex@lg` = 窄隐宽显(flex 容器)。
|
|
108
|
+
不可用 `wf-block@lg`——block 会覆盖 `wf-stack` 的 display:flex,gap/mt-auto 静默失效。
|
|
109
|
+
5. **容器内角标用 `wf-pop`**(父级 `wf-layer`/`wf-anchor`);`wf-pin` 是相对视口的 fixed,
|
|
110
|
+
嵌进带壳页面会覆盖壳。
|
|
111
|
+
|
|
112
|
+
完整冲突矩阵由 `node scripts/layout-inventory.mjs --json` 生成(属性指纹自动推导)。
|
|
113
|
+
|
|
87
114
|
### 排版工具(`wf-text-*`)
|
|
88
115
|
|
|
89
116
|
| 工具 | 效果 |
|
|
90
117
|
|------|------|
|
|
91
118
|
| `wf-text-left/center/right` | text-align |
|
|
92
119
|
| `wf-text-xs…5xl` | 字号(`--wf-font-size-*`) |
|
|
93
|
-
| `wf-text-secondary/tertiary/disabled/brand` | 中性色阶 |
|
|
120
|
+
| `wf-text-secondary/tertiary/disabled/brand`(`wf-text-primary` 为 brand 别名) | 中性色阶 |
|
|
121
|
+
| `wf-nums` | tabular-nums(数值防宽度抖动) |
|
|
94
122
|
| `wf-text-success/warning/error/info` | 语义色文本(`--wf-color-*`) |
|
|
95
123
|
| `wf-text-medium/semibold/bold` | 字重 |
|
|
96
124
|
| `wf-tracking-normal/wide/wider` | letter-spacing |
|
|
@@ -101,7 +129,7 @@ app.get('/layout.css', (req, ctx) => ctx.ui.css('weifuwu/layout'))
|
|
|
101
129
|
| `wf-truncate` | 单行省略(ellipsis) |
|
|
102
130
|
| `wf-line-clamp-2/3` | 多行截断 |
|
|
103
131
|
|
|
104
|
-
##
|
|
132
|
+
## 167 个主题 Token
|
|
105
133
|
|
|
106
134
|
**双层结构**:原始层(Primitive,色值只定义一次,品牌/暗色调校改这里)+ 语义层(Semantic,组件消费)。
|
|
107
135
|
|
package/docs/realtime.md
CHANGED
|
@@ -69,6 +69,8 @@ app.get('/page', (req, ctx) => ctx.ui.html`
|
|
|
69
69
|
|
|
70
70
|
```ts
|
|
71
71
|
app.get('/app.js', (req, ctx) => ctx.ui.js('./src/main.tsx')) // 相对路径
|
|
72
|
+
|
|
73
|
+
> ⚠️ **weifuwu/client 已删除**——前端运行时唯一入口为 `weifuwu/ui-dom`,见 [frontend-ui-dom.md](frontend-ui-dom.md)。
|
|
72
74
|
app.get('/app.js', (req, ctx) => ctx.ui.js('weifuwu/client')) // 或包名
|
|
73
75
|
```
|
|
74
76
|
|
package/docs/saas.md
CHANGED
|
@@ -75,6 +75,8 @@ app.get('/me', (req, ctx) => ok(ctx.user)) // 已注入
|
|
|
75
75
|
app.post('/secure', (req, ctx) => { ctx.auth.requireAuth(); ... })
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
+
|
|
79
|
+
> ⚠️ **weifuwu/client 已删除**——前端运行时唯一入口为 `weifuwu/ui-dom`,见 [frontend-ui-dom.md](frontend-ui-dom.md)。
|
|
78
80
|
- **安全基线**:scrypt 密码哈希(per-user salt + timing-safe,异步不阻塞);access token = HMAC-SHA256 JWT(与 `weifuwu/client` 的 `auth()` 天然配对);refresh token = 不透明随机串,DB 只存哈希,logout/轮换即撤销
|
|
79
81
|
- **防枚举**:登录失败统一 401(不泄露邮箱是否存在)
|
|
80
82
|
- **`ctx.auth` 方法面**:`register` / `login` / `logout` / `requireAuth` / `setPassword(userId, newPwd)` / `createToken(type, payload, { ttlSeconds })`(邮箱验证/密码重置自接)
|
package/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weifuwu",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.72.0",
|
|
5
5
|
"description": "AI SaaS framework — (req, ctx) => Response",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
8
8
|
"types": "./dist/index.d.ts",
|
|
9
9
|
"default": "./dist/index.js"
|
|
10
10
|
},
|
|
11
|
-
"./
|
|
12
|
-
"types": "./dist/
|
|
13
|
-
"default": "./dist/
|
|
11
|
+
"./ui-dom": {
|
|
12
|
+
"types": "./dist/ui-dom/index.d.ts",
|
|
13
|
+
"default": "./dist/ui-dom/index.js"
|
|
14
14
|
},
|
|
15
|
-
"./
|
|
16
|
-
"types": "./dist/
|
|
17
|
-
"default": "./dist/
|
|
15
|
+
"./ui-dom/jsx-runtime": {
|
|
16
|
+
"types": "./dist/ui-dom/index.d.ts",
|
|
17
|
+
"default": "./dist/ui-dom/jsx-runtime.js"
|
|
18
18
|
},
|
|
19
19
|
"./layout": "./dist/layout/weifuwu-layout.css",
|
|
20
20
|
"./layout/style.css": "./dist/layout/weifuwu-layout.css",
|
package/dist/client/app.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* weifuwu/client 应用 — createApp + ctx.ui.render
|
|
3
|
-
*
|
|
4
|
-
* createApp() → app.use(mw) → app.mount('#root', RootComponent)
|
|
5
|
-
*
|
|
6
|
-
* ctx.ui 在 mount 时注入:
|
|
7
|
-
* ctx.ui.render() 同步刷新当前组件
|
|
8
|
-
* ctx.ui.render(['#id']) 同步刷新指定组件
|
|
9
|
-
* ctx.ui.dirty() 异步刷新当前组件(微任务批处理)
|
|
10
|
-
* ctx.ui.$() 响应式状态容器($.x = val 自动 dirty)
|
|
11
|
-
*
|
|
12
|
-
* render / dirty / $ 通过 prototype chain 实现组件级 scope:
|
|
13
|
-
* 每个组件 mount 时创建 childCtx.ui = Object.create(ctx.ui)
|
|
14
|
-
* 并设置 childCtx.ui._selfId = 组件 ID
|
|
15
|
-
* render() 无参时从 this._selfId 取当前组件 ID
|
|
16
|
-
*/
|
|
17
|
-
import type { AppMiddleware } from './types.ts';
|
|
18
|
-
import type { Component } from './vnode.ts';
|
|
19
|
-
/** 应用句柄:use() 链式累积中间件注入的 ctx 类型,mount() 时组件拿到完整注入 */
|
|
20
|
-
export interface App<C extends object = {}> {
|
|
21
|
-
use<I extends object, O extends object>(mw: AppMiddleware<I, O>): App<C & O>;
|
|
22
|
-
mount(rootSelector: string, root: Component<any, C>, options?: {
|
|
23
|
-
hydrate?: boolean;
|
|
24
|
-
}): Promise<void>;
|
|
25
|
-
}
|
|
26
|
-
export declare function createApp<C extends object = {}>(): App<C>;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ErrorBoundary — 错误边界组件
|
|
3
|
-
*
|
|
4
|
-
* 捕获子组件渲染时的错误,展示 fallback 替代崩溃白屏。
|
|
5
|
-
*
|
|
6
|
-
* ```tsx
|
|
7
|
-
* <ErrorBoundary fallback={<p>出错了</p>}>
|
|
8
|
-
* <UserProfile />
|
|
9
|
-
* </ErrorBoundary>
|
|
10
|
-
* ```
|
|
11
|
-
*
|
|
12
|
-
* 基于 ctx.ui._errorHandler 机制:在渲染子组件前注入错误处理器,
|
|
13
|
-
* 子组件 render 抛错时设置 error → 重新渲染 fallback。
|
|
14
|
-
*/
|
|
15
|
-
import type { WfuiContext } from './types.ts';
|
|
16
|
-
import type { VNode } from './vnode.ts';
|
|
17
|
-
export interface ErrorBoundaryProps {
|
|
18
|
-
fallback?: VNode | ((props: {
|
|
19
|
-
error: unknown;
|
|
20
|
-
}) => VNode) | null;
|
|
21
|
-
children?: any;
|
|
22
|
-
}
|
|
23
|
-
export declare function ErrorBoundary(props: ErrorBoundaryProps, ctx: WfuiContext): (props2: ErrorBoundaryProps) => VNode | null;
|
package/dist/client/index.d.ts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* weifuwu/client — VDOM 前端框架
|
|
3
|
-
*
|
|
4
|
-
* 概念:
|
|
5
|
-
* 组件 = (props, ctx) => VNode
|
|
6
|
-
* 状态 = JS 变量
|
|
7
|
-
* 更新 = ctx.ui.render()
|
|
8
|
-
* 挂载/卸载 = ref 回调
|
|
9
|
-
*
|
|
10
|
-
* 导出:
|
|
11
|
-
* h / jsx / jsxs / jsxDEV / Fragment → JSX 工厂
|
|
12
|
-
* createApp → 应用引导
|
|
13
|
-
* router / RouteView → 路由
|
|
14
|
-
* api / auth / ws → 中间件
|
|
15
|
-
* extendCtx → ctx 扩展
|
|
16
|
-
* WfuiContext / AppMiddleware / RouteDef → 类型
|
|
17
|
-
*/
|
|
18
|
-
export { h, jsx, jsxs, jsxDEV, Fragment, Portal, createPortal } from './vnode.ts';
|
|
19
|
-
export type { VNode, VNodeType, Component, AsyncComponent } from './vnode.ts';
|
|
20
|
-
export { asyncComponent, isAsyncComponent } from './vnode.ts';
|
|
21
|
-
export { createApp } from './app.ts';
|
|
22
|
-
export type { App } from './app.ts';
|
|
23
|
-
export { router, RouteView } from './router.ts';
|
|
24
|
-
export type { RouteInjected } from './router.ts';
|
|
25
|
-
export { ws } from './middleware/ws.ts';
|
|
26
|
-
export type { WsClient, WsInjected } from './middleware/ws.ts';
|
|
27
|
-
export { api } from './middleware/api.ts';
|
|
28
|
-
export { auth } from './middleware/auth.ts';
|
|
29
|
-
export type { ApiClient, ApiOptions, ApiRequestOptions, ApiInjected } from './middleware/api.ts';
|
|
30
|
-
export { ApiError } from './middleware/api.ts';
|
|
31
|
-
export type { AuthClient, AuthOptions, AuthInjected } from './middleware/auth.ts';
|
|
32
|
-
export { extendCtx } from './types.ts';
|
|
33
|
-
export type { WfuiContext, AppMiddleware, RouteDef } from './types.ts';
|
|
34
|
-
export { aiStream } from './ai.ts';
|
|
35
|
-
export type { AiStreamCallbacks, AiStreamOptions, AiStreamHandle } from './ai.ts';
|
|
36
|
-
export { toChatMessages } from './use-chat.ts';
|
|
37
|
-
export type { UiMessage, UiToolCall, UseChatOptions, UseChatState, UseChatHandle, ChatApi } from './use-chat.ts';
|
|
38
|
-
export type { WfStreamEvent, WfMessageStart, WfToken, WfUsage, WfDone, WfError, WfErrorCode, WfToolCall, WfToolResult, WfToolProgress, WfStep, WfApprovalRequest, WfApprovalResponse, WfApprovalDecision, ChatMessage, ChatParams, MessageRole, ToolCall, ToolDefinition, } from '../ai/types.ts';
|
|
39
|
-
export { ErrorBoundary } from './error-boundary.ts';
|
|
40
|
-
export type { ErrorBoundaryProps } from './error-boundary.ts';
|
|
41
|
-
export { i18n } from './i18n.ts';
|
|
42
|
-
export type { I18nOptions, I18nState, I18nInjected } from './i18n.ts';
|
|
43
|
-
export { createReactiveState } from './reactive.ts';
|
|
44
|
-
export type { ReactiveState } from './types.ts';
|
|
45
|
-
export { lockScroll, unlockScroll } from './scroll-lock.ts';
|
|
46
|
-
export { trapFocus } from './focus-trap.ts';
|
|
47
|
-
export { mountVNode, callRefCleanup, clearAsyncComponentCache } from './render.ts';
|
|
48
|
-
export { hydrateVNode } from './hydration.ts';
|
|
49
|
-
export { patchValue } from './diff.ts';
|
|
50
|
-
export { animateOut } from './motion.ts';
|
|
51
|
-
export { computeFixedPos, computeFixedPosRect } from './popup.ts';
|
|
52
|
-
export type { FixedPos, Placement } from './popup.ts';
|
|
53
|
-
export { zhCN } from './locale/zh_CN.ts';
|
|
54
|
-
export { enUS } from './locale/en_US.ts';
|