@portabletext/editor 1.28.0 → 1.30.1

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 (61) hide show
  1. package/lib/_chunks-cjs/behavior.core.cjs +40 -37
  2. package/lib/_chunks-cjs/behavior.core.cjs.map +1 -1
  3. package/lib/_chunks-cjs/parse-blocks.cjs +79 -0
  4. package/lib/_chunks-cjs/parse-blocks.cjs.map +1 -0
  5. package/lib/_chunks-cjs/plugin.event-listener.cjs +55 -97
  6. package/lib/_chunks-cjs/plugin.event-listener.cjs.map +1 -1
  7. package/lib/_chunks-cjs/selector.get-selection-start-point.cjs +15 -0
  8. package/lib/_chunks-cjs/selector.get-selection-start-point.cjs.map +1 -0
  9. package/lib/_chunks-es/behavior.core.js +40 -37
  10. package/lib/_chunks-es/behavior.core.js.map +1 -1
  11. package/lib/_chunks-es/parse-blocks.js +80 -0
  12. package/lib/_chunks-es/parse-blocks.js.map +1 -0
  13. package/lib/_chunks-es/plugin.event-listener.js +57 -98
  14. package/lib/_chunks-es/plugin.event-listener.js.map +1 -1
  15. package/lib/_chunks-es/selector.get-selection-start-point.js +16 -0
  16. package/lib/_chunks-es/selector.get-selection-start-point.js.map +1 -0
  17. package/lib/behaviors/index.d.cts +196 -124
  18. package/lib/behaviors/index.d.ts +196 -124
  19. package/lib/index.d.cts +248 -0
  20. package/lib/index.d.ts +248 -0
  21. package/lib/plugins/index.cjs +249 -1
  22. package/lib/plugins/index.cjs.map +1 -1
  23. package/lib/plugins/index.d.cts +246 -1
  24. package/lib/plugins/index.d.ts +246 -1
  25. package/lib/plugins/index.js +257 -3
  26. package/lib/plugins/index.js.map +1 -1
  27. package/lib/selectors/index.cjs +28 -1
  28. package/lib/selectors/index.cjs.map +1 -1
  29. package/lib/selectors/index.d.cts +21 -0
  30. package/lib/selectors/index.d.ts +21 -0
  31. package/lib/selectors/index.js +28 -0
  32. package/lib/selectors/index.js.map +1 -1
  33. package/lib/utils/index.cjs +70 -1
  34. package/lib/utils/index.cjs.map +1 -1
  35. package/lib/utils/index.d.cts +168 -2
  36. package/lib/utils/index.d.ts +168 -2
  37. package/lib/utils/index.js +71 -1
  38. package/lib/utils/index.js.map +1 -1
  39. package/package.json +5 -5
  40. package/src/behavior-actions/behavior.action.delete.ts +18 -0
  41. package/src/behavior-actions/behavior.action.insert-break.ts +3 -8
  42. package/src/behavior-actions/behavior.actions.ts +9 -0
  43. package/src/behaviors/_exports/index.ts +1 -0
  44. package/src/behaviors/behavior.core.deserialize.ts +52 -38
  45. package/src/behaviors/behavior.core.ts +4 -11
  46. package/src/behaviors/behavior.types.ts +4 -0
  47. package/src/editor/PortableTextEditor.tsx +20 -0
  48. package/src/internal-utils/__tests__/patchToOperations.test.ts +19 -21
  49. package/src/internal-utils/applyPatch.ts +11 -3
  50. package/src/plugins/index.ts +2 -0
  51. package/src/plugins/plugin.behavior.tsx +22 -0
  52. package/src/plugins/plugin.one-line.tsx +225 -0
  53. package/src/selectors/index.ts +3 -0
  54. package/src/selectors/selector.get-selection-end-point.ts +17 -0
  55. package/src/selectors/selector.get-selection-start-point.ts +17 -0
  56. package/src/selectors/selector.is-overlapping-selection.ts +46 -0
  57. package/src/utils/index.ts +4 -0
  58. package/src/utils/util.is-span.ts +12 -0
  59. package/src/utils/util.is-text-block.ts +12 -0
  60. package/src/utils/util.merge-text-blocks.ts +36 -0
  61. package/src/utils/util.split-text-block.ts +55 -0
