@portabletext/editor 1.47.2 → 1.47.4

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.
@@ -664,6 +664,7 @@ declare const editorMachine: StateMachine<
664
664
  ghost?: HTMLElement
665
665
  origin: Pick<EventPosition, 'selection'>
666
666
  }
667
+ slateEditor?: PortableTextSlateEditor
667
668
  },
668
669
  | InternalPatchEvent
669
670
  | MutationEvent
@@ -700,6 +701,14 @@ declare const editorMachine: StateMachine<
700
701
  maxBlocks: number | undefined
701
702
  }
702
703
  | PatchesEvent
704
+ | {
705
+ type: 'blur'
706
+ editor: PortableTextSlateEditor
707
+ }
708
+ | {
709
+ type: 'focus'
710
+ editor: PortableTextSlateEditor
711
+ }
703
712
  | {
704
713
  type: 'normalizing'
705
714
  }
@@ -713,7 +722,6 @@ declare const editorMachine: StateMachine<
713
722
  type: 'behavior event'
714
723
  behaviorEvent: BehaviorEvent
715
724
  editor: PortableTextSlateEditor
716
- defaultActionCallback?: () => void
717
725
  nativeEvent?: {
718
726
  preventDefault: () => void
719
727
  }
@@ -836,17 +844,33 @@ declare const editorMachine: StateMachine<
836
844
  type: 'clear pending events'
837
845
  params: NonReducibleUnknown
838
846
  }
847
+ 'handle blur': {
848
+ type: 'handle blur'
849
+ params: unknown
850
+ }
851
+ 'handle focus': {
852
+ type: 'handle focus'
853
+ params: unknown
854
+ }
839
855
  'handle behavior event': {
840
856
  type: 'handle behavior event'
841
857
  params: unknown
842
858
  }
843
859
  }>,
844
- never,
860
+ {
861
+ type: 'slate is busy'
862
+ params: unknown
863
+ },
845
864
  never,
846
865
  {
847
866
  'edit mode':
848
867
  | {
849
- editable: 'dragging internally' | 'idle'
868
+ editable:
869
+ | 'dragging internally'
870
+ | 'idle'
871
+ | {
872
+ focusing: 'checking if busy' | 'busy'
873
+ }
850
874
  }
851
875
  | {
852
876
  'read only': 'read only' | 'determine initial edit mode'
@@ -969,6 +993,7 @@ declare const editorMachine: StateMachine<
969
993
  ghost?: HTMLElement
970
994
  origin: Pick<EventPosition, 'selection'>
971
995
  }
996
+ slateEditor?: PortableTextSlateEditor
972
997
  },
973
998
  | InternalPatchEvent
974
999
  | MutationEvent
@@ -1005,6 +1030,14 @@ declare const editorMachine: StateMachine<
1005
1030
  maxBlocks: number | undefined
1006
1031
  }
1007
1032
  | PatchesEvent
1033
+ | {
1034
+ type: 'blur'
1035
+ editor: PortableTextSlateEditor
1036
+ }
1037
+ | {
1038
+ type: 'focus'
1039
+ editor: PortableTextSlateEditor
1040
+ }
1008
1041
  | {
1009
1042
  type: 'normalizing'
1010
1043
  }
@@ -1018,7 +1051,6 @@ declare const editorMachine: StateMachine<
1018
1051
  type: 'behavior event'
1019
1052
  behaviorEvent: BehaviorEvent
1020
1053
  editor: PortableTextSlateEditor
1021
- defaultActionCallback?: () => void
1022
1054
  nativeEvent?: {
1023
1055
  preventDefault: () => void
1024
1056
  }
@@ -1132,6 +1164,14 @@ declare const editorMachine: StateMachine<
1132
1164
  maxBlocks: number | undefined
1133
1165
  }
1134
1166
  | PatchesEvent
1167
+ | {
1168
+ type: 'blur'
1169
+ editor: PortableTextSlateEditor
1170
+ }
1171
+ | {
1172
+ type: 'focus'
1173
+ editor: PortableTextSlateEditor
1174
+ }
1135
1175
  | {
1136
1176
  type: 'normalizing'
1137
1177
  }
@@ -1145,7 +1185,6 @@ declare const editorMachine: StateMachine<
1145
1185
  type: 'behavior event'
1146
1186
  behaviorEvent: BehaviorEvent
1147
1187
  editor: PortableTextSlateEditor
1148
- defaultActionCallback?: () => void
1149
1188
  nativeEvent?: {
1150
1189
  preventDefault: () => void
1151
1190
  }
@@ -1247,6 +1286,7 @@ declare const editorMachine: StateMachine<
1247
1286
  ghost?: HTMLElement
1248
1287
  origin: Pick<EventPosition, 'selection'>
1249
1288
  }
1289
+ slateEditor?: PortableTextSlateEditor
1250
1290
  },
