@portabletext/editor 1.49.9 → 1.49.11

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 (40) hide show
  1. package/lib/behaviors/index.d.cts +160 -2885
  2. package/lib/behaviors/index.d.ts +160 -2885
  3. package/lib/index.cjs +356 -311
  4. package/lib/index.cjs.map +1 -1
  5. package/lib/index.d.cts +170 -2874
  6. package/lib/index.d.ts +170 -2874
  7. package/lib/index.js +359 -314
  8. package/lib/index.js.map +1 -1
  9. package/lib/plugins/index.cjs.map +1 -1
  10. package/lib/plugins/index.d.cts +162 -2879
  11. package/lib/plugins/index.d.ts +162 -2879
  12. package/lib/plugins/index.js.map +1 -1
  13. package/lib/selectors/index.d.cts +160 -2885
  14. package/lib/selectors/index.d.ts +160 -2885
  15. package/lib/utils/index.d.cts +160 -2885
  16. package/lib/utils/index.d.ts +160 -2885
  17. package/package.json +7 -7
  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 +91 -53
  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 +89 -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/internal-utils/applyPatch.ts +6 -2
  39. package/src/plugins/plugin.event-listener.tsx +1 -1
  40. package/src/types/editor.ts +12 -4
@@ -12,10 +12,8 @@ import type {
12
12
  PortableTextTextBlock,
13
13
  } from '@sanity/types'
14
14
  import {KeyedSegment, PortableTextObject, PortableTextSpan} from '@sanity/types'
15
- import type {
16
- FocusEvent as FocusEvent_2,
17
- KeyboardEvent as KeyboardEvent_2,
18
- } from 'react'
15
+ import {FocusEvent as FocusEvent_2} from 'react'
16
+ import type {KeyboardEvent as KeyboardEvent_2} from 'react'
19
17
  import type {Descendant, Operation, TextUnit} from 'slate'
20
18
  import type {DOMNode} from 'slate-dom'
21
19
  import type {ReactEditor} from 'slate-react'
@@ -40,6 +38,7 @@ import {
40
38
  Values,
41
39
  } from 'xstate'
42
40
  import {GuardArgs} from 'xstate/guards'
41
+ import {InvalidValueResolution} from '..'
43
42
 
44
43
  declare type AbstractBehaviorEvent =
45
44
  | {
@@ -603,14 +602,6 @@ declare const editorMachine: StateMachine<
603
602
  type: 'update readOnly'
604
603
  readOnly: boolean
605
604
  }
606
- | {
607
- type: 'update schema'
608
- schema: EditorSchema
609
- }
610
- | {
611
- type: 'update key generator'
612
- keyGenerator: () => string
613
- }
614
605
  | {
615
606
  type: 'update maxBlocks'
616
607
  maxBlocks: number | undefined
@@ -634,6 +625,10 @@ declare const editorMachine: StateMachine<
634
625
  | {
635
626
  type: 'normalizing'
636
627
  }
628
+ | {
629
+ type: 'update selection'
630
+ selection: EditorSelection
631
+ }
637
632
  | {
638
633
  type: 'done normalizing'
639
634
  }
@@ -651,62 +646,6 @@ declare const editorMachine: StateMachine<
651
646
  preventDefault: () => void
652
647
  }
653
648
  }
654
- | {
655
- type: 'notify.patch'
656
- patch: Patch
657
- }
658
- | {
659
- type: 'notify.mutation'
660
- patches: Array<Patch>
661
- snapshot: Array<PortableTextBlock> | undefined
662
- value: Array<PortableTextBlock> | undefined
663
- }
664
- | {
665
- type: 'notify.blurred'
666
- event: FocusEvent_2<HTMLDivElement, Element>
667
- }
668
- | {
669
- type: 'notify.done loading'
670
- }
671
- | {
672
- type: 'notify.editable'
673
- }
674
- | {
675
- type: 'notify.error'
676
- name: string
677
- description: string
678
- data: unknown
679
- }
680
- | {
681
- type: 'notify.focused'
682
- event: FocusEvent_2<HTMLDivElement, Element>
683
- }
684
- | {
685
- type: 'notify.invalid value'
686
- resolution: InvalidValueResolution | null
687
- value: Array<PortableTextBlock> | undefined
688
- }
689
- | {
690
- type: 'notify.loading'
691
- }
692
- | {
693
- type: 'notify.read only'
694
- }
695
- | {
696
- type: 'notify.ready'
697
- }
698
- | {
699
- type: 'notify.selection'
700
- selection: EditorSelection
701
- }
702
- | {
703
- type: 'notify.value changed'
704
- value: Array<PortableTextBlock> | undefined
705
- }
706
- | {
707
- type: 'notify.unset'
708
- previousValue: Array<PortableTextBlock>
709
- }
710
649
  | {
711
650
  type: 'dragstart'
712
651
  origin: Pick<EventPosition, 'selection'>
@@ -729,10 +668,6 @@ declare const editorMachine: StateMachine<
729
668
  type: 'remove behavior from context'
730
669
  params: NonReducibleUnknown
731
670
  }
732
- 'assign schema': {
733
- type: 'assign schema'
734
- params: NonReducibleUnknown
735
- }
736
671
  'emit patch event': {
737
672
  type: 'emit patch event'
738
673
  params: NonReducibleUnknown
@@ -832,7 +767,6 @@ declare const editorMachine: StateMachine<
832
767
  initialValue?: Array<PortableTextBlock>
833
768
  },
834
769
  NonReducibleUnknown,
835
- | PatchEvent
836
770
  | InternalPatchEvent
837
771
  | MutationEvent
838
772
  | PatchesEvent
@@ -846,12 +780,6 @@ declare const editorMachine: StateMachine<
846
780
  | {
847
781
  type: 'editable'
848
782
  }
849
- | {
850
- type: 'error'
851
- name: string
852
- description: string
853
- data: unknown
854
- }
855
783
  | {
856
784
  type: 'focused'
857
785
  event: FocusEvent_2<HTMLDivElement, Element>
@@ -877,8 +805,7 @@ declare const editorMachine: StateMachine<
877
805
  | {
878
806
  type: 'value changed'
879
807
  value: Array<PortableTextBlock> | undefined
880
- }
881
- | UnsetEvent,
808
+ },
882
809
  MetaObject,
883
810
  {
884
811
  readonly id: 'editor'
@@ -943,14 +870,6 @@ declare const editorMachine: StateMachine<
943
870
  type: 'update readOnly'
944
871
  readOnly: boolean
945
872
  }
946
- | {
947
- type: 'update schema'
948
- schema: EditorSchema
949
- }
950
- | {
951
- type: 'update key generator'
952
- keyGenerator: () => string
953
- }
954
873
  | {
955
874
  type: 'update maxBlocks'
956
875
  maxBlocks: number | undefined
@@ -974,6 +893,10 @@ declare const editorMachine: StateMachine<
974
893
  | {
975
894
  type: 'normalizing'
976
895
  }
896
+ | {
897
+ type: 'update selection'
898
+ selection: EditorSelection
899
+ }
977
900
  | {
978
901
  type: 'done normalizing'
979
902
  }
@@ -991,62 +914,6 @@ declare const editorMachine: StateMachine<
991
914
  preventDefault: () => void
992
915
  }
993
916
  }
994
- | {
995
- type: 'notify.patch'
996
- patch: Patch
997
- }
998
- | {
999
- type: 'notify.mutation'
1000
- patches: Array<Patch>
1001
- snapshot: Array<PortableTextBlock> | undefined
1002
- value: Array<PortableTextBlock> | undefined
1003
- }
1004
- | {
1005
- type: 'notify.blurred'
1006
- event: FocusEvent_2<HTMLDivElement, Element>
1007
- }
1008
- | {
1009
- type: 'notify.done loading'
1010
- }
1011
- | {
1012
- type: 'notify.editable'
1013
- }
1014
- | {
1015
- type: 'notify.error'
1016
- name: string
1017
- description: string
1018
- data: unknown
1019
- }
1020
- | {
1021
- type: 'notify.focused'
1022
- event: FocusEvent_2<HTMLDivElement, Element>
1023
- }
1024
- | {
1025
- type: 'notify.invalid value'
1026
- resolution: InvalidValueResolution | null
1027
- value: Array<PortableTextBlock> | undefined
1028
- }
1029
- | {
1030
- type: 'notify.loading'
1031
- }
1032
- | {
1033
- type: 'notify.read only'
1034
- }
1035
- | {
1036
- type: 'notify.ready'
1037
- }
1038
- | {
1039
- type: 'notify.selection'
1040
- selection: EditorSelection
1041
- }
1042
- | {
1043
- type: 'notify.value changed'
1044
- value: Array<PortableTextBlock> | undefined
1045
- }
1046
- | {
1047
- type: 'notify.unset'
1048
- previousValue: Array<PortableTextBlock>
1049
- }
1050
917
  | {
1051
918
  type: 'dragstart'
1052
919
  origin: Pick<EventPosition, 'selection'>
@@ -1072,14 +939,6 @@ declare const editorMachine: StateMachine<
1072
939
  type: 'update readOnly'
1073
940
  readOnly: boolean
1074
941
  }
1075
- | {
1076
- type: 'update schema'
1077
- schema: EditorSchema
1078
- }
1079
- | {
1080
- type: 'update key generator'
1081
- keyGenerator: () => string
1082
- }
1083
942
  | {
1084
943
  type: 'update maxBlocks'
1085
944
  maxBlocks: number | undefined
@@ -1103,6 +962,10 @@ declare const editorMachine: StateMachine<
1103
962
  | {
1104
963
  type: 'normalizing'
1105
964
  }
965
+ | {
966
+ type: 'update selection'
967
+ selection: EditorSelection
968
+ }
1106
969
  | {
1107
970
  type: 'done normalizing'
1108
971
  }
@@ -1120,62 +983,6 @@ declare const editorMachine: StateMachine<
1120
983
  preventDefault: () => void
1121
984
  }
1122
985
  }
1123
- | {
1124
- type: 'notify.patch'
1125
- patch: Patch
1126
- }
1127
- | {
1128
- type: 'notify.mutation'
1129
- patches: Array<Patch>
1130
- snapshot: Array<PortableTextBlock> | undefined
1131
- value: Array<PortableTextBlock> | undefined
1132
- }
1133
- | {
1134
- type: 'notify.blurred'
1135
- event: FocusEvent_2<HTMLDivElement, Element>
1136
- }
1137
- | {
1138
- type: 'notify.done loading'
1139
- }
1140
- | {
1141
- type: 'notify.editable'
1142
- }
1143
- | {
1144
- type: 'notify.error'
1145
- name: string
1146
- description: string
1147
- data: unknown
1148
- }
1149
- | {
1150
- type: 'notify.focused'
1151
- event: FocusEvent_2<HTMLDivElement, Element>
1152
- }
1153
- | {
1154
- type: 'notify.invalid value'
1155
- resolution: InvalidValueResolution | null
1156
- value: Array<PortableTextBlock> | undefined
1157
- }
1158
- | {
1159
- type: 'notify.loading'
1160
- }
1161
- | {
1162
- type: 'notify.read only'
1163
- }
1164
- | {
1165
- type: 'notify.ready'
1166
- }
1167
- | {
1168
- type: 'notify.selection'
1169
- selection: EditorSelection
1170
- }
1171
- | {
1172
- type: 'notify.value changed'
1173
- value: Array<PortableTextBlock> | undefined
1174
- }
1175
- | {
1176
- type: 'notify.unset'
1177
- previousValue: Array<PortableTextBlock>
1178
- }
1179
986
  | {
1180
987
  type: 'dragstart'
1181
988
  origin: Pick<EventPosition, 'selection'>
@@ -1203,7 +1010,13 @@ declare const editorMachine: StateMachine<
1203
1010
  initialValue: PortableTextBlock[] | undefined
1204
1011
  }
