@portabletext/editor 1.18.6 → 1.19.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 (37) hide show
  1. package/lib/_chunks-cjs/behavior.core.cjs +52 -35
  2. package/lib/_chunks-cjs/behavior.core.cjs.map +1 -1
  3. package/lib/_chunks-es/behavior.core.js +52 -35
  4. package/lib/_chunks-es/behavior.core.js.map +1 -1
  5. package/lib/behaviors/index.cjs +1 -0
  6. package/lib/behaviors/index.cjs.map +1 -1
  7. package/lib/behaviors/index.d.cts +76 -84
  8. package/lib/behaviors/index.d.ts +76 -84
  9. package/lib/behaviors/index.js +3 -2
  10. package/lib/index.cjs +234 -251
  11. package/lib/index.cjs.map +1 -1
  12. package/lib/index.d.cts +257 -1106
  13. package/lib/index.d.ts +257 -1106
  14. package/lib/index.js +235 -252
  15. package/lib/index.js.map +1 -1
  16. package/lib/selectors/index.cjs +12 -9
  17. package/lib/selectors/index.cjs.map +1 -1
  18. package/lib/selectors/index.js +12 -9
  19. package/lib/selectors/index.js.map +1 -1
  20. package/package.json +7 -7
  21. package/src/behavior-actions/behavior.actions.ts +28 -36
  22. package/src/behaviors/behavior.core.decorators.ts +36 -42
  23. package/src/behaviors/behavior.core.ts +4 -3
  24. package/src/behaviors/behavior.types.ts +38 -24
  25. package/src/behaviors/index.ts +1 -0
  26. package/src/editor/PortableTextEditor.tsx +14 -16
  27. package/src/editor/__tests__/self-solving.test.tsx +4 -11
  28. package/src/editor/create-editor.ts +1 -3
  29. package/src/editor/editor-machine.ts +37 -41
  30. package/src/editor/plugins/create-with-event-listeners.ts +44 -57
  31. package/src/editor/plugins/createWithHotKeys.ts +1 -11
  32. package/src/editor/plugins/createWithPortableTextMarkModel.ts +12 -1
  33. package/src/editor/plugins/createWithPortableTextSelections.ts +1 -5
  34. package/src/editor/with-applying-behavior-actions.ts +15 -0
  35. package/src/selectors/selector.get-selected-spans.test.ts +122 -0
  36. package/src/selectors/selector.get-selected-spans.ts +3 -1
  37. package/src/selectors/selector.is-active-decorator.test.ts +65 -0
package/lib/index.d.cts CHANGED
@@ -50,11 +50,14 @@ import {
50
50
  AnyActorLogic,
51
51
  AnyActorRef,
52
52
  AnyEventObject,
53
+ ConditionalRequired,
53
54
  EventObject,
54
55
  InputFrom,
56
+ IsNotNever,
55
57
  MachineSnapshot,
56
58
  MetaObject,
57
59
  NonReducibleUnknown,
60
+ RequiredLogicInput,
58
61
  Snapshot,
59
62
  StateMachine,
60
63
  StateValue,
@@ -119,6 +122,27 @@ export declare type Behavior<
119
122
  */
120
123
  export declare type BehaviorActionIntend =
121
124
  | SyntheticBehaviorEvent
125
+ | {
126
+ type: 'raise'
127
+ event: SyntheticBehaviorEvent
128
+ }
129
+ | {
130
+ type: 'annotation.toggle'
131
+ annotation: {
132
+ name: string
133
+ value: {
134
+ [prop: string]: unknown
135
+ }
136
+ }
137
+ }
138
+ | {
139
+ type: 'decorator.add'
140
+ decorator: string
141
+ }
142
+ | {
143
+ type: 'decorator.remove'
144
+ decorator: string
145
+ }
122
146
  | {
123
147
  type: 'insert.span'
124
148
  text: string
@@ -174,13 +198,6 @@ export declare type BehaviorActionIntend =
174
198
  type: 'effect'
175
199
  effect: () => void
176
200
  }
177
- | {
178
- type: 'reselect'
179
- }
180
- | {
181
- type: 'select'
182
- selection: EditorSelection
183
- }
184
201
  | {
185
202
  type: 'select.previous block'
186
203
  }
@@ -556,15 +573,13 @@ export declare type EditorEvent = PickFromUnion<
556
573
  'type',
557
574
  | 'annotation.add'
558
575
  | 'annotation.remove'
559
- | 'annotation.toggle'
560
576
  | 'blur'
561
- | 'decorator.add'
562
- | 'decorator.remove'
563
577
  | 'decorator.toggle'
564
578
  | 'focus'
565
579
  | 'insert.block object'
566
580
  | 'insert.inline object'
567
581
  | 'list item.toggle'
582
+ | 'select'
568
583
  | 'style.toggle'
569
584
  | 'patches'
570
585
  | 'update behaviors'
@@ -608,26 +623,9 @@ export declare const editorMachine: StateMachine<
608
623
  name: string
609
624
  }
610
625
  }
611
- | {
612
- type: 'annotation.toggle'
613
- annotation: {
614
- name: string
615
- value: {
616
- [prop: string]: unknown
617
- }
618
- }
619
- }
620
626
  | {
621
627
  type: 'blur'
622
628
  }
623
- | {
624
- type: 'decorator.add'
625
- decorator: string
626
- }
627
- | {
628
- type: 'decorator.remove'
629
- decorator: string
630
- }
631
629
  | {
632
630
  type: 'decorator.toggle'
633
631
  decorator: string
@@ -721,6 +719,10 @@ export declare const editorMachine: StateMachine<
721
719
  description: string
722
720
  data: unknown
723
721
  }
722
+ | {
723
+ type: 'select'
724
+ selection: EditorSelection
725
+ }
724
726
  | {
725
727
  type: 'selection'
726
728
  selection: EditorSelection
@@ -827,26 +829,9 @@ export declare const editorMachine: StateMachine<
827
829
  name: string
828
830
  }
829
831
  }
830
- | {
831
- type: 'annotation.toggle'
832
- annotation: {
833
- name: string
834
- value: {
835
- [prop: string]: unknown
836
- }
837
- }
838
- }
839
832
  | {
840
833
  type: 'blur'
841
834
  }
842
- | {
843
- type: 'decorator.add'
844
- decorator: string
845
- }
846
- | {
847
- type: 'decorator.remove'
848
- decorator: string
849
- }
850
835
  | {
851
836
  type: 'decorator.toggle'
852
837
  decorator: string
@@ -906,6 +891,10 @@ export declare const editorMachine: StateMachine<
906
891
  description: string
907
892
  data: unknown
908
893
  }
894
+ | {
895
+ type: 'select'
896
+ selection: EditorSelection
897
+ }
909
898
  | {
910
899
  type: 'selection'
911
900
  selection: EditorSelection
@@ -943,14 +932,19 @@ export declare const editorMachine: StateMachine<
943
932
  ): ActorRefFromLogic<never>
944
933
  <TLogic extends AnyActorLogic>(
945
934
  src: TLogic,
946
- options?:
947
- | {
948
- id?: never
949
- systemId?: string
950
- input?: InputFrom<TLogic> | undefined
951
- syncSnapshot?: boolean
952
- }
953
- | undefined,
935
+ ...[options]: ConditionalRequired<
936
+ [
937
+ options?:
938
+ | ({
939
+ id?: never
940
+ systemId?: string
941
+ input?: InputFrom<TLogic> | undefined
942
+ syncSnapshot?: boolean
943
+ } & {[K in RequiredLogicInput<TLogic>]: unknown})
944
+ | undefined,
945
+ ],
946
+ IsNotNever<RequiredLogicInput<TLogic>>
947
+ >
954
948
  ): ActorRefFromLogic<TLogic>
955
949
  }
956
950
  input: {
@@ -988,26 +982,9 @@ export declare const editorMachine: StateMachine<
988
982
  name: string
989
983
  }
990
984
  }
991
- | {
992
- type: 'annotation.toggle'
993
- annotation: {
994
- name: string
995
- value: {
996
- [prop: string]: unknown
997
- }
998
- }
999
- }
1000
985
  | {
1001
986
  type: 'blur'
1002
987
  }
1003
- | {
1004
- type: 'decorator.add'
1005
- decorator: string
1006
- }
1007
- | {
1008
- type: 'decorator.remove'
1009
- decorator: string
1010
- }
1011
988
  | {
1012
989
  type: 'decorator.toggle'
1013
990
  decorator: string
@@ -1101,6 +1078,10 @@ export declare const editorMachine: StateMachine<
1101
1078
  description: string
1102
1079
  data: unknown
1103
1080
  }
1081
+ | {
1082
+ type: 'select'
1083
+ selection: EditorSelection
1084
+ }
1104
1085
  | {
1105
1086
  type: 'selection'
1106
1087
  selection: EditorSelection
@@ -1141,26 +1122,9 @@ export declare const editorMachine: StateMachine<
1141
1122
  name: string
1142
1123
  }
