rtl-css-js
Advanced tools
Comparing version 1.8.0 to 1.9.0
@@ -381,10 +381,16 @@ 'use strict'; | ||
propertyValueConverters.boxShadow = propertyValueConverters.textShadow; | ||
propertyValueConverters.webkitBoxShadow = propertyValueConverters.textShadow; | ||
propertyValueConverters.mozBoxShadow = propertyValueConverters.textShadow; | ||
propertyValueConverters.webkitBoxShadow = propertyValueConverters.boxShadow; | ||
propertyValueConverters.mozBoxShadow = propertyValueConverters.boxShadow; | ||
propertyValueConverters.WebkitBoxShadow = propertyValueConverters.boxShadow; | ||
propertyValueConverters.MozBoxShadow = propertyValueConverters.boxShadow; | ||
propertyValueConverters.borderStyle = propertyValueConverters.borderColor; | ||
propertyValueConverters.webkitTransform = propertyValueConverters.transform; | ||
propertyValueConverters.mozTransform = propertyValueConverters.transform; | ||
propertyValueConverters.WebkitTransform = propertyValueConverters.transform; | ||
propertyValueConverters.MozTransform = propertyValueConverters.transform; | ||
propertyValueConverters.transformOrigin = propertyValueConverters.backgroundPosition; | ||
propertyValueConverters.webkitTransformOrigin = propertyValueConverters.transformOrigin; | ||
propertyValueConverters.mozTransformOrigin = propertyValueConverters.transformOrigin; | ||
propertyValueConverters.WebkitTransformOrigin = propertyValueConverters.transformOrigin; | ||
propertyValueConverters.MozTransformOrigin = propertyValueConverters.transformOrigin; | ||
@@ -485,3 +491,3 @@ // kebab-case versions | ||
function getValueDoppelganger(key, originalValue) { | ||
/* eslint complexity:[2, 8] */ // let's try to keep the complexity down... If we have to do this much more, let's break this up | ||
/* eslint complexity:[2, 9] */ // let's try to keep the complexity down... If we have to do this much more, let's break this up | ||
if (isNullOrUndefined(originalValue) || isBoolean(originalValue)) { | ||
@@ -488,0 +494,0 @@ return originalValue; |
@@ -383,10 +383,16 @@ 'use strict'; | ||
propertyValueConverters.boxShadow = propertyValueConverters.textShadow; | ||
propertyValueConverters.webkitBoxShadow = propertyValueConverters.textShadow; | ||
propertyValueConverters.mozBoxShadow = propertyValueConverters.textShadow; | ||
propertyValueConverters.webkitBoxShadow = propertyValueConverters.boxShadow; | ||
propertyValueConverters.mozBoxShadow = propertyValueConverters.boxShadow; | ||
propertyValueConverters.WebkitBoxShadow = propertyValueConverters.boxShadow; | ||
propertyValueConverters.MozBoxShadow = propertyValueConverters.boxShadow; | ||
propertyValueConverters.borderStyle = propertyValueConverters.borderColor; | ||
propertyValueConverters.webkitTransform = propertyValueConverters.transform; | ||
propertyValueConverters.mozTransform = propertyValueConverters.transform; | ||
propertyValueConverters.WebkitTransform = propertyValueConverters.transform; | ||
propertyValueConverters.MozTransform = propertyValueConverters.transform; | ||
propertyValueConverters.transformOrigin = propertyValueConverters.backgroundPosition; | ||
propertyValueConverters.webkitTransformOrigin = propertyValueConverters.transformOrigin; | ||
propertyValueConverters.mozTransformOrigin = propertyValueConverters.transformOrigin; | ||
propertyValueConverters.WebkitTransformOrigin = propertyValueConverters.transformOrigin; | ||
propertyValueConverters.MozTransformOrigin = propertyValueConverters.transformOrigin; | ||
@@ -393,0 +399,0 @@ // kebab-case versions |
@@ -379,10 +379,16 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { | ||
propertyValueConverters.boxShadow = propertyValueConverters.textShadow; | ||
propertyValueConverters.webkitBoxShadow = propertyValueConverters.textShadow; | ||
propertyValueConverters.mozBoxShadow = propertyValueConverters.textShadow; | ||
propertyValueConverters.webkitBoxShadow = propertyValueConverters.boxShadow; | ||
propertyValueConverters.mozBoxShadow = propertyValueConverters.boxShadow; | ||
propertyValueConverters.WebkitBoxShadow = propertyValueConverters.boxShadow; | ||
propertyValueConverters.MozBoxShadow = propertyValueConverters.boxShadow; | ||
propertyValueConverters.borderStyle = propertyValueConverters.borderColor; | ||
propertyValueConverters.webkitTransform = propertyValueConverters.transform; | ||
propertyValueConverters.mozTransform = propertyValueConverters.transform; | ||
propertyValueConverters.WebkitTransform = propertyValueConverters.transform; | ||
propertyValueConverters.MozTransform = propertyValueConverters.transform; | ||
propertyValueConverters.transformOrigin = propertyValueConverters.backgroundPosition; | ||
propertyValueConverters.webkitTransformOrigin = propertyValueConverters.transformOrigin; | ||
propertyValueConverters.mozTransformOrigin = propertyValueConverters.transformOrigin; | ||
propertyValueConverters.WebkitTransformOrigin = propertyValueConverters.transformOrigin; | ||
propertyValueConverters.MozTransformOrigin = propertyValueConverters.transformOrigin; | ||
@@ -389,0 +395,0 @@ // kebab-case versions |
@@ -385,10 +385,16 @@ (function (global, factory) { | ||
propertyValueConverters.boxShadow = propertyValueConverters.textShadow; | ||
propertyValueConverters.webkitBoxShadow = propertyValueConverters.textShadow; | ||
propertyValueConverters.mozBoxShadow = propertyValueConverters.textShadow; | ||
propertyValueConverters.webkitBoxShadow = propertyValueConverters.boxShadow; | ||
propertyValueConverters.mozBoxShadow = propertyValueConverters.boxShadow; | ||
propertyValueConverters.WebkitBoxShadow = propertyValueConverters.boxShadow; | ||
propertyValueConverters.MozBoxShadow = propertyValueConverters.boxShadow; | ||
propertyValueConverters.borderStyle = propertyValueConverters.borderColor; | ||
propertyValueConverters.webkitTransform = propertyValueConverters.transform; | ||
propertyValueConverters.mozTransform = propertyValueConverters.transform; | ||
propertyValueConverters.WebkitTransform = propertyValueConverters.transform; | ||
propertyValueConverters.MozTransform = propertyValueConverters.transform; | ||
propertyValueConverters.transformOrigin = propertyValueConverters.backgroundPosition; | ||
propertyValueConverters.webkitTransformOrigin = propertyValueConverters.transformOrigin; | ||
propertyValueConverters.mozTransformOrigin = propertyValueConverters.transformOrigin; | ||
propertyValueConverters.WebkitTransformOrigin = propertyValueConverters.transformOrigin; | ||
propertyValueConverters.MozTransformOrigin = propertyValueConverters.transformOrigin; | ||
@@ -395,0 +401,0 @@ // kebab-case versions |
@@ -1,1 +0,1 @@ | ||
!function(r,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(r.rtlCSSJSCore={})}(this,function(r){"use strict";function e(r){return"number"==typeof r}function t(r,e){return-1!==r.indexOf(e)}function n(r){return 0===parseFloat(r)?r:"-"===r[0]?r.slice(1):"-"+r}function o(r,e,t,o){return e+n(t)+o}function i(r){var e=r.indexOf(".");if(-1===e)r=100-parseFloat(r)+"%";else{var t=r.length-e-2;r=(r=100-parseFloat(r)).toFixed(t)+"%"}return r}function a(r){return r.replace(/ +/g," ").split(" ").map(function(r){return r.trim()}).filter(Boolean).reduce(function(r,e){var t=r.list,n=r.state,o=(e.match(/\(/g)||[]).length,i=(e.match(/\)/g)||[]).length;return n.parensDepth>0?t[t.length-1]=t[t.length-1]+" "+e:t.push(e),n.parensDepth+=o-i,{list:t,state:n}},{list:[],state:{parensDepth:0}}).list}function u(r){var e=a(r);if(e.length<=3||e.length>4)return r;var t=l(e,4),n=t[0],o=t[1],i=t[2];return[n,t[3],i,o].join(" ")}var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},l=function(){function r(r,e){var t=[],n=!0,o=!1,i=void 0;try{for(var a,u=r[Symbol.iterator]();!(n=(a=u.next()).done)&&(t.push(a.value),!e||t.length!==e);n=!0);}catch(r){o=!0,i=r}finally{try{!n&&u.return&&u.return()}finally{if(o)throw i}}return t}return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return r(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),c={padding:function(r){var t=r.value;return e(t)?t:u(t)},textShadow:function(r){return r.value.replace(/(-*)([.|\d]+)/,function(r,e,t){return"0"===t?r:""+(""===e?"-":"")+t})},borderColor:function(r){return u(r.value)},borderRadius:function(r){var n=r.value;if(e(n))return n;if(t(n,"/")){var o=n.split("/"),i=l(o,2),u=i[0],s=i[1];return c.borderRadius({value:u.trim()})+" / "+c.borderRadius({value:s.trim()})}var f=a(n);switch(f.length){case 2:return f.reverse().join(" ");case 4:var d=l(f,4),g=d[0],b=d[1],p=d[2];return[b,g,d[3],p].join(" ");default:return n}},background:function(r){var e=r.value,t=r.valuesToConvert,n=r.isRtl,o=r.bgImgDirectionRegex,i=r.bgPosDirectionRegex,a=e.replace(/(url\(.*?\))|(rgba?\(.*?\))|(hsl\(.*?\))|(#[a-fA-F0-9]+)|((^| )(\D)+( |$))/g,"").trim();return e=e.replace(a,c.backgroundPosition({value:a,valuesToConvert:t,isRtl:n,bgPosDirectionRegex:i})),c.backgroundImage({value:e,valuesToConvert:t,bgImgDirectionRegex:o})},backgroundImage:function(r){var e=r.value,n=r.valuesToConvert,o=r.bgImgDirectionRegex;return t(e,"url(")||t(e,"linear-gradient(")?e.replace(o,function(r,e,t){return r.replace(t,n[t])}):e},backgroundPosition:function(r){var e=r.value,t=r.valuesToConvert,n=r.isRtl,o=r.bgPosDirectionRegex;return e.replace(n?/^((-|\d|\.)+%)/:null,function(r,e){return i(e)}).replace(o,function(r){return t[r]})},backgroundPositionX:function(r){var t=r.value,n=r.valuesToConvert,o=r.isRtl,i=r.bgPosDirectionRegex;return e(t)?t:c.backgroundPosition({value:t,valuesToConvert:n,isRtl:o,bgPosDirectionRegex:i})},transform:function(r){var e=r.value,t="(?:(?:(?:\\[0-9a-f]{1,6})(?:\\r\\n|\\s)?)|\\\\[^\\r\\n\\f0-9a-f])",n="((?:-?(?:[0-9]*\\.[0-9]+|[0-9]+)(?:\\s*(?:em|ex|px|cm|mm|in|pt|pc|deg|rad|grad|ms|s|hz|khz|%)|-?(?:[_a-z]|[^\\u0020-\\u007e]|"+t+")(?:[_a-z0-9-]|[^\\u0020-\\u007e]|"+t+")*)?)|(?:inherit|auto))",i=new RegExp("(translateX\\s*\\(\\s*)"+n+"(\\s*\\))","gi"),a=new RegExp("(translate\\s*\\(\\s*)"+n+"((?:\\s*,\\s*"+n+"){0,1}\\s*\\))","gi"),u=new RegExp("(translate3d\\s*\\(\\s*)"+n+"((?:\\s*,\\s*"+n+"){0,2}\\s*\\))","gi"),s=new RegExp("(rotate[ZY]?\\s*\\(\\s*)"+n+"(\\s*\\))","gi");return e.replace(i,o).replace(a,o).replace(u,o).replace(s,o)}};c.margin=c.padding,c.borderWidth=c.padding,c.boxShadow=c.textShadow,c.webkitBoxShadow=c.textShadow,c.mozBoxShadow=c.textShadow,c.borderStyle=c.borderColor,c.webkitTransform=c.transform,c.mozTransform=c.transform,c.transformOrigin=c.backgroundPosition,c.webkitTransformOrigin=c.transformOrigin,c.mozTransformOrigin=c.transformOrigin,c["text-shadow"]=c.textShadow,c["border-color"]=c.borderColor,c["border-radius"]=c.borderRadius,c["background-image"]=c.backgroundImage,c["background-position"]=c.backgroundPosition,c["background-position-x"]=c.backgroundPositionX,c["border-width"]=c.padding,c["box-shadow"]=c.textShadow,c["-webkit-box-shadow"]=c.textShadow,c["-moz-box-shadow"]=c.textShadow,c["border-style"]=c.borderColor,c["-webkit-transform"]=c.transform,c["-moz-transform"]=c.transform,c["transform-origin"]=c.transformOrigin,c["-webkit-transform-origin"]=c.transformOrigin,c["-moz-transform-origin"]=c.transformOrigin,r.propertyValueConverters=c,r.arrayToObject=function(r){return r.reduce(function(r,e){var t=l(e,2),n=t[0],o=t[1];return r[n]=o,r[o]=n,r},{})},r.calculateNewBackgroundPosition=i,r.calculateNewTranslate=o,r.flipTransformSign=o,r.flipSign=n,r.handleQuartetValues=u,r.includes=t,r.isBoolean=function(r){return"boolean"==typeof r},r.isNullOrUndefined=function(r){return null===r||void 0===r},r.isNumber=e,r.isObject=function(r){return r&&"object"===(void 0===r?"undefined":s(r))},r.isString=function(r){return"string"==typeof r},r.getValuesAsList=a,Object.defineProperty(r,"__esModule",{value:!0})}); | ||
!function(r,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(r.rtlCSSJSCore={})}(this,function(r){"use strict";var e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},c=function(r,e){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return function(r,e){var n=[],t=!0,o=!1,i=void 0;try{for(var a,u=r[Symbol.iterator]();!(t=(a=u.next()).done)&&(n.push(a.value),!e||n.length!==e);t=!0);}catch(r){o=!0,i=r}finally{try{!t&&u.return&&u.return()}finally{if(o)throw i}}return n}(r,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")};function d(r){return"number"==typeof r}function g(r,e){return-1!==r.indexOf(e)}function o(r){return 0===parseFloat(r)?r:"-"===r[0]?r.slice(1):"-"+r}function l(r,e,n,t){return e+o(n)+t}function i(r){var e=r.indexOf(".");if(-1===e)r=100-parseFloat(r)+"%";else{var n=r.length-e-2;r=(r=100-parseFloat(r)).toFixed(n)+"%"}return r}function b(r){return r.replace(/ +/g," ").split(" ").map(function(r){return r.trim()}).filter(Boolean).reduce(function(r,e){var n=r.list,t=r.state,o=(e.match(/\(/g)||[]).length,i=(e.match(/\)/g)||[]).length;return 0<t.parensDepth?n[n.length-1]=n[n.length-1]+" "+e:n.push(e),t.parensDepth+=o-i,{list:n,state:t}},{list:[],state:{parensDepth:0}}).list}function n(r){var e=b(r);if(e.length<=3||4<e.length)return r;var n=c(e,4),t=n[0],o=n[1],i=n[2];return[t,n[3],i,o].join(" ")}var m={padding:function(r){var e=r.value;return d(e)?e:n(e)},textShadow:function(r){return r.value.replace(/(-*)([.|\d]+)/,function(r,e,n){return"0"===n?r:""+(""===e?"-":"")+n})},borderColor:function(r){return n(r.value)},borderRadius:function(r){var e=r.value;if(d(e))return e;if(g(e,"/")){var n=e.split("/"),t=c(n,2),o=t[0],i=t[1];return m.borderRadius({value:o.trim()})+" / "+m.borderRadius({value:i.trim()})}var a=b(e);switch(a.length){case 2:return a.reverse().join(" ");case 4:var u=c(a,4),s=u[0],l=u[1],f=u[2];return[l,s,u[3],f].join(" ");default:return e}},background:function(r){var e=r.value,n=r.valuesToConvert,t=r.isRtl,o=r.bgImgDirectionRegex,i=r.bgPosDirectionRegex,a=e.replace(/(url\(.*?\))|(rgba?\(.*?\))|(hsl\(.*?\))|(#[a-fA-F0-9]+)|((^| )(\D)+( |$))/g,"").trim();return e=e.replace(a,m.backgroundPosition({value:a,valuesToConvert:n,isRtl:t,bgPosDirectionRegex:i})),m.backgroundImage({value:e,valuesToConvert:n,bgImgDirectionRegex:o})},backgroundImage:function(r){var e=r.value,t=r.valuesToConvert,n=r.bgImgDirectionRegex;return g(e,"url(")||g(e,"linear-gradient(")?e.replace(n,function(r,e,n){return r.replace(n,t[n])}):e},backgroundPosition:function(r){var e=r.value,n=r.valuesToConvert,t=r.isRtl,o=r.bgPosDirectionRegex;return e.replace(t?/^((-|\d|\.)+%)/:null,function(r,e){return i(e)}).replace(o,function(r){return n[r]})},backgroundPositionX:function(r){var e=r.value,n=r.valuesToConvert,t=r.isRtl,o=r.bgPosDirectionRegex;return d(e)?e:m.backgroundPosition({value:e,valuesToConvert:n,isRtl:t,bgPosDirectionRegex:o})},transform:function(r){var e=r.value,n="[^\\u0020-\\u007e]",t="(?:(?:(?:\\[0-9a-f]{1,6})(?:\\r\\n|\\s)?)|\\\\[^\\r\\n\\f0-9a-f])",o="((?:-?(?:[0-9]*\\.[0-9]+|[0-9]+)(?:\\s*(?:em|ex|px|cm|mm|in|pt|pc|deg|rad|grad|ms|s|hz|khz|%)|-?(?:[_a-z]|"+n+"|"+t+")(?:[_a-z0-9-]|"+n+"|"+t+")*)?)|(?:inherit|auto))",i=new RegExp("(translateX\\s*\\(\\s*)"+o+"(\\s*\\))","gi"),a=new RegExp("(translate\\s*\\(\\s*)"+o+"((?:\\s*,\\s*"+o+"){0,1}\\s*\\))","gi"),u=new RegExp("(translate3d\\s*\\(\\s*)"+o+"((?:\\s*,\\s*"+o+"){0,2}\\s*\\))","gi"),s=new RegExp("(rotate[ZY]?\\s*\\(\\s*)"+o+"(\\s*\\))","gi");return e.replace(i,l).replace(a,l).replace(u,l).replace(s,l)}};m.margin=m.padding,m.borderWidth=m.padding,m.boxShadow=m.textShadow,m.webkitBoxShadow=m.boxShadow,m.mozBoxShadow=m.boxShadow,m.WebkitBoxShadow=m.boxShadow,m.MozBoxShadow=m.boxShadow,m.borderStyle=m.borderColor,m.webkitTransform=m.transform,m.mozTransform=m.transform,m.WebkitTransform=m.transform,m.MozTransform=m.transform,m.transformOrigin=m.backgroundPosition,m.webkitTransformOrigin=m.transformOrigin,m.mozTransformOrigin=m.transformOrigin,m.WebkitTransformOrigin=m.transformOrigin,m.MozTransformOrigin=m.transformOrigin,m["text-shadow"]=m.textShadow,m["border-color"]=m.borderColor,m["border-radius"]=m.borderRadius,m["background-image"]=m.backgroundImage,m["background-position"]=m.backgroundPosition,m["background-position-x"]=m.backgroundPositionX,m["border-width"]=m.padding,m["box-shadow"]=m.textShadow,m["-webkit-box-shadow"]=m.textShadow,m["-moz-box-shadow"]=m.textShadow,m["border-style"]=m.borderColor,m["-webkit-transform"]=m.transform,m["-moz-transform"]=m.transform,m["transform-origin"]=m.transformOrigin,m["-webkit-transform-origin"]=m.transformOrigin,m["-moz-transform-origin"]=m.transformOrigin,r.propertyValueConverters=m,r.arrayToObject=function(r){return r.reduce(function(r,e){var n=c(e,2),t=n[0],o=n[1];return r[t]=o,r[o]=t,r},{})},r.calculateNewBackgroundPosition=i,r.calculateNewTranslate=l,r.flipTransformSign=l,r.flipSign=o,r.handleQuartetValues=n,r.includes=g,r.isBoolean=function(r){return"boolean"==typeof r},r.isNullOrUndefined=function(r){return null==r},r.isNumber=d,r.isObject=function(r){return r&&"object"===(void 0===r?"undefined":e(r))},r.isString=function(r){return"string"==typeof r},r.getValuesAsList=b,Object.defineProperty(r,"__esModule",{value:!0})}); |
@@ -379,10 +379,16 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { | ||
propertyValueConverters.boxShadow = propertyValueConverters.textShadow; | ||
propertyValueConverters.webkitBoxShadow = propertyValueConverters.textShadow; | ||
propertyValueConverters.mozBoxShadow = propertyValueConverters.textShadow; | ||
propertyValueConverters.webkitBoxShadow = propertyValueConverters.boxShadow; | ||
propertyValueConverters.mozBoxShadow = propertyValueConverters.boxShadow; | ||
propertyValueConverters.WebkitBoxShadow = propertyValueConverters.boxShadow; | ||
propertyValueConverters.MozBoxShadow = propertyValueConverters.boxShadow; | ||
propertyValueConverters.borderStyle = propertyValueConverters.borderColor; | ||
propertyValueConverters.webkitTransform = propertyValueConverters.transform; | ||
propertyValueConverters.mozTransform = propertyValueConverters.transform; | ||
propertyValueConverters.WebkitTransform = propertyValueConverters.transform; | ||
propertyValueConverters.MozTransform = propertyValueConverters.transform; | ||
propertyValueConverters.transformOrigin = propertyValueConverters.backgroundPosition; | ||
propertyValueConverters.webkitTransformOrigin = propertyValueConverters.transformOrigin; | ||
propertyValueConverters.mozTransformOrigin = propertyValueConverters.transformOrigin; | ||
propertyValueConverters.WebkitTransformOrigin = propertyValueConverters.transformOrigin; | ||
propertyValueConverters.MozTransformOrigin = propertyValueConverters.transformOrigin; | ||
@@ -483,3 +489,3 @@ // kebab-case versions | ||
function getValueDoppelganger(key, originalValue) { | ||
/* eslint complexity:[2, 8] */ // let's try to keep the complexity down... If we have to do this much more, let's break this up | ||
/* eslint complexity:[2, 9] */ // let's try to keep the complexity down... If we have to do this much more, let's break this up | ||
if (isNullOrUndefined(originalValue) || isBoolean(originalValue)) { | ||
@@ -486,0 +492,0 @@ return originalValue; |
@@ -385,10 +385,16 @@ (function (global, factory) { | ||
propertyValueConverters.boxShadow = propertyValueConverters.textShadow; | ||
propertyValueConverters.webkitBoxShadow = propertyValueConverters.textShadow; | ||
propertyValueConverters.mozBoxShadow = propertyValueConverters.textShadow; | ||
propertyValueConverters.webkitBoxShadow = propertyValueConverters.boxShadow; | ||
propertyValueConverters.mozBoxShadow = propertyValueConverters.boxShadow; | ||
propertyValueConverters.WebkitBoxShadow = propertyValueConverters.boxShadow; | ||
propertyValueConverters.MozBoxShadow = propertyValueConverters.boxShadow; | ||
propertyValueConverters.borderStyle = propertyValueConverters.borderColor; | ||
propertyValueConverters.webkitTransform = propertyValueConverters.transform; | ||
propertyValueConverters.mozTransform = propertyValueConverters.transform; | ||
propertyValueConverters.WebkitTransform = propertyValueConverters.transform; | ||
propertyValueConverters.MozTransform = propertyValueConverters.transform; | ||
propertyValueConverters.transformOrigin = propertyValueConverters.backgroundPosition; | ||
propertyValueConverters.webkitTransformOrigin = propertyValueConverters.transformOrigin; | ||
propertyValueConverters.mozTransformOrigin = propertyValueConverters.transformOrigin; | ||
propertyValueConverters.WebkitTransformOrigin = propertyValueConverters.transformOrigin; | ||
propertyValueConverters.MozTransformOrigin = propertyValueConverters.transformOrigin; | ||
@@ -489,3 +495,3 @@ // kebab-case versions | ||
function getValueDoppelganger(key, originalValue) { | ||
/* eslint complexity:[2, 8] */ // let's try to keep the complexity down... If we have to do this much more, let's break this up | ||
/* eslint complexity:[2, 9] */ // let's try to keep the complexity down... If we have to do this much more, let's break this up | ||
if (isNullOrUndefined(originalValue) || isBoolean(originalValue)) { | ||
@@ -492,0 +498,0 @@ return originalValue; |
@@ -1,1 +0,1 @@ | ||
!function(r,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):r.rtlCSSJS=e()}(this,function(){"use strict";function r(r){return r.reduce(function(r,e){var t=h(e,2),n=t[0],o=t[1];return r[n]=o,r[o]=n,r},{})}function e(r){return"boolean"==typeof r}function t(r){return"number"==typeof r}function n(r){return null===r||void 0===r}function o(r){return r&&"object"===(void 0===r?"undefined":p(r))}function i(r){return"string"==typeof r}function a(r,e){return-1!==r.indexOf(e)}function u(r){return 0===parseFloat(r)?r:"-"===r[0]?r.slice(1):"-"+r}function s(r,e,t,n){return e+u(t)+n}function d(r){var e=r.indexOf(".");if(-1===e)r=100-parseFloat(r)+"%";else{var t=r.length-e-2;r=(r=100-parseFloat(r)).toFixed(t)+"%"}return r}function l(r){return r.replace(/ +/g," ").split(" ").map(function(r){return r.trim()}).filter(Boolean).reduce(function(r,e){var t=r.list,n=r.state,o=(e.match(/\(/g)||[]).length,i=(e.match(/\)/g)||[]).length;return n.parensDepth>0?t[t.length-1]=t[t.length-1]+" "+e:t.push(e),n.parensDepth+=o-i,{list:t,state:n}},{list:[],state:{parensDepth:0}}).list}function f(r){var e=l(r);if(e.length<=3||e.length>4)return r;var t=h(e,4),n=t[0],o=t[1],i=t[2];return[n,t[3],i,o].join(" ")}function g(r){return Object.keys(r).reduce(function(e,t){var n=r[t];if(i(n)&&(n=n.trim()),a(R,t))return e[t]=n,e;var o=c(t,n),u=o.key,s=o.value;return e[u]=s,e},{})}function c(r,e){var t=/\/\*\s?@noflip\s?\*\//.test(e),n=t?r:b(r);return{key:n,value:t?e:m(n,e)}}function b(r){return x[r]||r}function m(r,i){if(n(i)||e(i))return i;if(o(i))return g(i);var a=t(i),u=a?i:i.replace(/ !important.*?$/,""),s=!a&&u.length!==i.length,d=v[r],l=void 0;return l=d?d({value:u,valuesToConvert:w,isRtl:!0,bgImgDirectionRegex:y,bgPosDirectionRegex:k}):w[u]||u,s?l+" !important":l}var p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},h=function(){function r(r,e){var t=[],n=!0,o=!1,i=void 0;try{for(var a,u=r[Symbol.iterator]();!(n=(a=u.next()).done)&&(t.push(a.value),!e||t.length!==e);n=!0);}catch(r){o=!0,i=r}finally{try{!n&&u.return&&u.return()}finally{if(o)throw i}}return t}return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return r(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),v={padding:function(r){var e=r.value;return t(e)?e:f(e)},textShadow:function(r){return r.value.replace(/(-*)([.|\d]+)/,function(r,e,t){return"0"===t?r:""+(""===e?"-":"")+t})},borderColor:function(r){return f(r.value)},borderRadius:function(r){var e=r.value;if(t(e))return e;if(a(e,"/")){var n=e.split("/"),o=h(n,2),i=o[0],u=o[1];return v.borderRadius({value:i.trim()})+" / "+v.borderRadius({value:u.trim()})}var s=l(e);switch(s.length){case 2:return s.reverse().join(" ");case 4:var d=h(s,4),f=d[0],g=d[1],c=d[2];return[g,f,d[3],c].join(" ");default:return e}},background:function(r){var e=r.value,t=r.valuesToConvert,n=r.isRtl,o=r.bgImgDirectionRegex,i=r.bgPosDirectionRegex,a=e.replace(/(url\(.*?\))|(rgba?\(.*?\))|(hsl\(.*?\))|(#[a-fA-F0-9]+)|((^| )(\D)+( |$))/g,"").trim();return e=e.replace(a,v.backgroundPosition({value:a,valuesToConvert:t,isRtl:n,bgPosDirectionRegex:i})),v.backgroundImage({value:e,valuesToConvert:t,bgImgDirectionRegex:o})},backgroundImage:function(r){var e=r.value,t=r.valuesToConvert,n=r.bgImgDirectionRegex;return a(e,"url(")||a(e,"linear-gradient(")?e.replace(n,function(r,e,n){return r.replace(n,t[n])}):e},backgroundPosition:function(r){var e=r.value,t=r.valuesToConvert,n=r.isRtl,o=r.bgPosDirectionRegex;return e.replace(n?/^((-|\d|\.)+%)/:null,function(r,e){return d(e)}).replace(o,function(r){return t[r]})},backgroundPositionX:function(r){var e=r.value,n=r.valuesToConvert,o=r.isRtl,i=r.bgPosDirectionRegex;return t(e)?e:v.backgroundPosition({value:e,valuesToConvert:n,isRtl:o,bgPosDirectionRegex:i})},transform:function(r){var e=r.value,t="(?:(?:(?:\\[0-9a-f]{1,6})(?:\\r\\n|\\s)?)|\\\\[^\\r\\n\\f0-9a-f])",n="((?:-?(?:[0-9]*\\.[0-9]+|[0-9]+)(?:\\s*(?:em|ex|px|cm|mm|in|pt|pc|deg|rad|grad|ms|s|hz|khz|%)|-?(?:[_a-z]|[^\\u0020-\\u007e]|"+t+")(?:[_a-z0-9-]|[^\\u0020-\\u007e]|"+t+")*)?)|(?:inherit|auto))",o=new RegExp("(translateX\\s*\\(\\s*)"+n+"(\\s*\\))","gi"),i=new RegExp("(translate\\s*\\(\\s*)"+n+"((?:\\s*,\\s*"+n+"){0,1}\\s*\\))","gi"),a=new RegExp("(translate3d\\s*\\(\\s*)"+n+"((?:\\s*,\\s*"+n+"){0,2}\\s*\\))","gi"),u=new RegExp("(rotate[ZY]?\\s*\\(\\s*)"+n+"(\\s*\\))","gi");return e.replace(o,s).replace(i,s).replace(a,s).replace(u,s)}};v.margin=v.padding,v.borderWidth=v.padding,v.boxShadow=v.textShadow,v.webkitBoxShadow=v.textShadow,v.mozBoxShadow=v.textShadow,v.borderStyle=v.borderColor,v.webkitTransform=v.transform,v.mozTransform=v.transform,v.transformOrigin=v.backgroundPosition,v.webkitTransformOrigin=v.transformOrigin,v.mozTransformOrigin=v.transformOrigin,v["text-shadow"]=v.textShadow,v["border-color"]=v.borderColor,v["border-radius"]=v.borderRadius,v["background-image"]=v.backgroundImage,v["background-position"]=v.backgroundPosition,v["background-position-x"]=v.backgroundPositionX,v["border-width"]=v.padding,v["box-shadow"]=v.textShadow,v["-webkit-box-shadow"]=v.textShadow,v["-moz-box-shadow"]=v.textShadow,v["border-style"]=v.borderColor,v["-webkit-transform"]=v.transform,v["-moz-transform"]=v.transform,v["transform-origin"]=v.transformOrigin,v["-webkit-transform-origin"]=v.transformOrigin,v["-moz-transform-origin"]=v.transformOrigin;var x=r([["paddingLeft","paddingRight"],["marginLeft","marginRight"],["left","right"],["borderLeft","borderRight"],["borderLeftColor","borderRightColor"],["borderLeftStyle","borderRightStyle"],["borderLeftWidth","borderRightWidth"],["borderTopLeftRadius","borderTopRightRadius"],["borderBottomLeftRadius","borderBottomRightRadius"],["padding-left","padding-right"],["margin-left","margin-right"],["border-left","border-right"],["border-left-color","border-right-color"],["border-left-style","border-right-style"],["border-left-width","border-right-width"],["border-top-left-radius","border-top-right-radius"],["border-bottom-left-radius","border-bottom-right-radius"]]),R=["content"],w=r([["ltr","rtl"],["left","right"],["w-resize","e-resize"],["sw-resize","se-resize"],["nw-resize","ne-resize"]]),y=new RegExp("(^|\\W|_)((ltr)|(rtl)|(left)|(right))(\\W|_|$)","g"),k=new RegExp("(left)|(right)");return g}); | ||
!function(r,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):r.rtlCSSJS=e()}(this,function(){"use strict";var g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},f=function(r,e){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return function(r,e){var t=[],o=!0,n=!1,i=void 0;try{for(var a,u=r[Symbol.iterator]();!(o=(a=u.next()).done)&&(t.push(a.value),!e||t.length!==e);o=!0);}catch(r){n=!0,i=r}finally{try{!o&&u.return&&u.return()}finally{if(n)throw i}}return t}(r,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")};function r(r){return r.reduce(function(r,e){var t=f(e,2),o=t[0],n=t[1];return r[o]=n,r[n]=o,r},{})}function b(r){return"number"==typeof r}function c(r,e){return-1!==r.indexOf(e)}function d(r,e,t,o){return e+(n=t,0===parseFloat(n)?n:"-"===n[0]?n.slice(1):"-"+n)+o;var n}function m(r){return r.replace(/ +/g," ").split(" ").map(function(r){return r.trim()}).filter(Boolean).reduce(function(r,e){var t=r.list,o=r.state,n=(e.match(/\(/g)||[]).length,i=(e.match(/\)/g)||[]).length;return 0<o.parensDepth?t[t.length-1]=t[t.length-1]+" "+e:t.push(e),o.parensDepth+=n-i,{list:t,state:o}},{list:[],state:{parensDepth:0}}).list}function t(r){var e=m(r);if(e.length<=3||4<e.length)return r;var t=f(e,4),o=t[0],n=t[1],i=t[2];return[o,t[3],i,n].join(" ")}var h={padding:function(r){var e=r.value;return b(e)?e:t(e)},textShadow:function(r){return r.value.replace(/(-*)([.|\d]+)/,function(r,e,t){return"0"===t?r:""+(""===e?"-":"")+t})},borderColor:function(r){return t(r.value)},borderRadius:function(r){var e=r.value;if(b(e))return e;if(c(e,"/")){var t=e.split("/"),o=f(t,2),n=o[0],i=o[1];return h.borderRadius({value:n.trim()})+" / "+h.borderRadius({value:i.trim()})}var a=m(e);switch(a.length){case 2:return a.reverse().join(" ");case 4:var u=f(a,4),s=u[0],d=u[1],l=u[2];return[d,s,u[3],l].join(" ");default:return e}},background:function(r){var e=r.value,t=r.valuesToConvert,o=r.isRtl,n=r.bgImgDirectionRegex,i=r.bgPosDirectionRegex,a=e.replace(/(url\(.*?\))|(rgba?\(.*?\))|(hsl\(.*?\))|(#[a-fA-F0-9]+)|((^| )(\D)+( |$))/g,"").trim();return e=e.replace(a,h.backgroundPosition({value:a,valuesToConvert:t,isRtl:o,bgPosDirectionRegex:i})),h.backgroundImage({value:e,valuesToConvert:t,bgImgDirectionRegex:n})},backgroundImage:function(r){var e=r.value,o=r.valuesToConvert,t=r.bgImgDirectionRegex;return c(e,"url(")||c(e,"linear-gradient(")?e.replace(t,function(r,e,t){return r.replace(t,o[t])}):e},backgroundPosition:function(r){var e=r.value,t=r.valuesToConvert,o=r.isRtl,n=r.bgPosDirectionRegex;return e.replace(o?/^((-|\d|\.)+%)/:null,function(r,e){return function(r){var e=r.indexOf(".");if(-1===e)r=100-parseFloat(r)+"%";else{var t=r.length-e-2;r=(r=100-parseFloat(r)).toFixed(t)+"%"}return r}(e)}).replace(n,function(r){return t[r]})},backgroundPositionX:function(r){var e=r.value,t=r.valuesToConvert,o=r.isRtl,n=r.bgPosDirectionRegex;return b(e)?e:h.backgroundPosition({value:e,valuesToConvert:t,isRtl:o,bgPosDirectionRegex:n})},transform:function(r){var e=r.value,t="[^\\u0020-\\u007e]",o="(?:(?:(?:\\[0-9a-f]{1,6})(?:\\r\\n|\\s)?)|\\\\[^\\r\\n\\f0-9a-f])",n="((?:-?(?:[0-9]*\\.[0-9]+|[0-9]+)(?:\\s*(?:em|ex|px|cm|mm|in|pt|pc|deg|rad|grad|ms|s|hz|khz|%)|-?(?:[_a-z]|"+t+"|"+o+")(?:[_a-z0-9-]|"+t+"|"+o+")*)?)|(?:inherit|auto))",i=new RegExp("(translateX\\s*\\(\\s*)"+n+"(\\s*\\))","gi"),a=new RegExp("(translate\\s*\\(\\s*)"+n+"((?:\\s*,\\s*"+n+"){0,1}\\s*\\))","gi"),u=new RegExp("(translate3d\\s*\\(\\s*)"+n+"((?:\\s*,\\s*"+n+"){0,2}\\s*\\))","gi"),s=new RegExp("(rotate[ZY]?\\s*\\(\\s*)"+n+"(\\s*\\))","gi");return e.replace(i,d).replace(a,d).replace(u,d).replace(s,d)}};h.margin=h.padding,h.borderWidth=h.padding,h.boxShadow=h.textShadow,h.webkitBoxShadow=h.boxShadow,h.mozBoxShadow=h.boxShadow,h.WebkitBoxShadow=h.boxShadow,h.MozBoxShadow=h.boxShadow,h.borderStyle=h.borderColor,h.webkitTransform=h.transform,h.mozTransform=h.transform,h.WebkitTransform=h.transform,h.MozTransform=h.transform,h.transformOrigin=h.backgroundPosition,h.webkitTransformOrigin=h.transformOrigin,h.mozTransformOrigin=h.transformOrigin,h.WebkitTransformOrigin=h.transformOrigin,h.MozTransformOrigin=h.transformOrigin,h["text-shadow"]=h.textShadow,h["border-color"]=h.borderColor,h["border-radius"]=h.borderRadius,h["background-image"]=h.backgroundImage,h["background-position"]=h.backgroundPosition,h["background-position-x"]=h.backgroundPositionX,h["border-width"]=h.padding,h["box-shadow"]=h.textShadow,h["-webkit-box-shadow"]=h.textShadow,h["-moz-box-shadow"]=h.textShadow,h["border-style"]=h.borderColor,h["-webkit-transform"]=h.transform,h["-moz-transform"]=h.transform,h["transform-origin"]=h.transformOrigin,h["-webkit-transform-origin"]=h.transformOrigin,h["-moz-transform-origin"]=h.transformOrigin;var p=r([["paddingLeft","paddingRight"],["marginLeft","marginRight"],["left","right"],["borderLeft","borderRight"],["borderLeftColor","borderRightColor"],["borderLeftStyle","borderRightStyle"],["borderLeftWidth","borderRightWidth"],["borderTopLeftRadius","borderTopRightRadius"],["borderBottomLeftRadius","borderBottomRightRadius"],["padding-left","padding-right"],["margin-left","margin-right"],["border-left","border-right"],["border-left-color","border-right-color"],["border-left-style","border-right-style"],["border-left-width","border-right-width"],["border-top-left-radius","border-top-right-radius"],["border-bottom-left-radius","border-bottom-right-radius"]]),v=["content"],x=r([["ltr","rtl"],["left","right"],["w-resize","e-resize"],["sw-resize","se-resize"],["nw-resize","ne-resize"]]),w=new RegExp("(^|\\W|_)((ltr)|(rtl)|(left)|(right))(\\W|_|$)","g"),R=new RegExp("(left)|(right)");function y(f){return Object.keys(f).reduce(function(r,e){var t=f[e];if("string"==typeof t&&(t=t.trim()),c(v,e))return r[e]=t,r;var o,n,i,a,u,s,d=(o=e,i=/\/\*\s?@noflip\s?\*\//.test(n=t),a=i?o:p[s=o]||s,u=i?n:function(r,e){if(o=e,null==o||(t=e,"boolean"==typeof t))return e;var t;var o;if(n=e,n&&"object"===(void 0===n?"undefined":g(n)))return y(e);var n;var i=b(e),a=i?e:e.replace(/ !important.*?$/,""),u=!i&&a.length!==e.length,s=h[r],d=void 0;d=s?s({value:a,valuesToConvert:x,isRtl:!0,bgImgDirectionRegex:w,bgPosDirectionRegex:R}):x[a]||a;if(u)return d+" !important";return d}(a,n),{key:a,value:u}),l=d.value;return r[d.key]=l,r},{})}return y}); |
{ | ||
"name": "rtl-css-js", | ||
"version": "1.8.0", | ||
"version": "1.9.0", | ||
"description": "Right To Left conversion for CSS in JS objects", | ||
@@ -5,0 +5,0 @@ "main": "dist/rtl-css-js.cjs.js", |
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
131258
2479