@portabletext/editor 1.1.8 → 1.1.10
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.
- package/lib/index.d.mts +717 -229
- package/lib/index.d.ts +717 -229
- package/lib/index.esm.js +124 -54
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +124 -54
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +124 -54
- package/lib/index.mjs.map +1 -1
- package/package.json +6 -6
- package/src/editor/Editable.tsx +0 -13
- package/src/editor/behavior/behavior.actions.ts +17 -0
- package/src/editor/behavior/behavior.core.ts +8 -26
- package/src/editor/behavior/behavior.types.ts +20 -9
- package/src/editor/editor-machine.ts +33 -11
- package/src/editor/plugins/create-with-event-listeners.ts +60 -0
- package/src/editor/plugins/createWithInsertBreak.ts +4 -0
- package/src/editor/plugins/createWithPortableTextMarkModel.ts +12 -0
- package/src/editor/plugins/createWithUtils.ts +7 -1
- package/src/editor/plugins/index.ts +16 -12
- package/src/types/editor.ts +5 -1
package/lib/index.d.mts
CHANGED
|
@@ -39,6 +39,7 @@ import {
|
|
|
39
39
|
} from 'react'
|
|
40
40
|
import type {Observable, Subject} from 'rxjs'
|
|
41
41
|
import type {Descendant, Node as Node_2, Operation} from 'slate'
|
|
42
|
+
import {TextUnit} from 'slate'
|
|
42
43
|
import type {ReactEditor} from 'slate-react'
|
|
43
44
|
import type {DOMNode} from 'slate-react/dist/utils/dom'
|
|
44
45
|
import {
|
|
@@ -84,9 +85,11 @@ export declare type Behavior<
|
|
|
84
85
|
*/
|
|
85
86
|
export declare type BehaviorActionIntend =
|
|
86
87
|
| {
|
|
87
|
-
type:
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
[TBehaviorEvent in BehaviorEvent as TBehaviorEvent['type']]: Omit<
|
|
89
|
+
TBehaviorEvent,
|
|
90
|
+
'default'
|
|
91
|
+
>
|
|
92
|
+
}[BehaviorEvent['type']]
|
|
90
93
|
| {
|
|
91
94
|
type: 'insert text block'
|
|
92
95
|
decorators: Array<string>
|
|
@@ -115,14 +118,22 @@ export declare type BehaviorContext = {
|
|
|
115
118
|
*/
|
|
116
119
|
export declare type BehaviorEvent =
|
|
117
120
|
| {
|
|
118
|
-
type: '
|
|
119
|
-
|
|
120
|
-
|
|
121
|
+
type: 'delete backward'
|
|
122
|
+
unit: TextUnit
|
|
123
|
+
default: () => void
|
|
121
124
|
}
|
|
122
125
|
| {
|
|
123
|
-
type: '
|
|
124
|
-
|
|
125
|
-
|
|
126
|
+
type: 'insert soft break'
|
|
127
|
+
default: () => void
|
|
128
|
+
}
|
|
129
|
+
| {
|
|
130
|
+
type: 'insert break'
|
|
131
|
+
default: () => void
|
|
132
|
+
}
|
|
133
|
+
| {
|
|
134
|
+
type: 'insert text'
|
|
135
|
+
text: string
|
|
136
|
+
default: () => void
|
|
126
137
|
}
|
|
127
138
|
|
|
128
139
|
/**
|
|
@@ -359,10 +370,42 @@ export declare const editorMachine: StateMachine<
|
|
|
359
370
|
pendingEvents: Array<PatchEvent | MutationEvent_2>
|
|
360
371
|
schema: PortableTextMemberSchemaTypes
|
|
361
372
|
},
|
|
362
|
-
| (
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
373
|
+
| (Omit<
|
|
374
|
+
{
|
|
375
|
+
type: 'delete backward'
|
|
376
|
+
unit: TextUnit
|
|
377
|
+
default: () => void
|
|
378
|
+
},
|
|
379
|
+
'default'
|
|
380
|
+
> & {
|
|
381
|
+
editor: PortableTextSlateEditor
|
|
382
|
+
})
|
|
383
|
+
| (Omit<
|
|
384
|
+
{
|
|
385
|
+
type: 'insert soft break'
|
|
386
|
+
default: () => void
|
|
387
|
+
},
|
|
388
|
+
'default'
|
|
389
|
+
> & {
|
|
390
|
+
editor: PortableTextSlateEditor
|
|
391
|
+
})
|
|
392
|
+
| (Omit<
|
|
393
|
+
{
|
|
394
|
+
type: 'insert break'
|
|
395
|
+
default: () => void
|
|
396
|
+
},
|
|
397
|
+
'default'
|
|
398
|
+
> & {
|
|
399
|
+
editor: PortableTextSlateEditor
|
|
400
|
+
})
|
|
401
|
+
| (Omit<
|
|
402
|
+
{
|
|
403
|
+
type: 'insert text'
|
|
404
|
+
text: string
|
|
405
|
+
default: () => void
|
|
406
|
+
},
|
|
407
|
+
'default'
|
|
408
|
+
> & {
|
|
366
409
|
editor: PortableTextSlateEditor
|
|
367
410
|
})
|
|
368
411
|
| ({
|
|
@@ -384,16 +427,6 @@ export declare const editorMachine: StateMachine<
|
|
|
384
427
|
} & {
|
|
385
428
|
editor: PortableTextSlateEditor
|
|
386
429
|
})
|
|
387
|
-
| {
|
|
388
|
-
type: 'key down'
|
|
389
|
-
nativeEvent: KeyboardEvent
|
|
390
|
-
editor: PortableTextSlateEditor
|
|
391
|
-
}
|
|
392
|
-
| {
|
|
393
|
-
type: 'before insert text'
|
|
394
|
-
nativeEvent: InputEvent
|
|
395
|
-
editor: PortableTextSlateEditor
|
|
396
|
-
}
|
|
397
430
|
| PatchEvent
|
|
398
431
|
| MutationEvent_2
|
|
399
432
|
| {
|
|
@@ -402,6 +435,11 @@ export declare const editorMachine: StateMachine<
|
|
|
402
435
|
| {
|
|
403
436
|
type: 'done normalizing'
|
|
404
437
|
}
|
|
438
|
+
| {
|
|
439
|
+
type: 'behavior event'
|
|
440
|
+
behaviorEvent: BehaviorEvent
|
|
441
|
+
editor: PortableTextSlateEditor
|
|
442
|
+
}
|
|
405
443
|
| {
|
|
406
444
|
type: 'update schema'
|
|
407
445
|
schema: PortableTextMemberSchemaTypes
|
|
@@ -641,10 +679,42 @@ export declare const editorMachine: StateMachine<
|
|
|
641
679
|
pendingEvents: Array<PatchEvent | MutationEvent_2>
|
|
642
680
|
schema: PortableTextMemberSchemaTypes
|
|
643
681
|
},
|
|
644
|
-
| (
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
682
|
+
| (Omit<
|
|
683
|
+
{
|
|
684
|
+
type: 'delete backward'
|
|
685
|
+
unit: TextUnit
|
|
686
|
+
default: () => void
|
|
687
|
+
},
|
|
688
|
+
'default'
|
|
689
|
+
> & {
|
|
690
|
+
editor: PortableTextSlateEditor
|
|
691
|
+
})
|
|
692
|
+
| (Omit<
|
|
693
|
+
{
|
|
694
|
+
type: 'insert soft break'
|
|
695
|
+
default: () => void
|
|
696
|
+
},
|
|
697
|
+
'default'
|
|
698
|
+
> & {
|
|
699
|
+
editor: PortableTextSlateEditor
|
|
700
|
+
})
|
|
701
|
+
| (Omit<
|
|
702
|
+
{
|
|
703
|
+
type: 'insert break'
|
|
704
|
+
default: () => void
|
|
705
|
+
},
|
|
706
|
+
'default'
|
|
707
|
+
> & {
|
|
708
|
+
editor: PortableTextSlateEditor
|
|
709
|
+
})
|
|
710
|
+
| (Omit<
|
|
711
|
+
{
|
|
712
|
+
type: 'insert text'
|
|
713
|
+
text: string
|
|
714
|
+
default: () => void
|
|
715
|
+
},
|
|
716
|
+
'default'
|
|
717
|
+
> & {
|
|
648
718
|
editor: PortableTextSlateEditor
|
|
649
719
|
})
|
|
650
720
|
| ({
|
|
@@ -666,16 +736,6 @@ export declare const editorMachine: StateMachine<
|
|
|
666
736
|
} & {
|
|
667
737
|
editor: PortableTextSlateEditor
|
|
668
738
|
})
|
|
669
|
-
| {
|
|
670
|
-
type: 'key down'
|
|
671
|
-
nativeEvent: KeyboardEvent
|
|
672
|
-
editor: PortableTextSlateEditor
|
|
673
|
-
}
|
|
674
|
-
| {
|
|
675
|
-
type: 'before insert text'
|
|
676
|
-
nativeEvent: InputEvent
|
|
677
|
-
editor: PortableTextSlateEditor
|
|
678
|
-
}
|
|
679
739
|
| PatchEvent
|
|
680
740
|
| MutationEvent_2
|
|
681
741
|
| {
|
|
@@ -684,6 +744,11 @@ export declare const editorMachine: StateMachine<
|
|
|
684
744
|
| {
|
|
685
745
|
type: 'done normalizing'
|
|
686
746
|
}
|
|
747
|
+
| {
|
|
748
|
+
type: 'behavior event'
|
|
749
|
+
behaviorEvent: BehaviorEvent
|
|
750
|
+
editor: PortableTextSlateEditor
|
|
751
|
+
}
|
|
687
752
|
| {
|
|
688
753
|
type: 'update schema'
|
|
689
754
|
schema: PortableTextMemberSchemaTypes
|
|
@@ -741,10 +806,42 @@ export declare const editorMachine: StateMachine<
|
|
|
741
806
|
any,
|
|
742
807
|
any
|
|
743
808
|
>,
|
|
744
|
-
| (
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
809
|
+
| (Omit<
|
|
810
|
+
{
|
|
811
|
+
type: 'delete backward'
|
|
812
|
+
unit: TextUnit
|
|
813
|
+
default: () => void
|
|
814
|
+
},
|
|
815
|
+
'default'
|
|
816
|
+
> & {
|
|
817
|
+
editor: PortableTextSlateEditor
|
|
818
|
+
})
|
|
819
|
+
| (Omit<
|
|
820
|
+
{
|
|
821
|
+
type: 'insert soft break'
|
|
822
|
+
default: () => void
|
|
823
|
+
},
|
|
824
|
+
'default'
|
|
825
|
+
> & {
|
|
826
|
+
editor: PortableTextSlateEditor
|
|
827
|
+
})
|
|
828
|
+
| (Omit<
|
|
829
|
+
{
|
|
830
|
+
type: 'insert break'
|
|
831
|
+
default: () => void
|
|
832
|
+
},
|
|
833
|
+
'default'
|
|
834
|
+
> & {
|
|
835
|
+
editor: PortableTextSlateEditor
|
|
836
|
+
})
|
|
837
|
+
| (Omit<
|
|
838
|
+
{
|
|
839
|
+
type: 'insert text'
|
|
840
|
+
text: string
|
|
841
|
+
default: () => void
|
|
842
|
+
},
|
|
843
|
+
'default'
|
|
844
|
+
> & {
|
|
748
845
|
editor: PortableTextSlateEditor
|
|
749
846
|
})
|
|
750
847
|
| ({
|
|
@@ -766,16 +863,6 @@ export declare const editorMachine: StateMachine<
|
|
|
766
863
|
} & {
|
|
767
864
|
editor: PortableTextSlateEditor
|
|
768
865
|
})
|
|
769
|
-
| {
|
|
770
|
-
type: 'key down'
|
|
771
|
-
nativeEvent: KeyboardEvent
|
|
772
|
-
editor: PortableTextSlateEditor
|
|
773
|
-
}
|
|
774
|
-
| {
|
|
775
|
-
type: 'before insert text'
|
|
776
|
-
nativeEvent: InputEvent
|
|
777
|
-
editor: PortableTextSlateEditor
|
|
778
|
-
}
|
|
779
866
|
| PatchEvent
|
|
780
867
|
| MutationEvent_2
|
|
781
868
|
| {
|
|
@@ -784,6 +871,11 @@ export declare const editorMachine: StateMachine<
|
|
|
784
871
|
| {
|
|
785
872
|
type: 'done normalizing'
|
|
786
873
|
}
|
|
874
|
+
| {
|
|
875
|
+
type: 'behavior event'
|
|
876
|
+
behaviorEvent: BehaviorEvent
|
|
877
|
+
editor: PortableTextSlateEditor
|
|
878
|
+
}
|
|
787
879
|
| {
|
|
788
880
|
type: 'update schema'
|
|
789
881
|
schema: PortableTextMemberSchemaTypes
|
|
@@ -858,10 +950,42 @@ export declare const editorMachine: StateMachine<
|
|
|
858
950
|
{
|
|
859
951
|
type: 'ready'
|
|
860
952
|
},
|
|
861
|
-
| (
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
953
|
+
| (Omit<
|
|
954
|
+
{
|
|
955
|
+
type: 'delete backward'
|
|
956
|
+
unit: TextUnit
|
|
957
|
+
default: () => void
|
|
958
|
+
},
|
|
959
|
+
'default'
|
|
960
|
+
> & {
|
|
961
|
+
editor: PortableTextSlateEditor
|
|
962
|
+
})
|
|
963
|
+
| (Omit<
|
|
964
|
+
{
|
|
965
|
+
type: 'insert soft break'
|
|
966
|
+
default: () => void
|
|
967
|
+
},
|
|
968
|
+
'default'
|
|
969
|
+
> & {
|
|
970
|
+
editor: PortableTextSlateEditor
|
|
971
|
+
})
|
|
972
|
+
| (Omit<
|
|
973
|
+
{
|
|
974
|
+
type: 'insert break'
|
|
975
|
+
default: () => void
|
|
976
|
+
},
|
|
977
|
+
'default'
|
|
978
|
+
> & {
|
|
979
|
+
editor: PortableTextSlateEditor
|
|
980
|
+
})
|
|
981
|
+
| (Omit<
|
|
982
|
+
{
|
|
983
|
+
type: 'insert text'
|
|
984
|
+
text: string
|
|
985
|
+
default: () => void
|
|
986
|
+
},
|
|
987
|
+
'default'
|
|
988
|
+
> & {
|
|
865
989
|
editor: PortableTextSlateEditor
|
|
866
990
|
})
|
|
867
991
|
| ({
|
|
@@ -883,16 +1007,6 @@ export declare const editorMachine: StateMachine<
|
|
|
883
1007
|
} & {
|
|
884
1008
|
editor: PortableTextSlateEditor
|
|
885
1009
|
})
|
|
886
|
-
| {
|
|
887
|
-
type: 'key down'
|
|
888
|
-
nativeEvent: KeyboardEvent
|
|
889
|
-
editor: PortableTextSlateEditor
|
|
890
|
-
}
|
|
891
|
-
| {
|
|
892
|
-
type: 'before insert text'
|
|
893
|
-
nativeEvent: InputEvent
|
|
894
|
-
editor: PortableTextSlateEditor
|
|
895
|
-
}
|
|
896
1010
|
| PatchEvent
|
|
897
1011
|
| MutationEvent_2
|
|
898
1012
|
| {
|
|
@@ -901,6 +1015,11 @@ export declare const editorMachine: StateMachine<
|
|
|
901
1015
|
| {
|
|
902
1016
|
type: 'done normalizing'
|
|
903
1017
|
}
|
|
1018
|
+
| {
|
|
1019
|
+
type: 'behavior event'
|
|
1020
|
+
behaviorEvent: BehaviorEvent
|
|
1021
|
+
editor: PortableTextSlateEditor
|
|
1022
|
+
}
|
|
904
1023
|
| {
|
|
905
1024
|
type: 'update schema'
|
|
906
1025
|
schema: PortableTextMemberSchemaTypes
|
|
@@ -1018,10 +1137,42 @@ export declare const editorMachine: StateMachine<
|
|
|
1018
1137
|
type: 'unset'
|
|
1019
1138
|
previousValue: Array<PortableTextBlock>
|
|
1020
1139
|
},
|
|
1021
|
-
| (
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1140
|
+
| (Omit<
|
|
1141
|
+
{
|
|
1142
|
+
type: 'delete backward'
|
|
1143
|
+
unit: TextUnit
|
|
1144
|
+
default: () => void
|
|
1145
|
+
},
|
|
1146
|
+
'default'
|
|
1147
|
+
> & {
|
|
1148
|
+
editor: PortableTextSlateEditor
|
|
1149
|
+
})
|
|
1150
|
+
| (Omit<
|
|
1151
|
+
{
|
|
1152
|
+
type: 'insert soft break'
|
|
1153
|
+
default: () => void
|
|
1154
|
+
},
|
|
1155
|
+
'default'
|
|
1156
|
+
> & {
|
|
1157
|
+
editor: PortableTextSlateEditor
|
|
1158
|
+
})
|
|
1159
|
+
| (Omit<
|
|
1160
|
+
{
|
|
1161
|
+
type: 'insert break'
|
|
1162
|
+
default: () => void
|
|
1163
|
+
},
|
|
1164
|
+
'default'
|
|
1165
|
+
> & {
|
|
1166
|
+
editor: PortableTextSlateEditor
|
|
1167
|
+
})
|
|
1168
|
+
| (Omit<
|
|
1169
|
+
{
|
|
1170
|
+
type: 'insert text'
|
|
1171
|
+
text: string
|
|
1172
|
+
default: () => void
|
|
1173
|
+
},
|
|
1174
|
+
'default'
|
|
1175
|
+
> & {
|
|
1025
1176
|
editor: PortableTextSlateEditor
|
|
1026
1177
|
})
|
|
1027
1178
|
| ({
|
|
@@ -1043,16 +1194,6 @@ export declare const editorMachine: StateMachine<
|
|
|
1043
1194
|
} & {
|
|
1044
1195
|
editor: PortableTextSlateEditor
|
|
1045
1196
|
})
|
|
1046
|
-
| {
|
|
1047
|
-
type: 'key down'
|
|
1048
|
-
nativeEvent: KeyboardEvent
|
|
1049
|
-
editor: PortableTextSlateEditor
|
|
1050
|
-
}
|
|
1051
|
-
| {
|
|
1052
|
-
type: 'before insert text'
|
|
1053
|
-
nativeEvent: InputEvent
|
|
1054
|
-
editor: PortableTextSlateEditor
|
|
1055
|
-
}
|
|
1056
1197
|
| PatchEvent
|
|
1057
1198
|
| MutationEvent_2
|
|
1058
1199
|
| {
|
|
@@ -1061,6 +1202,11 @@ export declare const editorMachine: StateMachine<
|
|
|
1061
1202
|
| {
|
|
1062
1203
|
type: 'done normalizing'
|
|
1063
1204
|
}
|
|
1205
|
+
| {
|
|
1206
|
+
type: 'behavior event'
|
|
1207
|
+
behaviorEvent: BehaviorEvent
|
|
1208
|
+
editor: PortableTextSlateEditor
|
|
1209
|
+
}
|
|
1064
1210
|
| {
|
|
1065
1211
|
type: 'update schema'
|
|
1066
1212
|
schema: PortableTextMemberSchemaTypes
|
|
@@ -1178,10 +1324,42 @@ export declare const editorMachine: StateMachine<
|
|
|
1178
1324
|
type: 'value changed'
|
|
1179
1325
|
value: Array<PortableTextBlock> | undefined
|
|
1180
1326
|
},
|
|
1181
|
-
| (
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1327
|
+
| (Omit<
|
|
1328
|
+
{
|
|
1329
|
+
type: 'delete backward'
|
|
1330
|
+
unit: TextUnit
|
|
1331
|
+
default: () => void
|
|
1332
|
+
},
|
|
1333
|
+
'default'
|
|
1334
|
+
> & {
|
|
1335
|
+
editor: PortableTextSlateEditor
|
|
1336
|
+
})
|
|
1337
|
+
| (Omit<
|
|
1338
|
+
{
|
|
1339
|
+
type: 'insert soft break'
|
|
1340
|
+
default: () => void
|
|
1341
|
+
},
|
|
1342
|
+
'default'
|
|
1343
|
+
> & {
|
|
1344
|
+
editor: PortableTextSlateEditor
|
|
1345
|
+
})
|
|
1346
|
+
| (Omit<
|
|
1347
|
+
{
|
|
1348
|
+
type: 'insert break'
|
|
1349
|
+
default: () => void
|
|
1350
|
+
},
|
|
1351
|
+
'default'
|
|
1352
|
+
> & {
|
|
1353
|
+
editor: PortableTextSlateEditor
|
|
1354
|
+
})
|
|
1355
|
+
| (Omit<
|
|
1356
|
+
{
|
|
1357
|
+
type: 'insert text'
|
|
1358
|
+
text: string
|
|
1359
|
+
default: () => void
|
|
1360
|
+
},
|
|
1361
|
+
'default'
|
|
1362
|
+
> & {
|
|
1185
1363
|
editor: PortableTextSlateEditor
|
|
1186
1364
|
})
|
|
1187
1365
|
| ({
|
|
@@ -1203,16 +1381,6 @@ export declare const editorMachine: StateMachine<
|
|
|
1203
1381
|
} & {
|
|
1204
1382
|
editor: PortableTextSlateEditor
|
|
1205
1383
|
})
|
|
1206
|
-
| {
|
|
1207
|
-
type: 'key down'
|
|
1208
|
-
nativeEvent: KeyboardEvent
|
|
1209
|
-
editor: PortableTextSlateEditor
|
|
1210
|
-
}
|
|
1211
|
-
| {
|
|
1212
|
-
type: 'before insert text'
|
|
1213
|
-
nativeEvent: InputEvent
|
|
1214
|
-
editor: PortableTextSlateEditor
|
|
1215
|
-
}
|
|
1216
1384
|
| PatchEvent
|
|
1217
1385
|
| MutationEvent_2
|
|
1218
1386
|
| {
|
|
@@ -1221,6 +1389,11 @@ export declare const editorMachine: StateMachine<
|
|
|
1221
1389
|
| {
|
|
1222
1390
|
type: 'done normalizing'
|
|
1223
1391
|
}
|
|
1392
|
+
| {
|
|
1393
|
+
type: 'behavior event'
|
|
1394
|
+
behaviorEvent: BehaviorEvent
|
|
1395
|
+
editor: PortableTextSlateEditor
|
|
1396
|
+
}
|
|
1224
1397
|
| {
|
|
1225
1398
|
type: 'update schema'
|
|
1226
1399
|
schema: PortableTextMemberSchemaTypes
|
|
@@ -1339,10 +1512,42 @@ export declare const editorMachine: StateMachine<
|
|
|
1339
1512
|
resolution: InvalidValueResolution | null
|
|
1340
1513
|
value: Array<PortableTextBlock> | undefined
|
|
1341
1514
|
},
|
|
1342
|
-
| (
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1515
|
+
| (Omit<
|
|
1516
|
+
{
|
|
1517
|
+
type: 'delete backward'
|
|
1518
|
+
unit: TextUnit
|
|
1519
|
+
default: () => void
|
|
1520
|
+
},
|
|
1521
|
+
'default'
|
|
1522
|
+
> & {
|
|
1523
|
+
editor: PortableTextSlateEditor
|
|
1524
|
+
})
|
|
1525
|
+
| (Omit<
|
|
1526
|
+
{
|
|
1527
|
+
type: 'insert soft break'
|
|
1528
|
+
default: () => void
|
|
1529
|
+
},
|
|
1530
|
+
'default'
|
|
1531
|
+
> & {
|
|
1532
|
+
editor: PortableTextSlateEditor
|
|
1533
|
+
})
|
|
1534
|
+
| (Omit<
|
|
1535
|
+
{
|
|
1536
|
+
type: 'insert break'
|
|
1537
|
+
default: () => void
|
|
1538
|
+
},
|
|
1539
|
+
'default'
|
|
1540
|
+
> & {
|
|
1541
|
+
editor: PortableTextSlateEditor
|
|
1542
|
+
})
|
|
1543
|
+
| (Omit<
|
|
1544
|
+
{
|
|
1545
|
+
type: 'insert text'
|
|
1546
|
+
text: string
|
|
1547
|
+
default: () => void
|
|
1548
|
+
},
|
|
1549
|
+
'default'
|
|
1550
|
+
> & {
|
|
1346
1551
|
editor: PortableTextSlateEditor
|
|
1347
1552
|
})
|
|
1348
1553
|
| ({
|
|
@@ -1364,16 +1569,6 @@ export declare const editorMachine: StateMachine<
|
|
|
1364
1569
|
} & {
|
|
1365
1570
|
editor: PortableTextSlateEditor
|
|
1366
1571
|
})
|
|
1367
|
-
| {
|
|
1368
|
-
type: 'key down'
|
|
1369
|
-
nativeEvent: KeyboardEvent
|
|
1370
|
-
editor: PortableTextSlateEditor
|
|
1371
|
-
}
|
|
1372
|
-
| {
|
|
1373
|
-
type: 'before insert text'
|
|
1374
|
-
nativeEvent: InputEvent
|
|
1375
|
-
editor: PortableTextSlateEditor
|
|
1376
|
-
}
|
|
1377
1572
|
| PatchEvent
|
|
1378
1573
|
| MutationEvent_2
|
|
1379
1574
|
| {
|
|
@@ -1382,6 +1577,11 @@ export declare const editorMachine: StateMachine<
|
|
|
1382
1577
|
| {
|
|
1383
1578
|
type: 'done normalizing'
|
|
1384
1579
|
}
|
|
1580
|
+
| {
|
|
1581
|
+
type: 'behavior event'
|
|
1582
|
+
behaviorEvent: BehaviorEvent
|
|
1583
|
+
editor: PortableTextSlateEditor
|
|
1584
|
+
}
|
|
1385
1585
|
| {
|
|
1386
1586
|
type: 'update schema'
|
|
1387
1587
|
schema: PortableTextMemberSchemaTypes
|
|
@@ -1501,10 +1701,42 @@ export declare const editorMachine: StateMachine<
|
|
|
1501
1701
|
description: string
|
|
1502
1702
|
data: unknown
|
|
1503
1703
|
},
|
|
1504
|
-
| (
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1704
|
+
| (Omit<
|
|
1705
|
+
{
|
|
1706
|
+
type: 'delete backward'
|
|
1707
|
+
unit: TextUnit
|
|
1708
|
+
default: () => void
|
|
1709
|
+
},
|
|
1710
|
+
'default'
|
|
1711
|
+
> & {
|
|
1712
|
+
editor: PortableTextSlateEditor
|
|
1713
|
+
})
|
|
1714
|
+
| (Omit<
|
|
1715
|
+
{
|
|
1716
|
+
type: 'insert soft break'
|
|
1717
|
+
default: () => void
|
|
1718
|
+
},
|
|
1719
|
+
'default'
|
|
1720
|
+
> & {
|
|
1721
|
+
editor: PortableTextSlateEditor
|
|
1722
|
+
})
|
|
1723
|
+
| (Omit<
|
|
1724
|
+
{
|
|
1725
|
+
type: 'insert break'
|
|
1726
|
+
default: () => void
|
|
1727
|
+
},
|
|
1728
|
+
'default'
|
|
1729
|
+
> & {
|
|
1730
|
+
editor: PortableTextSlateEditor
|
|
1731
|
+
})
|
|
1732
|
+
| (Omit<
|
|
1733
|
+
{
|
|
1734
|
+
type: 'insert text'
|
|
1735
|
+
text: string
|
|
1736
|
+
default: () => void
|
|
1737
|
+
},
|
|
1738
|
+
'default'
|
|
1739
|
+
> & {
|
|
1508
1740
|
editor: PortableTextSlateEditor
|
|
1509
1741
|
})
|
|
1510
1742
|
| ({
|
|
@@ -1526,16 +1758,6 @@ export declare const editorMachine: StateMachine<
|
|
|
1526
1758
|
} & {
|
|
1527
1759
|
editor: PortableTextSlateEditor
|
|
1528
1760
|
})
|
|
1529
|
-
| {
|
|
1530
|
-
type: 'key down'
|
|
1531
|
-
nativeEvent: KeyboardEvent
|
|
1532
|
-
editor: PortableTextSlateEditor
|
|
1533
|
-
}
|
|
1534
|
-
| {
|
|
1535
|
-
type: 'before insert text'
|
|
1536
|
-
nativeEvent: InputEvent
|
|
1537
|
-
editor: PortableTextSlateEditor
|
|
1538
|
-
}
|
|
1539
1761
|
| PatchEvent
|
|
1540
1762
|
| MutationEvent_2
|
|
1541
1763
|
| {
|
|
@@ -1544,6 +1766,11 @@ export declare const editorMachine: StateMachine<
|
|
|
1544
1766
|
| {
|
|
1545
1767
|
type: 'done normalizing'
|
|
1546
1768
|
}
|
|
1769
|
+
| {
|
|
1770
|
+
type: 'behavior event'
|
|
1771
|
+
behaviorEvent: BehaviorEvent
|
|
1772
|
+
editor: PortableTextSlateEditor
|
|
1773
|
+
}
|
|
1547
1774
|
| {
|
|
1548
1775
|
type: 'update schema'
|
|
1549
1776
|
schema: PortableTextMemberSchemaTypes
|
|
@@ -1661,10 +1888,42 @@ export declare const editorMachine: StateMachine<
|
|
|
1661
1888
|
type: 'selection'
|
|
1662
1889
|
selection: EditorSelection
|
|
1663
1890
|
},
|
|
1664
|
-
| (
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1891
|
+
| (Omit<
|
|
1892
|
+
{
|
|
1893
|
+
type: 'delete backward'
|
|
1894
|
+
unit: TextUnit
|
|
1895
|
+
default: () => void
|
|
1896
|
+
},
|
|
1897
|
+
'default'
|
|
1898
|
+
> & {
|
|
1899
|
+
editor: PortableTextSlateEditor
|
|
1900
|
+
})
|
|
1901
|
+
| (Omit<
|
|
1902
|
+
{
|
|
1903
|
+
type: 'insert soft break'
|
|
1904
|
+
default: () => void
|
|
1905
|
+
},
|
|
1906
|
+
'default'
|
|
1907
|
+
> & {
|
|
1908
|
+
editor: PortableTextSlateEditor
|
|
1909
|
+
})
|
|
1910
|
+
| (Omit<
|
|
1911
|
+
{
|
|
1912
|
+
type: 'insert break'
|
|
1913
|
+
default: () => void
|
|
1914
|
+
},
|
|
1915
|
+
'default'
|
|
1916
|
+
> & {
|
|
1917
|
+
editor: PortableTextSlateEditor
|
|
1918
|
+
})
|
|
1919
|
+
| (Omit<
|
|
1920
|
+
{
|
|
1921
|
+
type: 'insert text'
|
|
1922
|
+
text: string
|
|
1923
|
+
default: () => void
|
|
1924
|
+
},
|
|
1925
|
+
'default'
|
|
1926
|
+
> & {
|
|
1668
1927
|
editor: PortableTextSlateEditor
|
|
1669
1928
|
})
|
|
1670
1929
|
| ({
|
|
@@ -1686,16 +1945,6 @@ export declare const editorMachine: StateMachine<
|
|
|
1686
1945
|
} & {
|
|
1687
1946
|
editor: PortableTextSlateEditor
|
|
1688
1947
|
})
|
|
1689
|
-
| {
|
|
1690
|
-
type: 'key down'
|
|
1691
|
-
nativeEvent: KeyboardEvent
|
|
1692
|
-
editor: PortableTextSlateEditor
|
|
1693
|
-
}
|
|
1694
|
-
| {
|
|
1695
|
-
type: 'before insert text'
|
|
1696
|
-
nativeEvent: InputEvent
|
|
1697
|
-
editor: PortableTextSlateEditor
|
|
1698
|
-
}
|
|
1699
1948
|
| PatchEvent
|
|
1700
1949
|
| MutationEvent_2
|
|
1701
1950
|
| {
|
|
@@ -1704,6 +1953,11 @@ export declare const editorMachine: StateMachine<
|
|
|
1704
1953
|
| {
|
|
1705
1954
|
type: 'done normalizing'
|
|
1706
1955
|
}
|
|
1956
|
+
| {
|
|
1957
|
+
type: 'behavior event'
|
|
1958
|
+
behaviorEvent: BehaviorEvent
|
|
1959
|
+
editor: PortableTextSlateEditor
|
|
1960
|
+
}
|
|
1707
1961
|
| {
|
|
1708
1962
|
type: 'update schema'
|
|
1709
1963
|
schema: PortableTextMemberSchemaTypes
|
|
@@ -1821,10 +2075,42 @@ export declare const editorMachine: StateMachine<
|
|
|
1821
2075
|
type: 'blur'
|
|
1822
2076
|
event: FocusEvent_2<HTMLDivElement, Element>
|
|
1823
2077
|
},
|
|
1824
|
-
| (
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
2078
|
+
| (Omit<
|
|
2079
|
+
{
|
|
2080
|
+
type: 'delete backward'
|
|
2081
|
+
unit: TextUnit
|
|
2082
|
+
default: () => void
|
|
2083
|
+
},
|
|
2084
|
+
'default'
|
|
2085
|
+
> & {
|
|
2086
|
+
editor: PortableTextSlateEditor
|
|
2087
|
+
})
|
|
2088
|
+
| (Omit<
|
|
2089
|
+
{
|
|
2090
|
+
type: 'insert soft break'
|
|
2091
|
+
default: () => void
|
|
2092
|
+
},
|
|
2093
|
+
'default'
|
|
2094
|
+
> & {
|
|
2095
|
+
editor: PortableTextSlateEditor
|
|
2096
|
+
})
|
|
2097
|
+
| (Omit<
|
|
2098
|
+
{
|
|
2099
|
+
type: 'insert break'
|
|
2100
|
+
default: () => void
|
|
2101
|
+
},
|
|
2102
|
+
'default'
|
|
2103
|
+
> & {
|
|
2104
|
+
editor: PortableTextSlateEditor
|
|
2105
|
+
})
|
|
2106
|
+
| (Omit<
|
|
2107
|
+
{
|
|
2108
|
+
type: 'insert text'
|
|
2109
|
+
text: string
|
|
2110
|
+
default: () => void
|
|
2111
|
+
},
|
|
2112
|
+
'default'
|
|
2113
|
+
> & {
|
|
1828
2114
|
editor: PortableTextSlateEditor
|
|
1829
2115
|
})
|
|
1830
2116
|
| ({
|
|
@@ -1846,16 +2132,6 @@ export declare const editorMachine: StateMachine<
|
|
|
1846
2132
|
} & {
|
|
1847
2133
|
editor: PortableTextSlateEditor
|
|
1848
2134
|
})
|
|
1849
|
-
| {
|
|
1850
|
-
type: 'key down'
|
|
1851
|
-
nativeEvent: KeyboardEvent
|
|
1852
|
-
editor: PortableTextSlateEditor
|
|
1853
|
-
}
|
|
1854
|
-
| {
|
|
1855
|
-
type: 'before insert text'
|
|
1856
|
-
nativeEvent: InputEvent
|
|
1857
|
-
editor: PortableTextSlateEditor
|
|
1858
|
-
}
|
|
1859
2135
|
| PatchEvent
|
|
1860
2136
|
| MutationEvent_2
|
|
1861
2137
|
| {
|
|
@@ -1864,6 +2140,11 @@ export declare const editorMachine: StateMachine<
|
|
|
1864
2140
|
| {
|
|
1865
2141
|
type: 'done normalizing'
|
|
1866
2142
|
}
|
|
2143
|
+
| {
|
|
2144
|
+
type: 'behavior event'
|
|
2145
|
+
behaviorEvent: BehaviorEvent
|
|
2146
|
+
editor: PortableTextSlateEditor
|
|
2147
|
+
}
|
|
1867
2148
|
| {
|
|
1868
2149
|
type: 'update schema'
|
|
1869
2150
|
schema: PortableTextMemberSchemaTypes
|
|
@@ -1981,10 +2262,42 @@ export declare const editorMachine: StateMachine<
|
|
|
1981
2262
|
type: 'focus'
|
|
1982
2263
|
event: FocusEvent_2<HTMLDivElement, Element>
|
|
1983
2264
|
},
|
|
1984
|
-
| (
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
2265
|
+
| (Omit<
|
|
2266
|
+
{
|
|
2267
|
+
type: 'delete backward'
|
|
2268
|
+
unit: TextUnit
|
|
2269
|
+
default: () => void
|
|
2270
|
+
},
|
|
2271
|
+
'default'
|
|
2272
|
+
> & {
|
|
2273
|
+
editor: PortableTextSlateEditor
|
|
2274
|
+
})
|
|
2275
|
+
| (Omit<
|
|
2276
|
+
{
|
|
2277
|
+
type: 'insert soft break'
|
|
2278
|
+
default: () => void
|
|
2279
|
+
},
|
|
2280
|
+
'default'
|
|
2281
|
+
> & {
|
|
2282
|
+
editor: PortableTextSlateEditor
|
|
2283
|
+
})
|
|
2284
|
+
| (Omit<
|
|
2285
|
+
{
|
|
2286
|
+
type: 'insert break'
|
|
2287
|
+
default: () => void
|
|
2288
|
+
},
|
|
2289
|
+
'default'
|
|
2290
|
+
> & {
|
|
2291
|
+
editor: PortableTextSlateEditor
|
|
2292
|
+
})
|
|
2293
|
+
| (Omit<
|
|
2294
|
+
{
|
|
2295
|
+
type: 'insert text'
|
|
2296
|
+
text: string
|
|
2297
|
+
default: () => void
|
|
2298
|
+
},
|
|
2299
|
+
'default'
|
|
2300
|
+
> & {
|
|
1988
2301
|
editor: PortableTextSlateEditor
|
|
1989
2302
|
})
|
|
1990
2303
|
| ({
|
|
@@ -2006,16 +2319,6 @@ export declare const editorMachine: StateMachine<
|
|
|
2006
2319
|
} & {
|
|
2007
2320
|
editor: PortableTextSlateEditor
|
|
2008
2321
|
})
|
|
2009
|
-
| {
|
|
2010
|
-
type: 'key down'
|
|
2011
|
-
nativeEvent: KeyboardEvent
|
|
2012
|
-
editor: PortableTextSlateEditor
|
|
2013
|
-
}
|
|
2014
|
-
| {
|
|
2015
|
-
type: 'before insert text'
|
|
2016
|
-
nativeEvent: InputEvent
|
|
2017
|
-
editor: PortableTextSlateEditor
|
|
2018
|
-
}
|
|
2019
2322
|
| PatchEvent
|
|
2020
2323
|
| MutationEvent_2
|
|
2021
2324
|
| {
|
|
@@ -2024,6 +2327,11 @@ export declare const editorMachine: StateMachine<
|
|
|
2024
2327
|
| {
|
|
2025
2328
|
type: 'done normalizing'
|
|
2026
2329
|
}
|
|
2330
|
+
| {
|
|
2331
|
+
type: 'behavior event'
|
|
2332
|
+
behaviorEvent: BehaviorEvent
|
|
2333
|
+
editor: PortableTextSlateEditor
|
|
2334
|
+
}
|
|
2027
2335
|
| {
|
|
2028
2336
|
type: 'update schema'
|
|
2029
2337
|
schema: PortableTextMemberSchemaTypes
|
|
@@ -2140,10 +2448,42 @@ export declare const editorMachine: StateMachine<
|
|
|
2140
2448
|
{
|
|
2141
2449
|
type: 'online'
|
|
2142
2450
|
},
|
|
2143
|
-
| (
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2451
|
+
| (Omit<
|
|
2452
|
+
{
|
|
2453
|
+
type: 'delete backward'
|
|
2454
|
+
unit: TextUnit
|
|
2455
|
+
default: () => void
|
|
2456
|
+
},
|
|
2457
|
+
'default'
|
|
2458
|
+
> & {
|
|
2459
|
+
editor: PortableTextSlateEditor
|
|
2460
|
+
})
|
|
2461
|
+
| (Omit<
|
|
2462
|
+
{
|
|
2463
|
+
type: 'insert soft break'
|
|
2464
|
+
default: () => void
|
|
2465
|
+
},
|
|
2466
|
+
'default'
|
|
2467
|
+
> & {
|
|
2468
|
+
editor: PortableTextSlateEditor
|
|
2469
|
+
})
|
|
2470
|
+
| (Omit<
|
|
2471
|
+
{
|
|
2472
|
+
type: 'insert break'
|
|
2473
|
+
default: () => void
|
|
2474
|
+
},
|
|
2475
|
+
'default'
|
|
2476
|
+
> & {
|
|
2477
|
+
editor: PortableTextSlateEditor
|
|
2478
|
+
})
|
|
2479
|
+
| (Omit<
|
|
2480
|
+
{
|
|
2481
|
+
type: 'insert text'
|
|
2482
|
+
text: string
|
|
2483
|
+
default: () => void
|
|
2484
|
+
},
|
|
2485
|
+
'default'
|
|
2486
|
+
> & {
|
|
2147
2487
|
editor: PortableTextSlateEditor
|
|
2148
2488
|
})
|
|
2149
2489
|
| ({
|
|
@@ -2165,16 +2505,6 @@ export declare const editorMachine: StateMachine<
|
|
|
2165
2505
|
} & {
|
|
2166
2506
|
editor: PortableTextSlateEditor
|
|
2167
2507
|
})
|
|
2168
|
-
| {
|
|
2169
|
-
type: 'key down'
|
|
2170
|
-
nativeEvent: KeyboardEvent
|
|
2171
|
-
editor: PortableTextSlateEditor
|
|
2172
|
-
}
|
|
2173
|
-
| {
|
|
2174
|
-
type: 'before insert text'
|
|
2175
|
-
nativeEvent: InputEvent
|
|
2176
|
-
editor: PortableTextSlateEditor
|
|
2177
|
-
}
|
|
2178
2508
|
| PatchEvent
|
|
2179
2509
|
| MutationEvent_2
|
|
2180
2510
|
| {
|
|
@@ -2183,6 +2513,11 @@ export declare const editorMachine: StateMachine<
|
|
|
2183
2513
|
| {
|
|
2184
2514
|
type: 'done normalizing'
|
|
2185
2515
|
}
|
|
2516
|
+
| {
|
|
2517
|
+
type: 'behavior event'
|
|
2518
|
+
behaviorEvent: BehaviorEvent
|
|
2519
|
+
editor: PortableTextSlateEditor
|
|
2520
|
+
}
|
|
2186
2521
|
| {
|
|
2187
2522
|
type: 'update schema'
|
|
2188
2523
|
schema: PortableTextMemberSchemaTypes
|
|
@@ -2299,10 +2634,42 @@ export declare const editorMachine: StateMachine<
|
|
|
2299
2634
|
{
|
|
2300
2635
|
type: 'offline'
|
|
2301
2636
|
},
|
|
2302
|
-
| (
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2637
|
+
| (Omit<
|
|
2638
|
+
{
|
|
2639
|
+
type: 'delete backward'
|
|
2640
|
+
unit: TextUnit
|
|
2641
|
+
default: () => void
|
|
2642
|
+
},
|
|
2643
|
+
'default'
|
|
2644
|
+
> & {
|
|
2645
|
+
editor: PortableTextSlateEditor
|
|
2646
|
+
})
|
|
2647
|
+
| (Omit<
|
|
2648
|
+
{
|
|
2649
|
+
type: 'insert soft break'
|
|
2650
|
+
default: () => void
|
|
2651
|
+
},
|
|
2652
|
+
'default'
|
|
2653
|
+
> & {
|
|
2654
|
+
editor: PortableTextSlateEditor
|
|
2655
|
+
})
|
|
2656
|
+
| (Omit<
|
|
2657
|
+
{
|
|
2658
|
+
type: 'insert break'
|
|
2659
|
+
default: () => void
|
|
2660
|
+
},
|
|
2661
|
+
'default'
|
|
2662
|
+
> & {
|
|
2663
|
+
editor: PortableTextSlateEditor
|
|
2664
|
+
})
|
|
2665
|
+
| (Omit<
|
|
2666
|
+
{
|
|
2667
|
+
type: 'insert text'
|
|
2668
|
+
text: string
|
|
2669
|
+
default: () => void
|
|
2670
|
+
},
|
|
2671
|
+
'default'
|
|
2672
|
+
> & {
|
|
2306
2673
|
editor: PortableTextSlateEditor
|
|
2307
2674
|
})
|
|
2308
2675
|
| ({
|
|
@@ -2324,16 +2691,6 @@ export declare const editorMachine: StateMachine<
|
|
|
2324
2691
|
} & {
|
|
2325
2692
|
editor: PortableTextSlateEditor
|
|
2326
2693
|
})
|
|
2327
|
-
| {
|
|
2328
|
-
type: 'key down'
|
|
2329
|
-
nativeEvent: KeyboardEvent
|
|
2330
|
-
editor: PortableTextSlateEditor
|
|
2331
|
-
}
|
|
2332
|
-
| {
|
|
2333
|
-
type: 'before insert text'
|
|
2334
|
-
nativeEvent: InputEvent
|
|
2335
|
-
editor: PortableTextSlateEditor
|
|
2336
|
-
}
|
|
2337
2694
|
| PatchEvent
|
|
2338
2695
|
| MutationEvent_2
|
|
2339
2696
|
| {
|
|
@@ -2342,6 +2699,11 @@ export declare const editorMachine: StateMachine<
|
|
|
2342
2699
|
| {
|
|
2343
2700
|
type: 'done normalizing'
|
|
2344
2701
|
}
|
|
2702
|
+
| {
|
|
2703
|
+
type: 'behavior event'
|
|
2704
|
+
behaviorEvent: BehaviorEvent
|
|
2705
|
+
editor: PortableTextSlateEditor
|
|
2706
|
+
}
|
|
2345
2707
|
| {
|
|
2346
2708
|
type: 'update schema'
|
|
2347
2709
|
schema: PortableTextMemberSchemaTypes
|
|
@@ -2458,10 +2820,42 @@ export declare const editorMachine: StateMachine<
|
|
|
2458
2820
|
{
|
|
2459
2821
|
type: 'loading'
|
|
2460
2822
|
},
|
|
2461
|
-
| (
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2823
|
+
| (Omit<
|
|
2824
|
+
{
|
|
2825
|
+
type: 'delete backward'
|
|
2826
|
+
unit: TextUnit
|
|
2827
|
+
default: () => void
|
|
2828
|
+
},
|
|
2829
|
+
'default'
|
|
2830
|
+
> & {
|
|
2831
|
+
editor: PortableTextSlateEditor
|
|
2832
|
+
})
|
|
2833
|
+
| (Omit<
|
|
2834
|
+
{
|
|
2835
|
+
type: 'insert soft break'
|
|
2836
|
+
default: () => void
|
|
2837
|
+
},
|
|
2838
|
+
'default'
|
|
2839
|
+
> & {
|
|
2840
|
+
editor: PortableTextSlateEditor
|
|
2841
|
+
})
|
|
2842
|
+
| (Omit<
|
|
2843
|
+
{
|
|
2844
|
+
type: 'insert break'
|
|
2845
|
+
default: () => void
|
|
2846
|
+
},
|
|
2847
|
+
'default'
|
|
2848
|
+
> & {
|
|
2849
|
+
editor: PortableTextSlateEditor
|
|
2850
|
+
})
|
|
2851
|
+
| (Omit<
|
|
2852
|
+
{
|
|
2853
|
+
type: 'insert text'
|
|
2854
|
+
text: string
|
|
2855
|
+
default: () => void
|
|
2856
|
+
},
|
|
2857
|
+
'default'
|
|
2858
|
+
> & {
|
|
2465
2859
|
editor: PortableTextSlateEditor
|
|
2466
2860
|
})
|
|
2467
2861
|
| ({
|
|
@@ -2483,16 +2877,6 @@ export declare const editorMachine: StateMachine<
|
|
|
2483
2877
|
} & {
|
|
2484
2878
|
editor: PortableTextSlateEditor
|
|
2485
2879
|
})
|
|
2486
|
-
| {
|
|
2487
|
-
type: 'key down'
|
|
2488
|
-
nativeEvent: KeyboardEvent
|
|
2489
|
-
editor: PortableTextSlateEditor
|
|
2490
|
-
}
|
|
2491
|
-
| {
|
|
2492
|
-
type: 'before insert text'
|
|
2493
|
-
nativeEvent: InputEvent
|
|
2494
|
-
editor: PortableTextSlateEditor
|
|
2495
|
-
}
|
|
2496
2880
|
| PatchEvent
|
|
2497
2881
|
| MutationEvent_2
|
|
2498
2882
|
| {
|
|
@@ -2501,6 +2885,11 @@ export declare const editorMachine: StateMachine<
|
|
|
2501
2885
|
| {
|
|
2502
2886
|
type: 'done normalizing'
|
|
2503
2887
|
}
|
|
2888
|
+
| {
|
|
2889
|
+
type: 'behavior event'
|
|
2890
|
+
behaviorEvent: BehaviorEvent
|
|
2891
|
+
editor: PortableTextSlateEditor
|
|
2892
|
+
}
|
|
2504
2893
|
| {
|
|
2505
2894
|
type: 'update schema'
|
|
2506
2895
|
schema: PortableTextMemberSchemaTypes
|
|
@@ -2617,10 +3006,42 @@ export declare const editorMachine: StateMachine<
|
|
|
2617
3006
|
{
|
|
2618
3007
|
type: 'done loading'
|
|
2619
3008
|
},
|
|
2620
|
-
| (
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
3009
|
+
| (Omit<
|
|
3010
|
+
{
|
|
3011
|
+
type: 'delete backward'
|
|
3012
|
+
unit: TextUnit
|
|
3013
|
+
default: () => void
|
|
3014
|
+
},
|
|
3015
|
+
'default'
|
|
3016
|
+
> & {
|
|
3017
|
+
editor: PortableTextSlateEditor
|
|
3018
|
+
})
|
|
3019
|
+
| (Omit<
|
|
3020
|
+
{
|
|
3021
|
+
type: 'insert soft break'
|
|
3022
|
+
default: () => void
|
|
3023
|
+
},
|
|
3024
|
+
'default'
|
|
3025
|
+
> & {
|
|
3026
|
+
editor: PortableTextSlateEditor
|
|
3027
|
+
})
|
|
3028
|
+
| (Omit<
|
|
3029
|
+
{
|
|
3030
|
+
type: 'insert break'
|
|
3031
|
+
default: () => void
|
|
3032
|
+
},
|
|
3033
|
+
'default'
|
|
3034
|
+
> & {
|
|
3035
|
+
editor: PortableTextSlateEditor
|
|
3036
|
+
})
|
|
3037
|
+
| (Omit<
|
|
3038
|
+
{
|
|
3039
|
+
type: 'insert text'
|
|
3040
|
+
text: string
|
|
3041
|
+
default: () => void
|
|
3042
|
+
},
|
|
3043
|
+
'default'
|
|
3044
|
+
> & {
|
|
2624
3045
|
editor: PortableTextSlateEditor
|
|
2625
3046
|
})
|
|
2626
3047
|
| ({
|
|
@@ -2642,16 +3063,6 @@ export declare const editorMachine: StateMachine<
|
|
|
2642
3063
|
} & {
|
|
2643
3064
|
editor: PortableTextSlateEditor
|
|
2644
3065
|
})
|
|
2645
|
-
| {
|
|
2646
|
-
type: 'key down'
|
|
2647
|
-
nativeEvent: KeyboardEvent
|
|
2648
|
-
editor: PortableTextSlateEditor
|
|
2649
|
-
}
|
|
2650
|
-
| {
|
|
2651
|
-
type: 'before insert text'
|
|
2652
|
-
nativeEvent: InputEvent
|
|
2653
|
-
editor: PortableTextSlateEditor
|
|
2654
|
-
}
|
|
2655
3066
|
| PatchEvent
|
|
2656
3067
|
| MutationEvent_2
|
|
2657
3068
|
| {
|
|
@@ -2660,6 +3071,11 @@ export declare const editorMachine: StateMachine<
|
|
|
2660
3071
|
| {
|
|
2661
3072
|
type: 'done normalizing'
|
|
2662
3073
|
}
|
|
3074
|
+
| {
|
|
3075
|
+
type: 'behavior event'
|
|
3076
|
+
behaviorEvent: BehaviorEvent
|
|
3077
|
+
editor: PortableTextSlateEditor
|
|
3078
|
+
}
|
|
2663
3079
|
| {
|
|
2664
3080
|
type: 'update schema'
|
|
2665
3081
|
schema: PortableTextMemberSchemaTypes
|
|
@@ -2768,11 +3184,8 @@ export declare const editorMachine: StateMachine<
|
|
|
2768
3184
|
readonly 'update schema': {
|
|
2769
3185
|
readonly actions: 'assign schema'
|
|
2770
3186
|
}
|
|
2771
|
-
readonly '
|
|
2772
|
-
readonly actions:
|
|
2773
|
-
}
|
|
2774
|
-
readonly 'before insert text': {
|
|
2775
|
-
readonly actions: readonly ['handle behavior event']
|
|
3187
|
+
readonly 'behavior event': {
|
|
3188
|
+
readonly actions: 'handle behavior event'
|
|
2776
3189
|
}
|
|
2777
3190
|
readonly 'apply block style': {
|
|
2778
3191
|
readonly actions: readonly [
|
|
@@ -2794,6 +3207,29 @@ export declare const editorMachine: StateMachine<
|
|
|
2794
3207
|
}) => void,
|
|
2795
3208
|
]
|
|
2796
3209
|
}
|
|
3210
|
+
readonly 'delete backward': {
|
|
3211
|
+
readonly actions: readonly [
|
|
3212
|
+
({
|
|
3213
|
+
context,
|
|
3214
|
+
event,
|
|
3215
|
+
}: {
|
|
3216
|
+
context: {
|
|
3217
|
+
keyGenerator: () => string
|
|
3218
|
+
schema: PortableTextMemberSchemaTypes
|
|
3219
|
+
}
|
|
3220
|
+
event: Omit<
|
|
3221
|
+
{
|
|
3222
|
+
type: 'delete backward'
|
|
3223
|
+
unit: TextUnit
|
|
3224
|
+
default: () => void
|
|
3225
|
+
},
|
|
3226
|
+
'default'
|
|
3227
|
+
> & {
|
|
3228
|
+
editor: PortableTextSlateEditor
|
|
3229
|
+
}
|
|
3230
|
+
}) => void,
|
|
3231
|
+
]
|
|
3232
|
+
}
|
|
2797
3233
|
readonly 'delete text': {
|
|
2798
3234
|
readonly actions: readonly [
|
|
2799
3235
|
({
|
|
@@ -2813,6 +3249,50 @@ export declare const editorMachine: StateMachine<
|
|
|
2813
3249
|
}) => void,
|
|
2814
3250
|
]
|
|
2815
3251
|
}
|
|
3252
|
+
readonly 'insert break': {
|
|
3253
|
+
readonly actions: readonly [
|
|
3254
|
+
({
|
|
3255
|
+
context,
|
|
3256
|
+
event,
|
|
3257
|
+
}: {
|
|
3258
|
+
context: {
|
|
3259
|
+
keyGenerator: () => string
|
|
3260
|
+
schema: PortableTextMemberSchemaTypes
|
|
3261
|
+
}
|
|
3262
|
+
event: Omit<
|
|
3263
|
+
{
|
|
3264
|
+
type: 'insert break'
|
|
3265
|
+
default: () => void
|
|
3266
|
+
},
|
|
3267
|
+
'default'
|
|
3268
|
+
> & {
|
|
3269
|
+
editor: PortableTextSlateEditor
|
|
3270
|
+
}
|
|
3271
|
+
}) => void,
|
|
3272
|
+
]
|
|
3273
|
+
}
|
|
3274
|
+
readonly 'insert soft break': {
|
|
3275
|
+
readonly actions: readonly [
|
|
3276
|
+
({
|
|
3277
|
+
context,
|
|
3278
|
+
event,
|
|
3279
|
+
}: {
|
|
3280
|
+
context: {
|
|
3281
|
+
keyGenerator: () => string
|
|
3282
|
+
schema: PortableTextMemberSchemaTypes
|
|
3283
|
+
}
|
|
3284
|
+
event: Omit<
|
|
3285
|
+
{
|
|
3286
|
+
type: 'insert soft break'
|
|
3287
|
+
default: () => void
|
|
3288
|
+
},
|
|
3289
|
+
'default'
|
|
3290
|
+
> & {
|
|
3291
|
+
editor: PortableTextSlateEditor
|
|
3292
|
+
}
|
|
3293
|
+
}) => void,
|
|
3294
|
+
]
|
|
3295
|
+
}
|
|
2816
3296
|
readonly 'insert text': {
|
|
2817
3297
|
readonly actions: readonly [
|
|
2818
3298
|
({
|
|
@@ -2823,10 +3303,14 @@ export declare const editorMachine: StateMachine<
|
|
|
2823
3303
|
keyGenerator: () => string
|
|
2824
3304
|
schema: PortableTextMemberSchemaTypes
|
|
2825
3305
|
}
|
|
2826
|
-
event:
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
3306
|
+
event: Omit<
|
|
3307
|
+
{
|
|
3308
|
+
type: 'insert text'
|
|
3309
|
+
text: string
|
|
3310
|
+
default: () => void
|
|
3311
|
+
},
|
|
3312
|
+
'default'
|
|
3313
|
+
> & {
|
|
2830
3314
|
editor: PortableTextSlateEditor
|
|
2831
3315
|
}
|
|
2832
3316
|
}) => void,
|
|
@@ -3432,7 +3916,11 @@ export declare interface PortableTextSlateEditor extends ReactEditor {
|
|
|
3432
3916
|
/**
|
|
3433
3917
|
* Helper function that creates a text block
|
|
3434
3918
|
*/
|
|
3435
|
-
pteCreateTextBlock: (options: {
|
|
3919
|
+
pteCreateTextBlock: (options: {
|
|
3920
|
+
decorators: Array<string>
|
|
3921
|
+
listItem?: string
|
|
3922
|
+
level?: number
|
|
3923
|
+
}) => Descendant
|
|
3436
3924
|
/**
|
|
3437
3925
|
* Undo
|
|
3438
3926
|
*/
|