@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,10 +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'
17
+ import {FocusEvent as FocusEvent_2} from 'react'
18
+ import type {KeyboardEvent as KeyboardEvent_2} from 'react'
21
19
  import type {Descendant, Operation, TextUnit} from 'slate'
22
20
  import type {DOMNode} from 'slate-dom'
23
21
  import type {ReactEditor} from 'slate-react'
@@ -42,6 +40,7 @@ import {
42
40
  Values,
43
41
  } from 'xstate'
44
42
  import {GuardArgs} from 'xstate/guards'
43
+ import {InvalidValueResolution} from '..'
45
44
 
46
45
  declare type AbstractBehaviorEvent =
47
46
  | {
@@ -634,14 +633,6 @@ declare const editorMachine: StateMachine<
634
633
  type: 'update readOnly'
635
634
  readOnly: boolean
636
635
  }
637
- | {
638
- type: 'update schema'
639
- schema: EditorSchema
640
- }
641
- | {
642
- type: 'update key generator'
643
- keyGenerator: () => string
644
- }
645
636
  | {
646
637
  type: 'update maxBlocks'
647
638
  maxBlocks: number | undefined
@@ -665,6 +656,10 @@ declare const editorMachine: StateMachine<
665
656
  | {
666
657
  type: 'normalizing'
667
658
  }
659
+ | {
660
+ type: 'update selection'
661
+ selection: EditorSelection
662
+ }
668
663
  | {
669
664
  type: 'done normalizing'
670
665
  }
@@ -682,62 +677,6 @@ declare const editorMachine: StateMachine<
682
677
  preventDefault: () => void
683
678
  }
684
679
  }
685
- | {
686
- type: 'notify.patch'
687
- patch: Patch
688
- }
689
- | {
690
- type: 'notify.mutation'
691
- patches: Array<Patch>
692
- snapshot: Array<PortableTextBlock> | undefined
693
- value: Array<PortableTextBlock> | undefined
694
- }
695
- | {
696
- type: 'notify.blurred'
697
- event: FocusEvent_2<HTMLDivElement, Element>
698
- }
699
- | {
700
- type: 'notify.done loading'
701
- }
702
- | {
703
- type: 'notify.editable'
704
- }
705
- | {
706
- type: 'notify.error'
707
- name: string
708
- description: string
709
- data: unknown
710
- }
711
- | {
712
- type: 'notify.focused'
713
- event: FocusEvent_2<HTMLDivElement, Element>
714
- }
715
- | {
716
- type: 'notify.invalid value'
717
- resolution: InvalidValueResolution | null
718
- value: Array<PortableTextBlock> | undefined
719
- }
720
- | {
721
- type: 'notify.loading'
722
- }
723
- | {
724
- type: 'notify.read only'
725
- }
726
- | {
727
- type: 'notify.ready'
728
- }
729
- | {
730
- type: 'notify.selection'
731
- selection: EditorSelection
732
- }
733
- | {
734
- type: 'notify.value changed'
735
- value: Array<PortableTextBlock> | undefined
736
- }
737
- | {
738
- type: 'notify.unset'
739
- previousValue: Array<PortableTextBlock>
740
- }
741
680
  | {
742
681
  type: 'dragstart'
743
682
  origin: Pick<EventPosition, 'selection'>
@@ -760,10 +699,6 @@ declare const editorMachine: StateMachine<
760
699
  type: 'remove behavior from context'
761
700
  params: NonReducibleUnknown
762
701
  }
763
- 'assign schema': {
764
- type: 'assign schema'
765
- params: NonReducibleUnknown
766
- }
767
702
  'emit patch event': {
768
703
  type: 'emit patch event'
769
704
  params: NonReducibleUnknown
@@ -863,7 +798,6 @@ declare const editorMachine: StateMachine<
863
798
  initialValue?: Array<PortableTextBlock>
864
799
  },
865
800
  NonReducibleUnknown,
866
- | PatchEvent
867
801
  | InternalPatchEvent
868
802
  | MutationEvent
869
803
  | PatchesEvent
@@ -908,8 +842,7 @@ declare const editorMachine: StateMachine<
908
842
  | {
909
843
  type: 'value changed'
910
844
  value: Array<PortableTextBlock> | undefined
911
- }
912
- | UnsetEvent,
845
+ },
913
846
  MetaObject,
914
847
  {
915
848
  readonly id: 'editor'
@@ -974,14 +907,6 @@ declare const editorMachine: StateMachine<
974
907
  type: 'update readOnly'
975
908
  readOnly: boolean
976
909
  }
977
- | {
978
- type: 'update schema'
979
- schema: EditorSchema
980
- }
981
- | {
982
- type: 'update key generator'
983
- keyGenerator: () => string
984
- }
985
910
  | {
986
911
  type: 'update maxBlocks'
987
912
  maxBlocks: number | undefined
@@ -1005,6 +930,10 @@ declare const editorMachine: StateMachine<
1005
930
  | {
1006
931
  type: 'normalizing'
1007
932
  }
933
+ | {
934
+ type: 'update selection'
935
+ selection: EditorSelection
936
+ }
1008
937
  | {
1009
938
  type: 'done normalizing'
1010
939
  }
@@ -1022,62 +951,6 @@ declare const editorMachine: StateMachine<
1022
951
  preventDefault: () => void
1023
952
  }
1024
953
  }
1025
- | {
1026
- type: 'notify.patch'
1027
- patch: Patch
1028
- }
1029
- | {
1030
- type: 'notify.mutation'
1031
- patches: Array<Patch>
1032
- snapshot: Array<PortableTextBlock> | undefined
1033
- value: Array<PortableTextBlock> | undefined
1034
- }
1035
- | {
1036
- type: 'notify.blurred'
1037
- event: FocusEvent_2<HTMLDivElement, Element>
1038
- }
1039
- | {
1040
- type: 'notify.done loading'
1041
- }
1042
- | {
1043
- type: 'notify.editable'
1044
- }
1045
- | {
1046
- type: 'notify.error'
1047
- name: string
1048
- description: string
1049
- data: unknown
1050
- }
1051
- | {
1052
- type: 'notify.focused'
1053
- event: FocusEvent_2<HTMLDivElement, Element>
1054
- }
1055
- | {
1056
- type: 'notify.invalid value'
1057
- resolution: InvalidValueResolution | null
1058
- value: Array<PortableTextBlock> | undefined
1059
- }
1060
- | {
1061
- type: 'notify.loading'
1062
- }
1063
- | {
1064
- type: 'notify.read only'
1065
- }
1066
- | {
1067
- type: 'notify.ready'
1068
- }
1069
- | {
1070
- type: 'notify.selection'
1071
- selection: EditorSelection
1072
- }
1073
- | {
1074
- type: 'notify.value changed'
1075
- value: Array<PortableTextBlock> | undefined
1076
- }
1077
- | {
1078
- type: 'notify.unset'
1079
- previousValue: Array<PortableTextBlock>
1080
- }
1081
954
  | {
1082
955
  type: 'dragstart'
1083
956
  origin: Pick<EventPosition, 'selection'>
@@ -1103,14 +976,6 @@ declare const editorMachine: StateMachine<
1103
976
  type: 'update readOnly'
1104
977
  readOnly: boolean
1105
978
  }
1106
- | {
1107
- type: 'update schema'
1108
- schema: EditorSchema
1109
- }
1110
- | {
1111
- type: 'update key generator'
1112
- keyGenerator: () => string
1113
- }
1114
979
  | {
1115
980
  type: 'update maxBlocks'
1116
981
  maxBlocks: number | undefined
@@ -1134,6 +999,10 @@ declare const editorMachine: StateMachine<
1134
999
  | {
1135
1000
  type: 'normalizing'
1136
1001
  }
1002
+ | {
1003
+ type: 'update selection'
1004
+ selection: EditorSelection
1005
+ }
1137
1006
  | {
1138
1007
  type: 'done normalizing'
1139
1008
  }
@@ -1151,62 +1020,6 @@ declare const editorMachine: StateMachine<
1151
1020
  preventDefault: () => void
1152
1021
  }
1153
1022
  }
1154
- | {
1155
- type: 'notify.patch'
1156
- patch: Patch
1157
- }
1158
- | {
1159
- type: 'notify.mutation'
1160
- patches: Array<Patch>
1161
- snapshot: Array<PortableTextBlock> | undefined
1162
- value: Array<PortableTextBlock> | undefined
1163
- }
1164
- | {
1165
- type: 'notify.blurred'
1166
- event: FocusEvent_2<HTMLDivElement, Element>
1167
- }
1168
- | {
1169
- type: 'notify.done loading'
1170
- }
1171
- | {
1172
- type: 'notify.editable'
1173
- }
1174
- | {
1175
- type: 'notify.error'
1176
- name: string
1177
- description: string
1178
- data: unknown
1179
- }
1180
- | {
1181
- type: 'notify.focused'
1182
- event: FocusEvent_2<HTMLDivElement, Element>
1183
- }
1184
- | {
1185
- type: 'notify.invalid value'
1186
- resolution: InvalidValueResolution | null
1187
- value: Array<PortableTextBlock> | undefined
1188
- }
1189
- | {
1190
- type: 'notify.loading'
1191
- }
1192
- | {
1193
- type: 'notify.read only'
1194
- }
1195
- | {
1196
- type: 'notify.ready'
1197
- }
1198
- | {
1199
- type: 'notify.selection'
1200
- selection: EditorSelection
1201
- }
1202
- | {
1203
- type: 'notify.value changed'
1204
- value: Array<PortableTextBlock> | undefined
1205
- }
1206
- | {
1207
- type: 'notify.unset'
1208
- previousValue: Array<PortableTextBlock>
1209
- }
1210
1023
  | {
1211
1024
  type: 'dragstart'
1212
1025
  origin: Pick<EventPosition, 'selection'>
@@ -1234,7 +1047,13 @@ declare const editorMachine: StateMachine<
1234
1047
  initialValue: PortableTextBlock[] | undefined
1235
1048
  }
