slate-react 0.83.1 → 0.83.2-2022108124637

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
@@ -743,7 +743,6 @@ var ReactEditor = {
743
743
  * Deselect the editor.
744
744
  */
745
745
  deselect: function deselect(editor) {
746
- ReactEditor.toDOMNode(editor, editor);
747
746
  var selection = editor.selection;
748
747
  var root = ReactEditor.findDocumentOrShadowRoot(editor);
749
748
  var domSelection = root.getSelection();
@@ -1475,7 +1474,7 @@ var Leaf = function Leaf(props) {
1475
1474
  var editor = useSlateStatic();
1476
1475
  React.useEffect(function () {
1477
1476
  var placeholderEl = placeholderRef === null || placeholderRef === void 0 ? void 0 : placeholderRef.current;
1478
- var editorEl = document.querySelector('[data-slate-editor="true"]');
1477
+ var editorEl = ReactEditor.toDOMNode(editor, editor);
1479
1478
 
1480
1479
  if (!placeholderEl || !editorEl) {
1481
1480
  return;
@@ -3993,14 +3992,6 @@ var Editable = function Editable(props) {
3993
3992
  case 'insertReplacementText':
3994
3993
  case 'insertText':
3995
3994
  {
3996
- var _selection = editor.selection;
3997
-
3998
- if (_selection) {
3999
- if (slate.Range.isExpanded(_selection)) {
4000
- slate.Editor.deleteFragment(editor);
4001
- }
4002
- }
4003
-
4004
3995
  if (type === 'insertFromComposition') {
4005
3996
  // COMPAT: in Safari, `compositionend` is dispatched after the
4006
3997
  // `beforeinput` for "insertFromComposition". But if we wait for it
@@ -5081,11 +5072,11 @@ var Slate = function Slate(props) {
5081
5072
 
5082
5073
  var _React$useState = React__default['default'].useState(function () {
5083
5074
  if (!slate.Node.isNodeList(value)) {
5084
- throw new Error("[Slate] value is invalid! Expected a list of elements" + "but got: ".concat(slate.Scrubber.stringify(value)));
5075
+ throw new Error("[Slate] value is invalid! Expected a list of elements but got: ".concat(slate.Scrubber.stringify(value)));
5085
5076
  }
5086
5077
 
5087
5078
  if (!slate.Editor.isEditor(editor)) {
5088
- throw new Error("[Slate] editor is invalid! you passed:" + "".concat(slate.Scrubber.stringify(editor)));
5079
+ throw new Error("[Slate] editor is invalid! You passed: ".concat(slate.Scrubber.stringify(editor)));
5089
5080
  }
5090
5081
 
5091
5082
  editor.children = value;