edytor 4.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.
- package/README.md +2 -2
- package/dist/block/block.svelte.js +6 -21
- package/dist/block/inlineBlock.svelte.js +4 -6
- package/dist/clipboard/moveText.js +6 -8
- package/dist/cloudflare/DocumentRoom.d.ts +10 -3
- package/dist/cloudflare/index.d.ts +1 -1
- package/dist/cloudflare/room/access.d.ts +8 -3
- package/dist/cloudflare/room/access.js +44 -20
- package/dist/cloudflare/room/admission.js +28 -5
- package/dist/cloudflare/room/comments.js +28 -1
- package/dist/cloudflare/room/context.d.ts +115 -106
- package/dist/cloudflare/room/context.js +10 -3
- package/dist/cloudflare/room/forged.d.ts +14 -0
- package/dist/cloudflare/room/forged.js +30 -2
- package/dist/cloudflare/room/frames.d.ts +4 -0
- package/dist/cloudflare/room/frames.js +5 -1
- package/dist/cloudflare/room/purge.js +2 -1
- package/dist/cloudflare/room/replicas.d.ts +4 -2
- package/dist/cloudflare/room/replicas.js +8 -3
- package/dist/cloudflare/room/suggest.d.ts +7 -0
- package/dist/cloudflare/room/suggest.js +143 -0
- package/dist/cloudflare/routeDocumentSocket.d.ts +10 -1
- package/dist/cloudflare/routeDocumentSocket.js +5 -3
- package/dist/components/Content.svelte +9 -1
- package/dist/crdt/anchors.js +3 -2
- package/dist/crdt/attribution/attribution.d.ts +3 -0
- package/dist/crdt/attribution/attribution.js +3 -3
- package/dist/crdt/doc/capability.js +9 -13
- package/dist/crdt/doc/funnel.d.ts +1 -1
- package/dist/crdt/doc/funnel.js +5 -2
- package/dist/crdt/doc/gate.d.ts +1 -1
- package/dist/crdt/doc/history.d.ts +6 -0
- package/dist/crdt/doc/history.js +77 -56
- package/dist/crdt/doc/layout.js +5 -5
- package/dist/crdt/doc/meta.js +6 -7
- package/dist/crdt/doc/reads.d.ts +2 -2
- package/dist/crdt/doc/reads.js +18 -28
- package/dist/crdt/doc/steps.js +4 -4
- package/dist/crdt/doc/suggest.d.ts +167 -0
- package/dist/crdt/doc/suggest.js +579 -0
- package/dist/crdt/document.d.ts +10 -1
- package/dist/crdt/document.js +19 -11
- package/dist/crdt/edytor-doc.d.ts +355 -333
- package/dist/crdt/edytor-doc.js +125 -82
- package/dist/crdt/engine-api.d.ts +8 -2
- package/dist/crdt/engine.d.ts +2 -1
- package/dist/crdt/engine.js +3 -1
- package/dist/crdt/flow.d.ts +1 -1
- package/dist/crdt/flow.js +4 -10
- package/dist/crdt/index.d.ts +111 -105
- package/dist/crdt/index.js +3 -0
- package/dist/crdt/operations.d.ts +12 -3
- package/dist/crdt/parts.d.ts +43 -0
- package/dist/crdt/parts.js +44 -0
- package/dist/crdt/placement/display.d.ts +1 -1
- package/dist/crdt/placement/display.js +3 -3
- package/dist/crdt/placement/keys.d.ts +5 -0
- package/dist/crdt/placement/keys.js +5 -0
- package/dist/crdt/placement/resolve.js +2 -1
- package/dist/crdt/protocol.d.ts +1 -1
- package/dist/crdt/protocol.js +1 -1
- package/dist/crdt/protocols/auth.d.ts +11 -1
- package/dist/crdt/protocols/auth.js +17 -1
- package/dist/crdt/protocols/comments.d.ts +16 -1
- package/dist/crdt/protocols/comments.js +9 -1
- package/dist/crdt/providers/index.d.ts +6 -4
- package/dist/crdt/providers/index.js +3 -1
- package/dist/crdt/providers/websocket.d.ts +6 -4
- package/dist/crdt/providers/websocket.js +9 -4
- package/dist/crdt/purge.d.ts +7 -1
- package/dist/crdt/purge.js +32 -2
- package/dist/crdt/restore.d.ts +2 -1
- package/dist/crdt/restore.js +9 -0
- package/dist/crdt/schema.d.ts +9 -1
- package/dist/crdt/schema.js +13 -3
- package/dist/crdt/structs.d.ts +2 -0
- package/dist/crdt/structs.js +2 -0
- package/dist/crdt/text/index/claims.js +1 -23
- package/dist/crdt/text/index/layout.d.ts +2 -4
- package/dist/crdt/text/index/layout.js +9 -22
- package/dist/crdt/text/index/placement.js +21 -24
- package/dist/crdt/text/index/shared.js +17 -14
- package/dist/crdt/text/model.d.ts +10 -0
- package/dist/crdt/text/model.js +8 -1
- package/dist/crdt/text/runs.d.ts +34 -30
- package/dist/crdt/vendor/yjs/UPSTREAM.md +83 -0
- package/dist/crdt/vendor/yjs/dts/index.d.ts +1 -1
- package/dist/crdt/vendor/yjs/dts/structs/Item.d.ts +6 -3
- package/dist/crdt/vendor/yjs/dts/ynode.d.ts +13 -2
- package/dist/crdt/vendor/yjs/src/index.js +1 -1
- package/dist/crdt/vendor/yjs/src/structs/Item.js +44 -5
- package/dist/crdt/vendor/yjs/src/ynode.js +29 -7
- package/dist/edytor.svelte.d.ts +1 -1
- package/dist/edytor.svelte.js +100 -75
- package/dist/events/beforeInputCommands.d.ts +2 -2
- package/dist/events/nativeInteractiveControl.d.ts +11 -1
- package/dist/events/nativeInteractiveControl.js +41 -1
- package/dist/events/onBeforeInput.js +3 -3
- package/dist/events/onFocus.js +9 -11
- package/dist/export/forms.d.ts +25 -25
- package/dist/index.d.ts +4 -2
- package/dist/index.js +1 -1
- package/dist/labels.d.ts +8 -0
- package/dist/labels.js +6 -1
- package/dist/plugins/comments/CommentsController.svelte.d.ts +5 -1
- package/dist/plugins/comments/CommentsController.svelte.js +14 -4
- package/dist/plugins/find/search.js +2 -2
- package/dist/plugins/index.d.ts +1 -0
- package/dist/plugins/index.js +1 -0
- package/dist/plugins/suggestions/SuggestionBars.svelte +40 -23
- package/dist/plugins/suggestions/SuggestionBars.svelte.d.ts +3 -1
- package/dist/plugins/suggestions/SuggestionRuns.svelte +77 -0
- package/dist/plugins/suggestions/SuggestionRuns.svelte.d.ts +9 -0
- package/dist/plugins/suggestions/shared.svelte.d.ts +58 -0
- package/dist/plugins/suggestions/shared.svelte.js +421 -0
- package/dist/plugins/suggestions/suggestionsPlugin.d.ts +15 -4
- package/dist/selection/domSelection.d.ts +2 -0
- package/dist/selection/domSelection.js +6 -2
- package/dist/selection/pointer.svelte.js +75 -48
- package/dist/selection/replaceSelection.js +2 -6
- package/dist/selection/selection.svelte.d.ts +3 -3
- package/dist/selection/selection.svelte.js +39 -32
- package/dist/selection/selection.utils.d.ts +14 -0
- package/dist/selection/selection.utils.js +28 -3
- package/dist/session/commands.js +21 -11
- package/dist/session/composition.svelte.d.ts +5 -3
- package/dist/session/composition.svelte.js +21 -17
- package/dist/session/handles.d.ts +4 -17
- package/dist/session/handles.js +11 -37
- package/dist/session/navigation.js +6 -9
- package/dist/session/selection.d.ts +11 -5
- package/dist/session/selection.js +14 -48
- package/dist/session/suggestions.svelte.d.ts +38 -9
- package/dist/session/suggestions.svelte.js +37 -18
- package/dist/session/virtual.d.ts +1 -1
- package/dist/surface/attributes.d.ts +5 -0
- package/dist/surface/attributes.js +2 -2
- package/dist/surface/cells.d.ts +2 -26
- package/dist/surface/cells.js +2 -33
- package/dist/surface/observer.svelte.d.ts +6 -1
- package/dist/surface/observer.svelte.js +128 -81
- package/dist/surface/pin.svelte.d.ts +9 -9
- package/dist/surface/pin.svelte.js +15 -22
- package/dist/surface/projector.svelte.js +8 -14
- package/dist/text/text.svelte.js +14 -19
- package/dist/themes/notion.css +29 -0
- package/package.json +3 -1
package/dist/export/forms.d.ts
CHANGED
|
@@ -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
174
|
defaultChild?: string;
|
|
174
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
238
|
defaultChild?: string | undefined;
|
|
238
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
253
|
defaultChild?: string | undefined;
|
|
253
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
268
|
defaultChild?: string | undefined;
|
|
268
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
290
|
defaultChild?: string | undefined;
|
|
290
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
309
|
defaultChild?: string | undefined;
|
|
309
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
324
|
defaultChild?: string | undefined;
|
|
324
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
339
|
defaultChild?: string | undefined;
|
|
339
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
354
|
defaultChild?: string | undefined;
|
|
354
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
368
|
defaultChild: string;
|
|
368
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
382
|
defaultChild: string;
|
|
382
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
404
|
defaultChild: string;
|
|
404
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
419
|
defaultChild: string;
|
|
419
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
433
|
defaultChild?: string | undefined;
|
|
433
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
447
|
defaultChild?: string | undefined;
|
|
447
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
461
|
defaultChild?: string | undefined;
|
|
461
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
475
|
defaultChild?: string | undefined;
|
|
475
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
489
|
defaultChild?: string | undefined;
|
|
489
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
503
|
defaultChild?: string | undefined;
|
|
503
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
517
|
defaultChild?: string | undefined;
|
|
517
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
531
|
defaultChild?: string | undefined;
|
|
531
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
545
|
defaultChild?: string | undefined;
|
|
545
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
559
|
defaultChild?: string | undefined;
|
|
559
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
573
|
defaultChild: string;
|
|
573
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
588
|
defaultChild?: string | undefined;
|
|
588
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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 });
|
package/dist/plugins/index.d.ts
CHANGED
|
@@ -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';
|
package/dist/plugins/index.js
CHANGED
|
@@ -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';
|
|
@@ -7,7 +7,9 @@
|
|
|
7
7
|
/**
|
|
8
8
|
* The suggestion bar (Notion AI's): your `bar` under each block
|
|
9
9
|
* suggestion (Accept, Discard, and Try again when the app passed
|
|
10
|
-
* `onRetry`)
|
|
10
|
+
* `onRetry`) and under each shared suggestion's last block (its author,
|
|
11
|
+
* Accept and Reject for a view that decides, Withdraw for its author);
|
|
12
|
+
* its keys are the suggestions plugin's.
|
|
11
13
|
*/
|
|
12
14
|
export const createSuggestionBarPlugin =
|
|
13
15
|
({ bar }: SuggestionBarOptions): Plugin =>
|
|
@@ -23,7 +25,7 @@
|
|
|
23
25
|
import { takeKeys } from '../../events/onFocus.js';
|
|
24
26
|
import { onMount, type Snippet } from 'svelte';
|
|
25
27
|
import type { Edytor } from '../../edytor.svelte.js';
|
|
26
|
-
import type {
|
|
28
|
+
import type { AnySuggestion } from '../../session/suggestions.svelte.js';
|
|
27
29
|
import type { SuggestionBarPayload } from './suggestionsPlugin.js';
|
|
28
30
|
|
|
29
31
|
/** The plugin's `bar` under each block suggestion's preview, placed once per frame. */
|
|
@@ -39,15 +41,21 @@
|
|
|
39
41
|
if (!edytor.suggestions.list.length)
|
|
40
42
|
return Object.keys(places).length ? () => (places = {}) : undefined;
|
|
41
43
|
const next: typeof places = {};
|
|
44
|
+
const put = (id: string, node: Element | null | undefined) => {
|
|
45
|
+
const rect = node?.getBoundingClientRect();
|
|
46
|
+
if (rect)
|
|
47
|
+
next[id] = {
|
|
48
|
+
left: rect.left - origin.left,
|
|
49
|
+
top: rect.bottom - origin.top + 4,
|
|
50
|
+
width: rect.width
|
|
51
|
+
};
|
|
52
|
+
};
|
|
42
53
|
for (const node of edytor.node?.querySelectorAll<HTMLElement>('[data-edytor-suggestion]') ??
|
|
43
|
-
[])
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
width: rect.width
|
|
49
|
-
};
|
|
50
|
-
}
|
|
54
|
+
[])
|
|
55
|
+
put(node.dataset.edytorSuggestion!, node);
|
|
56
|
+
// A shared one's bar: under the last block it changes.
|
|
57
|
+
for (const s of shown)
|
|
58
|
+
if (s.shared) put(s.id, edytor.idToBlock.get(s.changes.at(-1)?.block ?? '')?.node);
|
|
51
59
|
return () => (places = next);
|
|
52
60
|
})
|
|
53
61
|
);
|
|
@@ -57,21 +65,30 @@
|
|
|
57
65
|
edytor.overlay.invalidate();
|
|
58
66
|
});
|
|
59
67
|
|
|
60
|
-
/** Block suggestions have a preview (an `end` one, past its first block). */
|
|
68
|
+
/** Block suggestions have a preview (an `end` one, past its first block); a shared one, a change. */
|
|
61
69
|
const shown = $derived(
|
|
62
|
-
edytor.suggestions.list.filter((s) =>
|
|
70
|
+
edytor.suggestions.list.filter((s) =>
|
|
71
|
+
s.shared ? s.changes.length > 0 : !(s.at && 'end' in s.at) || s.content.length > 1
|
|
72
|
+
)
|
|
63
73
|
);
|
|
64
|
-
const payload = (suggestion:
|
|
65
|
-
suggestion
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
74
|
+
const payload = (suggestion: AnySuggestion): SuggestionBarPayload => {
|
|
75
|
+
const by = suggestion.shared ? suggestion.by : undefined;
|
|
76
|
+
const profile = by === undefined ? undefined : edytor.document.attribution.actors.get(by);
|
|
77
|
+
return {
|
|
78
|
+
suggestion,
|
|
79
|
+
accept: () => {
|
|
80
|
+
suggestion.accept();
|
|
81
|
+
takeKeys(edytor);
|
|
82
|
+
},
|
|
83
|
+
discard: suggestion.discard,
|
|
84
|
+
reject: suggestion.shared ? suggestion.reject : suggestion.discard,
|
|
85
|
+
retry: suggestion.retryable ? suggestion.retry : undefined,
|
|
86
|
+
readonly: edytor.readonly,
|
|
87
|
+
canDecide: suggestion.shared ? suggestion.canDecide : !edytor.readonly,
|
|
88
|
+
author: by === undefined ? undefined : { id: by, ...profile },
|
|
89
|
+
mac: edytor.keymap.isMac
|
|
90
|
+
};
|
|
91
|
+
};
|
|
75
92
|
</script>
|
|
76
93
|
|
|
77
94
|
{#each shown as suggestion (suggestion.id)}
|
|
@@ -3,7 +3,9 @@ import type { SuggestionBarOptions } from './suggestionsPlugin.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* The suggestion bar (Notion AI's): your `bar` under each block
|
|
5
5
|
* suggestion (Accept, Discard, and Try again when the app passed
|
|
6
|
-
* `onRetry`)
|
|
6
|
+
* `onRetry`) and under each shared suggestion's last block (its author,
|
|
7
|
+
* Accept and Reject for a view that decides, Withdraw for its author);
|
|
8
|
+
* its keys are the suggestions plugin's.
|
|
7
9
|
*/
|
|
8
10
|
export declare const createSuggestionBarPlugin: ({ bar }: SuggestionBarOptions) => Plugin;
|
|
9
11
|
import { type Snippet } from 'svelte';
|