1236
1049
  readonly on: {
1237
- readonly 'notify.blurred': {
1050
+ readonly 'add behavior': {
1051
+ readonly actions: 'add behavior to context'
1052
+ }
1053
+ readonly 'remove behavior': {
1054
+ readonly actions: 'remove behavior from context'
1055
+ }
1056
+ readonly 'update maxBlocks': {
1238
1057
  readonly actions: ActionFunction<
1239
1058
  {
1240
1059
  behaviors: Set<BehaviorConfig>
@@ -1255,8 +1074,8 @@ declare const editorMachine: StateMachine<
1255
1074
  slateEditor?: PortableTextSlateEditor
1256
1075
  },
1257
1076
  {
1258
- type: 'notify.blurred'
1259
- event: FocusEvent_2<HTMLDivElement, Element>
1077
+ type: 'update maxBlocks'
1078
+ maxBlocks: number | undefined
1260
1079
  },
1261
1080
  | InternalPatchEvent
1262
1081
  | MutationEvent
@@ -1265,14 +1084,6 @@ declare const editorMachine: StateMachine<
1265
1084
  type: 'update readOnly'
1266
1085
  readOnly: boolean
1267
1086
  }
1268
- | {
1269
- type: 'update schema'
1270
- schema: EditorSchema
1271
- }
1272
- | {
1273
- type: 'update key generator'
1274
- keyGenerator: () => string
1275
- }
1276
1087
  | {
1277
1088
  type: 'update maxBlocks'
1278
1089
  maxBlocks: number | undefined
@@ -1296,6 +1107,10 @@ declare const editorMachine: StateMachine<
1296
1107
  | {
1297
1108
  type: 'normalizing'
1298
1109
  }
1110
+ | {
1111
+ type: 'update selection'
1112
+ selection: EditorSelection
1113
+ }
1299
1114
  | {
1300
1115
  type: 'done normalizing'
1301
1116
  }
@@ -1313,62 +1128,6 @@ declare const editorMachine: StateMachine<
1313
1128
  preventDefault: () => void
1314
1129
  }
1315
1130
  }
1316
- | {
1317
- type: 'notify.patch'
1318
- patch: Patch
1319
- }
1320
- | {
1321
- type: 'notify.mutation'
1322
- patches: Array<Patch>
1323
- snapshot: Array<PortableTextBlock> | undefined
1324
- value: Array<PortableTextBlock> | undefined
1325
- }
1326
- | {
1327
- type: 'notify.blurred'
1328
- event: FocusEvent_2<HTMLDivElement, Element>
1329
- }
1330
- | {
1331
- type: 'notify.done loading'
1332
- }
1333
- | {
1334
- type: 'notify.editable'
1335
- }
1336
- | {
1337
- type: 'notify.error'
1338
- name: string
1339
- description: string
1340
- data: unknown
1341
- }
1342
- | {
1343
- type: 'notify.focused'
1344
- event: FocusEvent_2<HTMLDivElement, Element>
1345
- }
1346
- | {
1347
- type: 'notify.invalid value'
1348
- resolution: InvalidValueResolution | null
1349
- value: Array<PortableTextBlock> | undefined
1350
- }
1351
- | {
1352
- type: 'notify.loading'
1353
- }
1354
- | {
1355
- type: 'notify.read only'
1356
- }
1357
- | {
1358
- type: 'notify.ready'
1359
- }
1360
- | {
1361
- type: 'notify.selection'
1362
- selection: EditorSelection
1363
- }
1364
- | {
1365
- type: 'notify.value changed'
1366
- value: Array<PortableTextBlock> | undefined
1367
- }
1368
- | {
1369
- type: 'notify.unset'
1370
- previousValue: Array<PortableTextBlock>
1371
- }
1372
1131
  | {
1373
1132
  type: 'dragstart'
1374
1133
  origin: Pick<EventPosition, 'selection'>
@@ -1385,2126 +1144,104 @@ declare const editorMachine: StateMachine<
1385
1144
  never,
1386
1145
  never,
1387
1146
  never,
1388
- | PatchEvent
1389
- | InternalPatchEvent
1390
- | MutationEvent
1391
- | PatchesEvent
1392
- | {
1393
- type: 'blurred'
1394
- event: FocusEvent_2<HTMLDivElement, Element>
1395
- }
1396
- | {
1397
- type: 'done loading'
1398
- }
1399
- | {
1400
- type: 'editable'
1401
- }
1402
- | {
1403
- type: 'error'
1404
- name: string
1405
- description: string
1406
- data: unknown
1407
- }
1408
- | {
1409
- type: 'focused'
1410
- event: FocusEvent_2<HTMLDivElement, Element>
1411
- }
1412
- | {
1413
- type: 'invalid value'
1414
- resolution: InvalidValueResolution | null
1415
- value: Array<PortableTextBlock> | undefined
1416
- }
1417
- | {
1418
- type: 'loading'
1419
- }
1420
- | {
1421
- type: 'read only'
1422
- }
1423
- | {
1424
- type: 'ready'
1425
- }
1426
- | {
1427
- type: 'selection'
1428
- selection: EditorSelection
1429
- }
1430
- | {
1431
- type: 'value changed'
1432
- value: Array<PortableTextBlock> | undefined
1433
- }
1434
- | UnsetEvent
1147
+ never
1435
1148
  >
1436
1149
  }
1437
- readonly 'notify.done loading': {
1438
- readonly actions: ActionFunction<
1439
- {
1440
- behaviors: Set<BehaviorConfig>
1441
- converters: Set<Converter>
1442
- getLegacySchema: () => PortableTextMemberSchemaTypes
1443
- keyGenerator: () => string
1444
- pendingEvents: Array<InternalPatchEvent | MutationEvent>
1445
- pendingIncomingPatchesEvents: Array<PatchesEvent>
1446
- schema: EditorSchema
1447
- initialReadOnly: boolean
1448
- maxBlocks: number | undefined
1449
- selection: EditorSelection
1450
- initialValue: Array<PortableTextBlock> | undefined
1451
- internalDrag?: {
1452
- ghost?: HTMLElement
1453
- origin: Pick<EventPosition, 'selection'>
1454
- }
1455
- slateEditor?: PortableTextSlateEditor
1456
- },
1457
- {
1458
- type: 'notify.done loading'
1459
- },
1460
- | InternalPatchEvent
1461
- | MutationEvent
1462
- | PatchesEvent
1463
- | {
1464
- type: 'update readOnly'
1465
- readOnly: boolean
1466
- }
1467
- | {
1468
- type: 'update schema'
1469
- schema: EditorSchema
1470
- }
1471
- | {
1472
- type: 'update key generator'
1150
+ readonly 'update selection': {
1151
+ readonly actions: readonly [
1152
+ ActionFunction<
1153
+ {
1154
+ behaviors: Set<BehaviorConfig>
1155
+ converters: Set<Converter>
1156
+ getLegacySchema: () => PortableTextMemberSchemaTypes
1473
1157
  keyGenerator: () => string
1474
- }
1475
- | {
1476
- type: 'update maxBlocks'
1158
+ pendingEvents: Array<InternalPatchEvent | MutationEvent>
1159
+ pendingIncomingPatchesEvents: Array<PatchesEvent>
1160
+ schema: EditorSchema
1161
+ initialReadOnly: boolean
1477
1162
  maxBlocks: number | undefined
1478
- }
1479
- | {
1480
- type: 'add behavior'
1481
- behaviorConfig: BehaviorConfig
1482
- }
1483
- | {
1484
- type: 'remove behavior'
1485
- behaviorConfig: BehaviorConfig
1486
- }
1487
- | {
1488
- type: 'blur'
1489
- editor: PortableTextSlateEditor
1490
- }
1491
- | {
1492
- type: 'focus'
1493
- editor: PortableTextSlateEditor
1494
- }
1495
- | {
1496
- type: 'normalizing'
1497
- }
1498
- | {
1499
- type: 'done normalizing'
1500
- }
1501
- | {
1502
- type: 'done syncing value'
1503
- }
1504
- | {
1505
- type: 'syncing value'
1506
- }
1507
- | {
1508
- type: 'behavior event'
1509
- behaviorEvent: BehaviorEvent
1510
- editor: PortableTextSlateEditor
1511
- nativeEvent?: {
1512
- preventDefault: () => void
1513
- }
1514
- }
1515
- | {
1516
- type: 'notify.patch'
1517
- patch: Patch
1518
- }
1519
- | {
1520
- type: 'notify.mutation'
1521
- patches: Array<Patch>
1522
- snapshot: Array<PortableTextBlock> | undefined
1523
- value: Array<PortableTextBlock> | undefined
1524
- }
1525
- | {
1526
- type: 'notify.blurred'
1527
- event: FocusEvent_2<HTMLDivElement, Element>
1528
- }
1529
- | {
1530
- type: 'notify.done loading'
1531
- }
1532
- | {
1533
- type: 'notify.editable'
1534
- }
1535
- | {
1536
- type: 'notify.error'
1537
- name: string
1538
- description: string
1539
- data: unknown
1540
- }
1541
- | {
1542
- type: 'notify.focused'
1543
- event: FocusEvent_2<HTMLDivElement, Element>
1544
- }
1545
- | {
1546
- type: 'notify.invalid value'
1547
- resolution: InvalidValueResolution | null
1548
- value: Array<PortableTextBlock> | undefined
1549
- }
1550
- | {
1551
- type: 'notify.loading'
1552
- }
1553
- | {
1554
- type: 'notify.read only'
1555
- }
1556
- | {
1557
- type: 'notify.ready'
1558
- }
1559
- | {
1560
- type: 'notify.selection'
1561
- selection: EditorSelection
1562
- }
1563
- | {
1564
- type: 'notify.value changed'
1565
- value: Array<PortableTextBlock> | undefined
1566
- }
1567
- | {
1568
- type: 'notify.unset'
1569
- previousValue: Array<PortableTextBlock>
1570
- }
1571
- | {
1572
- type: 'dragstart'
1573
- origin: Pick<EventPosition, 'selection'>
1574
- ghost?: HTMLElement
1575
- }
1576
- | {
1577
- type: 'dragend'
1578
- }
1579
- | {
1580
- type: 'drop'
1581
- },
1582
- undefined,
1583
- never,
1584
- never,
1585
- never,
1586
- never,
1587
- | PatchEvent
1588
- | InternalPatchEvent
1589
- | MutationEvent
1590
- | PatchesEvent
1591
- | {
1592
- type: 'blurred'
1593
- event: FocusEvent_2<HTMLDivElement, Element>
1594
- }
1595
- | {
1596
- type: 'done loading'
1597
- }
1598
- | {
1599
- type: 'editable'
1600
- }
1601
- | {
1602
- type: 'error'
1603
- name: string
1604
- description: string
1605
- data: unknown
1606
- }
1607
- | {
1608
- type: 'focused'
1609
- event: FocusEvent_2<HTMLDivElement, Element>
1610
- }
1611
- | {
1612
- type: 'invalid value'
1613
- resolution: InvalidValueResolution | null
1614
- value: Array<PortableTextBlock> | undefined
1615
- }
1616
- | {
1617
- type: 'loading'
1618
- }
1619
- | {
1620
- type: 'read only'
1621
- }
1622
- | {
1623
- type: 'ready'
1624
- }
1625
- | {
1626
- type: 'selection'
1627
- selection: EditorSelection
1628
- }
1629
- | {
1630
- type: 'value changed'
1631
- value: Array<PortableTextBlock> | undefined
1632
- }
1633
- | UnsetEvent
1634
- >
1635
- }
1636
- readonly 'notify.error': {
1637
- readonly actions: ActionFunction<
1638
- {
1639
- behaviors: Set<BehaviorConfig>
1640
- converters: Set<Converter>
1641
- getLegacySchema: () => PortableTextMemberSchemaTypes
1642
- keyGenerator: () => string
1643
- pendingEvents: Array<InternalPatchEvent | MutationEvent>
1644
- pendingIncomingPatchesEvents: Array<PatchesEvent>
1645
- schema: EditorSchema
1646
- initialReadOnly: boolean
1647
- maxBlocks: number | undefined
1648
- selection: EditorSelection
1649
- initialValue: Array<PortableTextBlock> | undefined
1650
- internalDrag?: {
1651
- ghost?: HTMLElement
1652
- origin: Pick<EventPosition, 'selection'>
1653
- }
1654
- slateEditor?: PortableTextSlateEditor
1655
- },
1656
- {
1657
- type: 'notify.error'
1658
- name: string
1659
- description: string
1660
- data: unknown
1661
- },
1662
- | InternalPatchEvent
1663
- | MutationEvent
1664
- | PatchesEvent
1665
- | {
1666
- type: 'update readOnly'
1667
- readOnly: boolean
1668
- }
1669
- | {
1670
- type: 'update schema'
1671
- schema: EditorSchema
1672
- }
1673
- | {
1674
- type: 'update key generator'
1675
- keyGenerator: () => string
1676
- }
1677
- | {
1678
- type: 'update maxBlocks'
1679
- maxBlocks: number | undefined
1680
- }
1681
- | {
1682
- type: 'add behavior'
1683
- behaviorConfig: BehaviorConfig
1684
- }
1685
- | {
1686
- type: 'remove behavior'
1687
- behaviorConfig: BehaviorConfig
1688
- }
1689
- | {
1690
- type: 'blur'
1691
- editor: PortableTextSlateEditor
1692
- }
1693
- | {
1694
- type: 'focus'
1695
- editor: PortableTextSlateEditor
1696
- }
1697
- | {
1698
- type: 'normalizing'
1699
- }
1700
- | {
1701
- type: 'done normalizing'
1702
- }
1703
- | {
1704
- type: 'done syncing value'
1705
- }
1706
- | {
1707
- type: 'syncing value'
1708
- }
1709
- | {
1710
- type: 'behavior event'
1711
- behaviorEvent: BehaviorEvent
1712
- editor: PortableTextSlateEditor
1713
- nativeEvent?: {
1714
- preventDefault: () => void
1715
- }
1716
- }
1717
- | {
1718
- type: 'notify.patch'
1719
- patch: Patch
1720
- }
1721
- | {
1722
- type: 'notify.mutation'
1723
- patches: Array<Patch>
1724
- snapshot: Array<PortableTextBlock> | undefined
1725
- value: Array<PortableTextBlock> | undefined
1726
- }
1727
- | {
1728
- type: 'notify.blurred'
1729
- event: FocusEvent_2<HTMLDivElement, Element>
1730
- }
1731
- | {
1732
- type: 'notify.done loading'
1733
- }
1734
- | {
1735
- type: 'notify.editable'
1736
- }
1737
- | {
1738
- type: 'notify.error'
1739
- name: string
1740
- description: string
1741
- data: unknown
1742
- }
1743
- | {
1744
- type: 'notify.focused'
1745
- event: FocusEvent_2<HTMLDivElement, Element>
1746
- }
1747
- | {
1748
- type: 'notify.invalid value'
1749
- resolution: InvalidValueResolution | null
1750
- value: Array<PortableTextBlock> | undefined
1751
- }
1752
- | {
1753
- type: 'notify.loading'
1754
- }
1755
- | {
1756
- type: 'notify.read only'
1757
- }
1758
- | {
1759
- type: 'notify.ready'
1760
- }
1761
- | {
1762
- type: 'notify.selection'
1763
- selection: EditorSelection
1764
- }
1765
- | {
1766
- type: 'notify.value changed'
1767
- value: Array<PortableTextBlock> | undefined
1768
- }
1769
- | {
1770
- type: 'notify.unset'
1771
- previousValue: Array<PortableTextBlock>
1772
- }
1773
- | {
1774
- type: 'dragstart'
1775
- origin: Pick<EventPosition, 'selection'>
1776
- ghost?: HTMLElement
1777
- }
1778
- | {
1779
- type: 'dragend'
1780
- }
1781
- | {
1782
- type: 'drop'
1783
- },
1784
- undefined,
1785
- never,
1786
- never,
1787
- never,
1788
- never,
1789
- | PatchEvent
1790
- | InternalPatchEvent
1791
- | MutationEvent
1792
- | PatchesEvent
1793
- | {
1794
- type: 'blurred'
1795
- event: FocusEvent_2<HTMLDivElement, Element>
1796
- }
1797
- | {
1798
- type: 'done loading'
1799
- }
1800
- | {
1801
- type: 'editable'
1802
- }
1803
- | {
1804
- type: 'error'
1805
- name: string
1806
- description: string
1807
- data: unknown
1808
- }
1809
- | {
1810
- type: 'focused'
1811
- event: FocusEvent_2<HTMLDivElement, Element>
1812
- }
1813
- | {
1814
- type: 'invalid value'
1815
- resolution: InvalidValueResolution | null
1816
- value: Array<PortableTextBlock> | undefined
1817
- }
1818
- | {
1819
- type: 'loading'
1820
- }
1821
- | {
1822
- type: 'read only'
1823
- }
1824
- | {
1825
- type: 'ready'
1826
- }
1827
- | {
1828
- type: 'selection'
1829
- selection: EditorSelection
1830
- }
1831
- | {
1832
- type: 'value changed'
1833
- value: Array<PortableTextBlock> | undefined
1834
- }
1835
- | UnsetEvent
1836
- >
1837
- }
1838
- readonly 'notify.invalid value': {
1839
- readonly actions: ActionFunction<
1840
- {
1841
- behaviors: Set<BehaviorConfig>
1842
- converters: Set<Converter>
1843
- getLegacySchema: () => PortableTextMemberSchemaTypes
1844
- keyGenerator: () => string
1845
- pendingEvents: Array<InternalPatchEvent | MutationEvent>
1846
- pendingIncomingPatchesEvents: Array<PatchesEvent>
1847
- schema: EditorSchema
1848
- initialReadOnly: boolean
1849
- maxBlocks: number | undefined
1850
- selection: EditorSelection
1851
- initialValue: Array<PortableTextBlock> | undefined
1852
- internalDrag?: {
1853
- ghost?: HTMLElement
1854
- origin: Pick<EventPosition, 'selection'>
1855
- }
1856
- slateEditor?: PortableTextSlateEditor
1857
- },
1858
- {
1859
- type: 'notify.invalid value'
1860
- resolution: InvalidValueResolution | null
1861
- value: Array<PortableTextBlock> | undefined
1862
- },
1863
- | InternalPatchEvent
1864
- | MutationEvent
1865
- | PatchesEvent
1866
- | {
1867
- type: 'update readOnly'
1868
- readOnly: boolean
1869
- }
1870
- | {
1871
- type: 'update schema'
1872
- schema: EditorSchema
1873
- }
1874
- | {
1875
- type: 'update key generator'
1876
- keyGenerator: () => string
1877
- }
1878
- | {
1879
- type: 'update maxBlocks'
1880
- maxBlocks: number | undefined
1881
- }
1882
- | {
1883
- type: 'add behavior'
1884
- behaviorConfig: BehaviorConfig
1885
- }
1886
- | {
1887
- type: 'remove behavior'
1888
- behaviorConfig: BehaviorConfig
1889
- }
1890
- | {
1891
- type: 'blur'
1892
- editor: PortableTextSlateEditor
1893
- }
1894
- | {
1895
- type: 'focus'
1896
- editor: PortableTextSlateEditor
1897
- }
1898
- | {
1899
- type: 'normalizing'
1900
- }
1901
- | {
1902
- type: 'done normalizing'
1903
- }
1904
- | {
1905
- type: 'done syncing value'
1906
- }
1907
- | {
1908
- type: 'syncing value'
1909
- }
1910
- | {
1911
- type: 'behavior event'
1912
- behaviorEvent: BehaviorEvent
1913
- editor: PortableTextSlateEditor
1914
- nativeEvent?: {
1915
- preventDefault: () => void
1916
- }
1917
- }
1918
- | {
1919
- type: 'notify.patch'
1920
- patch: Patch
1921
- }
1922
- | {
1923
- type: 'notify.mutation'
1924
- patches: Array<Patch>
1925
- snapshot: Array<PortableTextBlock> | undefined
1926
- value: Array<PortableTextBlock> | undefined
1927
- }
1928
- | {
1929
- type: 'notify.blurred'
1930
- event: FocusEvent_2<HTMLDivElement, Element>
1931
- }
1932
- | {
1933
- type: 'notify.done loading'
1934
- }
1935
- | {
1936
- type: 'notify.editable'
1937
- }
1938
- | {
1939
- type: 'notify.error'
1940
- name: string
1941
- description: string
1942
- data: unknown
1943
- }
1944
- | {
1945
- type: 'notify.focused'
1946
- event: FocusEvent_2<HTMLDivElement, Element>
1947
- }
1948
- | {
1949
- type: 'notify.invalid value'
1950
- resolution: InvalidValueResolution | null
1951
- value: Array<PortableTextBlock> | undefined
1952
- }
1953
- | {
1954
- type: 'notify.loading'
1955
- }
1956
- | {
1957
- type: 'notify.read only'
1958
- }
1959
- | {
1960
- type: 'notify.ready'
1961
- }
1962
- | {
1963
- type: 'notify.selection'
1964
- selection: EditorSelection
1965
- }
1966
- | {
1967
- type: 'notify.value changed'
1968
- value: Array<PortableTextBlock> | undefined
1969
- }
1970
- | {
1971
- type: 'notify.unset'
1972
- previousValue: Array<PortableTextBlock>
1973
- }
1974
- | {
1975
- type: 'dragstart'
1976
- origin: Pick<EventPosition, 'selection'>
1977
- ghost?: HTMLElement
1978
- }
1979
- | {
1980
- type: 'dragend'
1981
- }
1982
- | {
1983
- type: 'drop'
1984
- },
1985
- undefined,
1986
- never,
1987
- never,
1988
- never,
1989
- never,
1990
- | PatchEvent
1991
- | InternalPatchEvent
1992
- | MutationEvent
1993
- | PatchesEvent
1994
- | {
1995
- type: 'blurred'
1996
- event: FocusEvent_2<HTMLDivElement, Element>
1997
- }
1998
- | {
1999
- type: 'done loading'
2000
- }
2001
- | {
2002
- type: 'editable'
2003
- }
2004
- | {
2005
- type: 'error'
2006
- name: string
2007
- description: string
2008
- data: unknown
2009
- }
2010
- | {
2011
- type: 'focused'
2012
- event: FocusEvent_2<HTMLDivElement, Element>
2013
- }
2014
- | {
2015
- type: 'invalid value'
2016
- resolution: InvalidValueResolution | null
2017
- value: Array<PortableTextBlock> | undefined
2018
- }
2019
- | {
2020
- type: 'loading'
2021
- }
2022
- | {
2023
- type: 'read only'
2024
- }
2025
- | {
2026
- type: 'ready'
2027
- }
2028
- | {
2029
- type: 'selection'
2030
- selection: EditorSelection
2031
- }
2032
- | {
2033
- type: 'value changed'
2034
- value: Array<PortableTextBlock> | undefined
2035
- }
2036
- | UnsetEvent
2037
- >
2038
- }
2039
- readonly 'notify.focused': {
2040
- readonly actions: ActionFunction<
2041
- {
2042
- behaviors: Set<BehaviorConfig>
2043
- converters: Set<Converter>
2044
- getLegacySchema: () => PortableTextMemberSchemaTypes
2045
- keyGenerator: () => string
2046
- pendingEvents: Array<InternalPatchEvent | MutationEvent>
2047
- pendingIncomingPatchesEvents: Array<PatchesEvent>
2048
- schema: EditorSchema
2049
- initialReadOnly: boolean
2050
- maxBlocks: number | undefined
2051
- selection: EditorSelection
2052
- initialValue: Array<PortableTextBlock> | undefined
2053
- internalDrag?: {
2054
- ghost?: HTMLElement
2055
- origin: Pick<EventPosition, 'selection'>
2056
- }
2057
- slateEditor?: PortableTextSlateEditor
2058
- },
2059
- {
2060
- type: 'notify.focused'
2061
- event: FocusEvent_2<HTMLDivElement, Element>
2062
- },
2063
- | InternalPatchEvent
2064
- | MutationEvent
2065
- | PatchesEvent
2066
- | {
2067
- type: 'update readOnly'
2068
- readOnly: boolean
2069
- }
2070
- | {
2071
- type: 'update schema'
2072
- schema: EditorSchema
2073
- }
2074
- | {
2075
- type: 'update key generator'
2076
- keyGenerator: () => string
2077
- }
2078
- | {
2079
- type: 'update maxBlocks'
2080
- maxBlocks: number | undefined
2081
- }
2082
- | {
2083
- type: 'add behavior'
2084
- behaviorConfig: BehaviorConfig
2085
- }
2086
- | {
2087
- type: 'remove behavior'
2088
- behaviorConfig: BehaviorConfig
2089
- }
2090
- | {
2091
- type: 'blur'
2092
- editor: PortableTextSlateEditor
2093
- }
2094
- | {
2095
- type: 'focus'
2096
- editor: PortableTextSlateEditor
2097
- }
2098
- | {
2099
- type: 'normalizing'
2100
- }
2101
- | {
2102
- type: 'done normalizing'
2103
- }
2104
- | {
2105
- type: 'done syncing value'
2106
- }
2107
- | {
2108
- type: 'syncing value'
2109
- }
2110
- | {
2111
- type: 'behavior event'
2112
- behaviorEvent: BehaviorEvent
2113
- editor: PortableTextSlateEditor
2114
- nativeEvent?: {
2115
- preventDefault: () => void
2116
- }
2117
- }
2118
- | {
2119
- type: 'notify.patch'
2120
- patch: Patch
2121
- }
2122
- | {
2123
- type: 'notify.mutation'
2124
- patches: Array<Patch>
2125
- snapshot: Array<PortableTextBlock> | undefined
2126
- value: Array<PortableTextBlock> | undefined
2127
- }
2128
- | {
2129
- type: 'notify.blurred'
2130
- event: FocusEvent_2<HTMLDivElement, Element>
2131
- }
2132
- | {
2133
- type: 'notify.done loading'
2134
- }
2135
- | {
2136
- type: 'notify.editable'
2137
- }
2138
- | {
2139
- type: 'notify.error'
2140
- name: string
2141
- description: string
2142
- data: unknown
2143
- }
2144
- | {
2145
- type: 'notify.focused'
2146
- event: FocusEvent_2<HTMLDivElement, Element>
2147
- }
2148
- | {
2149
- type: 'notify.invalid value'
2150
- resolution: InvalidValueResolution | null
2151
- value: Array<PortableTextBlock> | undefined
2152
- }
2153
- | {
2154
- type: 'notify.loading'
2155
- }
2156
- | {
2157
- type: 'notify.read only'
2158
- }
2159
- | {
2160
- type: 'notify.ready'
2161
- }
2162
- | {
2163
- type: 'notify.selection'
2164
- selection: EditorSelection
2165
- }
2166
- | {
2167
- type: 'notify.value changed'
2168
- value: Array<PortableTextBlock> | undefined
2169
- }
2170
- | {
2171
- type: 'notify.unset'
2172
- previousValue: Array<PortableTextBlock>
2173
- }
2174
- | {
2175
- type: 'dragstart'
2176
- origin: Pick<EventPosition, 'selection'>
2177
- ghost?: HTMLElement
2178
- }
2179
- | {
2180
- type: 'dragend'
2181
- }
2182
- | {
2183
- type: 'drop'
2184
- },
2185
- undefined,
2186
- never,
2187
- never,
2188
- never,
2189
- never,
2190
- | PatchEvent
2191
- | InternalPatchEvent
2192
- | MutationEvent
2193
- | PatchesEvent
2194
- | {
2195
- type: 'blurred'
2196
- event: FocusEvent_2<HTMLDivElement, Element>
2197
- }
2198
- | {
2199
- type: 'done loading'
2200
- }
2201
- | {
2202
- type: 'editable'
2203
- }
2204
- | {
2205
- type: 'error'
2206
- name: string
2207
- description: string
2208
- data: unknown
2209
- }
2210
- | {
2211
- type: 'focused'
2212
- event: FocusEvent_2<HTMLDivElement, Element>
2213
- }
2214
- | {
2215
- type: 'invalid value'
2216
- resolution: InvalidValueResolution | null
2217
- value: Array<PortableTextBlock> | undefined
2218
- }
2219
- | {
2220
- type: 'loading'
2221
- }
2222
- | {
2223
- type: 'read only'
2224
- }
2225
- | {
2226
- type: 'ready'
2227
- }
2228
- | {
2229
- type: 'selection'
2230
- selection: EditorSelection
2231
- }
2232
- | {
2233
- type: 'value changed'
2234
- value: Array<PortableTextBlock> | undefined
2235
- }
2236
- | UnsetEvent
2237
- >
2238
- }
2239
- readonly 'notify.selection': {
2240
- readonly actions: readonly [
2241
- ActionFunction<
2242
- {
2243
- behaviors: Set<BehaviorConfig>
2244
- converters: Set<Converter>
2245
- getLegacySchema: () => PortableTextMemberSchemaTypes
2246
- keyGenerator: () => string
2247
- pendingEvents: Array<InternalPatchEvent | MutationEvent>
2248
- pendingIncomingPatchesEvents: Array<PatchesEvent>
2249
- schema: EditorSchema
2250
- initialReadOnly: boolean
2251
- maxBlocks: number | undefined
2252
- selection: EditorSelection
2253
- initialValue: Array<PortableTextBlock> | undefined
2254
- internalDrag?: {
2255
- ghost?: HTMLElement
2256
- origin: Pick<EventPosition, 'selection'>
2257
- }
2258
- slateEditor?: PortableTextSlateEditor
2259
- },
2260
- {
2261
- type: 'notify.selection'
2262
- selection: EditorSelection
2263
- },
2264
- | InternalPatchEvent
2265
- | MutationEvent
2266
- | PatchesEvent
2267
- | {
2268
- type: 'update readOnly'
2269
- readOnly: boolean
2270
- }
2271
- | {
2272
- type: 'update schema'
2273
- schema: EditorSchema
2274
- }
2275
- | {
2276
- type: 'update key generator'
2277
- keyGenerator: () => string
2278
- }
2279
- | {
2280
- type: 'update maxBlocks'
2281
- maxBlocks: number | undefined
2282
- }
2283
- | {
2284
- type: 'add behavior'
2285
- behaviorConfig: BehaviorConfig
2286
- }
2287
- | {
2288
- type: 'remove behavior'
2289
- behaviorConfig: BehaviorConfig
2290
- }
2291
- | {
2292
- type: 'blur'
2293
- editor: PortableTextSlateEditor
2294
- }
2295
- | {
2296
- type: 'focus'
2297
- editor: PortableTextSlateEditor
2298
- }
2299
- | {
2300
- type: 'normalizing'
2301
- }
2302
- | {
2303
- type: 'done normalizing'
2304
- }
2305
- | {
2306
- type: 'done syncing value'
2307
- }
2308
- | {
2309
- type: 'syncing value'
2310
- }
2311
- | {
2312
- type: 'behavior event'
2313
- behaviorEvent: BehaviorEvent
2314
- editor: PortableTextSlateEditor
2315
- nativeEvent?: {
2316
- preventDefault: () => void
2317
- }
2318
- }
2319
- | {
2320
- type: 'notify.patch'
2321
- patch: Patch
2322
- }
2323
- | {
2324
- type: 'notify.mutation'
2325
- patches: Array<Patch>
2326
- snapshot: Array<PortableTextBlock> | undefined
2327
- value: Array<PortableTextBlock> | undefined
2328
- }
2329
- | {
2330
- type: 'notify.blurred'
2331
- event: FocusEvent_2<HTMLDivElement, Element>
2332
- }
2333
- | {
2334
- type: 'notify.done loading'
2335
- }
2336
- | {
2337
- type: 'notify.editable'
2338
- }
2339
- | {
2340
- type: 'notify.error'
2341
- name: string
2342
- description: string
2343
- data: unknown
2344
- }
2345
- | {
2346
- type: 'notify.focused'
2347
- event: FocusEvent_2<HTMLDivElement, Element>
2348
- }
2349
- | {
2350
- type: 'notify.invalid value'
2351
- resolution: InvalidValueResolution | null
2352
- value: Array<PortableTextBlock> | undefined
2353
- }
2354
- | {
2355
- type: 'notify.loading'
2356
- }
2357
- | {
2358
- type: 'notify.read only'
2359
- }
2360
- | {
2361
- type: 'notify.ready'
2362
- }
2363
- | {
2364
- type: 'notify.selection'
2365
- selection: EditorSelection
2366
- }
2367
- | {
2368
- type: 'notify.value changed'
2369
- value: Array<PortableTextBlock> | undefined
2370
- }
2371
- | {
2372
- type: 'notify.unset'
2373
- previousValue: Array<PortableTextBlock>
2374
- }
2375
- | {
2376
- type: 'dragstart'
2377
- origin: Pick<EventPosition, 'selection'>
2378
- ghost?: HTMLElement
2379
- }
2380
- | {
2381
- type: 'dragend'
2382
- }
2383
- | {
2384
- type: 'drop'
2385
- },
2386
- undefined,
2387
- never,
2388
- never,
2389
- never,
2390
- never,
2391
- never
2392
- >,
2393
- ActionFunction<
2394
- {
2395
- behaviors: Set<BehaviorConfig>
2396
- converters: Set<Converter>
2397
- getLegacySchema: () => PortableTextMemberSchemaTypes
2398
- keyGenerator: () => string
2399
- pendingEvents: Array<InternalPatchEvent | MutationEvent>
2400
- pendingIncomingPatchesEvents: Array<PatchesEvent>
2401
- schema: EditorSchema
2402
- initialReadOnly: boolean
2403
- maxBlocks: number | undefined
2404
- selection: EditorSelection
2405
- initialValue: Array<PortableTextBlock> | undefined
2406
- internalDrag?: {
2407
- ghost?: HTMLElement
2408
- origin: Pick<EventPosition, 'selection'>
2409
- }
2410
- slateEditor?: PortableTextSlateEditor
2411
- },
2412
- {
2413
- type: 'notify.selection'
2414
- selection: EditorSelection
2415
- },
2416
- | InternalPatchEvent
2417
- | MutationEvent
2418
- | PatchesEvent
2419
- | {
2420
- type: 'update readOnly'
2421
- readOnly: boolean
2422
- }
2423
- | {
2424
- type: 'update schema'
2425
- schema: EditorSchema
2426
- }
2427
- | {
2428
- type: 'update key generator'
2429
- keyGenerator: () => string
2430
- }
2431
- | {
2432
- type: 'update maxBlocks'
2433
- maxBlocks: number | undefined
2434
- }
2435
- | {
2436
- type: 'add behavior'
2437
- behaviorConfig: BehaviorConfig
2438
- }
2439
- | {
2440
- type: 'remove behavior'
2441
- behaviorConfig: BehaviorConfig
2442
- }
2443
- | {
2444
- type: 'blur'
2445
- editor: PortableTextSlateEditor
2446
- }
2447
- | {
2448
- type: 'focus'
2449
- editor: PortableTextSlateEditor
2450
- }
2451
- | {
2452
- type: 'normalizing'
2453
- }
2454
- | {
2455
- type: 'done normalizing'
2456
- }
2457
- | {
2458
- type: 'done syncing value'
2459
- }
2460
- | {
2461
- type: 'syncing value'
2462
- }
2463
- | {
2464
- type: 'behavior event'
2465
- behaviorEvent: BehaviorEvent
2466
- editor: PortableTextSlateEditor
2467
- nativeEvent?: {
2468
- preventDefault: () => void
2469
- }
2470
- }
2471
- | {
2472
- type: 'notify.patch'
2473
- patch: Patch
2474
- }
2475
- | {
2476
- type: 'notify.mutation'
2477
- patches: Array<Patch>
2478
- snapshot: Array<PortableTextBlock> | undefined
2479
- value: Array<PortableTextBlock> | undefined
2480
- }
2481
- | {
2482
- type: 'notify.blurred'
2483
- event: FocusEvent_2<HTMLDivElement, Element>
2484
- }
2485
- | {
2486
- type: 'notify.done loading'
2487
- }
2488
- | {
2489
- type: 'notify.editable'
2490
- }
2491
- | {
2492
- type: 'notify.error'
2493
- name: string
2494
- description: string
2495
- data: unknown
2496
- }
2497
- | {
2498
- type: 'notify.focused'
2499
- event: FocusEvent_2<HTMLDivElement, Element>
2500
- }
2501
- | {
2502
- type: 'notify.invalid value'
2503
- resolution: InvalidValueResolution | null
2504
- value: Array<PortableTextBlock> | undefined
2505
- }
2506
- | {
2507
- type: 'notify.loading'
2508
- }
2509
- | {
2510
- type: 'notify.read only'
2511
- }
2512
- | {
2513
- type: 'notify.ready'
2514
- }
2515
- | {
2516
- type: 'notify.selection'
2517
- selection: EditorSelection
2518
- }
2519
- | {
2520
- type: 'notify.value changed'
2521
- value: Array<PortableTextBlock> | undefined
2522
- }
2523
- | {
2524
- type: 'notify.unset'
2525
- previousValue: Array<PortableTextBlock>
2526
- }
2527
- | {
2528
- type: 'dragstart'
2529
- origin: Pick<EventPosition, 'selection'>
2530
- ghost?: HTMLElement
2531
- }
2532
- | {
2533
- type: 'dragend'
2534
- }
2535
- | {
2536
- type: 'drop'
2537
- },
2538
- undefined,
2539
- never,
2540
- never,
2541
- never,
2542
- never,
2543
- | PatchEvent
2544
- | InternalPatchEvent
2545
- | MutationEvent
2546
- | PatchesEvent
2547
- | {
2548
- type: 'blurred'
2549
- event: FocusEvent_2<HTMLDivElement, Element>
2550
- }
2551
- | {
2552
- type: 'done loading'
2553
- }
2554
- | {
2555
- type: 'editable'
2556
- }
2557
- | {
2558
- type: 'error'
2559
- name: string
2560
- description: string
2561
- data: unknown
2562
- }
2563
- | {
2564
- type: 'focused'
2565
- event: FocusEvent_2<HTMLDivElement, Element>
2566
- }
2567
- | {
2568
- type: 'invalid value'
2569
- resolution: InvalidValueResolution | null
2570
- value: Array<PortableTextBlock> | undefined
2571
- }
2572
- | {
2573
- type: 'loading'
2574
- }
2575
- | {
2576
- type: 'read only'
2577
- }
2578
- | {
2579
- type: 'ready'
2580
- }
2581
- | {
2582
- type: 'selection'
2583
- selection: EditorSelection
2584
- }
2585
- | {
2586
- type: 'value changed'
2587
- value: Array<PortableTextBlock> | undefined
2588
- }
2589
- | UnsetEvent
2590
- >,
2591
- ]
2592
- }
2593
- readonly 'notify.unset': {
2594
- readonly actions: ActionFunction<
2595
- {
2596
- behaviors: Set<BehaviorConfig>
2597
- converters: Set<Converter>
2598
- getLegacySchema: () => PortableTextMemberSchemaTypes
2599
- keyGenerator: () => string
2600
- pendingEvents: Array<InternalPatchEvent | MutationEvent>
2601
- pendingIncomingPatchesEvents: Array<PatchesEvent>
2602
- schema: EditorSchema
2603
- initialReadOnly: boolean
2604
- maxBlocks: number | undefined
2605
- selection: EditorSelection
2606
- initialValue: Array<PortableTextBlock> | undefined
2607
- internalDrag?: {
2608
- ghost?: HTMLElement
2609
- origin: Pick<EventPosition, 'selection'>
2610
- }
2611
- slateEditor?: PortableTextSlateEditor
2612
- },
2613
- {
2614
- type: 'notify.unset'
2615
- previousValue: Array<PortableTextBlock>
2616
- },
2617
- | InternalPatchEvent
2618
- | MutationEvent
2619
- | PatchesEvent
2620
- | {
2621
- type: 'update readOnly'
2622
- readOnly: boolean
2623
- }
2624
- | {
2625
- type: 'update schema'
2626
- schema: EditorSchema
2627
- }
2628
- | {
2629
- type: 'update key generator'
2630
- keyGenerator: () => string
2631
- }
2632
- | {
2633
- type: 'update maxBlocks'
2634
- maxBlocks: number | undefined
2635
- }
2636
- | {
2637
- type: 'add behavior'
2638
- behaviorConfig: BehaviorConfig
2639
- }
2640
- | {
2641
- type: 'remove behavior'
2642
- behaviorConfig: BehaviorConfig
2643
- }
2644
- | {
2645
- type: 'blur'
2646
- editor: PortableTextSlateEditor
2647
- }
2648
- | {
2649
- type: 'focus'
2650
- editor: PortableTextSlateEditor
2651
- }
2652
- | {
2653
- type: 'normalizing'
2654
- }
2655
- | {
2656
- type: 'done normalizing'
2657
- }
2658
- | {
2659
- type: 'done syncing value'
2660
- }
2661
- | {
2662
- type: 'syncing value'
2663
- }
2664
- | {
2665
- type: 'behavior event'
2666
- behaviorEvent: BehaviorEvent
2667
- editor: PortableTextSlateEditor
2668
- nativeEvent?: {
2669
- preventDefault: () => void
2670
- }
2671
- }
2672
- | {
2673
- type: 'notify.patch'
2674
- patch: Patch
2675
- }
2676
- | {
2677
- type: 'notify.mutation'
2678
- patches: Array<Patch>
2679
- snapshot: Array<PortableTextBlock> | undefined
2680
- value: Array<PortableTextBlock> | undefined
2681
- }
2682
- | {
2683
- type: 'notify.blurred'
2684
- event: FocusEvent_2<HTMLDivElement, Element>
2685
- }
2686
- | {
2687
- type: 'notify.done loading'
2688
- }
2689
- | {
2690
- type: 'notify.editable'
2691
- }
2692
- | {
2693
- type: 'notify.error'
2694
- name: string
2695
- description: string
2696
- data: unknown
2697
- }
2698
- | {
2699
- type: 'notify.focused'
2700
- event: FocusEvent_2<HTMLDivElement, Element>
2701
- }
2702
- | {
2703
- type: 'notify.invalid value'
2704
- resolution: InvalidValueResolution | null
2705
- value: Array<PortableTextBlock> | undefined
2706
- }
2707
- | {
2708
- type: 'notify.loading'
2709
- }
2710
- | {
2711
- type: 'notify.read only'
2712
- }
2713
- | {
2714
- type: 'notify.ready'
2715
- }
2716
- | {
2717
- type: 'notify.selection'
2718
- selection: EditorSelection
2719
- }
2720
- | {
2721
- type: 'notify.value changed'
2722
- value: Array<PortableTextBlock> | undefined
2723
- }
2724
- | {
2725
- type: 'notify.unset'
2726
- previousValue: Array<PortableTextBlock>
2727
- }
2728
- | {
2729
- type: 'dragstart'
2730
- origin: Pick<EventPosition, 'selection'>
2731
- ghost?: HTMLElement
2732
- }
2733
- | {
2734
- type: 'dragend'
2735
- }
2736
- | {
2737
- type: 'drop'
2738
- },
2739
- undefined,
2740
- never,
2741
- never,
2742
- never,
2743
- never,
2744
- | PatchEvent
2745
- | InternalPatchEvent
2746
- | MutationEvent
2747
- | PatchesEvent
2748
- | {
2749
- type: 'blurred'
2750
- event: FocusEvent_2<HTMLDivElement, Element>
2751
- }
2752
- | {
2753
- type: 'done loading'
2754
- }
2755
- | {
2756
- type: 'editable'
2757
- }
2758
- | {
2759
- type: 'error'
2760
- name: string
2761
- description: string
2762
- data: unknown
2763
- }
2764
- | {
2765
- type: 'focused'
2766
- event: FocusEvent_2<HTMLDivElement, Element>
2767
- }
2768
- | {
2769
- type: 'invalid value'
2770
- resolution: InvalidValueResolution | null
2771
- value: Array<PortableTextBlock> | undefined
2772
- }
2773
- | {
2774
- type: 'loading'
2775
- }
2776
- | {
2777
- type: 'read only'
2778
- }
2779
- | {
2780
- type: 'ready'
2781
- }
2782
- | {
2783
- type: 'selection'
2784
- selection: EditorSelection
2785
- }
2786
- | {
2787
- type: 'value changed'
2788
- value: Array<PortableTextBlock> | undefined
2789
- }
2790
- | UnsetEvent
2791
- >
2792
- }
2793
- readonly 'notify.loading': {
2794
- readonly actions: ActionFunction<
2795
- {
2796
- behaviors: Set<BehaviorConfig>
2797
- converters: Set<Converter>
2798
- getLegacySchema: () => PortableTextMemberSchemaTypes
2799
- keyGenerator: () => string
2800
- pendingEvents: Array<InternalPatchEvent | MutationEvent>
2801
- pendingIncomingPatchesEvents: Array<PatchesEvent>
2802
- schema: EditorSchema
2803
- initialReadOnly: boolean
2804
- maxBlocks: number | undefined
2805
- selection: EditorSelection
2806
- initialValue: Array<PortableTextBlock> | undefined
2807
- internalDrag?: {
2808
- ghost?: HTMLElement
2809
- origin: Pick<EventPosition, 'selection'>
2810
- }
2811
- slateEditor?: PortableTextSlateEditor
2812
- },
2813
- {
2814
- type: 'notify.loading'
2815
- },
2816
- | InternalPatchEvent
2817
- | MutationEvent
2818
- | PatchesEvent
2819
- | {
2820
- type: 'update readOnly'
2821
- readOnly: boolean
2822
- }
2823
- | {
2824
- type: 'update schema'
2825
- schema: EditorSchema
2826
- }
2827
- | {
2828
- type: 'update key generator'
2829
- keyGenerator: () => string
2830
- }
2831
- | {
2832
- type: 'update maxBlocks'
2833
- maxBlocks: number | undefined
2834
- }
2835
- | {
2836
- type: 'add behavior'
2837
- behaviorConfig: BehaviorConfig
2838
- }
2839
- | {
2840
- type: 'remove behavior'
2841
- behaviorConfig: BehaviorConfig
2842
- }
2843
- | {
2844
- type: 'blur'
2845
- editor: PortableTextSlateEditor
2846
- }
2847
- | {
2848
- type: 'focus'
2849
- editor: PortableTextSlateEditor
2850
- }
2851
- | {
2852
- type: 'normalizing'
2853
- }
2854
- | {
2855
- type: 'done normalizing'
2856
- }
2857
- | {
2858
- type: 'done syncing value'
2859
- }
2860
- | {
2861
- type: 'syncing value'
2862
- }
2863
- | {
2864
- type: 'behavior event'
2865
- behaviorEvent: BehaviorEvent
2866
- editor: PortableTextSlateEditor
2867
- nativeEvent?: {
2868
- preventDefault: () => void
2869
- }
2870
- }
2871
- | {
2872
- type: 'notify.patch'
2873
- patch: Patch
2874
- }
2875
- | {
2876
- type: 'notify.mutation'
2877
- patches: Array<Patch>
2878
- snapshot: Array<PortableTextBlock> | undefined
2879
- value: Array<PortableTextBlock> | undefined
2880
- }
2881
- | {
2882
- type: 'notify.blurred'
2883
- event: FocusEvent_2<HTMLDivElement, Element>
2884
- }
2885
- | {
2886
- type: 'notify.done loading'
2887
- }
2888
- | {
2889
- type: 'notify.editable'
2890
- }
2891
- | {
2892
- type: 'notify.error'
2893
- name: string
2894
- description: string
2895
- data: unknown
2896
- }
2897
- | {
2898
- type: 'notify.focused'
2899
- event: FocusEvent_2<HTMLDivElement, Element>
2900
- }
2901
- | {
2902
- type: 'notify.invalid value'
2903
- resolution: InvalidValueResolution | null
2904
- value: Array<PortableTextBlock> | undefined
2905
- }
2906
- | {
2907
- type: 'notify.loading'
2908
- }
2909
- | {
2910
- type: 'notify.read only'
2911
- }
2912
- | {
2913
- type: 'notify.ready'
2914
- }
2915
- | {
2916
- type: 'notify.selection'
2917
- selection: EditorSelection
2918
- }
2919
- | {
2920
- type: 'notify.value changed'
2921
- value: Array<PortableTextBlock> | undefined
2922
- }
2923
- | {
2924
- type: 'notify.unset'
2925
- previousValue: Array<PortableTextBlock>
2926
- }
2927
- | {
2928
- type: 'dragstart'
2929
- origin: Pick<EventPosition, 'selection'>
2930
- ghost?: HTMLElement
2931
- }
2932
- | {
2933
- type: 'dragend'
2934
- }
2935
- | {
2936
- type: 'drop'
2937
- },
2938
- undefined,
2939
- never,
2940
- never,
2941
- never,
2942
- never,
2943
- | PatchEvent
2944
- | InternalPatchEvent
2945
- | MutationEvent
2946
- | PatchesEvent
2947
- | {
2948
- type: 'blurred'
2949
- event: FocusEvent_2<HTMLDivElement, Element>
2950
- }
2951
- | {
2952
- type: 'done loading'
2953
- }
2954
- | {
2955
- type: 'editable'
2956
- }
2957
- | {
2958
- type: 'error'
2959
- name: string
2960
- description: string
2961
- data: unknown
2962
- }
2963
- | {
2964
- type: 'focused'
2965
- event: FocusEvent_2<HTMLDivElement, Element>
2966
- }
2967
- | {
2968
- type: 'invalid value'
2969
- resolution: InvalidValueResolution | null
2970
- value: Array<PortableTextBlock> | undefined
2971
- }
2972
- | {
2973
- type: 'loading'
2974
- }
2975
- | {
2976
- type: 'read only'
2977
- }
2978
- | {
2979
- type: 'ready'
2980
- }
2981
- | {
2982
- type: 'selection'
2983
- selection: EditorSelection
2984
- }
2985
- | {
2986
- type: 'value changed'
2987
- value: Array<PortableTextBlock> | undefined
2988
- }
2989
- | UnsetEvent
2990
- >
2991
- }
2992
- readonly 'notify.value changed': {
2993
- readonly actions: ActionFunction<
2994
- {
2995
- behaviors: Set<BehaviorConfig>
2996
- converters: Set<Converter>
2997
- getLegacySchema: () => PortableTextMemberSchemaTypes
2998
- keyGenerator: () => string
2999
- pendingEvents: Array<InternalPatchEvent | MutationEvent>
3000
- pendingIncomingPatchesEvents: Array<PatchesEvent>
3001
- schema: EditorSchema
3002
- initialReadOnly: boolean
3003
- maxBlocks: number | undefined
3004
- selection: EditorSelection
3005
- initialValue: Array<PortableTextBlock> | undefined
3006
- internalDrag?: {
3007
- ghost?: HTMLElement
3008
- origin: Pick<EventPosition, 'selection'>
3009
- }
3010
- slateEditor?: PortableTextSlateEditor
3011
- },
3012
- {
3013
- type: 'notify.value changed'
3014
- value: Array<PortableTextBlock> | undefined
3015
- },
3016
- | InternalPatchEvent
3017
- | MutationEvent
3018
- | PatchesEvent
3019
- | {
3020
- type: 'update readOnly'
3021
- readOnly: boolean
3022
- }
3023
- | {
3024
- type: 'update schema'
3025
- schema: EditorSchema
3026
- }
3027
- | {
3028
- type: 'update key generator'
3029
- keyGenerator: () => string
3030
- }
3031
- | {
3032
- type: 'update maxBlocks'
3033
- maxBlocks: number | undefined
3034
- }
3035
- | {
3036
- type: 'add behavior'
3037
- behaviorConfig: BehaviorConfig
3038
- }
3039
- | {
3040
- type: 'remove behavior'
3041
- behaviorConfig: BehaviorConfig
3042
- }
3043
- | {
3044
- type: 'blur'
3045
- editor: PortableTextSlateEditor
3046
- }
3047
- | {
3048
- type: 'focus'
3049
- editor: PortableTextSlateEditor
3050
- }
3051
- | {
3052
- type: 'normalizing'
3053
- }
3054
- | {
3055
- type: 'done normalizing'
3056
- }
3057
- | {
3058
- type: 'done syncing value'
3059
- }
3060
- | {
3061
- type: 'syncing value'
3062
- }
3063
- | {
3064
- type: 'behavior event'
3065
- behaviorEvent: BehaviorEvent
3066
- editor: PortableTextSlateEditor
3067
- nativeEvent?: {
3068
- preventDefault: () => void
3069
- }
3070
- }
3071
- | {
3072
- type: 'notify.patch'
3073
- patch: Patch
3074
- }
3075
- | {
3076
- type: 'notify.mutation'
3077
- patches: Array<Patch>
3078
- snapshot: Array<PortableTextBlock> | undefined
3079
- value: Array<PortableTextBlock> | undefined
3080
- }
3081
- | {
3082
- type: 'notify.blurred'
3083
- event: FocusEvent_2<HTMLDivElement, Element>
3084
- }
3085
- | {
3086
- type: 'notify.done loading'
3087
- }
3088
- | {
3089
- type: 'notify.editable'
3090
- }
3091
- | {
3092
- type: 'notify.error'
3093
- name: string
3094
- description: string
3095
- data: unknown
3096
- }
3097
- | {
3098
- type: 'notify.focused'
3099
- event: FocusEvent_2<HTMLDivElement, Element>
3100
- }
3101
- | {
3102
- type: 'notify.invalid value'
3103
- resolution: InvalidValueResolution | null
3104
- value: Array<PortableTextBlock> | undefined
3105
- }
3106
- | {
3107
- type: 'notify.loading'
3108
- }
3109
- | {
3110
- type: 'notify.read only'
3111
- }
3112
- | {
3113
- type: 'notify.ready'
3114
- }
3115
- | {
3116
- type: 'notify.selection'
3117
- selection: EditorSelection
3118
- }
3119
- | {
3120
- type: 'notify.value changed'
3121
- value: Array<PortableTextBlock> | undefined
3122
- }
3123
- | {
3124
- type: 'notify.unset'
3125
- previousValue: Array<PortableTextBlock>
3126
- }
3127
- | {
3128
- type: 'dragstart'
3129
- origin: Pick<EventPosition, 'selection'>
3130
- ghost?: HTMLElement
3131
- }
3132
- | {
3133
- type: 'dragend'
3134
- }
3135
- | {
3136
- type: 'drop'
3137
- },
3138
- undefined,
3139
- never,
3140
- never,
3141
- never,
3142
- never,
3143
- | PatchEvent
3144
- | InternalPatchEvent
3145
- | MutationEvent
3146
- | PatchesEvent
3147
- | {
3148
- type: 'blurred'
3149
- event: FocusEvent_2<HTMLDivElement, Element>
3150
- }
3151
- | {
3152
- type: 'done loading'
3153
- }
3154
- | {
3155
- type: 'editable'
3156
- }
3157
- | {
3158
- type: 'error'
3159
- name: string
3160
- description: string
3161
- data: unknown
3162
- }
3163
- | {
3164
- type: 'focused'
3165
- event: FocusEvent_2<HTMLDivElement, Element>
3166
- }
3167
- | {
3168
- type: 'invalid value'
3169
- resolution: InvalidValueResolution | null
3170
- value: Array<PortableTextBlock> | undefined
3171
- }
3172
- | {
3173
- type: 'loading'
3174
- }
3175
- | {
3176
- type: 'read only'
3177
- }
3178
- | {
3179
- type: 'ready'
3180
- }
3181
- | {
3182
- type: 'selection'
3183
- selection: EditorSelection
3184
- }
3185
- | {
3186
- type: 'value changed'
3187
- value: Array<PortableTextBlock> | undefined
3188
- }
3189
- | UnsetEvent
3190
- >
3191
- }
3192
- readonly 'add behavior': {
3193
- readonly actions: 'add behavior to context'
3194
- }
3195
- readonly 'remove behavior': {
3196
- readonly actions: 'remove behavior from context'
3197
- }
3198
- readonly 'update key generator': {
3199
- readonly actions: ActionFunction<
3200
- {
3201
- behaviors: Set<BehaviorConfig>
3202
- converters: Set<Converter>
3203
- getLegacySchema: () => PortableTextMemberSchemaTypes
3204
- keyGenerator: () => string
3205
- pendingEvents: Array<InternalPatchEvent | MutationEvent>
3206
- pendingIncomingPatchesEvents: Array<PatchesEvent>
3207
- schema: EditorSchema
3208
- initialReadOnly: boolean
3209
- maxBlocks: number | undefined
3210
- selection: EditorSelection
3211
- initialValue: Array<PortableTextBlock> | undefined
3212
- internalDrag?: {
3213
- ghost?: HTMLElement
3214
- origin: Pick<EventPosition, 'selection'>
3215
- }
3216
- slateEditor?: PortableTextSlateEditor
3217
- },
3218
- {
3219
- type: 'update key generator'
3220
- keyGenerator: () => string
3221
- },
3222
- | InternalPatchEvent
3223
- | MutationEvent
3224
- | PatchesEvent
3225
- | {
3226
- type: 'update readOnly'
3227
- readOnly: boolean
3228
- }
3229
- | {
3230
- type: 'update schema'
3231
- schema: EditorSchema
3232
- }
3233
- | {
3234
- type: 'update key generator'
3235
- keyGenerator: () => string
3236
- }
3237
- | {
3238
- type: 'update maxBlocks'
3239
- maxBlocks: number | undefined
3240
- }
3241
- | {
3242
- type: 'add behavior'
3243
- behaviorConfig: BehaviorConfig
3244
- }
3245
- | {
3246
- type: 'remove behavior'
3247
- behaviorConfig: BehaviorConfig
3248
- }
3249
- | {
3250
- type: 'blur'
3251
- editor: PortableTextSlateEditor
3252
- }
3253
- | {
3254
- type: 'focus'
3255
- editor: PortableTextSlateEditor
3256
- }
3257
- | {
3258
- type: 'normalizing'
3259
- }
3260
- | {
3261
- type: 'done normalizing'
3262
- }
3263
- | {
3264
- type: 'done syncing value'
3265
- }
3266
- | {
3267
- type: 'syncing value'
3268
- }
3269
- | {
3270
- type: 'behavior event'
3271
- behaviorEvent: BehaviorEvent
3272
- editor: PortableTextSlateEditor
3273
- nativeEvent?: {
3274
- preventDefault: () => void
3275
- }
3276
- }
3277
- | {
3278
- type: 'notify.patch'
3279
- patch: Patch
3280
- }
3281
- | {
3282
- type: 'notify.mutation'
3283
- patches: Array<Patch>
3284
- snapshot: Array<PortableTextBlock> | undefined
3285
- value: Array<PortableTextBlock> | undefined
3286
- }
3287
- | {
3288
- type: 'notify.blurred'
3289
- event: FocusEvent_2<HTMLDivElement, Element>
3290
- }
3291
- | {
3292
- type: 'notify.done loading'
3293
- }
3294
- | {
3295
- type: 'notify.editable'
3296
- }
3297
- | {
3298
- type: 'notify.error'
3299
- name: string
3300
- description: string
3301
- data: unknown
3302
- }
3303
- | {
3304
- type: 'notify.focused'
3305
- event: FocusEvent_2<HTMLDivElement, Element>
3306
- }
3307
- | {
3308
- type: 'notify.invalid value'
3309
- resolution: InvalidValueResolution | null
3310
- value: Array<PortableTextBlock> | undefined
3311
- }
3312
- | {
3313
- type: 'notify.loading'
3314
- }
3315
- | {
3316
- type: 'notify.read only'
3317
- }
3318
- | {
3319
- type: 'notify.ready'
3320
- }
3321
- | {
3322
- type: 'notify.selection'
3323
- selection: EditorSelection
3324
- }
3325
- | {
3326
- type: 'notify.value changed'
3327
- value: Array<PortableTextBlock> | undefined
3328
- }
3329
- | {
3330
- type: 'notify.unset'
3331
- previousValue: Array<PortableTextBlock>
3332
- }
3333
- | {
3334
- type: 'dragstart'
3335
- origin: Pick<EventPosition, 'selection'>
3336
- ghost?: HTMLElement
3337
- }
3338
- | {
3339
- type: 'dragend'
3340
- }
3341
- | {
3342
- type: 'drop'
3343
- },
3344
- undefined,
3345
- never,
3346
- never,
3347
- never,
3348
- never,
3349
- never
3350
- >
3351
- }
3352
- readonly 'update schema': {
3353
- readonly actions: 'assign schema'
3354
- }
3355
- readonly 'update maxBlocks': {
3356
- readonly actions: ActionFunction<
3357
- {
3358
- behaviors: Set<BehaviorConfig>
3359
- converters: Set<Converter>
3360
- getLegacySchema: () => PortableTextMemberSchemaTypes
3361
- keyGenerator: () => string
3362
- pendingEvents: Array<InternalPatchEvent | MutationEvent>
3363
- pendingIncomingPatchesEvents: Array<PatchesEvent>
3364
- schema: EditorSchema
3365
- initialReadOnly: boolean
3366
- maxBlocks: number | undefined
3367
- selection: EditorSelection
3368
- initialValue: Array<PortableTextBlock> | undefined
3369
- internalDrag?: {
3370
- ghost?: HTMLElement
3371
- origin: Pick<EventPosition, 'selection'>
3372
- }
3373
- slateEditor?: PortableTextSlateEditor
3374
- },
3375
- {
3376
- type: 'update maxBlocks'
3377
- maxBlocks: number | undefined
3378
- },
3379
- | InternalPatchEvent
3380
- | MutationEvent
3381
- | PatchesEvent
3382
- | {
3383
- type: 'update readOnly'
3384
- readOnly: boolean
3385
- }
3386
- | {
3387
- type: 'update schema'
3388
- schema: EditorSchema
3389
- }
3390
- | {
3391
- type: 'update key generator'
3392
- keyGenerator: () => string
3393
- }
3394
- | {
3395
- type: 'update maxBlocks'
3396
- maxBlocks: number | undefined
3397
- }
3398
- | {
3399
- type: 'add behavior'
3400
- behaviorConfig: BehaviorConfig
3401
- }
3402
- | {
3403
- type: 'remove behavior'
3404
- behaviorConfig: BehaviorConfig
3405
- }
3406
- | {
3407
- type: 'blur'
3408
- editor: PortableTextSlateEditor
3409
- }
3410
- | {
3411
- type: 'focus'
3412
- editor: PortableTextSlateEditor
3413
- }
3414
- | {
3415
- type: 'normalizing'
3416
- }
3417
- | {
3418
- type: 'done normalizing'
3419
- }
3420
- | {
3421
- type: 'done syncing value'
3422
- }
3423
- | {
3424
- type: 'syncing value'
3425
- }
3426
- | {
3427
- type: 'behavior event'
3428
- behaviorEvent: BehaviorEvent
3429
- editor: PortableTextSlateEditor
3430
- nativeEvent?: {
3431
- preventDefault: () => void
1163
+ selection: EditorSelection
1164
+ initialValue: Array<PortableTextBlock> | undefined
1165
+ internalDrag?: {
1166
+ ghost?: HTMLElement
1167
+ origin: Pick<EventPosition, 'selection'>
3432
1168
  }
3433
- }
3434
- | {
3435
- type: 'notify.patch'
3436
- patch: Patch
3437
- }
3438
- | {
3439
- type: 'notify.mutation'
3440
- patches: Array<Patch>
3441
- snapshot: Array<PortableTextBlock> | undefined
3442
- value: Array<PortableTextBlock> | undefined
3443
- }
3444
- | {
3445
- type: 'notify.blurred'
3446
- event: FocusEvent_2<HTMLDivElement, Element>
3447
- }
3448
- | {
3449
- type: 'notify.done loading'
3450
- }
3451
- | {
3452
- type: 'notify.editable'
3453
- }
3454
- | {
3455
- type: 'notify.error'
3456
- name: string
3457
- description: string
3458
- data: unknown
3459
- }
3460
- | {
3461
- type: 'notify.focused'
3462
- event: FocusEvent_2<HTMLDivElement, Element>
3463
- }
3464
- | {
3465
- type: 'notify.invalid value'
3466
- resolution: InvalidValueResolution | null
3467
- value: Array<PortableTextBlock> | undefined
3468
- }
3469
- | {
3470
- type: 'notify.loading'
3471
- }
3472
- | {
3473
- type: 'notify.read only'
3474
- }
3475
- | {
3476
- type: 'notify.ready'
3477
- }
3478
- | {
3479
- type: 'notify.selection'
1169
+ slateEditor?: PortableTextSlateEditor
1170
+ },
1171
+ {
1172
+ type: 'update selection'
3480
1173
  selection: EditorSelection
3481
- }
3482
- | {
3483
- type: 'notify.value changed'
3484
- value: Array<PortableTextBlock> | undefined
3485
- }
3486
- | {
3487
- type: 'notify.unset'
3488
- previousValue: Array<PortableTextBlock>
3489
- }
3490
- | {
3491
- type: 'dragstart'
3492
- origin: Pick<EventPosition, 'selection'>
3493
- ghost?: HTMLElement
3494
- }
3495
- | {
3496
- type: 'dragend'
3497
- }
3498
- | {
3499
- type: 'drop'
3500
1174
  },
3501
- undefined,
3502
- never,
3503
- never,
3504
- never,
3505
- never,
3506
- never
3507
- >
1175
+ | InternalPatchEvent
1176
+ | MutationEvent
1177
+ | PatchesEvent
1178
+ | {
1179
+ type: 'update readOnly'
1180
+ readOnly: boolean
1181
+ }
1182
+ | {
1183
+ type: 'update maxBlocks'
1184
+ maxBlocks: number | undefined
1185
+ }
1186
+ | {
1187
+ type: 'add behavior'
1188
+ behaviorConfig: BehaviorConfig
1189
+ }
1190
+ | {
1191
+ type: 'remove behavior'
1192
+ behaviorConfig: BehaviorConfig
1193
+ }
1194
+ | {
1195
+ type: 'blur'
1196
+ editor: PortableTextSlateEditor
1197
+ }
1198
+ | {
1199
+ type: 'focus'
1200
+ editor: PortableTextSlateEditor
1201
+ }
1202
+ | {
1203
+ type: 'normalizing'
1204
+ }
1205
+ | {
1206
+ type: 'update selection'
1207
+ selection: EditorSelection
1208
+ }
1209
+ | {
1210
+ type: 'done normalizing'
1211
+ }
1212
+ | {
1213
+ type: 'done syncing value'
1214
+ }
1215
+ | {
1216
+ type: 'syncing value'
1217
+ }
1218
+ | {
1219
+ type: 'behavior event'
1220
+ behaviorEvent: BehaviorEvent
1221
+ editor: PortableTextSlateEditor
1222
+ nativeEvent?: {
1223
+ preventDefault: () => void
1224
+ }
1225
+ }
1226
+ | {
1227
+ type: 'dragstart'
1228
+ origin: Pick<EventPosition, 'selection'>
1229
+ ghost?: HTMLElement
1230
+ }
1231
+ | {
1232
+ type: 'dragend'
1233
+ }
1234
+ | {
1235
+ type: 'drop'
1236
+ },
1237
+ undefined,
1238
+ never,
1239
+ never,
1240
+ never,
1241
+ never,
1242
+ never
1243
+ >,
1244
+ ]
3508
1245
  }
3509
1246
  }
3510
1247
  readonly type: 'parallel'
@@ -3700,14 +1437,6 @@ declare const editorMachine: StateMachine<
3700
1437
  type: 'update readOnly'
3701
1438
  readOnly: boolean
3702
1439
  }
3703
- | {
3704
- type: 'update schema'
3705
- schema: EditorSchema
3706
- }
3707
- | {
3708
- type: 'update key generator'
3709
- keyGenerator: () => string
3710
- }
3711
1440
  | {
3712
1441
  type: 'update maxBlocks'
3713
1442
  maxBlocks: number | undefined
@@ -3722,87 +1451,35 @@ declare const editorMachine: StateMachine<
3722
1451
  }
3723
1452
  | {
3724
1453
  type: 'blur'
3725
- editor: PortableTextSlateEditor
3726
- }
3727
- | {
3728
- type: 'focus'
3729
- editor: PortableTextSlateEditor
3730
- }
3731
- | {
3732
- type: 'normalizing'
3733
- }
3734
- | {
3735
- type: 'done normalizing'
3736
- }
3737
- | {
3738
- type: 'done syncing value'
3739
- }
3740
- | {
3741
- type: 'syncing value'
3742
- }
3743
- | {
3744
- type: 'behavior event'
3745
- behaviorEvent: BehaviorEvent
3746
- editor: PortableTextSlateEditor
3747
- nativeEvent?: {
3748
- preventDefault: () => void
3749
- }
3750
- }
3751
- | {
3752
- type: 'notify.patch'
3753
- patch: Patch
3754
- }
3755
- | {
3756
- type: 'notify.mutation'
3757
- patches: Array<Patch>
3758
- snapshot: Array<PortableTextBlock> | undefined
3759
- value: Array<PortableTextBlock> | undefined
3760
- }
3761
- | {
3762
- type: 'notify.blurred'
3763
- event: FocusEvent_2<HTMLDivElement, Element>
3764
- }
3765
- | {
3766
- type: 'notify.done loading'
3767
- }
3768
- | {
3769
- type: 'notify.editable'
3770
- }
3771
- | {
3772
- type: 'notify.error'
3773
- name: string
3774
- description: string
3775
- data: unknown
3776
- }
3777
- | {
3778
- type: 'notify.focused'
3779
- event: FocusEvent_2<HTMLDivElement, Element>
1454
+ editor: PortableTextSlateEditor
3780
1455
  }
3781
1456
  | {
3782
- type: 'notify.invalid value'
3783
- resolution: InvalidValueResolution | null
3784
- value: Array<PortableTextBlock> | undefined
1457
+ type: 'focus'
1458
+ editor: PortableTextSlateEditor
3785
1459
  }
3786
1460
  | {
3787
- type: 'notify.loading'
1461
+ type: 'normalizing'
3788
1462
  }
3789
1463
  | {
3790
- type: 'notify.read only'
1464
+ type: 'update selection'
1465
+ selection: EditorSelection
3791
1466
  }
3792
1467
  | {
3793
- type: 'notify.ready'
1468
+ type: 'done normalizing'
3794
1469
  }
3795
1470
  | {
3796
- type: 'notify.selection'
3797
- selection: EditorSelection
1471
+ type: 'done syncing value'
3798
1472
  }
3799
1473
  | {
3800
- type: 'notify.value changed'
3801
- value: Array<PortableTextBlock> | undefined
1474
+ type: 'syncing value'
3802
1475
  }
3803
1476
  | {
3804
- type: 'notify.unset'
3805
- previousValue: Array<PortableTextBlock>
1477
+ type: 'behavior event'
1478
+ behaviorEvent: BehaviorEvent
1479
+ editor: PortableTextSlateEditor
1480
+ nativeEvent?: {
1481
+ preventDefault: () => void
1482
+ }
3806
1483
  }
3807
1484
  | {
3808
1485
  type: 'dragstart'
@@ -3866,14 +1543,6 @@ declare const editorMachine: StateMachine<
3866
1543
  type: 'update readOnly'
3867
1544
  readOnly: boolean
3868
1545
  }
3869
- | {
3870
- type: 'update schema'
3871
- schema: EditorSchema
3872
- }
3873
- | {
3874
- type: 'update key generator'
3875
- keyGenerator: () => string
3876
- }
3877
1546
  | {
3878
1547
  type: 'update maxBlocks'
3879
1548
  maxBlocks: number | undefined
@@ -3897,6 +1566,10 @@ declare const editorMachine: StateMachine<
3897
1566
  | {
3898
1567
  type: 'normalizing'
3899
1568
  }
1569
+ | {
1570
+ type: 'update selection'
1571
+ selection: EditorSelection
1572
+ }
3900
1573
  | {
3901
1574
  type: 'done normalizing'
3902
1575
  }
@@ -3914,62 +1587,6 @@ declare const editorMachine: StateMachine<
3914
1587
  preventDefault: () => void
3915
1588
  }
3916
1589
  }
3917
- | {
3918
- type: 'notify.patch'
3919
- patch: Patch
3920
- }
3921
- | {
3922
- type: 'notify.mutation'
3923
- patches: Array<Patch>
3924
- snapshot: Array<PortableTextBlock> | undefined
3925
- value: Array<PortableTextBlock> | undefined
3926
- }
3927
- | {
3928
- type: 'notify.blurred'
3929
- event: FocusEvent_2<HTMLDivElement, Element>
3930
- }
3931
- | {
3932
- type: 'notify.done loading'
3933
- }
3934
- | {
3935
- type: 'notify.editable'
3936
- }
3937
- | {
3938
- type: 'notify.error'
3939
- name: string
3940
- description: string
3941
- data: unknown
3942
- }
3943
- | {
3944
- type: 'notify.focused'
3945
- event: FocusEvent_2<HTMLDivElement, Element>
3946
- }
3947
- | {
3948
- type: 'notify.invalid value'
3949
- resolution: InvalidValueResolution | null
3950
- value: Array<PortableTextBlock> | undefined
3951
- }
3952
- | {
3953
- type: 'notify.loading'
3954
- }
3955
- | {
3956
- type: 'notify.read only'
3957
- }
3958
- | {
3959
- type: 'notify.ready'
3960
- }
3961
- | {
3962
- type: 'notify.selection'
3963
- selection: EditorSelection
3964
- }
3965
- | {
3966
- type: 'notify.value changed'
3967
- value: Array<PortableTextBlock> | undefined
3968
- }
3969
- | {
3970
- type: 'notify.unset'
3971
- previousValue: Array<PortableTextBlock>
3972
- }
3973
1590
  | {
3974
1591
  type: 'dragstart'
3975
1592
  origin: Pick<EventPosition, 'selection'>
@@ -4053,14 +1670,6 @@ declare const editorMachine: StateMachine<
4053
1670
  type: 'update readOnly'
4054
1671
  readOnly: boolean
4055
1672
  }
4056
- | {
4057
- type: 'update schema'
4058
- schema: EditorSchema
4059
- }
4060
- | {
4061
- type: 'update key generator'
4062
- keyGenerator: () => string
4063
- }
4064
1673
  | {
4065
1674
  type: 'update maxBlocks'
4066
1675
  maxBlocks: number | undefined
@@ -4084,6 +1693,10 @@ declare const editorMachine: StateMachine<
4084
1693
  | {
4085
1694
  type: 'normalizing'
4086
1695
  }
1696
+ | {
1697
+ type: 'update selection'
1698
+ selection: EditorSelection
1699
+ }
4087
1700
  | {
4088
1701
  type: 'done normalizing'
4089
1702
  }
@@ -4101,62 +1714,6 @@ declare const editorMachine: StateMachine<
4101
1714
  preventDefault: () => void
4102
1715
  }
4103
1716
  }
