@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
@@ -14,11 +14,8 @@ import type {
14
14
  PortableTextSpan,
15
15
  PortableTextTextBlock,
16
16
  } from '@sanity/types'
17
- import type {
18
- FocusEvent as FocusEvent_2,
19
- KeyboardEvent as KeyboardEvent_2,
20
- } from 'react'
21
- import {JSX, default as React_2} from 'react'
17
+ import {FocusEvent as FocusEvent_2, JSX, default as React_2} from 'react'
18
+ import type {KeyboardEvent as KeyboardEvent_2} from 'react'
22
19
  import type {Descendant, Operation, TextUnit} from 'slate'
23
20
  import type {DOMNode} from 'slate-dom'
24
21
  import type {ReactEditor} from 'slate-react'
@@ -44,6 +41,7 @@ import {
44
41
  } from 'xstate'
45
42
  import type {EventObject, Snapshot} from 'xstate'
46
43
  import {GuardArgs} from 'xstate/guards'
44
+ import {InvalidValueResolution} from '..'
47
45
 
48
46
  declare type AbstractBehaviorEvent =
49
47
  | {
@@ -624,19 +622,14 @@ declare type EditorEmittedEvent =
624
622
  | {
625
623
  type: 'editable'
626
624
  }
627
- | {
628
- type: 'error'
629
- name: string
630
- description: string
631
- data: unknown
632
- }
625
+ | ErrorEvent_2
633
626
  | {
634
627
  type: 'focused'
635
628
  event: FocusEvent_2<HTMLDivElement, Element>
636
629
  }
637
630
  | {
638
631
  type: 'invalid value'
639
- resolution: InvalidValueResolution | null
632
+ resolution: InvalidValueResolution_2 | null
640
633
  value: Array<PortableTextBlock> | undefined
641
634
  }
642
635
  | {
@@ -699,14 +692,6 @@ declare const editorMachine: StateMachine<
699
692
  type: 'update readOnly'
700
693
  readOnly: boolean
701
694
  }
702
- | {
703
- type: 'update schema'
704
- schema: EditorSchema
705
- }
706
- | {
707
- type: 'update key generator'
708
- keyGenerator: () => string
709
- }
710
695
  | {
711
696
  type: 'update maxBlocks'
712
697
  maxBlocks: number | undefined
@@ -730,6 +715,10 @@ declare const editorMachine: StateMachine<
730
715
  | {
731
716
  type: 'normalizing'
732
717
  }
718
+ | {
719
+ type: 'update selection'
720
+ selection: EditorSelection
721
+ }
733
722
  | {
734
723
  type: 'done normalizing'
735
724
  }
@@ -747,62 +736,6 @@ declare const editorMachine: StateMachine<
747
736
  preventDefault: () => void
748
737
  }
749
738
  }
750
- | {
751
- type: 'notify.patch'
752
- patch: Patch
753
- }
754
- | {
755
- type: 'notify.mutation'
756
- patches: Array<Patch>
757
- snapshot: Array<PortableTextBlock> | undefined
758
- value: Array<PortableTextBlock> | undefined
759
- }
760
- | {
761
- type: 'notify.blurred'
762
- event: FocusEvent_2<HTMLDivElement, Element>
763
- }
764
- | {
765
- type: 'notify.done loading'
766
- }
767
- | {
768
- type: 'notify.editable'
769
- }
770
- | {
771
- type: 'notify.error'
772
- name: string
773
- description: string
774
- data: unknown
775
- }
776
- | {
777
- type: 'notify.focused'
778
- event: FocusEvent_2<HTMLDivElement, Element>
779
- }
780
- | {
781
- type: 'notify.invalid value'
782
- resolution: InvalidValueResolution | null
783
- value: Array<PortableTextBlock> | undefined
784
- }
785
- | {
786
- type: 'notify.loading'
787
- }
788
- | {
789
- type: 'notify.read only'
790
- }
791
- | {
792
- type: 'notify.ready'
793
- }
794
- | {
795
- type: 'notify.selection'
796
- selection: EditorSelection
797
- }
798
- | {
799
- type: 'notify.value changed'
800
- value: Array<PortableTextBlock> | undefined
801
- }
802
- | {
803
- type: 'notify.unset'
804
- previousValue: Array<PortableTextBlock>
805
- }
806
739
  | {
807
740
  type: 'dragstart'
808
741
  origin: Pick<EventPosition, 'selection'>
@@ -825,10 +758,6 @@ declare const editorMachine: StateMachine<
825
758
  type: 'remove behavior from context'
826
759
  params: NonReducibleUnknown
827
760
  }
828
- 'assign schema': {
829
- type: 'assign schema'
830
- params: NonReducibleUnknown
831
- }
832
761
  'emit patch event': {
833
762
  type: 'emit patch event'
834
763
  params: NonReducibleUnknown
@@ -928,7 +857,6 @@ declare const editorMachine: StateMachine<
928
857
  initialValue?: Array<PortableTextBlock>
929
858
  },
930
859
  NonReducibleUnknown,
931
- | PatchEvent
932
860
  | InternalPatchEvent
933
861
  | MutationEvent
934
862
  | PatchesEvent
@@ -973,8 +901,7 @@ declare const editorMachine: StateMachine<
973
901
  | {
974
902
  type: 'value changed'
975
903
  value: Array<PortableTextBlock> | undefined
976
- }
977
- | UnsetEvent,
904
+ },
978
905
  MetaObject,
979
906
  {
980
907
  readonly id: 'editor'
@@ -1039,14 +966,6 @@ declare const editorMachine: StateMachine<
1039
966
  type: 'update readOnly'
1040
967
  readOnly: boolean
1041
968
  }
1042
- | {
1043
- type: 'update schema'
1044
- schema: EditorSchema
1045
- }
1046
- | {
1047
- type: 'update key generator'
1048
- keyGenerator: () => string
1049
- }
1050
969
  | {
1051
970
  type: 'update maxBlocks'
1052
971
  maxBlocks: number | undefined
@@ -1070,6 +989,10 @@ declare const editorMachine: StateMachine<
1070
989
  | {
1071
990
  type: 'normalizing'
1072
991
  }
992
+ | {
993
+ type: 'update selection'
994
+ selection: EditorSelection
995
+ }
1073
996
  | {
1074
997
  type: 'done normalizing'
1075
998
  }
@@ -1087,62 +1010,6 @@ declare const editorMachine: StateMachine<
1087
1010
  preventDefault: () => void
1088
1011
  }
1089
1012
  }
1090
- | {
1091
- type: 'notify.patch'
1092
- patch: Patch
1093
- }
1094
- | {
1095
- type: 'notify.mutation'
1096
- patches: Array<Patch>
1097
- snapshot: Array<PortableTextBlock> | undefined
1098
- value: Array<PortableTextBlock> | undefined
1099
- }
1100
- | {
1101
- type: 'notify.blurred'
1102
- event: FocusEvent_2<HTMLDivElement, Element>
1103
- }
1104
- | {
1105
- type: 'notify.done loading'
1106
- }
1107
- | {
1108
- type: 'notify.editable'
1109
- }
1110
- | {
1111
- type: 'notify.error'
1112
- name: string
1113
- description: string
1114
- data: unknown
1115
- }
1116
- | {
1117
- type: 'notify.focused'
1118
- event: FocusEvent_2<HTMLDivElement, Element>
1119
- }
1120
- | {
1121
- type: 'notify.invalid value'
1122
- resolution: InvalidValueResolution | null
1123
- value: Array<PortableTextBlock> | undefined
1124
- }
1125
- | {
1126
- type: 'notify.loading'
1127
- }
1128
- | {
1129
- type: 'notify.read only'
1130
- }
1131
- | {
1132
- type: 'notify.ready'
1133
- }
1134
- | {
1135
- type: 'notify.selection'
1136
- selection: EditorSelection
1137
- }
1138
- | {
1139
- type: 'notify.value changed'
1140
- value: Array<PortableTextBlock> | undefined
1141
- }
1142
- | {
1143
- type: 'notify.unset'
1144
- previousValue: Array<PortableTextBlock>
1145
- }
1146
1013
  | {
1147
1014
  type: 'dragstart'
1148
1015
  origin: Pick<EventPosition, 'selection'>
@@ -1168,14 +1035,6 @@ declare const editorMachine: StateMachine<
1168
1035
  type: 'update readOnly'
1169
1036
  readOnly: boolean
1170
1037
  }
1171
- | {
1172
- type: 'update schema'
1173
- schema: EditorSchema
1174
- }
1175
- | {
1176
- type: 'update key generator'
1177
- keyGenerator: () => string
1178
- }
1179
1038
  | {
1180
1039
  type: 'update maxBlocks'
1181
1040
  maxBlocks: number | undefined
@@ -1199,6 +1058,10 @@ declare const editorMachine: StateMachine<
1199
1058
  | {
1200
1059
  type: 'normalizing'
1201
1060
  }
1061
+ | {
1062
+ type: 'update selection'
1063
+ selection: EditorSelection
1064
+ }
1202
1065
  | {
1203
1066
  type: 'done normalizing'
1204
1067
  }
@@ -1216,62 +1079,6 @@ declare const editorMachine: StateMachine<
1216
1079
  preventDefault: () => void
1217
1080
  }
1218
1081
  }
1219
- | {
1220
- type: 'notify.patch'
1221
- patch: Patch
1222
- }
1223
- | {
1224
- type: 'notify.mutation'
1225
- patches: Array<Patch>
1226
- snapshot: Array<PortableTextBlock> | undefined
1227
- value: Array<PortableTextBlock> | undefined
1228
- }
1229
- | {
1230
- type: 'notify.blurred'
1231
- event: FocusEvent_2<HTMLDivElement, Element>
1232
- }
1233
- | {
1234
- type: 'notify.done loading'
1235
- }
1236
- | {
1237
- type: 'notify.editable'
1238
- }
1239
- | {
1240
- type: 'notify.error'
1241
- name: string
1242
- description: string
1243
- data: unknown
1244
- }
1245
- | {
1246
- type: 'notify.focused'
1247
- event: FocusEvent_2<HTMLDivElement, Element>
1248
- }
1249
- | {
1250
- type: 'notify.invalid value'
1251
- resolution: InvalidValueResolution | null
1252
- value: Array<PortableTextBlock> | undefined
1253
- }
1254
- | {
1255
- type: 'notify.loading'
1256
- }
1257
- | {
1258
- type: 'notify.read only'
1259
- }
1260
- | {
1261
- type: 'notify.ready'
1262
- }
1263
- | {
1264
- type: 'notify.selection'
1265
- selection: EditorSelection
1266
- }
1267
- | {
1268
- type: 'notify.value changed'
1269
- value: Array<PortableTextBlock> | undefined
1270
- }
1271
- | {
1272
- type: 'notify.unset'
1273
- previousValue: Array<PortableTextBlock>
1274
- }
1275
1082
  | {
1276
1083
  type: 'dragstart'
1277
1084
  origin: Pick<EventPosition, 'selection'>
@@ -1299,7 +1106,13 @@ declare const editorMachine: StateMachine<
1299
1106
  initialValue: PortableTextBlock[] | undefined
1300
1107
  }