1251
1291
  {
1252
1292
  type: 'notify.blurred'
@@ -1287,6 +1327,14 @@ declare const editorMachine: StateMachine<
1287
1327
  maxBlocks: number | undefined
1288
1328
  }
1289
1329
  | PatchesEvent
1330
+ | {
1331
+ type: 'blur'
1332
+ editor: PortableTextSlateEditor
1333
+ }
1334
+ | {
1335
+ type: 'focus'
1336
+ editor: PortableTextSlateEditor
1337
+ }
1290
1338
  | {
1291
1339
  type: 'normalizing'
1292
1340
  }
@@ -1300,7 +1348,6 @@ declare const editorMachine: StateMachine<
1300
1348
  type: 'behavior event'
1301
1349
  behaviorEvent: BehaviorEvent
1302
1350
  editor: PortableTextSlateEditor
1303
- defaultActionCallback?: () => void
1304
1351
  nativeEvent?: {
1305
1352
  preventDefault: () => void
1306
1353
  }
@@ -1442,6 +1489,7 @@ declare const editorMachine: StateMachine<
1442
1489
  ghost?: HTMLElement
1443
1490
  origin: Pick<EventPosition, 'selection'>
1444
1491
  }
1492
+ slateEditor?: PortableTextSlateEditor
1445
1493
  },
1446
1494
  {
1447
1495
  type: 'notify.done loading'
@@ -1481,6 +1529,14 @@ declare const editorMachine: StateMachine<
1481
1529
  maxBlocks: number | undefined
1482
1530
  }
1483
1531
  | PatchesEvent
1532
+ | {
1533
+ type: 'blur'
1534
+ editor: PortableTextSlateEditor
1535
+ }
1536
+ | {
1537
+ type: 'focus'
1538
+ editor: PortableTextSlateEditor
1539
+ }
1484
1540
  | {
1485
1541
  type: 'normalizing'
1486
1542
  }
@@ -1494,7 +1550,6 @@ declare const editorMachine: StateMachine<
1494
1550
  type: 'behavior event'
1495
1551
  behaviorEvent: BehaviorEvent
1496
1552
  editor: PortableTextSlateEditor
1497
- defaultActionCallback?: () => void
1498
1553
  nativeEvent?: {
1499
1554
  preventDefault: () => void
1500
1555
  }
@@ -1636,6 +1691,7 @@ declare const editorMachine: StateMachine<
1636
1691
  ghost?: HTMLElement
1637
1692
  origin: Pick<EventPosition, 'selection'>
1638
1693
  }
1694
+ slateEditor?: PortableTextSlateEditor
1639
1695
  },
1640
1696
  {
1641
1697
  type: 'notify.error'
@@ -1678,6 +1734,14 @@ declare const editorMachine: StateMachine<
1678
1734
  maxBlocks: number | undefined
1679
1735
  }
1680
1736
  | PatchesEvent
1737
+ | {
1738
+ type: 'blur'
1739
+ editor: PortableTextSlateEditor
1740
+ }
1741
+ | {
1742
+ type: 'focus'
1743
+ editor: PortableTextSlateEditor
1744
+ }
1681
1745
  | {
1682
1746
  type: 'normalizing'
1683
1747
  }
@@ -1691,7 +1755,6 @@ declare const editorMachine: StateMachine<
1691
1755
  type: 'behavior event'
1692
1756
  behaviorEvent: BehaviorEvent
1693
1757
  editor: PortableTextSlateEditor
1694
- defaultActionCallback?: () => void
1695
1758
  nativeEvent?: {
1696
1759
  preventDefault: () => void
1697
1760
  }
@@ -1833,6 +1896,7 @@ declare const editorMachine: StateMachine<
1833
1896
  ghost?: HTMLElement
1834
1897
  origin: Pick<EventPosition, 'selection'>
1835
1898
  }
1899
+ slateEditor?: PortableTextSlateEditor
1836
1900
  },
1837
1901
  {
1838
1902
  type: 'notify.invalid value'
@@ -1874,6 +1938,14 @@ declare const editorMachine: StateMachine<
1874
1938
  maxBlocks: number | undefined
1875
1939
  }
1876
1940
  | PatchesEvent
1941
+ | {
1942
+ type: 'blur'
1943
+ editor: PortableTextSlateEditor
1944
+ }
1945
+ | {
1946
+ type: 'focus'
1947
+ editor: PortableTextSlateEditor
1948
+ }
1877
1949
  | {
1878
1950
  type: 'normalizing'
1879
1951
  }
@@ -1887,7 +1959,6 @@ declare const editorMachine: StateMachine<
1887
1959
  type: 'behavior event'
1888
1960
  behaviorEvent: BehaviorEvent
1889
1961
  editor: PortableTextSlateEditor
