@portabletext/editor 1.18.7 → 1.20.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 (43) 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-cjs/selector.is-selection-collapsed.cjs.map +1 -1
  4. package/lib/_chunks-es/behavior.core.js +52 -35
  5. package/lib/_chunks-es/behavior.core.js.map +1 -1
  6. package/lib/_chunks-es/selector.is-selection-collapsed.js.map +1 -1
  7. package/lib/behaviors/index.cjs +1 -0
  8. package/lib/behaviors/index.cjs.map +1 -1
  9. package/lib/behaviors/index.d.cts +78 -86
  10. package/lib/behaviors/index.d.ts +78 -86
  11. package/lib/behaviors/index.js +3 -2
  12. package/lib/behaviors/index.js.map +1 -1
  13. package/lib/index.cjs +277 -422
  14. package/lib/index.cjs.map +1 -1
  15. package/lib/index.d.cts +488 -1127
  16. package/lib/index.d.ts +488 -1127
  17. package/lib/index.js +279 -425
  18. package/lib/index.js.map +1 -1
  19. package/lib/selectors/index.cjs +12 -9
  20. package/lib/selectors/index.cjs.map +1 -1
  21. package/lib/selectors/index.js +12 -9
  22. package/lib/selectors/index.js.map +1 -1
  23. package/package.json +5 -7
  24. package/src/behavior-actions/behavior.actions.ts +28 -36
  25. package/src/behaviors/behavior.core.decorators.ts +36 -42
  26. package/src/behaviors/behavior.core.ts +4 -3
  27. package/src/behaviors/behavior.types.ts +40 -26
  28. package/src/behaviors/index.ts +1 -0
  29. package/src/editor/PortableTextEditor.tsx +14 -16
  30. package/src/editor/__tests__/self-solving.test.tsx +4 -11
  31. package/src/editor/components/Element.tsx +17 -23
  32. package/src/editor/create-editor.ts +18 -3
  33. package/src/editor/editor-machine.ts +67 -45
  34. package/src/editor/nodes/DefaultObject.tsx +2 -2
  35. package/src/editor/plugins/create-with-event-listeners.ts +44 -57
  36. package/src/editor/plugins/createWithHotKeys.ts +1 -11
  37. package/src/editor/plugins/createWithPortableTextMarkModel.ts +12 -1
  38. package/src/editor/plugins/createWithPortableTextSelections.ts +1 -5
  39. package/src/editor/with-applying-behavior-actions.ts +15 -0
  40. package/src/selectors/selector.get-selected-spans.test.ts +122 -0
  41. package/src/selectors/selector.get-selected-spans.ts +3 -1
  42. package/src/selectors/selector.is-active-decorator.test.ts +65 -0
  43. package/src/editor/nodes/index.ts +0 -189
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
  }
@@ -455,6 +469,10 @@ export declare interface EditableAPIDeleteOptions {
455
469
  */
456
470
  export declare type Editor = {
457
471
  getSnapshot: () => EditorSnapshot
472
+ /**
473
+ * @beta
474
+ */
475
+ registerBehavior: (config: {behavior: Behavior}) => () => void
458
476
  send: (event: EditorEvent) => void
459
477
  on: ActorRef<Snapshot<unknown>, EventObject, EditorEmittedEvent>['on']
460
478
  _internal: {
@@ -559,15 +577,13 @@ export declare type EditorEvent = PickFromUnion<
559
577
  'type',
560
578
  | 'annotation.add'
561
579
  | 'annotation.remove'
562
- | 'annotation.toggle'
563
580
  | 'blur'
564
- | 'decorator.add'
565
- | 'decorator.remove'
566
581
  | 'decorator.toggle'
567
582
  | 'focus'
568
583
  | 'insert.block object'
569
584
  | 'insert.inline object'
570
585
  | 'list item.toggle'
586
+ | 'select'
571
587
  | 'style.toggle'
572
588
  | 'patches'
573
589
  | 'update behaviors'
@@ -587,7 +603,7 @@ export declare function EditorEventListener(props: {
587
603
  */
588
604
  export declare const editorMachine: StateMachine<
589
605
  {
590
- behaviors: Array<Behavior>
606
+ behaviors: Set<Behavior>
591
607
  keyGenerator: () => string
592
608
  pendingEvents: Array<PatchEvent | MutationEvent_2>
593
609
  schema: EditorSchema
@@ -611,26 +627,9 @@ export declare const editorMachine: StateMachine<
611
627
  name: string
612
628
  }
613
629
  }
614
- | {
615
- type: 'annotation.toggle'
616
- annotation: {
617
- name: string
618
- value: {
619
- [prop: string]: unknown
620
- }
621
- }
622
- }
623
630
  | {
624
631
  type: 'blur'
625
632
  }
626
- | {
627
- type: 'decorator.add'
628
- decorator: string
629
- }
630
- | {
631
- type: 'decorator.remove'
632
- decorator: string
633
- }
634
633
  | {
635
634
  type: 'decorator.toggle'
636
635
  decorator: string
@@ -684,6 +683,14 @@ export declare const editorMachine: StateMachine<
684
683
  preventDefault: () => void
685
684
  }
686
685
  }
686
+ | {
687
+ type: 'add behavior'
688
+ behavior: Behavior
689
+ }
690
+ | {
691
+ type: 'remove behavior'
692
+ behavior: Behavior
693
+ }
687
694
  | {
688
695
  type: 'update readOnly'
689
696
  readOnly: boolean
@@ -724,6 +731,10 @@ export declare const editorMachine: StateMachine<
724
731
  description: string
725
732
  data: unknown
726
733
  }
734
+ | {
735
+ type: 'select'
736
+ selection: EditorSelection
737
+ }
727
738
  | {
728
739
  type: 'selection'
729
740
  selection: EditorSelection
@@ -745,6 +756,14 @@ export declare const editorMachine: StateMachine<
745
756
  {},
746
757
  never,
747
758
  Values<{
759
+ 'add behavior to context': {
760
+ type: 'add behavior to context'
761
+ params: NonReducibleUnknown
762
+ }
763
+ 'remove behavior from context': {
764
+ type: 'remove behavior from context'
765
+ params: NonReducibleUnknown
766
+ }
748
767
  'assign behaviors': {
749
768
  type: 'assign behaviors'
750
769
  params: NonReducibleUnknown
@@ -830,26 +849,9 @@ export declare const editorMachine: StateMachine<
830
849
  name: string
831
850
  }
832
851
  }
833
- | {
834
- type: 'annotation.toggle'
835
- annotation: {
836
- name: string
837
- value: {
838
- [prop: string]: unknown
839
- }
840
- }
841
- }
842
852
  | {
843
853
  type: 'blur'
844
854
  }
845
- | {
846
- type: 'decorator.add'
847
- decorator: string
848
- }
849
- | {
850
- type: 'decorator.remove'
851
- decorator: string
852
- }
853
855
  | {
854
856
  type: 'decorator.toggle'
855
857
  decorator: string
@@ -909,6 +911,10 @@ export declare const editorMachine: StateMachine<
909
911
  description: string
910
912
  data: unknown
911
913
  }
914
+ | {
915
+ type: 'select'
916
+ selection: EditorSelection
917
+ }
912
918
  | {
913
919
  type: 'selection'
914
920
  selection: EditorSelection
@@ -972,7 +978,7 @@ export declare const editorMachine: StateMachine<
972
978
  self: ActorRef<
973
979
  MachineSnapshot<
974
980
  {
975
- behaviors: Array<Behavior>
981
+ behaviors: Set<Behavior>
976
982
  keyGenerator: () => string
977
983
  pendingEvents: Array<PatchEvent | MutationEvent_2>
978
984
  schema: EditorSchema
@@ -996,26 +1002,9 @@ export declare const editorMachine: StateMachine<
996
1002
  name: string
997
1003
  }
998
1004
  }
999
- | {
1000
- type: 'annotation.toggle'
1001
- annotation: {
1002
- name: string
1003
- value: {
1004
- [prop: string]: unknown
1005
- }
1006
- }
1007
- }
1008
1005
  | {
1009
1006
  type: 'blur'
1010
1007
  }
1011
- | {
1012
- type: 'decorator.add'
1013
- decorator: string
1014
- }
1015
- | {
1016
- type: 'decorator.remove'
1017
- decorator: string
1018
- }
1019
1008
  | {
1020
1009
  type: 'decorator.toggle'
1021
1010
  decorator: string
@@ -1069,6 +1058,14 @@ export declare const editorMachine: StateMachine<
1069
1058
  preventDefault: () => void
1070
1059
  }
1071
1060
  }
1061
+ | {
1062
+ type: 'add behavior'
1063
+ behavior: Behavior
1064
+ }
1065
+ | {
1066
+ type: 'remove behavior'
1067
+ behavior: Behavior
1068
+ }
1072
1069
  | {
1073
1070
  type: 'update readOnly'
1074
1071
  readOnly: boolean
@@ -1109,6 +1106,10 @@ export declare const editorMachine: StateMachine<
1109
1106
  description: string
1110
1107
  data: unknown
1111
1108
  }
1109
+ | {
1110
+ type: 'select'
1111
+ selection: EditorSelection
1112
+ }
1112
1113
  | {
1113
1114
  type: 'selection'
1114
1115
  selection: EditorSelection
@@ -1149,26 +1150,9 @@ export declare const editorMachine: StateMachine<
1149
1150
  name: string
1150
1151
  }
1151
1152
  }
1152
- | {
1153
- type: 'annotation.toggle'
1154
- annotation: {
1155
- name: string
1156
- value: {
1157
- [prop: string]: unknown
1158
- }
1159
- }
1160
- }
1161
1153
  | {
1162
1154
  type: 'blur'
1163
1155
  }
1164
- | {
1165
- type: 'decorator.add'
1166
- decorator: string
1167
- }
1168
- | {
1169
- type: 'decorator.remove'
1170
- decorator: string
1171
- }
1172
1156
  | {
1173
1157
  type: 'decorator.toggle'
1174
1158
  decorator: string
@@ -1222,6 +1206,14 @@ export declare const editorMachine: StateMachine<
1222
1206
  preventDefault: () => void
1223
1207
  }
1224
1208
  }
1209
+ | {
1210
+ type: 'add behavior'
1211
+ behavior: Behavior
1212
+ }
1213
+ | {
1214
+ type: 'remove behavior'
1215
+ behavior: Behavior
1216
+ }
1225
1217
  | {
1226
1218
  type: 'update readOnly'
1227
1219
  readOnly: boolean
@@ -1262,6 +1254,10 @@ export declare const editorMachine: StateMachine<
1262
1254
  description: string
1263
1255
  data: unknown
1264
1256
  }
1257
+ | {
1258
+ type: 'select'
1259
+ selection: EditorSelection
1260
+ }
1265
1261
  | {
1266
1262
  type: 'selection'
1267
1263
  selection: EditorSelection
@@ -1283,7 +1279,7 @@ export declare const editorMachine: StateMachine<
1283
1279
  AnyEventObject
1284
1280
  >
1285
1281
  }) => {
1286
- behaviors: Behavior[]
1282
+ behaviors: Set<Behavior>
1287
1283
  keyGenerator: () => string
1288
1284
  pendingEvents: never[]
1289
1285
  schema: PortableTextMemberSchemaTypes
@@ -1293,10 +1289,16 @@ export declare const editorMachine: StateMachine<
1293
1289
  value: PortableTextBlock[] | undefined
1294
1290
  }