1205
1012
  readonly on: {
1206
- readonly 'notify.blurred': {
1013
+ readonly 'add behavior': {
1014
+ readonly actions: 'add behavior to context'
1015
+ }
1016
+ readonly 'remove behavior': {
1017
+ readonly actions: 'remove behavior from context'
1018
+ }
1019
+ readonly 'update maxBlocks': {
1207
1020
  readonly actions: ActionFunction<
1208
1021
  {
1209
1022
  behaviors: Set<BehaviorConfig>
@@ -1224,8 +1037,8 @@ declare const editorMachine: StateMachine<
1224
1037
  slateEditor?: PortableTextSlateEditor
1225
1038
  },
1226
1039
  {
1227
- type: 'notify.blurred'
1228
- event: FocusEvent_2<HTMLDivElement, Element>
1040
+ type: 'update maxBlocks'
1041
+ maxBlocks: number | undefined
1229
1042
  },
1230
1043
  | InternalPatchEvent
1231
1044
  | MutationEvent
@@ -1234,14 +1047,6 @@ declare const editorMachine: StateMachine<
1234
1047
  type: 'update readOnly'
1235
1048
  readOnly: boolean
1236
1049
  }
1237
- | {
1238
- type: 'update schema'
1239
- schema: EditorSchema
1240
- }
1241
- | {
1242
- type: 'update key generator'
1243
- keyGenerator: () => string
1244
- }
1245
1050
  | {
1246
1051
  type: 'update maxBlocks'
1247
1052
  maxBlocks: number | undefined
@@ -1265,6 +1070,10 @@ declare const editorMachine: StateMachine<
1265
1070
  | {
1266
1071
  type: 'normalizing'
1267
1072
  }
1073
+ | {
1074
+ type: 'update selection'
1075
+ selection: EditorSelection
1076
+ }
1268
1077
  | {
1269
1078
  type: 'done normalizing'
1270
1079
  }
@@ -1282,62 +1091,6 @@ declare const editorMachine: StateMachine<
1282
1091
  preventDefault: () => void
1283
1092
  }
1284
1093
  }
1285
- | {
1286
- type: 'notify.patch'
1287
- patch: Patch
1288
- }
1289
- | {
1290
- type: 'notify.mutation'
1291
- patches: Array<Patch>
1292
- snapshot: Array<PortableTextBlock> | undefined
1293
- value: Array<PortableTextBlock> | undefined
1294
- }
1295
- | {
1296
- type: 'notify.blurred'
1297
- event: FocusEvent_2<HTMLDivElement, Element>
1298
- }
1299
- | {
1300
- type: 'notify.done loading'
1301
- }
1302
- | {
1303
- type: 'notify.editable'
1304
- }
1305
- | {
1306
- type: 'notify.error'
1307
- name: string
1308
- description: string
1309
- data: unknown
1310
- }
1311
- | {
1312
- type: 'notify.focused'
1313
- event: FocusEvent_2<HTMLDivElement, Element>
1314
- }
1315
- | {
1316
- type: 'notify.invalid value'
1317
- resolution: InvalidValueResolution | null
1318
- value: Array<PortableTextBlock> | undefined
1319
- }
1320
- | {
1321
- type: 'notify.loading'
1322
- }
1323
- | {
1324
- type: 'notify.read only'
1325
- }
1326
- | {
1327
- type: 'notify.ready'
1328
- }
1329
- | {
1330
- type: 'notify.selection'
1331
- selection: EditorSelection
1332
- }
1333
- | {
1334
- type: 'notify.value changed'
1335
- value: Array<PortableTextBlock> | undefined
1336
- }
1337
- | {
1338
- type: 'notify.unset'
1339
- previousValue: Array<PortableTextBlock>
1340
- }
1341
1094
  | {
1342
1095
  type: 'dragstart'
1343
1096
  origin: Pick<EventPosition, 'selection'>
@@ -1354,2126 +1107,104 @@ declare const editorMachine: StateMachine<
1354
1107
  never,
1355
1108
  never,
1356
1109
  never,
1357
- | PatchEvent
1358
- | InternalPatchEvent
1359
- | MutationEvent
1360
- | PatchesEvent
1361
- | {
1362
- type: 'blurred'
1363
- event: FocusEvent_2<HTMLDivElement, Element>
1364
- }
1365
- | {
1366
- type: 'done loading'
1367
- }
1368
- | {
1369
- type: 'editable'
1370
- }
1371
- | {
1372
- type: 'error'
1373
- name: string
1374
- description: string
1375
- data: unknown
1376
- }
1377
- | {
1378
- type: 'focused'
1379
- event: FocusEvent_2<HTMLDivElement, Element>
1380
- }
1381
- | {
1382
- type: 'invalid value'
1383
- resolution: InvalidValueResolution | null
1384
- value: Array<PortableTextBlock> | undefined
1385
- }
1386
- | {
1387
- type: 'loading'
1388
- }
1389
- | {
1390
- type: 'read only'
1391
- }
1392
- | {
1393
- type: 'ready'
1394
- }
1395
- | {
1396
- type: 'selection'
1397
- selection: EditorSelection
1398
- }
1399
- | {
1400
- type: 'value changed'
1401
- value: Array<PortableTextBlock> | undefined
1402
- }
1403
- | UnsetEvent
1110
+ never
1404
1111
  >
1405
1112
  }
1406
- readonly 'notify.done loading': {
1407
- readonly actions: ActionFunction<
1408
- {
1409
- behaviors: Set<BehaviorConfig>
1410
- converters: Set<Converter>
1411
- getLegacySchema: () => PortableTextMemberSchemaTypes
1412
- keyGenerator: () => string
1413
- pendingEvents: Array<InternalPatchEvent | MutationEvent>
1414
- pendingIncomingPatchesEvents: Array<PatchesEvent>
1415
- schema: EditorSchema
1416
- initialReadOnly: boolean
1417
- maxBlocks: number | undefined
1418
- selection: EditorSelection
1419
- initialValue: Array<PortableTextBlock> | undefined
1420
- internalDrag?: {
1421
- ghost?: HTMLElement
1422
- origin: Pick<EventPosition, 'selection'>
1423
- }
1424
- slateEditor?: PortableTextSlateEditor
1425
- },
1426
- {
1427
- type: 'notify.done loading'
1428
- },
1429
- | InternalPatchEvent
1430
- | MutationEvent
1431
- | PatchesEvent
1432
- | {
1433
- type: 'update readOnly'
1434
- readOnly: boolean
1435
- }
1436
- | {
1437
- type: 'update schema'
1438
- schema: EditorSchema
1439
- }
1440
- | {
1441
- type: 'update key generator'
1113
+ readonly 'update selection': {
1114
+ readonly actions: readonly [
1115
+ ActionFunction<
1116
+ {
1117
+ behaviors: Set<BehaviorConfig>
1118
+ converters: Set<Converter>
1119
+ getLegacySchema: () => PortableTextMemberSchemaTypes
1442
1120
  keyGenerator: () => string
1443
- }
1444
- | {
1445
- type: 'update maxBlocks'
1121
+ pendingEvents: Array<InternalPatchEvent | MutationEvent>
1122
+ pendingIncomingPatchesEvents: Array<PatchesEvent>
1123
+ schema: EditorSchema
1124
+ initialReadOnly: boolean
1446
1125
  maxBlocks: number | undefined
1447
- }
1448
- | {
1449
- type: 'add behavior'
1450
- behaviorConfig: BehaviorConfig
1451
- }
1452
- | {
1453
- type: 'remove behavior'
1454
- behaviorConfig: BehaviorConfig
1455
- }
1456
- | {
1457
- type: 'blur'
1458
- editor: PortableTextSlateEditor
1459
- }
1460
- | {
1461
- type: 'focus'
1462
- editor: PortableTextSlateEditor
1463
- }
1464
- | {
1465
- type: 'normalizing'
1466
- }
1467
- | {
1468
- type: 'done normalizing'
1469
- }
1470
- | {
1471
- type: 'done syncing value'
1472
- }
1473
- | {
1474
- type: 'syncing value'
1475
- }
1476
- | {
1477
- type: 'behavior event'
1478
- behaviorEvent: BehaviorEvent
1479
- editor: PortableTextSlateEditor
1480
- nativeEvent?: {
1481
- preventDefault: () => void
1482
- }
1483
- }
1484
- | {
1485
- type: 'notify.patch'
1486
- patch: Patch
1487
- }
1488
- | {
1489
- type: 'notify.mutation'
1490
- patches: Array<Patch>
1491
- snapshot: Array<PortableTextBlock> | undefined
1492
- value: Array<PortableTextBlock> | undefined
1493
- }
1494
- | {
1495
- type: 'notify.blurred'
1496
- event: FocusEvent_2<HTMLDivElement, Element>
1497
- }
1498
- | {
1499
- type: 'notify.done loading'
1500
- }
1501
- | {
1502
- type: 'notify.editable'
1503
- }
1504
- | {
1505
- type: 'notify.error'
1506
- name: string
1507
- description: string
1508
- data: unknown
1509
- }
1510
- | {
1511
- type: 'notify.focused'
1512
- event: FocusEvent_2<HTMLDivElement, Element>
1513
- }
1514
- | {
1515
- type: 'notify.invalid value'
1516
- resolution: InvalidValueResolution | null
1517
- value: Array<PortableTextBlock> | undefined
1518
- }
1519
- | {
1520
- type: 'notify.loading'
1521
- }
1522
- | {
1523
- type: 'notify.read only'
1524
- }
1525
- | {
1526
- type: 'notify.ready'
1527
- }
1528
- | {
1529
- type: 'notify.selection'
1530
- selection: EditorSelection
1531
- }
1532
- | {
1533
- type: 'notify.value changed'
1534
- value: Array<PortableTextBlock> | undefined
1535
- }
1536
- | {
1537
- type: 'notify.unset'
1538
- previousValue: Array<PortableTextBlock>
1539
- }
1540
- | {
1541
- type: 'dragstart'
1542
- origin: Pick<EventPosition, 'selection'>
1543
- ghost?: HTMLElement
1544
- }
1545
- | {
1546
- type: 'dragend'
1547
- }
1548
- | {
1549
- type: 'drop'
1550
- },
1551
- undefined,
1552
- never,
1553
- never,
1554
- never,
1555
- never,
1556
- | PatchEvent
1557
- | InternalPatchEvent
1558
- | MutationEvent
1559
- | PatchesEvent
1560
- | {
1561
- type: 'blurred'
1562
- event: FocusEvent_2<HTMLDivElement, Element>
1563
- }
1564
- | {
1565
- type: 'done loading'
1566
- }
1567
- | {
1568
- type: 'editable'
1569
- }
1570
- | {
1571
- type: 'error'
1572
- name: string
1573
- description: string
1574
- data: unknown
1575
- }
1576
- | {
1577
- type: 'focused'
1578
- event: FocusEvent_2<HTMLDivElement, Element>
1579
- }
1580
- | {
1581
- type: 'invalid value'
1582
- resolution: InvalidValueResolution | null
1583
- value: Array<PortableTextBlock> | undefined
1584
- }
1585
- | {
1586
- type: 'loading'
1587
- }
1588
- | {
1589
- type: 'read only'
1590
- }
1591
- | {
1592
- type: 'ready'
1593
- }
1594
- | {
1595
- type: 'selection'
1596
- selection: EditorSelection
1597
- }
1598
- | {
1599
- type: 'value changed'
1600
- value: Array<PortableTextBlock> | undefined
1601
- }
1602
- | UnsetEvent
1603
- >
1604
- }
1605
- readonly 'notify.error': {
1606
- readonly actions: ActionFunction<
1607
- {
1608
- behaviors: Set<BehaviorConfig>
1609
- converters: Set<Converter>
1610
- getLegacySchema: () => PortableTextMemberSchemaTypes
1611
- keyGenerator: () => string
1612
- pendingEvents: Array<InternalPatchEvent | MutationEvent>
1613
- pendingIncomingPatchesEvents: Array<PatchesEvent>
1614
- schema: EditorSchema
1615
- initialReadOnly: boolean
1616
- maxBlocks: number | undefined
1617
- selection: EditorSelection
1618
- initialValue: Array<PortableTextBlock> | undefined
1619
- internalDrag?: {
1620
- ghost?: HTMLElement
1621
- origin: Pick<EventPosition, 'selection'>
1622
- }
1623
- slateEditor?: PortableTextSlateEditor
1624
- },
1625
- {
1626
- type: 'notify.error'
1627
- name: string
1628
- description: string
1629
- data: unknown
1630
- },
1631
- | InternalPatchEvent
1632
- | MutationEvent
1633
- | PatchesEvent
1634
- | {
1635
- type: 'update readOnly'
1636
- readOnly: boolean
1637
- }
1638
- | {
1639
- type: 'update schema'
1640
- schema: EditorSchema
1641
- }
1642
- | {
1643
- type: 'update key generator'
1644
- keyGenerator: () => string
1645
- }
1646
- | {
1647
- type: 'update maxBlocks'
1648
- maxBlocks: number | undefined
1649
- }
1650
- | {
1651
- type: 'add behavior'
1652
- behaviorConfig: BehaviorConfig
1653
- }
1654
- | {
1655
- type: 'remove behavior'
1656
- behaviorConfig: BehaviorConfig
1657
- }
1658
- | {
1659
- type: 'blur'
1660
- editor: PortableTextSlateEditor
1661
- }
1662
- | {
1663
- type: 'focus'
1664
- editor: PortableTextSlateEditor
1665
- }
1666
- | {
1667
- type: 'normalizing'
1668
- }
1669
- | {
1670
- type: 'done normalizing'
1671
- }
1672
- | {
1673
- type: 'done syncing value'
1674
- }
1675
- | {
1676
- type: 'syncing value'
1677
- }
1678
- | {
1679
- type: 'behavior event'
1680
- behaviorEvent: BehaviorEvent
1681
- editor: PortableTextSlateEditor
1682
- nativeEvent?: {
1683
- preventDefault: () => void
1684
- }
1685
- }
1686
- | {
1687
- type: 'notify.patch'
1688
- patch: Patch
1689
- }
1690
- | {
1691
- type: 'notify.mutation'
1692
- patches: Array<Patch>
1693
- snapshot: Array<PortableTextBlock> | undefined
1694
- value: Array<PortableTextBlock> | undefined
1695
- }
1696
- | {
1697
- type: 'notify.blurred'
1698
- event: FocusEvent_2<HTMLDivElement, Element>
1699
- }
1700
- | {
1701
- type: 'notify.done loading'
1702
- }
1703
- | {
1704
- type: 'notify.editable'
1705
- }
1706
- | {
1707
- type: 'notify.error'
1708
- name: string
1709
- description: string
1710
- data: unknown
1711
- }
1712
- | {
1713
- type: 'notify.focused'
1714
- event: FocusEvent_2<HTMLDivElement, Element>
1715
- }
1716
- | {
1717
- type: 'notify.invalid value'
1718
- resolution: InvalidValueResolution | null
1719
- value: Array<PortableTextBlock> | undefined
1720
- }
1721
- | {
1722
- type: 'notify.loading'
1723
- }
1724
- | {
1725
- type: 'notify.read only'
1726
- }
1727
- | {
1728
- type: 'notify.ready'
1729
- }
1730
- | {
1731
- type: 'notify.selection'
1732
- selection: EditorSelection
1733
- }
1734
- | {
1735
- type: 'notify.value changed'
1736
- value: Array<PortableTextBlock> | undefined
1737
- }
1738
- | {
1739
- type: 'notify.unset'
1740
- previousValue: Array<PortableTextBlock>
1741
- }
1742
- | {
1743
- type: 'dragstart'
1744
- origin: Pick<EventPosition, 'selection'>
1745
- ghost?: HTMLElement
1746
- }
1747
- | {
1748
- type: 'dragend'
1749
- }
1750
- | {
1751
- type: 'drop'
1752
- },
1753
- undefined,
1754
- never,
1755
- never,
1756
- never,
1757
- never,
1758
- | PatchEvent
1759
- | InternalPatchEvent
1760
- | MutationEvent
1761
- | PatchesEvent
1762
- | {
1763
- type: 'blurred'
1764
- event: FocusEvent_2<HTMLDivElement, Element>
1765
- }
1766
- | {
1767
- type: 'done loading'
1768
- }
1769
- | {
1770
- type: 'editable'
1771
- }
1772
- | {
1773
- type: 'error'
1774
- name: string
1775
- description: string
1776
- data: unknown
1777
- }
1778
- | {
1779
- type: 'focused'
1780
- event: FocusEvent_2<HTMLDivElement, Element>
1781
- }
1782
- | {
1783
- type: 'invalid value'
1784
- resolution: InvalidValueResolution | null
1785
- value: Array<PortableTextBlock> | undefined
1786
- }
1787
- | {
1788
- type: 'loading'
1789
- }
1790
- | {
1791
- type: 'read only'
1792
- }
1793
- | {
1794
- type: 'ready'
1795
- }
1796
- | {
1797
- type: 'selection'
1798
- selection: EditorSelection
1799
- }
1800
- | {
1801
- type: 'value changed'
1802
- value: Array<PortableTextBlock> | undefined
1803
- }
1804
- | UnsetEvent
1805
- >
1806
- }
1807
- readonly 'notify.invalid value': {
1808
- readonly actions: ActionFunction<
1809
- {
1810
- behaviors: Set<BehaviorConfig>
1811
- converters: Set<Converter>
1812
- getLegacySchema: () => PortableTextMemberSchemaTypes
1813
- keyGenerator: () => string
1814
- pendingEvents: Array<InternalPatchEvent | MutationEvent>
1815
- pendingIncomingPatchesEvents: Array<PatchesEvent>
1816
- schema: EditorSchema
1817
- initialReadOnly: boolean
1818
- maxBlocks: number | undefined
1819
- selection: EditorSelection
1820
- initialValue: Array<PortableTextBlock> | undefined
1821
- internalDrag?: {
1822
- ghost?: HTMLElement
1823
- origin: Pick<EventPosition, 'selection'>
1824
- }
1825
- slateEditor?: PortableTextSlateEditor
1826
- },
1827
- {
1828
- type: 'notify.invalid value'
1829
- resolution: InvalidValueResolution | null
1830
- value: Array<PortableTextBlock> | undefined
1831
- },
1832
- | InternalPatchEvent
1833
- | MutationEvent
1834
- | PatchesEvent
1835
- | {
1836
- type: 'update readOnly'
1837
- readOnly: boolean
1838
- }
1839
- | {
1840
- type: 'update schema'
1841
- schema: EditorSchema
1842
- }
1843
- | {
1844
- type: 'update key generator'
1845
- keyGenerator: () => string
1846
- }
1847
- | {
1848
- type: 'update maxBlocks'
1849
- maxBlocks: number | undefined
1850
- }
1851
- | {
1852
- type: 'add behavior'
1853
- behaviorConfig: BehaviorConfig
1854
- }
1855
- | {
1856
- type: 'remove behavior'
1857
- behaviorConfig: BehaviorConfig
1858
- }
1859
- | {
1860
- type: 'blur'
1861
- editor: PortableTextSlateEditor
1862
- }
1863
- | {
1864
- type: 'focus'
1865
- editor: PortableTextSlateEditor
1866
- }
1867
- | {
1868
- type: 'normalizing'
1869
- }
1870
- | {
1871
- type: 'done normalizing'
1872
- }
1873
- | {
1874
- type: 'done syncing value'
1875
- }
1876
- | {
1877
- type: 'syncing value'
1878
- }
1879
- | {
1880
- type: 'behavior event'
1881
- behaviorEvent: BehaviorEvent
1882
- editor: PortableTextSlateEditor
1883
- nativeEvent?: {
1884
- preventDefault: () => void
1885
- }
1886
- }
1887
- | {
1888
- type: 'notify.patch'
1889
- patch: Patch
1890
- }
1891
- | {
1892
- type: 'notify.mutation'
1893
- patches: Array<Patch>
1894
- snapshot: Array<PortableTextBlock> | undefined
1895
- value: Array<PortableTextBlock> | undefined
1896
- }
1897
- | {
1898
- type: 'notify.blurred'
1899
- event: FocusEvent_2<HTMLDivElement, Element>
1900
- }
1901
- | {
1902
- type: 'notify.done loading'
1903
- }
1904
- | {
1905
- type: 'notify.editable'
1906
- }
1907
- | {
1908
- type: 'notify.error'
1909
- name: string
1910
- description: string
1911
- data: unknown
1912
- }
1913
- | {
1914
- type: 'notify.focused'
1915
- event: FocusEvent_2<HTMLDivElement, Element>
1916
- }
1917
- | {
1918
- type: 'notify.invalid value'
1919
- resolution: InvalidValueResolution | null
1920
- value: Array<PortableTextBlock> | undefined
1921
- }
1922
- | {
1923
- type: 'notify.loading'
1924
- }
1925
- | {
1926
- type: 'notify.read only'
1927
- }
1928
- | {
1929
- type: 'notify.ready'
1930
- }
1931
- | {
1932
- type: 'notify.selection'
1933
- selection: EditorSelection
1934
- }
1935
- | {
1936
- type: 'notify.value changed'
1937
- value: Array<PortableTextBlock> | undefined
1938
- }
1939
- | {
1940
- type: 'notify.unset'
1941
- previousValue: Array<PortableTextBlock>
1942
- }
1943
- | {
1944
- type: 'dragstart'
1945
- origin: Pick<EventPosition, 'selection'>
1946
- ghost?: HTMLElement
1947
- }
1948
- | {
1949
- type: 'dragend'
1950
- }
1951
- | {
1952
- type: 'drop'
1953
- },
1954
- undefined,
1955
- never,
1956
- never,
1957
- never,
1958
- never,
1959
- | PatchEvent
1960
- | InternalPatchEvent
1961
- | MutationEvent
1962
- | PatchesEvent
1963
- | {
1964
- type: 'blurred'
1965
- event: FocusEvent_2<HTMLDivElement, Element>
1966
- }
1967
- | {
1968
- type: 'done loading'
1969
- }
1970
- | {
1971
- type: 'editable'
1972
- }
1973
- | {
1974
- type: 'error'
1975
- name: string
1976
- description: string
1977
- data: unknown
1978
- }
1979
- | {
1980
- type: 'focused'
1981
- event: FocusEvent_2<HTMLDivElement, Element>
1982
- }
1983
- | {
1984
- type: 'invalid value'
1985
- resolution: InvalidValueResolution | null
1986
- value: Array<PortableTextBlock> | undefined
1987
- }
1988
- | {
1989
- type: 'loading'
1990
- }
1991
- | {
1992
- type: 'read only'
1993
- }
1994
- | {
1995
- type: 'ready'
1996
- }
1997
- | {
1998
- type: 'selection'
1999
- selection: EditorSelection
2000
- }
2001
- | {
2002
- type: 'value changed'
2003
- value: Array<PortableTextBlock> | undefined
2004
- }
2005
- | UnsetEvent
2006
- >
2007
- }
2008
- readonly 'notify.focused': {
2009
- readonly actions: ActionFunction<
2010
- {
2011
- behaviors: Set<BehaviorConfig>
2012
- converters: Set<Converter>
2013
- getLegacySchema: () => PortableTextMemberSchemaTypes
2014
- keyGenerator: () => string
2015
- pendingEvents: Array<InternalPatchEvent | MutationEvent>
2016
- pendingIncomingPatchesEvents: Array<PatchesEvent>
2017
- schema: EditorSchema
2018
- initialReadOnly: boolean
2019
- maxBlocks: number | undefined
2020
- selection: EditorSelection
2021
- initialValue: Array<PortableTextBlock> | undefined
2022
- internalDrag?: {
2023
- ghost?: HTMLElement
2024
- origin: Pick<EventPosition, 'selection'>
2025
- }
2026
- slateEditor?: PortableTextSlateEditor
2027
- },
2028
- {
2029
- type: 'notify.focused'
2030
- event: FocusEvent_2<HTMLDivElement, Element>
2031
- },
2032
- | InternalPatchEvent
2033
- | MutationEvent
2034
- | PatchesEvent
2035
- | {
2036
- type: 'update readOnly'
2037
- readOnly: boolean
2038
- }
2039
- | {
2040
- type: 'update schema'
2041
- schema: EditorSchema
2042
- }
2043
- | {
2044
- type: 'update key generator'
2045
- keyGenerator: () => string
2046
- }
2047
- | {
2048
- type: 'update maxBlocks'
2049
- maxBlocks: number | undefined
2050
- }
2051
- | {
2052
- type: 'add behavior'
2053
- behaviorConfig: BehaviorConfig
2054
- }
2055
- | {
2056
- type: 'remove behavior'
2057
- behaviorConfig: BehaviorConfig
2058
- }
2059
- | {
2060
- type: 'blur'
2061
- editor: PortableTextSlateEditor
2062
- }
2063
- | {
2064
- type: 'focus'
2065
- editor: PortableTextSlateEditor
2066
- }
2067
- | {
2068
- type: 'normalizing'
2069
- }
2070
- | {
2071
- type: 'done normalizing'
2072
- }
2073
- | {
2074
- type: 'done syncing value'
2075
- }
2076
- | {
2077
- type: 'syncing value'
2078
- }
2079
- | {
2080
- type: 'behavior event'
2081
- behaviorEvent: BehaviorEvent
2082
- editor: PortableTextSlateEditor
2083
- nativeEvent?: {
2084
- preventDefault: () => void
2085
- }
2086
- }
2087
- | {
2088
- type: 'notify.patch'
2089
- patch: Patch
2090
- }
2091
- | {
2092
- type: 'notify.mutation'
2093
- patches: Array<Patch>
2094
- snapshot: Array<PortableTextBlock> | undefined
2095
- value: Array<PortableTextBlock> | undefined
2096
- }
2097
- | {
2098
- type: 'notify.blurred'
2099
- event: FocusEvent_2<HTMLDivElement, Element>
2100
- }
2101
- | {
2102
- type: 'notify.done loading'
2103
- }
2104
- | {
2105
- type: 'notify.editable'
2106
- }
2107
- | {
2108
- type: 'notify.error'
2109
- name: string
2110
- description: string
2111
- data: unknown
2112
- }
2113
- | {
2114
- type: 'notify.focused'
2115
- event: FocusEvent_2<HTMLDivElement, Element>
2116
- }
2117
- | {
2118
- type: 'notify.invalid value'
2119
- resolution: InvalidValueResolution | null
2120
- value: Array<PortableTextBlock> | undefined
2121
- }
2122
- | {
2123
- type: 'notify.loading'
2124
- }
2125
- | {
2126
- type: 'notify.read only'
2127
- }
2128
- | {
2129
- type: 'notify.ready'
2130
- }
2131
- | {
2132
- type: 'notify.selection'
2133
- selection: EditorSelection
2134
- }
2135
- | {
2136
- type: 'notify.value changed'
2137
- value: Array<PortableTextBlock> | undefined
2138
- }
2139
- | {
2140
- type: 'notify.unset'
2141
- previousValue: Array<PortableTextBlock>
2142
- }
2143
- | {
2144
- type: 'dragstart'
2145
- origin: Pick<EventPosition, 'selection'>
2146
- ghost?: HTMLElement
2147
- }
2148
- | {
2149
- type: 'dragend'
2150
- }
2151
- | {
2152
- type: 'drop'
2153
- },
2154
- undefined,
2155
- never,
2156
- never,
2157
- never,
2158
- never,
2159
- | PatchEvent
2160
- | InternalPatchEvent
2161
- | MutationEvent
2162
- | PatchesEvent
2163
- | {
2164
- type: 'blurred'
2165
- event: FocusEvent_2<HTMLDivElement, Element>
2166
- }
2167
- | {
2168
- type: 'done loading'
2169
- }
2170
- | {
2171
- type: 'editable'
2172
- }
2173
- | {
2174
- type: 'error'
2175
- name: string
2176
- description: string
2177
- data: unknown
2178
- }
2179
- | {
2180
- type: 'focused'
2181
- event: FocusEvent_2<HTMLDivElement, Element>
2182
- }
2183
- | {
2184
- type: 'invalid value'
2185
- resolution: InvalidValueResolution | null
2186
- value: Array<PortableTextBlock> | undefined
2187
- }
2188
- | {
2189
- type: 'loading'
2190
- }
2191
- | {
2192
- type: 'read only'
2193
- }
2194
- | {
2195
- type: 'ready'
2196
- }
2197
- | {
2198
- type: 'selection'
2199
- selection: EditorSelection
2200
- }
2201
- | {
2202
- type: 'value changed'
2203
- value: Array<PortableTextBlock> | undefined
2204
- }
2205
- | UnsetEvent
2206
- >
2207
- }
2208
- readonly 'notify.selection': {
2209
- readonly actions: readonly [
2210
- ActionFunction<
2211
- {
2212
- behaviors: Set<BehaviorConfig>
2213
- converters: Set<Converter>
2214
- getLegacySchema: () => PortableTextMemberSchemaTypes
2215
- keyGenerator: () => string
2216
- pendingEvents: Array<InternalPatchEvent | MutationEvent>
2217
- pendingIncomingPatchesEvents: Array<PatchesEvent>
2218
- schema: EditorSchema
2219
- initialReadOnly: boolean
2220
- maxBlocks: number | undefined
2221
- selection: EditorSelection
2222
- initialValue: Array<PortableTextBlock> | undefined
2223
- internalDrag?: {
2224
- ghost?: HTMLElement
2225
- origin: Pick<EventPosition, 'selection'>
2226
- }
2227
- slateEditor?: PortableTextSlateEditor
2228
- },
2229
- {
2230
- type: 'notify.selection'
2231
- selection: EditorSelection
2232
- },
2233
- | InternalPatchEvent
2234
- | MutationEvent
2235
- | PatchesEvent
2236
- | {
2237
- type: 'update readOnly'
2238
- readOnly: boolean
2239
- }
2240
- | {
2241
- type: 'update schema'
2242
- schema: EditorSchema
2243
- }
2244
- | {
2245
- type: 'update key generator'
2246
- keyGenerator: () => string
2247
- }
2248
- | {
2249
- type: 'update maxBlocks'
2250
- maxBlocks: number | undefined
2251
- }
2252
- | {
2253
- type: 'add behavior'
2254
- behaviorConfig: BehaviorConfig
2255
- }
2256
- | {
2257
- type: 'remove behavior'
2258
- behaviorConfig: BehaviorConfig
2259
- }
2260
- | {
2261
- type: 'blur'
2262
- editor: PortableTextSlateEditor
2263
- }
2264
- | {
2265
- type: 'focus'
2266
- editor: PortableTextSlateEditor
2267
- }
2268
- | {
2269
- type: 'normalizing'
2270
- }
2271
- | {
2272
- type: 'done normalizing'
2273
- }
2274
- | {
2275
- type: 'done syncing value'
2276
- }
2277
- | {
2278
- type: 'syncing value'
2279
- }
2280
- | {
2281
- type: 'behavior event'
2282
- behaviorEvent: BehaviorEvent
2283
- editor: PortableTextSlateEditor
2284
- nativeEvent?: {
2285
- preventDefault: () => void
2286
- }
2287
- }
2288
- | {
2289
- type: 'notify.patch'
2290
- patch: Patch
2291
- }
2292
- | {
2293
- type: 'notify.mutation'
2294
- patches: Array<Patch>
2295
- snapshot: Array<PortableTextBlock> | undefined
2296
- value: Array<PortableTextBlock> | undefined
2297
- }
2298
- | {
2299
- type: 'notify.blurred'
2300
- event: FocusEvent_2<HTMLDivElement, Element>
2301
- }
2302
- | {
2303
- type: 'notify.done loading'
2304
- }
2305
- | {
2306
- type: 'notify.editable'
2307
- }
2308
- | {
2309
- type: 'notify.error'
2310
- name: string
2311
- description: string
2312
- data: unknown
2313
- }
2314
- | {
2315
- type: 'notify.focused'
2316
- event: FocusEvent_2<HTMLDivElement, Element>
2317
- }
2318
- | {
2319
- type: 'notify.invalid value'
2320
- resolution: InvalidValueResolution | null
2321
- value: Array<PortableTextBlock> | undefined
2322
- }
2323
- | {
2324
- type: 'notify.loading'
2325
- }
2326
- | {
2327
- type: 'notify.read only'
2328
- }
2329
- | {
2330
- type: 'notify.ready'
2331
- }
2332
- | {
2333
- type: 'notify.selection'
2334
- selection: EditorSelection
2335
- }
2336
- | {
2337
- type: 'notify.value changed'
2338
- value: Array<PortableTextBlock> | undefined
2339
- }
2340
- | {
2341
- type: 'notify.unset'
2342
- previousValue: Array<PortableTextBlock>
2343
- }
2344
- | {
2345
- type: 'dragstart'
2346
- origin: Pick<EventPosition, 'selection'>
2347
- ghost?: HTMLElement
2348
- }
2349
- | {
2350
- type: 'dragend'
2351
- }
2352
- | {
2353
- type: 'drop'
2354
- },
2355
- undefined,
2356
- never,
2357
- never,
2358
- never,
2359
- never,
2360
- never
2361
- >,
2362
- ActionFunction<
2363
- {
2364
- behaviors: Set<BehaviorConfig>
2365
- converters: Set<Converter>
2366
- getLegacySchema: () => PortableTextMemberSchemaTypes
2367
- keyGenerator: () => string
2368
- pendingEvents: Array<InternalPatchEvent | MutationEvent>
2369
- pendingIncomingPatchesEvents: Array<PatchesEvent>
2370
- schema: EditorSchema
2371
- initialReadOnly: boolean
2372
- maxBlocks: number | undefined
2373
- selection: EditorSelection
2374
- initialValue: Array<PortableTextBlock> | undefined
2375
- internalDrag?: {
2376
- ghost?: HTMLElement
2377
- origin: Pick<EventPosition, 'selection'>
2378
- }
2379
- slateEditor?: PortableTextSlateEditor
2380
- },
2381
- {
2382
- type: 'notify.selection'
2383
- selection: EditorSelection
2384
- },
2385
- | InternalPatchEvent
2386
- | MutationEvent
2387
- | PatchesEvent
2388
- | {
2389
- type: 'update readOnly'
2390
- readOnly: boolean
2391
- }
2392
- | {
2393
- type: 'update schema'
2394
- schema: EditorSchema
2395
- }
2396
- | {
2397
- type: 'update key generator'
2398
- keyGenerator: () => string
2399
- }
2400
- | {
2401
- type: 'update maxBlocks'
2402
- maxBlocks: number | undefined
2403
- }
2404
- | {
2405
- type: 'add behavior'
2406
- behaviorConfig: BehaviorConfig
2407
- }
2408
- | {
2409
- type: 'remove behavior'
2410
- behaviorConfig: BehaviorConfig
2411
- }
2412
- | {
2413
- type: 'blur'
2414
- editor: PortableTextSlateEditor
2415
- }
2416
- | {
2417
- type: 'focus'
2418
- editor: PortableTextSlateEditor
2419
- }
2420
- | {
2421
- type: 'normalizing'
2422
- }
2423
- | {
2424
- type: 'done normalizing'
2425
- }
2426
- | {
2427
- type: 'done syncing value'
2428
- }
2429
- | {
2430
- type: 'syncing value'
2431
- }
2432
- | {
2433
- type: 'behavior event'
2434
- behaviorEvent: BehaviorEvent
2435
- editor: PortableTextSlateEditor
2436
- nativeEvent?: {
2437
- preventDefault: () => void
2438
- }
2439
- }
2440
- | {
2441
- type: 'notify.patch'
2442
- patch: Patch
2443
- }
2444
- | {
2445
- type: 'notify.mutation'
2446
- patches: Array<Patch>
2447
- snapshot: Array<PortableTextBlock> | undefined
2448
- value: Array<PortableTextBlock> | undefined
2449
- }
2450
- | {
2451
- type: 'notify.blurred'
2452
- event: FocusEvent_2<HTMLDivElement, Element>
2453
- }
2454
- | {
2455
- type: 'notify.done loading'
2456
- }
2457
- | {
2458
- type: 'notify.editable'
2459
- }
2460
- | {
2461
- type: 'notify.error'
2462
- name: string
2463
- description: string
2464
- data: unknown
2465
- }
2466
- | {
2467
- type: 'notify.focused'
2468
- event: FocusEvent_2<HTMLDivElement, Element>
2469
- }
2470
- | {
2471
- type: 'notify.invalid value'
2472
- resolution: InvalidValueResolution | null
2473
- value: Array<PortableTextBlock> | undefined
2474
- }
2475
- | {
2476
- type: 'notify.loading'
2477
- }
2478
- | {
2479
- type: 'notify.read only'
2480
- }
2481
- | {
2482
- type: 'notify.ready'
2483
- }
2484
- | {
2485
- type: 'notify.selection'
2486
- selection: EditorSelection
2487
- }
2488
- | {
2489
- type: 'notify.value changed'
2490
- value: Array<PortableTextBlock> | undefined
2491
- }
2492
- | {
2493
- type: 'notify.unset'
2494
- previousValue: Array<PortableTextBlock>
2495
- }
2496
- | {
2497
- type: 'dragstart'
2498
- origin: Pick<EventPosition, 'selection'>
2499
- ghost?: HTMLElement
2500
- }
2501
- | {
2502
- type: 'dragend'
2503
- }
2504
- | {
2505
- type: 'drop'
2506
- },
2507
- undefined,
2508
- never,
2509
- never,
2510
- never,
2511
- never,
2512
- | PatchEvent
2513
- | InternalPatchEvent
2514
- | MutationEvent
2515
- | PatchesEvent
2516
- | {
2517
- type: 'blurred'
2518
- event: FocusEvent_2<HTMLDivElement, Element>
2519
- }
2520
- | {
2521
- type: 'done loading'
2522
- }
2523
- | {
2524
- type: 'editable'
2525
- }
2526
- | {
2527
- type: 'error'
2528
- name: string
2529
- description: string
2530
- data: unknown
2531
- }
2532
- | {
2533
- type: 'focused'
2534
- event: FocusEvent_2<HTMLDivElement, Element>
2535
- }
2536
- | {
2537
- type: 'invalid value'
2538
- resolution: InvalidValueResolution | null
2539
- value: Array<PortableTextBlock> | undefined
2540
- }
2541
- | {
2542
- type: 'loading'
2543
- }
2544
- | {
2545
- type: 'read only'
2546
- }
2547
- | {
2548
- type: 'ready'
2549
- }
2550
- | {
2551
- type: 'selection'
2552
- selection: EditorSelection
2553
- }
2554
- | {
2555
- type: 'value changed'
2556
- value: Array<PortableTextBlock> | undefined
2557
- }
2558
- | UnsetEvent
2559
- >,
2560
- ]
2561
- }
2562
- readonly 'notify.unset': {
2563
- readonly actions: ActionFunction<
2564
- {
2565
- behaviors: Set<BehaviorConfig>
2566
- converters: Set<Converter>
2567
- getLegacySchema: () => PortableTextMemberSchemaTypes
2568
- keyGenerator: () => string
2569
- pendingEvents: Array<InternalPatchEvent | MutationEvent>
2570
- pendingIncomingPatchesEvents: Array<PatchesEvent>
2571
- schema: EditorSchema
2572
- initialReadOnly: boolean
2573
- maxBlocks: number | undefined
2574
- selection: EditorSelection
2575
- initialValue: Array<PortableTextBlock> | undefined
2576
- internalDrag?: {
2577
- ghost?: HTMLElement
2578
- origin: Pick<EventPosition, 'selection'>
2579
- }
2580
- slateEditor?: PortableTextSlateEditor
2581
- },
2582
- {
2583
- type: 'notify.unset'
2584
- previousValue: Array<PortableTextBlock>
2585
- },
2586
- | InternalPatchEvent
2587
- | MutationEvent
2588
- | PatchesEvent
2589
- | {
2590
- type: 'update readOnly'
2591
- readOnly: boolean
2592
- }
2593
- | {
2594
- type: 'update schema'
2595
- schema: EditorSchema
2596
- }
2597
- | {
2598
- type: 'update key generator'
2599
- keyGenerator: () => string
2600
- }
2601
- | {
2602
- type: 'update maxBlocks'
2603
- maxBlocks: number | undefined
2604
- }
2605
- | {
2606
- type: 'add behavior'
2607
- behaviorConfig: BehaviorConfig
2608
- }
2609
- | {
2610
- type: 'remove behavior'
2611
- behaviorConfig: BehaviorConfig
2612
- }
2613
- | {
2614
- type: 'blur'
2615
- editor: PortableTextSlateEditor
2616
- }
2617
- | {
2618
- type: 'focus'
2619
- editor: PortableTextSlateEditor
2620
- }
2621
- | {
2622
- type: 'normalizing'
2623
- }
2624
- | {
2625
- type: 'done normalizing'
2626
- }
2627
- | {
2628
- type: 'done syncing value'
2629
- }
2630
- | {
2631
- type: 'syncing value'
2632
- }
2633
- | {
2634
- type: 'behavior event'
2635
- behaviorEvent: BehaviorEvent
2636
- editor: PortableTextSlateEditor
2637
- nativeEvent?: {
2638
- preventDefault: () => void
2639
- }
2640
- }
2641
- | {
2642
- type: 'notify.patch'
2643
- patch: Patch
2644
- }
2645
- | {
2646
- type: 'notify.mutation'
2647
- patches: Array<Patch>
2648
- snapshot: Array<PortableTextBlock> | undefined
2649
- value: Array<PortableTextBlock> | undefined
2650
- }
2651
- | {
2652
- type: 'notify.blurred'
2653
- event: FocusEvent_2<HTMLDivElement, Element>
2654
- }
2655
- | {
2656
- type: 'notify.done loading'
2657
- }
2658
- | {
2659
- type: 'notify.editable'
2660
- }
2661
- | {
2662
- type: 'notify.error'
2663
- name: string
2664
- description: string
2665
- data: unknown
2666
- }
2667
- | {
2668
- type: 'notify.focused'
2669
- event: FocusEvent_2<HTMLDivElement, Element>
2670
- }
2671
- | {
2672
- type: 'notify.invalid value'
2673
- resolution: InvalidValueResolution | null
2674
- value: Array<PortableTextBlock> | undefined
2675
- }
2676
- | {
2677
- type: 'notify.loading'
2678
- }
2679
- | {
2680
- type: 'notify.read only'
2681
- }
2682
- | {
2683
- type: 'notify.ready'
2684
- }
2685
- | {
2686
- type: 'notify.selection'
2687
- selection: EditorSelection
2688
- }
2689
- | {
2690
- type: 'notify.value changed'
2691
- value: Array<PortableTextBlock> | undefined
2692
- }
2693
- | {
2694
- type: 'notify.unset'
2695
- previousValue: Array<PortableTextBlock>
2696
- }
2697
- | {
2698
- type: 'dragstart'
2699
- origin: Pick<EventPosition, 'selection'>
2700
- ghost?: HTMLElement
2701
- }
2702
- | {
2703
- type: 'dragend'
2704
- }
2705
- | {
2706
- type: 'drop'
2707
- },
2708
- undefined,
2709
- never,
2710
- never,
2711
- never,
2712
- never,
2713
- | PatchEvent
2714
- | InternalPatchEvent
2715
- | MutationEvent
2716
- | PatchesEvent
2717
- | {
2718
- type: 'blurred'
2719
- event: FocusEvent_2<HTMLDivElement, Element>
2720
- }
2721
- | {
2722
- type: 'done loading'
2723
- }
2724
- | {
2725
- type: 'editable'
2726
- }
2727
- | {
2728
- type: 'error'
2729
- name: string
2730
- description: string
2731
- data: unknown
2732
- }
2733
- | {
2734
- type: 'focused'
2735
- event: FocusEvent_2<HTMLDivElement, Element>
2736
- }
2737
- | {
2738
- type: 'invalid value'
2739
- resolution: InvalidValueResolution | null
2740
- value: Array<PortableTextBlock> | undefined
2741
- }
2742
- | {
2743
- type: 'loading'
2744
- }
2745
- | {
2746
- type: 'read only'
2747
- }
2748
- | {
2749
- type: 'ready'
2750
- }
2751
- | {
2752
- type: 'selection'
2753
- selection: EditorSelection
2754
- }
2755
- | {
2756
- type: 'value changed'
2757
- value: Array<PortableTextBlock> | undefined
2758
- }
2759
- | UnsetEvent
2760
- >
2761
- }
2762
- readonly 'notify.loading': {
2763
- readonly actions: ActionFunction<
2764
- {
2765
- behaviors: Set<BehaviorConfig>
2766
- converters: Set<Converter>
2767
- getLegacySchema: () => PortableTextMemberSchemaTypes
2768
- keyGenerator: () => string
2769
- pendingEvents: Array<InternalPatchEvent | MutationEvent>
2770
- pendingIncomingPatchesEvents: Array<PatchesEvent>
2771
- schema: EditorSchema
2772
- initialReadOnly: boolean
2773
- maxBlocks: number | undefined
2774
- selection: EditorSelection
2775
- initialValue: Array<PortableTextBlock> | undefined
2776
- internalDrag?: {
2777
- ghost?: HTMLElement
2778
- origin: Pick<EventPosition, 'selection'>
2779
- }
2780
- slateEditor?: PortableTextSlateEditor
2781
- },
2782
- {
2783
- type: 'notify.loading'
2784
- },
2785
- | InternalPatchEvent
2786
- | MutationEvent
2787
- | PatchesEvent
2788
- | {
2789
- type: 'update readOnly'
2790
- readOnly: boolean
2791
- }
2792
- | {
2793
- type: 'update schema'
2794
- schema: EditorSchema
2795
- }
2796
- | {
2797
- type: 'update key generator'
2798
- keyGenerator: () => string
2799
- }
2800
- | {
2801
- type: 'update maxBlocks'
2802
- maxBlocks: number | undefined
2803
- }
2804
- | {
2805
- type: 'add behavior'
2806
- behaviorConfig: BehaviorConfig
2807
- }
2808
- | {
2809
- type: 'remove behavior'
2810
- behaviorConfig: BehaviorConfig
2811
- }
2812
- | {
2813
- type: 'blur'
2814
- editor: PortableTextSlateEditor
2815
- }
2816
- | {
2817
- type: 'focus'
2818
- editor: PortableTextSlateEditor
2819
- }
2820
- | {
2821
- type: 'normalizing'
2822
- }
2823
- | {
2824
- type: 'done normalizing'
2825
- }
2826
- | {
2827
- type: 'done syncing value'
2828
- }
2829
- | {
2830
- type: 'syncing value'
2831
- }
2832
- | {
2833
- type: 'behavior event'
2834
- behaviorEvent: BehaviorEvent
2835
- editor: PortableTextSlateEditor
2836
- nativeEvent?: {
2837
- preventDefault: () => void
2838
- }
2839
- }
2840
- | {
2841
- type: 'notify.patch'
2842
- patch: Patch
2843
- }
2844
- | {
2845
- type: 'notify.mutation'
2846
- patches: Array<Patch>
2847
- snapshot: Array<PortableTextBlock> | undefined
2848
- value: Array<PortableTextBlock> | undefined
2849
- }
2850
- | {
2851
- type: 'notify.blurred'
2852
- event: FocusEvent_2<HTMLDivElement, Element>
2853
- }
2854
- | {
2855
- type: 'notify.done loading'
2856
- }
2857
- | {
2858
- type: 'notify.editable'
2859
- }
2860
- | {
2861
- type: 'notify.error'
2862
- name: string
2863
- description: string
2864
- data: unknown
2865
- }
2866
- | {
2867
- type: 'notify.focused'
2868
- event: FocusEvent_2<HTMLDivElement, Element>
2869
- }
2870
- | {
2871
- type: 'notify.invalid value'
2872
- resolution: InvalidValueResolution | null
2873
- value: Array<PortableTextBlock> | undefined
2874
- }
2875
- | {
2876
- type: 'notify.loading'
2877
- }
2878
- | {
2879
- type: 'notify.read only'
2880
- }
2881
- | {
2882
- type: 'notify.ready'
2883
- }
2884
- | {
2885
- type: 'notify.selection'
2886
- selection: EditorSelection
2887
- }
2888
- | {
2889
- type: 'notify.value changed'
2890
- value: Array<PortableTextBlock> | undefined
2891
- }
2892
- | {
2893
- type: 'notify.unset'
2894
- previousValue: Array<PortableTextBlock>
2895
- }
2896
- | {
2897
- type: 'dragstart'
2898
- origin: Pick<EventPosition, 'selection'>
2899
- ghost?: HTMLElement
2900
- }
2901
- | {
2902
- type: 'dragend'
2903
- }
2904
- | {
2905
- type: 'drop'
2906
- },
2907
- undefined,
2908
- never,
2909
- never,
2910
- never,
2911
- never,
2912
- | PatchEvent
2913
- | InternalPatchEvent
2914
- | MutationEvent
2915
- | PatchesEvent
2916
- | {
2917
- type: 'blurred'
2918
- event: FocusEvent_2<HTMLDivElement, Element>
2919
- }
2920
- | {
2921
- type: 'done loading'
2922
- }
2923
- | {
2924
- type: 'editable'
2925
- }
2926
- | {
2927
- type: 'error'
2928
- name: string
2929
- description: string
2930
- data: unknown
2931
- }
2932
- | {
2933
- type: 'focused'
2934
- event: FocusEvent_2<HTMLDivElement, Element>
2935
- }
2936
- | {
2937
- type: 'invalid value'
2938
- resolution: InvalidValueResolution | null
2939
- value: Array<PortableTextBlock> | undefined
2940
- }
2941
- | {
2942
- type: 'loading'
2943
- }
2944
- | {
2945
- type: 'read only'
2946
- }
2947
- | {
2948
- type: 'ready'
2949
- }
2950
- | {
2951
- type: 'selection'
2952
- selection: EditorSelection
2953
- }
2954
- | {
2955
- type: 'value changed'
2956
- value: Array<PortableTextBlock> | undefined
2957
- }
2958
- | UnsetEvent
2959
- >
2960
- }
2961
- readonly 'notify.value changed': {
2962
- readonly actions: ActionFunction<
2963
- {
2964
- behaviors: Set<BehaviorConfig>
2965
- converters: Set<Converter>
2966
- getLegacySchema: () => PortableTextMemberSchemaTypes
2967
- keyGenerator: () => string
2968
- pendingEvents: Array<InternalPatchEvent | MutationEvent>
2969
- pendingIncomingPatchesEvents: Array<PatchesEvent>
2970
- schema: EditorSchema
2971
- initialReadOnly: boolean
2972
- maxBlocks: number | undefined
2973
- selection: EditorSelection
2974
- initialValue: Array<PortableTextBlock> | undefined
2975
- internalDrag?: {
2976
- ghost?: HTMLElement
2977
- origin: Pick<EventPosition, 'selection'>
2978
- }
2979
- slateEditor?: PortableTextSlateEditor
2980
- },
2981
- {
2982
- type: 'notify.value changed'
2983
- value: Array<PortableTextBlock> | undefined
2984
- },
2985
- | InternalPatchEvent
2986
- | MutationEvent
2987
- | PatchesEvent
2988
- | {
2989
- type: 'update readOnly'
2990
- readOnly: boolean
2991
- }
2992
- | {
2993
- type: 'update schema'
2994
- schema: EditorSchema
2995
- }
2996
- | {
2997
- type: 'update key generator'
2998
- keyGenerator: () => string
2999
- }
3000
- | {
3001
- type: 'update maxBlocks'
3002
- maxBlocks: number | undefined
3003
- }
3004
- | {
3005
- type: 'add behavior'
3006
- behaviorConfig: BehaviorConfig
3007
- }
3008
- | {
3009
- type: 'remove behavior'
3010
- behaviorConfig: BehaviorConfig
3011
- }
3012
- | {
3013
- type: 'blur'
3014
- editor: PortableTextSlateEditor
3015
- }
3016
- | {
3017
- type: 'focus'
3018
- editor: PortableTextSlateEditor
3019
- }
3020
- | {
3021
- type: 'normalizing'
3022
- }
3023
- | {
3024
- type: 'done normalizing'
3025
- }
3026
- | {
3027
- type: 'done syncing value'
3028
- }
3029
- | {
3030
- type: 'syncing value'
3031
- }
3032
- | {
3033
- type: 'behavior event'
3034
- behaviorEvent: BehaviorEvent
3035
- editor: PortableTextSlateEditor
3036
- nativeEvent?: {
3037
- preventDefault: () => void
3038
- }
3039
- }
3040
- | {
3041
- type: 'notify.patch'
3042
- patch: Patch
3043
- }
3044
- | {
3045
- type: 'notify.mutation'
3046
- patches: Array<Patch>
3047
- snapshot: Array<PortableTextBlock> | undefined
3048
- value: Array<PortableTextBlock> | undefined
3049
- }
3050
- | {
3051
- type: 'notify.blurred'
3052
- event: FocusEvent_2<HTMLDivElement, Element>
3053
- }
3054
- | {
3055
- type: 'notify.done loading'
3056
- }
3057
- | {
3058
- type: 'notify.editable'
3059
- }
3060
- | {
3061
- type: 'notify.error'
3062
- name: string
3063
- description: string
3064
- data: unknown
3065
- }
3066
- | {
3067
- type: 'notify.focused'
3068
- event: FocusEvent_2<HTMLDivElement, Element>
3069
- }
3070
- | {
3071
- type: 'notify.invalid value'
3072
- resolution: InvalidValueResolution | null
3073
- value: Array<PortableTextBlock> | undefined
3074
- }
3075
- | {
3076
- type: 'notify.loading'
3077
- }
3078
- | {
3079
- type: 'notify.read only'
3080
- }
3081
- | {
3082
- type: 'notify.ready'
3083
- }
3084
- | {
3085
- type: 'notify.selection'
3086
- selection: EditorSelection
3087
- }
3088
- | {
3089
- type: 'notify.value changed'
3090
- value: Array<PortableTextBlock> | undefined
3091
- }
3092
- | {
3093
- type: 'notify.unset'
3094
- previousValue: Array<PortableTextBlock>
3095
- }
3096
- | {
3097
- type: 'dragstart'
3098
- origin: Pick<EventPosition, 'selection'>
3099
- ghost?: HTMLElement
3100
- }
3101
- | {
3102
- type: 'dragend'
3103
- }
3104
- | {
3105
- type: 'drop'
3106
- },
3107
- undefined,
3108
- never,
3109
- never,
3110
- never,
3111
- never,
3112
- | PatchEvent
3113
- | InternalPatchEvent
3114
- | MutationEvent
3115
- | PatchesEvent
3116
- | {
3117
- type: 'blurred'
3118
- event: FocusEvent_2<HTMLDivElement, Element>
3119
- }
3120
- | {
3121
- type: 'done loading'
3122
- }
3123
- | {
3124
- type: 'editable'
3125
- }
3126
- | {
3127
- type: 'error'
3128
- name: string
3129
- description: string
3130
- data: unknown
3131
- }
3132
- | {
3133
- type: 'focused'
3134
- event: FocusEvent_2<HTMLDivElement, Element>
3135
- }
3136
- | {
3137
- type: 'invalid value'
3138
- resolution: InvalidValueResolution | null
3139
- value: Array<PortableTextBlock> | undefined
3140
- }
3141
- | {
3142
- type: 'loading'
3143
- }
3144
- | {
3145
- type: 'read only'
3146
- }
3147
- | {
3148
- type: 'ready'
3149
- }
3150
- | {
3151
- type: 'selection'
3152
- selection: EditorSelection
3153
- }
3154
- | {
3155
- type: 'value changed'
3156
- value: Array<PortableTextBlock> | undefined
3157
- }
3158
- | UnsetEvent
3159
- >
3160
- }
3161
- readonly 'add behavior': {
3162
- readonly actions: 'add behavior to context'
3163
- }
3164
- readonly 'remove behavior': {
3165
- readonly actions: 'remove behavior from context'
3166
- }
3167
- readonly 'update key generator': {
3168
- readonly actions: ActionFunction<
3169
- {
3170
- behaviors: Set<BehaviorConfig>
3171
- converters: Set<Converter>
3172
- getLegacySchema: () => PortableTextMemberSchemaTypes
3173
- keyGenerator: () => string
3174
- pendingEvents: Array<InternalPatchEvent | MutationEvent>
3175
- pendingIncomingPatchesEvents: Array<PatchesEvent>
3176
- schema: EditorSchema
3177
- initialReadOnly: boolean
3178
- maxBlocks: number | undefined
3179
- selection: EditorSelection
3180
- initialValue: Array<PortableTextBlock> | undefined
3181
- internalDrag?: {
3182
- ghost?: HTMLElement
3183
- origin: Pick<EventPosition, 'selection'>
3184
- }
3185
- slateEditor?: PortableTextSlateEditor
3186
- },
3187
- {
3188
- type: 'update key generator'
3189
- keyGenerator: () => string
3190
- },
3191
- | InternalPatchEvent
3192
- | MutationEvent
3193
- | PatchesEvent
3194
- | {
3195
- type: 'update readOnly'
3196
- readOnly: boolean
3197
- }
3198
- | {
3199
- type: 'update schema'
3200
- schema: EditorSchema
3201
- }
3202
- | {
3203
- type: 'update key generator'
3204
- keyGenerator: () => string
3205
- }
3206
- | {
3207
- type: 'update maxBlocks'
3208
- maxBlocks: number | undefined
3209
- }
3210
- | {
3211
- type: 'add behavior'
3212
- behaviorConfig: BehaviorConfig
3213
- }
3214
- | {
3215
- type: 'remove behavior'
3216
- behaviorConfig: BehaviorConfig
3217
- }
3218
- | {
3219
- type: 'blur'
3220
- editor: PortableTextSlateEditor
3221
- }
3222
- | {
3223
- type: 'focus'
3224
- editor: PortableTextSlateEditor
3225
- }
3226
- | {
3227
- type: 'normalizing'
3228
- }
3229
- | {
3230
- type: 'done normalizing'
3231
- }
3232
- | {
3233
- type: 'done syncing value'
3234
- }
3235
- | {
3236
- type: 'syncing value'
3237
- }
3238
- | {
3239
- type: 'behavior event'
3240
- behaviorEvent: BehaviorEvent
3241
- editor: PortableTextSlateEditor
3242
- nativeEvent?: {
3243
- preventDefault: () => void
3244
- }
3245
- }
3246
- | {
3247
- type: 'notify.patch'
3248
- patch: Patch
3249
- }
3250
- | {
3251
- type: 'notify.mutation'
3252
- patches: Array<Patch>
3253
- snapshot: Array<PortableTextBlock> | undefined
3254
- value: Array<PortableTextBlock> | undefined
3255
- }
3256
- | {
3257
- type: 'notify.blurred'
3258
- event: FocusEvent_2<HTMLDivElement, Element>
3259
- }
3260
- | {
3261
- type: 'notify.done loading'
3262
- }
3263
- | {
3264
- type: 'notify.editable'
3265
- }
3266
- | {
3267
- type: 'notify.error'
3268
- name: string
3269
- description: string
3270
- data: unknown
3271
- }
3272
- | {
3273
- type: 'notify.focused'
3274
- event: FocusEvent_2<HTMLDivElement, Element>
3275
- }
3276
- | {
3277
- type: 'notify.invalid value'
3278
- resolution: InvalidValueResolution | null
3279
- value: Array<PortableTextBlock> | undefined
3280
- }
3281
- | {
3282
- type: 'notify.loading'
3283
- }
3284
- | {
3285
- type: 'notify.read only'
3286
- }
3287
- | {
3288
- type: 'notify.ready'
3289
- }
3290
- | {
3291
- type: 'notify.selection'
3292
- selection: EditorSelection
3293
- }
3294
- | {
3295
- type: 'notify.value changed'
3296
- value: Array<PortableTextBlock> | undefined
3297
- }
3298
- | {
3299
- type: 'notify.unset'
3300
- previousValue: Array<PortableTextBlock>
3301
- }
3302
- | {
3303
- type: 'dragstart'
3304
- origin: Pick<EventPosition, 'selection'>
3305
- ghost?: HTMLElement
3306
- }
3307
- | {
3308
- type: 'dragend'
3309
- }
3310
- | {
3311
- type: 'drop'
3312
- },
3313
- undefined,
3314
- never,
3315
- never,
3316
- never,
3317
- never,
3318
- never
3319
- >
3320
- }
3321
- readonly 'update schema': {
3322
- readonly actions: 'assign schema'
3323
- }
3324
- readonly 'update maxBlocks': {
3325
- readonly actions: ActionFunction<
3326
- {
3327
- behaviors: Set<BehaviorConfig>
3328
- converters: Set<Converter>
3329
- getLegacySchema: () => PortableTextMemberSchemaTypes
3330
- keyGenerator: () => string
3331
- pendingEvents: Array<InternalPatchEvent | MutationEvent>
3332
- pendingIncomingPatchesEvents: Array<PatchesEvent>
3333
- schema: EditorSchema
3334
- initialReadOnly: boolean
3335
- maxBlocks: number | undefined
3336
- selection: EditorSelection
3337
- initialValue: Array<PortableTextBlock> | undefined
3338
- internalDrag?: {
3339
- ghost?: HTMLElement
3340
- origin: Pick<EventPosition, 'selection'>
3341
- }
3342
- slateEditor?: PortableTextSlateEditor
3343
- },
3344
- {
3345
- type: 'update maxBlocks'
3346
- maxBlocks: number | undefined
3347
- },
3348
- | InternalPatchEvent
3349
- | MutationEvent
3350
- | PatchesEvent
3351
- | {
3352
- type: 'update readOnly'
3353
- readOnly: boolean
3354
- }
3355
- | {
3356
- type: 'update schema'
3357
- schema: EditorSchema
3358
- }
3359
- | {
3360
- type: 'update key generator'
3361
- keyGenerator: () => string
3362
- }
3363
- | {
3364
- type: 'update maxBlocks'
3365
- maxBlocks: number | undefined
3366
- }
3367
- | {
3368
- type: 'add behavior'
3369
- behaviorConfig: BehaviorConfig
3370
- }
3371
- | {
3372
- type: 'remove behavior'
3373
- behaviorConfig: BehaviorConfig
3374
- }
3375
- | {
3376
- type: 'blur'
3377
- editor: PortableTextSlateEditor
3378
- }
3379
- | {
3380
- type: 'focus'
3381
- editor: PortableTextSlateEditor
3382
- }
3383
- | {
3384
- type: 'normalizing'
3385
- }
3386
- | {
3387
- type: 'done normalizing'
3388
- }
3389
- | {
3390
- type: 'done syncing value'
3391
- }
3392
- | {
3393
- type: 'syncing value'
3394
- }
3395
- | {
3396
- type: 'behavior event'
3397
- behaviorEvent: BehaviorEvent
3398
- editor: PortableTextSlateEditor
3399
- nativeEvent?: {
3400
- preventDefault: () => void
1126
+ selection: EditorSelection
1127
+ initialValue: Array<PortableTextBlock> | undefined
1128
+ internalDrag?: {
1129
+ ghost?: HTMLElement
1130
+ origin: Pick<EventPosition, 'selection'>
3401
1131
  }
3402
- }
3403
- | {
3404
- type: 'notify.patch'
3405
- patch: Patch
3406
- }
3407
- | {
3408
- type: 'notify.mutation'
3409
- patches: Array<Patch>
3410
- snapshot: Array<PortableTextBlock> | undefined
3411
- value: Array<PortableTextBlock> | undefined
3412
- }
3413
- | {
3414
- type: 'notify.blurred'
3415
- event: FocusEvent_2<HTMLDivElement, Element>
3416
- }
3417
- | {
3418
- type: 'notify.done loading'
3419
- }
3420
- | {
3421
- type: 'notify.editable'
3422
- }
3423
- | {
3424
- type: 'notify.error'
3425
- name: string
3426
- description: string
3427
- data: unknown
3428
- }
3429
- | {
3430
- type: 'notify.focused'
3431
- event: FocusEvent_2<HTMLDivElement, Element>
3432
- }
3433
- | {
3434
- type: 'notify.invalid value'
3435
- resolution: InvalidValueResolution | null
3436
- value: Array<PortableTextBlock> | undefined
3437
- }
3438
- | {
3439
- type: 'notify.loading'
3440
- }
3441
- | {
3442
- type: 'notify.read only'
3443
- }
3444
- | {
3445
- type: 'notify.ready'
3446
- }
3447
- | {
3448
- type: 'notify.selection'
1132
+ slateEditor?: PortableTextSlateEditor
1133
+ },
1134
+ {
1135
+ type: 'update selection'
3449
1136
  selection: EditorSelection
3450
- }
3451
- | {
3452
- type: 'notify.value changed'
3453
- value: Array<PortableTextBlock> | undefined
3454
- }
3455
- | {
3456
- type: 'notify.unset'
3457
- previousValue: Array<PortableTextBlock>
3458
- }
3459
- | {
3460
- type: 'dragstart'
3461
- origin: Pick<EventPosition, 'selection'>
3462
- ghost?: HTMLElement
3463
- }
3464
- | {
3465
- type: 'dragend'
3466
- }
3467
- | {
3468
- type: 'drop'
3469
1137
  },
3470
- undefined,
3471
- never,
3472
- never,
3473
- never,
3474
- never,
3475
- never
3476
- >
1138
+ | InternalPatchEvent
1139
+ | MutationEvent
1140
+ | PatchesEvent
1141
+ | {
1142
+ type: 'update readOnly'
1143
+ readOnly: boolean
1144
+ }
1145
+ | {
1146
+ type: 'update maxBlocks'
1147
+ maxBlocks: number | undefined
1148
+ }
1149
+ | {
1150
+ type: 'add behavior'
1151
+ behaviorConfig: BehaviorConfig
1152
+ }
1153
+ | {
1154
+ type: 'remove behavior'
1155
+ behaviorConfig: BehaviorConfig
1156
+ }
1157
+ | {
1158
+ type: 'blur'
1159
+ editor: PortableTextSlateEditor
1160
+ }
1161
+ | {
1162
+ type: 'focus'
1163
+ editor: PortableTextSlateEditor
1164
+ }
1165
+ | {
1166
+ type: 'normalizing'
1167
+ }
1168
+ | {
1169
+ type: 'update selection'
1170
+ selection: EditorSelection
1171
+ }
1172
+ | {
1173
+ type: 'done normalizing'
1174
+ }
1175
+ | {
1176
+ type: 'done syncing value'
1177
+ }
1178
+ | {
1179
+ type: 'syncing value'
1180
+ }
1181
+ | {
1182
+ type: 'behavior event'
1183
+ behaviorEvent: BehaviorEvent
1184
+ editor: PortableTextSlateEditor
1185
+ nativeEvent?: {
1186
+ preventDefault: () => void
1187
+ }
1188
+ }
1189
+ | {
1190
+ type: 'dragstart'
1191
+ origin: Pick<EventPosition, 'selection'>
1192
+ ghost?: HTMLElement
1193
+ }
1194
+ | {
1195
+ type: 'dragend'
1196
+ }
1197
+ | {
1198
+ type: 'drop'
1199
+ },
1200
+ undefined,
1201
+ never,
1202
+ never,
1203
+ never,
1204
+ never,
1205
+ never
1206
+ >,
1207
+ ]
3477
1208
  }
3478
1209
  }
3479
1210
  readonly type: 'parallel'
@@ -3669,14 +1400,6 @@ declare const editorMachine: StateMachine<
3669
1400
  type: 'update readOnly'
3670
1401
  readOnly: boolean
3671
1402
  }
3672
- | {
3673
- type: 'update schema'
3674
- schema: EditorSchema
3675
- }
3676
- | {
3677
- type: 'update key generator'
3678
- keyGenerator: () => string
3679
- }
3680
1403
  | {
3681
1404
  type: 'update maxBlocks'
3682
1405
  maxBlocks: number | undefined
@@ -3690,88 +1413,36 @@ declare const editorMachine: StateMachine<
3690
1413
  behaviorConfig: BehaviorConfig
3691
1414
  }
3692
1415
  | {
3693
- type: 'blur'
3694
- editor: PortableTextSlateEditor
3695
- }
3696
- | {
3697
- type: 'focus'
3698
- editor: PortableTextSlateEditor
3699
- }
3700
- | {
3701
- type: 'normalizing'
3702
- }
3703
- | {
3704
- type: 'done normalizing'
3705
- }
3706
- | {
3707
- type: 'done syncing value'
3708
- }
3709
- | {
3710
- type: 'syncing value'
3711
- }
3712
- | {
3713
- type: 'behavior event'
3714
- behaviorEvent: BehaviorEvent
3715
- editor: PortableTextSlateEditor
3716
- nativeEvent?: {
3717
- preventDefault: () => void
3718
- }
3719
- }
3720
- | {
3721
- type: 'notify.patch'
3722
- patch: Patch
3723
- }
3724
- | {
3725
- type: 'notify.mutation'
3726
- patches: Array<Patch>
3727
- snapshot: Array<PortableTextBlock> | undefined
3728
- value: Array<PortableTextBlock> | undefined
3729
- }
3730
- | {
3731
- type: 'notify.blurred'
3732
- event: FocusEvent_2<HTMLDivElement, Element>
3733
- }
3734
- | {
3735
- type: 'notify.done loading'
3736
- }
3737
- | {
3738
- type: 'notify.editable'
3739
- }
3740
- | {
3741
- type: 'notify.error'
3742
- name: string
3743
- description: string
3744
- data: unknown
3745
- }
3746
- | {
3747
- type: 'notify.focused'
3748
- event: FocusEvent_2<HTMLDivElement, Element>
1416
+ type: 'blur'
1417
+ editor: PortableTextSlateEditor
3749
1418
  }
3750
1419
  | {
3751
- type: 'notify.invalid value'
3752
- resolution: InvalidValueResolution | null
3753
- value: Array<PortableTextBlock> | undefined
1420
+ type: 'focus'
1421
+ editor: PortableTextSlateEditor
3754
1422
  }
3755
1423
  | {
3756
- type: 'notify.loading'
1424
+ type: 'normalizing'
3757
1425
  }
3758
1426
  | {
3759
- type: 'notify.read only'
1427
+ type: 'update selection'
1428
+ selection: EditorSelection
3760
1429
  }
3761
1430
  | {
3762
- type: 'notify.ready'
1431
+ type: 'done normalizing'
3763
1432
  }
3764
1433
  | {
3765
- type: 'notify.selection'
3766
- selection: EditorSelection
1434
+ type: 'done syncing value'
3767
1435
  }
3768
1436
  | {
3769
- type: 'notify.value changed'
3770
- value: Array<PortableTextBlock> | undefined
1437
+ type: 'syncing value'
3771
1438
  }
3772
1439
  | {
3773
- type: 'notify.unset'
3774
- previousValue: Array<PortableTextBlock>
1440
+ type: 'behavior event'
1441
+ behaviorEvent: BehaviorEvent
1442
+ editor: PortableTextSlateEditor
1443
+ nativeEvent?: {
1444
+ preventDefault: () => void
1445
+ }
3775
1446
  }
3776
1447
  | {
3777
1448
  type: 'dragstart'
@@ -3835,14 +1506,6 @@ declare const editorMachine: StateMachine<
3835
1506
  type: 'update readOnly'
3836
1507
  readOnly: boolean
3837
1508
  }
3838
- | {
3839
- type: 'update schema'
3840
- schema: EditorSchema
3841
- }
3842
- | {
3843
- type: 'update key generator'
3844
- keyGenerator: () => string
3845
- }
3846
1509
  | {
3847
1510
  type: 'update maxBlocks'
3848
1511
  maxBlocks: number | undefined
@@ -3866,6 +1529,10 @@ declare const editorMachine: StateMachine<
3866
1529
  | {
3867
1530
  type: 'normalizing'
3868
1531
  }
1532
+ | {
1533
+ type: 'update selection'
1534
+ selection: EditorSelection
1535
+ }
3869
1536
  | {
3870
1537
  type: 'done normalizing'
3871
1538
  }
@@ -3883,62 +1550,6 @@ declare const editorMachine: StateMachine<
3883
1550
  preventDefault: () => void
3884
1551
  }
3885
1552
  }
3886
- | {
3887
- type: 'notify.patch'
3888
- patch: Patch
3889
- }
3890
- | {
3891
- type: 'notify.mutation'
3892
- patches: Array<Patch>
3893
- snapshot: Array<PortableTextBlock> | undefined
3894
- value: Array<PortableTextBlock> | undefined
3895
- }
3896
- | {
3897
- type: 'notify.blurred'
3898
- event: FocusEvent_2<HTMLDivElement, Element>
3899
- }
3900
- | {
3901
- type: 'notify.done loading'
3902
- }
3903
- | {
3904
- type: 'notify.editable'
3905
- }
3906
- | {
3907
- type: 'notify.error'
3908
- name: string
3909
- description: string
3910
- data: unknown
3911
- }
3912
- | {
3913
- type: 'notify.focused'
3914
- event: FocusEvent_2<HTMLDivElement, Element>
3915
- }
3916
- | {
3917
- type: 'notify.invalid value'
3918
- resolution: InvalidValueResolution | null
3919
- value: Array<PortableTextBlock> | undefined
3920
- }
3921
- | {
3922
- type: 'notify.loading'
3923
- }
3924
- | {
3925
- type: 'notify.read only'
3926
- }
3927
- | {
3928
- type: 'notify.ready'
3929
- }
3930
- | {
3931
- type: 'notify.selection'
3932
- selection: EditorSelection
3933
- }
3934
- | {
3935
- type: 'notify.value changed'
3936
- value: Array<PortableTextBlock> | undefined
3937
- }
3938
- | {
3939
- type: 'notify.unset'
3940
- previousValue: Array<PortableTextBlock>
3941
- }
3942
1553
  | {
3943
1554
  type: 'dragstart'
3944
1555
  origin: Pick<EventPosition, 'selection'>
@@ -4022,14 +1633,6 @@ declare const editorMachine: StateMachine<
4022
1633
  type: 'update readOnly'
4023
1634
  readOnly: boolean
4024
1635
  }
4025
- | {
4026
- type: 'update schema'
4027
- schema: EditorSchema
4028
- }
4029
- | {
4030
- type: 'update key generator'
4031
- keyGenerator: () => string
4032
- }
4033
1636
  | {
4034
1637
  type: 'update maxBlocks'
4035
1638
  maxBlocks: number | undefined
@@ -4053,6 +1656,10 @@ declare const editorMachine: StateMachine<
4053
1656
  | {
4054
1657
  type: 'normalizing'
4055
1658
  }
1659
+ | {
1660
+ type: 'update selection'
1661
+ selection: EditorSelection
1662
+ }
4056
1663
  | {
4057
1664
  type: 'done normalizing'
4058
1665
  }
@@ -4070,62 +1677,6 @@ declare const editorMachine: StateMachine<
4070
1677
  preventDefault: () => void
4071
1678
  }
4072
1679
  }
