@portabletext/editor 1.47.11 → 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 +61 -3
- package/lib/_chunks-cjs/behavior.core.cjs.map +1 -1
- package/lib/_chunks-cjs/editor-provider.cjs +88 -58
- package/lib/_chunks-cjs/editor-provider.cjs.map +1 -1
- package/lib/_chunks-cjs/util.get-selection-start-point.cjs +10 -0
- package/lib/_chunks-cjs/util.get-selection-start-point.cjs.map +1 -0
- package/lib/_chunks-cjs/util.selection-point-to-block-offset.cjs +0 -8
- package/lib/_chunks-cjs/util.selection-point-to-block-offset.cjs.map +1 -1
- package/lib/_chunks-es/behavior.core.js +63 -4
- package/lib/_chunks-es/behavior.core.js.map +1 -1
- package/lib/_chunks-es/editor-provider.js +90 -59
- package/lib/_chunks-es/editor-provider.js.map +1 -1
- package/lib/_chunks-es/util.get-selection-start-point.js +11 -0
- package/lib/_chunks-es/util.get-selection-start-point.js.map +1 -0
- package/lib/_chunks-es/util.selection-point-to-block-offset.js +0 -8
- package/lib/_chunks-es/util.selection-point-to-block-offset.js.map +1 -1
- package/lib/behaviors/index.d.cts +4876 -288
- package/lib/behaviors/index.d.ts +4876 -288
- package/lib/index.cjs +3 -3
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +29 -42
- package/lib/index.d.ts +29 -42
- package/lib/index.js +1 -1
- package/lib/plugins/index.cjs +0 -9
- package/lib/plugins/index.cjs.map +1 -1
- package/lib/plugins/index.d.cts +29 -42
- package/lib/plugins/index.d.ts +29 -42
- package/lib/plugins/index.js +0 -9
- package/lib/plugins/index.js.map +1 -1
- package/lib/selectors/index.d.cts +29 -41
- package/lib/selectors/index.d.ts +29 -41
- package/lib/utils/index.cjs +3 -3
- package/lib/utils/index.d.cts +29 -41
- package/lib/utils/index.d.ts +29 -41
- package/lib/utils/index.js +2 -1
- package/lib/utils/index.js.map +1 -1
- package/package.json +6 -6
- package/src/behavior-actions/behavior.action.insert.block.ts +136 -45
- package/src/behaviors/behavior.abstract.insert.ts +2 -2
- package/src/behaviors/behavior.abstract.split.ts +2 -46
- package/src/behaviors/behavior.core.insert-break.ts +113 -0
- package/src/behaviors/behavior.core.ts +2 -0
- 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 +31 -33
- package/src/internal-utils/slate-utils.ts +50 -1
- package/src/plugins/plugin.one-line.tsx +0 -7
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
|
**************************************/
|
|
@@ -235,7 +229,7 @@ declare const abstractBehaviorEventTypes: readonly [
|
|
|
235
229
|
'serialize',
|
|
236
230
|
'serialization.success',
|
|
237
231
|
'serialization.failure',
|
|
238
|
-
'split
|
|
232
|
+
'split',
|
|
239
233
|
'style.add',
|
|
240
234
|
'style.remove',
|
|
241
235
|
'style.toggle',
|
|
@@ -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
|
**************************************/
|
|
@@ -235,7 +229,7 @@ declare const abstractBehaviorEventTypes: readonly [
|
|
|
235
229
|
'serialize',
|
|
236
230
|
'serialization.success',
|
|
237
231
|
'serialization.failure',
|
|
238
|
-
'split
|
|
232
|
+
'split',
|
|
239
233
|
'style.add',
|
|
240
234
|
'style.remove',
|
|
241
235
|
'style.toggle',
|
|
@@ -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.js
CHANGED
|
@@ -15,7 +15,7 @@ import { DOMEditor, isDOMNode } from "slate-dom";
|
|
|
15
15
|
import { isSelectionCollapsed as isSelectionCollapsed$1 } from "./_chunks-es/util.is-selection-collapsed.js";
|
|
16
16
|
import { parseBlocks } from "./_chunks-es/parse-blocks.js";
|
|
17
17
|
import isEqual from "lodash/isEqual.js";
|
|
18
|
-
import { getSelectionEndPoint } from "./_chunks-es/util.selection-point
|
|
18
|
+
import { getSelectionEndPoint } from "./_chunks-es/util.get-selection-start-point.js";
|
|
19
19
|
import { isSelectingEntireBlocks } from "./_chunks-es/selector.is-selecting-entire-blocks.js";
|
|
20
20
|
import { defineBehavior, isHotkey } from "./_chunks-es/behavior.core.js";
|
|
21
21
|
import uniq from "lodash/uniq.js";
|
package/lib/plugins/index.cjs
CHANGED
|
@@ -419,15 +419,6 @@ const oneLineBehaviors = [
|
|
|
419
419
|
type: "noop"
|
|
420
420
|
}]]
|
|
421
421
|
}),
|
|
422
|
-
/**
|
|
423
|
-
* `split.block`s as well.
|
|
424
|
-
*/
|
|
425
|
-
behavior_core.defineBehavior({
|
|
426
|
-
on: "split.block",
|
|
427
|
-
actions: [() => [{
|
|
428
|
-
type: "noop"
|
|
429
|
-
}]]
|
|
430
|
-
}),
|
|
431
422
|
/**
|
|
432
423
|
* `insert.block` `before` or `after` is not allowed in a one-line editor.
|
|
433
424
|
*/
|