@arbidocs/blocks 0.4.155 → 0.4.157

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.
Files changed (103) hide show
  1. package/dist/{ConnectedNativeDocxComparison-OLWRQSRS.js → ConnectedNativeDocxComparison-2PLOOXSH.js} +6 -6
  2. package/dist/{ConnectedNativeDocxComparison-OLWRQSRS.js.map → ConnectedNativeDocxComparison-2PLOOXSH.js.map} +1 -1
  3. package/dist/{ConnectedNativeDocxComparison-YORMOPPN.cjs → ConnectedNativeDocxComparison-S25BPUH5.cjs} +7 -7
  4. package/dist/{ConnectedNativeDocxComparison-YORMOPPN.cjs.map → ConnectedNativeDocxComparison-S25BPUH5.cjs.map} +1 -1
  5. package/dist/{ConnectedNativeDocxEditor-34EBIIFS.js → ConnectedNativeDocxEditor-JJAGMHZC.js} +4 -4
  6. package/dist/{ConnectedNativeDocxEditor-34EBIIFS.js.map → ConnectedNativeDocxEditor-JJAGMHZC.js.map} +1 -1
  7. package/dist/{ConnectedNativeDocxEditor-EHTWGGX3.cjs → ConnectedNativeDocxEditor-YA4HWLY4.cjs} +6 -6
  8. package/dist/{ConnectedNativeDocxEditor-EHTWGGX3.cjs.map → ConnectedNativeDocxEditor-YA4HWLY4.cjs.map} +1 -1
  9. package/dist/{ConnectedStreamedWordArtifact-5DK6QGYN.cjs → ConnectedStreamedWordArtifact-EXYZAU4Y.cjs} +7 -7
  10. package/dist/ConnectedStreamedWordArtifact-EXYZAU4Y.cjs.map +1 -0
  11. package/dist/{ConnectedStreamedWordArtifact-GLIDLSAS.js → ConnectedStreamedWordArtifact-YAAXY5KY.js} +6 -6
  12. package/dist/{ConnectedStreamedWordArtifact-GLIDLSAS.js.map → ConnectedStreamedWordArtifact-YAAXY5KY.js.map} +1 -1
  13. package/dist/{NativeDocxEditor-XT5ZLFGU.js → NativeDocxEditor-JBQMH3MP.js} +3 -3
  14. package/dist/{NativeDocxEditor-XT5ZLFGU.js.map → NativeDocxEditor-JBQMH3MP.js.map} +1 -1
  15. package/dist/{NativeDocxEditor-5VBNM5I7.cjs → NativeDocxEditor-M3I776GD.cjs} +7 -7
  16. package/dist/{NativeDocxEditor-5VBNM5I7.cjs.map → NativeDocxEditor-M3I776GD.cjs.map} +1 -1
  17. package/dist/{chunk-MF5KQ4PS.js → chunk-2CWM2CFZ.js} +4 -4
  18. package/dist/{chunk-MF5KQ4PS.js.map → chunk-2CWM2CFZ.js.map} +1 -1
  19. package/dist/{chunk-6HMCF4AJ.js → chunk-5ZIYPZYE.js} +1033 -5
  20. package/dist/chunk-5ZIYPZYE.js.map +1 -0
  21. package/dist/{chunk-KHXEIEXN.js → chunk-7IRSCMNK.js} +3 -3
  22. package/dist/{chunk-KHXEIEXN.js.map → chunk-7IRSCMNK.js.map} +1 -1
  23. package/dist/{chunk-TZOQKV64.js → chunk-EWCJXUBP.js} +3 -3
  24. package/dist/{chunk-TZOQKV64.js.map → chunk-EWCJXUBP.js.map} +1 -1
  25. package/dist/{chunk-CU6LDQ57.js → chunk-F3EZDBDJ.js} +4 -4
  26. package/dist/{chunk-CU6LDQ57.js.map → chunk-F3EZDBDJ.js.map} +1 -1
  27. package/dist/{chunk-W7CWGURO.js → chunk-FTZ45WHY.js} +6 -685
  28. package/dist/chunk-FTZ45WHY.js.map +1 -0
  29. package/dist/{chunk-CQCNU5KT.cjs → chunk-IJEISII2.cjs} +6 -6
  30. package/dist/{chunk-CQCNU5KT.cjs.map → chunk-IJEISII2.cjs.map} +1 -1
  31. package/dist/{chunk-NPR5BGFF.cjs → chunk-JSQEAPTC.cjs} +26 -14
  32. package/dist/chunk-JSQEAPTC.cjs.map +1 -0
  33. package/dist/{chunk-MUDEL7UL.cjs → chunk-NPLGB4LI.cjs} +4 -703
  34. package/dist/chunk-NPLGB4LI.cjs.map +1 -0
  35. package/dist/{chunk-265GOG4W.js → chunk-ONTUMV74.js} +26 -14
  36. package/dist/chunk-ONTUMV74.js.map +1 -0
  37. package/dist/chunk-OTU5KGQ6.cjs +18 -0
  38. package/dist/{chunk-HUATKA3M.cjs.map → chunk-OTU5KGQ6.cjs.map} +1 -1
  39. package/dist/{chunk-GO3BN76C.js → chunk-PGOSIJ2I.js} +3 -3
  40. package/dist/{chunk-GO3BN76C.js.map → chunk-PGOSIJ2I.js.map} +1 -1
  41. package/dist/{chunk-WV4TD2HZ.cjs → chunk-QJFJ5JBF.cjs} +1055 -2
  42. package/dist/chunk-QJFJ5JBF.cjs.map +1 -0
  43. package/dist/chunk-S74QMZVZ.cjs +18 -0
  44. package/dist/{chunk-C3SMTA3C.cjs.map → chunk-S74QMZVZ.cjs.map} +1 -1
  45. package/dist/{chunk-KUT2Y7JF.cjs → chunk-TQIY2SVY.cjs} +5 -5
  46. package/dist/{chunk-KUT2Y7JF.cjs.map → chunk-TQIY2SVY.cjs.map} +1 -1
  47. package/dist/{chunk-757OYF6G.cjs → chunk-VY4UFXTM.cjs} +4 -4
  48. package/dist/{chunk-757OYF6G.cjs.map → chunk-VY4UFXTM.cjs.map} +1 -1
  49. package/dist/connect/docx.cjs +10 -10
  50. package/dist/connect/docx.js +6 -6
  51. package/dist/connect/index.cjs +626 -66
  52. package/dist/connect/index.cjs.map +1 -1
  53. package/dist/connect/index.js +564 -9
  54. package/dist/connect/index.js.map +1 -1
  55. package/dist/connect/viewer.cjs +43 -43
  56. package/dist/connect/viewer.js +5 -5
  57. package/dist/connection/files/index.d.ts +5 -0
  58. package/dist/connection/files/support.d.ts +2 -0
  59. package/dist/connection/files/upload/AddFromAccountsButton.d.ts +16 -0
  60. package/dist/connection/files/upload/ConnectedUpload.d.ts +36 -0
  61. package/dist/connection/files/upload/ConnectedUploadDropzone.d.ts +36 -0
  62. package/dist/connection/files/upload/EmptyWorkspaceUpload.d.ts +13 -0
  63. package/dist/connection/files/upload/useAddFromUrls.d.ts +13 -0
  64. package/dist/docx/index.cjs +47 -47
  65. package/dist/docx/index.js +3 -3
  66. package/dist/files/PrivacyExplainerModal.d.ts +8 -0
  67. package/dist/files/ShareToggle.d.ts +8 -0
  68. package/dist/files/UrlInputDialog.d.ts +24 -0
  69. package/dist/files/index.cjs +298 -278
  70. package/dist/files/index.d.ts +4 -0
  71. package/dist/files/index.js +2 -2
  72. package/dist/files/media-preview.d.ts +24 -0
  73. package/node_modules/@arbidocs/coedit/dist/hocuspocus.cjs +96 -29
  74. package/node_modules/@arbidocs/coedit/dist/hocuspocus.cjs.map +1 -1
  75. package/node_modules/@arbidocs/coedit/dist/hocuspocus.d.cts +1 -1
  76. package/node_modules/@arbidocs/coedit/dist/hocuspocus.d.ts +1 -1
  77. package/node_modules/@arbidocs/coedit/dist/hocuspocus.js +98 -31
  78. package/node_modules/@arbidocs/coedit/dist/hocuspocus.js.map +1 -1
  79. package/node_modules/@arbidocs/coedit/dist/index.cjs +96 -29
  80. package/node_modules/@arbidocs/coedit/dist/index.cjs.map +1 -1
  81. package/node_modules/@arbidocs/coedit/dist/index.d.cts +1 -1
  82. package/node_modules/@arbidocs/coedit/dist/index.d.ts +1 -1
  83. package/node_modules/@arbidocs/coedit/dist/index.js +98 -31
  84. package/node_modules/@arbidocs/coedit/dist/index.js.map +1 -1
  85. package/node_modules/@arbidocs/coedit/dist/server.cjs +98 -33
  86. package/node_modules/@arbidocs/coedit/dist/server.cjs.map +1 -1
  87. package/node_modules/@arbidocs/coedit/dist/server.d.cts +1 -1
  88. package/node_modules/@arbidocs/coedit/dist/server.d.ts +1 -1
  89. package/node_modules/@arbidocs/coedit/dist/server.js +99 -34
  90. package/node_modules/@arbidocs/coedit/dist/server.js.map +1 -1
  91. package/node_modules/@arbidocs/coedit/dist/{session-Cf9iu1Vt.d.cts → session-WGvWs6yO.d.cts} +22 -4
  92. package/node_modules/@arbidocs/coedit/dist/{session-Cf9iu1Vt.d.ts → session-WGvWs6yO.d.ts} +22 -4
  93. package/node_modules/@arbidocs/coedit/package.json +1 -1
  94. package/package.json +5 -5
  95. package/dist/ConnectedStreamedWordArtifact-5DK6QGYN.cjs.map +0 -1
  96. package/dist/chunk-265GOG4W.js.map +0 -1
  97. package/dist/chunk-6HMCF4AJ.js.map +0 -1
  98. package/dist/chunk-C3SMTA3C.cjs +0 -18
  99. package/dist/chunk-HUATKA3M.cjs +0 -18
  100. package/dist/chunk-MUDEL7UL.cjs.map +0 -1
  101. package/dist/chunk-NPR5BGFF.cjs.map +0 -1
  102. package/dist/chunk-W7CWGURO.js.map +0 -1
  103. package/dist/chunk-WV4TD2HZ.cjs.map +0 -1