4073
- | {
4074
- type: 'notify.patch'
4075
- patch: Patch
4076
- }
4077
- | {
4078
- type: 'notify.mutation'
4079
- patches: Array<Patch>
4080
- snapshot: Array<PortableTextBlock> | undefined
4081
- value: Array<PortableTextBlock> | undefined
4082
- }
4083
- | {
4084
- type: 'notify.blurred'
4085
- event: FocusEvent_2<HTMLDivElement, Element>
4086
- }
4087
- | {
4088
- type: 'notify.done loading'
4089
- }
4090
- | {
4091
- type: 'notify.editable'
4092
- }
4093
- | {
4094
- type: 'notify.error'
4095
- name: string
4096
- description: string
4097
- data: unknown
4098
- }
4099
- | {
4100
- type: 'notify.focused'
4101
- event: FocusEvent_2<HTMLDivElement, Element>
4102
- }
4103
- | {
4104
- type: 'notify.invalid value'
4105
- resolution: InvalidValueResolution | null
4106
- value: Array<PortableTextBlock> | undefined
4107
- }
4108
- | {
4109
- type: 'notify.loading'
4110
- }
4111
- | {
4112
- type: 'notify.read only'
4113
- }
4114
- | {
4115
- type: 'notify.ready'
4116
- }
4117
- | {
4118
- type: 'notify.selection'
4119
- selection: EditorSelection
4120
- }
4121
- | {
4122
- type: 'notify.value changed'
4123
- value: Array<PortableTextBlock> | undefined
4124
- }
4125
- | {
4126
- type: 'notify.unset'
4127
- previousValue: Array<PortableTextBlock>
4128
- }
4129
1680
  | {
4130
1681
  type: 'dragstart'
4131
1682
  origin: Pick<EventPosition, 'selection'>
@@ -4144,14 +1695,6 @@ declare const editorMachine: StateMachine<
4144
1695
  type: 'update readOnly'
4145
1696
  readOnly: boolean
4146
1697
  }