4104
- | {
4105
- type: 'notify.patch'
4106
- patch: Patch
4107
- }
4108
- | {
4109
- type: 'notify.mutation'
4110
- patches: Array<Patch>
4111
- snapshot: Array<PortableTextBlock> | undefined
4112
- value: Array<PortableTextBlock> | undefined
4113
- }
4114
- | {
4115
- type: 'notify.blurred'
4116
- event: FocusEvent_2<HTMLDivElement, Element>
4117
- }
4118
- | {
4119
- type: 'notify.done loading'
4120
- }
4121
- | {
4122
- type: 'notify.editable'
4123
- }
4124
- | {
4125
- type: 'notify.error'
4126
- name: string
4127
- description: string
4128
- data: unknown
4129
- }
4130
- | {
4131
- type: 'notify.focused'
4132
- event: FocusEvent_2<HTMLDivElement, Element>
4133
- }
4134
- | {
4135
- type: 'notify.invalid value'
4136
- resolution: InvalidValueResolution | null
4137
- value: Array<PortableTextBlock> | undefined
4138
- }
4139
- | {
4140
- type: 'notify.loading'
4141
- }
4142
- | {
4143
- type: 'notify.read only'
4144
- }
4145
- | {
4146
- type: 'notify.ready'
4147
- }
4148
- | {
4149
- type: 'notify.selection'
4150
- selection: EditorSelection
4151
- }
4152
- | {
4153
- type: 'notify.value changed'
4154
- value: Array<PortableTextBlock> | undefined
4155
- }
4156
- | {
4157
- type: 'notify.unset'
4158
- previousValue: Array<PortableTextBlock>
4159
- }
4160
1717
  | {
4161
1718
  type: 'dragstart'
4162
1719
  origin: Pick<EventPosition, 'selection'>
@@ -4175,14 +1732,6 @@ declare const editorMachine: StateMachine<
4175
1732
  type: 'update readOnly'
4176
1733
  readOnly: boolean
4177
1734
  }
