@portabletext/editor 1.18.7 → 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 +241 -1098
  13. package/lib/index.d.ts +241 -1098
  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 +2 -2
  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
@@ -122,6 +122,27 @@ export declare type Behavior<
122
122
  */
123
123
  export declare type BehaviorActionIntend =
124
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
+ }
125
146
  | {
126
147
  type: 'insert.span'
127
148
  text: string
@@ -177,13 +198,6 @@ export declare type BehaviorActionIntend =
177
198
  type: 'effect'
178
199
  effect: () => void
179
200
  }
180
- | {
181
- type: 'reselect'
182
- }
183
- | {
184
- type: 'select'
185
- selection: EditorSelection
186
- }
187
201
  | {
188
202
  type: 'select.previous block'
189
203
  }
@@ -559,15 +573,13 @@ export declare type EditorEvent = PickFromUnion<
559
573
  'type',
560
574
  | 'annotation.add'
561
575
  | 'annotation.remove'
562
- | 'annotation.toggle'
563
576
  | 'blur'
564
- | 'decorator.add'
565
- | 'decorator.remove'
566
577
  | 'decorator.toggle'
567
578
  | 'focus'
568
579
  | 'insert.block object'
569
580
  | 'insert.inline object'
570
581
  | 'list item.toggle'
582
+ | 'select'
571
583
  | 'style.toggle'
572
584
  | 'patches'
573
585
  | 'update behaviors'
@@ -611,26 +623,9 @@ export declare const editorMachine: StateMachine<
611
623
  name: string
612
624
  }
613
625
  }
614
- | {
615
- type: 'annotation.toggle'
616
- annotation: {
617
- name: string
618
- value: {
619
- [prop: string]: unknown
620
- }
621
- }
622
- }
623
626
  | {
624
627
  type: 'blur'
625
628
  }
626
- | {
627
- type: 'decorator.add'
628
- decorator: string
629
- }
630
- | {
631
- type: 'decorator.remove'
632
- decorator: string
633
- }
634
629
  | {
635
630
  type: 'decorator.toggle'
636
631
  decorator: string
@@ -724,6 +719,10 @@ export declare const editorMachine: StateMachine<
724
719
  description: string
725
720
  data: unknown
726
721
  }
722
+ | {
723
+ type: 'select'
724
+ selection: EditorSelection
725
+ }
727
726
  | {
728
727
  type: 'selection'
729
728
  selection: EditorSelection
@@ -830,26 +829,9 @@ export declare const editorMachine: StateMachine<
830
829
  name: string
831
830
  }
832
831
  }
833
- | {
834
- type: 'annotation.toggle'
835
- annotation: {
836
- name: string
837
- value: {
838
- [prop: string]: unknown
839
- }
840
- }
841
- }
842
832
  | {
843
833
  type: 'blur'
844
834
  }
845
- | {
846
- type: 'decorator.add'
847
- decorator: string
848
- }
849
- | {
850
- type: 'decorator.remove'
851
- decorator: string
852
- }
853
835
  | {
854
836
  type: 'decorator.toggle'
855
837
  decorator: string
@@ -909,6 +891,10 @@ export declare const editorMachine: StateMachine<
909
891
  description: string
910
892
  data: unknown
911
893
  }
894
+ | {
895
+ type: 'select'
896
+ selection: EditorSelection
897
+ }
912
898
  | {
913
899
  type: 'selection'
914
900
  selection: EditorSelection
@@ -996,26 +982,9 @@ export declare const editorMachine: StateMachine<
996
982
  name: string
997
983
  }
998
984
  }
999
- | {
1000
- type: 'annotation.toggle'
1001
- annotation: {
1002
- name: string
1003
- value: {
1004
- [prop: string]: unknown
1005
- }
1006
- }
1007
- }
1008
985
  | {
1009
986
  type: 'blur'
1010
987
  }
1011
- | {
1012
- type: 'decorator.add'
1013
- decorator: string
1014
- }
1015
- | {
1016
- type: 'decorator.remove'
1017
- decorator: string
1018
- }
1019
988
  | {
1020
989
  type: 'decorator.toggle'
1021
990
  decorator: string
@@ -1109,6 +1078,10 @@ export declare const editorMachine: StateMachine<
1109
1078
  description: string
1110
1079
  data: unknown
1111
1080
  }
1081
+ | {
1082
+ type: 'select'
1083
+ selection: EditorSelection
1084
+ }
1112
1085
  | {
1113
1086
  type: 'selection'
1114
1087
  selection: EditorSelection
@@ -1149,26 +1122,9 @@ export declare const editorMachine: StateMachine<
1149
1122
  name: string
1150
1123
  }
1151
1124
  }
1152
- | {
1153
- type: 'annotation.toggle'
1154
- annotation: {
1155
- name: string
1156
- value: {
1157
- [prop: string]: unknown
1158
- }
1159
- }
1160
- }
1161
1125
  | {
1162
1126
  type: 'blur'
1163
1127
  }
1164
- | {
1165
- type: 'decorator.add'
1166
- decorator: string
1167
- }
1168
- | {
1169
- type: 'decorator.remove'
1170
- decorator: string
1171
- }
1172
1128
  | {
1173
1129
  type: 'decorator.toggle'
1174
1130
  decorator: string
@@ -1262,6 +1218,10 @@ export declare const editorMachine: StateMachine<
1262
1218
  description: string
1263
1219
  data: unknown
1264
1220
  }
1221
+ | {
1222
+ type: 'select'
1223
+ selection: EditorSelection
1224
+ }
1265
1225
  | {
1266
1226
  type: 'selection'
1267
1227
  selection: EditorSelection
@@ -1324,26 +1284,9 @@ export declare const editorMachine: StateMachine<
1324
1284
  name: string
1325
1285
  }
1326
1286
  }
1327
- | {
1328
- type: 'annotation.toggle'
1329
- annotation: {
1330
- name: string
1331
- value: {
1332
- [prop: string]: unknown
1333
- }
1334
- }
1335
- }
1336
1287
  | {
1337
1288
  type: 'blur'
1338
1289
  }
1339
- | {
1340
- type: 'decorator.add'
1341
- decorator: string
1342
- }
1343
- | {
1344
- type: 'decorator.remove'
1345
- decorator: string
1346
- }
1347
1290
  | {
1348
1291
  type: 'decorator.toggle'
1349
1292
  decorator: string
@@ -1437,6 +1380,10 @@ export declare const editorMachine: StateMachine<
1437
1380
  description: string
1438
1381
  data: unknown
1439
1382
  }
1383
+ | {
1384
+ type: 'select'
1385
+ selection: EditorSelection
1386
+ }
1440
1387
  | {
1441
1388
  type: 'selection'
1442
1389
  selection: EditorSelection
@@ -1475,26 +1422,9 @@ export declare const editorMachine: StateMachine<
1475
1422
  name: string
1476
1423
  }
1477
1424
  }
1478
- | {
1479
- type: 'annotation.toggle'
1480
- annotation: {
1481
- name: string
1482
- value: {
1483
- [prop: string]: unknown
1484
- }
1485
- }
1486
- }
1487
1425
  | {
1488
1426
  type: 'blur'
1489
1427
  }
1490
- | {
1491
- type: 'decorator.add'
1492
- decorator: string
1493
- }
1494
- | {
1495
- type: 'decorator.remove'
1496
- decorator: string
1497
- }
1498
1428
  | {
1499
1429
  type: 'decorator.toggle'
1500
1430
  decorator: string
@@ -1554,6 +1484,10 @@ export declare const editorMachine: StateMachine<
1554
1484
  description: string
1555
1485
  data: unknown
1556
1486
  }
1487
+ | {
1488
+ type: 'select'
1489
+ selection: EditorSelection
1490
+ }
1557
1491
  | {
1558
1492
  type: 'selection'
1559
1493
  selection: EditorSelection
@@ -1611,26 +1545,9 @@ export declare const editorMachine: StateMachine<
1611
1545
  name: string
1612
1546
  }
1613
1547
  }
1614
- | {
1615
- type: 'annotation.toggle'
1616
- annotation: {
1617
- name: string
1618
- value: {
1619
- [prop: string]: unknown
1620
- }
1621
- }
1622
- }
1623
1548
  | {
1624
1549
  type: 'blur'
1625
1550
  }
