@jboltai/tokui 0.2.2 → 0.2.4
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/CHANGELOG.md +53 -0
- package/dist/tokui.cjs +13 -13
- package/dist/tokui.cjs.map +1 -1
- package/dist/tokui.css +1 -1
- package/dist/tokui.mjs +1333 -1046
- package/dist/tokui.mjs.map +1 -1
- package/dist/tokui.umd.js +13 -13
- package/dist/tokui.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/index.d.ts +7 -0
- package/src/server/tokui-builder.d.ts +8 -0
- package/src/server/tokui-builder.js +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jboltai/tokui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"description": "TokUI — Zero-dependency streaming UI description & rendering framework for AI chat. Describe UI with a tiny DSL, stream over SSE, render to real DOM incrementally.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"tokui",
|
package/src/index.d.ts
CHANGED
|
@@ -49,6 +49,13 @@ export interface TokUIOptions {
|
|
|
49
49
|
locale?: string;
|
|
50
50
|
/** 是否启用流式渲染模式,默认 true */
|
|
51
51
|
streaming?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* 流式入场动画开关,默认 true。
|
|
54
|
+
* true:流式挂载的顶层元素挂 tokui-fade-in 淡入(嵌套元素与纯文本 chunk 不挂);
|
|
55
|
+
* false:流式路径完全关闭入场动画(大对话/高频流式性能场景)。
|
|
56
|
+
* 不影响一次性 render() 的入场动画。
|
|
57
|
+
*/
|
|
58
|
+
streamAnimation?: boolean;
|
|
52
59
|
/** 事件回调:('streamEnd', {}) 流结束;('component', TokUIComponentEvent) 组件交互统一出口 */
|
|
53
60
|
onEvent?: TokUIEventCallback | null;
|
|
54
61
|
/** 组件交互事件过滤器:返回 false 丢弃该事件(onEvent 降噪用,如只看某类组件) */
|
|
@@ -95,6 +95,10 @@ export declare class TokUIBuilder {
|
|
|
95
95
|
floatButton(attrs?: BuilderAttrs): this;
|
|
96
96
|
masonry(attrs?: BuilderAttrs): this;
|
|
97
97
|
|
|
98
|
+
// —— 高级网格布局(容器,需 end() 闭合)——
|
|
99
|
+
grid(attrs?: BuilderAttrs): this;
|
|
100
|
+
cell(attrs?: BuilderAttrs): this;
|
|
101
|
+
|
|
98
102
|
// —— 表格辅助 ——
|
|
99
103
|
thead(attrs?: BuilderAttrs): this;
|
|
100
104
|
theadCols(cols: any[]): this;
|
|
@@ -102,4 +106,8 @@ export declare class TokUIBuilder {
|
|
|
102
106
|
|
|
103
107
|
// —— 代码块(容器)——
|
|
104
108
|
code(attrs?: BuilderAttrs): this;
|
|
109
|
+
|
|
110
|
+
// —— AI 对话组件(plan-step 支持 [upd id:] 步骤推进)——
|
|
111
|
+
plan(attrs?: BuilderAttrs): this;
|
|
112
|
+
planStep(attrs?: BuilderAttrs): this;
|
|
105
113
|
}
|
|
@@ -296,6 +296,10 @@ class TokUIBuilder {
|
|
|
296
296
|
row_layout(attrs) { return this._open('row', attrs); }
|
|
297
297
|
/** 栅格列 */
|
|
298
298
|
col_layout(attrs) { return this._open('col', attrs); }
|
|
299
|
+
/** 高级网格容器(显式二维网格:cols/rows 轨道、areas 模板区域、gap/h 等) */
|
|
300
|
+
grid(attrs) { return this._open('grid', attrs); }
|
|
301
|
+
/** 网格单元(grid 子容器:area 区域名 / c 列跨 / r 行跨 / align / justify) */
|
|
302
|
+
cell(attrs) { return this._open('cell', attrs); }
|
|
299
303
|
/** 列表 */
|
|
300
304
|
list(attrs) { return this._open('list', attrs); }
|
|
301
305
|
/** 列表项(有内容自闭合 [item 文本],无内容开容器供嵌套子 list)。
|