@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/plugins/index.d.ts
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
|
|
@@ -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
|
|
|
@@ -5934,12 +5920,14 @@ declare type SyntheticBehaviorEvent =
|
|
|
5934
5920
|
type: StrictExtract<SyntheticBehaviorEventType, 'select'>
|
|
5935
5921
|
at: EditorSelection
|
|
5936
5922
|
}
|
|
5923
|
+
| AbstractBehaviorEvent
|
|
5937
5924
|
|
|
5938
5925
|
declare type SyntheticBehaviorEventNamespace =
|
|
5939
5926
|
ExtractNamespace<SyntheticBehaviorEventType>
|
|
5940
5927
|
|
|
5941
5928
|
declare type SyntheticBehaviorEventType =
|
|
5942
|
-
(typeof syntheticBehaviorEventTypes)[number]
|
|
5929
|
+
| (typeof syntheticBehaviorEventTypes)[number]
|
|
5930
|
+
| (typeof abstractBehaviorEventTypes)[number]
|
|
5943
5931
|
|
|
5944
5932
|
/**************************************
|
|
5945
5933
|
* Synthetic events
|
package/lib/selectors/index.d.ts
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
|
|
|
@@ -5934,12 +5920,14 @@ declare type SyntheticBehaviorEvent =
|
|
|
5934
5920
|
type: StrictExtract<SyntheticBehaviorEventType, 'select'>
|
|
5935
5921
|
at: EditorSelection
|
|
5936
5922
|
}
|
|
5923
|
+
| AbstractBehaviorEvent
|
|
5937
5924
|
|
|
5938
5925
|
declare type SyntheticBehaviorEventNamespace =
|
|
5939
5926
|
ExtractNamespace<SyntheticBehaviorEventType>
|
|
5940
5927
|
|
|
5941
5928
|
declare type SyntheticBehaviorEventType =
|
|
5942
|
-
(typeof syntheticBehaviorEventTypes)[number]
|
|
5929
|
+
| (typeof syntheticBehaviorEventTypes)[number]
|
|
5930
|
+
| (typeof abstractBehaviorEventTypes)[number]
|
|
5943
5931
|
|
|
5944
5932
|
/**************************************
|
|
5945
5933
|
* Synthetic events
|