1143
1124
  }
1144
- | {
1145
- type: 'annotation.toggle'
1146
- annotation: {
1147
- name: string
1148
- value: {
1149
- [prop: string]: unknown
1150
- }
1151
- }
1152
- }
1153
1125
  | {
1154
1126
  type: 'blur'
1155
1127
  }
1156
- | {
1157
- type: 'decorator.add'
1158
- decorator: string
1159
- }
1160
- | {
1161
- type: 'decorator.remove'
1162
- decorator: string
1163
- }
1164
1128
  | {
1165
1129
  type: 'decorator.toggle'
1166
1130
  decorator: string
@@ -1254,6 +1218,10 @@ export declare const editorMachine: StateMachine<
1254
1218
  description: string
1255
1219
  data: unknown
1256
1220
  }
1221
+ | {
1222
+ type: 'select'
1223
+ selection: EditorSelection
1224
+ }
1257
1225
  | {
1258
1226
  type: 'selection'
1259
1227
  selection: EditorSelection
@@ -1316,26 +1284,9 @@ export declare const editorMachine: StateMachine<
1316
1284
  name: string
1317
1285
  }
1318
1286
  }
1319
- | {
1320
- type: 'annotation.toggle'
1321
- annotation: {
1322
- name: string
1323
- value: {
1324
- [prop: string]: unknown
1325
- }
1326
- }
1327
- }
1328
1287
  | {
1329
1288
  type: 'blur'
1330
1289
  }
1331
- | {
1332
- type: 'decorator.add'
1333
- decorator: string
1334
- }
1335
- | {
1336
- type: 'decorator.remove'
1337
- decorator: string
1338
- }
1339
1290
  | {
1340
1291
  type: 'decorator.toggle'
1341
1292
  decorator: string
@@ -1429,6 +1380,10 @@ export declare const editorMachine: StateMachine<
1429
1380
  description: string
1430
1381
  data: unknown
1431
1382
  }
1383
+ | {
1384
+ type: 'select'
1385
+ selection: EditorSelection
1386
+ }
1432
1387
  | {
1433
1388
  type: 'selection'
1434
1389
  selection: EditorSelection
@@ -1467,26 +1422,9 @@ export declare const editorMachine: StateMachine<
1467
1422
  name: string
1468
1423
  }
1469
1424
  }
1470
- | {
1471
- type: 'annotation.toggle'
1472
- annotation: {
1473
- name: string
1474
- value: {
1475
- [prop: string]: unknown
1476
- }
1477
- }
1478
- }
1479
1425
  | {
1480
1426
  type: 'blur'
1481
1427
  }
1482
- | {
1483
- type: 'decorator.add'
1484
- decorator: string
1485
- }
1486
- | {
1487
- type: 'decorator.remove'
1488
- decorator: string
1489
- }
1490
1428
  | {
1491
1429
  type: 'decorator.toggle'
1492
1430
  decorator: string
@@ -1546,6 +1484,10 @@ export declare const editorMachine: StateMachine<
1546
1484
  description: string
1547
1485
  data: unknown
1548
1486
  }
1487
+ | {
1488
+ type: 'select'
1489
+ selection: EditorSelection
1490
+ }
1549
1491
  | {
1550
1492
  type: 'selection'
1551
1493
  selection: EditorSelection
@@ -1603,26 +1545,9 @@ export declare const editorMachine: StateMachine<
1603
1545
  name: string
1604
1546
  }
1605
1547
  }
1606
- | {
1607
- type: 'annotation.toggle'
1608
- annotation: {
1609
- name: string
1610
- value: {
1611
- [prop: string]: unknown
1612
- }
1613
- }
1614
- }
1615
1548
  | {
1616
1549
  type: 'blur'
1617
1550
  }
1618
- | {
1619
- type: 'decorator.add'
1620
- decorator: string
1621
- }
1622
- | {
1623
- type: 'decorator.remove'
1624
- decorator: string
1625
- }
1626
1551
  | {
1627
1552
  type: 'decorator.toggle'
1628
1553
  decorator: string
@@ -1716,6 +1641,10 @@ export declare const editorMachine: StateMachine<
1716
1641
  description: string
1717
1642
  data: unknown
1718
1643
  }
1644
+ | {
1645
+ type: 'select'
1646
+ selection: EditorSelection
1647
+ }
1719
1648
  | {
1720
1649
  type: 'selection'
1721
1650
  selection: EditorSelection
@@ -1754,26 +1683,9 @@ export declare const editorMachine: StateMachine<
1754
1683
  name: string
1755
1684
  }
1756
1685
  }
1757
- | {
1758
- type: 'annotation.toggle'
1759
- annotation: {
1760
- name: string
1761
- value: {
1762
- [prop: string]: unknown
1763
- }
1764
- }
1765
- }
1766
1686
  | {
1767
1687
  type: 'blur'
1768
1688
  }
1769
- | {
1770
- type: 'decorator.add'
1771
- decorator: string
1772
- }
1773
- | {
1774
- type: 'decorator.remove'
1775
- decorator: string
1776
- }
1777
1689
  | {
1778
1690
  type: 'decorator.toggle'
1779
1691
  decorator: string
@@ -1833,6 +1745,10 @@ export declare const editorMachine: StateMachine<
1833
1745
  description: string
1834
1746
  data: unknown
1835
1747
  }
1748
+ | {
1749
+ type: 'select'
1750
+ selection: EditorSelection
1751
+ }
1836
1752
  | {
1837
1753
  type: 'selection'
1838
1754
  selection: EditorSelection
@@ -1891,26 +1807,9 @@ export declare const editorMachine: StateMachine<
1891
1807
  name: string
1892
1808
  }
1893
1809
  }
1894
- | {
1895
- type: 'annotation.toggle'
1896
- annotation: {
1897
- name: string
1898
- value: {
1899
- [prop: string]: unknown
1900
- }
1901
- }
1902
- }
1903
1810
  | {
1904
1811
  type: 'blur'
1905
1812
  }
1906
- | {
1907
- type: 'decorator.add'
1908
- decorator: string
1909
- }
1910
- | {
1911
- type: 'decorator.remove'
1912
- decorator: string
1913
- }
1914
1813
  | {
1915
1814
  type: 'decorator.toggle'
1916
1815
  decorator: string
@@ -2004,6 +1903,10 @@ export declare const editorMachine: StateMachine<
2004
1903
  description: string
2005
1904
  data: unknown
2006
1905
  }
1906
+ | {
1907
+ type: 'select'
1908
+ selection: EditorSelection
1909
+ }
2007
1910
  | {
2008
1911
  type: 'selection'
2009
1912
  selection: EditorSelection
@@ -2042,26 +1945,9 @@ export declare const editorMachine: StateMachine<
2042
1945
  name: string
2043
1946
  }
2044
1947
  }
2045
- | {
2046
- type: 'annotation.toggle'
2047
- annotation: {
2048
- name: string
2049
- value: {
2050
- [prop: string]: unknown
2051
- }
2052
- }
2053
- }
2054
1948
  | {
2055
1949
  type: 'blur'
2056
1950
  }
2057
- | {
2058
- type: 'decorator.add'
2059
- decorator: string
2060
- }
2061
- | {
2062
- type: 'decorator.remove'
2063
- decorator: string
2064
- }
2065
1951
  | {
2066
1952
  type: 'decorator.toggle'
2067
1953
  decorator: string
@@ -2121,6 +2007,10 @@ export declare const editorMachine: StateMachine<
2121
2007
  description: string
2122
2008
  data: unknown
2123
2009
  }
2010
+ | {
2011
+ type: 'select'
2012
+ selection: EditorSelection
2013
+ }
2124
2014
  | {
2125
2015
  type: 'selection'
2126
2016
  selection: EditorSelection
@@ -2180,26 +2070,9 @@ export declare const editorMachine: StateMachine<
2180
2070
  name: string
2181
2071
  }
2182
2072
  }
2183
- | {
2184
- type: 'annotation.toggle'
2185
- annotation: {
2186
- name: string
2187
- value: {
2188
- [prop: string]: unknown
2189
- }
2190
- }
2191
- }
2192
2073
  | {
2193
2074
  type: 'blur'
2194
2075
  }
2195
- | {
2196
- type: 'decorator.add'
2197
- decorator: string
2198
- }
2199
- | {
2200
- type: 'decorator.remove'
2201
- decorator: string
2202
- }
2203
2076
  | {
2204
2077
  type: 'decorator.toggle'
2205
2078
  decorator: string
@@ -2293,6 +2166,10 @@ export declare const editorMachine: StateMachine<
2293
2166
  description: string
2294
2167
  data: unknown
2295
2168
  }