1301
1108
  readonly on: {
1302
- readonly 'notify.blurred': {
1109
+ readonly 'add behavior': {
1110
+ readonly actions: 'add behavior to context'
1111
+ }
1112
+ readonly 'remove behavior': {
1113
+ readonly actions: 'remove behavior from context'
1114
+ }
1115
+ readonly 'update maxBlocks': {
1303
1116
  readonly actions: ActionFunction<
1304
1117
  {
1305
1118
  behaviors: Set<BehaviorConfig>
@@ -1320,8 +1133,8 @@ declare const editorMachine: StateMachine<
1320
1133
  slateEditor?: PortableTextSlateEditor
1321
1134
  },
1322
1135
  {
1323
- type: 'notify.blurred'
1324
- event: FocusEvent_2<HTMLDivElement, Element>
1136
+ type: 'update maxBlocks'
1137
+ maxBlocks: number | undefined
1325
1138
  },
1326
1139
  | InternalPatchEvent
1327
1140
  | MutationEvent
@@ -1330,14 +1143,6 @@ declare const editorMachine: StateMachine<
1330
1143
  type: 'update readOnly'
1331
1144
  readOnly: boolean
1332
1145
  }
1333
- | {
1334
- type: 'update schema'
1335
- schema: EditorSchema
1336
- }
1337
- | {
1338
- type: 'update key generator'
1339
- keyGenerator: () => string
1340
- }
1341
1146
  | {
1342
1147
  type: 'update maxBlocks'
1343
1148
  maxBlocks: number | undefined
@@ -1361,6 +1166,10 @@ declare const editorMachine: StateMachine<
1361
1166
  | {
1362
1167
  type: 'normalizing'
1363
1168
  }
1169
+ | {
1170
+ type: 'update selection'
1171
+ selection: EditorSelection
1172
+ }
1364
1173
  | {
1365
1174
  type: 'done normalizing'
1366
1175
  }
@@ -1378,62 +1187,6 @@ declare const editorMachine: StateMachine<
1378
1187
  preventDefault: () => void
1379
1188
  }
1380
1189
  }
1381
- | {
1382
- type: 'notify.patch'
1383
- patch: Patch
1384
- }
1385
- | {
1386
- type: 'notify.mutation'
1387
- patches: Array<Patch>
1388
- snapshot: Array<PortableTextBlock> | undefined
1389
- value: Array<PortableTextBlock> | undefined
1390
- }
1391
- | {
1392
- type: 'notify.blurred'
1393
- event: FocusEvent_2<HTMLDivElement, Element>
1394
- }
1395
- | {
1396
- type: 'notify.done loading'
1397
- }
1398
- | {
1399
- type: 'notify.editable'
1400
- }
1401
- | {
1402
- type: 'notify.error'
1403
- name: string
1404
- description: string
1405
- data: unknown
1406
- }
1407
- | {
1408
- type: 'notify.focused'
1409
- event: FocusEvent_2<HTMLDivElement, Element>
1410
- }
1411
- | {
1412
- type: 'notify.invalid value'
1413
- resolution: InvalidValueResolution | null
1414
- value: Array<PortableTextBlock> | undefined
1415
- }
1416
- | {
1417
- type: 'notify.loading'
1418
- }
1419
- | {
1420
- type: 'notify.read only'
1421
- }
1422
- | {
1423
- type: 'notify.ready'
1424
- }
1425
- | {
1426
- type: 'notify.selection'
1427
- selection: EditorSelection
1428
- }
1429
- | {
1430
- type: 'notify.value changed'
1431
- value: Array<PortableTextBlock> | undefined
1432
- }
1433
- | {
1434
- type: 'notify.unset'
1435
- previousValue: Array<PortableTextBlock>
1436
- }
1437
1190
  | {
1438
1191
  type: 'dragstart'
1439
1192
  origin: Pick<EventPosition, 'selection'>
@@ -1450,2126 +1203,104 @@ declare const editorMachine: StateMachine<
1450
1203
  never,
1451
1204
  never,
1452
1205
  never,
1453
- | PatchEvent
1454
- | InternalPatchEvent
1455
- | MutationEvent
1456
- | PatchesEvent
1457
- | {
1458
- type: 'blurred'
1459
- event: FocusEvent_2<HTMLDivElement, Element>
1460
- }
1461
- | {
1462
- type: 'done loading'
1463
- }
1464
- | {
1465
- type: 'editable'
1466
- }
1467
- | {
1468
- type: 'error'
1469
- name: string
1470
- description: string
1471
- data: unknown
1472
- }
1473
- | {
1474
- type: 'focused'
1475
- event: FocusEvent_2<HTMLDivElement, Element>
1476
- }
1477
- | {
1478
- type: 'invalid value'
1479
- resolution: InvalidValueResolution | null
1480
- value: Array<PortableTextBlock> | undefined
1481
- }
1482
- | {
1483
- type: 'loading'
1484
- }
1485
- | {
1486
- type: 'read only'
1487
- }
1488
- | {
1489
- type: 'ready'
1490
- }
1491
- | {
1492
- type: 'selection'
1493
- selection: EditorSelection
1494
- }
1495
- | {
1496
- type: 'value changed'
1497
- value: Array<PortableTextBlock> | undefined
1498
- }
1499
- | UnsetEvent
1206
+ never
1500
1207
  >
1501
1208
  }
1502
- readonly 'notify.done loading': {
1503
- readonly actions: ActionFunction<
1504
- {
1505
- behaviors: Set<BehaviorConfig>
1506
- converters: Set<Converter>
1507
- getLegacySchema: () => PortableTextMemberSchemaTypes
1508
- keyGenerator: () => string
1509
- pendingEvents: Array<InternalPatchEvent | MutationEvent>
1510
- pendingIncomingPatchesEvents: Array<PatchesEvent>
1511
- schema: EditorSchema
1512
- initialReadOnly: boolean
1513
- maxBlocks: number | undefined
1514
- selection: EditorSelection
1515
- initialValue: Array<PortableTextBlock> | undefined
1516
- internalDrag?: {
1517
- ghost?: HTMLElement
1518
- origin: Pick<EventPosition, 'selection'>
1519
- }
1520
- slateEditor?: PortableTextSlateEditor
1521
- },
1522
- {
1523
- type: 'notify.done loading'
1524
- },
1525
- | InternalPatchEvent
1526
- | MutationEvent
1527
- | PatchesEvent
1528
- | {
1529
- type: 'update readOnly'
1530
- readOnly: boolean
1531
- }
1532
- | {
1533
- type: 'update schema'
1534
- schema: EditorSchema
1535
- }
1536
- | {
1537
- type: 'update key generator'
1209
+ readonly 'update selection': {
1210
+ readonly actions: readonly [
1211
+ ActionFunction<
1212
+ {
1213
+ behaviors: Set<BehaviorConfig>
1214
+ converters: Set<Converter>
1215
+ getLegacySchema: () => PortableTextMemberSchemaTypes
1538
1216
  keyGenerator: () => string
1539
- }
1540
- | {
1541
- type: 'update maxBlocks'
1217
+ pendingEvents: Array<InternalPatchEvent | MutationEvent>
1218
+ pendingIncomingPatchesEvents: Array<PatchesEvent>
1219
+ schema: EditorSchema
1220
+ initialReadOnly: boolean
1542
1221
  maxBlocks: number | undefined
1543
- }
1544
- | {
1545
- type: 'add behavior'
1546
- behaviorConfig: BehaviorConfig
1547
- }
1548
- | {
1549
- type: 'remove behavior'
1550
- behaviorConfig: BehaviorConfig
1551
- }
1552
- | {
1553
- type: 'blur'
1554
- editor: PortableTextSlateEditor
1555
- }
1556
- | {
1557
- type: 'focus'
1558
- editor: PortableTextSlateEditor
1559
- }
1560
- | {
1561
- type: 'normalizing'
1562
- }
1563
- | {
1564
- type: 'done normalizing'
1565
- }
1566
- | {
1567
- type: 'done syncing value'
1568
- }
1569
- | {
1570
- type: 'syncing value'
1571
- }
1572
- | {
1573
- type: 'behavior event'
1574
- behaviorEvent: BehaviorEvent
1575
- editor: PortableTextSlateEditor
1576
- nativeEvent?: {
1577
- preventDefault: () => void
1578
- }
1579
- }
1580
- | {
1581
- type: 'notify.patch'
1582
- patch: Patch
1583
- }
1584
- | {
1585
- type: 'notify.mutation'
1586
- patches: Array<Patch>
1587
- snapshot: Array<PortableTextBlock> | undefined
1588
- value: Array<PortableTextBlock> | undefined
1589
- }
1590
- | {
1591
- type: 'notify.blurred'
1592
- event: FocusEvent_2<HTMLDivElement, Element>
1593
- }
1594
- | {
1595
- type: 'notify.done loading'
1596
- }
1597
- | {
1598
- type: 'notify.editable'
1599
- }
1600
- | {
1601
- type: 'notify.error'
1602
- name: string
1603
- description: string
1604
- data: unknown
1605
- }
1606
- | {
1607
- type: 'notify.focused'
1608
- event: FocusEvent_2<HTMLDivElement, Element>
1609
- }
1610
- | {
1611
- type: 'notify.invalid value'
1612
- resolution: InvalidValueResolution | null
1613
- value: Array<PortableTextBlock> | undefined
1614
- }
1615
- | {
1616
- type: 'notify.loading'
1617
- }
1618
- | {
1619
- type: 'notify.read only'
1620
- }
1621
- | {
1622
- type: 'notify.ready'
1623
- }
1624
- | {
1625
- type: 'notify.selection'
1626
- selection: EditorSelection
1627
- }
1628
- | {
1629
- type: 'notify.value changed'
1630
- value: Array<PortableTextBlock> | undefined
1631
- }
1632
- | {
1633
- type: 'notify.unset'
1634
- previousValue: Array<PortableTextBlock>
1635
- }
1636
- | {
1637
- type: 'dragstart'
1638
- origin: Pick<EventPosition, 'selection'>
1639
- ghost?: HTMLElement
1640
- }
1641
- | {
1642
- type: 'dragend'
1643
- }
1644
- | {
1645
- type: 'drop'
1646
- },
1647
- undefined,
1648
- never,
1649
- never,
1650
- never,
1651
- never,
1652
- | PatchEvent
1653
- | InternalPatchEvent
1654
- | MutationEvent
1655
- | PatchesEvent
1656
- | {
1657
- type: 'blurred'
1658
- event: FocusEvent_2<HTMLDivElement, Element>
1659
- }
1660
- | {
1661
- type: 'done loading'
1662
- }
1663
- | {
1664
- type: 'editable'
1665
- }
1666
- | {
1667
- type: 'error'
1668
- name: string
1669
- description: string
1670
- data: unknown
1671
- }
1672
- | {
1673
- type: 'focused'
1674
- event: FocusEvent_2<HTMLDivElement, Element>
1675
- }
1676
- | {
1677
- type: 'invalid value'
1678
- resolution: InvalidValueResolution | null
1679
- value: Array<PortableTextBlock> | undefined
1680
- }
1681
- | {
1682
- type: 'loading'
1683
- }
1684
- | {
1685
- type: 'read only'
1686
- }
1687
- | {
1688
- type: 'ready'
1689
- }
1690
- | {
1691
- type: 'selection'
1692
- selection: EditorSelection
1693
- }
1694
- | {
1695
- type: 'value changed'
1696
- value: Array<PortableTextBlock> | undefined
1697
- }
1698
- | UnsetEvent
1699
- >
1700
- }
1701
- readonly 'notify.error': {
1702
- readonly actions: ActionFunction<
1703
- {
1704
- behaviors: Set<BehaviorConfig>
1705
- converters: Set<Converter>
1706
- getLegacySchema: () => PortableTextMemberSchemaTypes
1707
- keyGenerator: () => string
1708
- pendingEvents: Array<InternalPatchEvent | MutationEvent>
1709
- pendingIncomingPatchesEvents: Array<PatchesEvent>
1710
- schema: EditorSchema
1711
- initialReadOnly: boolean
1712
- maxBlocks: number | undefined
1713
- selection: EditorSelection
1714
- initialValue: Array<PortableTextBlock> | undefined
1715
- internalDrag?: {
1716
- ghost?: HTMLElement
1717
- origin: Pick<EventPosition, 'selection'>
1718
- }
1719
- slateEditor?: PortableTextSlateEditor
1720
- },
1721
- {
1722
- type: 'notify.error'
1723
- name: string
1724
- description: string
1725
- data: unknown
1726
- },
1727
- | InternalPatchEvent
1728
- | MutationEvent
1729
- | PatchesEvent
1730
- | {
1731
- type: 'update readOnly'
1732
- readOnly: boolean
1733
- }
1734
- | {
1735
- type: 'update schema'
1736
- schema: EditorSchema
1737
- }
1738
- | {
1739
- type: 'update key generator'
1740
- keyGenerator: () => string
1741
- }
1742
- | {
1743
- type: 'update maxBlocks'
1744
- maxBlocks: number | undefined
1745
- }
1746
- | {
1747
- type: 'add behavior'
1748
- behaviorConfig: BehaviorConfig
1749
- }
1750
- | {
1751
- type: 'remove behavior'
1752
- behaviorConfig: BehaviorConfig
1753
- }
1754
- | {
1755
- type: 'blur'
1756
- editor: PortableTextSlateEditor
1757
- }
1758
- | {
1759
- type: 'focus'
1760
- editor: PortableTextSlateEditor
1761
- }
1762
- | {
1763
- type: 'normalizing'
1764
- }
1765
- | {
1766
- type: 'done normalizing'
1767
- }
1768
- | {
1769
- type: 'done syncing value'
1770
- }
1771
- | {
1772
- type: 'syncing value'
1773
- }
1774
- | {
1775
- type: 'behavior event'
1776
- behaviorEvent: BehaviorEvent
1777
- editor: PortableTextSlateEditor
1778
- nativeEvent?: {
1779
- preventDefault: () => void
1780
- }
1781
- }
1782
- | {
1783
- type: 'notify.patch'
1784
- patch: Patch
1785
- }
1786
- | {
1787
- type: 'notify.mutation'
1788
- patches: Array<Patch>
1789
- snapshot: Array<PortableTextBlock> | undefined
1790
- value: Array<PortableTextBlock> | undefined
1791
- }
1792
- | {
1793
- type: 'notify.blurred'
1794
- event: FocusEvent_2<HTMLDivElement, Element>
1795
- }
1796
- | {
1797
- type: 'notify.done loading'
1798
- }
1799
- | {
1800
- type: 'notify.editable'
1801
- }
1802
- | {
1803
- type: 'notify.error'
1804
- name: string
1805
- description: string
1806
- data: unknown
1807
- }
1808
- | {
1809
- type: 'notify.focused'
1810
- event: FocusEvent_2<HTMLDivElement, Element>
1811
- }
1812
- | {
1813
- type: 'notify.invalid value'
1814
- resolution: InvalidValueResolution | null
1815
- value: Array<PortableTextBlock> | undefined
1816
- }
1817
- | {
1818
- type: 'notify.loading'
1819
- }
1820
- | {
1821
- type: 'notify.read only'
1822
- }
1823
- | {
1824
- type: 'notify.ready'
1825
- }
1826
- | {
1827
- type: 'notify.selection'
1828
- selection: EditorSelection
1829
- }
1830
- | {
1831
- type: 'notify.value changed'
1832
- value: Array<PortableTextBlock> | undefined
1833
- }
1834
- | {
1835
- type: 'notify.unset'
1836
- previousValue: Array<PortableTextBlock>
1837
- }
1838
- | {
1839
- type: 'dragstart'
1840
- origin: Pick<EventPosition, 'selection'>
1841
- ghost?: HTMLElement
1842
- }
1843
- | {
1844
- type: 'dragend'
1845
- }
1846
- | {
1847
- type: 'drop'
1848
- },
1849
- undefined,
1850
- never,
1851
- never,
1852
- never,
1853
- never,
1854
- | PatchEvent
1855
- | InternalPatchEvent
1856
- | MutationEvent
1857
- | PatchesEvent
1858
- | {
1859
- type: 'blurred'
1860
- event: FocusEvent_2<HTMLDivElement, Element>
1861
- }
1862
- | {
1863
- type: 'done loading'
1864
- }
1865
- | {
1866
- type: 'editable'
1867
- }
1868
- | {
1869
- type: 'error'
1870
- name: string
1871
- description: string
1872
- data: unknown
1873
- }
1874
- | {
1875
- type: 'focused'
1876
- event: FocusEvent_2<HTMLDivElement, Element>
1877
- }
1878
- | {
1879
- type: 'invalid value'
1880
- resolution: InvalidValueResolution | null
1881
- value: Array<PortableTextBlock> | undefined
1882
- }
1883
- | {
1884
- type: 'loading'
1885
- }
1886
- | {
1887
- type: 'read only'
1888
- }
1889
- | {
1890
- type: 'ready'
1891
- }
1892
- | {
1893
- type: 'selection'
1894
- selection: EditorSelection
1895
- }
1896
- | {
1897
- type: 'value changed'
1898
- value: Array<PortableTextBlock> | undefined
1899
- }
1900
- | UnsetEvent
1901
- >
1902
- }
1903
- readonly 'notify.invalid value': {
1904
- readonly actions: ActionFunction<
1905
- {
1906
- behaviors: Set<BehaviorConfig>
1907
- converters: Set<Converter>
1908
- getLegacySchema: () => PortableTextMemberSchemaTypes
1909
- keyGenerator: () => string
1910
- pendingEvents: Array<InternalPatchEvent | MutationEvent>
1911
- pendingIncomingPatchesEvents: Array<PatchesEvent>
1912
- schema: EditorSchema
1913
- initialReadOnly: boolean
1914
- maxBlocks: number | undefined
1915
- selection: EditorSelection
1916
- initialValue: Array<PortableTextBlock> | undefined
1917
- internalDrag?: {
1918
- ghost?: HTMLElement
1919
- origin: Pick<EventPosition, 'selection'>
1920
- }
1921
- slateEditor?: PortableTextSlateEditor
1922
- },
1923
- {
1924
- type: 'notify.invalid value'
1925
- resolution: InvalidValueResolution | null
1926
- value: Array<PortableTextBlock> | undefined
1927
- },
1928
- | InternalPatchEvent
1929
- | MutationEvent
1930
- | PatchesEvent
1931
- | {
1932
- type: 'update readOnly'
1933
- readOnly: boolean
1934
- }
1935
- | {
1936
- type: 'update schema'
1937
- schema: EditorSchema
1938
- }
1939
- | {
1940
- type: 'update key generator'
1941
- keyGenerator: () => string
1942
- }
1943
- | {
1944
- type: 'update maxBlocks'
1945
- maxBlocks: number | undefined
1946
- }
1947
- | {
1948
- type: 'add behavior'
1949
- behaviorConfig: BehaviorConfig
1950
- }
1951
- | {
1952
- type: 'remove behavior'
1953
- behaviorConfig: BehaviorConfig
1954
- }
1955
- | {
1956
- type: 'blur'
1957
- editor: PortableTextSlateEditor
1958
- }
1959
- | {
1960
- type: 'focus'
1961
- editor: PortableTextSlateEditor
1962
- }
1963
- | {
1964
- type: 'normalizing'
1965
- }
1966
- | {
1967
- type: 'done normalizing'
1968
- }
1969
- | {
1970
- type: 'done syncing value'
1971
- }
1972
- | {
1973
- type: 'syncing value'
1974
- }
1975
- | {
1976
- type: 'behavior event'
1977
- behaviorEvent: BehaviorEvent
1978
- editor: PortableTextSlateEditor
1979
- nativeEvent?: {
1980
- preventDefault: () => void
1981
- }
1982
- }
1983
- | {
1984
- type: 'notify.patch'
1985
- patch: Patch
1986
- }
1987
- | {
1988
- type: 'notify.mutation'
1989
- patches: Array<Patch>
1990
- snapshot: Array<PortableTextBlock> | undefined
1991
- value: Array<PortableTextBlock> | undefined
1992
- }
1993
- | {
1994
- type: 'notify.blurred'
1995
- event: FocusEvent_2<HTMLDivElement, Element>
1996
- }
1997
- | {
1998
- type: 'notify.done loading'
1999
- }
2000
- | {
2001
- type: 'notify.editable'
2002
- }
2003
- | {
2004
- type: 'notify.error'
2005
- name: string
2006
- description: string
2007
- data: unknown
2008
- }
2009
- | {
2010
- type: 'notify.focused'
2011
- event: FocusEvent_2<HTMLDivElement, Element>
2012
- }
2013
- | {
2014
- type: 'notify.invalid value'
2015
- resolution: InvalidValueResolution | null
2016
- value: Array<PortableTextBlock> | undefined
2017
- }
2018
- | {
2019
- type: 'notify.loading'
2020
- }
2021
- | {
2022
- type: 'notify.read only'
2023
- }
2024
- | {
2025
- type: 'notify.ready'
2026
- }
2027
- | {
2028
- type: 'notify.selection'
2029
- selection: EditorSelection
2030
- }
2031
- | {
2032
- type: 'notify.value changed'
2033
- value: Array<PortableTextBlock> | undefined
2034
- }
2035
- | {
2036
- type: 'notify.unset'
2037
- previousValue: Array<PortableTextBlock>
2038
- }
2039
- | {
2040
- type: 'dragstart'
2041
- origin: Pick<EventPosition, 'selection'>
2042
- ghost?: HTMLElement
2043
- }
2044
- | {
2045
- type: 'dragend'
2046
- }
2047
- | {
2048
- type: 'drop'
2049
- },
2050
- undefined,
2051
- never,
2052
- never,
2053
- never,
2054
- never,
2055
- | PatchEvent
2056
- | InternalPatchEvent
2057
- | MutationEvent
2058
- | PatchesEvent
2059
- | {
2060
- type: 'blurred'
2061
- event: FocusEvent_2<HTMLDivElement, Element>
2062
- }
2063
- | {
2064
- type: 'done loading'
2065
- }
2066
- | {
2067
- type: 'editable'
2068
- }
2069
- | {
2070
- type: 'error'
2071
- name: string
2072
- description: string
2073
- data: unknown
2074
- }
2075
- | {
2076
- type: 'focused'
2077
- event: FocusEvent_2<HTMLDivElement, Element>
2078
- }
2079
- | {
2080
- type: 'invalid value'
2081
- resolution: InvalidValueResolution | null
2082
- value: Array<PortableTextBlock> | undefined
2083
- }
2084
- | {
2085
- type: 'loading'
2086
- }
2087
- | {
2088
- type: 'read only'
2089
- }
2090
- | {
2091
- type: 'ready'
2092
- }
2093
- | {
2094
- type: 'selection'
2095
- selection: EditorSelection
2096
- }
2097
- | {
2098
- type: 'value changed'
2099
- value: Array<PortableTextBlock> | undefined
2100
- }
2101
- | UnsetEvent
2102
- >
2103
- }
2104
- readonly 'notify.focused': {
2105
- readonly actions: ActionFunction<
2106
- {
2107
- behaviors: Set<BehaviorConfig>
2108
- converters: Set<Converter>
2109
- getLegacySchema: () => PortableTextMemberSchemaTypes
2110
- keyGenerator: () => string
2111
- pendingEvents: Array<InternalPatchEvent | MutationEvent>
2112
- pendingIncomingPatchesEvents: Array<PatchesEvent>
2113
- schema: EditorSchema
2114
- initialReadOnly: boolean
2115
- maxBlocks: number | undefined
2116
- selection: EditorSelection
2117
- initialValue: Array<PortableTextBlock> | undefined
2118
- internalDrag?: {
2119
- ghost?: HTMLElement
2120
- origin: Pick<EventPosition, 'selection'>
2121
- }
2122
- slateEditor?: PortableTextSlateEditor
2123
- },
2124
- {
2125
- type: 'notify.focused'
2126
- event: FocusEvent_2<HTMLDivElement, Element>
2127
- },
2128
- | InternalPatchEvent
2129
- | MutationEvent
2130
- | PatchesEvent
2131
- | {
2132
- type: 'update readOnly'
2133
- readOnly: boolean
2134
- }
2135
- | {
2136
- type: 'update schema'
2137
- schema: EditorSchema
2138
- }
2139
- | {
2140
- type: 'update key generator'
2141
- keyGenerator: () => string
2142
- }
2143
- | {
2144
- type: 'update maxBlocks'
2145
- maxBlocks: number | undefined
2146
- }
2147
- | {
2148
- type: 'add behavior'
2149
- behaviorConfig: BehaviorConfig
2150
- }
2151
- | {
2152
- type: 'remove behavior'
2153
- behaviorConfig: BehaviorConfig
2154
- }
2155
- | {
2156
- type: 'blur'
2157
- editor: PortableTextSlateEditor
2158
- }
2159
- | {
2160
- type: 'focus'
2161
- editor: PortableTextSlateEditor
2162
- }
2163
- | {
2164
- type: 'normalizing'
2165
- }
2166
- | {
2167
- type: 'done normalizing'
2168
- }
2169
- | {
2170
- type: 'done syncing value'
2171
- }
2172
- | {
2173
- type: 'syncing value'
2174
- }
2175
- | {
2176
- type: 'behavior event'
2177
- behaviorEvent: BehaviorEvent
2178
- editor: PortableTextSlateEditor
2179
- nativeEvent?: {
2180
- preventDefault: () => void
2181
- }
2182
- }
2183
- | {
2184
- type: 'notify.patch'
2185
- patch: Patch
2186
- }
2187
- | {
2188
- type: 'notify.mutation'
2189
- patches: Array<Patch>
2190
- snapshot: Array<PortableTextBlock> | undefined
2191
- value: Array<PortableTextBlock> | undefined
2192
- }
2193
- | {
2194
- type: 'notify.blurred'
2195
- event: FocusEvent_2<HTMLDivElement, Element>
2196
- }
2197
- | {
2198
- type: 'notify.done loading'
2199
- }
2200
- | {
2201
- type: 'notify.editable'
2202
- }
2203
- | {
2204
- type: 'notify.error'
2205
- name: string
2206
- description: string
2207
- data: unknown
2208
- }
2209
- | {
2210
- type: 'notify.focused'
2211
- event: FocusEvent_2<HTMLDivElement, Element>
2212
- }
2213
- | {
2214
- type: 'notify.invalid value'
2215
- resolution: InvalidValueResolution | null
2216
- value: Array<PortableTextBlock> | undefined
2217
- }
2218
- | {
2219
- type: 'notify.loading'
2220
- }
2221
- | {
2222
- type: 'notify.read only'
2223
- }
2224
- | {
2225
- type: 'notify.ready'
2226
- }
2227
- | {
2228
- type: 'notify.selection'
2229
- selection: EditorSelection
2230
- }
2231
- | {
2232
- type: 'notify.value changed'
2233
- value: Array<PortableTextBlock> | undefined
2234
- }
2235
- | {
2236
- type: 'notify.unset'
2237
- previousValue: Array<PortableTextBlock>
2238
- }
2239
- | {
2240
- type: 'dragstart'
2241
- origin: Pick<EventPosition, 'selection'>
2242
- ghost?: HTMLElement
2243
- }
2244
- | {
2245
- type: 'dragend'
2246
- }
2247
- | {
2248
- type: 'drop'
2249
- },
2250
- undefined,
2251
- never,
2252
- never,
2253
- never,
2254
- never,
2255
- | PatchEvent
2256
- | InternalPatchEvent
2257
- | MutationEvent
2258
- | PatchesEvent
2259
- | {
2260
- type: 'blurred'
2261
- event: FocusEvent_2<HTMLDivElement, Element>
2262
- }
2263
- | {
2264
- type: 'done loading'
2265
- }
2266
- | {
2267
- type: 'editable'
2268
- }
2269
- | {
2270
- type: 'error'
2271
- name: string
2272
- description: string
2273
- data: unknown
2274
- }
2275
- | {
2276
- type: 'focused'
2277
- event: FocusEvent_2<HTMLDivElement, Element>
2278
- }
2279
- | {
2280
- type: 'invalid value'
2281
- resolution: InvalidValueResolution | null
2282
- value: Array<PortableTextBlock> | undefined
2283
- }
2284
- | {
2285
- type: 'loading'
2286
- }
2287
- | {
2288
- type: 'read only'
2289
- }
2290
- | {
2291
- type: 'ready'
2292
- }
2293
- | {
2294
- type: 'selection'
2295
- selection: EditorSelection
2296
- }
2297
- | {
2298
- type: 'value changed'
2299
- value: Array<PortableTextBlock> | undefined
2300
- }
2301
- | UnsetEvent
2302
- >
2303
- }
2304
- readonly 'notify.selection': {
2305
- readonly actions: readonly [
2306
- ActionFunction<
2307
- {
2308
- behaviors: Set<BehaviorConfig>
2309
- converters: Set<Converter>
2310
- getLegacySchema: () => PortableTextMemberSchemaTypes
2311
- keyGenerator: () => string
2312
- pendingEvents: Array<InternalPatchEvent | MutationEvent>
2313
- pendingIncomingPatchesEvents: Array<PatchesEvent>
2314
- schema: EditorSchema
2315
- initialReadOnly: boolean
2316
- maxBlocks: number | undefined
2317
- selection: EditorSelection
2318
- initialValue: Array<PortableTextBlock> | undefined
2319
- internalDrag?: {
2320
- ghost?: HTMLElement
2321
- origin: Pick<EventPosition, 'selection'>
2322
- }
2323
- slateEditor?: PortableTextSlateEditor
2324
- },
2325
- {
2326
- type: 'notify.selection'
2327
- selection: EditorSelection
2328
- },
2329
- | InternalPatchEvent
2330
- | MutationEvent
2331
- | PatchesEvent
2332
- | {
2333
- type: 'update readOnly'
2334
- readOnly: boolean
2335
- }
2336
- | {
2337
- type: 'update schema'
2338
- schema: EditorSchema
2339
- }
2340
- | {
2341
- type: 'update key generator'
2342
- keyGenerator: () => string
2343
- }
2344
- | {
2345
- type: 'update maxBlocks'
2346
- maxBlocks: number | undefined
2347
- }
2348
- | {
2349
- type: 'add behavior'
2350
- behaviorConfig: BehaviorConfig
2351
- }
2352
- | {
2353
- type: 'remove behavior'
2354
- behaviorConfig: BehaviorConfig
2355
- }
2356
- | {
2357
- type: 'blur'
2358
- editor: PortableTextSlateEditor
2359
- }
2360
- | {
2361
- type: 'focus'
2362
- editor: PortableTextSlateEditor
2363
- }
2364
- | {
2365
- type: 'normalizing'
2366
- }
2367
- | {
2368
- type: 'done normalizing'
2369
- }
2370
- | {
2371
- type: 'done syncing value'
2372
- }
2373
- | {
2374
- type: 'syncing value'
2375
- }
2376
- | {
2377
- type: 'behavior event'
2378
- behaviorEvent: BehaviorEvent
2379
- editor: PortableTextSlateEditor
2380
- nativeEvent?: {
2381
- preventDefault: () => void
2382
- }
2383
- }
2384
- | {
2385
- type: 'notify.patch'
2386
- patch: Patch
2387
- }
2388
- | {
2389
- type: 'notify.mutation'
2390
- patches: Array<Patch>
2391
- snapshot: Array<PortableTextBlock> | undefined
2392
- value: Array<PortableTextBlock> | undefined
2393
- }
2394
- | {
2395
- type: 'notify.blurred'
2396
- event: FocusEvent_2<HTMLDivElement, Element>
2397
- }
2398
- | {
2399
- type: 'notify.done loading'
2400
- }
2401
- | {
2402
- type: 'notify.editable'
2403
- }
2404
- | {
2405
- type: 'notify.error'
2406
- name: string
2407
- description: string
2408
- data: unknown
2409
- }
2410
- | {
2411
- type: 'notify.focused'
2412
- event: FocusEvent_2<HTMLDivElement, Element>
2413
- }
2414
- | {
2415
- type: 'notify.invalid value'
2416
- resolution: InvalidValueResolution | null
2417
- value: Array<PortableTextBlock> | undefined
2418
- }
2419
- | {
2420
- type: 'notify.loading'
2421
- }
2422
- | {
2423
- type: 'notify.read only'
2424
- }
2425
- | {
2426
- type: 'notify.ready'
2427
- }
2428
- | {
2429
- type: 'notify.selection'
2430
- selection: EditorSelection
2431
- }
2432
- | {
2433
- type: 'notify.value changed'
2434
- value: Array<PortableTextBlock> | undefined
2435
- }
2436
- | {
2437
- type: 'notify.unset'
2438
- previousValue: Array<PortableTextBlock>
2439
- }
2440
- | {
2441
- type: 'dragstart'
2442
- origin: Pick<EventPosition, 'selection'>
2443
- ghost?: HTMLElement
2444
- }
2445
- | {
2446
- type: 'dragend'
2447
- }
2448
- | {
2449
- type: 'drop'
2450
- },
2451
- undefined,
2452
- never,
2453
- never,
2454
- never,
2455
- never,
2456
- never
2457
- >,
2458
- ActionFunction<
2459
- {
2460
- behaviors: Set<BehaviorConfig>
2461
- converters: Set<Converter>
2462
- getLegacySchema: () => PortableTextMemberSchemaTypes
2463
- keyGenerator: () => string
2464
- pendingEvents: Array<InternalPatchEvent | MutationEvent>
2465
- pendingIncomingPatchesEvents: Array<PatchesEvent>
2466
- schema: EditorSchema
2467
- initialReadOnly: boolean
2468
- maxBlocks: number | undefined
2469
- selection: EditorSelection
2470
- initialValue: Array<PortableTextBlock> | undefined
2471
- internalDrag?: {
2472
- ghost?: HTMLElement
2473
- origin: Pick<EventPosition, 'selection'>
2474
- }
2475
- slateEditor?: PortableTextSlateEditor
2476
- },
2477
- {
2478
- type: 'notify.selection'
2479
- selection: EditorSelection
2480
- },
2481
- | InternalPatchEvent
2482
- | MutationEvent
2483
- | PatchesEvent
2484
- | {
2485
- type: 'update readOnly'
2486
- readOnly: boolean
2487
- }
2488
- | {
2489
- type: 'update schema'
2490
- schema: EditorSchema
2491
- }
2492
- | {
2493
- type: 'update key generator'
2494
- keyGenerator: () => string
2495
- }
2496
- | {
2497
- type: 'update maxBlocks'
2498
- maxBlocks: number | undefined
2499
- }
2500
- | {
2501
- type: 'add behavior'
2502
- behaviorConfig: BehaviorConfig
2503
- }
2504
- | {
2505
- type: 'remove behavior'
2506
- behaviorConfig: BehaviorConfig
2507
- }
2508
- | {
2509
- type: 'blur'
2510
- editor: PortableTextSlateEditor
2511
- }
2512
- | {
2513
- type: 'focus'
2514
- editor: PortableTextSlateEditor
2515
- }
2516
- | {
2517
- type: 'normalizing'
2518
- }
2519
- | {
2520
- type: 'done normalizing'
2521
- }
2522
- | {
2523
- type: 'done syncing value'
2524
- }
2525
- | {
2526
- type: 'syncing value'
2527
- }
2528
- | {
2529
- type: 'behavior event'
2530
- behaviorEvent: BehaviorEvent
2531
- editor: PortableTextSlateEditor
2532
- nativeEvent?: {
2533
- preventDefault: () => void
2534
- }
2535
- }
2536
- | {
2537
- type: 'notify.patch'
2538
- patch: Patch
2539
- }
2540
- | {
2541
- type: 'notify.mutation'
2542
- patches: Array<Patch>
2543
- snapshot: Array<PortableTextBlock> | undefined
2544
- value: Array<PortableTextBlock> | undefined
2545
- }
2546
- | {
2547
- type: 'notify.blurred'
2548
- event: FocusEvent_2<HTMLDivElement, Element>
2549
- }
2550
- | {
2551
- type: 'notify.done loading'
2552
- }
2553
- | {
2554
- type: 'notify.editable'
2555
- }
2556
- | {
2557
- type: 'notify.error'
2558
- name: string
2559
- description: string
2560
- data: unknown
2561
- }
2562
- | {
2563
- type: 'notify.focused'
2564
- event: FocusEvent_2<HTMLDivElement, Element>
2565
- }
2566
- | {
2567
- type: 'notify.invalid value'
2568
- resolution: InvalidValueResolution | null
2569
- value: Array<PortableTextBlock> | undefined
2570
- }
2571
- | {
2572
- type: 'notify.loading'
2573
- }
2574
- | {
2575
- type: 'notify.read only'
2576
- }
2577
- | {
2578
- type: 'notify.ready'
2579
- }
2580
- | {
2581
- type: 'notify.selection'
2582
- selection: EditorSelection
2583
- }
2584
- | {
2585
- type: 'notify.value changed'
2586
- value: Array<PortableTextBlock> | undefined
2587
- }
2588
- | {
2589
- type: 'notify.unset'
2590
- previousValue: Array<PortableTextBlock>
2591
- }
2592
- | {
2593
- type: 'dragstart'
2594
- origin: Pick<EventPosition, 'selection'>
2595
- ghost?: HTMLElement
2596
- }
2597
- | {
2598
- type: 'dragend'
2599
- }
2600
- | {
2601
- type: 'drop'
2602
- },
2603
- undefined,
2604
- never,
2605
- never,
2606
- never,
2607
- never,
2608
- | PatchEvent
2609
- | InternalPatchEvent
2610
- | MutationEvent
2611
- | PatchesEvent
2612
- | {
2613
- type: 'blurred'
2614
- event: FocusEvent_2<HTMLDivElement, Element>
2615
- }
2616
- | {
2617
- type: 'done loading'
2618
- }
2619
- | {
2620
- type: 'editable'
2621
- }
2622
- | {
2623
- type: 'error'
2624
- name: string
2625
- description: string
2626
- data: unknown
2627
- }
2628
- | {
2629
- type: 'focused'
2630
- event: FocusEvent_2<HTMLDivElement, Element>
2631
- }
2632
- | {
2633
- type: 'invalid value'
2634
- resolution: InvalidValueResolution | null
2635
- value: Array<PortableTextBlock> | undefined
2636
- }
2637
- | {
2638
- type: 'loading'
2639
- }
2640
- | {
2641
- type: 'read only'
2642
- }
2643
- | {
2644
- type: 'ready'
2645
- }
2646
- | {
2647
- type: 'selection'
2648
- selection: EditorSelection
2649
- }
2650
- | {
2651
- type: 'value changed'
2652
- value: Array<PortableTextBlock> | undefined
2653
- }
2654
- | UnsetEvent
2655
- >,
2656
- ]
2657
- }
2658
- readonly 'notify.unset': {
2659
- readonly actions: ActionFunction<
2660
- {
2661
- behaviors: Set<BehaviorConfig>
2662
- converters: Set<Converter>
2663
- getLegacySchema: () => PortableTextMemberSchemaTypes
2664
- keyGenerator: () => string
2665
- pendingEvents: Array<InternalPatchEvent | MutationEvent>
2666
- pendingIncomingPatchesEvents: Array<PatchesEvent>
2667
- schema: EditorSchema
2668
- initialReadOnly: boolean
2669
- maxBlocks: number | undefined
2670
- selection: EditorSelection
2671
- initialValue: Array<PortableTextBlock> | undefined
2672
- internalDrag?: {
2673
- ghost?: HTMLElement
2674
- origin: Pick<EventPosition, 'selection'>
2675
- }
2676
- slateEditor?: PortableTextSlateEditor
2677
- },
2678
- {
2679
- type: 'notify.unset'
2680
- previousValue: Array<PortableTextBlock>
2681
- },
2682
- | InternalPatchEvent
2683
- | MutationEvent
2684
- | PatchesEvent
2685
- | {
2686
- type: 'update readOnly'
2687
- readOnly: boolean
2688
- }
2689
- | {
2690
- type: 'update schema'
2691
- schema: EditorSchema
2692
- }
2693
- | {
2694
- type: 'update key generator'
2695
- keyGenerator: () => string
2696
- }
2697
- | {
2698
- type: 'update maxBlocks'
2699
- maxBlocks: number | undefined
2700
- }
2701
- | {
2702
- type: 'add behavior'
2703
- behaviorConfig: BehaviorConfig
2704
- }
2705
- | {
2706
- type: 'remove behavior'
2707
- behaviorConfig: BehaviorConfig
2708
- }
2709
- | {
2710
- type: 'blur'
2711
- editor: PortableTextSlateEditor
2712
- }
2713
- | {
2714
- type: 'focus'
2715
- editor: PortableTextSlateEditor
2716
- }
2717
- | {
2718
- type: 'normalizing'
2719
- }
2720
- | {
2721
- type: 'done normalizing'
2722
- }
2723
- | {
2724
- type: 'done syncing value'
2725
- }
2726
- | {
2727
- type: 'syncing value'
2728
- }
2729
- | {
2730
- type: 'behavior event'
2731
- behaviorEvent: BehaviorEvent
2732
- editor: PortableTextSlateEditor
2733
- nativeEvent?: {
2734
- preventDefault: () => void
2735
- }
2736
- }
2737
- | {
2738
- type: 'notify.patch'
2739
- patch: Patch
2740
- }
2741
- | {
2742
- type: 'notify.mutation'
2743
- patches: Array<Patch>
2744
- snapshot: Array<PortableTextBlock> | undefined
2745
- value: Array<PortableTextBlock> | undefined
2746
- }
2747
- | {
2748
- type: 'notify.blurred'
2749
- event: FocusEvent_2<HTMLDivElement, Element>
2750
- }
2751
- | {
2752
- type: 'notify.done loading'
2753
- }
2754
- | {
2755
- type: 'notify.editable'
2756
- }
2757
- | {
2758
- type: 'notify.error'
2759
- name: string
2760
- description: string
2761
- data: unknown
2762
- }
2763
- | {
2764
- type: 'notify.focused'
2765
- event: FocusEvent_2<HTMLDivElement, Element>
2766
- }
2767
- | {
2768
- type: 'notify.invalid value'
2769
- resolution: InvalidValueResolution | null
2770
- value: Array<PortableTextBlock> | undefined
2771
- }
2772
- | {
2773
- type: 'notify.loading'
2774
- }
2775
- | {
2776
- type: 'notify.read only'
2777
- }
2778
- | {
2779
- type: 'notify.ready'
2780
- }
2781
- | {
2782
- type: 'notify.selection'
2783
- selection: EditorSelection
2784
- }
2785
- | {
2786
- type: 'notify.value changed'
2787
- value: Array<PortableTextBlock> | undefined
2788
- }
2789
- | {
2790
- type: 'notify.unset'
2791
- previousValue: Array<PortableTextBlock>
2792
- }
2793
- | {
2794
- type: 'dragstart'
2795
- origin: Pick<EventPosition, 'selection'>
2796
- ghost?: HTMLElement
2797
- }
2798
- | {
2799
- type: 'dragend'
2800
- }
2801
- | {
2802
- type: 'drop'
2803
- },
2804
- undefined,
2805
- never,
2806
- never,
2807
- never,
2808
- never,
2809
- | PatchEvent
2810
- | InternalPatchEvent
2811
- | MutationEvent
2812
- | PatchesEvent
2813
- | {
2814
- type: 'blurred'
2815
- event: FocusEvent_2<HTMLDivElement, Element>
2816
- }
2817
- | {
2818
- type: 'done loading'
2819
- }
2820
- | {
2821
- type: 'editable'
2822
- }
2823
- | {
2824
- type: 'error'
2825
- name: string
2826
- description: string
2827
- data: unknown
2828
- }
2829
- | {
2830
- type: 'focused'
2831
- event: FocusEvent_2<HTMLDivElement, Element>
2832
- }
2833
- | {
2834
- type: 'invalid value'
2835
- resolution: InvalidValueResolution | null
2836
- value: Array<PortableTextBlock> | undefined
2837
- }
2838
- | {
2839
- type: 'loading'
2840
- }
2841
- | {
2842
- type: 'read only'
2843
- }
2844
- | {
2845
- type: 'ready'
2846
- }
2847
- | {
2848
- type: 'selection'
2849
- selection: EditorSelection
2850
- }
2851
- | {
2852
- type: 'value changed'
2853
- value: Array<PortableTextBlock> | undefined
2854
- }
2855
- | UnsetEvent
2856
- >
2857
- }
2858
- readonly 'notify.loading': {
2859
- readonly actions: ActionFunction<
2860
- {
2861
- behaviors: Set<BehaviorConfig>
2862
- converters: Set<Converter>
2863
- getLegacySchema: () => PortableTextMemberSchemaTypes
2864
- keyGenerator: () => string
2865
- pendingEvents: Array<InternalPatchEvent | MutationEvent>
2866
- pendingIncomingPatchesEvents: Array<PatchesEvent>
2867
- schema: EditorSchema
2868
- initialReadOnly: boolean
2869
- maxBlocks: number | undefined
2870
- selection: EditorSelection
2871
- initialValue: Array<PortableTextBlock> | undefined
2872
- internalDrag?: {
2873
- ghost?: HTMLElement
2874
- origin: Pick<EventPosition, 'selection'>
2875
- }
2876
- slateEditor?: PortableTextSlateEditor
2877
- },
2878
- {
2879
- type: 'notify.loading'
2880
- },
2881
- | InternalPatchEvent
2882
- | MutationEvent
2883
- | PatchesEvent
2884
- | {
2885
- type: 'update readOnly'
2886
- readOnly: boolean
2887
- }
2888
- | {
2889
- type: 'update schema'
2890
- schema: EditorSchema
2891
- }
2892
- | {
2893
- type: 'update key generator'
2894
- keyGenerator: () => string
2895
- }
2896
- | {
2897
- type: 'update maxBlocks'
2898
- maxBlocks: number | undefined
2899
- }
2900
- | {
2901
- type: 'add behavior'
2902
- behaviorConfig: BehaviorConfig
2903
- }
2904
- | {
2905
- type: 'remove behavior'
2906
- behaviorConfig: BehaviorConfig
2907
- }
2908
- | {
2909
- type: 'blur'
2910
- editor: PortableTextSlateEditor
2911
- }
2912
- | {
2913
- type: 'focus'
2914
- editor: PortableTextSlateEditor
2915
- }
2916
- | {
2917
- type: 'normalizing'
2918
- }
2919
- | {
2920
- type: 'done normalizing'
2921
- }
2922
- | {
2923
- type: 'done syncing value'
2924
- }
2925
- | {
2926
- type: 'syncing value'
2927
- }
2928
- | {
2929
- type: 'behavior event'
2930
- behaviorEvent: BehaviorEvent
2931
- editor: PortableTextSlateEditor
2932
- nativeEvent?: {
2933
- preventDefault: () => void
2934
- }
2935
- }
2936
- | {
2937
- type: 'notify.patch'
2938
- patch: Patch
2939
- }
2940
- | {
2941
- type: 'notify.mutation'
2942
- patches: Array<Patch>
2943
- snapshot: Array<PortableTextBlock> | undefined
2944
- value: Array<PortableTextBlock> | undefined
2945
- }
2946
- | {
2947
- type: 'notify.blurred'
2948
- event: FocusEvent_2<HTMLDivElement, Element>
2949
- }
2950
- | {
2951
- type: 'notify.done loading'
2952
- }
2953
- | {
2954
- type: 'notify.editable'
2955
- }
2956
- | {
2957
- type: 'notify.error'
2958
- name: string
2959
- description: string
2960
- data: unknown
2961
- }
2962
- | {
2963
- type: 'notify.focused'
2964
- event: FocusEvent_2<HTMLDivElement, Element>
2965
- }
2966
- | {
2967
- type: 'notify.invalid value'
2968
- resolution: InvalidValueResolution | null
2969
- value: Array<PortableTextBlock> | undefined
2970
- }
2971
- | {
2972
- type: 'notify.loading'
2973
- }
2974
- | {
2975
- type: 'notify.read only'
2976
- }
2977
- | {
2978
- type: 'notify.ready'
2979
- }
2980
- | {
2981
- type: 'notify.selection'
2982
- selection: EditorSelection
2983
- }
2984
- | {
2985
- type: 'notify.value changed'
2986
- value: Array<PortableTextBlock> | undefined
2987
- }
2988
- | {
2989
- type: 'notify.unset'
2990
- previousValue: Array<PortableTextBlock>
2991
- }
2992
- | {
2993
- type: 'dragstart'
2994
- origin: Pick<EventPosition, 'selection'>
2995
- ghost?: HTMLElement
2996
- }
2997
- | {
2998
- type: 'dragend'
2999
- }
3000
- | {
3001
- type: 'drop'
3002
- },
3003
- undefined,
3004
- never,
3005
- never,
3006
- never,
3007
- never,
3008
- | PatchEvent
3009
- | InternalPatchEvent
3010
- | MutationEvent
3011
- | PatchesEvent
3012
- | {
3013
- type: 'blurred'
3014
- event: FocusEvent_2<HTMLDivElement, Element>
3015
- }
3016
- | {
3017
- type: 'done loading'
3018
- }
3019
- | {
3020
- type: 'editable'
3021
- }
3022
- | {
3023
- type: 'error'
3024
- name: string
3025
- description: string
3026
- data: unknown
3027
- }
3028
- | {
3029
- type: 'focused'
3030
- event: FocusEvent_2<HTMLDivElement, Element>
3031
- }
3032
- | {
3033
- type: 'invalid value'
3034
- resolution: InvalidValueResolution | null
3035
- value: Array<PortableTextBlock> | undefined
3036
- }
3037
- | {
3038
- type: 'loading'
3039
- }
3040
- | {
3041
- type: 'read only'
3042
- }
3043
- | {
3044
- type: 'ready'
3045
- }
3046
- | {
3047
- type: 'selection'
3048
- selection: EditorSelection
3049
- }
3050
- | {
3051
- type: 'value changed'
3052
- value: Array<PortableTextBlock> | undefined
3053
- }
3054
- | UnsetEvent
3055
- >
3056
- }
3057
- readonly 'notify.value changed': {
3058
- readonly actions: ActionFunction<
3059
- {
3060
- behaviors: Set<BehaviorConfig>
3061
- converters: Set<Converter>
3062
- getLegacySchema: () => PortableTextMemberSchemaTypes
3063
- keyGenerator: () => string
3064
- pendingEvents: Array<InternalPatchEvent | MutationEvent>
3065
- pendingIncomingPatchesEvents: Array<PatchesEvent>
3066
- schema: EditorSchema
3067
- initialReadOnly: boolean
3068
- maxBlocks: number | undefined
3069
- selection: EditorSelection
3070
- initialValue: Array<PortableTextBlock> | undefined
3071
- internalDrag?: {
3072
- ghost?: HTMLElement
3073
- origin: Pick<EventPosition, 'selection'>
3074
- }
3075
- slateEditor?: PortableTextSlateEditor
3076
- },
3077
- {
3078
- type: 'notify.value changed'
3079
- value: Array<PortableTextBlock> | undefined
3080
- },
3081
- | InternalPatchEvent
3082
- | MutationEvent
3083
- | PatchesEvent
3084
- | {
3085
- type: 'update readOnly'
3086
- readOnly: boolean
3087
- }
3088
- | {
3089
- type: 'update schema'
3090
- schema: EditorSchema
3091
- }
3092
- | {
3093
- type: 'update key generator'
3094
- keyGenerator: () => string
3095
- }
3096
- | {
3097
- type: 'update maxBlocks'
3098
- maxBlocks: number | undefined
3099
- }
3100
- | {
3101
- type: 'add behavior'
3102
- behaviorConfig: BehaviorConfig
3103
- }
3104
- | {
3105
- type: 'remove behavior'
3106
- behaviorConfig: BehaviorConfig
3107
- }
3108
- | {
3109
- type: 'blur'
3110
- editor: PortableTextSlateEditor
3111
- }
3112
- | {
3113
- type: 'focus'
3114
- editor: PortableTextSlateEditor
3115
- }
3116
- | {
3117
- type: 'normalizing'
3118
- }
3119
- | {
3120
- type: 'done normalizing'
3121
- }
3122
- | {
3123
- type: 'done syncing value'
3124
- }
3125
- | {
3126
- type: 'syncing value'
3127
- }
3128
- | {
3129
- type: 'behavior event'
3130
- behaviorEvent: BehaviorEvent
3131
- editor: PortableTextSlateEditor
3132
- nativeEvent?: {
3133
- preventDefault: () => void
3134
- }
3135
- }
3136
- | {
3137
- type: 'notify.patch'
3138
- patch: Patch
3139
- }
3140
- | {
3141
- type: 'notify.mutation'
3142
- patches: Array<Patch>
3143
- snapshot: Array<PortableTextBlock> | undefined
3144
- value: Array<PortableTextBlock> | undefined
3145
- }
3146
- | {
3147
- type: 'notify.blurred'
3148
- event: FocusEvent_2<HTMLDivElement, Element>
3149
- }
3150
- | {
3151
- type: 'notify.done loading'
3152
- }
3153
- | {
3154
- type: 'notify.editable'
3155
- }
3156
- | {
3157
- type: 'notify.error'
3158
- name: string
3159
- description: string
3160
- data: unknown
3161
- }
3162
- | {
3163
- type: 'notify.focused'
3164
- event: FocusEvent_2<HTMLDivElement, Element>
3165
- }
3166
- | {
3167
- type: 'notify.invalid value'
3168
- resolution: InvalidValueResolution | null
3169
- value: Array<PortableTextBlock> | undefined
3170
- }
3171
- | {
3172
- type: 'notify.loading'
3173
- }
3174
- | {
3175
- type: 'notify.read only'
3176
- }
3177
- | {
3178
- type: 'notify.ready'
3179
- }
3180
- | {
3181
- type: 'notify.selection'
3182
- selection: EditorSelection
3183
- }
3184
- | {
3185
- type: 'notify.value changed'
3186
- value: Array<PortableTextBlock> | undefined
3187
- }
3188
- | {
3189
- type: 'notify.unset'
3190
- previousValue: Array<PortableTextBlock>
3191
- }
3192
- | {
3193
- type: 'dragstart'
3194
- origin: Pick<EventPosition, 'selection'>
3195
- ghost?: HTMLElement
3196
- }
3197
- | {
3198
- type: 'dragend'
3199
- }
3200
- | {
3201
- type: 'drop'
3202
- },
3203
- undefined,
3204
- never,
3205
- never,
3206
- never,
3207
- never,
3208
- | PatchEvent
3209
- | InternalPatchEvent
3210
- | MutationEvent
3211
- | PatchesEvent
3212
- | {
3213
- type: 'blurred'
3214
- event: FocusEvent_2<HTMLDivElement, Element>
3215
- }
3216
- | {
3217
- type: 'done loading'
3218
- }
3219
- | {
3220
- type: 'editable'
3221
- }
3222
- | {
3223
- type: 'error'
3224
- name: string
3225
- description: string
3226
- data: unknown
3227
- }
3228
- | {
3229
- type: 'focused'
3230
- event: FocusEvent_2<HTMLDivElement, Element>
3231
- }
3232
- | {
3233
- type: 'invalid value'
3234
- resolution: InvalidValueResolution | null
3235
- value: Array<PortableTextBlock> | undefined
3236
- }
3237
- | {
3238
- type: 'loading'
3239
- }
3240
- | {
3241
- type: 'read only'
3242
- }
3243
- | {
3244
- type: 'ready'
3245
- }
3246
- | {
3247
- type: 'selection'
3248
- selection: EditorSelection
3249
- }
3250
- | {
3251
- type: 'value changed'
3252
- value: Array<PortableTextBlock> | undefined
3253
- }
3254
- | UnsetEvent
3255
- >
3256
- }
3257
- readonly 'add behavior': {
3258
- readonly actions: 'add behavior to context'
3259
- }
3260
- readonly 'remove behavior': {
3261
- readonly actions: 'remove behavior from context'
3262
- }
3263
- readonly 'update key generator': {
3264
- readonly actions: ActionFunction<
3265
- {
3266
- behaviors: Set<BehaviorConfig>
3267
- converters: Set<Converter>
3268
- getLegacySchema: () => PortableTextMemberSchemaTypes
3269
- keyGenerator: () => string
3270
- pendingEvents: Array<InternalPatchEvent | MutationEvent>
3271
- pendingIncomingPatchesEvents: Array<PatchesEvent>
3272
- schema: EditorSchema
3273
- initialReadOnly: boolean
3274
- maxBlocks: number | undefined
3275
- selection: EditorSelection
3276
- initialValue: Array<PortableTextBlock> | undefined
3277
- internalDrag?: {
3278
- ghost?: HTMLElement
3279
- origin: Pick<EventPosition, 'selection'>
3280
- }
3281
- slateEditor?: PortableTextSlateEditor
3282
- },
3283
- {
3284
- type: 'update key generator'
3285
- keyGenerator: () => string
3286
- },
3287
- | InternalPatchEvent
3288
- | MutationEvent
3289
- | PatchesEvent
3290
- | {
3291
- type: 'update readOnly'
3292
- readOnly: boolean
3293
- }
3294
- | {
3295
- type: 'update schema'
3296
- schema: EditorSchema
3297
- }
3298
- | {
3299
- type: 'update key generator'
3300
- keyGenerator: () => string
3301
- }
3302
- | {
3303
- type: 'update maxBlocks'
3304
- maxBlocks: number | undefined
3305
- }
3306
- | {
3307
- type: 'add behavior'
3308
- behaviorConfig: BehaviorConfig
3309
- }
3310
- | {
3311
- type: 'remove behavior'
3312
- behaviorConfig: BehaviorConfig
3313
- }
3314
- | {
3315
- type: 'blur'
3316
- editor: PortableTextSlateEditor
3317
- }
3318
- | {
3319
- type: 'focus'
3320
- editor: PortableTextSlateEditor
3321
- }
3322
- | {
3323
- type: 'normalizing'
3324
- }
3325
- | {
3326
- type: 'done normalizing'
3327
- }
3328
- | {
3329
- type: 'done syncing value'
3330
- }
3331
- | {
3332
- type: 'syncing value'
3333
- }
3334
- | {
3335
- type: 'behavior event'
3336
- behaviorEvent: BehaviorEvent
3337
- editor: PortableTextSlateEditor
3338
- nativeEvent?: {
3339
- preventDefault: () => void
3340
- }
3341
- }
3342
- | {
3343
- type: 'notify.patch'
3344
- patch: Patch
3345
- }
3346
- | {
3347
- type: 'notify.mutation'
3348
- patches: Array<Patch>
3349
- snapshot: Array<PortableTextBlock> | undefined
3350
- value: Array<PortableTextBlock> | undefined
3351
- }
3352
- | {
3353
- type: 'notify.blurred'
3354
- event: FocusEvent_2<HTMLDivElement, Element>
3355
- }
3356
- | {
3357
- type: 'notify.done loading'
3358
- }
3359
- | {
3360
- type: 'notify.editable'
3361
- }
3362
- | {
3363
- type: 'notify.error'
3364
- name: string
3365
- description: string
3366
- data: unknown
3367
- }
3368
- | {
3369
- type: 'notify.focused'
3370
- event: FocusEvent_2<HTMLDivElement, Element>
3371
- }
3372
- | {
3373
- type: 'notify.invalid value'
3374
- resolution: InvalidValueResolution | null
3375
- value: Array<PortableTextBlock> | undefined
3376
- }
3377
- | {
3378
- type: 'notify.loading'
3379
- }
3380
- | {
3381
- type: 'notify.read only'
3382
- }
3383
- | {
3384
- type: 'notify.ready'
3385
- }
3386
- | {
3387
- type: 'notify.selection'
3388
- selection: EditorSelection
3389
- }
3390
- | {
3391
- type: 'notify.value changed'
3392
- value: Array<PortableTextBlock> | undefined
3393
- }
3394
- | {
3395
- type: 'notify.unset'
3396
- previousValue: Array<PortableTextBlock>
3397
- }
3398
- | {
3399
- type: 'dragstart'
3400
- origin: Pick<EventPosition, 'selection'>
3401
- ghost?: HTMLElement
3402
- }
3403
- | {
3404
- type: 'dragend'
3405
- }
3406
- | {
3407
- type: 'drop'
3408
- },
3409
- undefined,
3410
- never,
3411
- never,
3412
- never,
3413
- never,
3414
- never
3415
- >
3416
- }
3417
- readonly 'update schema': {
3418
- readonly actions: 'assign schema'
3419
- }
3420
- readonly 'update maxBlocks': {
3421
- readonly actions: ActionFunction<
3422
- {
3423
- behaviors: Set<BehaviorConfig>
3424
- converters: Set<Converter>
3425
- getLegacySchema: () => PortableTextMemberSchemaTypes
3426
- keyGenerator: () => string
3427
- pendingEvents: Array<InternalPatchEvent | MutationEvent>
3428
- pendingIncomingPatchesEvents: Array<PatchesEvent>
3429
- schema: EditorSchema
3430
- initialReadOnly: boolean
3431
- maxBlocks: number | undefined
3432
- selection: EditorSelection
3433
- initialValue: Array<PortableTextBlock> | undefined
3434
- internalDrag?: {
3435
- ghost?: HTMLElement
3436
- origin: Pick<EventPosition, 'selection'>
3437
- }
3438
- slateEditor?: PortableTextSlateEditor
3439
- },
3440
- {
3441
- type: 'update maxBlocks'
3442
- maxBlocks: number | undefined
3443
- },
3444
- | InternalPatchEvent
3445
- | MutationEvent
3446
- | PatchesEvent
3447
- | {
3448
- type: 'update readOnly'
3449
- readOnly: boolean
3450
- }
3451
- | {
3452
- type: 'update schema'
3453
- schema: EditorSchema
3454
- }
3455
- | {
3456
- type: 'update key generator'
3457
- keyGenerator: () => string
3458
- }
3459
- | {
3460
- type: 'update maxBlocks'
3461
- maxBlocks: number | undefined
3462
- }
3463
- | {
3464
- type: 'add behavior'
3465
- behaviorConfig: BehaviorConfig
3466
- }
3467
- | {
3468
- type: 'remove behavior'
3469
- behaviorConfig: BehaviorConfig
3470
- }
3471
- | {
3472
- type: 'blur'
3473
- editor: PortableTextSlateEditor
3474
- }
3475
- | {
3476
- type: 'focus'
3477
- editor: PortableTextSlateEditor
3478
- }
3479
- | {
3480
- type: 'normalizing'
3481
- }
3482
- | {
3483
- type: 'done normalizing'
3484
- }
3485
- | {
3486
- type: 'done syncing value'
3487
- }
3488
- | {
3489
- type: 'syncing value'
3490
- }
3491
- | {
3492
- type: 'behavior event'
3493
- behaviorEvent: BehaviorEvent
3494
- editor: PortableTextSlateEditor
3495
- nativeEvent?: {
3496
- preventDefault: () => void
1222
+ selection: EditorSelection
1223
+ initialValue: Array<PortableTextBlock> | undefined
1224
+ internalDrag?: {
1225
+ ghost?: HTMLElement
1226
+ origin: Pick<EventPosition, 'selection'>
3497
1227
  }
3498
- }
3499
- | {
3500
- type: 'notify.patch'
3501
- patch: Patch
3502
- }
3503
- | {
3504
- type: 'notify.mutation'
3505
- patches: Array<Patch>
3506
- snapshot: Array<PortableTextBlock> | undefined
3507
- value: Array<PortableTextBlock> | undefined
3508
- }
3509
- | {
3510
- type: 'notify.blurred'
3511
- event: FocusEvent_2<HTMLDivElement, Element>
3512
- }
3513
- | {
3514
- type: 'notify.done loading'
3515
- }
3516
- | {
3517
- type: 'notify.editable'
3518
- }
3519
- | {
3520
- type: 'notify.error'
3521
- name: string
3522
- description: string
3523
- data: unknown
3524
- }
3525
- | {
3526
- type: 'notify.focused'
3527
- event: FocusEvent_2<HTMLDivElement, Element>
3528
- }
3529
- | {
3530
- type: 'notify.invalid value'
3531
- resolution: InvalidValueResolution | null
3532
- value: Array<PortableTextBlock> | undefined
3533
- }
3534
- | {
3535
- type: 'notify.loading'
3536
- }
3537
- | {
3538
- type: 'notify.read only'
3539
- }
3540
- | {
3541
- type: 'notify.ready'
3542
- }
3543
- | {
3544
- type: 'notify.selection'
1228
+ slateEditor?: PortableTextSlateEditor
1229
+ },
1230
+ {
1231
+ type: 'update selection'
3545
1232
  selection: EditorSelection
3546
- }
3547
- | {
3548
- type: 'notify.value changed'
3549
- value: Array<PortableTextBlock> | undefined
3550
- }
3551
- | {
3552
- type: 'notify.unset'
3553
- previousValue: Array<PortableTextBlock>
3554
- }
3555
- | {
3556
- type: 'dragstart'
3557
- origin: Pick<EventPosition, 'selection'>
3558
- ghost?: HTMLElement
3559
- }
3560
- | {
3561
- type: 'dragend'
3562
- }
3563
- | {
3564
- type: 'drop'
3565
1233
  },
3566
- undefined,
3567
- never,
3568
- never,
3569
- never,
3570
- never,
3571
- never
3572
- >
1234
+ | InternalPatchEvent
1235
+ | MutationEvent
1236
+ | PatchesEvent
1237
+ | {
1238
+ type: 'update readOnly'
1239
+ readOnly: boolean
1240
+ }
1241
+ | {
1242
+ type: 'update maxBlocks'
1243
+ maxBlocks: number | undefined
1244
+ }
1245
+ | {
1246
+ type: 'add behavior'
1247
+ behaviorConfig: BehaviorConfig
1248
+ }
1249
+ | {
1250
+ type: 'remove behavior'
1251
+ behaviorConfig: BehaviorConfig
1252
+ }
1253
+ | {
1254
+ type: 'blur'
1255
+ editor: PortableTextSlateEditor
1256
+ }
1257
+ | {
1258
+ type: 'focus'
1259
+ editor: PortableTextSlateEditor
1260
+ }
1261
+ | {
1262
+ type: 'normalizing'
1263
+ }
1264
+ | {
1265
+ type: 'update selection'
1266
+ selection: EditorSelection
1267
+ }
1268
+ | {
1269
+ type: 'done normalizing'
1270
+ }
1271
+ | {
1272
+ type: 'done syncing value'
1273
+ }
1274
+ | {
1275
+ type: 'syncing value'
1276
+ }
1277
+ | {
1278
+ type: 'behavior event'
1279
+ behaviorEvent: BehaviorEvent
1280
+ editor: PortableTextSlateEditor
1281
+ nativeEvent?: {
1282
+ preventDefault: () => void
1283
+ }
1284
+ }
1285
+ | {
1286
+ type: 'dragstart'
1287
+ origin: Pick<EventPosition, 'selection'>
1288
+ ghost?: HTMLElement
1289
+ }
1290
+ | {
1291
+ type: 'dragend'
1292
+ }
1293
+ | {
1294
+ type: 'drop'
1295
+ },
1296
+ undefined,
1297
+ never,
1298
+ never,
1299
+ never,
1300
+ never,
1301
+ never
1302
+ >,
1303
+ ]
3573
1304
  }
3574
1305
  }
3575
1306
  readonly type: 'parallel'
@@ -3765,14 +1496,6 @@ declare const editorMachine: StateMachine<
3765
1496
  type: 'update readOnly'
3766
1497
  readOnly: boolean
3767
1498
  }
3768
- | {
3769
- type: 'update schema'
3770
- schema: EditorSchema
3771
- }
3772
- | {
3773
- type: 'update key generator'
3774
- keyGenerator: () => string
3775
- }
3776
1499
  | {
3777
1500
  type: 'update maxBlocks'
3778
1501
  maxBlocks: number | undefined
@@ -3797,77 +1520,25 @@ declare const editorMachine: StateMachine<
3797
1520
  type: 'normalizing'
3798
1521
  }
3799
1522
  | {
3800
- type: 'done normalizing'
3801
- }
3802
- | {
3803
- type: 'done syncing value'
3804
- }
3805
- | {
3806
- type: 'syncing value'
3807
- }
3808
- | {
3809
- type: 'behavior event'
3810
- behaviorEvent: BehaviorEvent
3811
- editor: PortableTextSlateEditor
3812
- nativeEvent?: {
3813
- preventDefault: () => void
3814
- }
3815
- }
3816
- | {
3817
- type: 'notify.patch'
3818
- patch: Patch
3819
- }
3820
- | {
3821
- type: 'notify.mutation'
3822
- patches: Array<Patch>
3823
- snapshot: Array<PortableTextBlock> | undefined
3824
- value: Array<PortableTextBlock> | undefined
3825
- }
3826
- | {
3827
- type: 'notify.blurred'
3828
- event: FocusEvent_2<HTMLDivElement, Element>
3829
- }
3830
- | {
3831
- type: 'notify.done loading'
3832
- }
3833
- | {
3834
- type: 'notify.editable'
3835
- }
3836
- | {
3837
- type: 'notify.error'
3838
- name: string
3839
- description: string
3840
- data: unknown
3841
- }
3842
- | {
3843
- type: 'notify.focused'
3844
- event: FocusEvent_2<HTMLDivElement, Element>
3845
- }
3846
- | {
3847
- type: 'notify.invalid value'
3848
- resolution: InvalidValueResolution | null
3849
- value: Array<PortableTextBlock> | undefined
3850
- }
3851
- | {
3852
- type: 'notify.loading'
3853
- }
3854
- | {
3855
- type: 'notify.read only'
1523
+ type: 'update selection'
1524
+ selection: EditorSelection
3856
1525
  }
3857
1526
  | {
3858
- type: 'notify.ready'
1527
+ type: 'done normalizing'
3859
1528
  }
3860
1529
  | {
3861
- type: 'notify.selection'
3862
- selection: EditorSelection
1530
+ type: 'done syncing value'
3863
1531
  }
3864
1532
  | {
3865
- type: 'notify.value changed'
3866
- value: Array<PortableTextBlock> | undefined
1533
+ type: 'syncing value'
3867
1534
  }
3868
1535
  | {
3869
- type: 'notify.unset'
3870
- previousValue: Array<PortableTextBlock>
1536
+ type: 'behavior event'
1537
+ behaviorEvent: BehaviorEvent
1538
+ editor: PortableTextSlateEditor
1539
+ nativeEvent?: {
1540
+ preventDefault: () => void
1541
+ }
3871
1542
  }
3872
1543
  | {
3873
1544
  type: 'dragstart'
@@ -3931,14 +1602,6 @@ declare const editorMachine: StateMachine<
3931
1602
  type: 'update readOnly'
3932
1603
  readOnly: boolean
3933
1604
  }
3934
- | {
3935
- type: 'update schema'
3936
- schema: EditorSchema
3937
- }
3938
- | {
3939
- type: 'update key generator'
3940
- keyGenerator: () => string
3941
- }
3942
1605
  | {
3943
1606
  type: 'update maxBlocks'
3944
1607
  maxBlocks: number | undefined
@@ -3962,6 +1625,10 @@ declare const editorMachine: StateMachine<
3962
1625
  | {
3963
1626
  type: 'normalizing'
3964
1627
  }
1628
+ | {
1629
+ type: 'update selection'
1630
+ selection: EditorSelection
1631
+ }
3965
1632
  | {
3966
1633
  type: 'done normalizing'
3967
1634
  }
@@ -3979,62 +1646,6 @@ declare const editorMachine: StateMachine<
3979
1646
  preventDefault: () => void
3980
1647
  }
3981
1648
  }
3982
- | {
3983
- type: 'notify.patch'
3984
- patch: Patch
3985
- }
3986
- | {
3987
- type: 'notify.mutation'
3988
- patches: Array<Patch>
3989
- snapshot: Array<PortableTextBlock> | undefined
3990
- value: Array<PortableTextBlock> | undefined
3991
- }
3992
- | {
3993
- type: 'notify.blurred'
3994
- event: FocusEvent_2<HTMLDivElement, Element>
3995
- }
3996
- | {
3997
- type: 'notify.done loading'
3998
- }
3999
- | {
4000
- type: 'notify.editable'
4001
- }
4002
- | {
4003
- type: 'notify.error'
4004
- name: string
4005
- description: string
4006
- data: unknown
4007
- }
4008
- | {
4009
- type: 'notify.focused'
4010
- event: FocusEvent_2<HTMLDivElement, Element>
4011
- }
4012
- | {
4013
- type: 'notify.invalid value'
4014
- resolution: InvalidValueResolution | null
4015
- value: Array<PortableTextBlock> | undefined
4016
- }
4017
- | {
4018
- type: 'notify.loading'
4019
- }
4020
- | {
4021
- type: 'notify.read only'
4022
- }
4023
- | {
4024
- type: 'notify.ready'
4025
- }
4026
- | {
4027
- type: 'notify.selection'
4028
- selection: EditorSelection
4029
- }
4030
- | {
4031
- type: 'notify.value changed'
4032
- value: Array<PortableTextBlock> | undefined
4033
- }
4034
- | {
4035
- type: 'notify.unset'
4036
- previousValue: Array<PortableTextBlock>
4037
- }
4038
1649
  | {
4039
1650
  type: 'dragstart'
4040
1651
  origin: Pick<EventPosition, 'selection'>
@@ -4118,14 +1729,6 @@ declare const editorMachine: StateMachine<
4118
1729
  type: 'update readOnly'
4119
1730
  readOnly: boolean
4120
1731
  }
4121
- | {
4122
- type: 'update schema'
4123
- schema: EditorSchema
4124
- }
4125
- | {
4126
- type: 'update key generator'
4127
- keyGenerator: () => string
4128
- }
4129
1732
  | {
4130
1733
  type: 'update maxBlocks'
4131
1734
  maxBlocks: number | undefined
@@ -4149,6 +1752,10 @@ declare const editorMachine: StateMachine<
4149
1752
  | {
4150
1753
  type: 'normalizing'
4151
1754
  }
1755
+ | {
1756
+ type: 'update selection'
1757
+ selection: EditorSelection
1758
+ }
4152
1759
  | {
4153
1760
  type: 'done normalizing'
4154
1761
  }
@@ -4166,62 +1773,6 @@ declare const editorMachine: StateMachine<
4166
1773
  preventDefault: () => void
4167
1774
  }
4168
1775
  }
