slate-react 0.95.0 → 0.96.0-2023431122027

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
@@ -81,7 +81,7 @@ var IS_IOS = typeof navigator !== 'undefined' && typeof window !== 'undefined' &
81
81
  var IS_APPLE = typeof navigator !== 'undefined' && /Mac OS X/.test(navigator.userAgent);
82
82
  var IS_ANDROID = typeof navigator !== 'undefined' && /Android/.test(navigator.userAgent);
83
83
  var IS_FIREFOX = typeof navigator !== 'undefined' && /^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);
84
- var IS_SAFARI = typeof navigator !== 'undefined' && /Version\/[\d\.]+.*Safari/.test(navigator.userAgent); // "modern" Edge was released at 79.x
84
+ var IS_WEBKIT = typeof navigator !== 'undefined' && /AppleWebKit/.test(navigator.userAgent); // "modern" Edge was released at 79.x
85
85
 
86
86
  var IS_EDGE_LEGACY = typeof navigator !== 'undefined' && /Edge?\/(?:[0-6][0-9]|[0-7][0-8])(?:\.)/i.test(navigator.userAgent);
87
87
  var IS_CHROME = typeof navigator !== 'undefined' && /Chrome/i.test(navigator.userAgent); // Native `beforeInput` events don't work well with react on Chrome 75
@@ -2531,7 +2531,7 @@ var Leaf = props => {
2531
2531
  userSelect: 'none',
2532
2532
  textDecoration: 'none',
2533
2533
  // Fixes https://github.com/udecode/plate/issues/2315
2534
- WebkitUserModify: IS_SAFARI ? 'inherit' : undefined
2534
+ WebkitUserModify: IS_WEBKIT ? 'inherit' : undefined
2535
2535
  },
2536
2536
  contentEditable: false,
2537
2537
  ref: callbackPlaceholderRef
@@ -3901,7 +3901,7 @@ var Editable = props => {
3901
3901
  // https://stackoverflow.com/questions/12353247/force-contenteditable-div-to-stop-accepting-input-after-it-loses-focus-under-web
3902
3902
 
3903
3903
 
3904
- if (IS_SAFARI) {
3904
+ if (IS_WEBKIT) {
3905
3905
  var domSelection = root.getSelection();
3906
3906
  domSelection === null || domSelection === void 0 ? void 0 : domSelection.removeAllRanges();
3907
3907
  }
@@ -3978,7 +3978,7 @@ var Editable = props => {
3978
3978
  // ends since it will already have been committed to the DOM.
3979
3979
 
3980
3980
 
3981
- if (!IS_SAFARI && !IS_FIREFOX_LEGACY && !IS_IOS && !IS_WECHATBROWSER && !IS_UC_MOBILE && event.data) {
3981
+ if (!IS_WEBKIT && !IS_FIREFOX_LEGACY && !IS_IOS && !IS_WECHATBROWSER && !IS_UC_MOBILE && event.data) {
3982
3982
  var placeholderMarks = EDITOR_TO_PENDING_INSERTION_MARKS.get(editor);
3983
3983
  EDITOR_TO_PENDING_INSERTION_MARKS.delete(editor); // Ensure we insert text with the marks the user was actually seeing
3984
3984
 
@@ -4435,7 +4435,7 @@ var Editable = props => {
4435
4435
  return;
4436
4436
  }
4437
4437
  } else {
4438
- if (IS_CHROME || IS_SAFARI) {
4438
+ if (IS_CHROME || IS_WEBKIT) {
4439
4439
  // COMPAT: Chrome and Safari support `beforeinput` event but do not fire
4440
4440
  // an event when deleting backwards in a selected void inline node
4441
4441
  if (selection && (Hotkeys.isDeleteBackward(nativeEvent) || Hotkeys.isDeleteForward(nativeEvent)) && Range.isCollapsed(selection)) {
@@ -4462,7 +4462,7 @@ var Editable = props => {
4462
4462
  // COMPAT: Safari InputEvents generated by pasting won't include
4463
4463
  // application/x-slate-fragment items, so use the
4464
4464
  // ClipboardEvent here. (2023/03/15)
4465
- if (!HAS_BEFORE_INPUT_SUPPORT || isPlainTextOnlyPaste(event.nativeEvent) || IS_SAFARI) {
4465
+ if (!HAS_BEFORE_INPUT_SUPPORT || isPlainTextOnlyPaste(event.nativeEvent) || IS_WEBKIT) {
4466
4466
  event.preventDefault();
4467
4467
  ReactEditor.insertData(editor, event.clipboardData);
4468
4468
  }