4147
- | {
4148
- type: 'update schema'
4149
- schema: EditorSchema
4150
- }
4151
- | {
4152
- type: 'update key generator'
4153
- keyGenerator: () => string
4154
- }
4155
1698
  | {
4156
1699
  type: 'update maxBlocks'
4157
1700
  maxBlocks: number | undefined
@@ -4175,6 +1718,10 @@ declare const editorMachine: StateMachine<
4175
1718
  | {
4176
1719
  type: 'normalizing'
4177
1720
  }
1721
+ | {
1722
+ type: 'update selection'
1723
+ selection: EditorSelection
1724
+ }
4178
1725
  | {
4179
1726
  type: 'done normalizing'
4180
1727
  }
@@ -4192,62 +1739,6 @@ declare const editorMachine: StateMachine<
4192
1739
  preventDefault: () => void
4193
1740
  }
4194
1741
  }
4195
- | {
4196
- type: 'notify.patch'
4197
- patch: Patch
4198
- }
4199
- | {
4200
- type: 'notify.mutation'
4201
- patches: Array<Patch>
4202
- snapshot: Array<PortableTextBlock> | undefined
4203
- value: Array<PortableTextBlock> | undefined
4204
- }
4205
- | {
4206
- type: 'notify.blurred'
4207
- event: FocusEvent_2<HTMLDivElement, Element>
4208
- }
4209
- | {
4210
- type: 'notify.done loading'
4211
- }
4212
- | {
4213
- type: 'notify.editable'
4214
- }
4215
- | {
4216
- type: 'notify.error'
4217
- name: string
4218
- description: string
4219
- data: unknown
4220
- }
4221
- | {
4222
- type: 'notify.focused'
4223
- event: FocusEvent_2<HTMLDivElement, Element>
4224
- }
4225
- | {
4226
- type: 'notify.invalid value'
4227
- resolution: InvalidValueResolution | null
4228
- value: Array<PortableTextBlock> | undefined
4229
- }
4230
- | {
4231
- type: 'notify.loading'
4232
- }
4233
- | {
4234
- type: 'notify.read only'
4235
- }
4236
- | {
4237
- type: 'notify.ready'
4238
- }
4239
- | {
4240
- type: 'notify.selection'
4241
- selection: EditorSelection
4242
- }
4243
- | {
4244
- type: 'notify.value changed'
4245
- value: Array<PortableTextBlock> | undefined
4246
- }
4247
- | {
4248
- type: 'notify.unset'
4249
- previousValue: Array<PortableTextBlock>
4250
- }
4251
1742
  | {
4252
1743
  type: 'dragstart'
4253
1744
  origin: Pick<EventPosition, 'selection'>
@@ -4286,14 +1777,6 @@ declare const editorMachine: StateMachine<
4286
1777
  type: 'update readOnly'
4287
1778
  readOnly: boolean
4288
1779
  }
