@portabletext/editor 1.32.0 → 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 (69) 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 +127 -88
  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 +127 -87
  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 +1 -0
  26. package/lib/behaviors/index.d.ts +1 -0
  27. package/lib/index.d.cts +60 -0
  28. package/lib/index.d.ts +60 -0
  29. package/lib/plugins/index.cjs +295 -3
  30. package/lib/plugins/index.cjs.map +1 -1
  31. package/lib/plugins/index.d.cts +74 -1
  32. package/lib/plugins/index.d.ts +74 -1
  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 +5 -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 +1 -0
  53. package/src/editor/plugins/createWithPortableTextMarkModel.ts +2 -97
  54. package/src/plugins/plugin.markdown.tsx +11 -1
  55. package/src/selectors/index.ts +5 -0
  56. package/src/selectors/selector.get-anchor-block.ts +22 -0
  57. package/src/selectors/selector.get-anchor-child.ts +36 -0
  58. package/src/selectors/selector.get-anchor-span.ts +18 -0
  59. package/src/selectors/selector.get-anchor-text-block.ts +20 -0
  60. package/src/selectors/selector.get-trimmed-selection.test.ts +658 -0
  61. package/src/selectors/selector.get-trimmed-selection.ts +175 -0
  62. package/src/utils/index.ts +1 -0
  63. package/src/utils/util.block-offsets-to-selection.ts +36 -0
  64. package/lib/_chunks-cjs/parse-blocks.cjs.map +0 -1
  65. package/lib/_chunks-cjs/util.is-empty-text-block.cjs +0 -14
  66. package/lib/_chunks-cjs/util.is-empty-text-block.cjs.map +0 -1
  67. package/lib/_chunks-es/parse-blocks.js.map +0 -1
  68. package/lib/_chunks-es/util.is-empty-text-block.js +0 -15
  69. 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'
@@ -878,6 +879,7 @@ declare const editorMachine: StateMachine<
878
879
  | {
879
880
  type: 'decorator.add'
880
881
  decorator: string
882
+ selection?: NonNullable<EditorSelection>
881
883
  }