4169
- | {
4170
- type: 'notify.patch'
4171
- patch: Patch
4172
- }
4173
- | {
4174
- type: 'notify.mutation'
4175
- patches: Array<Patch>
4176
- snapshot: Array<PortableTextBlock> | undefined
4177
- value: Array<PortableTextBlock> | undefined
4178
- }
4179
- | {
4180
- type: 'notify.blurred'
4181
- event: FocusEvent_2<HTMLDivElement, Element>
4182
- }
4183
- | {
4184
- type: 'notify.done loading'
4185
- }
4186
- | {
4187
- type: 'notify.editable'
4188
- }
4189
- | {
4190
- type: 'notify.error'
4191
- name: string
4192
- description: string
4193
- data: unknown
4194
- }
4195
- | {
4196
- type: 'notify.focused'
4197
- event: FocusEvent_2<HTMLDivElement, Element>
4198
- }
4199
- | {
4200
- type: 'notify.invalid value'
4201
- resolution: InvalidValueResolution | null
4202
- value: Array<PortableTextBlock> | undefined
4203
- }
4204
- | {
4205
- type: 'notify.loading'
4206
- }
4207
- | {
4208
- type: 'notify.read only'
4209
- }
4210
- | {
4211
- type: 'notify.ready'
4212
- }
4213
- | {
4214
- type: 'notify.selection'
4215
- selection: EditorSelection
4216
- }
4217
- | {
4218
- type: 'notify.value changed'
4219
- value: Array<PortableTextBlock> | undefined
4220
- }
4221
- | {
4222
- type: 'notify.unset'
4223
- previousValue: Array<PortableTextBlock>
4224
- }
4225
1776
  | {
4226
1777
  type: 'dragstart'
4227
1778
  origin: Pick<EventPosition, 'selection'>
@@ -4240,14 +1791,6 @@ declare const editorMachine: StateMachine<
4240
1791
  type: 'update readOnly'
4241
1792
  readOnly: boolean
4242
1793
  }