1890
- defaultActionCallback?: () => void
1891
1962
  nativeEvent?: {
1892
1963
  preventDefault: () => void
1893
1964
  }
@@ -2029,6 +2100,7 @@ declare const editorMachine: StateMachine<
2029
2100
  ghost?: HTMLElement
2030
2101
  origin: Pick<EventPosition, 'selection'>
2031
2102
  }
2103
+ slateEditor?: PortableTextSlateEditor
2032
2104
  },
2033
2105
  {
2034
2106
  type: 'notify.focused'
@@ -2069,6 +2141,14 @@ declare const editorMachine: StateMachine<
2069
2141
  maxBlocks: number | undefined
2070
2142
  }
2071
2143
  | PatchesEvent
2144
+ | {
2145
+ type: 'blur'
2146
+ editor: PortableTextSlateEditor
2147
+ }
2148
+ | {
2149
+ type: 'focus'
2150
+ editor: PortableTextSlateEditor
2151
+ }
2072
2152
  | {
2073
2153
  type: 'normalizing'
2074
2154
  }
@@ -2082,7 +2162,6 @@ declare const editorMachine: StateMachine<
2082
2162
  type: 'behavior event'
2083
2163
  behaviorEvent: BehaviorEvent
2084
2164
  editor: PortableTextSlateEditor
2085
- defaultActionCallback?: () => void
2086
2165
  nativeEvent?: {
2087
2166
  preventDefault: () => void
2088
2167
  }
@@ -2225,6 +2304,7 @@ declare const editorMachine: StateMachine<
2225
2304
  ghost?: HTMLElement
2226
2305
  origin: Pick<EventPosition, 'selection'>
2227
2306
  }
2307
+ slateEditor?: PortableTextSlateEditor
2228
2308
  },
2229
2309
  {
2230
2310
  type: 'notify.selection'
@@ -2265,6 +2345,14 @@ declare const editorMachine: StateMachine<
2265
2345
  maxBlocks: number | undefined
2266
2346
  }
2267
2347
  | PatchesEvent
2348
+ | {
2349
+ type: 'blur'
2350
+ editor: PortableTextSlateEditor
2351
+ }
2352
+ | {
2353
+ type: 'focus'
2354
+ editor: PortableTextSlateEditor
2355
+ }
2268
2356
  | {
2269
2357
  type: 'normalizing'
2270
2358
  }
@@ -2278,7 +2366,6 @@ declare const editorMachine: StateMachine<
2278
2366
  type: 'behavior event'
2279
2367
  behaviorEvent: BehaviorEvent
2280
2368
  editor: PortableTextSlateEditor
2281
- defaultActionCallback?: () => void
2282
2369
  nativeEvent?: {
2283
2370
  preventDefault: () => void
2284
2371
  }
@@ -2372,6 +2459,7 @@ declare const editorMachine: StateMachine<
2372
2459
  ghost?: HTMLElement
2373
2460
  origin: Pick<EventPosition, 'selection'>
2374
2461
  }
2462
+ slateEditor?: PortableTextSlateEditor
2375
2463
  },
2376
2464
  {
2377
2465
  type: 'notify.selection'
@@ -2412,6 +2500,14 @@ declare const editorMachine: StateMachine<
2412
2500
  maxBlocks: number | undefined
2413
2501
  }
2414
2502
  | PatchesEvent
2503
+ | {
2504
+ type: 'blur'
2505
+ editor: PortableTextSlateEditor
2506
+ }
2507
+ | {
2508
+ type: 'focus'
2509
+ editor: PortableTextSlateEditor
2510
+ }
2415
2511
  | {
2416
2512
  type: 'normalizing'
2417
2513
  }
@@ -2425,7 +2521,6 @@ declare const editorMachine: StateMachine<
2425
2521
  type: 'behavior event'
2426
2522
  behaviorEvent: BehaviorEvent
2427
2523
  editor: PortableTextSlateEditor
2428
- defaultActionCallback?: () => void
2429
2524
  nativeEvent?: {
2430
2525
  preventDefault: () => void
2431
2526
  }
@@ -2568,6 +2663,7 @@ declare const editorMachine: StateMachine<
2568
2663
  ghost?: HTMLElement
2569
2664
  origin: Pick<EventPosition, 'selection'>
2570
2665
  }
2666
+ slateEditor?: PortableTextSlateEditor
2571
2667
  },
2572
2668
  {
2573
2669
  type: 'notify.unset'
@@ -2608,6 +2704,14 @@ declare const editorMachine: StateMachine<
2608
2704
  maxBlocks: number | undefined
2609
2705
  }
2610
2706
  | PatchesEvent
2707
+ | {
2708
+ type: 'blur'
2709
+ editor: PortableTextSlateEditor
2710
+ }
2711
+ | {
2712
+ type: 'focus'
2713
+ editor: PortableTextSlateEditor
2714
+ }
2611
2715
  | {
2612
2716
  type: 'normalizing'
2613
2717
  }
