@jboltai/tokui 0.2.5 → 0.2.6
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 +38 -0
- package/dist/tokui.cjs +5 -5
- package/dist/tokui.cjs.map +1 -1
- package/dist/tokui.css +1 -1
- package/dist/tokui.mjs +958 -320
- package/dist/tokui.mjs.map +1 -1
- package/dist/tokui.umd.js +5 -5
- package/dist/tokui.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/server/tokui-builder.d.ts +14 -0
- package/src/server/tokui-builder.js +27 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jboltai/tokui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
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",
|
|
@@ -106,6 +106,20 @@ export declare class TokUIBuilder {
|
|
|
106
106
|
/** 大屏缩放容器 */
|
|
107
107
|
fitScreen(attrs?: BuilderAttrs): this;
|
|
108
108
|
|
|
109
|
+
// —— 应用壳(M2 / T2.1,容器,需 end() 闭合)——
|
|
110
|
+
/** 应用壳(三件套落位 grid areas) */
|
|
111
|
+
page(attrs?: BuilderAttrs): this;
|
|
112
|
+
/** 页头(子节点为右侧动作区;bc 面包屑、sticky 吸顶) */
|
|
113
|
+
pageHeader(attrs?: BuilderAttrs): this;
|
|
114
|
+
/** 侧栏(品牌行 + 折叠钮 + 滚动主体) */
|
|
115
|
+
pageSidebar(attrs?: BuilderAttrs): this;
|
|
116
|
+
/** 主区薄包装 */
|
|
117
|
+
pageContent(attrs?: BuilderAttrs): this;
|
|
118
|
+
/** 多页签容器(act 初始激活 key) */
|
|
119
|
+
pageTabs(attrs?: BuilderAttrs): this;
|
|
120
|
+
/** 单页签(n 为 key,closeable 可关闭) */
|
|
121
|
+
pageTab(attrs?: BuilderAttrs): this;
|
|
122
|
+
|
|
109
123
|
// —— 高级网格布局(容器,需 end() 闭合)——
|
|
110
124
|
grid(attrs?: BuilderAttrs): this;
|
|
111
125
|
cell(attrs?: BuilderAttrs): this;
|
|
@@ -218,13 +218,19 @@ class TokUIBuilder {
|
|
|
218
218
|
tbody() { return this._open('tbody'); }
|
|
219
219
|
/** 表格数据行,多个值用逗号拼接,含逗号的值自动加双引号 */
|
|
220
220
|
row(...values) {
|
|
221
|
+
// T2.3:尾参可为 attrs 对象(tr id/pid/clk 等)——[tr id:x pid:y] 树形行/行点击
|
|
222
|
+
let attrs;
|
|
223
|
+
const last = values[values.length - 1];
|
|
224
|
+
if (last && typeof last === 'object' && !Array.isArray(last)) {
|
|
225
|
+
attrs = values.pop();
|
|
226
|
+
}
|
|
221
227
|
const escaped = values.map(v => {
|
|
222
228
|
const s = String(v);
|
|
223
229
|
// 只对含逗号的 cell 加引号,含冒号的交给 _selfClosing 统一处理
|
|
224
230
|
if (s.includes(',')) return `"${s}"`;
|
|
225
231
|
return s;
|
|
226
232
|
});
|
|
227
|
-
return this._selfClosing('tr', escaped.join(','));
|
|
233
|
+
return this._selfClosing('tr', escaped.join(','), attrs);
|
|
228
234
|
}
|
|
229
235
|
|
|
230
236
|
// ========== 表单组件 ==========
|
|
@@ -685,6 +691,26 @@ class TokUIBuilder {
|
|
|
685
691
|
/** 大屏缩放容器(1920×1080 设计稿等比适配) */
|
|
686
692
|
fitScreen(attrs) { return this._open('fit-screen', attrs); }
|
|
687
693
|
|
|
694
|
+
// ========== 应用壳组件(M2 Admin Pack / T2.1,均为容器需 .end()) ==========
|
|
695
|
+
|
|
696
|
+
/** 应用壳(page-header/page-sidebar/page-content 三件套落位 grid areas) */
|
|
697
|
+
page(attrs) { return this._open('page', attrs); }
|
|
698
|
+
|
|
699
|
+
/** 页头(子节点为右侧动作区;bc 逗号分级面包屑,sticky 吸顶) */
|
|
700
|
+
pageHeader(attrs) { return this._open('page-header', attrs); }
|
|
701
|
+
|
|
702
|
+
/** 侧栏(内置品牌行 + 折叠钮,子节点为主体内容) */
|
|
703
|
+
pageSidebar(attrs) { return this._open('page-sidebar', attrs); }
|
|
704
|
+
|
|
705
|
+
/** 主区薄包装(自滚动 + 裁剪防护) */
|
|
706
|
+
pageContent(attrs) { return this._open('page-content', attrs); }
|
|
707
|
+
|
|
708
|
+
/** 多页签容器(act 指定初始激活页签 key) */
|
|
709
|
+
pageTabs(attrs) { return this._open('page-tabs', attrs); }
|
|
710
|
+
|
|
711
|
+
/** 单页签(n 为 key,closeable 可关闭,del 整签移除) */
|
|
712
|
+
pageTab(attrs) { return this._open('page-tab', attrs); }
|
|
713
|
+
|
|
688
714
|
|
|
689
715
|
/** 流式闪光加载(自闭合) */
|
|
690
716
|
shimmer(attrs) { return this._selfClosing('shimmer', null, attrs); }
|