4289
- | {
4290
- type: 'update schema'
4291
- schema: EditorSchema
4292
- }
4293
- | {
4294
- type: 'update key generator'
4295
- keyGenerator: () => string
4296
- }
4297
1780
  | {
4298
1781
  type: 'update maxBlocks'
4299
1782
  maxBlocks: number | undefined
@@ -4317,6 +1800,10 @@ declare const editorMachine: StateMachine<
4317
1800
  | {
4318
1801
  type: 'normalizing'
4319
1802
  }
1803
+ | {
1804
+ type: 'update selection'
1805
+ selection: EditorSelection
1806
+ }
4320
1807
  | {
4321
1808
  type: 'done normalizing'
4322
1809
  }
@@ -4334,62 +1821,6 @@ declare const editorMachine: StateMachine<
4334
1821
  preventDefault: () => void
4335
1822
  }
4336
1823
  }
4337
- | {
4338
- type: 'notify.patch'
4339
- patch: Patch
4340
- }
4341
- | {
4342
- type: 'notify.mutation'
4343
- patches: Array<Patch>
4344
- snapshot: Array<PortableTextBlock> | undefined
4345
- value: Array<PortableTextBlock> | undefined
4346
- }
4347
- | {
4348
- type: 'notify.blurred'
4349
- event: FocusEvent_2<HTMLDivElement, Element>
4350
- }
4351
- | {
4352
- type: 'notify.done loading'
4353
- }
4354
- | {
4355
- type: 'notify.editable'
4356
- }
4357
- | {
4358
- type: 'notify.error'
4359
- name: string
4360
- description: string
4361
- data: unknown
4362
- }
4363
- | {
4364
- type: 'notify.focused'
4365
- event: FocusEvent_2<HTMLDivElement, Element>
4366
- }
4367
- | {
4368
- type: 'notify.invalid value'
4369
- resolution: InvalidValueResolution | null
4370
- value: Array<PortableTextBlock> | undefined
4371
- }
4372
- | {
4373
- type: 'notify.loading'
4374
- }
4375
- | {
4376
- type: 'notify.read only'
4377
- }
4378
- | {
4379
- type: 'notify.ready'
4380
- }
4381
- | {
4382
- type: 'notify.selection'
4383
- selection: EditorSelection
4384
- }
4385
- | {
4386
- type: 'notify.value changed'
4387
- value: Array<PortableTextBlock> | undefined
4388
- }
4389
- | {
4390
- type: 'notify.unset'
4391
- previousValue: Array<PortableTextBlock>
4392
- }
4393
1824
  | {
4394
1825
  type: 'dragstart'
4395
1826
  origin: Pick<EventPosition, 'selection'>
@@ -4408,14 +1839,6 @@ declare const editorMachine: StateMachine<
4408
1839
  type: 'update readOnly'
4409
1840
  readOnly: boolean
4410
1841
  }