4243
- | {
4244
- type: 'update schema'
4245
- schema: EditorSchema
4246
- }
4247
- | {
4248
- type: 'update key generator'
4249
- keyGenerator: () => string
4250
- }
4251
1794
  | {
4252
1795
  type: 'update maxBlocks'
4253
1796
  maxBlocks: number | undefined
@@ -4271,6 +1814,10 @@ declare const editorMachine: StateMachine<
4271
1814
  | {
4272
1815
  type: 'normalizing'
4273
1816
  }
1817
+ | {
1818
+ type: 'update selection'
1819
+ selection: EditorSelection
1820
+ }
4274
1821
  | {
4275
1822
  type: 'done normalizing'
4276
1823
  }
@@ -4288,62 +1835,6 @@ declare const editorMachine: StateMachine<
4288
1835
  preventDefault: () => void
4289
1836
  }
4290
1837
  }
4291
- | {
4292
- type: 'notify.patch'
4293
- patch: Patch
4294
- }
4295
- | {
4296
- type: 'notify.mutation'
4297
- patches: Array<Patch>
4298
- snapshot: Array<PortableTextBlock> | undefined
4299
- value: Array<PortableTextBlock> | undefined
4300
- }
4301
- | {
4302
- type: 'notify.blurred'
4303
- event: FocusEvent_2<HTMLDivElement, Element>
4304
- }
4305
- | {
4306
- type: 'notify.done loading'
4307
- }
4308
- | {
4309
- type: 'notify.editable'
4310
- }
4311
- | {
4312
- type: 'notify.error'
4313
- name: string
4314
- description: string
4315
- data: unknown
4316
- }
4317
- | {
4318
- type: 'notify.focused'
4319
- event: FocusEvent_2<HTMLDivElement, Element>
4320
- }
4321
- | {
4322
- type: 'notify.invalid value'
4323
- resolution: InvalidValueResolution | null
4324
- value: Array<PortableTextBlock> | undefined
4325
- }
4326
- | {
4327
- type: 'notify.loading'
4328
- }
4329
- | {
4330
- type: 'notify.read only'
4331
- }
4332
- | {
4333
- type: 'notify.ready'
4334
- }
4335
- | {
4336
- type: 'notify.selection'
4337
- selection: EditorSelection
4338
- }
4339
- | {
4340
- type: 'notify.value changed'
4341
- value: Array<PortableTextBlock> | undefined
4342
- }
4343
- | {
4344
- type: 'notify.unset'
4345
- previousValue: Array<PortableTextBlock>
4346
- }
4347
1838
  | {
4348
1839
  type: 'dragstart'
4349
1840
  origin: Pick<EventPosition, 'selection'>
@@ -4382,14 +1873,6 @@ declare const editorMachine: StateMachine<
4382
1873
  type: 'update readOnly'
4383
1874
  readOnly: boolean
4384
1875
  }