@@ -2621,7 +2725,6 @@ declare const editorMachine: StateMachine<
2621
2725
  type: 'behavior event'
2622
2726
  behaviorEvent: BehaviorEvent
2623
2727
  editor: PortableTextSlateEditor
2624
- defaultActionCallback?: () => void
2625
2728
  nativeEvent?: {
2626
2729
  preventDefault: () => void
2627
2730
  }
@@ -2763,6 +2866,7 @@ declare const editorMachine: StateMachine<
2763
2866
  ghost?: HTMLElement
2764
2867
  origin: Pick<EventPosition, 'selection'>
2765
2868
  }
2869
+ slateEditor?: PortableTextSlateEditor
2766
2870
  },
2767
2871
  {
2768
2872
  type: 'notify.loading'
@@ -2802,6 +2906,14 @@ declare const editorMachine: StateMachine<
2802
2906
  maxBlocks: number | undefined
2803
2907
  }
2804
2908
  | PatchesEvent
2909
+ | {
2910
+ type: 'blur'
2911
+ editor: PortableTextSlateEditor
2912
+ }
2913
+ | {
2914
+ type: 'focus'
2915
+ editor: PortableTextSlateEditor
2916
+ }
2805
2917
  | {
2806
2918
  type: 'normalizing'
2807
2919
  }
@@ -2815,7 +2927,6 @@ declare const editorMachine: StateMachine<
2815
2927
  type: 'behavior event'
2816
2928
  behaviorEvent: BehaviorEvent
2817
2929
  editor: PortableTextSlateEditor
2818
- defaultActionCallback?: () => void
2819
2930
  nativeEvent?: {
2820
2931
  preventDefault: () => void
2821
2932
  }
@@ -2957,6 +3068,7 @@ declare const editorMachine: StateMachine<
2957
3068
  ghost?: HTMLElement
2958
3069
  origin: Pick<EventPosition, 'selection'>
2959
3070
  }
3071
+ slateEditor?: PortableTextSlateEditor
2960
3072
  },
2961
3073
  {
2962
3074
  type: 'notify.value changed'
@@ -2997,6 +3109,14 @@ declare const editorMachine: StateMachine<
2997
3109
  maxBlocks: number | undefined
2998
3110
  }
2999
3111
  | PatchesEvent
3112
+ | {
3113
+ type: 'blur'
3114
+ editor: PortableTextSlateEditor
3115
+ }
3116
+ | {
3117
+ type: 'focus'
3118
+ editor: PortableTextSlateEditor
3119
+ }
3000
3120
  | {
3001
3121
  type: 'normalizing'
3002
3122
  }
@@ -3010,7 +3130,6 @@ declare const editorMachine: StateMachine<
3010
3130
  type: 'behavior event'
3011
3131
  behaviorEvent: BehaviorEvent
3012
3132
  editor: PortableTextSlateEditor
3013
- defaultActionCallback?: () => void
3014
3133
  nativeEvent?: {
3015
3134
  preventDefault: () => void
3016
3135
  }
@@ -3158,6 +3277,7 @@ declare const editorMachine: StateMachine<
3158
3277
  ghost?: HTMLElement
3159
3278
  origin: Pick<EventPosition, 'selection'>
3160
3279
  }
3280
+ slateEditor?: PortableTextSlateEditor
3161
3281
  },
3162
3282
  PatchesEvent,
3163
3283
  | InternalPatchEvent
@@ -3195,6 +3315,14 @@ declare const editorMachine: StateMachine<
3195
3315
  maxBlocks: number | undefined
3196
3316
  }
3197
3317
  | PatchesEvent
3318
+ | {
3319
+ type: 'blur'
3320
+ editor: PortableTextSlateEditor
3321
+ }
3322
+ | {
3323
+ type: 'focus'
3324
+ editor: PortableTextSlateEditor
3325
+ }
3198
3326
  | {
3199
3327
  type: 'normalizing'
3200
3328
  }
@@ -3208,7 +3336,6 @@ declare const editorMachine: StateMachine<
3208
3336
  type: 'behavior event'
3209
3337
  behaviorEvent: BehaviorEvent
3210
3338
  editor: PortableTextSlateEditor
3211
- defaultActionCallback?: () => void
3212
3339
  nativeEvent?: {
3213
3340
  preventDefault: () => void
3214
3341
  }
@@ -3353,6 +3480,7 @@ declare const editorMachine: StateMachine<
3353
3480
  ghost?: HTMLElement
3354
3481
  origin: Pick<EventPosition, 'selection'>
3355
3482
  }
3483
+ slateEditor?: PortableTextSlateEditor
3356
3484
  },