2169
+ | {
2170
+ type: 'select'
2171
+ selection: EditorSelection
2172
+ }
2296
2173
  | {
2297
2174
  type: 'selection'
2298
2175
  selection: EditorSelection
@@ -2331,26 +2208,9 @@ export declare const editorMachine: StateMachine<
2331
2208
  name: string
2332
2209
  }
2333
2210
  }
2334
- | {
2335
- type: 'annotation.toggle'
2336
- annotation: {
2337
- name: string
2338
- value: {
2339
- [prop: string]: unknown
2340
- }
2341
- }
2342
- }
2343
2211
  | {
2344
2212
  type: 'blur'
2345
2213
  }
2346
- | {
2347
- type: 'decorator.add'
2348
- decorator: string
2349
- }
2350
- | {
2351
- type: 'decorator.remove'
2352
- decorator: string
2353
- }
2354
2214
  | {
2355
2215
  type: 'decorator.toggle'
2356
2216
  decorator: string
@@ -2410,6 +2270,10 @@ export declare const editorMachine: StateMachine<
2410
2270
  description: string
2411
2271
  data: unknown
2412
2272
  }
2273
+ | {
2274
+ type: 'select'
2275
+ selection: EditorSelection
2276
+ }
2413
2277
  | {
2414
2278
  type: 'selection'
2415
2279
  selection: EditorSelection
@@ -2468,26 +2332,9 @@ export declare const editorMachine: StateMachine<
2468
2332
  name: string
2469
2333
  }
2470
2334
  }
2471
- | {
2472
- type: 'annotation.toggle'
2473
- annotation: {
2474
- name: string
2475
- value: {
2476
- [prop: string]: unknown
2477
- }
2478
- }
2479
- }
2480
2335
  | {
2481
2336
  type: 'blur'
2482
2337
  }
2483
- | {
2484
- type: 'decorator.add'
2485
- decorator: string
2486
- }
2487
- | {
2488
- type: 'decorator.remove'
2489
- decorator: string
2490
- }
2491
2338
  | {
2492
2339
  type: 'decorator.toggle'
2493
2340
  decorator: string
@@ -2581,6 +2428,10 @@ export declare const editorMachine: StateMachine<
2581
2428
  description: string
2582
2429
  data: unknown
2583
2430
  }
2431
+ | {
2432
+ type: 'select'
2433
+ selection: EditorSelection
2434
+ }
2584
2435
  | {
2585
2436
  type: 'selection'
2586
2437
  selection: EditorSelection
@@ -2636,26 +2487,9 @@ export declare const editorMachine: StateMachine<
2636
2487
  name: string
2637
2488
  }
2638
2489
  }
2639
- | {
2640
- type: 'annotation.toggle'
2641
- annotation: {
2642
- name: string
2643
- value: {
2644
- [prop: string]: unknown
2645
- }
2646
- }
2647
- }
2648
2490
  | {
2649
2491
  type: 'blur'
2650
2492
  }
2651
- | {
2652
- type: 'decorator.add'
2653
- decorator: string
2654
- }
2655
- | {
2656
- type: 'decorator.remove'
2657
- decorator: string
2658
- }
2659
2493
  | {
2660
2494
  type: 'decorator.toggle'
2661
2495
  decorator: string
@@ -2749,6 +2583,10 @@ export declare const editorMachine: StateMachine<
2749
2583
  description: string
2750
2584
  data: unknown
2751
2585
  }
2586
+ | {
2587
+ type: 'select'
2588
+ selection: EditorSelection
2589
+ }
2752
2590
  | {
2753
2591
  type: 'selection'
2754
2592
  selection: EditorSelection
@@ -2787,26 +2625,9 @@ export declare const editorMachine: StateMachine<
2787
2625
  name: string
2788
2626
  }
2789
2627
  }
2790
- | {
2791
- type: 'annotation.toggle'
2792
- annotation: {
2793
- name: string
2794
- value: {
2795
- [prop: string]: unknown
2796
- }
2797
- }
2798
- }
2799
2628
  | {
2800
2629
  type: 'blur'
2801
2630
  }
2802
- | {
2803
- type: 'decorator.add'
2804
- decorator: string
2805
- }
2806
- | {
2807
- type: 'decorator.remove'
2808
- decorator: string
2809
- }
2810
2631
  | {
2811
2632
  type: 'decorator.toggle'
2812
2633
  decorator: string
@@ -2866,6 +2687,10 @@ export declare const editorMachine: StateMachine<
2866
2687
  description: string
2867
2688
  data: unknown
2868
2689
  }
2690
+ | {
2691
+ type: 'select'
2692
+ selection: EditorSelection
2693
+ }
2869
2694
  | {
2870
2695
  type: 'selection'
2871
2696
  selection: EditorSelection
@@ -2924,26 +2749,9 @@ export declare const editorMachine: StateMachine<
2924
2749
  name: string
2925
2750
  }
2926
2751
  }
2927
- | {
2928
- type: 'annotation.toggle'
2929
- annotation: {
2930
- name: string
2931
- value: {
2932
- [prop: string]: unknown
2933
- }
2934
- }
2935
- }
2936
2752
  | {
2937
2753
  type: 'blur'
2938
2754
  }
2939
- | {
2940
- type: 'decorator.add'
2941
- decorator: string
2942
- }
2943
- | {
2944
- type: 'decorator.remove'
2945
- decorator: string
2946
- }
2947
2755
  | {
2948
2756
  type: 'decorator.toggle'
2949
2757
  decorator: string
@@ -3037,6 +2845,10 @@ export declare const editorMachine: StateMachine<
3037
2845
  description: string
3038
2846
  data: unknown
3039
2847
  }
2848
+ | {
2849
+ type: 'select'
2850
+ selection: EditorSelection
2851
+ }
3040
2852
  | {
3041
2853
  type: 'selection'
3042
2854
  selection: EditorSelection
@@ -3075,26 +2887,9 @@ export declare const editorMachine: StateMachine<
3075
2887
  name: string
3076
2888
  }
3077
2889
  }
3078
- | {
3079
- type: 'annotation.toggle'
3080
- annotation: {
3081
- name: string
3082
- value: {
3083
- [prop: string]: unknown
3084
- }
3085
- }
3086
- }
3087
2890
  | {
3088
2891
  type: 'blur'
3089
2892
  }
3090
- | {
3091
- type: 'decorator.add'
3092
- decorator: string
3093
- }
3094
- | {
3095
- type: 'decorator.remove'
3096
- decorator: string
3097
- }
3098
2893
  | {
3099
2894
  type: 'decorator.toggle'
3100
2895
  decorator: string
@@ -3154,6 +2949,10 @@ export declare const editorMachine: StateMachine<
3154
2949
  description: string
3155
2950
  data: unknown
3156
2951
  }
2952
+ | {
2953
+ type: 'select'
2954
+ selection: EditorSelection
2955
+ }
3157
2956
  | {
3158
2957
  type: 'selection'
3159
2958
  selection: EditorSelection
@@ -3211,26 +3010,9 @@ export declare const editorMachine: StateMachine<
3211
3010
  name: string
3212
3011
  }
3213
3012
  }
3214
- | {
3215
- type: 'annotation.toggle'
3216
- annotation: {
3217
- name: string
3218
- value: {
3219
- [prop: string]: unknown
3220
- }
3221
- }
3222
- }
3223
3013
  | {
3224
3014
  type: 'blur'
3225
3015
  }
3226
- | {
3227
- type: 'decorator.add'
3228
- decorator: string
3229
- }
3230
- | {
3231
- type: 'decorator.remove'
3232
- decorator: string
3233
- }
3234
3016
  | {
3235
3017
  type: 'decorator.toggle'
3236
3018
  decorator: string
@@ -3324,6 +3106,10 @@ export declare const editorMachine: StateMachine<
3324
3106
  description: string
3325
3107
  data: unknown
3326
3108
  }
3109
+ | {
3110
+ type: 'select'
3111
+ selection: EditorSelection
3112
+ }
3327
3113
  | {
3328
3114
  type: 'selection'
3329
3115
  selection: EditorSelection
@@ -3362,26 +3148,9 @@ export declare const editorMachine: StateMachine<
3362
3148
  name: string
3363
3149
  }
3364
3150
  }
3365
- | {
3366
- type: 'annotation.toggle'
3367
- annotation: {
3368
- name: string
3369
- value: {
3370
- [prop: string]: unknown
3371
- }
3372
- }
3373
- }
3374
3151
  | {
3375
3152
  type: 'blur'
3376
3153
  }
3377
- | {
3378
- type: 'decorator.add'
3379
- decorator: string
3380
- }
3381
- | {
3382
- type: 'decorator.remove'
3383
- decorator: string
3384
- }
3385
3154
  | {
3386
3155
  type: 'decorator.toggle'
3387
3156
  decorator: string
@@ -3441,6 +3210,10 @@ export declare const editorMachine: StateMachine<
3441
3210
  description: string
3442
3211
  data: unknown
3443
3212
  }