package/lib/index.d.ts CHANGED
@@ -722,6 +722,10 @@ declare const editorMachine: StateMachine<
722
722
  type: 'decorator.toggle'
723
723
  decorator: string
724
724
  }
725
+ | {
726
+ type: 'delete'
727
+ selection: NonNullable<EditorSelection>
728
+ }
725
729
  | {
726
730
  type: 'delete.backward'
727
731
  unit: TextUnit
@@ -1142,6 +1146,10 @@ declare const editorMachine: StateMachine<
1142
1146
  type: 'decorator.toggle'
1143
1147
  decorator: string
1144
1148
  }
1149
+ | {
1150
+ type: 'delete'
1151
+ selection: NonNullable<EditorSelection>
1152
+ }
1145
1153
  | {
1146
1154
  type: 'delete.backward'
1147
1155
  unit: TextUnit
@@ -1462,6 +1470,10 @@ declare const editorMachine: StateMachine<
1462
1470
  type: 'decorator.toggle'
1463
1471
  decorator: string
1464
1472
  }
1473
+ | {
1474
+ type: 'delete'
1475
+ selection: NonNullable<EditorSelection>
1476
+ }
1465
1477
  | {
1466
1478
  type: 'delete.backward'
1467
1479
  unit: TextUnit
@@ -1807,6 +1819,10 @@ declare const editorMachine: StateMachine<
1807
1819
  type: 'decorator.toggle'
1808
1820
  decorator: string
1809
1821
  }
1822
+ | {
1823
+ type: 'delete'
1824
+ selection: NonNullable<EditorSelection>
1825
+ }
1810
1826
  | {
1811
1827
  type: 'delete.backward'
1812
1828
  unit: TextUnit
@@ -2176,6 +2192,10 @@ declare const editorMachine: StateMachine<
2176
2192
  type: 'decorator.toggle'
2177
2193
  decorator: string
2178
2194
  }
2195
+ | {
2196
+ type: 'delete'
2197
+ selection: NonNullable<EditorSelection>
2198
+ }
2179
2199
  | {
2180
2200
  type: 'delete.backward'
2181
2201
  unit: TextUnit
@@ -2519,6 +2539,10 @@ declare const editorMachine: StateMachine<
2519
2539
  type: 'decorator.toggle'
2520
2540
  decorator: string
2521
2541
  }
2542
+ | {
2543
+ type: 'delete'
2544
+ selection: NonNullable<EditorSelection>
2545
+ }
2522
2546
  | {
2523
2547
  type: 'delete.backward'
2524
2548
  unit: TextUnit
@@ -2807,6 +2831,10 @@ declare const editorMachine: StateMachine<
2807
2831
  type: 'decorator.toggle'
2808
2832
  decorator: string
2809
2833
  }
2834
+ | {
2835
+ type: 'delete'
2836
+ selection: NonNullable<EditorSelection>
2837
+ }
2810
2838
  | {
2811
2839
  type: 'delete.backward'
2812
2840
  unit: TextUnit
@@ -3150,6 +3178,10 @@ declare const editorMachine: StateMachine<
3150
3178
  type: 'decorator.toggle'
3151
3179
  decorator: string
3152
3180
  }
3181
+ | {
3182
+ type: 'delete'
3183
+ selection: NonNullable<EditorSelection>
3184
+ }
3153
3185
  | {
3154
3186
  type: 'delete.backward'
3155
3187
  unit: TextUnit
@@ -3441,6 +3473,10 @@ declare const editorMachine: StateMachine<
3441
3473
  type: 'decorator.toggle'
3442
3474
  decorator: string
3443
3475
  }
3476
+ | {
3477
+ type: 'delete'
3478
+ selection: NonNullable<EditorSelection>
3479
+ }
3444
3480
  | {
3445
3481
  type: 'delete.backward'
3446
3482
  unit: TextUnit
@@ -3784,6 +3820,10 @@ declare const editorMachine: StateMachine<
3784
3820
  type: 'decorator.toggle'
3785
3821
  decorator: string
3786
3822
  }
3823
+ | {
3824
+ type: 'delete'
3825
+ selection: NonNullable<EditorSelection>
3826
+ }
3787
3827
  | {
3788
3828
  type: 'delete.backward'
3789
3829
  unit: TextUnit
@@ -4074,6 +4114,10 @@ declare const editorMachine: StateMachine<
4074
4114
  type: 'decorator.toggle'
4075
4115
  decorator: string
4076
4116
  }