4178
- | {
4179
- type: 'update schema'
4180
- schema: EditorSchema
4181
- }
4182
- | {
4183
- type: 'update key generator'
4184
- keyGenerator: () => string
4185
- }
4186
1735
  | {
4187
1736
  type: 'update maxBlocks'
4188
1737
  maxBlocks: number | undefined
@@ -4206,6 +1755,10 @@ declare const editorMachine: StateMachine<
4206
1755
  | {
4207
1756
  type: 'normalizing'
4208
1757
  }
1758
+ | {
1759
+ type: 'update selection'
1760
+ selection: EditorSelection
1761
+ }
4209
1762
  | {
4210
1763
  type: 'done normalizing'
4211
1764
  }
@@ -4223,62 +1776,6 @@ declare const editorMachine: StateMachine<
4223
1776
  preventDefault: () => void
4224
1777
  }
4225
1778
  }
4226
- | {
4227
- type: 'notify.patch'
4228
- patch: Patch
4229
- }
4230
- | {
4231
- type: 'notify.mutation'
4232
- patches: Array<Patch>
4233
- snapshot: Array<PortableTextBlock> | undefined
4234
- value: Array<PortableTextBlock> | undefined
4235
- }
4236
- | {
4237
- type: 'notify.blurred'
4238
- event: FocusEvent_2<HTMLDivElement, Element>
4239
- }
4240
- | {
4241
- type: 'notify.done loading'
4242
- }
4243
- | {
4244
- type: 'notify.editable'
4245
- }
4246
- | {
4247
- type: 'notify.error'
4248
- name: string
4249
- description: string
4250
- data: unknown
4251
- }
4252
- | {
4253
- type: 'notify.focused'
4254
- event: FocusEvent_2<HTMLDivElement, Element>
4255
- }
4256
- | {
4257
- type: 'notify.invalid value'
4258
- resolution: InvalidValueResolution | null
4259
- value: Array<PortableTextBlock> | undefined
4260
- }
4261
- | {
4262
- type: 'notify.loading'
4263
- }
4264
- | {
4265
- type: 'notify.read only'
4266
- }
4267
- | {
4268
- type: 'notify.ready'
4269
- }
4270
- | {
4271
- type: 'notify.selection'
4272
- selection: EditorSelection
4273
- }
4274
- | {
4275
- type: 'notify.value changed'
4276
- value: Array<PortableTextBlock> | undefined
4277
- }
4278
- | {
4279
- type: 'notify.unset'
4280
- previousValue: Array<PortableTextBlock>
4281
- }
4282
1779
  | {
4283
1780
  type: 'dragstart'
4284
1781
  origin: Pick<EventPosition, 'selection'>
@@ -4317,14 +1814,6 @@ declare const editorMachine: StateMachine<
4317
1814
  type: 'update readOnly'
4318
1815
  readOnly: boolean
4319
1816
  }