1295
1291
  readonly on: {
1292
+ readonly 'add behavior': {
1293
+ readonly actions: 'add behavior to context'
1294
+ }
1295
+ readonly 'remove behavior': {
1296
+ readonly actions: 'remove behavior from context'
1297
+ }
1296
1298
  readonly 'unset': {
1297
1299
  readonly actions: ActionFunction<
1298
1300
  {
1299
- behaviors: Array<Behavior>
1301
+ behaviors: Set<Behavior>
1300
1302
  keyGenerator: () => string
1301
1303
  pendingEvents: Array<PatchEvent | MutationEvent_2>
1302
1304
  schema: EditorSchema
@@ -1324,26 +1326,9 @@ export declare const editorMachine: StateMachine<
1324
1326
  name: string
1325
1327
  }
1326
1328
  }
1327
- | {
1328
- type: 'annotation.toggle'
1329
- annotation: {
1330
- name: string
1331
- value: {
1332
- [prop: string]: unknown
1333
- }
1334
- }
1335
- }
1336
1329
  | {
1337
1330
  type: 'blur'
1338
1331
  }
1339
- | {
1340
- type: 'decorator.add'
1341
- decorator: string
1342
- }
1343
- | {
1344
- type: 'decorator.remove'
1345
- decorator: string
1346
- }
1347
1332
  | {
1348
1333
  type: 'decorator.toggle'
1349
1334
  decorator: string
@@ -1397,6 +1382,14 @@ export declare const editorMachine: StateMachine<
1397
1382
  preventDefault: () => void
1398
1383
  }
1399
1384
  }
1385
+ | {
1386
+ type: 'add behavior'
1387
+ behavior: Behavior
1388
+ }
1389
+ | {
1390
+ type: 'remove behavior'
1391
+ behavior: Behavior
1392
+ }
1400
1393
  | {
1401
1394
  type: 'update readOnly'
1402
1395
  readOnly: boolean
@@ -1437,6 +1430,10 @@ export declare const editorMachine: StateMachine<
1437
1430
  description: string
1438
1431
  data: unknown
1439
1432
  }
1433
+ | {
1434
+ type: 'select'
1435
+ selection: EditorSelection
1436
+ }
1440
1437
  | {
1441
1438
  type: 'selection'
1442
1439
  selection: EditorSelection
@@ -1475,26 +1472,9 @@ export declare const editorMachine: StateMachine<
1475
1472
  name: string
1476
1473
  }
1477
1474
  }
1478
- | {
1479
- type: 'annotation.toggle'
1480
- annotation: {
1481
- name: string
1482
- value: {
1483
- [prop: string]: unknown
1484
- }
1485
- }
1486
- }
1487
1475
  | {
1488
1476
  type: 'blur'
1489
1477
  }
1490
- | {
1491
- type: 'decorator.add'
1492
- decorator: string
1493
- }
1494
- | {
1495
- type: 'decorator.remove'
1496
- decorator: string
1497
- }
1498
1478
  | {
1499
1479
  type: 'decorator.toggle'
1500
1480
  decorator: string
@@ -1554,6 +1534,10 @@ export declare const editorMachine: StateMachine<
1554
1534
  description: string
1555
1535
  data: unknown
1556
1536
  }
1537
+ | {
1538
+ type: 'select'
1539
+ selection: EditorSelection
1540
+ }
1557
1541
  | {
1558
1542
  type: 'selection'
1559
1543
  selection: EditorSelection
@@ -1583,7 +1567,7 @@ export declare const editorMachine: StateMachine<
1583
1567
  readonly 'value changed': {
1584
1568
  readonly actions: ActionFunction<
1585
1569
  {
1586
- behaviors: Array<Behavior>
1570
+ behaviors: Set<Behavior>
1587
1571
  keyGenerator: () => string
1588
1572
  pendingEvents: Array<PatchEvent | MutationEvent_2>
1589
1573
  schema: EditorSchema
@@ -1611,26 +1595,9 @@ export declare const editorMachine: StateMachine<
1611
1595
  name: string
1612
1596
  }
1613
1597
  }
1614
- | {
1615
- type: 'annotation.toggle'
1616
- annotation: {
1617
- name: string
1618
- value: {
1619
- [prop: string]: unknown
1620
- }
1621
- }
1622
- }
1623
1598
  | {
1624
1599
  type: 'blur'
1625
1600
  }
1626
- | {
1627
- type: 'decorator.add'
1628
- decorator: string
1629
- }
1630
- | {
1631
- type: 'decorator.remove'
1632
- decorator: string
1633
- }
1634
1601
  | {
1635
1602
  type: 'decorator.toggle'
1636
1603
  decorator: string
@@ -1684,6 +1651,14 @@ export declare const editorMachine: StateMachine<
1684
1651
  preventDefault: () => void
1685
1652
  }
1686
1653
  }
1654
+ | {
1655
+ type: 'add behavior'
1656
+ behavior: Behavior
1657
+ }
1658
+ | {
1659
+ type: 'remove behavior'
1660
+ behavior: Behavior
1661
+ }
1687
1662
  | {
1688
1663
  type: 'update readOnly'
1689
1664
  readOnly: boolean
@@ -1724,6 +1699,10 @@ export declare const editorMachine: StateMachine<
1724
1699
  description: string
1725
1700
  data: unknown
1726
1701
  }
1702
+ | {
1703
+ type: 'select'
1704
+ selection: EditorSelection
1705
+ }
1727
1706
  | {
1728
1707
  type: 'selection'
1729
1708
  selection: EditorSelection
@@ -1762,26 +1741,9 @@ export declare const editorMachine: StateMachine<
1762
1741
  name: string
1763
1742
  }
1764
1743
  }
1765
- | {
1766
- type: 'annotation.toggle'
1767
- annotation: {
1768
- name: string
1769
- value: {
1770
- [prop: string]: unknown
1771
- }
1772
- }
1773
- }
1774
1744
  | {
1775
1745
  type: 'blur'
1776
1746
  }
1777
- | {
1778
- type: 'decorator.add'
1779
- decorator: string
1780
- }
1781
- | {
1782
- type: 'decorator.remove'
1783
- decorator: string
1784
- }
1785
1747
  | {
1786
1748
  type: 'decorator.toggle'
1787
1749
  decorator: string
@@ -1841,6 +1803,10 @@ export declare const editorMachine: StateMachine<
1841
1803
  description: string
1842
1804
  data: unknown
1843
1805
  }
1806
+ | {
1807
+ type: 'select'
1808
+ selection: EditorSelection
1809
+ }
1844
1810
  | {
1845
1811
  type: 'selection'
1846
1812
  selection: EditorSelection
@@ -1870,7 +1836,7 @@ export declare const editorMachine: StateMachine<
1870
1836
  readonly 'invalid value': {
1871
1837
  readonly actions: ActionFunction<
1872
1838
  {
1873
- behaviors: Array<Behavior>
1839
+ behaviors: Set<Behavior>
1874
1840
  keyGenerator: () => string
1875
1841
  pendingEvents: Array<PatchEvent | MutationEvent_2>
1876
1842
  schema: EditorSchema
@@ -1899,26 +1865,9 @@ export declare const editorMachine: StateMachine<
1899
1865
  name: string
1900
1866
  }
1901
1867
  }
1902
- | {
1903
- type: 'annotation.toggle'
1904
- annotation: {
1905
- name: string
1906
- value: {
1907
- [prop: string]: unknown
1908
- }
1909
- }
1910
- }
1911
1868
  | {
1912
1869
  type: 'blur'
1913
1870
  }
1914
- | {
1915
- type: 'decorator.add'
1916
- decorator: string
1917
- }
1918
- | {
1919
- type: 'decorator.remove'
1920
- decorator: string
1921
- }
1922
1871
  | {
1923
1872
  type: 'decorator.toggle'
1924
1873
  decorator: string
@@ -1972,6 +1921,14 @@ export declare const editorMachine: StateMachine<
1972
1921
  preventDefault: () => void
1973
1922
  }
1974
1923
  }
1924
+ | {
1925
+ type: 'add behavior'
1926
+ behavior: Behavior
1927
+ }
1928
+ | {
1929
+ type: 'remove behavior'
1930
+ behavior: Behavior
1931
+ }
1975
1932
  | {
1976
1933
  type: 'update readOnly'
1977
1934
  readOnly: boolean
@@ -2012,6 +1969,10 @@ export declare const editorMachine: StateMachine<
2012
1969
  description: string
2013
1970
  data: unknown
2014
1971
  }
1972
+ | {
1973
+ type: 'select'
1974
+ selection: EditorSelection
1975
+ }
2015
1976
  | {
2016
1977
  type: 'selection'
2017
1978
  selection: EditorSelection
@@ -2050,26 +2011,9 @@ export declare const editorMachine: StateMachine<
2050
2011
  name: string
2051
2012
  }
2052
2013
  }
2053
- | {
2054
- type: 'annotation.toggle'
2055
- annotation: {
2056
- name: string
2057
- value: {
2058
- [prop: string]: unknown
2059
- }
2060
- }
2061
- }
2062
2014
  | {
2063
2015
  type: 'blur'
2064
2016
  }
2065
- | {
2066
- type: 'decorator.add'
2067
- decorator: string
2068
- }
2069
- | {
2070
- type: 'decorator.remove'
2071
- decorator: string
2072
- }
2073
2017
  | {
2074
2018
  type: 'decorator.toggle'
2075
2019
  decorator: string
@@ -2129,6 +2073,10 @@ export declare const editorMachine: StateMachine<
2129
2073
  description: string
2130
2074
  data: unknown
2131
2075
  }
2076
+ | {
2077
+ type: 'select'
2078
+ selection: EditorSelection
2079
+ }
2132
2080
  | {
2133
2081
  type: 'selection'
2134
2082
  selection: EditorSelection
@@ -2158,7 +2106,7 @@ export declare const editorMachine: StateMachine<
2158
2106
  readonly 'error': {
2159
2107
  readonly actions: ActionFunction<
2160
2108
  {
2161
- behaviors: Array<Behavior>
2109
+ behaviors: Set<Behavior>
2162
2110
  keyGenerator: () => string
2163
2111
  pendingEvents: Array<PatchEvent | MutationEvent_2>
2164
2112
  schema: EditorSchema
@@ -2188,26 +2136,9 @@ export declare const editorMachine: StateMachine<
2188
2136
  name: string
2189
2137
  }
2190
2138
  }
2191
- | {
2192
- type: 'annotation.toggle'
2193
- annotation: {
2194
- name: string
2195
- value: {
2196
- [prop: string]: unknown
2197
- }
2198
- }
2199
- }
2200
2139
  | {
2201
2140
  type: 'blur'
2202
2141
  }
2203
- | {
2204
- type: 'decorator.add'
2205
- decorator: string
2206
- }
2207
- | {
2208
- type: 'decorator.remove'
2209
- decorator: string
2210
- }
2211
2142
  | {
2212
2143
  type: 'decorator.toggle'
2213
2144
  decorator: string
@@ -2262,7 +2193,15 @@ export declare const editorMachine: StateMachine<
2262
2193
  }
2263
2194
  }