4117
+ | {
4118
+ type: 'delete'
4119
+ selection: NonNullable<EditorSelection>
4120
+ }
4077
4121
  | {
4078
4122
  type: 'delete.backward'
4079
4123
  unit: TextUnit
@@ -4417,6 +4461,10 @@ declare const editorMachine: StateMachine<
4417
4461
  type: 'decorator.toggle'
4418
4462
  decorator: string
4419
4463
  }
4464
+ | {
4465
+ type: 'delete'
4466
+ selection: NonNullable<EditorSelection>
4467
+ }
4420
4468
  | {
4421
4469
  type: 'delete.backward'
4422
4470
  unit: TextUnit
@@ -4706,6 +4754,10 @@ declare const editorMachine: StateMachine<
4706
4754
  type: 'decorator.toggle'
4707
4755
  decorator: string
4708
4756
  }
4757
+ | {
4758
+ type: 'delete'
4759
+ selection: NonNullable<EditorSelection>
4760
+ }
4709
4761
  | {
4710
4762
  type: 'delete.backward'
4711
4763
  unit: TextUnit
@@ -5049,6 +5101,10 @@ declare const editorMachine: StateMachine<
5049
5101
  type: 'decorator.toggle'
5050
5102
  decorator: string
5051
5103
  }
5104
+ | {
5105
+ type: 'delete'
5106
+ selection: NonNullable<EditorSelection>
5107
+ }
5052
5108
  | {
5053
5109
  type: 'delete.backward'
5054
5110
  unit: TextUnit
@@ -5339,6 +5395,10 @@ declare const editorMachine: StateMachine<
5339
5395
  type: 'decorator.toggle'
5340
5396
  decorator: string
5341
5397
  }
5398
+ | {
5399
+ type: 'delete'
5400
+ selection: NonNullable<EditorSelection>
5401
+ }
5342
5402
  | {
5343
5403
  type: 'delete.backward'
5344
5404
  unit: TextUnit
@@ -5700,6 +5760,10 @@ declare const editorMachine: StateMachine<
5700
5760
  type: 'decorator.toggle'
5701
5761
  decorator: string
5702
5762
  }
5763
+ | {
5764
+ type: 'delete'
5765
+ selection: NonNullable<EditorSelection>
5766
+ }
5703
5767
  | {
5704
5768
  type: 'delete.backward'
5705
5769
  unit: TextUnit
@@ -6043,6 +6107,10 @@ declare const editorMachine: StateMachine<
6043
6107
  type: 'decorator.toggle'
6044
6108
  decorator: string
6045
6109
  }
6110
+ | {
6111
+ type: 'delete'
6112
+ selection: NonNullable<EditorSelection>
6113
+ }
6046
6114
  | {
6047
6115
  type: 'delete.backward'
6048
6116
  unit: TextUnit
@@ -6333,6 +6401,10 @@ declare const editorMachine: StateMachine<
6333
6401
  type: 'decorator.toggle'
6334
6402
  decorator: string
6335
6403
  }
6404
+ | {
6405
+ type: 'delete'
6406
+ selection: NonNullable<EditorSelection>
6407
+ }
6336
6408
  | {
6337
6409
  type: 'delete.backward'
6338
6410
  unit: TextUnit
@@ -6676,6 +6748,10 @@ declare const editorMachine: StateMachine<
6676
6748
  type: 'decorator.toggle'
6677
6749
  decorator: string
6678
6750
  }
6751
+ | {
6752
+ type: 'delete'
6753
+ selection: NonNullable<EditorSelection>
6754
+ }
6679
6755
  | {
6680
6756
  type: 'delete.backward'
6681
6757
  unit: TextUnit
@@ -6964,6 +7040,10 @@ declare const editorMachine: StateMachine<
6964
7040
  type: 'decorator.toggle'
6965
7041
  decorator: string
6966
7042
  }
7043
+ | {
7044
+ type: 'delete'
7045
+ selection: NonNullable<EditorSelection>
7046
+ }
6967
7047
  | {
6968
7048
  type: 'delete.backward'
6969
7049
  unit: TextUnit
@@ -7307,6 +7387,10 @@ declare const editorMachine: StateMachine<
7307
7387
  type: 'decorator.toggle'
7308
7388
  decorator: string
7309
7389
  }
