@portabletext/editor 1.49.10 → 1.49.12

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 (39) hide show
  1. package/lib/behaviors/index.d.cts +159 -2872
  2. package/lib/behaviors/index.d.ts +159 -2872
  3. package/lib/index.cjs +346 -308
  4. package/lib/index.cjs.map +1 -1
  5. package/lib/index.d.cts +176 -2857
  6. package/lib/index.d.ts +176 -2857
  7. package/lib/index.js +349 -311
  8. package/lib/index.js.map +1 -1
  9. package/lib/plugins/index.cjs.map +1 -1
  10. package/lib/plugins/index.d.cts +168 -2862
  11. package/lib/plugins/index.d.ts +168 -2862
  12. package/lib/plugins/index.js.map +1 -1
  13. package/lib/selectors/index.d.cts +159 -2872
  14. package/lib/selectors/index.d.ts +159 -2872
  15. package/lib/utils/index.d.cts +159 -2872
  16. package/lib/utils/index.d.ts +159 -2872
  17. package/package.json +1 -1
  18. package/src/editor/Editable.tsx +14 -12
  19. package/src/editor/PortableTextEditor.tsx +21 -26
  20. package/src/editor/__tests__/self-solving.test.tsx +9 -9
  21. package/src/editor/create-editor.ts +81 -49
  22. package/src/editor/create-slate-editor.tsx +3 -0
  23. package/src/editor/editor-machine.ts +15 -127
  24. package/src/editor/editor-provider.tsx +20 -15
  25. package/src/editor/mutation-machine.ts +125 -7
  26. package/src/editor/plugins/createWithPatches.ts +5 -2
  27. package/src/editor/plugins/createWithPortableTextSelections.ts +4 -2
  28. package/src/editor/plugins/with-plugins.ts +8 -3
  29. package/src/editor/relay-actor-context.ts +4 -0
  30. package/src/editor/relay-machine.ts +100 -0
  31. package/src/editor/route-events-to-changes.tsx +4 -10
  32. package/src/editor/sync-machine.ts +2 -2
  33. package/src/editor-event-listener.tsx +1 -1
  34. package/src/editor.ts +2 -4
  35. package/src/index.ts +3 -6
  36. package/src/internal-utils/__tests__/operationToPatches.test.ts +3 -1
  37. package/src/internal-utils/__tests__/patchToOperations.test.ts +2 -0
  38. package/src/plugins/plugin.event-listener.tsx +1 -1
  39. package/src/types/editor.ts +12 -4
