@portabletext/editor 1.41.4 → 1.42.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 (52) hide show
  1. package/lib/_chunks-cjs/behavior.core.cjs +2 -26
  2. package/lib/_chunks-cjs/behavior.core.cjs.map +1 -1
  3. package/lib/_chunks-cjs/behavior.markdown.cjs.map +1 -1
  4. package/lib/_chunks-cjs/editor-provider.cjs +21 -4
  5. package/lib/_chunks-cjs/editor-provider.cjs.map +1 -1
  6. package/lib/_chunks-es/behavior.core.js +2 -26
  7. package/lib/_chunks-es/behavior.core.js.map +1 -1
  8. package/lib/_chunks-es/behavior.markdown.js.map +1 -1
  9. package/lib/_chunks-es/editor-provider.js +20 -3
  10. package/lib/_chunks-es/editor-provider.js.map +1 -1
  11. package/lib/behaviors/index.cjs.map +1 -1
  12. package/lib/behaviors/index.d.cts +16 -86
  13. package/lib/behaviors/index.d.ts +16 -86
  14. package/lib/behaviors/index.js.map +1 -1
  15. package/lib/index.d.cts +7 -68
  16. package/lib/index.d.ts +7 -68
  17. package/lib/plugins/index.cjs +7 -1
  18. package/lib/plugins/index.cjs.map +1 -1
  19. package/lib/plugins/index.d.cts +12 -68
  20. package/lib/plugins/index.d.ts +12 -68
  21. package/lib/plugins/index.js +8 -2
  22. package/lib/plugins/index.js.map +1 -1
  23. package/lib/selectors/index.d.cts +7 -68
  24. package/lib/selectors/index.d.ts +7 -68
  25. package/lib/utils/index.d.cts +7 -68
  26. package/lib/utils/index.d.ts +7 -68
  27. package/package.json +4 -4
  28. package/src/behavior-actions/behavior.actions.ts +1 -1
  29. package/src/behaviors/behavior.code-editor.ts +1 -1
  30. package/src/behaviors/behavior.core.annotations.ts +2 -1
  31. package/src/behaviors/behavior.core.block-objects.ts +2 -1
  32. package/src/behaviors/behavior.core.decorators.ts +2 -1
  33. package/src/behaviors/behavior.core.dnd.ts +1 -1
  34. package/src/behaviors/behavior.core.insert-break.ts +2 -1
  35. package/src/behaviors/behavior.core.lists.ts +2 -1
  36. package/src/behaviors/behavior.decorator-pair.ts +1 -1
  37. package/src/behaviors/behavior.default.raise-soft-break.ts +2 -1
  38. package/src/behaviors/behavior.default.ts +2 -1
  39. package/src/behaviors/behavior.emoji-picker.ts +1 -1
  40. package/src/behaviors/behavior.links.ts +1 -1
  41. package/src/behaviors/behavior.markdown.ts +1 -1
  42. package/src/behaviors/behavior.types.action.ts +61 -0
  43. package/src/behaviors/behavior.types.behavior.ts +84 -0
  44. package/src/behaviors/{behavior.types.ts → behavior.types.event.ts} +58 -203
  45. package/src/behaviors/behavior.types.guard.ts +14 -0
  46. package/src/behaviors/index.ts +11 -9
  47. package/src/editor/create-editor.ts +2 -2
  48. package/src/editor/editor-machine.ts +3 -3
  49. package/src/editor/plugins/create-with-event-listeners.ts +0 -1
  50. package/src/plugins/index.ts +1 -0
  51. package/src/plugins/plugin.core.tsx +9 -0
  52. package/src/plugins/plugin.decorator-shortcut.ts +1 -1
@@ -24,7 +24,6 @@ import type {Descendant, Operation} from 'slate'
24
24
  import {TextUnit} from 'slate'
25
25
  import type {DOMNode} from 'slate-dom'
26
26
  import type {ReactEditor} from 'slate-react'