3213
+ | {
3214
+ type: 'select'
3215
+ selection: EditorSelection
3216
+ }
3444
3217
  | {
3445
3218
  type: 'selection'
3446
3219
  selection: EditorSelection
@@ -3497,26 +3270,9 @@ export declare const editorMachine: StateMachine<
3497
3270
  name: string
3498
3271
  }
3499
3272
  }
3500
- | {
3501
- type: 'annotation.toggle'
3502
- annotation: {
3503
- name: string
3504
- value: {
3505
- [prop: string]: unknown
3506
- }
3507
- }
3508
- }
3509
3273
  | {
3510
3274
  type: 'blur'
3511
3275
  }
3512
- | {
3513
- type: 'decorator.add'
3514
- decorator: string
3515
- }
3516
- | {
3517
- type: 'decorator.remove'
3518
- decorator: string
3519
- }
3520
3276
  | {
3521
3277
  type: 'decorator.toggle'
3522
3278
  decorator: string
@@ -3610,6 +3366,10 @@ export declare const editorMachine: StateMachine<
3610
3366
  description: string
3611
3367
  data: unknown
3612
3368
  }
3369
+ | {
3370
+ type: 'select'
3371
+ selection: EditorSelection
3372
+ }
3613
3373
  | {
3614
3374
  type: 'selection'
3615
3375
  selection: EditorSelection
@@ -3648,26 +3408,9 @@ export declare const editorMachine: StateMachine<
3648
3408
  name: string
3649
3409
  }
3650
3410
  }
3651
- | {
3652
- type: 'annotation.toggle'
3653
- annotation: {
3654
- name: string
3655
- value: {
3656
- [prop: string]: unknown
3657
- }
3658
- }
3659
- }
3660
3411
  | {
3661
3412
  type: 'blur'
3662
3413
  }
3663
- | {
3664
- type: 'decorator.add'
3665
- decorator: string
3666
- }
3667
- | {
3668
- type: 'decorator.remove'
3669
- decorator: string
3670
- }
3671
3414
  | {
3672
3415
  type: 'decorator.toggle'
3673
3416
  decorator: string
@@ -3727,6 +3470,10 @@ export declare const editorMachine: StateMachine<
3727
3470
  description: string
3728
3471
  data: unknown
3729
3472
  }
3473
+ | {
3474
+ type: 'select'
3475
+ selection: EditorSelection
3476
+ }
3730
3477
  | {
3731
3478
  type: 'selection'
3732
3479
  selection: EditorSelection
@@ -3781,26 +3528,9 @@ export declare const editorMachine: StateMachine<
3781
3528
  name: string
3782
3529
  }
3783
3530
  }
3784
- | {
3785
- type: 'annotation.toggle'
3786
- annotation: {
3787
- name: string
3788
- value: {
3789
- [prop: string]: unknown
3790
- }
3791
- }
3792
- }
3793
3531
  | {
3794
3532
  type: 'blur'
3795
3533
  }
3796
- | {
3797
- type: 'decorator.add'
3798
- decorator: string
3799
- }
3800
- | {
3801
- type: 'decorator.remove'
3802
- decorator: string
3803
- }
3804
3534
  | {
3805
3535
  type: 'decorator.toggle'
3806
3536
  decorator: string
@@ -3894,6 +3624,10 @@ export declare const editorMachine: StateMachine<
3894
3624
  description: string
3895
3625
  data: unknown
3896
3626
  }
3627
+ | {
3628
+ type: 'select'
3629
+ selection: EditorSelection
3630
+ }
3897
3631
  | {
3898
3632
  type: 'selection'
3899
3633
  selection: EditorSelection
@@ -3932,26 +3666,9 @@ export declare const editorMachine: StateMachine<
3932
3666
  name: string
3933
3667
  }
3934
3668
  }
3935
- | {
3936
- type: 'annotation.toggle'
3937
- annotation: {
3938
- name: string
3939
- value: {
3940
- [prop: string]: unknown
3941
- }
3942
- }
3943
- }
3944
3669
  | {
3945
3670
  type: 'blur'
3946
3671
  }
3947
- | {
3948
- type: 'decorator.add'
3949
- decorator: string
3950
- }
3951
- | {
3952
- type: 'decorator.remove'
3953
- decorator: string
3954
- }
3955
3672
  | {
3956
3673
  type: 'decorator.toggle'
3957
3674
  decorator: string
@@ -4011,6 +3728,10 @@ export declare const editorMachine: StateMachine<
4011
3728
  description: string
4012
3729
  data: unknown
4013
3730
  }
3731
+ | {
3732
+ type: 'select'
3733
+ selection: EditorSelection
3734
+ }
4014
3735
  | {
4015
3736
  type: 'selection'
4016
3737
  selection: EditorSelection
@@ -4067,26 +3788,9 @@ export declare const editorMachine: StateMachine<
4067
3788
  name: string
4068
3789
  }
4069
3790
  }
4070
- | {
4071
- type: 'annotation.toggle'
4072
- annotation: {
4073
- name: string
4074
- value: {
4075
- [prop: string]: unknown
4076
- }
4077
- }
4078
- }
4079
3791
  | {
4080
3792
  type: 'blur'
4081
3793
  }
4082
- | {
4083
- type: 'decorator.add'
4084
- decorator: string
4085
- }
4086
- | {
4087
- type: 'decorator.remove'
4088
- decorator: string
4089
- }
4090
3794
  | {
4091
3795
  type: 'decorator.toggle'
4092
3796
  decorator: string
@@ -4180,6 +3884,10 @@ export declare const editorMachine: StateMachine<
4180
3884
  description: string
4181
3885
  data: unknown
4182
3886
  }
3887
+ | {
3888
+ type: 'select'
3889
+ selection: EditorSelection
3890
+ }
4183
3891
  | {
4184
3892
  type: 'selection'
4185
3893
  selection: EditorSelection
@@ -4218,26 +3926,9 @@ export declare const editorMachine: StateMachine<
4218
3926
  name: string
4219
3927
  }
4220
3928
  }
4221
- | {
4222
- type: 'annotation.toggle'
4223
- annotation: {
4224
- name: string
4225
- value: {
4226
- [prop: string]: unknown
4227
- }
4228
- }
4229
- }
4230
3929
  | {
4231
3930
  type: 'blur'
4232
3931
  }
4233
- | {
4234
- type: 'decorator.add'
4235
- decorator: string
4236
- }
4237
- | {
4238
- type: 'decorator.remove'
4239
- decorator: string
4240
- }
4241
3932
  | {
4242
3933
  type: 'decorator.toggle'
4243
3934
  decorator: string
@@ -4297,6 +3988,10 @@ export declare const editorMachine: StateMachine<
4297
3988
  description: string
4298
3989
  data: unknown
4299
3990
  }
3991
+ | {
3992
+ type: 'select'
3993
+ selection: EditorSelection
3994
+ }
4300
3995
  | {
4301
3996
  type: 'selection'
4302
3997
  selection: EditorSelection
@@ -4360,26 +4055,9 @@ export declare const editorMachine: StateMachine<
4360
4055
  name: string
4361
4056
  }
4362
4057
  }
4363
- | {
4364
- type: 'annotation.toggle'
4365
- annotation: {
4366
- name: string
4367
- value: {
4368
- [prop: string]: unknown
4369
- }
4370
- }
4371
- }
4372
4058
  | {
4373
4059
  type: 'blur'
4374
4060
  }
4375
- | {
4376
- type: 'decorator.add'
4377
- decorator: string
4378
- }
4379
- | {
4380
- type: 'decorator.remove'
4381
- decorator: string
4382
- }
4383
4061
  | {
4384
4062
  type: 'decorator.toggle'
4385
4063
  decorator: string
@@ -4473,6 +4151,10 @@ export declare const editorMachine: StateMachine<
4473
4151
  description: string
4474
4152
  data: unknown
4475
4153
  }
4154
+ | {
4155
+ type: 'select'
4156
+ selection: EditorSelection
4157
+ }
4476
4158
  | {
4477
4159
  type: 'selection'
4478
4160
  selection: EditorSelection
@@ -4530,26 +4212,9 @@ export declare const editorMachine: StateMachine<
4530
4212
  name: string
4531
4213
  }
4532
4214
  }
4533
- | {
4534
- type: 'annotation.toggle'
4535
- annotation: {
4536
- name: string
4537
- value: {
4538
- [prop: string]: unknown
4539
- }
4540
- }
4541
- }
4542
4215
  | {
4543
4216
  type: 'blur'
4544
4217
  }