package/lib/index.d.cts CHANGED
@@ -21,7 +21,6 @@ import {
21
21
  import type {
22
22
  BaseSyntheticEvent,
23
23
  ClipboardEvent as ClipboardEvent_2,
24
- FocusEvent as FocusEvent_2,
25
24
  KeyboardEvent as KeyboardEvent_2,
26
25
  default as React_2,
27
26
  ReactElement,
@@ -29,6 +28,7 @@ import type {
29
28
  } from 'react'
30
29
  import {
31
30
  Component,
31
+ FocusEvent as FocusEvent_2,
32
32
  ForwardRefExoticComponent,
33
33
  JSX,
34
34
  MutableRefObject,
@@ -63,7 +63,10 @@ import {
63
63
  } from 'xstate'
64
64
  import type {EventObject, Snapshot} from 'xstate'
65
65
  import {GuardArgs} from 'xstate/guards'
66
- import {Editor as Editor_2} from '..'
66
+ import {
67
+ Editor as Editor_2,
68
+ InvalidValueResolution as InvalidValueResolution_2,
69
+ } from '..'
67
70
 
68
71
  declare type AbstractBehaviorEvent =
69
72
  | {
@@ -480,7 +483,9 @@ declare type ClipboardBehaviorEvent =
480
483
  /**
481
484
  * The editor was either connected or disconnected to the network
482
485
  * To show out of sync warnings etc when in collaborative mode.
483
- * @beta */
486
+ * @beta
487
+ * @deprecated The change is no longer emitted
488
+ * */
484
489
  export declare type ConnectionChange = {
485
490
  type: 'connection'
486
491
  value: 'online' | 'offline'
@@ -818,12 +823,7 @@ export declare type EditorEmittedEvent =
818
823
  | {
819
824
  type: 'editable'
820
825
  }
821
- | {
822
- type: 'error'
823
- name: string
824
- description: string
825
- data: unknown
826
- }
826
+ | ErrorEvent_2
827
827
  | {
828
828
  type: 'focused'
829
829
  event: FocusEvent_2<HTMLDivElement, Element>
@@ -906,14 +906,6 @@ declare const editorMachine: StateMachine<
906
906
  type: 'update readOnly'
907
907
  readOnly: boolean
908
908
  }
909
- | {
910
- type: 'update schema'
911
- schema: EditorSchema
912
- }
913
- | {
914
- type: 'update key generator'
915
- keyGenerator: () => string
916
- }
917
909
  | {
918
910
  type: 'update maxBlocks'
919
911
  maxBlocks: number | undefined
@@ -937,6 +929,10 @@ declare const editorMachine: StateMachine<
937
929
  | {
938
930
  type: 'normalizing'
939
931
  }
932
+ | {
933
+ type: 'update selection'
934
+ selection: EditorSelection
935
+ }
940
936
  | {
941
937
  type: 'done normalizing'
942
938
  }
@@ -954,62 +950,6 @@ declare const editorMachine: StateMachine<
954
950
  preventDefault: () => void
955
951
  }
956
952
  }
957
- | {
958
- type: 'notify.patch'
959
- patch: Patch
960
- }
961
- | {
962
- type: 'notify.mutation'
963
- patches: Array<Patch>
964
- snapshot: Array<PortableTextBlock> | undefined
965
- value: Array<PortableTextBlock> | undefined
966
- }
967
- | {
968
- type: 'notify.blurred'
969
- event: FocusEvent_2<HTMLDivElement, Element>
970
- }
971
- | {
972
- type: 'notify.done loading'
973
- }
974
- | {
975
- type: 'notify.editable'
976
- }
977
- | {
978
- type: 'notify.error'
979
- name: string
980
- description: string
981
- data: unknown
982
- }
983
- | {
984
- type: 'notify.focused'
985
- event: FocusEvent_2<HTMLDivElement, Element>
986
- }
987
- | {
988
- type: 'notify.invalid value'
989
- resolution: InvalidValueResolution | null
990
- value: Array<PortableTextBlock> | undefined
991
- }
992
- | {
993
- type: 'notify.loading'
994
- }
995
- | {
996
- type: 'notify.read only'
997
- }
998
- | {
999
- type: 'notify.ready'
1000
- }
1001
- | {
1002
- type: 'notify.selection'
1003
- selection: EditorSelection
1004
- }
1005
- | {
1006
- type: 'notify.value changed'
1007
- value: Array<PortableTextBlock> | undefined
1008
- }
1009
- | {
1010
- type: 'notify.unset'
1011
- previousValue: Array<PortableTextBlock>
1012
- }
1013
953
  | {
1014
954
  type: 'dragstart'
1015
955
  origin: Pick<EventPosition, 'selection'>
@@ -1032,10 +972,6 @@ declare const editorMachine: StateMachine<
1032
972
  type: 'remove behavior from context'
1033
973
  params: NonReducibleUnknown
1034
974
  }
1035
- 'assign schema': {
1036
- type: 'assign schema'
1037
- params: NonReducibleUnknown
1038
- }
1039
975
  'emit patch event': {
1040
976
  type: 'emit patch event'
1041
977
  params: NonReducibleUnknown
@@ -1135,7 +1071,6 @@ declare const editorMachine: StateMachine<
1135
1071
  initialValue?: Array<PortableTextBlock>
1136
1072
  },
1137
1073
  NonReducibleUnknown,
1138
- | PatchEvent
1139
1074
  | InternalPatchEvent
1140
1075
  | MutationEvent
1141
1076
  | PatchesEvent
@@ -1161,7 +1096,7 @@ declare const editorMachine: StateMachine<
1161
1096
  }
1162
1097
  | {
1163
1098
  type: 'invalid value'
1164
- resolution: InvalidValueResolution | null
1099
+ resolution: InvalidValueResolution_2 | null
1165
1100
  value: Array<PortableTextBlock> | undefined
1166
1101
  }
1167
1102
  | {
@@ -1180,8 +1115,7 @@ declare const editorMachine: StateMachine<
1180
1115
  | {
1181
1116
  type: 'value changed'
1182
1117
  value: Array<PortableTextBlock> | undefined
1183
- }
1184
- | UnsetEvent,
1118
+ },
1185
1119
  MetaObject,
1186
1120
  {
1187
1121
  readonly id: 'editor'
@@ -1246,14 +1180,6 @@ declare const editorMachine: StateMachine<
1246
1180
  type: 'update readOnly'
1247
1181
  readOnly: boolean
1248
1182
  }
1249
- | {
1250
- type: 'update schema'
1251
- schema: EditorSchema
1252
- }
1253
- | {
1254
- type: 'update key generator'
1255
- keyGenerator: () => string
1256
- }
1257
1183
  | {
1258
1184
  type: 'update maxBlocks'
1259
1185
  maxBlocks: number | undefined
@@ -1277,6 +1203,10 @@ declare const editorMachine: StateMachine<
1277
1203
  | {
1278
1204
  type: 'normalizing'
1279
1205
  }
1206
+ | {
1207
+ type: 'update selection'
1208
+ selection: EditorSelection
1209
+ }
1280
1210
  | {
1281
1211
  type: 'done normalizing'
1282
1212
  }
@@ -1294,62 +1224,6 @@ declare const editorMachine: StateMachine<
1294
1224
  preventDefault: () => void
1295
1225
  }
1296
1226
  }
1297
- | {
1298
- type: 'notify.patch'
1299
- patch: Patch
1300
- }
1301
- | {
1302
- type: 'notify.mutation'
1303
- patches: Array<Patch>
1304
- snapshot: Array<PortableTextBlock> | undefined
1305
- value: Array<PortableTextBlock> | undefined
1306
- }
1307
- | {
1308
- type: 'notify.blurred'
1309
- event: FocusEvent_2<HTMLDivElement, Element>
1310
- }
1311
- | {
1312
- type: 'notify.done loading'
1313
- }
1314
- | {
1315
- type: 'notify.editable'
1316
- }
1317
- | {
1318
- type: 'notify.error'
1319
- name: string
1320
- description: string
1321
- data: unknown
1322
- }
1323
- | {
1324
- type: 'notify.focused'
1325
- event: FocusEvent_2<HTMLDivElement, Element>
1326
- }
1327
- | {
1328
- type: 'notify.invalid value'
1329
- resolution: InvalidValueResolution | null
1330
- value: Array<PortableTextBlock> | undefined
1331
- }
1332
- | {
1333
- type: 'notify.loading'
1334
- }
1335
- | {
1336
- type: 'notify.read only'
1337
- }
1338
- | {
1339
- type: 'notify.ready'
1340
- }
1341
- | {
1342
- type: 'notify.selection'
1343
- selection: EditorSelection
1344
- }
1345
- | {
1346
- type: 'notify.value changed'
1347
- value: Array<PortableTextBlock> | undefined
1348
- }
1349
- | {
1350
- type: 'notify.unset'
1351
- previousValue: Array<PortableTextBlock>
1352
- }
1353
1227
  | {
1354
1228
  type: 'dragstart'
1355
1229
  origin: Pick<EventPosition, 'selection'>
@@ -1375,14 +1249,6 @@ declare const editorMachine: StateMachine<
1375
1249
  type: 'update readOnly'
1376
1250
  readOnly: boolean
1377
1251
  }
1378
- | {
1379
- type: 'update schema'
1380
- schema: EditorSchema
1381
- }
1382
- | {
1383
- type: 'update key generator'
1384
- keyGenerator: () => string
1385
- }
1386
1252
  | {
1387
1253
  type: 'update maxBlocks'
1388
1254
  maxBlocks: number | undefined
@@ -1406,6 +1272,10 @@ declare const editorMachine: StateMachine<
1406
1272
  | {
1407
1273
  type: 'normalizing'
1408
1274
  }
1275
+ | {
1276
+ type: 'update selection'
1277
+ selection: EditorSelection
1278
+ }
1409
1279
  | {
1410
1280
  type: 'done normalizing'
1411
1281
  }
@@ -1423,62 +1293,6 @@ declare const editorMachine: StateMachine<
1423
1293
  preventDefault: () => void
1424
1294
  }
1425
1295
  }
1426
- | {
1427
- type: 'notify.patch'
1428
- patch: Patch
1429
- }
1430
- | {
1431
- type: 'notify.mutation'
1432
- patches: Array<Patch>
1433
- snapshot: Array<PortableTextBlock> | undefined
1434
- value: Array<PortableTextBlock> | undefined
1435
- }
1436
- | {
1437
- type: 'notify.blurred'
1438
- event: FocusEvent_2<HTMLDivElement, Element>
1439
- }
1440
- | {
1441
- type: 'notify.done loading'
1442
- }
1443
- | {
1444
- type: 'notify.editable'
1445
- }
1446
- | {
1447
- type: 'notify.error'
1448
- name: string
1449
- description: string
1450
- data: unknown
1451
- }
1452
- | {
1453
- type: 'notify.focused'
1454
- event: FocusEvent_2<HTMLDivElement, Element>
1455
- }
1456
- | {
1457
- type: 'notify.invalid value'
1458
- resolution: InvalidValueResolution | null
1459
- value: Array<PortableTextBlock> | undefined
1460
- }
1461
- | {
1462
- type: 'notify.loading'
1463
- }
1464
- | {
1465
- type: 'notify.read only'
1466
- }
1467
- | {
1468
- type: 'notify.ready'
1469
- }
1470
- | {
1471
- type: 'notify.selection'
1472
- selection: EditorSelection
1473
- }
1474
- | {
1475
- type: 'notify.value changed'
1476
- value: Array<PortableTextBlock> | undefined
1477
- }
1478
- | {
1479
- type: 'notify.unset'
1480
- previousValue: Array<PortableTextBlock>
1481
- }
1482
1296
  | {
1483
1297
  type: 'dragstart'
1484
1298
  origin: Pick<EventPosition, 'selection'>
@@ -1506,7 +1320,13 @@ declare const editorMachine: StateMachine<
1506
1320
  initialValue: PortableTextBlock[] | undefined
1507
1321
  }
1508
1322
  readonly on: {
1509
- readonly 'notify.blurred': {
1323
+ readonly 'add behavior': {
1324
+ readonly actions: 'add behavior to context'
1325
+ }
1326
+ readonly 'remove behavior': {
1327
+ readonly actions: 'remove behavior from context'
1328
+ }
1329
+ readonly 'update maxBlocks': {
1510
1330
  readonly actions: ActionFunction<
1511
1331
  {
1512
1332
  behaviors: Set<BehaviorConfig>
@@ -1527,8 +1347,8 @@ declare const editorMachine: StateMachine<
1527
1347
  slateEditor?: PortableTextSlateEditor
1528
1348
  },
1529
1349
  {
1530
- type: 'notify.blurred'
1531
- event: FocusEvent_2<HTMLDivElement, Element>
1350
+ type: 'update maxBlocks'
1351
+ maxBlocks: number | undefined
1532
1352
  },
1533
1353
  | InternalPatchEvent
1534
1354
  | MutationEvent
@@ -1537,14 +1357,6 @@ declare const editorMachine: StateMachine<
1537
1357
  type: 'update readOnly'
1538
1358
  readOnly: boolean
1539
1359
  }
1540
- | {
1541
- type: 'update schema'
1542
- schema: EditorSchema
1543
- }
1544
- | {
1545
- type: 'update key generator'
1546
- keyGenerator: () => string
1547
- }
1548
1360
  | {
1549
1361
  type: 'update maxBlocks'
1550
1362
  maxBlocks: number | undefined
@@ -1568,6 +1380,10 @@ declare const editorMachine: StateMachine<
1568
1380
  | {
1569
1381
  type: 'normalizing'
1570
1382
  }
1383
+ | {
1384
+ type: 'update selection'
1385
+ selection: EditorSelection
1386
+ }
1571
1387
  | {
1572
1388
  type: 'done normalizing'
1573
1389
  }
@@ -1585,62 +1401,6 @@ declare const editorMachine: StateMachine<
1585
1401
  preventDefault: () => void
1586
1402
  }
1587
1403
  }
1588
- | {
1589
- type: 'notify.patch'
1590
- patch: Patch
1591
- }
1592
- | {
1593
- type: 'notify.mutation'
1594
- patches: Array<Patch>
1595
- snapshot: Array<PortableTextBlock> | undefined
1596
- value: Array<PortableTextBlock> | undefined
1597
- }
1598
- | {
1599
- type: 'notify.blurred'
1600
- event: FocusEvent_2<HTMLDivElement, Element>
1601
- }
1602
- | {
1603
- type: 'notify.done loading'
1604
- }
1605
- | {
1606
- type: 'notify.editable'
1607
- }
1608
- | {
1609
- type: 'notify.error'
1610
- name: string
1611
- description: string
1612
- data: unknown
1613
- }
1614
- | {
1615
- type: 'notify.focused'
1616
- event: FocusEvent_2<HTMLDivElement, Element>
1617
- }
1618
- | {
1619
- type: 'notify.invalid value'
1620
- resolution: InvalidValueResolution | null
1621
- value: Array<PortableTextBlock> | undefined
1622
- }
1623
- | {
1624
- type: 'notify.loading'
1625
- }
1626
- | {
1627
- type: 'notify.read only'
1628
- }
1629
- | {
1630
- type: 'notify.ready'
1631
- }
1632
- | {
1633
- type: 'notify.selection'
1634
- selection: EditorSelection
1635
- }
1636
- | {
1637
- type: 'notify.value changed'
1638
- value: Array<PortableTextBlock> | undefined
1639
- }
1640
- | {
1641
- type: 'notify.unset'
1642
- previousValue: Array<PortableTextBlock>
1643
- }
1644
1404
  | {
1645
1405
  type: 'dragstart'
1646
1406
  origin: Pick<EventPosition, 'selection'>
@@ -1657,2126 +1417,104 @@ declare const editorMachine: StateMachine<
1657
1417
  never,
1658
1418
  never,
1659
1419
  never,
1660
- | PatchEvent
1661
- | InternalPatchEvent
1662
- | MutationEvent
1663
- | PatchesEvent
1664
- | {
1665
- type: 'blurred'
1666
- event: FocusEvent_2<HTMLDivElement, Element>
1667
- }
1668
- | {
1669
- type: 'done loading'
1670
- }
1671
- | {
1672
- type: 'editable'
1673
- }
1674
- | {
1675
- type: 'error'
1676
- name: string
1677
- description: string
1678
- data: unknown
1679
- }
1680
- | {
1681
- type: 'focused'
1682
- event: FocusEvent_2<HTMLDivElement, Element>
1683
- }
1684
- | {
1685
- type: 'invalid value'
1686
- resolution: InvalidValueResolution | null
1687
- value: Array<PortableTextBlock> | undefined
1688
- }
1689
- | {
1690
- type: 'loading'
1691
- }
1692
- | {
1693
- type: 'read only'
1694
- }
1695
- | {
1696
- type: 'ready'
1697
- }
1698
- | {
1699
- type: 'selection'
1700
- selection: EditorSelection
1701
- }
1702
- | {
1703
- type: 'value changed'
1704
- value: Array<PortableTextBlock> | undefined
1705
- }
1706
- | UnsetEvent
1420
+ never
1707
1421
  >
1708
1422
  }
1709
- readonly 'notify.done loading': {
1710
- readonly actions: ActionFunction<
1711
- {
1712
- behaviors: Set<BehaviorConfig>
1713
- converters: Set<Converter>
1714
- getLegacySchema: () => PortableTextMemberSchemaTypes
1715
- keyGenerator: () => string
1716
- pendingEvents: Array<InternalPatchEvent | MutationEvent>
1717
- pendingIncomingPatchesEvents: Array<PatchesEvent>
1718
- schema: EditorSchema
1719
- initialReadOnly: boolean
1720
- maxBlocks: number | undefined
1721
- selection: EditorSelection
1722
- initialValue: Array<PortableTextBlock> | undefined
1723
- internalDrag?: {
1724
- ghost?: HTMLElement
1725
- origin: Pick<EventPosition, 'selection'>
1726
- }
1727
- slateEditor?: PortableTextSlateEditor
1728
- },
1729
- {
1730
- type: 'notify.done loading'
1731
- },
1732
- | InternalPatchEvent
1733
- | MutationEvent
1734
- | PatchesEvent
1735
- | {
1736
- type: 'update readOnly'
1737
- readOnly: boolean
1738
- }
1739
- | {
1740
- type: 'update schema'
1741
- schema: EditorSchema
1742
- }
1743
- | {
1744
- type: 'update key generator'
1423
+ readonly 'update selection': {
1424
+ readonly actions: readonly [
1425
+ ActionFunction<
1426
+ {
1427
+ behaviors: Set<BehaviorConfig>
1428
+ converters: Set<Converter>
1429
+ getLegacySchema: () => PortableTextMemberSchemaTypes
1745
1430
  keyGenerator: () => string
1746
- }
1747
- | {
1748
- type: 'update maxBlocks'
1749
- maxBlocks: number | undefined
1750
- }
1751
- | {
1752
- type: 'add behavior'
1753
- behaviorConfig: BehaviorConfig
1754
- }
1755
- | {
1756
- type: 'remove behavior'
1757
- behaviorConfig: BehaviorConfig
1758
- }
1759
- | {
1760
- type: 'blur'
1761
- editor: PortableTextSlateEditor
1762
- }
1763
- | {
1764
- type: 'focus'
1765
- editor: PortableTextSlateEditor
1766
- }
1767
- | {
1768
- type: 'normalizing'
1769
- }
1770
- | {
1771
- type: 'done normalizing'
1772
- }
1773
- | {
1774
- type: 'done syncing value'
1775
- }
1776
- | {
1777
- type: 'syncing value'
1778
- }
1779
- | {
1780
- type: 'behavior event'
1781
- behaviorEvent: BehaviorEvent
1782
- editor: PortableTextSlateEditor
1783
- nativeEvent?: {
1784
- preventDefault: () => void
1785
- }
1786
- }
1787
- | {
1788
- type: 'notify.patch'
1789
- patch: Patch
1790
- }
1791
- | {
1792
- type: 'notify.mutation'
1793
- patches: Array<Patch>
1794
- snapshot: Array<PortableTextBlock> | undefined
1795
- value: Array<PortableTextBlock> | undefined
1796
- }
1797
- | {
1798
- type: 'notify.blurred'
1799
- event: FocusEvent_2<HTMLDivElement, Element>
1800
- }
1801
- | {
1802
- type: 'notify.done loading'
1803
- }
1804
- | {
1805
- type: 'notify.editable'
1806
- }
1807
- | {
1808
- type: 'notify.error'
1809
- name: string
1810
- description: string
1811
- data: unknown
1812
- }
1813
- | {
1814
- type: 'notify.focused'
1815
- event: FocusEvent_2<HTMLDivElement, Element>
1816
- }
1817
- | {
1818
- type: 'notify.invalid value'
1819
- resolution: InvalidValueResolution | null
1820
- value: Array<PortableTextBlock> | undefined
1821
- }
1822
- | {
1823
- type: 'notify.loading'
1824
- }
1825
- | {
1826
- type: 'notify.read only'
1827
- }
1828
- | {
1829
- type: 'notify.ready'
1830
- }
1831
- | {
1832
- type: 'notify.selection'
1833
- selection: EditorSelection
1834
- }
1835
- | {
1836
- type: 'notify.value changed'
1837
- value: Array<PortableTextBlock> | undefined
1838
- }
1839
- | {
1840
- type: 'notify.unset'
1841
- previousValue: Array<PortableTextBlock>
1842
- }
1843
- | {
1844
- type: 'dragstart'
1845
- origin: Pick<EventPosition, 'selection'>
1846
- ghost?: HTMLElement
1847
- }
1848
- | {
1849
- type: 'dragend'
1850
- }
1851
- | {
1852
- type: 'drop'
1853
- },
1854
- undefined,
1855
- never,
1856
- never,
1857
- never,
1858
- never,
1859
- | PatchEvent
1860
- | InternalPatchEvent
1861
- | MutationEvent
1862
- | PatchesEvent
1863
- | {
1864
- type: 'blurred'
1865
- event: FocusEvent_2<HTMLDivElement, Element>
1866
- }
1867
- | {
1868
- type: 'done loading'
1869
- }
1870
- | {
1871
- type: 'editable'
1872
- }
1873
- | {
1874
- type: 'error'
1875
- name: string
1876
- description: string
1877
- data: unknown
1878
- }
1879
- | {
1880
- type: 'focused'
1881
- event: FocusEvent_2<HTMLDivElement, Element>
1882
- }
1883
- | {
1884
- type: 'invalid value'
1885
- resolution: InvalidValueResolution | null
1886
- value: Array<PortableTextBlock> | undefined
1887
- }
1888
- | {
1889
- type: 'loading'
1890
- }
1891
- | {
1892
- type: 'read only'
1893
- }
1894
- | {
1895
- type: 'ready'
1896
- }
1897
- | {
1898
- type: 'selection'
1899
- selection: EditorSelection
1900
- }
1901
- | {
1902
- type: 'value changed'
1903
- value: Array<PortableTextBlock> | undefined
1904
- }
1905
- | UnsetEvent
1906
- >
1907
- }
1908
- readonly 'notify.error': {
1909
- readonly actions: ActionFunction<
1910
- {
1911
- behaviors: Set<BehaviorConfig>
1912
- converters: Set<Converter>
1913
- getLegacySchema: () => PortableTextMemberSchemaTypes
1914
- keyGenerator: () => string
1915
- pendingEvents: Array<InternalPatchEvent | MutationEvent>
1916
- pendingIncomingPatchesEvents: Array<PatchesEvent>
1917
- schema: EditorSchema
1918
- initialReadOnly: boolean
1919
- maxBlocks: number | undefined
1920
- selection: EditorSelection
1921
- initialValue: Array<PortableTextBlock> | undefined
1922
- internalDrag?: {
1923
- ghost?: HTMLElement
1924
- origin: Pick<EventPosition, 'selection'>
1925
- }
1926
- slateEditor?: PortableTextSlateEditor
1927
- },
1928
- {
1929
- type: 'notify.error'
1930
- name: string
1931
- description: string
1932
- data: unknown
1933
- },
1934
- | InternalPatchEvent
1935
- | MutationEvent
1936
- | PatchesEvent
1937
- | {
1938
- type: 'update readOnly'
1939
- readOnly: boolean
1940
- }
1941
- | {
1942
- type: 'update schema'
1943
- schema: EditorSchema
1944
- }
1945
- | {
1946
- type: 'update key generator'
1947
- keyGenerator: () => string
1948
- }
1949
- | {
1950
- type: 'update maxBlocks'
1951
- maxBlocks: number | undefined
1952
- }
1953
- | {
1954
- type: 'add behavior'
1955
- behaviorConfig: BehaviorConfig
1956
- }
1957
- | {
1958
- type: 'remove behavior'
1959
- behaviorConfig: BehaviorConfig
1960
- }
1961
- | {
1962
- type: 'blur'
1963
- editor: PortableTextSlateEditor
1964
- }
1965
- | {
1966
- type: 'focus'
1967
- editor: PortableTextSlateEditor
1968
- }
1969
- | {
1970
- type: 'normalizing'
1971
- }
1972
- | {
1973
- type: 'done normalizing'
1974
- }
1975
- | {
1976
- type: 'done syncing value'
1977
- }
1978
- | {
1979
- type: 'syncing value'
1980
- }
1981
- | {
1982
- type: 'behavior event'
1983
- behaviorEvent: BehaviorEvent
1984
- editor: PortableTextSlateEditor
1985
- nativeEvent?: {
1986
- preventDefault: () => void
1987
- }
1988
- }
1989
- | {
1990
- type: 'notify.patch'
1991
- patch: Patch
1992
- }
1993
- | {
1994
- type: 'notify.mutation'
1995
- patches: Array<Patch>
1996
- snapshot: Array<PortableTextBlock> | undefined
1997
- value: Array<PortableTextBlock> | undefined
1998
- }
1999
- | {
2000
- type: 'notify.blurred'
2001
- event: FocusEvent_2<HTMLDivElement, Element>
2002
- }
2003
- | {
2004
- type: 'notify.done loading'
2005
- }
2006
- | {
2007
- type: 'notify.editable'
2008
- }
2009
- | {
2010
- type: 'notify.error'
2011
- name: string
2012
- description: string
2013
- data: unknown
2014
- }
2015
- | {
2016
- type: 'notify.focused'
2017
- event: FocusEvent_2<HTMLDivElement, Element>
2018
- }
2019
- | {
2020
- type: 'notify.invalid value'
2021
- resolution: InvalidValueResolution | null
2022
- value: Array<PortableTextBlock> | undefined
2023
- }
2024
- | {
2025
- type: 'notify.loading'
2026
- }
2027
- | {
2028
- type: 'notify.read only'
2029
- }
2030
- | {
2031
- type: 'notify.ready'
2032
- }
2033
- | {
2034
- type: 'notify.selection'
2035
- selection: EditorSelection
2036
- }
2037
- | {
2038
- type: 'notify.value changed'
2039
- value: Array<PortableTextBlock> | undefined
2040
- }
2041
- | {
2042
- type: 'notify.unset'
2043
- previousValue: Array<PortableTextBlock>
2044
- }
2045
- | {
2046
- type: 'dragstart'
2047
- origin: Pick<EventPosition, 'selection'>
2048
- ghost?: HTMLElement
2049
- }
2050
- | {
2051
- type: 'dragend'
2052
- }
2053
- | {
2054
- type: 'drop'
2055
- },
2056
- undefined,
2057
- never,
2058
- never,
2059
- never,
2060
- never,
2061
- | PatchEvent
2062
- | InternalPatchEvent
2063
- | MutationEvent
2064
- | PatchesEvent
2065
- | {
2066
- type: 'blurred'
2067
- event: FocusEvent_2<HTMLDivElement, Element>
2068
- }
2069
- | {
2070
- type: 'done loading'
2071
- }
2072
- | {
2073
- type: 'editable'
2074
- }
2075
- | {
2076
- type: 'error'
2077
- name: string
2078
- description: string
2079
- data: unknown
2080
- }
2081
- | {
2082
- type: 'focused'
2083
- event: FocusEvent_2<HTMLDivElement, Element>
2084
- }
2085
- | {
2086
- type: 'invalid value'
2087
- resolution: InvalidValueResolution | null
2088
- value: Array<PortableTextBlock> | undefined
2089
- }
2090
- | {
2091
- type: 'loading'
2092
- }
2093
- | {
2094
- type: 'read only'
2095
- }
2096
- | {
2097
- type: 'ready'
2098
- }
2099
- | {
2100
- type: 'selection'
2101
- selection: EditorSelection
2102
- }
2103
- | {
2104
- type: 'value changed'
2105
- value: Array<PortableTextBlock> | undefined
2106
- }
2107
- | UnsetEvent
2108
- >
2109
- }
2110
- readonly 'notify.invalid value': {
2111
- readonly actions: ActionFunction<
2112
- {
2113
- behaviors: Set<BehaviorConfig>
2114
- converters: Set<Converter>
2115
- getLegacySchema: () => PortableTextMemberSchemaTypes
2116
- keyGenerator: () => string
2117
- pendingEvents: Array<InternalPatchEvent | MutationEvent>
2118
- pendingIncomingPatchesEvents: Array<PatchesEvent>
2119
- schema: EditorSchema
2120
- initialReadOnly: boolean
2121
- maxBlocks: number | undefined
2122
- selection: EditorSelection
2123
- initialValue: Array<PortableTextBlock> | undefined
2124
- internalDrag?: {
2125
- ghost?: HTMLElement
2126
- origin: Pick<EventPosition, 'selection'>
2127
- }
2128
- slateEditor?: PortableTextSlateEditor
2129
- },
2130
- {
2131
- type: 'notify.invalid value'
2132
- resolution: InvalidValueResolution | null
2133
- value: Array<PortableTextBlock> | undefined
2134
- },
2135
- | InternalPatchEvent
2136
- | MutationEvent
2137
- | PatchesEvent
2138
- | {
2139
- type: 'update readOnly'
2140
- readOnly: boolean
2141
- }
2142
- | {
2143
- type: 'update schema'
2144
- schema: EditorSchema
2145
- }
2146
- | {
2147
- type: 'update key generator'
2148
- keyGenerator: () => string
2149
- }
2150
- | {
2151
- type: 'update maxBlocks'
2152
- maxBlocks: number | undefined
2153
- }
2154
- | {
2155
- type: 'add behavior'
2156
- behaviorConfig: BehaviorConfig
2157
- }
2158
- | {
2159
- type: 'remove behavior'
2160
- behaviorConfig: BehaviorConfig
2161
- }
2162
- | {
2163
- type: 'blur'
2164
- editor: PortableTextSlateEditor
2165
- }
2166
- | {
2167
- type: 'focus'
2168
- editor: PortableTextSlateEditor
2169
- }
2170
- | {
2171
- type: 'normalizing'
2172
- }
2173
- | {
2174
- type: 'done normalizing'
2175
- }
2176
- | {
2177
- type: 'done syncing value'
2178
- }
2179
- | {
2180
- type: 'syncing value'
2181
- }
2182
- | {
2183
- type: 'behavior event'
2184
- behaviorEvent: BehaviorEvent
2185
- editor: PortableTextSlateEditor
2186
- nativeEvent?: {
2187
- preventDefault: () => void
2188
- }
2189
- }
2190
- | {
2191
- type: 'notify.patch'
2192
- patch: Patch
2193
- }
2194
- | {
2195
- type: 'notify.mutation'
2196
- patches: Array<Patch>
2197
- snapshot: Array<PortableTextBlock> | undefined
2198
- value: Array<PortableTextBlock> | undefined
2199
- }
2200
- | {
2201
- type: 'notify.blurred'
2202
- event: FocusEvent_2<HTMLDivElement, Element>
2203
- }
2204
- | {
2205
- type: 'notify.done loading'
2206
- }
2207
- | {
2208
- type: 'notify.editable'
2209
- }
2210
- | {
2211
- type: 'notify.error'
2212
- name: string
2213
- description: string
2214
- data: unknown
2215
- }
2216
- | {
2217
- type: 'notify.focused'
2218
- event: FocusEvent_2<HTMLDivElement, Element>
2219
- }
2220
- | {
2221
- type: 'notify.invalid value'
2222
- resolution: InvalidValueResolution | null
2223
- value: Array<PortableTextBlock> | undefined
2224
- }
2225
- | {
2226
- type: 'notify.loading'
2227
- }
2228
- | {
2229
- type: 'notify.read only'
2230
- }
2231
- | {
2232
- type: 'notify.ready'
2233
- }
2234
- | {
2235
- type: 'notify.selection'
2236
- selection: EditorSelection
2237
- }
2238
- | {
2239
- type: 'notify.value changed'
2240
- value: Array<PortableTextBlock> | undefined
2241
- }
2242
- | {
2243
- type: 'notify.unset'
2244
- previousValue: Array<PortableTextBlock>
2245
- }
2246
- | {
2247
- type: 'dragstart'
2248
- origin: Pick<EventPosition, 'selection'>
2249
- ghost?: HTMLElement
2250
- }
2251
- | {
2252
- type: 'dragend'
2253
- }
2254
- | {
2255
- type: 'drop'
2256
- },
2257
- undefined,
2258
- never,
2259
- never,
2260
- never,
2261
- never,
2262
- | PatchEvent
2263
- | InternalPatchEvent
2264
- | MutationEvent
2265
- | PatchesEvent
2266
- | {
2267
- type: 'blurred'
2268
- event: FocusEvent_2<HTMLDivElement, Element>
2269
- }
2270
- | {
2271
- type: 'done loading'
2272
- }
2273
- | {
2274
- type: 'editable'
2275
- }
2276
- | {
2277
- type: 'error'
2278
- name: string
2279
- description: string
2280
- data: unknown
2281
- }
2282
- | {
2283
- type: 'focused'
2284
- event: FocusEvent_2<HTMLDivElement, Element>
2285
- }
2286
- | {
2287
- type: 'invalid value'
2288
- resolution: InvalidValueResolution | null
2289
- value: Array<PortableTextBlock> | undefined
2290
- }
2291
- | {
2292
- type: 'loading'
2293
- }
2294
- | {
2295
- type: 'read only'
2296
- }
2297
- | {
2298
- type: 'ready'
2299
- }
2300
- | {
2301
- type: 'selection'
2302
- selection: EditorSelection
2303
- }
2304
- | {
2305
- type: 'value changed'
2306
- value: Array<PortableTextBlock> | undefined
2307
- }
2308
- | UnsetEvent
2309
- >
2310
- }
2311
- readonly 'notify.focused': {
2312
- readonly actions: ActionFunction<
2313
- {
2314
- behaviors: Set<BehaviorConfig>
2315
- converters: Set<Converter>
2316
- getLegacySchema: () => PortableTextMemberSchemaTypes
2317
- keyGenerator: () => string
2318
- pendingEvents: Array<InternalPatchEvent | MutationEvent>
2319
- pendingIncomingPatchesEvents: Array<PatchesEvent>
2320
- schema: EditorSchema
2321
- initialReadOnly: boolean
2322
- maxBlocks: number | undefined
2323
- selection: EditorSelection
2324
- initialValue: Array<PortableTextBlock> | undefined
2325
- internalDrag?: {
2326
- ghost?: HTMLElement
2327
- origin: Pick<EventPosition, 'selection'>
2328
- }
2329
- slateEditor?: PortableTextSlateEditor
2330
- },
2331
- {
2332
- type: 'notify.focused'
2333
- event: FocusEvent_2<HTMLDivElement, Element>
2334
- },
2335
- | InternalPatchEvent
2336
- | MutationEvent
2337
- | PatchesEvent
2338
- | {
2339
- type: 'update readOnly'
2340
- readOnly: boolean
2341
- }
2342
- | {
2343
- type: 'update schema'
2344
- schema: EditorSchema
2345
- }
2346
- | {
2347
- type: 'update key generator'
2348
- keyGenerator: () => string
2349
- }
2350
- | {
2351
- type: 'update maxBlocks'
2352
- maxBlocks: number | undefined
2353
- }
2354
- | {
2355
- type: 'add behavior'
2356
- behaviorConfig: BehaviorConfig
2357
- }
2358
- | {
2359
- type: 'remove behavior'
2360
- behaviorConfig: BehaviorConfig
2361
- }
2362
- | {
2363
- type: 'blur'
2364
- editor: PortableTextSlateEditor
2365
- }
2366
- | {
2367
- type: 'focus'
2368
- editor: PortableTextSlateEditor
2369
- }
2370
- | {
2371
- type: 'normalizing'
2372
- }
2373
- | {
2374
- type: 'done normalizing'
2375
- }
2376
- | {
2377
- type: 'done syncing value'
2378
- }
2379
- | {
2380
- type: 'syncing value'
2381
- }
2382
- | {
2383
- type: 'behavior event'
2384
- behaviorEvent: BehaviorEvent
2385
- editor: PortableTextSlateEditor
2386
- nativeEvent?: {
2387
- preventDefault: () => void
2388
- }
2389
- }
2390
- | {
2391
- type: 'notify.patch'
2392
- patch: Patch
2393
- }
2394
- | {
2395
- type: 'notify.mutation'
2396
- patches: Array<Patch>
2397
- snapshot: Array<PortableTextBlock> | undefined
2398
- value: Array<PortableTextBlock> | undefined
2399
- }
2400
- | {
2401
- type: 'notify.blurred'
2402
- event: FocusEvent_2<HTMLDivElement, Element>
2403
- }
2404
- | {
2405
- type: 'notify.done loading'
2406
- }
2407
- | {
2408
- type: 'notify.editable'
2409
- }
2410
- | {
2411
- type: 'notify.error'
2412
- name: string
2413
- description: string
2414
- data: unknown
2415
- }
2416
- | {
2417
- type: 'notify.focused'
2418
- event: FocusEvent_2<HTMLDivElement, Element>
2419
- }
2420
- | {
2421
- type: 'notify.invalid value'
2422
- resolution: InvalidValueResolution | null
2423
- value: Array<PortableTextBlock> | undefined
2424
- }
2425
- | {
2426
- type: 'notify.loading'
2427
- }
2428
- | {
2429
- type: 'notify.read only'
2430
- }
2431
- | {
2432
- type: 'notify.ready'
2433
- }
2434
- | {
2435
- type: 'notify.selection'
2436
- selection: EditorSelection
2437
- }
2438
- | {
2439
- type: 'notify.value changed'
2440
- value: Array<PortableTextBlock> | undefined
2441
- }
2442
- | {
2443
- type: 'notify.unset'
2444
- previousValue: Array<PortableTextBlock>
2445
- }
2446
- | {
2447
- type: 'dragstart'
2448
- origin: Pick<EventPosition, 'selection'>
2449
- ghost?: HTMLElement
2450
- }
2451
- | {
2452
- type: 'dragend'
2453
- }
2454
- | {
2455
- type: 'drop'
2456
- },
2457
- undefined,
2458
- never,
2459
- never,
2460
- never,
2461
- never,
2462
- | PatchEvent
2463
- | InternalPatchEvent
2464
- | MutationEvent
2465
- | PatchesEvent
2466
- | {
2467
- type: 'blurred'
2468
- event: FocusEvent_2<HTMLDivElement, Element>
2469
- }
2470
- | {
2471
- type: 'done loading'
2472
- }
2473
- | {
2474
- type: 'editable'
2475
- }
2476
- | {
2477
- type: 'error'
2478
- name: string
2479
- description: string
2480
- data: unknown
2481
- }
2482
- | {
2483
- type: 'focused'
2484
- event: FocusEvent_2<HTMLDivElement, Element>
2485
- }
2486
- | {
2487
- type: 'invalid value'
2488
- resolution: InvalidValueResolution | null
2489
- value: Array<PortableTextBlock> | undefined
2490
- }
2491
- | {
2492
- type: 'loading'
2493
- }
2494
- | {
2495
- type: 'read only'
2496
- }
2497
- | {
2498
- type: 'ready'
2499
- }
2500
- | {
2501
- type: 'selection'
2502
- selection: EditorSelection
2503
- }
2504
- | {
2505
- type: 'value changed'
2506
- value: Array<PortableTextBlock> | undefined
2507
- }
2508
- | UnsetEvent
2509
- >
2510
- }
2511
- readonly 'notify.selection': {
2512
- readonly actions: readonly [
2513
- ActionFunction<
2514
- {
2515
- behaviors: Set<BehaviorConfig>
2516
- converters: Set<Converter>
2517
- getLegacySchema: () => PortableTextMemberSchemaTypes
2518
- keyGenerator: () => string
2519
- pendingEvents: Array<InternalPatchEvent | MutationEvent>
2520
- pendingIncomingPatchesEvents: Array<PatchesEvent>
2521
- schema: EditorSchema
2522
- initialReadOnly: boolean
2523
- maxBlocks: number | undefined
2524
- selection: EditorSelection
2525
- initialValue: Array<PortableTextBlock> | undefined
2526
- internalDrag?: {
2527
- ghost?: HTMLElement
2528
- origin: Pick<EventPosition, 'selection'>
2529
- }
2530
- slateEditor?: PortableTextSlateEditor
2531
- },
2532
- {
2533
- type: 'notify.selection'
2534
- selection: EditorSelection
2535
- },
2536
- | InternalPatchEvent
2537
- | MutationEvent
2538
- | PatchesEvent
2539
- | {
2540
- type: 'update readOnly'
2541
- readOnly: boolean
2542
- }
2543
- | {
2544
- type: 'update schema'
2545
- schema: EditorSchema
2546
- }
2547
- | {
2548
- type: 'update key generator'
2549
- keyGenerator: () => string
2550
- }
2551
- | {
2552
- type: 'update maxBlocks'
2553
- maxBlocks: number | undefined
2554
- }
2555
- | {
2556
- type: 'add behavior'
2557
- behaviorConfig: BehaviorConfig
2558
- }
2559
- | {
2560
- type: 'remove behavior'
2561
- behaviorConfig: BehaviorConfig
2562
- }
2563
- | {
2564
- type: 'blur'
2565
- editor: PortableTextSlateEditor
2566
- }
2567
- | {
2568
- type: 'focus'
2569
- editor: PortableTextSlateEditor
2570
- }
2571
- | {
2572
- type: 'normalizing'
2573
- }
2574
- | {
2575
- type: 'done normalizing'
2576
- }
2577
- | {
2578
- type: 'done syncing value'
2579
- }
2580
- | {
2581
- type: 'syncing value'
2582
- }
2583
- | {
2584
- type: 'behavior event'
2585
- behaviorEvent: BehaviorEvent
2586
- editor: PortableTextSlateEditor
2587
- nativeEvent?: {
2588
- preventDefault: () => void
2589
- }
2590
- }
2591
- | {
2592
- type: 'notify.patch'
2593
- patch: Patch
2594
- }
2595
- | {
2596
- type: 'notify.mutation'
2597
- patches: Array<Patch>
2598
- snapshot: Array<PortableTextBlock> | undefined
2599
- value: Array<PortableTextBlock> | undefined
2600
- }
2601
- | {
2602
- type: 'notify.blurred'
2603
- event: FocusEvent_2<HTMLDivElement, Element>
2604
- }
2605
- | {
2606
- type: 'notify.done loading'
2607
- }
2608
- | {
2609
- type: 'notify.editable'
2610
- }
2611
- | {
2612
- type: 'notify.error'
2613
- name: string
2614
- description: string
2615
- data: unknown
2616
- }
2617
- | {
2618
- type: 'notify.focused'
2619
- event: FocusEvent_2<HTMLDivElement, Element>
2620
- }
2621
- | {
2622
- type: 'notify.invalid value'
2623
- resolution: InvalidValueResolution | null
2624
- value: Array<PortableTextBlock> | undefined
2625
- }
2626
- | {
2627
- type: 'notify.loading'
2628
- }
2629
- | {
2630
- type: 'notify.read only'
2631
- }
2632
- | {
2633
- type: 'notify.ready'
2634
- }
2635
- | {
2636
- type: 'notify.selection'
2637
- selection: EditorSelection
2638
- }
2639
- | {
2640
- type: 'notify.value changed'
2641
- value: Array<PortableTextBlock> | undefined
2642
- }
2643
- | {
2644
- type: 'notify.unset'
2645
- previousValue: Array<PortableTextBlock>
2646
- }
2647
- | {
2648
- type: 'dragstart'
2649
- origin: Pick<EventPosition, 'selection'>
2650
- ghost?: HTMLElement
2651
- }
2652
- | {
2653
- type: 'dragend'
2654
- }
2655
- | {
2656
- type: 'drop'
2657
- },
2658
- undefined,
2659
- never,
2660
- never,
2661
- never,
2662
- never,
2663
- never
2664
- >,
2665
- ActionFunction<
2666
- {
2667
- behaviors: Set<BehaviorConfig>
2668
- converters: Set<Converter>
2669
- getLegacySchema: () => PortableTextMemberSchemaTypes
2670
- keyGenerator: () => string
2671
- pendingEvents: Array<InternalPatchEvent | MutationEvent>
2672
- pendingIncomingPatchesEvents: Array<PatchesEvent>
2673
- schema: EditorSchema
2674
- initialReadOnly: boolean
2675
- maxBlocks: number | undefined
2676
- selection: EditorSelection
2677
- initialValue: Array<PortableTextBlock> | undefined
2678
- internalDrag?: {
2679
- ghost?: HTMLElement
2680
- origin: Pick<EventPosition, 'selection'>
2681
- }
2682
- slateEditor?: PortableTextSlateEditor
2683
- },
2684
- {
2685
- type: 'notify.selection'
2686
- selection: EditorSelection
2687
- },
2688
- | InternalPatchEvent
2689
- | MutationEvent
2690
- | PatchesEvent
2691
- | {
2692
- type: 'update readOnly'
2693
- readOnly: boolean
2694
- }
2695
- | {
2696
- type: 'update schema'
2697
- schema: EditorSchema
2698
- }
2699
- | {
2700
- type: 'update key generator'
2701
- keyGenerator: () => string
2702
- }
2703
- | {
2704
- type: 'update maxBlocks'
2705
- maxBlocks: number | undefined
2706
- }
2707
- | {
2708
- type: 'add behavior'
2709
- behaviorConfig: BehaviorConfig
2710
- }
2711
- | {
2712
- type: 'remove behavior'
2713
- behaviorConfig: BehaviorConfig
2714
- }
2715
- | {
2716
- type: 'blur'
2717
- editor: PortableTextSlateEditor
2718
- }
2719
- | {
2720
- type: 'focus'
2721
- editor: PortableTextSlateEditor
2722
- }
2723
- | {
2724
- type: 'normalizing'
2725
- }
2726
- | {
2727
- type: 'done normalizing'
2728
- }
2729
- | {
2730
- type: 'done syncing value'
2731
- }
2732
- | {
2733
- type: 'syncing value'
2734
- }
2735
- | {
2736
- type: 'behavior event'
2737
- behaviorEvent: BehaviorEvent
2738
- editor: PortableTextSlateEditor
2739
- nativeEvent?: {
2740
- preventDefault: () => void
2741
- }
2742
- }
2743
- | {
2744
- type: 'notify.patch'
2745
- patch: Patch
2746
- }
2747
- | {
2748
- type: 'notify.mutation'
2749
- patches: Array<Patch>
2750
- snapshot: Array<PortableTextBlock> | undefined
2751
- value: Array<PortableTextBlock> | undefined
2752
- }
2753
- | {
2754
- type: 'notify.blurred'
2755
- event: FocusEvent_2<HTMLDivElement, Element>
2756
- }
2757
- | {
2758
- type: 'notify.done loading'
2759
- }
2760
- | {
2761
- type: 'notify.editable'
2762
- }
2763
- | {
2764
- type: 'notify.error'
2765
- name: string
2766
- description: string
2767
- data: unknown
2768
- }
2769
- | {
2770
- type: 'notify.focused'
2771
- event: FocusEvent_2<HTMLDivElement, Element>
2772
- }
2773
- | {
2774
- type: 'notify.invalid value'
2775
- resolution: InvalidValueResolution | null
2776
- value: Array<PortableTextBlock> | undefined
2777
- }
2778
- | {
2779
- type: 'notify.loading'
2780
- }
2781
- | {
2782
- type: 'notify.read only'
2783
- }
2784
- | {
2785
- type: 'notify.ready'
2786
- }
2787
- | {
2788
- type: 'notify.selection'
2789
- selection: EditorSelection
2790
- }
2791
- | {
2792
- type: 'notify.value changed'
2793
- value: Array<PortableTextBlock> | undefined
2794
- }
2795
- | {
2796
- type: 'notify.unset'
2797
- previousValue: Array<PortableTextBlock>
2798
- }
2799
- | {
2800
- type: 'dragstart'
2801
- origin: Pick<EventPosition, 'selection'>
2802
- ghost?: HTMLElement
2803
- }
2804
- | {
2805
- type: 'dragend'
2806
- }
2807
- | {
2808
- type: 'drop'
2809
- },
2810
- undefined,
2811
- never,
2812
- never,
2813
- never,
2814
- never,
2815
- | PatchEvent
2816
- | InternalPatchEvent
2817
- | MutationEvent
2818
- | PatchesEvent
2819
- | {
2820
- type: 'blurred'
2821
- event: FocusEvent_2<HTMLDivElement, Element>
2822
- }
2823
- | {
2824
- type: 'done loading'
2825
- }
2826
- | {
2827
- type: 'editable'
2828
- }
2829
- | {
2830
- type: 'error'
2831
- name: string
2832
- description: string
2833
- data: unknown
2834
- }
2835
- | {
2836
- type: 'focused'
2837
- event: FocusEvent_2<HTMLDivElement, Element>
2838
- }
2839
- | {
2840
- type: 'invalid value'
2841
- resolution: InvalidValueResolution | null
2842
- value: Array<PortableTextBlock> | undefined
2843
- }
2844
- | {
2845
- type: 'loading'
2846
- }
2847
- | {
2848
- type: 'read only'
2849
- }
2850
- | {
2851
- type: 'ready'
2852
- }
2853
- | {
2854
- type: 'selection'
2855
- selection: EditorSelection
2856
- }
2857
- | {
2858
- type: 'value changed'
2859
- value: Array<PortableTextBlock> | undefined
2860
- }
2861
- | UnsetEvent
2862
- >,
2863
- ]
2864
- }
2865
- readonly 'notify.unset': {
2866
- readonly actions: ActionFunction<
2867
- {
2868
- behaviors: Set<BehaviorConfig>
2869
- converters: Set<Converter>
2870
- getLegacySchema: () => PortableTextMemberSchemaTypes
2871
- keyGenerator: () => string
2872
- pendingEvents: Array<InternalPatchEvent | MutationEvent>
2873
- pendingIncomingPatchesEvents: Array<PatchesEvent>
2874
- schema: EditorSchema
2875
- initialReadOnly: boolean
2876
- maxBlocks: number | undefined
2877
- selection: EditorSelection
2878
- initialValue: Array<PortableTextBlock> | undefined
2879
- internalDrag?: {
2880
- ghost?: HTMLElement
2881
- origin: Pick<EventPosition, 'selection'>
2882
- }
2883
- slateEditor?: PortableTextSlateEditor
2884
- },
2885
- {
2886
- type: 'notify.unset'
2887
- previousValue: Array<PortableTextBlock>
2888
- },
2889
- | InternalPatchEvent
2890
- | MutationEvent
2891
- | PatchesEvent
2892
- | {
2893
- type: 'update readOnly'
2894
- readOnly: boolean
2895
- }
2896
- | {
2897
- type: 'update schema'
2898
- schema: EditorSchema
2899
- }
2900
- | {
2901
- type: 'update key generator'
2902
- keyGenerator: () => string
2903
- }
2904
- | {
2905
- type: 'update maxBlocks'
2906
- maxBlocks: number | undefined
2907
- }
2908
- | {
2909
- type: 'add behavior'
2910
- behaviorConfig: BehaviorConfig
2911
- }
2912
- | {
2913
- type: 'remove behavior'
2914
- behaviorConfig: BehaviorConfig
2915
- }
2916
- | {
2917
- type: 'blur'
2918
- editor: PortableTextSlateEditor
2919
- }
2920
- | {
2921
- type: 'focus'
2922
- editor: PortableTextSlateEditor
2923
- }
2924
- | {
2925
- type: 'normalizing'
2926
- }
2927
- | {
2928
- type: 'done normalizing'
2929
- }
2930
- | {
2931
- type: 'done syncing value'
2932
- }
2933
- | {
2934
- type: 'syncing value'
2935
- }
2936
- | {
2937
- type: 'behavior event'
2938
- behaviorEvent: BehaviorEvent
2939
- editor: PortableTextSlateEditor
2940
- nativeEvent?: {
2941
- preventDefault: () => void
2942
- }
2943
- }
2944
- | {
2945
- type: 'notify.patch'
2946
- patch: Patch
2947
- }
2948
- | {
2949
- type: 'notify.mutation'
2950
- patches: Array<Patch>
2951
- snapshot: Array<PortableTextBlock> | undefined
2952
- value: Array<PortableTextBlock> | undefined
2953
- }
2954
- | {
2955
- type: 'notify.blurred'
2956
- event: FocusEvent_2<HTMLDivElement, Element>
2957
- }
2958
- | {
2959
- type: 'notify.done loading'
2960
- }
2961
- | {
2962
- type: 'notify.editable'
2963
- }
2964
- | {
2965
- type: 'notify.error'
2966
- name: string
2967
- description: string
2968
- data: unknown
2969
- }
2970
- | {
2971
- type: 'notify.focused'
2972
- event: FocusEvent_2<HTMLDivElement, Element>
2973
- }
2974
- | {
2975
- type: 'notify.invalid value'
2976
- resolution: InvalidValueResolution | null
2977
- value: Array<PortableTextBlock> | undefined
2978
- }
2979
- | {
2980
- type: 'notify.loading'
2981
- }
2982
- | {
2983
- type: 'notify.read only'
2984
- }
2985
- | {
2986
- type: 'notify.ready'
2987
- }
2988
- | {
2989
- type: 'notify.selection'
2990
- selection: EditorSelection
2991
- }
2992
- | {
2993
- type: 'notify.value changed'
2994
- value: Array<PortableTextBlock> | undefined
2995
- }
2996
- | {
2997
- type: 'notify.unset'
2998
- previousValue: Array<PortableTextBlock>
2999
- }
3000
- | {
3001
- type: 'dragstart'
3002
- origin: Pick<EventPosition, 'selection'>
3003
- ghost?: HTMLElement
3004
- }
3005
- | {
3006
- type: 'dragend'
3007
- }
3008
- | {
3009
- type: 'drop'
3010
- },
3011
- undefined,
3012
- never,
3013
- never,
3014
- never,
3015
- never,
3016
- | PatchEvent
3017
- | InternalPatchEvent
3018
- | MutationEvent
3019
- | PatchesEvent
3020
- | {
3021
- type: 'blurred'
3022
- event: FocusEvent_2<HTMLDivElement, Element>
3023
- }
3024
- | {
3025
- type: 'done loading'
3026
- }
3027
- | {
3028
- type: 'editable'
3029
- }
3030
- | {
3031
- type: 'error'
3032
- name: string
3033
- description: string
3034
- data: unknown
3035
- }
3036
- | {
3037
- type: 'focused'
3038
- event: FocusEvent_2<HTMLDivElement, Element>
3039
- }
3040
- | {
3041
- type: 'invalid value'
3042
- resolution: InvalidValueResolution | null
3043
- value: Array<PortableTextBlock> | undefined
3044
- }
3045
- | {
3046
- type: 'loading'
3047
- }
3048
- | {
3049
- type: 'read only'
3050
- }
3051
- | {
3052
- type: 'ready'
3053
- }
3054
- | {
3055
- type: 'selection'
3056
- selection: EditorSelection
3057
- }
3058
- | {
3059
- type: 'value changed'
3060
- value: Array<PortableTextBlock> | undefined
3061
- }
3062
- | UnsetEvent
3063
- >
3064
- }
3065
- readonly 'notify.loading': {
3066
- readonly actions: ActionFunction<
3067
- {
3068
- behaviors: Set<BehaviorConfig>
3069
- converters: Set<Converter>
3070
- getLegacySchema: () => PortableTextMemberSchemaTypes
3071
- keyGenerator: () => string
3072
- pendingEvents: Array<InternalPatchEvent | MutationEvent>
3073
- pendingIncomingPatchesEvents: Array<PatchesEvent>
3074
- schema: EditorSchema
3075
- initialReadOnly: boolean
3076
- maxBlocks: number | undefined
3077
- selection: EditorSelection
3078
- initialValue: Array<PortableTextBlock> | undefined
3079
- internalDrag?: {
3080
- ghost?: HTMLElement
3081
- origin: Pick<EventPosition, 'selection'>
3082
- }
3083
- slateEditor?: PortableTextSlateEditor
3084
- },
3085
- {
3086
- type: 'notify.loading'
3087
- },
3088
- | InternalPatchEvent
3089
- | MutationEvent
3090
- | PatchesEvent
3091
- | {
3092
- type: 'update readOnly'
3093
- readOnly: boolean
3094
- }
3095
- | {
3096
- type: 'update schema'
3097
- schema: EditorSchema
3098
- }
3099
- | {
3100
- type: 'update key generator'
3101
- keyGenerator: () => string
3102
- }
3103
- | {
3104
- type: 'update maxBlocks'
3105
- maxBlocks: number | undefined
3106
- }
3107
- | {
3108
- type: 'add behavior'
3109
- behaviorConfig: BehaviorConfig
3110
- }
3111
- | {
3112
- type: 'remove behavior'
3113
- behaviorConfig: BehaviorConfig
3114
- }
3115
- | {
3116
- type: 'blur'
3117
- editor: PortableTextSlateEditor
3118
- }
3119
- | {
3120
- type: 'focus'
3121
- editor: PortableTextSlateEditor
3122
- }
3123
- | {
3124
- type: 'normalizing'
3125
- }
3126
- | {
3127
- type: 'done normalizing'
3128
- }
3129
- | {
3130
- type: 'done syncing value'
3131
- }
3132
- | {
3133
- type: 'syncing value'
3134
- }
3135
- | {
3136
- type: 'behavior event'
3137
- behaviorEvent: BehaviorEvent
3138
- editor: PortableTextSlateEditor
3139
- nativeEvent?: {
3140
- preventDefault: () => void
3141
- }
3142
- }
3143
- | {
3144
- type: 'notify.patch'
3145
- patch: Patch
3146
- }
3147
- | {
3148
- type: 'notify.mutation'
3149
- patches: Array<Patch>
3150
- snapshot: Array<PortableTextBlock> | undefined
3151
- value: Array<PortableTextBlock> | undefined
3152
- }
3153
- | {
3154
- type: 'notify.blurred'
3155
- event: FocusEvent_2<HTMLDivElement, Element>
3156
- }
3157
- | {
3158
- type: 'notify.done loading'
3159
- }
3160
- | {
3161
- type: 'notify.editable'
3162
- }
3163
- | {
3164
- type: 'notify.error'
3165
- name: string
3166
- description: string
3167
- data: unknown
3168
- }
3169
- | {
3170
- type: 'notify.focused'
3171
- event: FocusEvent_2<HTMLDivElement, Element>
3172
- }
3173
- | {
3174
- type: 'notify.invalid value'
3175
- resolution: InvalidValueResolution | null
3176
- value: Array<PortableTextBlock> | undefined
3177
- }
3178
- | {
3179
- type: 'notify.loading'
3180
- }
3181
- | {
3182
- type: 'notify.read only'
3183
- }
3184
- | {
3185
- type: 'notify.ready'
3186
- }
3187
- | {
3188
- type: 'notify.selection'
3189
- selection: EditorSelection
3190
- }
3191
- | {
3192
- type: 'notify.value changed'
3193
- value: Array<PortableTextBlock> | undefined
3194
- }
3195
- | {
3196
- type: 'notify.unset'
3197
- previousValue: Array<PortableTextBlock>
3198
- }
3199
- | {
3200
- type: 'dragstart'
3201
- origin: Pick<EventPosition, 'selection'>
3202
- ghost?: HTMLElement
3203
- }
3204
- | {
3205
- type: 'dragend'
3206
- }
3207
- | {
3208
- type: 'drop'
3209
- },
3210
- undefined,
3211
- never,
3212
- never,
3213
- never,
3214
- never,
3215
- | PatchEvent
3216
- | InternalPatchEvent
3217
- | MutationEvent
3218
- | PatchesEvent
3219
- | {
3220
- type: 'blurred'
3221
- event: FocusEvent_2<HTMLDivElement, Element>
3222
- }
3223
- | {
3224
- type: 'done loading'
3225
- }
3226
- | {
3227
- type: 'editable'
3228
- }
3229
- | {
3230
- type: 'error'
3231
- name: string
3232
- description: string
3233
- data: unknown
3234
- }
3235
- | {
3236
- type: 'focused'
3237
- event: FocusEvent_2<HTMLDivElement, Element>
3238
- }
3239
- | {
3240
- type: 'invalid value'
3241
- resolution: InvalidValueResolution | null
3242
- value: Array<PortableTextBlock> | undefined
3243
- }
3244
- | {
3245
- type: 'loading'
3246
- }
3247
- | {
3248
- type: 'read only'
3249
- }
3250
- | {
3251
- type: 'ready'
3252
- }
3253
- | {
3254
- type: 'selection'
3255
- selection: EditorSelection
3256
- }
3257
- | {
3258
- type: 'value changed'
3259
- value: Array<PortableTextBlock> | undefined
3260
- }
3261
- | UnsetEvent
3262
- >
3263
- }
3264
- readonly 'notify.value changed': {
3265
- readonly actions: ActionFunction<
3266
- {
3267
- behaviors: Set<BehaviorConfig>
3268
- converters: Set<Converter>
3269
- getLegacySchema: () => PortableTextMemberSchemaTypes
3270
- keyGenerator: () => string
3271
- pendingEvents: Array<InternalPatchEvent | MutationEvent>
3272
- pendingIncomingPatchesEvents: Array<PatchesEvent>
3273
- schema: EditorSchema
3274
- initialReadOnly: boolean
3275
- maxBlocks: number | undefined
3276
- selection: EditorSelection
3277
- initialValue: Array<PortableTextBlock> | undefined
3278
- internalDrag?: {
3279
- ghost?: HTMLElement
3280
- origin: Pick<EventPosition, 'selection'>
3281
- }
3282
- slateEditor?: PortableTextSlateEditor
3283
- },
3284
- {
3285
- type: 'notify.value changed'
3286
- value: Array<PortableTextBlock> | undefined
3287
- },
3288
- | InternalPatchEvent
3289
- | MutationEvent
3290
- | PatchesEvent
3291
- | {
3292
- type: 'update readOnly'
3293
- readOnly: boolean
3294
- }
3295
- | {
3296
- type: 'update schema'
3297
- schema: EditorSchema
3298
- }
3299
- | {
3300
- type: 'update key generator'
3301
- keyGenerator: () => string
3302
- }
3303
- | {
3304
- type: 'update maxBlocks'
3305
- maxBlocks: number | undefined
3306
- }
3307
- | {
3308
- type: 'add behavior'
3309
- behaviorConfig: BehaviorConfig
3310
- }
3311
- | {
3312
- type: 'remove behavior'
3313
- behaviorConfig: BehaviorConfig
3314
- }
3315
- | {
3316
- type: 'blur'
3317
- editor: PortableTextSlateEditor
3318
- }
3319
- | {
3320
- type: 'focus'
3321
- editor: PortableTextSlateEditor
3322
- }
3323
- | {
3324
- type: 'normalizing'
3325
- }
3326
- | {
3327
- type: 'done normalizing'
3328
- }
3329
- | {
3330
- type: 'done syncing value'
3331
- }
3332
- | {
3333
- type: 'syncing value'
3334
- }
3335
- | {
3336
- type: 'behavior event'
3337
- behaviorEvent: BehaviorEvent
3338
- editor: PortableTextSlateEditor
3339
- nativeEvent?: {
3340
- preventDefault: () => void
3341
- }
3342
- }
3343
- | {
3344
- type: 'notify.patch'
3345
- patch: Patch
3346
- }
3347
- | {
3348
- type: 'notify.mutation'
3349
- patches: Array<Patch>
3350
- snapshot: Array<PortableTextBlock> | undefined
3351
- value: Array<PortableTextBlock> | undefined
3352
- }
3353
- | {
3354
- type: 'notify.blurred'
3355
- event: FocusEvent_2<HTMLDivElement, Element>
3356
- }
3357
- | {
3358
- type: 'notify.done loading'
3359
- }
3360
- | {
3361
- type: 'notify.editable'
3362
- }
3363
- | {
3364
- type: 'notify.error'
3365
- name: string
3366
- description: string
3367
- data: unknown
3368
- }
3369
- | {
3370
- type: 'notify.focused'
3371
- event: FocusEvent_2<HTMLDivElement, Element>
3372
- }
3373
- | {
3374
- type: 'notify.invalid value'
3375
- resolution: InvalidValueResolution | null
3376
- value: Array<PortableTextBlock> | undefined
3377
- }
3378
- | {
3379
- type: 'notify.loading'
3380
- }
3381
- | {
3382
- type: 'notify.read only'
3383
- }
3384
- | {
3385
- type: 'notify.ready'
3386
- }
3387
- | {
3388
- type: 'notify.selection'
3389
- selection: EditorSelection
3390
- }
3391
- | {
3392
- type: 'notify.value changed'
3393
- value: Array<PortableTextBlock> | undefined
3394
- }
3395
- | {
3396
- type: 'notify.unset'
3397
- previousValue: Array<PortableTextBlock>
3398
- }
3399
- | {
3400
- type: 'dragstart'
3401
- origin: Pick<EventPosition, 'selection'>
3402
- ghost?: HTMLElement
3403
- }
3404
- | {
3405
- type: 'dragend'
3406
- }
3407
- | {
3408
- type: 'drop'
3409
- },
3410
- undefined,
3411
- never,
3412
- never,
3413
- never,
3414
- never,
3415
- | PatchEvent
3416
- | InternalPatchEvent
3417
- | MutationEvent
3418
- | PatchesEvent
3419
- | {
3420
- type: 'blurred'
3421
- event: FocusEvent_2<HTMLDivElement, Element>
3422
- }
3423
- | {
3424
- type: 'done loading'
3425
- }
3426
- | {
3427
- type: 'editable'
3428
- }
3429
- | {
3430
- type: 'error'
3431
- name: string
3432
- description: string
3433
- data: unknown
3434
- }
3435
- | {
3436
- type: 'focused'
3437
- event: FocusEvent_2<HTMLDivElement, Element>
3438
- }
3439
- | {
3440
- type: 'invalid value'
3441
- resolution: InvalidValueResolution | null
3442
- value: Array<PortableTextBlock> | undefined
3443
- }
3444
- | {
3445
- type: 'loading'
3446
- }
3447
- | {
3448
- type: 'read only'
3449
- }
3450
- | {
3451
- type: 'ready'
3452
- }
3453
- | {
3454
- type: 'selection'
3455
- selection: EditorSelection
3456
- }
3457
- | {
3458
- type: 'value changed'
3459
- value: Array<PortableTextBlock> | undefined
3460
- }
3461
- | UnsetEvent
3462
- >
3463
- }
3464
- readonly 'add behavior': {
3465
- readonly actions: 'add behavior to context'
3466
- }
3467
- readonly 'remove behavior': {
3468
- readonly actions: 'remove behavior from context'
3469
- }
3470
- readonly 'update key generator': {
3471
- readonly actions: ActionFunction<
3472
- {
3473
- behaviors: Set<BehaviorConfig>
3474
- converters: Set<Converter>
3475
- getLegacySchema: () => PortableTextMemberSchemaTypes
3476
- keyGenerator: () => string
3477
- pendingEvents: Array<InternalPatchEvent | MutationEvent>
3478
- pendingIncomingPatchesEvents: Array<PatchesEvent>
3479
- schema: EditorSchema
3480
- initialReadOnly: boolean
3481
- maxBlocks: number | undefined
3482
- selection: EditorSelection
3483
- initialValue: Array<PortableTextBlock> | undefined
3484
- internalDrag?: {
3485
- ghost?: HTMLElement
3486
- origin: Pick<EventPosition, 'selection'>
3487
- }
3488
- slateEditor?: PortableTextSlateEditor
3489
- },
3490
- {
3491
- type: 'update key generator'
3492
- keyGenerator: () => string
3493
- },
3494
- | InternalPatchEvent
3495
- | MutationEvent
3496
- | PatchesEvent
3497
- | {
3498
- type: 'update readOnly'
3499
- readOnly: boolean
3500
- }
3501
- | {
3502
- type: 'update schema'
3503
- schema: EditorSchema
3504
- }
3505
- | {
3506
- type: 'update key generator'
3507
- keyGenerator: () => string
3508
- }
3509
- | {
3510
- type: 'update maxBlocks'
3511
- maxBlocks: number | undefined
3512
- }
3513
- | {
3514
- type: 'add behavior'
3515
- behaviorConfig: BehaviorConfig
3516
- }
3517
- | {
3518
- type: 'remove behavior'
3519
- behaviorConfig: BehaviorConfig
3520
- }
3521
- | {
3522
- type: 'blur'
3523
- editor: PortableTextSlateEditor
3524
- }
3525
- | {
3526
- type: 'focus'
3527
- editor: PortableTextSlateEditor
3528
- }
3529
- | {
3530
- type: 'normalizing'
3531
- }
3532
- | {
3533
- type: 'done normalizing'
3534
- }
3535
- | {
3536
- type: 'done syncing value'
3537
- }
3538
- | {
3539
- type: 'syncing value'
3540
- }
3541
- | {
3542
- type: 'behavior event'
3543
- behaviorEvent: BehaviorEvent
3544
- editor: PortableTextSlateEditor
3545
- nativeEvent?: {
3546
- preventDefault: () => void
3547
- }
3548
- }
3549
- | {
3550
- type: 'notify.patch'
3551
- patch: Patch
3552
- }
3553
- | {
3554
- type: 'notify.mutation'
3555
- patches: Array<Patch>
3556
- snapshot: Array<PortableTextBlock> | undefined
3557
- value: Array<PortableTextBlock> | undefined
3558
- }
3559
- | {
3560
- type: 'notify.blurred'
3561
- event: FocusEvent_2<HTMLDivElement, Element>
3562
- }
3563
- | {
3564
- type: 'notify.done loading'
3565
- }
3566
- | {
3567
- type: 'notify.editable'
3568
- }
3569
- | {
3570
- type: 'notify.error'
3571
- name: string
3572
- description: string
3573
- data: unknown
3574
- }
3575
- | {
3576
- type: 'notify.focused'
3577
- event: FocusEvent_2<HTMLDivElement, Element>
3578
- }
3579
- | {
3580
- type: 'notify.invalid value'
3581
- resolution: InvalidValueResolution | null
3582
- value: Array<PortableTextBlock> | undefined
3583
- }
3584
- | {
3585
- type: 'notify.loading'
3586
- }
3587
- | {
3588
- type: 'notify.read only'
3589
- }
3590
- | {
3591
- type: 'notify.ready'
3592
- }
3593
- | {
3594
- type: 'notify.selection'
3595
- selection: EditorSelection
3596
- }
3597
- | {
3598
- type: 'notify.value changed'
3599
- value: Array<PortableTextBlock> | undefined
3600
- }
3601
- | {
3602
- type: 'notify.unset'
3603
- previousValue: Array<PortableTextBlock>
3604
- }
3605
- | {
3606
- type: 'dragstart'
3607
- origin: Pick<EventPosition, 'selection'>
3608
- ghost?: HTMLElement
3609
- }
3610
- | {
3611
- type: 'dragend'
3612
- }
3613
- | {
3614
- type: 'drop'
3615
- },
3616
- undefined,
3617
- never,
3618
- never,
3619
- never,
3620
- never,
3621
- never
3622
- >
3623
- }
3624
- readonly 'update schema': {
3625
- readonly actions: 'assign schema'
3626
- }
3627
- readonly 'update maxBlocks': {
3628
- readonly actions: ActionFunction<
3629
- {
3630
- behaviors: Set<BehaviorConfig>
3631
- converters: Set<Converter>
3632
- getLegacySchema: () => PortableTextMemberSchemaTypes
3633
- keyGenerator: () => string
3634
- pendingEvents: Array<InternalPatchEvent | MutationEvent>
3635
- pendingIncomingPatchesEvents: Array<PatchesEvent>
3636
- schema: EditorSchema
3637
- initialReadOnly: boolean
3638
- maxBlocks: number | undefined
3639
- selection: EditorSelection
3640
- initialValue: Array<PortableTextBlock> | undefined
3641
- internalDrag?: {
3642
- ghost?: HTMLElement
3643
- origin: Pick<EventPosition, 'selection'>
3644
- }
3645
- slateEditor?: PortableTextSlateEditor
3646
- },
3647
- {
3648
- type: 'update maxBlocks'
3649
- maxBlocks: number | undefined
3650
- },
3651
- | InternalPatchEvent
3652
- | MutationEvent
3653
- | PatchesEvent
3654
- | {
3655
- type: 'update readOnly'
3656
- readOnly: boolean
3657
- }
3658
- | {
3659
- type: 'update schema'
1431
+ pendingEvents: Array<InternalPatchEvent | MutationEvent>
1432
+ pendingIncomingPatchesEvents: Array<PatchesEvent>
3660
1433
  schema: EditorSchema
3661
- }
3662
- | {
3663
- type: 'update key generator'
3664
- keyGenerator: () => string
3665
- }
3666
- | {
3667
- type: 'update maxBlocks'
1434
+ initialReadOnly: boolean
3668
1435
  maxBlocks: number | undefined
3669
- }
3670
- | {
3671
- type: 'add behavior'
3672
- behaviorConfig: BehaviorConfig
3673
- }
3674
- | {
3675
- type: 'remove behavior'
3676
- behaviorConfig: BehaviorConfig
3677
- }
3678
- | {
3679
- type: 'blur'
3680
- editor: PortableTextSlateEditor
3681
- }
3682
- | {
3683
- type: 'focus'
3684
- editor: PortableTextSlateEditor
3685
- }
3686
- | {
3687
- type: 'normalizing'
3688
- }
3689
- | {
3690
- type: 'done normalizing'
3691
- }
3692
- | {
3693
- type: 'done syncing value'
3694
- }
3695
- | {
3696
- type: 'syncing value'
3697
- }
3698
- | {
3699
- type: 'behavior event'
3700
- behaviorEvent: BehaviorEvent
3701
- editor: PortableTextSlateEditor
3702
- nativeEvent?: {
3703
- preventDefault: () => void
1436
+ selection: EditorSelection
1437
+ initialValue: Array<PortableTextBlock> | undefined
1438
+ internalDrag?: {
1439
+ ghost?: HTMLElement
1440
+ origin: Pick<EventPosition, 'selection'>
3704
1441
  }
3705
- }
3706
- | {
3707
- type: 'notify.patch'
3708
- patch: Patch
3709
- }
3710
- | {
3711
- type: 'notify.mutation'
3712
- patches: Array<Patch>
3713
- snapshot: Array<PortableTextBlock> | undefined
3714
- value: Array<PortableTextBlock> | undefined
3715
- }
3716
- | {
3717
- type: 'notify.blurred'
3718
- event: FocusEvent_2<HTMLDivElement, Element>
3719
- }
3720
- | {
3721
- type: 'notify.done loading'
3722
- }
3723
- | {
3724
- type: 'notify.editable'
3725
- }
3726
- | {
3727
- type: 'notify.error'
3728
- name: string
3729
- description: string
3730
- data: unknown
3731
- }
3732
- | {
3733
- type: 'notify.focused'
3734
- event: FocusEvent_2<HTMLDivElement, Element>
3735
- }
3736
- | {
3737
- type: 'notify.invalid value'
3738
- resolution: InvalidValueResolution | null
3739
- value: Array<PortableTextBlock> | undefined
3740
- }
3741
- | {
3742
- type: 'notify.loading'
3743
- }
3744
- | {
3745
- type: 'notify.read only'
3746
- }
3747
- | {
3748
- type: 'notify.ready'
3749
- }
3750
- | {
3751
- type: 'notify.selection'
1442
+ slateEditor?: PortableTextSlateEditor
1443
+ },
1444
+ {
1445
+ type: 'update selection'
3752
1446
  selection: EditorSelection
3753
- }
3754
- | {
3755
- type: 'notify.value changed'
3756
- value: Array<PortableTextBlock> | undefined
3757
- }
3758
- | {
3759
- type: 'notify.unset'
3760
- previousValue: Array<PortableTextBlock>
3761
- }
3762
- | {
3763
- type: 'dragstart'
3764
- origin: Pick<EventPosition, 'selection'>
3765
- ghost?: HTMLElement
3766
- }
3767
- | {
3768
- type: 'dragend'
3769
- }
3770
- | {
3771
- type: 'drop'
3772
1447
  },
3773
- undefined,
3774
- never,
3775
- never,
3776
- never,
3777
- never,
3778
- never
3779
- >
1448
+ | InternalPatchEvent
1449
+ | MutationEvent
1450
+ | PatchesEvent
1451
+ | {
1452
+ type: 'update readOnly'
1453
+ readOnly: boolean
1454
+ }
1455
+ | {
1456
+ type: 'update maxBlocks'
1457
+ maxBlocks: number | undefined
1458
+ }
1459
+ | {
1460
+ type: 'add behavior'
1461
+ behaviorConfig: BehaviorConfig
1462
+ }
1463
+ | {
1464
+ type: 'remove behavior'
1465
+ behaviorConfig: BehaviorConfig
1466
+ }
1467
+ | {
1468
+ type: 'blur'
1469
+ editor: PortableTextSlateEditor
1470
+ }
1471
+ | {
1472
+ type: 'focus'
1473
+ editor: PortableTextSlateEditor
1474
+ }
1475
+ | {
1476
+ type: 'normalizing'
1477
+ }
1478
+ | {
1479
+ type: 'update selection'
1480
+ selection: EditorSelection
1481
+ }
1482
+ | {
1483
+ type: 'done normalizing'
1484
+ }
1485
+ | {
1486
+ type: 'done syncing value'
1487
+ }
1488
+ | {
1489
+ type: 'syncing value'
1490
+ }
1491
+ | {
1492
+ type: 'behavior event'
1493
+ behaviorEvent: BehaviorEvent
1494
+ editor: PortableTextSlateEditor
1495
+ nativeEvent?: {
1496
+ preventDefault: () => void
1497
+ }
1498
+ }
1499
+ | {
1500
+ type: 'dragstart'
1501
+ origin: Pick<EventPosition, 'selection'>
1502
+ ghost?: HTMLElement
1503
+ }
1504
+ | {
1505
+ type: 'dragend'
1506
+ }
1507
+ | {
1508
+ type: 'drop'
1509
+ },
1510
+ undefined,
1511
+ never,
1512
+ never,
1513
+ never,
1514
+ never,
1515
+ never
1516
+ >,
1517
+ ]
3780
1518
  }
3781
1519
  }
3782
1520
  readonly type: 'parallel'
@@ -3972,14 +1710,6 @@ declare const editorMachine: StateMachine<
3972
1710
  type: 'update readOnly'
3973
1711
  readOnly: boolean
3974
1712
  }
3975
- | {
3976
- type: 'update schema'
3977
- schema: EditorSchema
3978
- }
3979
- | {
3980
- type: 'update key generator'
3981
- keyGenerator: () => string
3982
- }
3983
1713
  | {
3984
1714
  type: 'update maxBlocks'
3985
1715
  maxBlocks: number | undefined
@@ -4003,6 +1733,10 @@ declare const editorMachine: StateMachine<
4003
1733
  | {
4004
1734
  type: 'normalizing'
4005
1735
  }
1736
+ | {
1737
+ type: 'update selection'
1738
+ selection: EditorSelection
1739
+ }
4006
1740
  | {
4007
1741
  type: 'done normalizing'
4008
1742
  }
@@ -4017,64 +1751,8 @@ declare const editorMachine: StateMachine<
4017
1751
  behaviorEvent: BehaviorEvent
4018
1752
  editor: PortableTextSlateEditor
4019
1753
  nativeEvent?: {
4020
- preventDefault: () => void
4021
- }
4022
- }
4023
- | {
4024
- type: 'notify.patch'
4025
- patch: Patch
4026
- }
4027
- | {
4028
- type: 'notify.mutation'
4029
- patches: Array<Patch>
4030
- snapshot: Array<PortableTextBlock> | undefined
4031
- value: Array<PortableTextBlock> | undefined
4032
- }
4033
- | {
4034
- type: 'notify.blurred'
4035
- event: FocusEvent_2<HTMLDivElement, Element>
4036
- }
4037
- | {
4038
- type: 'notify.done loading'
4039
- }
4040
- | {
4041
- type: 'notify.editable'
4042
- }
4043
- | {
4044
- type: 'notify.error'
4045
- name: string
4046
- description: string
4047
- data: unknown
4048
- }
4049
- | {
4050
- type: 'notify.focused'
4051
- event: FocusEvent_2<HTMLDivElement, Element>
4052
- }
4053
- | {
4054
- type: 'notify.invalid value'
4055
- resolution: InvalidValueResolution | null
4056
- value: Array<PortableTextBlock> | undefined
4057
- }
4058
- | {
4059
- type: 'notify.loading'
4060
- }
4061
- | {
4062
- type: 'notify.read only'
4063
- }
4064
- | {
4065
- type: 'notify.ready'
4066
- }
4067
- | {
4068
- type: 'notify.selection'
4069
- selection: EditorSelection
4070
- }
4071
- | {
4072
- type: 'notify.value changed'
4073
- value: Array<PortableTextBlock> | undefined
4074
- }
4075
- | {
4076
- type: 'notify.unset'
4077
- previousValue: Array<PortableTextBlock>
1754
+ preventDefault: () => void
1755
+ }
4078
1756
  }
4079
1757
  | {
4080
1758
  type: 'dragstart'
@@ -4138,14 +1816,6 @@ declare const editorMachine: StateMachine<
4138
1816
  type: 'update readOnly'
4139
1817
  readOnly: boolean
4140
1818
  }
4141
- | {
4142
- type: 'update schema'
4143
- schema: EditorSchema
4144
- }
4145
- | {
4146
- type: 'update key generator'
4147
- keyGenerator: () => string
4148
- }
4149
1819
  | {
4150
1820
  type: 'update maxBlocks'
4151
1821
  maxBlocks: number | undefined
@@ -4169,6 +1839,10 @@ declare const editorMachine: StateMachine<
4169
1839
  | {
4170
1840
  type: 'normalizing'
4171
1841
  }
1842
+ | {
1843
+ type: 'update selection'
1844
+ selection: EditorSelection
1845
+ }
4172
1846
  | {
4173
1847
  type: 'done normalizing'
4174
1848
  }
@@ -4186,62 +1860,6 @@ declare const editorMachine: StateMachine<
4186
1860
  preventDefault: () => void
4187
1861
  }
4188
1862
  }
4189
- | {
4190
- type: 'notify.patch'
4191
- patch: Patch
4192
- }
4193
- | {
4194
- type: 'notify.mutation'
4195
- patches: Array<Patch>
4196
- snapshot: Array<PortableTextBlock> | undefined
4197
- value: Array<PortableTextBlock> | undefined
4198
- }
4199
- | {
4200
- type: 'notify.blurred'
4201
- event: FocusEvent_2<HTMLDivElement, Element>
4202
- }
4203
- | {
4204
- type: 'notify.done loading'
4205
- }
4206
- | {
4207
- type: 'notify.editable'
4208
- }
4209
- | {
4210
- type: 'notify.error'
4211
- name: string
4212
- description: string
4213
- data: unknown
4214
- }
4215
- | {
4216
- type: 'notify.focused'
4217
- event: FocusEvent_2<HTMLDivElement, Element>
4218
- }
4219
- | {
4220
- type: 'notify.invalid value'
4221
- resolution: InvalidValueResolution | null
4222
- value: Array<PortableTextBlock> | undefined
4223
- }
4224
- | {
4225
- type: 'notify.loading'
4226
- }
4227
- | {
4228
- type: 'notify.read only'
4229
- }
4230
- | {
4231
- type: 'notify.ready'
4232
- }
4233
- | {
4234
- type: 'notify.selection'
4235
- selection: EditorSelection
4236
- }
4237
- | {
4238
- type: 'notify.value changed'
4239
- value: Array<PortableTextBlock> | undefined
4240
- }
4241
- | {
4242
- type: 'notify.unset'
4243
- previousValue: Array<PortableTextBlock>
4244
- }
4245
1863
  | {
4246
1864
  type: 'dragstart'
4247
1865
  origin: Pick<EventPosition, 'selection'>
@@ -4325,14 +1943,6 @@ declare const editorMachine: StateMachine<
4325
1943
  type: 'update readOnly'
4326
1944
  readOnly: boolean
4327
1945
  }
4328
- | {
4329
- type: 'update schema'
4330
- schema: EditorSchema
4331
- }
4332
- | {
4333
- type: 'update key generator'
4334
- keyGenerator: () => string
4335
- }
4336
1946
  | {
4337
1947
  type: 'update maxBlocks'
4338
1948
  maxBlocks: number | undefined
@@ -4356,6 +1966,10 @@ declare const editorMachine: StateMachine<
4356
1966
  | {
4357
1967
  type: 'normalizing'
4358
1968
  }
1969
+ | {
1970
+ type: 'update selection'
1971
+ selection: EditorSelection
1972
+ }
4359
1973
  | {
4360
1974
  type: 'done normalizing'
4361
1975
  }
@@ -4373,62 +1987,6 @@ declare const editorMachine: StateMachine<
4373
1987
  preventDefault: () => void
4374
1988
  }
4375
1989
  }