7390
+ | {
7391
+ type: 'delete'
7392
+ selection: NonNullable<EditorSelection>
7393
+ }
7310
7394
  | {
7311
7395
  type: 'delete.backward'
7312
7396
  unit: TextUnit
@@ -7596,6 +7680,10 @@ declare const editorMachine: StateMachine<
7596
7680
  type: 'decorator.toggle'
7597
7681
  decorator: string
7598
7682
  }
7683
+ | {
7684
+ type: 'delete'
7685
+ selection: NonNullable<EditorSelection>
7686
+ }
7599
7687
  | {
7600
7688
  type: 'delete.backward'
7601
7689
  unit: TextUnit
@@ -7939,6 +8027,10 @@ declare const editorMachine: StateMachine<
7939
8027
  type: 'decorator.toggle'
7940
8028
  decorator: string
7941
8029
  }
8030
+ | {
8031
+ type: 'delete'
8032
+ selection: NonNullable<EditorSelection>
8033
+ }
7942
8034
  | {
7943
8035
  type: 'delete.backward'
7944
8036
  unit: TextUnit
@@ -8231,6 +8323,10 @@ declare const editorMachine: StateMachine<
8231
8323
  type: 'decorator.toggle'
8232
8324
  decorator: string
8233
8325
  }
8326
+ | {
8327
+ type: 'delete'
8328
+ selection: NonNullable<EditorSelection>
8329
+ }
8234
8330
  | {
8235
8331
  type: 'delete.backward'
8236
8332
  unit: TextUnit
@@ -8574,6 +8670,10 @@ declare const editorMachine: StateMachine<
8574
8670
  type: 'decorator.toggle'
8575
8671
  decorator: string
8576
8672
  }
8673
+ | {
8674
+ type: 'delete'
8675
+ selection: NonNullable<EditorSelection>
8676
+ }
8577
8677
  | {
8578
8678
  type: 'delete.backward'
8579
8679
  unit: TextUnit
@@ -8866,6 +8966,10 @@ declare const editorMachine: StateMachine<
8866
8966
  type: 'decorator.toggle'
8867
8967
  decorator: string
8868
8968
  }
8969
+ | {
8970
+ type: 'delete'
8971
+ selection: NonNullable<EditorSelection>
8972
+ }
8869
8973
  | {
8870
8974
  type: 'delete.backward'
8871
8975
  unit: TextUnit
@@ -9232,6 +9336,10 @@ declare const editorMachine: StateMachine<
9232
9336
  type: 'decorator.toggle'
9233
9337
  decorator: string
9234
9338
  }
9339
+ | {
9340
+ type: 'delete'
9341
+ selection: NonNullable<EditorSelection>
9342
+ }
9235
9343
  | {
9236
9344
  type: 'delete.backward'
9237
9345
  unit: TextUnit
@@ -9595,6 +9703,10 @@ declare const editorMachine: StateMachine<
9595
9703
  type: 'decorator.toggle'
9596
9704
  decorator: string
9597
9705
  }
9706
+ | {
9707
+ type: 'delete'
9708
+ selection: NonNullable<EditorSelection>
9709
+ }
9598
9710
  | {
9599
9711
  type: 'delete.backward'
9600
9712
  unit: TextUnit
@@ -10106,6 +10218,10 @@ declare const editorMachine: StateMachine<
10106
10218
  type: 'decorator.toggle'
10107
10219
  decorator: string
10108
10220
  }
10221
+ | {
10222
+ type: 'delete'
10223
+ selection: NonNullable<EditorSelection>
10224
+ }
10109
10225
  | {
10110
10226
  type: 'delete.backward'
10111
10227
  unit: TextUnit
@@ -10451,6 +10567,10 @@ declare const editorMachine: StateMachine<
10451
10567
  type: 'decorator.toggle'
10452
10568
  decorator: string
10453
10569
  }
10570
+ | {
10571
+ type: 'delete'
10572
+ selection: NonNullable<EditorSelection>
10573
+ }
10454
10574
  | {
10455
10575
  type: 'delete.backward'
10456
10576
  unit: TextUnit
@@ -10746,6 +10866,10 @@ declare const editorMachine: StateMachine<
10746
10866
  type: 'decorator.toggle'
10747
10867
  decorator: string
10748
10868
  }