4545
- | {
4546
- type: 'decorator.add'
4547
- decorator: string
4548
- }
4549
- | {
4550
- type: 'decorator.remove'
4551
- decorator: string
4552
- }
4553
4218
  | {
4554
4219
  type: 'decorator.toggle'
4555
4220
  decorator: string
@@ -4643,6 +4308,10 @@ export declare const editorMachine: StateMachine<
4643
4308
  description: string
4644
4309
  data: unknown
4645
4310
  }
4311
+ | {
4312
+ type: 'select'
4313
+ selection: EditorSelection
4314
+ }
4646
4315
  | {
4647
4316
  type: 'selection'
4648
4317
  selection: EditorSelection
@@ -4762,7 +4431,7 @@ export declare const editorMachine: StateMachine<
4762
4431
  readonly 'behavior event': {
4763
4432
  readonly actions: 'handle behavior event'
4764
4433
  }
4765
- readonly 'annotation.add': {
4434
+ readonly 'annotation.*': {
4766
4435
  readonly actions: ActionFunction<
4767
4436
  {
4768
4437
  behaviors: Array<Behavior>
@@ -4774,15 +4443,6 @@ export declare const editorMachine: StateMachine<
4774
4443
  selection: EditorSelection
4775
4444
  value: Array<PortableTextBlock> | undefined
4776
4445
  },
4777
- {
4778
- type: 'annotation.add'
4779
- annotation: {
4780
- name: string
4781
- value: {
4782
- [prop: string]: unknown
4783
- }
4784
- }
4785
- },
4786
4446
  | {
4787
4447
  type: 'annotation.add'
4788
4448
  annotation: {
@@ -4797,9 +4457,9 @@ export declare const editorMachine: StateMachine<
4797
4457
  annotation: {
4798
4458
  name: string
4799
4459
  }
4800
- }
4460
+ },
4801
4461
  | {
4802
- type: 'annotation.toggle'
4462
+ type: 'annotation.add'
4803
4463
  annotation: {
4804
4464
  name: string
4805
4465
  value: {
@@ -4808,15 +4468,13 @@ export declare const editorMachine: StateMachine<
4808
4468
  }
4809
4469
  }
4810
4470
  | {
4811
- type: 'blur'
4812
- }
4813
- | {
4814
- type: 'decorator.add'
4815
- decorator: string
4471
+ type: 'annotation.remove'
4472
+ annotation: {
4473
+ name: string
4474
+ }
4816
4475
  }
4817
4476
  | {
4818
- type: 'decorator.remove'
4819
- decorator: string
4477
+ type: 'blur'
4820
4478
  }
4821
4479
  | {
4822
4480
  type: 'decorator.toggle'
@@ -4914,296 +4572,9 @@ export declare const editorMachine: StateMachine<
4914
4572
  data: unknown
4915
4573
  }
4916
4574
  | {
4917
- type: 'selection'
4575
+ type: 'select'
4918
4576
  selection: EditorSelection
4919
4577
  }
4920
- | {
4921
- type: 'blurred'
4922
- event: FocusEvent_2<HTMLDivElement, Element>
4923
- }
4924
- | {
4925
- type: 'focused'
4926
- event: FocusEvent_2<HTMLDivElement, Element>
4927
- }
4928
- | {
4929
- type: 'loading'
4930
- }
4931
- | {
4932
- type: 'done loading'
4933
- },
4934
- undefined,
4935
- never,
4936
- never,
4937
- never,
4938
- never,
4939
- | {
4940
- type: 'annotation.add'
4941
- annotation: {
4942
- name: string
4943
- value: {
4944
- [prop: string]: unknown
4945
- }
4946
- }
4947
- }
4948
- | {
4949
- type: 'annotation.remove'
4950
- annotation: {
4951
- name: string
4952
- }
4953
- }
4954
- | {
4955
- type: 'annotation.toggle'
4956
- annotation: {
4957
- name: string
4958
- value: {
4959
- [prop: string]: unknown
4960
- }
4961
- }
4962
- }
4963
- | {
4964
- type: 'blur'
4965
- }
4966
- | {
4967
- type: 'decorator.add'
4968
- decorator: string
4969
- }
4970
- | {
4971
- type: 'decorator.remove'
4972
- decorator: string
4973
- }
4974
- | {
4975
- type: 'decorator.toggle'
4976
- decorator: string
4977
- }
4978
- | {
4979
- type: 'focus'
4980
- }
4981
- | {
4982
- type: 'insert.block object'
4983
- placement: 'auto' | 'after' | 'before'
4984
- blockObject: {
4985
- name: string
4986
- value?: {
4987
- [prop: string]: unknown
4988
- }
4989
- }
4990
- }
4991
- | {
4992
- type: 'insert.inline object'
4993
- inlineObject: {
4994
- name: string
4995
- value?: {
4996
- [prop: string]: unknown
4997
- }
4998
- }
4999
- }
5000
- | {
5001
- type: 'list item.toggle'
5002
- listItem: string
5003
- }
5004
- | {
5005
- type: 'style.toggle'
5006
- style: string
5007
- }
5008
- | PatchEvent
5009
- | MutationEvent_2
5010
- | {
5011
- type: 'ready'
5012
- }
5013
- | PatchesEvent
5014
- | {
5015
- type: 'unset'
5016
- previousValue: Array<PortableTextBlock>
5017
- }
5018
- | {
5019
- type: 'value changed'
5020
- value: Array<PortableTextBlock> | undefined
5021
- }
5022
- | {
5023
- type: 'invalid value'
5024
- resolution: InvalidValueResolution | null
5025
- value: Array<PortableTextBlock> | undefined
5026
- }
5027
- | {
5028
- type: 'error'
5029
- name: string
5030
- description: string
5031
- data: unknown
5032
- }
5033
- | {
5034
- type: 'selection'
5035
- selection: EditorSelection
5036
- }
5037
- | {
5038
- type: 'blurred'
5039
- event: FocusEvent_2<HTMLDivElement, Element>
5040
- }
5041
- | {
5042
- type: 'focused'
5043
- event: FocusEvent_2<HTMLDivElement, Element>
5044
- }
5045
- | {
5046
- type: 'loading'
5047
- }
5048
- | {
5049
- type: 'done loading'
5050
- }
5051
- | {
5052
- type: 'read only'
5053
- }
5054
- | {
5055
- type: 'editable'
5056
- }
5057
- >
5058
- }
5059
- readonly 'annotation.remove': {
5060
- readonly actions: ActionFunction<
5061
- {
5062
- behaviors: Array<Behavior>
5063
- keyGenerator: () => string
5064
- pendingEvents: Array<PatchEvent | MutationEvent_2>
5065
- schema: EditorSchema
5066
- initialReadOnly: boolean
5067
- maxBlocks: number | undefined
5068
- selection: EditorSelection
5069
- value: Array<PortableTextBlock> | undefined
5070
- },
5071
- {
5072
- type: 'annotation.remove'
5073
- annotation: {
5074
- name: string
5075
- }
5076
- },
5077
- | {
5078
- type: 'annotation.add'
5079
- annotation: {
5080
- name: string
5081
- value: {
5082
- [prop: string]: unknown
5083
- }
5084
- }
5085
- }
5086
- | {
5087
- type: 'annotation.remove'
5088
- annotation: {
5089
- name: string
5090
- }
5091
- }
5092
- | {
5093
- type: 'annotation.toggle'
5094
- annotation: {
5095
- name: string
5096
- value: {
5097
- [prop: string]: unknown
5098
- }
5099
- }
5100
- }
5101
- | {
5102
- type: 'blur'
5103
- }
5104
- | {
5105
- type: 'decorator.add'
5106
- decorator: string
5107
- }
5108
- | {
5109
- type: 'decorator.remove'
5110
- decorator: string
5111
- }
5112
- | {
5113
- type: 'decorator.toggle'
5114
- decorator: string
5115
- }
5116
- | {
5117
- type: 'focus'
5118
- }
5119
- | {
5120
- type: 'insert.block object'
5121
- placement: 'auto' | 'after' | 'before'
5122
- blockObject: {
5123
- name: string
5124
- value?: {
5125
- [prop: string]: unknown
5126
- }
5127
- }
5128
- }
5129
- | {
5130
- type: 'insert.inline object'
5131
- inlineObject: {
5132
- name: string
5133
- value?: {
5134
- [prop: string]: unknown
5135
- }
5136
- }
5137
- }
5138
- | {
5139
- type: 'list item.toggle'
5140
- listItem: string
5141
- }
5142
- | {
5143
- type: 'style.toggle'
5144
- style: string
5145
- }
5146
- | PatchEvent
5147
- | MutationEvent_2
5148
- | {
5149
- type: 'normalizing'
5150
- }
5151
- | {
5152
- type: 'done normalizing'
5153
- }
5154
- | {
5155
- type: 'done syncing initial value'
5156
- }
5157
- | {
5158
- type: 'behavior event'
5159
- behaviorEvent:
5160
- | SyntheticBehaviorEvent
5161
- | NativeBehaviorEvent
5162
- editor: PortableTextSlateEditor
5163
- nativeEvent?: {
5164
- preventDefault: () => void
5165
- }
5166
- }
5167
- | {
5168
- type: 'update readOnly'
5169
- readOnly: boolean
5170
- }
5171
- | {
5172
- type: 'update schema'
5173
- schema: EditorSchema
5174
- }
5175
- | {
5176
- type: 'update behaviors'
5177
- behaviors: Array<Behavior>
5178
- }
5179
- | {
5180
- type: 'update value'
5181
- value: Array<PortableTextBlock> | undefined
5182
- }
5183
- | {
5184
- type: 'update maxBlocks'
5185
- maxBlocks: number | undefined
5186
- }
5187
- | PatchesEvent
5188
- | {
5189
- type: 'unset'
5190
- previousValue: Array<PortableTextBlock>
5191
- }
5192
- | {
5193
- type: 'value changed'
5194
- value: Array<PortableTextBlock> | undefined
5195
- }
5196
- | {
5197
- type: 'invalid value'
5198
- resolution: InvalidValueResolution | null
5199
- value: Array<PortableTextBlock> | undefined
5200
- }
5201
- | {
5202
- type: 'error'
5203
- name: string
5204
- description: string
5205
- data: unknown
5206
- }
5207
4578
  | {
5208
4579
  type: 'selection'
5209
4580
  selection: EditorSelection
@@ -5242,26 +4613,9 @@ export declare const editorMachine: StateMachine<
5242
4613
  name: string
5243
4614
  }
5244
4615
  }
5245
- | {
5246
- type: 'annotation.toggle'
5247
- annotation: {
5248
- name: string
5249
- value: {
5250
- [prop: string]: unknown
5251
- }
5252
- }
5253
- }
5254
4616
  | {
5255
4617
  type: 'blur'
5256
4618
  }
5257
- | {
5258
- type: 'decorator.add'
5259
- decorator: string
5260
- }
5261
- | {
5262
- type: 'decorator.remove'
5263
- decorator: string
5264
- }
5265
4619
  | {
5266
4620
  type: 'decorator.toggle'
5267
4621
  decorator: string
@@ -5321,6 +4675,10 @@ export declare const editorMachine: StateMachine<
5321
4675
  description: string
5322
4676
  data: unknown
5323
4677
  }
4678
+ | {
4679
+ type: 'select'
4680
+ selection: EditorSelection
4681
+ }
5324
4682
  | {
5325
4683
  type: 'selection'
5326
4684
  selection: EditorSelection
@@ -5347,7 +4705,7 @@ export declare const editorMachine: StateMachine<
5347
4705
  }
5348
4706
  >
5349
4707
  }
5350
- readonly 'annotation.toggle': {
4708
+ readonly 'blur': {
5351
4709
  readonly actions: ActionFunction<
5352
4710
  {
5353
4711
  behaviors: Array<Behavior>
@@ -5360,13 +4718,7 @@ export declare const editorMachine: StateMachine<
5360
4718
  value: Array<PortableTextBlock> | undefined
5361
4719
  },
5362
4720
  {
5363
- type: 'annotation.toggle'
5364
- annotation: {
5365
- name: string
5366
- value: {
5367
- [prop: string]: unknown
5368
- }
5369
- }
4721
+ type: 'blur'
5370
4722
  },
5371
4723
  | {
5372
4724
  type: 'annotation.add'
@@ -5383,26 +4735,9 @@ export declare const editorMachine: StateMachine<
5383
4735
  name: string
5384
4736
  }
5385
4737
  }
5386
- | {
5387
- type: 'annotation.toggle'
5388
- annotation: {
5389
- name: string
5390
- value: {
5391
- [prop: string]: unknown
5392
- }
5393
- }
5394
- }
5395
4738
  | {
5396
4739
  type: 'blur'
5397
4740
  }
5398
- | {
5399
- type: 'decorator.add'
5400
- decorator: string
5401
- }
5402
- | {
5403
- type: 'decorator.remove'
5404
- decorator: string
5405
- }
5406
4741
  | {
5407
4742
  type: 'decorator.toggle'
5408
4743
  decorator: string
@@ -5498,6 +4833,10 @@ export declare const editorMachine: StateMachine<
5498
4833
  description: string
5499
4834
  data: unknown
5500
4835
  }
4836
+ | {
4837
+ type: 'select'
4838
+ selection: EditorSelection
4839
+ }
5501
4840
  | {
5502
4841
  type: 'selection'
5503
4842
  selection: EditorSelection
@@ -5536,26 +4875,9 @@ export declare const editorMachine: StateMachine<
5536
4875
  name: string
5537
4876
  }
5538
4877
  }
5539
- | {
5540
- type: 'annotation.toggle'
5541
- annotation: {
5542
- name: string
5543
- value: {
5544
- [prop: string]: unknown
5545
- }
5546
- }
5547
- }
5548
4878
  | {
5549
4879
  type: 'blur'
5550
4880
  }
5551
- | {
5552
- type: 'decorator.add'
5553
- decorator: string
5554
- }
5555
- | {
5556
- type: 'decorator.remove'
5557
- decorator: string
5558
- }
5559
4881
  | {
5560
4882
  type: 'decorator.toggle'
5561
4883
  decorator: string
@@ -5615,6 +4937,10 @@ export declare const editorMachine: StateMachine<
5615
4937
  description: string
5616
4938
  data: unknown
5617
4939
  }
4940
+ | {
4941
+ type: 'select'
4942
+ selection: EditorSelection
4943
+ }
5618
4944
  | {
5619
4945
  type: 'selection'
5620
4946
  selection: EditorSelection
@@ -5641,7 +4967,7 @@ export declare const editorMachine: StateMachine<
5641
4967
  }
5642
4968
  >
5643
4969
  }
5644
- readonly 'blur': {
4970
+ readonly 'decorator.*': {
5645
4971
  readonly actions: ActionFunction<
5646
4972
  {
5647
4973
  behaviors: Array<Behavior>
@@ -5654,7 +4980,8 @@ export declare const editorMachine: StateMachine<
5654
4980
  value: Array<PortableTextBlock> | undefined
5655
4981
  },
5656
4982
  {
5657
- type: 'blur'
4983
+ type: 'decorator.toggle'
4984
+ decorator: string
5658
4985
  },
5659
4986
  | {
5660
4987
  type: 'annotation.add'
@@ -5671,26 +4998,9 @@ export declare const editorMachine: StateMachine<
5671
4998
  name: string
5672
4999
  }
5673
5000
  }
5674
- | {
5675
- type: 'annotation.toggle'
5676
- annotation: {
5677
- name: string
5678
- value: {
5679
- [prop: string]: unknown
5680
- }
5681
- }
5682
- }
5683
5001
  | {
5684
5002
  type: 'blur'
5685
5003
  }
5686
- | {
5687
- type: 'decorator.add'
5688
- decorator: string
5689
- }
5690
- | {
5691
- type: 'decorator.remove'
5692
- decorator: string
5693
- }
5694
5004
  | {
5695
5005
  type: 'decorator.toggle'
5696
5006
  decorator: string
@@ -5786,6 +5096,10 @@ export declare const editorMachine: StateMachine<
5786
5096
  description: string
5787
5097
  data: unknown
5788
5098
  }
5099
+ | {
5100
+ type: 'select'
5101
+ selection: EditorSelection
5102
+ }
5789
5103
  | {
5790
5104
  type: 'selection'
5791
5105
  selection: EditorSelection
@@ -5824,26 +5138,9 @@ export declare const editorMachine: StateMachine<
5824
5138
  name: string
5825
5139
  }
5826
5140
  }
5827
- | {
5828
- type: 'annotation.toggle'
5829
- annotation: {
5830
- name: string
5831
- value: {
5832
- [prop: string]: unknown
5833
- }
5834
- }
5835
- }
5836
5141
  | {
5837
5142
  type: 'blur'
5838
5143
  }
5839
- | {
5840
- type: 'decorator.add'
5841
- decorator: string
5842
- }
5843
- | {
5844
- type: 'decorator.remove'
5845
- decorator: string
5846
- }
5847
5144
  | {
5848
5145
  type: 'decorator.toggle'
5849
5146
  decorator: string
@@ -5903,6 +5200,10 @@ export declare const editorMachine: StateMachine<
5903
5200
  description: string
5904
5201
  data: unknown
5905
5202
  }
5203
+ | {
5204
+ type: 'select'
5205
+ selection: EditorSelection
5206
+ }
5906
5207
  | {
5907
5208
  type: 'selection'
5908
5209
  selection: EditorSelection
@@ -5929,7 +5230,7 @@ export declare const editorMachine: StateMachine<
5929
5230
  }
5930
5231
  >
5931
5232
  }
