@stesura/vue-wordgard 0.4.1 → 0.4.3

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 CHANGED
@@ -1,3 +1,15 @@
1
+ ## 0.4.3 (2026-11-20)
2
+
3
+ ### New features
4
+
5
+ `batch(wg, change)` runs a change and draws what the editor's components draw from it at once: a store set in a `wg.scheduleDOMWrite` is in the DOM for the reads after it, where Vue's scheduler would draw it later.
6
+
7
+ ## 0.4.2 (2026-11-20)
8
+
9
+ ### Bug fixes
10
+
11
+ An editor drawn inside another editor's shape (a sub-editor in an atom's chrome) keeps the user's typing: the outer editor's shape no longer claims the inner editor's DOM changes, which left typed text doubled or threw.
12
+
1
13
  ## 0.4.1 (2026-11-19)
2
14
 
3
15
  ### Bug fixes
package/README.md CHANGED
@@ -388,7 +388,9 @@ Everything is exported from `@stesura/vue-wordgard`.
388
388
  - Helpers: `useMergedDOMRefs(...refs)` (one function `:ref` setting several, each given the
389
389
  element, a component's root element on a component), `staticCopy(dom)` (a copy of what an editor
390
390
  drew, without its ids and editor attributes), `isTrailingBreak(dom)` (the `<br>` ending a
391
- textblock, not a line break's).
391
+ textblock, not a line break's), `batch(wg, change)` (runs `change` and draws what the editor's
392
+ components draw from it at once: a store set in a `wg.scheduleDOMWrite` is in the DOM for the
393
+ reads after it, where Vue's scheduler would draw it later).
392
394
  - Props types: `ShapeComponentProps`, `WrapperComponentProps`, `MarkComponentProps`,
393
395
  `WidgetComponentProps`, `NodeWrapperComponentProps`.
394
396
  - `VueWordgard.create(spec)`: an editor drawn by Vue outside a component tree (tests, benchmarks).
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Wordgard, Widget } from 'wordgard/editor';
2
2
  import { RenderedDocTile, RenderedWordgard, MarkShape, SelectTypes, ComponentShape, EditorEvent, StateField } from '@stesura/wordgard-view';
3
- export { isTrailingBreak, staticCopy } from '@stesura/wordgard-view';
3
+ export { batch, isTrailingBreak, staticCopy } from '@stesura/wordgard-view';
4
4
  import { GardState } from 'wordgard/state';
5
5
  import * as vue from 'vue';
6
6
  import { Component, WatchSource, ComputedRef, ShallowRef, Ref, ComponentPublicInstance } from 'vue';
package/dist/index.js CHANGED
@@ -811,7 +811,7 @@ var vueRenderer = (dom, { wg, failed }, mount) => {
811
811
  "VueWordgard can't update from inside a Vue component's setup, render or hook: read the editor's layout from useEditorEffect, useEditorLayoutEffect or an event handler"
812
812
  );
813
813
  };
814
- const batch = (change, commit = false) => {
814
+ const batch2 = (change, commit = false) => {
815
815
  refuse();
816
816
  change();
817
817
  if ((flushUpdates(context) || commit) && last) render(last, dom);
@@ -854,12 +854,12 @@ var vueRenderer = (dom, { wg, failed }, mount) => {
854
854
  wrappers2.value = state.facet(vueNodeWrappers.reader);
855
855
  views = first;
856
856
  },
857
- commit: (state, next, publish) => batch(() => {
857
+ commit: (state, next, publish) => batch2(() => {
858
858
  publish();
859
859
  wrappers2.value = state.facet(vueNodeWrappers.reader);
860
860
  draw(next);
861
861
  }, true),
862
- batch,
862
+ batch: batch2,
863
863
  redrawsAll,
864
864
  words: vueWords
865
865
  };
@@ -1252,7 +1252,7 @@ var useWordgardRef = () => {
1252
1252
  };
1253
1253
 
1254
1254
  // src/index.ts
1255
- import { isTrailingBreak, staticCopy } from "@stesura/wordgard-view";
1255
+ import { batch, isTrailingBreak, staticCopy } from "@stesura/wordgard-view";
1256
1256
  export {
1257
1257
  DecorationRoot,
1258
1258
  NodeContent,
@@ -1261,6 +1261,7 @@ export {
1261
1261
  WordgardEditor,
1262
1262
  WordgardScope,
1263
1263
  WrappedNode,
1264
+ batch,
1264
1265
  createMarkShape,
1265
1266
  createShape,
1266
1267
  createWidgetType,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stesura/vue-wordgard",
3
- "version": "0.4.1",
3
+ "version": "0.4.3",
4
4
  "description": "A Vue view for the Wordgard rich text editor",
5
5
  "keywords": [
6
6
  "vue",
@@ -50,7 +50,7 @@
50
50
  "postpublish": "node ../../scripts/pack-manifest.js restore"
51
51
  },
52
52
  "dependencies": {
53
- "@stesura/wordgard-view": "0.4.1"
53
+ "@stesura/wordgard-view": "0.4.3"
54
54
  },
55
55
  "peerDependencies": {
56
56
  "vue": "~3.5.45",