4411
- | {
4412
- type: 'update schema'
4413
- schema: EditorSchema
4414
- }
4415
- | {
4416
- type: 'update key generator'
4417
- keyGenerator: () => string
4418
- }
4419
1842
  | {
4420
1843
  type: 'update maxBlocks'
4421
1844
  maxBlocks: number | undefined
@@ -4439,6 +1862,10 @@ declare const editorMachine: StateMachine<
4439
1862
  | {
4440
1863
  type: 'normalizing'
4441
1864
  }
1865
+ | {
1866
+ type: 'update selection'
1867
+ selection: EditorSelection
1868
+ }
4442
1869
  | {
4443
1870
  type: 'done normalizing'
4444
1871
  }
@@ -4456,62 +1883,6 @@ declare const editorMachine: StateMachine<
4456
1883
  preventDefault: () => void
4457
1884
  }
4458
1885
  }
4459
- | {
4460
- type: 'notify.patch'
4461
- patch: Patch
4462
- }
4463
- | {
4464
- type: 'notify.mutation'
4465
- patches: Array<Patch>
4466
- snapshot: Array<PortableTextBlock> | undefined
4467
- value: Array<PortableTextBlock> | undefined
4468
- }
4469
- | {
4470
- type: 'notify.blurred'
4471
- event: FocusEvent_2<HTMLDivElement, Element>
4472
- }
4473
- | {
4474
- type: 'notify.done loading'
4475
- }
4476
- | {
4477
- type: 'notify.editable'
4478
- }
4479
- | {
4480
- type: 'notify.error'
4481
- name: string
4482
- description: string
4483
- data: unknown
4484
- }
4485
- | {
4486
- type: 'notify.focused'
4487
- event: FocusEvent_2<HTMLDivElement, Element>
4488
- }
4489
- | {
4490
- type: 'notify.invalid value'
4491
- resolution: InvalidValueResolution | null
4492
- value: Array<PortableTextBlock> | undefined
4493
- }
4494
- | {
4495
- type: 'notify.loading'
4496
- }
4497
- | {
4498
- type: 'notify.read only'
4499
- }
4500
- | {
4501
- type: 'notify.ready'
4502
- }
4503
- | {
4504
- type: 'notify.selection'
4505
- selection: EditorSelection
4506
- }
4507
- | {
4508
- type: 'notify.value changed'
4509
- value: Array<PortableTextBlock> | undefined
4510
- }
4511
- | {
4512
- type: 'notify.unset'
4513
- previousValue: Array<PortableTextBlock>
4514
- }
4515
1886
  | {
4516
1887
  type: 'dragstart'
4517
1888
  origin: Pick<EventPosition, 'selection'>
@@ -4612,14 +1983,6 @@ declare const editorMachine: StateMachine<
4612
1983
  type: 'update readOnly'
4613
1984
  readOnly: boolean
4614
1985
  }