27
- import {TextInsertTextOptions} from 'slate/dist/interfaces/transforms/text'
28
27
  import {
29
28
  ActionArgs,
30
29
  ActionFunction,
@@ -55,7 +54,7 @@ import {
55
54
  import {
56
55
  InputBehaviorEvent as InputBehaviorEvent_2,
57
56
  InsertPlacement as InsertPlacement_2,
58
- } from '../behaviors/behavior.types'
57
+ } from '../behaviors/behavior.types.event'
59
58
  import {MIMEType as MIMEType_2} from '../internal-utils/mime-type'
60
59
  import {PickFromUnion as PickFromUnion_2} from '../type-utils'
61
60
  import {BlockWithOptionalKey as BlockWithOptionalKey_2} from '../types/block-with-optional-key'
@@ -640,7 +639,6 @@ declare const editorMachine: StateMachine<
640
639
  | {
641
640
  type: 'insert.text'
642
641
  text: string
643
- options?: TextInsertTextOptions
644
642
  }
645
643
  | {
646
644
  type: 'list item.add'
@@ -1085,7 +1083,6 @@ declare const editorMachine: StateMachine<
1085
1083
  | {
1086
1084
  type: 'insert.text'
1087
1085
  text: string
1088
- options?: TextInsertTextOptions
1089
1086
  }
1090
1087
  | {
1091
1088
  type: 'list item.add'
@@ -1419,7 +1416,6 @@ declare const editorMachine: StateMachine<
1419
1416
  | {
1420
1417
  type: 'insert.text'
1421
1418
  text: string
1422
- options?: TextInsertTextOptions
1423
1419
  }
1424
1420
  | {
1425
1421
  type: 'list item.add'
@@ -1787,7 +1783,6 @@ declare const editorMachine: StateMachine<
1787
1783
  | {
1788
1784
  type: 'insert.text'
1789
1785
  text: string
1790
- options?: TextInsertTextOptions
1791
1786
  }
1792
1787
  | {
1793
1788
  type: 'list item.add'
@@ -2183,7 +2178,6 @@ declare const editorMachine: StateMachine<
2183
2178
  | {
2184
2179
  type: 'insert.text'
2185
2180
  text: string
2186
- options?: TextInsertTextOptions
2187
2181
  }
2188
2182
  | {
2189
2183
  type: 'list item.add'
@@ -2549,7 +2543,6 @@ declare const editorMachine: StateMachine<
2549
2543
  | {
2550
2544
  type: 'insert.text'
2551
2545
  text: string
2552
- options?: TextInsertTextOptions
2553
2546
  }
2554
2547
  | {
2555
2548
  type: 'list item.add'
@@ -2851,7 +2844,6 @@ declare const editorMachine: StateMachine<
2851
2844
  | {
2852
2845
  type: 'insert.text'
2853
2846
  text: string
2854
- options?: TextInsertTextOptions
2855
2847
  }
2856
2848
  | {
2857
2849
  type: 'list item.add'
@@ -3217,7 +3209,6 @@ declare const editorMachine: StateMachine<
3217
3209
  | {
3218
3210
  type: 'insert.text'
3219
3211
  text: string
3220
- options?: TextInsertTextOptions
3221
3212
  }
3222
3213
  | {
3223
3214
  type: 'list item.add'
@@ -3522,7 +3513,6 @@ declare const editorMachine: StateMachine<
3522
3513
  | {
3523
3514
  type: 'insert.text'
3524
3515
  text: string
3525
- options?: TextInsertTextOptions
3526
3516
  }
3527
3517
  | {
3528
3518
  type: 'list item.add'
@@ -3888,7 +3878,6 @@ declare const editorMachine: StateMachine<
3888
3878
  | {
3889
3879
  type: 'insert.text'
3890
3880
  text: string
3891
- options?: TextInsertTextOptions
3892
3881
  }
3893
3882
  | {
3894
3883
  type: 'list item.add'
@@ -4192,7 +4181,6 @@ declare const editorMachine: StateMachine<
4192
4181
  | {
4193
4182
  type: 'insert.text'
4194
4183
  text: string
4195
- options?: TextInsertTextOptions
4196
4184
  }
4197
4185
  | {
4198
4186
  type: 'list item.add'
@@ -4558,7 +4546,6 @@ declare const editorMachine: StateMachine<
4558
4546
  | {
4559
4547
  type: 'insert.text'
4560
4548
  text: string
4561
- options?: TextInsertTextOptions
4562
4549
  }
4563
4550
  | {
4564
4551
  type: 'list item.add'
@@ -4861,7 +4848,6 @@ declare const editorMachine: StateMachine<
4861
4848
  | {
4862
4849
  type: 'insert.text'
4863
4850
  text: string
4864
- options?: TextInsertTextOptions
4865
4851
  }
4866
4852
  | {
4867
4853
  type: 'list item.add'
@@ -5227,7 +5213,6 @@ declare const editorMachine: StateMachine<
5227
5213
  | {
5228
5214
  type: 'insert.text'
5229
5215
  text: string
5230
- options?: TextInsertTextOptions
5231
5216
  }
5232
5217
  | {
5233
5218
  type: 'list item.add'
@@ -5531,7 +5516,6 @@ declare const editorMachine: StateMachine<
5531
5516
  | {
5532
5517
  type: 'insert.text'
5533
5518
  text: string
5534
- options?: TextInsertTextOptions
5535
5519
  }
5536
5520
  | {
5537
5521
  type: 'list item.add'
@@ -5919,7 +5903,6 @@ declare const editorMachine: StateMachine<
5919
5903
  | {
5920
5904
  type: 'insert.text'
5921
5905
  text: string
5922
- options?: TextInsertTextOptions
5923
5906
  }
5924
5907
  | {
5925
5908
  type: 'list item.add'
@@ -6285,7 +6268,6 @@ declare const editorMachine: StateMachine<
6285
6268
  | {
6286
6269
  type: 'insert.text'
6287
6270
  text: string
6288
- options?: TextInsertTextOptions
6289
6271
  }
6290
6272
  | {
6291
6273
  type: 'list item.add'
@@ -6589,7 +6571,6 @@ declare const editorMachine: StateMachine<
6589
6571
  | {
6590
6572
  type: 'insert.text'
6591
6573
  text: string
6592
- options?: TextInsertTextOptions
6593
6574
  }
6594
6575
  | {
6595
6576
  type: 'list item.add'
@@ -6955,7 +6936,6 @@ declare const editorMachine: StateMachine<
6955
6936
  | {
6956
6937
  type: 'insert.text'
6957
6938
  text: string
6958
- options?: TextInsertTextOptions
6959
6939
  }
6960
6940
  | {
6961
6941
  type: 'list item.add'
@@ -7257,7 +7237,6 @@ declare const editorMachine: StateMachine<
7257
7237
  | {
7258
7238
  type: 'insert.text'
7259
7239
  text: string
7260
- options?: TextInsertTextOptions
7261
7240
  }
7262
7241
  | {
7263
7242
  type: 'list item.add'
@@ -7623,7 +7602,6 @@ declare const editorMachine: StateMachine<
7623
7602
  | {
7624
7603
  type: 'insert.text'
7625
7604
  text: string
7626
- options?: TextInsertTextOptions
7627
7605
  }
7628
7606
  | {
7629
7607
  type: 'list item.add'
@@ -7926,7 +7904,6 @@ declare const editorMachine: StateMachine<
7926
7904
  | {
7927
7905
  type: 'insert.text'
7928
7906
  text: string
7929
- options?: TextInsertTextOptions
7930
7907
  }
7931
7908
  | {
7932
7909
  type: 'list item.add'
@@ -8292,7 +8269,6 @@ declare const editorMachine: StateMachine<
8292
8269
  | {
8293
8270
  type: 'insert.text'
8294
8271
  text: string
8295
- options?: TextInsertTextOptions
8296
8272
  }
8297
8273
  | {
8298
8274
  type: 'list item.add'
@@ -8598,7 +8574,6 @@ declare const editorMachine: StateMachine<
8598
8574
  | {
8599
8575
  type: 'insert.text'
8600
8576
  text: string
8601
- options?: TextInsertTextOptions
8602
8577
  }
8603
8578
  | {
8604
8579
  type: 'list item.add'
@@ -8964,7 +8939,6 @@ declare const editorMachine: StateMachine<
8964
8939
  | {
8965
8940
  type: 'insert.text'
8966
8941
  text: string
8967
- options?: TextInsertTextOptions
8968
8942
  }
8969
8943
  | {
8970
8944
  type: 'list item.add'
@@ -9270,7 +9244,6 @@ declare const editorMachine: StateMachine<
9270
9244
  | {
9271
9245
  type: 'insert.text'
9272
9246
  text: string
9273
- options?: TextInsertTextOptions
9274
9247
  }
9275
9248
  | {
9276
9249
  type: 'list item.add'
@@ -9663,7 +9636,6 @@ declare const editorMachine: StateMachine<
9663
9636
  | {
9664
9637
  type: 'insert.text'
9665
9638
  text: string
9666
- options?: TextInsertTextOptions
9667
9639
  }
9668
9640
  | {
9669
9641
  type: 'list item.add'
@@ -10053,7 +10025,6 @@ declare const editorMachine: StateMachine<
10053
10025
  | {
10054
10026
  type: 'insert.text'
10055
10027
  text: string
10056
- options?: TextInsertTextOptions
10057
10028
  }
10058
10029
  | {
10059
10030
  type: 'list item.add'
@@ -10612,7 +10583,6 @@ declare const editorMachine: StateMachine<
10612
10583
  | {
10613
10584
  type: 'insert.text'
10614
10585
  text: string
10615
- options?: TextInsertTextOptions
10616
10586
  }
10617
10587
  | {
10618
10588
  type: 'list item.add'
@@ -10978,7 +10948,6 @@ declare const editorMachine: StateMachine<
10978
10948
  | {
10979
10949
  type: 'insert.text'
10980
10950
  text: string
10981
- options?: TextInsertTextOptions
10982
10951
  }
10983
10952
  | {
10984
10953
  type: 'list item.add'
@@ -11287,7 +11256,6 @@ declare const editorMachine: StateMachine<
11287
11256
  | {
11288
11257
  type: 'insert.text'
11289
11258
  text: string
11290
- options?: TextInsertTextOptions
11291
11259
  }
11292
11260
  | {
11293
11261
  type: 'list item.add'
@@ -11653,7 +11621,6 @@ declare const editorMachine: StateMachine<
11653
11621
  | {
11654
11622
  type: 'insert.text'
11655
11623
  text: string
11656
- options?: TextInsertTextOptions
11657
11624
  }
11658
11625
  | {
11659
11626
  type: 'list item.add'
@@ -11955,7 +11922,6 @@ declare const editorMachine: StateMachine<
11955
11922
  | {
11956
11923
  type: 'insert.text'
11957
11924
  text: string
11958
- options?: TextInsertTextOptions
11959
11925
  }
11960
11926
  | {
11961
11927
  type: 'list item.add'
@@ -12321,7 +12287,6 @@ declare const editorMachine: StateMachine<
12321
12287
  | {
12322
12288
  type: 'insert.text'
12323
12289
  text: string
12324
- options?: TextInsertTextOptions
12325
12290
  }
12326
12291
  | {
12327
12292
  type: 'list item.add'
@@ -12623,7 +12588,6 @@ declare const editorMachine: StateMachine<
12623
12588
  | {
12624
12589
  type: 'insert.text'
12625
12590
  text: string
12626
- options?: TextInsertTextOptions
12627
12591
  }
12628
12592
  | {
12629
12593
  type: 'list item.add'
@@ -12989,7 +12953,6 @@ declare const editorMachine: StateMachine<
12989
12953
  | {
12990
12954
  type: 'insert.text'
12991
12955
  text: string
12992
- options?: TextInsertTextOptions
12993
12956
  }
12994
12957
  | {
12995
12958
  type: 'list item.add'
@@ -13308,7 +13271,6 @@ declare const editorMachine: StateMachine<
13308
13271
  | {
13309
13272
  type: 'insert.text'
13310
13273
  text: string
13311
- options?: TextInsertTextOptions
13312
13274
  }
13313
13275
  | {
13314
13276
  type: 'list item.add'
@@ -13674,7 +13636,6 @@ declare const editorMachine: StateMachine<
13674
13636
  | {
13675
13637
  type: 'insert.text'
13676
13638
  text: string
13677
- options?: TextInsertTextOptions
13678
13639
  }
13679
13640
  | {
13680
13641
  type: 'list item.add'
@@ -13990,7 +13951,6 @@ declare const editorMachine: StateMachine<
13990
13951
  | {
13991
13952
  type: 'insert.text'
13992
13953
  text: string
13993
- options?: TextInsertTextOptions
13994
13954
  }
13995
13955
  | {
13996
13956
  type: 'list item.add'
@@ -14356,7 +14316,6 @@ declare const editorMachine: StateMachine<
14356
14316
  | {
14357
14317
  type: 'insert.text'
14358
14318
  text: string
14359
- options?: TextInsertTextOptions
14360
14319
  }
14361
14320
  | {
14362
14321
  type: 'list item.add'
@@ -14658,7 +14617,6 @@ declare const editorMachine: StateMachine<
14658
14617
  | {
14659
14618
  type: 'insert.text'
14660
14619
  text: string
14661
- options?: TextInsertTextOptions
14662
14620
  }
14663
14621
  | {
14664
14622
  type: 'list item.add'
@@ -15024,7 +14982,6 @@ declare const editorMachine: StateMachine<
15024
14982
  | {
15025
14983
  type: 'insert.text'
15026
14984
  text: string
15027
- options?: TextInsertTextOptions
15028
14985
  }
15029
14986
  | {
15030
14987
  type: 'list item.add'
@@ -15329,7 +15286,6 @@ declare const editorMachine: StateMachine<
15329
15286
  | {
15330
15287
  type: 'insert.text'
15331
15288
  text: string
15332
- options?: TextInsertTextOptions
15333
15289
  }
15334
15290
  | {
15335
15291
  type: 'list item.add'
@@ -15695,7 +15651,6 @@ declare const editorMachine: StateMachine<
15695
15651
  | {
15696
15652
  type: 'insert.text'
15697
15653
  text: string
15698
- options?: TextInsertTextOptions
15699
15654
  }
15700
15655
  | {
15701
15656
  type: 'list item.add'
@@ -15901,7 +15856,6 @@ declare const editorMachine: StateMachine<
15901
15856
  | {
15902
15857
  type: 'insert.text'
15903
15858
  text: string
15904
- options?: TextInsertTextOptions
15905
15859
  }
15906
15860
  | ExternalSyntheticBehaviorEvent,
15907
15861
  | {
@@ -16037,7 +15991,6 @@ declare const editorMachine: StateMachine<
16037
15991
  | {
16038
15992
  type: 'insert.text'
16039
15993
  text: string
16040
- options?: TextInsertTextOptions
16041
15994
  }
16042
15995
  | {
16043
15996
  type: 'list item.add'
@@ -16403,7 +16356,6 @@ declare const editorMachine: StateMachine<
16403
16356
  | {
16404
16357
  type: 'insert.text'
16405
16358
  text: string
16406
- options?: TextInsertTextOptions
16407
16359
  }
16408
16360
  | {
16409
16361
  type: 'list item.add'
@@ -16714,7 +16666,6 @@ declare const editorMachine: StateMachine<
16714
16666
  | {
16715
16667
  type: 'insert.text'
16716
16668
  text: string
16717
- options?: TextInsertTextOptions
16718
16669
  }
16719
16670
  | {
16720
16671
  type: 'list item.add'
@@ -17080,7 +17031,6 @@ declare const editorMachine: StateMachine<
17080
17031
  | {
17081
17032
  type: 'insert.text'
17082
17033
  text: string
17083
- options?: TextInsertTextOptions
17084
17034
  }
17085
17035
  | {
17086
17036
  type: 'list item.add'
@@ -17392,7 +17342,6 @@ declare const editorMachine: StateMachine<
17392
17342
  | {
17393
17343
  type: 'insert.text'
17394
17344
  text: string
17395
- options?: TextInsertTextOptions
17396
17345
  }
17397
17346
  | {
17398
17347
  type: 'list item.add'
@@ -17758,7 +17707,6 @@ declare const editorMachine: StateMachine<
17758
17707
  | {
17759
17708
  type: 'insert.text'
17760
17709
  text: string
17761
- options?: TextInsertTextOptions
17762
17710
  }
17763
17711
  | {
17764
17712
  type: 'list item.add'
@@ -18061,7 +18009,6 @@ declare const editorMachine: StateMachine<
18061
18009
  | {
18062
18010
  type: 'insert.text'
18063
18011
  text: string
18064
- options?: TextInsertTextOptions
18065
18012
  }
18066
18013
  | {
18067
18014
  type: 'list item.add'
@@ -18427,7 +18374,6 @@ declare const editorMachine: StateMachine<
18427
18374
  | {
18428
18375
  type: 'insert.text'
18429
18376
  text: string
18430
- options?: TextInsertTextOptions
18431
18377
  }
18432
18378
  | {
18433
18379
  type: 'list item.add'
@@ -18734,7 +18680,6 @@ declare const editorMachine: StateMachine<
18734
18680
  | {
18735
18681
  type: 'insert.text'
18736
18682
  text: string
18737
- options?: TextInsertTextOptions
18738
18683
  }
18739
18684
  | {
18740
18685
  type: 'list item.add'
@@ -19100,7 +19045,6 @@ declare const editorMachine: StateMachine<
19100
19045
  | {
19101
19046
  type: 'insert.text'
19102
19047
  text: string
19103
- options?: TextInsertTextOptions
19104
19048
  }
19105
19049
  | {
19106
19050
  type: 'list item.add'
@@ -19411,7 +19355,6 @@ declare const editorMachine: StateMachine<
19411
19355
  | {
19412
19356
  type: 'insert.text'
19413
19357
  text: string
19414
- options?: TextInsertTextOptions
19415
19358
  }
19416
19359
  | {
19417
19360
  type: 'list item.add'
@@ -19777,7 +19720,6 @@ declare const editorMachine: StateMachine<
19777
19720
  | {
19778
19721
  type: 'insert.text'
19779
19722
  text: string
19780
- options?: TextInsertTextOptions
19781
19723
  }
19782
19724
  | {
19783
19725
  type: 'list item.add'
@@ -20102,7 +20044,6 @@ declare const editorMachine: StateMachine<
20102
20044
  | {
20103
20045
  type: 'insert.text'
20104
20046
  text: string
20105
- options?: TextInsertTextOptions
20106
20047
  }
20107
20048
  | {
20108
20049
  type: 'list item.add'
@@ -20499,7 +20440,6 @@ declare const editorMachine: StateMachine<
20499
20440
  | {
20500
20441
  type: 'insert.text'
20501
20442
  text: string
20502
- options?: TextInsertTextOptions
20503
20443
  }
20504
20444
  | {
20505
20445
  type: 'list item.add'
@@ -20860,7 +20800,6 @@ declare const editorMachine: StateMachine<
20860
20800
  | {
20861
20801
  type: 'insert.text'
20862
20802
  text: string
20863
- options?: TextInsertTextOptions
20864
20803
  }
20865
20804
  | {
20866
20805
  type: 'list item.add'
@@ -21238,7 +21177,6 @@ declare const editorMachine: StateMachine<
21238
21177
  | {
21239
21178
  type: 'insert.text'
21240
21179
  text: string
21241
- options?: TextInsertTextOptions
21242
21180
  }
21243
21181
  | {
21244
21182
  type: 'list item.add'
@@ -21599,7 +21537,6 @@ declare const editorMachine: StateMachine<
21599
21537
  | {
21600
21538
  type: 'insert.text'
21601
21539
  text: string
21602
- options?: TextInsertTextOptions
21603
21540
  }
21604
21541
  | {
21605
21542
  type: 'list item.add'
@@ -22337,6 +22274,9 @@ declare interface PortableTextSlateEditor extends ReactEditor {
22337
22274
  redo: () => void
22338
22275
  }
22339
22276
 
22277
+ /**************************************
22278
+ * Resolve behavior event
22279
+ **************************************/
22340
22280
  declare type ResolveBehaviorEvent<
22341
22281
  TBehaviorEventType extends
22342
22282
  | '*'
@@ -22566,7 +22506,6 @@ declare type SyntheticBehaviorEvent =
22566
22506
  | {
22567
22507
  type: SyntheticBehaviorEventType<'insert', 'text'>
22568
22508
  text: string
22569
- options?: TextInsertTextOptions
22570
22509
  }
22571
22510
  | {
22572
22511
  type: SyntheticBehaviorEventType<'list item', 'add'>
@@ -22662,9 +22601,6 @@ declare type SyntheticBehaviorEvent =
22662
22601
  >
22663
22602
  }
22664
22603
 
22665
- /**************************************
22666
- * Synthetic events
22667
- **************************************/
22668
22604
  declare type SyntheticBehaviorEventNamespace =
22669
22605
  | 'annotation'
22670
22606
  | 'block'
@@ -22682,6 +22618,9 @@ declare type SyntheticBehaviorEventNamespace =
22682
22618
  | 'serialization'
22683
22619
  | 'style'
22684
22620
 
22621
+ /**************************************
22622
+ * Synthetic events
22623
+ **************************************/
22685
22624
  declare type SyntheticBehaviorEventType<
22686
22625
  TNamespace extends SyntheticBehaviorEventNamespace,
22687
22626
  TType extends string = '',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@portabletext/editor",
3
- "version": "1.41.4",
3
+ "version": "1.42.0",
4
4
  "description": "Portable Text Editor made in React",
5
5
  "keywords": [
6
6
  "sanity",
@@ -98,8 +98,8 @@
98
98
  "@typescript-eslint/eslint-plugin": "^8.26.1",
99
99
  "@typescript-eslint/parser": "^8.26.1",
100
100
  "@vitejs/plugin-react": "^4.3.4",
101
- "@vitest/browser": "^3.0.8",
102
- "@vitest/coverage-istanbul": "^3.0.8",
101
+ "@vitest/browser": "^3.0.9",
102
+ "@vitest/coverage-istanbul": "^3.0.9",
103
103
  "babel-plugin-react-compiler": "19.0.0-beta-3229e95-20250315",
104
104
  "eslint": "8.57.1",
105
105
  "eslint-plugin-react-compiler": "19.0.0-beta-3229e95-20250315",
@@ -110,7 +110,7 @@
110
110
  "rxjs": "^7.8.2",
111
111
  "typescript": "5.8.2",
112
112
  "vite": "^6.2.0",
113
- "vitest": "^3.0.8",
113
+ "vitest": "^3.0.9",
114
114
  "vitest-browser-react": "^0.1.1",
115
115
  "racejar": "1.2.3"
116
116
  },
@@ -1,4 +1,4 @@
1
- import type {InternalBehaviorAction} from '../behaviors/behavior.types'
1
+ import type {InternalBehaviorAction} from '../behaviors/behavior.types.action'
2
2
  import type {EditorContext} from '../editor/editor-snapshot'
3
3
  import {
4
4
  addAnnotationActionImplementation,
@@ -1,6 +1,6 @@
1
1
  import {isHotkey} from '../internal-utils/is-hotkey'
2
2
  import * as selectors from '../selectors'
3
- import {defineBehavior} from './behavior.types'
3
+ import {defineBehavior} from './behavior.types.behavior'
4
4
 
5
5
  /**
6
6
  * @beta
@@ -1,5 +1,6 @@
1
1
  import * as selectors from '../selectors'
2
- import {defineBehavior, raise} from './behavior.types'
2
+ import {raise} from './behavior.types.action'
3
+ import {defineBehavior} from './behavior.types.behavior'
3
4
 
4
5
  const addAnnotationOnCollapsedSelection = defineBehavior({
5
6
  on: 'annotation.add',
@@ -2,7 +2,8 @@ import {isPortableTextTextBlock} from '@sanity/types'
2
2
  import {isHotkey} from '../internal-utils/is-hotkey'
3
3
  import * as selectors from '../selectors'
4
4
  import {isEmptyTextBlock} from '../utils/util.is-empty-text-block'
5
- import {defineBehavior, raise} from './behavior.types'
5
+ import {raise} from './behavior.types.action'
6
+ import {defineBehavior} from './behavior.types.behavior'
6
7
 
7
8
  const arrowDownOnLonelyBlockObject = defineBehavior({
8
9
  on: 'keyboard.keydown',
@@ -1,5 +1,6 @@
1
1
  import {isHotkey} from '../internal-utils/is-hotkey'
2
- import {defineBehavior, raise} from './behavior.types'
2
+ import {raise} from './behavior.types.action'
3
+ import {defineBehavior} from './behavior.types.behavior'
3
4
 
4
5
  export const coreDecoratorBehaviors = {
5
6
  strongShortcut: defineBehavior({
@@ -1,5 +1,5 @@
1
1
  import * as selectors from '../selectors'
2
- import {defineBehavior} from './behavior.types'
2
+ import {defineBehavior} from './behavior.types.behavior'
3
3
 
4
4
  export const coreDndBehaviors = [
5
5
  /**
@@ -1,5 +1,6 @@
1
1
  import * as selectors from '../selectors'
2
- import {defineBehavior, raise} from './behavior.types'
2
+ import {raise} from './behavior.types.action'
3
+ import {defineBehavior} from './behavior.types.behavior'
3
4
 
4
5
  const breakingAtTheEndOfTextBlock = defineBehavior({
5
6
  on: 'insert.break',
@@ -2,7 +2,8 @@ import {createGuards} from '../behavior-actions/behavior.guards'
2
2
  import {isHotkey} from '../internal-utils/is-hotkey'
3
3
  import * as selectors from '../selectors'
4
4
  import {isEmptyTextBlock} from '../utils/util.is-empty-text-block'
5
- import {defineBehavior, raise} from './behavior.types'
5
+ import {raise} from './behavior.types.action'
6
+ import {defineBehavior} from './behavior.types.behavior'
6
7
 
7
8
  const MAX_LIST_LEVEL = 10
8
9
 
@@ -3,7 +3,7 @@ import {createPairRegex} from '../internal-utils/get-text-to-emphasize'
3
3
  import * as selectors from '../selectors'
4
4
  import type {BlockOffset} from '../types/block-offset'
5
5
  import * as utils from '../utils'
6
- import {defineBehavior} from './behavior.types'
6
+ import {defineBehavior} from './behavior.types.behavior'
7
7
 
8
8
  export function createDecoratorPairBehavior(config: {
9
9
  decorator: ({schema}: {schema: EditorSchema}) => string | undefined
@@ -1,5 +1,6 @@
1
1
  import {keyIs} from '../internal-utils/key-is'
2
- import {defineBehavior, raise} from './behavior.types'
2
+ import {raise} from './behavior.types.action'
3
+ import {defineBehavior} from './behavior.types.behavior'
3
4
 
4
5
  /**
5
6
  * On WebKit, Shift+Enter results in an `insertParagraph` input event rather
@@ -1,7 +1,8 @@
1
1
  import * as selectors from '../selectors'
2
2
  import {blockOffsetsToSelection} from '../utils'
3
3
  import {raiseInsertSoftBreak} from './behavior.default.raise-soft-break'
4
- import {defineBehavior, raise} from './behavior.types'
4
+ import {raise} from './behavior.types.action'
5
+ import {defineBehavior} from './behavior.types.behavior'
5
6
 
6
7
  const toggleAnnotationOff = defineBehavior({
7
8
  on: 'annotation.toggle',
@@ -1,7 +1,7 @@
1
1
  import {assertEvent, assign, createActor, setup} from 'xstate'
2
2
  import {isHotkey} from '../internal-utils/is-hotkey'
3
3
  import * as selectors from '../selectors'
4
- import {defineBehavior} from './behavior.types'
4
+ import {defineBehavior} from './behavior.types.behavior'
5
5
 
6
6
  const emojiCharRegEx = /^[a-zA-Z-_0-9]{1}$/
7
7
  const incompleteEmojiRegEx = /:([a-zA-Z-_0-9]+)$/
@@ -1,7 +1,7 @@
1
1
  import type {EditorSchema} from '../editor/define-schema'
2
2
  import {looksLikeUrl} from '../internal-utils/looks-like-url'
3
3
  import * as selectors from '../selectors'
4
- import {defineBehavior} from './behavior.types'
4
+ import {defineBehavior} from './behavior.types.behavior'
5
5
 
6
6
  /**
7
7
  * @beta