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/index.js
CHANGED
|
@@ -1264,7 +1264,6 @@ var Leaf = function Leaf(props) {
|
|
|
1264
1264
|
style: {
|
|
1265
1265
|
pointerEvents: 'none',
|
|
1266
1266
|
display: 'inline-block',
|
|
1267
|
-
verticalAlign: 'text-top',
|
|
1268
1267
|
width: '0',
|
|
1269
1268
|
maxWidth: '100%',
|
|
1270
1269
|
whiteSpace: 'nowrap',
|
|
@@ -1589,7 +1588,9 @@ var IS_APPLE = typeof navigator !== 'undefined' && /Mac OS X/.test(navigator.use
|
|
|
1589
1588
|
var IS_FIREFOX = typeof navigator !== 'undefined' && /^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);
|
|
1590
1589
|
var IS_SAFARI = typeof navigator !== 'undefined' && /Version\/[\d\.]+.*Safari/.test(navigator.userAgent); // "modern" Edge was released at 79.x
|
|
1591
1590
|
|
|
1592
|
-
var IS_EDGE_LEGACY = typeof navigator !== 'undefined' && /Edge?\/(?:[0-6][0-9]|[0-7][0-8])/i.test(navigator.userAgent);
|
|
1591
|
+
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
|
|
1592
|
+
|
|
1593
|
+
var IS_CHROME_LEGACY = typeof navigator !== 'undefined' && /Chrome?\/(?:[0-7][0-5]|[0-6][0-9])/i.test(navigator.userAgent);
|
|
1593
1594
|
|
|
1594
1595
|
/**
|
|
1595
1596
|
* Hotkey mappings for each platform.
|
|
@@ -1683,8 +1684,9 @@ var Hotkeys = {
|
|
|
1683
1684
|
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; }
|
|
1684
1685
|
|
|
1685
1686
|
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; }
|
|
1687
|
+
// Chrome Legacy doesn't support `beforeinput` correctly
|
|
1686
1688
|
|
|
1687
|
-
var HAS_BEFORE_INPUT_SUPPORT = !(IS_FIREFOX || IS_EDGE_LEGACY);
|
|
1689
|
+
var HAS_BEFORE_INPUT_SUPPORT = !(IS_FIREFOX || IS_EDGE_LEGACY || IS_CHROME_LEGACY);
|
|
1688
1690
|
/**
|
|
1689
1691
|
* Editable.
|
|
1690
1692
|
*/
|
|
@@ -1938,13 +1940,13 @@ var Editable = function Editable(props) {
|
|
|
1938
1940
|
// https://github.com/facebook/react/issues/11211
|
|
1939
1941
|
|
|
1940
1942
|
useIsomorphicLayoutEffect(function () {
|
|
1941
|
-
if (ref.current) {
|
|
1943
|
+
if (ref.current && HAS_BEFORE_INPUT_SUPPORT) {
|
|
1942
1944
|
// @ts-ignore The `beforeinput` event isn't recognized.
|
|
1943
1945
|
ref.current.addEventListener('beforeinput', onDOMBeforeInput);
|
|
1944
1946
|
}
|
|
1945
1947
|
|
|
1946
1948
|
return function () {
|
|
1947
|
-
if (ref.current) {
|
|
1949
|
+
if (ref.current && HAS_BEFORE_INPUT_SUPPORT) {
|
|
1948
1950
|
// @ts-ignore The `beforeinput` event isn't recognized.
|
|
1949
1951
|
ref.current.removeEventListener('beforeinput', onDOMBeforeInput);
|
|
1950
1952
|
}
|