1626
- | {
1627
- type: 'decorator.add'
1628
- decorator: string
1629
- }
1630
- | {
1631
- type: 'decorator.remove'
1632
- decorator: string
1633
- }
1634
1551
  | {
1635
1552
  type: 'decorator.toggle'
1636
1553
  decorator: string
@@ -1724,6 +1641,10 @@ export declare const editorMachine: StateMachine<
1724
1641
  description: string
1725
1642
  data: unknown
1726
1643
  }
1644
+ | {
1645
+ type: 'select'
1646
+ selection: EditorSelection
1647
+ }
1727
1648
  | {
1728
1649
  type: 'selection'
1729
1650
  selection: EditorSelection
@@ -1762,26 +1683,9 @@ export declare const editorMachine: StateMachine<
1762
1683
  name: string
1763
1684
  }
1764
1685
  }
1765
- | {
1766
- type: 'annotation.toggle'
1767
- annotation: {
1768
- name: string
1769
- value: {
1770
- [prop: string]: unknown
1771
- }
1772
- }
1773
- }
1774
1686
  | {
1775
1687
  type: 'blur'
1776
1688
  }
1777
- | {
1778
- type: 'decorator.add'
1779
- decorator: string
1780
- }
1781
- | {
1782
- type: 'decorator.remove'
1783
- decorator: string
1784
- }
1785
1689
  | {
1786
1690
  type: 'decorator.toggle'
1787
1691
  decorator: string
@@ -1841,6 +1745,10 @@ export declare const editorMachine: StateMachine<
1841
1745
  description: string
1842
1746
  data: unknown
1843
1747
  }
1748
+ | {
1749
+ type: 'select'
1750
+ selection: EditorSelection
1751
+ }
1844
1752
  | {
1845
1753
  type: 'selection'
1846
1754
  selection: EditorSelection
@@ -1899,26 +1807,9 @@ export declare const editorMachine: StateMachine<
1899
1807
  name: string
1900
1808
  }
1901
1809
  }
1902
- | {
1903
- type: 'annotation.toggle'
1904
- annotation: {
1905
- name: string
1906
- value: {
1907
- [prop: string]: unknown
1908
- }
1909
- }
1910
- }
1911
1810
  | {
1912
1811
  type: 'blur'
1913
1812
  }
1914
- | {
1915
- type: 'decorator.add'
1916
- decorator: string
1917
- }
1918
- | {
1919
- type: 'decorator.remove'
1920
- decorator: string
1921
- }
1922
1813
  | {
1923
1814
  type: 'decorator.toggle'
1924
1815
  decorator: string
@@ -2012,6 +1903,10 @@ export declare const editorMachine: StateMachine<
2012
1903
  description: string
2013
1904
  data: unknown
2014
1905
  }
1906
+ | {
1907
+ type: 'select'
1908
+ selection: EditorSelection
1909
+ }
2015
1910
  | {
2016
1911
  type: 'selection'
2017
1912
  selection: EditorSelection
@@ -2050,26 +1945,9 @@ export declare const editorMachine: StateMachine<
2050
1945
  name: string
2051
1946
  }
2052
1947
  }
2053
- | {
2054
- type: 'annotation.toggle'
2055
- annotation: {
2056
- name: string
2057
- value: {
2058
- [prop: string]: unknown
2059
- }
2060
- }
2061
- }
2062
1948
  | {
2063
1949
  type: 'blur'
2064
1950
  }
2065
- | {
2066
- type: 'decorator.add'
2067
- decorator: string
2068
- }
2069
- | {
2070
- type: 'decorator.remove'
2071
- decorator: string
2072
- }
2073
1951
  | {
2074
1952
  type: 'decorator.toggle'
2075
1953
  decorator: string
@@ -2129,6 +2007,10 @@ export declare const editorMachine: StateMachine<
2129
2007
  description: string
2130
2008
  data: unknown
2131
2009
  }
2010
+ | {
2011
+ type: 'select'
2012
+ selection: EditorSelection
2013
+ }
2132
2014
  | {
2133
2015
  type: 'selection'
2134
2016
  selection: EditorSelection
@@ -2188,26 +2070,9 @@ export declare const editorMachine: StateMachine<
2188
2070
  name: string
2189
2071
  }
2190
2072
  }
2191
- | {
2192
- type: 'annotation.toggle'
2193
- annotation: {
2194
- name: string
2195
- value: {
2196
- [prop: string]: unknown
2197
- }
2198
- }
2199
- }
2200
2073
  | {
2201
2074
  type: 'blur'
2202
2075
  }
2203
- | {
2204
- type: 'decorator.add'
2205
- decorator: string
2206
- }
2207
- | {
2208
- type: 'decorator.remove'
2209
- decorator: string
2210
- }
2211
2076
  | {
2212
2077
  type: 'decorator.toggle'
2213
2078
  decorator: string
@@ -2301,6 +2166,10 @@ export declare const editorMachine: StateMachine<
2301
2166
  description: string
2302
2167
  data: unknown
2303
2168
  }
2169
+ | {
2170
+ type: 'select'
2171
+ selection: EditorSelection
2172
+ }
2304
2173
  | {
2305
2174
  type: 'selection'
2306
2175
  selection: EditorSelection
@@ -2339,26 +2208,9 @@ export declare const editorMachine: StateMachine<
2339
2208
  name: string
2340
2209
  }
2341
2210
  }
2342
- | {
2343
- type: 'annotation.toggle'
2344
- annotation: {
2345
- name: string
2346
- value: {
2347
- [prop: string]: unknown
2348
- }
2349
- }
2350
- }
2351
2211
  | {
2352
2212
  type: 'blur'
2353
2213
  }
2354
- | {
2355
- type: 'decorator.add'
2356
- decorator: string
2357
- }
2358
- | {
2359
- type: 'decorator.remove'
2360
- decorator: string
2361
- }
2362
2214
  | {
2363
2215
  type: 'decorator.toggle'
2364
2216
  decorator: string
@@ -2418,6 +2270,10 @@ export declare const editorMachine: StateMachine<
2418
2270
  description: string
2419
2271
  data: unknown
2420
2272
  }
2273
+ | {
2274
+ type: 'select'
2275
+ selection: EditorSelection
2276
+ }
2421
2277
  | {
2422
2278
  type: 'selection'
2423
2279
  selection: EditorSelection
@@ -2476,26 +2332,9 @@ export declare const editorMachine: StateMachine<
2476
2332
  name: string
2477
2333
  }
2478
2334
  }
2479
- | {
2480
- type: 'annotation.toggle'
2481
- annotation: {
2482
- name: string
2483
- value: {
2484
- [prop: string]: unknown
2485
- }
2486
- }
2487
- }
2488
2335
  | {
2489
2336
  type: 'blur'
2490
2337
  }
2491
- | {
2492
- type: 'decorator.add'
2493
- decorator: string
2494
- }
2495
- | {
2496
- type: 'decorator.remove'
2497
- decorator: string
2498
- }
2499
2338
  | {
2500
2339
  type: 'decorator.toggle'
2501
2340
  decorator: string
@@ -2589,6 +2428,10 @@ export declare const editorMachine: StateMachine<
2589
2428
  description: string
2590
2429
  data: unknown
2591
2430
  }
2431
+ | {
2432
+ type: 'select'
2433
+ selection: EditorSelection
2434
+ }
2592
2435
  | {
2593
2436
  type: 'selection'
2594
2437
  selection: EditorSelection
@@ -2644,26 +2487,9 @@ export declare const editorMachine: StateMachine<
2644
2487
  name: string
2645
2488
  }
2646
2489
  }
2647
- | {
2648
- type: 'annotation.toggle'
2649
- annotation: {
2650
- name: string
2651
- value: {
2652
- [prop: string]: unknown
2653
- }
2654
- }
2655
- }
2656
2490
  | {
2657
2491
  type: 'blur'
2658
2492
  }
2659
- | {
2660
- type: 'decorator.add'
2661
- decorator: string
2662
- }
2663
- | {
2664
- type: 'decorator.remove'
2665
- decorator: string
2666
- }
2667
2493
  | {
2668
2494
  type: 'decorator.toggle'
2669
2495
  decorator: string
@@ -2757,6 +2583,10 @@ export declare const editorMachine: StateMachine<
2757
2583
  description: string
2758
2584
  data: unknown
2759
2585
  }
