@jboltai/tokui 0.1.8 → 0.2.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/dist/tokui.cjs +11 -7
- package/dist/tokui.cjs.map +1 -1
- package/dist/tokui.css +1 -1
- package/dist/tokui.mjs +3123 -1793
- package/dist/tokui.mjs.map +1 -1
- package/dist/tokui.umd.js +11 -7
- package/dist/tokui.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/server/tokui-builder.js +13 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jboltai/tokui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
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",
|
|
@@ -153,6 +153,19 @@ class TokUIBuilder {
|
|
|
153
153
|
return this;
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
+
/** KaTeX 公式(容器=块级 / inline:true → [katex f:"公式"] 行内;渲染依赖宿主加载 katex,无插件回退源码) */
|
|
157
|
+
katex(content, inline) {
|
|
158
|
+
return inline
|
|
159
|
+
? this._selfClosing('katex', null, { f: content })
|
|
160
|
+
: (this.chunks.push(`[katex]${content}[/katex]`), this);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/** Mermaid 图(容器;渲染依赖宿主加载 mermaid,无插件回退代码块) */
|
|
164
|
+
mermaid(content) {
|
|
165
|
+
this.chunks.push(`[mermaid]${content}[/mermaid]`);
|
|
166
|
+
return this;
|
|
167
|
+
}
|
|
168
|
+
|
|
156
169
|
/** 分割线 */
|
|
157
170
|
hr() { this.chunks.push('[hr]'); return this; }
|
|
158
171
|
|