2264
2195
  | {
2265
- type: 'update readOnly'
2196
+ type: 'add behavior'
2197
+ behavior: Behavior
2198
+ }
2199
+ | {
2200
+ type: 'remove behavior'
2201
+ behavior: Behavior
2202
+ }
2203
+ | {
2204
+ type: 'update readOnly'
2266
2205
  readOnly: boolean
2267
2206
  }
2268
2207
  | {
@@ -2301,6 +2240,10 @@ export declare const editorMachine: StateMachine<
2301
2240
  description: string
2302
2241
  data: unknown
2303
2242
  }
2243
+ | {
2244
+ type: 'select'
2245
+ selection: EditorSelection
2246
+ }
2304
2247
  | {
2305
2248
  type: 'selection'
2306
2249
  selection: EditorSelection
@@ -2339,26 +2282,9 @@ export declare const editorMachine: StateMachine<
2339
2282
  name: string
2340
2283
  }
2341
2284
  }
2342
- | {
2343
- type: 'annotation.toggle'
2344
- annotation: {
2345
- name: string
2346
- value: {
2347
- [prop: string]: unknown
2348
- }
2349
- }
2350
- }
2351
2285
  | {
2352
2286
  type: 'blur'
2353
2287
  }
2354
- | {
2355
- type: 'decorator.add'
2356
- decorator: string
2357
- }
2358
- | {
2359
- type: 'decorator.remove'
2360
- decorator: string
2361
- }
2362
2288
  | {
2363
2289
  type: 'decorator.toggle'
2364
2290
  decorator: string
@@ -2418,6 +2344,10 @@ export declare const editorMachine: StateMachine<
2418
2344
  description: string
2419
2345
  data: unknown
2420
2346
  }
2347
+ | {
2348
+ type: 'select'
2349
+ selection: EditorSelection
2350
+ }
2421
2351
  | {
2422
2352
  type: 'selection'
2423
2353
  selection: EditorSelection
@@ -2448,7 +2378,7 @@ export declare const editorMachine: StateMachine<
2448
2378
  readonly actions: readonly [
2449
2379
  ActionFunction<
2450
2380
  {
2451
- behaviors: Array<Behavior>
2381
+ behaviors: Set<Behavior>
2452
2382
  keyGenerator: () => string
2453
2383
  pendingEvents: Array<PatchEvent | MutationEvent_2>
2454
2384
  schema: EditorSchema
@@ -2476,26 +2406,9 @@ export declare const editorMachine: StateMachine<
2476
2406
  name: string
2477
2407
  }
2478
2408
  }
2479
- | {
2480
- type: 'annotation.toggle'
2481
- annotation: {
2482
- name: string
2483
- value: {
2484
- [prop: string]: unknown
2485
- }
2486
- }
2487
- }
2488
2409
  | {
2489
2410
  type: 'blur'
2490
2411
  }
2491
- | {
2492
- type: 'decorator.add'
2493
- decorator: string
2494
- }
2495
- | {
2496
- type: 'decorator.remove'
2497
- decorator: string
2498
- }
2499
2412
  | {
2500
2413
  type: 'decorator.toggle'
2501
2414
  decorator: string
@@ -2549,6 +2462,14 @@ export declare const editorMachine: StateMachine<
2549
2462
  preventDefault: () => void
2550
2463
  }
2551
2464
  }
2465
+ | {
2466
+ type: 'add behavior'
2467
+ behavior: Behavior
2468
+ }
2469
+ | {
2470
+ type: 'remove behavior'
2471
+ behavior: Behavior
2472
+ }
2552
2473
  | {
2553
2474
  type: 'update readOnly'
2554
2475
  readOnly: boolean
@@ -2589,6 +2510,10 @@ export declare const editorMachine: StateMachine<
2589
2510
  description: string
2590
2511
  data: unknown
2591
2512
  }
2513
+ | {
2514
+ type: 'select'
2515
+ selection: EditorSelection
2516
+ }
2592
2517
  | {
2593
2518
  type: 'selection'
2594
2519
  selection: EditorSelection
@@ -2616,7 +2541,7 @@ export declare const editorMachine: StateMachine<
2616
2541
  >,
2617
2542
  ActionFunction<
2618
2543
  {
2619
- behaviors: Array<Behavior>
2544
+ behaviors: Set<Behavior>
2620
2545
  keyGenerator: () => string
2621
2546
  pendingEvents: Array<PatchEvent | MutationEvent_2>
2622
2547
  schema: EditorSchema
@@ -2644,26 +2569,9 @@ export declare const editorMachine: StateMachine<
2644
2569
  name: string
2645
2570
  }
2646
2571
  }
2647
- | {
2648
- type: 'annotation.toggle'
2649
- annotation: {
2650
- name: string
2651
- value: {
2652
- [prop: string]: unknown
2653
- }
2654
- }
2655
- }
2656
2572
  | {
2657
2573
  type: 'blur'
2658
2574
  }
2659
- | {
2660
- type: 'decorator.add'
2661
- decorator: string
2662
- }
2663
- | {
2664
- type: 'decorator.remove'
2665
- decorator: string
2666
- }
2667
2575
  | {
2668
2576
  type: 'decorator.toggle'
2669
2577
  decorator: string
@@ -2717,6 +2625,14 @@ export declare const editorMachine: StateMachine<
2717
2625
  preventDefault: () => void
2718
2626
  }
2719
2627
  }
2628
+ | {
2629
+ type: 'add behavior'
2630
+ behavior: Behavior
2631
+ }
2632
+ | {
2633
+ type: 'remove behavior'
2634
+ behavior: Behavior
2635
+ }
2720
2636
  | {
2721
2637
  type: 'update readOnly'
2722
2638
  readOnly: boolean
@@ -2757,6 +2673,10 @@ export declare const editorMachine: StateMachine<
2757
2673
  description: string
2758
2674
  data: unknown
2759
2675
  }
2676
+ | {
2677
+ type: 'select'
2678
+ selection: EditorSelection
2679
+ }
2760
2680
  | {
2761
2681
  type: 'selection'
2762
2682
  selection: EditorSelection
@@ -2795,26 +2715,9 @@ export declare const editorMachine: StateMachine<
2795
2715
  name: string
2796
2716
  }
2797
2717
  }
2798
- | {
2799
- type: 'annotation.toggle'
2800
- annotation: {
2801
- name: string
2802
- value: {
2803
- [prop: string]: unknown
2804
- }
2805
- }
2806
- }
2807
2718
  | {
2808
2719
  type: 'blur'
2809
2720
  }
2810
- | {
2811
- type: 'decorator.add'
2812
- decorator: string
2813
- }
2814
- | {
2815
- type: 'decorator.remove'
2816
- decorator: string
2817
- }
2818
2721
  | {
2819
2722
  type: 'decorator.toggle'
2820
2723
  decorator: string
@@ -2874,6 +2777,10 @@ export declare const editorMachine: StateMachine<
2874
2777
  description: string
2875
2778
  data: unknown
2876
2779
  }
2780
+ | {
2781
+ type: 'select'
2782
+ selection: EditorSelection
2783
+ }
2877
2784
  | {
2878
2785
  type: 'selection'
2879
2786
  selection: EditorSelection
@@ -2904,7 +2811,7 @@ export declare const editorMachine: StateMachine<
2904
2811
  readonly 'blurred': {
2905
2812
  readonly actions: ActionFunction<
2906
2813
  {
2907
- behaviors: Array<Behavior>
2814
+ behaviors: Set<Behavior>
2908
2815
  keyGenerator: () => string
2909
2816
  pendingEvents: Array<PatchEvent | MutationEvent_2>
2910
2817
  schema: EditorSchema
@@ -2932,26 +2839,9 @@ export declare const editorMachine: StateMachine<
2932
2839
  name: string
2933
2840
  }
2934
2841
  }
2935
- | {
2936
- type: 'annotation.toggle'
2937
- annotation: {
2938
- name: string
2939
- value: {
2940
- [prop: string]: unknown
2941
- }
2942
- }
2943
- }
2944
2842
  | {
2945
2843
  type: 'blur'
2946
2844
  }
2947
- | {
2948
- type: 'decorator.add'
2949
- decorator: string
2950
- }
2951
- | {
2952
- type: 'decorator.remove'
2953
- decorator: string
2954
- }
2955
2845
  | {
2956
2846
  type: 'decorator.toggle'
2957
2847
  decorator: string
@@ -3005,6 +2895,14 @@ export declare const editorMachine: StateMachine<
3005
2895
  preventDefault: () => void
3006
2896
  }
3007
2897
  }
2898
+ | {
2899
+ type: 'add behavior'
2900
+ behavior: Behavior
2901
+ }
2902
+ | {
2903
+ type: 'remove behavior'
2904
+ behavior: Behavior
2905
+ }
3008
2906
  | {
3009
2907
  type: 'update readOnly'
3010
2908
  readOnly: boolean
@@ -3045,6 +2943,10 @@ export declare const editorMachine: StateMachine<
3045
2943
  description: string
3046
2944
  data: unknown
3047
2945
  }
2946
+ | {
2947
+ type: 'select'
2948
+ selection: EditorSelection
2949
+ }
3048
2950
  | {
3049
2951
  type: 'selection'
3050
2952
  selection: EditorSelection
@@ -3083,26 +2985,9 @@ export declare const editorMachine: StateMachine<
3083
2985
  name: string
3084
2986
  }
3085
2987
  }
3086
- | {
3087
- type: 'annotation.toggle'
3088
- annotation: {
3089
- name: string
3090
- value: {
3091
- [prop: string]: unknown
3092
- }
3093
- }
3094
- }
3095
2988
  | {
3096
2989
  type: 'blur'
3097
2990
  }
3098
- | {
3099
- type: 'decorator.add'
3100
- decorator: string
3101
- }
3102
- | {
3103
- type: 'decorator.remove'
3104
- decorator: string
3105
- }
3106
2991
  | {
3107
2992
  type: 'decorator.toggle'
3108
2993
  decorator: string
@@ -3162,6 +3047,10 @@ export declare const editorMachine: StateMachine<
3162
3047
  description: string
3163
3048
  data: unknown
3164
3049
  }
