css-in-js-utils
Advanced tools
Comparing version 3.0.4 to 3.1.0
@@ -1,11 +0,15 @@ | ||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } | ||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } | ||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } | ||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } | ||
function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } | ||
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } | ||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } | ||
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); } | ||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } | ||
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } | ||
function filterUniqueArray(arr) { | ||
@@ -12,0 +16,0 @@ return arr.filter(function (val, index) { |
var DASH = /-([a-z])/g; | ||
var MS = /^Ms/g; | ||
var cache = {}; | ||
@@ -9,3 +10,9 @@ function toUpper(match) { | ||
export default function camelCaseProperty(property) { | ||
return property.replace(DASH, toUpper).replace(MS, 'ms'); | ||
if (cache.hasOwnProperty(property)) { | ||
return cache[property]; | ||
} | ||
var camelProp = property.replace(DASH, toUpper).replace(MS, 'ms'); | ||
cache[property] = camelProp; | ||
return camelProp; | ||
} |
@@ -0,32 +1,34 @@ | ||
"use strict"; | ||
window.PR_SHOULD_USE_CONTINUATION = true; | ||
(function () { | ||
var h = ["break,continue,do,else,for,if,return,while"]; | ||
var u = [h, "auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"]; | ||
var p = [u, "catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"]; | ||
var l = [p, "alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"]; | ||
var x = [p, "abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"]; | ||
var R = [x, "as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"]; | ||
var r = "all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes"; | ||
var w = [p, "debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"]; | ||
var s = "caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"; | ||
var I = [h, "and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"]; | ||
var f = [h, "alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"]; | ||
var H = [h, "case,done,elif,esac,eval,fi,function,in,local,set,then,until"]; | ||
var h = ['break,continue,do,else,for,if,return,while']; | ||
var u = [h, 'auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile']; | ||
var p = [u, 'catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof']; | ||
var l = [p, 'alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where']; | ||
var x = [p, 'abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient']; | ||
var R = [x, 'as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var']; | ||
var r = 'all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes'; | ||
var w = [p, 'debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN']; | ||
var s = 'caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END'; | ||
var I = [h, 'and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None']; | ||
var f = [h, 'alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END']; | ||
var H = [h, 'case,done,elif,esac,eval,fi,function,in,local,set,then,until']; | ||
var A = [l, R, w, s + I, f, H]; | ||
var e = /^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/; | ||
var C = "str"; | ||
var z = "kwd"; | ||
var j = "com"; | ||
var O = "typ"; | ||
var G = "lit"; | ||
var L = "pun"; | ||
var F = "pln"; | ||
var m = "tag"; | ||
var E = "dec"; | ||
var J = "src"; | ||
var P = "atn"; | ||
var n = "atv"; | ||
var N = "nocode"; | ||
var M = "(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*"; | ||
var C = 'str'; | ||
var z = 'kwd'; | ||
var j = 'com'; | ||
var O = 'typ'; | ||
var G = 'lit'; | ||
var L = 'pun'; | ||
var F = 'pln'; | ||
var m = 'tag'; | ||
var E = 'dec'; | ||
var J = 'src'; | ||
var P = 'atn'; | ||
var n = 'atv'; | ||
var N = 'nocode'; | ||
var M = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*'; | ||
@@ -44,3 +46,3 @@ function k(Z) { | ||
} else { | ||
if (/[a-z]/i.test(ae.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi, ""))) { | ||
if (/[a-z]/i.test(ae.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi, ''))) { | ||
S = true; | ||
@@ -75,6 +77,6 @@ ac = false; | ||
} else { | ||
if ("0" <= af && af <= "7") { | ||
if ('0' <= af && af <= '7') { | ||
return parseInt(ah.substring(1), 8); | ||
} else { | ||
if (af === "u" || af === "x") { | ||
if (af === 'u' || af === 'x') { | ||
return parseInt(ah.substring(2), 16); | ||
@@ -90,3 +92,3 @@ } else { | ||
if (af < 32) { | ||
return (af < 16 ? "\\x0" : "\\x") + af.toString(16); | ||
return (af < 16 ? '\\x0' : '\\x') + af.toString(16); | ||
} | ||
@@ -96,4 +98,4 @@ | ||
if (ag === "\\" || ag === "-" || ag === "[" || ag === "]") { | ||
ag = "\\" + ag; | ||
if (ag === '\\' || ag === '-' || ag === '[' || ag === ']') { | ||
ag = '\\' + ag; | ||
} | ||
@@ -105,6 +107,6 @@ | ||
function X(am) { | ||
var aq = am.substring(1, am.length - 1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]", "g")); | ||
var aq = am.substring(1, am.length - 1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]", 'g')); | ||
var ak = []; | ||
var af = []; | ||
var ao = aq[0] === "^"; | ||
var ao = aq[0] === '^'; | ||
@@ -120,3 +122,3 @@ for (var ar = ao ? 1 : 0, aj = aq.length; ar < aj; ++ar) { | ||
if (ar + 2 < aj && "-" === aq[ar + 1]) { | ||
if (ar + 2 < aj && '-' === aq[ar + 1]) { | ||
al = ab(aq[ar + 2]); | ||
@@ -158,6 +160,6 @@ ar += 2; | ||
var an = ["["]; | ||
var an = ['[']; | ||
if (ao) { | ||
an.push("^"); | ||
an.push('^'); | ||
} | ||
@@ -173,3 +175,3 @@ | ||
if (at[1] + 1 > at[0]) { | ||
an.push("-"); | ||
an.push('-'); | ||
} | ||
@@ -181,8 +183,8 @@ | ||
an.push("]"); | ||
return an.join(""); | ||
an.push(']'); | ||
return an.join(''); | ||
} | ||
function W(al) { | ||
var aj = al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)", "g")); | ||
var aj = al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)", 'g')); | ||
var ah = aj.length; | ||
@@ -194,6 +196,6 @@ var an = []; | ||
if (ag === "(") { | ||
if (ag === '(') { | ||
++am; | ||
} else { | ||
if ("\\" === ag.charAt(0)) { | ||
if ('\\' === ag.charAt(0)) { | ||
var af = +ag.substring(1); | ||
@@ -217,14 +219,14 @@ | ||
if (ag === "(") { | ||
if (ag === '(') { | ||
++am; | ||
if (an[am] === undefined) { | ||
aj[ak] = "(?:"; | ||
aj[ak] = '(?:'; | ||
} | ||
} else { | ||
if ("\\" === ag.charAt(0)) { | ||
if ('\\' === ag.charAt(0)) { | ||
var af = +ag.substring(1); | ||
if (af && af <= am) { | ||
aj[ak] = "\\" + an[am]; | ||
aj[ak] = '\\' + an[am]; | ||
} | ||
@@ -236,4 +238,4 @@ } | ||
for (var ak = 0, am = 0; ak < ah; ++ak) { | ||
if ("^" === aj[ak] && "^" !== aj[ak + 1]) { | ||
aj[ak] = ""; | ||
if ('^' === aj[ak] && '^' !== aj[ak + 1]) { | ||
aj[ak] = ''; | ||
} | ||
@@ -247,9 +249,9 @@ } | ||
if (ag.length >= 2 && ai === "[") { | ||
if (ag.length >= 2 && ai === '[') { | ||
aj[ak] = X(ag); | ||
} else { | ||
if (ai !== "\\") { | ||
if (ai !== '\\') { | ||
aj[ak] = ag.replace(/[a-zA-Z]/g, function (ao) { | ||
var ap = ao.charCodeAt(0); | ||
return "[" + String.fromCharCode(ap & ~32, ap | 32) + "]"; | ||
return '[' + String.fromCharCode(ap & ~32, ap | 32) + ']'; | ||
}); | ||
@@ -261,3 +263,3 @@ } | ||
return aj.join(""); | ||
return aj.join(''); | ||
} | ||
@@ -271,9 +273,9 @@ | ||
if (ae.global || ae.multiline) { | ||
throw new Error("" + ae); | ||
throw new Error('' + ae); | ||
} | ||
aa.push("(?:" + W(ae) + ")"); | ||
aa.push('(?:' + W(ae) + ')'); | ||
} | ||
return new RegExp(aa.join("|"), ac ? "gi" : "g"); | ||
return new RegExp(aa.join('|'), ac ? 'gi' : 'g'); | ||
} | ||
@@ -293,7 +295,7 @@ | ||
if (window.getComputedStyle) { | ||
S = document.defaultView.getComputedStyle(V, null).getPropertyValue("white-space"); | ||
S = document.defaultView.getComputedStyle(V, null).getPropertyValue('white-space'); | ||
} | ||
} | ||
var Y = S && "pre" === S.substring(0, 3); | ||
var Y = S && 'pre' === S.substring(0, 3); | ||
@@ -313,4 +315,4 @@ function aa(ab) { | ||
if ("BR" === ad || "LI" === ad) { | ||
X[W] = "\n"; | ||
if ('BR' === ad || 'LI' === ad) { | ||
X[W] = '\n'; | ||
Z[W << 1] = T++; | ||
@@ -328,5 +330,5 @@ Z[W++ << 1 | 1] = ab; | ||
if (!Y) { | ||
ac = ac.replace(/[ \t\r\n]+/g, " "); | ||
ac = ac.replace(/[ \t\r\n]+/g, ' '); | ||
} else { | ||
ac = ac.replace(/\r\n?/g, "\n"); | ||
ac = ac.replace(/\r\n?/g, '\n'); | ||
} | ||
@@ -346,3 +348,3 @@ | ||
return { | ||
sourceCode: X.join("").replace(/\n$/, ""), | ||
sourceCode: X.join('').replace(/\n$/, ''), | ||
spans: Z | ||
@@ -398,3 +400,3 @@ }; | ||
var af = Y[1]; | ||
var aa = "" + af; | ||
var aa = '' + af; | ||
@@ -427,3 +429,3 @@ if (!ag.hasOwnProperty(aa)) { | ||
if (typeof ap === "string") { | ||
if (typeof ap === 'string') { | ||
am = false; | ||
@@ -452,5 +454,5 @@ } else { | ||
am = ap.length >= 5 && "lang-" === ap.substring(0, 5); | ||
am = ap.length >= 5 && 'lang-' === ap.substring(0, 5); | ||
if (am && !(ai && typeof ai[1] === "string")) { | ||
if (am && !(ai && typeof ai[1] === 'string')) { | ||
am = false; | ||
@@ -498,8 +500,8 @@ ap = J; | ||
if (T.tripleQuotedStrings) { | ||
W.push([C, /^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/, null, "'\""]); | ||
W.push([C, /^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/, null, '\'"']); | ||
} else { | ||
if (T.multiLineStrings) { | ||
W.push([C, /^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/, null, "'\"`"]); | ||
W.push([C, /^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/, null, '\'"`']); | ||
} else { | ||
W.push([C, /^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/, null, "\"'"]); | ||
W.push([C, /^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/, null, '"\'']); | ||
} | ||
@@ -517,5 +519,5 @@ } | ||
if (Y > 1) { | ||
W.push([j, /^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/, null, "#"]); | ||
W.push([j, /^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/, null, '#']); | ||
} else { | ||
W.push([j, /^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/, null, "#"]); | ||
W.push([j, /^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/, null, '#']); | ||
} | ||
@@ -525,3 +527,3 @@ | ||
} else { | ||
W.push([j, /^#[^\r\n]*/, null, "#"]); | ||
W.push([j, /^#[^\r\n]*/, null, '#']); | ||
} | ||
@@ -536,4 +538,4 @@ } | ||
if (T.regexLiterals) { | ||
var X = "/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/"; | ||
S.push(["lang-regex", new RegExp("^" + M + "(" + X + ")")]); | ||
var X = '/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/'; | ||
S.push(['lang-regex', new RegExp('^' + M + '(' + X + ')')]); | ||
} | ||
@@ -547,10 +549,10 @@ | ||
var U = ("" + T.keywords).replace(/^ | $/g, ""); | ||
var U = ('' + T.keywords).replace(/^ | $/g, ''); | ||
if (U.length) { | ||
S.push([z, new RegExp("^(?:" + U.replace(/[\s,]+/g, "|") + ")\\b"), null]); | ||
S.push([z, new RegExp('^(?:' + U.replace(/[\s,]+/g, '|') + ')\\b'), null]); | ||
} | ||
W.push([F, /^\s+/, null, " \r\n\t\xA0"]); | ||
S.push([G, /^@[a-z_$][a-z_$@0-9]*/i, null], [O, /^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/, null], [F, /^[a-z_$][a-z_$@0-9]*/i, null], [G, new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*", "i"), null, "0123456789"], [F, /^\\[\s\S]?/, null], [L, /^.[^\s\w\.$@\'\"\`\/\#\\]*/, null]); | ||
W.push([F, /^\s+/, null, ' \r\n\t\xA0']); | ||
S.push([G, /^@[a-z_$][a-z_$@0-9]*/i, null], [O, /^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/, null], [F, /^[a-z_$][a-z_$@0-9]*/i, null], [G, new RegExp('^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*', 'i'), null, '0123456789'], [F, /^\\[\s\S]?/, null], [L, /^.[^\s\w\.$@\'\"\`\/\#\\]*/, null]); | ||
return g(W, S); | ||
@@ -577,8 +579,8 @@ } | ||
if (window.getComputedStyle) { | ||
S = ac.defaultView.getComputedStyle(V, null).getPropertyValue("white-space"); | ||
S = ac.defaultView.getComputedStyle(V, null).getPropertyValue('white-space'); | ||
} | ||
} | ||
var Z = S && "pre" === S.substring(0, 3); | ||
var af = ac.createElement("LI"); | ||
var Z = S && 'pre' === S.substring(0, 3); | ||
var af = ac.createElement('LI'); | ||
@@ -598,3 +600,3 @@ while (V.firstChild) { | ||
if ("BR" === al.nodeName) { | ||
if ('BR' === al.nodeName) { | ||
ad(al); | ||
@@ -682,7 +684,7 @@ | ||
if (ag === (ag | 0)) { | ||
W[0].setAttribute("value", ag); | ||
W[0].setAttribute('value', ag); | ||
} | ||
var aa = ac.createElement("OL"); | ||
aa.className = "linenums"; | ||
var aa = ac.createElement('OL'); | ||
aa.className = 'linenums'; | ||
var X = Math.max(0, ag - 1 | 0) || 0; | ||
@@ -692,6 +694,6 @@ | ||
af = W[Y]; | ||
af.className = "L" + (Y + X) % 10; | ||
af.className = 'L' + (Y + X) % 10; | ||
if (!af.firstChild) { | ||
af.appendChild(ac.createTextNode("\xA0")); | ||
af.appendChild(ac.createTextNode('\xA0')); | ||
} | ||
@@ -759,3 +761,3 @@ | ||
if (aj) { | ||
U = U.replace(am, "\r"); | ||
U = U.replace(am, '\r'); | ||
} | ||
@@ -765,3 +767,3 @@ | ||
var ai = ak.ownerDocument; | ||
var ao = ai.createElement("SPAN"); | ||
var ao = ai.createElement('SPAN'); | ||
ao.className = X[Z + 1]; | ||
@@ -800,3 +802,3 @@ var ad = ak.parentNode; | ||
if (window.console) { | ||
console.warn("cannot override language handler %s", T); | ||
console.warn('cannot override language handler %s', T); | ||
} | ||
@@ -809,3 +811,3 @@ } | ||
if (!(T && t.hasOwnProperty(T))) { | ||
T = /^\s*</.test(S) ? "default-markup" : "default-code"; | ||
T = /^\s*</.test(S) ? 'default-markup' : 'default-code'; | ||
} | ||
@@ -816,6 +818,6 @@ | ||
c(K, ["default-code"]); | ||
c(g([], [[F, /^[^<?]+/], [E, /^<!\w[^>]*(?:>|$)/], [j, /^<\!--[\s\S]*?(?:-\->|$)/], ["lang-", /^<\?([\s\S]+?)(?:\?>|$)/], ["lang-", /^<%([\s\S]+?)(?:%>|$)/], [L, /^(?:<[%?]|[%?]>)/], ["lang-", /^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i], ["lang-js", /^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i], ["lang-css", /^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i], ["lang-in.tag", /^(<\/?[a-z][^<>]*>)/i]]), ["default-markup", "htm", "html", "mxml", "xhtml", "xml", "xsl"]); | ||
c(g([[F, /^[\s]+/, null, " \t\r\n"], [n, /^(?:\"[^\"]*\"?|\'[^\']*\'?)/, null, "\"'"]], [[m, /^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i], [P, /^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i], ["lang-uq.val", /^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/], [L, /^[=<>\/]+/], ["lang-js", /^on\w+\s*=\s*\"([^\"]+)\"/i], ["lang-js", /^on\w+\s*=\s*\'([^\']+)\'/i], ["lang-js", /^on\w+\s*=\s*([^\"\'>\s]+)/i], ["lang-css", /^style\s*=\s*\"([^\"]+)\"/i], ["lang-css", /^style\s*=\s*\'([^\']+)\'/i], ["lang-css", /^style\s*=\s*([^\"\'>\s]+)/i]]), ["in.tag"]); | ||
c(g([], [[n, /^[\s\S]+/]]), ["uq.val"]); | ||
c(K, ['default-code']); | ||
c(g([], [[F, /^[^<?]+/], [E, /^<!\w[^>]*(?:>|$)/], [j, /^<\!--[\s\S]*?(?:-\->|$)/], ['lang-', /^<\?([\s\S]+?)(?:\?>|$)/], ['lang-', /^<%([\s\S]+?)(?:%>|$)/], [L, /^(?:<[%?]|[%?]>)/], ['lang-', /^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i], ['lang-js', /^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i], ['lang-css', /^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i], ['lang-in.tag', /^(<\/?[a-z][^<>]*>)/i]]), ['default-markup', 'htm', 'html', 'mxml', 'xhtml', 'xml', 'xsl']); | ||
c(g([[F, /^[\s]+/, null, ' \t\r\n'], [n, /^(?:\"[^\"]*\"?|\'[^\']*\'?)/, null, '"\'']], [[m, /^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i], [P, /^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i], ['lang-uq.val', /^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/], [L, /^[=<>\/]+/], ['lang-js', /^on\w+\s*=\s*\"([^\"]+)\"/i], ['lang-js', /^on\w+\s*=\s*\'([^\']+)\'/i], ['lang-js', /^on\w+\s*=\s*([^\"\'>\s]+)/i], ['lang-css', /^style\s*=\s*\"([^\"]+)\"/i], ['lang-css', /^style\s*=\s*\'([^\']+)\'/i], ['lang-css', /^style\s*=\s*([^\"\'>\s]+)/i]]), ['in.tag']); | ||
c(g([], [[n, /^[\s\S]+/]]), ['uq.val']); | ||
c(i({ | ||
@@ -826,6 +828,6 @@ keywords: l, | ||
types: e | ||
}), ["c", "cc", "cpp", "cxx", "cyc", "m"]); | ||
}), ['c', 'cc', 'cpp', 'cxx', 'cyc', 'm']); | ||
c(i({ | ||
keywords: "null,true,false" | ||
}), ["json"]); | ||
keywords: 'null,true,false' | ||
}), ['json']); | ||
c(i({ | ||
@@ -837,7 +839,7 @@ keywords: R, | ||
types: e | ||
}), ["cs"]); | ||
}), ['cs']); | ||
c(i({ | ||
keywords: x, | ||
cStyleComments: true | ||
}), ["java"]); | ||
}), ['java']); | ||
c(i({ | ||
@@ -847,3 +849,3 @@ keywords: H, | ||
multiLineStrings: true | ||
}), ["bsh", "csh", "sh"]); | ||
}), ['bsh', 'csh', 'sh']); | ||
c(i({ | ||
@@ -854,3 +856,3 @@ keywords: I, | ||
tripleQuotedStrings: true | ||
}), ["cv", "py"]); | ||
}), ['cv', 'py']); | ||
c(i({ | ||
@@ -861,3 +863,3 @@ keywords: s, | ||
regexLiterals: true | ||
}), ["perl", "pl", "pm"]); | ||
}), ['perl', 'pl', 'pm']); | ||
c(i({ | ||
@@ -868,3 +870,3 @@ keywords: f, | ||
regexLiterals: true | ||
}), ["rb"]); | ||
}), ['rb']); | ||
c(i({ | ||
@@ -874,3 +876,3 @@ keywords: w, | ||
regexLiterals: true | ||
}), ["js"]); | ||
}), ['js']); | ||
c(i({ | ||
@@ -883,4 +885,4 @@ keywords: r, | ||
regexLiterals: true | ||
}), ["coffee"]); | ||
c(g([], [[C, /^[\s\S]+/]]), ["regex"]); | ||
}), ['coffee']); | ||
c(g([], [[C, /^[\s\S]+/]]), ['regex']); | ||
@@ -899,3 +901,3 @@ function d(V) { | ||
} catch (W) { | ||
if ("console" in window) { | ||
if ('console' in window) { | ||
console.log(W && W.stack ? W.stack : W); | ||
@@ -907,3 +909,3 @@ } | ||
function y(W, V, U) { | ||
var S = document.createElement("PRE"); | ||
var S = document.createElement('PRE'); | ||
S.innerHTML = W; | ||
@@ -929,3 +931,3 @@ | ||
var ac = [Y("pre"), Y("code"), Y("xmp")]; | ||
var ac = [Y('pre'), Y('code'), Y('xmp')]; | ||
var T = []; | ||
@@ -962,7 +964,7 @@ | ||
if (ai.indexOf("prettyprint") >= 0) { | ||
if (ai.indexOf('prettyprint') >= 0) { | ||
var ah = ai.match(ab); | ||
var am; | ||
if (!ah && (am = o(aj)) && "CODE" === am.tagName) { | ||
if (!ah && (am = o(aj)) && 'CODE' === am.tagName) { | ||
ah = am.className.match(ab); | ||
@@ -978,3 +980,3 @@ } | ||
for (var ak = aj.parentNode; ak; ak = ak.parentNode) { | ||
if ((ak.tagName === "pre" || ak.tagName === "code" || ak.tagName === "xmp") && ak.className && ak.className.indexOf("prettyprint") >= 0) { | ||
if ((ak.tagName === 'pre' || ak.tagName === 'code' || ak.tagName === 'xmp') && ak.className && ak.className.indexOf('prettyprint') >= 0) { | ||
al = true; | ||
@@ -1037,5 +1039,5 @@ break; | ||
PR.registerLangHandler(PR.createSimpleLexer([], [[PR.PR_DECLARATION, /^<!\w[^>]*(?:>|$)/], [PR.PR_COMMENT, /^<\!--[\s\S]*?(?:-\->|$)/], [PR.PR_PUNCTUATION, /^(?:<[%?]|[%?]>)/], ["lang-", /^<\?([\s\S]+?)(?:\?>|$)/], ["lang-", /^<%([\s\S]+?)(?:%>|$)/], ["lang-", /^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i], ["lang-handlebars", /^<script\b[^>]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i], ["lang-js", /^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i], ["lang-css", /^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i], ["lang-in.tag", /^(<\/?[a-z][^<>]*>)/i], [PR.PR_DECLARATION, /^{{[#^>/]?\s*[\w.][^}]*}}/], [PR.PR_DECLARATION, /^{{&?\s*[\w.][^}]*}}/], [PR.PR_DECLARATION, /^{{{>?\s*[\w.][^}]*}}}/], [PR.PR_COMMENT, /^{{![^}]*}}/]]), ["handlebars", "hbs"]); | ||
PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN, /^[ \t\r\n\f]+/, null, " \t\r\n\f"]], [[PR.PR_STRING, /^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/, null], [PR.PR_STRING, /^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/, null], ["lang-css-str", /^url\(([^\)\"\']*)\)/i], [PR.PR_KEYWORD, /^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i, null], ["lang-css-kw", /^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i], [PR.PR_COMMENT, /^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//], [PR.PR_COMMENT, /^(?:<!--|-->)/], [PR.PR_LITERAL, /^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i], [PR.PR_LITERAL, /^#(?:[0-9a-f]{3}){1,2}/i], [PR.PR_PLAIN, /^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i], [PR.PR_PUNCTUATION, /^[^\s\w\'\"]+/]]), ["css"]); | ||
PR.registerLangHandler(PR.createSimpleLexer([], [[PR.PR_KEYWORD, /^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]), ["css-kw"]); | ||
PR.registerLangHandler(PR.createSimpleLexer([], [[PR.PR_STRING, /^[^\)\"\']+/]]), ["css-str"]); | ||
PR.registerLangHandler(PR.createSimpleLexer([], [[PR.PR_DECLARATION, /^<!\w[^>]*(?:>|$)/], [PR.PR_COMMENT, /^<\!--[\s\S]*?(?:-\->|$)/], [PR.PR_PUNCTUATION, /^(?:<[%?]|[%?]>)/], ['lang-', /^<\?([\s\S]+?)(?:\?>|$)/], ['lang-', /^<%([\s\S]+?)(?:%>|$)/], ['lang-', /^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i], ['lang-handlebars', /^<script\b[^>]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i], ['lang-js', /^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i], ['lang-css', /^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i], ['lang-in.tag', /^(<\/?[a-z][^<>]*>)/i], [PR.PR_DECLARATION, /^{{[#^>/]?\s*[\w.][^}]*}}/], [PR.PR_DECLARATION, /^{{&?\s*[\w.][^}]*}}/], [PR.PR_DECLARATION, /^{{{>?\s*[\w.][^}]*}}}/], [PR.PR_COMMENT, /^{{![^}]*}}/]]), ['handlebars', 'hbs']); | ||
PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN, /^[ \t\r\n\f]+/, null, ' \t\r\n\f']], [[PR.PR_STRING, /^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/, null], [PR.PR_STRING, /^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/, null], ['lang-css-str', /^url\(([^\)\"\']*)\)/i], [PR.PR_KEYWORD, /^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i, null], ['lang-css-kw', /^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i], [PR.PR_COMMENT, /^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//], [PR.PR_COMMENT, /^(?:<!--|-->)/], [PR.PR_LITERAL, /^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i], [PR.PR_LITERAL, /^#(?:[0-9a-f]{3}){1,2}/i], [PR.PR_PLAIN, /^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i], [PR.PR_PUNCTUATION, /^[^\s\w\'\"]+/]]), ['css']); | ||
PR.registerLangHandler(PR.createSimpleLexer([], [[PR.PR_KEYWORD, /^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]), ['css-kw']); | ||
PR.registerLangHandler(PR.createSimpleLexer([], [[PR.PR_STRING, /^[^\)\"\']+/]]), ['css-str']); |
@@ -0,3 +1,5 @@ | ||
"use strict"; | ||
var addSorting = function () { | ||
"use strict"; | ||
'use strict'; | ||
@@ -4,0 +6,0 @@ var cols, |
@@ -8,12 +8,16 @@ "use strict"; | ||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } | ||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } | ||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } | ||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } | ||
function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } | ||
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } | ||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } | ||
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); } | ||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } | ||
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } | ||
function filterUniqueArray(arr) { | ||
@@ -20,0 +24,0 @@ return arr.filter(function (val, index) { |
@@ -9,2 +9,3 @@ "use strict"; | ||
var MS = /^Ms/g; | ||
var cache = {}; | ||
@@ -16,3 +17,9 @@ function toUpper(match) { | ||
function camelCaseProperty(property) { | ||
return property.replace(DASH, toUpper).replace(MS, 'ms'); | ||
if (cache.hasOwnProperty(property)) { | ||
return cache[property]; | ||
} | ||
var camelProp = property.replace(DASH, toUpper).replace(MS, 'ms'); | ||
cache[property] = camelProp; | ||
return camelProp; | ||
} |
{ | ||
"name": "css-in-js-utils", | ||
"version": "3.0.4", | ||
"version": "3.1.0", | ||
"description": "Useful utility functions for CSS in JS solutions", | ||
"main": "lib/index.js", | ||
"module": "es/index.js", | ||
"types": "es/index.d.ts", | ||
"jsnext:main": "es/index.js", | ||
@@ -23,9 +24,9 @@ "sideEffects": false, | ||
"scripts": { | ||
"build": "yarn run clean && yarn build:lib && yarn build:es", | ||
"build:lib": "cross-env BABEL_ENV=commonjs babel modules --out-dir lib --ignore __tests__", | ||
"build:es": "babel modules --out-dir es --ignore __tests__", | ||
"build": "yarn run clean && yarn build:es && yarn build:lib", | ||
"build:lib": "cross-env BABEL_ENV=commonjs babel modules --extensions '.ts' --ignore 'modules/__tests__','**/*.d.ts' --out-dir lib", | ||
"build:es": "tsc && babel es --out-dir es", | ||
"clean": "rimraf es lib coverage", | ||
"check": "yarn lint && yarn test:coverage", | ||
"format": "prettier --write \"modules/**/*.js\"", | ||
"lint": "eslint modules/**/*.js", | ||
"format": "prettier --write \"modules/**/*.{js,ts}\"", | ||
"lint": "eslint 'modules/**/*.{js,ts}'", | ||
"release": "git pull --rebase && yarn run check && yarn build && npm publish", | ||
@@ -46,20 +47,20 @@ "test": "cross-env BABEL_ENV=commonjs jest", | ||
"devDependencies": { | ||
"@babel/cli": "^7.2.0", | ||
"@babel/core": "^7.2.2", | ||
"@babel/preset-env": "^7.2.0", | ||
"babel-core": "7.0.0-bridge.0", | ||
"babel-eslint": "^7.1.1", | ||
"babel-jest": "^23.6.0", | ||
"babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", | ||
"cross-env": "^5.2.0", | ||
"eslint": "^3.14.1", | ||
"eslint-config-airbnb": "^14.0.0", | ||
"eslint-plugin-flowtype": "^2.30.0", | ||
"eslint-plugin-import": "^2.2.0", | ||
"eslint-plugin-jsx-a11y": "^3.0.2", | ||
"eslint-plugin-react": "^6.9.0", | ||
"jest": "^23.6.0", | ||
"@babel/cli": "^7.8.4", | ||
"@babel/core": "^7.9.0", | ||
"@babel/preset-env": "^7.9.5", | ||
"@babel/preset-typescript": "^7.9.0", | ||
"@types/jest": "^25.2.1", | ||
"@typescript-eslint/eslint-plugin": "^2.26.0", | ||
"@typescript-eslint/parser": "^2.26.0", | ||
"babel-jest": "^25.2.6", | ||
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.2", | ||
"cross-env": "^7.0.2", | ||
"eslint": "^6.8.0", | ||
"eslint-config-airbnb-base": "^14.1.0", | ||
"eslint-plugin-import": "^2.20.2", | ||
"jest": "^25.2.6", | ||
"prettier": "^1.7.4", | ||
"rimraf": "^2.6.1" | ||
"rimraf": "^2.6.1", | ||
"typescript": "^3.8.3" | ||
} | ||
} |
61101
47
1396