rtl-css-js
Advanced tools
Comparing version 1.9.0 to 1.9.1
@@ -458,3 +458,3 @@ 'use strict'; | ||
return newObj; | ||
}, {}); | ||
}, Array.isArray(object) ? [] : {}); | ||
} | ||
@@ -461,0 +461,0 @@ |
@@ -456,3 +456,3 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { | ||
return newObj; | ||
}, {}); | ||
}, Array.isArray(object) ? [] : {}); | ||
} | ||
@@ -459,0 +459,0 @@ |
@@ -462,3 +462,3 @@ (function (global, factory) { | ||
return newObj; | ||
}, {}); | ||
}, Array.isArray(object) ? [] : {}); | ||
} | ||
@@ -465,0 +465,0 @@ |
@@ -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";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}); | ||
!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"),y=new RegExp("(left)|(right)");function R(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 R(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:y}):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},Array.isArray(f)?[]:{})}return R}); |
{ | ||
"name": "rtl-css-js", | ||
"version": "1.9.0", | ||
"version": "1.9.1", | ||
"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
131365
2480