@portabletext/editor 1.34.0 → 1.34.1
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/plugin.event-listener.cjs +0 -4
- package/lib/_chunks-cjs/plugin.event-listener.cjs.map +1 -1
- package/lib/_chunks-es/behavior.core.js.map +1 -1
- package/lib/_chunks-es/plugin.event-listener.js +0 -4
- package/lib/_chunks-es/plugin.event-listener.js.map +1 -1
- package/lib/behaviors/index.d.cts +4 -3
- package/lib/behaviors/index.d.ts +4 -3
- package/lib/index.d.cts +116 -59
- package/lib/index.d.ts +116 -59
- package/lib/plugins/index.d.cts +116 -59
- package/lib/plugins/index.d.ts +116 -59
- package/lib/selectors/index.d.cts +3 -2
- package/lib/selectors/index.d.ts +3 -2
- package/lib/utils/index.d.cts +3 -2
- package/lib/utils/index.d.ts +3 -2
- package/package.json +3 -3
- package/src/behaviors/behavior.types.ts +1 -1
- package/src/converters/converter.types.ts +3 -2
- package/src/editor/plugins/create-with-event-listeners.ts +0 -5
|
@@ -80,18 +80,19 @@ declare type Converter<TMIMEType extends MIMEType = MIMEType> = {
|
|
|
80
80
|
declare type ConverterEvent<TMIMEType extends MIMEType = MIMEType> =
|
|
81
81
|
| {
|
|
82
82
|
type: 'serialize'
|
|
83
|
-
originEvent: 'copy' | 'cut' | 'unknown'
|
|
83
|
+
originEvent: 'copy' | 'cut' | 'drag' | 'unknown'
|
|
84
84
|
}
|
|
85
85
|
| {
|
|
86
86
|
type: 'serialization.failure'
|
|
87
87
|
mimeType: TMIMEType
|
|
88
|
+
originEvent: 'copy' | 'cut' | 'drag' | 'unknown'
|
|
88
89
|
reason: string
|
|
89
90
|
}
|
|
90
91
|
| {
|
|
91
92
|
type: 'serialization.success'
|
|
92
93
|
data: string
|
|
93
94
|
mimeType: TMIMEType
|
|
94
|
-
originEvent: 'copy' | 'cut' | 'unknown'
|
|
95
|
+
originEvent: 'copy' | 'cut' | 'drag' | 'unknown'
|
|
95
96
|
}
|
|
96
97
|
| {
|
|
97
98
|
type: 'deserialize'
|
package/lib/selectors/index.d.ts
CHANGED
|
@@ -80,18 +80,19 @@ declare type Converter<TMIMEType extends MIMEType = MIMEType> = {
|
|
|
80
80
|
declare type ConverterEvent<TMIMEType extends MIMEType = MIMEType> =
|
|
81
81
|
| {
|
|
82
82
|
type: 'serialize'
|
|
83
|
-
originEvent: 'copy' | 'cut' | 'unknown'
|
|
83
|
+
originEvent: 'copy' | 'cut' | 'drag' | 'unknown'
|
|
84
84
|
}
|
|
85
85
|
| {
|
|
86
86
|
type: 'serialization.failure'
|
|
87
87
|
mimeType: TMIMEType
|
|
88
|
+
originEvent: 'copy' | 'cut' | 'drag' | 'unknown'
|
|
88
89
|
reason: string
|
|
89
90
|
}
|
|
90
91
|
| {
|
|
91
92
|
type: 'serialization.success'
|
|
92
93
|
data: string
|
|
93
94
|
mimeType: TMIMEType
|
|
94
|
-
originEvent: 'copy' | 'cut' | 'unknown'
|
|
95
|
+
originEvent: 'copy' | 'cut' | 'drag' | 'unknown'
|
|
95
96
|
}
|
|
96
97
|
| {
|
|
97
98
|
type: 'deserialize'
|
package/lib/utils/index.d.cts
CHANGED
|
@@ -78,18 +78,19 @@ declare type Converter<TMIMEType extends MIMEType = MIMEType> = {
|
|
|
78
78
|
declare type ConverterEvent<TMIMEType extends MIMEType = MIMEType> =
|
|
79
79
|
| {
|
|
80
80
|
type: 'serialize'
|
|
81
|
-
originEvent: 'copy' | 'cut' | 'unknown'
|
|
81
|
+
originEvent: 'copy' | 'cut' | 'drag' | 'unknown'
|
|
82
82
|
}
|
|
83
83
|
| {
|
|
84
84
|
type: 'serialization.failure'
|
|
85
85
|
mimeType: TMIMEType
|
|
86
|
+
originEvent: 'copy' | 'cut' | 'drag' | 'unknown'
|
|
86
87
|
reason: string
|
|
87
88
|
}
|
|
88
89
|
| {
|
|
89
90
|
type: 'serialization.success'
|
|
90
91
|
data: string
|
|
91
92
|
mimeType: TMIMEType
|
|
92
|
-
originEvent: 'copy' | 'cut' | 'unknown'
|
|
93
|
+
originEvent: 'copy' | 'cut' | 'drag' | 'unknown'
|
|
93
94
|
}
|
|
94
95
|
| {
|
|
95
96
|
type: 'deserialize'
|
package/lib/utils/index.d.ts
CHANGED
|
@@ -78,18 +78,19 @@ declare type Converter<TMIMEType extends MIMEType = MIMEType> = {
|
|
|
78
78
|
declare type ConverterEvent<TMIMEType extends MIMEType = MIMEType> =
|
|
79
79
|
| {
|
|
80
80
|
type: 'serialize'
|
|
81
|
-
originEvent: 'copy' | 'cut' | 'unknown'
|
|
81
|
+
originEvent: 'copy' | 'cut' | 'drag' | 'unknown'
|
|
82
82
|
}
|
|
83
83
|
| {
|
|
84
84
|
type: 'serialization.failure'
|
|
85
85
|
mimeType: TMIMEType
|
|
86
|
+
originEvent: 'copy' | 'cut' | 'drag' | 'unknown'
|
|
86
87
|
reason: string
|
|
87
88
|
}
|
|
88
89
|
| {
|
|
89
90
|
type: 'serialization.success'
|
|
90
91
|
data: string
|
|
91
92
|
mimeType: TMIMEType
|
|
92
|
-
originEvent: 'copy' | 'cut' | 'unknown'
|
|
93
|
+
originEvent: 'copy' | 'cut' | 'drag' | 'unknown'
|
|
93
94
|
}
|
|
94
95
|
| {
|
|
95
96
|
type: 'deserialize'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@portabletext/editor",
|
|
3
|
-
"version": "1.34.
|
|
3
|
+
"version": "1.34.1",
|
|
4
4
|
"description": "Portable Text Editor made in React",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sanity",
|
|
@@ -79,8 +79,8 @@
|
|
|
79
79
|
"slate-react": "0.112.1",
|
|
80
80
|
"use-effect-event": "^1.0.2",
|
|
81
81
|
"xstate": "^5.19.2",
|
|
82
|
-
"@portabletext/
|
|
83
|
-
"@portabletext/
|
|
82
|
+
"@portabletext/patches": "1.1.3",
|
|
83
|
+
"@portabletext/block-tools": "1.1.8"
|
|
84
84
|
},
|
|
85
85
|
"devDependencies": {
|
|
86
86
|
"@portabletext/toolkit": "^2.0.17",
|
|
@@ -18,18 +18,19 @@ export function defineConverter<TMIMEType extends MIMEType>(
|
|
|
18
18
|
export type ConverterEvent<TMIMEType extends MIMEType = MIMEType> =
|
|
19
19
|
| {
|
|
20
20
|
type: 'serialize'
|
|
21
|
-
originEvent: 'copy' | 'cut' | 'unknown'
|
|
21
|
+
originEvent: 'copy' | 'cut' | 'drag' | 'unknown'
|
|
22
22
|
}
|
|
23
23
|
| {
|
|
24
24
|
type: 'serialization.failure'
|
|
25
25
|
mimeType: TMIMEType
|
|
26
|
+
originEvent: 'copy' | 'cut' | 'drag' | 'unknown'
|
|
26
27
|
reason: string
|
|
27
28
|
}
|
|
28
29
|
| {
|
|
29
30
|
type: 'serialization.success'
|
|
30
31
|
data: string
|
|
31
32
|
mimeType: TMIMEType
|
|
32
|
-
originEvent: 'copy' | 'cut' | 'unknown'
|
|
33
|
+
originEvent: 'copy' | 'cut' | 'drag' | 'unknown'
|
|
33
34
|
}
|
|
34
35
|
| {
|
|
35
36
|
type: 'deserialize'
|
|
@@ -236,11 +236,6 @@ export function createWithEventListeners(
|
|
|
236
236
|
}
|
|
237
237
|
|
|
238
238
|
editor.setFragmentData = (dataTransfer, originEvent) => {
|
|
239
|
-
if (originEvent === 'drag') {
|
|
240
|
-
setFragmentData(dataTransfer)
|
|
241
|
-
return
|
|
242
|
-
}
|
|
243
|
-
|
|
244
239
|
if (isApplyingBehaviorActions(editor)) {
|
|
245
240
|
setFragmentData(dataTransfer)
|
|
246
241
|
return
|