4320
- | {
4321
- type: 'update schema'
4322
- schema: EditorSchema
4323
- }
4324
- | {
4325
- type: 'update key generator'
4326
- keyGenerator: () => string
4327
- }
4328
1817
  | {
4329
1818
  type: 'update maxBlocks'
4330
1819
  maxBlocks: number | undefined
@@ -4348,6 +1837,10 @@ declare const editorMachine: StateMachine<
4348
1837
  | {
4349
1838
  type: 'normalizing'
4350
1839
  }
1840
+ | {
1841
+ type: 'update selection'
1842
+ selection: EditorSelection
1843
+ }
4351
1844
  | {
4352
1845
  type: 'done normalizing'
4353
1846
  }
@@ -4365,62 +1858,6 @@ declare const editorMachine: StateMachine<
4365
1858
  preventDefault: () => void
4366
1859
  }
4367
1860
  }
4368
- | {
4369
- type: 'notify.patch'
4370
- patch: Patch
4371
- }
4372
- | {
4373
- type: 'notify.mutation'
4374
- patches: Array<Patch>
4375
- snapshot: Array<PortableTextBlock> | undefined
4376
- value: Array<PortableTextBlock> | undefined
4377
- }
4378
- | {
4379
- type: 'notify.blurred'
4380
- event: FocusEvent_2<HTMLDivElement, Element>
4381
- }
4382
- | {
4383
- type: 'notify.done loading'
4384
- }
4385
- | {
4386
- type: 'notify.editable'
4387
- }
4388
- | {
4389
- type: 'notify.error'
4390
- name: string
4391
- description: string
4392
- data: unknown
4393
- }
4394
- | {
4395
- type: 'notify.focused'
4396
- event: FocusEvent_2<HTMLDivElement, Element>
4397
- }
4398
- | {
4399
- type: 'notify.invalid value'
4400
- resolution: InvalidValueResolution | null
4401
- value: Array<PortableTextBlock> | undefined
4402
- }
4403
- | {
4404
- type: 'notify.loading'
4405
- }
4406
- | {
4407
- type: 'notify.read only'
4408
- }
4409
- | {
4410
- type: 'notify.ready'
4411
- }
4412
- | {
4413
- type: 'notify.selection'
4414
- selection: EditorSelection
4415
- }
4416
- | {
4417
- type: 'notify.value changed'
4418
- value: Array<PortableTextBlock> | undefined
4419
- }
4420
- | {
4421
- type: 'notify.unset'
4422
- previousValue: Array<PortableTextBlock>
4423
- }
4424
1861
  | {
4425
1862
  type: 'dragstart'
4426
1863
  origin: Pick<EventPosition, 'selection'>
@@ -4439,14 +1876,6 @@ declare const editorMachine: StateMachine<
4439
1876
  type: 'update readOnly'
4440
1877
  readOnly: boolean
4441
1878
  }
