grafana/.yarn/patches/slate-dev-environment-npm-0.2.5-9aeb7da7b5.patch
kay delaney a70aba1384
Chore: Update slate and related packages (#54566)
* Chore: Update slate and related packages
2022-09-06 15:23:48 +01:00

80 lines
37 KiB
Diff

diff --git a/dist/slate-dev-environment.js b/dist/slate-dev-environment.js
index 54ba8de31d5038ee0e9854dfd77e0d694b31b050..bce0f5aeff05792f442a0f5576ff38aac658e645 100644
--- a/dist/slate-dev-environment.js
+++ b/dist/slate-dev-environment.js
@@ -147,11 +147,8 @@ var FEATURE_RULES = [['inputeventslevel1', function (window) {
var event = window.InputEvent ? new window.InputEvent('input') : {};
var support = 'inputType' in event;
return support;
-}], ['inputeventslevel2', function (window) {
- var element = window.document.createElement('div');
- element.contentEditable = true;
- var support = 'onbeforeinput' in element;
- return support;
+}], ['inputeventslevel2', function (_) {
+ return false;
}]];
var features = [];
diff --git a/dist/slate-dev-environment.min.js b/dist/slate-dev-environment.min.js
index d7886c6cecd5df0f82def22eeaddab93b8d5d6c8..45d6bb936c327f476c898a8d3493213b9ba69a57 100644
--- a/dist/slate-dev-environment.min.js
+++ b/dist/slate-dev-environment.min.js
@@ -1 +1 @@
-!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r(e.SlateDevEnvironment={})}(this,function(e){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n="object"===("undefined"==typeof window?"undefined":r(window))&&"object"===("undefined"==typeof document?"undefined":r(document))&&9===document.nodeType,t=function(){return function(e,r){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,r){var n=[],t=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(t=(a=u.next()).done)&&(n.push(a.value),!r||n.length!==r);t=!0);}catch(e){o=!0,i=e}finally{try{!t&&u.return&&u.return()}finally{if(o)throw i}}return n}(e,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=void 0;if(n){var i=!0,a=!1,u=void 0;try{for(var f,l=[["edge",/Edge\/([0-9\._]+)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)$/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+)\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["android",/Android\s([0-9\.]+)/],["safari",/Version\/([0-9\._]+).*Safari/]][Symbol.iterator]();!(i=(f=l.next()).done);i=!0){var d=f.value,v=t(d,2),c=v[0];if(v[1].test(window.navigator.userAgent)){o=c;break}}}catch(e){a=!0,u=e}finally{try{!i&&l.return&&l.return()}finally{if(a)throw u}}}var s=void 0;if(n){var y=!0,m=!1,p=void 0;try{for(var S,_=[["ios",/os ([\.\_\d]+) like mac os/i],["macos",/mac os x/i],["android",/android/i],["firefoxos",/mozilla\/[a-z\.\_\d]+ \((?:mobile)|(?:tablet)/i],["windows",/windows\s*(?:nt)?\s*([\.\_\d]+)/i]][Symbol.iterator]();!(y=(S=_.next()).done);y=!0){var w=S.value,I=t(w,2),b=I[0];if(I[1].test(window.navigator.userAgent)){s=b;break}}}catch(e){m=!0,p=e}finally{try{!y&&_.return&&_.return()}finally{if(m)throw p}}}var E=[];if(n){var h=!0,A=!1,x=void 0;try{for(var O,g=[["inputeventslevel1",function(e){return"inputType"in(e.InputEvent?new e.InputEvent("input"):{})}],["inputeventslevel2",function(e){var r=e.document.createElement("div");return r.contentEditable=!0,"onbeforeinput"in r}]][Symbol.iterator]();!(h=(O=g.next()).done);h=!0){var R=O.value,T=t(R,2),N=T[0];(0,T[1])(window)&&E.push(N)}}catch(e){A=!0,x=e}finally{try{!h&&g.return&&g.return()}finally{if(A)throw x}}}var D=[[/^9([.]0|)/,28],[/^8[.]1/,27],[/^8([.]0|)/,26],[/^7[.]1/,25],[/^7([.]0|)/,24],[/^6([.]0|)/,23],[/^5[.]1/,22],[/^5([.]0|)/,21],[/^4[.]4/,20]];var P="chrome"===o,V="opera"===o,$="firefox"===o,j="safari"===o,M="ie"===o,k="edge"===o,C="android"===s,F="ios"===s,L="macos"===s,H="windows"===s,z=function(){if("android"!==s)return null;var e=window.navigator.userAgent.match(/Android\s([0-9\.]+)/);if(null==e)return null;var r=e[1],n=!0,o=!1,i=void 0;try{for(var a,u=D[Symbol.iterator]();!(n=(a=u.next()).done);n=!0){var f=a.value,l=t(f,2),d=l[0],v=l[1];if(r.match(d))return v}}catch(e){o=!0,i=e}finally{try{!n&&u.return&&u.return()}finally{if(o)throw i}}return null}(),G=E.includes("inputeventslevel1"),U=E.includes("inputeventslevel2")||C&&(28===z||null===z);e.IS_CHROME=P,e.IS_OPERA=V,e.IS_FIREFOX=$,e.IS_SAFARI=j,e.IS_IE=M,e.IS_EDGE=k,e.IS_ANDROID=C,e.IS_IOS=F,e.IS_MAC=L,e.IS_WINDOWS=H,e.ANDROID_API_VERSION=z,e.HAS_INPUT_EVENTS_LEVEL_1=G,e.HAS_INPUT_EVENTS_LEVEL_2=U,Object.defineProperty(e,"__esModule",{value:!0})});
+!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r(e.SlateDevEnvironment={})}(this,function(e){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n="object"===("undefined"==typeof window?"undefined":r(window))&&"object"===("undefined"==typeof document?"undefined":r(document))&&9===document.nodeType,t=function(){return function(e,r){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,r){var n=[],t=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(t=(a=u.next()).done)&&(n.push(a.value),!r||n.length!==r);t=!0);}catch(e){o=!0,i=e}finally{try{!t&&u.return&&u.return()}finally{if(o)throw i}}return n}(e,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=void 0;if(n){var i=!0,a=!1,u=void 0;try{for(var f,l=[["edge",/Edge\/([0-9\._]+)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)$/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+)\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["android",/Android\s([0-9\.]+)/],["safari",/Version\/([0-9\._]+).*Safari/]][Symbol.iterator]();!(i=(f=l.next()).done);i=!0){var d=f.value,v=t(d,2),c=v[0];if(v[1].test(window.navigator.userAgent)){o=c;break}}}catch(e){a=!0,u=e}finally{try{!i&&l.return&&l.return()}finally{if(a)throw u}}}var s=void 0;if(n){var y=!0,m=!1,p=void 0;try{for(var S,_=[["ios",/os ([\.\_\d]+) like mac os/i],["macos",/mac os x/i],["android",/android/i],["firefoxos",/mozilla\/[a-z\.\_\d]+ \((?:mobile)|(?:tablet)/i],["windows",/windows\s*(?:nt)?\s*([\.\_\d]+)/i]][Symbol.iterator]();!(y=(S=_.next()).done);y=!0){var w=S.value,I=t(w,2),b=I[0];if(I[1].test(window.navigator.userAgent)){s=b;break}}}catch(e){m=!0,p=e}finally{try{!y&&_.return&&_.return()}finally{if(m)throw p}}}var E=[];if(n){var h=!0,A=!1,x=void 0;try{for(var O,g=[["inputeventslevel1",function(e){return"inputType"in(e.InputEvent?new e.InputEvent("input"):{})}],["inputeventslevel2",function(_){return false}]][Symbol.iterator]();!(h=(O=g.next()).done);h=!0){var R=O.value,T=t(R,2),N=T[0];(0,T[1])(window)&&E.push(N)}}catch(e){A=!0,x=e}finally{try{!h&&g.return&&g.return()}finally{if(A)throw x}}}var D=[[/^9([.]0|)/,28],[/^8[.]1/,27],[/^8([.]0|)/,26],[/^7[.]1/,25],[/^7([.]0|)/,24],[/^6([.]0|)/,23],[/^5[.]1/,22],[/^5([.]0|)/,21],[/^4[.]4/,20]];var P="chrome"===o,V="opera"===o,$="firefox"===o,j="safari"===o,M="ie"===o,k="edge"===o,C="android"===s,F="ios"===s,L="macos"===s,H="windows"===s,z=function(){if("android"!==s)return null;var e=window.navigator.userAgent.match(/Android\s([0-9\.]+)/);if(null==e)return null;var r=e[1],n=!0,o=!1,i=void 0;try{for(var a,u=D[Symbol.iterator]();!(n=(a=u.next()).done);n=!0){var f=a.value,l=t(f,2),d=l[0],v=l[1];if(r.match(d))return v}}catch(e){o=!0,i=e}finally{try{!n&&u.return&&u.return()}finally{if(o)throw i}}return null}(),G=E.includes("inputeventslevel1"),U=E.includes("inputeventslevel2")||C&&(28===z||null===z);e.IS_CHROME=P,e.IS_OPERA=V,e.IS_FIREFOX=$,e.IS_SAFARI=j,e.IS_IE=M,e.IS_EDGE=k,e.IS_ANDROID=C,e.IS_IOS=F,e.IS_MAC=L,e.IS_WINDOWS=H,e.ANDROID_API_VERSION=z,e.HAS_INPUT_EVENTS_LEVEL_1=G,e.HAS_INPUT_EVENTS_LEVEL_2=U,Object.defineProperty(e,"__esModule",{value:!0})});
diff --git a/lib/slate-dev-environment.es.js b/lib/slate-dev-environment.es.js
index 91fcf8e4da93f86611a4c2ce854fc56cb9d2713f..0ce6ef502cd08e6b7dbcbd0ccb574d7028d7fe0f 100644
--- a/lib/slate-dev-environment.es.js
+++ b/lib/slate-dev-environment.es.js
@@ -139,11 +139,8 @@ var FEATURE_RULES = [['inputeventslevel1', function (window) {
var event = window.InputEvent ? new window.InputEvent('input') : {};
var support = 'inputType' in event;
return support;
-}], ['inputeventslevel2', function (window) {
- var element = window.document.createElement('div');
- element.contentEditable = true;
- var support = 'onbeforeinput' in element;
- return support;
+}], ['inputeventslevel2', function (_) {
+ return false;
}]];
var features = [];
diff --git a/lib/slate-dev-environment.es.js.map b/lib/slate-dev-environment.es.js.map
index 58d22034fabe7cc249ed3df4cc4d659197e556f9..b6feac76cdd689c815377367ed1af74cdec1d82f 100644
--- a/lib/slate-dev-environment.es.js.map
+++ b/lib/slate-dev-environment.es.js.map
@@ -1 +1 @@
-{"version":3,"file":"slate-dev-environment.es.js","sources":["../src/index.js"],"sourcesContent":["import isBrowser from 'is-in-browser'\n\n/**\n * Browser matching rules.\n *\n * @type {Array}\n */\n\nconst BROWSER_RULES = [\n ['edge', /Edge\\/([0-9\\._]+)/],\n ['chrome', /(?!Chrom.*OPR)Chrom(?:e|ium)\\/([0-9\\.]+)(:?\\s|$)/],\n ['firefox', /Firefox\\/([0-9\\.]+)(?:\\s|$)/],\n ['opera', /Opera\\/([0-9\\.]+)(?:\\s|$)/],\n ['opera', /OPR\\/([0-9\\.]+)(:?\\s|$)$/],\n ['ie', /Trident\\/7\\.0.*rv\\:([0-9\\.]+)\\).*Gecko$/],\n ['ie', /MSIE\\s([0-9\\.]+);.*Trident\\/[4-7].0/],\n ['ie', /MSIE\\s(7\\.0)/],\n ['android', /Android\\s([0-9\\.]+)/],\n ['safari', /Version\\/([0-9\\._]+).*Safari/],\n]\n\nlet browser\n\nif (isBrowser) {\n for (const [name, regexp] of BROWSER_RULES) {\n if (regexp.test(window.navigator.userAgent)) {\n browser = name\n break\n }\n }\n}\n\n/**\n * Operating system matching rules.\n *\n * @type {Array}\n */\n\nconst OS_RULES = [\n ['ios', /os ([\\.\\_\\d]+) like mac os/i], // must be before the macos rule\n ['macos', /mac os x/i],\n ['android', /android/i],\n ['firefoxos', /mozilla\\/[a-z\\.\\_\\d]+ \\((?:mobile)|(?:tablet)/i],\n ['windows', /windows\\s*(?:nt)?\\s*([\\.\\_\\d]+)/i],\n]\n\nlet os\n\nif (isBrowser) {\n for (const [name, regexp] of OS_RULES) {\n if (regexp.test(window.navigator.userAgent)) {\n os = name\n break\n }\n }\n}\n\n/**\n * Feature matching rules.\n *\n * @type {Array}\n */\n\nconst FEATURE_RULES = [\n [\n 'inputeventslevel1',\n window => {\n const event = window.InputEvent ? new window.InputEvent('input') : {}\n const support = 'inputType' in event\n return support\n },\n ],\n [\n 'inputeventslevel2',\n window => {\n const element = window.document.createElement('div')\n element.contentEditable = true\n const support = 'onbeforeinput' in element\n return support\n },\n ],\n]\n\nconst features = []\n\nif (isBrowser) {\n for (const [name, test] of FEATURE_RULES) {\n if (test(window)) {\n features.push(name)\n }\n }\n}\n\n/**\n * Array of regular expression matchers and their API version\n *\n * @type {Array}\n */\n\nconst ANDROID_API_VERSIONS = [\n [/^9([.]0|)/, 28],\n [/^8[.]1/, 27],\n [/^8([.]0|)/, 26],\n [/^7[.]1/, 25],\n [/^7([.]0|)/, 24],\n [/^6([.]0|)/, 23],\n [/^5[.]1/, 22],\n [/^5([.]0|)/, 21],\n [/^4[.]4/, 20],\n]\n\n/**\n * get the Android API version from the userAgent\n *\n * @return {number} version\n */\n\nfunction getAndroidApiVersion() {\n if (os !== 'android') return null\n const { userAgent } = window.navigator\n const matchData = userAgent.match(/Android\\s([0-9\\.]+)/)\n if (matchData == null) return null\n const versionString = matchData[1]\n\n for (const [regex, version] of ANDROID_API_VERSIONS) {\n if (versionString.match(regex)) return version\n }\n return null\n}\n\n/**\n * Export.\n *\n * @type {Boolean}\n */\n\nexport const IS_CHROME = browser === 'chrome'\nexport const IS_OPERA = browser === 'opera'\nexport const IS_FIREFOX = browser === 'firefox'\nexport const IS_SAFARI = browser === 'safari'\nexport const IS_IE = browser === 'ie'\nexport const IS_EDGE = browser === 'edge'\n\nexport const IS_ANDROID = os === 'android'\nexport const IS_IOS = os === 'ios'\nexport const IS_MAC = os === 'macos'\nexport const IS_WINDOWS = os === 'windows'\n\nexport const ANDROID_API_VERSION = getAndroidApiVersion()\n\nexport const HAS_INPUT_EVENTS_LEVEL_1 = features.includes('inputeventslevel1')\nexport const HAS_INPUT_EVENTS_LEVEL_2 =\n features.includes('inputeventslevel2') ||\n (IS_ANDROID && (ANDROID_API_VERSION === 28 || ANDROID_API_VERSION === null))\n"],"names":["BROWSER_RULES","browser","isBrowser","name","regexp","test","window","navigator","userAgent","OS_RULES","os","FEATURE_RULES","event","InputEvent","support","element","document","createElement","contentEditable","features","push","ANDROID_API_VERSIONS","getAndroidApiVersion","matchData","match","versionString","regex","version","IS_CHROME","IS_OPERA","IS_FIREFOX","IS_SAFARI","IS_IE","IS_EDGE","IS_ANDROID","IS_IOS","IS_MAC","IS_WINDOWS","ANDROID_API_VERSION","HAS_INPUT_EVENTS_LEVEL_1","includes","HAS_INPUT_EVENTS_LEVEL_2"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;;;;;;AAMA,IAAMA,gBAAgB,CACpB,CAAC,MAAD,EAAS,mBAAT,CADoB,EAEpB,CAAC,QAAD,EAAW,kDAAX,CAFoB,EAGpB,CAAC,SAAD,EAAY,6BAAZ,CAHoB,EAIpB,CAAC,OAAD,EAAU,2BAAV,CAJoB,EAKpB,CAAC,OAAD,EAAU,0BAAV,CALoB,EAMpB,CAAC,IAAD,EAAO,yCAAP,CANoB,EAOpB,CAAC,IAAD,EAAO,qCAAP,CAPoB,EAQpB,CAAC,IAAD,EAAO,cAAP,CARoB,EASpB,CAAC,SAAD,EAAY,qBAAZ,CAToB,EAUpB,CAAC,QAAD,EAAW,8BAAX,CAVoB,CAAtB;;AAaA,IAAIC,gBAAJ;;AAEA,IAAIC,SAAJ,EAAe;;;;;;yBACgBF,aAA7B,8HAA4C;;;;;UAAhCG,IAAgC;UAA1BC,MAA0B;;UACtCA,OAAOC,IAAP,CAAYC,OAAOC,SAAP,CAAiBC,SAA7B,CAAJ,EAA6C;kBACjCL,IAAV;;;;;;;;;;;;;;;;;;;;;;;;;;AAYN,IAAMM,WAAW,CACf,CAAC,KAAD,EAAQ,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dev-environment.es.js","sources":["../src/index.js"],"sourcesContent":["import isBrowser from 'is-in-browser'\n\n/**\n * Browser matching rules.\n *\n * @type {Array}\n */\n\nconst BROWSER_RULES = [\n ['edge', /Edge\\/([0-9\\._]+)/],\n ['chrome', /(?!Chrom.*OPR)Chrom(?:e|ium)\\/([0-9\\.]+)(:?\\s|$)/],\n ['firefox', /Firefox\\/([0-9\\.]+)(?:\\s|$)/],\n ['opera', /Opera\\/([0-9\\.]+)(?:\\s|$)/],\n ['opera', /OPR\\/([0-9\\.]+)(:?\\s|$)$/],\n ['ie', /Trident\\/7\\.0.*rv\\:([0-9\\.]+)\\).*Gecko$/],\n ['ie', /MSIE\\s([0-9\\.]+);.*Trident\\/[4-7].0/],\n ['ie', /MSIE\\s(7\\.0)/],\n ['android', /Android\\s([0-9\\.]+)/],\n ['safari', /Version\\/([0-9\\._]+).*Safari/],\n]\n\nlet browser\n\nif (isBrowser) {\n for (const [name, regexp] of BROWSER_RULES) {\n if (regexp.test(window.navigator.userAgent)) {\n browser = name\n break\n }\n }\n}\n\n/**\n * Operating system matching rules.\n *\n * @type {Array}\n */\n\nconst OS_RULES = [\n ['ios', /os ([\\.\\_\\d]+) like mac os/i], // must be before the macos rule\n ['macos', /mac os x/i],\n ['android', /android/i],\n ['firefoxos', /mozilla\\/[a-z\\.\\_\\d]+ \\((?:mobile)|(?:tablet)/i],\n ['windows', /windows\\s*(?:nt)?\\s*([\\.\\_\\d]+)/i],\n]\n\nlet os\n\nif (isBrowser) {\n for (const [name, regexp] of OS_RULES) {\n if (regexp.test(window.navigator.userAgent)) {\n os = name\n break\n }\n }\n}\n\n/**\n * Feature matching rules.\n *\n * @type {Array}\n */\n\nconst FEATURE_RULES = [\n [\n 'inputeventslevel1',\n window => {\n const event = window.InputEvent ? new window.InputEvent('input') : {}\n const support = 'inputType' in event\n return support\n },\n ],\n [\n 'inputeventslevel2',\n _ => {\n return false },\n ],\n]\n\nconst features = []\n\nif (isBrowser) {\n for (const [name, test] of FEATURE_RULES) {\n if (test(window)) {\n features.push(name)\n }\n }\n}\n\n/**\n * Array of regular expression matchers and their API version\n *\n * @type {Array}\n */\n\nconst ANDROID_API_VERSIONS = [\n [/^9([.]0|)/, 28],\n [/^8[.]1/, 27],\n [/^8([.]0|)/, 26],\n [/^7[.]1/, 25],\n [/^7([.]0|)/, 24],\n [/^6([.]0|)/, 23],\n [/^5[.]1/, 22],\n [/^5([.]0|)/, 21],\n [/^4[.]4/, 20],\n]\n\n/**\n * get the Android API version from the userAgent\n *\n * @return {number} version\n */\n\nfunction getAndroidApiVersion() {\n if (os !== 'android') return null\n const { userAgent } = window.navigator\n const matchData = userAgent.match(/Android\\s([0-9\\.]+)/)\n if (matchData == null) return null\n const versionString = matchData[1]\n\n for (const [regex, version] of ANDROID_API_VERSIONS) {\n if (versionString.match(regex)) return version\n }\n return null\n}\n\n/**\n * Export.\n *\n * @type {Boolean}\n */\n\nexport const IS_CHROME = browser === 'chrome'\nexport const IS_OPERA = browser === 'opera'\nexport const IS_FIREFOX = browser === 'firefox'\nexport const IS_SAFARI = browser === 'safari'\nexport const IS_IE = browser === 'ie'\nexport const IS_EDGE = browser === 'edge'\n\nexport const IS_ANDROID = os === 'android'\nexport const IS_IOS = os === 'ios'\nexport const IS_MAC = os === 'macos'\nexport const IS_WINDOWS = os === 'windows'\n\nexport const ANDROID_API_VERSION = getAndroidApiVersion()\n\nexport const HAS_INPUT_EVENTS_LEVEL_1 = features.includes('inputeventslevel1')\nexport const HAS_INPUT_EVENTS_LEVEL_2 =\n features.includes('inputeventslevel2') ||\n (IS_ANDROID && (ANDROID_API_VERSION === 28 || ANDROID_API_VERSION === null))\n"],"names":["BROWSER_RULES","browser","isBrowser","name","regexp","test","window","navigator","userAgent","OS_RULES","os","FEATURE_RULES","event","InputEvent","support","element","document","createElement","contentEditable","features","push","ANDROID_API_VERSIONS","getAndroidApiVersion","matchData","match","versionString","regex","version","IS_CHROME","IS_OPERA","IS_FIREFOX","IS_SAFARI","IS_IE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IAAP;MACjBE,gBAAgBF,UAAU,CAAV,CAAtB;;;;;;;0BAE+BF,oBAA/B,mIAAqD;;;;;UAAzCK,KAAyC;UAAlCC,OAAkC;;UAC/CF,cAAcD,KAAd,CAAoBE,KAApB,CAAJ,EAAgC,OAAOC,OAAP;;;;;;;;;;;;;;;;;SAE3B,IAAP;;;;;;;;;AASF,AAAO,IAAMC,YAAY3B,YAAY,QAA9B;AACP,AAAO,IAAM4B,WAAW5B,YAAY,OAA7B;AACP,AAAO,IAAM6B,aAAa7B,YAAY,SAA/B;AACP,AAAO,IAAM8B,YAAY9B,YAAY,QAA9B;AACP,AAAO,IAAM+B,QAAQ/B,YAAY,IAA1B;AACP,AAAO,IAAMgC,UAAUhC,YAAY,MAA5B;;AAEP,AAAO,IAAMiC,aAAaxB,OAAO,SAA1B;AACP,AAAO,IAAMyB,SAASzB,OAAO,KAAtB;AACP,AAAO,IAAM0B,SAAS1B,OAAO,OAAtB;AACP,AAAO,IAAM2B,aAAa3B,OAAO,SAA1B;;AAEP,AAAO,IAAM4B,sBAAsBhB,sBAA5B;;AAEP,AAAO,IAAMiB,2BAA2BpB,SAASqB,QAAT,CAAkB,mBAAlB,CAAjC;AACP,AAAO,IAAMC,2BACXtB,SAASqB,QAAT,CAAkB,mBAAlB,KACCN,eAAeI,wBAAwB,EAAxB,IAA8BA,wBAAwB,IAArE,CAFI;;;;"}
\ No newline at end of file
diff --git a/lib/slate-dev-environment.js b/lib/slate-dev-environment.js
index 4fafbdd2428a68954c10342b25ac206d4c9a25e0..fd4ae1134c4be4cbb516ed464a29d9ec99e87701 100644
--- a/lib/slate-dev-environment.js
+++ b/lib/slate-dev-environment.js
@@ -145,11 +145,8 @@ var FEATURE_RULES = [['inputeventslevel1', function (window) {
var event = window.InputEvent ? new window.InputEvent('input') : {};
var support = 'inputType' in event;
return support;
-}], ['inputeventslevel2', function (window) {
- var element = window.document.createElement('div');
- element.contentEditable = true;
- var support = 'onbeforeinput' in element;
- return support;
+}], ['inputeventslevel2', function (_) {
+ return false;
}]];
var features = [];
diff --git a/lib/slate-dev-environment.js.map b/lib/slate-dev-environment.js.map
index 32ae85f6ff65055c6875e84469fa61979c37d7df..6105b7b3385781dbd8c3b2dfd940d17355bfecc0 100644
--- a/lib/slate-dev-environment.js.map
+++ b/lib/slate-dev-environment.js.map
@@ -1 +1 @@
-{"version":3,"file":"slate-dev-environment.js","sources":["../src/index.js"],"sourcesContent":["import isBrowser from 'is-in-browser'\n\n/**\n * Browser matching rules.\n *\n * @type {Array}\n */\n\nconst BROWSER_RULES = [\n ['edge', /Edge\\/([0-9\\._]+)/],\n ['chrome', /(?!Chrom.*OPR)Chrom(?:e|ium)\\/([0-9\\.]+)(:?\\s|$)/],\n ['firefox', /Firefox\\/([0-9\\.]+)(?:\\s|$)/],\n ['opera', /Opera\\/([0-9\\.]+)(?:\\s|$)/],\n ['opera', /OPR\\/([0-9\\.]+)(:?\\s|$)$/],\n ['ie', /Trident\\/7\\.0.*rv\\:([0-9\\.]+)\\).*Gecko$/],\n ['ie', /MSIE\\s([0-9\\.]+);.*Trident\\/[4-7].0/],\n ['ie', /MSIE\\s(7\\.0)/],\n ['android', /Android\\s([0-9\\.]+)/],\n ['safari', /Version\\/([0-9\\._]+).*Safari/],\n]\n\nlet browser\n\nif (isBrowser) {\n for (const [name, regexp] of BROWSER_RULES) {\n if (regexp.test(window.navigator.userAgent)) {\n browser = name\n break\n }\n }\n}\n\n/**\n * Operating system matching rules.\n *\n * @type {Array}\n */\n\nconst OS_RULES = [\n ['ios', /os ([\\.\\_\\d]+) like mac os/i], // must be before the macos rule\n ['macos', /mac os x/i],\n ['android', /android/i],\n ['firefoxos', /mozilla\\/[a-z\\.\\_\\d]+ \\((?:mobile)|(?:tablet)/i],\n ['windows', /windows\\s*(?:nt)?\\s*([\\.\\_\\d]+)/i],\n]\n\nlet os\n\nif (isBrowser) {\n for (const [name, regexp] of OS_RULES) {\n if (regexp.test(window.navigator.userAgent)) {\n os = name\n break\n }\n }\n}\n\n/**\n * Feature matching rules.\n *\n * @type {Array}\n */\n\nconst FEATURE_RULES = [\n [\n 'inputeventslevel1',\n window => {\n const event = window.InputEvent ? new window.InputEvent('input') : {}\n const support = 'inputType' in event\n return support\n },\n ],\n [\n 'inputeventslevel2',\n window => {\n const element = window.document.createElement('div')\n element.contentEditable = true\n const support = 'onbeforeinput' in element\n return support\n },\n ],\n]\n\nconst features = []\n\nif (isBrowser) {\n for (const [name, test] of FEATURE_RULES) {\n if (test(window)) {\n features.push(name)\n }\n }\n}\n\n/**\n * Array of regular expression matchers and their API version\n *\n * @type {Array}\n */\n\nconst ANDROID_API_VERSIONS = [\n [/^9([.]0|)/, 28],\n [/^8[.]1/, 27],\n [/^8([.]0|)/, 26],\n [/^7[.]1/, 25],\n [/^7([.]0|)/, 24],\n [/^6([.]0|)/, 23],\n [/^5[.]1/, 22],\n [/^5([.]0|)/, 21],\n [/^4[.]4/, 20],\n]\n\n/**\n * get the Android API version from the userAgent\n *\n * @return {number} version\n */\n\nfunction getAndroidApiVersion() {\n if (os !== 'android') return null\n const { userAgent } = window.navigator\n const matchData = userAgent.match(/Android\\s([0-9\\.]+)/)\n if (matchData == null) return null\n const versionString = matchData[1]\n\n for (const [regex, version] of ANDROID_API_VERSIONS) {\n if (versionString.match(regex)) return version\n }\n return null\n}\n\n/**\n * Export.\n *\n * @type {Boolean}\n */\n\nexport const IS_CHROME = browser === 'chrome'\nexport const IS_OPERA = browser === 'opera'\nexport const IS_FIREFOX = browser === 'firefox'\nexport const IS_SAFARI = browser === 'safari'\nexport const IS_IE = browser === 'ie'\nexport const IS_EDGE = browser === 'edge'\n\nexport const IS_ANDROID = os === 'android'\nexport const IS_IOS = os === 'ios'\nexport const IS_MAC = os === 'macos'\nexport const IS_WINDOWS = os === 'windows'\n\nexport const ANDROID_API_VERSION = getAndroidApiVersion()\n\nexport const HAS_INPUT_EVENTS_LEVEL_1 = features.includes('inputeventslevel1')\nexport const HAS_INPUT_EVENTS_LEVEL_2 =\n features.includes('inputeventslevel2') ||\n (IS_ANDROID && (ANDROID_API_VERSION === 28 || ANDROID_API_VERSION === null))\n"],"names":["BROWSER_RULES","browser","isBrowser","name","regexp","test","window","navigator","userAgent","OS_RULES","os","FEATURE_RULES","event","InputEvent","support","element","document","createElement","contentEditable","features","push","ANDROID_API_VERSIONS","getAndroidApiVersion","matchData","match","versionString","regex","version","IS_CHROME","IS_OPERA","IS_FIREFOX","IS_SAFARI","IS_IE","IS_EDGE","IS_ANDROID","IS_IOS","IS_MAC","IS_WINDOWS","ANDROID_API_VERSION","HAS_INPUT_EVENTS_LEVEL_1","includes","HAS_INPUT_EVENTS_LEVEL_2"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;;;;;;AAMA,IAAMA,gBAAgB,CACpB,CAAC,MAAD,EAAS,mBAAT,CADoB,EAEpB,CAAC,QAAD,EAAW,kDAAX,CAFoB,EAGpB,CAAC,SAAD,EAAY,6BAAZ,CAHoB,EAIpB,CAAC,OAAD,EAAU,2BAAV,CAJoB,EAKpB,CAAC,OAAD,EAAU,0BAAV,CALoB,EAMpB,CAAC,IAAD,EAAO,yCAAP,CANoB,EAOpB,CAAC,IAAD,EAAO,qCAAP,CAPoB,EAQpB,CAAC,IAAD,EAAO,cAAP,CARoB,EASpB,CAAC,SAAD,EAAY,qBAAZ,CAToB,EAUpB,CAAC,QAAD,EAAW,8BAAX,CAVoB,CAAtB;;AAaA,IAAIC,gBAAJ;;AAEA,IAAIC,SAAJ,EAAe;;;;;;yBACgBF,aAA7B,8HAA4C;;;;;UAAhCG,IAAgC;UAA1BC,MAA0B;;UACtCA,OAAOC,IAAP,CAAYC,OAAOC,SAAP,CAAiBC,SAA7B,CAAJ,EAA6C;kBACjCL,IAAV;;;;;;;;;;;;;;;;;;;;;;;;;;AAYN,IAAMM,WAAW,CACf,CAAC,KAAD,EAAQ,6BAAR,CADe;AAEf,CAAC,OAAD,EAAU,WAAV,CAFe,EAGf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rowser from 'is-in-browser'\n\n/**\n * Browser matching rules.\n *\n * @type {Array}\n */\n\nconst BROWSER_RULES = [\n ['edge', /Edge\\/([0-9\\._]+)/],\n ['chrome', /(?!Chrom.*OPR)Chrom(?:e|ium)\\/([0-9\\.]+)(:?\\s|$)/],\n ['firefox', /Firefox\\/([0-9\\.]+)(?:\\s|$)/],\n ['opera', /Opera\\/([0-9\\.]+)(?:\\s|$)/],\n ['opera', /OPR\\/([0-9\\.]+)(:?\\s|$)$/],\n ['ie', /Trident\\/7\\.0.*rv\\:([0-9\\.]+)\\).*Gecko$/],\n ['ie', /MSIE\\s([0-9\\.]+);.*Trident\\/[4-7].0/],\n ['ie', /MSIE\\s(7\\.0)/],\n ['android', /Android\\s([0-9\\.]+)/],\n ['safari', /Version\\/([0-9\\._]+).*Safari/],\n]\n\nlet browser\n\nif (isBrowser) {\n for (const [name, regexp] of BROWSER_RULES) {\n if (regexp.test(window.navigator.userAgent)) {\n browser = name\n break\n }\n }\n}\n\n/**\n * Operating system matching rules.\n *\n * @type {Array}\n */\n\nconst OS_RULES = [\n ['ios', /os ([\\.\\_\\d]+) like mac os/i], // must be before the macos rule\n ['macos', /mac os x/i],\n ['android', /android/i],\n ['firefoxos', /mozilla\\/[a-z\\.\\_\\d]+ \\((?:mobile)|(?:tablet)/i],\n ['windows', /windows\\s*(?:nt)?\\s*([\\.\\_\\d]+)/i],\n]\n\nlet os\n\nif (isBrowser) {\n for (const [name, regexp] of OS_RULES) {\n if (regexp.test(window.navigator.userAgent)) {\n os = name\n break\n }\n }\n}\n\n/**\n * Feature matching rules.\n *\n * @type {Array}\n */\n\nconst FEATURE_RULES = [\n [\n 'inputeventslevel1',\n window => {\n const event = window.InputEvent ? new window.InputEvent('input') : {}\n const support = 'inputType' in event\n return support\n },\n ],\n [\n 'inputeventslevel2',\n _ => {\n return false\n },\n ],\n]\n\nconst features = []\n\nif (isBrowser) {\n for (const [name, test] of FEATURE_RULES) {\n if (test(window)) {\n features.push(name)\n }\n }\n}\n\n/**\n * Array of regular expression matchers and their API version\n *\n * @type {Array}\n */\n\nconst ANDROID_API_VERSIONS = [\n [/^9([.]0|)/, 28],\n [/^8[.]1/, 27],\n [/^8([.]0|)/, 26],\n [/^7[.]1/, 25],\n [/^7([.]0|)/, 24],\n [/^6([.]0|)/, 23],\n [/^5[.]1/, 22],\n [/^5([.]0|)/, 21],\n [/^4[.]4/, 20],\n]\n\n/**\n * get the Android API version from the userAgent\n *\n * @return {number} version\n */\n\nfunction getAndroidApiVersion() {\n if (os !== 'android') return null\n const { userAgent } = window.navigator\n const matchData = userAgent.match(/Android\\s([0-9\\.]+)/)\n if (matchData == null) return null\n const versionString = matchData[1]\n\n for (const [regex, version] of ANDROID_API_VERSIONS) {\n if (versionString.match(regex)) return version\n }\n return null\n}\n\n/**\n * Export.\n *\n * @type {Boolean}\n */\n\nexport const IS_CHROME = browser === 'chrome'\nexport const IS_OPERA = browser === 'opera'\nexport const IS_FIREFOX = browser === 'firefox'\nexport const IS_SAFARI = browser === 'safari'\nexport const IS_IE = browser === 'ie'\nexport const IS_EDGE = browser === 'edge'\n\nexport const IS_ANDROID = os === 'android'\nexport const IS_IOS = os === 'ios'\nexport const IS_MAC = os === 'macos'\nexport const IS_WINDOWS = os === 'windows'\n\nexport const ANDROID_API_VERSION = getAndroidApiVersion()\n\nexport const HAS_INPUT_EVENTS_LEVEL_1 = features.includes('inputeventslevel1')\nexport const HAS_INPUT_EVENTS_LEVEL_2 =\n features.includes('inputeventslevel2') ||\n (IS_ANDROID && (ANDROID_API_VERSION === 28 || ANDROID_API_VERSION === null))\n"],"names":["BROWSER_RULES","browser","isBrowser","name","regexp","test","window","navigator","userAgent","OS_RULES","os","FEATURE_RULES","event","InputEvent","support","element","document","createElement","contentEditable","features","push","ANDROID_API_VERSIONS","getAndroidApiVersion","matchData","match","versionString","regex","version","IS_CHROME","IS_OPERA","IS_FIREFOX","IS_SAFARI","IS_IE","IS_EDGE","IS_ANDROID","IS_IOS","IS_MAC","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