edytor 3.0.0 → 5.0.0

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 (231) hide show
  1. package/README.md +2 -2
  2. package/dist/block/block.svelte.js +6 -21
  3. package/dist/block/inlineBlock.svelte.js +4 -6
  4. package/dist/clipboard/moveText.js +6 -8
  5. package/dist/cloudflare/DocumentRoom.d.ts +23 -12
  6. package/dist/cloudflare/DocumentRoom.js +10 -6
  7. package/dist/cloudflare/index.d.ts +1 -1
  8. package/dist/cloudflare/room/access.d.ts +8 -3
  9. package/dist/cloudflare/room/access.js +44 -20
  10. package/dist/cloudflare/room/admission.js +28 -5
  11. package/dist/cloudflare/room/comments.js +28 -1
  12. package/dist/cloudflare/room/context.d.ts +139 -129
  13. package/dist/cloudflare/room/context.js +11 -4
  14. package/dist/cloudflare/room/forged.d.ts +14 -0
  15. package/dist/cloudflare/room/forged.js +30 -2
  16. package/dist/cloudflare/room/frames.d.ts +4 -0
  17. package/dist/cloudflare/room/frames.js +5 -1
  18. package/dist/cloudflare/room/purge.d.ts +6 -3
  19. package/dist/cloudflare/room/purge.js +45 -19
  20. package/dist/cloudflare/room/replicas.d.ts +4 -2
  21. package/dist/cloudflare/room/replicas.js +8 -3
  22. package/dist/cloudflare/room/suggest.d.ts +7 -0
  23. package/dist/cloudflare/room/suggest.js +143 -0
  24. package/dist/cloudflare/room/updates.d.ts +3 -4
  25. package/dist/cloudflare/room/updates.js +6 -8
  26. package/dist/cloudflare/routeDocumentSocket.d.ts +10 -1
  27. package/dist/cloudflare/routeDocumentSocket.js +5 -3
  28. package/dist/components/Content.svelte +9 -1
  29. package/dist/crdt/anchors.js +3 -2
  30. package/dist/crdt/attribution/attribution.d.ts +34 -12
  31. package/dist/crdt/attribution/attribution.js +59 -21
  32. package/dist/crdt/attribution/block.d.ts +3 -3
  33. package/dist/crdt/attribution/block.js +7 -8
  34. package/dist/crdt/attribution/index.d.ts +1 -1
  35. package/dist/crdt/attribution/index.js +1 -1
  36. package/dist/crdt/data.d.ts +62 -31
  37. package/dist/crdt/data.js +211 -103
  38. package/dist/crdt/doc/capability.js +9 -13
  39. package/dist/crdt/doc/delete.d.ts +1 -1
  40. package/dist/crdt/doc/delete.js +13 -30
  41. package/dist/crdt/doc/funnel.d.ts +1 -1
  42. package/dist/crdt/doc/funnel.js +34 -26
  43. package/dist/crdt/doc/gate.d.ts +3 -3
  44. package/dist/crdt/doc/history.d.ts +31 -9
  45. package/dist/crdt/doc/history.js +204 -73
  46. package/dist/crdt/doc/layout.js +16 -27
  47. package/dist/crdt/doc/meta.js +17 -23
  48. package/dist/crdt/doc/moves.d.ts +1 -1
  49. package/dist/crdt/doc/moves.js +52 -32
  50. package/dist/crdt/doc/reads.d.ts +2 -2
  51. package/dist/crdt/doc/reads.js +20 -30
  52. package/dist/crdt/doc/seed.js +2 -2
  53. package/dist/crdt/doc/split-merge.js +12 -15
  54. package/dist/crdt/doc/steps.d.ts +25 -13
  55. package/dist/crdt/doc/steps.js +55 -125
  56. package/dist/crdt/doc/suggest.d.ts +167 -0
  57. package/dist/crdt/doc/suggest.js +579 -0
  58. package/dist/crdt/doc/types.d.ts +21 -9
  59. package/dist/crdt/document.d.ts +26 -6
  60. package/dist/crdt/document.js +40 -15
  61. package/dist/crdt/edytor-doc.d.ts +410 -390
  62. package/dist/crdt/edytor-doc.js +143 -95
  63. package/dist/crdt/engine-api.d.ts +39 -1
  64. package/dist/crdt/engine.d.ts +2 -2
  65. package/dist/crdt/engine.js +4 -5
  66. package/dist/crdt/flow.d.ts +2 -2
  67. package/dist/crdt/flow.js +29 -37
  68. package/dist/crdt/index.d.ts +134 -127
  69. package/dist/crdt/index.js +4 -1
  70. package/dist/crdt/operations.d.ts +12 -3
  71. package/dist/crdt/parts.d.ts +43 -0
  72. package/dist/crdt/parts.js +44 -0
  73. package/dist/crdt/placement/display.d.ts +6 -31
  74. package/dist/crdt/placement/display.js +41 -146
  75. package/dist/crdt/placement/keys.d.ts +63 -0
  76. package/dist/crdt/placement/keys.js +95 -0
  77. package/dist/crdt/placement/model.d.ts +119 -118
  78. package/dist/crdt/placement/model.js +242 -142
  79. package/dist/crdt/placement/resolve.d.ts +123 -35
  80. package/dist/crdt/placement/resolve.js +188 -153
  81. package/dist/crdt/placement/slots.d.ts +134 -0
  82. package/dist/crdt/placement/slots.js +152 -0
  83. package/dist/crdt/protocol.d.ts +1 -1
  84. package/dist/crdt/protocol.js +1 -1
  85. package/dist/crdt/protocols/auth.d.ts +11 -1
  86. package/dist/crdt/protocols/auth.js +17 -1
  87. package/dist/crdt/protocols/comments.d.ts +16 -1
  88. package/dist/crdt/protocols/comments.js +9 -1
  89. package/dist/crdt/providers/index.d.ts +6 -4
  90. package/dist/crdt/providers/index.js +3 -1
  91. package/dist/crdt/providers/room.d.ts +16 -2
  92. package/dist/crdt/providers/room.js +64 -17
  93. package/dist/crdt/providers/websocket.d.ts +6 -4
  94. package/dist/crdt/providers/websocket.js +14 -7
  95. package/dist/crdt/purge.d.ts +24 -9
  96. package/dist/crdt/purge.js +266 -126
  97. package/dist/crdt/restore.d.ts +4 -3
  98. package/dist/crdt/restore.js +27 -34
  99. package/dist/crdt/schema.d.ts +30 -21
  100. package/dist/crdt/schema.js +39 -23
  101. package/dist/crdt/storage.d.ts +1 -1
  102. package/dist/crdt/storage.js +1 -1
  103. package/dist/crdt/structs.d.ts +17 -15
  104. package/dist/crdt/structs.js +10 -22
  105. package/dist/crdt/text/index/cache.js +4 -0
  106. package/dist/crdt/text/index/claims.js +13 -23
  107. package/dist/crdt/text/index/fold.d.ts +2 -3
  108. package/dist/crdt/text/index/fold.js +194 -44
  109. package/dist/crdt/text/index/layout.d.ts +2 -4
  110. package/dist/crdt/text/index/layout.js +14 -30
  111. package/dist/crdt/text/index/placement.d.ts +26 -18
  112. package/dist/crdt/text/index/placement.js +420 -157
  113. package/dist/crdt/text/index/records.d.ts +3 -3
  114. package/dist/crdt/text/index/records.js +24 -31
  115. package/dist/crdt/text/index/shared.d.ts +11 -3
  116. package/dist/crdt/text/index/shared.js +29 -17
  117. package/dist/crdt/text/index/state.d.ts +21 -17
  118. package/dist/crdt/text/index/state.js +15 -17
  119. package/dist/crdt/text/index/streams.d.ts +10 -5
  120. package/dist/crdt/text/index/streams.js +78 -27
  121. package/dist/crdt/text/items.d.ts +10 -3
  122. package/dist/crdt/text/items.js +7 -0
  123. package/dist/crdt/text/model.d.ts +87 -62
  124. package/dist/crdt/text/model.js +91 -169
  125. package/dist/crdt/text/ranges.d.ts +1 -1
  126. package/dist/crdt/text/ranges.js +3 -3
  127. package/dist/crdt/text/rows.d.ts +13 -7
  128. package/dist/crdt/text/rows.js +24 -7
  129. package/dist/crdt/text/runs.d.ts +51 -42
  130. package/dist/crdt/text/runs.js +24 -7
  131. package/dist/crdt/text/streams.d.ts +26 -13
  132. package/dist/crdt/text/streams.js +41 -14
  133. package/dist/crdt/vendor/yjs/UPSTREAM.md +651 -21
  134. package/dist/crdt/vendor/yjs/dts/global.d.ts +2 -0
  135. package/dist/crdt/vendor/yjs/dts/index.d.ts +1 -1
  136. package/dist/crdt/vendor/yjs/dts/structs/AbstractStruct.d.ts +7 -0
  137. package/dist/crdt/vendor/yjs/dts/structs/Item.d.ts +197 -10
  138. package/dist/crdt/vendor/yjs/dts/utils/Doc.d.ts +6 -3
  139. package/dist/crdt/vendor/yjs/dts/utils/StructStore.d.ts +5 -18
  140. package/dist/crdt/vendor/yjs/dts/utils/Transaction.d.ts +15 -1
  141. package/dist/crdt/vendor/yjs/dts/utils/UpdateDecoder.d.ts +14 -6
  142. package/dist/crdt/vendor/yjs/dts/utils/UpdateEncoder.d.ts +33 -6
  143. package/dist/crdt/vendor/yjs/dts/utils/ids.d.ts +1 -65
  144. package/dist/crdt/vendor/yjs/dts/utils/marks.d.ts +6 -1
  145. package/dist/crdt/vendor/yjs/dts/ynode.d.ts +54 -7
  146. package/dist/crdt/vendor/yjs/global.d.ts +2 -0
  147. package/dist/crdt/vendor/yjs/src/index.js +1 -1
  148. package/dist/crdt/vendor/yjs/src/structs/AbstractStruct.js +10 -0
  149. package/dist/crdt/vendor/yjs/src/structs/Item.js +649 -51
  150. package/dist/crdt/vendor/yjs/src/utils/BlockSet.js +18 -9
  151. package/dist/crdt/vendor/yjs/src/utils/Doc.js +5 -3
  152. package/dist/crdt/vendor/yjs/src/utils/StructStore.js +5 -0
  153. package/dist/crdt/vendor/yjs/src/utils/Transaction.js +36 -13
  154. package/dist/crdt/vendor/yjs/src/utils/UpdateDecoder.js +88 -18
  155. package/dist/crdt/vendor/yjs/src/utils/UpdateEncoder.js +119 -32
  156. package/dist/crdt/vendor/yjs/src/utils/encoding.js +13 -1
  157. package/dist/crdt/vendor/yjs/src/utils/ids.js +7 -7
  158. package/dist/crdt/vendor/yjs/src/utils/marks.js +193 -8
  159. package/dist/crdt/vendor/yjs/src/utils/redo.js +1 -1
  160. package/dist/crdt/vendor/yjs/src/utils/transaction-helpers.js +1 -1
  161. package/dist/crdt/vendor/yjs/src/utils/updates.js +3 -3
  162. package/dist/crdt/vendor/yjs/src/ynode.js +199 -12
  163. package/dist/edytor.svelte.d.ts +1 -1
  164. package/dist/edytor.svelte.js +103 -75
  165. package/dist/events/beforeInputCommands.d.ts +2 -2
  166. package/dist/events/beforeInputCommands.js +2 -2
  167. package/dist/events/nativeInteractiveControl.d.ts +11 -1
  168. package/dist/events/nativeInteractiveControl.js +41 -1
  169. package/dist/events/onBeforeInput.js +3 -3
  170. package/dist/events/onFocus.js +9 -11
  171. package/dist/events/onPageHide.d.ts +3 -0
  172. package/dist/events/onPageHide.js +16 -0
  173. package/dist/export/forms.d.ts +50 -50
  174. package/dist/index.d.ts +4 -2
  175. package/dist/index.js +1 -1
  176. package/dist/labels.d.ts +8 -0
  177. package/dist/labels.js +6 -1
  178. package/dist/plugins/comments/CommentsController.svelte.d.ts +5 -1
  179. package/dist/plugins/comments/CommentsController.svelte.js +14 -4
  180. package/dist/plugins/find/search.js +2 -2
  181. package/dist/plugins/index.d.ts +1 -0
  182. package/dist/plugins/index.js +1 -0
  183. package/dist/plugins/suggestions/SuggestionBars.svelte +40 -23
  184. package/dist/plugins/suggestions/SuggestionBars.svelte.d.ts +3 -1
  185. package/dist/plugins/suggestions/SuggestionRuns.svelte +77 -0
  186. package/dist/plugins/suggestions/SuggestionRuns.svelte.d.ts +9 -0
  187. package/dist/plugins/suggestions/shared.svelte.d.ts +58 -0
  188. package/dist/plugins/suggestions/shared.svelte.js +421 -0
  189. package/dist/plugins/suggestions/suggestionsPlugin.d.ts +15 -4
  190. package/dist/selection/domSelection.d.ts +2 -0
  191. package/dist/selection/domSelection.js +6 -2
  192. package/dist/selection/pointer.svelte.js +75 -48
  193. package/dist/selection/replaceSelection.js +2 -6
  194. package/dist/selection/selection.svelte.d.ts +3 -3
  195. package/dist/selection/selection.svelte.js +39 -32
  196. package/dist/selection/selection.utils.d.ts +14 -0
  197. package/dist/selection/selection.utils.js +28 -3
  198. package/dist/session/commands.js +21 -11
  199. package/dist/session/composition.svelte.d.ts +5 -3
  200. package/dist/session/composition.svelte.js +21 -17
  201. package/dist/session/handles.d.ts +4 -17
  202. package/dist/session/handles.js +11 -37
  203. package/dist/session/navigation.js +6 -9
  204. package/dist/session/selection.d.ts +11 -5
  205. package/dist/session/selection.js +14 -48
  206. package/dist/session/suggestions.svelte.d.ts +38 -9
  207. package/dist/session/suggestions.svelte.js +37 -18
  208. package/dist/session/virtual.d.ts +1 -1
  209. package/dist/surface/attributes.d.ts +5 -0
  210. package/dist/surface/attributes.js +2 -2
  211. package/dist/surface/cells.d.ts +2 -26
  212. package/dist/surface/cells.js +2 -33
  213. package/dist/surface/observer.svelte.d.ts +6 -1
  214. package/dist/surface/observer.svelte.js +130 -83
  215. package/dist/surface/pin.svelte.d.ts +9 -9
  216. package/dist/surface/pin.svelte.js +15 -22
  217. package/dist/surface/projector.svelte.d.ts +15 -3
  218. package/dist/surface/projector.svelte.js +67 -22
  219. package/dist/text/text.svelte.js +14 -19
  220. package/dist/themes/notion.css +29 -0
  221. package/package.json +4 -2
  222. package/dist/crdt/placement/rank.d.ts +0 -87
  223. package/dist/crdt/placement/rank.js +0 -332
  224. package/dist/crdt/placement/source.d.ts +0 -43
  225. package/dist/crdt/placement/source.js +0 -66
  226. package/dist/crdt/text/delete-index.d.ts +0 -129
  227. package/dist/crdt/text/delete-index.js +0 -365
  228. package/dist/crdt/text/deletes.d.ts +0 -76
  229. package/dist/crdt/text/deletes.js +0 -362
  230. package/dist/crdt/text/index/anchored.d.ts +0 -17
  231. package/dist/crdt/text/index/anchored.js +0 -197