3050
+ | {
3051
+ type: 'select'
3052
+ selection: EditorSelection
3053
+ }
3165
3054
  | {
3166
3055
  type: 'selection'
3167
3056
  selection: EditorSelection
@@ -3191,7 +3080,7 @@ export declare const editorMachine: StateMachine<
3191
3080
  readonly 'focused': {
3192
3081
  readonly actions: ActionFunction<
3193
3082
  {
3194
- behaviors: Array<Behavior>
3083
+ behaviors: Set<Behavior>
3195
3084
  keyGenerator: () => string
3196
3085
  pendingEvents: Array<PatchEvent | MutationEvent_2>
3197
3086
  schema: EditorSchema
@@ -3219,26 +3108,9 @@ export declare const editorMachine: StateMachine<
3219
3108
  name: string
3220
3109
  }
3221
3110
  }
3222
- | {
3223
- type: 'annotation.toggle'
3224
- annotation: {
3225
- name: string
3226
- value: {
3227
- [prop: string]: unknown
3228
- }
3229
- }
3230
- }
3231
3111
  | {
3232
3112
  type: 'blur'
3233
3113
  }
3234
- | {
3235
- type: 'decorator.add'
3236
- decorator: string
3237
- }
3238
- | {
3239
- type: 'decorator.remove'
3240
- decorator: string
3241
- }
3242
3114
  | {
3243
3115
  type: 'decorator.toggle'
3244
3116
  decorator: string
@@ -3292,6 +3164,14 @@ export declare const editorMachine: StateMachine<
3292
3164
  preventDefault: () => void
3293
3165
  }
3294
3166
  }
3167
+ | {
3168
+ type: 'add behavior'
3169
+ behavior: Behavior
3170
+ }
3171
+ | {
3172
+ type: 'remove behavior'
3173
+ behavior: Behavior
3174
+ }
3295
3175
  | {
3296
3176
  type: 'update readOnly'
3297
3177
  readOnly: boolean
@@ -3332,6 +3212,10 @@ export declare const editorMachine: StateMachine<
3332
3212
  description: string
3333
3213
  data: unknown
3334
3214
  }
3215
+ | {
3216
+ type: 'select'
3217
+ selection: EditorSelection
3218
+ }
3335
3219
  | {
3336
3220
  type: 'selection'
3337
3221
  selection: EditorSelection
@@ -3370,26 +3254,9 @@ export declare const editorMachine: StateMachine<
3370
3254
  name: string
3371
3255
  }
3372
3256
  }
3373
- | {
3374
- type: 'annotation.toggle'
3375
- annotation: {
3376
- name: string
3377
- value: {
3378
- [prop: string]: unknown
3379
- }
3380
- }
3381
- }
3382
3257
  | {
3383
3258
  type: 'blur'
3384
3259
  }
3385
- | {
3386
- type: 'decorator.add'
3387
- decorator: string
3388
- }
3389
- | {
3390
- type: 'decorator.remove'
3391
- decorator: string
3392
- }
3393
3260
  | {
3394
3261
  type: 'decorator.toggle'
3395
3262
  decorator: string
@@ -3449,6 +3316,10 @@ export declare const editorMachine: StateMachine<
3449
3316
  description: string
3450
3317
  data: unknown
3451
3318
  }
3319
+ | {
3320
+ type: 'select'
3321
+ selection: EditorSelection
3322
+ }
3452
3323
  | {
3453
3324
  type: 'selection'
3454
3325
  selection: EditorSelection
@@ -3478,7 +3349,7 @@ export declare const editorMachine: StateMachine<
3478
3349
  readonly 'loading': {
3479
3350
  readonly actions: ActionFunction<
3480
3351
  {
3481
- behaviors: Array<Behavior>
3352
+ behaviors: Set<Behavior>
3482
3353
  keyGenerator: () => string
3483
3354
  pendingEvents: Array<PatchEvent | MutationEvent_2>
3484
3355
  schema: EditorSchema
@@ -3505,26 +3376,9 @@ export declare const editorMachine: StateMachine<
3505
3376
  name: string
3506
3377
  }
3507
3378
  }
3508
- | {
3509
- type: 'annotation.toggle'
3510
- annotation: {
3511
- name: string
3512
- value: {
3513
- [prop: string]: unknown
3514
- }
3515
- }
3516
- }
3517
3379
  | {
3518
3380
  type: 'blur'
3519
3381
  }
3520
- | {
3521
- type: 'decorator.add'
3522
- decorator: string
3523
- }
3524
- | {
3525
- type: 'decorator.remove'
3526
- decorator: string
3527
- }
3528
3382
  | {
3529
3383
  type: 'decorator.toggle'
3530
3384
  decorator: string
@@ -3578,6 +3432,14 @@ export declare const editorMachine: StateMachine<
3578
3432
  preventDefault: () => void
3579
3433
  }
3580
3434
  }
3435
+ | {
3436
+ type: 'add behavior'
3437
+ behavior: Behavior
3438
+ }
3439
+ | {
3440
+ type: 'remove behavior'
3441
+ behavior: Behavior
3442
+ }
3581
3443
  | {
3582
3444
  type: 'update readOnly'
3583
3445
  readOnly: boolean
@@ -3618,6 +3480,10 @@ export declare const editorMachine: StateMachine<
3618
3480
  description: string
3619
3481
  data: unknown
3620
3482
  }
3483
+ | {
3484
+ type: 'select'
3485
+ selection: EditorSelection
3486
+ }
3621
3487
  | {
3622
3488
  type: 'selection'
3623
3489
  selection: EditorSelection
@@ -3656,26 +3522,9 @@ export declare const editorMachine: StateMachine<
3656
3522
  name: string
3657
3523
  }
3658
3524
  }
3659
- | {
3660
- type: 'annotation.toggle'
3661
- annotation: {
3662
- name: string
3663
- value: {
3664
- [prop: string]: unknown
3665
- }
3666
- }
3667
- }
3668
3525
  | {
3669
3526
  type: 'blur'
3670
3527
  }
3671
- | {
3672
- type: 'decorator.add'
3673
- decorator: string
3674
- }
3675
- | {
3676
- type: 'decorator.remove'
3677
- decorator: string
3678
- }
3679
3528
  | {
3680
3529
  type: 'decorator.toggle'
3681
3530
  decorator: string
@@ -3735,6 +3584,10 @@ export declare const editorMachine: StateMachine<
3735
3584
  description: string
3736
3585
  data: unknown
3737
3586
  }
3587
+ | {
3588
+ type: 'select'
3589
+ selection: EditorSelection
3590
+ }
3738
3591
  | {
3739
3592
  type: 'selection'
3740
3593
  selection: EditorSelection
@@ -3764,7 +3617,7 @@ export declare const editorMachine: StateMachine<
3764
3617
  readonly 'patches': {
3765
3618
  readonly actions: ActionFunction<
3766
3619
  {
3767
- behaviors: Array<Behavior>
3620
+ behaviors: Set<Behavior>
3768
3621
  keyGenerator: () => string
3769
3622
  pendingEvents: Array<PatchEvent | MutationEvent_2>
3770
3623
  schema: EditorSchema
@@ -3789,26 +3642,9 @@ export declare const editorMachine: StateMachine<
3789
3642
  name: string
3790
3643
  }
3791
3644
  }
3792
- | {
3793
- type: 'annotation.toggle'
3794
- annotation: {
3795
- name: string
3796
- value: {
3797
- [prop: string]: unknown
3798
- }
3799
- }
3800
- }
3801
3645
  | {
3802
3646
  type: 'blur'
3803
3647
  }
3804
- | {
3805
- type: 'decorator.add'
3806
- decorator: string
3807
- }
3808
- | {
3809
- type: 'decorator.remove'
3810
- decorator: string
3811
- }
3812
3648
  | {
3813
3649
  type: 'decorator.toggle'
3814
3650
  decorator: string
@@ -3862,6 +3698,14 @@ export declare const editorMachine: StateMachine<
3862
3698
  preventDefault: () => void
3863
3699
  }
3864
3700
  }
3701
+ | {
3702
+ type: 'add behavior'
3703
+ behavior: Behavior
3704
+ }
3705
+ | {
3706
+ type: 'remove behavior'
3707
+ behavior: Behavior
3708
+ }
3865
3709
  | {
3866
3710
  type: 'update readOnly'
3867
3711
  readOnly: boolean
@@ -3902,6 +3746,10 @@ export declare const editorMachine: StateMachine<
3902
3746
  description: string
3903
3747
  data: unknown
3904
3748
  }
3749
+ | {
3750
+ type: 'select'
3751
+ selection: EditorSelection
3752
+ }
3905
3753
  | {
3906
3754
  type: 'selection'
3907
3755
  selection: EditorSelection
@@ -3940,26 +3788,9 @@ export declare const editorMachine: StateMachine<
3940
3788
  name: string
3941
3789
  }
3942
3790
  }
3943
- | {
3944
- type: 'annotation.toggle'
3945
- annotation: {
3946
- name: string
3947
- value: {
3948
- [prop: string]: unknown
3949
- }
3950
- }
3951
- }
3952
3791
  | {
3953
3792
  type: 'blur'
3954
3793
  }
3955
- | {
3956
- type: 'decorator.add'
3957
- decorator: string
3958
- }
3959
- | {
3960
- type: 'decorator.remove'
3961
- decorator: string
3962
- }
3963
3794
  | {
3964
3795
  type: 'decorator.toggle'
3965
3796
  decorator: string
@@ -4019,6 +3850,10 @@ export declare const editorMachine: StateMachine<
4019
3850
  description: string
4020
3851
  data: unknown
4021
3852
  }
3853
+ | {
3854
+ type: 'select'
3855
+ selection: EditorSelection
3856
+ }
4022
3857
  | {
4023
3858
  type: 'selection'
4024
3859
  selection: EditorSelection
@@ -4048,7 +3883,7 @@ export declare const editorMachine: StateMachine<
4048
3883
  readonly 'done loading': {
4049
3884
  readonly actions: ActionFunction<
4050
3885
  {
4051
- behaviors: Array<Behavior>
3886
+ behaviors: Set<Behavior>
4052
3887
  keyGenerator: () => string
4053
3888
  pendingEvents: Array<PatchEvent | MutationEvent_2>
4054
3889
  schema: EditorSchema
@@ -4075,32 +3910,15 @@ export declare const editorMachine: StateMachine<
4075
3910
  name: string
4076
3911
  }
4077
3912
  }
4078
- | {
4079
- type: 'annotation.toggle'
4080
- annotation: {
4081
- name: string
4082
- value: {
4083
- [prop: string]: unknown
4084
- }
4085
- }
4086
- }
4087
3913
  | {
4088
3914
  type: 'blur'
4089
3915
  }
4090
3916
  | {
4091
- type: 'decorator.add'
3917
+ type: 'decorator.toggle'
4092
3918
  decorator: string
4093
3919
  }
4094
3920
  | {
4095
- type: 'decorator.remove'
4096
- decorator: string
4097
- }
4098
- | {
4099
- type: 'decorator.toggle'
4100
- decorator: string
4101
- }
4102
- | {
4103
- type: 'focus'
3921
+ type: 'focus'
4104
3922
  }
4105
3923
  | {
4106
3924
  type: 'insert.block object'
@@ -4148,6 +3966,14 @@ export declare const editorMachine: StateMachine<
4148
3966
  preventDefault: () => void
4149
3967
  }
4150
3968
  }