10869
+ | {
10870
+ type: 'delete'
10871
+ selection: NonNullable<EditorSelection>
10872
+ }
10749
10873
  | {
10750
10874
  type: 'delete.backward'
10751
10875
  unit: TextUnit
@@ -11091,6 +11215,10 @@ declare const editorMachine: StateMachine<
11091
11215
  type: 'decorator.toggle'
11092
11216
  decorator: string
11093
11217
  }
11218
+ | {
11219
+ type: 'delete'
11220
+ selection: NonNullable<EditorSelection>
11221
+ }
11094
11222
  | {
11095
11223
  type: 'delete.backward'
11096
11224
  unit: TextUnit
@@ -11379,6 +11507,10 @@ declare const editorMachine: StateMachine<
11379
11507
  type: 'decorator.toggle'
11380
11508
  decorator: string
11381
11509
  }
11510
+ | {
11511
+ type: 'delete'
11512
+ selection: NonNullable<EditorSelection>
11513
+ }
11382
11514
  | {
11383
11515
  type: 'delete.backward'
11384
11516
  unit: TextUnit
@@ -11724,6 +11856,10 @@ declare const editorMachine: StateMachine<
11724
11856
  type: 'decorator.toggle'
11725
11857
  decorator: string
11726
11858
  }
11859
+ | {
11860
+ type: 'delete'
11861
+ selection: NonNullable<EditorSelection>
11862
+ }
11727
11863
  | {
11728
11864
  type: 'delete.backward'
11729
11865
  unit: TextUnit
@@ -12012,6 +12148,10 @@ declare const editorMachine: StateMachine<
12012
12148
  type: 'decorator.toggle'
12013
12149
  decorator: string
12014
12150
  }
12151
+ | {
12152
+ type: 'delete'
12153
+ selection: NonNullable<EditorSelection>
12154
+ }
12015
12155
  | {
12016
12156
  type: 'delete.backward'
12017
12157
  unit: TextUnit
@@ -12357,6 +12497,10 @@ declare const editorMachine: StateMachine<
12357
12497
  type: 'decorator.toggle'
12358
12498
  decorator: string
12359
12499
  }
12500
+ | {
12501
+ type: 'delete'
12502
+ selection: NonNullable<EditorSelection>
12503
+ }
12360
12504
  | {
12361
12505
  type: 'delete.backward'
12362
12506
  unit: TextUnit
@@ -12654,6 +12798,10 @@ declare const editorMachine: StateMachine<
12654
12798
  type: 'decorator.toggle'
12655
12799
  decorator: string
12656
12800
  }
12801
+ | {
12802
+ type: 'delete'
12803
+ selection: NonNullable<EditorSelection>
12804
+ }
12657
12805
  | {
12658
12806
  type: 'delete.backward'
12659
12807
  unit: TextUnit
@@ -12999,6 +13147,10 @@ declare const editorMachine: StateMachine<
12999
13147
  type: 'decorator.toggle'
13000
13148
  decorator: string
13001
13149
  }
13150
+ | {
13151
+ type: 'delete'
13152
+ selection: NonNullable<EditorSelection>
13153
+ }
13002
13154
  | {
13003
13155
  type: 'delete.backward'
13004
13156
  unit: TextUnit
@@ -13301,6 +13453,10 @@ declare const editorMachine: StateMachine<
13301
13453
  type: 'decorator.toggle'
13302
13454
  decorator: string
13303
13455
  }
13456
+ | {
13457
+ type: 'delete'
13458
+ selection: NonNullable<EditorSelection>
13459
+ }
13304
13460
  | {
13305
13461
  type: 'delete.backward'
13306
13462
  unit: TextUnit
@@ -13646,6 +13802,10 @@ declare const editorMachine: StateMachine<
13646
13802
  type: 'decorator.toggle'
13647
13803
  decorator: string
13648
13804
  }
13805
+ | {
13806
+ type: 'delete'
13807
+ selection: NonNullable<EditorSelection>
13808
+ }
13649
13809
  | {
13650
13810
  type: 'delete.backward'
13651
13811
  unit: TextUnit
@@ -13934,6 +14094,10 @@ declare const editorMachine: StateMachine<
13934
14094
  type: 'decorator.toggle'
13935
14095
  decorator: string
13936
14096
  }
