edytor 5.0.0 → 7.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 (137) hide show
  1. package/README.md +3 -3
  2. package/dist/cloudflare/DocumentRoom.d.ts +77 -2
  3. package/dist/cloudflare/DocumentRoom.js +37 -1
  4. package/dist/cloudflare/index.d.ts +1 -1
  5. package/dist/cloudflare/index.js +1 -1
  6. package/dist/cloudflare/room/access.d.ts +6 -1
  7. package/dist/cloudflare/room/access.js +30 -4
  8. package/dist/cloudflare/room/admission.d.ts +11 -0
  9. package/dist/cloudflare/room/admission.js +43 -10
  10. package/dist/cloudflare/room/context.d.ts +73 -76
  11. package/dist/cloudflare/room/context.js +17 -6
  12. package/dist/cloudflare/room/forged.d.ts +1 -1
  13. package/dist/cloudflare/room/forged.js +11 -9
  14. package/dist/cloudflare/room/frames.d.ts +2 -0
  15. package/dist/cloudflare/room/frames.js +2 -0
  16. package/dist/cloudflare/room/presence.js +1 -4
  17. package/dist/cloudflare/room/reseed.d.ts +93 -0
  18. package/dist/cloudflare/room/reseed.js +500 -0
  19. package/dist/cloudflare/room/scheduler.d.ts +1 -1
  20. package/dist/cloudflare/room/scheduler.js +9 -1
  21. package/dist/cloudflare/room/shared.d.ts +10 -0
  22. package/dist/cloudflare/room/shared.js +10 -0
  23. package/dist/cloudflare/room/storage.d.ts +7 -0
  24. package/dist/cloudflare/room/storage.js +33 -1
  25. package/dist/components/Edytor.svelte +18 -3
  26. package/dist/components/Edytor.svelte.d.ts +10 -1
  27. package/dist/components/EdytorRoot.svelte +17 -0
  28. package/dist/components/EdytorRoot.svelte.d.ts +4 -0
  29. package/dist/components/Suggestion.svelte +1 -1
  30. package/dist/crdt/attribution/block.d.ts +3 -0
  31. package/dist/crdt/attribution/block.js +3 -2
  32. package/dist/crdt/doc/history.js +2 -3
  33. package/dist/crdt/doc/ops.d.ts +81 -0
  34. package/dist/crdt/doc/ops.js +1898 -0
  35. package/dist/crdt/doc/suggest.d.ts +6 -2
  36. package/dist/crdt/doc/suggest.js +6 -5
  37. package/dist/crdt/edytor-doc.d.ts +157 -157
  38. package/dist/crdt/edytor-doc.js +15 -43
  39. package/dist/crdt/engine-room.d.ts +4 -0
  40. package/dist/crdt/engine-room.js +6 -0
  41. package/dist/crdt/flow.d.ts +4 -46
  42. package/dist/crdt/flow.js +2 -262
  43. package/dist/crdt/index.d.ts +64 -75
  44. package/dist/crdt/operations.d.ts +1 -1
  45. package/dist/crdt/placement/resolve.d.ts +1 -1
  46. package/dist/crdt/protocol.d.ts +2 -2
  47. package/dist/crdt/protocol.js +2 -2
  48. package/dist/crdt/protocols/auth.d.ts +8 -1
  49. package/dist/crdt/protocols/auth.js +14 -1
  50. package/dist/crdt/protocols/awareness.js +46 -81
  51. package/dist/crdt/providers/index.d.ts +11 -22
  52. package/dist/crdt/providers/index.js +22 -3
  53. package/dist/crdt/providers/indexeddb.d.ts +6 -10
  54. package/dist/crdt/providers/indexeddb.js +10 -16
  55. package/dist/crdt/providers/room.d.ts +26 -0
  56. package/dist/crdt/providers/room.js +41 -12
  57. package/dist/crdt/providers/websocket.d.ts +10 -14
  58. package/dist/crdt/providers/websocket.js +43 -23
  59. package/dist/crdt/rangeDelete.d.ts +2 -47
  60. package/dist/crdt/rangeDelete.js +1 -169
  61. package/dist/crdt/reseed.d.ts +127 -0
  62. package/dist/crdt/reseed.js +533 -0
  63. package/dist/crdt/restore.d.ts +13 -1
  64. package/dist/crdt/restore.js +8 -3
  65. package/dist/crdt/schema.d.ts +6 -0
  66. package/dist/crdt/schema.js +6 -0
  67. package/dist/crdt/structs.d.ts +8 -11
  68. package/dist/crdt/structs.js +25 -44
  69. package/dist/crdt/text/index/build.d.ts +119 -0
  70. package/dist/crdt/text/index/build.js +2801 -0
  71. package/dist/crdt/text/index/shared.d.ts +2 -6
  72. package/dist/crdt/text/index/shared.js +2 -5
  73. package/dist/crdt/text/model.js +2 -3
  74. package/dist/crdt/text/runs.d.ts +9 -12
  75. package/dist/crdt/text/runs.js +2 -165
  76. package/dist/crdt/vendor/yjs/UPSTREAM.md +101 -5
  77. package/dist/crdt/vendor/yjs/dts/index.d.ts +1 -1
  78. package/dist/crdt/vendor/yjs/dts/utils/Transaction.d.ts +10 -10
  79. package/dist/crdt/vendor/yjs/dts/utils/encoding.d.ts +1 -0
  80. package/dist/crdt/vendor/yjs/src/index.js +1 -1
  81. package/dist/crdt/vendor/yjs/src/structs/Item.js +24 -13
  82. package/dist/crdt/vendor/yjs/src/utils/Transaction.js +12 -10
  83. package/dist/crdt/vendor/yjs/src/utils/encoding.js +42 -1
  84. package/dist/events/domTextOffset.d.ts +2 -0
  85. package/dist/events/domTextOffset.js +8 -0
  86. package/dist/export/forms.d.ts +50 -50
  87. package/dist/index.d.ts +1 -1
  88. package/dist/index.js +1 -1
  89. package/dist/plugins/richtext/RichTextPlugin.svelte +63 -61
  90. package/dist/plugins/richtext/richTextOperations.js +26 -32
  91. package/dist/selection/selection.svelte.d.ts +1 -1
  92. package/dist/selection/selection.svelte.js +87 -106
  93. package/dist/selection/selection.utils.js +5 -8
  94. package/dist/session/commands.js +49 -51
  95. package/dist/session/handles.js +3 -7
  96. package/dist/surface/attributes.d.ts +3 -3
  97. package/dist/surface/attributes.js +2 -2
  98. package/dist/surface/observer.svelte.d.ts +7 -7
  99. package/dist/surface/observer.svelte.js +225 -336
  100. package/dist/surface/projector.svelte.js +2 -2
  101. package/dist/utils.d.ts +5 -0
  102. package/dist/utils.js +7 -0
  103. package/package.json +1 -1
  104. package/dist/crdt/doc/capability.d.ts +0 -56
  105. package/dist/crdt/doc/capability.js +0 -207
  106. package/dist/crdt/doc/content.d.ts +0 -16
  107. package/dist/crdt/doc/content.js +0 -77
  108. package/dist/crdt/doc/delete.d.ts +0 -15
  109. package/dist/crdt/doc/delete.js +0 -84
  110. package/dist/crdt/doc/layout.d.ts +0 -9
  111. package/dist/crdt/doc/layout.js +0 -178
  112. package/dist/crdt/doc/meta.d.ts +0 -19
  113. package/dist/crdt/doc/meta.js +0 -198
  114. package/dist/crdt/doc/moves.d.ts +0 -21
  115. package/dist/crdt/doc/moves.js +0 -274
  116. package/dist/crdt/doc/split-merge.d.ts +0 -10
  117. package/dist/crdt/doc/split-merge.js +0 -179
  118. package/dist/crdt/doc/steps.d.ts +0 -65
  119. package/dist/crdt/doc/steps.js +0 -311
  120. package/dist/crdt/text/index/cache.d.ts +0 -16
  121. package/dist/crdt/text/index/cache.js +0 -175
  122. package/dist/crdt/text/index/claims.d.ts +0 -18
  123. package/dist/crdt/text/index/claims.js +0 -203
  124. package/dist/crdt/text/index/fold.d.ts +0 -21
  125. package/dist/crdt/text/index/fold.js +0 -656
  126. package/dist/crdt/text/index/layout.d.ts +0 -22
  127. package/dist/crdt/text/index/layout.js +0 -258
  128. package/dist/crdt/text/index/placement.d.ts +0 -47
  129. package/dist/crdt/text/index/placement.js +0 -738
  130. package/dist/crdt/text/index/records.d.ts +0 -13
  131. package/dist/crdt/text/index/records.js +0 -139
  132. package/dist/crdt/text/index/report.d.ts +0 -18
  133. package/dist/crdt/text/index/report.js +0 -337
  134. package/dist/crdt/text/index/state.d.ts +0 -197
  135. package/dist/crdt/text/index/state.js +0 -116
  136. package/dist/crdt/text/index/streams.d.ts +0 -25
  137. package/dist/crdt/text/index/streams.js +0 -248
