slate-dev-environment
Advanced tools
Comparing version 0.2.1 to 0.2.2
@@ -194,2 +194,57 @@ (function (global, factory) { | ||
/** | ||
* Array of regular expression matchers and their API version | ||
* | ||
* @type {Array} | ||
*/ | ||
var ANDROID_API_VERSIONS = [[/^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]]; | ||
/** | ||
* get the Android API version from the userAgent | ||
* | ||
* @return {number} version | ||
*/ | ||
function getAndroidApiVersion() { | ||
if (os !== 'android') return null; | ||
var userAgent = window.navigator.userAgent; | ||
var matchData = userAgent.match(/Android\s([0-9\.]+)/); | ||
if (matchData == null) return null; | ||
var versionString = matchData[1]; | ||
var _iteratorNormalCompletion4 = true; | ||
var _didIteratorError4 = false; | ||
var _iteratorError4 = undefined; | ||
try { | ||
for (var _iterator4 = ANDROID_API_VERSIONS[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { | ||
var _ref7 = _step4.value; | ||
var _ref8 = slicedToArray(_ref7, 2); | ||
var regex = _ref8[0]; | ||
var version = _ref8[1]; | ||
if (versionString.match(regex)) return version; | ||
} | ||
} catch (err) { | ||
_didIteratorError4 = true; | ||
_iteratorError4 = err; | ||
} finally { | ||
try { | ||
if (!_iteratorNormalCompletion4 && _iterator4.return) { | ||
_iterator4.return(); | ||
} | ||
} finally { | ||
if (_didIteratorError4) { | ||
throw _iteratorError4; | ||
} | ||
} | ||
} | ||
return null; | ||
} | ||
/** | ||
* Export. | ||
@@ -212,4 +267,6 @@ * | ||
var ANDROID_API_VERSION = getAndroidApiVersion(); | ||
var HAS_INPUT_EVENTS_LEVEL_1 = features.includes('inputeventslevel1'); | ||
var HAS_INPUT_EVENTS_LEVEL_2 = features.includes('inputeventslevel2'); | ||
var HAS_INPUT_EVENTS_LEVEL_2 = features.includes('inputeventslevel2') || IS_ANDROID && (ANDROID_API_VERSION === 28 || ANDROID_API_VERSION === null); | ||
@@ -226,2 +283,3 @@ exports.IS_CHROME = IS_CHROME; | ||
exports.IS_WINDOWS = IS_WINDOWS; | ||
exports.ANDROID_API_VERSION = ANDROID_API_VERSION; | ||
exports.HAS_INPUT_EVENTS_LEVEL_1 = HAS_INPUT_EVENTS_LEVEL_1; | ||
@@ -228,0 +286,0 @@ exports.HAS_INPUT_EVENTS_LEVEL_2 = HAS_INPUT_EVENTS_LEVEL_2; |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.SlateDevEnvironment={})}(this,function(e){"use strict";var t="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":t(window))&&"object"===("undefined"==typeof document?"undefined":t(document))&&9===document.nodeType,r=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,f=e[Symbol.iterator]();!(r=(a=f.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&f.return&&f.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=void 0;if(n){var i=!0,a=!1,f=void 0;try{for(var d,u=[["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=(d=u.next()).done);i=!0){var l=r(d.value,2),s=l[0];if(l[1].test(window.navigator.userAgent)){o=s;break}}}catch(e){a=!0,f=e}finally{try{!i&&u.return&&u.return()}finally{if(a)throw f}}}var c=void 0;if(n){var y=!0,v=!1,p=void 0;try{for(var m,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=(m=S.next()).done);y=!0){var _=r(m.value,2),b=_[0];if(_[1].test(window.navigator.userAgent)){c=b;break}}}catch(e){v=!0,p=e}finally{try{!y&&S.return&&S.return()}finally{if(v)throw p}}}var w=[];if(n){var E=!0,I=!1,h=void 0;try{for(var x,A=[["inputeventslevel1",function(e){return"inputType"in(e.InputEvent?new e.InputEvent("input"):{})}],["inputeventslevel2",function(e){var t=e.document.createElement("div");return t.contentEditable=!0,"onbeforeinput"in t}]][Symbol.iterator]();!(E=(x=A.next()).done);E=!0){var O=r(x.value,2),T=O[0];(0,O[1])(window)&&w.push(T)}}catch(e){I=!0,h=e}finally{try{!E&&A.return&&A.return()}finally{if(I)throw h}}}var g="chrome"===o,R="opera"===o,N="firefox"===o,P="safari"===o,$="ie"===o,j="edge"===o,D="android"===c,M="ios"===c,V="macos"===c,k="windows"===c,C=w.includes("inputeventslevel1"),F=w.includes("inputeventslevel2");e.IS_CHROME=g,e.IS_OPERA=R,e.IS_FIREFOX=N,e.IS_SAFARI=P,e.IS_IE=$,e.IS_EDGE=j,e.IS_ANDROID=D,e.IS_IOS=M,e.IS_MAC=V,e.IS_WINDOWS=k,e.HAS_INPUT_EVENTS_LEVEL_1=C,e.HAS_INPUT_EVENTS_LEVEL_2=F,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(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})}); |
@@ -186,2 +186,57 @@ import isBrowser from 'is-in-browser'; | ||
/** | ||
* Array of regular expression matchers and their API version | ||
* | ||
* @type {Array} | ||
*/ | ||
var ANDROID_API_VERSIONS = [[/^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]]; | ||
/** | ||
* get the Android API version from the userAgent | ||
* | ||
* @return {number} version | ||
*/ | ||
function getAndroidApiVersion() { | ||
if (os !== 'android') return null; | ||
var userAgent = window.navigator.userAgent; | ||
var matchData = userAgent.match(/Android\s([0-9\.]+)/); | ||
if (matchData == null) return null; | ||
var versionString = matchData[1]; | ||
var _iteratorNormalCompletion4 = true; | ||
var _didIteratorError4 = false; | ||
var _iteratorError4 = undefined; | ||
try { | ||
for (var _iterator4 = ANDROID_API_VERSIONS[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { | ||
var _ref7 = _step4.value; | ||
var _ref8 = slicedToArray(_ref7, 2); | ||
var regex = _ref8[0]; | ||
var version = _ref8[1]; | ||
if (versionString.match(regex)) return version; | ||
} | ||
} catch (err) { | ||
_didIteratorError4 = true; | ||
_iteratorError4 = err; | ||
} finally { | ||
try { | ||
if (!_iteratorNormalCompletion4 && _iterator4.return) { | ||
_iterator4.return(); | ||
} | ||
} finally { | ||
if (_didIteratorError4) { | ||
throw _iteratorError4; | ||
} | ||
} | ||
} | ||
return null; | ||
} | ||
/** | ||
* Export. | ||
@@ -204,6 +259,8 @@ * | ||
var ANDROID_API_VERSION = getAndroidApiVersion(); | ||
var HAS_INPUT_EVENTS_LEVEL_1 = features.includes('inputeventslevel1'); | ||
var HAS_INPUT_EVENTS_LEVEL_2 = features.includes('inputeventslevel2'); | ||
var HAS_INPUT_EVENTS_LEVEL_2 = features.includes('inputeventslevel2') || IS_ANDROID && (ANDROID_API_VERSION === 28 || ANDROID_API_VERSION === null); | ||
export { IS_CHROME, IS_OPERA, IS_FIREFOX, IS_SAFARI, IS_IE, IS_EDGE, IS_ANDROID, IS_IOS, IS_MAC, IS_WINDOWS, HAS_INPUT_EVENTS_LEVEL_1, HAS_INPUT_EVENTS_LEVEL_2 }; | ||
export { 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, HAS_INPUT_EVENTS_LEVEL_2 }; | ||
//# sourceMappingURL=slate-dev-environment.es.js.map |
@@ -192,2 +192,57 @@ 'use strict'; | ||
/** | ||
* Array of regular expression matchers and their API version | ||
* | ||
* @type {Array} | ||
*/ | ||
var ANDROID_API_VERSIONS = [[/^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]]; | ||
/** | ||
* get the Android API version from the userAgent | ||
* | ||
* @return {number} version | ||
*/ | ||
function getAndroidApiVersion() { | ||
if (os !== 'android') return null; | ||
var userAgent = window.navigator.userAgent; | ||
var matchData = userAgent.match(/Android\s([0-9\.]+)/); | ||
if (matchData == null) return null; | ||
var versionString = matchData[1]; | ||
var _iteratorNormalCompletion4 = true; | ||
var _didIteratorError4 = false; | ||
var _iteratorError4 = undefined; | ||
try { | ||
for (var _iterator4 = ANDROID_API_VERSIONS[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { | ||
var _ref7 = _step4.value; | ||
var _ref8 = slicedToArray(_ref7, 2); | ||
var regex = _ref8[0]; | ||
var version = _ref8[1]; | ||
if (versionString.match(regex)) return version; | ||
} | ||
} catch (err) { | ||
_didIteratorError4 = true; | ||
_iteratorError4 = err; | ||
} finally { | ||
try { | ||
if (!_iteratorNormalCompletion4 && _iterator4.return) { | ||
_iterator4.return(); | ||
} | ||
} finally { | ||
if (_didIteratorError4) { | ||
throw _iteratorError4; | ||
} | ||
} | ||
} | ||
return null; | ||
} | ||
/** | ||
* Export. | ||
@@ -210,4 +265,6 @@ * | ||
var ANDROID_API_VERSION = getAndroidApiVersion(); | ||
var HAS_INPUT_EVENTS_LEVEL_1 = features.includes('inputeventslevel1'); | ||
var HAS_INPUT_EVENTS_LEVEL_2 = features.includes('inputeventslevel2'); | ||
var HAS_INPUT_EVENTS_LEVEL_2 = features.includes('inputeventslevel2') || IS_ANDROID && (ANDROID_API_VERSION === 28 || ANDROID_API_VERSION === null); | ||
@@ -224,4 +281,5 @@ exports.IS_CHROME = IS_CHROME; | ||
exports.IS_WINDOWS = IS_WINDOWS; | ||
exports.ANDROID_API_VERSION = ANDROID_API_VERSION; | ||
exports.HAS_INPUT_EVENTS_LEVEL_1 = HAS_INPUT_EVENTS_LEVEL_1; | ||
exports.HAS_INPUT_EVENTS_LEVEL_2 = HAS_INPUT_EVENTS_LEVEL_2; | ||
//# sourceMappingURL=slate-dev-environment.js.map |
{ | ||
"name": "slate-dev-environment", | ||
"description": "INTERNAL: A set of environment-related constants for Slate's core.", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "repository": "git://github.com/ianstormtaylor/slate.git", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
40666
705
147808