@portabletext/editor 1.47.12 → 1.47.13
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/_chunks-cjs/behavior.core.cjs.map +1 -1
- package/lib/_chunks-cjs/editor-provider.cjs +2 -2
- package/lib/_chunks-cjs/editor-provider.cjs.map +1 -1
- package/lib/_chunks-es/behavior.core.js.map +1 -1
- package/lib/_chunks-es/editor-provider.js +2 -2
- package/lib/_chunks-es/editor-provider.js.map +1 -1
- package/lib/behaviors/index.d.cts +4752 -164
- package/lib/behaviors/index.d.ts +4752 -164
- package/lib/index.d.cts +28 -41
- package/lib/index.d.ts +28 -41
- package/lib/plugins/index.d.cts +28 -41
- package/lib/plugins/index.d.ts +28 -41
- package/lib/selectors/index.d.cts +28 -40
- package/lib/selectors/index.d.ts +28 -40
- package/lib/utils/index.d.cts +28 -40
- package/lib/utils/index.d.ts +28 -40
- package/package.json +7 -7
- package/src/behaviors/behavior.perform-event.ts +2 -7
- package/src/behaviors/behavior.types.action.ts +7 -13
- package/src/behaviors/behavior.types.event.ts +30 -32
package/lib/index.d.cts
CHANGED
|
@@ -66,7 +66,7 @@ import {GuardArgs} from 'xstate/guards'
|
|
|
66
66
|
|
|
67
67
|
declare type AbstractBehaviorEvent =
|
|
68
68
|
| {
|
|
69
|
-
type: StrictExtract<
|
|
69
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'annotation.toggle'>
|
|
70
70
|
annotation: {
|
|
71
71
|
name: string
|
|
72
72
|
value: {
|
|
@@ -75,7 +75,7 @@ declare type AbstractBehaviorEvent =
|
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
| {
|
|
78
|
-
type: StrictExtract<
|
|
78
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'decorator.toggle'>
|
|
79
79
|
decorator: string
|
|
80
80
|
at?: {
|
|
81
81
|
anchor: BlockOffset
|
|
@@ -83,14 +83,14 @@ declare type AbstractBehaviorEvent =
|
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
| {
|
|
86
|
-
type: StrictExtract<
|
|
86
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'delete.text'>
|
|
87
87
|
at: {
|
|
88
88
|
anchor: BlockOffset
|
|
89
89
|
focus: BlockOffset
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
| {
|
|
93
|
-
type: StrictExtract<
|
|
93
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'deserialize'>
|
|
94
94
|
originEvent:
|
|
95
95
|
| PickFromUnion<
|
|
96
96
|
NativeBehaviorEvent,
|
|
@@ -100,7 +100,7 @@ declare type AbstractBehaviorEvent =
|
|
|
100
100
|
| InputBehaviorEvent
|
|
101
101
|
}
|
|
102
102
|
| {
|
|
103
|
-
type: StrictExtract<
|
|
103
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'serialize'>
|
|
104
104
|
originEvent: PickFromUnion<
|
|
105
105
|
NativeBehaviorEvent,
|
|
106
106
|
'type',
|
|
@@ -108,7 +108,7 @@ declare type AbstractBehaviorEvent =
|
|
|
108
108
|
>
|
|
109
109
|
}
|
|
110
110
|
| {
|
|
111
|
-
type: StrictExtract<
|
|
111
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'deserialization.success'>
|
|
112
112
|
mimeType: MIMEType
|
|
113
113
|
data: Array<PortableTextBlock>
|
|
114
114
|
originEvent:
|
|
@@ -120,7 +120,7 @@ declare type AbstractBehaviorEvent =
|
|
|
120
120
|
| InputBehaviorEvent
|
|
121
121
|
}
|
|
122
122
|
| {
|
|
123
|
-
type: StrictExtract<
|
|
123
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'deserialization.failure'>
|
|
124
124
|
mimeType: MIMEType
|
|
125
125
|
reason: string
|
|
126
126
|
originEvent:
|
|
@@ -132,7 +132,7 @@ declare type AbstractBehaviorEvent =
|
|
|
132
132
|
| InputBehaviorEvent
|
|
133
133
|
}
|
|
134
134
|
| {
|
|
135
|
-
type: StrictExtract<
|
|
135
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'serialization.success'>
|
|
136
136
|
mimeType: MIMEType
|
|
137
137
|
data: string
|
|
138
138
|
originEvent: PickFromUnion<
|
|
@@ -142,7 +142,7 @@ declare type AbstractBehaviorEvent =
|
|
|
142
142
|
>
|
|
143
143
|
}
|
|
144
144
|
| {
|
|
145
|
-
type: StrictExtract<
|
|
145
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'serialization.failure'>
|
|
146
146
|
mimeType: MIMEType
|
|
147
147
|
reason: string
|
|
148
148
|
originEvent: PickFromUnion<
|
|
@@ -152,66 +152,60 @@ declare type AbstractBehaviorEvent =
|
|
|
152
152
|
>
|
|
153
153
|
}
|
|
154
154
|
| {
|
|
155
|
-
type: StrictExtract<
|
|
155
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'insert.blocks'>
|
|
156
156
|
blocks: Array<PortableTextBlock>
|
|
157
157
|
placement: InsertPlacement
|
|
158
158
|
}
|
|
159
159
|
| {
|
|
160
|
-
type: StrictExtract<
|
|
160
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'insert.break'>
|
|
161
161
|
}
|
|
162
162
|
| {
|
|
163
|
-
type: StrictExtract<
|
|
163
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'insert.soft break'>
|
|
164
164
|
}
|
|
165
165
|
| {
|
|
166
|
-
type: StrictExtract<
|
|
166
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'list item.add'>
|
|
167
167
|
listItem: string
|
|
168
168
|
}
|
|
169
169
|
| {
|
|
170
|
-
type: StrictExtract<
|
|
170
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'list item.remove'>
|
|
171
171
|
listItem: string
|
|
172
172
|
}
|
|
173
173
|
| {
|
|
174
|
-
type: StrictExtract<
|
|
174
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'list item.toggle'>
|
|
175
175
|
listItem: string
|
|
176
176
|
}
|
|
177
177
|
| {
|
|
178
|
-
type: StrictExtract<
|
|
178
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'move.block down'>
|
|
179
179
|
at: [KeyedSegment]
|
|
180
180
|
}
|
|
181
181
|
| {
|
|
182
|
-
type: StrictExtract<
|
|
182
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'move.block up'>
|
|
183
183
|
at: [KeyedSegment]
|
|
184
184
|
}
|
|
185
185
|
| {
|
|
186
|
-
type: StrictExtract<
|
|
186
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'select.previous block'>
|
|
187
187
|
select?: 'start' | 'end'
|
|
188
188
|
}
|
|
189
189
|
| {
|
|
190
|
-
type: StrictExtract<
|
|
190
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'select.next block'>
|
|
191
191
|
select?: 'start' | 'end'
|
|
192
192
|
}
|
|
193
193
|
| {
|
|
194
|
-
type: StrictExtract<
|
|
194
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'split'>
|
|
195
195
|
}
|
|
196
196
|
| {
|
|
197
|
-
type: StrictExtract<
|
|
197
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'style.add'>
|
|
198
198
|
style: string
|
|
199
199
|
}
|
|
200
200
|
| {
|
|
201
|
-
type: StrictExtract<
|
|
201
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'style.remove'>
|
|
202
202
|
style: string
|
|
203
203
|
}
|
|
204
204
|
| {
|
|
205
|
-
type: StrictExtract<
|
|
205
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'style.toggle'>
|
|
206
206
|
style: string
|
|
207
207
|
}
|
|
208
208
|
|
|
209
|
-
declare type AbstractBehaviorEventNamespace =
|
|
210
|
-
ExtractNamespace<AbstractBehaviorEventType>
|
|
211
|
-
|
|
212
|
-
declare type AbstractBehaviorEventType =
|
|
213
|
-
(typeof abstractBehaviorEventTypes)[number]
|
|
214
|
-
|
|
215
209
|
/**************************************
|
|
216
210
|
* Abstract events
|
|
217
211
|
**************************************/
|
|
@@ -305,17 +299,11 @@ declare type Behavior<
|
|
|
305
299
|
declare type BehaviorAction =
|
|
306
300
|
| {
|
|
307
301
|
type: 'execute'
|
|
308
|
-
event:
|
|
309
|
-
| AbstractBehaviorEvent
|
|
310
|
-
| SyntheticBehaviorEvent
|
|
311
|
-
| CustomBehaviorEvent
|
|
302
|
+
event: SyntheticBehaviorEvent
|
|
312
303
|
}
|
|
313
304
|
| {
|
|
314
305
|
type: 'raise'
|
|
315
|
-
event:
|
|
316
|
-
| AbstractBehaviorEvent
|
|
317
|
-
| SyntheticBehaviorEvent
|
|
318
|
-
| CustomBehaviorEvent
|
|
306
|
+
event: SyntheticBehaviorEvent | CustomBehaviorEvent
|
|
319
307
|
}
|
|
320
308
|
| {
|
|
321
309
|
type: 'noop'
|
|
@@ -341,13 +329,11 @@ declare type BehaviorActionSet<TBehaviorEvent, TGuardResponse> = (
|
|
|
341
329
|
*/
|
|
342
330
|
declare type BehaviorEvent =
|
|
343
331
|
| SyntheticBehaviorEvent
|
|
344
|
-
| AbstractBehaviorEvent
|
|
345
332
|
| NativeBehaviorEvent
|
|
346
333
|
| CustomBehaviorEvent
|
|
347
334
|
|
|
348
335
|
declare type BehaviorEventTypeNamespace =
|
|
349
336
|
| SyntheticBehaviorEventNamespace
|
|
350
|
-
| AbstractBehaviorEventNamespace
|
|
351
337
|
| NativeBehaviorEventNamespace
|
|
352
338
|
| CustomBehaviorEventNamespace
|
|
353
339
|
|
|
@@ -5509,7 +5495,6 @@ declare type ExternalBehaviorEvent =
|
|
|
5509
5495
|
}
|
|
5510
5496
|
}
|
|
5511
5497
|
}
|
|
5512
|
-
| AbstractBehaviorEvent
|
|
5513
5498
|
| SyntheticBehaviorEvent
|
|
5514
5499
|
| CustomBehaviorEvent
|
|
5515
5500
|
|
|
@@ -6756,12 +6741,14 @@ declare type SyntheticBehaviorEvent =
|
|
|
6756
6741
|
type: StrictExtract<SyntheticBehaviorEventType, 'select'>
|
|
6757
6742
|
at: EditorSelection
|
|
6758
6743
|
}
|
|
6744
|
+
| AbstractBehaviorEvent
|
|
6759
6745
|
|
|
6760
6746
|
declare type SyntheticBehaviorEventNamespace =
|
|
6761
6747
|
ExtractNamespace<SyntheticBehaviorEventType>
|
|
6762
6748
|
|
|
6763
6749
|
declare type SyntheticBehaviorEventType =
|
|
6764
|
-
(typeof syntheticBehaviorEventTypes)[number]
|
|
6750
|
+
| (typeof syntheticBehaviorEventTypes)[number]
|
|
6751
|
+
| (typeof abstractBehaviorEventTypes)[number]
|
|
6765
6752
|
|
|
6766
6753
|
/**************************************
|
|
6767
6754
|
* Synthetic events
|
package/lib/index.d.ts
CHANGED
|
@@ -66,7 +66,7 @@ import {GuardArgs} from 'xstate/guards'
|
|
|
66
66
|
|
|
67
67
|
declare type AbstractBehaviorEvent =
|
|
68
68
|
| {
|
|
69
|
-
type: StrictExtract<
|
|
69
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'annotation.toggle'>
|
|
70
70
|
annotation: {
|
|
71
71
|
name: string
|
|
72
72
|
value: {
|
|
@@ -75,7 +75,7 @@ declare type AbstractBehaviorEvent =
|
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
| {
|
|
78
|
-
type: StrictExtract<
|
|
78
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'decorator.toggle'>
|
|
79
79
|
decorator: string
|
|
80
80
|
at?: {
|
|
81
81
|
anchor: BlockOffset
|
|
@@ -83,14 +83,14 @@ declare type AbstractBehaviorEvent =
|
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
| {
|
|
86
|
-
type: StrictExtract<
|
|
86
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'delete.text'>
|
|
87
87
|
at: {
|
|
88
88
|
anchor: BlockOffset
|
|
89
89
|
focus: BlockOffset
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
| {
|
|
93
|
-
type: StrictExtract<
|
|
93
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'deserialize'>
|
|
94
94
|
originEvent:
|
|
95
95
|
| PickFromUnion<
|
|
96
96
|
NativeBehaviorEvent,
|
|
@@ -100,7 +100,7 @@ declare type AbstractBehaviorEvent =
|
|
|
100
100
|
| InputBehaviorEvent
|
|
101
101
|
}
|
|
102
102
|
| {
|
|
103
|
-
type: StrictExtract<
|
|
103
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'serialize'>
|
|
104
104
|
originEvent: PickFromUnion<
|
|
105
105
|
NativeBehaviorEvent,
|
|
106
106
|
'type',
|
|
@@ -108,7 +108,7 @@ declare type AbstractBehaviorEvent =
|
|
|
108
108
|
>
|
|
109
109
|
}
|
|
110
110
|
| {
|
|
111
|
-
type: StrictExtract<
|
|
111
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'deserialization.success'>
|
|
112
112
|
mimeType: MIMEType
|
|
113
113
|
data: Array<PortableTextBlock>
|
|
114
114
|
originEvent:
|
|
@@ -120,7 +120,7 @@ declare type AbstractBehaviorEvent =
|
|
|
120
120
|
| InputBehaviorEvent
|
|
121
121
|
}
|
|
122
122
|
| {
|
|
123
|
-
type: StrictExtract<
|
|
123
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'deserialization.failure'>
|
|
124
124
|
mimeType: MIMEType
|
|
125
125
|
reason: string
|
|
126
126
|
originEvent:
|
|
@@ -132,7 +132,7 @@ declare type AbstractBehaviorEvent =
|
|
|
132
132
|
| InputBehaviorEvent
|
|
133
133
|
}
|
|
134
134
|
| {
|
|
135
|
-
type: StrictExtract<
|
|
135
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'serialization.success'>
|
|
136
136
|
mimeType: MIMEType
|
|
137
137
|
data: string
|
|
138
138
|
originEvent: PickFromUnion<
|
|
@@ -142,7 +142,7 @@ declare type AbstractBehaviorEvent =
|
|
|
142
142
|
>
|
|
143
143
|
}
|
|
144
144
|
| {
|
|
145
|
-
type: StrictExtract<
|
|
145
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'serialization.failure'>
|
|
146
146
|
mimeType: MIMEType
|
|
147
147
|
reason: string
|
|
148
148
|
originEvent: PickFromUnion<
|
|
@@ -152,66 +152,60 @@ declare type AbstractBehaviorEvent =
|
|
|
152
152
|
>
|
|
153
153
|
}
|
|
154
154
|
| {
|
|
155
|
-
type: StrictExtract<
|
|
155
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'insert.blocks'>
|
|
156
156
|
blocks: Array<PortableTextBlock>
|
|
157
157
|
placement: InsertPlacement
|
|
158
158
|
}
|
|
159
159
|
| {
|
|
160
|
-
type: StrictExtract<
|
|
160
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'insert.break'>
|
|
161
161
|
}
|
|
162
162
|
| {
|
|
163
|
-
type: StrictExtract<
|
|
163
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'insert.soft break'>
|
|
164
164
|
}
|
|
165
165
|
| {
|
|
166
|
-
type: StrictExtract<
|
|
166
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'list item.add'>
|
|
167
167
|
listItem: string
|
|
168
168
|
}
|
|
169
169
|
| {
|
|
170
|
-
type: StrictExtract<
|
|
170
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'list item.remove'>
|
|
171
171
|
listItem: string
|
|
172
172
|
}
|
|
173
173
|
| {
|
|
174
|
-
type: StrictExtract<
|
|
174
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'list item.toggle'>
|
|
175
175
|
listItem: string
|
|
176
176
|
}
|
|
177
177
|
| {
|
|
178
|
-
type: StrictExtract<
|
|
178
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'move.block down'>
|
|
179
179
|
at: [KeyedSegment]
|
|
180
180
|
}
|
|
181
181
|
| {
|
|
182
|
-
type: StrictExtract<
|
|
182
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'move.block up'>
|
|
183
183
|
at: [KeyedSegment]
|
|
184
184
|
}
|
|
185
185
|
| {
|
|
186
|
-
type: StrictExtract<
|
|
186
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'select.previous block'>
|
|
187
187
|
select?: 'start' | 'end'
|
|
188
188
|
}
|
|
189
189
|
| {
|
|
190
|
-
type: StrictExtract<
|
|
190
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'select.next block'>
|
|
191
191
|
select?: 'start' | 'end'
|
|
192
192
|
}
|
|
193
193
|
| {
|
|
194
|
-
type: StrictExtract<
|
|
194
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'split'>
|
|
195
195
|
}
|
|
196
196
|
| {
|
|
197
|
-
type: StrictExtract<
|
|
197
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'style.add'>
|
|
198
198
|
style: string
|
|
199
199
|
}
|
|
200
200
|
| {
|
|
201
|
-
type: StrictExtract<
|
|
201
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'style.remove'>
|
|
202
202
|
style: string
|
|
203
203
|
}
|
|
204
204
|
| {
|
|
205
|
-
type: StrictExtract<
|
|
205
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'style.toggle'>
|
|
206
206
|
style: string
|
|
207
207
|
}
|
|
208
208
|
|
|
209
|
-
declare type AbstractBehaviorEventNamespace =
|
|
210
|
-
ExtractNamespace<AbstractBehaviorEventType>
|
|
211
|
-
|
|
212
|
-
declare type AbstractBehaviorEventType =
|
|
213
|
-
(typeof abstractBehaviorEventTypes)[number]
|
|
214
|
-
|
|
215
209
|
/**************************************
|
|
216
210
|
* Abstract events
|
|
217
211
|
**************************************/
|
|
@@ -305,17 +299,11 @@ declare type Behavior<
|
|
|
305
299
|
declare type BehaviorAction =
|
|
306
300
|
| {
|
|
307
301
|
type: 'execute'
|
|
308
|
-
event:
|
|
309
|
-
| AbstractBehaviorEvent
|
|
310
|
-
| SyntheticBehaviorEvent
|
|
311
|
-
| CustomBehaviorEvent
|
|
302
|
+
event: SyntheticBehaviorEvent
|
|
312
303
|
}
|
|
313
304
|
| {
|
|
314
305
|
type: 'raise'
|
|
315
|
-
event:
|
|
316
|
-
| AbstractBehaviorEvent
|
|
317
|
-
| SyntheticBehaviorEvent
|
|
318
|
-
| CustomBehaviorEvent
|
|
306
|
+
event: SyntheticBehaviorEvent | CustomBehaviorEvent
|
|
319
307
|
}
|
|
320
308
|
| {
|
|
321
309
|
type: 'noop'
|
|
@@ -341,13 +329,11 @@ declare type BehaviorActionSet<TBehaviorEvent, TGuardResponse> = (
|
|
|
341
329
|
*/
|
|
342
330
|
declare type BehaviorEvent =
|
|
343
331
|
| SyntheticBehaviorEvent
|
|
344
|
-
| AbstractBehaviorEvent
|
|
345
332
|
| NativeBehaviorEvent
|
|
346
333
|
| CustomBehaviorEvent
|
|
347
334
|
|
|
348
335
|
declare type BehaviorEventTypeNamespace =
|
|
349
336
|
| SyntheticBehaviorEventNamespace
|
|
350
|
-
| AbstractBehaviorEventNamespace
|
|
351
337
|
| NativeBehaviorEventNamespace
|
|
352
338
|
| CustomBehaviorEventNamespace
|
|
353
339
|
|
|
@@ -5509,7 +5495,6 @@ declare type ExternalBehaviorEvent =
|
|
|
5509
5495
|
}
|
|
5510
5496
|
}
|
|
5511
5497
|
}
|
|
5512
|
-
| AbstractBehaviorEvent
|
|
5513
5498
|
| SyntheticBehaviorEvent
|
|
5514
5499
|
| CustomBehaviorEvent
|
|
5515
5500
|
|
|
@@ -6756,12 +6741,14 @@ declare type SyntheticBehaviorEvent =
|
|
|
6756
6741
|
type: StrictExtract<SyntheticBehaviorEventType, 'select'>
|
|
6757
6742
|
at: EditorSelection
|
|
6758
6743
|
}
|
|
6744
|
+
| AbstractBehaviorEvent
|
|
6759
6745
|
|
|
6760
6746
|
declare type SyntheticBehaviorEventNamespace =
|
|
6761
6747
|
ExtractNamespace<SyntheticBehaviorEventType>
|
|
6762
6748
|
|
|
6763
6749
|
declare type SyntheticBehaviorEventType =
|
|
6764
|
-
(typeof syntheticBehaviorEventTypes)[number]
|
|
6750
|
+
| (typeof syntheticBehaviorEventTypes)[number]
|
|
6751
|
+
| (typeof abstractBehaviorEventTypes)[number]
|
|
6765
6752
|
|
|
6766
6753
|
/**************************************
|
|
6767
6754
|
* Synthetic events
|
package/lib/plugins/index.d.cts
CHANGED
|
@@ -47,7 +47,7 @@ import {GuardArgs} from 'xstate/guards'
|
|
|
47
47
|
|
|
48
48
|
declare type AbstractBehaviorEvent =
|
|
49
49
|
| {
|
|
50
|
-
type: StrictExtract<
|
|
50
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'annotation.toggle'>
|
|
51
51
|
annotation: {
|
|
52
52
|
name: string
|
|
53
53
|
value: {
|
|
@@ -56,7 +56,7 @@ declare type AbstractBehaviorEvent =
|
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
| {
|
|
59
|
-
type: StrictExtract<
|
|
59
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'decorator.toggle'>
|
|
60
60
|
decorator: string
|
|
61
61
|
at?: {
|
|
62
62
|
anchor: BlockOffset
|
|
@@ -64,14 +64,14 @@ declare type AbstractBehaviorEvent =
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
| {
|
|
67
|
-
type: StrictExtract<
|
|
67
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'delete.text'>
|
|
68
68
|
at: {
|
|
69
69
|
anchor: BlockOffset
|
|
70
70
|
focus: BlockOffset
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
| {
|
|
74
|
-
type: StrictExtract<
|
|
74
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'deserialize'>
|
|
75
75
|
originEvent:
|
|
76
76
|
| PickFromUnion<
|
|
77
77
|
NativeBehaviorEvent,
|
|
@@ -81,7 +81,7 @@ declare type AbstractBehaviorEvent =
|
|
|
81
81
|
| InputBehaviorEvent
|
|
82
82
|
}
|
|
83
83
|
| {
|
|
84
|
-
type: StrictExtract<
|
|
84
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'serialize'>
|
|
85
85
|
originEvent: PickFromUnion<
|
|
86
86
|
NativeBehaviorEvent,
|
|
87
87
|
'type',
|
|
@@ -89,7 +89,7 @@ declare type AbstractBehaviorEvent =
|
|
|
89
89
|
>
|
|
90
90
|
}
|
|
91
91
|
| {
|
|
92
|
-
type: StrictExtract<
|
|
92
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'deserialization.success'>
|
|
93
93
|
mimeType: MIMEType
|
|
94
94
|
data: Array<PortableTextBlock>
|
|
95
95
|
originEvent:
|
|
@@ -101,7 +101,7 @@ declare type AbstractBehaviorEvent =
|
|
|
101
101
|
| InputBehaviorEvent
|
|
102
102
|
}
|
|
103
103
|
| {
|
|
104
|
-
type: StrictExtract<
|
|
104
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'deserialization.failure'>
|
|
105
105
|
mimeType: MIMEType
|
|
106
106
|
reason: string
|
|
107
107
|
originEvent:
|
|
@@ -113,7 +113,7 @@ declare type AbstractBehaviorEvent =
|
|
|
113
113
|
| InputBehaviorEvent
|
|
114
114
|
}
|
|
115
115
|
| {
|
|
116
|
-
type: StrictExtract<
|
|
116
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'serialization.success'>
|
|
117
117
|
mimeType: MIMEType
|
|
118
118
|
data: string
|
|
119
119
|
originEvent: PickFromUnion<
|
|
@@ -123,7 +123,7 @@ declare type AbstractBehaviorEvent =
|
|
|
123
123
|
>
|
|
124
124
|
}
|
|
125
125
|
| {
|
|
126
|
-
type: StrictExtract<
|
|
126
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'serialization.failure'>
|
|
127
127
|
mimeType: MIMEType
|
|
128
128
|
reason: string
|
|
129
129
|
originEvent: PickFromUnion<
|
|
@@ -133,66 +133,60 @@ declare type AbstractBehaviorEvent =
|
|
|
133
133
|
>
|
|
134
134
|
}
|
|
135
135
|
| {
|
|
136
|
-
type: StrictExtract<
|
|
136
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'insert.blocks'>
|
|
137
137
|
blocks: Array<PortableTextBlock>
|
|
138
138
|
placement: InsertPlacement
|
|
139
139
|
}
|
|
140
140
|
| {
|
|
141
|
-
type: StrictExtract<
|
|
141
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'insert.break'>
|
|
142
142
|
}
|
|
143
143
|
| {
|
|
144
|
-
type: StrictExtract<
|
|
144
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'insert.soft break'>
|
|
145
145
|
}
|
|
146
146
|
| {
|
|
147
|
-
type: StrictExtract<
|
|
147
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'list item.add'>
|
|
148
148
|
listItem: string
|
|
149
149
|
}
|
|
150
150
|
| {
|
|
151
|
-
type: StrictExtract<
|
|
151
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'list item.remove'>
|
|
152
152
|
listItem: string
|
|
153
153
|
}
|
|
154
154
|
| {
|
|
155
|
-
type: StrictExtract<
|
|
155
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'list item.toggle'>
|
|
156
156
|
listItem: string
|
|
157
157
|
}
|
|
158
158
|
| {
|
|
159
|
-
type: StrictExtract<
|
|
159
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'move.block down'>
|
|
160
160
|
at: [KeyedSegment]
|
|
161
161
|
}
|
|
162
162
|
| {
|
|
163
|
-
type: StrictExtract<
|
|
163
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'move.block up'>
|
|
164
164
|
at: [KeyedSegment]
|
|
165
165
|
}
|
|
166
166
|
| {
|
|
167
|
-
type: StrictExtract<
|
|
167
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'select.previous block'>
|
|
168
168
|
select?: 'start' | 'end'
|
|
169
169
|
}
|
|
170
170
|
| {
|
|
171
|
-
type: StrictExtract<
|
|
171
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'select.next block'>
|
|
172
172
|
select?: 'start' | 'end'
|
|
173
173
|
}
|
|
174
174
|
| {
|
|
175
|
-
type: StrictExtract<
|
|
175
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'split'>
|
|
176
176
|
}
|
|
177
177
|
| {
|
|
178
|
-
type: StrictExtract<
|
|
178
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'style.add'>
|
|
179
179
|
style: string
|
|
180
180
|
}
|
|
181
181
|
| {
|
|
182
|
-
type: StrictExtract<
|
|
182
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'style.remove'>
|
|
183
183
|
style: string
|
|
184
184
|
}
|
|
185
185
|
| {
|
|
186
|
-
type: StrictExtract<
|
|
186
|
+
type: StrictExtract<SyntheticBehaviorEventType, 'style.toggle'>
|
|
187
187
|
style: string
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
-
declare type AbstractBehaviorEventNamespace =
|
|
191
|
-
ExtractNamespace<AbstractBehaviorEventType>
|
|
192
|
-
|
|
193
|
-
declare type AbstractBehaviorEventType =
|
|
194
|
-
(typeof abstractBehaviorEventTypes)[number]
|
|
195
|
-
|
|
196
190
|
/**************************************
|
|
197
191
|
* Abstract events
|
|
198
192
|
**************************************/
|
|
@@ -268,17 +262,11 @@ declare type Behavior<
|
|
|
268
262
|
declare type BehaviorAction =
|
|
269
263
|
| {
|
|
270
264
|
type: 'execute'
|
|
271
|
-
event:
|
|
272
|
-
| AbstractBehaviorEvent
|
|
273
|
-
| SyntheticBehaviorEvent
|
|
274
|
-
| CustomBehaviorEvent
|
|
265
|
+
event: SyntheticBehaviorEvent
|
|
275
266
|
}
|
|
276
267
|
| {
|
|
277
268
|
type: 'raise'
|
|
278
|
-
event:
|
|
279
|
-
| AbstractBehaviorEvent
|
|
280
|
-
| SyntheticBehaviorEvent
|
|
281
|
-
| CustomBehaviorEvent
|
|
269
|
+
event: SyntheticBehaviorEvent | CustomBehaviorEvent
|
|
282
270
|
}
|
|
283
271
|
| {
|
|
284
272
|
type: 'noop'
|
|
@@ -304,13 +292,11 @@ declare type BehaviorActionSet<TBehaviorEvent, TGuardResponse> = (
|
|
|
304
292
|
*/
|
|
305
293
|
declare type BehaviorEvent =
|
|
306
294
|
| SyntheticBehaviorEvent
|
|
307
|
-
| AbstractBehaviorEvent
|
|
308
295
|
| NativeBehaviorEvent
|
|
309
296
|
| CustomBehaviorEvent
|
|
310
297
|
|
|
311
298
|
declare type BehaviorEventTypeNamespace =
|
|
312
299
|
| SyntheticBehaviorEventNamespace
|
|
313
|
-
| AbstractBehaviorEventNamespace
|
|
314
300
|
| NativeBehaviorEventNamespace
|
|
315
301
|
| CustomBehaviorEventNamespace
|
|
316
302
|
|
|
@@ -5318,7 +5304,6 @@ declare type ExternalBehaviorEvent =
|
|
|
5318
5304
|
}
|
|
5319
5305
|
}
|
|
5320
5306
|
}
|
|
5321
|
-
| AbstractBehaviorEvent
|
|
5322
5307
|
| SyntheticBehaviorEvent
|
|
5323
5308
|
| CustomBehaviorEvent
|
|
5324
5309
|
|
|
@@ -5845,12 +5830,14 @@ declare type SyntheticBehaviorEvent =
|
|
|
5845
5830
|
type: StrictExtract<SyntheticBehaviorEventType, 'select'>
|
|
5846
5831
|
at: EditorSelection
|
|
5847
5832
|
}
|
|
5833
|
+
| AbstractBehaviorEvent
|
|
5848
5834
|
|
|
5849
5835
|
declare type SyntheticBehaviorEventNamespace =
|
|
5850
5836
|
ExtractNamespace<SyntheticBehaviorEventType>
|
|
5851
5837
|
|
|
5852
5838
|
declare type SyntheticBehaviorEventType =
|
|
5853
|
-
(typeof syntheticBehaviorEventTypes)[number]
|
|
5839
|
+
| (typeof syntheticBehaviorEventTypes)[number]
|
|
5840
|
+
| (typeof abstractBehaviorEventTypes)[number]
|
|
5854
5841
|
|
|
5855
5842
|
/**************************************
|
|
5856
5843
|
* Synthetic events
|