@@ -22,7 +22,7 @@ import * as array from 'lib0-v14/array'
22
22
 
23
23
  import { getStateVector, StructStore } from './StructStore.js'
24
24
  import { getItemCleanStart, getItemCleanEnd } from './transaction-helpers.js'
25
- import { createIdSet, IdRange, readAndApplyDeleteSet, readIdSet, mergeIdSets, writeIdSet } from './ids.js'
25
+ import { createIdSet, IdRange, readAndApplyDeleteSet, readIdSet, mergeIdSets, writeIdSet, intersectSets } from './ids.js' // YP34: intersectSets
26
26
  import { createID, ID } from './ID.js'
27
27
  import { UpdateDecoder } from './UpdateDecoder.js'
28
28
  import { UpdateEncoder } from './UpdateEncoder.js'
@@ -469,6 +469,47 @@ export const diffUpdate = (update, sv) => {
469
469
  return encoder.toUint8Array()
470
470
  }
471
471
 
472
+ // YP34 begin
473
+ /**
474
+ * The part of `update` that the state vector `sv` covers, with only the
475
+ * deletes `ds` also holds: `update` as it read at an earlier state (the
476
+ * counterpart of `diffUpdate`). A struct that crosses the state vector is
477
+ * cut at it; a skip is written only where a later struct of its client
478
+ * follows it.
479
+ *
480
+ * @param {Uint8Array} update
481
+ * @param {Uint8Array} sv
482
+ * @param {import('./ids.js').IdSet} ds
483
+ */
484
+ export const clipUpdate = (update, sv, ds) => {
485
+ const state = decodeStateVector(sv)
486
+ const encoder = new UpdateEncoder()
487
+ const lazyStructWriter = new LazyStructWriter(encoder)
488
+ const decoder = new UpdateDecoder(decoding.createDecoder(update))
489
+ const reader = new LazyStructReader(decoder, false)
490
+ /** @type {Array<Skip>} */
491
+ let skips = []
492
+ let client = -1
493
+ for (let curr = reader.curr; curr !== null; curr = reader.next()) {
494
+ if (curr.id.client !== client) [client, skips] = [curr.id.client, []]
495
+ const svClock = state.get(client) || 0
496
+ if (curr.id.clock >= svClock) continue
497
+ if (curr.constructor === Skip) {
498
+ skips.push(/** @type {Skip} */ (curr))
499
+ continue
500
+ }
501
+ if (lazyStructWriter.written > 0 && lazyStructWriter.currClient === client) {
502
+ for (const skip of skips) writeStructToLazyStructWriter(lazyStructWriter, skip, 0, 0)
503
+ }
504
+ skips = []
505
+ writeStructToLazyStructWriter(lazyStructWriter, curr, 0, math.max(curr.id.clock + curr.length - svClock, 0))
506
+ }
507
+ finishLazyStructWriting(lazyStructWriter)
508
+ writeIdSet(encoder, intersectSets(readIdSet(decoder), ds))
509
+ return encoder.toUint8Array()
510
+ }
511
+ // YP34 end
512
+
472
513
  /**
473
514
  * Read decodedState and return State as Map.
474
515
  *
@@ -10,3 +10,5 @@
10
10
  * through its child index); a disconnected one keeps its offset.
11
11
  */