3969
+ | {
3970
+ type: 'add behavior'
3971
+ behavior: Behavior
3972
+ }
3973
+ | {
3974
+ type: 'remove behavior'
3975
+ behavior: Behavior
3976
+ }
4151
3977
  | {
4152
3978
  type: 'update readOnly'
4153
3979
  readOnly: boolean
@@ -4188,6 +4014,10 @@ export declare const editorMachine: StateMachine<
4188
4014
  description: string
4189
4015
  data: unknown
4190
4016
  }
4017
+ | {
4018
+ type: 'select'
4019
+ selection: EditorSelection
4020
+ }
4191
4021
  | {
4192
4022
  type: 'selection'
4193
4023
  selection: EditorSelection
@@ -4226,26 +4056,9 @@ export declare const editorMachine: StateMachine<
4226
4056
  name: string
4227
4057
  }
4228
4058
  }
4229
- | {
4230
- type: 'annotation.toggle'
4231
- annotation: {
4232
- name: string
4233
- value: {
4234
- [prop: string]: unknown
4235
- }
4236
- }
4237
- }
4238
4059
  | {
4239
4060
  type: 'blur'
4240
4061
  }
4241
- | {
4242
- type: 'decorator.add'
4243
- decorator: string
4244
- }
4245
- | {
4246
- type: 'decorator.remove'
4247
- decorator: string
4248
- }
4249
4062
  | {
4250
4063
  type: 'decorator.toggle'
4251
4064
  decorator: string
@@ -4305,6 +4118,10 @@ export declare const editorMachine: StateMachine<
4305
4118
  description: string
4306
4119
  data: unknown
4307
4120
  }
4121
+ | {
4122
+ type: 'select'
4123
+ selection: EditorSelection
4124
+ }
4308
4125
  | {
4309
4126
  type: 'selection'
4310
4127
  selection: EditorSelection
@@ -4340,7 +4157,7 @@ export declare const editorMachine: StateMachine<
4340
4157
  readonly 'update value': {
4341
4158
  readonly actions: ActionFunction<
4342
4159
  {
4343
- behaviors: Array<Behavior>
4160
+ behaviors: Set<Behavior>
4344
4161
  keyGenerator: () => string
4345
4162
  pendingEvents: Array<PatchEvent | MutationEvent_2>
4346
4163
  schema: EditorSchema
@@ -4368,26 +4185,9 @@ export declare const editorMachine: StateMachine<
4368
4185
  name: string
4369
4186
  }
4370
4187
  }
4371
- | {
4372
- type: 'annotation.toggle'
4373
- annotation: {
4374
- name: string
4375
- value: {
4376
- [prop: string]: unknown
4377
- }
4378
- }
4379
- }
4380
4188
  | {
4381
4189
  type: 'blur'
4382
4190
  }
4383
- | {
4384
- type: 'decorator.add'
4385
- decorator: string
4386
- }
4387
- | {
4388
- type: 'decorator.remove'
4389
- decorator: string
4390
- }
4391
4191
  | {
4392
4192
  type: 'decorator.toggle'
4393
4193
  decorator: string
@@ -4441,6 +4241,14 @@ export declare const editorMachine: StateMachine<
4441
4241
  preventDefault: () => void
4442
4242
  }
4443
4243
  }
4244
+ | {
4245
+ type: 'add behavior'
4246
+ behavior: Behavior
4247
+ }
4248
+ | {
4249
+ type: 'remove behavior'
4250
+ behavior: Behavior
4251
+ }
4444
4252
  | {
4445
4253
  type: 'update readOnly'
4446
4254
  readOnly: boolean
@@ -4481,6 +4289,10 @@ export declare const editorMachine: StateMachine<
4481
4289
  description: string
4482
4290
  data: unknown
4483
4291
  }
4292
+ | {
4293
+ type: 'select'
4294
+ selection: EditorSelection
4295
+ }
4484
4296
  | {
4485
4297
  type: 'selection'
4486
4298
  selection: EditorSelection
@@ -4510,7 +4322,7 @@ export declare const editorMachine: StateMachine<
4510
4322
  readonly 'update maxBlocks': {
4511
4323
  readonly actions: ActionFunction<
4512
4324
  {
4513
- behaviors: Array<Behavior>
4325
+ behaviors: Set<Behavior>
4514
4326
  keyGenerator: () => string
4515
4327
  pendingEvents: Array<PatchEvent | MutationEvent_2>
4516
4328
  schema: EditorSchema
@@ -4538,26 +4350,9 @@ export declare const editorMachine: StateMachine<
4538
4350
  name: string
4539
4351
  }
4540
4352
  }
4541
- | {
4542
- type: 'annotation.toggle'
4543
- annotation: {
4544
- name: string
4545
- value: {
4546
- [prop: string]: unknown
4547
- }
4548
- }
4549
- }
4550
4353
  | {
4551
4354
  type: 'blur'
4552
4355
  }
4553
- | {
4554
- type: 'decorator.add'
4555
- decorator: string
4556
- }
4557
- | {
4558
- type: 'decorator.remove'
4559
- decorator: string
4560
- }
4561
4356
  | {
4562
4357
  type: 'decorator.toggle'
4563
4358
  decorator: string
@@ -4611,6 +4406,14 @@ export declare const editorMachine: StateMachine<
4611
4406
  preventDefault: () => void
4612
4407
  }
4613
4408
  }
4409
+ | {
4410
+ type: 'add behavior'
4411
+ behavior: Behavior
4412
+ }
4413
+ | {
4414
+ type: 'remove behavior'
4415
+ behavior: Behavior
4416
+ }
4614
4417
  | {
4615
4418
  type: 'update readOnly'
4616
4419
  readOnly: boolean
@@ -4651,6 +4454,10 @@ export declare const editorMachine: StateMachine<
4651
4454
  description: string
4652
4455
  data: unknown
4653
4456
  }
4457
+ | {
4458
+ type: 'select'
4459
+ selection: EditorSelection
4460
+ }
4654
4461
  | {
4655
4462
  type: 'selection'
4656
4463
  selection: EditorSelection
@@ -4695,7 +4502,7 @@ export declare const editorMachine: StateMachine<
4695
4502
  context,
4696
4503
  }: GuardArgs<
4697
4504
  {
4698
- behaviors: Array<Behavior>
4505
+ behaviors: Set<Behavior>
4699
4506
  keyGenerator: () => string
4700
4507
  pendingEvents: Array<PatchEvent | MutationEvent_2>
4701
4508
  schema: EditorSchema
@@ -4722,7 +4529,7 @@ export declare const editorMachine: StateMachine<
4722
4529
  event,
4723
4530
  }: GuardArgs<
4724
4531
  {
4725
- behaviors: Array<Behavior>
4532
+ behaviors: Set<Behavior>
4726
4533
  keyGenerator: () => string
4727
4534
  pendingEvents: Array<PatchEvent | MutationEvent_2>
4728
4535
  schema: EditorSchema
@@ -4750,7 +4557,7 @@ export declare const editorMachine: StateMachine<
4750
4557
  event,
4751
4558
  }: GuardArgs<
