@dou-ui/flow 0.1.0-alpha.20 → 0.1.0-alpha.22

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.
@@ -218,10 +218,20 @@ var flow_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
218
218
  /** The axis that levels two ports on this side. */
219
219
  const level = (side) => side === "left" || side === "right" ? "y" : "x";
220
220
  const same = (a, b) => a.length === b.length && a.every((id, i) => id === b[i]);
221
+ let latest = null;
222
+ const docOf = () => latest ?? toRaw(doc.value);
223
+ /** The document as extensions and comments see it: the latest commit, even before `v-model` catches up. */
224
+ const currentDoc = customRef(() => ({
225
+ get: () => {
226
+ const value = doc.value;
227
+ return latest ?? value;
228
+ },
229
+ set: (value) => doc.value = value
230
+ }));
221
231
  const { comments, extension: commentsExtension, anchors: getCommentAnchors, anchorOf: commentAnchorOf } = useFlowComments({
222
232
  props,
223
233
  emit,
224
- doc,
234
+ doc: currentDoc,
225
235
  selection,
226
236
  messages,
227
237
  transact,
@@ -299,16 +309,6 @@ var flow_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
299
309
  edges: sel.edges.filter((id) => edges.has(id))
300
310
  };
301
311
  }
302
- let latest = null;
303
- const docOf = () => latest ?? toRaw(doc.value);
304
- /** The document as extensions see it: the latest commit, even before `v-model` catches up. */
305
- const currentDoc = customRef(() => ({
306
- get: () => {
307
- const value = doc.value;
308
- return latest ?? value;
309
- },
310
- set: (value) => doc.value = value
311
- }));
312
312
  /** Runs the extensions' `transaction` hooks; `false` when one cancelled the change. */
313
313
  function check(tr) {
314
314
  for (const hook of resolved.value.transactions) {