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/dist/index.js
CHANGED
|
@@ -1216,7 +1216,7 @@ var Editable$1 = function Editable(props) {
|
|
|
1216
1216
|
|
|
1217
1217
|
if (hasDomSelection && hasDomSelectionInEditor && selection) {
|
|
1218
1218
|
var slateRange = ReactEditor.toSlateRange(editor, domSelection, {
|
|
1219
|
-
exactMatch:
|
|
1219
|
+
exactMatch: true,
|
|
1220
1220
|
// domSelection is not necessarily a valid Slate range
|
|
1221
1221
|
// (e.g. when clicking on contentEditable:false element)
|
|
1222
1222
|
suppressThrow: true
|
|
@@ -2530,14 +2530,14 @@ var ReactEditor = {
|
|
|
2530
2530
|
* Insert fragment data from a `DataTransfer` into the editor.
|
|
2531
2531
|
*/
|
|
2532
2532
|
insertFragmentData: function insertFragmentData(editor, data) {
|
|
2533
|
-
editor.insertFragmentData(data);
|
|
2533
|
+
return editor.insertFragmentData(data);
|
|
2534
2534
|
},
|
|
2535
2535
|
|
|
2536
2536
|
/**
|
|
2537
2537
|
* Insert text data from a `DataTransfer` into the editor.
|
|
2538
2538
|
*/
|
|
2539
2539
|
insertTextData: function insertTextData(editor, data) {
|
|
2540
|
-
editor.insertTextData(data);
|
|
2540
|
+
return editor.insertTextData(data);
|
|
2541
2541
|
},
|
|
2542
2542
|
|
|
2543
2543
|
/**
|
|
@@ -4325,8 +4325,9 @@ var withReact = function withReact(editor) {
|
|
|
4325
4325
|
};
|
|
4326
4326
|
|
|
4327
4327
|
e.insertData = function (data) {
|
|
4328
|
-
e.insertFragmentData(data)
|
|
4329
|
-
|
|
4328
|
+
if (!e.insertFragmentData(data)) {
|
|
4329
|
+
e.insertTextData(data);
|
|
4330
|
+
}
|
|
4330
4331
|
};
|
|
4331
4332
|
|
|
4332
4333
|
e.insertFragmentData = function (data) {
|
|
@@ -4339,8 +4340,10 @@ var withReact = function withReact(editor) {
|
|
|
4339
4340
|
var decoded = decodeURIComponent(window.atob(fragment));
|
|
4340
4341
|
var parsed = JSON.parse(decoded);
|
|
4341
4342
|
e.insertFragment(parsed);
|
|
4342
|
-
return;
|
|
4343
|
+
return true;
|
|
4343
4344
|
}
|
|
4345
|
+
|
|
4346
|
+
return false;
|
|
4344
4347
|
};
|
|
4345
4348
|
|
|
4346
4349
|
e.insertTextData = function (data) {
|
|
@@ -4371,7 +4374,11 @@ var withReact = function withReact(editor) {
|
|
|
4371
4374
|
} finally {
|
|
4372
4375
|
_iterator4.f();
|
|
4373
4376
|
}
|
|
4377
|
+
|
|
4378
|
+
return true;
|
|
4374
4379
|
}
|
|
4380
|
+
|
|
4381
|
+
return false;
|
|
4375
4382
|
};
|
|
4376
4383
|
|
|
4377
4384
|
e.onChange = function () {
|