3357
3485
  {
3358
3486
  type: 'update key generator'
@@ -3393,6 +3521,14 @@ declare const editorMachine: StateMachine<
3393
3521
  maxBlocks: number | undefined
3394
3522
  }
3395
3523
  | PatchesEvent
3524
+ | {
3525
+ type: 'blur'
3526
+ editor: PortableTextSlateEditor
3527
+ }
3528
+ | {
3529
+ type: 'focus'
3530
+ editor: PortableTextSlateEditor
3531
+ }
3396
3532
  | {
3397
3533
  type: 'normalizing'
3398
3534
  }
@@ -3406,7 +3542,6 @@ declare const editorMachine: StateMachine<
3406
3542
  type: 'behavior event'
3407
3543
  behaviorEvent: BehaviorEvent
3408
3544
  editor: PortableTextSlateEditor
3409
- defaultActionCallback?: () => void
3410
3545
  nativeEvent?: {
3411
3546
  preventDefault: () => void
3412
3547
  }
@@ -3505,6 +3640,7 @@ declare const editorMachine: StateMachine<
3505
3640
  ghost?: HTMLElement
3506
3641
  origin: Pick<EventPosition, 'selection'>
3507
3642
  }
3643
+ slateEditor?: PortableTextSlateEditor
3508
3644
  },
3509
3645
  {
3510
3646
  type: 'update value'
@@ -3545,6 +3681,14 @@ declare const editorMachine: StateMachine<
3545
3681
  maxBlocks: number | undefined
3546
3682
  }
3547
3683
  | PatchesEvent
3684
+ | {
3685
+ type: 'blur'
3686
+ editor: PortableTextSlateEditor
3687
+ }
3688
+ | {
3689
+ type: 'focus'
3690
+ editor: PortableTextSlateEditor
3691
+ }
3548
3692
  | {
3549
3693
  type: 'normalizing'
3550
3694
  }
@@ -3558,7 +3702,6 @@ declare const editorMachine: StateMachine<
3558
3702
  type: 'behavior event'
3559
3703
  behaviorEvent: BehaviorEvent
3560
3704
  editor: PortableTextSlateEditor
3561
- defaultActionCallback?: () => void
3562
3705
  nativeEvent?: {
3563
3706
  preventDefault: () => void
3564
3707
  }
@@ -3654,6 +3797,7 @@ declare const editorMachine: StateMachine<
3654
3797
  ghost?: HTMLElement
3655
3798
  origin: Pick<EventPosition, 'selection'>
3656
3799
  }
3800
+ slateEditor?: PortableTextSlateEditor
3657
3801
  },
3658
3802
  {
3659
3803
  type: 'update maxBlocks'
@@ -3694,6 +3838,14 @@ declare const editorMachine: StateMachine<
3694
3838
  maxBlocks: number | undefined
3695
3839
  }
3696
3840
  | PatchesEvent
3841
+ | {
3842
+ type: 'blur'
3843
+ editor: PortableTextSlateEditor
3844
+ }
3845
+ | {
3846
+ type: 'focus'
3847
+ editor: PortableTextSlateEditor
3848
+ }
3697
3849
  | {
3698
3850
  type: 'normalizing'
3699
3851
  }
@@ -3707,7 +3859,6 @@ declare const editorMachine: StateMachine<
3707
3859
  type: 'behavior event'
3708
3860
  behaviorEvent: BehaviorEvent
3709
3861
  editor: PortableTextSlateEditor
3710
- defaultActionCallback?: () => void
3711
3862
  nativeEvent?: {
3712
3863
  preventDefault: () => void
3713
3864
  }
@@ -3815,12 +3966,12 @@ declare const editorMachine: StateMachine<
3815
3966
  ghost?: HTMLElement
3816
3967
  origin: Pick<EventPosition, 'selection'>
3817
3968
  }
3969
+ slateEditor?: PortableTextSlateEditor
3818
3970
  },
3819
3971
  {
3820
3972
  type: 'behavior event'
3821
3973
  behaviorEvent: BehaviorEvent
3822
3974
  editor: PortableTextSlateEditor
3823
- defaultActionCallback?: () => void
3824
3975
  nativeEvent?: {
3825
3976
  preventDefault: () => void
3826
3977
  }
@@ -3853,6 +4004,7 @@ declare const editorMachine: StateMachine<
3853
4004
  ghost?: HTMLElement
3854
4005
  origin: Pick<EventPosition, 'selection'>
3855
4006
  }
4007
+ slateEditor?: PortableTextSlateEditor
3856
4008
  },
3857
4009
  {
3858
4010
  type: 'done syncing initial value'
@@ -3885,6 +4037,7 @@ declare const editorMachine: StateMachine<
3885
4037
  ghost?: HTMLElement
3886
4038
  origin: Pick<EventPosition, 'selection'>
3887
4039
  }