14097
+ | {
14098
+ type: 'delete'
14099
+ selection: NonNullable<EditorSelection>
14100
+ }
13937
14101
  | {
13938
14102
  type: 'delete.backward'
13939
14103
  unit: TextUnit
@@ -14279,6 +14443,10 @@ declare const editorMachine: StateMachine<
14279
14443
  type: 'decorator.toggle'
14280
14444
  decorator: string
14281
14445
  }
14446
+ | {
14447
+ type: 'delete'
14448
+ selection: NonNullable<EditorSelection>
14449
+ }
14282
14450
  | {
14283
14451
  type: 'delete.backward'
14284
14452
  unit: TextUnit
@@ -14621,6 +14789,10 @@ declare const editorMachine: StateMachine<
14621
14789
  type: 'decorator.toggle'
14622
14790
  decorator: string
14623
14791
  }
14792
+ | {
14793
+ type: 'delete'
14794
+ selection: NonNullable<EditorSelection>
14795
+ }
14624
14796
  | {
14625
14797
  type: 'delete.backward'
14626
14798
  unit: TextUnit
@@ -14966,6 +15138,10 @@ declare const editorMachine: StateMachine<
14966
15138
  type: 'decorator.toggle'
14967
15139
  decorator: string
14968
15140
  }
15141
+ | {
15142
+ type: 'delete'
15143
+ selection: NonNullable<EditorSelection>
15144
+ }
14969
15145
  | {
14970
15146
  type: 'delete.backward'
14971
15147
  unit: TextUnit
@@ -15263,6 +15439,10 @@ declare const editorMachine: StateMachine<
15263
15439
  type: 'decorator.toggle'
15264
15440
  decorator: string
15265
15441
  }
15442
+ | {
15443
+ type: 'delete'
15444
+ selection: NonNullable<EditorSelection>
15445
+ }
15266
15446
  | {
15267
15447
  type: 'delete.backward'
15268
15448
  unit: TextUnit
@@ -15608,6 +15788,10 @@ declare const editorMachine: StateMachine<
15608
15788
  type: 'decorator.toggle'
15609
15789
  decorator: string
15610
15790
  }
15791
+ | {
15792
+ type: 'delete'
15793
+ selection: NonNullable<EditorSelection>
15794
+ }
15611
15795
  | {
15612
15796
  type: 'delete.backward'
15613
15797
  unit: TextUnit
@@ -15906,6 +16090,10 @@ declare const editorMachine: StateMachine<
15906
16090
  type: 'decorator.toggle'
15907
16091
  decorator: string
15908
16092
  }
16093
+ | {
16094
+ type: 'delete'
16095
+ selection: NonNullable<EditorSelection>
16096
+ }
15909
16097
  | {
15910
16098
  type: 'delete.backward'
15911
16099
  unit: TextUnit
@@ -16251,6 +16439,10 @@ declare const editorMachine: StateMachine<
16251
16439
  type: 'decorator.toggle'
16252
16440
  decorator: string
16253
16441
  }
16442
+ | {
16443
+ type: 'delete'
16444
+ selection: NonNullable<EditorSelection>
16445
+ }
16254
16446
  | {
16255
16447
  type: 'delete.backward'
16256
16448
  unit: TextUnit
@@ -16540,6 +16732,10 @@ declare const editorMachine: StateMachine<
16540
16732
  type: 'decorator.toggle'
16541
16733
  decorator: string
16542
16734
  }
16735
+ | {
16736
+ type: 'delete'
16737
+ selection: NonNullable<EditorSelection>
16738
+ }
16543
16739
  | {
16544
16740
  type: 'delete.backward'
16545
16741
  unit: TextUnit
@@ -16885,6 +17081,10 @@ declare const editorMachine: StateMachine<
16885
17081
  type: 'decorator.toggle'
16886
17082
  decorator: string
16887
17083
  }
17084
+ | {
17085
+ type: 'delete'
17086
+ selection: NonNullable<EditorSelection>
17087
+ }
16888
17088
  | {
16889
17089
  type: 'delete.backward'
16890
17090
  unit: TextUnit
@@ -17176,6 +17376,10 @@ declare const editorMachine: StateMachine<
17176
17376
  type: 'decorator.toggle'
17177
17377
  decorator: string
17178
17378
  }