@@ -5,7 +5,7 @@ import { CollaborationIdentity } from '@docx-editor.dev/core/collaboration';
5
5
  import { TreePackageStore, PackageTransactResult, HeadlessDocumentView, ImageDecodePort } from '@docx-editor.dev/core/store';
6
6
  import { R as ReferencesPort } from './port-BbN5OZHx.cjs';
7
7
  import { R as Revision } from './track-eYC94jTp.cjs';
8
- import { D as DocxCollaborationSession } from './session-Cf9iu1Vt.cjs';
8
+ import { D as DocxCollaborationSession } from './session-WGvWs6yO.cjs';
9
9
  export { C as COLLAB_PROTOCOL, D as DOCUMENT_COLLABORATION_VERSIONS } from './versions-DXiFQMA6.cjs';
10
10
  import 'y-protocols/awareness';
11
11
  import '@docx-editor.dev/core/collaboration/replication';
@@ -5,7 +5,7 @@ import { CollaborationIdentity } from '@docx-editor.dev/core/collaboration';
5
5
  import { TreePackageStore, PackageTransactResult, HeadlessDocumentView, ImageDecodePort } from '@docx-editor.dev/core/store';
6
6
  import { R as ReferencesPort } from './port-BbN5OZHx.js';
7
7
  import { R as Revision } from './track-eYC94jTp.js';
