slate-react 0.70.0 → 0.70.1-202110159535

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.js CHANGED
@@ -1462,11 +1462,12 @@ var Editable$1 = function Editable(props) {
1462
1462
  // https://www.w3.org/TR/input-events-2/
1463
1463
  state.isComposing && setIsComposing(false);
1464
1464
  state.isComposing = false;
1465
- }
1465
+ } // use a weak comparison instead of 'instanceof' to allow
1466
+ // programmatic access of paste events coming from external windows
1467
+ // like cypress where cy.window does not work realibly
1466
1468
 
1467
- var window = ReactEditor.getWindow(editor);
1468
1469
 
1469
- if (data instanceof window.DataTransfer) {
1470
+ if ((data === null || data === void 0 ? void 0 : data.constructor.name) === 'DataTransfer') {
1470
1471
  ReactEditor.insertData(editor, data);
1471
1472
  } else if (typeof data === 'string') {
1472
1473
  // Only insertText operations use the native functionality, for now.
@@ -1567,11 +1568,7 @@ var Editable$1 = function Editable(props) {
1567
1568
  value: readOnly
1568
1569
  }, /*#__PURE__*/React__default['default'].createElement(DecorateContext.Provider, {
1569
1570
  value: decorate
1570
- }, /*#__PURE__*/React__default['default'].createElement(Component // COMPAT: The Grammarly Chrome extension works by changing the DOM
1571
- // out from under `contenteditable` elements, which leads to weird
1572
- // behaviors so we have to disable it like editor. (2017/04/24)
1573
- , Object.assign({
1574
- "data-gramm": false,
1571
+ }, /*#__PURE__*/React__default['default'].createElement(Component, Object.assign({
1575
1572
  role: readOnly ? undefined : 'textbox'
1576
1573
  }, attributes, {
1577
1574
  // COMPAT: Certain browsers don't support the `beforeinput` event, so we'd