17379
+ | {
17380
+ type: 'delete'
17381
+ selection: NonNullable<EditorSelection>
17382
+ }
17179
17383
  | {
17180
17384
  type: 'delete.backward'
17181
17385
  unit: TextUnit
@@ -17521,6 +17725,10 @@ declare const editorMachine: StateMachine<
17521
17725
  type: 'decorator.toggle'
17522
17726
  decorator: string
17523
17727
  }
17728
+ | {
17729
+ type: 'delete'
17730
+ selection: NonNullable<EditorSelection>
17731
+ }
17524
17732
  | {
17525
17733
  type: 'delete.backward'
17526
17734
  unit: TextUnit
@@ -17818,6 +18026,10 @@ declare const editorMachine: StateMachine<
17818
18026
  type: 'decorator.toggle'
17819
18027
  decorator: string
17820
18028
  }
18029
+ | {
18030
+ type: 'delete'
18031
+ selection: NonNullable<EditorSelection>
18032
+ }
17821
18033
  | {
17822
18034
  type: 'delete.backward'
17823
18035
  unit: TextUnit
@@ -18163,6 +18375,10 @@ declare const editorMachine: StateMachine<
18163
18375
  type: 'decorator.toggle'
18164
18376
  decorator: string
18165
18377
  }
18378
+ | {
18379
+ type: 'delete'
18380
+ selection: NonNullable<EditorSelection>
18381
+ }
18166
18382
  | {
18167
18383
  type: 'delete.backward'
18168
18384
  unit: TextUnit
@@ -18460,6 +18676,10 @@ declare const editorMachine: StateMachine<
18460
18676
  type: 'decorator.toggle'
18461
18677
  decorator: string
18462
18678
  }
18679
+ | {
18680
+ type: 'delete'
18681
+ selection: NonNullable<EditorSelection>
18682
+ }
18463
18683
  | {
18464
18684
  type: 'delete.backward'
18465
18685
  unit: TextUnit
@@ -18805,6 +19025,10 @@ declare const editorMachine: StateMachine<
18805
19025
  type: 'decorator.toggle'
18806
19026
  decorator: string
18807
19027
  }
19028
+ | {
19029
+ type: 'delete'
19030
+ selection: NonNullable<EditorSelection>
19031
+ }
18808
19032
  | {
18809
19033
  type: 'delete.backward'
18810
19034
  unit: TextUnit
@@ -19873,11 +20097,31 @@ export declare class PortableTextEditor extends Component<
19873
20097
  * ```
19874
20098
  */
19875
20099
  static toggleMark: (editor: PortableTextEditor, mark: string) => void
20100
+ /**
20101
+ * @deprecated
20102
+ * Use built-in selectors or write your own: https://www.portabletext.org/reference/selectors/
20103
+ *
20104
+ * ```
20105
+ * import * as selectors from '@portabletext/editor/selectors'
20106
+ * const editor = useEditor()
20107
+ * const selectedSlice = useEditorSelector(editor, selectors.getSelectedSlice)
20108
+ * ```
20109
+ */
19876
20110
  static getFragment: (
19877
20111
  editor: PortableTextEditor,
19878
20112
  ) => PortableTextBlock[] | undefined
19879
20113
  static undo: (editor: PortableTextEditor) => void
19880
20114
  static redo: (editor: PortableTextEditor) => void
20115
+ /**
20116
+ * @deprecated
20117
+ * Use built-in selectors or write your own: https://www.portabletext.org/reference/selectors/
20118
+ *
20119
+ * ```
20120
+ * import * as selectors from '@portabletext/editor/selectors'
20121
+ * const editor = useEditor()
20122
+ * const isOverlapping = useEditorSelector(editor, selectors.isOverlappingSelection(selectionB))
20123
+ * ```
20124
+ */
19881
20125
  static isSelectionsOverlapping: (
19882
20126
  editor: PortableTextEditor,
19883
20127
  selectionA: EditorSelection,
@@ -20201,6 +20445,10 @@ export declare type SyntheticBehaviorEvent =
20201
20445
  type: 'decorator.toggle'
20202
20446
  decorator: string
20203
20447
  }
20448
+ | {
20449
+ type: 'delete'
20450
+ selection: NonNullable<EditorSelection>
20451
+ }
20204
20452
  | {
20205
20453
  type: 'delete.backward'
20206
20454
  unit: TextUnit