@portabletext/editor 1.31.2 → 1.33.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 (74) hide show
  1. package/lib/_chunks-cjs/behavior.core.cjs +4 -4
  2. package/lib/_chunks-cjs/behavior.core.cjs.map +1 -1
  3. package/lib/_chunks-cjs/behavior.markdown.cjs +19 -11
  4. package/lib/_chunks-cjs/behavior.markdown.cjs.map +1 -1
  5. package/lib/_chunks-cjs/plugin.event-listener.cjs +1839 -1724
  6. package/lib/_chunks-cjs/plugin.event-listener.cjs.map +1 -1
  7. package/lib/_chunks-cjs/selector.get-trimmed-selection.cjs +97 -0
  8. package/lib/_chunks-cjs/selector.get-trimmed-selection.cjs.map +1 -0
  9. package/lib/_chunks-cjs/{parse-blocks.cjs → util.block-offsets-to-selection.cjs} +21 -2
  10. package/lib/_chunks-cjs/util.block-offsets-to-selection.cjs.map +1 -0
  11. package/lib/_chunks-cjs/util.reverse-selection.cjs +11 -0
  12. package/lib/_chunks-cjs/util.reverse-selection.cjs.map +1 -1
  13. package/lib/_chunks-es/behavior.core.js +1 -1
  14. package/lib/_chunks-es/behavior.core.js.map +1 -1
  15. package/lib/_chunks-es/behavior.markdown.js +18 -11
  16. package/lib/_chunks-es/behavior.markdown.js.map +1 -1
  17. package/lib/_chunks-es/plugin.event-listener.js +1842 -1726
  18. package/lib/_chunks-es/plugin.event-listener.js.map +1 -1
  19. package/lib/_chunks-es/selector.get-trimmed-selection.js +100 -0
  20. package/lib/_chunks-es/selector.get-trimmed-selection.js.map +1 -0
  21. package/lib/_chunks-es/{parse-blocks.js → util.block-offsets-to-selection.js} +21 -1
  22. package/lib/_chunks-es/util.block-offsets-to-selection.js.map +1 -0
  23. package/lib/_chunks-es/util.reverse-selection.js +11 -0
  24. package/lib/_chunks-es/util.reverse-selection.js.map +1 -1
  25. package/lib/behaviors/index.d.cts +27 -0
  26. package/lib/behaviors/index.d.ts +27 -0
  27. package/lib/index.d.cts +1128 -66
  28. package/lib/index.d.ts +1128 -66
  29. package/lib/plugins/index.cjs +295 -3
  30. package/lib/plugins/index.cjs.map +1 -1
  31. package/lib/plugins/index.d.cts +1142 -67
  32. package/lib/plugins/index.d.ts +1142 -67
  33. package/lib/plugins/index.js +300 -4
  34. package/lib/plugins/index.js.map +1 -1
  35. package/lib/selectors/index.cjs +51 -1
  36. package/lib/selectors/index.cjs.map +1 -1
  37. package/lib/selectors/index.d.cts +67 -0
  38. package/lib/selectors/index.d.ts +67 -0
  39. package/lib/selectors/index.js +53 -2
  40. package/lib/selectors/index.js.map +1 -1
  41. package/lib/utils/index.cjs +5 -4
  42. package/lib/utils/index.cjs.map +1 -1
  43. package/lib/utils/index.d.cts +16 -0
  44. package/lib/utils/index.d.ts +16 -0
  45. package/lib/utils/index.js +4 -3
  46. package/package.json +2 -2
  47. package/src/behavior-actions/behavior.action.decorator.add.ts +161 -0
  48. package/src/behavior-actions/behavior.action.delete.text.ts +54 -0
  49. package/src/behavior-actions/behavior.actions.ts +25 -43
  50. package/src/behaviors/behavior.markdown-emphasis.ts +395 -0
  51. package/src/behaviors/behavior.markdown.ts +11 -4
  52. package/src/behaviors/behavior.types.ts +7 -0
  53. package/src/editor/editor-machine.ts +80 -85
  54. package/src/editor/plugins/create-with-event-listeners.ts +51 -0
  55. package/src/editor/plugins/createWithEditableAPI.ts +18 -2
  56. package/src/editor/plugins/createWithPortableTextMarkModel.ts +2 -97
  57. package/src/editor/plugins/createWithUndoRedo.ts +132 -107
  58. package/src/editor/with-applying-behavior-actions.ts +27 -3
  59. package/src/plugins/plugin.markdown.tsx +11 -1
  60. package/src/selectors/index.ts +5 -0
  61. package/src/selectors/selector.get-anchor-block.ts +22 -0
  62. package/src/selectors/selector.get-anchor-child.ts +36 -0
  63. package/src/selectors/selector.get-anchor-span.ts +18 -0
  64. package/src/selectors/selector.get-anchor-text-block.ts +20 -0
  65. package/src/selectors/selector.get-trimmed-selection.test.ts +658 -0
  66. package/src/selectors/selector.get-trimmed-selection.ts +175 -0
  67. package/src/utils/index.ts +1 -0
  68. package/src/utils/util.block-offsets-to-selection.ts +36 -0
  69. package/lib/_chunks-cjs/parse-blocks.cjs.map +0 -1
  70. package/lib/_chunks-cjs/util.is-empty-text-block.cjs +0 -14
  71. package/lib/_chunks-cjs/util.is-empty-text-block.cjs.map +0 -1
  72. package/lib/_chunks-es/parse-blocks.js.map +0 -1
  73. package/lib/_chunks-es/util.is-empty-text-block.js +0 -15
  74. package/lib/_chunks-es/util.is-empty-text-block.js.map +0 -1
@@ -448,6 +448,7 @@ declare const editorMachine: StateMachine<
448
448
  | {
449
449
  type: 'decorator.add'
450
450
  decorator: string
451
+ selection?: NonNullable<EditorSelection>
451
452
  }