5932
- readonly 'decorator.*': {
5233
+ readonly 'focus': {
5933
5234
  readonly actions: ActionFunction<
5934
5235
  {
5935
5236
  behaviors: Array<Behavior>
@@ -5941,18 +5242,9 @@ export declare const editorMachine: StateMachine<
5941
5242
  selection: EditorSelection
5942
5243
  value: Array<PortableTextBlock> | undefined
5943
5244
  },
5944
- | {
5945
- type: 'decorator.add'
5946
- decorator: string
5947
- }
5948
- | {
5949
- type: 'decorator.remove'
5950
- decorator: string
5951
- }
5952
- | {
5953
- type: 'decorator.toggle'
5954
- decorator: string
5955
- },
5245
+ {
5246
+ type: 'focus'
5247
+ },
5956
5248
  | {
5957
5249
  type: 'annotation.add'
5958
5250
  annotation: {
@@ -5968,26 +5260,9 @@ export declare const editorMachine: StateMachine<
5968
5260
  name: string
5969
5261
  }
5970
5262
  }
5971
- | {
5972
- type: 'annotation.toggle'
5973
- annotation: {
5974
- name: string
5975
- value: {
5976
- [prop: string]: unknown
5977
- }
5978
- }
5979
- }
5980
5263
  | {
5981
5264
  type: 'blur'
5982
5265
  }
5983
- | {
5984
- type: 'decorator.add'
5985
- decorator: string
5986
- }
5987
- | {
5988
- type: 'decorator.remove'
5989
- decorator: string
5990
- }
5991
5266
  | {
5992
5267
  type: 'decorator.toggle'
5993
5268
  decorator: string
@@ -6083,6 +5358,10 @@ export declare const editorMachine: StateMachine<
6083
5358
  description: string
6084
5359
  data: unknown
6085
5360
  }
5361
+ | {
5362
+ type: 'select'
5363
+ selection: EditorSelection
5364
+ }
6086
5365
  | {
6087
5366
  type: 'selection'
6088
5367
  selection: EditorSelection
@@ -6121,26 +5400,9 @@ export declare const editorMachine: StateMachine<
6121
5400
  name: string
6122
5401
  }
6123
5402
  }
6124
- | {
6125
- type: 'annotation.toggle'
6126
- annotation: {
6127
- name: string
6128
- value: {
6129
- [prop: string]: unknown
6130
- }
6131
- }
6132
- }
6133
5403
  | {
6134
5404
  type: 'blur'
6135
5405
  }
6136
- | {
6137
- type: 'decorator.add'
6138
- decorator: string
6139
- }
6140
- | {
6141
- type: 'decorator.remove'
6142
- decorator: string
6143
- }
6144
5406
  | {
6145
5407
  type: 'decorator.toggle'
6146
5408
  decorator: string
@@ -6200,6 +5462,10 @@ export declare const editorMachine: StateMachine<
6200
5462
  description: string
6201
5463
  data: unknown
6202
5464
  }
5465
+ | {
5466
+ type: 'select'
5467
+ selection: EditorSelection
5468
+ }
6203
5469
  | {
6204
5470
  type: 'selection'
6205
5471
  selection: EditorSelection
@@ -6226,7 +5492,7 @@ export declare const editorMachine: StateMachine<
6226
5492
  }
6227
5493
  >
6228
5494
  }