4752
4559
  {
4753
- behaviors: Array<Behavior>
4560
+ behaviors: Set<Behavior>
4754
4561
  keyGenerator: () => string
4755
4562
  pendingEvents: Array<PatchEvent | MutationEvent_2>
4756
4563
  schema: EditorSchema
@@ -4770,10 +4577,10 @@ export declare const editorMachine: StateMachine<
4770
4577
  readonly 'behavior event': {
4771
4578
  readonly actions: 'handle behavior event'
4772
4579
  }
4773
- readonly 'annotation.add': {
4580
+ readonly 'annotation.*': {
4774
4581
  readonly actions: ActionFunction<
4775
4582
  {
4776
- behaviors: Array<Behavior>
4583
+ behaviors: Set<Behavior>
4777
4584
  keyGenerator: () => string
4778
4585
  pendingEvents: Array<PatchEvent | MutationEvent_2>
4779
4586
  schema: EditorSchema
@@ -4782,15 +4589,6 @@ export declare const editorMachine: StateMachine<
4782
4589
  selection: EditorSelection
4783
4590
  value: Array<PortableTextBlock> | undefined
4784
4591
  },
4785
- {
4786
- type: 'annotation.add'
4787
- annotation: {
4788
- name: string
4789
- value: {
4790
- [prop: string]: unknown
4791
- }
4792
- }
4793
- },
4794
4592
  | {
4795
4593
  type: 'annotation.add'
4796
4594
  annotation: {
@@ -4805,145 +4603,7 @@ export declare const editorMachine: StateMachine<
4805
4603
  annotation: {
4806
4604
  name: string
4807
4605
  }
4808
- }
4809
- | {
4810
- type: 'annotation.toggle'
4811
- annotation: {
4812
- name: string
4813
- value: {
4814
- [prop: string]: unknown
4815
- }
4816
- }
4817
- }
4818
- | {
4819
- type: 'blur'
4820
- }
4821
- | {
4822
- type: 'decorator.add'
4823
- decorator: string
4824
- }
4825
- | {
4826
- type: 'decorator.remove'
4827
- decorator: string
4828
- }
4829
- | {
4830
- type: 'decorator.toggle'
4831
- decorator: string
4832
- }
4833
- | {
4834
- type: 'focus'
4835
- }
4836
- | {
4837
- type: 'insert.block object'
4838
- placement: 'auto' | 'after' | 'before'
4839
- blockObject: {
4840
- name: string
4841
- value?: {
4842
- [prop: string]: unknown
4843
- }
4844
- }
4845
- }
4846
- | {
4847
- type: 'insert.inline object'
4848
- inlineObject: {
4849
- name: string
4850
- value?: {
4851
- [prop: string]: unknown
4852
- }
4853
- }
4854
- }
4855
- | {
4856
- type: 'list item.toggle'
4857
- listItem: string
4858
- }
4859
- | {
4860
- type: 'style.toggle'
4861
- style: string
4862
- }
4863
- | PatchEvent
4864
- | MutationEvent_2
4865
- | {
4866
- type: 'normalizing'
4867
- }
4868
- | {
4869
- type: 'done normalizing'
4870
- }
4871
- | {
4872
- type: 'done syncing initial value'
4873
- }
4874
- | {
4875
- type: 'behavior event'
4876
- behaviorEvent:
4877
- | SyntheticBehaviorEvent
4878
- | NativeBehaviorEvent
4879
- editor: PortableTextSlateEditor
4880
- nativeEvent?: {
4881
- preventDefault: () => void
4882
- }
4883
- }
4884
- | {
4885
- type: 'update readOnly'
4886
- readOnly: boolean
4887
- }
4888
- | {
4889
- type: 'update schema'
4890
- schema: EditorSchema
4891
- }
4892
- | {
4893
- type: 'update behaviors'
4894
- behaviors: Array<Behavior>
4895
- }
4896
- | {
4897
- type: 'update value'
4898
- value: Array<PortableTextBlock> | undefined
4899
- }
4900
- | {
4901
- type: 'update maxBlocks'
4902
- maxBlocks: number | undefined
4903
- }
4904
- | PatchesEvent
4905
- | {
4906
- type: 'unset'
4907
- previousValue: Array<PortableTextBlock>
4908
- }
4909
- | {
4910
- type: 'value changed'
4911
- value: Array<PortableTextBlock> | undefined
4912
- }
4913
- | {
4914
- type: 'invalid value'
4915
- resolution: InvalidValueResolution | null
4916
- value: Array<PortableTextBlock> | undefined
4917
- }
4918
- | {
4919
- type: 'error'
4920
- name: string
4921
- description: string
4922
- data: unknown
4923
- }
4924
- | {
4925
- type: 'selection'
4926
- selection: EditorSelection
4927
- }
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
4606
  },
4942
- undefined,
4943
- never,
4944
- never,
4945
- never,
4946
- never,
4947
4607
  | {
4948
4608
  type: 'annotation.add'
4949
4609
  annotation: {
@@ -4959,164 +4619,9 @@ export declare const editorMachine: StateMachine<
4959
4619
  name: string
4960
4620
  }
4961
4621
  }
4962
- | {
4963
- type: 'annotation.toggle'
4964
- annotation: {
4965
- name: string
4966
- value: {
4967
- [prop: string]: unknown
4968
- }
4969
- }
4970
- }
4971
4622
  | {
4972
4623
  type: 'blur'
4973
4624
  }
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
4625
  | {
5121
4626
  type: 'decorator.toggle'
5122
4627
  decorator: string
@@ -5172,6 +4677,14 @@ export declare const editorMachine: StateMachine<
5172
4677
  preventDefault: () => void
5173
4678
  }
5174
4679
  }
4680
+ | {
4681
+ type: 'add behavior'
4682
+ behavior: Behavior
4683
+ }
4684
+ | {
4685
+ type: 'remove behavior'
4686
+ behavior: Behavior
4687
+ }
5175
4688
  | {
5176
4689
  type: 'update readOnly'
5177
4690
  readOnly: boolean
@@ -5212,6 +4725,10 @@ export declare const editorMachine: StateMachine<
5212
4725
  description: string
5213
4726
  data: unknown
5214
4727
  }
4728
+ | {
4729
+ type: 'select'
4730
+ selection: EditorSelection
4731
+ }
5215
4732
  | {
5216
4733
  type: 'selection'
5217
4734
  selection: EditorSelection
@@ -5250,26 +4767,9 @@ export declare const editorMachine: StateMachine<
5250
4767
  name: string
5251
4768
  }
5252
4769
  }
5253
- | {
5254
- type: 'annotation.toggle'
5255
- annotation: {
5256
- name: string
5257
- value: {
5258
- [prop: string]: unknown
5259
- }
5260
- }
5261
- }
5262
4770
  | {
5263
4771
  type: 'blur'
5264
4772
  }
5265
- | {
5266
- type: 'decorator.add'
5267
- decorator: string
5268
- }
5269
- | {
5270
- type: 'decorator.remove'
5271
- decorator: string
5272
- }
5273
4773
  | {
5274
4774
  type: 'decorator.toggle'
5275
4775
  decorator: string
@@ -5329,6 +4829,10 @@ export declare const editorMachine: StateMachine<
5329
4829
  description: string
5330
4830
  data: unknown
5331
4831
  }
4832
+ | {
4833
+ type: 'select'
4834
+ selection: EditorSelection
4835
+ }
5332
4836
  | {
5333
4837
  type: 'selection'
5334
4838
  selection: EditorSelection
@@ -5355,10 +4859,10 @@ export declare const editorMachine: StateMachine<
5355
4859
  }
5356
4860
  >
5357
4861
  }
5358
- readonly 'annotation.toggle': {
4862
+ readonly 'blur': {
5359
4863
  readonly actions: ActionFunction<
5360
4864
  {
5361
- behaviors: Array<Behavior>
4865
+ behaviors: Set<Behavior>
5362
4866
  keyGenerator: () => string
5363
4867
  pendingEvents: Array<PatchEvent | MutationEvent_2>
5364
4868
  schema: EditorSchema
@@ -5368,13 +4872,7 @@ export declare const editorMachine: StateMachine<
5368
4872
  value: Array<PortableTextBlock> | undefined
5369
4873
  },
5370
4874
  {
5371
- type: 'annotation.toggle'
5372
- annotation: {
5373
- name: string
5374
- value: {
5375
- [prop: string]: unknown
5376
- }
5377
- }
4875
+ type: 'blur'
5378
4876
  },
5379
4877
  | {
5380
4878
  type: 'annotation.add'
@@ -5391,26 +4889,9 @@ export declare const editorMachine: StateMachine<
5391
4889
  name: string
5392
4890
  }
5393
4891
  }
5394
- | {
5395
- type: 'annotation.toggle'
5396
- annotation: {
5397
- name: string
5398
- value: {
5399
- [prop: string]: unknown
5400
- }
5401
- }
5402
- }
5403
4892
  | {
5404
4893
  type: 'blur'
5405
4894
  }
5406
- | {
5407
- type: 'decorator.add'
5408
- decorator: string
5409
- }
5410
- | {
5411
- type: 'decorator.remove'
5412
- decorator: string
5413
- }
5414
4895
  | {
5415
4896
  type: 'decorator.toggle'
5416
4897
  decorator: string
@@ -5466,6 +4947,14 @@ export declare const editorMachine: StateMachine<
5466
4947
  preventDefault: () => void
5467
4948
  }
5468
4949
  }
4950
+ | {
4951
+ type: 'add behavior'
4952
+ behavior: Behavior
4953
+ }
4954
+ | {
4955
+ type: 'remove behavior'
4956
+ behavior: Behavior
4957
+ }
5469
4958
  | {
5470
4959
  type: 'update readOnly'
5471
4960
  readOnly: boolean
@@ -5506,6 +4995,10 @@ export declare const editorMachine: StateMachine<
5506
4995
  description: string
5507
4996
  data: unknown
5508
4997
  }
4998
+ | {
4999
+ type: 'select'
5000
+ selection: EditorSelection
5001
+ }
5509
5002
  | {
5510
5003
  type: 'selection'
5511
5004
  selection: EditorSelection
@@ -5544,26 +5037,9 @@ export declare const editorMachine: StateMachine<
5544
5037
  name: string
5545
5038
  }
5546
5039
  }
5547
- | {
5548
- type: 'annotation.toggle'
5549
- annotation: {
5550
- name: string
5551
- value: {
5552
- [prop: string]: unknown
5553
- }
5554
- }
5555
- }
5556
5040
  | {
5557
5041
  type: 'blur'
5558
5042
  }
5559
- | {
5560
- type: 'decorator.add'
5561
- decorator: string
5562
- }
5563
- | {
5564
- type: 'decorator.remove'
5565
- decorator: string
5566
- }
5567
5043
  | {
5568
5044
  type: 'decorator.toggle'
5569
5045
  decorator: string
@@ -5623,6 +5099,10 @@ export declare const editorMachine: StateMachine<
5623
5099
  description: string
5624
5100
  data: unknown
5625
5101
  }
5102
+ | {
5103
+ type: 'select'
5104
+ selection: EditorSelection
5105
+ }
5626
5106
  | {
5627
5107
  type: 'selection'
5628
5108
  selection: EditorSelection
@@ -5649,10 +5129,10 @@ export declare const editorMachine: StateMachine<
5649
5129
  }
5650
5130
  >
5651
5131
  }
5652
- readonly 'blur': {
5132
+ readonly 'decorator.*': {
5653
5133
  readonly actions: ActionFunction<
5654
5134
  {
5655
- behaviors: Array<Behavior>
5135
+ behaviors: Set<Behavior>
5656
5136
  keyGenerator: () => string
5657
5137
  pendingEvents: Array<PatchEvent | MutationEvent_2>
5658
5138
  schema: EditorSchema
@@ -5662,7 +5142,8 @@ export declare const editorMachine: StateMachine<
5662
5142
  value: Array<PortableTextBlock> | undefined
5663
5143
  },
5664
5144
  {
5665
- type: 'blur'
5145
+ type: 'decorator.toggle'
5146
+ decorator: string
5666
5147
  },
5667
5148
  | {
5668
5149
  type: 'annotation.add'
@@ -5679,26 +5160,9 @@ export declare const editorMachine: StateMachine<
5679
5160
  name: string
5680
5161
  }
5681
5162
  }
5682
- | {
5683
- type: 'annotation.toggle'
5684
- annotation: {
5685
- name: string
5686
- value: {
5687
- [prop: string]: unknown
5688
- }
5689
- }
5690
- }
5691
5163
  | {
5692
5164
  type: 'blur'
5693
5165
  }
5694
- | {
5695
- type: 'decorator.add'
5696
- decorator: string
5697
- }
5698
- | {
5699
- type: 'decorator.remove'
5700
- decorator: string
5701
- }
5702
5166
  | {
5703
5167
  type: 'decorator.toggle'
5704
5168
  decorator: string
@@ -5754,6 +5218,14 @@ export declare const editorMachine: StateMachine<
5754
5218
  preventDefault: () => void
5755
5219
  }
5756
5220
  }
5221
+ | {
5222
+ type: 'add behavior'
5223
+ behavior: Behavior
5224
+ }
5225
+ | {
5226
+ type: 'remove behavior'
5227
+ behavior: Behavior
5228
+ }
5757
5229
  | {
5758
5230
  type: 'update readOnly'
5759
5231
  readOnly: boolean
@@ -5794,6 +5266,10 @@ export declare const editorMachine: StateMachine<
5794
5266
  description: string
5795
5267
  data: unknown
5796
5268
  }
5269
+ | {
5270
+ type: 'select'
5271
+ selection: EditorSelection
5272
+ }
5797
5273
  | {
5798
5274
  type: 'selection'
5799
5275
  selection: EditorSelection
@@ -5832,26 +5308,9 @@ export declare const editorMachine: StateMachine<
5832
5308
  name: string
5833
5309
  }
5834
5310
  }
5835
- | {
5836
- type: 'annotation.toggle'
5837
- annotation: {
5838
- name: string
5839
- value: {
5840
- [prop: string]: unknown
5841
- }
5842
- }
5843
- }
5844
5311
  | {
5845
5312
  type: 'blur'
5846
5313
  }
