@livx.cc/bare-v3 0.1.0-alpha.61 → 0.1.0-alpha.62
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.
|
@@ -97,6 +97,8 @@ function openEmphasis(para) {
|
|
|
97
97
|
var ALERTS = { note: "info", info: "info", tip: "success", important: "info", warning: "warning", caution: "danger", danger: "danger" };
|
|
98
98
|
var STYLE_ID = "b3-markdown-stream-style";
|
|
99
99
|
var STYLE = `
|
|
100
|
+
.b3-prose > :is(.b3-md-stats,.b3-table-wrap,.b3-alert,.b3-md-code,.b3-md-bars){margin-block:1rem;}
|
|
101
|
+
.b3-prose > :first-child{margin-block-start:0;}
|
|
100
102
|
.b3-md-appear{animation:b3-md-in var(--b3-duration,.2s) ease-out;}
|
|
101
103
|
@keyframes b3-md-in{from{opacity:0;transform:translateY(3px);}}
|
|
102
104
|
.b3-md-caret{display:inline-block;inline-size:.5em;block-size:1em;vertical-align:-.15em;margin-inline-start:2px;background:currentColor;animation:b3-md-blink 1s steps(2) infinite;}
|
|
@@ -165,6 +167,7 @@ class MarkdownStream {
|
|
|
165
167
|
attach(el) {
|
|
166
168
|
this.detach();
|
|
167
169
|
this.el = el;
|
|
170
|
+
el.replaceChildren();
|
|
168
171
|
this.buf = "";
|
|
169
172
|
this.nodes = [];
|
|
170
173
|
this.ended = false;
|
|
@@ -184,7 +187,9 @@ class MarkdownStream {
|
|
|
184
187
|
this.buf += chunk;
|
|
185
188
|
this.render(true);
|
|
186
189
|
}
|
|
187
|
-
end() {
|
|
190
|
+
end(finalText) {
|
|
191
|
+
if (finalText !== undefined)
|
|
192
|
+
this.buf = String(finalText);
|
|
188
193
|
this.ended = true;
|
|
189
194
|
this.render(false);
|
|
190
195
|
}
|
package/dist/manifest.json
CHANGED
|
@@ -50,8 +50,8 @@ returns is sanitized.
|
|
|
50
50
|
- **Footnotes and other GFM extras** are not built in; add a marked extension via `markedOptions`, e.g.
|
|
51
51
|
`markedOptions: markedFootnote()` (from `marked-footnote`) for `Note[^1]` / `[^1]: x`.
|
|
52
52
|
|
|
53
|
-
Methods: `attach(el)`, `push(chunk)`, `end()`, `toHtml(src)`, `detach()`. `end()` finalises the
|
|
54
|
-
stream
|
|
53
|
+
Methods: `attach(el)`, `push(chunk)`, `end(finalText?)`, `toHtml(src)`, `detach()`. `end()` finalises the
|
|
54
|
+
stream. If the host returns a complete reply, pass it to `end(reply)` to reconcile missing tokens; unchanged blocks retain their DOM. `attach(el)` clears the target for a new reply. A later `push()` is ignored with a console warning; call `attach(el)` to start a new one. `settle(buffer)`, `promptGuide(options)` and
|
|
55
55
|
`stickToBottom(scroller)` are exported on their own.
|
|
56
56
|
|
|
57
57
|
## Agent / LLM integration
|