4376
- | {
4377
- type: 'notify.patch'
4378
- patch: Patch
4379
- }
4380
- | {
4381
- type: 'notify.mutation'
4382
- patches: Array<Patch>
4383
- snapshot: Array<PortableTextBlock> | undefined
4384
- value: Array<PortableTextBlock> | undefined
4385
- }
4386
- | {
4387
- type: 'notify.blurred'
4388
- event: FocusEvent_2<HTMLDivElement, Element>
4389
- }
4390
- | {
4391
- type: 'notify.done loading'
4392
- }
4393
- | {
4394
- type: 'notify.editable'
4395
- }
4396
- | {
4397
- type: 'notify.error'
4398
- name: string
4399
- description: string
4400
- data: unknown
4401
- }
4402
- | {
4403
- type: 'notify.focused'
4404
- event: FocusEvent_2<HTMLDivElement, Element>
4405
- }
4406
- | {
4407
- type: 'notify.invalid value'
4408
- resolution: InvalidValueResolution | null
4409
- value: Array<PortableTextBlock> | undefined
4410
- }
4411
- | {
4412
- type: 'notify.loading'
4413
- }
4414
- | {
4415
- type: 'notify.read only'
4416
- }
4417
- | {
4418
- type: 'notify.ready'
4419
- }
4420
- | {
4421
- type: 'notify.selection'
4422
- selection: EditorSelection
4423
- }
4424
- | {
4425
- type: 'notify.value changed'
4426
- value: Array<PortableTextBlock> | undefined
4427
- }
4428
- | {
4429
- type: 'notify.unset'
4430
- previousValue: Array<PortableTextBlock>
4431
- }
4432
1990
  | {
4433
1991
  type: 'dragstart'
4434
1992
  origin: Pick<EventPosition, 'selection'>
@@ -4447,14 +2005,6 @@ declare const editorMachine: StateMachine<
4447
2005
  type: 'update readOnly'
4448
2006
  readOnly: boolean
4449
2007
  }