4442
- | {
4443
- type: 'update schema'
4444
- schema: EditorSchema
4445
- }
4446
- | {
4447
- type: 'update key generator'
4448
- keyGenerator: () => string
4449
- }
4450
1879
  | {
4451
1880
  type: 'update maxBlocks'
4452
1881
  maxBlocks: number | undefined
@@ -4470,6 +1899,10 @@ declare const editorMachine: StateMachine<
4470
1899
  | {
4471
1900
  type: 'normalizing'
4472
1901
  }
1902
+ | {
1903
+ type: 'update selection'
1904
+ selection: EditorSelection
1905
+ }
4473
1906
  | {
4474
1907
  type: 'done normalizing'
4475
1908
  }
@@ -4487,62 +1920,6 @@ declare const editorMachine: StateMachine<
4487
1920
  preventDefault: () => void
4488
1921
  }
4489
1922
  }
4490
- | {
4491
- type: 'notify.patch'
4492
- patch: Patch
4493
- }
4494
- | {
4495
- type: 'notify.mutation'
4496
- patches: Array<Patch>
4497
- snapshot: Array<PortableTextBlock> | undefined
4498
- value: Array<PortableTextBlock> | undefined
4499
- }
4500
- | {
4501
- type: 'notify.blurred'
4502
- event: FocusEvent_2<HTMLDivElement, Element>
4503
- }
4504
- | {
4505
- type: 'notify.done loading'
4506
- }
4507
- | {
4508
- type: 'notify.editable'
4509
- }
4510
- | {
4511
- type: 'notify.error'
4512
- name: string
4513
- description: string
4514
- data: unknown
4515
- }
4516
- | {
4517
- type: 'notify.focused'
4518
- event: FocusEvent_2<HTMLDivElement, Element>
4519
- }
4520
- | {
4521
- type: 'notify.invalid value'
4522
- resolution: InvalidValueResolution | null
4523
- value: Array<PortableTextBlock> | undefined
4524
- }
4525
- | {
4526
- type: 'notify.loading'
4527
- }
4528
- | {
4529
- type: 'notify.read only'
4530
- }
4531
- | {
4532
- type: 'notify.ready'
4533
- }
4534
- | {
4535
- type: 'notify.selection'
4536
- selection: EditorSelection
4537
- }
4538
- | {
4539
- type: 'notify.value changed'
4540
- value: Array<PortableTextBlock> | undefined
4541
- }
4542
- | {
4543
- type: 'notify.unset'
4544
- previousValue: Array<PortableTextBlock>
4545
- }
4546
1923
  | {
4547
1924
  type: 'dragstart'
4548
1925
  origin: Pick<EventPosition, 'selection'>
@@ -4643,14 +2020,6 @@ declare const editorMachine: StateMachine<
4643
2020
  type: 'update readOnly'
4644
2021
  readOnly: boolean
4645
2022
  }