8
- import { D as DocxCollaborationSession } from './session-Cf9iu1Vt.js';
8
+ import { D as DocxCollaborationSession } from './session-WGvWs6yO.js';
9
9
  export { C as COLLAB_PROTOCOL, D as DOCUMENT_COLLABORATION_VERSIONS } from './versions-DXiFQMA6.js';
10
10
  import 'y-protocols/awareness';
11
11
  import '@docx-editor.dev/core/collaboration/replication';
@@ -1,6 +1,6 @@
1
1
  import { Awareness } from 'y-protocols/awareness';
2
2
  import { createServerAutomationHost } from '@docx-editor.dev/core/automation';
3
- import { createCollaborationDocumentPort, historyGroupOfJournal } from '@docx-editor.dev/core/collaboration/replication';
3
+ import { createCollaborationDocumentPort, historyGroupOfJournal, mapOffsetAcrossText } from '@docx-editor.dev/core/collaboration/replication';
4
4
  import { TreePackageStore, validateRasterHeader, headlessViewOfStore, ORIGIN_IDS, readOoxmlPackage, writeOoxmlPackage, readOoxmlPart, validateExternalTarget, relsPartNameFor, contentTypesPartBytes, withContentTypeOverride, readXml } from '@docx-editor.dev/core/store';