4450
- | {
4451
- type: 'update schema'
4452
- schema: EditorSchema
4453
- }
4454
- | {
4455
- type: 'update key generator'
4456
- keyGenerator: () => string
4457
- }
4458
2008
  | {
4459
2009
  type: 'update maxBlocks'
4460
2010
  maxBlocks: number | undefined
@@ -4478,6 +2028,10 @@ declare const editorMachine: StateMachine<
4478
2028
  | {
4479
2029
  type: 'normalizing'
4480
2030
  }
2031
+ | {
2032
+ type: 'update selection'
2033
+ selection: EditorSelection
2034
+ }
4481
2035
  | {
4482
2036
  type: 'done normalizing'
4483
2037
  }
@@ -4495,62 +2049,6 @@ declare const editorMachine: StateMachine<
4495
2049
  preventDefault: () => void
4496
2050
  }
4497
2051
  }
4498
- | {
4499
- type: 'notify.patch'
4500
- patch: Patch
4501
- }
4502
- | {
4503
- type: 'notify.mutation'
4504
- patches: Array<Patch>
4505
- snapshot: Array<PortableTextBlock> | undefined
4506
- value: Array<PortableTextBlock> | undefined
4507
- }
4508
- | {
4509
- type: 'notify.blurred'
4510
- event: FocusEvent_2<HTMLDivElement, Element>
4511
- }
4512
- | {
4513
- type: 'notify.done loading'
4514
- }
4515
- | {
4516
- type: 'notify.editable'
4517
- }
4518
- | {
4519
- type: 'notify.error'
4520
- name: string
4521
- description: string
4522
- data: unknown
4523
- }
4524
- | {
4525
- type: 'notify.focused'
4526
- event: FocusEvent_2<HTMLDivElement, Element>
4527
- }
4528
- | {
4529
- type: 'notify.invalid value'
4530
- resolution: InvalidValueResolution | null
4531
- value: Array<PortableTextBlock> | undefined
4532
- }
4533
- | {
4534
- type: 'notify.loading'
4535
- }
4536
- | {
4537
- type: 'notify.read only'
4538
- }
4539
- | {
4540
- type: 'notify.ready'
4541
- }
4542
- | {
4543
- type: 'notify.selection'
4544
- selection: EditorSelection
4545
- }
4546
- | {
4547
- type: 'notify.value changed'
4548
- value: Array<PortableTextBlock> | undefined
4549
- }
4550
- | {
4551
- type: 'notify.unset'
4552
- previousValue: Array<PortableTextBlock>
4553
- }
4554
2052
  | {
4555
2053
  type: 'dragstart'
4556
2054
  origin: Pick<EventPosition, 'selection'>
@@ -4589,14 +2087,6 @@ declare const editorMachine: StateMachine<
4589
2087
  type: 'update readOnly'
4590
2088
  readOnly: boolean
4591
2089
  }