4040
+ slateEditor?: PortableTextSlateEditor
3888
4041
  },
3889
4042
  {
3890
4043
  type: 'update readOnly'
@@ -3918,6 +4071,7 @@ declare const editorMachine: StateMachine<
3918
4071
  ghost?: HTMLElement
3919
4072
  origin: Pick<EventPosition, 'selection'>
3920
4073
  }
4074
+ slateEditor?: PortableTextSlateEditor
3921
4075
  },
3922
4076
  {
3923
4077
  type: 'update readOnly'
@@ -3930,6 +4084,169 @@ declare const editorMachine: StateMachine<
3930
4084
  readonly 'behavior event': {
3931
4085
  readonly actions: 'handle behavior event'
3932
4086
  }
4087
+ readonly 'blur': {
4088
+ readonly actions: 'handle blur'
4089
+ }
4090
+ readonly 'focus': {
4091
+ readonly target: '.focusing'
4092
+ readonly actions: readonly [
4093
+ ActionFunction<
4094
+ {
4095
+ behaviors: Set<Behavior>
4096
+ converters: Set<Converter>
4097
+ keyGenerator: () => string
4098
+ pendingEvents: Array<InternalPatchEvent | MutationEvent>
4099
+ schema: EditorSchema
4100
+ initialReadOnly: boolean
4101
+ maxBlocks: number | undefined
4102
+ selection: EditorSelection
4103
+ incomingValue: Array<PortableTextBlock> | undefined
4104
+ internalDrag?: {
4105
+ ghost?: HTMLElement
4106
+ origin: Pick<EventPosition, 'selection'>
4107
+ }
4108
+ slateEditor?: PortableTextSlateEditor
4109
+ },
4110
+ {
4111
+ type: 'focus'
4112
+ editor: PortableTextSlateEditor
4113
+ },
4114
+ | InternalPatchEvent
4115
+ | MutationEvent
4116
+ | {
4117
+ type: 'add behavior'
4118
+ behavior: Behavior
4119
+ }
4120
+ | {
4121
+ type: 'remove behavior'
4122
+ behavior: Behavior
4123
+ }
4124
+ | {
4125
+ type: 'update readOnly'
4126
+ readOnly: boolean
4127
+ }
4128
+ | {
4129
+ type: 'update schema'
4130
+ schema: EditorSchema
4131
+ }
4132
+ | {
4133
+ type: 'update behaviors'
4134
+ behaviors: Array<Behavior>
4135
+ }
4136
+ | {
4137
+ type: 'update key generator'
4138
+ keyGenerator: () => string
4139
+ }
4140
+ | {
4141
+ type: 'update value'
4142
+ value: Array<PortableTextBlock> | undefined
4143
+ }
4144
+ | {
4145
+ type: 'update maxBlocks'
4146
+ maxBlocks: number | undefined
4147
+ }
4148
+ | PatchesEvent
4149
+ | {
4150
+ type: 'blur'
4151
+ editor: PortableTextSlateEditor
4152
+ }
4153
+ | {
4154
+ type: 'focus'
4155
+ editor: PortableTextSlateEditor
4156
+ }
4157
+ | {
4158
+ type: 'normalizing'
4159
+ }
4160
+ | {
4161
+ type: 'done normalizing'
4162
+ }
4163
+ | {
4164
+ type: 'done syncing initial value'
4165
+ }
4166
+ | {
4167
+ type: 'behavior event'
4168
+ behaviorEvent: BehaviorEvent
4169
+ editor: PortableTextSlateEditor
4170
+ nativeEvent?: {
4171
+ preventDefault: () => void
4172
+ }
4173
+ }
4174
+ | {
4175
+ type: 'notify.patch'
4176
+ patch: Patch
4177
+ }
4178
+ | {
4179
+ type: 'notify.mutation'
4180
+ patches: Array<Patch>
4181
+ snapshot: Array<PortableTextBlock> | undefined
4182
+ value: Array<PortableTextBlock> | undefined
4183
+ }
4184
+ | {
4185
+ type: 'notify.blurred'
4186
+ event: FocusEvent_2<HTMLDivElement, Element>
4187
+ }
4188
+ | {
4189
+ type: 'notify.done loading'
4190
+ }
4191
+ | {
4192
+ type: 'notify.editable'
4193
+ }
4194
+ | {
4195
+ type: 'notify.error'
4196
+ name: string
4197
+ description: string
4198
+ data: unknown
4199
+ }
4200
+ | {
4201
+ type: 'notify.focused'
4202
+ event: FocusEvent_2<HTMLDivElement, Element>
4203
+ }
4204
+ | {
4205
+ type: 'notify.invalid value'
4206
+ resolution: InvalidValueResolution | null
4207
+ value: Array<PortableTextBlock> | undefined
4208
+ }
4209
+ | {
4210
+ type: 'notify.loading'
4211
+ }
4212
+ | {
4213
+ type: 'notify.read only'
4214
+ }
4215
+ | {
4216
+ type: 'notify.ready'
4217
+ }
4218
+ | {
4219
+ type: 'notify.selection'
4220
+ selection: EditorSelection
4221
+ }
4222
+ | {
4223
+ type: 'notify.value changed'
4224
+ value: Array<PortableTextBlock> | undefined
4225
+ }
4226
+ | {
4227
+ type: 'notify.unset'
4228
+ previousValue: Array<PortableTextBlock>
4229
+ }
4230
+ | {
4231
+ type: 'dragstart'
4232
+ origin: Pick<EventPosition, 'selection'>
4233
+ ghost?: HTMLElement
4234
+ }
4235
+ | {
4236
+ type: 'dragend'
4237
+ }
4238
+ | {
4239
+ type: 'drop'
4240
+ },
4241
+ undefined,
4242
+ never,
4243
+ never,
4244
+ never,
4245
+ never,
4246
+ never
4247
+ >,
4248
+ ]
4249
+ }
3933
4250
  }