2586
+ | {
2587
+ type: 'select'
2588
+ selection: EditorSelection
2589
+ }
2760
2590
  | {
2761
2591
  type: 'selection'
2762
2592
  selection: EditorSelection
@@ -2795,26 +2625,9 @@ export declare const editorMachine: StateMachine<
2795
2625
  name: string
2796
2626
  }
2797
2627
  }
2798
- | {
2799
- type: 'annotation.toggle'
2800
- annotation: {
2801
- name: string
2802
- value: {
2803
- [prop: string]: unknown
2804
- }
2805
- }
2806
- }
2807
2628
  | {
2808
2629
  type: 'blur'
2809
2630
  }
2810
- | {
2811
- type: 'decorator.add'
2812
- decorator: string
2813
- }
2814
- | {
2815
- type: 'decorator.remove'
2816
- decorator: string
2817
- }
2818
2631
  | {
2819
2632
  type: 'decorator.toggle'
2820
2633
  decorator: string
@@ -2874,6 +2687,10 @@ export declare const editorMachine: StateMachine<
2874
2687
  description: string
2875
2688
  data: unknown
2876
2689
  }
2690
+ | {
2691
+ type: 'select'
2692
+ selection: EditorSelection
2693
+ }
2877
2694
  | {
2878
2695
  type: 'selection'
2879
2696
  selection: EditorSelection
@@ -2932,26 +2749,9 @@ export declare const editorMachine: StateMachine<
2932
2749
  name: string
2933
2750
  }
2934
2751
  }
2935
- | {
2936
- type: 'annotation.toggle'
2937
- annotation: {
2938
- name: string
2939
- value: {
2940
- [prop: string]: unknown
2941
- }
2942
- }
2943
- }
2944
2752
  | {
2945
2753
  type: 'blur'
2946
2754
  }
2947
- | {
2948
- type: 'decorator.add'
2949
- decorator: string
2950
- }
2951
- | {
2952
- type: 'decorator.remove'
2953
- decorator: string
2954
- }
2955
2755
  | {
2956
2756
  type: 'decorator.toggle'
2957
2757
  decorator: string
@@ -3045,6 +2845,10 @@ export declare const editorMachine: StateMachine<
3045
2845
  description: string
3046
2846
  data: unknown
3047
2847
  }
2848
+ | {
2849
+ type: 'select'
2850
+ selection: EditorSelection
2851
+ }
3048
2852
  | {
3049
2853
  type: 'selection'
3050
2854
  selection: EditorSelection
@@ -3083,26 +2887,9 @@ export declare const editorMachine: StateMachine<
3083
2887
  name: string
3084
2888
  }
3085
2889
  }
3086
- | {
3087
- type: 'annotation.toggle'
3088
- annotation: {
3089
- name: string
3090
- value: {
3091
- [prop: string]: unknown
3092
- }
3093
- }
3094
- }
3095
2890
  | {
3096
2891
  type: 'blur'
3097
2892
  }
3098
- | {
3099
- type: 'decorator.add'
3100
- decorator: string
3101
- }
3102
- | {
3103
- type: 'decorator.remove'
3104
- decorator: string
3105
- }
3106
2893
  | {
3107
2894
  type: 'decorator.toggle'
3108
2895
  decorator: string
@@ -3162,6 +2949,10 @@ export declare const editorMachine: StateMachine<
3162
2949
  description: string
3163
2950
  data: unknown
3164
2951
  }
2952
+ | {
2953
+ type: 'select'
2954
+ selection: EditorSelection
2955
+ }
3165
2956
  | {
3166
2957
  type: 'selection'
3167
2958
  selection: EditorSelection
@@ -3219,26 +3010,9 @@ export declare const editorMachine: StateMachine<
3219
3010
  name: string
3220
3011
  }
3221
3012
  }
3222
- | {
3223
- type: 'annotation.toggle'
3224
- annotation: {
3225
- name: string
3226
- value: {
3227
- [prop: string]: unknown
3228
- }
3229
- }
3230
- }
3231
3013
  | {
3232
3014
  type: 'blur'
3233
3015
  }
3234
- | {
3235
- type: 'decorator.add'
3236
- decorator: string
3237
- }
3238
- | {
3239
- type: 'decorator.remove'
3240
- decorator: string
3241
- }
3242
3016
  | {
3243
3017
  type: 'decorator.toggle'
3244
3018
  decorator: string
@@ -3332,6 +3106,10 @@ export declare const editorMachine: StateMachine<
3332
3106
  description: string
3333
3107
  data: unknown
3334
3108
  }
3109
+ | {
3110
+ type: 'select'
3111
+ selection: EditorSelection
3112
+ }
3335
3113
  | {
3336
3114
  type: 'selection'
3337
3115
  selection: EditorSelection
@@ -3370,26 +3148,9 @@ export declare const editorMachine: StateMachine<
3370
3148
  name: string
3371
3149
  }
3372
3150
  }
3373
- | {
3374
- type: 'annotation.toggle'
3375
- annotation: {
3376
- name: string
3377
- value: {
3378
- [prop: string]: unknown
3379
- }
3380
- }
3381
- }
3382
3151
  | {
3383
3152
  type: 'blur'
3384
3153
  }
3385
- | {
3386
- type: 'decorator.add'
3387
- decorator: string
3388
- }
3389
- | {
3390
- type: 'decorator.remove'
3391
- decorator: string
3392
- }
3393
3154
  | {
3394
3155
  type: 'decorator.toggle'
3395
3156
  decorator: string
@@ -3449,6 +3210,10 @@ export declare const editorMachine: StateMachine<
3449
3210
  description: string
3450
3211
  data: unknown
3451
3212
  }
3213
+ | {
3214
+ type: 'select'
3215
+ selection: EditorSelection
3216
+ }
3452
3217
  | {
3453
3218
  type: 'selection'
3454
3219
  selection: EditorSelection
@@ -3505,26 +3270,9 @@ export declare const editorMachine: StateMachine<
3505
3270
  name: string
3506
3271
  }
3507
3272
  }
3508
- | {
3509
- type: 'annotation.toggle'
3510
- annotation: {
3511
- name: string
3512
- value: {
3513
- [prop: string]: unknown
3514
- }
3515
- }
3516
- }
3517
3273
  | {
3518
3274
  type: 'blur'
3519
3275
  }
3520
- | {
3521
- type: 'decorator.add'
3522
- decorator: string
3523
- }
3524
- | {
3525
- type: 'decorator.remove'
3526
- decorator: string
3527
- }
3528
3276
  | {
3529
3277
  type: 'decorator.toggle'
3530
3278
  decorator: string
@@ -3618,6 +3366,10 @@ export declare const editorMachine: StateMachine<
3618
3366
  description: string
3619
3367
  data: unknown
3620
3368
  }
3369
+ | {
3370
+ type: 'select'
3371
+ selection: EditorSelection
3372
+ }
3621
3373
  | {
3622
3374
  type: 'selection'
3623
3375
  selection: EditorSelection
@@ -3656,26 +3408,9 @@ export declare const editorMachine: StateMachine<
3656
3408
  name: string
3657
3409
  }
3658
3410
  }
3659
- | {
3660
- type: 'annotation.toggle'
3661
- annotation: {
3662
- name: string
3663
- value: {
3664
- [prop: string]: unknown
3665
- }
3666
- }
3667
- }
3668
3411
  | {
3669
3412
  type: 'blur'
3670
3413
  }
3671
- | {
3672
- type: 'decorator.add'
3673
- decorator: string
3674
- }
3675
- | {
3676
- type: 'decorator.remove'
3677
- decorator: string
3678
- }
3679
3414
  | {
3680
3415
  type: 'decorator.toggle'
3681
3416
  decorator: string
@@ -3735,6 +3470,10 @@ export declare const editorMachine: StateMachine<
3735
3470
  description: string
3736
3471
  data: unknown
3737
3472
  }
3473
+ | {
3474
+ type: 'select'
3475
+ selection: EditorSelection
3476
+ }
3738
3477
  | {
3739
3478
  type: 'selection'
3740
3479
  selection: EditorSelection
@@ -3789,26 +3528,9 @@ export declare const editorMachine: StateMachine<
3789
3528
  name: string
3790
3529
  }