4646
- | {
4647
- type: 'update schema'
4648
- schema: EditorSchema
4649
- }
4650
- | {
4651
- type: 'update key generator'
4652
- keyGenerator: () => string
4653
- }
4654
2023
  | {
4655
2024
  type: 'update maxBlocks'
4656
2025
  maxBlocks: number | undefined
@@ -4674,6 +2043,10 @@ declare const editorMachine: StateMachine<
4674
2043
  | {
4675
2044
  type: 'normalizing'
4676
2045
  }
2046
+ | {
2047
+ type: 'update selection'
2048
+ selection: EditorSelection
2049
+ }
4677
2050
  | {
4678
2051
  type: 'done normalizing'
4679
2052
  }
@@ -4691,62 +2064,6 @@ declare const editorMachine: StateMachine<
4691
2064
  preventDefault: () => void
4692
2065
  }
4693
2066
  }
4694
- | {
4695
- type: 'notify.patch'
4696
- patch: Patch
4697
- }
4698
- | {
4699
- type: 'notify.mutation'
4700
- patches: Array<Patch>
4701
- snapshot: Array<PortableTextBlock> | undefined
4702
- value: Array<PortableTextBlock> | undefined
4703
- }
4704
- | {
4705
- type: 'notify.blurred'
4706
- event: FocusEvent_2<HTMLDivElement, Element>
4707
- }
4708
- | {
4709
- type: 'notify.done loading'
4710
- }
4711
- | {
4712
- type: 'notify.editable'
4713
- }
4714
- | {
4715
- type: 'notify.error'
4716
- name: string
4717
- description: string
4718
- data: unknown
4719
- }
4720
- | {
4721
- type: 'notify.focused'
4722
- event: FocusEvent_2<HTMLDivElement, Element>
4723
- }
4724
- | {
4725
- type: 'notify.invalid value'
4726
- resolution: InvalidValueResolution | null
4727
- value: Array<PortableTextBlock> | undefined
4728
- }
4729
- | {
4730
- type: 'notify.loading'
4731
- }
4732
- | {
4733
- type: 'notify.read only'
4734
- }
4735
- | {
4736
- type: 'notify.ready'
4737
- }
4738
- | {
4739
- type: 'notify.selection'
4740
- selection: EditorSelection
4741
- }
4742
- | {
4743
- type: 'notify.value changed'
4744
- value: Array<PortableTextBlock> | undefined
4745
- }
4746
- | {
4747
- type: 'notify.unset'
4748
- previousValue: Array<PortableTextBlock>
4749
- }
4750
2067
  | {
4751
2068
  type: 'dragstart'
4752
2069
  origin: Pick<EventPosition, 'selection'>
@@ -4763,7 +2080,6 @@ declare const editorMachine: StateMachine<
4763
2080
  never,
4764
2081
  never,
4765
2082
  never,
4766
- | PatchEvent
4767
2083
  | InternalPatchEvent
4768
2084
  | MutationEvent
4769
2085
  | PatchesEvent
@@ -4809,7 +2125,6 @@ declare const editorMachine: StateMachine<
4809
2125
  type: 'value changed'
4810
2126
  value: Array<PortableTextBlock> | undefined
4811
2127
  }