4385
- | {
4386
- type: 'update schema'
4387
- schema: EditorSchema
4388
- }
4389
- | {
4390
- type: 'update key generator'
4391
- keyGenerator: () => string
4392
- }
4393
1876
  | {
4394
1877
  type: 'update maxBlocks'
4395
1878
  maxBlocks: number | undefined
@@ -4413,6 +1896,10 @@ declare const editorMachine: StateMachine<
4413
1896
  | {
4414
1897
  type: 'normalizing'
4415
1898
  }
1899
+ | {
1900
+ type: 'update selection'
1901
+ selection: EditorSelection
1902
+ }
4416
1903
  | {
4417
1904
  type: 'done normalizing'
4418
1905
  }
@@ -4430,62 +1917,6 @@ declare const editorMachine: StateMachine<
4430
1917
  preventDefault: () => void
4431
1918
  }
4432
1919
  }
4433
- | {
4434
- type: 'notify.patch'
4435
- patch: Patch
4436
- }
4437
- | {
4438
- type: 'notify.mutation'
4439
- patches: Array<Patch>
4440
- snapshot: Array<PortableTextBlock> | undefined
4441
- value: Array<PortableTextBlock> | undefined
4442
- }
4443
- | {
4444
- type: 'notify.blurred'
4445
- event: FocusEvent_2<HTMLDivElement, Element>
4446
- }
4447
- | {
4448
- type: 'notify.done loading'
4449
- }
4450
- | {
4451
- type: 'notify.editable'
4452
- }
4453
- | {
4454
- type: 'notify.error'
4455
- name: string
4456
- description: string
4457
- data: unknown
4458
- }
4459
- | {
4460
- type: 'notify.focused'
4461
- event: FocusEvent_2<HTMLDivElement, Element>
4462
- }
4463
- | {
4464
- type: 'notify.invalid value'
4465
- resolution: InvalidValueResolution | null
4466
- value: Array<PortableTextBlock> | undefined
4467
- }
4468
- | {
4469
- type: 'notify.loading'
4470
- }
4471
- | {
4472
- type: 'notify.read only'
4473
- }
4474
- | {
4475
- type: 'notify.ready'
4476
- }
4477
- | {
4478
- type: 'notify.selection'
4479
- selection: EditorSelection
4480
- }
4481
- | {
4482
- type: 'notify.value changed'
4483
- value: Array<PortableTextBlock> | undefined
4484
- }
4485
- | {
4486
- type: 'notify.unset'
4487
- previousValue: Array<PortableTextBlock>
4488
- }
4489
1920
  | {
4490
1921
  type: 'dragstart'
4491
1922
  origin: Pick<EventPosition, 'selection'>
@@ -4504,14 +1935,6 @@ declare const editorMachine: StateMachine<
4504
1935
  type: 'update readOnly'
4505
1936
  readOnly: boolean
4506
1937
  }