3791
3530
  }
3792
- | {
3793
- type: 'annotation.toggle'
3794
- annotation: {
3795
- name: string
3796
- value: {
3797
- [prop: string]: unknown
3798
- }
3799
- }
3800
- }
3801
3531
  | {
3802
3532
  type: 'blur'
3803
3533
  }
3804
- | {
3805
- type: 'decorator.add'
3806
- decorator: string
3807
- }
3808
- | {
3809
- type: 'decorator.remove'
3810
- decorator: string
3811
- }
3812
3534
  | {
3813
3535
  type: 'decorator.toggle'
3814
3536
  decorator: string
@@ -3902,6 +3624,10 @@ export declare const editorMachine: StateMachine<
3902
3624
  description: string
3903
3625
  data: unknown
3904
3626
  }
3627
+ | {
3628
+ type: 'select'
3629
+ selection: EditorSelection
3630
+ }
3905
3631
  | {
3906
3632
  type: 'selection'
3907
3633
  selection: EditorSelection
@@ -3940,26 +3666,9 @@ export declare const editorMachine: StateMachine<
3940
3666
  name: string
3941
3667
  }
3942
3668
  }
3943
- | {
3944
- type: 'annotation.toggle'
3945
- annotation: {
3946
- name: string
3947
- value: {
3948
- [prop: string]: unknown
3949
- }
3950
- }
3951
- }
3952
3669
  | {
3953
3670
  type: 'blur'
3954
3671
  }
3955
- | {
3956
- type: 'decorator.add'
3957
- decorator: string
3958
- }
3959
- | {
3960
- type: 'decorator.remove'
3961
- decorator: string
3962
- }
3963
3672
  | {
3964
3673
  type: 'decorator.toggle'
3965
3674
  decorator: string
@@ -4019,6 +3728,10 @@ export declare const editorMachine: StateMachine<
4019
3728
  description: string
4020
3729
  data: unknown
4021
3730
  }
3731
+ | {
3732
+ type: 'select'
3733
+ selection: EditorSelection
3734
+ }
4022
3735
  | {
4023
3736
  type: 'selection'
4024
3737
  selection: EditorSelection
@@ -4075,26 +3788,9 @@ export declare const editorMachine: StateMachine<
4075
3788
  name: string
4076
3789
  }
4077
3790
  }
4078
- | {
4079
- type: 'annotation.toggle'
4080
- annotation: {
4081
- name: string
4082
- value: {
4083
- [prop: string]: unknown
4084
- }
4085
- }
4086
- }
4087
3791
  | {
4088
3792
  type: 'blur'
4089
3793
  }
4090
- | {
4091
- type: 'decorator.add'
4092
- decorator: string
4093
- }
4094
- | {
4095
- type: 'decorator.remove'
4096
- decorator: string
4097
- }
4098
3794
  | {
4099
3795
  type: 'decorator.toggle'
4100
3796
  decorator: string
@@ -4188,6 +3884,10 @@ export declare const editorMachine: StateMachine<
4188
3884
  description: string
4189
3885
  data: unknown
4190
3886
  }
3887
+ | {
3888
+ type: 'select'
3889
+ selection: EditorSelection
3890
+ }
4191
3891
  | {
4192
3892
  type: 'selection'
4193
3893
  selection: EditorSelection
@@ -4226,26 +3926,9 @@ export declare const editorMachine: StateMachine<
4226
3926
  name: string
4227
3927
  }
4228
3928
  }
4229
- | {
4230
- type: 'annotation.toggle'
4231
- annotation: {
4232
- name: string
4233
- value: {
4234
- [prop: string]: unknown
4235
- }
4236
- }
4237
- }
4238
3929
  | {
4239
3930
  type: 'blur'
4240
3931
  }
4241
- | {
4242
- type: 'decorator.add'
4243
- decorator: string
4244
- }
4245
- | {
4246
- type: 'decorator.remove'
4247
- decorator: string
4248
- }
4249
3932
  | {
4250
3933
  type: 'decorator.toggle'
4251
3934
  decorator: string
@@ -4305,6 +3988,10 @@ export declare const editorMachine: StateMachine<
4305
3988
  description: string
4306
3989
  data: unknown
4307
3990
  }
3991
+ | {
3992
+ type: 'select'
3993
+ selection: EditorSelection
3994
+ }
4308
3995
  | {
4309
3996
  type: 'selection'
4310
3997
  selection: EditorSelection
@@ -4368,26 +4055,9 @@ export declare const editorMachine: StateMachine<
4368
4055
  name: string
4369
4056
  }
4370
4057
  }
4371
- | {
4372
- type: 'annotation.toggle'
4373
- annotation: {
4374
- name: string
4375
- value: {
4376
- [prop: string]: unknown
4377
- }
4378
- }
4379
- }
4380
4058
  | {
4381
4059
  type: 'blur'
4382
4060
  }
4383
- | {
4384
- type: 'decorator.add'
4385
- decorator: string
4386
- }
4387
- | {
4388
- type: 'decorator.remove'
4389
- decorator: string
4390
- }
4391
4061
  | {
4392
4062
  type: 'decorator.toggle'
4393
4063
  decorator: string
@@ -4481,6 +4151,10 @@ export declare const editorMachine: StateMachine<
4481
4151
  description: string
4482
4152
  data: unknown
4483
4153
  }
4154
+ | {
4155
+ type: 'select'
4156
+ selection: EditorSelection
4157
+ }
4484
4158
  | {
4485
4159
  type: 'selection'
4486
4160
  selection: EditorSelection
@@ -4538,26 +4212,9 @@ export declare const editorMachine: StateMachine<
4538
4212
  name: string
4539
4213
  }
4540
4214
  }
4541
- | {
4542
- type: 'annotation.toggle'
4543
- annotation: {
4544
- name: string
4545
- value: {
4546
- [prop: string]: unknown
4547
- }
4548
- }
4549
- }
4550
4215
  | {
4551
4216
  type: 'blur'
4552
4217
  }
4553
- | {
4554
- type: 'decorator.add'
4555
- decorator: string
4556
- }
4557
- | {
4558
- type: 'decorator.remove'
4559
- decorator: string
4560
- }
4561
4218
  | {
4562
4219
  type: 'decorator.toggle'
4563
4220
  decorator: string
@@ -4651,6 +4308,10 @@ export declare const editorMachine: StateMachine<
4651
4308
  description: string
4652
4309
  data: unknown
4653
4310
  }
