@jboltai/tokui 0.1.6 → 0.1.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jboltai/tokui",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
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",
@@ -256,6 +256,16 @@ class TokUIBuilder {
256
256
  /** 容器内原始文本(用于 textarea/md/code 等容器组件) */
257
257
  text(content) { this.chunks.push(String(content)); return this; }
258
258
 
259
+ // ========== 行内格式组件(p/list 等容器内的文本修饰) ==========
260
+
261
+ /** 粗体 */ b(content) { return this._selfClosing('b', content); }
262
+ /** 粗体(strong 语义) */ strong(content) { return this._selfClosing('strong', content); }
263
+ /** 斜体 */ em(content) { return this._selfClosing('em', content); }
264
+ /** 高亮标记 */ mark(content) { return this._selfClosing('mark', content); }
265
+ /** 删除线 */ del(content) { return this._selfClosing('del', content); }
266
+ /** 下标 */ sub(content) { return this._selfClosing('sub', content); }
267
+ /** 上标 */ sup(content) { return this._selfClosing('sup', content); }
268
+
259
269
  // ========== 布局组件 ==========
260
270
 
261
271
  /** 卡片(容器模式:需 .end() 关闭) */
@@ -598,8 +608,8 @@ class TokUIBuilder {
598
608
  /** 计划步骤(自闭合或容器) */
599
609
  planStep(attrs) { return this._selfClosing('plan-step', null, attrs); }
600
610
 
601
- /** Agent 状态卡片(自闭合或容器) */
602
- agent(attrs) { return attrs && (attrs.status || attrs.name) && !attrs._container ? this._selfClosing('agent', null, attrs) : this._open('agent', attrs); }
611
+ /** Agent 状态卡片(自闭合;agent 组件纯 attr 驱动,无 children 语义) */
612
+ agent(attrs) { return this._selfClosing('agent', null, attrs); }
603
613
 
604
614
  /** 文件树(容器) */
605
615
  fileTree(attrs) { return this._open('file-tree', attrs); }