4507
- | {
4508
- type: 'update schema'
4509
- schema: EditorSchema
4510
- }
4511
- | {
4512
- type: 'update key generator'
4513
- keyGenerator: () => string
4514
- }
4515
1938
  | {
4516
1939
  type: 'update maxBlocks'
4517
1940
  maxBlocks: number | undefined
@@ -4535,6 +1958,10 @@ declare const editorMachine: StateMachine<
4535
1958
  | {
4536
1959
  type: 'normalizing'
4537
1960
  }
1961
+ | {
1962
+ type: 'update selection'
1963
+ selection: EditorSelection
1964
+ }
4538
1965
  | {
4539
1966
  type: 'done normalizing'
4540
1967
  }
@@ -4552,62 +1979,6 @@ declare const editorMachine: StateMachine<
4552
1979
  preventDefault: () => void
4553
1980
  }
4554
1981
  }
4555
- | {
4556
- type: 'notify.patch'
4557
- patch: Patch
4558
- }
4559
- | {
4560
- type: 'notify.mutation'
4561
- patches: Array<Patch>
4562
- snapshot: Array<PortableTextBlock> | undefined
4563
- value: Array<PortableTextBlock> | undefined
4564
- }
4565
- | {
4566
- type: 'notify.blurred'
4567
- event: FocusEvent_2<HTMLDivElement, Element>
4568
- }
4569
- | {
4570
- type: 'notify.done loading'
4571
- }
4572
- | {
4573
- type: 'notify.editable'
4574
- }
4575
- | {
4576
- type: 'notify.error'
4577
- name: string
4578
- description: string
4579
- data: unknown
4580
- }
4581
- | {
4582
- type: 'notify.focused'
4583
- event: FocusEvent_2<HTMLDivElement, Element>
4584
- }
4585
- | {
4586
- type: 'notify.invalid value'
4587
- resolution: InvalidValueResolution | null
4588
- value: Array<PortableTextBlock> | undefined
4589
- }
4590
- | {
4591
- type: 'notify.loading'
4592
- }
4593
- | {
4594
- type: 'notify.read only'
4595
- }
4596
- | {
4597
- type: 'notify.ready'
4598
- }
4599
- | {
4600
- type: 'notify.selection'
4601
- selection: EditorSelection
4602
- }
4603
- | {
4604
- type: 'notify.value changed'
4605
- value: Array<PortableTextBlock> | undefined
4606
- }
4607
- | {
4608
- type: 'notify.unset'
4609
- previousValue: Array<PortableTextBlock>
4610
- }
4611
1982
  | {
4612
1983
  type: 'dragstart'
4613
1984
  origin: Pick<EventPosition, 'selection'>
@@ -4708,14 +2079,6 @@ declare const editorMachine: StateMachine<
4708
2079
  type: 'update readOnly'
4709
2080
  readOnly: boolean
4710
2081
  }