4592
- | {
4593
- type: 'update schema'
4594
- schema: EditorSchema
4595
- }
4596
- | {
4597
- type: 'update key generator'
4598
- keyGenerator: () => string
4599
- }
4600
2090
  | {
4601
2091
  type: 'update maxBlocks'
4602
2092
  maxBlocks: number | undefined
@@ -4620,6 +2110,10 @@ declare const editorMachine: StateMachine<
4620
2110
  | {
4621
2111
  type: 'normalizing'
4622
2112
  }
2113
+ | {
2114
+ type: 'update selection'
2115
+ selection: EditorSelection
2116
+ }
4623
2117
  | {
4624
2118
  type: 'done normalizing'
4625
2119
  }
@@ -4637,62 +2131,6 @@ declare const editorMachine: StateMachine<
4637
2131
  preventDefault: () => void
4638
2132
  }
4639
2133
  }
4640
- | {
4641
- type: 'notify.patch'
4642
- patch: Patch
4643
- }
4644
- | {
4645
- type: 'notify.mutation'
4646
- patches: Array<Patch>
4647
- snapshot: Array<PortableTextBlock> | undefined
4648
- value: Array<PortableTextBlock> | undefined
4649
- }
4650
- | {
4651
- type: 'notify.blurred'
4652
- event: FocusEvent_2<HTMLDivElement, Element>
4653
- }
4654
- | {
4655
- type: 'notify.done loading'
4656
- }
4657
- | {
4658
- type: 'notify.editable'
4659
- }
4660
- | {
4661
- type: 'notify.error'
4662
- name: string
4663
- description: string
4664
- data: unknown
4665
- }
4666
- | {
4667
- type: 'notify.focused'
4668
- event: FocusEvent_2<HTMLDivElement, Element>
4669
- }
4670
- | {
4671
- type: 'notify.invalid value'
4672
- resolution: InvalidValueResolution | null
4673
- value: Array<PortableTextBlock> | undefined
4674
- }
4675
- | {
4676
- type: 'notify.loading'
4677
- }
4678
- | {
4679
- type: 'notify.read only'
4680
- }
4681
- | {
4682
- type: 'notify.ready'
4683
- }
4684
- | {
4685
- type: 'notify.selection'
4686
- selection: EditorSelection
4687
- }
4688
- | {
4689
- type: 'notify.value changed'
4690
- value: Array<PortableTextBlock> | undefined
4691
- }
4692
- | {
4693
- type: 'notify.unset'
4694
- previousValue: Array<PortableTextBlock>
4695
- }
4696
2134
  | {
4697
2135
  type: 'dragstart'
4698
2136
  origin: Pick<EventPosition, 'selection'>
@@ -4711,14 +2149,6 @@ declare const editorMachine: StateMachine<
4711
2149
  type: 'update readOnly'
4712
2150
  readOnly: boolean
4713
2151
  }
