edytor 0.1.0-next.38 → 0.1.0-next.40

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 (259) hide show
  1. package/README.md +2 -2
  2. package/dist/block/block.svelte.d.ts +0 -11
  3. package/dist/block/block.svelte.js +4 -34
  4. package/dist/block/block.utils.d.ts +9 -19
  5. package/dist/block/block.utils.js +4 -15
  6. package/dist/clipboard/createClipboardFragment.js +1 -1
  7. package/dist/clipboard/htmlFlow.d.ts +2 -2
  8. package/dist/clipboard/htmlFlow.js +2 -2
  9. package/dist/clipboard/serializeClipboardFragment.js +1 -1
  10. package/dist/cloudflare/DocumentRoom.d.ts +3 -11
  11. package/dist/cloudflare/DocumentRoom.js +6 -12
  12. package/dist/cloudflare/history.d.ts +6 -6
  13. package/dist/cloudflare/history.js +4 -3
  14. package/dist/cloudflare/index.d.ts +2 -2
  15. package/dist/cloudflare/index.js +2 -2
  16. package/dist/cloudflare/locks.d.ts +2 -2
  17. package/dist/cloudflare/move.d.ts +1 -11
  18. package/dist/cloudflare/move.js +0 -5
  19. package/dist/cloudflare/room/access.js +2 -2
  20. package/dist/cloudflare/room/admission.js +7 -7
  21. package/dist/cloudflare/room/comments.d.ts +1 -1
  22. package/dist/cloudflare/room/comments.js +1 -1
  23. package/dist/cloudflare/room/context.d.ts +1 -4
  24. package/dist/cloudflare/room/forged.d.ts +3 -3
  25. package/dist/cloudflare/room/forged.js +6 -6
  26. package/dist/cloudflare/room/storage.js +1 -1
  27. package/dist/cloudflare/room/updates.d.ts +2 -2
  28. package/dist/cloudflare/room/updates.js +3 -3
  29. package/dist/cloudflare/routeDocumentSocket.js +3 -3
  30. package/dist/collaboration/RemoteSelections.svelte +1 -1
  31. package/dist/collaboration/awarenessSelection.d.ts +4 -4
  32. package/dist/collaboration/awarenessSelection.js +2 -2
  33. package/dist/collaboration/documentSync.d.ts +1 -1
  34. package/dist/collaboration/remoteSelection.d.ts +1 -1
  35. package/dist/collaboration/remoteSelection.js +3 -3
  36. package/dist/components/Block.svelte +6 -6
  37. package/dist/components/Content.svelte +3 -3
  38. package/dist/components/Content.svelte.d.ts +1 -1
  39. package/dist/components/Edytor.svelte +10 -17
  40. package/dist/components/Edytor.svelte.d.ts +0 -4
  41. package/dist/components/InlineBlock.svelte +1 -1
  42. package/dist/components/Mark.svelte +2 -2
  43. package/dist/components/SuggestionRanges.svelte +1 -1
  44. package/dist/components/Text.svelte +5 -5
  45. package/dist/crdt/admission.d.ts +1 -1
  46. package/dist/crdt/admission.js +1 -1
  47. package/dist/crdt/anchors.d.ts +3 -3
  48. package/dist/crdt/attribution/attribution.d.ts +6 -6
  49. package/dist/crdt/attribution/attribution.js +3 -3
  50. package/dist/crdt/attribution/block.d.ts +7 -7
  51. package/dist/crdt/attribution/block.js +3 -3
  52. package/dist/crdt/attribution/index.d.ts +2 -2
  53. package/dist/crdt/attribution/index.js +2 -2
  54. package/dist/crdt/data.d.ts +1 -1
  55. package/dist/crdt/data.js +5 -5
  56. package/dist/crdt/doc/anchors.js +1 -1
  57. package/dist/crdt/doc/capability.d.ts +5 -5
  58. package/dist/crdt/doc/capability.js +16 -16
  59. package/dist/crdt/doc/delete.js +1 -1
  60. package/dist/crdt/doc/events.js +3 -3
  61. package/dist/crdt/doc/funnel.js +6 -6
  62. package/dist/crdt/doc/gate.d.ts +2 -2
  63. package/dist/crdt/doc/history.js +10 -10
  64. package/dist/crdt/doc/layout.js +4 -4
  65. package/dist/crdt/doc/meta.js +8 -8
  66. package/dist/crdt/doc/moves.js +9 -9
  67. package/dist/crdt/doc/plan.d.ts +1 -1
  68. package/dist/crdt/doc/plan.js +1 -1
  69. package/dist/crdt/doc/reads.js +8 -8
  70. package/dist/crdt/doc/seed.d.ts +2 -2
  71. package/dist/crdt/doc/seed.js +5 -5
  72. package/dist/crdt/doc/split-merge.js +12 -12
  73. package/dist/crdt/doc/steps.js +18 -18
  74. package/dist/crdt/document.d.ts +6 -6
  75. package/dist/crdt/document.js +8 -8
  76. package/dist/crdt/edytor-doc.js +17 -17
  77. package/dist/crdt/engine.js +4 -4
  78. package/dist/crdt/flow.d.ts +10 -10
  79. package/dist/crdt/flow.js +6 -6
  80. package/dist/crdt/incarnations.d.ts +8 -8
  81. package/dist/crdt/incarnations.js +3 -3
  82. package/dist/crdt/index.d.ts +2 -5
  83. package/dist/crdt/index.js +6 -6
  84. package/dist/crdt/migration/generation.d.ts +2 -2
  85. package/dist/crdt/migration/legacy-schema.d.ts +1 -1
  86. package/dist/crdt/migration/migrate.d.ts +1 -12
  87. package/dist/crdt/migration/migrate.js +9 -9
  88. package/dist/crdt/nodes.d.ts +4 -4
  89. package/dist/crdt/placement/display.d.ts +8 -8
  90. package/dist/crdt/placement/display.js +12 -12
  91. package/dist/crdt/placement/model.d.ts +5 -5
  92. package/dist/crdt/placement/model.js +15 -15
  93. package/dist/crdt/placement/rank.d.ts +4 -4
  94. package/dist/crdt/placement/rank.js +8 -8
  95. package/dist/crdt/placement/resolve.js +2 -2
  96. package/dist/crdt/placement/source.d.ts +4 -4
  97. package/dist/crdt/placement/source.js +4 -4
  98. package/dist/crdt/protocols/awareness.js +1 -1
  99. package/dist/crdt/protocols/comments.d.ts +1 -1
  100. package/dist/crdt/protocols/comments.js +1 -1
  101. package/dist/crdt/protocols/envelope.d.ts +1 -1
  102. package/dist/crdt/protocols/envelope.js +1 -1
  103. package/dist/crdt/protocols/sync.d.ts +1 -1
  104. package/dist/crdt/protocols/sync.js +3 -3
  105. package/dist/crdt/providers/container.d.ts +2 -2
  106. package/dist/crdt/providers/container.js +3 -3
  107. package/dist/crdt/providers/index.d.ts +1 -6
  108. package/dist/crdt/providers/index.js +18 -14
  109. package/dist/crdt/providers/indexeddb.js +8 -8
  110. package/dist/crdt/providers/room.d.ts +2 -2
  111. package/dist/crdt/providers/room.js +7 -7
  112. package/dist/crdt/providers/websocket.js +9 -9
  113. package/dist/crdt/purge.d.ts +1 -1
  114. package/dist/crdt/purge.js +3 -3
  115. package/dist/crdt/rand.d.ts +3 -3
  116. package/dist/crdt/rand.js +3 -3
  117. package/dist/crdt/rangeDelete.d.ts +2 -2
  118. package/dist/crdt/rangeDelete.js +2 -2
  119. package/dist/crdt/restore.d.ts +2 -2
  120. package/dist/crdt/schema.d.ts +7 -7
  121. package/dist/crdt/schema.js +8 -8
  122. package/dist/crdt/semantics.d.ts +1 -1
  123. package/dist/crdt/semantics.js +1 -1
  124. package/dist/crdt/storage.d.ts +1 -1
  125. package/dist/crdt/storage.js +1 -1
  126. package/dist/crdt/structs.d.ts +1 -1
  127. package/dist/crdt/structs.js +1 -1
  128. package/dist/crdt/text/delete-index.d.ts +3 -3
  129. package/dist/crdt/text/delete-index.js +3 -3
  130. package/dist/crdt/text/deletes.d.ts +5 -5
  131. package/dist/crdt/text/deletes.js +8 -8
  132. package/dist/crdt/text/index/anchored.js +1 -1
  133. package/dist/crdt/text/index/checks.js +2 -2
  134. package/dist/crdt/text/index/claims.d.ts +1 -1
  135. package/dist/crdt/text/index/claims.js +1 -1
  136. package/dist/crdt/text/index/fold.js +8 -8
  137. package/dist/crdt/text/index/placement.d.ts +1 -1
  138. package/dist/crdt/text/index/placement.js +13 -13
  139. package/dist/crdt/text/index/records.js +4 -4
  140. package/dist/crdt/text/index/report.js +6 -6
  141. package/dist/crdt/text/index/shared.d.ts +1 -1
  142. package/dist/crdt/text/index/shared.js +2 -2
  143. package/dist/crdt/text/index/state.d.ts +3 -3
  144. package/dist/crdt/text/index/state.js +3 -3
  145. package/dist/crdt/text/index/streams.d.ts +1 -1
  146. package/dist/crdt/text/index/streams.js +3 -3
  147. package/dist/crdt/text/marks.d.ts +1 -1
  148. package/dist/crdt/text/marks.js +1 -1
  149. package/dist/crdt/text/model.d.ts +4 -4
  150. package/dist/crdt/text/model.js +11 -11
  151. package/dist/crdt/text/ranges.d.ts +2 -2
  152. package/dist/crdt/text/ranges.js +2 -2
  153. package/dist/crdt/text/rows.d.ts +1 -1
  154. package/dist/crdt/text/runs.d.ts +4 -4
  155. package/dist/crdt/text/runs.js +1 -1
  156. package/dist/crdt/vendor/yjs/API-NOTES.md +1 -1
  157. package/dist/crdt/vendor/yjs/UPSTREAM.md +72 -72
  158. package/dist/crdt/vendor/yjs/dts/utils/Doc.d.ts +3 -3
  159. package/dist/crdt/vendor/yjs/dts/utils/RangeCursor.d.ts +1 -1
  160. package/dist/crdt/vendor/yjs/dts/utils/UndoManager.d.ts +6 -6
  161. package/dist/crdt/vendor/yjs/dts/utils/marks.d.ts +1 -1
  162. package/dist/crdt/vendor/yjs/src/index.js +2 -2
  163. package/dist/crdt/vendor/yjs/src/structs/Item.js +7 -7
  164. package/dist/crdt/vendor/yjs/src/utils/Doc.js +3 -3
  165. package/dist/crdt/vendor/yjs/src/utils/RangeCursor.js +5 -5
  166. package/dist/crdt/vendor/yjs/src/utils/Transaction.js +3 -3
  167. package/dist/crdt/vendor/yjs/src/utils/UndoManager.js +14 -14
  168. package/dist/crdt/vendor/yjs/src/utils/encoding.js +6 -6
  169. package/dist/crdt/vendor/yjs/src/utils/marks.js +1 -1
  170. package/dist/crdt/vendor/yjs/src/utils/renderer-helpers.js +1 -1
  171. package/dist/crdt/vendor/yjs/src/utils/transaction-helpers.js +7 -7
  172. package/dist/crdt/vendor/yjs/src/ynode.js +15 -15
  173. package/dist/edytor.svelte.d.ts +1 -3
  174. package/dist/edytor.svelte.js +42 -20
  175. package/dist/events/beforeInputCommands.js +5 -5
  176. package/dist/events/beforeInputDeleteCommands.js +5 -5
  177. package/dist/events/nativeInteractiveControl.d.ts +1 -1
  178. package/dist/events/nativeInteractiveControl.js +1 -1
  179. package/dist/events/onBeforeInput.js +4 -4
  180. package/dist/events/onFocus.js +1 -1
  181. package/dist/events/onInput.d.ts +1 -1
  182. package/dist/events/onInput.js +3 -3
  183. package/dist/events/onKeyDown.js +1 -1
  184. package/dist/events/onPaste.js +1 -1
  185. package/dist/kinds.d.ts +6 -6
  186. package/dist/kinds.js +9 -9
  187. package/dist/plugins/arrowMove/arrowMove.js +1 -1
  188. package/dist/plugins/blockHandles/BlockHandleController.svelte.js +1 -1
  189. package/dist/plugins/blockHandles/BlockHandles.svelte +3 -3
  190. package/dist/plugins/blockHandles/blockHandlesPlugin.js +1 -1
  191. package/dist/plugins/code/CodePlugin.svelte +1 -1
  192. package/dist/plugins/code/languages.d.ts +1 -1
  193. package/dist/plugins/code/languages.js +1 -1
  194. package/dist/plugins/columns/ColumnsPlugin.svelte +4 -4
  195. package/dist/plugins/columns/columns.css +3 -3
  196. package/dist/plugins/columns/resize.svelte.d.ts +2 -2
  197. package/dist/plugins/columns/resize.svelte.js +2 -2
  198. package/dist/plugins/columns/stacking.d.ts +1 -1
  199. package/dist/plugins/columns/stacking.js +1 -1
  200. package/dist/plugins/comments/CommentsSidebar.svelte +1 -1
  201. package/dist/plugins/find/FindHighlights.svelte +1 -1
  202. package/dist/plugins/find/findPlugin.js +1 -1
  203. package/dist/plugins/image/ImageEmpty.svelte +1 -1
  204. package/dist/plugins/image/ImagePlugin.svelte +1 -1
  205. package/dist/plugins/image/controls.svelte.d.ts +1 -1
  206. package/dist/plugins/image/controls.svelte.js +1 -1
  207. package/dist/plugins/richtext/RichTextPlugin.svelte +2 -2
  208. package/dist/plugins/richtext/richTextOperations.js +1 -1
  209. package/dist/plugins/slashMenu/slashMenuPlugin.js +1 -1
  210. package/dist/plugins/suggestions/SuggestionBars.svelte +1 -1
  211. package/dist/plugins/toolbar/toolbarPlugin.js +1 -1
  212. package/dist/selection/replaceSelection.d.ts +13 -13
  213. package/dist/selection/replaceSelection.js +15 -15
  214. package/dist/selection/selection.svelte.d.ts +1 -1
  215. package/dist/selection/selection.svelte.js +17 -17
  216. package/dist/selection/selection.utils.d.ts +1 -1
  217. package/dist/selection/selection.utils.js +2 -2
  218. package/dist/selection/visibility.d.ts +4 -4
  219. package/dist/selection/visibility.js +5 -5
  220. package/dist/session/attempt.d.ts +4 -4
  221. package/dist/session/attempt.js +1 -1
  222. package/dist/session/bindings.d.ts +2 -2
  223. package/dist/session/bindings.js +8 -8
  224. package/dist/session/commands.d.ts +2 -2
  225. package/dist/session/commands.js +3 -3
  226. package/dist/session/composition.svelte.d.ts +7 -7
  227. package/dist/session/composition.svelte.js +12 -12
  228. package/dist/session/editing/text.d.ts +6 -6
  229. package/dist/session/editing/text.js +1 -1
  230. package/dist/session/handles.d.ts +2 -2
  231. package/dist/session/handles.js +2 -2
  232. package/dist/session/history.d.ts +4 -4
  233. package/dist/session/history.js +1 -1
  234. package/dist/session/keymap.js +1 -1
  235. package/dist/session/moves.d.ts +1 -1
  236. package/dist/session/moves.js +7 -7
  237. package/dist/session/navigation.d.ts +4 -4
  238. package/dist/session/navigation.js +7 -7
  239. package/dist/session/selection.d.ts +2 -2
  240. package/dist/session/selection.js +1 -1
  241. package/dist/surface/attributes.d.ts +3 -4
  242. package/dist/surface/attributes.js +2 -2
  243. package/dist/surface/cells.d.ts +1 -1
  244. package/dist/surface/cells.js +7 -8
  245. package/dist/surface/observer.svelte.d.ts +2 -2
  246. package/dist/surface/observer.svelte.js +10 -11
  247. package/dist/surface/overlay.d.ts +2 -2
  248. package/dist/surface/overlay.js +2 -2
  249. package/dist/surface/pin.svelte.d.ts +3 -3
  250. package/dist/surface/pin.svelte.js +2 -2
  251. package/dist/surface/popups.svelte.js +1 -1
  252. package/dist/surface/projector.svelte.d.ts +5 -5
  253. package/dist/surface/projector.svelte.js +17 -17
  254. package/dist/text/text.utils.js +1 -1
  255. package/dist/themes/notion.css +2 -2
  256. package/dist/utils/diffText.d.ts +1 -1
  257. package/dist/utils/json.d.ts +3 -3
  258. package/dist/utils/json.js +5 -5
  259. package/package.json +1 -1