3934
4251
  readonly initial: 'idle'
3935
4252
  readonly states: {
@@ -3954,6 +4271,7 @@ declare const editorMachine: StateMachine<
3954
4271
  ghost?: HTMLElement
3955
4272
  origin: Pick<EventPosition, 'selection'>
3956
4273
  }
4274
+ slateEditor?: PortableTextSlateEditor
3957
4275
  },
3958
4276
  {
3959
4277
  type: 'dragstart'
@@ -3995,6 +4313,14 @@ declare const editorMachine: StateMachine<
3995
4313
  maxBlocks: number | undefined
3996
4314
  }
3997
4315
  | PatchesEvent
4316
+ | {
4317
+ type: 'blur'
4318
+ editor: PortableTextSlateEditor
4319
+ }
4320
+ | {
4321
+ type: 'focus'
4322
+ editor: PortableTextSlateEditor
4323
+ }
3998
4324
  | {
3999
4325
  type: 'normalizing'
4000
4326
  }
@@ -4008,7 +4334,6 @@ declare const editorMachine: StateMachine<
4008
4334
  type: 'behavior event'
4009
4335
  behaviorEvent: BehaviorEvent
4010
4336
  editor: PortableTextSlateEditor
4011
- defaultActionCallback?: () => void
4012
4337
  nativeEvent?: {
4013
4338
  preventDefault: () => void
4014
4339
  }
@@ -4092,6 +4417,30 @@ declare const editorMachine: StateMachine<
4092
4417
  }
4093
4418
  }
4094
4419
  }
4420
+ readonly 'focusing': {
4421
+ readonly initial: 'checking if busy'
4422
+ readonly states: {
4423
+ readonly 'checking if busy': {
4424
+ readonly always: readonly [
4425
+ {
4426
+ readonly guard: 'slate is busy'
4427
+ readonly target: 'busy'
4428
+ },
4429
+ {
4430
+ readonly target: '#editor.edit mode.editable.idle'
4431
+ readonly actions: readonly ['handle focus']
4432
+ },
4433
+ ]
4434
+ }
4435
+ readonly 'busy': {
4436
+ readonly after: {
4437
+ readonly 10: {
4438
+ readonly target: 'checking if busy'
4439
+ }
4440
+ }
4441
+ }
4442
+ }
4443
+ }
4095
4444
  readonly 'dragging internally': {
4096
4445
  readonly exit: readonly [
4097
4446
  ({
@@ -4111,6 +4460,7 @@ declare const editorMachine: StateMachine<
4111
4460
  ghost?: HTMLElement
4112
4461
  origin: Pick<EventPosition, 'selection'>
4113
4462
  }
4463
+ slateEditor?: PortableTextSlateEditor
4114
4464
  },
4115
4465
  | InternalPatchEvent
4116
4466
  | MutationEvent
@@ -4147,6 +4497,14 @@ declare const editorMachine: StateMachine<
4147
4497
  maxBlocks: number | undefined
4148
4498
  }
4149
4499
  | PatchesEvent
4500
+ | {
4501
+ type: 'blur'
4502
+ editor: PortableTextSlateEditor
4503
+ }
4504
+ | {
4505
+ type: 'focus'
4506
+ editor: PortableTextSlateEditor
4507
+ }
4150
4508
  | {
4151
4509
  type: 'normalizing'
4152
4510
  }
@@ -4160,7 +4518,6 @@ declare const editorMachine: StateMachine<
4160
4518
  type: 'behavior event'
4161
4519
  behaviorEvent: BehaviorEvent
4162
4520
  editor: PortableTextSlateEditor
4163
- defaultActionCallback?: () => void
4164
4521
  nativeEvent?: {
4165
4522
  preventDefault: () => void
4166
4523
  }
@@ -4267,6 +4624,14 @@ declare const editorMachine: StateMachine<
4267
4624
  maxBlocks: number | undefined
4268
4625
  }