5847
- | {
5848
- type: 'decorator.add'
5849
- decorator: string
5850
- }
5851
- | {
5852
- type: 'decorator.remove'
5853
- decorator: string
5854
- }
5855
5314
  | {
5856
5315
  type: 'decorator.toggle'
5857
5316
  decorator: string
@@ -5911,6 +5370,10 @@ export declare const editorMachine: StateMachine<
5911
5370
  description: string
5912
5371
  data: unknown
5913
5372
  }
5373
+ | {
5374
+ type: 'select'
5375
+ selection: EditorSelection
5376
+ }
5914
5377
  | {
5915
5378
  type: 'selection'
5916
5379
  selection: EditorSelection
@@ -5937,10 +5400,10 @@ export declare const editorMachine: StateMachine<
5937
5400
  }
5938
5401
  >
5939
5402
  }
5940
- readonly 'decorator.*': {
5403
+ readonly 'focus': {
5941
5404
  readonly actions: ActionFunction<
5942
5405
  {
5943
- behaviors: Array<Behavior>
5406
+ behaviors: Set<Behavior>
5944
5407
  keyGenerator: () => string
5945
5408
  pendingEvents: Array<PatchEvent | MutationEvent_2>
5946
5409
  schema: EditorSchema
@@ -5949,18 +5412,9 @@ export declare const editorMachine: StateMachine<
5949
5412
  selection: EditorSelection
5950
5413
  value: Array<PortableTextBlock> | undefined
5951
5414
  },
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
- },
5415
+ {
5416
+ type: 'focus'
5417
+ },
5964
5418
  | {
5965
5419
  type: 'annotation.add'
5966
5420
  annotation: {
@@ -5973,28 +5427,11 @@ export declare const editorMachine: StateMachine<
5973
5427
  | {
5974
5428
  type: 'annotation.remove'
5975
5429
  annotation: {
5976
- name: string
5977
- }
5978
- }
5979
- | {
5980
- type: 'annotation.toggle'
5981
- annotation: {
5982
- name: string
5983
- value: {
5984
- [prop: string]: unknown
5985
- }
5986
- }
5987
- }
5988
- | {
5989
- type: 'blur'
5990
- }
5991
- | {
5992
- type: 'decorator.add'
5993
- decorator: string
5430
+ name: string
5431
+ }
5994
5432
  }
5995
5433
  | {
5996
- type: 'decorator.remove'
5997
- decorator: string
5434
+ type: 'blur'
5998
5435
  }
5999
5436
  | {
6000
5437
  type: 'decorator.toggle'
@@ -6051,6 +5488,14 @@ export declare const editorMachine: StateMachine<
6051
5488
  preventDefault: () => void
6052
5489
  }
6053
5490
  }
5491
+ | {
5492
+ type: 'add behavior'
5493
+ behavior: Behavior
5494
+ }
5495
+ | {
5496
+ type: 'remove behavior'
5497
+ behavior: Behavior
5498
+ }
6054
5499
  | {
6055
5500
  type: 'update readOnly'
6056
5501
  readOnly: boolean
@@ -6091,6 +5536,10 @@ export declare const editorMachine: StateMachine<
6091
5536
  description: string
6092
5537
  data: unknown
6093
5538
  }
5539
+ | {
5540
+ type: 'select'
5541
+ selection: EditorSelection
5542
+ }
6094
5543
  | {
6095
5544
  type: 'selection'
6096
5545
  selection: EditorSelection
@@ -6129,26 +5578,9 @@ export declare const editorMachine: StateMachine<
6129
5578
  name: string
6130
5579
  }
6131
5580
  }
6132
- | {
6133
- type: 'annotation.toggle'
6134
- annotation: {
6135
- name: string
6136
- value: {
6137
- [prop: string]: unknown
6138
- }
6139
- }
6140
- }
6141
5581
  | {
6142
5582
  type: 'blur'
6143
5583
  }
6144
- | {
6145
- type: 'decorator.add'
6146
- decorator: string
6147
- }
6148
- | {
6149
- type: 'decorator.remove'
6150
- decorator: string
6151
- }
6152
5584
  | {
6153
5585
  type: 'decorator.toggle'
6154
5586
  decorator: string
@@ -6208,6 +5640,10 @@ export declare const editorMachine: StateMachine<
6208
5640
  description: string
6209
5641
  data: unknown
6210
5642
  }
5643
+ | {
5644
+ type: 'select'
5645
+ selection: EditorSelection
5646
+ }
6211
5647
  | {
6212
5648
  type: 'selection'
6213
5649
  selection: EditorSelection
@@ -6234,10 +5670,10 @@ export declare const editorMachine: StateMachine<
6234
5670
  }
6235
5671
  >
6236
5672
  }
6237
- readonly 'focus': {
5673
+ readonly 'insert.*': {
6238
5674
  readonly actions: ActionFunction<
6239
5675
  {
6240
- behaviors: Array<Behavior>
5676
+ behaviors: Set<Behavior>
6241
5677
  keyGenerator: () => string
6242
5678
  pendingEvents: Array<PatchEvent | MutationEvent_2>
6243
5679
  schema: EditorSchema
@@ -6246,26 +5682,27 @@ export declare const editorMachine: StateMachine<
6246
5682
  selection: EditorSelection
6247
5683
  value: Array<PortableTextBlock> | undefined
6248
5684
  },
6249
- {
6250
- type: 'focus'
6251
- },
6252
5685
  | {
6253
- type: 'annotation.add'
6254
- annotation: {
5686
+ type: 'insert.block object'
5687
+ placement: 'auto' | 'after' | 'before'
5688
+ blockObject: {
6255
5689
  name: string
6256
- value: {
5690
+ value?: {
6257
5691
  [prop: string]: unknown
6258
5692
  }
6259
5693
  }
6260
5694
  }
6261
5695
  | {
6262
- type: 'annotation.remove'
6263
- annotation: {
5696
+ type: 'insert.inline object'
5697
+ inlineObject: {
6264
5698
  name: string
5699
+ value?: {
5700
+ [prop: string]: unknown
5701
+ }
6265
5702
  }
6266
- }
5703
+ },
6267
5704
  | {
6268
- type: 'annotation.toggle'
5705
+ type: 'annotation.add'
6269
5706
  annotation: {
6270
5707
  name: string
6271
5708
  value: {
@@ -6274,15 +5711,13 @@ export declare const editorMachine: StateMachine<
6274
5711
  }
6275
5712
  }
6276
5713
  | {
6277
- type: 'blur'
6278
- }
6279
- | {
6280
- type: 'decorator.add'
6281
- decorator: string
5714
+ type: 'annotation.remove'
5715
+ annotation: {
5716
+ name: string
5717
+ }
6282
5718
  }
6283
5719
  | {
6284
- type: 'decorator.remove'
6285
- decorator: string
5720
+ type: 'blur'
6286
5721
  }
6287
5722
  | {
6288
5723
  type: 'decorator.toggle'
@@ -6339,6 +5774,14 @@ export declare const editorMachine: StateMachine<
6339
5774
  preventDefault: () => void
6340
5775
  }
6341
5776
  }
5777
+ | {
5778
+ type: 'add behavior'
5779
+ behavior: Behavior
5780
+ }
5781
+ | {
5782
+ type: 'remove behavior'
5783
+ behavior: Behavior
5784
+ }
6342
5785
  | {
6343
5786
  type: 'update readOnly'
6344
5787
  readOnly: boolean
@@ -6379,6 +5822,10 @@ export declare const editorMachine: StateMachine<
6379
5822
  description: string
6380
5823
  data: unknown
6381
5824
  }
5825
+ | {
5826
+ type: 'select'
5827
+ selection: EditorSelection
5828
+ }
6382
5829
  | {
6383
5830
  type: 'selection'
6384
5831
  selection: EditorSelection
@@ -6417,26 +5864,9 @@ export declare const editorMachine: StateMachine<
6417
5864
  name: string
6418
5865
  }
6419
5866
  }
6420
- | {
6421
- type: 'annotation.toggle'
6422
- annotation: {
6423
- name: string
6424
- value: {
6425
- [prop: string]: unknown
6426
- }
6427
- }
6428
- }
6429
5867
  | {
6430
5868
  type: 'blur'
6431
5869
  }
6432
- | {
6433
- type: 'decorator.add'
6434
- decorator: string
6435
- }
6436
- | {
6437
- type: 'decorator.remove'
6438
- decorator: string
6439
- }
6440
5870
  | {
6441
5871
  type: 'decorator.toggle'
6442
5872
  decorator: string
@@ -6496,6 +5926,10 @@ export declare const editorMachine: StateMachine<
6496
5926
  description: string
6497
5927
  data: unknown
6498
5928
  }
5929
+ | {
5930
+ type: 'select'
5931
+ selection: EditorSelection
5932
+ }
6499
5933
  | {
6500
5934
  type: 'selection'
6501
5935
  selection: EditorSelection
@@ -6522,10 +5956,10 @@ export declare const editorMachine: StateMachine<
6522
5956
  }
6523
5957
  >
6524
5958
  }
6525
- readonly 'insert.*': {
5959
+ readonly 'list item.*': {
6526
5960
  readonly actions: ActionFunction<
6527
5961
  {
6528
- behaviors: Array<Behavior>
5962
+ behaviors: Set<Behavior>
6529
5963
  keyGenerator: () => string
6530
5964
  pendingEvents: Array<PatchEvent | MutationEvent_2>
6531
5965
  schema: EditorSchema
@@ -6534,25 +5968,10 @@ export declare const editorMachine: StateMachine<
6534
5968
  selection: EditorSelection
6535
5969
  value: Array<PortableTextBlock> | undefined
6536
5970
  },
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
- },
5971
+ {
5972
+ type: 'list item.toggle'
5973
+ listItem: string
5974
+ },
6556
5975
  | {
6557
5976
  type: 'annotation.add'
6558
5977
  annotation: {
@@ -6568,26 +5987,9 @@ export declare const editorMachine: StateMachine<
6568
5987
  name: string
6569
5988
  }
6570
5989
  }
6571
- | {
6572
- type: 'annotation.toggle'
6573
- annotation: {
6574
- name: string
6575
- value: {
6576
- [prop: string]: unknown
6577
- }
6578
- }
6579
- }
6580
5990
  | {
6581
5991
  type: 'blur'
6582
5992
  }
6583
- | {
6584
- type: 'decorator.add'
6585
- decorator: string
6586
- }
6587
- | {
6588
- type: 'decorator.remove'
6589
- decorator: string
6590
- }
6591
5993
  | {
6592
5994
  type: 'decorator.toggle'
6593
5995
  decorator: string
@@ -6643,6 +6045,14 @@ export declare const editorMachine: StateMachine<
6643
6045
  preventDefault: () => void
6644
6046
  }
6645
6047
  }
6048
+ | {
6049
+ type: 'add behavior'
6050
+ behavior: Behavior
6051
+ }
6052
+ | {
6053
+ type: 'remove behavior'
6054
+ behavior: Behavior
6055
+ }
6646
6056
  | {
6647
6057
  type: 'update readOnly'
6648
6058
  readOnly: boolean
@@ -6683,6 +6093,10 @@ export declare const editorMachine: StateMachine<
6683
6093
  description: string
6684
6094
  data: unknown
6685
6095
  }
6096
+ | {
6097
+ type: 'select'
6098
+ selection: EditorSelection
6099
+ }
6686
6100
  | {
6687
6101
  type: 'selection'
6688
6102
  selection: EditorSelection
@@ -6721,26 +6135,9 @@ export declare const editorMachine: StateMachine<
6721
6135
  name: string
6722
6136
  }
6723
6137
  }
6724
- | {
6725
- type: 'annotation.toggle'
6726
- annotation: {
6727
- name: string
6728
- value: {
6729
- [prop: string]: unknown
6730
- }
6731
- }
6732
- }
6733
6138
  | {
6734
6139
  type: 'blur'
6735
6140
  }
6736
- | {
6737
- type: 'decorator.add'
6738
- decorator: string
6739
- }
6740
- | {
6741
- type: 'decorator.remove'
6742
- decorator: string
6743
- }
6744
6141
  | {
6745
6142
  type: 'decorator.toggle'
6746
6143
  decorator: string
@@ -6800,6 +6197,10 @@ export declare const editorMachine: StateMachine<
6800
6197
  description: string
6801
6198
  data: unknown
6802
6199
  }
6200
+ | {
6201
+ type: 'select'
6202
+ selection: EditorSelection
6203
+ }
6803
6204
  | {
6804
6205
  type: 'selection'
6805
6206
  selection: EditorSelection
@@ -6826,10 +6227,10 @@ export declare const editorMachine: StateMachine<
6826
6227
  }
6827
6228
  >
6828
6229
  }
