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 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('application/x-slate-fragment', encoded); // Add the content to a <div> so that we can get its inner HTML.
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('application/x-slate-fragment') || getSlateFragmentAttribute(data);
5084
+ var fragment = data.getData("application/".concat(clipboardFormatKey)) || getSlateFragmentAttribute(data);
5084
5085
 
5085
5086
  if (fragment) {
5086
5087
  var decoded = decodeURIComponent(window.atob(fragment));