4714
- | {
4715
- type: 'update schema'
4716
- schema: EditorSchema
4717
- }
4718
- | {
4719
- type: 'update key generator'
4720
- keyGenerator: () => string
4721
- }
4722
2152
  | {
4723
2153
  type: 'update maxBlocks'
4724
2154
  maxBlocks: number | undefined
@@ -4742,6 +2172,10 @@ declare const editorMachine: StateMachine<
4742
2172
  | {
4743
2173
  type: 'normalizing'
4744
2174
  }
2175
+ | {
2176
+ type: 'update selection'
2177
+ selection: EditorSelection
2178
+ }
4745
2179
  | {
4746
2180
  type: 'done normalizing'
4747
2181
  }
@@ -4759,62 +2193,6 @@ declare const editorMachine: StateMachine<
4759
2193
  preventDefault: () => void
4760
2194
  }
4761
2195
  }
4762
- | {
4763
- type: 'notify.patch'
4764
- patch: Patch
4765
- }
4766
- | {
4767
- type: 'notify.mutation'
4768
- patches: Array<Patch>
4769
- snapshot: Array<PortableTextBlock> | undefined
4770
- value: Array<PortableTextBlock> | undefined
4771
- }
4772
- | {
4773
- type: 'notify.blurred'
4774
- event: FocusEvent_2<HTMLDivElement, Element>
4775
- }
4776
- | {
4777
- type: 'notify.done loading'
4778
- }
4779
- | {
4780
- type: 'notify.editable'
4781
- }
4782
- | {
4783
- type: 'notify.error'
4784
- name: string
4785
- description: string
4786
- data: unknown
4787
- }
4788
- | {
4789
- type: 'notify.focused'
4790
- event: FocusEvent_2<HTMLDivElement, Element>
4791
- }
4792
- | {
4793
- type: 'notify.invalid value'
4794
- resolution: InvalidValueResolution | null
4795
- value: Array<PortableTextBlock> | undefined
4796
- }
4797
- | {
4798
- type: 'notify.loading'
4799
- }
4800
- | {
4801
- type: 'notify.read only'
4802
- }
4803
- | {
4804
- type: 'notify.ready'
4805
- }
4806
- | {
4807
- type: 'notify.selection'
4808
- selection: EditorSelection
4809
- }
4810
- | {
4811
- type: 'notify.value changed'
4812
- value: Array<PortableTextBlock> | undefined
4813
- }
4814
- | {
4815
- type: 'notify.unset'
4816
- previousValue: Array<PortableTextBlock>
4817
- }
4818
2196
  | {
4819
2197
  type: 'dragstart'
4820
2198
  origin: Pick<EventPosition, 'selection'>
@@ -4915,14 +2293,6 @@ declare const editorMachine: StateMachine<
4915
2293
  type: 'update readOnly'
4916
2294
  readOnly: boolean
4917
2295
  }