6829
- readonly 'list item.*': {
6230
+ readonly 'select': {
6830
6231
  readonly actions: ActionFunction<
6831
6232
  {
6832
- behaviors: Array<Behavior>
6233
+ behaviors: Set<Behavior>
6833
6234
  keyGenerator: () => string
6834
6235
  pendingEvents: Array<PatchEvent | MutationEvent_2>
6835
6236
  schema: EditorSchema
@@ -6839,8 +6240,8 @@ export declare const editorMachine: StateMachine<
6839
6240
  value: Array<PortableTextBlock> | undefined
6840
6241
  },
6841
6242
  {
6842
- type: 'list item.toggle'
6843
- listItem: string
6243
+ type: 'select'
6244
+ selection: EditorSelection
6844
6245
  },
6845
6246
  | {
6846
6247
  type: 'annotation.add'
@@ -6857,26 +6258,9 @@ export declare const editorMachine: StateMachine<
6857
6258
  name: string
6858
6259
  }
6859
6260
  }
6860
- | {
6861
- type: 'annotation.toggle'
6862
- annotation: {
6863
- name: string
6864
- value: {
6865
- [prop: string]: unknown
6866
- }
6867
- }
6868
- }
6869
6261
  | {
6870
6262
  type: 'blur'
6871
6263
  }
6872
- | {
6873
- type: 'decorator.add'
6874
- decorator: string
6875
- }
6876
- | {
6877
- type: 'decorator.remove'
6878
- decorator: string
6879
- }
6880
6264
  | {
6881
6265
  type: 'decorator.toggle'
6882
6266
  decorator: string
@@ -6932,6 +6316,14 @@ export declare const editorMachine: StateMachine<
6932
6316
  preventDefault: () => void
6933
6317
  }
6934
6318
  }
6319
+ | {
6320
+ type: 'add behavior'
6321
+ behavior: Behavior
6322
+ }
6323
+ | {
6324
+ type: 'remove behavior'
6325
+ behavior: Behavior
6326
+ }
6935
6327
  | {
6936
6328
  type: 'update readOnly'
6937
6329
  readOnly: boolean
@@ -6972,6 +6364,10 @@ export declare const editorMachine: StateMachine<
6972
6364
  description: string
6973
6365
  data: unknown
6974
6366
  }
6367
+ | {
6368
+ type: 'select'
6369
+ selection: EditorSelection
6370
+ }
6975
6371
  | {
6976
6372
  type: 'selection'
6977
6373
  selection: EditorSelection
@@ -7010,26 +6406,9 @@ export declare const editorMachine: StateMachine<
7010
6406
  name: string
7011
6407
  }
7012
6408
  }
7013
- | {
7014
- type: 'annotation.toggle'
7015
- annotation: {
7016
- name: string
7017
- value: {
7018
- [prop: string]: unknown
7019
- }
7020
- }
7021
- }
7022
6409
  | {
7023
6410
  type: 'blur'
7024
6411
  }
7025
- | {
7026
- type: 'decorator.add'
7027
- decorator: string
7028
- }
7029
- | {
7030
- type: 'decorator.remove'
7031
- decorator: string
7032
- }
7033
6412
  | {
7034
6413
  type: 'decorator.toggle'
7035
6414
  decorator: string
@@ -7089,6 +6468,10 @@ export declare const editorMachine: StateMachine<
7089
6468
  description: string
7090
6469
  data: unknown
7091
6470
  }
6471
+ | {
6472
+ type: 'select'
6473
+ selection: EditorSelection
6474
+ }
7092
6475
  | {
7093
6476
  type: 'selection'
7094
6477
  selection: EditorSelection
@@ -7118,7 +6501,7 @@ export declare const editorMachine: StateMachine<
7118
6501
  readonly 'style.*': {
7119
6502
  readonly actions: ActionFunction<
7120
6503
  {
7121
- behaviors: Array<Behavior>
6504
+ behaviors: Set<Behavior>
7122
6505
  keyGenerator: () => string
7123
6506
  pendingEvents: Array<PatchEvent | MutationEvent_2>
7124
6507
  schema: EditorSchema
@@ -7146,26 +6529,9 @@ export declare const editorMachine: StateMachine<
7146
6529
  name: string
7147
6530
  }
7148
6531
  }
7149
- | {
7150
- type: 'annotation.toggle'
7151
- annotation: {
7152
- name: string
7153
- value: {
7154
- [prop: string]: unknown
7155
- }
7156
- }
7157
- }
7158
6532
  | {
7159
6533
  type: 'blur'
7160
6534
  }
7161
- | {
7162
- type: 'decorator.add'
7163
- decorator: string
7164
- }
7165
- | {
7166
- type: 'decorator.remove'
7167
- decorator: string
7168
- }
7169
6535
  | {
7170
6536
  type: 'decorator.toggle'
7171
6537
  decorator: string
@@ -7221,6 +6587,14 @@ export declare const editorMachine: StateMachine<
7221
6587
  preventDefault: () => void
7222
6588
  }
7223
6589
  }
6590
+ | {
6591
+ type: 'add behavior'
6592
+ behavior: Behavior
6593
+ }
6594
+ | {
6595
+ type: 'remove behavior'
6596
+ behavior: Behavior
6597
+ }
7224
6598
  | {
7225
6599
  type: 'update readOnly'
7226
6600
  readOnly: boolean
@@ -7261,6 +6635,10 @@ export declare const editorMachine: StateMachine<
7261
6635
  description: string
7262
6636
  data: unknown
7263
6637
  }
6638
+ | {
6639
+ type: 'select'
6640
+ selection: EditorSelection
6641
+ }
7264
6642
  | {
7265
6643
  type: 'selection'
7266
6644
  selection: EditorSelection
@@ -7299,26 +6677,9 @@ export declare const editorMachine: StateMachine<
7299
6677
  name: string
7300
6678
  }
7301
6679
  }
7302
- | {
7303
- type: 'annotation.toggle'
7304
- annotation: {
7305
- name: string
7306
- value: {
7307
- [prop: string]: unknown
7308
- }
7309
- }
7310
- }
7311
6680
  | {
7312
6681
  type: 'blur'
7313
6682
  }
7314
- | {
7315
- type: 'decorator.add'
7316
- decorator: string
7317
- }
7318
- | {
7319
- type: 'decorator.remove'
7320
- decorator: string
7321
- }
7322
6683
  | {
7323
6684
  type: 'decorator.toggle'
7324
6685
  decorator: string
@@ -7378,6 +6739,10 @@ export declare const editorMachine: StateMachine<
7378
6739
  description: string
7379
6740
  data: unknown
7380
6741
  }
6742
+ | {
6743
+ type: 'select'
6744
+ selection: EditorSelection
6745
+ }
7381
6746
  | {
7382
6747
  type: 'selection'
7383
6748
  selection: EditorSelection
@@ -7603,6 +6968,10 @@ export declare type InternalEditorEmittedEvent =
7603
6968
  description: string
7604
6969
  data: unknown
7605
6970
  }
6971
+ | {
6972
+ type: 'select'
6973
+ selection: EditorSelection
6974
+ }
7606
6975
  | {
7607
6976
  type: 'selection'
7608
6977
  selection: EditorSelection
@@ -7632,10 +7001,7 @@ export declare type InternalEditorEmittedEvent =
7632
7001
  'type',
7633
7002
  | 'annotation.add'
7634
7003
  | 'annotation.remove'
7635
- | 'annotation.toggle'
7636
7004
  | 'blur'
7637
- | 'decorator.add'
7638
- | 'decorator.remove'
7639
7005
  | 'decorator.toggle'
7640
7006
  | 'insert.block object'
7641
7007
  | 'insert.inline object'
@@ -7665,6 +7031,14 @@ export declare type InternalEditorEvent =
7665
7031
  preventDefault: () => void
7666
7032
  }
7667
7033
  }
7034
+ | {
7035
+ type: 'add behavior'
7036
+ behavior: Behavior
7037
+ }
7038
+ | {
7039
+ type: 'remove behavior'
7040
+ behavior: Behavior
7041
+ }
7668
7042
  | {
7669
7043
  type: 'update readOnly'
7670
7044
  readOnly: boolean
@@ -8321,26 +7695,9 @@ export declare type SyntheticBehaviorEvent =
8321
7695
  name: string
8322
7696
  }
8323
7697
  }
8324
- | {
8325
- type: 'annotation.toggle'
8326
- annotation: {
8327
- name: string
8328
- value: {
8329
- [prop: string]: unknown
8330
- }
8331
- }
8332
- }
8333
7698
  | {
8334
7699
  type: 'blur'
8335
7700
  }
8336
- | {
8337
- type: 'decorator.add'
8338
- decorator: string
8339
- }
8340
- | {
8341
- type: 'decorator.remove'
8342
- decorator: string
8343
- }
8344
7701
  | {
8345
7702
  type: 'decorator.toggle'
8346
7703
  decorator: string
@@ -8390,6 +7747,10 @@ export declare type SyntheticBehaviorEvent =
8390
7747
  type: 'list item.toggle'
8391
7748
  listItem: string
8392
7749
  }
7750
+ | {
7751
+ type: 'select'
7752
+ selection: EditorSelection
7753
+ }
8393
7754
  | {
8394
7755
  type: 'style.toggle'
8395
7756
  style: string