4711
- | {
4712
- type: 'update schema'
4713
- schema: EditorSchema
4714
- }
4715
- | {
4716
- type: 'update key generator'
4717
- keyGenerator: () => string
4718
- }
4719
2082
  | {
4720
2083
  type: 'update maxBlocks'
4721
2084
  maxBlocks: number | undefined
@@ -4739,6 +2102,10 @@ declare const editorMachine: StateMachine<
4739
2102
  | {
4740
2103
  type: 'normalizing'
4741
2104
  }
2105
+ | {
2106
+ type: 'update selection'
2107
+ selection: EditorSelection
2108
+ }
4742
2109
  | {
4743
2110
  type: 'done normalizing'
4744
2111
  }
@@ -4756,62 +2123,6 @@ declare const editorMachine: StateMachine<
4756
2123
  preventDefault: () => void
4757
2124
  }
4758
2125
  }
4759
- | {
4760
- type: 'notify.patch'
4761
- patch: Patch
4762
- }
4763
- | {
4764
- type: 'notify.mutation'
4765
- patches: Array<Patch>
4766
- snapshot: Array<PortableTextBlock> | undefined
4767
- value: Array<PortableTextBlock> | undefined
4768
- }
4769
- | {
4770
- type: 'notify.blurred'
4771
- event: FocusEvent_2<HTMLDivElement, Element>
4772
- }
4773
- | {
4774
- type: 'notify.done loading'
4775
- }
4776
- | {
4777
- type: 'notify.editable'
4778
- }
4779
- | {
4780
- type: 'notify.error'
4781
- name: string
4782
- description: string
4783
- data: unknown
4784
- }
4785
- | {
4786
- type: 'notify.focused'
4787
- event: FocusEvent_2<HTMLDivElement, Element>
4788
- }
4789
- | {
4790
- type: 'notify.invalid value'
4791
- resolution: InvalidValueResolution | null
4792
- value: Array<PortableTextBlock> | undefined
4793
- }
4794
- | {
4795
- type: 'notify.loading'
4796
- }
4797
- | {
4798
- type: 'notify.read only'
4799
- }
4800
- | {
4801
- type: 'notify.ready'
4802
- }
4803
- | {
4804
- type: 'notify.selection'
4805
- selection: EditorSelection
4806
- }
4807
- | {
4808
- type: 'notify.value changed'
4809
- value: Array<PortableTextBlock> | undefined
4810
- }
4811
- | {
4812
- type: 'notify.unset'
4813
- previousValue: Array<PortableTextBlock>
4814
- }
4815
2126
  | {
4816
2127
  type: 'dragstart'
4817
2128
  origin: Pick<EventPosition, 'selection'>
@@ -4828,7 +2139,6 @@ declare const editorMachine: StateMachine<
4828
2139
  never,
4829
2140
  never,
4830
2141
  never,
4831
- | PatchEvent
4832
2142
  | InternalPatchEvent
4833
2143
  | MutationEvent
4834
2144
  | PatchesEvent
@@ -4874,7 +2184,6 @@ declare const editorMachine: StateMachine<
4874
2184
  type: 'value changed'
4875
2185
  value: Array<PortableTextBlock> | undefined
4876
2186
  }