6229
- readonly 'focus': {
5495
+ readonly 'insert.*': {
6230
5496
  readonly actions: ActionFunction<
6231
5497
  {
6232
5498
  behaviors: Array<Behavior>
@@ -6238,26 +5504,27 @@ export declare const editorMachine: StateMachine<
6238
5504
  selection: EditorSelection
6239
5505
  value: Array<PortableTextBlock> | undefined
6240
5506
  },
6241
- {
6242
- type: 'focus'
6243
- },
6244
5507
  | {
6245
- type: 'annotation.add'
6246
- annotation: {
5508
+ type: 'insert.block object'
5509
+ placement: 'auto' | 'after' | 'before'
5510
+ blockObject: {
6247
5511
  name: string
6248
- value: {
5512
+ value?: {
6249
5513
  [prop: string]: unknown
6250
5514
  }
6251
5515
  }
6252
5516
  }
6253
5517
  | {
6254
- type: 'annotation.remove'
6255
- annotation: {
5518
+ type: 'insert.inline object'
5519
+ inlineObject: {
6256
5520
  name: string
5521
+ value?: {
5522
+ [prop: string]: unknown
5523
+ }
6257
5524
  }
6258
- }
5525
+ },
6259
5526
  | {
6260
- type: 'annotation.toggle'
5527
+ type: 'annotation.add'
6261
5528
  annotation: {
6262
5529
  name: string
6263
5530
  value: {
@@ -6266,15 +5533,13 @@ export declare const editorMachine: StateMachine<
6266
5533
  }
6267
5534
  }
6268
5535
  | {
6269
- type: 'blur'
6270
- }
6271
- | {
6272
- type: 'decorator.add'
6273
- decorator: string
5536
+ type: 'annotation.remove'
5537
+ annotation: {
5538
+ name: string
5539
+ }
6274
5540
  }
6275
5541
  | {
6276
- type: 'decorator.remove'
6277
- decorator: string
5542
+ type: 'blur'
6278
5543
  }
6279
5544
  | {
6280
5545
  type: 'decorator.toggle'
@@ -6371,6 +5636,10 @@ export declare const editorMachine: StateMachine<
6371
5636
  description: string
6372
5637
  data: unknown
6373
5638
  }
5639
+ | {
5640
+ type: 'select'
5641
+ selection: EditorSelection
5642
+ }
6374
5643
  | {
6375
5644
  type: 'selection'
6376
5645
  selection: EditorSelection
@@ -6409,26 +5678,9 @@ export declare const editorMachine: StateMachine<
6409
5678
  name: string
6410
5679
  }
6411
5680
  }
6412
- | {
6413
- type: 'annotation.toggle'
6414
- annotation: {
6415
- name: string
6416
- value: {
6417
- [prop: string]: unknown
6418
- }
6419
- }
6420
- }
6421
5681
  | {
6422
5682
  type: 'blur'
6423
5683
  }
6424
- | {
6425
- type: 'decorator.add'
6426
- decorator: string
6427
- }
6428
- | {
6429
- type: 'decorator.remove'
6430
- decorator: string
6431
- }
6432
5684
  | {
6433
5685
  type: 'decorator.toggle'
6434
5686
  decorator: string
@@ -6488,6 +5740,10 @@ export declare const editorMachine: StateMachine<
6488
5740
  description: string
6489
5741
  data: unknown
6490
5742
  }
5743
+ | {
5744
+ type: 'select'
5745
+ selection: EditorSelection
5746
+ }
6491
5747
  | {
6492
5748
  type: 'selection'
6493
5749
  selection: EditorSelection
@@ -6514,7 +5770,7 @@ export declare const editorMachine: StateMachine<
6514
5770
  }
6515
5771
  >
6516
5772
  }
6517
- readonly 'insert.*': {
5773
+ readonly 'list item.*': {
6518
5774
  readonly actions: ActionFunction<
6519
5775
  {
6520
5776
  behaviors: Array<Behavior>
@@ -6526,25 +5782,10 @@ export declare const editorMachine: StateMachine<
6526
5782
  selection: EditorSelection
6527
5783
  value: Array<PortableTextBlock> | undefined
6528
5784
  },
6529
- | {
6530
- type: 'insert.block object'
6531
- placement: 'auto' | 'after' | 'before'
6532
- blockObject: {
6533
- name: string
6534
- value?: {
6535
- [prop: string]: unknown
6536
- }
6537
- }
6538
- }
6539
- | {
6540
- type: 'insert.inline object'
6541
- inlineObject: {
6542
- name: string
6543
- value?: {
6544
- [prop: string]: unknown
6545
- }
6546
- }
6547
- },
5785
+ {
5786
+ type: 'list item.toggle'
5787
+ listItem: string
5788
+ },
6548
5789
  | {
6549
5790
  type: 'annotation.add'
6550
5791
  annotation: {
@@ -6560,26 +5801,9 @@ export declare const editorMachine: StateMachine<
6560
5801
  name: string
6561
5802
  }
6562
5803
  }
6563
- | {
6564
- type: 'annotation.toggle'
6565
- annotation: {
6566
- name: string
6567
- value: {
6568
- [prop: string]: unknown
6569
- }
6570
- }
6571
- }
6572
5804
  | {
6573
5805
  type: 'blur'
6574
5806
  }
6575
- | {
6576
- type: 'decorator.add'
6577
- decorator: string
6578
- }
6579
- | {
6580
- type: 'decorator.remove'
6581
- decorator: string
6582
- }
6583
5807
  | {
6584
5808
  type: 'decorator.toggle'
6585
5809
  decorator: string
@@ -6675,6 +5899,10 @@ export declare const editorMachine: StateMachine<
6675
5899
  description: string
6676
5900
  data: unknown
6677
5901
  }
5902
+ | {
5903
+ type: 'select'
5904
+ selection: EditorSelection
5905
+ }
6678
5906
  | {
6679
5907
  type: 'selection'
6680
5908
  selection: EditorSelection
@@ -6713,26 +5941,9 @@ export declare const editorMachine: StateMachine<
6713
5941
  name: string
6714
5942
  }
6715
5943
  }
6716
- | {
6717
- type: 'annotation.toggle'
6718
- annotation: {
6719
- name: string
6720
- value: {
6721
- [prop: string]: unknown
6722
- }
6723
- }
6724
- }
6725
5944
  | {
6726
5945
  type: 'blur'
6727
5946
  }
6728
- | {
6729
- type: 'decorator.add'
6730
- decorator: string
6731
- }
6732
- | {
6733
- type: 'decorator.remove'
6734
- decorator: string
6735
- }
6736
5947
  | {
6737
5948
  type: 'decorator.toggle'
6738
5949
  decorator: string
@@ -6792,6 +6003,10 @@ export declare const editorMachine: StateMachine<
6792
6003
  description: string
6793
6004
  data: unknown
6794
6005
  }
6006
+ | {
6007
+ type: 'select'
6008
+ selection: EditorSelection
6009
+ }
6795
6010
  | {
6796
6011
  type: 'selection'
6797
6012
  selection: EditorSelection
@@ -6818,7 +6033,7 @@ export declare const editorMachine: StateMachine<
6818
6033
  }
6819
6034
  >
6820
6035
  }
6821
- readonly 'list item.*': {
6036
+ readonly 'select': {
6822
6037
  readonly actions: ActionFunction<
6823
6038
  {
6824
6039
  behaviors: Array<Behavior>
@@ -6831,8 +6046,8 @@ export declare const editorMachine: StateMachine<
6831
6046
  value: Array<PortableTextBlock> | undefined
6832
6047
  },
6833
6048
  {
6834
- type: 'list item.toggle'
6835
- listItem: string
6049
+ type: 'select'
6050
+ selection: EditorSelection
6836
6051
  },
6837
6052
  | {
6838
6053
  type: 'annotation.add'
@@ -6849,26 +6064,9 @@ export declare const editorMachine: StateMachine<
6849
6064
  name: string
6850
6065
  }
6851
6066
  }
6852
- | {
6853
- type: 'annotation.toggle'
6854
- annotation: {
6855
- name: string
6856
- value: {
6857
- [prop: string]: unknown
6858
- }
6859
- }
6860
- }
6861
6067
  | {
6862
6068
  type: 'blur'
6863
6069
  }
6864
- | {
6865
- type: 'decorator.add'
6866
- decorator: string
6867
- }
6868
- | {
6869
- type: 'decorator.remove'
6870
- decorator: string
6871
- }
6872
6070
  | {
6873
6071
  type: 'decorator.toggle'
6874
6072
  decorator: string
@@ -6964,6 +6162,10 @@ export declare const editorMachine: StateMachine<
6964
6162
  description: string
6965
6163
  data: unknown
6966
6164
  }
6165
+ | {
6166
+ type: 'select'
6167
+ selection: EditorSelection
6168
+ }
6967
6169
  | {
6968
6170
  type: 'selection'
6969
6171
  selection: EditorSelection
@@ -7002,26 +6204,9 @@ export declare const editorMachine: StateMachine<
7002
6204
  name: string
7003
6205
  }
7004
6206
  }
7005
- | {
7006
- type: 'annotation.toggle'
7007
- annotation: {
7008
- name: string
7009
- value: {
7010
- [prop: string]: unknown
7011
- }
7012
- }
7013
- }
7014
6207
  | {
7015
6208
  type: 'blur'
7016
6209
  }
7017
- | {
7018
- type: 'decorator.add'
7019
- decorator: string
7020
- }
7021
- | {
7022
- type: 'decorator.remove'
7023
- decorator: string
7024
- }
7025
6210
  | {
7026
6211
  type: 'decorator.toggle'
7027
6212
  decorator: string
@@ -7081,6 +6266,10 @@ export declare const editorMachine: StateMachine<
7081
6266
  description: string
7082
6267
  data: unknown
7083
6268
  }
6269
+ | {
6270
+ type: 'select'
6271
+ selection: EditorSelection
6272
+ }
7084
6273
  | {
7085
6274
  type: 'selection'
7086
6275
  selection: EditorSelection
@@ -7138,26 +6327,9 @@ export declare const editorMachine: StateMachine<
7138
6327
  name: string
7139
6328
  }
7140
6329
  }
7141
- | {
7142
- type: 'annotation.toggle'
7143
- annotation: {
7144
- name: string
7145
- value: {
7146
- [prop: string]: unknown
7147
- }
7148
- }
7149
- }
7150
6330
  | {
7151
6331
  type: 'blur'
7152
6332
  }
7153
- | {
7154
- type: 'decorator.add'
7155
- decorator: string
7156
- }
7157
- | {
7158
- type: 'decorator.remove'
7159
- decorator: string
7160
- }
7161
6333
  | {
7162
6334
  type: 'decorator.toggle'
7163
6335
  decorator: string
@@ -7253,6 +6425,10 @@ export declare const editorMachine: StateMachine<
7253
6425
  description: string
7254
6426
  data: unknown
7255
6427
  }
6428
+ | {
6429
+ type: 'select'
6430
+ selection: EditorSelection
6431
+ }
7256
6432
  | {
7257
6433
  type: 'selection'
7258
6434
  selection: EditorSelection
@@ -7291,26 +6467,9 @@ export declare const editorMachine: StateMachine<
7291
6467
  name: string
7292
6468
  }
7293
6469
  }
7294
- | {
7295
- type: 'annotation.toggle'
7296
- annotation: {
7297
- name: string
7298
- value: {
7299
- [prop: string]: unknown
7300
- }
7301
- }
7302
- }
7303
6470
  | {
7304
6471
  type: 'blur'
7305
6472
  }
7306
- | {
7307
- type: 'decorator.add'
7308
- decorator: string
7309
- }
7310
- | {
7311
- type: 'decorator.remove'
7312
- decorator: string
7313
- }
7314
6473
  | {
7315
6474
  type: 'decorator.toggle'
7316
6475
  decorator: string
@@ -7370,6 +6529,10 @@ export declare const editorMachine: StateMachine<
7370
6529
  description: string
7371
6530
  data: unknown
7372
6531
  }
6532
+ | {
6533
+ type: 'select'
6534
+ selection: EditorSelection
6535
+ }
7373
6536
  | {
7374
6537
  type: 'selection'
7375
6538
  selection: EditorSelection
@@ -7595,6 +6758,10 @@ export declare type InternalEditorEmittedEvent =
7595
6758
  description: string
7596
6759
  data: unknown
7597
6760
  }
6761
+ | {
6762
+ type: 'select'
6763
+ selection: EditorSelection
6764
+ }
7598
6765
  | {
7599
6766
  type: 'selection'
7600
6767
  selection: EditorSelection
@@ -7624,10 +6791,7 @@ export declare type InternalEditorEmittedEvent =
7624
6791
  'type',
7625
6792
  | 'annotation.add'
7626
6793
  | 'annotation.remove'
7627
- | 'annotation.toggle'
7628
6794
  | 'blur'
7629
- | 'decorator.add'
7630
- | 'decorator.remove'
7631
6795
  | 'decorator.toggle'
7632
6796
  | 'insert.block object'
7633
6797
  | 'insert.inline object'
@@ -8313,26 +7477,9 @@ export declare type SyntheticBehaviorEvent =
8313
7477
  name: string
8314
7478
  }
8315
7479
  }
8316
- | {
8317
- type: 'annotation.toggle'
8318
- annotation: {
8319
- name: string
8320
- value: {
8321
- [prop: string]: unknown
8322
- }
8323
- }
8324
- }
8325
7480
  | {
8326
7481
  type: 'blur'
8327
7482
  }
8328
- | {
8329
- type: 'decorator.add'
8330
- decorator: string
8331
- }
8332
- | {
8333
- type: 'decorator.remove'
8334
- decorator: string
8335
- }
8336
7483
  | {
8337
7484
  type: 'decorator.toggle'
8338
7485
  decorator: string
@@ -8382,6 +7529,10 @@ export declare type SyntheticBehaviorEvent =
8382
7529
  type: 'list item.toggle'
8383
7530
  listItem: string
8384
7531
  }
7532
+ | {
7533
+ type: 'select'
7534
+ selection: EditorSelection
7535
+ }
8385
7536
  | {
8386
7537
  type: 'style.toggle'
8387
7538
  style: string