12
12
  export declare const getTextContentOffsetAtPoint: (textNode: Node, node: Node, offset: number) => number;
13
+ /** `element`'s text nodes in document order: the leaves the offsets above count. */
14
+ export declare const textLeaves: (element: Node) => CharacterData[];
@@ -22,3 +22,11 @@ export const getTextContentOffsetAtPoint = (textNode, node, offset) => {
22
22
  range.setEnd(node, at);
23
23
  return range.toString().length;
24
24
  };
25
+ /** `element`'s text nodes in document order: the leaves the offsets above count. */
26
+ export const textLeaves = (element) => {
27
+ const walker = (element.ownerDocument ?? document).createTreeWalker(element, NodeFilter.SHOW_TEXT);
28
+ const leaves = [];
29
+ while (walker.nextNode())
30
+ leaves.push(walker.currentNode);
31
+ return leaves;
32
+ };
@@ -169,10 +169,9 @@ export declare const equationForms: (mathml?: MathML) => {
169
169
  blocks: {
170
170
  equation: {
171
171
  lines?: boolean;
172
- itemKind?: string;
173
172
  island?: boolean;
174
- defaultChild?: string;
175
173
  rendersContent: boolean;
174
+ defaultChild?: string;
176
175
  void: boolean;
177
176
  html?: string | ((block: JSONBlock, content: string, children: string) => string);
178
177
  markdown?: (block: JSONBlock, content: string, children: string, context: import("../plugins.js").MarkdownContext) => string;
@@ -180,6 +179,7 @@ export declare const equationForms: (mathml?: MathML) => {
180
179
  parse?: (element: HTMLElement) => Record<string, import("../utils/json.js").SerializableContent> | undefined;
181
180
  element?: import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement);
182
181
  contentElement?: import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement);
182
+ itemKind?: string;
183
183
  };
184
184
  };