@@ -168,12 +168,12 @@ export type MathML = (tex: string, display: boolean) => string;
168
168
  export declare const equationForms: (mathml?: MathML) => {
169
169
  blocks: {
170
170
  equation: {
171
+ lines?: boolean;
171
172
  itemKind?: string;
172
173
  island?: boolean;
173
- rendersContent: boolean;
174
174
  defaultChild?: string;
175
+ rendersContent: boolean;
175
176
  void: boolean;
176
- lines?: boolean;
177
177
  html?: string | ((block: JSONBlock, content: string, children: string) => string);
178
178
  markdown?: (block: JSONBlock, content: string, children: string, context: import("../plugins.js").MarkdownContext) => string;
179
179
  plain?: (block: JSONBlock, content: string, children: string) => string;
@@ -232,12 +232,12 @@ export declare const bundledRead: () => {
232
232
  level: "h1" | "h2" | "h3";
233
233
  };
234
234
  }[];
235
+ lines?: boolean | undefined;
235
236
  itemKind?: string | undefined;
236
237
  island?: boolean | undefined;
237
- rendersContent?: boolean | undefined;
238
238
  defaultChild?: string | undefined;
239
+ rendersContent?: boolean | undefined;
239
240
  void?: boolean | undefined;
240
- lines?: boolean | undefined;
241
241
  html?: string | ((block: JSONBlock, content: string, children: string) => string) | undefined;
242
242
  markdown?: ((block: JSONBlock, content: string, children: string, context: import("../plugins.js").MarkdownContext) => string) | undefined;
243
243
  plain?: ((block: JSONBlock, content: string, children: string) => string) | undefined;
@@ -247,12 +247,12 @@ export declare const bundledRead: () => {
247
247
  };
248
248
  'bulleted-list-item': {
249
249
  presets: {}[];
250
+ lines?: boolean | undefined;
250
251
  itemKind?: string | undefined;
251
252
  island?: boolean | undefined;
252
- rendersContent?: boolean | undefined;
253
253
  defaultChild?: string | undefined;
254
+ rendersContent?: boolean | undefined;
254
255
  void?: boolean | undefined;
255
- lines?: boolean | undefined;
256
256
  html?: string | ((block: JSONBlock, content: string, children: string) => string) | undefined;
257
257
  markdown?: ((block: JSONBlock, content: string, children: string, context: import("../plugins.js").MarkdownContext) => string) | undefined;
258
258
  plain?: ((block: JSONBlock, content: string, children: string) => string) | undefined;
@@ -262,12 +262,12 @@ export declare const bundledRead: () => {
262
262
  };
263
263
  'numbered-list-item': {
264
264
  presets: {}[];
265
+ lines?: boolean | undefined;
265
266
  itemKind?: string | undefined;
266
267
  island?: boolean | undefined;
267
- rendersContent?: boolean | undefined;
268
268
  defaultChild?: string | undefined;
269
+ rendersContent?: boolean | undefined;
269
270
  void?: boolean | undefined;
270
- lines?: boolean | undefined;
271
271
  html?: string | ((block: JSONBlock, content: string, children: string) => string) | undefined;
272
272
  markdown?: ((block: JSONBlock, content: string, children: string, context: import("../plugins.js").MarkdownContext) => string) | undefined;
273
273
  plain?: ((block: JSONBlock, content: string, children: string) => string) | undefined;
@@ -284,12 +284,12 @@ export declare const bundledRead: () => {
284
284
  };
285
285
  toggle: {
286
286
  presets: {}[];
287
+ lines?: boolean | undefined;
287
288
  itemKind?: string | undefined;
288
289
  island?: boolean | undefined;
289
- rendersContent?: boolean | undefined;
290
290
  defaultChild?: string | undefined;
291
+ rendersContent?: boolean | undefined;
291
292
  void?: boolean | undefined;
292
- lines?: boolean | undefined;
293
293
  html?: string | ((block: JSONBlock, content: string, children: string) => string) | undefined;
294
294
  markdown?: ((block: JSONBlock, content: string, children: string, context: import("../plugins.js").MarkdownContext) => string) | undefined;
295
295
  plain?: ((block: JSONBlock, content: string, children: string) => string) | undefined;
@@ -303,12 +303,12 @@ export declare const bundledRead: () => {
303
303
  level: "h1" | "h2" | "h3";
304
304
  };
305
305
  }[];
306
+ lines?: boolean | undefined;
306
307
  itemKind?: string | undefined;
307
308
  island?: boolean | undefined;
308
- rendersContent?: boolean | undefined;
309
309
  defaultChild?: string | undefined;
310
+ rendersContent?: boolean | undefined;
310
311
  void?: boolean | undefined;
311
- lines?: boolean | undefined;
312
312
  html?: string | ((block: JSONBlock, content: string, children: string) => string) | undefined;
313
313
  markdown?: ((block: JSONBlock, content: string, children: string, context: import("../plugins.js").MarkdownContext) => string) | undefined;
314
314
  plain?: ((block: JSONBlock, content: string, children: string) => string) | undefined;
@@ -318,12 +318,12 @@ export declare const bundledRead: () => {
318
318
  };
319
319
  callout: {
320
320
  presets: {}[];
321
+ lines?: boolean | undefined;
321
322
  itemKind?: string | undefined;
322
323
  island?: boolean | undefined;
323
- rendersContent?: boolean | undefined;
324
324
  defaultChild?: string | undefined;
325
+ rendersContent?: boolean | undefined;
325
326
  void?: boolean | undefined;
326
- lines?: boolean | undefined;
327
327
  html?: string | ((block: JSONBlock, content: string, children: string) => string) | undefined;
328
328
  markdown?: ((block: JSONBlock, content: string, children: string, context: import("../plugins.js").MarkdownContext) => string) | undefined;
329
329
  plain?: ((block: JSONBlock, content: string, children: string) => string) | undefined;
@@ -333,12 +333,12 @@ export declare const bundledRead: () => {
333
333
  };
334
334
  quote: {
335
335
  presets: {}[];
336
+ lines?: boolean | undefined;
336
337
  itemKind?: string | undefined;
337
338
  island?: boolean | undefined;
338
- rendersContent?: boolean | undefined;
339
339
  defaultChild?: string | undefined;
340
+ rendersContent?: boolean | undefined;
340
341
  void?: boolean | undefined;
341
- lines?: boolean | undefined;
342
342
  html?: string | ((block: JSONBlock, content: string, children: string) => string) | undefined;
343
343
  markdown?: ((block: JSONBlock, content: string, children: string, context: import("../plugins.js").MarkdownContext) => string) | undefined;
344
344
  plain?: ((block: JSONBlock, content: string, children: string) => string) | undefined;
@@ -348,12 +348,12 @@ export declare const bundledRead: () => {
348
348
  };
349
349
  divider: {
350
350
  presets: {}[];
351
+ lines?: boolean | undefined;
351
352
  itemKind?: string | undefined;
352
353
  island?: boolean | undefined;
353
- rendersContent: boolean;
354
354
  defaultChild?: string | undefined;
355
+ rendersContent: boolean;
355
356
  void: boolean;
356
- lines?: boolean | undefined;
357
357
  html?: string | ((block: JSONBlock, content: string, children: string) => string) | undefined;
358
358
  markdown?: ((block: JSONBlock, content: string, children: string, context: import("../plugins.js").MarkdownContext) => string) | undefined;
359
359
  plain?: ((block: JSONBlock, content: string, children: string) => string) | undefined;
@@ -362,12 +362,12 @@ export declare const bundledRead: () => {
362
362
  contentElement?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
363
363
  };
364
364
  'ordered-list': {
365
+ lines?: boolean | undefined;
365
366
  itemKind?: string | undefined;
366
367
  island?: boolean | undefined;
367
- rendersContent: boolean;
368
368
  defaultChild: string;
369
+ rendersContent: boolean;
369
370
  void?: boolean | undefined;
370
- lines?: boolean | undefined;
371
371
  html?: string | ((block: JSONBlock, content: string, children: string) => string) | undefined;
372
372
  markdown?: ((block: JSONBlock, content: string, children: string, context: import("../plugins.js").MarkdownContext) => string) | undefined;
373
373
  plain?: ((block: JSONBlock, content: string, children: string) => string) | undefined;
@@ -376,12 +376,12 @@ export declare const bundledRead: () => {
376
376
  contentElement?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
377
377
  };
378
378
  'unordered-list': {
379
+ lines?: boolean | undefined;
379
380
  itemKind?: string | undefined;
380
381
  island?: boolean | undefined;
381
- rendersContent: boolean;
382
382
  defaultChild: string;
383
+ rendersContent: boolean;
383
384
  void?: boolean | undefined;
384
- lines?: boolean | undefined;
385
385
  html?: string | ((block: JSONBlock, content: string, children: string) => string) | undefined;
386
386
  markdown?: ((block: JSONBlock, content: string, children: string, context: import("../plugins.js").MarkdownContext) => string) | undefined;
387
387
  plain?: ((block: JSONBlock, content: string, children: string) => string) | undefined;
@@ -398,12 +398,12 @@ export declare const bundledRead: () => {
398
398
  };
399
399
  codeLine: {};
400
400
  table: {
401
+ lines?: boolean | undefined;
401
402
  itemKind?: string | undefined;
402
403
  island?: boolean | undefined;
403
- rendersContent: boolean;
404
404
  defaultChild: string;
405
+ rendersContent: boolean;
405
406
  void?: boolean | undefined;
406
- lines?: boolean | undefined;
407
407
  html?: string | ((block: JSONBlock, content: string, children: string) => string) | undefined;
408
408
  markdown?: ((block: JSONBlock, content: string, children: string, context: import("../plugins.js").MarkdownContext) => string) | undefined;
409
409
  plain?: ((block: JSONBlock, content: string, children: string) => string) | undefined;
@@ -413,12 +413,12 @@ export declare const bundledRead: () => {
413
413
  table: true;
414
414
  };
415
415
  tableRow: {
416
+ lines?: boolean | undefined;
416
417
  itemKind?: string | undefined;
417
418
  island?: boolean | undefined;
418
- rendersContent: boolean;
419
419
  defaultChild: string;
420
+ rendersContent: boolean;
420
421
  void?: boolean | undefined;
421
- lines?: boolean | undefined;
422
422
  html?: string | ((block: JSONBlock, content: string, children: string) => string) | undefined;
423
423
  markdown?: ((block: JSONBlock, content: string, children: string, context: import("../plugins.js").MarkdownContext) => string) | undefined;
424
424
  plain?: ((block: JSONBlock, content: string, children: string) => string) | undefined;
@@ -427,12 +427,12 @@ export declare const bundledRead: () => {
427
427
  contentElement?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
428
428
  };
429
429
  tableCell: {
430
+ lines?: boolean | undefined;
430
431
  itemKind?: string | undefined;
431
432
  island: boolean;
432
- rendersContent?: boolean | undefined;
433
433
  defaultChild?: string | undefined;
434
+ rendersContent?: boolean | undefined;
434
435
  void?: boolean | undefined;
435
- lines?: boolean | undefined;
436
436
  html?: string | ((block: JSONBlock, content: string, children: string) => string) | undefined;
437
437
  markdown?: ((block: JSONBlock, content: string, children: string, context: import("../plugins.js").MarkdownContext) => string) | undefined;
438
438
  plain?: ((block: JSONBlock, content: string, children: string) => string) | undefined;
@@ -441,12 +441,12 @@ export declare const bundledRead: () => {
441
441
  contentElement?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
442
442
  };
443
443
  image: {
444
+ lines?: boolean | undefined;
444
445
  itemKind?: string | undefined;
445
446
  island?: boolean | undefined;
446
- rendersContent?: boolean | undefined;
447
447
  defaultChild?: string | undefined;
448
+ rendersContent?: boolean | undefined;
448
449
  void: boolean;
449
- lines?: boolean | undefined;
450
450
  html?: string | ((block: JSONBlock, content: string, children: string) => string) | undefined;
451
451
  markdown?: ((block: JSONBlock, content: string, children: string, context: import("../plugins.js").MarkdownContext) => string) | undefined;
452
452
  plain?: ((block: JSONBlock, content: string, children: string) => string) | undefined;
@@ -455,12 +455,12 @@ export declare const bundledRead: () => {
455
455
  contentElement?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
456
456
  };
457
457
  embed: {
458
+ lines?: boolean | undefined;
458
459
  itemKind?: string | undefined;
459
460
  island?: boolean | undefined;
460
- rendersContent?: boolean | undefined;
461
461
  defaultChild?: string | undefined;
462
+ rendersContent?: boolean | undefined;
462
463
  void: boolean;
463
- lines?: boolean | undefined;
464
464
  html?: string | ((block: JSONBlock, content: string, children: string) => string) | undefined;
465
465
  markdown?: ((block: JSONBlock, content: string, children: string, context: import("../plugins.js").MarkdownContext) => string) | undefined;
466
466
  plain?: ((block: JSONBlock, content: string, children: string) => string) | undefined;
@@ -469,12 +469,12 @@ export declare const bundledRead: () => {
469
469
  contentElement?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
470
470
  };
471
471
  bookmark: {
472
+ lines?: boolean | undefined;
472
473
  itemKind?: string | undefined;
473
474
  island?: boolean | undefined;
474
- rendersContent?: boolean | undefined;
475
475
  defaultChild?: string | undefined;
476
+ rendersContent?: boolean | undefined;
476
477
  void: boolean;
477
- lines?: boolean | undefined;
478
478
  html?: string | ((block: JSONBlock, content: string, children: string) => string) | undefined;
479
479
  markdown?: ((block: JSONBlock, content: string, children: string, context: import("../plugins.js").MarkdownContext) => string) | undefined;
480
480
  plain?: ((block: JSONBlock, content: string, children: string) => string) | undefined;
@@ -483,12 +483,12 @@ export declare const bundledRead: () => {
483
483
  contentElement?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
484
484
  };
485
485
  file: {
486
+ lines?: boolean | undefined;
486
487
  itemKind?: string | undefined;
487
488
  island?: boolean | undefined;
488
- rendersContent?: boolean | undefined;
489
489
  defaultChild?: string | undefined;
490
+ rendersContent?: boolean | undefined;
490
491
  void: boolean;
491
- lines?: boolean | undefined;
492
492
  html?: string | ((block: JSONBlock, content: string, children: string) => string) | undefined;
493
493
  markdown?: ((block: JSONBlock, content: string, children: string, context: import("../plugins.js").MarkdownContext) => string) | undefined;
494
494
  plain?: ((block: JSONBlock, content: string, children: string) => string) | undefined;
@@ -497,12 +497,12 @@ export declare const bundledRead: () => {
497
497
  contentElement?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
498
498
  };
499
499
  video: {
500
+ lines?: boolean | undefined;
500
501
  itemKind?: string | undefined;
501
502
  island?: boolean | undefined;
502
- rendersContent?: boolean | undefined;
503
503
  defaultChild?: string | undefined;
504
+ rendersContent?: boolean | undefined;
504
505
  void: boolean;
505
- lines?: boolean | undefined;
506
506
  html?: string | ((block: JSONBlock, content: string, children: string) => string) | undefined;
507
507
  markdown?: ((block: JSONBlock, content: string, children: string, context: import("../plugins.js").MarkdownContext) => string) | undefined;
508
508
  plain?: ((block: JSONBlock, content: string, children: string) => string) | undefined;
@@ -511,12 +511,12 @@ export declare const bundledRead: () => {
511
511
  contentElement?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
512
512
  };
513
513
  audio: {
514
+ lines?: boolean | undefined;
514
515
  itemKind?: string | undefined;
515
516
  island?: boolean | undefined;
516
- rendersContent?: boolean | undefined;
517
517
  defaultChild?: string | undefined;
518
+ rendersContent?: boolean | undefined;
518
519
  void: boolean;
519
- lines?: boolean | undefined;
520
520
  html?: string | ((block: JSONBlock, content: string, children: string) => string) | undefined;
521
521
  markdown?: ((block: JSONBlock, content: string, children: string, context: import("../plugins.js").MarkdownContext) => string) | undefined;
522
522
  plain?: ((block: JSONBlock, content: string, children: string) => string) | undefined;
@@ -525,12 +525,12 @@ export declare const bundledRead: () => {
525
525
  contentElement?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
526
526
  };
527
527
  page: {
528
+ lines?: boolean | undefined;
528
529
  itemKind?: string | undefined;
529
530
  island?: boolean | undefined;
530
- rendersContent: boolean;
531
531
  defaultChild?: string | undefined;
532
+ rendersContent: boolean;
532
533
  void: boolean;
533
- lines?: boolean | undefined;
534
534
  html?: string | ((block: JSONBlock, content: string, children: string) => string) | undefined;
535
535
  markdown?: ((block: JSONBlock, content: string, children: string, context: import("../plugins.js").MarkdownContext) => string) | undefined;
536
536
  plain?: ((block: JSONBlock, content: string, children: string) => string) | undefined;
@@ -539,12 +539,12 @@ export declare const bundledRead: () => {
539
539
  contentElement?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
540
540
  };
541
541
  toc: {
542
+ lines?: boolean | undefined;
542
543
  itemKind?: string | undefined;
543
544
  island?: boolean | undefined;
544
- rendersContent: boolean;
545
545
  defaultChild?: string | undefined;
546
+ rendersContent: boolean;
546
547
  void: boolean;
547
- lines?: boolean | undefined;
548
548
  html?: string | ((block: JSONBlock, content: string, children: string) => string) | undefined;
549
549
  markdown?: ((block: JSONBlock, content: string, children: string, context: import("../plugins.js").MarkdownContext) => string) | undefined;
550
550
  plain?: ((block: JSONBlock, content: string, children: string) => string) | undefined;
@@ -553,12 +553,12 @@ export declare const bundledRead: () => {
553
553
  contentElement?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
554
554
  };
555
555
  equation: {
556
+ lines?: boolean | undefined;
556
557
  itemKind?: string | undefined;
557
558
  island?: boolean | undefined;
558
- rendersContent: boolean;
559
559
  defaultChild?: string | undefined;
560
+ rendersContent: boolean;
560
561
  void: boolean;
561
- lines?: boolean | undefined;
562
562
  html?: string | ((block: JSONBlock, content: string, children: string) => string) | undefined;
563
563
  markdown?: ((block: JSONBlock, content: string, children: string, context: import("../plugins.js").MarkdownContext) => string) | undefined;
564
564
  plain?: ((block: JSONBlock, content: string, children: string) => string) | undefined;
@@ -567,12 +567,12 @@ export declare const bundledRead: () => {
567
567
  contentElement?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
568
568
  };
569
569
  columns: {
570
+ lines?: boolean | undefined;
570
571
  itemKind?: string | undefined;
571
572
  island?: boolean | undefined;
572
- rendersContent: boolean;
573
573
  defaultChild: string;
574
+ rendersContent: boolean;
574
575
  void?: boolean | undefined;
575
- lines?: boolean | undefined;
576
576
  html?: string | ((block: JSONBlock, content: string, children: string) => string) | undefined;
577
577
  markdown?: ((block: JSONBlock, content: string, children: string, context: import("../plugins.js").MarkdownContext) => string) | undefined;
578
578
  plain?: ((block: JSONBlock, content: string, children: string) => string) | undefined;
@@ -582,12 +582,12 @@ export declare const bundledRead: () => {
582
582
  layout: true;
583
583
  };
584
584
  column: {
585
+ lines?: boolean | undefined;
585
586
  itemKind?: string | undefined;
586
587
  island?: boolean | undefined;
587
- rendersContent: boolean;
588
588
  defaultChild?: string | undefined;
589
+ rendersContent: boolean;
589
590
  void?: boolean | undefined;
590
- lines?: boolean | undefined;
591
591
  html?: string | ((block: JSONBlock, content: string, children: string) => string) | undefined;
592
592
  markdown?: ((block: JSONBlock, content: string, children: string, context: import("../plugins.js").MarkdownContext) => string) | undefined;
593
593
  plain?: ((block: JSONBlock, content: string, children: string) => string) | undefined;
package/dist/index.d.ts CHANGED
@@ -42,7 +42,7 @@ export type { CommandResult } from './session/commands.js';
42
42
  export { convertToKind, turnCommands, wrapBlocks, wrappable, type KindRow } from './kinds.js';
43
43
  export { textToBlocks, type TextToBlocksOptions } from './clipboard/textBlocks.js';
44
44
  export type { Suggestion, Suggestions, SuggestionAt, SuggestionContent, SuggestionOptions, SuggestionRange, SuggestionStatus, SuggestionsAt, ResolvedAt } from './session/suggestions.svelte.js';
45
- export { createRichTextPlugin, richTextOperations, richTextPlaceholder, CALLOUT_ICONS, createCalloutIconsPlugin, type CalloutIconPicker, type CalloutIconsOptions, type RichTextPluginOptions, type TodoCheckboxPayload, type CalloutIconPayload, type EmptyBodyPayload, createArrowMovePlugin, createCodePlugin, CODE_LANGUAGES, loadCodeLanguage, type CodeLanguage, type CodePluginOptions, type CodeHeader, type LanguageMenu, type LanguageMenuItem, type LanguageRow, createMarkdownShortcutsPlugin, createMentionPlugin, type MentionItem, type MentionData, type MentionPluginOptions, createPageLinkPlugin, type PageLinkItem, type PageLinkData, type PageLinkPluginOptions, type TriggerMenuController, withRulesAndTriggers, BLOCK_ACTIVATE_EVENT, BLOCK_ADD_EVENT, type BlockActivation, type BlockAddition, createBlockHandlesPlugin, type BlockHandlesOptions, type BlockHandleSnippetPayload, type BlockHandleController, createSlashMenuPlugin, type SlashMenuOptions, type SlashMenuController, createToolbarPlugin, type ToolbarOptions, type ToolbarController, createBlockMenuPlugin, type BlockMenuOptions, type BlockMenuController, type BlockMenuAction, type BlockMenuColor, createSuggestionsPlugin, createSuggestionBarPlugin, type SuggestionBarOptions, type SuggestionBarPayload, createImagePlugin, type ImagePluginOptions, safeImageSrc, storableImageSrc, MAX_INLINE_IMAGE_BYTES, createColumnsPlugin, type ColumnsPluginOptions, createEmbedPlugin, EMBED_PROVIDERS, EMBED_SANDBOX, EMBED_ALLOW, embedSourceOf, type EmbedProvider, type EmbedPluginOptions, type EmbedFallbackPayload, createBookmarkPlugin, type BookmarkPluginOptions, type BookmarkPreview, type BookmarkCardPayload, createFilePlugin, type FilePluginOptions, type FileRowPayload, createVideoPlugin, type VideoPluginOptions, createAudioPlugin, type AudioPluginOptions, safeWebUrl, safeMediaSrc, type MediaKind, createMediaEmptyPlugin, type MediaEmptyOptions, createImageToolbarPlugin, type ImageToolbar, type ImageToolbarOptions, type MediaEmptyController, type MediaEmptyFailure, type UrlPasteController, type UrlPasteOffer, type UrlPasteOption, type ImageControls, type ImageBox, type ChromeAnchor, type MenuItemPayload, createFindPlugin, findController, findMatches, type FindPluginOptions, type FindController, type ReplaceMatches, type FindMatch, type FindOptions, createMarqueePlugin, type MarqueePluginOptions, type MarqueeBoxPayload, createCommentsPlugin, commentsController, type CommentsPluginOptions, type CommentCardPayload, type CommentsController, type CommentDraft, type CommentNotice, type CommentUser, type PlacedThread, createPagePlugin, type PagePluginOptions, type PageBlockLinkPayload, createTocPlugin, type TocPluginOptions, type TocHeadingLevel, type TocEntryPayload, type TocEmptyPayload, createTablePlugin, type TablePluginOptions, insertTableRow, deleteTableRows, insertTableColumn, deleteTableColumn, moveTableColumn, moveTableRows, fillTableCell, type TableChrome, type TableMenu, type TableMenuRow, type TableMenuItem, type TableGripPayload, type TableAddPayload, tableBlock, type TableBlockOptions, createEquationPlugin, KATEX_CDN, KATEX_VERSION, type EquationPluginOptions, type EquationData, type EquationEditor, type EquationErrorPayload, type EquationPlaceholderPayload, type EquationTarget, type KatexLike, type KatexLoader } from './plugins/index.js';
45
+ export { createRichTextPlugin, richTextOperations, richTextPlaceholder, CALLOUT_ICONS, createCalloutIconsPlugin, type CalloutIconPicker, type CalloutIconsOptions, type RichTextPluginOptions, type TodoCheckboxPayload, type CalloutIconPayload, type EmptyBodyPayload, createArrowMovePlugin, createCodePlugin, CODE_LANGUAGES, loadCodeLanguage, type CodeLanguage, type CodePluginOptions, type CodeHeader, type LanguageMenu, type LanguageMenuItem, type LanguageRow, createMarkdownShortcutsPlugin, createMentionPlugin, type MentionItem, type MentionData, type MentionPluginOptions, createPageLinkPlugin, type PageLinkItem, type PageLinkData, type PageLinkPluginOptions, type TriggerMenuController, withRulesAndTriggers, BLOCK_ACTIVATE_EVENT, BLOCK_ADD_EVENT, type BlockActivation, type BlockAddition, createBlockHandlesPlugin, type BlockHandlesOptions, type BlockHandleSnippetPayload, type BlockHandleController, createSlashMenuPlugin, type SlashMenuOptions, type SlashMenuController, createToolbarPlugin, type ToolbarOptions, type ToolbarController, createBlockMenuPlugin, type BlockMenuOptions, type BlockMenuController, type BlockMenuAction, type BlockMenuColor, createSuggestionsPlugin, createSuggestionBarPlugin, type SuggestionBarOptions, type SuggestionBarPayload, createSharedSuggestionsPlugin, sharedSuggestionsController, type SharedSuggestionsController, type SharedSuggestionOptions, createImagePlugin, type ImagePluginOptions, safeImageSrc, storableImageSrc, MAX_INLINE_IMAGE_BYTES, createColumnsPlugin, type ColumnsPluginOptions, createEmbedPlugin, EMBED_PROVIDERS, EMBED_SANDBOX, EMBED_ALLOW, embedSourceOf, type EmbedProvider, type EmbedPluginOptions, type EmbedFallbackPayload, createBookmarkPlugin, type BookmarkPluginOptions, type BookmarkPreview, type BookmarkCardPayload, createFilePlugin, type FilePluginOptions, type FileRowPayload, createVideoPlugin, type VideoPluginOptions, createAudioPlugin, type AudioPluginOptions, safeWebUrl, safeMediaSrc, type MediaKind, createMediaEmptyPlugin, type MediaEmptyOptions, createImageToolbarPlugin, type ImageToolbar, type ImageToolbarOptions, type MediaEmptyController, type MediaEmptyFailure, type UrlPasteController, type UrlPasteOffer, type UrlPasteOption, type ImageControls, type ImageBox, type ChromeAnchor, type MenuItemPayload, createFindPlugin, findController, findMatches, type FindPluginOptions, type FindController, type ReplaceMatches, type FindMatch, type FindOptions, createMarqueePlugin, type MarqueePluginOptions, type MarqueeBoxPayload, createCommentsPlugin, commentsController, type CommentsPluginOptions, type CommentCardPayload, type CommentsController, type CommentDraft, type CommentNotice, type CommentUser, type PlacedThread, createPagePlugin, type PagePluginOptions, type PageBlockLinkPayload, createTocPlugin, type TocPluginOptions, type TocHeadingLevel, type TocEntryPayload, type TocEmptyPayload, createTablePlugin, type TablePluginOptions, insertTableRow, deleteTableRows, insertTableColumn, deleteTableColumn, moveTableColumn, moveTableRows, fillTableCell, type TableChrome, type TableMenu, type TableMenuRow, type TableMenuItem, type TableGripPayload, type TableAddPayload, tableBlock, type TableBlockOptions, createEquationPlugin, KATEX_CDN, KATEX_VERSION, type EquationPluginOptions, type EquationData, type EquationEditor, type EquationErrorPayload, type EquationPlaceholderPayload, type EquationTarget, type KatexLike, type KatexLoader } from './plugins/index.js';
46
46
  export { BLOCK_COLORS, setBlockColor, type BlockColorField } from './block/colors.js';
47
47
  export { englishLabels, type Labels, type PartialLabels } from './labels.js';
48
48
  export { EdytorDocument, createDocument, loadDocument, attachDocument, defaultSemantics, semanticsOf, mergeSemantics, SemanticConflictError, DocumentNotReadyError, DocumentDestroyedError, SchemaMismatchError, UndecodableUpdateError, SyncRefusedError, type CreateDocumentOptions, type LoadDocumentOptions, type DocumentActor, type DocumentReadiness, type KindSemantics, type JSONDoc, type JSONBlock, type JSONText, type JSONInlineBlock, type OpResult, type Plan, type Prepared, type DocChange } from './crdt/index.js';
@@ -51,7 +51,9 @@ export { createCommentsClient, createMemoryCommentsClient, CommentRequestError,
51
51
  export { VersionHistory, createHistoryClient, HistoryRequestError, versionDiff, type HistoryClient, type HistoryClientOptions, type HistoryRestoreResult, type HistoryUndoResult, type HistoryVersion, type VersionHistoryStatus, type VersionHistoryOptions, type VersionChange, type VersionDiff } from './collaboration/history/index.js';
52
52
  export type { EdytorProps } from './components/Edytor.svelte';
53
53
  export type { EdytorOptions } from './edytor.svelte.js';
54
- export type { BlockMenuLabels, CodeLabels, ColumnsLabels, CommentsLabels, EditorLabels, EquationLabels, ImageLabels, MediaLabels, PageLabels, PageLinkLabels, RichTextLabels, TableLabels, TocLabels } from './labels.js';
54
+ export type { BlockMenuLabels, CodeLabels, ColumnsLabels, CommentsLabels, EditorLabels, EquationLabels, ImageLabels, MediaLabels, PageLabels, PageLinkLabels, RichTextLabels, SuggestionsLabels, TableLabels, TocLabels } from './labels.js';
55
+ export type { SuggestedChange } from './crdt/doc/suggest.js';
56
+ export type { AnySuggestion, SharedSuggestion } from './session/suggestions.svelte.js';
55
57
  export type { BlockElement, BlockView, InitializedPlugin, InlineBlockView, PluginDefinitions, PluginOperations } from './plugins.js';
56
58
  export type { Dispatcher } from './session/commands.js';
57
59
  export type { PresenceSelection, SelectionPoint, SelectionProjection, SelectionSegment, SelectionValue } from './session/selection.js';
package/dist/index.js CHANGED
@@ -35,7 +35,7 @@ export { PreventionError, isPrevention } from './utils.js';
35
35
  export { convertToKind, turnCommands, wrapBlocks, wrappable } from './kinds.js';
36
36
  export { textToBlocks } from './clipboard/textBlocks.js';
37
37
  // ── The bundled plugins ────────────────────────────────────────────────
38
- export { createRichTextPlugin, richTextOperations, richTextPlaceholder, CALLOUT_ICONS, createCalloutIconsPlugin, createArrowMovePlugin, createCodePlugin, CODE_LANGUAGES, loadCodeLanguage, createMarkdownShortcutsPlugin, createMentionPlugin, createPageLinkPlugin, withRulesAndTriggers, BLOCK_ACTIVATE_EVENT, BLOCK_ADD_EVENT, createBlockHandlesPlugin, createSlashMenuPlugin, createToolbarPlugin, createBlockMenuPlugin, createSuggestionsPlugin, createSuggestionBarPlugin, createImagePlugin, safeImageSrc, storableImageSrc, MAX_INLINE_IMAGE_BYTES, createColumnsPlugin, createEmbedPlugin, EMBED_PROVIDERS, EMBED_SANDBOX, EMBED_ALLOW, embedSourceOf, createBookmarkPlugin, createFilePlugin, createVideoPlugin, createAudioPlugin, safeWebUrl, safeMediaSrc, createMediaEmptyPlugin, createImageToolbarPlugin, createFindPlugin, findController, findMatches, createMarqueePlugin, createCommentsPlugin, commentsController, createPagePlugin, createTocPlugin, createTablePlugin, insertTableRow, deleteTableRows, insertTableColumn, deleteTableColumn, moveTableColumn, moveTableRows, fillTableCell, tableBlock, createEquationPlugin, KATEX_CDN, KATEX_VERSION } from './plugins/index.js';
38
+ export { createRichTextPlugin, richTextOperations, richTextPlaceholder, CALLOUT_ICONS, createCalloutIconsPlugin, createArrowMovePlugin, createCodePlugin, CODE_LANGUAGES, loadCodeLanguage, createMarkdownShortcutsPlugin, createMentionPlugin, createPageLinkPlugin, withRulesAndTriggers, BLOCK_ACTIVATE_EVENT, BLOCK_ADD_EVENT, createBlockHandlesPlugin, createSlashMenuPlugin, createToolbarPlugin, createBlockMenuPlugin, createSuggestionsPlugin, createSuggestionBarPlugin, createSharedSuggestionsPlugin, sharedSuggestionsController, createImagePlugin, safeImageSrc, storableImageSrc, MAX_INLINE_IMAGE_BYTES, createColumnsPlugin, createEmbedPlugin, EMBED_PROVIDERS, EMBED_SANDBOX, EMBED_ALLOW, embedSourceOf, createBookmarkPlugin, createFilePlugin, createVideoPlugin, createAudioPlugin, safeWebUrl, safeMediaSrc, createMediaEmptyPlugin, createImageToolbarPlugin, createFindPlugin, findController, findMatches, createMarqueePlugin, createCommentsPlugin, commentsController, createPagePlugin, createTocPlugin, createTablePlugin, insertTableRow, deleteTableRows, insertTableColumn, deleteTableColumn, moveTableColumn, moveTableRows, fillTableCell, tableBlock, createEquationPlugin, KATEX_CDN, KATEX_VERSION } from './plugins/index.js';
39
39
  export { BLOCK_COLORS, setBlockColor } from './block/colors.js';
40
40
  // ── Localization ───────────────────────────────────────────────────────
41
41
  export { englishLabels } from './labels.js';
package/dist/labels.d.ts CHANGED
@@ -27,6 +27,11 @@ export type EditorLabels = {
27
27
  moved: (what: string) => string;
28
28
  deleted: (what: string) => string;
29
29
  };
30
+ /** The shared suggestions plugin's words (`createSharedSuggestionsPlugin`). */
31
+ export type SuggestionsLabels = {
32
+ /** Announced when a change is refused because the view is suggesting (a move, a merge, a retype, a data change, a format). */
33
+ notSuggested: string;
34
+ };
30
35
  /** The rich text kinds and marks: their names, the document's own words, placeholders. */
31
36
  export type RichTextLabels = {
32
37
  /** Each preset's label: the slash menu, Turn into, the handles' names. */
@@ -204,6 +209,7 @@ export type Labels = {
204
209
  comments: CommentsLabels;
205
210
  table: TableLabels;
206
211
  equation: EquationLabels;
212
+ suggestions: SuggestionsLabels;
207
213
  };
208
214
  /** The entries of a section to replace: any of them, and any entry of a nested group. */
209
215
  type Overrides<L> = {
@@ -222,6 +228,8 @@ export type PartialLabels = {
222
228
  };
223
229
  /** The `editor` section in English. */
224
230
  export declare const editorEnglish: EditorLabels;
231
+ /** The `suggestions` section in English. */
232
+ export declare const suggestionsEnglish: SuggestionsLabels;
225
233
  /** The `richText` section in English. */
226
234
  export declare const richTextEnglish: RichTextLabels;
227
235
  /** The `blockMenu` section in English. */
package/dist/labels.js CHANGED
@@ -50,6 +50,10 @@ export const editorEnglish = /* @__PURE__ */ frozen({
50
50
  moved: (what) => `Moved ${what}`,
51
51
  deleted: (what) => `Deleted ${what}`
52
52
  });
53
+ /** The `suggestions` section in English. */
54
+ export const suggestionsEnglish = /* @__PURE__ */ frozen({
55
+ notSuggested: 'Only text and blocks can be suggested'
56
+ });
53
57
  /** The `richText` section in English. */
54
58
  export const richTextEnglish = /* @__PURE__ */ frozen({
55
59
  kinds: {
@@ -184,7 +188,8 @@ export const englishLabels = /* @__PURE__ */ frozen({
184
188
  pageLink: pageLinkEnglish,
185
189
  comments: commentsEnglish,
186
190
  table: tableEnglish,
187
- equation: equationEnglish
191
+ equation: equationEnglish,
192
+ suggestions: suggestionsEnglish
188
193
  });
189
194
  /** Each view's sections, merged once: its `labels` over the English ones. */
190
195
  const merged = new WeakMap();
@@ -80,7 +80,11 @@ export declare class CommentsController {
80
80
  * place itself (the sidebar places its cards in the margin).
81
81
  */
82
82
  readonly anchor: import("../chrome.js").ChromeAnchor;
83
- /** The view may write: it may start, answer, resolve and delete comments. */
83
+ /**
84
+ * The view may start, answer, resolve and delete comments: it may write,
85
+ * or its user may comment without writing (`document.access` `comment`,
86
+ * a readonly view's: the room writes a new thread's anchor).
87
+ */
84
88
  get canComment(): boolean;
85
89
  /** One thread, by id. */
86
90
  thread(id: string): PlacedThread | undefined;
@@ -112,9 +112,14 @@ export class CommentsController {
112
112
  : [];
113
113
  return rect && new DOMRect(rect.left, rect.top, rect.width, rect.height);
114
114
  }, () => this.edytor.node);
115
- /** The view may write: it may start, answer, resolve and delete comments. */
115
+ /**
116
+ * The view may start, answer, resolve and delete comments: it may write,
117
+ * or its user may comment without writing (`document.access` `comment`,
118
+ * a readonly view's: the room writes a new thread's anchor).
119
+ */
116
120
  get canComment() {
117
- return this.edytor.dispatcher.permits();
121
+ const { access } = this.edytor.document;
122
+ return access === 'comment' || access === 'suggest' || this.edytor.dispatcher.permits();
118
123
  }
119
124
  /** One thread, by id. */
120
125
  thread(id) {
@@ -275,18 +280,23 @@ export class CommentsController {
275
280
  const draft = this.draft;
276
281
  if (!draft || !body.trim())
277
282
  return false;
283
+ // A user who may comment but not write sends its anchors: the room writes the mark.
284
+ const { access } = this.edytor.document;
285
+ const commentOnly = access === 'comment' || access === 'suggest';
278
286
  const result = await this.#send({
279
287
  op: 'add',
280
288
  thread: draft.id,
281
289
  body,
282
290
  quote: draft.quote,
283
- block: draft.block
291
+ block: draft.block,
292
+ ...(commentOnly && { anchors: draft.spans })
284
293
  });
285
294
  if (!result)
286
295
  return false;
287
296
  if (this.draft === draft)
288
297
  this.draft = null;
289
- this.#anchor(draft.id, this.draftRuns(draft));
298
+ if (!commentOnly)
299
+ this.#anchor(draft.id, this.draftRuns(draft));
290
300
  this.active = draft.id;
291
301
  this.#refocus();
292
302
  return true;
@@ -26,9 +26,9 @@ export const findMatches = (edytor, query, { caseSensitive = false } = {}) => {
26
26
  const walk = (parent) => {
27
27
  for (const block of facade.childrenIds(parent)) {
28
28
  for (const part of idToBlock.parts(block)) {
29
- if (part.kind !== 'text' || part.length < needle.length)
29
+ if (part.kind !== 'text' || part.text.length < needle.length)
30
30
  continue;
31
- const text = part.items.map((item) => item.text).join('');
31
+ const { text } = part;
32
32
  const hay = caseSensitive ? text : fold(text);
33
33
  for (let at = hay.indexOf(needle); at >= 0; at = hay.indexOf(needle, at + needle.length))
34
34
  matches.push({ block, offset: part.start + at, length: needle.length });
@@ -19,6 +19,7 @@ export type { ToolbarController } from './toolbar/ToolbarController.svelte.js';
19
19
  export { createBlockMenuPlugin } from './blockMenu/blockMenuPlugin.js';
20
20
  export { createSuggestionsPlugin, type SuggestionBarOptions, type SuggestionBarPayload } from './suggestions/suggestionsPlugin.js';
21
21
  export { createSuggestionBarPlugin } from './suggestions/SuggestionBars.svelte';
22
+ export { createSharedSuggestionsPlugin, sharedSuggestionsController, type SharedSuggestionsController, type SharedSuggestionOptions } from './suggestions/shared.svelte.js';
22
23
  export type { BlockMenuOptions, BlockMenuController, BlockMenuAction, BlockMenuColor } from './blockMenu/BlockMenuController.svelte.js';
23
24
  export { createImagePlugin, type ImagePluginOptions, safeImageSrc, storableImageSrc, oversizedInlineImage, MAX_INLINE_IMAGE_BYTES, MIN_IMAGE_WIDTH, type ImageData, type ImageAlign } from './image/ImagePlugin.svelte';
24
25
  export { createEmbedPlugin, EMBED_PROVIDERS, EMBED_SANDBOX, EMBED_ALLOW, embedSourceOf, type EmbedProvider, type EmbedPluginOptions, type EmbedFallbackPayload } from './media/EmbedPlugin.svelte';
@@ -13,6 +13,7 @@ export { createToolbarPlugin } from './toolbar/toolbarPlugin.js';
13
13
  export { createBlockMenuPlugin } from './blockMenu/blockMenuPlugin.js';
14
14
  export { createSuggestionsPlugin } from './suggestions/suggestionsPlugin.js';
15
15
  export { createSuggestionBarPlugin } from './suggestions/SuggestionBars.svelte';
16
+ export { createSharedSuggestionsPlugin, sharedSuggestionsController } from './suggestions/shared.svelte.js';
16
17
  export { createImagePlugin, safeImageSrc, storableImageSrc, oversizedInlineImage, MAX_INLINE_IMAGE_BYTES, MIN_IMAGE_WIDTH } from './image/ImagePlugin.svelte';
17
18
  export { createEmbedPlugin, EMBED_PROVIDERS, EMBED_SANDBOX, EMBED_ALLOW, embedSourceOf } from './media/EmbedPlugin.svelte';
18
19
  export { createBookmarkPlugin } from './media/BookmarkPlugin.svelte';