4877
- | UnsetEvent
4878
2187
  >,
4879
2188
  ]
4880
2189
  }
@@ -5078,6 +2387,16 @@ declare type EditorSnapshot = {
5078
2387
  }
5079
2388
  }
5080
2389
 
2390
+ /**
2391
+ * @deprecated The event is no longer emitted
2392
+ */
2393
+ declare type ErrorEvent_2 = {
2394
+ type: 'error'
2395
+ name: string
2396
+ description: string
2397
+ data: unknown
2398
+ }
2399
+
5081
2400
  /**
5082
2401
  * @public
5083
2402
  * Listen for events emitted by the editor. Must be used inside `EditorProvider`. Events available include:
@@ -5178,14 +2497,6 @@ declare type ExternalEditorEvent =
5178
2497
  type: 'update readOnly'
5179
2498
  readOnly: boolean
5180
2499
  }
5181
- | {
5182
- type: 'update schema'
5183
- schema: EditorSchema
5184
- }
5185
- | {
5186
- type: 'update key generator'
5187
- keyGenerator: () => string
5188
- }
5189
2500
  | {
5190
2501
  type: 'update maxBlocks'
5191
2502
  maxBlocks: number | undefined
@@ -5235,7 +2546,7 @@ declare type InternalPatchEvent = NamespaceEvent<PatchEvent, 'internal'> & {
5235
2546
  /**
5236
2547
  * The editor has invalid data in the value that can be resolved by the user
5237
2548
  * @beta */
5238
- declare type InvalidValueResolution = {
2549
+ declare type InvalidValueResolution_2 = {
5239
2550
  autoResolve?: boolean
5240
2551
  patches: Patch[]
5241
2552
  description: string
@@ -5707,9 +3018,4 @@ declare type TextBlockWithOptionalKey = Omit<PortableTextTextBlock, '_key'> & {
5707
3018
  _key?: PortableTextTextBlock['_key']
5708
3019
  }
5709
3020
 
5710
- declare type UnsetEvent = {
5711
- type: 'unset'
5712
- previousValue: Array<PortableTextBlock>
5713
- }
5714
-
5715
3021
  export {}