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.es.js
CHANGED
|
@@ -4842,7 +4842,8 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
4842
4842
|
* See https://docs.slatejs.org/concepts/11-typescript to learn how.
|
|
4843
4843
|
*/
|
|
4844
4844
|
|
|
4845
|
-
var withReact = editor
|
|
4845
|
+
var withReact = function withReact(editor) {
|
|
4846
|
+
var clipboardFormatKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'x-slate-fragment';
|
|
4846
4847
|
var e = editor;
|
|
4847
4848
|
var {
|
|
4848
4849
|
apply,
|
|
@@ -5058,7 +5059,7 @@ var withReact = editor => {
|
|
|
5058
5059
|
var string = JSON.stringify(fragment);
|
|
5059
5060
|
var encoded = window.btoa(encodeURIComponent(string));
|
|
5060
5061
|
attach.setAttribute('data-slate-fragment', encoded);
|
|
5061
|
-
data.setData(
|
|
5062
|
+
data.setData("application/".concat(clipboardFormatKey), encoded); // Add the content to a <div> so that we can get its inner HTML.
|
|
5062
5063
|
|
|
5063
5064
|
var div = contents.ownerDocument.createElement('div');
|
|
5064
5065
|
div.appendChild(contents);
|
|
@@ -5080,7 +5081,7 @@ var withReact = editor => {
|
|
|
5080
5081
|
/**
|
|
5081
5082
|
* Checking copied fragment from application/x-slate-fragment or data-slate-fragment
|
|
5082
5083
|
*/
|
|
5083
|
-
var fragment = data.getData(
|
|
5084
|
+
var fragment = data.getData("application/".concat(clipboardFormatKey)) || getSlateFragmentAttribute(data);
|
|
5084
5085
|
|
|
5085
5086
|
if (fragment) {
|
|
5086
5087
|
var decoded = decodeURIComponent(window.atob(fragment));
|