4918
- | {
4919
- type: 'update schema'
4920
- schema: EditorSchema
4921
- }
4922
- | {
4923
- type: 'update key generator'
4924
- keyGenerator: () => string
4925
- }
4926
2296
  | {
4927
2297
  type: 'update maxBlocks'
4928
2298
  maxBlocks: number | undefined
@@ -4946,6 +2316,10 @@ declare const editorMachine: StateMachine<
4946
2316
  | {
4947
2317
  type: 'normalizing'
4948
2318
  }
2319
+ | {
2320
+ type: 'update selection'
2321
+ selection: EditorSelection
2322
+ }
4949
2323
  | {
4950
2324
  type: 'done normalizing'
4951
2325
  }
@@ -4963,62 +2337,6 @@ declare const editorMachine: StateMachine<
4963
2337
  preventDefault: () => void
4964
2338
  }
4965
2339
  }
4966
- | {
4967
- type: 'notify.patch'
4968
- patch: Patch
4969
- }
4970
- | {
4971
- type: 'notify.mutation'
4972
- patches: Array<Patch>
4973
- snapshot: Array<PortableTextBlock> | undefined
4974
- value: Array<PortableTextBlock> | undefined
4975
- }
4976
- | {
4977
- type: 'notify.blurred'
4978
- event: FocusEvent_2<HTMLDivElement, Element>
4979
- }
4980
- | {
4981
- type: 'notify.done loading'
4982
- }
4983
- | {
4984
- type: 'notify.editable'
4985
- }
4986
- | {
4987
- type: 'notify.error'
4988
- name: string
4989
- description: string
4990
- data: unknown
4991
- }
4992
- | {
4993
- type: 'notify.focused'
4994
- event: FocusEvent_2<HTMLDivElement, Element>
4995
- }
4996
- | {
4997
- type: 'notify.invalid value'
4998
- resolution: InvalidValueResolution | null
4999
- value: Array<PortableTextBlock> | undefined
5000
- }
5001
- | {
5002
- type: 'notify.loading'
5003
- }
5004
- | {
5005
- type: 'notify.read only'
5006
- }
5007
- | {
5008
- type: 'notify.ready'
5009
- }
5010
- | {
5011
- type: 'notify.selection'
5012
- selection: EditorSelection
5013
- }
5014
- | {
5015
- type: 'notify.value changed'
5016
- value: Array<PortableTextBlock> | undefined
5017
- }
5018
- | {
5019
- type: 'notify.unset'
5020
- previousValue: Array<PortableTextBlock>
5021
- }
5022
2340
  | {
5023
2341
  type: 'dragstart'
5024
2342
  origin: Pick<EventPosition, 'selection'>
@@ -5035,7 +2353,6 @@ declare const editorMachine: StateMachine<
5035
2353
  never,
5036
2354
  never,
5037
2355
  never,
5038
- | PatchEvent
5039
2356
  | InternalPatchEvent
5040
2357
  | MutationEvent
5041
2358
  | PatchesEvent
@@ -5061,7 +2378,7 @@ declare const editorMachine: StateMachine<
5061
2378
  }
