slate-react 0.58.3 → 0.58.4
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/components/editable.d.ts.map +1 -1
- package/dist/components/leaf.d.ts.map +1 -1
- package/dist/index.es.js +7 -5
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/dist/slate-react.js +7 -5
- package/dist/slate-react.min.js +1 -1
- package/dist/utils/environment.d.ts +1 -0
- package/dist/utils/environment.d.ts.map +1 -1
- package/package.json +4 -4
package/dist/slate-react.js
CHANGED
|
@@ -28663,7 +28663,6 @@
|
|
|
28663
28663
|
style: {
|
|
28664
28664
|
pointerEvents: 'none',
|
|
28665
28665
|
display: 'inline-block',
|
|
28666
|
-
verticalAlign: 'text-top',
|
|
28667
28666
|
width: '0',
|
|
28668
28667
|
maxWidth: '100%',
|
|
28669
28668
|
whiteSpace: 'nowrap',
|
|
@@ -29244,7 +29243,9 @@
|
|
|
29244
29243
|
var IS_FIREFOX = typeof navigator !== 'undefined' && /^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);
|
|
29245
29244
|
var IS_SAFARI = typeof navigator !== 'undefined' && /Version\/[\d\.]+.*Safari/.test(navigator.userAgent); // "modern" Edge was released at 79.x
|
|
29246
29245
|
|
|
29247
|
-
var IS_EDGE_LEGACY = typeof navigator !== 'undefined' && /Edge?\/(?:[0-6][0-9]|[0-7][0-8])/i.test(navigator.userAgent);
|
|
29246
|
+
var IS_EDGE_LEGACY = typeof navigator !== 'undefined' && /Edge?\/(?:[0-6][0-9]|[0-7][0-8])/i.test(navigator.userAgent); // Native beforeInput events don't work well with react on Chrome 75 and older, Chrome 76+ can use beforeInput
|
|
29247
|
+
|
|
29248
|
+
var IS_CHROME_LEGACY = typeof navigator !== 'undefined' && /Chrome?\/(?:[0-7][0-5]|[0-6][0-9])/i.test(navigator.userAgent);
|
|
29248
29249
|
|
|
29249
29250
|
/**
|
|
29250
29251
|
* Hotkey mappings for each platform.
|
|
@@ -29338,8 +29339,9 @@
|
|
|
29338
29339
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
29339
29340
|
|
|
29340
29341
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
29342
|
+
// Chrome Legacy doesn't support `beforeinput` correctly
|
|
29341
29343
|
|
|
29342
|
-
var HAS_BEFORE_INPUT_SUPPORT = !(IS_FIREFOX || IS_EDGE_LEGACY);
|
|
29344
|
+
var HAS_BEFORE_INPUT_SUPPORT = !(IS_FIREFOX || IS_EDGE_LEGACY || IS_CHROME_LEGACY);
|
|
29343
29345
|
/**
|
|
29344
29346
|
* Editable.
|
|
29345
29347
|
*/
|
|
@@ -29593,13 +29595,13 @@
|
|
|
29593
29595
|
// https://github.com/facebook/react/issues/11211
|
|
29594
29596
|
|
|
29595
29597
|
useIsomorphicLayoutEffect(function () {
|
|
29596
|
-
if (ref.current) {
|
|
29598
|
+
if (ref.current && HAS_BEFORE_INPUT_SUPPORT) {
|
|
29597
29599
|
// @ts-ignore The `beforeinput` event isn't recognized.
|
|
29598
29600
|
ref.current.addEventListener('beforeinput', onDOMBeforeInput);
|
|
29599
29601
|
}
|
|
29600
29602
|
|
|
29601
29603
|
return function () {
|
|
29602
|
-
if (ref.current) {
|
|
29604
|
+
if (ref.current && HAS_BEFORE_INPUT_SUPPORT) {
|
|
29603
29605
|
// @ts-ignore The `beforeinput` event isn't recognized.
|
|
29604
29606
|
ref.current.removeEventListener('beforeinput', onDOMBeforeInput);
|
|
29605
29607
|
}
|