@portabletext/editor 1.15.1 → 1.15.2
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/lib/_chunks-cjs/behavior.core.cjs +494 -0
- package/lib/_chunks-cjs/behavior.core.cjs.map +1 -0
- package/lib/_chunks-cjs/selector.get-text-before.cjs +0 -231
- package/lib/_chunks-cjs/selector.get-text-before.cjs.map +1 -1
- package/lib/_chunks-cjs/selectors.cjs +234 -0
- package/lib/_chunks-cjs/selectors.cjs.map +1 -0
- package/lib/_chunks-es/behavior.core.js +496 -0
- package/lib/_chunks-es/behavior.core.js.map +1 -0
- package/lib/_chunks-es/selector.get-text-before.js +2 -233
- package/lib/_chunks-es/selector.get-text-before.js.map +1 -1
- package/lib/_chunks-es/selectors.js +235 -0
- package/lib/_chunks-es/selectors.js.map +1 -0
- package/lib/behaviors/index.cjs +460 -0
- package/lib/behaviors/index.cjs.map +1 -0
- package/lib/behaviors/index.d.cts +875 -0
- package/lib/behaviors/index.d.ts +875 -0
- package/lib/behaviors/index.js +464 -0
- package/lib/behaviors/index.js.map +1 -0
- package/lib/index.cjs +38 -1008
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +17 -536
- package/lib/index.d.ts +17 -536
- package/lib/index.js +31 -1000
- package/lib/index.js.map +1 -1
- package/lib/selectors/index.cjs +16 -16
- package/lib/selectors/index.cjs.map +1 -1
- package/lib/selectors/index.js +3 -2
- package/lib/selectors/index.js.map +1 -1
- package/package.json +10 -4
- package/src/{editor/behavior → behavior-actions}/behavior.action-utils.insert-block.ts +2 -2
- package/src/{editor/behavior → behavior-actions}/behavior.action.insert-block-object.ts +1 -1
- package/src/{editor/behavior → behavior-actions}/behavior.action.insert-break.ts +1 -1
- package/src/{editor/behavior → behavior-actions}/behavior.action.insert-inline-object.ts +1 -1
- package/src/{editor/behavior → behavior-actions}/behavior.action.list-item.ts +2 -2
- package/src/{editor/behavior → behavior-actions}/behavior.action.text-block.set.ts +1 -1
- package/src/{editor/behavior → behavior-actions}/behavior.action.text-block.unset.ts +1 -1
- package/src/{editor/behavior → behavior-actions}/behavior.actions.ts +14 -14
- package/src/{editor/behavior → behavior-actions}/behavior.guards.ts +1 -1
- package/src/{editor/behavior → behaviors}/behavior.code-editor.ts +4 -4
- package/src/{editor/behavior → behaviors}/behavior.core.block-objects.ts +5 -5
- package/src/{editor/behavior → behaviors}/behavior.core.decorators.ts +6 -16
- package/src/{editor/behavior → behaviors}/behavior.core.lists.ts +15 -15
- package/src/{editor/behavior → behaviors}/behavior.links.ts +4 -4
- package/src/{editor/behavior → behaviors}/behavior.markdown.ts +15 -25
- package/src/{editor/behavior → behaviors}/behavior.types.ts +32 -39
- package/src/behaviors/index.ts +28 -0
- package/src/editor/create-editor.ts +26 -46
- package/src/editor/editor-machine.ts +14 -12
- package/src/editor/plugins/createWithEditableAPI.ts +3 -3
- package/src/editor/plugins/createWithPortableTextMarkModel.ts +1 -1
- package/src/editor/utils/utils.block-offset.ts +1 -1
- package/src/index.ts +11 -26
- package/src/selectors/selector.get-active-list-item.ts +1 -1
- package/src/selectors/selectors.ts +1 -1
- package/src/type-utils.ts +17 -0
- package/src/utils/__tests__/operationToPatches.test.ts +1 -1
- package/src/utils/__tests__/patchToOperations.test.ts +1 -1
- /package/src/{editor/behavior → behavior-actions}/behavior.action.insert-span.ts +0 -0
- /package/src/{editor/behavior → behavior-actions}/behavior.action.style.ts +0 -0
- /package/src/{editor/behavior → behaviors}/behavior.core.ts +0 -0
package/lib/index.d.ts
CHANGED
|
@@ -94,26 +94,26 @@ export declare type BaseDefinition = {
|
|
|
94
94
|
* @alpha
|
|
95
95
|
*/
|
|
96
96
|
export declare type Behavior<
|
|
97
|
-
|
|
97
|
+
TBehaviorEventType extends BehaviorEvent['type'] = BehaviorEvent['type'],
|
|
98
98
|
TGuardResponse = true,
|
|
99
99
|
> = {
|
|
100
100
|
/**
|
|
101
101
|
* The internal editor event that triggers this behavior.
|
|
102
102
|
*/
|
|
103
|
-
on:
|
|
103
|
+
on: TBehaviorEventType
|
|
104
104
|
/**
|
|
105
105
|
* Predicate function that determines if the behavior should be executed.
|
|
106
106
|
* Returning a non-nullable value from the guard will pass the value to the
|
|
107
107
|
* actions and execute them.
|
|
108
108
|
*/
|
|
109
109
|
guard?: BehaviorGuard<
|
|
110
|
-
PickFromUnion<BehaviorEvent, 'type',
|
|
110
|
+
PickFromUnion<BehaviorEvent, 'type', TBehaviorEventType>,
|
|
111
111
|
TGuardResponse
|
|
112
112
|
>
|
|
113
113
|
/**
|
|
114
114
|
* Array of behavior action sets.
|
|
115
115
|
*/
|
|
116
|
-
actions: Array<BehaviorActionIntendSet<TGuardResponse>>
|
|
116
|
+
actions: Array<BehaviorActionIntendSet<TBehaviorEventType, TGuardResponse>>
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
/**
|
|
@@ -213,7 +213,17 @@ export declare type BehaviorActionIntend =
|
|
|
213
213
|
/**
|
|
214
214
|
* @alpha
|
|
215
215
|
*/
|
|
216
|
-
export declare type BehaviorActionIntendSet<
|
|
216
|
+
export declare type BehaviorActionIntendSet<
|
|
217
|
+
TBehaviorEventType extends BehaviorEvent['type'] = BehaviorEvent['type'],
|
|
218
|
+
TGuardResponse = true,
|
|
219
|
+
> = (
|
|
220
|
+
{
|
|
221
|
+
context,
|
|
222
|
+
event,
|
|
223
|
+
}: {
|
|
224
|
+
context: EditorContext
|
|
225
|
+
event: PickFromUnion<BehaviorEvent, 'type', TBehaviorEventType>
|
|
226
|
+
},
|
|
217
227
|
guardResponse: TGuardResponse,
|
|
218
228
|
) => Array<BehaviorActionIntend>
|
|
219
229
|
|
|
@@ -226,14 +236,14 @@ export declare type BehaviorEvent = SyntheticBehaviorEvent | NativeBehaviorEvent
|
|
|
226
236
|
* @alpha
|
|
227
237
|
*/
|
|
228
238
|
export declare type BehaviorGuard<
|
|
229
|
-
|
|
239
|
+
TBehaviorEvent extends BehaviorEvent,
|
|
230
240
|
TGuardResponse,
|
|
231
241
|
> = ({
|
|
232
242
|
context,
|
|
233
243
|
event,
|
|
234
244
|
}: {
|
|
235
245
|
context: EditorContext
|
|
236
|
-
event:
|
|
246
|
+
event: TBehaviorEvent
|
|
237
247
|
}) => TGuardResponse | false
|
|
238
248
|
|
|
239
249
|
/** @beta */
|
|
@@ -334,14 +344,6 @@ export declare type BlurChange = {
|
|
|
334
344
|
event: FocusEvent_2<HTMLDivElement, Element>
|
|
335
345
|
}
|
|
336
346
|
|
|
337
|
-
/**
|
|
338
|
-
* @alpha
|
|
339
|
-
*/
|
|
340
|
-
export declare type CodeEditorBehaviorsConfig = {
|
|
341
|
-
moveBlockUpShortcut: string
|
|
342
|
-
moveBlockDownShortcut: string
|
|
343
|
-
}
|
|
344
|
-
|
|
345
347
|
/**
|
|
346
348
|
* The editor was either connected or disconnected to the network
|
|
347
349
|
* To show out of sync warnings etc when in collaborative mode.
|
|
@@ -351,480 +353,6 @@ export declare type ConnectionChange = {
|
|
|
351
353
|
value: 'online' | 'offline'
|
|
352
354
|
}
|
|
353
355
|
|
|
354
|
-
/**
|
|
355
|
-
* @alpha
|
|
356
|
-
*/
|
|
357
|
-
export declare const coreBehavior: {
|
|
358
|
-
softReturn: Behavior<
|
|
359
|
-
| 'focus'
|
|
360
|
-
| 'list item.toggle'
|
|
361
|
-
| 'annotation.add'
|
|
362
|
-
| 'annotation.remove'
|
|
363
|
-
| 'annotation.toggle'
|
|
364
|
-
| 'blur'
|
|
365
|
-
| 'decorator.add'
|
|
366
|
-
| 'decorator.remove'
|
|
367
|
-
| 'decorator.toggle'
|
|
368
|
-
| 'delete.backward'
|
|
369
|
-
| 'delete.forward'
|
|
370
|
-
| 'insert.block object'
|
|
371
|
-
| 'insert.inline object'
|
|
372
|
-
| 'insert.soft break'
|
|
373
|
-
| 'insert.break'
|
|
374
|
-
| 'insert.text'
|
|
375
|
-
| 'style.toggle'
|
|
376
|
-
| 'copy'
|
|
377
|
-
| 'key.down'
|
|
378
|
-
| 'key.up'
|
|
379
|
-
| 'paste',
|
|
380
|
-
true
|
|
381
|
-
>
|
|
382
|
-
decorators: {
|
|
383
|
-
decoratorAdd: Behavior<
|
|
384
|
-
| 'focus'
|
|
385
|
-
| 'list item.toggle'
|
|
386
|
-
| 'annotation.add'
|
|
387
|
-
| 'annotation.remove'
|
|
388
|
-
| 'annotation.toggle'
|
|
389
|
-
| 'blur'
|
|
390
|
-
| 'decorator.add'
|
|
391
|
-
| 'decorator.remove'
|
|
392
|
-
| 'decorator.toggle'
|
|
393
|
-
| 'delete.backward'
|
|
394
|
-
| 'delete.forward'
|
|
395
|
-
| 'insert.block object'
|
|
396
|
-
| 'insert.inline object'
|
|
397
|
-
| 'insert.soft break'
|
|
398
|
-
| 'insert.break'
|
|
399
|
-
| 'insert.text'
|
|
400
|
-
| 'style.toggle'
|
|
401
|
-
| 'copy'
|
|
402
|
-
| 'key.down'
|
|
403
|
-
| 'key.up'
|
|
404
|
-
| 'paste',
|
|
405
|
-
true
|
|
406
|
-
>
|
|
407
|
-
decoratorRemove: Behavior<
|
|
408
|
-
| 'focus'
|
|
409
|
-
| 'list item.toggle'
|
|
410
|
-
| 'annotation.add'
|
|
411
|
-
| 'annotation.remove'
|
|
412
|
-
| 'annotation.toggle'
|
|
413
|
-
| 'blur'
|
|
414
|
-
| 'decorator.add'
|
|
415
|
-
| 'decorator.remove'
|
|
416
|
-
| 'decorator.toggle'
|
|
417
|
-
| 'delete.backward'
|
|
418
|
-
| 'delete.forward'
|
|
419
|
-
| 'insert.block object'
|
|
420
|
-
| 'insert.inline object'
|
|
421
|
-
| 'insert.soft break'
|
|
422
|
-
| 'insert.break'
|
|
423
|
-
| 'insert.text'
|
|
424
|
-
| 'style.toggle'
|
|
425
|
-
| 'copy'
|
|
426
|
-
| 'key.down'
|
|
427
|
-
| 'key.up'
|
|
428
|
-
| 'paste',
|
|
429
|
-
true
|
|
430
|
-
>
|
|
431
|
-
decoratorToggle: Behavior<
|
|
432
|
-
| 'focus'
|
|
433
|
-
| 'list item.toggle'
|
|
434
|
-
| 'annotation.add'
|
|
435
|
-
| 'annotation.remove'
|
|
436
|
-
| 'annotation.toggle'
|
|
437
|
-
| 'blur'
|
|
438
|
-
| 'decorator.add'
|
|
439
|
-
| 'decorator.remove'
|
|
440
|
-
| 'decorator.toggle'
|
|
441
|
-
| 'delete.backward'
|
|
442
|
-
| 'delete.forward'
|
|
443
|
-
| 'insert.block object'
|
|
444
|
-
| 'insert.inline object'
|
|
445
|
-
| 'insert.soft break'
|
|
446
|
-
| 'insert.break'
|
|
447
|
-
| 'insert.text'
|
|
448
|
-
| 'style.toggle'
|
|
449
|
-
| 'copy'
|
|
450
|
-
| 'key.down'
|
|
451
|
-
| 'key.up'
|
|
452
|
-
| 'paste',
|
|
453
|
-
true
|
|
454
|
-
>
|
|
455
|
-
}
|
|
456
|
-
blockObjects: {
|
|
457
|
-
arrowDownOnLonelyBlockObject: Behavior<
|
|
458
|
-
| 'focus'
|
|
459
|
-
| 'list item.toggle'
|
|
460
|
-
| 'annotation.add'
|
|
461
|
-
| 'annotation.remove'
|
|
462
|
-
| 'annotation.toggle'
|
|
463
|
-
| 'blur'
|
|
464
|
-
| 'decorator.add'
|
|
465
|
-
| 'decorator.remove'
|
|
466
|
-
| 'decorator.toggle'
|
|
467
|
-
| 'delete.backward'
|
|
468
|
-
| 'delete.forward'
|
|
469
|
-
| 'insert.block object'
|
|
470
|
-
| 'insert.inline object'
|
|
471
|
-
| 'insert.soft break'
|
|
472
|
-
| 'insert.break'
|
|
473
|
-
| 'insert.text'
|
|
474
|
-
| 'style.toggle'
|
|
475
|
-
| 'copy'
|
|
476
|
-
| 'key.down'
|
|
477
|
-
| 'key.up'
|
|
478
|
-
| 'paste',
|
|
479
|
-
true
|
|
480
|
-
>
|
|
481
|
-
arrowUpOnLonelyBlockObject: Behavior<
|
|
482
|
-
| 'focus'
|
|
483
|
-
| 'list item.toggle'
|
|
484
|
-
| 'annotation.add'
|
|
485
|
-
| 'annotation.remove'
|
|
486
|
-
| 'annotation.toggle'
|
|
487
|
-
| 'blur'
|
|
488
|
-
| 'decorator.add'
|
|
489
|
-
| 'decorator.remove'
|
|
490
|
-
| 'decorator.toggle'
|
|
491
|
-
| 'delete.backward'
|
|
492
|
-
| 'delete.forward'
|
|
493
|
-
| 'insert.block object'
|
|
494
|
-
| 'insert.inline object'
|
|
495
|
-
| 'insert.soft break'
|
|
496
|
-
| 'insert.break'
|
|
497
|
-
| 'insert.text'
|
|
498
|
-
| 'style.toggle'
|
|
499
|
-
| 'copy'
|
|
500
|
-
| 'key.down'
|
|
501
|
-
| 'key.up'
|
|
502
|
-
| 'paste',
|
|
503
|
-
true
|
|
504
|
-
>
|
|
505
|
-
breakingBlockObject: Behavior<
|
|
506
|
-
| 'focus'
|
|
507
|
-
| 'list item.toggle'
|
|
508
|
-
| 'annotation.add'
|
|
509
|
-
| 'annotation.remove'
|
|
510
|
-
| 'annotation.toggle'
|
|
511
|
-
| 'blur'
|
|
512
|
-
| 'decorator.add'
|
|
513
|
-
| 'decorator.remove'
|
|
514
|
-
| 'decorator.toggle'
|
|
515
|
-
| 'delete.backward'
|
|
516
|
-
| 'delete.forward'
|
|
517
|
-
| 'insert.block object'
|
|
518
|
-
| 'insert.inline object'
|
|
519
|
-
| 'insert.soft break'
|
|
520
|
-
| 'insert.break'
|
|
521
|
-
| 'insert.text'
|
|
522
|
-
| 'style.toggle'
|
|
523
|
-
| 'copy'
|
|
524
|
-
| 'key.down'
|
|
525
|
-
| 'key.up'
|
|
526
|
-
| 'paste',
|
|
527
|
-
true
|
|
528
|
-
>
|
|
529
|
-
deletingEmptyTextBlockAfterBlockObject: Behavior<
|
|
530
|
-
| 'focus'
|
|
531
|
-
| 'list item.toggle'
|
|
532
|
-
| 'annotation.add'
|
|
533
|
-
| 'annotation.remove'
|
|
534
|
-
| 'annotation.toggle'
|
|
535
|
-
| 'blur'
|
|
536
|
-
| 'decorator.add'
|
|
537
|
-
| 'decorator.remove'
|
|
538
|
-
| 'decorator.toggle'
|
|
539
|
-
| 'delete.backward'
|
|
540
|
-
| 'delete.forward'
|
|
541
|
-
| 'insert.block object'
|
|
542
|
-
| 'insert.inline object'
|
|
543
|
-
| 'insert.soft break'
|
|
544
|
-
| 'insert.break'
|
|
545
|
-
| 'insert.text'
|
|
546
|
-
| 'style.toggle'
|
|
547
|
-
| 'copy'
|
|
548
|
-
| 'key.down'
|
|
549
|
-
| 'key.up'
|
|
550
|
-
| 'paste',
|
|
551
|
-
true
|
|
552
|
-
>
|
|
553
|
-
deletingEmptyTextBlockBeforeBlockObject: Behavior<
|
|
554
|
-
| 'focus'
|
|
555
|
-
| 'list item.toggle'
|
|
556
|
-
| 'annotation.add'
|
|
557
|
-
| 'annotation.remove'
|
|
558
|
-
| 'annotation.toggle'
|
|
559
|
-
| 'blur'
|
|
560
|
-
| 'decorator.add'
|
|
561
|
-
| 'decorator.remove'
|
|
562
|
-
| 'decorator.toggle'
|
|
563
|
-
| 'delete.backward'
|
|
564
|
-
| 'delete.forward'
|
|
565
|
-
| 'insert.block object'
|
|
566
|
-
| 'insert.inline object'
|
|
567
|
-
| 'insert.soft break'
|
|
568
|
-
| 'insert.break'
|
|
569
|
-
| 'insert.text'
|
|
570
|
-
| 'style.toggle'
|
|
571
|
-
| 'copy'
|
|
572
|
-
| 'key.down'
|
|
573
|
-
| 'key.up'
|
|
574
|
-
| 'paste',
|
|
575
|
-
true
|
|
576
|
-
>
|
|
577
|
-
}
|
|
578
|
-
lists: {
|
|
579
|
-
clearListOnBackspace: Behavior<
|
|
580
|
-
| 'focus'
|
|
581
|
-
| 'list item.toggle'
|
|
582
|
-
| 'annotation.add'
|
|
583
|
-
| 'annotation.remove'
|
|
584
|
-
| 'annotation.toggle'
|
|
585
|
-
| 'blur'
|
|
586
|
-
| 'decorator.add'
|
|
587
|
-
| 'decorator.remove'
|
|
588
|
-
| 'decorator.toggle'
|
|
589
|
-
| 'delete.backward'
|
|
590
|
-
| 'delete.forward'
|
|
591
|
-
| 'insert.block object'
|
|
592
|
-
| 'insert.inline object'
|
|
593
|
-
| 'insert.soft break'
|
|
594
|
-
| 'insert.break'
|
|
595
|
-
| 'insert.text'
|
|
596
|
-
| 'style.toggle'
|
|
597
|
-
| 'copy'
|
|
598
|
-
| 'key.down'
|
|
599
|
-
| 'key.up'
|
|
600
|
-
| 'paste',
|
|
601
|
-
true
|
|
602
|
-
>
|
|
603
|
-
unindentListOnBackspace: Behavior<
|
|
604
|
-
| 'focus'
|
|
605
|
-
| 'list item.toggle'
|
|
606
|
-
| 'annotation.add'
|
|
607
|
-
| 'annotation.remove'
|
|
608
|
-
| 'annotation.toggle'
|
|
609
|
-
| 'blur'
|
|
610
|
-
| 'decorator.add'
|
|
611
|
-
| 'decorator.remove'
|
|
612
|
-
| 'decorator.toggle'
|
|
613
|
-
| 'delete.backward'
|
|
614
|
-
| 'delete.forward'
|
|
615
|
-
| 'insert.block object'
|
|
616
|
-
| 'insert.inline object'
|
|
617
|
-
| 'insert.soft break'
|
|
618
|
-
| 'insert.break'
|
|
619
|
-
| 'insert.text'
|
|
620
|
-
| 'style.toggle'
|
|
621
|
-
| 'copy'
|
|
622
|
-
| 'key.down'
|
|
623
|
-
| 'key.up'
|
|
624
|
-
| 'paste',
|
|
625
|
-
true
|
|
626
|
-
>
|
|
627
|
-
clearListOnEnter: Behavior<
|
|
628
|
-
| 'focus'
|
|
629
|
-
| 'list item.toggle'
|
|
630
|
-
| 'annotation.add'
|
|
631
|
-
| 'annotation.remove'
|
|
632
|
-
| 'annotation.toggle'
|
|
633
|
-
| 'blur'
|
|
634
|
-
| 'decorator.add'
|
|
635
|
-
| 'decorator.remove'
|
|
636
|
-
| 'decorator.toggle'
|
|
637
|
-
| 'delete.backward'
|
|
638
|
-
| 'delete.forward'
|
|
639
|
-
| 'insert.block object'
|
|
640
|
-
| 'insert.inline object'
|
|
641
|
-
| 'insert.soft break'
|
|
642
|
-
| 'insert.break'
|
|
643
|
-
| 'insert.text'
|
|
644
|
-
| 'style.toggle'
|
|
645
|
-
| 'copy'
|
|
646
|
-
| 'key.down'
|
|
647
|
-
| 'key.up'
|
|
648
|
-
| 'paste',
|
|
649
|
-
true
|
|
650
|
-
>
|
|
651
|
-
indentListOnTab: Behavior<
|
|
652
|
-
| 'focus'
|
|
653
|
-
| 'list item.toggle'
|
|
654
|
-
| 'annotation.add'
|
|
655
|
-
| 'annotation.remove'
|
|
656
|
-
| 'annotation.toggle'
|
|
657
|
-
| 'blur'
|
|
658
|
-
| 'decorator.add'
|
|
659
|
-
| 'decorator.remove'
|
|
660
|
-
| 'decorator.toggle'
|
|
661
|
-
| 'delete.backward'
|
|
662
|
-
| 'delete.forward'
|
|
663
|
-
| 'insert.block object'
|
|
664
|
-
| 'insert.inline object'
|
|
665
|
-
| 'insert.soft break'
|
|
666
|
-
| 'insert.break'
|
|
667
|
-
| 'insert.text'
|
|
668
|
-
| 'style.toggle'
|
|
669
|
-
| 'copy'
|
|
670
|
-
| 'key.down'
|
|
671
|
-
| 'key.up'
|
|
672
|
-
| 'paste',
|
|
673
|
-
true
|
|
674
|
-
>
|
|
675
|
-
unindentListOnShiftTab: Behavior<
|
|
676
|
-
| 'focus'
|
|
677
|
-
| 'list item.toggle'
|
|
678
|
-
| 'annotation.add'
|
|
679
|
-
| 'annotation.remove'
|
|
680
|
-
| 'annotation.toggle'
|
|
681
|
-
| 'blur'
|
|
682
|
-
| 'decorator.add'
|
|
683
|
-
| 'decorator.remove'
|
|
684
|
-
| 'decorator.toggle'
|
|
685
|
-
| 'delete.backward'
|
|
686
|
-
| 'delete.forward'
|
|
687
|
-
| 'insert.block object'
|
|
688
|
-
| 'insert.inline object'
|
|
689
|
-
| 'insert.soft break'
|
|
690
|
-
| 'insert.break'
|
|
691
|
-
| 'insert.text'
|
|
692
|
-
| 'style.toggle'
|
|
693
|
-
| 'copy'
|
|
694
|
-
| 'key.down'
|
|
695
|
-
| 'key.up'
|
|
696
|
-
| 'paste',
|
|
697
|
-
true
|
|
698
|
-
>
|
|
699
|
-
}
|
|
700
|
-
}
|
|
701
|
-
|
|
702
|
-
/**
|
|
703
|
-
* @alpha
|
|
704
|
-
*/
|
|
705
|
-
export declare const coreBehaviors: Behavior<
|
|
706
|
-
| 'focus'
|
|
707
|
-
| 'list item.toggle'
|
|
708
|
-
| 'annotation.add'
|
|
709
|
-
| 'annotation.remove'
|
|
710
|
-
| 'annotation.toggle'
|
|
711
|
-
| 'blur'
|
|
712
|
-
| 'decorator.add'
|
|
713
|
-
| 'decorator.remove'
|
|
714
|
-
| 'decorator.toggle'
|
|
715
|
-
| 'delete.backward'
|
|
716
|
-
| 'delete.forward'
|
|
717
|
-
| 'insert.block object'
|
|
718
|
-
| 'insert.inline object'
|
|
719
|
-
| 'insert.soft break'
|
|
720
|
-
| 'insert.break'
|
|
721
|
-
| 'insert.text'
|
|
722
|
-
| 'style.toggle'
|
|
723
|
-
| 'copy'
|
|
724
|
-
| 'key.down'
|
|
725
|
-
| 'key.up'
|
|
726
|
-
| 'paste',
|
|
727
|
-
true
|
|
728
|
-
>[]
|
|
729
|
-
|
|
730
|
-
/**
|
|
731
|
-
* @alpha
|
|
732
|
-
*/
|
|
733
|
-
export declare function createCodeEditorBehaviors(
|
|
734
|
-
config: CodeEditorBehaviorsConfig,
|
|
735
|
-
): Behavior<
|
|
736
|
-
| 'focus'
|
|
737
|
-
| 'list item.toggle'
|
|
738
|
-
| 'annotation.add'
|
|
739
|
-
| 'annotation.remove'
|
|
740
|
-
| 'annotation.toggle'
|
|
741
|
-
| 'blur'
|
|
742
|
-
| 'decorator.add'
|
|
743
|
-
| 'decorator.remove'
|
|
744
|
-
| 'decorator.toggle'
|
|
745
|
-
| 'delete.backward'
|
|
746
|
-
| 'delete.forward'
|
|
747
|
-
| 'insert.block object'
|
|
748
|
-
| 'insert.inline object'
|
|
749
|
-
| 'insert.soft break'
|
|
750
|
-
| 'insert.break'
|
|
751
|
-
| 'insert.text'
|
|
752
|
-
| 'style.toggle'
|
|
753
|
-
| 'copy'
|
|
754
|
-
| 'key.down'
|
|
755
|
-
| 'key.up'
|
|
756
|
-
| 'paste',
|
|
757
|
-
true
|
|
758
|
-
>[]
|
|
759
|
-
|
|
760
|
-
/**
|
|
761
|
-
* @alpha
|
|
762
|
-
*/
|
|
763
|
-
export declare function createLinkBehaviors(
|
|
764
|
-
config: LinkBehaviorsConfig,
|
|
765
|
-
): Behavior<
|
|
766
|
-
| 'focus'
|
|
767
|
-
| 'list item.toggle'
|
|
768
|
-
| 'annotation.add'
|
|
769
|
-
| 'annotation.remove'
|
|
770
|
-
| 'annotation.toggle'
|
|
771
|
-
| 'blur'
|
|
772
|
-
| 'decorator.add'
|
|
773
|
-
| 'decorator.remove'
|
|
774
|
-
| 'decorator.toggle'
|
|
775
|
-
| 'delete.backward'
|
|
776
|
-
| 'delete.forward'
|
|
777
|
-
| 'insert.block object'
|
|
778
|
-
| 'insert.inline object'
|
|
779
|
-
| 'insert.soft break'
|
|
780
|
-
| 'insert.break'
|
|
781
|
-
| 'insert.text'
|
|
782
|
-
| 'style.toggle'
|
|
783
|
-
| 'copy'
|
|
784
|
-
| 'key.down'
|
|
785
|
-
| 'key.up'
|
|
786
|
-
| 'paste',
|
|
787
|
-
true
|
|
788
|
-
>[]
|
|
789
|
-
|
|
790
|
-
/**
|
|
791
|
-
* @alpha
|
|
792
|
-
*/
|
|
793
|
-
export declare function createMarkdownBehaviors(
|
|
794
|
-
config: MarkdownBehaviorsConfig,
|
|
795
|
-
): Behavior<
|
|
796
|
-
| 'focus'
|
|
797
|
-
| 'list item.toggle'
|
|
798
|
-
| 'annotation.add'
|
|
799
|
-
| 'annotation.remove'
|
|
800
|
-
| 'annotation.toggle'
|
|
801
|
-
| 'blur'
|
|
802
|
-
| 'decorator.add'
|
|
803
|
-
| 'decorator.remove'
|
|
804
|
-
| 'decorator.toggle'
|
|
805
|
-
| 'delete.backward'
|
|
806
|
-
| 'delete.forward'
|
|
807
|
-
| 'insert.block object'
|
|
808
|
-
| 'insert.inline object'
|
|
809
|
-
| 'insert.soft break'
|
|
810
|
-
| 'insert.break'
|
|
811
|
-
| 'insert.text'
|
|
812
|
-
| 'style.toggle'
|
|
813
|
-
| 'copy'
|
|
814
|
-
| 'key.down'
|
|
815
|
-
| 'key.up'
|
|
816
|
-
| 'paste',
|
|
817
|
-
true
|
|
818
|
-
>[]
|
|
819
|
-
|
|
820
|
-
/**
|
|
821
|
-
* @alpha
|
|
822
|
-
*/
|
|
823
|
-
export declare function defineBehavior<
|
|
824
|
-
TAnyBehaviorEventType extends BehaviorEvent['type'],
|
|
825
|
-
TGuardResponse = true,
|
|
826
|
-
>(behavior: Behavior<TAnyBehaviorEventType, TGuardResponse>): Behavior
|
|
827
|
-
|
|
828
356
|
/**
|
|
829
357
|
* @alpha
|
|
830
358
|
*/
|
|
@@ -9551,23 +9079,6 @@ export declare type InvalidValueResolution = {
|
|
|
9551
9079
|
*/
|
|
9552
9080
|
export declare const keyGenerator: () => string
|
|
9553
9081
|
|
|
9554
|
-
/**
|
|
9555
|
-
* @alpha
|
|
9556
|
-
*/
|
|
9557
|
-
export declare type LinkBehaviorsConfig = {
|
|
9558
|
-
linkAnnotation?: (context: {
|
|
9559
|
-
schema: PortableTextMemberSchemaTypes
|
|
9560
|
-
url: string
|
|
9561
|
-
}) =>
|
|
9562
|
-
| {
|
|
9563
|
-
name: string
|
|
9564
|
-
value: {
|
|
9565
|
-
[prop: string]: unknown
|
|
9566
|
-
}
|
|
9567
|
-
}
|
|
9568
|
-
| undefined
|
|
9569
|
-
}
|
|
9570
|
-
|
|
9571
9082
|
/**
|
|
9572
9083
|
* The editor is currently loading something
|
|
9573
9084
|
* Could be used to show a spinner etc.
|
|
@@ -9577,36 +9088,6 @@ export declare type LoadingChange = {
|
|
|
9577
9088
|
isLoading: boolean
|
|
9578
9089
|
}
|
|
9579
9090
|
|
|
9580
|
-
/**
|
|
9581
|
-
* @alpha
|
|
9582
|
-
*/
|
|
9583
|
-
export declare type MarkdownBehaviorsConfig = {
|
|
9584
|
-
horizontalRuleObject?: (context: {schema: PortableTextMemberSchemaTypes}) =>
|
|
9585
|
-
| {
|
|
9586
|
-
name: string
|
|
9587
|
-
value?: {
|
|
9588
|
-
[prop: string]: unknown
|
|
9589
|
-
}
|
|
9590
|
-
}
|
|
9591
|
-
| undefined
|
|
9592
|
-
defaultStyle?: (context: {
|
|
9593
|
-
schema: PortableTextMemberSchemaTypes
|
|
9594
|
-
}) => string | undefined
|
|
9595
|
-
headingStyle?: (context: {
|
|
9596
|
-
schema: PortableTextMemberSchemaTypes
|
|
9597
|
-
level: number
|
|
9598
|
-
}) => string | undefined
|
|
9599
|
-
blockquoteStyle?: (context: {
|
|
9600
|
-
schema: PortableTextMemberSchemaTypes
|
|
9601
|
-
}) => string | undefined
|
|
9602
|
-
unorderedListStyle?: (context: {
|
|
9603
|
-
schema: PortableTextMemberSchemaTypes
|
|
9604
|
-
}) => string | undefined
|
|
9605
|
-
orderedListStyle?: (context: {
|
|
9606
|
-
schema: PortableTextMemberSchemaTypes
|
|
9607
|
-
}) => string | undefined
|
|
9608
|
-
}
|
|
9609
|
-
|
|
9610
9091
|
/**
|
|
9611
9092
|
* The editor has mutated it's content.
|
|
9612
9093
|
* @beta */
|