flux-md 0.20.1 → 0.20.2

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/client.d.ts CHANGED
@@ -158,6 +158,10 @@ export declare class FluxClient {
158
158
  * order, after the store updates) — for side effects like lazily
159
159
  * highlighting a finished code block or analytics. A committed block never
160
160
  * re-fires; the streaming tail does not (subscribe for live tail updates).
161
+ * NOTE: this is a PARSER-commit hook — the block carries the parser's raw
162
+ * id. During a setContent divergence swap the rendered view may show that
163
+ * block under a different id (an adopted old id, or a namespaced one), so
164
+ * correlate with rendered blocks via subscribe()+getSnapshot(), not this id.
161
165
  * @param options.coalesce opt-in (default `false`): collapse multiple
162
166
  * intra-frame patch notifications into ONE `requestAnimationFrame`-scheduled
163
167
  * flush to subscribers, so a React `useSyncExternalStore` consumer renders at
package/dist/client.js CHANGED
@@ -262,6 +262,10 @@ class FluxClient {
262
262
  * order, after the store updates) — for side effects like lazily
263
263
  * highlighting a finished code block or analytics. A committed block never
264
264
  * re-fires; the streaming tail does not (subscribe for live tail updates).
265
+ * NOTE: this is a PARSER-commit hook — the block carries the parser's raw
266
+ * id. During a setContent divergence swap the rendered view may show that
267
+ * block under a different id (an adopted old id, or a namespaced one), so
268
+ * correlate with rendered blocks via subscribe()+getSnapshot(), not this id.
265
269
  * @param options.coalesce opt-in (default `false`): collapse multiple
266
270
  * intra-frame patch notifications into ONE `requestAnimationFrame`-scheduled
267
271
  * flush to subscribers, so a React `useSyncExternalStore` consumer renders at
@@ -416,6 +420,9 @@ class FluxClient {
416
420
  setContent(content, opts) {
417
421
  if (content !== this.lastContent) {
418
422
  if (!this.contentDone && content.startsWith(this.lastContent)) {
423
+ if (this.lastContent === "" && content.length > 0 && this.getSnapshot().length > 0) {
424
+ this.softReset(this.getSnapshot());
425
+ }
419
426
  this.append(content.slice(this.lastContent.length));
420
427
  } else {
421
428
  const displayed = this.getSnapshot();
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flux-md",
3
- "version": "0.20.1",
3
+ "version": "0.20.2",
4
4
  "description": "Zero-dep streaming markdown for the browser. Rust→WASM core, Web Worker per stream, incremental parse with speculative closure.",
5
5
  "type": "module",
6
6
  "sideEffects": ["./dist/worker.js", "./dist/styles.css"],