185
185
  inlineBlocks: {
@@ -233,10 +233,9 @@ export declare const bundledRead: () => {
233
233
  };
234
234
  }[];
235
235
  lines?: boolean | undefined;
236
- itemKind?: string | undefined;
237
236
  island?: boolean | undefined;
238
- defaultChild?: string | undefined;
239
237
  rendersContent?: boolean | undefined;
238
+ defaultChild?: string | undefined;
240
239
  void?: boolean | undefined;
241
240
  html?: string | ((block: JSONBlock, content: string, children: string) => string) | undefined;
242
241
  markdown?: ((block: JSONBlock, content: string, children: string, context: import("../plugins.js").MarkdownContext) => string) | undefined;
@@ -244,14 +243,14 @@ export declare const bundledRead: () => {
244
243
  parse?: ((element: HTMLElement) => Record<string, import("../utils/json.js").SerializableContent> | undefined) | undefined;
245
244
  element?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
246
245
  contentElement?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
246
+ itemKind?: string | undefined;
247
247
  };
248
248
  'bulleted-list-item': {
249
249
  presets: {}[];
250
250
  lines?: boolean | undefined;
251
- itemKind?: string | undefined;
252
251
  island?: boolean | undefined;
253
- defaultChild?: string | undefined;
254
252
  rendersContent?: boolean | undefined;
253
+ defaultChild?: string | undefined;
255
254
  void?: boolean | undefined;
256
255
  html?: string | ((block: JSONBlock, content: string, children: string) => string) | undefined;
257
256
  markdown?: ((block: JSONBlock, content: string, children: string, context: import("../plugins.js").MarkdownContext) => string) | undefined;
@@ -259,14 +258,14 @@ export declare const bundledRead: () => {
259
258
  parse?: ((element: HTMLElement) => Record<string, import("../utils/json.js").SerializableContent> | undefined) | undefined;
260
259
  element?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
261
260
  contentElement?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
261
+ itemKind?: string | undefined;
262
262
  };
263
263
  'numbered-list-item': {
264
264
  presets: {}[];
265
265
  lines?: boolean | undefined;
266
- itemKind?: string | undefined;
267
266
  island?: boolean | undefined;
268
- defaultChild?: string | undefined;
269
267
  rendersContent?: boolean | undefined;
268
+ defaultChild?: string | undefined;
270
269
  void?: boolean | undefined;
271
270
  html?: string | ((block: JSONBlock, content: string, children: string) => string) | undefined;
272
271
  markdown?: ((block: JSONBlock, content: string, children: string, context: import("../plugins.js").MarkdownContext) => string) | undefined;
@@ -274,6 +273,7 @@ export declare const bundledRead: () => {
274
273
  parse?: ((element: HTMLElement) => Record<string, import("../utils/json.js").SerializableContent> | undefined) | undefined;
275
274
  element?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
276
275
  contentElement?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
276
+ itemKind?: string | undefined;
277
277
  };
278
278
  'todo-item': {
279
279
  presets: {
@@ -285,10 +285,9 @@ export declare const bundledRead: () => {
285
285
  toggle: {
286
286
  presets: {}[];
287
287
  lines?: boolean | undefined;
288
- itemKind?: string | undefined;
289
288
  island?: boolean | undefined;
290
- defaultChild?: string | undefined;
291
289
  rendersContent?: boolean | undefined;
290
+ defaultChild?: string | undefined;
292
291
  void?: boolean | undefined;
293
292
  html?: string | ((block: JSONBlock, content: string, children: string) => string) | undefined;
294
293
  markdown?: ((block: JSONBlock, content: string, children: string, context: import("../plugins.js").MarkdownContext) => string) | undefined;
@@ -296,6 +295,7 @@ export declare const bundledRead: () => {
296
295
  parse?: ((element: HTMLElement) => Record<string, import("../utils/json.js").SerializableContent> | undefined) | undefined;
297
296
  element?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
298
297
  contentElement?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
298
+ itemKind?: string | undefined;
299
299
  };
300
300
  'toggle-heading': {
301
301
  presets: {
@@ -304,10 +304,9 @@ export declare const bundledRead: () => {
304
304
  };
305
305
  }[];
306
306
  lines?: boolean | undefined;
307
- itemKind?: string | undefined;
308
307
  island?: boolean | undefined;
309
- defaultChild?: string | undefined;
310
308
  rendersContent?: boolean | undefined;
309
+ defaultChild?: string | undefined;
311
310
  void?: boolean | undefined;
312
311
  html?: string | ((block: JSONBlock, content: string, children: string) => string) | undefined;
313
312
  markdown?: ((block: JSONBlock, content: string, children: string, context: import("../plugins.js").MarkdownContext) => string) | undefined;
@@ -315,14 +314,14 @@ export declare const bundledRead: () => {
315
314
  parse?: ((element: HTMLElement) => Record<string, import("../utils/json.js").SerializableContent> | undefined) | undefined;
316
315
  element?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
317
316
  contentElement?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
317
+ itemKind?: string | undefined;
318
318
  };
319
319
  callout: {
320
320
  presets: {}[];
321
321
  lines?: boolean | undefined;
322
- itemKind?: string | undefined;
323
322
  island?: boolean | undefined;
324
- defaultChild?: string | undefined;
325
323
  rendersContent?: boolean | undefined;
324
+ defaultChild?: string | undefined;
326
325
  void?: boolean | undefined;
327
326
  html?: string | ((block: JSONBlock, content: string, children: string) => string) | undefined;
328
327
  markdown?: ((block: JSONBlock, content: string, children: string, context: import("../plugins.js").MarkdownContext) => string) | undefined;
@@ -330,14 +329,14 @@ export declare const bundledRead: () => {
330
329
  parse?: ((element: HTMLElement) => Record<string, import("../utils/json.js").SerializableContent> | undefined) | undefined;
331
330
  element?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
332
331
  contentElement?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
332
+ itemKind?: string | undefined;
333
333
  };
334
334
  quote: {
335
335
  presets: {}[];
336
336
  lines?: boolean | undefined;
337
- itemKind?: string | undefined;
338
337
  island?: boolean | undefined;
339
- defaultChild?: string | undefined;
340
338
  rendersContent?: boolean | undefined;
339
+ defaultChild?: string | undefined;
341
340
  void?: boolean | undefined;
342
341
  html?: string | ((block: JSONBlock, content: string, children: string) => string) | undefined;
343
342
  markdown?: ((block: JSONBlock, content: string, children: string, context: import("../plugins.js").MarkdownContext) => string) | undefined;
@@ -345,14 +344,14 @@ export declare const bundledRead: () => {
345
344
  parse?: ((element: HTMLElement) => Record<string, import("../utils/json.js").SerializableContent> | undefined) | undefined;
346
345
  element?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
347
346
  contentElement?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
347
+ itemKind?: string | undefined;
348
348
  };
349
349
  divider: {
350
350
  presets: {}[];
351
351
  lines?: boolean | undefined;
352
- itemKind?: string | undefined;
353
352
  island?: boolean | undefined;
354
- defaultChild?: string | undefined;
355
353
  rendersContent: boolean;
354
+ defaultChild?: string | undefined;
356
355
  void: boolean;
357
356
  html?: string | ((block: JSONBlock, content: string, children: string) => string) | undefined;
358
357
  markdown?: ((block: JSONBlock, content: string, children: string, context: import("../plugins.js").MarkdownContext) => string) | undefined;
@@ -360,13 +359,13 @@ export declare const bundledRead: () => {
360
359
  parse?: ((element: HTMLElement) => Record<string, import("../utils/json.js").SerializableContent> | undefined) | undefined;
361
360
  element?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
362
361
  contentElement?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
362
+ itemKind?: string | undefined;
363
363
  };
364
364
  'ordered-list': {
365
365
  lines?: boolean | undefined;
366
- itemKind?: string | undefined;
367
366
  island?: boolean | undefined;
368
- defaultChild: string;
369
367
  rendersContent: boolean;
368
+ defaultChild: string;
370
369
  void?: boolean | undefined;
371
370
  html?: string | ((block: JSONBlock, content: string, children: string) => string) | undefined;
372
371
  markdown?: ((block: JSONBlock, content: string, children: string, context: import("../plugins.js").MarkdownContext) => string) | undefined;
@@ -374,13 +373,13 @@ export declare const bundledRead: () => {
374
373
  parse?: ((element: HTMLElement) => Record<string, import("../utils/json.js").SerializableContent> | undefined) | undefined;
375
374
  element?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
376
375
  contentElement?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
376
+ itemKind?: string | undefined;
377
377
  };
378
378
  'unordered-list': {
379
379
  lines?: boolean | undefined;
380
- itemKind?: string | undefined;
381
380
  island?: boolean | undefined;
382
- defaultChild: string;
383
381
  rendersContent: boolean;
382
+ defaultChild: string;
384
383
  void?: boolean | undefined;
385
384
  html?: string | ((block: JSONBlock, content: string, children: string) => string) | undefined;
386
385
  markdown?: ((block: JSONBlock, content: string, children: string, context: import("../plugins.js").MarkdownContext) => string) | undefined;
@@ -388,6 +387,7 @@ export declare const bundledRead: () => {
388
387
  parse?: ((element: HTMLElement) => Record<string, import("../utils/json.js").SerializableContent> | undefined) | undefined;
389
388
  element?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
390
389
  contentElement?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
390
+ itemKind?: string | undefined;
391
391
  };
392
392
  'list-item': Form;
393
393
  code: {
@@ -399,10 +399,9 @@ export declare const bundledRead: () => {
399
399
  codeLine: {};
400
400
  table: {
401
401
  lines?: boolean | undefined;
402
- itemKind?: string | undefined;
403
402
  island?: boolean | undefined;
404
- defaultChild: string;
405
403
  rendersContent: boolean;
404
+ defaultChild: string;
406
405
  void?: boolean | undefined;
407
406
  html?: string | ((block: JSONBlock, content: string, children: string) => string) | undefined;
408
407
  markdown?: ((block: JSONBlock, content: string, children: string, context: import("../plugins.js").MarkdownContext) => string) | undefined;
@@ -410,14 +409,14 @@ export declare const bundledRead: () => {
410
409
  parse?: ((element: HTMLElement) => Record<string, import("../utils/json.js").SerializableContent> | undefined) | undefined;
411
410
  element?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
412
411
  contentElement?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
412
+ itemKind?: string | undefined;
413
413
  table: true;
414
414
  };
415
415
  tableRow: {
416
416
  lines?: boolean | undefined;
417
- itemKind?: string | undefined;
418
417
  island?: boolean | undefined;
419
- defaultChild: string;
420
418
  rendersContent: boolean;
419
+ defaultChild: string;
421
420
  void?: boolean | undefined;
422
421
  html?: string | ((block: JSONBlock, content: string, children: string) => string) | undefined;
423
422
  markdown?: ((block: JSONBlock, content: string, children: string, context: import("../plugins.js").MarkdownContext) => string) | undefined;
@@ -425,13 +424,13 @@ export declare const bundledRead: () => {
425
424
  parse?: ((element: HTMLElement) => Record<string, import("../utils/json.js").SerializableContent> | undefined) | undefined;
426
425
  element?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
427
426
  contentElement?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
427
+ itemKind?: string | undefined;
428
428
  };
429
429
  tableCell: {
430
430
  lines?: boolean | undefined;
431
- itemKind?: string | undefined;
432
431
  island: boolean;
433
- defaultChild?: string | undefined;
434
432
  rendersContent?: boolean | undefined;
433
+ defaultChild?: string | undefined;
435
434
  void?: boolean | undefined;
436
435
  html?: string | ((block: JSONBlock, content: string, children: string) => string) | undefined;
437
436
  markdown?: ((block: JSONBlock, content: string, children: string, context: import("../plugins.js").MarkdownContext) => string) | undefined;
@@ -439,13 +438,13 @@ export declare const bundledRead: () => {
439
438
  parse?: ((element: HTMLElement) => Record<string, import("../utils/json.js").SerializableContent> | undefined) | undefined;
440
439
  element?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
441
440
  contentElement?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
441
+ itemKind?: string | undefined;
442
442
  };
443
443
  image: {
444
444
  lines?: boolean | undefined;
445
- itemKind?: string | undefined;
446
445
  island?: boolean | undefined;
447
- defaultChild?: string | undefined;
448
446
  rendersContent?: boolean | undefined;
447
+ defaultChild?: string | undefined;
449
448
  void: boolean;
450
449
  html?: string | ((block: JSONBlock, content: string, children: string) => string) | undefined;
451
450
  markdown?: ((block: JSONBlock, content: string, children: string, context: import("../plugins.js").MarkdownContext) => string) | undefined;
@@ -453,13 +452,13 @@ export declare const bundledRead: () => {
453
452
  parse?: ((element: HTMLElement) => Record<string, import("../utils/json.js").SerializableContent> | undefined) | undefined;
454
453
  element?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
455
454
  contentElement?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
455
+ itemKind?: string | undefined;
456
456
  };
457
457
  embed: {
458
458
  lines?: boolean | undefined;
459
- itemKind?: string | undefined;
460
459
  island?: boolean | undefined;
461
- defaultChild?: string | undefined;
462
460
  rendersContent?: boolean | undefined;
461
+ defaultChild?: string | undefined;
463
462
  void: boolean;
464
463
  html?: string | ((block: JSONBlock, content: string, children: string) => string) | undefined;
465
464
  markdown?: ((block: JSONBlock, content: string, children: string, context: import("../plugins.js").MarkdownContext) => string) | undefined;
@@ -467,13 +466,13 @@ export declare const bundledRead: () => {
467
466
  parse?: ((element: HTMLElement) => Record<string, import("../utils/json.js").SerializableContent> | undefined) | undefined;
468
467
  element?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
469
468
  contentElement?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
469
+ itemKind?: string | undefined;
470
470
  };
471
471
  bookmark: {
472
472
  lines?: boolean | undefined;
473
- itemKind?: string | undefined;
474
473
  island?: boolean | undefined;
475
- defaultChild?: string | undefined;
476
474
  rendersContent?: boolean | undefined;
475
+ defaultChild?: string | undefined;
477
476
  void: boolean;
478
477
  html?: string | ((block: JSONBlock, content: string, children: string) => string) | undefined;
479
478
  markdown?: ((block: JSONBlock, content: string, children: string, context: import("../plugins.js").MarkdownContext) => string) | undefined;
@@ -481,13 +480,13 @@ export declare const bundledRead: () => {
481
480
  parse?: ((element: HTMLElement) => Record<string, import("../utils/json.js").SerializableContent> | undefined) | undefined;
482
481
  element?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
483
482
  contentElement?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
483
+ itemKind?: string | undefined;
484
484
  };
485
485
  file: {
486
486
  lines?: boolean | undefined;
487
- itemKind?: string | undefined;
488
487
  island?: boolean | undefined;
489
- defaultChild?: string | undefined;
490
488
  rendersContent?: boolean | undefined;
489
+ defaultChild?: string | undefined;
491
490
  void: boolean;
492
491
  html?: string | ((block: JSONBlock, content: string, children: string) => string) | undefined;
493
492
  markdown?: ((block: JSONBlock, content: string, children: string, context: import("../plugins.js").MarkdownContext) => string) | undefined;
@@ -495,13 +494,13 @@ export declare const bundledRead: () => {
495
494
  parse?: ((element: HTMLElement) => Record<string, import("../utils/json.js").SerializableContent> | undefined) | undefined;
496
495
  element?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
497
496
  contentElement?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
497
+ itemKind?: string | undefined;
498
498
  };
499
499
  video: {
500
500
  lines?: boolean | undefined;
501
- itemKind?: string | undefined;
502
501
  island?: boolean | undefined;
503
- defaultChild?: string | undefined;
504
502
  rendersContent?: boolean | undefined;
503
+ defaultChild?: string | undefined;
505
504
  void: boolean;
506
505
  html?: string | ((block: JSONBlock, content: string, children: string) => string) | undefined;
507
506
  markdown?: ((block: JSONBlock, content: string, children: string, context: import("../plugins.js").MarkdownContext) => string) | undefined;
@@ -509,13 +508,13 @@ export declare const bundledRead: () => {
509
508
  parse?: ((element: HTMLElement) => Record<string, import("../utils/json.js").SerializableContent> | undefined) | undefined;
510
509
  element?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
511
510
  contentElement?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
511
+ itemKind?: string | undefined;
512
512
  };
513
513
  audio: {
514
514
  lines?: boolean | undefined;
515
- itemKind?: string | undefined;
516
515
  island?: boolean | undefined;
517
- defaultChild?: string | undefined;
518
516
  rendersContent?: boolean | undefined;
517
+ defaultChild?: string | undefined;
519
518
  void: boolean;
520
519
  html?: string | ((block: JSONBlock, content: string, children: string) => string) | undefined;
521
520
  markdown?: ((block: JSONBlock, content: string, children: string, context: import("../plugins.js").MarkdownContext) => string) | undefined;
@@ -523,13 +522,13 @@ export declare const bundledRead: () => {
523
522
  parse?: ((element: HTMLElement) => Record<string, import("../utils/json.js").SerializableContent> | undefined) | undefined;
524
523
  element?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
525
524
  contentElement?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
525
+ itemKind?: string | undefined;
526
526
  };
527
527
  page: {
528
528
  lines?: boolean | undefined;
529
- itemKind?: string | undefined;
530
529
  island?: boolean | undefined;
531
- defaultChild?: string | undefined;
532
530
  rendersContent: boolean;
531
+ defaultChild?: string | undefined;
533
532
  void: boolean;
534
533
  html?: string | ((block: JSONBlock, content: string, children: string) => string) | undefined;
535
534
  markdown?: ((block: JSONBlock, content: string, children: string, context: import("../plugins.js").MarkdownContext) => string) | undefined;
@@ -537,13 +536,13 @@ export declare const bundledRead: () => {
537
536
  parse?: ((element: HTMLElement) => Record<string, import("../utils/json.js").SerializableContent> | undefined) | undefined;
538
537
  element?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
539
538
  contentElement?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
539
+ itemKind?: string | undefined;
540
540
  };
541
541
  toc: {
542
542
  lines?: boolean | undefined;
543
- itemKind?: string | undefined;
544
543
  island?: boolean | undefined;
545
- defaultChild?: string | undefined;
546
544
  rendersContent: boolean;
545
+ defaultChild?: string | undefined;
547
546
  void: boolean;
548
547
  html?: string | ((block: JSONBlock, content: string, children: string) => string) | undefined;
549
548
  markdown?: ((block: JSONBlock, content: string, children: string, context: import("../plugins.js").MarkdownContext) => string) | undefined;
@@ -551,13 +550,13 @@ export declare const bundledRead: () => {
551
550
  parse?: ((element: HTMLElement) => Record<string, import("../utils/json.js").SerializableContent> | undefined) | undefined;
552
551
  element?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
553
552
  contentElement?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
553
+ itemKind?: string | undefined;
554
554
  };
555
555
  equation: {
556
556
  lines?: boolean | undefined;
557
- itemKind?: string | undefined;
558
557
  island?: boolean | undefined;
559
- defaultChild?: string | undefined;
560
558
  rendersContent: boolean;
559
+ defaultChild?: string | undefined;
561
560
  void: boolean;
562
561
  html?: string | ((block: JSONBlock, content: string, children: string) => string) | undefined;
563
562
  markdown?: ((block: JSONBlock, content: string, children: string, context: import("../plugins.js").MarkdownContext) => string) | undefined;
@@ -565,13 +564,13 @@ export declare const bundledRead: () => {
565
564
  parse?: ((element: HTMLElement) => Record<string, import("../utils/json.js").SerializableContent> | undefined) | undefined;
566
565
  element?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
567
566
  contentElement?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
567
+ itemKind?: string | undefined;
568
568
  };
569
569
  columns: {
570
570
  lines?: boolean | undefined;
571
- itemKind?: string | undefined;
572
571
  island?: boolean | undefined;
573
- defaultChild: string;
574
572
  rendersContent: boolean;
573
+ defaultChild: string;
575
574
  void?: boolean | undefined;
576
575
  html?: string | ((block: JSONBlock, content: string, children: string) => string) | undefined;
577
576
  markdown?: ((block: JSONBlock, content: string, children: string, context: import("../plugins.js").MarkdownContext) => string) | undefined;
@@ -579,14 +578,14 @@ export declare const bundledRead: () => {
579
578
  parse?: ((element: HTMLElement) => Record<string, import("../utils/json.js").SerializableContent> | undefined) | undefined;
580
579
  element?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
581
580
  contentElement?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
581
+ itemKind?: string | undefined;
582
582
  layout: true;
583
583
  };
584
584
  column: {
585
585
  lines?: boolean | undefined;
586
- itemKind?: string | undefined;
587
586
  island?: boolean | undefined;
588
- defaultChild?: string | undefined;
589
587
  rendersContent: boolean;
588
+ defaultChild?: string | undefined;
590
589
  void?: boolean | undefined;
591
590
  html?: string | ((block: JSONBlock, content: string, children: string) => string) | undefined;
592
591
  markdown?: ((block: JSONBlock, content: string, children: string, context: import("../plugins.js").MarkdownContext) => string) | undefined;
@@ -594,6 +593,7 @@ export declare const bundledRead: () => {
594
593
  parse?: ((element: HTMLElement) => Record<string, import("../utils/json.js").SerializableContent> | undefined) | undefined;
595
594
  element?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
596
595
  contentElement?: (import("../plugins.js").BlockElement | ((data: Record<string, any>, id?: string) => import("../plugins.js").BlockElement)) | undefined;
596
+ itemKind?: string | undefined;
597
597
  };
598
598
  };
599
599
  marks: Record<string, MarkForms>;
package/dist/index.d.ts CHANGED
@@ -25,7 +25,7 @@
25
25
  * This module re-exports the `.svelte` component, so it requires a
26
26
  * bundler that understands Svelte (vite-plugin-svelte).
27
27
  */
28
- export { default as Edytor } from './components/Edytor.svelte';
28
+ export { default as Edytor } from './components/EdytorRoot.svelte';
29
29
  export { useEdytor } from './edytor.svelte.js';
30
30
  /** The editor instance plugins, hotkeys and `bind:edytor` receive (`Edytor` names the component). */
31
31
  export type { Edytor as EdytorInstance, EdytorDocData } from './edytor.svelte.js';
package/dist/index.js CHANGED
@@ -26,7 +26,7 @@
26
26
  * bundler that understands Svelte (vite-plugin-svelte).
27
27
  */
28
28
  // ── The editor ─────────────────────────────────────────────────────────
29
- export { default as Edytor } from './components/Edytor.svelte';
29
+ export { default as Edytor } from './components/EdytorRoot.svelte';
30
30
  export { useEdytor } from './edytor.svelte.js';
31
31
  export { Block } from './block/block.svelte.js';
32
32
  export { InlineBlock } from './block/inlineBlock.svelte.js';