package/README.md CHANGED
@@ -16,7 +16,7 @@
16
16
 
17
17
  Edytor aims to be for Svelte what Slate.js is for React: a heavily customizable editor with an API to build any kind of collaborative rich text editor.
18
18
 
19
- > **Work in progress.** Edytor is a pre-release (`0.1.0-next.38`, `edytor@next` on npm) and not ready for production; the API changes between releases without a compatibility layer. The untagged `edytor@0.0.11` on npm predates the current API. Issues and PRs are welcome: when you report a bug, include the document's JSON value.
19
+ > **Work in progress.** Edytor is a pre-release (`0.1.0-next.40`, `edytor@next` on npm) and not ready for production; the API changes between releases without a compatibility layer. The untagged `edytor@0.0.11` on npm predates the current API. Issues and PRs are welcome: when you report a bug, include the document's JSON value.
20
20
 
21
21
  ## Features
22
22
 
@@ -108,7 +108,7 @@ The [documentation site](https://edytor.dev/docs) is the single source for the A
108
108
 
109
109
  ## Contributing
110
110
 
111
- `CONTRIBUTING.md` lists the test lanes, what CI runs, and the pull request checklist; `AGENTS.md` describes the architecture (one owner per fact) and where to fix what. The docs live in `site/content/docs`; a change to public behavior updates them in the same commit.
111
+ `CONTRIBUTING.md` lists the test lanes, what CI runs, and the pull request checklist; `AGENTS.md` describes the architecture (one owner per fact) and where to fix what, and `docs/agents/` holds the rules of each area. The docs live in `site/content/docs`; a change to public behavior updates them in the same commit.
112
112
 
113
113
  ```bash
114
114
  pnpm install
@@ -64,13 +64,6 @@ export declare class Block {
64
64
  get path(): number[];
65
65
  /** The block is visible in the document (a dead handle answers false). */
66
66
  get isInTree(): boolean;
67
- /**
68
- * @deprecated `edytor.suggestions` with `{ end: block.id }`. The content of
69
- * this block's latest `end` suggestion, as parts (a text's runs, or an
70
- * atom); setting it replaces this block's `end` suggestions, `null` drops them.
71
- */
72
- get suggestions(): (JSONText[] | JSONInlineBlock)[] | null;
73
- set suggestions(value: (JSONText[] | JSONInlineBlock)[] | null);
74
67
  get nextBlock(): Block | null;
75
68
  get previousBlock(): Block | null;
76
69
  get closestPreviousBlock(): Block | null;
@@ -177,10 +170,6 @@ export declare class Block {
177
170
  }) => Text | null | undefined;
178
171
  normalizeContent: () => void;
179
172
  normalizeChildren: () => void;
180
- /** @deprecated `edytor.suggestions.add({ end: block.id }, …)`. */
181
- suggestText: (payload: BlockOperations["suggestText"]) => void;
182
- /** @deprecated `suggestion.accept()`. */
183
- acceptSuggestedText: () => void;
184
173
  deleteContentAtRange: (payload: {
185
174
  start: [number, number];
186
175
  end: [number, number];
@@ -1,5 +1,5 @@
1
1
  import { Text } from '../text/text.svelte.js';
2
- import { batch, removeInlineBlock, addChildBlock, insertBlockAfter, insertBlockBefore, mergeBlockBackward, mergeBlockForward, nestBlock, removeBlock, setBlock, splitBlock, prepareSplit, duplicateBlock, prepareDuplicate, prepareSet, prepareMove, prepareMoves, prepareInsertAfter, prepareInsertBefore, prepareRemove, prepareMergeBackward, prepareMergeForward, prepareUnNest, prepareNest, prepareRemoveInline, preparePatch, patchData, prepareDeleteRange, addChildBlocks, pushContentIntoBlock, unNestBlock, moveBlock, moveBlocks, normalizeContent, addInlineBlock, textAfterAtom, blockOf, acceptSuggestedText, suggestText, deleteContentAtRange, normalizeChildren } from './block.utils.js';
2
+ import { batch, removeInlineBlock, addChildBlock, insertBlockAfter, insertBlockBefore, mergeBlockBackward, mergeBlockForward, nestBlock, removeBlock, setBlock, splitBlock, prepareSplit, duplicateBlock, prepareDuplicate, prepareSet, prepareMove, prepareMoves, prepareInsertAfter, prepareInsertBefore, prepareRemove, prepareMergeBackward, prepareMergeForward, prepareUnNest, prepareNest, prepareRemoveInline, preparePatch, patchData, prepareDeleteRange, addChildBlocks, pushContentIntoBlock, unNestBlock, moveBlock, moveBlocks, normalizeContent, addInlineBlock, textAfterAtom, blockOf, deleteContentAtRange, normalizeChildren } from './block.utils.js';
3
3
  import { jsonBlockToSpec, jsonContentToItems } from '../utils/json.js';
4
4
  import { InlineBlock } from './inlineBlock.svelte.js';
5
5
  import { revealed } from '../selection/replaceSelection.js';
@@ -194,32 +194,6 @@ export class Block {
194
194
  this.#track();
195
195
  return this.edytor.facade.isVisibleBlock(this.id);
196
196
  }
197
- /**
198
- * @deprecated `edytor.suggestions` with `{ end: block.id }`. The content of
199
- * this block's latest `end` suggestion, as parts (a text's runs, or an
200
- * atom); setting it replaces this block's `end` suggestions, `null` drops them.
201
- */
202
- get suggestions() {
203
- const content = this.edytor.suggestions?.at(this.id).end.at(-1)?.content[0]?.content;
204
- if (!content?.length)
205
- return null;
206
- const parts = [];
207
- for (const part of content)
208
- if ('type' in part)
209
- parts.push(part);
210
- else if (Array.isArray(parts.at(-1)))
211
- parts.at(-1).push(part);
212
- else
213
- parts.push([part]);
214
- return parts;
215
- }
216
- set suggestions(value) {
217
- const { suggestions } = this.edytor;
218
- for (const suggestion of suggestions.at(this.id).end)
219
- suggestion.discard();
220
- if (value)
221
- suggestions.add({ end: this.id }, [{ type: this.type, content: value.flat() }]);
222
- }
223
197
  get nextBlock() {
224
198
  return this.parent ? this.parent.children[this.index + 1] : null;
225
199
  }
@@ -350,10 +324,6 @@ export class Block {
350
324
  };
351
325
  normalizeContent = batch('normalizeContent', normalizeContent);
352
326
  normalizeChildren = batch('normalizeChildren', normalizeChildren);
353
- /** @deprecated `edytor.suggestions.add({ end: block.id }, …)`. */
354
- suggestText = (payload) => suggestText.call(this, payload);
355
- /** @deprecated `suggestion.accept()`. */
356
- acceptSuggestedText = () => acceptSuggestedText.call(this);
357
327
  deleteContentAtRange = batch('deleteContentAtRange', deleteContentAtRange, prepareDeleteRange);
358
328
  /** Mark an element inside the block's markup as non-editable chrome (a header, a caption bar). */
359
329
  void = voidChrome;
@@ -382,7 +352,7 @@ export class Block {
382
352
  }
383
353
  return hit;
384
354
  };
385
- // ── JSON insertion (K5: specs are data; `new Block({block})` is gone) ──
355
+ // ── JSON insertion (specs are data; `new Block({block})` is gone) ──
386
356
  /**
387
357
  * Insert children at `index`: a JSON spec is created (its id kept, minted
388
358
  * when missing); a block handle moves there with its identity.
@@ -425,9 +395,9 @@ export class Block {
425
395
  /** The declared view state (`open` on a `details`) the block's last element held. */
426
396
  #viewState = [];
427
397
  /**
428
- * Register the element the core rendered for this block (O45) and run the
398
+ * Register the element the core rendered for this block and run the
429
399
  * attach hooks. A re-rendered block (moved, re-parented) keeps its declared
430
- * view state (R11): an open toggle stays open.
400
+ * view state: an open toggle stays open.
431
401
  * @internal
432
402
  */
433
403
  attach = (node) => {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * View-side command adapter for block operations (U2 delegation contract).
2
+ * View-side command adapter for block operations: each delegates to one document operation.
3
3
  *
4
4
  * These functions are the `BlockOperations` layer bound onto `Block` via
5
5
  * `batch()`, which dispatches each call as a command (admission, plugin
@@ -8,8 +8,8 @@
8
8
  * sibling lookup for `nestBlock`), the plan of an operation
9
9
  * that is one document op (`prepare*`) and its normalization requests.
10
10
  *
11
- * OPERATIONS READ AND WRITE ONLY THE DOCUMENT (R3): `Block`/`Text` are id-only
12
- * handles whose getters read the index (R4), so what a caller needs after the
11
+ * OPERATIONS READ AND WRITE ONLY THE DOCUMENT: `Block`/`Text` are id-only
12
+ * handles whose getters read the index, so what a caller needs after the
13
13
  * write (the new block, the text after an inserted atom, the caret a range op
14
14
  * decided) is the op's document result as a handle (`batch`'s `resolve`) —
15
15
  * inside an outer transaction too.
@@ -19,13 +19,13 @@
19
19
  * as "refused" — no view-side re-checks of the rules the document already
20
20
  * enforces (island sealing, void/island destinations, own-subtree moves,
21
21
  * merges across island boundaries; see `edytor-doc.ts` `canPlace` and
22
- * `canMerge`, R5). Removing a view-side semantic guard must never
22
+ * `canMerge`). Removing a view-side semantic guard must never
23
23
  * change document behavior — if a rule matters here it belongs in the
24
24
  * facade, not in this file.
25
25
  *
26
26
  * Content preparation produces `BlockSpec`/`ContentItem` DIRECTLY from
27
27
  * JSON (`jsonBlockToSpec`/`jsonContentToItems` in `utils/json.ts`): specs are
28
- * data (K5: `new Block({block})` is gone). The live-content invariant
28
+ * data (`new Block({block})` is gone). The live-content invariant
29
29
  * (text-first/text-last, no adjacent same-kind parts) is derived by the
30
30
  * document's projection on read, so stored content needs no
31
31
  * pre-normalization.
@@ -36,7 +36,7 @@ import type { Flow, FlowTarget } from '../crdt/flow.js';
36
36
  import type { Plan, Prepared } from '../crdt/edytor-doc.js';
37
37
  import type { DataPatch } from '../crdt/data.js';
38
38
  import type { ResolvedAt } from '../session/suggestions.svelte.js';
39
- import { type JSONBlock, type JSONInlineBlock, type JSONText } from '../utils/json.js';
39
+ import { type JSONBlock, type JSONInlineBlock } from '../utils/json.js';
40
40
  import { InlineBlock } from './inlineBlock.svelte.js';
41
41
  /** A move beside `target`, to its `side` (`prepare.placeBeside`, `layout.place-beside`). */
42
42
  export type BlockBeside = {
@@ -108,12 +108,6 @@ export type BlockOperations = {
108
108
  };
109
109
  normalizeContent: {};
110
110
  normalizeChildren: {};
111
- /** @deprecated `edytor.suggestions.add({ end: block.id }, …)`. */
112
- suggestText: {
113
- value: (JSONText | JSONInlineBlock)[] | string | null;
114
- };
115
- /** @deprecated `suggestion.accept()`; the command hooks see is `acceptSuggestion`. */
116
- acceptSuggestedText: {};
117
111
  /** A suggestion placed in the document (`edytor.suggestions`, `suggestion.accept()`). */
118
112
  acceptSuggestion: {
119
113
  suggestion: {
@@ -292,7 +286,7 @@ export declare function prepareMove(this: Block, { path }: BlockOperations['move
292
286
  export declare function moveBlock(this: Block, payload: BlockOperations['moveBlock'], plan?: Prepared): Block | null;
293
287
  /**
294
288
  * Grouped move — the operation-layer counterpart of `moveBlock` for
295
- * drags/multi-moves (D5). `path` is the same view-tree address shape:
289
+ * drags/multi-moves. `path` is the same view-tree address shape:
296
290
  * the prefix resolves the destination PARENT block, the last element is
297
291
  * the FINAL index — already discounted for the moved members by the
298
292
  * caller (the `facade.moveBlocks` contract, which counts the
@@ -329,20 +323,16 @@ export declare function patchData(this: Block, payload: BlockOperations['patchDa
329
323
  * ({@link textAfterAtom}), where the caret's pending marks follow.
330
324
  */
331
325
  export declare function addInlineBlock(this: Block, { index, block, text }: BlockOperations['addInlineBlock']): string;
332
- /** The text after atom `atom` of this block; the caret's pending marks follow it there (L4). */
326
+ /** The text after atom `atom` of this block; the caret's pending marks follow it there. */
333
327
  export declare function textAfterAtom(this: Block, atom: string | undefined): Text | null | undefined;
334
328
  /**
335
329
  * Normalization runs at the end of the command's transaction
336
330
  * (`Dispatcher.drain`): a normalizer reads handles over the index; when a
337
331
  * plugin hook answers work, the work runs in the same transaction and the
338
- * block is requested again (bounded by the dispatcher's pass limit, D25).
332
+ * block is requested again (bounded by the dispatcher's pass limit).
339
333
  */
340
334
  export declare function normalizeContent(this: Block): void;
341
335
  export declare function normalizeChildren(this: Block): void;
342
- /** @deprecated A thin wrapper over an `{ end: block.id }` suggestion (`edytor.suggestions`). */
343
- export declare function suggestText(this: Block, { value }: BlockOperations['suggestText']): void;
344
- /** @deprecated Accepts this block's latest `{ end }` suggestion (`suggestion.accept()`). */
345
- export declare function acceptSuggestedText(this: Block): void;
346
336
  export declare function prepareDeleteRange(this: Block, { start: [startIndex, startOffset], end: [endIndex, endOffset] }: {
347
337
  start: number[];
348
338
  end: number[];
@@ -96,7 +96,7 @@ export function duplicateBlock(_ = {}, plan = prepareDuplicate.call(this)) {
96
96
  export function prepareSplit({ index, text }) {
97
97
  if (!text || !this.parent || !this.model)
98
98
  return REFUSED;
99
- // G5: the sibling takes its parent's default child type and no data — a
99
+ // The sibling takes its parent's default child type and no data — a
100
100
  // list-like kind (`continues`) keeps its own, with its first preset's data.
101
101
  const { continues, presets } = this.definition;
102
102
  const tail = continues
@@ -183,7 +183,7 @@ export function moveBlock(payload, plan = prepareMove.call(this, payload)) {
183
183
  }
184
184
  /**
185
185
  * Grouped move — the operation-layer counterpart of `moveBlock` for
186
- * drags/multi-moves (D5). `path` is the same view-tree address shape:
186
+ * drags/multi-moves. `path` is the same view-tree address shape:
187
187
  * the prefix resolves the destination PARENT block, the last element is
188
188
  * the FINAL index — already discounted for the moved members by the
189
189
  * caller (the `facade.moveBlocks` contract, which counts the
@@ -298,7 +298,7 @@ export function addInlineBlock({ index, block, text }) {
298
298
  this.normalizeContent();
299
299
  return atom.id;
300
300
  }
301
- /** The text after atom `atom` of this block; the caret's pending marks follow it there (L4). */
301
+ /** The text after atom `atom` of this block; the caret's pending marks follow it there. */
302
302
  export function textAfterAtom(atom) {
303
303
  if (atom === undefined)
304
304
  return undefined;
@@ -317,7 +317,7 @@ export function textAfterAtom(atom) {
317
317
  * Normalization runs at the end of the command's transaction
318
318
  * (`Dispatcher.drain`): a normalizer reads handles over the index; when a
319
319
  * plugin hook answers work, the work runs in the same transaction and the
320
- * block is requested again (bounded by the dispatcher's pass limit, D25).
320
+ * block is requested again (bounded by the dispatcher's pass limit).
321
321
  */
322
322
  export function normalizeContent() {
323
323
  if (this.edytor.dispatcher.defer(this, normalizeContent))
@@ -341,17 +341,6 @@ export function normalizeChildren() {
341
341
  this.normalizeChildren();
342
342
  }
343
343
  }
344
- /** @deprecated A thin wrapper over an `{ end: block.id }` suggestion (`edytor.suggestions`). */
345
- export function suggestText({ value }) {
346
- this.suggestions =
347
- typeof value === 'string'
348
- ? [[{ text: value }]]
349
- : (value?.map((part) => ('type' in part ? part : [part])) ?? null);
350
- }
351
- /** @deprecated Accepts this block's latest `{ end }` suggestion (`suggestion.accept()`). */
352
- export function acceptSuggestedText() {
353
- this.edytor.suggestions.at(this.id).end.at(-1)?.accept();
354
- }
355
344
  export function prepareDeleteRange({ start: [startIndex, startOffset], end: [endIndex, endOffset] }) {
356
345
  const parts = this.edytor.idToBlock.parts(this.id);
357
346
  const [startPart, endPart] = [parts.at(startIndex), parts.at(endIndex)];
@@ -101,7 +101,7 @@ const withoutUncopied = (edytor, fragment) => {
101
101
  };
102
102
  export const createEdytorClipboardFragment = (edytor) => withoutUncopied(edytor, fragmentOf(edytor));
103
103
  const fragmentOf = (edytor) => {
104
- // A layout the block selection covers whole is copied as the layout (D3).
104
+ // A layout the block selection covers whole is copied as the layout.
105
105
  const selectedBlocks = selectedMembers(edytor, liftLayouts(edytor.selection.selectedBlocks));
106
106
  if (selectedBlocks.length > 0) {
107
107
  return {
@@ -10,7 +10,7 @@ type Values = Record<string, SerializableContent>;
10
10
  /** The tag a kind writes for `data`: its export form's first tag, else its element's, else its content element's. */
11
11
  export declare const tagOf: (type: string, kind: BlockDefinition, data: Values) => string | undefined;
12
12
  /**
13
- * External HTML as a flow (P4.1): the browser parses (inert: no script
13
+ * External HTML as a flow: the browser parses (inert: no script
14
14
  * runs, nothing loads), and the tag tables are the records inverted — a
15
15
  * catalogue kind's tag per preset (a content-less container takes its
16
16
  * default child's tag, one child per text line), a value-less mark's
@@ -20,7 +20,7 @@ export declare const tagOf: (type: string, kind: BlockDefinition, data: Values)
20
20
  * `iframe`, `video` or `audio` no hook claims carries nothing. An atom
21
21
  * kind's `parse` hook claims inline elements (an equation's `<math>`): the
22
22
  * atom, never its text. Unknown
23
- * elements degrade to text runs; whitespace collapses as HTML renders it. `null` when the HTML carries nothing (`flow.shape`, F-P10).
23
+ * elements degrade to text runs; whitespace collapses as HTML renders it. `null` when the HTML carries nothing (`flow.shape`).
24
24
  */
25
25
  export declare const flowOfHtml: (kinds: ImportKinds, html: string | undefined) => Flow | null;
26
26
  export {};
@@ -54,7 +54,7 @@ export const tagOf = (type, kind, data) => {
54
54
  return undefined;
55
55
  };
56
56
  /**
57
- * External HTML as a flow (P4.1): the browser parses (inert: no script
57
+ * External HTML as a flow: the browser parses (inert: no script
58
58
  * runs, nothing loads), and the tag tables are the records inverted — a
59
59
  * catalogue kind's tag per preset (a content-less container takes its
60
60
  * default child's tag, one child per text line), a value-less mark's
@@ -64,7 +64,7 @@ export const tagOf = (type, kind, data) => {
64
64
  * `iframe`, `video` or `audio` no hook claims carries nothing. An atom
65
65
  * kind's `parse` hook claims inline elements (an equation's `<math>`): the
66
66
  * atom, never its text. Unknown
67
- * elements degrade to text runs; whitespace collapses as HTML renders it. `null` when the HTML carries nothing (`flow.shape`, F-P10).
67
+ * elements degrade to text runs; whitespace collapses as HTML renders it. `null` when the HTML carries nothing (`flow.shape`).
68
68
  */
69
69
  export const flowOfHtml = (kinds, html) => {
70
70
  if (!html || html.length > 8 * 1024 * 1024 || typeof DOMParser === 'undefined')
@@ -7,7 +7,7 @@ const escapeHtml = (value) => value.replace(/&/g, '&amp;').replace(/</g, '&lt;')
7
7
  const tag = (name, inner, attributes = {}) => `<${name}${Object.entries(attributes)
8
8
  .map(([key, value]) => (value === undefined ? '' : ` ${key}="${escapeHtml(value)}"`))
9
9
  .join('')}>${inner}</${name}>`;
10
- /** A mark exports the element it renders (P2.7): its `tag` and `attributes`. */
10
+ /** A mark exports the element it renders: its `tag` and `attributes`. */
11
11
  const textHtml = (part, kinds) => {
12
12
  let html = escapeHtml(part.text).replace(/\n/g, '<br>');
13
13
  for (const [name, mark] of kinds.marks) {
@@ -36,7 +36,7 @@
36
36
  * rows ≤ `maxRowBytes` (2 MB row cap) in one `transactionSync`, then
37
37
  * broadcast; after `compactAfter` update records the rows are replaced
38
38
  * by one snapshot record of the live document's state (its healed
39
- * state, deleted content collected: P2), after the message is
39
+ * state, deleted content collected), after the message is
40
40
  * acknowledged — never inside the engine's `update` observer, where one
41
41
  * throw would silence every later emit. Memory never runs ahead of
42
42
  * storage: when an append fails, nothing is relayed or acknowledged, the
@@ -52,7 +52,7 @@
52
52
  * left out of the ack), the rest applied. Compaction reclaims the
53
53
  * waiting deletes of client ids no user registered and no socket holds;
54
54
  * `dropWaitingDeletes()` every one.
55
- * - storage format (P5): the generation record says `storage: 'v2'` —
55
+ * - storage format: the generation record says `storage: 'v2'` —
56
56
  * snapshots in the v2 encoding, compressed in place after they are
57
57
  * stored (`compressLater`), inflated at start (`inflate`); update and
58
58
  * pending records stay v1. A container without `storage` (0.1.0-next.22)
@@ -216,7 +216,7 @@ export declare const ROOM_ORIGIN: unique symbol;
216
216
  export declare const RESTORE_ORIGIN: unique symbol;
217
217
  /** The transaction origin of the room's purge: tracked by no history. */
218
218
  export declare const PURGE_ORIGIN: unique symbol;
219
- /** The header `routeDocumentHistory` sets on an authorized history request (H11). */
219
+ /** The header `routeDocumentHistory` sets on an authorized history request. */
220
220
  export declare const HISTORY_HEADER = "X-Edytor-History";
221
221
  /** The version key of a history `read` or `restore` request. */
222
222
  export declare const HISTORY_KEY_HEADER = "X-Edytor-History-Key";
@@ -888,14 +888,6 @@ export declare class AttachedDocument {
888
888
  * `false` for a socket that is not the document's).
889
889
  */
890
890
  export declare const attachRoom: (host: DurableObject<any>, options?: AttachRoomOptions) => AttachedDocument;
891
- /**
892
- * @deprecated Use {@link attachRoom} (the client's `attachDocument` attaches
893
- * a document to an engine doc, a different thing). Removed in the next
894
- * release.
895
- */
896
- export declare const attachDocument: (host: DurableObject<any>, options?: AttachRoomOptions) => AttachedDocument;
897
- /** @deprecated Use {@link AttachRoomOptions}. Removed in the next release. */
898
- export type AttachDocumentOptions = AttachRoomOptions;
899
891
  /**
900
892
  * The ready-made room: a Durable Object hosting one document, configured
901
893
  * by `vars` ({@link DocumentRoomEnv}). Subclass it to override `onLoad` and
@@ -36,7 +36,7 @@
36
36
  * rows ≤ `maxRowBytes` (2 MB row cap) in one `transactionSync`, then
37
37
  * broadcast; after `compactAfter` update records the rows are replaced
38
38
  * by one snapshot record of the live document's state (its healed
39
- * state, deleted content collected: P2), after the message is
39
+ * state, deleted content collected), after the message is
40
40
  * acknowledged — never inside the engine's `update` observer, where one
41
41
  * throw would silence every later emit. Memory never runs ahead of
42
42
  * storage: when an append fails, nothing is relayed or acknowledged, the
@@ -52,7 +52,7 @@
52
52
  * left out of the ack), the rest applied. Compaction reclaims the
53
53
  * waiting deletes of client ids no user registered and no socket holds;
54
54
  * `dropWaitingDeletes()` every one.
55
- * - storage format (P5): the generation record says `storage: 'v2'` —
55
+ * - storage format: the generation record says `storage: 'v2'` —
56
56
  * snapshots in the v2 encoding, compressed in place after they are
57
57
  * stored (`compressLater`), inflated at start (`inflate`); update and
58
58
  * pending records stay v1. A container without `storage` (0.1.0-next.22)
@@ -193,7 +193,7 @@ export const ROOM_ORIGIN = Symbol('edytor-room');
193
193
  export const RESTORE_ORIGIN = Symbol('edytor-restore');
194
194
  /** The transaction origin of the room's purge: tracked by no history. */
195
195
  export const PURGE_ORIGIN = Symbol('edytor-purge');
196
- /** The header `routeDocumentHistory` sets on an authorized history request (H11). */
196
+ /** The header `routeDocumentHistory` sets on an authorized history request. */
197
197
  export const HISTORY_HEADER = 'X-Edytor-History';
198
198
  /** The version key of a history `read` or `restore` request. */
199
199
  export const HISTORY_KEY_HEADER = 'X-Edytor-History-Key';
@@ -430,7 +430,7 @@ export class AttachedDocument {
430
430
  lastUpdated() {
431
431
  return this.room.storage.lastUpdated();
432
432
  }
433
- // ── History (H11) ────────────────────────────────────────────────────
433
+ // ── History ────────────────────────────────────────────────────
434
434
  /**
435
435
  * Resolves once the versions the room is writing are stored (a slot a
436
436
  * write closed is written in the background).
@@ -485,7 +485,7 @@ export class AttachedDocument {
485
485
  comment(request, actor) {
486
486
  return this.room.comments.apply(request, actor);
487
487
  }
488
- // ── Moves (H10, `room.move`) ─────────────────────────────────────────
488
+ // ── Moves (`room.move`) ─────────────────────────────────────────
489
489
  /**
490
490
  * Export blocks `ids` for a move (`room.move`, step 1): their visible
491
491
  * subtrees as JSON, the outermost only, in document order. Writes
@@ -537,7 +537,7 @@ export class AttachedDocument {
537
537
  applyLateEdits(batch) {
538
538
  return this.room.moves.applyLateEdits(batch);
539
539
  }
540
- // ── Purge (H7) ───────────────────────────────────────────────────────
540
+ // ── Purge ───────────────────────────────────────────────────────
541
541
  /**
542
542
  * The purge task, also over RPC (`room.purge.timing`): record an epoch
543
543
  * (the state vector, now) when the document changed since the last one,
@@ -685,12 +685,6 @@ export const attachRoom = (host, options = {}) => {
685
685
  }
686
686
  return document;
687
687
  };
688
- /**
689
- * @deprecated Use {@link attachRoom} (the client's `attachDocument` attaches
690
- * a document to an engine doc, a different thing). Removed in the next
691
- * release.
692
- */
693
- export const attachDocument = attachRoom;
694
688
  /**
695
689
  * The ready-made room: a Durable Object hosting one document, configured
696
690
  * by `vars` ({@link DocumentRoomEnv}). Subclass it to override `onLoad` and
@@ -10,8 +10,7 @@
10
10
  /**
11
11
  * The structural subset of a KV namespace {@link kvHistory} uses — a
12
12
  * Workers `KVNamespace` binding satisfies it, and so does an in-memory
13
- * fake. Passed as `history.store` itself it is wrapped by
14
- * {@link kvHistory} (deprecated: pass `kvHistory(namespace)`).
13
+ * fake. As `history.store` it goes through {@link kvHistory}.
15
14
  */
16
15
  export type KVLike = {
17
16
  put(key: string, value: ArrayBuffer | ArrayBufferView | string, options?: {
@@ -110,10 +109,10 @@ export type HistoryStoreFactory = (room: HistoryRoomStorage) => HistoryStore;
110
109
  export type HistoryOptions = {
111
110
  /**
112
111
  * The store: a {@link HistoryStore} ({@link kvHistory}, {@link r2History}
113
- * or your own), {@link roomHistory}`()`, or — deprecated — a KV namespace
114
- * itself (any {@link KVLike}, wrapped by {@link kvHistory}).
112
+ * or your own) or {@link roomHistory}`()`. A KV namespace goes through
113
+ * {@link kvHistory}.
115
114
  */
116
- store: HistoryStore | HistoryStoreFactory | KVLike;
115
+ store: HistoryStore | HistoryStoreFactory;
117
116
  /** How long a version is kept, in days (default 30). */
118
117
  retentionDays?: number;
119
118
  /** The IANA time zone whose noon and midnight end the slots (default `'UTC'`). */
@@ -235,6 +234,7 @@ export declare const isR2Bucket: (store: unknown) => store is R2BucketLike;
235
234
  /**
236
235
  * The store `history.store` names, built for this room: a
237
236
  * {@link HistoryStore} as it is, a factory ({@link roomHistory}) over the
238
- * room's storage, and a bare KV namespace through {@link kvHistory}.
237
+ * room's storage. Anything else (a KV namespace itself) is refused: it goes
238
+ * through {@link kvHistory}.
239
239
  */
240
240
  export declare const resolveHistoryStore: (store: HistoryOptions["store"], room: HistoryRoomStorage) => HistoryStore;
@@ -324,7 +324,7 @@ export const roomHistory = (options = {}) => ({ sql, transactionSync, tablePrefi
324
324
  }
325
325
  };
326
326
  };
327
- /** A {@link HistoryStore} (its numeric `maxValueBytes` says so), as opposed to a bare KV namespace. */
327
+ /** A {@link HistoryStore} (its numeric `maxValueBytes` and its `delete` say so). */
328
328
  const isHistoryStore = (store) => typeof store?.maxValueBytes === 'number' &&
329
329
  typeof store.delete === 'function';
330
330
  /** An R2 bucket binding (it has multipart uploads; a KV namespace does not). */
@@ -333,12 +333,13 @@ export const isR2Bucket = (store) => typeof store?.createMultipartUpload ===
333
333
  /**
334
334
  * The store `history.store` names, built for this room: a
335
335
  * {@link HistoryStore} as it is, a factory ({@link roomHistory}) over the
336
- * room's storage, and a bare KV namespace through {@link kvHistory}.
336
+ * room's storage. Anything else (a KV namespace itself) is refused: it goes
337
+ * through {@link kvHistory}.
337
338
  */
338
339
  export const resolveHistoryStore = (store, room) => {
339
340
  if (typeof store === 'function')
340
341
  return store(room);
341
342
  if (isHistoryStore(store))
342
343
  return store;
343
- return kvHistory(store);
344
+ throw new TypeError('history.store: not a HistoryStore. Wrap a KV namespace in kvHistory(namespace), an R2 bucket in r2History(bucket)');
344
345
  };
@@ -4,10 +4,10 @@
4
4
  * `cloudflare:workers`); built on the Worker-safe CRDT entry. Documented in
5
5
  * the site's `server/` section (room, authorization, extending, protocol).
6
6
  */
7
- export { DocumentRoom, AttachedDocument, attachRoom, attachDocument, SOCKET_TAG, closedSocket, type AttachRoomOptions, type AttachDocumentOptions, type CommentOptions, DEFAULT_COMPACT_AFTER, DEFAULT_MAX_ROW_BYTES, DEFAULT_SAVE_AFTER, DEFAULT_MAX_DOCUMENT_BYTES, DEFAULT_MAX_INBOUND_FRAME_BYTES, DEFAULT_MAX_BUFFERED_BYTES, DEFAULT_MAX_UPDATES_PER_SECOND, DEFAULT_MAX_PRESENCE_BYTES, DEFAULT_MAX_PRESENCE_PER_SECOND, DEFAULT_MAX_PRESENCE_FANOUT, MAX_REFUSALS, MAX_WAITING_DELETES, ROOM_ORIGIN, RESTORE_ORIGIN, PURGE_ORIGIN, IDENTITY_HEADERS, PROBE_HEADER, noTimers, type Attachment, type DocumentRoomEnv, type LoadedDocument, type Refusal, type ReplicaOwner, type SavedDocument, type SocketIdentity, type StoredRecord, type FrameValidation, type ValidatedBlock, type RoomMetrics, type RoomLogEntry, type RestoreResult, type Timing } from './DocumentRoom.js';
7
+ export { DocumentRoom, AttachedDocument, attachRoom, SOCKET_TAG, closedSocket, type AttachRoomOptions, type CommentOptions, DEFAULT_COMPACT_AFTER, DEFAULT_MAX_ROW_BYTES, DEFAULT_SAVE_AFTER, DEFAULT_MAX_DOCUMENT_BYTES, DEFAULT_MAX_INBOUND_FRAME_BYTES, DEFAULT_MAX_BUFFERED_BYTES, DEFAULT_MAX_UPDATES_PER_SECOND, DEFAULT_MAX_PRESENCE_BYTES, DEFAULT_MAX_PRESENCE_PER_SECOND, DEFAULT_MAX_PRESENCE_FANOUT, MAX_REFUSALS, MAX_WAITING_DELETES, ROOM_ORIGIN, RESTORE_ORIGIN, PURGE_ORIGIN, IDENTITY_HEADERS, PROBE_HEADER, noTimers, type Attachment, type DocumentRoomEnv, type LoadedDocument, type Refusal, type ReplicaOwner, type SavedDocument, type SocketIdentity, type StoredRecord, type FrameValidation, type ValidatedBlock, type RoomMetrics, type RoomLogEntry, type RestoreResult, type Timing } from './DocumentRoom.js';
8
8
  export { DEFAULT_RETENTION_DAYS, HISTORY_MAX_VALUE_BYTES, R2_HISTORY_MAX_VALUE_BYTES, ROOM_HISTORY_MAX_BYTES, ROOM_HISTORY_MAX_VALUE_BYTES, kvHistory, r2History, roomHistory, type HistoryEntry, type HistoryMetadata, type HistoryOptions, type HistoryRoomStorage, type HistoryStore, type HistoryStoreFactory, type HistoryStoreRecord, type KVLike, type R2BucketLike } from './history.js';
9
9
  export { type PurgeReport } from '../crdt/purge.js';
10
10
  export { COMMENT_STATUS, MAX_COMMENT_LENGTH, MAX_COMMENTS_PER_THREAD, MAX_THREADS, commentAnchors, decideComment, type ThreadComment, type CommentActor, type CommentChange, type CommentOutcome, type CommentRefusal, type CommentRequest, type CommentRun, type CommentSnapshot, type CommentThread } from '../crdt/protocols/comments.js';
11
11
  export { lockedBlocks, type LockOptions } from './locks.js';
12
- export { moveBlocksBetweenRooms, moveBlocks, forwardLateEdits, DEFAULT_MOVE_GRACE_DAYS, type CommitResult, type ExportedBlocks, type ImportReceipt, type ImportRequest, type LateEdit, type LateEditBatch, type MoveDestination, type MovedState, type MoveNamespace, type MoveRoom } from './move.js';
12
+ export { moveBlocksBetweenRooms, forwardLateEdits, DEFAULT_MOVE_GRACE_DAYS, type CommitResult, type ExportedBlocks, type ImportReceipt, type ImportRequest, type LateEdit, type LateEditBatch, type MoveDestination, type MovedState, type MoveNamespace, type MoveRoom } from './move.js';
13
13
  export { routeDocumentSocket, routeDocumentHistory, routeDocumentComments, requestedReplica, type AuthorizeDocumentSocket, type ExpiredCredential, type DocumentNamespace, type DocumentIdentity, type RouteDocumentOptions } from './routeDocumentSocket.js';
@@ -4,10 +4,10 @@
4
4
  * `cloudflare:workers`); built on the Worker-safe CRDT entry. Documented in
5
5
  * the site's `server/` section (room, authorization, extending, protocol).
6
6
  */
7
- export { DocumentRoom, AttachedDocument, attachRoom, attachDocument, SOCKET_TAG, closedSocket, DEFAULT_COMPACT_AFTER, DEFAULT_MAX_ROW_BYTES, DEFAULT_SAVE_AFTER, DEFAULT_MAX_DOCUMENT_BYTES, DEFAULT_MAX_INBOUND_FRAME_BYTES, DEFAULT_MAX_BUFFERED_BYTES, DEFAULT_MAX_UPDATES_PER_SECOND, DEFAULT_MAX_PRESENCE_BYTES, DEFAULT_MAX_PRESENCE_PER_SECOND, DEFAULT_MAX_PRESENCE_FANOUT, MAX_REFUSALS, MAX_WAITING_DELETES, ROOM_ORIGIN, RESTORE_ORIGIN, PURGE_ORIGIN, IDENTITY_HEADERS, PROBE_HEADER, noTimers } from './DocumentRoom.js';
7
+ export { DocumentRoom, AttachedDocument, attachRoom, SOCKET_TAG, closedSocket, DEFAULT_COMPACT_AFTER, DEFAULT_MAX_ROW_BYTES, DEFAULT_SAVE_AFTER, DEFAULT_MAX_DOCUMENT_BYTES, DEFAULT_MAX_INBOUND_FRAME_BYTES, DEFAULT_MAX_BUFFERED_BYTES, DEFAULT_MAX_UPDATES_PER_SECOND, DEFAULT_MAX_PRESENCE_BYTES, DEFAULT_MAX_PRESENCE_PER_SECOND, DEFAULT_MAX_PRESENCE_FANOUT, MAX_REFUSALS, MAX_WAITING_DELETES, ROOM_ORIGIN, RESTORE_ORIGIN, PURGE_ORIGIN, IDENTITY_HEADERS, PROBE_HEADER, noTimers } from './DocumentRoom.js';
8
8
  export { DEFAULT_RETENTION_DAYS, HISTORY_MAX_VALUE_BYTES, R2_HISTORY_MAX_VALUE_BYTES, ROOM_HISTORY_MAX_BYTES, ROOM_HISTORY_MAX_VALUE_BYTES, kvHistory, r2History, roomHistory } from './history.js';
9
9
  export {} from '../crdt/purge.js';
10
10
  export { COMMENT_STATUS, MAX_COMMENT_LENGTH, MAX_COMMENTS_PER_THREAD, MAX_THREADS, commentAnchors, decideComment } from '../crdt/protocols/comments.js';
11
11
  export { lockedBlocks } from './locks.js';
12
- export { moveBlocksBetweenRooms, moveBlocks, forwardLateEdits, DEFAULT_MOVE_GRACE_DAYS } from './move.js';
12
+ export { moveBlocksBetweenRooms, forwardLateEdits, DEFAULT_MOVE_GRACE_DAYS } from './move.js';
13
13
  export { routeDocumentSocket, routeDocumentHistory, routeDocumentComments, requestedReplica } from './routeDocumentSocket.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
- * Per-block locks (H10, `room.locks` in `docs/editor-delete-contract.md`):
3
- * a `validate` hook (H2, accept-then-compensate) that keeps a locked block
2
+ * Per-block locks (`room.locks` in `docs/editor-delete-contract.md`):
3
+ * a `validate` hook (accept-then-compensate) that keeps a locked block
4
4
  * its owner's. Worker-safe: no timers, no browser globals.
5
5
  *
6
6
  * A block is locked when its data names a user under `key` (default
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Cross-document moves (H10, `room.move` in `docs/editor-delete-contract.md`):
2
+ * Cross-document moves (`room.move` in `docs/editor-delete-contract.md`):
3
3
  * blocks leave document A for document B so that no concurrent edit is
4
4
  * lost. Worker-safe; the room (`DocumentRoom.ts`) owns the storage and the
5
5
  * transactions, this module the protocol and the merge.
@@ -150,16 +150,6 @@ export declare const moveBlocksBetweenRooms: (namespace: MoveNamespace, move: {
150
150
  ids: string[];
151
151
  dest: MoveDestination;
152
152
  }) => Promise<ImportReceipt>;
153
- /**
154
- * @deprecated Use {@link moveBlocksBetweenRooms} (`edytor.moveBlocks` moves
155
- * blocks inside one document). Removed in the next release.
156
- */
157
- export declare const moveBlocks: (namespace: MoveNamespace, move: {
158
- from: string;
159
- to: string;
160
- ids: string[];
161
- dest: MoveDestination;
162
- }) => Promise<ImportReceipt>;
163
153
  /**
164
154
  * Forward the late edits document `from` holds (`room.move.late`) to their
165
155
  * destinations and acknowledge them — for a room without `rooms()`, which
@@ -148,11 +148,6 @@ export const moveBlocksBetweenRooms = async (namespace, move) => {
148
148
  throw new Error(`moveBlocksBetweenRooms: commit refused (${committed.reason ?? 'unknown'})`);
149
149
  return receipt;
150
150
  };
151
- /**
152
- * @deprecated Use {@link moveBlocksBetweenRooms} (`edytor.moveBlocks` moves
153
- * blocks inside one document). Removed in the next release.
154
- */
155
- export const moveBlocks = moveBlocksBetweenRooms;
156
151
  /**
157
152
  * Forward the late edits document `from` holds (`room.move.late`) to their
158
153
  * destinations and acknowledge them — for a room without `rooms()`, which
@@ -57,7 +57,7 @@ export class RoomAccess {
57
57
  /** A request forwarded by the host Worker (`AttachedDocument.fetch`). */
58
58
  async fetch(request) {
59
59
  const room = this.room;
60
- // A history request (H11), forwarded by `routeDocumentHistory` once authorized.
60
+ // A history request, forwarded by `routeDocumentHistory` once authorized.
61
61
  const op = request.headers.get(HISTORY_HEADER);
62
62
  if (op !== null) {
63
63
  const identity = readIdentity(request.headers);
@@ -77,7 +77,7 @@ export class RoomAccess {
77
77
  return room.comments.request(comments, identity, body);
78
78
  }
79
79
  // The probes, forwarded by `routeDocumentSocket` once authorized:
80
- // `lastUpdated` (H12) and `snapshot` (P8: the document as JSON).
80
+ // `lastUpdated` and `snapshot` (the document as JSON).
81
81
  const probe = request.headers.get(PROBE_HEADER);
82
82
  if (probe === 'lastUpdated' || probe === 'snapshot') {
83
83
  if (readIdentity(request.headers) === null) {