4311
+ | {
4312
+ type: 'select'
4313
+ selection: EditorSelection
4314
+ }
4654
4315
  | {
4655
4316
  type: 'selection'
4656
4317
  selection: EditorSelection
@@ -4770,7 +4431,7 @@ export declare const editorMachine: StateMachine<
4770
4431
  readonly 'behavior event': {
4771
4432
  readonly actions: 'handle behavior event'
4772
4433
  }
4773
- readonly 'annotation.add': {
4434
+ readonly 'annotation.*': {
4774
4435
  readonly actions: ActionFunction<
4775
4436
  {
4776
4437
  behaviors: Array<Behavior>
@@ -4782,15 +4443,6 @@ export declare const editorMachine: StateMachine<
4782
4443
  selection: EditorSelection
4783
4444
  value: Array<PortableTextBlock> | undefined
4784
4445
  },
4785
- {
4786
- type: 'annotation.add'
4787
- annotation: {
4788
- name: string
4789
- value: {
4790
- [prop: string]: unknown
4791
- }
4792
- }
4793
- },
4794
4446
  | {
4795
4447
  type: 'annotation.add'
4796
4448
  annotation: {
@@ -4805,9 +4457,9 @@ export declare const editorMachine: StateMachine<
4805
4457
  annotation: {
4806
4458
  name: string
4807
4459
  }
4808
- }
4460
+ },
4809
4461
  | {
4810
- type: 'annotation.toggle'
4462
+ type: 'annotation.add'
4811
4463
  annotation: {
4812
4464
  name: string
4813
4465
  value: {
@@ -4816,15 +4468,13 @@ export declare const editorMachine: StateMachine<
4816
4468
  }
4817
4469
  }
4818
4470
  | {
4819
- type: 'blur'
4820
- }
4821
- | {
4822
- type: 'decorator.add'
4823
- decorator: string
4471
+ type: 'annotation.remove'
4472
+ annotation: {
4473
+ name: string
4474
+ }
4824
4475
  }
4825
4476
  | {
4826
- type: 'decorator.remove'
4827
- decorator: string
4477
+ type: 'blur'
4828
4478
  }
4829
4479
  | {
4830
4480
  type: 'decorator.toggle'
@@ -4922,296 +4572,9 @@ export declare const editorMachine: StateMachine<
4922
4572
  data: unknown
4923
4573
  }
4924
4574
  | {
4925
- type: 'selection'
4575
+ type: 'select'
4926
4576
  selection: EditorSelection
4927
4577
  }
4928
- | {
4929
- type: 'blurred'
4930
- event: FocusEvent_2<HTMLDivElement, Element>
4931
- }
4932
- | {
4933
- type: 'focused'
4934
- event: FocusEvent_2<HTMLDivElement, Element>
4935
- }
4936
- | {
4937
- type: 'loading'
4938
- }
4939
- | {
4940
- type: 'done loading'
4941
- },
4942
- undefined,
4943
- never,
4944
- never,
4945
- never,
4946
- never,
4947
- | {
4948
- type: 'annotation.add'
4949
- annotation: {
4950
- name: string
4951
- value: {
4952
- [prop: string]: unknown
4953
- }
4954
- }
4955
- }
4956
- | {
4957
- type: 'annotation.remove'
4958
- annotation: {
4959
- name: string
4960
- }
4961
- }
4962
- | {
4963
- type: 'annotation.toggle'
4964
- annotation: {
4965
- name: string
4966
- value: {
4967
- [prop: string]: unknown
4968
- }
4969
- }
4970
- }
4971
- | {
4972
- type: 'blur'
4973
- }
4974
- | {
4975
- type: 'decorator.add'
4976
- decorator: string
4977
- }
4978
- | {
4979
- type: 'decorator.remove'
4980
- decorator: string
4981
- }
4982
- | {
4983
- type: 'decorator.toggle'
4984
- decorator: string
4985
- }
4986
- | {
4987
- type: 'focus'
4988
- }
4989
- | {
4990
- type: 'insert.block object'
4991
- placement: 'auto' | 'after' | 'before'
4992
- blockObject: {
4993
- name: string
4994
- value?: {
4995
- [prop: string]: unknown
4996
- }
4997
- }
4998
- }
4999
- | {
5000
- type: 'insert.inline object'
5001
- inlineObject: {
5002
- name: string
5003
- value?: {
5004
- [prop: string]: unknown
5005
- }
5006
- }
5007
- }
5008
- | {
5009
- type: 'list item.toggle'
5010
- listItem: string
5011
- }
5012
- | {
5013
- type: 'style.toggle'
5014
- style: string
5015
- }
5016
- | PatchEvent
5017
- | MutationEvent_2
5018
- | {
5019
- type: 'ready'
5020
- }
5021
- | PatchesEvent
5022
- | {
5023
- type: 'unset'
5024
- previousValue: Array<PortableTextBlock>
5025
- }
5026
- | {
5027
- type: 'value changed'
5028
- value: Array<PortableTextBlock> | undefined
5029
- }
5030
- | {
5031
- type: 'invalid value'
5032
- resolution: InvalidValueResolution | null
5033
- value: Array<PortableTextBlock> | undefined
5034
- }
5035
- | {
5036
- type: 'error'
5037
- name: string
5038
- description: string
5039
- data: unknown
5040
- }
5041
- | {
5042
- type: 'selection'
5043
- selection: EditorSelection
5044
- }
5045
- | {
5046
- type: 'blurred'
5047
- event: FocusEvent_2<HTMLDivElement, Element>
5048
- }
5049
- | {
5050
- type: 'focused'
5051
- event: FocusEvent_2<HTMLDivElement, Element>
5052
- }
5053
- | {
5054
- type: 'loading'
5055
- }
5056
- | {
5057
- type: 'done loading'
5058
- }
5059
- | {
5060
- type: 'read only'
5061
- }
5062
- | {
5063
- type: 'editable'
5064
- }
5065
- >
5066
- }
5067
- readonly 'annotation.remove': {
5068
- readonly actions: ActionFunction<
5069
- {
5070
- behaviors: Array<Behavior>
5071
- keyGenerator: () => string
5072
- pendingEvents: Array<PatchEvent | MutationEvent_2>
5073
- schema: EditorSchema
5074
- initialReadOnly: boolean
5075
- maxBlocks: number | undefined
5076
- selection: EditorSelection
5077
- value: Array<PortableTextBlock> | undefined
5078
- },
5079
- {
5080
- type: 'annotation.remove'
5081
- annotation: {
5082
- name: string
5083
- }
5084
- },
5085
- | {
5086
- type: 'annotation.add'
5087
- annotation: {
5088
- name: string
5089
- value: {
5090
- [prop: string]: unknown
5091
- }
5092
- }
5093
- }
5094
- | {
5095
- type: 'annotation.remove'
5096
- annotation: {
5097
- name: string
5098
- }
5099
- }
5100
- | {
5101
- type: 'annotation.toggle'
5102
- annotation: {
5103
- name: string
5104
- value: {
5105
- [prop: string]: unknown
5106
- }
5107
- }
5108
- }
5109
- | {
5110
- type: 'blur'
5111
- }
5112
- | {
5113
- type: 'decorator.add'
5114
- decorator: string
5115
- }
5116
- | {
5117
- type: 'decorator.remove'
5118
- decorator: string
5119
- }
5120
- | {
5121
- type: 'decorator.toggle'
5122
- decorator: string
5123
- }
5124
- | {
5125
- type: 'focus'
5126
- }
5127
- | {
5128
- type: 'insert.block object'
5129
- placement: 'auto' | 'after' | 'before'
5130
- blockObject: {
5131
- name: string
5132
- value?: {
5133
- [prop: string]: unknown
5134
- }
5135
- }
5136
- }
5137
- | {
5138
- type: 'insert.inline object'
5139
- inlineObject: {
5140
- name: string
5141
- value?: {
5142
- [prop: string]: unknown
5143
- }
5144
- }
5145
- }
5146
- | {
5147
- type: 'list item.toggle'
5148
- listItem: string
5149
- }
5150
- | {
5151
- type: 'style.toggle'
5152
- style: string
5153
- }
5154
- | PatchEvent
5155
- | MutationEvent_2
5156
- | {
5157
- type: 'normalizing'
5158
- }
5159
- | {
5160
- type: 'done normalizing'
5161
- }
5162
- | {
5163
- type: 'done syncing initial value'
5164
- }
5165
- | {
5166
- type: 'behavior event'
5167
- behaviorEvent:
5168
- | SyntheticBehaviorEvent
5169
- | NativeBehaviorEvent
5170
- editor: PortableTextSlateEditor
5171
- nativeEvent?: {
5172
- preventDefault: () => void
5173
- }
5174
- }
5175
- | {
5176
- type: 'update readOnly'
5177
- readOnly: boolean
5178
- }
5179
- | {
5180
- type: 'update schema'
5181
- schema: EditorSchema
5182
- }
5183
- | {
5184
- type: 'update behaviors'
5185
- behaviors: Array<Behavior>
5186
- }
5187
- | {
5188
- type: 'update value'
5189
- value: Array<PortableTextBlock> | undefined
5190
- }
5191
- | {
5192
- type: 'update maxBlocks'
5193
- maxBlocks: number | undefined
5194
- }
5195
- | PatchesEvent
5196
- | {
5197
- type: 'unset'
5198
- previousValue: Array<PortableTextBlock>
5199
- }
5200
- | {
5201
- type: 'value changed'
5202
- value: Array<PortableTextBlock> | undefined
5203
- }
5204
- | {
5205
- type: 'invalid value'
5206
- resolution: InvalidValueResolution | null
5207
- value: Array<PortableTextBlock> | undefined
5208
- }
5209
- | {
5210
- type: 'error'
5211
- name: string
5212
- description: string
5213
- data: unknown
5214
- }
5215
4578
  | {
5216
4579
  type: 'selection'
5217
4580
  selection: EditorSelection
@@ -5250,26 +4613,9 @@ export declare const editorMachine: StateMachine<
5250
4613
  name: string
5251
4614
  }
5252
4615
  }
5253
- | {
5254
- type: 'annotation.toggle'
5255
- annotation: {
5256
- name: string
5257
- value: {
5258
- [prop: string]: unknown
5259
- }
5260
- }
5261
- }
5262
4616
  | {
5263
4617
  type: 'blur'
5264
4618
  }
5265
- | {
5266
- type: 'decorator.add'
5267
- decorator: string
5268
- }
5269
- | {
5270
- type: 'decorator.remove'
5271
- decorator: string
5272
- }
5273
4619
  | {
5274
4620
  type: 'decorator.toggle'
5275
4621
  decorator: string
@@ -5329,6 +4675,10 @@ export declare const editorMachine: StateMachine<
5329
4675
  description: string
5330
4676
  data: unknown
5331
4677
  }
4678
+ | {
4679
+ type: 'select'
4680
+ selection: EditorSelection
4681
+ }
5332
4682
  | {
5333
4683
  type: 'selection'
5334
4684
  selection: EditorSelection
@@ -5355,7 +4705,7 @@ export declare const editorMachine: StateMachine<
5355
4705
  }
5356
4706
  >
5357
4707
  }
5358
- readonly 'annotation.toggle': {
4708
+ readonly 'blur': {
5359
4709
  readonly actions: ActionFunction<
5360
4710
  {
5361
4711
  behaviors: Array<Behavior>
@@ -5368,13 +4718,7 @@ export declare const editorMachine: StateMachine<
5368
4718
  value: Array<PortableTextBlock> | undefined
5369
4719
  },
5370
4720
  {
5371
- type: 'annotation.toggle'
5372
- annotation: {
5373
- name: string
5374
- value: {
5375
- [prop: string]: unknown
5376
- }
5377
- }
4721
+ type: 'blur'
5378
4722
  },
5379
4723
  | {
5380
4724
  type: 'annotation.add'
@@ -5391,26 +4735,9 @@ export declare const editorMachine: StateMachine<
5391
4735
  name: string
5392
4736
  }
5393
4737
  }
5394
- | {
5395
- type: 'annotation.toggle'
5396
- annotation: {
5397
- name: string
5398
- value: {
5399
- [prop: string]: unknown
5400
- }
5401
- }
5402
- }
5403
4738
  | {
5404
4739
  type: 'blur'
5405
4740
  }
5406
- | {
5407
- type: 'decorator.add'
5408
- decorator: string
5409
- }
5410
- | {
5411
- type: 'decorator.remove'
5412
- decorator: string
5413
- }
5414
4741
  | {
5415
4742
  type: 'decorator.toggle'
5416
4743
  decorator: string
@@ -5506,6 +4833,10 @@ export declare const editorMachine: StateMachine<
5506
4833
  description: string
5507
4834
  data: unknown
5508
4835
  }
4836
+ | {
4837
+ type: 'select'
4838
+ selection: EditorSelection
4839
+ }
5509
4840
  | {
5510
4841
  type: 'selection'
5511
4842
  selection: EditorSelection
@@ -5544,26 +4875,9 @@ export declare const editorMachine: StateMachine<
5544
4875
  name: string
5545
4876
  }
5546
4877
  }
5547
- | {
5548
- type: 'annotation.toggle'
5549
- annotation: {
5550
- name: string
5551
- value: {
5552
- [prop: string]: unknown
5553
- }
5554
- }
5555
- }
5556
4878
  | {
5557
4879
  type: 'blur'
5558
4880
  }
5559
- | {
5560
- type: 'decorator.add'
5561
- decorator: string
5562
- }
5563
- | {
5564
- type: 'decorator.remove'
5565
- decorator: string
5566
- }
5567
4881
  | {
5568
4882
  type: 'decorator.toggle'
5569
4883
  decorator: string
@@ -5623,6 +4937,10 @@ export declare const editorMachine: StateMachine<
5623
4937
  description: string
5624
4938
  data: unknown
5625
4939
  }
4940
+ | {
4941
+ type: 'select'
4942
+ selection: EditorSelection
4943
+ }
5626
4944
  | {
5627
4945
  type: 'selection'
5628
4946
  selection: EditorSelection
@@ -5649,7 +4967,7 @@ export declare const editorMachine: StateMachine<
5649
4967
  }
5650
4968
  >
5651
4969
  }
5652
- readonly 'blur': {
4970
+ readonly 'decorator.*': {
5653
4971
  readonly actions: ActionFunction<
5654
4972
  {
5655
4973
  behaviors: Array<Behavior>
@@ -5662,7 +4980,8 @@ export declare const editorMachine: StateMachine<
5662
4980
  value: Array<PortableTextBlock> | undefined
5663
4981
  },
5664
4982
  {
5665
- type: 'blur'
4983
+ type: 'decorator.toggle'
4984
+ decorator: string
5666
4985
  },
5667
4986
  | {
5668
4987
  type: 'annotation.add'
@@ -5679,26 +4998,9 @@ export declare const editorMachine: StateMachine<
5679
4998
  name: string
5680
4999
  }
5681
5000
  }
5682
- | {
5683
- type: 'annotation.toggle'
5684
- annotation: {
5685
- name: string
5686
- value: {
5687
- [prop: string]: unknown
5688
- }
5689
- }
5690
- }
5691
5001
  | {
5692
5002
  type: 'blur'
5693
5003
  }
5694
- | {
5695
- type: 'decorator.add'
5696
- decorator: string
5697
- }
5698
- | {
5699
- type: 'decorator.remove'
5700
- decorator: string
5701
- }
5702
5004
  | {
5703
5005
  type: 'decorator.toggle'
5704
5006
  decorator: string
@@ -5794,6 +5096,10 @@ export declare const editorMachine: StateMachine<
5794
5096
  description: string
5795
5097
  data: unknown
5796
5098
  }
5099
+ | {
5100
+ type: 'select'
5101
+ selection: EditorSelection
5102
+ }
5797
5103
  | {
5798
5104
  type: 'selection'
5799
5105
  selection: EditorSelection
@@ -5832,26 +5138,9 @@ export declare const editorMachine: StateMachine<
5832
5138
  name: string
5833
5139
  }
5834
5140
  }
5835
- | {
5836
- type: 'annotation.toggle'
5837
- annotation: {
5838
- name: string
5839
- value: {
5840
- [prop: string]: unknown
5841
- }
5842
- }
5843
- }
5844
5141
  | {
5845
5142
  type: 'blur'
5846
5143
  }
5847
- | {
5848
- type: 'decorator.add'
5849
- decorator: string
5850
- }
5851
- | {
5852
- type: 'decorator.remove'
5853
- decorator: string
5854
- }
5855
5144
  | {
5856
5145
  type: 'decorator.toggle'
5857
5146
  decorator: string
@@ -5911,6 +5200,10 @@ export declare const editorMachine: StateMachine<
5911
5200
  description: string
5912
5201
  data: unknown
5913
5202
  }
5203
+ | {
5204
+ type: 'select'
5205
+ selection: EditorSelection
5206
+ }
5914
5207
  | {
5915
5208
  type: 'selection'
5916
5209
  selection: EditorSelection
@@ -5937,7 +5230,7 @@ export declare const editorMachine: StateMachine<
5937
5230
  }
5938
5231
  >
5939
5232
  }
