@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
package/lib/index.d.cts CHANGED
@@ -715,6 +715,7 @@ declare const editorMachine: StateMachine<
715
715
  | {
716
716
  type: 'decorator.add'
717
717
  decorator: string
718
+ selection?: NonNullable<EditorSelection>
718
719
  }
719
720
  | {
720
721
  type: 'decorator.remove'
@@ -1145,6 +1146,7 @@ declare const editorMachine: StateMachine<
1145
1146
  | {
1146
1147
  type: 'decorator.add'
1147
1148
  decorator: string
1149
+ selection?: NonNullable<EditorSelection>
1148
1150
  }
1149
1151
  | {
1150
1152
  type: 'decorator.remove'
@@ -1475,6 +1477,7 @@ declare const editorMachine: StateMachine<
1475
1477
  | {
1476
1478
  type: 'decorator.add'
1477
1479
  decorator: string
1480
+ selection?: NonNullable<EditorSelection>
1478
1481
  }
1479
1482
  | {
1480
1483
  type: 'decorator.remove'
@@ -1830,6 +1833,7 @@ declare const editorMachine: StateMachine<
1830
1833
  | {
1831
1834
  type: 'decorator.add'
1832
1835
  decorator: string
1836
+ selection?: NonNullable<EditorSelection>
1833
1837
  }
1834
1838
  | {
1835
1839
  type: 'decorator.remove'
@@ -2321,6 +2325,7 @@ declare const editorMachine: StateMachine<
2321
2325
  | {
2322
2326
  type: 'decorator.add'
2323
2327
  decorator: string
2328
+ selection?: NonNullable<EditorSelection>
2324
2329
  }
2325
2330
  | {
2326
2331
  type: 'decorator.remove'
@@ -2674,6 +2679,7 @@ declare const editorMachine: StateMachine<
2674
2679
  | {
2675
2680
  type: 'decorator.add'
2676
2681
  decorator: string
2682
+ selection?: NonNullable<EditorSelection>
2677
2683
  }
2678
2684
  | {
2679
2685
  type: 'decorator.remove'
@@ -2972,6 +2978,7 @@ declare const editorMachine: StateMachine<
2972
2978
  | {
2973
2979
  type: 'decorator.add'
2974
2980
  decorator: string
2981
+ selection?: NonNullable<EditorSelection>
2975
2982
  }
2976
2983
  | {
2977
2984
  type: 'decorator.remove'
@@ -3325,6 +3332,7 @@ declare const editorMachine: StateMachine<
3325
3332
  | {
3326
3333
  type: 'decorator.add'
3327
3334
  decorator: string
3335
+ selection?: NonNullable<EditorSelection>
3328
3336
  }
3329
3337
  | {
3330
3338
  type: 'decorator.remove'
@@ -3626,6 +3634,7 @@ declare const editorMachine: StateMachine<
3626
3634
  | {
3627
3635
  type: 'decorator.add'
3628
3636
  decorator: string
3637
+ selection?: NonNullable<EditorSelection>
3629
3638
  }
3630
3639
  | {
3631
3640
  type: 'decorator.remove'
@@ -3979,6 +3988,7 @@ declare const editorMachine: StateMachine<
3979
3988
  | {
3980
3989
  type: 'decorator.add'
3981
3990
  decorator: string
3991
+ selection?: NonNullable<EditorSelection>
3982
3992
  }
3983
3993
  | {
3984
3994
  type: 'decorator.remove'
@@ -4279,6 +4289,7 @@ declare const editorMachine: StateMachine<
4279
4289
  | {
4280
4290
  type: 'decorator.add'
4281
4291
  decorator: string
4292
+ selection?: NonNullable<EditorSelection>
4282
4293
  }
4283
4294
  | {
4284
4295
  type: 'decorator.remove'
@@ -4632,6 +4643,7 @@ declare const editorMachine: StateMachine<
4632
4643
  | {
4633
4644
  type: 'decorator.add'
4634
4645
  decorator: string
4646
+ selection?: NonNullable<EditorSelection>
4635
4647
  }
4636
4648
  | {
4637
4649
  type: 'decorator.remove'
@@ -4931,6 +4943,7 @@ declare const editorMachine: StateMachine<
4931
4943
  | {
4932
4944
  type: 'decorator.add'
4933
4945
  decorator: string
4946
+ selection?: NonNullable<EditorSelection>
4934
4947
  }
4935
4948
  | {
4936
4949
  type: 'decorator.remove'
@@ -5284,6 +5297,7 @@ declare const editorMachine: StateMachine<
5284
5297
  | {
5285
5298
  type: 'decorator.add'
5286
5299
  decorator: string
5300
+ selection?: NonNullable<EditorSelection>
5287
5301
  }
5288
5302
  | {
5289
5303
  type: 'decorator.remove'
@@ -5584,6 +5598,7 @@ declare const editorMachine: StateMachine<
5584
5598
  | {
5585
5599
  type: 'decorator.add'
5586
5600
  decorator: string
5601
+ selection?: NonNullable<EditorSelection>
5587
5602
  }
5588
5603
  | {
5589
5604
  type: 'decorator.remove'
@@ -5955,6 +5970,7 @@ declare const editorMachine: StateMachine<
5955
5970
  | {
5956
5971
  type: 'decorator.add'
5957
5972
  decorator: string
5973
+ selection?: NonNullable<EditorSelection>
5958
5974
  }
5959
5975
  | {
5960
5976
  type: 'decorator.remove'
@@ -6308,6 +6324,7 @@ declare const editorMachine: StateMachine<
6308
6324
  | {
6309
6325
  type: 'decorator.add'
6310
6326
  decorator: string
6327
+ selection?: NonNullable<EditorSelection>
6311
6328
  }
6312
6329
  | {
6313
6330
  type: 'decorator.remove'
@@ -6608,6 +6625,7 @@ declare const editorMachine: StateMachine<
6608
6625
  | {
6609
6626
  type: 'decorator.add'
6610
6627
  decorator: string
6628
+ selection?: NonNullable<EditorSelection>
6611
6629
  }
6612
6630
  | {
6613
6631
  type: 'decorator.remove'
@@ -6961,6 +6979,7 @@ declare const editorMachine: StateMachine<
6961
6979
  | {
6962
6980
  type: 'decorator.add'
6963
6981
  decorator: string
6982
+ selection?: NonNullable<EditorSelection>
6964
6983
  }
6965
6984
  | {
6966
6985
  type: 'decorator.remove'
@@ -7259,6 +7278,7 @@ declare const editorMachine: StateMachine<
7259
7278
  | {
7260
7279
  type: 'decorator.add'
7261
7280
  decorator: string
7281
+ selection?: NonNullable<EditorSelection>
7262
7282
  }
7263
7283
  | {
7264
7284
  type: 'decorator.remove'
@@ -7612,6 +7632,7 @@ declare const editorMachine: StateMachine<
7612
7632
  | {
7613
7633
  type: 'decorator.add'
7614
7634
  decorator: string
7635
+ selection?: NonNullable<EditorSelection>
7615
7636
  }
7616
7637
  | {
7617
7638
  type: 'decorator.remove'
@@ -7911,6 +7932,7 @@ declare const editorMachine: StateMachine<
7911
7932
  | {
7912
7933
  type: 'decorator.add'
7913
7934
  decorator: string
7935
+ selection?: NonNullable<EditorSelection>
7914
7936
  }
7915
7937
  | {
7916
7938
  type: 'decorator.remove'
@@ -8264,6 +8286,7 @@ declare const editorMachine: StateMachine<
8264
8286
  | {
8265
8287
  type: 'decorator.add'
8266
8288
  decorator: string
8289
+ selection?: NonNullable<EditorSelection>
8267
8290
  }
8268
8291
  | {
8269
8292
  type: 'decorator.remove'
@@ -8566,6 +8589,7 @@ declare const editorMachine: StateMachine<
8566
8589
  | {
8567
8590
  type: 'decorator.add'
8568
8591
  decorator: string
8592
+ selection?: NonNullable<EditorSelection>
8569
8593
  }
8570
8594
  | {
8571
8595
  type: 'decorator.remove'
@@ -8919,6 +8943,7 @@ declare const editorMachine: StateMachine<
8919
8943
  | {
8920
8944
  type: 'decorator.add'
8921
8945
  decorator: string
8946
+ selection?: NonNullable<EditorSelection>
8922
8947
  }
8923
8948
  | {
8924
8949
  type: 'decorator.remove'
@@ -9221,6 +9246,7 @@ declare const editorMachine: StateMachine<
9221
9246
  | {
9222
9247
  type: 'decorator.add'
9223
9248
  decorator: string
9249
+ selection?: NonNullable<EditorSelection>
9224
9250
  }
9225
9251
  | {
9226
9252
  type: 'decorator.remove'
@@ -9597,6 +9623,7 @@ declare const editorMachine: StateMachine<
9597
9623
  | {
9598
9624
  type: 'decorator.add'
9599
9625
  decorator: string
9626
+ selection?: NonNullable<EditorSelection>
9600
9627
  }
9601
9628
  | {
9602
9629
  type: 'decorator.remove'
@@ -9970,6 +9997,7 @@ declare const editorMachine: StateMachine<
9970
9997
  | {
9971
9998
  type: 'decorator.add'
9972
9999
  decorator: string
10000
+ selection?: NonNullable<EditorSelection>
9973
10001
  }
9974
10002
  | {
9975
10003
  type: 'decorator.remove'
@@ -10491,6 +10519,7 @@ declare const editorMachine: StateMachine<
10491
10519
  | {
10492
10520
  type: 'decorator.add'
10493
10521
  decorator: string
10522
+ selection?: NonNullable<EditorSelection>
10494
10523
  }
10495
10524
  | {
10496
10525
  type: 'decorator.remove'
@@ -10846,6 +10875,7 @@ declare const editorMachine: StateMachine<
10846
10875
  | {
10847
10876
  type: 'decorator.add'
10848
10877
  decorator: string
10878
+ selection?: NonNullable<EditorSelection>
10849
10879
  }
10850
10880
  | {
10851
10881
  type: 'decorator.remove'
@@ -11151,6 +11181,7 @@ declare const editorMachine: StateMachine<
11151
11181
  | {
11152
11182
  type: 'decorator.add'
11153
11183
  decorator: string
11184
+ selection?: NonNullable<EditorSelection>
11154
11185
  }
11155
11186
  | {
11156
11187
  type: 'decorator.remove'
@@ -11506,6 +11537,7 @@ declare const editorMachine: StateMachine<
11506
11537
  | {
11507
11538
  type: 'decorator.add'
11508
11539
  decorator: string
11540
+ selection?: NonNullable<EditorSelection>
11509
11541
  }
11510
11542
  | {
11511
11543
  type: 'decorator.remove'
@@ -11804,6 +11836,7 @@ declare const editorMachine: StateMachine<
11804
11836
  | {
11805
11837
  type: 'decorator.add'
11806
11838
  decorator: string
11839
+ selection?: NonNullable<EditorSelection>
11807
11840
  }
11808
11841
  | {
11809
11842
  type: 'decorator.remove'
@@ -12159,6 +12192,7 @@ declare const editorMachine: StateMachine<
12159
12192
  | {
12160
12193
  type: 'decorator.add'
12161
12194
  decorator: string
12195
+ selection?: NonNullable<EditorSelection>
12162
12196
  }
12163
12197
  | {
12164
12198
  type: 'decorator.remove'
@@ -12457,6 +12491,7 @@ declare const editorMachine: StateMachine<
12457
12491
  | {
12458
12492
  type: 'decorator.add'
12459
12493
  decorator: string
12494
+ selection?: NonNullable<EditorSelection>
12460
12495
  }
12461
12496
  | {
12462
12497
  type: 'decorator.remove'
@@ -12812,6 +12847,7 @@ declare const editorMachine: StateMachine<
12812
12847
  | {
12813
12848
  type: 'decorator.add'
12814
12849
  decorator: string
12850
+ selection?: NonNullable<EditorSelection>
12815
12851
  }
12816
12852
  | {
12817
12853
  type: 'decorator.remove'
@@ -13064,6 +13100,7 @@ declare const editorMachine: StateMachine<
13064
13100
  | {
13065
13101
  type: 'decorator.add'
13066
13102
  decorator: string
13103
+ selection?: NonNullable<EditorSelection>
13067
13104
  }
13068
13105
  | {
13069
13106
  type: 'decorator.remove'
@@ -13119,6 +13156,7 @@ declare const editorMachine: StateMachine<
13119
13156
  | {
13120
13157
  type: 'decorator.add'
13121
13158
  decorator: string
13159
+ selection?: NonNullable<EditorSelection>
13122
13160
  }
13123
13161
  | {
13124
13162
  type: 'decorator.remove'
@@ -13474,6 +13512,7 @@ declare const editorMachine: StateMachine<
13474
13512
  | {
13475
13513
  type: 'decorator.add'
13476
13514
  decorator: string
13515
+ selection?: NonNullable<EditorSelection>
13477
13516
  }
13478
13517
  | {
13479
13518
  type: 'decorator.remove'
@@ -13786,6 +13825,7 @@ declare const editorMachine: StateMachine<
13786
13825
  | {
13787
13826
  type: 'decorator.add'
13788
13827
  decorator: string
13828
+ selection?: NonNullable<EditorSelection>
13789
13829
  }
13790
13830
  | {
13791
13831
  type: 'decorator.remove'
@@ -14141,6 +14181,7 @@ declare const editorMachine: StateMachine<
14141
14181
  | {
14142
14182
  type: 'decorator.add'
14143
14183
  decorator: string
14184
+ selection?: NonNullable<EditorSelection>
14144
14185
  }
14145
14186
  | {
14146
14187
  type: 'decorator.remove'
@@ -14439,6 +14480,7 @@ declare const editorMachine: StateMachine<
14439
14480
  | {
14440
14481
  type: 'decorator.add'
14441
14482
  decorator: string
14483
+ selection?: NonNullable<EditorSelection>
14442
14484
  }
14443
14485
  | {
14444
14486
  type: 'decorator.remove'
@@ -14794,6 +14836,7 @@ declare const editorMachine: StateMachine<
14794
14836
  | {
14795
14837
  type: 'decorator.add'
14796
14838
  decorator: string
14839
+ selection?: NonNullable<EditorSelection>
14797
14840
  }
14798
14841
  | {
14799
14842
  type: 'decorator.remove'
@@ -15095,6 +15138,7 @@ declare const editorMachine: StateMachine<
15095
15138
  | {
15096
15139
  type: 'decorator.add'
15097
15140
  decorator: string
15141
+ selection?: NonNullable<EditorSelection>
15098
15142
  }
15099
15143
  | {
15100
15144
  type: 'decorator.remove'
@@ -15450,6 +15494,7 @@ declare const editorMachine: StateMachine<
15450
15494
  | {
15451
15495
  type: 'decorator.add'
15452
15496
  decorator: string
15497
+ selection?: NonNullable<EditorSelection>
15453
15498
  }
15454
15499
  | {
15455
15500
  type: 'decorator.remove'
@@ -15802,6 +15847,7 @@ declare const editorMachine: StateMachine<
15802
15847
  | {
15803
15848
  type: 'decorator.add'
15804
15849
  decorator: string
15850
+ selection?: NonNullable<EditorSelection>
15805
15851
  }
15806
15852
  | {
15807
15853
  type: 'decorator.remove'
@@ -16157,6 +16203,7 @@ declare const editorMachine: StateMachine<
16157
16203
  | {
16158
16204
  type: 'decorator.add'
16159
16205
  decorator: string
16206
+ selection?: NonNullable<EditorSelection>
16160
16207
  }
16161
16208
  | {
16162
16209
  type: 'decorator.remove'
@@ -16464,6 +16511,7 @@ declare const editorMachine: StateMachine<
16464
16511
  | {
16465
16512
  type: 'decorator.add'
16466
16513
  decorator: string
16514
+ selection?: NonNullable<EditorSelection>
16467
16515
  }
16468
16516
  | {
16469
16517
  type: 'decorator.remove'
@@ -16819,6 +16867,7 @@ declare const editorMachine: StateMachine<
16819
16867
  | {
16820
16868
  type: 'decorator.add'
16821
16869
  decorator: string
16870
+ selection?: NonNullable<EditorSelection>
16822
16871
  }
16823
16872
  | {
16824
16873
  type: 'decorator.remove'
@@ -17127,6 +17176,7 @@ declare const editorMachine: StateMachine<
17127
17176
  | {
17128
17177
  type: 'decorator.add'
17129
17178
  decorator: string
17179
+ selection?: NonNullable<EditorSelection>
17130
17180
  }
17131
17181
  | {
17132
17182
  type: 'decorator.remove'
@@ -17482,6 +17532,7 @@ declare const editorMachine: StateMachine<
17482
17532
  | {
17483
17533
  type: 'decorator.add'
17484
17534
  decorator: string
17535
+ selection?: NonNullable<EditorSelection>
17485
17536
  }
17486
17537
  | {
17487
17538
  type: 'decorator.remove'
@@ -17781,6 +17832,7 @@ declare const editorMachine: StateMachine<
17781
17832
  | {
17782
17833
  type: 'decorator.add'
17783
17834
  decorator: string
17835
+ selection?: NonNullable<EditorSelection>
17784
17836
  }
17785
17837
  | {
17786
17838
  type: 'decorator.remove'
@@ -18136,6 +18188,7 @@ declare const editorMachine: StateMachine<
18136
18188
  | {
18137
18189
  type: 'decorator.add'
18138
18190
  decorator: string
18191
+ selection?: NonNullable<EditorSelection>
18139
18192
  }
18140
18193
  | {
18141
18194
  type: 'decorator.remove'
@@ -18437,6 +18490,7 @@ declare const editorMachine: StateMachine<
18437
18490
  | {
18438
18491
  type: 'decorator.add'
18439
18492
  decorator: string
18493
+ selection?: NonNullable<EditorSelection>
18440
18494
  }
18441
18495
  | {
18442
18496
  type: 'decorator.remove'
@@ -18792,6 +18846,7 @@ declare const editorMachine: StateMachine<
18792
18846
  | {
18793
18847
  type: 'decorator.add'
18794
18848
  decorator: string
18849
+ selection?: NonNullable<EditorSelection>
18795
18850
  }
18796
18851
  | {
18797
18852
  type: 'decorator.remove'
@@ -19099,6 +19154,7 @@ declare const editorMachine: StateMachine<
19099
19154
  | {
19100
19155
  type: 'decorator.add'
19101
19156
  decorator: string
19157
+ selection?: NonNullable<EditorSelection>
19102
19158
  }
19103
19159
  | {
19104
19160
  type: 'decorator.remove'
@@ -19454,6 +19510,7 @@ declare const editorMachine: StateMachine<
19454
19510
  | {
19455
19511
  type: 'decorator.add'
19456
19512
  decorator: string
19513
+ selection?: NonNullable<EditorSelection>
19457
19514
  }
19458
19515
  | {
19459
19516
  type: 'decorator.remove'
@@ -19761,6 +19818,7 @@ declare const editorMachine: StateMachine<
19761
19818
  | {
19762
19819
  type: 'decorator.add'
19763
19820
  decorator: string
19821
+ selection?: NonNullable<EditorSelection>
19764
19822
  }
19765
19823
  | {
19766
19824
  type: 'decorator.remove'
@@ -20116,6 +20174,7 @@ declare const editorMachine: StateMachine<
20116
20174
  | {
20117
20175
  type: 'decorator.add'
20118
20176
  decorator: string
20177
+ selection?: NonNullable<EditorSelection>
20119
20178
  }
20120
20179
  | {
20121
20180
  type: 'decorator.remove'
@@ -21538,6 +21597,7 @@ export declare type SyntheticBehaviorEvent =
21538
21597
  | {
21539
21598
  type: 'decorator.add'
21540
21599
  decorator: string
21600
+ selection?: NonNullable<EditorSelection>
21541
21601
  }
21542
21602
  | {
21543
21603
  type: 'decorator.remove'