slate-react 0.90.0 → 0.91.0-20231918571
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/dist/index.es.js +4 -3
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/plugin/with-react.d.ts +1 -1
- package/dist/plugin/with-react.d.ts.map +1 -1
- package/dist/slate-react.js +3 -2
- package/dist/slate-react.min.js +1 -1
- package/dist/utils/dom.d.ts +1 -1
- package/dist/utils/dom.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5357,6 +5357,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
5357
5357
|
*/
|
|
5358
5358
|
|
|
5359
5359
|
var withReact = function withReact(editor) {
|
|
5360
|
+
var clipboardFormatKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'x-slate-fragment';
|
|
5360
5361
|
var e = editor;
|
|
5361
5362
|
var apply = e.apply,
|
|
5362
5363
|
onChange = e.onChange,
|
|
@@ -5587,7 +5588,7 @@ var withReact = function withReact(editor) {
|
|
|
5587
5588
|
var string = JSON.stringify(fragment);
|
|
5588
5589
|
var encoded = window.btoa(encodeURIComponent(string));
|
|
5589
5590
|
attach.setAttribute('data-slate-fragment', encoded);
|
|
5590
|
-
data.setData(
|
|
5591
|
+
data.setData("application/".concat(clipboardFormatKey), encoded); // Add the content to a <div> so that we can get its inner HTML.
|
|
5591
5592
|
|
|
5592
5593
|
var div = contents.ownerDocument.createElement('div');
|
|
5593
5594
|
div.appendChild(contents);
|
|
@@ -5609,7 +5610,7 @@ var withReact = function withReact(editor) {
|
|
|
5609
5610
|
/**
|
|
5610
5611
|
* Checking copied fragment from application/x-slate-fragment or data-slate-fragment
|
|
5611
5612
|
*/
|
|
5612
|
-
var fragment = data.getData(
|
|
5613
|
+
var fragment = data.getData("application/".concat(clipboardFormatKey)) || getSlateFragmentAttribute(data);
|
|
5613
5614
|
|
|
5614
5615
|
if (fragment) {
|
|
5615
5616
|
var decoded = decodeURIComponent(window.atob(fragment));
|