5
5
  import { resolveNumberingLevel, resolveStoryListItems, buildStyleCascadeTable, withNumberingStyleLinks, buildNumberingIndex } from '@docx-editor.dev/core/layout';
6
6
  import { zipSync, strToU8, strFromU8, unzipSync } from 'fflate';
@@ -1895,7 +1895,6 @@ function applyJournal(doc, registry, journal, origin, context) {
1895
1895
 
1896
1896
  // src/sync.ts
1897
1897
  var LOCAL_ORIGIN = /* @__PURE__ */ Symbol("arbi-coedit/local");
1898
- var DEFAULT_REMOTE_DELAY_MS = 40;
1899
1898
  var MirrorSync = class {
1900
1899
  doc;
1901
1900
  registry = new NodeRegistry();
@@ -1904,14 +1903,11 @@ var MirrorSync = class {
1904
1903
  actorId;
1905
1904
  onFailure;
1906
1905
  onLocalJournal;
1906
+ aroundRemote;
1907
1907
  disposers = [];
1908
- remoteDelayMs;
1909
1908
  operation = 0;
1910
1909
  applyingRemote = false;
1911
1910
  failed = false;
1912
- remoteDirty = false;
1913
- remoteOrigin;
1914
- remoteTimer;
1915
1911
  /** Parts whose node ids must be re-registered before the next local journal; true means all. */
1916
1912
  staleParts = null;
1917
1913
  constructor(options) {
@@ -1920,7 +1916,7 @@ var MirrorSync = class {
1920
1916
  this.actorId = options.actorId;
1921
1917
  this.onFailure = options.onFailure;
1922
1918
  this.onLocalJournal = options.onLocalJournal;
1923
- this.remoteDelayMs = options.remoteDelayMs ?? DEFAULT_REMOTE_DELAY_MS;
1919
+ this.aroundRemote = options.aroundRemote;
1924
1920
  registerMirror(this.doc, this.registry);
1925
1921
  this.cache = new MaterializeCache(this.doc);
1926
1922
  this.disposers.push(() => this.cache.destroy());
@@ -1941,16 +1937,10 @@ var MirrorSync = class {
1941
1937
  const onAfterTransaction = (transaction) => {
1942
1938
  if (transaction.origin === LOCAL_ORIGIN || this.failed) return;
1943
1939
  if (transaction.changed.size === 0 && transaction.changedParentTypes.size === 0) return;
1944
- this.remoteDirty = true;
1945
- this.remoteOrigin = transaction.origin;
1946
- if (this.remoteDelayMs <= 0) this.flushRemote();
1947
- else if (this.remoteTimer === void 0) {
1948
- this.remoteTimer = setTimeout(() => this.flushRemote(), this.remoteDelayMs);
1949
- }
1940
+ this.publishRemote(transaction.origin);
1950
1941
  };
1951
1942
  this.doc.on("afterTransaction", onAfterTransaction);
1952
1943
  this.disposers.push(() => this.doc.off("afterTransaction", onAfterTransaction));
1953
- this.disposers.push(() => clearTimeout(this.remoteTimer));
1954
1944
  }
1955
1945
  get hasFailed() {
1956
1946
  return this.failed;
@@ -1959,17 +1949,8 @@ var MirrorSync = class {
1959
1949
  beforeRemote() {
1960
1950
  this.port.flushPendingJournals();
1961
1951
  }
1962
- /** Publish any waiting remote change now. Call before a local operation runs. */
1963
- flushRemote() {
1964
- clearTimeout(this.remoteTimer);
1965
- this.remoteTimer = void 0;
1966
- if (!this.remoteDirty || this.failed) return;
1967
- this.remoteDirty = false;
1968
- this.publishRemote(this.remoteOrigin);
1969
- }
1970
1952
  /** Make the local tree equal to the room: used when the editor opened an older snapshot of it. */
1971
1953
  adopt() {
1972
- this.remoteDirty = false;
1973
1954
  this.publishRemote(void 0);
1974
1955
  }
1975
1956
  /** Re-register node ids for parts a remote publication replaced; deferred until a local edit needs them. */
@@ -1979,23 +1960,29 @@ var MirrorSync = class {
1979
1960
  this.staleParts = null;
1980
1961
  }
1981
1962
  publishRemote(origin) {
1963
+ if (this.failed) return;
1964
+ const published = this.aroundRemote?.();
1982
1965
  this.applyingRemote = true;
1983
1966
  const changed = this.cache.take();
1967
+ let ok = false;
1984
1968
  try {
1985
1969
  const result = this.port.applyRemotePackage(materialize(this.doc, this.cache, changed), {
1986
- origin: "dev.docx-editor.collaboration.remote",
1970
+ // The editor's own origin for a peer's change: it carries the local caret only across those.
1971
+ origin: ORIGIN_IDS.mutationRemote,
1987
1972
  actorId: typeof origin === "string" ? origin : this.actorId,
1988
1973
  operationId: `${this.actorId}:remote:${this.operation++}`
1989
1974
  });
1990
1975
  if (!result.ok) throw new JournalError(result.reason);
1991
1976
  if (changed === null || this.staleParts === true) this.staleParts = true;
1992
1977
  else this.staleParts = /* @__PURE__ */ new Set([...this.staleParts ?? [], ...changed]);
1978
+ ok = true;
1993
1979
  } catch (error) {
1994
1980
  this.cache.restore(changed);
1995
1981
  this.fail(error instanceof MaterializeError ? "materialize" : "apply", error);
1996
1982
  } finally {
1997
1983
  this.applyingRemote = false;
1998
1984
  }
1985
+ if (ok) published?.();
1999
1986
  }
2000
1987
  fail(code, error) {
2001
1988
  if (this.failed) return;
@@ -2049,7 +2036,6 @@ var DocxCollaborationSession = class {
2049
2036
  doc;
2050
2037
  awareness;
2051
2038
  offlineEditing;
2052
- remoteDelayMs;
2053
2039
  tracker = createCollaborationStatusTracker("initializing");
2054
2040
  statusListeners = /* @__PURE__ */ new Set();
2055
2041
  participantListeners = /* @__PURE__ */ new Set();
@@ -2062,6 +2048,10 @@ var DocxCollaborationSession = class {
2062
2048
  selectionsCache = [];
2063
2049
  selectionsKey = "[]";
2064
2050
  baselineVector;
2051
+ /** The selection the editor last published, carried across the remote changes since. */
2052
+ carried = null;
2053
+ selectionMove = null;
2054
+ inputFlush = null;
2065
2055
  disposers = [];
2066
2056
  constructor(options) {
2067
2057
  this.documentId = options.documentId;
@@ -2070,7 +2060,6 @@ var DocxCollaborationSession = class {
2070
2060
  this.doc = options.doc;
2071
2061
  this.awareness = options.awareness;
2072
2062
  this.offlineEditing = options.offlineEditing ?? false;
2073
- this.remoteDelayMs = options.remoteDelayMs;
2074
2063
  this.undoManager = new Y3.UndoManager(
2075
2064
  [
2076
2065
  this.doc.getMap("parts"),
@@ -2132,7 +2121,6 @@ var DocxCollaborationSession = class {
2132
2121
  return this.port !== void 0;
2133
2122
  }
2134
2123
  gateOperations() {
2135
- this.sync?.flushRemote();
2136
2124
  switch (this.status()) {
2137
2125
  case "ready":
2138
2126
  return this.port ? null : "collaboration-session-not-attached";
@@ -2161,7 +2149,7 @@ var DocxCollaborationSession = class {
2161
2149
  doc: this.doc,
2162
2150
  port,
2163
2151
  actorId: this.identity.actorId,
2164
- remoteDelayMs: this.remoteDelayMs,
2152
+ aroundRemote: () => this.carrySelection(),
2165
2153
  onFailure: (code, detail) => {
2166
2154
  this.markFailed(code === "journal" ? "local-mirror-failed" : "remote-apply-failed", detail);
2167
2155
  },
@@ -2185,8 +2173,21 @@ var DocxCollaborationSession = class {
2185
2173
  }
2186
2174
  /** Transport hook: call before integrating inbound Yjs data so queued local edits are mirrored first. */
2187
2175
  beforeRemote() {
2176
+ this.inputFlush?.();
2188
2177
  this.sync?.beforeRemote();
2189
2178
  }
2179
+ /**
2180
+ * Bind the editor's pending-input flush (`PaginatedSurface.flushPendingInput`). The session writes
2181
+ * below the editor's input buffer, so it lands queued typing before a remote change and lays the
2182
+ * change out right after it: the editor carries its caret at that layout, and a keystroke before
2183
+ * it would otherwise use the caret from before the change. Returns the unbind function.
2184
+ */
2185
+ bindEditorInput(flush) {
2186
+ this.inputFlush = flush;
2187
+ return () => {
2188
+ if (this.inputFlush === flush) this.inputFlush = null;
2189
+ };
2190
+ }
2190
2191
  // ── Undo ─────────────────────────────────────────────────────────────────
2191
2192
  canUndo() {
2192
2193
  return this.undoManager.undoStack.length > 0;
@@ -2199,7 +2200,6 @@ var DocxCollaborationSession = class {
2199
2200
  if (this.gateOperations() !== null || !this.canUndo()) return false;
2200
2201
  this.undoManager.stopCapturing();
2201
2202
  this.undoManager.undo();
2202
- this.sync?.flushRemote();
2203
2203
  return true;
2204
2204
  }
2205
2205
  redo() {
@@ -2207,13 +2207,79 @@ var DocxCollaborationSession = class {
2207
2207
  if (this.gateOperations() !== null || !this.canRedo()) return false;
2208
2208
  this.undoManager.stopCapturing();
2209
2209
  this.undoManager.redo();
2210
- this.sync?.flushRemote();
2211
2210
  return true;
2212
2211
  }
2213
2212
  // ── Presence ─────────────────────────────────────────────────────────────
2214
2213
  setLocalSelection(selection) {
2214
+ this.carried = selection && selection.kind !== "cells" ? { from: null, selection } : null;
2215
+ this.selectionMove = null;
2215
2216
  this.awareness.setLocalStateField("selection", selection);
2216
2217
  }
2218
+ /** Where the last remote change carried the local selection; see `carrySelection`. */
2219
+ remoteSelectionMove() {
2220
+ return this.selectionMove;
2221
+ }
2222
+ /**
2223
+ * Called before a remote change reaches the port: notes the selection's paragraphs and their text,
2224
+ * and returns what carries it across the change once the port holds the new tree. The editor
2225
+ * takes the carried selection when a local edit was coalesced with the remote change, where it
2226
+ * cannot map its caret by the text alone. Several remote changes before the editor publishes its
2227
+ * selection again chain, all from the selection it published.
2228
+ */
2229
+ carrySelection() {
2230
+ const port = this.port;
2231
+ const carried = this.carried;
2232
+ const settle = () => this.inputFlush?.();
2233
+ if (!port || !carried) return settle;
2234
+ const before = (address) => {
2235
+ const paragraph = port.paragraphByStableId(address.paragraphId);
2236
+ if (!paragraph) return null;
2237
+ const offset = Math.min(address.offset, paragraph.text.length);
2238
+ return { nodeId: paragraph.nodeId, text: paragraph.text, offset };
2239
+ };
2240
+ const anchor = before(carried.selection.anchor);
2241
+ const head = before(carried.selection.head);
2242
+ if (!anchor || !head) {
2243
+ this.carried = null;
2244
+ this.selectionMove = null;
2245
+ return settle;
2246
+ }
2247
+ const from = carried.from ?? {
2248
+ anchor: { nodeId: anchor.nodeId, offset: anchor.offset },
2249
+ head: { nodeId: head.nodeId, offset: head.offset }
2250
+ };
2251
+ return () => {
2252
+ const after = (address, was) => {
2253
+ const paragraph = port.paragraphByStableId(address.paragraphId);
2254
+ if (!paragraph) return null;
2255
+ const offset = mapOffsetAcrossText(was.offset, was.text, paragraph.text);
2256
+ return { paragraphId: address.paragraphId, nodeId: paragraph.nodeId, offset };
2257
+ };
2258
+ const nextAnchor = after(carried.selection.anchor, anchor);
2259
+ const nextHead = after(carried.selection.head, head);
2260
+ if (!nextAnchor || !nextHead) {
2261
+ this.carried = null;
2262
+ this.selectionMove = null;
2263
+ } else {
2264
+ this.carried = {
2265
+ from,
2266
+ selection: {
2267
+ ...carried.selection,
2268
+ anchor: { paragraphId: nextAnchor.paragraphId, offset: nextAnchor.offset },
2269
+ head: { paragraphId: nextHead.paragraphId, offset: nextHead.offset }
2270
+ }
2271
+ };
2272
+ this.selectionMove = {
2273
+ from,
2274
+ to: {
2275
+ anchor: { nodeId: nextAnchor.nodeId, offset: nextAnchor.offset },
2276
+ head: { nodeId: nextHead.nodeId, offset: nextHead.offset }
2277
+ }
2278
+ };
2279
+ }
2280
+ settle();
2281
+ };
2282
+ }
2217
2283
  participants() {
2218
2284
  return this.participantsCache;
2219
2285
  }
@@ -2285,6 +2351,7 @@ var DocxCollaborationSession = class {
2285
2351
  this.sync?.destroy();
2286
2352
  this.sync = void 0;
2287
2353
  this.port = void 0;
2354
+ this.inputFlush = null;
2288
2355
  this.undoManager.destroy();
2289
2356
  this.awareness.setLocalState(null);
2290
2357
  for (const dispose of this.disposers.splice(0)) dispose();
@@ -2375,8 +2442,7 @@ function openRoomAutomation(options) {
2375
2442
  doc: options.doc,
2376
2443
  awareness,
2377
2444
  documentId: options.documentId,
2378
- identity: options.identity,
2379
- remoteDelayMs: 0
2445
+ identity: options.identity
2380
2446
  });
2381
2447
  session.markReady();
2382
2448
  try {
@@ -2408,8 +2474,7 @@ function openRoomStore(options) {
2408
2474
  doc: options.doc,
2409
2475
  awareness,
2410
2476
  documentId: options.documentId,
2411
- identity: options.identity,
2412
- remoteDelayMs: 0
2477
+ identity: options.identity
2413
2478
  });
2414
2479
  session.markReady();
2415
2480
  try {