5062
2379
  | {
5063
2380
  type: 'invalid value'
5064
- resolution: InvalidValueResolution | null
2381
+ resolution: InvalidValueResolution_2 | null
5065
2382
  value: Array<PortableTextBlock> | undefined
5066
2383
  }
5067
2384
  | {
@@ -5081,7 +2398,6 @@ declare const editorMachine: StateMachine<
5081
2398
  type: 'value changed'
5082
2399
  value: Array<PortableTextBlock> | undefined
5083
2400
  }
5084
- | UnsetEvent
5085
2401
  >,
5086
2402
  ]
5087
2403
  }
@@ -5317,7 +2633,9 @@ export declare type EditorSnapshot = {
5317
2633
 
5318
2634
  /**
5319
2635
  * The editor produced an error
5320
- * @beta */
2636
+ * @beta
2637
+ * @deprecated The change is no longer emitted
2638
+ * */
5321
2639
  export declare type ErrorChange = {
5322
2640
  type: 'error'
5323
2641
  name: string
@@ -5326,6 +2644,16 @@ export declare type ErrorChange = {
5326
2644
  data?: unknown
5327
2645
  }
5328
2646
 
2647
+ /**
2648
+ * @deprecated The event is no longer emitted
2649
+ */
2650
+ declare type ErrorEvent_2 = {
2651
+ type: 'error'
2652
+ name: string
2653
+ description: string
2654
+ data: unknown
2655
+ }
2656
+
5329
2657
  declare type EventPosition = {
5330
2658
  block: 'start' | 'end'
5331
2659
  /**
@@ -5373,14 +2701,6 @@ declare type ExternalEditorEvent =
5373
2701
  type: 'update readOnly'
5374
2702
  readOnly: boolean
5375
2703
  }
5376
- | {
5377
- type: 'update schema'
5378
- schema: EditorSchema
5379
- }
5380
- | {
5381
- type: 'update key generator'
5382
- keyGenerator: () => string
5383
- }
5384
2704
  | {
5385
2705
  type: 'update maxBlocks'
5386
2706
  maxBlocks: number | undefined
@@ -6347,7 +3667,9 @@ export declare type ReadyChange = {
6347
3667
 
6348
3668
  /**
6349
3669
  * The editor performed redo history step
6350
- * @beta */
3670
+ * @beta
3671
+ * @deprecated The change is no longer emitted
3672
+ * */
6351
3673
  export declare type RedoChange = {
6352
3674
  type: 'redo'
6353
3675
  patches: Patch[]
@@ -6627,7 +3949,9 @@ declare type TextBlockWithOptionalKey = Omit<PortableTextTextBlock, '_key'> & {
6627
3949
 
6628
3950
  /**
6629
3951
  * The editor performed a undo history step
6630
- * @beta */
3952
+ * @beta
3953
+ * @deprecated The change is no longer emitted
3954
+ * */
6631
3955
  export declare type UndoChange = {
6632
3956
  type: 'undo'
6633
3957
  patches: Patch[]
@@ -6640,11 +3964,6 @@ export declare type UnsetChange = {
6640
3964
  previousValue: PortableTextBlock[]
6641
3965
  }
6642
3966
 
6643
- declare type UnsetEvent = {
6644
- type: 'unset'
6645
- previousValue: Array<PortableTextBlock>
6646
- }
6647
-
6648
3967
  /**
6649
3968
  * @public
6650
3969
  * Get the current editor context from the `EditorProvider`.