@jboltai/tokui 0.2.4 → 0.2.5
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 +359 -0
- package/README.md +2 -2
- package/dist/tokui.cjs +9 -9
- package/dist/tokui.cjs.map +1 -1
- package/dist/tokui.css +1 -1
- package/dist/tokui.mjs +3046 -1985
- package/dist/tokui.mjs.map +1 -1
- package/dist/tokui.umd.js +9 -9
- package/dist/tokui.umd.js.map +1 -1
- package/package.json +2 -1
- package/src/server/tokui-builder.d.ts +11 -0
- package/src/server/tokui-builder.js +19 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jboltai/tokui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
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",
|
|
@@ -91,6 +91,7 @@
|
|
|
91
91
|
"typecheck": "tsc",
|
|
92
92
|
"coverage": "c8 --include='src/**/*.js' --exclude='src/server/**' npm run test:all",
|
|
93
93
|
"server": "node demo/server/sse-server.js",
|
|
94
|
+
"demo:validate": "node demo/server/validate-demos.js",
|
|
94
95
|
"demo:sync": "npm run build && cp dist/tokui.umd.js dist/tokui.css demo/lib/ && perl -i -ne 'print unless m{^//# sourceMappingURL=}' demo/lib/tokui.umd.js && cp src/server/tokui-builder.js demo/server/tokui-builder.js",
|
|
95
96
|
"dev": "vite",
|
|
96
97
|
"build": "vite build --mode lib",
|
|
@@ -94,6 +94,17 @@ export declare class TokUIBuilder {
|
|
|
94
94
|
editable(attrs?: BuilderAttrs): this;
|
|
95
95
|
floatButton(attrs?: BuilderAttrs): this;
|
|
96
96
|
masonry(attrs?: BuilderAttrs): this;
|
|
97
|
+
scrollArea(attrs?: BuilderAttrs): this;
|
|
98
|
+
/** 科技边框容器(容器) */
|
|
99
|
+
panel(attrs?: BuilderAttrs): this;
|
|
100
|
+
/** 指标卡(容器) */
|
|
101
|
+
kpi(attrs?: BuilderAttrs): this;
|
|
102
|
+
/** 数字翻牌器(自闭合) */
|
|
103
|
+
flipNum(attrs?: BuilderAttrs): this;
|
|
104
|
+
/** 轮播榜单(容器) */
|
|
105
|
+
scrollboard(attrs?: BuilderAttrs): this;
|
|
106
|
+
/** 大屏缩放容器 */
|
|
107
|
+
fitScreen(attrs?: BuilderAttrs): this;
|
|
97
108
|
|
|
98
109
|
// —— 高级网格布局(容器,需 end() 闭合)——
|
|
99
110
|
grid(attrs?: BuilderAttrs): this;
|
|
@@ -348,9 +348,9 @@ class TokUIBuilder {
|
|
|
348
348
|
var a = attrs || {};
|
|
349
349
|
// hasInline 判定:凡带内联数据载体的 chart 均自闭合。
|
|
350
350
|
// d=柱/折/面积/饼/雷达/散点/气泡/直方/瀑布/箱线/K线/树图; tasks=甘特;
|
|
351
|
-
// rows=热力; nodes+flows=桑基; v=仪表盘/进度条(单值)
|
|
351
|
+
// rows=热力; nodes+flows=桑基; v=仪表盘/进度条(单值); region=地图省级热力。
|
|
352
352
|
// 漏判会让本应自闭合的 chart 走容器分支,.end() 错位闭合 → 后续栅格结构串味乱套。
|
|
353
|
-
var hasInline = a.d || a.tasks || a.rows || (a.nodes && a.flows) ||
|
|
353
|
+
var hasInline = a.d || a.tasks || a.rows || a.region || (a.nodes && a.flows) ||
|
|
354
354
|
(a.v !== undefined && (a.t === 'gauge' || a.t === 'progress'));
|
|
355
355
|
// 布局属性前置:流式预览阶段 d/tasks 边到边长,若 orient/stack/smooth/area 排在数据后,
|
|
356
356
|
// parser 半成品看不到 → 预览用默认布局,] 闭合才翻转(如 orient:h 末尾到达致纵向→横向闪)。
|
|
@@ -668,6 +668,23 @@ class TokUIBuilder {
|
|
|
668
668
|
|
|
669
669
|
/** 终端输出(容器) */
|
|
670
670
|
terminal(attrs) { return this._open('terminal', attrs); }
|
|
671
|
+
// ========== 数据大屏组件(M1 Dashboard Pack) ==========
|
|
672
|
+
|
|
673
|
+
/** 科技边框容器(容器) */
|
|
674
|
+
panel(attrs) { return this._open('panel', attrs); }
|
|
675
|
+
|
|
676
|
+
/** 指标卡(容器,子节点为底部说明行) */
|
|
677
|
+
kpi(attrs) { return this._open('kpi', attrs); }
|
|
678
|
+
|
|
679
|
+
/** 数字翻牌器(自闭合) */
|
|
680
|
+
flipNum(attrs) { return this._selfClosing('flip-num', null, attrs); }
|
|
681
|
+
|
|
682
|
+
/** 轮播榜单(容器,可加 tr 子节点行) */
|
|
683
|
+
scrollboard(attrs) { return this._open('scrollboard', attrs); }
|
|
684
|
+
|
|
685
|
+
/** 大屏缩放容器(1920×1080 设计稿等比适配) */
|
|
686
|
+
fitScreen(attrs) { return this._open('fit-screen', attrs); }
|
|
687
|
+
|
|
671
688
|
|
|
672
689
|
/** 流式闪光加载(自闭合) */
|
|
673
690
|
shimmer(attrs) { return this._selfClosing('shimmer', null, attrs); }
|