4812
- | UnsetEvent
4813
2128
  >,
4814
2129
  ]
4815
2130
  }
@@ -5076,29 +2391,6 @@ declare type InternalPatchEvent = NamespaceEvent<PatchEvent, 'internal'> & {
5076
2391
  value: Array<PortableTextBlock>
5077
2392
  }
5078
2393
 
5079
- /**
5080
- * The editor has invalid data in the value that can be resolved by the user
5081
- * @beta */
5082
- declare type InvalidValueResolution = {
5083
- autoResolve?: boolean
5084
- patches: Patch[]
5085
- description: string
5086
- action: string
5087
- item: PortableTextBlock[] | PortableTextBlock | PortableTextChild | undefined
5088
- /**
5089
- * i18n keys for the description and action
5090
- *
5091
- * These are in addition to the description and action properties, to decouple the editor from
5092
- * the i18n system, and allow usage without it. The i18n keys take precedence over the
5093
- * description and action properties, if i18n framework is available.
5094
- */
5095
- i18n: {
5096
- description: `inputs.portable-text.invalid-value.${Lowercase<string>}.description`
5097
- action: `inputs.portable-text.invalid-value.${Lowercase<string>}.action`
5098
- values?: Record<string, string | number | string[]>
5099
- }
5100
- }
5101
-
5102
2394
  declare type KeyboardBehaviorEvent =
5103
2395
  | {
5104
2396
  type: StrictExtract<NativeBehaviorEventType, 'keyboard.keydown'>
@@ -5459,9 +2751,4 @@ declare type TextBlockWithOptionalKey = Omit<PortableTextTextBlock, '_key'> & {
5459
2751
  _key?: PortableTextTextBlock['_key']
5460
2752
  }
5461
2753
 
5462
- declare type UnsetEvent = {
5463
- type: 'unset'
5464
- previousValue: Array<PortableTextBlock>
5465
- }
5466
-
5467
2754
  export {}