5940
- readonly 'decorator.*': {
5233
+ readonly 'focus': {
5941
5234
  readonly actions: ActionFunction<
5942
5235
  {
5943
5236
  behaviors: Array<Behavior>
@@ -5949,18 +5242,9 @@ export declare const editorMachine: StateMachine<
5949
5242
  selection: EditorSelection
5950
5243
  value: Array<PortableTextBlock> | undefined
5951
5244
  },
5952
- | {
5953
- type: 'decorator.add'
5954
- decorator: string
5955
- }
5956
- | {
5957
- type: 'decorator.remove'
5958
- decorator: string
5959
- }
5960
- | {
5961
- type: 'decorator.toggle'
5962
- decorator: string
5963
- },
5245
+ {
5246
+ type: 'focus'
5247
+ },
5964
5248
  | {
5965
5249
  type: 'annotation.add'
5966
5250
  annotation: {
@@ -5976,26 +5260,9 @@ export declare const editorMachine: StateMachine<
5976
5260
  name: string
5977
5261
  }
5978
5262
  }
5979
- | {
5980
- type: 'annotation.toggle'
5981
- annotation: {
5982
- name: string
5983
- value: {
5984
- [prop: string]: unknown
5985
- }
5986
- }
5987
- }
5988
5263
  | {
5989
5264
  type: 'blur'
5990
5265
  }
5991
- | {
5992
- type: 'decorator.add'
5993
- decorator: string
5994
- }
5995
- | {
5996
- type: 'decorator.remove'
5997
- decorator: string
5998
- }
5999
5266
  | {
6000
5267
  type: 'decorator.toggle'
6001
5268
  decorator: string
@@ -6091,6 +5358,10 @@ export declare const editorMachine: StateMachine<
6091
5358
  description: string
6092
5359
  data: unknown
6093
5360
  }
5361
+ | {
5362
+ type: 'select'
5363
+ selection: EditorSelection
5364
+ }
6094
5365
  | {
6095
5366
  type: 'selection'
6096
5367
  selection: EditorSelection
@@ -6129,26 +5400,9 @@ export declare const editorMachine: StateMachine<
6129
5400
  name: string
6130
5401
  }
6131
5402
  }
6132
- | {
6133
- type: 'annotation.toggle'
6134
- annotation: {
6135
- name: string
6136
- value: {
6137
- [prop: string]: unknown
6138
- }
6139
- }
6140
- }
6141
5403
  | {
6142
5404
  type: 'blur'
6143
5405
  }
6144
- | {
6145
- type: 'decorator.add'
6146
- decorator: string
6147
- }
6148
- | {
6149
- type: 'decorator.remove'
6150
- decorator: string
6151
- }
6152
5406
  | {
6153
5407
  type: 'decorator.toggle'
6154
5408
  decorator: string
@@ -6208,6 +5462,10 @@ export declare const editorMachine: StateMachine<
6208
5462
  description: string
6209
5463
  data: unknown
6210
5464
  }
5465
+ | {
5466
+ type: 'select'
5467
+ selection: EditorSelection
5468
+ }
6211
5469
  | {
6212
5470
  type: 'selection'
6213
5471
  selection: EditorSelection
@@ -6234,7 +5492,7 @@ export declare const editorMachine: StateMachine<
6234
5492
  }
6235
5493
  >
6236
5494
  }