4269
4626
  | PatchesEvent
4627
+ | {
4628
+ type: 'blur'
4629
+ editor: PortableTextSlateEditor
4630
+ }
4631
+ | {
4632
+ type: 'focus'
4633
+ editor: PortableTextSlateEditor
4634
+ }
4270
4635
  | {
4271
4636
  type: 'normalizing'
4272
4637
  }
@@ -4280,7 +4645,6 @@ declare const editorMachine: StateMachine<
4280
4645
  type: 'behavior event'
4281
4646
  behaviorEvent: BehaviorEvent
4282
4647
  editor: PortableTextSlateEditor
4283
- defaultActionCallback?: () => void
4284
4648
  nativeEvent?: {
4285
4649
  preventDefault: () => void
4286
4650
  }
@@ -4368,6 +4732,7 @@ declare const editorMachine: StateMachine<
4368
4732
  ghost?: HTMLElement
4369
4733
  origin: Pick<EventPosition, 'selection'>
4370
4734
  }
4735
+ slateEditor?: PortableTextSlateEditor
4371
4736
  },
4372
4737
  | InternalPatchEvent
4373
4738
  | MutationEvent
@@ -4404,6 +4769,14 @@ declare const editorMachine: StateMachine<
4404
4769
  maxBlocks: number | undefined
4405
4770
  }
4406
4771
  | PatchesEvent
4772
+ | {
4773
+ type: 'blur'
4774
+ editor: PortableTextSlateEditor
4775
+ }
4776
+ | {
4777
+ type: 'focus'
4778
+ editor: PortableTextSlateEditor
4779
+ }
4407
4780
  | {
4408
4781
  type: 'normalizing'
4409
4782
  }
@@ -4417,7 +4790,6 @@ declare const editorMachine: StateMachine<
4417
4790
  type: 'behavior event'
4418
4791
  behaviorEvent: BehaviorEvent
4419
4792
  editor: PortableTextSlateEditor
4420
- defaultActionCallback?: () => void
4421
4793
  nativeEvent?: {
4422
4794
  preventDefault: () => void
4423
4795
  }
@@ -4524,6 +4896,14 @@ declare const editorMachine: StateMachine<
4524
4896
  maxBlocks: number | undefined
4525
4897
  }
4526
4898
  | PatchesEvent
4899
+ | {
4900
+ type: 'blur'
4901
+ editor: PortableTextSlateEditor
4902
+ }
4903
+ | {
4904
+ type: 'focus'
4905
+ editor: PortableTextSlateEditor
4906
+ }
4527
4907
  | {
4528
4908
  type: 'normalizing'
4529
4909
  }
@@ -4537,7 +4917,6 @@ declare const editorMachine: StateMachine<
4537
4917
  type: 'behavior event'
4538
4918
  behaviorEvent: BehaviorEvent
4539
4919
  editor: PortableTextSlateEditor
4540
- defaultActionCallback?: () => void
4541
4920
  nativeEvent?: {
4542
4921
  preventDefault: () => void
4543
4922
  }
@@ -5257,9 +5636,6 @@ declare type SyntheticBehaviorEvent =
5257
5636
  at: [KeyedSegment]
5258
5637
  props: Array<string>
5259
5638
  }
5260
- | {
5261
- type: StrictExtract<SyntheticBehaviorEventType, 'blur'>
5262
- }
5263
5639
  | {
5264
5640
  type: StrictExtract<SyntheticBehaviorEventType, 'decorator.add'>
5265
5641
  decorator: string
@@ -5288,9 +5664,6 @@ declare type SyntheticBehaviorEvent =
5288
5664
  type: StrictExtract<SyntheticBehaviorEventType, 'delete.forward'>
5289
5665
  unit: TextUnit
5290
5666
  }
5291
- | {
5292
- type: StrictExtract<SyntheticBehaviorEventType, 'focus'>
5293
- }
5294
5667
  | {
5295
5668
  type: StrictExtract<SyntheticBehaviorEventType, 'history.redo'>
5296
5669
  }
@@ -5362,14 +5735,12 @@ declare const syntheticBehaviorEventTypes: readonly [
5362
5735
  'annotation.remove',
5363
5736
  'block.set',
5364
5737
  'block.unset',
5365
- 'blur',
5366
5738
  'decorator.add',
5367
5739
  'decorator.remove',
5368
5740
  'delete',
5369
5741
  'delete.backward',
5370
5742
  'delete.block',
5371
5743
  'delete.forward',
5372
- 'focus',
5373
5744
  'history.redo',
5374
5745
  'history.undo',
5375
5746
  'insert.inline object',