slate-dev-environment
Advanced tools
Comparing version 0.1.4 to 0.1.5
@@ -57,35 +57,5 @@ (function (global, factory) { | ||
/** | ||
* DOM event matching rules. | ||
* | ||
* @type {Array} | ||
*/ | ||
var browser = void 0; | ||
var EVENT_RULES = [['beforeinput', function (el) { | ||
return 'onbeforeinput' in el; | ||
}]]; | ||
/** | ||
* Operating system matching rules. | ||
* | ||
* @type {Array} | ||
*/ | ||
var OS_RULES = [['ios', /os ([\.\_\d]+) like mac os/i], // must be before the macos rule | ||
['macos', /mac os x/i], ['android', /android/i], ['firefoxos', /mozilla\/[a-z\.\_\d]+ \((?:mobile)|(?:tablet)/i], ['windows', /windows\s*(?:nt)?\s*([\.\_\d]+)/i]]; | ||
/** | ||
* Define variables to store the result. | ||
*/ | ||
var BROWSER = void 0; | ||
var EVENTS = {}; | ||
var OS = void 0; | ||
/** | ||
* Run the matchers when in browser. | ||
*/ | ||
if (isBrowser) { | ||
var userAgent = window.navigator.userAgent; | ||
var _iteratorNormalCompletion = true; | ||
@@ -96,3 +66,2 @@ var _didIteratorError = false; | ||
try { | ||
for (var _iterator = BROWSER_RULES[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { | ||
@@ -106,4 +75,4 @@ var _ref = _step.value; | ||
if (regexp.test(userAgent)) { | ||
BROWSER = name; | ||
if (regexp.test(window.navigator.userAgent)) { | ||
browser = name; | ||
break; | ||
@@ -126,3 +95,16 @@ } | ||
} | ||
} | ||
/** | ||
* Operating system matching rules. | ||
* | ||
* @type {Array} | ||
*/ | ||
var OS_RULES = [['ios', /os ([\.\_\d]+) like mac os/i], // must be before the macos rule | ||
['macos', /mac os x/i], ['android', /android/i], ['firefoxos', /mozilla\/[a-z\.\_\d]+ \((?:mobile)|(?:tablet)/i], ['windows', /windows\s*(?:nt)?\s*([\.\_\d]+)/i]]; | ||
var os = void 0; | ||
if (isBrowser) { | ||
var _iteratorNormalCompletion2 = true; | ||
@@ -141,4 +123,4 @@ var _didIteratorError2 = false; | ||
if (_regexp.test(userAgent)) { | ||
OS = _name; | ||
if (_regexp.test(window.navigator.userAgent)) { | ||
os = _name; | ||
break; | ||
@@ -161,6 +143,24 @@ } | ||
} | ||
} | ||
var testEl = window.document.createElement('div'); | ||
testEl.contentEditable = true; | ||
/** | ||
* Feature matching rules. | ||
* | ||
* @type {Array} | ||
*/ | ||
var FEATURE_RULES = [['inputeventslevel1', function (window) { | ||
var event = window.InputEvent ? new 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; | ||
}]]; | ||
var features = []; | ||
if (isBrowser) { | ||
var _iteratorNormalCompletion3 = true; | ||
@@ -171,3 +171,3 @@ var _didIteratorError3 = false; | ||
try { | ||
for (var _iterator3 = EVENT_RULES[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { | ||
for (var _iterator3 = FEATURE_RULES[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { | ||
var _ref5 = _step3.value; | ||
@@ -178,5 +178,7 @@ | ||
var _name2 = _ref6[0]; | ||
var testFn = _ref6[1]; | ||
var test = _ref6[1]; | ||
EVENTS[_name2] = testFn(testEl); | ||
if (test(window)) { | ||
features.push(_name2); | ||
} | ||
} | ||
@@ -202,18 +204,19 @@ } catch (err) { | ||
* | ||
* @type {Object} | ||
* @type {Boolean} | ||
*/ | ||
var IS_CHROME = BROWSER === 'chrome'; | ||
var IS_OPERA = BROWSER === 'opera'; | ||
var IS_FIREFOX = BROWSER === 'firefox'; | ||
var IS_SAFARI = BROWSER === 'safari'; | ||
var IS_IE = BROWSER === 'ie'; | ||
var IS_EDGE = BROWSER === 'edge'; | ||
var IS_CHROME = browser === 'chrome'; | ||
var IS_OPERA = browser === 'opera'; | ||
var IS_FIREFOX = browser === 'firefox'; | ||
var IS_SAFARI = browser === 'safari'; | ||
var IS_IE = browser === 'ie'; | ||
var IS_EDGE = browser === 'edge'; | ||
var IS_ANDROID = OS === 'android'; | ||
var IS_IOS = OS === 'ios'; | ||
var IS_MAC = OS === 'macos'; | ||
var IS_WINDOWS = OS === 'windows'; | ||
var IS_ANDROID = os === 'android'; | ||
var IS_IOS = os === 'ios'; | ||
var IS_MAC = os === 'macos'; | ||
var IS_WINDOWS = os === 'windows'; | ||
var SUPPORTED_EVENTS = EVENTS; | ||
var HAS_INPUT_EVENTS_LEVEL_1 = features.includes('inputeventslevel1'); | ||
var HAS_INPUT_EVENTS_LEVEL_2 = features.includes('inputeventslevel2'); | ||
@@ -230,3 +233,4 @@ exports.IS_CHROME = IS_CHROME; | ||
exports.IS_WINDOWS = IS_WINDOWS; | ||
exports.SUPPORTED_EVENTS = SUPPORTED_EVENTS; | ||
exports.HAS_INPUT_EVENTS_LEVEL_1 = HAS_INPUT_EVENTS_LEVEL_1; | ||
exports.HAS_INPUT_EVENTS_LEVEL_2 = HAS_INPUT_EVENTS_LEVEL_2; | ||
@@ -233,0 +237,0 @@ Object.defineProperty(exports, '__esModule', { value: true }); |
@@ -1,1 +0,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},o="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 o=[],t=!0,n=!1,i=void 0;try{for(var a,f=e[Symbol.iterator]();!(t=(a=f.next()).done)&&(o.push(a.value),!r||o.length!==r);t=!0);}catch(e){n=!0,i=e}finally{try{!t&&f.return&&f.return()}finally{if(n)throw i}}return o}(e,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),n=void 0,i={},a=void 0;if(o){var f=window.navigator.userAgent,d=!0,u=!1,l=void 0;try{for(var y,c=[["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]();!(d=(y=c.next()).done);d=!0){var s=t(y.value,2),m=s[0];if(s[1].test(f)){n=m;break}}}catch(e){u=!0,l=e}finally{try{!d&&c.return&&c.return()}finally{if(u)throw l}}var v=!0,S=!1,p=void 0;try{for(var b,w=[["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]();!(v=(b=w.next()).done);v=!0){var I=t(b.value,2),_=I[0];if(I[1].test(f)){a=_;break}}}catch(e){S=!0,p=e}finally{try{!v&&w.return&&w.return()}finally{if(S)throw p}}var h=window.document.createElement("div");h.contentEditable=!0;var E=!0,x=!1,O=void 0;try{for(var A,R=[["beforeinput",function(e){return"onbeforeinput"in e}]][Symbol.iterator]();!(E=(A=R.next()).done);E=!0){var g=t(A.value,2),D=g[0],P=g[1];i[D]=P(h)}}catch(e){x=!0,O=e}finally{try{!E&&R.return&&R.return()}finally{if(x)throw O}}}var T="chrome"===n,$="opera"===n,j="firefox"===n,M="safari"===n,k="ie"===n,C="edge"===n,F="android"===a,N="ios"===a,z="macos"===a,G="windows"===a,V=i;e.IS_CHROME=T,e.IS_OPERA=$,e.IS_FIREFOX=j,e.IS_SAFARI=M,e.IS_IE=k,e.IS_EDGE=C,e.IS_ANDROID=F,e.IS_IOS=N,e.IS_MAC=z,e.IS_WINDOWS=G,e.SUPPORTED_EVENTS=V,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!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=[["inputeventslevel1",function(e){return"inputType"in(e.InputEvent?new InputEvent("input"):{})}],["inputeventslevel2",function(e){var t=e.document.createElement("div");return t.contentEditable=!0,"onbeforeinput"in t}]],E=[];if(n){var I=!0,h=!1,x=void 0;try{for(var A,O=w[Symbol.iterator]();!(I=(A=O.next()).done);I=!0){var T=r(A.value,2),g=T[0];(0,T[1])(window)&&E.push(g)}}catch(e){h=!0,x=e}finally{try{!I&&O.return&&O.return()}finally{if(h)throw x}}}var R="chrome"===o,N="opera"===o,P="firefox"===o,$="safari"===o,j="ie"===o,D="edge"===o,M="android"===c,V="ios"===c,k="macos"===c,C="windows"===c,F=E.includes("inputeventslevel1"),L=E.includes("inputeventslevel2");e.IS_CHROME=R,e.IS_OPERA=N,e.IS_FIREFOX=P,e.IS_SAFARI=$,e.IS_IE=j,e.IS_EDGE=D,e.IS_ANDROID=M,e.IS_IOS=V,e.IS_MAC=k,e.IS_WINDOWS=C,e.HAS_INPUT_EVENTS_LEVEL_1=F,e.HAS_INPUT_EVENTS_LEVEL_2=L,Object.defineProperty(e,"__esModule",{value:!0})}); |
@@ -1,2 +0,2 @@ | ||
import browser from 'is-in-browser'; | ||
import isBrowser from 'is-in-browser'; | ||
@@ -49,35 +49,5 @@ var slicedToArray = function () { | ||
/** | ||
* DOM event matching rules. | ||
* | ||
* @type {Array} | ||
*/ | ||
var browser = void 0; | ||
var EVENT_RULES = [['beforeinput', function (el) { | ||
return 'onbeforeinput' in el; | ||
}]]; | ||
/** | ||
* Operating system matching rules. | ||
* | ||
* @type {Array} | ||
*/ | ||
var OS_RULES = [['ios', /os ([\.\_\d]+) like mac os/i], // must be before the macos rule | ||
['macos', /mac os x/i], ['android', /android/i], ['firefoxos', /mozilla\/[a-z\.\_\d]+ \((?:mobile)|(?:tablet)/i], ['windows', /windows\s*(?:nt)?\s*([\.\_\d]+)/i]]; | ||
/** | ||
* Define variables to store the result. | ||
*/ | ||
var BROWSER = void 0; | ||
var EVENTS = {}; | ||
var OS = void 0; | ||
/** | ||
* Run the matchers when in browser. | ||
*/ | ||
if (browser) { | ||
var userAgent = window.navigator.userAgent; | ||
if (isBrowser) { | ||
var _iteratorNormalCompletion = true; | ||
@@ -88,3 +58,2 @@ var _didIteratorError = false; | ||
try { | ||
for (var _iterator = BROWSER_RULES[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { | ||
@@ -98,4 +67,4 @@ var _ref = _step.value; | ||
if (regexp.test(userAgent)) { | ||
BROWSER = name; | ||
if (regexp.test(window.navigator.userAgent)) { | ||
browser = name; | ||
break; | ||
@@ -118,3 +87,16 @@ } | ||
} | ||
} | ||
/** | ||
* Operating system matching rules. | ||
* | ||
* @type {Array} | ||
*/ | ||
var OS_RULES = [['ios', /os ([\.\_\d]+) like mac os/i], // must be before the macos rule | ||
['macos', /mac os x/i], ['android', /android/i], ['firefoxos', /mozilla\/[a-z\.\_\d]+ \((?:mobile)|(?:tablet)/i], ['windows', /windows\s*(?:nt)?\s*([\.\_\d]+)/i]]; | ||
var os = void 0; | ||
if (isBrowser) { | ||
var _iteratorNormalCompletion2 = true; | ||
@@ -133,4 +115,4 @@ var _didIteratorError2 = false; | ||
if (_regexp.test(userAgent)) { | ||
OS = _name; | ||
if (_regexp.test(window.navigator.userAgent)) { | ||
os = _name; | ||
break; | ||
@@ -153,6 +135,24 @@ } | ||
} | ||
} | ||
var testEl = window.document.createElement('div'); | ||
testEl.contentEditable = true; | ||
/** | ||
* Feature matching rules. | ||
* | ||
* @type {Array} | ||
*/ | ||
var FEATURE_RULES = [['inputeventslevel1', function (window) { | ||
var event = window.InputEvent ? new 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; | ||
}]]; | ||
var features = []; | ||
if (isBrowser) { | ||
var _iteratorNormalCompletion3 = true; | ||
@@ -163,3 +163,3 @@ var _didIteratorError3 = false; | ||
try { | ||
for (var _iterator3 = EVENT_RULES[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { | ||
for (var _iterator3 = FEATURE_RULES[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { | ||
var _ref5 = _step3.value; | ||
@@ -170,5 +170,7 @@ | ||
var _name2 = _ref6[0]; | ||
var testFn = _ref6[1]; | ||
var test = _ref6[1]; | ||
EVENTS[_name2] = testFn(testEl); | ||
if (test(window)) { | ||
features.push(_name2); | ||
} | ||
} | ||
@@ -194,20 +196,21 @@ } catch (err) { | ||
* | ||
* @type {Object} | ||
* @type {Boolean} | ||
*/ | ||
var IS_CHROME = BROWSER === 'chrome'; | ||
var IS_OPERA = BROWSER === 'opera'; | ||
var IS_FIREFOX = BROWSER === 'firefox'; | ||
var IS_SAFARI = BROWSER === 'safari'; | ||
var IS_IE = BROWSER === 'ie'; | ||
var IS_EDGE = BROWSER === 'edge'; | ||
var IS_CHROME = browser === 'chrome'; | ||
var IS_OPERA = browser === 'opera'; | ||
var IS_FIREFOX = browser === 'firefox'; | ||
var IS_SAFARI = browser === 'safari'; | ||
var IS_IE = browser === 'ie'; | ||
var IS_EDGE = browser === 'edge'; | ||
var IS_ANDROID = OS === 'android'; | ||
var IS_IOS = OS === 'ios'; | ||
var IS_MAC = OS === 'macos'; | ||
var IS_WINDOWS = OS === 'windows'; | ||
var IS_ANDROID = os === 'android'; | ||
var IS_IOS = os === 'ios'; | ||
var IS_MAC = os === 'macos'; | ||
var IS_WINDOWS = os === 'windows'; | ||
var SUPPORTED_EVENTS = EVENTS; | ||
var HAS_INPUT_EVENTS_LEVEL_1 = features.includes('inputeventslevel1'); | ||
var HAS_INPUT_EVENTS_LEVEL_2 = features.includes('inputeventslevel2'); | ||
export { IS_CHROME, IS_OPERA, IS_FIREFOX, IS_SAFARI, IS_IE, IS_EDGE, IS_ANDROID, IS_IOS, IS_MAC, IS_WINDOWS, SUPPORTED_EVENTS }; | ||
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 }; | ||
//# sourceMappingURL=slate-dev-environment.es.js.map |
@@ -7,3 +7,3 @@ 'use strict'; | ||
var browser = _interopDefault(require('is-in-browser')); | ||
var isBrowser = _interopDefault(require('is-in-browser')); | ||
@@ -56,35 +56,5 @@ var slicedToArray = function () { | ||
/** | ||
* DOM event matching rules. | ||
* | ||
* @type {Array} | ||
*/ | ||
var browser = void 0; | ||
var EVENT_RULES = [['beforeinput', function (el) { | ||
return 'onbeforeinput' in el; | ||
}]]; | ||
/** | ||
* Operating system matching rules. | ||
* | ||
* @type {Array} | ||
*/ | ||
var OS_RULES = [['ios', /os ([\.\_\d]+) like mac os/i], // must be before the macos rule | ||
['macos', /mac os x/i], ['android', /android/i], ['firefoxos', /mozilla\/[a-z\.\_\d]+ \((?:mobile)|(?:tablet)/i], ['windows', /windows\s*(?:nt)?\s*([\.\_\d]+)/i]]; | ||
/** | ||
* Define variables to store the result. | ||
*/ | ||
var BROWSER = void 0; | ||
var EVENTS = {}; | ||
var OS = void 0; | ||
/** | ||
* Run the matchers when in browser. | ||
*/ | ||
if (browser) { | ||
var userAgent = window.navigator.userAgent; | ||
if (isBrowser) { | ||
var _iteratorNormalCompletion = true; | ||
@@ -95,3 +65,2 @@ var _didIteratorError = false; | ||
try { | ||
for (var _iterator = BROWSER_RULES[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { | ||
@@ -105,4 +74,4 @@ var _ref = _step.value; | ||
if (regexp.test(userAgent)) { | ||
BROWSER = name; | ||
if (regexp.test(window.navigator.userAgent)) { | ||
browser = name; | ||
break; | ||
@@ -125,3 +94,16 @@ } | ||
} | ||
} | ||
/** | ||
* Operating system matching rules. | ||
* | ||
* @type {Array} | ||
*/ | ||
var OS_RULES = [['ios', /os ([\.\_\d]+) like mac os/i], // must be before the macos rule | ||
['macos', /mac os x/i], ['android', /android/i], ['firefoxos', /mozilla\/[a-z\.\_\d]+ \((?:mobile)|(?:tablet)/i], ['windows', /windows\s*(?:nt)?\s*([\.\_\d]+)/i]]; | ||
var os = void 0; | ||
if (isBrowser) { | ||
var _iteratorNormalCompletion2 = true; | ||
@@ -140,4 +122,4 @@ var _didIteratorError2 = false; | ||
if (_regexp.test(userAgent)) { | ||
OS = _name; | ||
if (_regexp.test(window.navigator.userAgent)) { | ||
os = _name; | ||
break; | ||
@@ -160,6 +142,24 @@ } | ||
} | ||
} | ||
var testEl = window.document.createElement('div'); | ||
testEl.contentEditable = true; | ||
/** | ||
* Feature matching rules. | ||
* | ||
* @type {Array} | ||
*/ | ||
var FEATURE_RULES = [['inputeventslevel1', function (window) { | ||
var event = window.InputEvent ? new 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; | ||
}]]; | ||
var features = []; | ||
if (isBrowser) { | ||
var _iteratorNormalCompletion3 = true; | ||
@@ -170,3 +170,3 @@ var _didIteratorError3 = false; | ||
try { | ||
for (var _iterator3 = EVENT_RULES[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { | ||
for (var _iterator3 = FEATURE_RULES[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { | ||
var _ref5 = _step3.value; | ||
@@ -177,5 +177,7 @@ | ||
var _name2 = _ref6[0]; | ||
var testFn = _ref6[1]; | ||
var test = _ref6[1]; | ||
EVENTS[_name2] = testFn(testEl); | ||
if (test(window)) { | ||
features.push(_name2); | ||
} | ||
} | ||
@@ -201,18 +203,19 @@ } catch (err) { | ||
* | ||
* @type {Object} | ||
* @type {Boolean} | ||
*/ | ||
var IS_CHROME = BROWSER === 'chrome'; | ||
var IS_OPERA = BROWSER === 'opera'; | ||
var IS_FIREFOX = BROWSER === 'firefox'; | ||
var IS_SAFARI = BROWSER === 'safari'; | ||
var IS_IE = BROWSER === 'ie'; | ||
var IS_EDGE = BROWSER === 'edge'; | ||
var IS_CHROME = browser === 'chrome'; | ||
var IS_OPERA = browser === 'opera'; | ||
var IS_FIREFOX = browser === 'firefox'; | ||
var IS_SAFARI = browser === 'safari'; | ||
var IS_IE = browser === 'ie'; | ||
var IS_EDGE = browser === 'edge'; | ||
var IS_ANDROID = OS === 'android'; | ||
var IS_IOS = OS === 'ios'; | ||
var IS_MAC = OS === 'macos'; | ||
var IS_WINDOWS = OS === 'windows'; | ||
var IS_ANDROID = os === 'android'; | ||
var IS_IOS = os === 'ios'; | ||
var IS_MAC = os === 'macos'; | ||
var IS_WINDOWS = os === 'windows'; | ||
var SUPPORTED_EVENTS = EVENTS; | ||
var HAS_INPUT_EVENTS_LEVEL_1 = features.includes('inputeventslevel1'); | ||
var HAS_INPUT_EVENTS_LEVEL_2 = features.includes('inputeventslevel2'); | ||
@@ -229,3 +232,4 @@ exports.IS_CHROME = IS_CHROME; | ||
exports.IS_WINDOWS = IS_WINDOWS; | ||
exports.SUPPORTED_EVENTS = SUPPORTED_EVENTS; | ||
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.1.4", | ||
"version": "0.1.5", | ||
"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
31574
566
147808