slate-react 0.68.0 → 0.69.0-202192741544
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/CHANGELOG.md +12 -0
- package/dist/index.es.js +13 -6
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +13 -6
- package/dist/index.js.map +1 -1
- package/dist/plugin/react-editor.d.ts +4 -4
- package/dist/plugin/react-editor.d.ts.map +1 -1
- package/dist/plugin/with-react.d.ts.map +1 -1
- package/dist/slate-react.js +13 -6
- package/dist/slate-react.min.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# slate-react
|
|
2
2
|
|
|
3
|
+
## 0.69.0-202192741544
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#4625](https://github.com/ianstormtaylor/slate/pull/4625) [`e54f2a0e`](https://github.com/ianstormtaylor/slate/commit/e54f2a0ea01ddc94f3ad14e812602b0ed824aeb3) Thanks [@echarles](https://github.com/echarles)! - insertTextData and insertFragmentData return a boolean (true if some content has been effectively inserted)
|
|
8
|
+
|
|
9
|
+
## 0.68.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#4627](https://github.com/ianstormtaylor/slate/pull/4627) [`ec01e75f`](https://github.com/ianstormtaylor/slate/commit/ec01e75fff29b3e7b710b59a6ba8106d9aa9ca5e) Thanks [@jameshfisher](https://github.com/jameshfisher)! - Fixed issues where cursor jumps to wrong location
|
|
14
|
+
|
|
3
15
|
## 0.68.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/dist/index.es.js
CHANGED
|
@@ -1019,7 +1019,7 @@ var Editable$1 = props => {
|
|
|
1019
1019
|
|
|
1020
1020
|
if (hasDomSelection && hasDomSelectionInEditor && selection) {
|
|
1021
1021
|
var slateRange = ReactEditor.toSlateRange(editor, domSelection, {
|
|
1022
|
-
exactMatch:
|
|
1022
|
+
exactMatch: true,
|
|
1023
1023
|
// domSelection is not necessarily a valid Slate range
|
|
1024
1024
|
// (e.g. when clicking on contentEditable:false element)
|
|
1025
1025
|
suppressThrow: true
|
|
@@ -2281,14 +2281,14 @@ var ReactEditor = {
|
|
|
2281
2281
|
* Insert fragment data from a `DataTransfer` into the editor.
|
|
2282
2282
|
*/
|
|
2283
2283
|
insertFragmentData(editor, data) {
|
|
2284
|
-
editor.insertFragmentData(data);
|
|
2284
|
+
return editor.insertFragmentData(data);
|
|
2285
2285
|
},
|
|
2286
2286
|
|
|
2287
2287
|
/**
|
|
2288
2288
|
* Insert text data from a `DataTransfer` into the editor.
|
|
2289
2289
|
*/
|
|
2290
2290
|
insertTextData(editor, data) {
|
|
2291
|
-
editor.insertTextData(data);
|
|
2291
|
+
return editor.insertTextData(data);
|
|
2292
2292
|
},
|
|
2293
2293
|
|
|
2294
2294
|
/**
|
|
@@ -3993,8 +3993,9 @@ var withReact = editor => {
|
|
|
3993
3993
|
};
|
|
3994
3994
|
|
|
3995
3995
|
e.insertData = data => {
|
|
3996
|
-
e.insertFragmentData(data)
|
|
3997
|
-
|
|
3996
|
+
if (!e.insertFragmentData(data)) {
|
|
3997
|
+
e.insertTextData(data);
|
|
3998
|
+
}
|
|
3998
3999
|
};
|
|
3999
4000
|
|
|
4000
4001
|
e.insertFragmentData = data => {
|
|
@@ -4007,8 +4008,10 @@ var withReact = editor => {
|
|
|
4007
4008
|
var decoded = decodeURIComponent(window.atob(fragment));
|
|
4008
4009
|
var parsed = JSON.parse(decoded);
|
|
4009
4010
|
e.insertFragment(parsed);
|
|
4010
|
-
return;
|
|
4011
|
+
return true;
|
|
4011
4012
|
}
|
|
4013
|
+
|
|
4014
|
+
return false;
|
|
4012
4015
|
};
|
|
4013
4016
|
|
|
4014
4017
|
e.insertTextData = data => {
|
|
@@ -4028,7 +4031,11 @@ var withReact = editor => {
|
|
|
4028
4031
|
e.insertText(line);
|
|
4029
4032
|
split = true;
|
|
4030
4033
|
}
|
|
4034
|
+
|
|
4035
|
+
return true;
|
|
4031
4036
|
}
|
|
4037
|
+
|
|
4038
|
+
return false;
|
|
4032
4039
|
};
|
|
4033
4040
|
|
|
4034
4041
|
e.onChange = () => {
|