882
884
  | {
883
885
  type: 'decorator.remove'
@@ -1208,6 +1210,7 @@ declare const editorMachine: StateMachine<
1208
1210
  | {
1209
1211
  type: 'decorator.add'
1210
1212
  decorator: string
1213
+ selection?: NonNullable<EditorSelection>
1211
1214
  }
1212
1215
  | {
1213
1216
  type: 'decorator.remove'
@@ -1563,6 +1566,7 @@ declare const editorMachine: StateMachine<
1563
1566
  | {
1564
1567
  type: 'decorator.add'
1565
1568
  decorator: string
1569
+ selection?: NonNullable<EditorSelection>
1566
1570
  }
1567
1571
  | {
1568
1572
  type: 'decorator.remove'
@@ -2054,6 +2058,7 @@ declare const editorMachine: StateMachine<
2054
2058
  | {
2055
2059
  type: 'decorator.add'
2056
2060
  decorator: string
2061
+ selection?: NonNullable<EditorSelection>
2057
2062
  }
2058
2063
  | {
2059
2064
  type: 'decorator.remove'
@@ -2407,6 +2412,7 @@ declare const editorMachine: StateMachine<
2407
2412
  | {
2408
2413
  type: 'decorator.add'
2409
2414
  decorator: string
2415
+ selection?: NonNullable<EditorSelection>
2410
2416
  }
2411
2417
  | {
2412
2418
  type: 'decorator.remove'
@@ -2705,6 +2711,7 @@ declare const editorMachine: StateMachine<
2705
2711
  | {
2706
2712
  type: 'decorator.add'
2707
2713
  decorator: string
2714
+ selection?: NonNullable<EditorSelection>
2708
2715
  }
2709
2716
  | {
2710
2717
  type: 'decorator.remove'
@@ -3058,6 +3065,7 @@ declare const editorMachine: StateMachine<
3058
3065
  | {
3059
3066
  type: 'decorator.add'
3060
3067
  decorator: string
3068
+ selection?: NonNullable<EditorSelection>
3061
3069
  }
3062
3070
  | {
3063
3071
  type: 'decorator.remove'
@@ -3359,6 +3367,7 @@ declare const editorMachine: StateMachine<
3359
3367
  | {
3360
3368
  type: 'decorator.add'
3361
3369
  decorator: string
3370
+ selection?: NonNullable<EditorSelection>
3362
3371
  }
3363
3372
  | {
3364
3373
  type: 'decorator.remove'
@@ -3712,6 +3721,7 @@ declare const editorMachine: StateMachine<
3712
3721
  | {
3713
3722
  type: 'decorator.add'
3714
3723
  decorator: string
3724
+ selection?: NonNullable<EditorSelection>
3715
3725
  }
3716
3726
  | {
3717
3727
  type: 'decorator.remove'
@@ -4012,6 +4022,7 @@ declare const editorMachine: StateMachine<
4012
4022
  | {
4013
4023
  type: 'decorator.add'
4014
4024
  decorator: string
4025
+ selection?: NonNullable<EditorSelection>
4015
4026
  }
4016
4027
  | {
4017
4028
  type: 'decorator.remove'
@@ -4365,6 +4376,7 @@ declare const editorMachine: StateMachine<
4365
4376
  | {
4366
4377
  type: 'decorator.add'
4367
4378
  decorator: string
4379
+ selection?: NonNullable<EditorSelection>
4368
4380
  }
4369
4381
  | {
4370
4382
  type: 'decorator.remove'
@@ -4664,6 +4676,7 @@ declare const editorMachine: StateMachine<
4664
4676
  | {
4665
4677
  type: 'decorator.add'
4666
4678
  decorator: string
4679
+ selection?: NonNullable<EditorSelection>
4667
4680
  }
4668
4681
  | {
4669
4682
  type: 'decorator.remove'
@@ -5017,6 +5030,7 @@ declare const editorMachine: StateMachine<
5017
5030
  | {
5018
5031
  type: 'decorator.add'
5019
5032
  decorator: string
5033
+ selection?: NonNullable<EditorSelection>
5020
5034
  }
5021
5035
  | {
5022
5036
  type: 'decorator.remove'
@@ -5317,6 +5331,7 @@ declare const editorMachine: StateMachine<
5317
5331
  | {
5318
5332
  type: 'decorator.add'
5319
5333
  decorator: string
5334
+ selection?: NonNullable<EditorSelection>
5320
5335
  }
5321
5336
  | {
5322
5337
  type: 'decorator.remove'
@@ -5688,6 +5703,7 @@ declare const editorMachine: StateMachine<
5688
5703
  | {
5689
5704
  type: 'decorator.add'
5690
5705
  decorator: string
5706
+ selection?: NonNullable<EditorSelection>
5691
5707
  }
5692
5708
  | {
5693
5709
  type: 'decorator.remove'
@@ -6041,6 +6057,7 @@ declare const editorMachine: StateMachine<
6041
6057
  | {
6042
6058
  type: 'decorator.add'
6043
6059
  decorator: string
6060
+ selection?: NonNullable<EditorSelection>
6044
6061
  }
6045
6062
  | {
6046
6063
  type: 'decorator.remove'
@@ -6341,6 +6358,7 @@ declare const editorMachine: StateMachine<
6341
6358
  | {
6342
6359
  type: 'decorator.add'
6343
6360
  decorator: string
6361
+ selection?: NonNullable<EditorSelection>
6344
6362
  }
6345
6363
  | {
6346
6364
  type: 'decorator.remove'
@@ -6694,6 +6712,7 @@ declare const editorMachine: StateMachine<
6694
6712
  | {
6695
6713
  type: 'decorator.add'
6696
6714
  decorator: string
6715
+ selection?: NonNullable<EditorSelection>
6697
6716
  }
6698
6717
  | {
6699
6718
  type: 'decorator.remove'
@@ -6992,6 +7011,7 @@ declare const editorMachine: StateMachine<
6992
7011
  | {
6993
7012
  type: 'decorator.add'
6994
7013
  decorator: string
7014
+ selection?: NonNullable<EditorSelection>
6995
7015
  }
6996
7016
  | {
6997
7017
  type: 'decorator.remove'
@@ -7345,6 +7365,7 @@ declare const editorMachine: StateMachine<
7345
7365
  | {
7346
7366
  type: 'decorator.add'
7347
7367
  decorator: string
7368
+ selection?: NonNullable<EditorSelection>
7348
7369
  }
7349
7370
  | {
7350
7371
  type: 'decorator.remove'
@@ -7644,6 +7665,7 @@ declare const editorMachine: StateMachine<
7644
7665
  | {
7645
7666
  type: 'decorator.add'
7646
7667
  decorator: string
7668
+ selection?: NonNullable<EditorSelection>
7647
7669
  }
7648
7670
  | {
7649
7671
  type: 'decorator.remove'
@@ -7997,6 +8019,7 @@ declare const editorMachine: StateMachine<
7997
8019
  | {
7998
8020
  type: 'decorator.add'
7999
8021
  decorator: string
8022
+ selection?: NonNullable<EditorSelection>
8000
8023
  }
8001
8024
  | {
8002
8025
  type: 'decorator.remove'
@@ -8299,6 +8322,7 @@ declare const editorMachine: StateMachine<
8299
8322
  | {
8300
8323
  type: 'decorator.add'
8301
8324
  decorator: string
8325
+ selection?: NonNullable<EditorSelection>
8302
8326
  }
8303
8327
  | {
8304
8328
  type: 'decorator.remove'
@@ -8652,6 +8676,7 @@ declare const editorMachine: StateMachine<
8652
8676
  | {
8653
8677
  type: 'decorator.add'
8654
8678
  decorator: string
8679
+ selection?: NonNullable<EditorSelection>
8655
8680
  }
8656
8681
  | {
8657
8682
  type: 'decorator.remove'
@@ -8954,6 +8979,7 @@ declare const editorMachine: StateMachine<
8954
8979
  | {
8955
8980
  type: 'decorator.add'
8956
8981
  decorator: string
8982
+ selection?: NonNullable<EditorSelection>
8957
8983
  }
8958
8984
  | {
8959
8985
  type: 'decorator.remove'
@@ -9330,6 +9356,7 @@ declare const editorMachine: StateMachine<
9330
9356
  | {
9331
9357
  type: 'decorator.add'
9332
9358
  decorator: string
9359
+ selection?: NonNullable<EditorSelection>
9333
9360
  }
9334
9361
  | {
9335
9362
  type: 'decorator.remove'
@@ -9703,6 +9730,7 @@ declare const editorMachine: StateMachine<
9703
9730
  | {
9704
9731
  type: 'decorator.add'
9705
9732
  decorator: string
9733
+ selection?: NonNullable<EditorSelection>
9706
9734
  }
9707
9735
  | {
9708
9736
  type: 'decorator.remove'
@@ -10224,6 +10252,7 @@ declare const editorMachine: StateMachine<
10224
10252
  | {
10225
10253
  type: 'decorator.add'
10226
10254
  decorator: string
10255
+ selection?: NonNullable<EditorSelection>
10227
10256
  }
10228
10257
  | {
10229
10258
  type: 'decorator.remove'
@@ -10579,6 +10608,7 @@ declare const editorMachine: StateMachine<
10579
10608
  | {
10580
10609
  type: 'decorator.add'
10581
10610
  decorator: string
10611
+ selection?: NonNullable<EditorSelection>
10582
10612
  }
10583
10613
  | {
10584
10614
  type: 'decorator.remove'
@@ -10884,6 +10914,7 @@ declare const editorMachine: StateMachine<
10884
10914
  | {
10885
10915
  type: 'decorator.add'
10886
10916
  decorator: string
10917
+ selection?: NonNullable<EditorSelection>
10887
10918
  }
10888
10919
  | {
10889
10920
  type: 'decorator.remove'
@@ -11239,6 +11270,7 @@ declare const editorMachine: StateMachine<
11239
11270
  | {
11240
11271
  type: 'decorator.add'
11241
11272
  decorator: string
11273
+ selection?: NonNullable<EditorSelection>
11242
11274
  }
11243
11275
  | {
11244
11276
  type: 'decorator.remove'
@@ -11537,6 +11569,7 @@ declare const editorMachine: StateMachine<
11537
11569
  | {
11538
11570
  type: 'decorator.add'
11539
11571
  decorator: string
11572
+ selection?: NonNullable<EditorSelection>
11540
11573
  }
11541
11574
  | {
11542
11575
  type: 'decorator.remove'
@@ -11892,6 +11925,7 @@ declare const editorMachine: StateMachine<
11892
11925
  | {
11893
11926
  type: 'decorator.add'
11894
11927
  decorator: string
11928
+ selection?: NonNullable<EditorSelection>
11895
11929
  }
11896
11930
  | {
11897
11931
  type: 'decorator.remove'
@@ -12190,6 +12224,7 @@ declare const editorMachine: StateMachine<
12190
12224
  | {
12191
12225
  type: 'decorator.add'
12192
12226
  decorator: string
12227
+ selection?: NonNullable<EditorSelection>
12193
12228
  }
12194
12229
  | {
12195
12230
  type: 'decorator.remove'
@@ -12545,6 +12580,7 @@ declare const editorMachine: StateMachine<
12545
12580
  | {
12546
12581
  type: 'decorator.add'
12547
12582
  decorator: string
12583
+ selection?: NonNullable<EditorSelection>
12548
12584
  }
12549
12585
  | {
12550
12586
  type: 'decorator.remove'
@@ -12797,6 +12833,7 @@ declare const editorMachine: StateMachine<
12797
12833
  | {
12798
12834
  type: 'decorator.add'
12799
12835
  decorator: string
12836
+ selection?: NonNullable<EditorSelection>
12800
12837
  }
12801
12838
  | {
12802
12839
  type: 'decorator.remove'
@@ -12852,6 +12889,7 @@ declare const editorMachine: StateMachine<
12852
12889
  | {
12853
12890
  type: 'decorator.add'
12854
12891
  decorator: string
12892
+ selection?: NonNullable<EditorSelection>
12855
12893
  }
12856
12894
  | {
12857
12895
  type: 'decorator.remove'
@@ -13207,6 +13245,7 @@ declare const editorMachine: StateMachine<
13207
13245
  | {
13208
13246
  type: 'decorator.add'
13209
13247
  decorator: string
13248
+ selection?: NonNullable<EditorSelection>
13210
13249
  }
13211
13250
  | {
13212
13251
  type: 'decorator.remove'
@@ -13519,6 +13558,7 @@ declare const editorMachine: StateMachine<
13519
13558
  | {
13520
13559
  type: 'decorator.add'
13521
13560
  decorator: string
13561
+ selection?: NonNullable<EditorSelection>
13522
13562
  }
13523
13563
  | {
13524
13564
  type: 'decorator.remove'
@@ -13874,6 +13914,7 @@ declare const editorMachine: StateMachine<
13874
13914
  | {
13875
13915
  type: 'decorator.add'
13876
13916
  decorator: string
13917
+ selection?: NonNullable<EditorSelection>
13877
13918
  }
13878
13919
  | {
13879
13920
  type: 'decorator.remove'
@@ -14172,6 +14213,7 @@ declare const editorMachine: StateMachine<
14172
14213
  | {
14173
14214
  type: 'decorator.add'
14174
14215
  decorator: string
14216
+ selection?: NonNullable<EditorSelection>
14175
14217
  }
14176
14218
  | {
14177
14219
  type: 'decorator.remove'
@@ -14527,6 +14569,7 @@ declare const editorMachine: StateMachine<
14527
14569
  | {
14528
14570
  type: 'decorator.add'
14529
14571
  decorator: string
14572
+ selection?: NonNullable<EditorSelection>
14530
14573
  }
14531
14574
  | {
14532
14575
  type: 'decorator.remove'
@@ -14828,6 +14871,7 @@ declare const editorMachine: StateMachine<
14828
14871
  | {
14829
14872
  type: 'decorator.add'
14830
14873
  decorator: string
14874
+ selection?: NonNullable<EditorSelection>
14831
14875
  }
14832
14876
  | {
14833
14877
  type: 'decorator.remove'
@@ -15183,6 +15227,7 @@ declare const editorMachine: StateMachine<
15183
15227
  | {
15184
15228
  type: 'decorator.add'
15185
15229
  decorator: string
15230
+ selection?: NonNullable<EditorSelection>
15186
15231
  }
15187
15232
  | {
15188
15233
  type: 'decorator.remove'
@@ -15535,6 +15580,7 @@ declare const editorMachine: StateMachine<
15535
15580
  | {
15536
15581
  type: 'decorator.add'
15537
15582
  decorator: string
15583
+ selection?: NonNullable<EditorSelection>
15538
15584
  }
15539
15585
  | {
15540
15586
  type: 'decorator.remove'
@@ -15890,6 +15936,7 @@ declare const editorMachine: StateMachine<
15890
15936
  | {
15891
15937
  type: 'decorator.add'
15892
15938
  decorator: string
15939
+ selection?: NonNullable<EditorSelection>
15893
15940
  }
15894
15941
  | {
15895
15942
  type: 'decorator.remove'
@@ -16197,6 +16244,7 @@ declare const editorMachine: StateMachine<
16197
16244
  | {
16198
16245
  type: 'decorator.add'
16199
16246
  decorator: string
16247
+ selection?: NonNullable<EditorSelection>
16200
16248
  }
16201
16249
  | {
16202
16250
  type: 'decorator.remove'
@@ -16552,6 +16600,7 @@ declare const editorMachine: StateMachine<
16552
16600
  | {
16553
16601
  type: 'decorator.add'
16554
16602
  decorator: string
16603
+ selection?: NonNullable<EditorSelection>
16555
16604
  }
16556
16605
  | {
16557
16606
  type: 'decorator.remove'
@@ -16860,6 +16909,7 @@ declare const editorMachine: StateMachine<
16860
16909
  | {
16861
16910
  type: 'decorator.add'
16862
16911
  decorator: string
16912
+ selection?: NonNullable<EditorSelection>
16863
16913
  }
16864
16914
  | {
16865
16915
  type: 'decorator.remove'
@@ -17215,6 +17265,7 @@ declare const editorMachine: StateMachine<
17215
17265
  | {
17216
17266
  type: 'decorator.add'
17217
17267
  decorator: string
17268
+ selection?: NonNullable<EditorSelection>
17218
17269
  }
17219
17270
  | {
17220
17271
  type: 'decorator.remove'
@@ -17514,6 +17565,7 @@ declare const editorMachine: StateMachine<
17514
17565
  | {
17515
17566
  type: 'decorator.add'
17516
17567
  decorator: string
17568
+ selection?: NonNullable<EditorSelection>
17517
17569
  }
17518
17570
  | {
17519
17571
  type: 'decorator.remove'
@@ -17869,6 +17921,7 @@ declare const editorMachine: StateMachine<
17869
17921
  | {
17870
17922
  type: 'decorator.add'
17871
17923
  decorator: string
17924
+ selection?: NonNullable<EditorSelection>
17872
17925
  }
17873
17926
  | {
17874
17927
  type: 'decorator.remove'
@@ -18170,6 +18223,7 @@ declare const editorMachine: StateMachine<
18170
18223
  | {
18171
18224
  type: 'decorator.add'
18172
18225
  decorator: string
18226
+ selection?: NonNullable<EditorSelection>
18173
18227
  }
18174
18228
  | {
18175
18229
  type: 'decorator.remove'
@@ -18525,6 +18579,7 @@ declare const editorMachine: StateMachine<
18525
18579
  | {
18526
18580
  type: 'decorator.add'
18527
18581
  decorator: string
18582
+ selection?: NonNullable<EditorSelection>
18528
18583
  }
18529
18584
  | {
18530
18585
  type: 'decorator.remove'
@@ -18832,6 +18887,7 @@ declare const editorMachine: StateMachine<
18832
18887
  | {
18833
18888
  type: 'decorator.add'
18834
18889
  decorator: string
18890
+ selection?: NonNullable<EditorSelection>
18835
18891
  }
18836
18892
  | {
18837
18893
  type: 'decorator.remove'
@@ -19187,6 +19243,7 @@ declare const editorMachine: StateMachine<
19187
19243
  | {
19188
19244
  type: 'decorator.add'
19189
19245
  decorator: string
19246
+ selection?: NonNullable<EditorSelection>
19190
19247
  }
19191
19248
  | {
19192
19249
  type: 'decorator.remove'
@@ -19494,6 +19551,7 @@ declare const editorMachine: StateMachine<
19494
19551
  | {
19495
19552
  type: 'decorator.add'
19496
19553
  decorator: string
19554
+ selection?: NonNullable<EditorSelection>
19497
19555
  }
19498
19556
  | {
19499
19557
  type: 'decorator.remove'
@@ -19849,6 +19907,7 @@ declare const editorMachine: StateMachine<
19849
19907
  | {
19850
19908
  type: 'decorator.add'
19851
19909
  decorator: string
19910
+ selection?: NonNullable<EditorSelection>
19852
19911
  }
19853
19912
  | {
19854
19913
  type: 'decorator.remove'
@@ -20339,6 +20398,14 @@ declare type MarkdownBehaviorsConfig = {
20339
20398
  orderedListStyle?: (context: {schema: EditorSchema}) => string | undefined
20340
20399
  }
20341
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
+
20342
20409
  /**
20343
20410
  * @beta
20344
20411
  * Add markdown behaviors for common markdown actions such as converting ### to headings, --- to HRs, and more.
@@ -20354,6 +20421,10 @@ declare type MarkdownBehaviorsConfig = {
20354
20421
  * <EditorProvider>
20355
20422
  * <MarkdownPlugin
20356
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,
20357
20428
  * horizontalRuleObject: ({schema}) => {
20358
20429
  * const name = schema.blockObjects.find(
20359
20430
  * (object) => object.name === 'break',
@@ -20385,7 +20456,8 @@ export declare function MarkdownPlugin(props: {
20385
20456
  /**
20386
20457
  * @beta
20387
20458
  */
20388
- export declare type MarkdownPluginConfig = MarkdownBehaviorsConfig
20459
+ export declare type MarkdownPluginConfig = MarkdownBehaviorsConfig &
20460
+ MarkdownEmphasisBehaviorsConfig
20389
20461
 
20390
20462
  declare type MIMEType = `${string}/${string}`
20391
20463
 
@@ -20590,6 +20662,7 @@ declare type SyntheticBehaviorEvent =
20590
20662
  | {
20591
20663
  type: 'decorator.add'
20592
20664
  decorator: string
20665
+ selection?: NonNullable<EditorSelection>
20593
20666
  }
20594
20667
  | {
20595
20668
  type: 'decorator.remove'