4615
- | {
4616
- type: 'update schema'
4617
- schema: EditorSchema
4618
- }
4619
- | {
4620
- type: 'update key generator'
4621
- keyGenerator: () => string
4622
- }
4623
1986
  | {
4624
1987
  type: 'update maxBlocks'
4625
1988
  maxBlocks: number | undefined
@@ -4643,6 +2006,10 @@ declare const editorMachine: StateMachine<
4643
2006
  | {
4644
2007
  type: 'normalizing'
4645
2008
  }
2009
+ | {
2010
+ type: 'update selection'
2011
+ selection: EditorSelection
2012
+ }
4646
2013
  | {
4647
2014
  type: 'done normalizing'
4648
2015
  }
@@ -4660,62 +2027,6 @@ declare const editorMachine: StateMachine<
4660
2027
  preventDefault: () => void
4661
2028
  }
4662
2029
  }
4663
- | {
4664
- type: 'notify.patch'
4665
- patch: Patch
4666
- }
4667
- | {
4668
- type: 'notify.mutation'
4669
- patches: Array<Patch>
4670
- snapshot: Array<PortableTextBlock> | undefined
4671
- value: Array<PortableTextBlock> | undefined
4672
- }
4673
- | {
4674
- type: 'notify.blurred'
4675
- event: FocusEvent_2<HTMLDivElement, Element>
4676
- }
4677
- | {
4678
- type: 'notify.done loading'
4679
- }
4680
- | {
4681
- type: 'notify.editable'
4682
- }
4683
- | {
4684
- type: 'notify.error'
4685
- name: string
4686
- description: string
4687
- data: unknown
4688
- }
4689
- | {
4690
- type: 'notify.focused'
4691
- event: FocusEvent_2<HTMLDivElement, Element>
4692
- }
4693
- | {
4694
- type: 'notify.invalid value'
4695
- resolution: InvalidValueResolution | null
4696
- value: Array<PortableTextBlock> | undefined
4697
- }
4698
- | {
4699
- type: 'notify.loading'
4700
- }
4701
- | {
4702
- type: 'notify.read only'
4703
- }
4704
- | {
4705
- type: 'notify.ready'
4706
- }
4707
- | {
4708
- type: 'notify.selection'
4709
- selection: EditorSelection
4710
- }
4711
- | {
4712
- type: 'notify.value changed'
4713
- value: Array<PortableTextBlock> | undefined
4714
- }
4715
- | {
4716
- type: 'notify.unset'
4717
- previousValue: Array<PortableTextBlock>
4718
- }
4719
2030
  | {
4720
2031
  type: 'dragstart'
4721
2032
  origin: Pick<EventPosition, 'selection'>
@@ -4732,7 +2043,6 @@ declare const editorMachine: StateMachine<
4732
2043
  never,
4733
2044
  never,
4734
2045
  never,
4735
- | PatchEvent
4736
2046
  | InternalPatchEvent
4737
2047
  | MutationEvent
4738
2048
  | PatchesEvent
@@ -4746,12 +2056,6 @@ declare const editorMachine: StateMachine<
4746
2056
  | {
4747
2057
  type: 'editable'
4748
2058
  }
4749
- | {
4750
- type: 'error'
4751
- name: string
4752
- description: string
4753
- data: unknown
4754
- }
4755
2059
  | {
4756
2060
  type: 'focused'
4757
2061
  event: FocusEvent_2<HTMLDivElement, Element>
@@ -4778,7 +2082,6 @@ declare const editorMachine: StateMachine<
4778
2082
  type: 'value changed'
4779
2083
  value: Array<PortableTextBlock> | undefined
4780
2084
  }
4781
- | UnsetEvent
4782
2085
  >,
4783
2086
  ]