452
453
  | {
453
454
  type: 'decorator.remove'
@@ -481,6 +482,12 @@ declare const editorMachine: StateMachine<
481
482
  | {
482
483
  type: 'focus'
483
484
  }
485
+ | {
486
+ type: 'history.redo'
487
+ }
488
+ | {
489
+ type: 'history.undo'
490
+ }
484
491
  | {
485
492
  type: 'insert.blocks'
486
493
  blocks: Array<PortableTextBlock>
@@ -872,6 +879,7 @@ declare const editorMachine: StateMachine<
872
879
  | {
873
880
  type: 'decorator.add'
874
881
  decorator: string
882
+ selection?: NonNullable<EditorSelection>
875
883
  }
876
884
  | {
877
885
  type: 'decorator.remove'
@@ -905,6 +913,12 @@ declare const editorMachine: StateMachine<
905
913
  | {
906
914
  type: 'focus'
907
915
  }
916
+ | {
917
+ type: 'history.redo'
918
+ }
919
+ | {
920
+ type: 'history.undo'
921
+ }
908
922
  | {
909
923
  type: 'insert.blocks'
910
924
  blocks: Array<PortableTextBlock>
@@ -1196,6 +1210,7 @@ declare const editorMachine: StateMachine<
1196
1210
  | {
1197
1211
  type: 'decorator.add'
1198
1212
  decorator: string
1213
+ selection?: NonNullable<EditorSelection>
1199
1214
  }
1200
1215
  | {
1201
1216
  type: 'decorator.remove'
@@ -1229,6 +1244,12 @@ declare const editorMachine: StateMachine<
1229
1244
  | {
1230
1245
  type: 'focus'
1231
1246
  }
1247
+ | {
1248
+ type: 'history.redo'
1249
+ }
1250
+ | {
1251
+ type: 'history.undo'
1252
+ }
1232
1253
  | {
1233
1254
  type: 'insert.blocks'
1234
1255
  blocks: Array<PortableTextBlock>
@@ -1545,6 +1566,7 @@ declare const editorMachine: StateMachine<
1545
1566
  | {
1546
1567
  type: 'decorator.add'
1547
1568
  decorator: string
1569
+ selection?: NonNullable<EditorSelection>
1548
1570
  }
1549
1571
  | {
1550
1572
  type: 'decorator.remove'
@@ -1578,6 +1600,12 @@ declare const editorMachine: StateMachine<
1578
1600
  | {
1579
1601
  type: 'focus'
1580
1602
  }
1603
+ | {
1604
+ type: 'history.redo'
1605
+ }
1606
+ | {
1607
+ type: 'history.undo'
1608
+ }
1581
1609
  | {
1582
1610
  type: 'insert.blocks'
1583
1611
  blocks: Array<PortableTextBlock>
@@ -1870,6 +1898,8 @@ declare const editorMachine: StateMachine<
1870
1898
  | 'delete.block'
1871
1899
  | 'delete.forward'
1872
1900
  | 'delete.text'
1901
+ | 'history.redo'
1902
+ | 'history.undo'
1873
1903
  | 'insert.blocks'
1874
1904
  | 'insert.block object'
1875
1905
  | 'insert.inline object'
@@ -1924,6 +1954,8 @@ declare const editorMachine: StateMachine<
1924
1954
  | 'delete.block'
1925
1955
  | 'delete.forward'
1926
1956
  | 'delete.text'
1957
+ | 'history.redo'
1958
+ | 'history.undo'
1927
1959
  | 'insert.blocks'
1928
1960
  | 'insert.block object'
1929
1961
  | 'insert.inline object'
@@ -2026,6 +2058,7 @@ declare const editorMachine: StateMachine<
2026
2058
  | {
2027
2059
  type: 'decorator.add'
2028
2060
  decorator: string
2061
+ selection?: NonNullable<EditorSelection>
2029
2062
  }
2030
2063
  | {
2031
2064
  type: 'decorator.remove'
@@ -2059,6 +2092,12 @@ declare const editorMachine: StateMachine<
2059
2092
  | {
2060
2093
  type: 'focus'
2061
2094
  }
2095
+ | {
2096
+ type: 'history.redo'
2097
+ }
2098
+ | {
2099
+ type: 'history.undo'
2100
+ }
2062
2101
  | {
2063
2102
  type: 'insert.blocks'
2064
2103
  blocks: Array<PortableTextBlock>
@@ -2373,6 +2412,7 @@ declare const editorMachine: StateMachine<
2373
2412
  | {
2374
2413
  type: 'decorator.add'
2375
2414
  decorator: string
2415
+ selection?: NonNullable<EditorSelection>
2376
2416
  }
2377
2417
  | {
2378
2418
  type: 'decorator.remove'
@@ -2406,6 +2446,12 @@ declare const editorMachine: StateMachine<
2406
2446
  | {
2407
2447
  type: 'focus'
2408
2448
  }
2449
+ | {
2450
+ type: 'history.redo'
2451
+ }
2452
+ | {
2453
+ type: 'history.undo'
2454
+ }
2409
2455
  | {
2410
2456
  type: 'insert.blocks'
2411
2457
  blocks: Array<PortableTextBlock>
@@ -2665,6 +2711,7 @@ declare const editorMachine: StateMachine<
2665
2711
  | {
2666
2712
  type: 'decorator.add'
2667
2713
  decorator: string
2714
+ selection?: NonNullable<EditorSelection>
2668
2715
  }
2669
2716
  | {
2670
2717
  type: 'decorator.remove'
@@ -2698,6 +2745,12 @@ declare const editorMachine: StateMachine<
2698
2745
  | {
2699
2746
  type: 'focus'
2700
2747
  }
2748
+ | {
2749
+ type: 'history.redo'
2750
+ }
2751
+ | {
2752
+ type: 'history.undo'
2753
+ }
2701
2754
  | {
2702
2755
  type: 'insert.blocks'
2703
2756
  blocks: Array<PortableTextBlock>
@@ -3012,6 +3065,7 @@ declare const editorMachine: StateMachine<
3012
3065
  | {
3013
3066
  type: 'decorator.add'
3014
3067
  decorator: string
3068
+ selection?: NonNullable<EditorSelection>
3015
3069
  }
3016
3070
  | {
3017
3071
  type: 'decorator.remove'
@@ -3045,6 +3099,12 @@ declare const editorMachine: StateMachine<
3045
3099
  | {
3046
3100
  type: 'focus'
3047
3101
  }
3102
+ | {
3103
+ type: 'history.redo'
3104
+ }
3105
+ | {
3106
+ type: 'history.undo'
3107
+ }
3048
3108
  | {
3049
3109
  type: 'insert.blocks'
3050
3110
  blocks: Array<PortableTextBlock>
@@ -3307,6 +3367,7 @@ declare const editorMachine: StateMachine<
3307
3367
  | {
3308
3368
  type: 'decorator.add'
3309
3369
  decorator: string
3370
+ selection?: NonNullable<EditorSelection>
3310
3371
  }
3311
3372
  | {
3312
3373
  type: 'decorator.remove'
@@ -3340,6 +3401,12 @@ declare const editorMachine: StateMachine<
3340
3401
  | {
3341
3402
  type: 'focus'
3342
3403
  }
3404
+ | {
3405
+ type: 'history.redo'
3406
+ }
3407
+ | {
3408
+ type: 'history.undo'
3409
+ }
3343
3410
  | {
3344
3411
  type: 'insert.blocks'
3345
3412
  blocks: Array<PortableTextBlock>
@@ -3654,6 +3721,7 @@ declare const editorMachine: StateMachine<
3654
3721
  | {
3655
3722
  type: 'decorator.add'
3656
3723
  decorator: string
3724
+ selection?: NonNullable<EditorSelection>
3657
3725
  }
3658
3726
  | {
3659
3727
  type: 'decorator.remove'
@@ -3687,6 +3755,12 @@ declare const editorMachine: StateMachine<
3687
3755
  | {
3688
3756
  type: 'focus'
3689
3757
  }
3758
+ | {
3759
+ type: 'history.redo'
3760
+ }
3761
+ | {
3762
+ type: 'history.undo'
3763
+ }
3690
3764
  | {
3691
3765
  type: 'insert.blocks'
3692
3766
  blocks: Array<PortableTextBlock>
@@ -3948,6 +4022,7 @@ declare const editorMachine: StateMachine<
3948
4022
  | {
3949
4023
  type: 'decorator.add'
3950
4024
  decorator: string
4025
+ selection?: NonNullable<EditorSelection>
3951
4026
  }
3952
4027
  | {
3953
4028
  type: 'decorator.remove'
@@ -3981,6 +4056,12 @@ declare const editorMachine: StateMachine<
3981
4056
  | {
3982
4057
  type: 'focus'
3983
4058
  }
4059
+ | {
4060
+ type: 'history.redo'
4061
+ }
4062
+ | {
4063
+ type: 'history.undo'
4064
+ }
3984
4065
  | {
3985
4066
  type: 'insert.blocks'
3986
4067
  blocks: Array<PortableTextBlock>
@@ -4295,6 +4376,7 @@ declare const editorMachine: StateMachine<
4295
4376
  | {
4296
4377
  type: 'decorator.add'
4297
4378
  decorator: string
4379
+ selection?: NonNullable<EditorSelection>
4298
4380
  }
4299
4381
  | {
4300
4382
  type: 'decorator.remove'
@@ -4328,6 +4410,12 @@ declare const editorMachine: StateMachine<
4328
4410
  | {
4329
4411
  type: 'focus'
4330
4412
  }
4413
+ | {
4414
+ type: 'history.redo'
4415
+ }
4416
+ | {
4417
+ type: 'history.undo'
4418
+ }
4331
4419
  | {
4332
4420
  type: 'insert.blocks'
4333
4421
  blocks: Array<PortableTextBlock>
@@ -4588,6 +4676,7 @@ declare const editorMachine: StateMachine<
4588
4676
  | {
4589
4677
  type: 'decorator.add'
4590
4678
  decorator: string
4679
+ selection?: NonNullable<EditorSelection>
4591
4680
  }
4592
4681
  | {
4593
4682
  type: 'decorator.remove'
@@ -4621,6 +4710,12 @@ declare const editorMachine: StateMachine<
4621
4710
  | {
4622
4711
  type: 'focus'
4623
4712
  }
4713
+ | {
4714
+ type: 'history.redo'
4715
+ }
4716
+ | {
4717
+ type: 'history.undo'
4718
+ }
4624
4719
  | {
4625
4720
  type: 'insert.blocks'
4626
4721
  blocks: Array<PortableTextBlock>
@@ -4935,6 +5030,7 @@ declare const editorMachine: StateMachine<
4935
5030
  | {
4936
5031
  type: 'decorator.add'
4937
5032
  decorator: string
5033
+ selection?: NonNullable<EditorSelection>
4938
5034
  }
4939
5035
  | {
4940
5036
  type: 'decorator.remove'
@@ -4968,6 +5064,12 @@ declare const editorMachine: StateMachine<
4968
5064
  | {
4969
5065
  type: 'focus'
4970
5066
  }
5067
+ | {
5068
+ type: 'history.redo'
5069
+ }
5070
+ | {
5071
+ type: 'history.undo'
5072
+ }
4971
5073
  | {
4972
5074
  type: 'insert.blocks'
4973
5075
  blocks: Array<PortableTextBlock>
@@ -5229,6 +5331,7 @@ declare const editorMachine: StateMachine<
5229
5331
  | {
5230
5332
  type: 'decorator.add'
5231
5333
  decorator: string
5334
+ selection?: NonNullable<EditorSelection>
5232
5335
  }
5233
5336
  | {
5234
5337
  type: 'decorator.remove'
@@ -5262,6 +5365,12 @@ declare const editorMachine: StateMachine<
5262
5365
  | {
5263
5366
  type: 'focus'
5264
5367
  }
5368
+ | {
5369
+ type: 'history.redo'
5370
+ }
5371
+ | {
5372
+ type: 'history.undo'
5373
+ }
5265
5374
  | {
5266
5375
  type: 'insert.blocks'
5267
5376
  blocks: Array<PortableTextBlock>
@@ -5594,6 +5703,7 @@ declare const editorMachine: StateMachine<
5594
5703
  | {
5595
5704
  type: 'decorator.add'
5596
5705
  decorator: string
5706
+ selection?: NonNullable<EditorSelection>
5597
5707
  }
5598
5708
  | {
5599
5709
  type: 'decorator.remove'
@@ -5627,6 +5737,12 @@ declare const editorMachine: StateMachine<
5627
5737
  | {
5628
5738
  type: 'focus'
5629
5739
  }
5740
+ | {
5741
+ type: 'history.redo'
5742
+ }
5743
+ | {
5744
+ type: 'history.undo'
5745
+ }
5630
5746
  | {
5631
5747
  type: 'insert.blocks'
5632
5748
  blocks: Array<PortableTextBlock>
@@ -5941,6 +6057,7 @@ declare const editorMachine: StateMachine<
5941
6057
  | {
5942
6058
  type: 'decorator.add'
5943
6059
  decorator: string
6060
+ selection?: NonNullable<EditorSelection>
5944
6061
  }
5945
6062
  | {
5946
6063
  type: 'decorator.remove'
@@ -5974,6 +6091,12 @@ declare const editorMachine: StateMachine<
5974
6091
  | {
5975
6092
  type: 'focus'
5976
6093
  }
6094
+ | {
6095
+ type: 'history.redo'
6096
+ }
6097
+ | {
6098
+ type: 'history.undo'
6099
+ }
5977
6100
  | {
5978
6101
  type: 'insert.blocks'
5979
6102
  blocks: Array<PortableTextBlock>
@@ -6235,6 +6358,7 @@ declare const editorMachine: StateMachine<
6235
6358
  | {
6236
6359
  type: 'decorator.add'
6237
6360
  decorator: string
6361
+ selection?: NonNullable<EditorSelection>
6238
6362
  }
6239
6363
  | {
6240
6364
  type: 'decorator.remove'
@@ -6268,6 +6392,12 @@ declare const editorMachine: StateMachine<
6268
6392
  | {
6269
6393
  type: 'focus'
6270
6394
  }
6395
+ | {
6396
+ type: 'history.redo'
6397
+ }
6398
+ | {
6399
+ type: 'history.undo'
6400
+ }
6271
6401
  | {
6272
6402
  type: 'insert.blocks'
6273
6403
  blocks: Array<PortableTextBlock>
@@ -6582,6 +6712,7 @@ declare const editorMachine: StateMachine<
6582
6712
  | {
6583
6713
  type: 'decorator.add'
6584
6714
  decorator: string
6715
+ selection?: NonNullable<EditorSelection>
6585
6716
  }
6586
6717
  | {
6587
6718
  type: 'decorator.remove'
@@ -6615,6 +6746,12 @@ declare const editorMachine: StateMachine<
6615
6746
  | {
6616
6747
  type: 'focus'
6617
6748
  }
6749
+ | {
6750
+ type: 'history.redo'
6751
+ }
6752
+ | {
6753
+ type: 'history.undo'
6754
+ }
6618
6755
  | {
6619
6756
  type: 'insert.blocks'
6620
6757
  blocks: Array<PortableTextBlock>
@@ -6874,6 +7011,7 @@ declare const editorMachine: StateMachine<
6874
7011
  | {
6875
7012
  type: 'decorator.add'
6876
7013
  decorator: string
7014
+ selection?: NonNullable<EditorSelection>
6877
7015
  }
6878
7016
  | {
6879
7017
  type: 'decorator.remove'
@@ -6907,6 +7045,12 @@ declare const editorMachine: StateMachine<
6907
7045
  | {
6908
7046
  type: 'focus'
6909
7047
  }
7048
+ | {
7049
+ type: 'history.redo'
7050
+ }
7051
+ | {
7052
+ type: 'history.undo'
7053
+ }
6910
7054
  | {
6911
7055
  type: 'insert.blocks'
6912
7056
  blocks: Array<PortableTextBlock>
@@ -7221,6 +7365,7 @@ declare const editorMachine: StateMachine<
7221
7365
  | {
7222
7366
  type: 'decorator.add'
7223
7367
  decorator: string
7368
+ selection?: NonNullable<EditorSelection>
7224
7369
  }
7225
7370
  | {
7226
7371
  type: 'decorator.remove'
@@ -7254,6 +7399,12 @@ declare const editorMachine: StateMachine<
7254
7399
  | {
7255
7400
  type: 'focus'
7256
7401
  }
7402
+ | {
7403
+ type: 'history.redo'
7404
+ }
7405
+ | {
7406
+ type: 'history.undo'
7407
+ }
7257
7408
  | {
7258
7409
  type: 'insert.blocks'
7259
7410
  blocks: Array<PortableTextBlock>
@@ -7514,6 +7665,7 @@ declare const editorMachine: StateMachine<
7514
7665
  | {
7515
7666
  type: 'decorator.add'
7516
7667
  decorator: string
7668
+ selection?: NonNullable<EditorSelection>
7517
7669
  }
7518
7670
  | {
7519
7671
  type: 'decorator.remove'
@@ -7547,6 +7699,12 @@ declare const editorMachine: StateMachine<
7547
7699
  | {
7548
7700
  type: 'focus'
7549
7701
  }
7702
+ | {
7703
+ type: 'history.redo'
7704
+ }
7705
+ | {
7706
+ type: 'history.undo'
7707
+ }
7550
7708
  | {
7551
7709
  type: 'insert.blocks'
7552
7710
  blocks: Array<PortableTextBlock>
@@ -7861,6 +8019,7 @@ declare const editorMachine: StateMachine<
7861
8019
  | {
7862
8020
  type: 'decorator.add'
7863
8021
  decorator: string
8022
+ selection?: NonNullable<EditorSelection>
7864
8023
  }
7865
8024
  | {
7866
8025
  type: 'decorator.remove'
@@ -7894,6 +8053,12 @@ declare const editorMachine: StateMachine<
7894
8053
  | {
7895
8054
  type: 'focus'
7896
8055
  }
8056
+ | {
8057
+ type: 'history.redo'
8058
+ }
8059
+ | {
8060
+ type: 'history.undo'
8061
+ }
7897
8062
  | {
7898
8063
  type: 'insert.blocks'
7899
8064
  blocks: Array<PortableTextBlock>
@@ -8157,6 +8322,7 @@ declare const editorMachine: StateMachine<
8157
8322
  | {
8158
8323
  type: 'decorator.add'
8159
8324
  decorator: string
8325
+ selection?: NonNullable<EditorSelection>
8160
8326
  }
8161
8327
  | {
8162
8328
  type: 'decorator.remove'
@@ -8190,6 +8356,12 @@ declare const editorMachine: StateMachine<
8190
8356
  | {
8191
8357
  type: 'focus'
8192
8358
  }
8359
+ | {
8360
+ type: 'history.redo'
8361
+ }
8362
+ | {
8363
+ type: 'history.undo'
8364
+ }
8193
8365
  | {
8194
8366
  type: 'insert.blocks'
8195
8367
  blocks: Array<PortableTextBlock>
@@ -8504,6 +8676,7 @@ declare const editorMachine: StateMachine<
8504
8676
  | {
8505
8677
  type: 'decorator.add'
8506
8678
  decorator: string
8679
+ selection?: NonNullable<EditorSelection>
8507
8680
  }
8508
8681
  | {
8509
8682
  type: 'decorator.remove'
@@ -8537,6 +8710,12 @@ declare const editorMachine: StateMachine<
8537
8710
  | {
8538
8711
  type: 'focus'
8539
8712
  }
8713
+ | {
8714
+ type: 'history.redo'
8715
+ }
8716
+ | {
8717
+ type: 'history.undo'
8718
+ }
8540
8719
  | {
8541
8720
  type: 'insert.blocks'
8542
8721
  blocks: Array<PortableTextBlock>
@@ -8800,6 +8979,7 @@ declare const editorMachine: StateMachine<
8800
8979
  | {
8801
8980
  type: 'decorator.add'
8802
8981
  decorator: string
8982
+ selection?: NonNullable<EditorSelection>
8803
8983
  }
8804
8984
  | {
8805
8985
  type: 'decorator.remove'
@@ -8833,6 +9013,12 @@ declare const editorMachine: StateMachine<
8833
9013
  | {
8834
9014
  type: 'focus'
8835
9015
  }
9016
+ | {
9017
+ type: 'history.redo'
9018
+ }
9019
+ | {
9020
+ type: 'history.undo'
9021
+ }
8836
9022
  | {
8837
9023
  type: 'insert.blocks'
8838
9024
  blocks: Array<PortableTextBlock>
@@ -9170,6 +9356,7 @@ declare const editorMachine: StateMachine<
9170
9356
  | {
9171
9357
  type: 'decorator.add'
9172
9358
  decorator: string
9359
+ selection?: NonNullable<EditorSelection>
9173
9360
  }
9174
9361
  | {
9175
9362
  type: 'decorator.remove'
@@ -9203,6 +9390,12 @@ declare const editorMachine: StateMachine<
9203
9390
  | {
9204
9391
  type: 'focus'
9205
9392
  }
9393
+ | {
9394
+ type: 'history.redo'
9395
+ }
9396
+ | {
9397
+ type: 'history.undo'
9398
+ }
9206
9399
  | {
9207
9400
  type: 'insert.blocks'
9208
9401
  blocks: Array<PortableTextBlock>
@@ -9537,6 +9730,7 @@ declare const editorMachine: StateMachine<
9537
9730
  | {
9538
9731
  type: 'decorator.add'
9539
9732
  decorator: string
9733
+ selection?: NonNullable<EditorSelection>
9540
9734
  }
9541
9735
  | {
9542
9736
  type: 'decorator.remove'
@@ -9570,6 +9764,12 @@ declare const editorMachine: StateMachine<
9570
9764
  | {
9571
9765
  type: 'focus'
9572
9766
  }
9767
+ | {
9768
+ type: 'history.redo'
9769
+ }
9770
+ | {
9771
+ type: 'history.undo'
9772
+ }
9573
9773
  | {
9574
9774
  type: 'insert.blocks'
9575
9775
  blocks: Array<PortableTextBlock>
@@ -10052,6 +10252,7 @@ declare const editorMachine: StateMachine<
10052
10252
  | {
10053
10253
  type: 'decorator.add'
10054
10254
  decorator: string
10255
+ selection?: NonNullable<EditorSelection>
10055
10256
  }
10056
10257
  | {
10057
10258
  type: 'decorator.remove'
@@ -10085,6 +10286,12 @@ declare const editorMachine: StateMachine<
10085
10286
  | {
10086
10287
  type: 'focus'
10087
10288
  }
10289
+ | {
10290
+ type: 'history.redo'
10291
+ }
10292
+ | {
10293
+ type: 'history.undo'
10294
+ }
10088
10295
  | {
10089
10296
  type: 'insert.blocks'
10090
10297
  blocks: Array<PortableTextBlock>
@@ -10401,6 +10608,7 @@ declare const editorMachine: StateMachine<
10401
10608
  | {
10402
10609
  type: 'decorator.add'
10403
10610
  decorator: string
10611
+ selection?: NonNullable<EditorSelection>
10404
10612
  }
10405
10613
  | {
10406
10614
  type: 'decorator.remove'
@@ -10434,6 +10642,12 @@ declare const editorMachine: StateMachine<
10434
10642
  | {
10435
10643
  type: 'focus'
10436
10644
  }
10645
+ | {
10646
+ type: 'history.redo'
10647
+ }
10648
+ | {
10649
+ type: 'history.undo'
10650
+ }
10437
10651
  | {
10438
10652
  type: 'insert.blocks'
10439
10653
  blocks: Array<PortableTextBlock>
@@ -10700,6 +10914,7 @@ declare const editorMachine: StateMachine<
10700
10914
  | {
10701
10915
  type: 'decorator.add'
10702
10916
  decorator: string
10917
+ selection?: NonNullable<EditorSelection>
10703
10918
  }
10704
10919
  | {
10705
10920
  type: 'decorator.remove'
@@ -10733,6 +10948,12 @@ declare const editorMachine: StateMachine<
10733
10948
  | {
10734
10949
  type: 'focus'
10735
10950
  }
10951
+ | {
10952
+ type: 'history.redo'
10953
+ }
10954
+ | {
10955
+ type: 'history.undo'
10956
+ }
10736
10957
  | {
10737
10958
  type: 'insert.blocks'
10738
10959
  blocks: Array<PortableTextBlock>
@@ -11049,6 +11270,7 @@ declare const editorMachine: StateMachine<
11049
11270
  | {
11050
11271
  type: 'decorator.add'
11051
11272
  decorator: string
11273
+ selection?: NonNullable<EditorSelection>
11052
11274
  }
11053
11275
  | {
11054
11276
  type: 'decorator.remove'
@@ -11082,6 +11304,12 @@ declare const editorMachine: StateMachine<
11082
11304
  | {
11083
11305
  type: 'focus'
11084
11306
  }
11307
+ | {
11308
+ type: 'history.redo'
11309
+ }
11310
+ | {
11311
+ type: 'history.undo'
11312
+ }
11085
11313
  | {
11086
11314
  type: 'insert.blocks'
11087
11315
  blocks: Array<PortableTextBlock>
@@ -11341,6 +11569,7 @@ declare const editorMachine: StateMachine<
11341
11569
  | {
11342
11570
  type: 'decorator.add'
11343
11571
  decorator: string
11572
+ selection?: NonNullable<EditorSelection>
11344
11573
  }
11345
11574
  | {
11346
11575
  type: 'decorator.remove'
@@ -11374,6 +11603,12 @@ declare const editorMachine: StateMachine<
11374
11603
  | {
11375
11604
  type: 'focus'
11376
11605
  }
11606
+ | {
11607
+ type: 'history.redo'
11608
+ }
11609
+ | {
11610
+ type: 'history.undo'
11611
+ }
11377
11612
  | {
11378
11613
  type: 'insert.blocks'
11379
11614
  blocks: Array<PortableTextBlock>
@@ -11690,6 +11925,7 @@ declare const editorMachine: StateMachine<
11690
11925
  | {
11691
11926
  type: 'decorator.add'
11692
11927
  decorator: string
11928
+ selection?: NonNullable<EditorSelection>
11693
11929
  }
11694
11930
  | {
11695
11931
  type: 'decorator.remove'
@@ -11723,6 +11959,12 @@ declare const editorMachine: StateMachine<
11723
11959
  | {
11724
11960
  type: 'focus'
11725
11961
  }
11962
+ | {
11963
+ type: 'history.redo'
11964
+ }
11965
+ | {
11966
+ type: 'history.undo'
11967
+ }
11726
11968
  | {
11727
11969
  type: 'insert.blocks'
11728
11970
  blocks: Array<PortableTextBlock>
@@ -11982,6 +12224,7 @@ declare const editorMachine: StateMachine<
11982
12224
  | {
11983
12225
  type: 'decorator.add'
11984
12226
  decorator: string
12227
+ selection?: NonNullable<EditorSelection>
11985
12228
  }
11986
12229
  | {
11987
12230
  type: 'decorator.remove'
@@ -12015,6 +12258,12 @@ declare const editorMachine: StateMachine<
12015
12258
  | {
12016
12259
  type: 'focus'
12017
12260
  }
12261
+ | {
12262
+ type: 'history.redo'
12263
+ }
12264
+ | {
12265
+ type: 'history.undo'
12266
+ }
12018
12267
  | {
12019
12268
  type: 'insert.blocks'
12020
12269
  blocks: Array<PortableTextBlock>
@@ -12331,6 +12580,7 @@ declare const editorMachine: StateMachine<
12331
12580
  | {
12332
12581
  type: 'decorator.add'
12333
12582
  decorator: string
12583
+ selection?: NonNullable<EditorSelection>
12334
12584
  }
12335
12585
  | {
12336
12586
  type: 'decorator.remove'
@@ -12364,6 +12614,12 @@ declare const editorMachine: StateMachine<
12364
12614
  | {
12365
12615
  type: 'focus'
12366
12616
  }
12617
+ | {
12618
+ type: 'history.redo'
12619
+ }
12620
+ | {
12621
+ type: 'history.undo'
12622
+ }
12367
12623
  | {
12368
12624
  type: 'insert.blocks'
12369
12625
  blocks: Array<PortableTextBlock>
@@ -12577,6 +12833,7 @@ declare const editorMachine: StateMachine<
12577
12833
  | {
12578
12834
  type: 'decorator.add'
12579
12835
  decorator: string
12836
+ selection?: NonNullable<EditorSelection>
12580
12837
  }
12581
12838
  | {
12582
12839
  type: 'decorator.remove'
@@ -12632,6 +12889,7 @@ declare const editorMachine: StateMachine<
12632
12889
  | {
12633
12890
  type: 'decorator.add'
12634
12891
  decorator: string
12892
+ selection?: NonNullable<EditorSelection>
12635
12893
  }
12636
12894
  | {
12637
12895
  type: 'decorator.remove'
@@ -12665,6 +12923,12 @@ declare const editorMachine: StateMachine<
12665
12923
  | {
12666
12924
  type: 'focus'
12667
12925
  }
12926
+ | {
12927
+ type: 'history.redo'
12928
+ }
12929
+ | {
12930
+ type: 'history.undo'
12931
+ }
12668
12932
  | {
12669
12933
  type: 'insert.blocks'
12670
12934
  blocks: Array<PortableTextBlock>
@@ -12981,6 +13245,7 @@ declare const editorMachine: StateMachine<
12981
13245
  | {
12982
13246
  type: 'decorator.add'
12983
13247
  decorator: string
13248
+ selection?: NonNullable<EditorSelection>
12984
13249
  }
12985
13250
  | {
12986
13251
  type: 'decorator.remove'
@@ -13014,6 +13279,12 @@ declare const editorMachine: StateMachine<
13014
13279
  | {
13015
13280
  type: 'focus'
13016
13281
  }
13282
+ | {
13283
+ type: 'history.redo'
13284
+ }
13285
+ | {
13286
+ type: 'history.undo'
13287
+ }
13017
13288
  | {
13018
13289
  type: 'insert.blocks'
13019
13290
  blocks: Array<PortableTextBlock>
@@ -13287,6 +13558,7 @@ declare const editorMachine: StateMachine<
13287
13558
  | {
13288
13559
  type: 'decorator.add'
13289
13560
  decorator: string
13561
+ selection?: NonNullable<EditorSelection>
13290
13562
  }
13291
13563
  | {
13292
13564
  type: 'decorator.remove'
@@ -13320,6 +13592,12 @@ declare const editorMachine: StateMachine<
13320
13592
  | {
13321
13593
  type: 'focus'
13322
13594
  }
13595
+ | {
13596
+ type: 'history.redo'
13597
+ }
13598
+ | {
13599
+ type: 'history.undo'
13600
+ }
13323
13601
  | {
13324
13602
  type: 'insert.blocks'
13325
13603
  blocks: Array<PortableTextBlock>
@@ -13636,6 +13914,7 @@ declare const editorMachine: StateMachine<
13636
13914
  | {
13637
13915
  type: 'decorator.add'
13638
13916
  decorator: string
13917
+ selection?: NonNullable<EditorSelection>
13639
13918
  }
13640
13919
  | {
13641
13920
  type: 'decorator.remove'
@@ -13669,6 +13948,12 @@ declare const editorMachine: StateMachine<
13669
13948
  | {
13670
13949
  type: 'focus'
13671
13950
  }
13951
+ | {
13952
+ type: 'history.redo'
13953
+ }
13954
+ | {
13955
+ type: 'history.undo'
13956
+ }
13672
13957
  | {
13673
13958
  type: 'insert.blocks'
13674
13959
  blocks: Array<PortableTextBlock>
@@ -13928,6 +14213,7 @@ declare const editorMachine: StateMachine<
13928
14213
  | {
13929
14214
  type: 'decorator.add'
13930
14215
  decorator: string
14216
+ selection?: NonNullable<EditorSelection>
13931
14217
  }
13932
14218
  | {
13933
14219
  type: 'decorator.remove'
@@ -13961,6 +14247,12 @@ declare const editorMachine: StateMachine<
13961
14247
  | {
13962
14248
  type: 'focus'
13963
14249
  }
14250
+ | {
14251
+ type: 'history.redo'
14252
+ }
14253
+ | {
14254
+ type: 'history.undo'
14255
+ }
13964
14256
  | {
13965
14257
  type: 'insert.blocks'
13966
14258
  blocks: Array<PortableTextBlock>
@@ -14277,6 +14569,7 @@ declare const editorMachine: StateMachine<
14277
14569
  | {
14278
14570
  type: 'decorator.add'
14279
14571
  decorator: string
14572
+ selection?: NonNullable<EditorSelection>
14280
14573
  }
14281
14574
  | {
14282
14575
  type: 'decorator.remove'
@@ -14310,6 +14603,12 @@ declare const editorMachine: StateMachine<
14310
14603
  | {
14311
14604
  type: 'focus'
14312
14605
  }
14606
+ | {
14607
+ type: 'history.redo'
14608
+ }
14609
+ | {
14610
+ type: 'history.undo'
14611
+ }
14313
14612
  | {
14314
14613
  type: 'insert.blocks'
14315
14614
  blocks: Array<PortableTextBlock>
@@ -14507,7 +14806,7 @@ declare const editorMachine: StateMachine<
14507
14806
  }
14508
14807
  >
14509
14808
  }
14510
- readonly 'insert.*': {
14809
+ readonly 'history.*': {
14511
14810
  readonly actions: ActionFunction<
14512
14811
  {
14513
14812
  behaviors: Set<Behavior>
@@ -14521,61 +14820,10 @@ declare const editorMachine: StateMachine<
14521
14820
  value: Array<PortableTextBlock> | undefined
14522
14821
  },
14523
14822
  | {
14524
- type: 'insert.blocks'
14525
- blocks: Array<PortableTextBlock>
14526
- }
14527
- | {
14528
- type: 'insert.block object'
14529
- placement: 'auto' | 'after' | 'before'
14530
- blockObject: {
14531
- name: string
14532
- value?: {
14533
- [prop: string]: unknown
14534
- }
14535
- }
14536
- }
14537
- | {
14538
- type: 'insert.inline object'
14539
- inlineObject: {
14540
- name: string
14541
- value?: {
14542
- [prop: string]: unknown
14543
- }
14544
- }
14545
- }
14546
- | {
14547
- type: 'insert.break'
14548
- }
14549
- | {
14550
- type: 'insert.soft break'
14551
- }
14552
- | {
14553
- type: 'insert.block'
14554
- block: PortableTextBlock
14555
- placement: 'auto' | 'after' | 'before'
14556
- }
14557
- | {
14558
- type: 'insert.span'
14559
- text: string
14560
- annotations?: Array<{
14561
- name: string
14562
- value: {
14563
- [prop: string]: unknown
14564
- }
14565
- }>
14566
- decorators?: Array<string>
14567
- }
14568
- | {
14569
- type: 'insert.text'
14570
- text: string
14571
- options?: TextInsertTextOptions
14823
+ type: 'history.redo'
14572
14824
  }
14573
14825
  | {
14574
- type: 'insert.text block'
14575
- placement: 'auto' | 'after' | 'before'
14576
- textBlock?: {
14577
- children?: PortableTextTextBlock['children']
14578
- }
14826
+ type: 'history.undo'
14579
14827
  },
14580
14828
  | {
14581
14829
  type: 'annotation.add'
@@ -14623,6 +14871,7 @@ declare const editorMachine: StateMachine<
14623
14871
  | {
14624
14872
  type: 'decorator.add'
14625
14873
  decorator: string
14874
+ selection?: NonNullable<EditorSelection>
14626
14875
  }
14627
14876
  | {
14628
14877
  type: 'decorator.remove'
@@ -14656,6 +14905,12 @@ declare const editorMachine: StateMachine<
14656
14905
  | {
14657
14906
  type: 'focus'
14658
14907
  }
14908
+ | {
14909
+ type: 'history.redo'
14910
+ }
14911
+ | {
14912
+ type: 'history.undo'
14913
+ }
14659
14914
  | {
14660
14915
  type: 'insert.blocks'
14661
14916
  blocks: Array<PortableTextBlock>
@@ -14972,6 +15227,7 @@ declare const editorMachine: StateMachine<
14972
15227
  | {
14973
15228
  type: 'decorator.add'
14974
15229
  decorator: string
15230
+ selection?: NonNullable<EditorSelection>
14975
15231
  }
14976
15232
  | {
14977
15233
  type: 'decorator.remove'
@@ -15005,6 +15261,12 @@ declare const editorMachine: StateMachine<
15005
15261
  | {
15006
15262
  type: 'focus'
15007
15263
  }
15264
+ | {
15265
+ type: 'history.redo'
15266
+ }
15267
+ | {
15268
+ type: 'history.undo'
15269
+ }
15008
15270
  | {
15009
15271
  type: 'insert.blocks'
15010
15272
  blocks: Array<PortableTextBlock>
@@ -15202,7 +15464,7 @@ declare const editorMachine: StateMachine<
15202
15464
  }
15203
15465
  >
15204
15466
  }
15205
- readonly 'list item.*': {
15467
+ readonly 'insert.*': {
15206
15468
  readonly actions: ActionFunction<
15207
15469
  {
15208
15470
  behaviors: Set<Behavior>
@@ -15216,22 +15478,731 @@ declare const editorMachine: StateMachine<
15216
15478
  value: Array<PortableTextBlock> | undefined
15217
15479
  },
15218
15480
  | {
15219
- type: 'list item.add'
15220
- listItem: string
15481
+ type: 'insert.blocks'
15482
+ blocks: Array<PortableTextBlock>
15221
15483
  }
15222
15484
  | {
15223
- type: 'list item.remove'
15224
- listItem: string
15485
+ type: 'insert.block object'
15486
+ placement: 'auto' | 'after' | 'before'
15487
+ blockObject: {
15488
+ name: string
15489
+ value?: {
15490
+ [prop: string]: unknown
15491
+ }
15492
+ }
15225
15493
  }
15226
15494
  | {
15227
- type: 'list item.toggle'
15228
- listItem: string
15229
- },
15230
- | {
15231
- type: 'annotation.add'
15232
- annotation: {
15495
+ type: 'insert.inline object'
15496
+ inlineObject: {
15233
15497
  name: string
15234
- value: {
15498
+ value?: {
15499
+ [prop: string]: unknown
15500
+ }
15501
+ }
15502
+ }
15503
+ | {
15504
+ type: 'insert.break'
15505
+ }
15506
+ | {
15507
+ type: 'insert.soft break'
15508
+ }
15509
+ | {
15510
+ type: 'insert.block'
15511
+ block: PortableTextBlock
15512
+ placement: 'auto' | 'after' | 'before'
15513
+ }
15514
+ | {
15515
+ type: 'insert.span'
15516
+ text: string
15517
+ annotations?: Array<{
15518
+ name: string
15519
+ value: {
15520
+ [prop: string]: unknown
15521
+ }
15522
+ }>
15523
+ decorators?: Array<string>
15524
+ }
15525
+ | {
15526
+ type: 'insert.text'
15527
+ text: string
15528
+ options?: TextInsertTextOptions
15529
+ }
15530
+ | {
15531
+ type: 'insert.text block'
15532
+ placement: 'auto' | 'after' | 'before'
15533
+ textBlock?: {
15534
+ children?: PortableTextTextBlock['children']
15535
+ }
15536
+ },
15537
+ | {
15538
+ type: 'annotation.add'
15539
+ annotation: {
15540
+ name: string
15541
+ value: {
15542
+ [prop: string]: unknown
15543
+ }
15544
+ }
15545
+ }
15546
+ | {
15547
+ type: 'annotation.remove'
15548
+ annotation: {
15549
+ name: string
15550
+ }
15551
+ }
15552
+ | {
15553
+ type: 'annotation.toggle'
15554
+ annotation: {
15555
+ name: string
15556
+ value: {
15557
+ [prop: string]: unknown
15558
+ }
15559
+ }
15560
+ }
15561
+ | {
15562
+ [props: string]: unknown
15563
+ type: 'block.set'
15564
+ at: [KeyedSegment]
15565
+ }
15566
+ | {
15567
+ type: 'block.unset'
15568
+ at: [KeyedSegment]
15569
+ props: Array<string>
15570
+ }
15571
+ | {
15572
+ type: 'blur'
15573
+ }
15574
+ | {
15575
+ type: 'data transfer.set'
15576
+ data: string
15577
+ dataTransfer: DataTransfer
15578
+ mimeType: MIMEType_2
15579
+ }
15580
+ | {
15581
+ type: 'decorator.add'
15582
+ decorator: string
15583
+ selection?: NonNullable<EditorSelection>
15584
+ }
15585
+ | {
15586
+ type: 'decorator.remove'
15587
+ decorator: string
15588
+ }
15589
+ | {
15590
+ type: 'decorator.toggle'
15591
+ decorator: string
15592
+ }
15593
+ | {
15594
+ type: 'delete'
15595
+ selection: NonNullable<EditorSelection>
15596
+ }
15597
+ | {
15598
+ type: 'delete.backward'
15599
+ unit: TextUnit
15600
+ }
15601
+ | {
15602
+ type: 'delete.block'
15603
+ blockPath: [KeyedSegment]
15604
+ }
15605
+ | {
15606
+ type: 'delete.forward'
15607
+ unit: TextUnit
15608
+ }
15609
+ | {
15610
+ type: 'delete.text'
15611
+ anchor: BlockOffset_2
15612
+ focus: BlockOffset_2
15613
+ }
15614
+ | {
15615
+ type: 'focus'
15616
+ }
15617
+ | {
15618
+ type: 'history.redo'
15619
+ }
15620
+ | {
15621
+ type: 'history.undo'
15622
+ }
15623
+ | {
15624
+ type: 'insert.blocks'
15625
+ blocks: Array<PortableTextBlock>
15626
+ }
15627
+ | {
15628
+ type: 'insert.block object'
15629
+ placement: 'auto' | 'after' | 'before'
15630
+ blockObject: {
15631
+ name: string
15632
+ value?: {
15633
+ [prop: string]: unknown
15634
+ }
15635
+ }
15636
+ }
15637
+ | {
15638
+ type: 'insert.inline object'
15639
+ inlineObject: {
15640
+ name: string
15641
+ value?: {
15642
+ [prop: string]: unknown
15643
+ }
15644
+ }
15645
+ }
15646
+ | {
15647
+ type: 'insert.break'
15648
+ }
15649
+ | {
15650
+ type: 'insert.soft break'
15651
+ }
15652
+ | {
15653
+ type: 'insert.block'
15654
+ block: PortableTextBlock
15655
+ placement: 'auto' | 'after' | 'before'
15656
+ }
15657
+ | {
15658
+ type: 'insert.span'
15659
+ text: string
15660
+ annotations?: Array<{
15661
+ name: string
15662
+ value: {
15663
+ [prop: string]: unknown
15664
+ }
15665
+ }>
15666
+ decorators?: Array<string>
15667
+ }
15668
+ | {
15669
+ type: 'insert.text'
15670
+ text: string
15671
+ options?: TextInsertTextOptions
15672
+ }
15673
+ | {
15674
+ type: 'insert.text block'
15675
+ placement: 'auto' | 'after' | 'before'
15676
+ textBlock?: {
15677
+ children?: PortableTextTextBlock['children']
15678
+ }
15679
+ }
15680
+ | {
15681
+ type: 'list item.add'
15682
+ listItem: string
15683
+ }
15684
+ | {
15685
+ type: 'list item.remove'
15686
+ listItem: string
15687
+ }
15688
+ | {
15689
+ type: 'list item.toggle'
15690
+ listItem: string
15691
+ }
15692
+ | {
15693
+ type: 'move.block'
15694
+ at: [KeyedSegment]
15695
+ to: [KeyedSegment]
15696
+ }
15697
+ | {
15698
+ type: 'move.block down'
15699
+ at: [KeyedSegment]
15700
+ }
15701
+ | {
15702
+ type: 'move.block up'
15703
+ at: [KeyedSegment]
15704
+ }
15705
+ | {
15706
+ type: 'select'
15707
+ selection: EditorSelection
15708
+ }
15709
+ | {
15710
+ type: 'select.previous block'
15711
+ }
15712
+ | {
15713
+ type: 'select.next block'
15714
+ }
15715
+ | {
15716
+ type: 'style.add'
15717
+ style: string
15718
+ }
15719
+ | {
15720
+ type: 'style.remove'
15721
+ style: string
15722
+ }
15723
+ | {
15724
+ type: 'style.toggle'
15725
+ style: string
15726
+ }
15727
+ | {
15728
+ type: 'text block.set'
15729
+ at: [KeyedSegment]
15730
+ level?: number
15731
+ listItem?: string
15732
+ style?: string
15733
+ }
15734
+ | {
15735
+ type: 'text block.unset'
15736
+ at: [KeyedSegment]
15737
+ props: Array<'level' | 'listItem' | 'style'>
15738
+ }
15739
+ | ({
15740
+ type: 'serialization.failure'
15741
+ mimeType: `${string}/${string}`
15742
+ reason: string
15743
+ } & {
15744
+ dataTransfer: DataTransfer
15745
+ })
15746
+ | ({
15747
+ type: 'serialization.success'
15748
+ data: string
15749
+ mimeType: `${string}/${string}`
15750
+ originEvent: 'copy' | 'cut' | 'unknown'
15751
+ } & {
15752
+ dataTransfer: DataTransfer
15753
+ })
15754
+ | ({
15755
+ type: 'deserialization.failure'
15756
+ mimeType: `${string}/${string}`
15757
+ reason: string
15758
+ } & {
15759
+ dataTransfer: DataTransfer
15760
+ })
15761
+ | ({
15762
+ type: 'deserialization.success'
15763
+ data: Array<PortableTextBlock>
15764
+ mimeType: `${string}/${string}`
15765
+ } & {
15766
+ dataTransfer: DataTransfer
15767
+ })
15768
+ | PatchEvent
15769
+ | MutationEvent
15770
+ | {
15771
+ type: 'normalizing'
15772
+ }
15773
+ | {
15774
+ type: 'done normalizing'
15775
+ }
15776
+ | {
15777
+ type: 'done syncing initial value'
15778
+ }
15779
+ | {
15780
+ type: 'behavior event'
15781
+ behaviorEvent:
15782
+ | SyntheticBehaviorEvent
15783
+ | NativeBehaviorEvent
15784
+ editor: PortableTextSlateEditor
15785
+ defaultActionCallback?: () => void
15786
+ nativeEvent?: {
15787
+ preventDefault: () => void
15788
+ }
15789
+ }
15790
+ | {
15791
+ type: 'custom behavior event'
15792
+ behaviorEvent: CustomBehaviorEvent
15793
+ editor: PortableTextSlateEditor
15794
+ nativeEvent?: {
15795
+ preventDefault: () => void
15796
+ }
15797
+ }
15798
+ | CustomBehaviorEvent
15799
+ | {
15800
+ type: 'add behavior'
15801
+ behavior: Behavior
15802
+ }
15803
+ | {
15804
+ type: 'remove behavior'
15805
+ behavior: Behavior
15806
+ }
15807
+ | {
15808
+ type: 'update readOnly'
15809
+ readOnly: boolean
15810
+ }
15811
+ | {
15812
+ type: 'update schema'
15813
+ schema: EditorSchema
15814
+ }
15815
+ | {
15816
+ type: 'update behaviors'
15817
+ behaviors: Array<Behavior>
15818
+ }
15819
+ | {
15820
+ type: 'update key generator'
15821
+ keyGenerator: () => string
15822
+ }
15823
+ | {
15824
+ type: 'update value'
15825
+ value: Array<PortableTextBlock> | undefined
15826
+ }
15827
+ | {
15828
+ type: 'update maxBlocks'
15829
+ maxBlocks: number | undefined
15830
+ }
15831
+ | PatchesEvent
15832
+ | {
15833
+ type: 'notify.patch'
15834
+ patch: Patch
15835
+ }
15836
+ | {
15837
+ type: 'notify.mutation'
15838
+ patches: Array<Patch>
15839
+ snapshot: Array<PortableTextBlock> | undefined
15840
+ value: Array<PortableTextBlock> | undefined
15841
+ }
15842
+ | {
15843
+ type: 'notify.blurred'
15844
+ event: FocusEvent_2<HTMLDivElement, Element>
15845
+ }
15846
+ | {
15847
+ type: 'notify.done loading'
15848
+ }
15849
+ | {
15850
+ type: 'notify.editable'
15851
+ }
15852
+ | {
15853
+ type: 'notify.error'
15854
+ name: string
15855
+ description: string
15856
+ data: unknown
15857
+ }
15858
+ | {
15859
+ type: 'notify.focused'
15860
+ event: FocusEvent_2<HTMLDivElement, Element>
15861
+ }
15862
+ | {
15863
+ type: 'notify.invalid value'
15864
+ resolution: InvalidValueResolution | null
15865
+ value: Array<PortableTextBlock> | undefined
15866
+ }
15867
+ | {
15868
+ type: 'notify.loading'
15869
+ }
15870
+ | {
15871
+ type: 'notify.read only'
15872
+ }
15873
+ | {
15874
+ type: 'notify.ready'
15875
+ }
15876
+ | {
15877
+ type: 'notify.selection'
15878
+ selection: EditorSelection
15879
+ }
15880
+ | {
15881
+ type: 'notify.value changed'
15882
+ value: Array<PortableTextBlock> | undefined
15883
+ }
15884
+ | {
15885
+ type: 'notify.unset'
15886
+ previousValue: Array<PortableTextBlock>
15887
+ },
15888
+ undefined,
15889
+ never,
15890
+ never,
15891
+ never,
15892
+ never,
15893
+ | {
15894
+ type: 'annotation.add'
15895
+ annotation: {
15896
+ name: string
15897
+ value: {
15898
+ [prop: string]: unknown
15899
+ }
15900
+ }
15901
+ }
15902
+ | {
15903
+ type: 'annotation.remove'
15904
+ annotation: {
15905
+ name: string
15906
+ }
15907
+ }
15908
+ | {
15909
+ type: 'annotation.toggle'
15910
+ annotation: {
15911
+ name: string
15912
+ value: {
15913
+ [prop: string]: unknown
15914
+ }
15915
+ }
15916
+ }
15917
+ | {
15918
+ [props: string]: unknown
15919
+ type: 'block.set'
15920
+ at: [KeyedSegment]
15921
+ }
15922
+ | {
15923
+ type: 'block.unset'
15924
+ at: [KeyedSegment]
15925
+ props: Array<string>
15926
+ }
15927
+ | {
15928
+ type: 'blur'
15929
+ }
15930
+ | {
15931
+ type: 'data transfer.set'
15932
+ data: string
15933
+ dataTransfer: DataTransfer
15934
+ mimeType: MIMEType_2
15935
+ }
15936
+ | {
15937
+ type: 'decorator.add'
15938
+ decorator: string
15939
+ selection?: NonNullable<EditorSelection>
15940
+ }
15941
+ | {
15942
+ type: 'decorator.remove'
15943
+ decorator: string
15944
+ }
15945
+ | {
15946
+ type: 'decorator.toggle'
15947
+ decorator: string
15948
+ }
15949
+ | {
15950
+ type: 'delete'
15951
+ selection: NonNullable<EditorSelection>
15952
+ }
15953
+ | {
15954
+ type: 'delete.backward'
15955
+ unit: TextUnit
15956
+ }
15957
+ | {
15958
+ type: 'delete.block'
15959
+ blockPath: [KeyedSegment]
15960
+ }
15961
+ | {
15962
+ type: 'delete.forward'
15963
+ unit: TextUnit
15964
+ }
15965
+ | {
15966
+ type: 'delete.text'
15967
+ anchor: BlockOffset_2
15968
+ focus: BlockOffset_2
15969
+ }
15970
+ | {
15971
+ type: 'focus'
15972
+ }
15973
+ | {
15974
+ type: 'history.redo'
15975
+ }
15976
+ | {
15977
+ type: 'history.undo'
15978
+ }
15979
+ | {
15980
+ type: 'insert.blocks'
15981
+ blocks: Array<PortableTextBlock>
15982
+ }
15983
+ | {
15984
+ type: 'insert.block object'
15985
+ placement: 'auto' | 'after' | 'before'
15986
+ blockObject: {
15987
+ name: string
15988
+ value?: {
15989
+ [prop: string]: unknown
15990
+ }
15991
+ }
15992
+ }
15993
+ | {
15994
+ type: 'insert.inline object'
15995
+ inlineObject: {
15996
+ name: string
15997
+ value?: {
15998
+ [prop: string]: unknown
15999
+ }
16000
+ }
16001
+ }
16002
+ | {
16003
+ type: 'insert.break'
16004
+ }
16005
+ | {
16006
+ type: 'insert.soft break'
16007
+ }
16008
+ | {
16009
+ type: 'insert.block'
16010
+ block: PortableTextBlock
16011
+ placement: 'auto' | 'after' | 'before'
16012
+ }
16013
+ | {
16014
+ type: 'insert.span'
16015
+ text: string
16016
+ annotations?: Array<{
16017
+ name: string
16018
+ value: {
16019
+ [prop: string]: unknown
16020
+ }
16021
+ }>
16022
+ decorators?: Array<string>
16023
+ }
16024
+ | {
16025
+ type: 'insert.text'
16026
+ text: string
16027
+ options?: TextInsertTextOptions
16028
+ }
16029
+ | {
16030
+ type: 'insert.text block'
16031
+ placement: 'auto' | 'after' | 'before'
16032
+ textBlock?: {
16033
+ children?: PortableTextTextBlock['children']
16034
+ }
16035
+ }
16036
+ | {
16037
+ type: 'list item.add'
16038
+ listItem: string
16039
+ }
16040
+ | {
16041
+ type: 'list item.remove'
16042
+ listItem: string
16043
+ }
16044
+ | {
16045
+ type: 'list item.toggle'
16046
+ listItem: string
16047
+ }
16048
+ | {
16049
+ type: 'move.block'
16050
+ at: [KeyedSegment]
16051
+ to: [KeyedSegment]
16052
+ }
16053
+ | {
16054
+ type: 'move.block down'
16055
+ at: [KeyedSegment]
16056
+ }
16057
+ | {
16058
+ type: 'move.block up'
16059
+ at: [KeyedSegment]
16060
+ }
16061
+ | {
16062
+ type: 'select'
16063
+ selection: EditorSelection
16064
+ }
16065
+ | {
16066
+ type: 'select.previous block'
16067
+ }
16068
+ | {
16069
+ type: 'select.next block'
16070
+ }
16071
+ | {
16072
+ type: 'style.add'
16073
+ style: string
16074
+ }
16075
+ | {
16076
+ type: 'style.remove'
16077
+ style: string
16078
+ }
16079
+ | {
16080
+ type: 'style.toggle'
16081
+ style: string
16082
+ }
16083
+ | {
16084
+ type: 'text block.set'
16085
+ at: [KeyedSegment]
16086
+ level?: number
16087
+ listItem?: string
16088
+ style?: string
16089
+ }
16090
+ | {
16091
+ type: 'text block.unset'
16092
+ at: [KeyedSegment]
16093
+ props: Array<'level' | 'listItem' | 'style'>
16094
+ }
16095
+ | ({
16096
+ type: 'serialization.failure'
16097
+ mimeType: `${string}/${string}`
16098
+ reason: string
16099
+ } & {
16100
+ dataTransfer: DataTransfer
16101
+ })
16102
+ | ({
16103
+ type: 'serialization.success'
16104
+ data: string
16105
+ mimeType: `${string}/${string}`
16106
+ originEvent: 'copy' | 'cut' | 'unknown'
16107
+ } & {
16108
+ dataTransfer: DataTransfer
16109
+ })
16110
+ | ({
16111
+ type: 'deserialization.failure'
16112
+ mimeType: `${string}/${string}`
16113
+ reason: string
16114
+ } & {
16115
+ dataTransfer: DataTransfer
16116
+ })
16117
+ | ({
16118
+ type: 'deserialization.success'
16119
+ data: Array<PortableTextBlock>
16120
+ mimeType: `${string}/${string}`
16121
+ } & {
16122
+ dataTransfer: DataTransfer
16123
+ })
16124
+ | PatchEvent
16125
+ | MutationEvent
16126
+ | PatchesEvent
16127
+ | {
16128
+ type: 'blurred'
16129
+ event: FocusEvent_2<HTMLDivElement, Element>
16130
+ }
16131
+ | {
16132
+ type: 'done loading'
16133
+ }
16134
+ | {
16135
+ type: 'editable'
16136
+ }
16137
+ | {
16138
+ type: 'error'
16139
+ name: string
16140
+ description: string
16141
+ data: unknown
16142
+ }
16143
+ | {
16144
+ type: 'focused'
16145
+ event: FocusEvent_2<HTMLDivElement, Element>
16146
+ }
16147
+ | {
16148
+ type: 'invalid value'
16149
+ resolution: InvalidValueResolution | null
16150
+ value: Array<PortableTextBlock> | undefined
16151
+ }
16152
+ | {
16153
+ type: 'loading'
16154
+ }
16155
+ | {
16156
+ type: 'read only'
16157
+ }
16158
+ | {
16159
+ type: 'ready'
16160
+ }
16161
+ | {
16162
+ type: 'selection'
16163
+ selection: EditorSelection
16164
+ }
16165
+ | {
16166
+ type: 'value changed'
16167
+ value: Array<PortableTextBlock> | undefined
16168
+ }
16169
+ | UnsetEvent
16170
+ | {
16171
+ type: 'custom.*'
16172
+ event: CustomBehaviorEvent
16173
+ }
16174
+ >
16175
+ }
16176
+ readonly 'list item.*': {
16177
+ readonly actions: ActionFunction<
16178
+ {
16179
+ behaviors: Set<Behavior>
16180
+ converters: Set<Converter>
16181
+ keyGenerator: () => string
16182
+ pendingEvents: Array<PatchEvent | MutationEvent>
16183
+ schema: EditorSchema
16184
+ initialReadOnly: boolean
16185
+ maxBlocks: number | undefined
16186
+ selection: EditorSelection
16187
+ value: Array<PortableTextBlock> | undefined
16188
+ },
16189
+ | {
16190
+ type: 'list item.add'
16191
+ listItem: string
16192
+ }
16193
+ | {
16194
+ type: 'list item.remove'
16195
+ listItem: string
16196
+ }
16197
+ | {
16198
+ type: 'list item.toggle'
16199
+ listItem: string
16200
+ },
16201
+ | {
16202
+ type: 'annotation.add'
16203
+ annotation: {
16204
+ name: string
16205
+ value: {
15235
16206
  [prop: string]: unknown
15236
16207
  }
15237
16208
  }
@@ -15273,6 +16244,7 @@ declare const editorMachine: StateMachine<
15273
16244
  | {
15274
16245
  type: 'decorator.add'
15275
16246
  decorator: string
16247
+ selection?: NonNullable<EditorSelection>
15276
16248
  }
15277
16249
  | {
15278
16250
  type: 'decorator.remove'
@@ -15306,6 +16278,12 @@ declare const editorMachine: StateMachine<
15306
16278
  | {
15307
16279
  type: 'focus'
15308
16280
  }
16281
+ | {
16282
+ type: 'history.redo'
16283
+ }
16284
+ | {
16285
+ type: 'history.undo'
16286
+ }
15309
16287
  | {
15310
16288
  type: 'insert.blocks'
15311
16289
  blocks: Array<PortableTextBlock>
@@ -15622,6 +16600,7 @@ declare const editorMachine: StateMachine<
15622
16600
  | {
15623
16601
  type: 'decorator.add'
15624
16602
  decorator: string
16603
+ selection?: NonNullable<EditorSelection>
15625
16604
  }
15626
16605
  | {
15627
16606
  type: 'decorator.remove'
@@ -15655,6 +16634,12 @@ declare const editorMachine: StateMachine<
15655
16634
  | {
15656
16635
  type: 'focus'
15657
16636
  }
16637
+ | {
16638
+ type: 'history.redo'
16639
+ }
16640
+ | {
16641
+ type: 'history.undo'
16642
+ }
15658
16643
  | {
15659
16644
  type: 'insert.blocks'
15660
16645
  blocks: Array<PortableTextBlock>
@@ -15924,6 +16909,7 @@ declare const editorMachine: StateMachine<
15924
16909
  | {
15925
16910
  type: 'decorator.add'
15926
16911
  decorator: string
16912
+ selection?: NonNullable<EditorSelection>
15927
16913
  }
15928
16914
  | {
15929
16915
  type: 'decorator.remove'
@@ -15957,6 +16943,12 @@ declare const editorMachine: StateMachine<
15957
16943
  | {
15958
16944
  type: 'focus'
15959
16945
  }
16946
+ | {
16947
+ type: 'history.redo'
16948
+ }
16949
+ | {
16950
+ type: 'history.undo'
16951
+ }
15960
16952
  | {
15961
16953
  type: 'insert.blocks'
15962
16954
  blocks: Array<PortableTextBlock>
@@ -16273,6 +17265,7 @@ declare const editorMachine: StateMachine<
16273
17265
  | {
16274
17266
  type: 'decorator.add'
16275
17267
  decorator: string
17268
+ selection?: NonNullable<EditorSelection>
16276
17269
  }
16277
17270
  | {
16278
17271
  type: 'decorator.remove'
@@ -16306,6 +17299,12 @@ declare const editorMachine: StateMachine<
16306
17299
  | {
16307
17300
  type: 'focus'
16308
17301
  }
17302
+ | {
17303
+ type: 'history.redo'
17304
+ }
17305
+ | {
17306
+ type: 'history.undo'
17307
+ }
16309
17308
  | {
16310
17309
  type: 'insert.blocks'
16311
17310
  blocks: Array<PortableTextBlock>
@@ -16566,6 +17565,7 @@ declare const editorMachine: StateMachine<
16566
17565
  | {
16567
17566
  type: 'decorator.add'
16568
17567
  decorator: string
17568
+ selection?: NonNullable<EditorSelection>
16569
17569
  }
16570
17570
  | {
16571
17571
  type: 'decorator.remove'
@@ -16599,6 +17599,12 @@ declare const editorMachine: StateMachine<
16599
17599
  | {
16600
17600
  type: 'focus'
16601
17601
  }
17602
+ | {
17603
+ type: 'history.redo'
17604
+ }
17605
+ | {
17606
+ type: 'history.undo'
17607
+ }
16602
17608
  | {
16603
17609
  type: 'insert.blocks'
16604
17610
  blocks: Array<PortableTextBlock>
@@ -16915,6 +17921,7 @@ declare const editorMachine: StateMachine<
16915
17921
  | {
16916
17922
  type: 'decorator.add'
16917
17923
  decorator: string
17924
+ selection?: NonNullable<EditorSelection>
16918
17925
  }
16919
17926
  | {
16920
17927
  type: 'decorator.remove'
@@ -16948,6 +17955,12 @@ declare const editorMachine: StateMachine<
16948
17955
  | {
16949
17956
  type: 'focus'
16950
17957
  }
17958
+ | {
17959
+ type: 'history.redo'
17960
+ }
17961
+ | {
17962
+ type: 'history.undo'
17963
+ }
16951
17964
  | {
16952
17965
  type: 'insert.blocks'
16953
17966
  blocks: Array<PortableTextBlock>
@@ -17210,6 +18223,7 @@ declare const editorMachine: StateMachine<
17210
18223
  | {
17211
18224
  type: 'decorator.add'
17212
18225
  decorator: string
18226
+ selection?: NonNullable<EditorSelection>
17213
18227
  }
17214
18228
  | {
17215
18229
  type: 'decorator.remove'
@@ -17243,6 +18257,12 @@ declare const editorMachine: StateMachine<
17243
18257
  | {
17244
18258
  type: 'focus'
17245
18259
  }
18260
+ | {
18261
+ type: 'history.redo'
18262
+ }
18263
+ | {
18264
+ type: 'history.undo'
18265
+ }
17246
18266
  | {
17247
18267
  type: 'insert.blocks'
17248
18268
  blocks: Array<PortableTextBlock>
@@ -17559,6 +18579,7 @@ declare const editorMachine: StateMachine<
17559
18579
  | {
17560
18580
  type: 'decorator.add'
17561
18581
  decorator: string
18582
+ selection?: NonNullable<EditorSelection>
17562
18583
  }
17563
18584
  | {
17564
18585
  type: 'decorator.remove'
@@ -17592,6 +18613,12 @@ declare const editorMachine: StateMachine<
17592
18613
  | {
17593
18614
  type: 'focus'
17594
18615
  }
18616
+ | {
18617
+ type: 'history.redo'
18618
+ }
18619
+ | {
18620
+ type: 'history.undo'
18621
+ }
17595
18622
  | {
17596
18623
  type: 'insert.blocks'
17597
18624
  blocks: Array<PortableTextBlock>
@@ -17860,6 +18887,7 @@ declare const editorMachine: StateMachine<
17860
18887
  | {
17861
18888
  type: 'decorator.add'
17862
18889
  decorator: string
18890
+ selection?: NonNullable<EditorSelection>
17863
18891
  }
17864
18892
  | {
17865
18893
  type: 'decorator.remove'
@@ -17893,6 +18921,12 @@ declare const editorMachine: StateMachine<
17893
18921
  | {
17894
18922
  type: 'focus'
17895
18923
  }
18924
+ | {
18925
+ type: 'history.redo'
18926
+ }
18927
+ | {
18928
+ type: 'history.undo'
18929
+ }
17896
18930
  | {
17897
18931
  type: 'insert.blocks'
17898
18932
  blocks: Array<PortableTextBlock>
@@ -18209,6 +19243,7 @@ declare const editorMachine: StateMachine<
18209
19243
  | {
18210
19244
  type: 'decorator.add'
18211
19245
  decorator: string
19246
+ selection?: NonNullable<EditorSelection>
18212
19247
  }
18213
19248
  | {
18214
19249
  type: 'decorator.remove'
@@ -18242,6 +19277,12 @@ declare const editorMachine: StateMachine<
18242
19277
  | {
18243
19278
  type: 'focus'
18244
19279
  }
19280
+ | {
19281
+ type: 'history.redo'
19282
+ }
19283
+ | {
19284
+ type: 'history.undo'
19285
+ }
18245
19286
  | {
18246
19287
  type: 'insert.blocks'
18247
19288
  blocks: Array<PortableTextBlock>
@@ -18510,6 +19551,7 @@ declare const editorMachine: StateMachine<
18510
19551
  | {
18511
19552
  type: 'decorator.add'
18512
19553
  decorator: string
19554
+ selection?: NonNullable<EditorSelection>
18513
19555
  }
18514
19556
  | {
18515
19557
  type: 'decorator.remove'
@@ -18543,6 +19585,12 @@ declare const editorMachine: StateMachine<
18543
19585
  | {
18544
19586
  type: 'focus'
18545
19587
  }
19588
+ | {
19589
+ type: 'history.redo'
19590
+ }
19591
+ | {
19592
+ type: 'history.undo'
19593
+ }
18546
19594
  | {
18547
19595
  type: 'insert.blocks'
18548
19596
  blocks: Array<PortableTextBlock>
@@ -18859,6 +19907,7 @@ declare const editorMachine: StateMachine<
18859
19907
  | {
18860
19908
  type: 'decorator.add'
18861
19909
  decorator: string
19910
+ selection?: NonNullable<EditorSelection>
18862
19911
  }
18863
19912
  | {
18864
19913
  type: 'decorator.remove'
@@ -18892,6 +19941,12 @@ declare const editorMachine: StateMachine<
18892
19941
  | {
18893
19942
  type: 'focus'
18894
19943
  }
19944
+ | {
19945
+ type: 'history.redo'
19946
+ }
19947
+ | {
19948
+ type: 'history.undo'
19949
+ }
18895
19950
  | {
18896
19951
  type: 'insert.blocks'
18897
19952
  blocks: Array<PortableTextBlock>
@@ -19343,6 +20398,14 @@ declare type MarkdownBehaviorsConfig = {
19343
20398
  orderedListStyle?: (context: {schema: EditorSchema}) => string | undefined
19344
20399
  }
19345
20400
 
20401
+ /**
20402
+ * @beta
20403
+ */
20404
+ declare type MarkdownEmphasisBehaviorsConfig = {
20405
+ boldDecorator?: ({schema}: {schema: EditorSchema}) => string | undefined
20406
+ italicDecorator?: ({schema}: {schema: EditorSchema}) => string | undefined
20407
+ }
20408
+
19346
20409
  /**
19347
20410
  * @beta
19348
20411
  * Add markdown behaviors for common markdown actions such as converting ### to headings, --- to HRs, and more.
@@ -19358,6 +20421,10 @@ declare type MarkdownBehaviorsConfig = {
19358
20421
  * <EditorProvider>
19359
20422
  * <MarkdownPlugin
19360
20423
  * config={{
20424
+ * boldDecorator: ({schema}) =>
20425
+ * schema.decorators.find((decorator) => decorator.value === 'strong')?.value,
20426
+ * italicDecorator: ({schema}) =>
20427
+ * schema.decorators.find((decorator) => decorator.value === 'em')?.value,
19361
20428
  * horizontalRuleObject: ({schema}) => {
19362
20429
  * const name = schema.blockObjects.find(
19363
20430
  * (object) => object.name === 'break',
@@ -19389,7 +20456,8 @@ export declare function MarkdownPlugin(props: {
19389
20456
  /**
19390
20457
  * @beta
19391
20458
  */
19392
- export declare type MarkdownPluginConfig = MarkdownBehaviorsConfig
20459
+ export declare type MarkdownPluginConfig = MarkdownBehaviorsConfig &
20460
+ MarkdownEmphasisBehaviorsConfig
19393
20461
 
19394
20462
  declare type MIMEType = `${string}/${string}`
19395
20463
 
@@ -19594,6 +20662,7 @@ declare type SyntheticBehaviorEvent =
19594
20662
  | {
19595
20663
  type: 'decorator.add'
19596
20664
  decorator: string
20665
+ selection?: NonNullable<EditorSelection>
19597
20666
  }
19598
20667
  | {
19599
20668
  type: 'decorator.remove'
@@ -19627,6 +20696,12 @@ declare type SyntheticBehaviorEvent =
19627
20696
  | {
19628
20697
  type: 'focus'
19629
20698
  }
20699
+ | {
20700
+ type: 'history.redo'
20701
+ }
20702
+ | {
20703
+ type: 'history.undo'
20704
+ }
19630
20705
  | {
19631
20706
  type: 'insert.blocks'
19632
20707
  blocks: Array<PortableTextBlock>