6237
- readonly 'focus': {
5495
+ readonly 'insert.*': {
6238
5496
  readonly actions: ActionFunction<
6239
5497
  {
6240
5498
  behaviors: Array<Behavior>
@@ -6246,26 +5504,27 @@ export declare const editorMachine: StateMachine<
6246
5504
  selection: EditorSelection
6247
5505
  value: Array<PortableTextBlock> | undefined
6248
5506
  },
6249
- {
6250
- type: 'focus'
6251
- },
6252
5507
  | {
6253
- type: 'annotation.add'
6254
- annotation: {
5508
+ type: 'insert.block object'
5509
+ placement: 'auto' | 'after' | 'before'
5510
+ blockObject: {
6255
5511
  name: string
6256
- value: {
5512
+ value?: {
6257
5513
  [prop: string]: unknown
6258
5514
  }
6259
5515
  }
6260
5516
  }
6261
5517
  | {
6262
- type: 'annotation.remove'
6263
- annotation: {
5518
+ type: 'insert.inline object'
5519
+ inlineObject: {
6264
5520
  name: string
5521
+ value?: {
5522
+ [prop: string]: unknown
5523
+ }
6265
5524
  }
6266
- }
5525
+ },
6267
5526
  | {
6268
- type: 'annotation.toggle'
5527
+ type: 'annotation.add'
6269
5528
  annotation: {
6270
5529
  name: string
6271
5530
  value: {
@@ -6274,15 +5533,13 @@ export declare const editorMachine: StateMachine<
6274
5533
  }
6275
5534
  }
6276
5535
  | {
6277
- type: 'blur'
6278
- }
6279
- | {
6280
- type: 'decorator.add'
6281
- decorator: string
5536
+ type: 'annotation.remove'
5537
+ annotation: {
5538
+ name: string
5539
+ }
6282
5540
  }
6283
5541
  | {
6284
- type: 'decorator.remove'
6285
- decorator: string
5542
+ type: 'blur'
6286
5543
  }
6287
5544
  | {
6288
5545
  type: 'decorator.toggle'
@@ -6379,6 +5636,10 @@ export declare const editorMachine: StateMachine<
6379
5636
  description: string
6380
5637
  data: unknown
6381
5638
  }
5639
+ | {
5640
+ type: 'select'
5641
+ selection: EditorSelection
5642
+ }
6382
5643
  | {
6383
5644
  type: 'selection'
6384
5645
  selection: EditorSelection
@@ -6417,26 +5678,9 @@ export declare const editorMachine: StateMachine<
6417
5678
  name: string
6418
5679
  }
6419
5680
  }
6420
- | {
6421
- type: 'annotation.toggle'
6422
- annotation: {
6423
- name: string
6424
- value: {
6425
- [prop: string]: unknown
6426
- }
6427
- }
6428
- }
6429
5681
  | {
6430
5682
  type: 'blur'
6431
5683
  }
6432
- | {
6433
- type: 'decorator.add'
6434
- decorator: string
6435
- }
6436
- | {
6437
- type: 'decorator.remove'
6438
- decorator: string
6439
- }
6440
5684
  | {
6441
5685
  type: 'decorator.toggle'
6442
5686
  decorator: string
@@ -6496,6 +5740,10 @@ export declare const editorMachine: StateMachine<
6496
5740
  description: string
6497
5741
  data: unknown
6498
5742
  }
5743
+ | {
5744
+ type: 'select'
5745
+ selection: EditorSelection
5746
+ }
6499
5747
  | {
6500
5748
  type: 'selection'
6501
5749
  selection: EditorSelection
@@ -6522,7 +5770,7 @@ export declare const editorMachine: StateMachine<
6522
5770
  }
6523
5771
  >
6524
5772
  }
6525
- readonly 'insert.*': {
5773
+ readonly 'list item.*': {
6526
5774
  readonly actions: ActionFunction<
6527
5775
  {
6528
5776
  behaviors: Array<Behavior>
@@ -6534,25 +5782,10 @@ export declare const editorMachine: StateMachine<
6534
5782
  selection: EditorSelection
6535
5783
  value: Array<PortableTextBlock> | undefined
6536
5784
  },
6537
- | {
6538
- type: 'insert.block object'
6539
- placement: 'auto' | 'after' | 'before'
6540
- blockObject: {
6541
- name: string
6542
- value?: {
6543
- [prop: string]: unknown
6544
- }
6545
- }
6546
- }
6547
- | {
6548
- type: 'insert.inline object'
6549
- inlineObject: {
6550
- name: string
6551
- value?: {
6552
- [prop: string]: unknown
6553
- }
6554
- }
6555
- },
5785
+ {
5786
+ type: 'list item.toggle'
5787
+ listItem: string
5788
+ },
6556
5789
  | {
6557
5790
  type: 'annotation.add'
6558
5791
  annotation: {
@@ -6568,26 +5801,9 @@ export declare const editorMachine: StateMachine<
6568
5801
  name: string
6569
5802
  }
6570
5803
  }
6571
- | {
6572
- type: 'annotation.toggle'
6573
- annotation: {
6574
- name: string
6575
- value: {
6576
- [prop: string]: unknown
6577
- }
6578
- }
6579
- }
6580
5804
  | {
6581
5805
  type: 'blur'
6582
5806
  }
6583
- | {
6584
- type: 'decorator.add'
6585
- decorator: string
6586
- }
6587
- | {
6588
- type: 'decorator.remove'
6589
- decorator: string
6590
- }
6591
5807
  | {
6592
5808
  type: 'decorator.toggle'
6593
5809
  decorator: string
@@ -6683,6 +5899,10 @@ export declare const editorMachine: StateMachine<
6683
5899
  description: string
6684
5900
  data: unknown
6685
5901
  }
5902
+ | {
5903
+ type: 'select'
5904
+ selection: EditorSelection
5905
+ }
6686
5906
  | {
6687
5907
  type: 'selection'
6688
5908
  selection: EditorSelection
@@ -6721,26 +5941,9 @@ export declare const editorMachine: StateMachine<
6721
5941
  name: string
6722
5942
  }
6723
5943
  }
6724
- | {
6725
- type: 'annotation.toggle'
6726
- annotation: {
6727
- name: string
6728
- value: {
6729
- [prop: string]: unknown
6730
- }
6731
- }
6732
- }
6733
5944
  | {
6734
5945
  type: 'blur'
6735
5946
  }
6736
- | {
6737
- type: 'decorator.add'
6738
- decorator: string
6739
- }
6740
- | {
6741
- type: 'decorator.remove'
6742
- decorator: string
6743
- }
6744
5947
  | {
6745
5948
  type: 'decorator.toggle'
6746
5949
  decorator: string
@@ -6800,6 +6003,10 @@ export declare const editorMachine: StateMachine<
6800
6003
  description: string
6801
6004
  data: unknown
6802
6005
  }
6006
+ | {
6007
+ type: 'select'
6008
+ selection: EditorSelection
6009
+ }
6803
6010
  | {
6804
6011
  type: 'selection'
6805
6012
  selection: EditorSelection
@@ -6826,7 +6033,7 @@ export declare const editorMachine: StateMachine<
6826
6033
  }
6827
6034
  >
6828
6035
  }
6829
- readonly 'list item.*': {
6036
+ readonly 'select': {
6830
6037
  readonly actions: ActionFunction<
6831
6038
  {
6832
6039
  behaviors: Array<Behavior>
@@ -6839,8 +6046,8 @@ export declare const editorMachine: StateMachine<
6839
6046
  value: Array<PortableTextBlock> | undefined
6840
6047
  },
6841
6048
  {
6842
- type: 'list item.toggle'
6843
- listItem: string
6049
+ type: 'select'
6050
+ selection: EditorSelection
6844
6051
  },
6845
6052
  | {
6846
6053
  type: 'annotation.add'
@@ -6857,26 +6064,9 @@ export declare const editorMachine: StateMachine<
6857
6064
  name: string
6858
6065
  }
6859
6066
  }
6860
- | {
6861
- type: 'annotation.toggle'
6862
- annotation: {
6863
- name: string
6864
- value: {
6865
- [prop: string]: unknown
6866
- }
6867
- }
6868
- }
6869
6067
  | {
6870
6068
  type: 'blur'
6871
6069
  }
6872
- | {
6873
- type: 'decorator.add'
6874
- decorator: string
6875
- }
6876
- | {
6877
- type: 'decorator.remove'
6878
- decorator: string
6879
- }
6880
6070
  | {
6881
6071
  type: 'decorator.toggle'
6882
6072
  decorator: string
@@ -6972,6 +6162,10 @@ export declare const editorMachine: StateMachine<
6972
6162
  description: string
6973
6163
  data: unknown
6974
6164
  }
6165
+ | {
6166
+ type: 'select'
6167
+ selection: EditorSelection
6168
+ }
6975
6169
  | {
6976
6170
  type: 'selection'
6977
6171
  selection: EditorSelection
@@ -7010,26 +6204,9 @@ export declare const editorMachine: StateMachine<
7010
6204
  name: string
7011
6205
  }
7012
6206
  }
7013
- | {
7014
- type: 'annotation.toggle'
7015
- annotation: {
7016
- name: string
7017
- value: {
7018
- [prop: string]: unknown
7019
- }
7020
- }
7021
- }
7022
6207
  | {
7023
6208
  type: 'blur'
7024
6209
  }
7025
- | {
7026
- type: 'decorator.add'
7027
- decorator: string
7028
- }
7029
- | {
7030
- type: 'decorator.remove'
7031
- decorator: string
7032
- }
7033
6210
  | {
7034
6211
  type: 'decorator.toggle'
7035
6212
  decorator: string
@@ -7089,6 +6266,10 @@ export declare const editorMachine: StateMachine<
7089
6266
  description: string
7090
6267
  data: unknown
7091
6268
  }
6269
+ | {
6270
+ type: 'select'
6271
+ selection: EditorSelection
6272
+ }
7092
6273
  | {
7093
6274
  type: 'selection'
7094
6275
  selection: EditorSelection
@@ -7146,26 +6327,9 @@ export declare const editorMachine: StateMachine<
7146
6327
  name: string
7147
6328
  }
7148
6329
  }
7149
- | {
7150
- type: 'annotation.toggle'
7151
- annotation: {
7152
- name: string
7153
- value: {
7154
- [prop: string]: unknown
7155
- }
7156
- }
7157
- }
7158
6330
  | {
7159
6331
  type: 'blur'
7160
6332
  }
7161
- | {
7162
- type: 'decorator.add'
7163
- decorator: string
7164
- }
7165
- | {
7166
- type: 'decorator.remove'
7167
- decorator: string
7168
- }
7169
6333
  | {
7170
6334
  type: 'decorator.toggle'
7171
6335
  decorator: string
@@ -7261,6 +6425,10 @@ export declare const editorMachine: StateMachine<
7261
6425
  description: string
7262
6426
  data: unknown
7263
6427
  }
6428
+ | {
6429
+ type: 'select'
6430
+ selection: EditorSelection
6431
+ }
7264
6432
  | {
7265
6433
  type: 'selection'
7266
6434
  selection: EditorSelection
@@ -7299,26 +6467,9 @@ export declare const editorMachine: StateMachine<
7299
6467
  name: string
7300
6468
  }
7301
6469
  }
7302
- | {
7303
- type: 'annotation.toggle'
7304
- annotation: {
7305
- name: string
7306
- value: {
7307
- [prop: string]: unknown
7308
- }
7309
- }
7310
- }
7311
6470
  | {
7312
6471
  type: 'blur'
7313
6472
  }
7314
- | {
7315
- type: 'decorator.add'
7316
- decorator: string
7317
- }
7318
- | {
7319
- type: 'decorator.remove'
7320
- decorator: string
7321
- }
7322
6473
  | {
7323
6474
  type: 'decorator.toggle'
7324
6475
  decorator: string
@@ -7378,6 +6529,10 @@ export declare const editorMachine: StateMachine<
7378
6529
  description: string
7379
6530
  data: unknown
7380
6531
  }
6532
+ | {
6533
+ type: 'select'
6534
+ selection: EditorSelection
6535
+ }
7381
6536
  | {
7382
6537
  type: 'selection'
7383
6538
  selection: EditorSelection
@@ -7603,6 +6758,10 @@ export declare type InternalEditorEmittedEvent =
7603
6758
  description: string
7604
6759
  data: unknown
7605
6760
  }
6761
+ | {
6762
+ type: 'select'
6763
+ selection: EditorSelection
6764
+ }
7606
6765
  | {
7607
6766
  type: 'selection'
7608
6767
  selection: EditorSelection
@@ -7632,10 +6791,7 @@ export declare type InternalEditorEmittedEvent =
7632
6791
  'type',
7633
6792
  | 'annotation.add'
7634
6793
  | 'annotation.remove'
7635
- | 'annotation.toggle'
7636
6794
  | 'blur'
7637
- | 'decorator.add'
7638
- | 'decorator.remove'
7639
6795
  | 'decorator.toggle'
7640
6796
  | 'insert.block object'
7641
6797
  | 'insert.inline object'
@@ -8321,26 +7477,9 @@ export declare type SyntheticBehaviorEvent =
8321
7477
  name: string
8322
7478
  }
8323
7479
  }
8324
- | {
8325
- type: 'annotation.toggle'
8326
- annotation: {
8327
- name: string
8328
- value: {
8329
- [prop: string]: unknown
8330
- }
8331
- }
8332
- }
8333
7480
  | {
8334
7481
  type: 'blur'
8335
7482
  }
8336
- | {
8337
- type: 'decorator.add'
8338
- decorator: string
8339
- }
8340
- | {
8341
- type: 'decorator.remove'
8342
- decorator: string
8343
- }
8344
7483
  | {
8345
7484
  type: 'decorator.toggle'
8346
7485
  decorator: string
@@ -8390,6 +7529,10 @@ export declare type SyntheticBehaviorEvent =
8390
7529
  type: 'list item.toggle'
8391
7530
  listItem: string
8392
7531
  }
7532
+ | {
7533
+ type: 'select'
7534
+ selection: EditorSelection
7535
+ }
8393
7536
  | {
8394
7537
  type: 'style.toggle'
8395
7538
  style: string