4784
2087
  }
@@ -5352,29 +2655,6 @@ declare type InternalPatchEvent = NamespaceEvent<PatchEvent, 'internal'> & {
5352
2655
  value: Array<PortableTextBlock>
5353
2656
  }
5354
2657
 
5355
- /**
5356
- * The editor has invalid data in the value that can be resolved by the user
5357
- * @beta */
5358
- declare type InvalidValueResolution = {
5359
- autoResolve?: boolean
5360
- patches: Patch[]
5361
- description: string
5362
- action: string
5363
- item: PortableTextBlock[] | PortableTextBlock | PortableTextChild | undefined
5364
- /**
5365
- * i18n keys for the description and action
5366
- *
5367
- * These are in addition to the description and action properties, to decouple the editor from
5368
- * the i18n system, and allow usage without it. The i18n keys take precedence over the
5369
- * description and action properties, if i18n framework is available.
5370
- */
5371
- i18n: {
5372
- description: `inputs.portable-text.invalid-value.${Lowercase<string>}.description`
5373
- action: `inputs.portable-text.invalid-value.${Lowercase<string>}.action`
5374
- values?: Record<string, string | number | string[]>
5375
- }
5376
- }
5377
-
5378
2658
  /**
5379
2659
  * @public
5380
2660
  */
@@ -5806,9 +3086,4 @@ declare type TextBlockWithOptionalKey = Omit<PortableTextTextBlock, '_key'> & {
5806
3086
  _key?: PortableTextTextBlock['_key']
5807
3087
  }
5808
3088
 
5809
- declare type UnsetEvent = {
5810
- type: 'unset'
5811
- previousValue: Array<PortableTextBlock>
5812
- }
5813
-
5814
3089
  export {}