Socket
Socket
Sign inDemoInstall

bss

Package Overview
Dependencies
0
Maintainers
1
Versions
69
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.0.0-rc.9 to 3.0.0-rc.10

6

dist/bss.esm.js

@@ -147,3 +147,3 @@ var el = typeof document !== 'undefined' && document.createElement('div'); // eslint-disable-line

var style = b.apply(b, arguments);
parse(style.content.trim(), '__raw').forEach(function (x) { return insert(x.replace(/\.__raw/g, '').trim()); }
parse(style.content.replace(/@import[^;]*;/g, insert).trim(), '__global').forEach(function (x) { return insert(x.replace(/\.__global/g, '').trim()); }
);

@@ -371,6 +371,6 @@ }

propParse(
s.slice(x.prop, x.propEnd), s.slice(x.value, i + 1), x
s.slice(x.prop, x.propEnd), s.slice(x.value, i + 1).trim(), x
)
);
x.end = i + (x.lean ? 1 : 2);
x.end = i + (s[i + 1] === ';' ? 2 : 1);
x.comma = x.value;

@@ -377,0 +377,0 @@ x.value = x.prop = x.propEnd = null;

@@ -153,3 +153,3 @@ (function (global, factory) {

var style = b.apply(b, arguments);
parse(style.content.trim(), '__raw').forEach(function (x) { return insert(x.replace(/\.__raw/g, '').trim()); }
parse(style.content.replace(/@import[^;]*;/g, insert).trim(), '__global').forEach(function (x) { return insert(x.replace(/\.__global/g, '').trim()); }
);

@@ -377,6 +377,6 @@ }

propParse(
s.slice(x.prop, x.propEnd), s.slice(x.value, i + 1), x
s.slice(x.prop, x.propEnd), s.slice(x.value, i + 1).trim(), x
)
);
x.end = i + (x.lean ? 1 : 2);
x.end = i + (s[i + 1] === ';' ? 2 : 1);
x.comma = x.value;

@@ -383,0 +383,0 @@ x.value = x.prop = x.propEnd = null;

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).b=t()}(this,(function(){"use strict";var e="undefined"!=typeof document&&document.createElement("div"),t={flex:0,border:1,transform:1,"line-height":0,"box-shadow":1,"border-top":1,"border-left":1,"border-right":1,"border-bottom":1};function n(n){if("-"===n[0]&&"-"===n[1]||n in t)return t[n];try{return e.style[n]="1px",e.style.setProperty(n,"1px"),t[n]="1px"===e.style[n].slice(-3)}catch(e){return t[n]=!1}}var r=/^(o|O|ms|MS|Ms|moz|Moz|webkit|Webkit|WebKit)([A-Z])/,o=function(e){return e.replace(/(\B[A-Z])/g,"-$1").toLowerCase()},i=function(e){return e?e.hasOwnProperty("width")?e:i(Object.getPrototypeOf(e)):{}},u=["float"].concat(Object.keys("undefined"==typeof document?{}:i(document.documentElement.style))).filter((function(e,t,n){return-1===e.indexOf("-")&&"length"!==e&&n.indexOf(e)===t})).map((function(e){return e.match(r)?"-"+o(e):o(e)})).sort(),l=function(e,t){var n;return Object.assign(e,((n={})[t.split("-").map((function(e){return e[0]})).join("")]=t,n))},a=Object.assign(u.reduce(l,{}),["align-items","bottom","background-color","border-radius","box-shadow","background-image","color","display","float","flex-direction","font-family","font-size","height","justify-content","left","line-height","letter-spacing","margin","margin-bottom","margin-left","margin-right","margin-top","opacity","padding","padding-bottom","padding-left","padding-right","padding-top","right","top","text-align","text-decoration","text-transform","width"].reduce(l,{}));function c(e){return a[e]||e}var s="undefined"!=typeof document&&window.document,f=function(e,t){return t?function(t){return e.indexOf(t.toLowerCase())>-1}:function(t){return e.indexOf(t)>-1}},p=f("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-"),d=f("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_",!0),g=f("'\""),h=f(" ,)"),m=function(e){return"number"==typeof e},v=Object.create(null,{}),x=Object.create(null,{});function b(e){void 0===e&&(e={});var t=e.style;void 0===t&&(t=s&&s.querySelector&&(s.querySelector(".bss_style")||s.createElement("style")));var r=e.prefix;void 0===r&&(r=t&&t.getAttribute("id")||"bss"+("000000"+(Math.random()*Math.pow(36,6)|0).toString(36)).slice(-6));var o=e.append;void 0===o&&(o=!0);var i={},l=[],a=[],f=b();return f.count=0,f.rules=t&&t.textContent&&t.textContent.split(f.prefix+"{}")||[],f.debug=!1,f.prefix=r,f.properties=u,f.at=function(e){return a.unshift("function"==typeof e?e:function(t){return e[t.slice(1)]||t})},f.prop=function(e){return l.unshift(e)},f.create=b,f.ssr=function(){return'<style class="bss_style" id="'+f.prefix+'">'+f.rules.join(f.prefix+"{}")+"</style>"},f.global=function(){var e=f.apply(f,arguments);j(e.content.trim(),"__raw").forEach((function(e){return y(e.replace(/\.__raw/g,"").trim())}))},f.prop((function(e){if(-1===u.indexOf(e)){if(v[e])return f.debug&&console.log(e,"prefixed to",v[e]),v[e];f.debug&&0!==e.indexOf("--")&&console.log(e,"not found")}return e})),f.prop(c),t&&(t.id=f.prefix),f;function x(){if(this.className)return this.className;this.className=f.prefix+ ++f.count;var e=j(this.content.trim(),this.className);return e.forEach(y),e.name}function b(e){return function(t){for(var n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];for(var o=(e||"")+t[0],u=1;u<t.length;u++){var l=n[u-1];o+=(l&&l.toString===x?l.content:Array.isArray(l)?l.map((function(e){return e.content||e})).join("\n"):l)+t[u]}if(o in i)return i[o];var a=b("\n"+o+"\n");return a.toString=a.valueOf=x,a.content=o,i[o]=a,a}}function y(e){o&&(t&&s.head&&s.head.appendChild(t),o=!1);var n=0===e.indexOf("@import")?0:f.rules.length;if(f.debug&&t)0===n?f.rules.unshift(e):f.rules.push(e),t.textContent=f.rules.map(O).join("\n");else if(t&&t.sheet)try{t.sheet.insertRule(e,n),0===n?f.rules.unshift(e):f.rules.push(e)}catch(e){f.debug&&console.log("Ignored error:",e)}else 0===n?f.rules.unshift(e):f.rules.push(e)}function O(e){return e.replace(/{/g," {\n").replace(/([;{])\n*/g,"$1\n ").replace(/(.*):(.*);/g,"$1: $2;").replace(/[\s]*}/g,"\n}\n").replace(/,\s*/g,", ").replace(/@.*{[\s\S]*?}[\s]*}/g,(function(e){return e.split("\n").reduce((function(e,t,n,r){return e+(n<r.length-1?"\n":"")+(n>1&&n<r.length-2?" ":"")+t}),"")})).trim().replace("}\n\n}","}\n}")}function j(e,t){for(var n=[],r={prop:null,propEnd:null,value:null,out:[],lean:!0,comma:0,end:0,quote:!1},o=[],i=!1,u=!1,l=!1,c=!1,s=0;s<e.length;s++)if(s>0&&c&&!d(e[s])&&(t=e.slice(1,s)+"-"+t,c=!1),c||0===s&&"."===e[s])c=!0;else if(E(e,s,e[s],r),"}"===e[s]||s===e.length-1)w(i||u||l||n,s,t,r,o),i&&!o.length&&((u||l||n).push(i.selector+"{"+i.join("")+"}"),i=!1),u&&!o.length&&((l||n).push("@font-face"===u.selector?u.selector+u.join(""):u.selector+"{"+u.join("")+"}"),u=!1),l&&!o.length&&(n.push(l.selector+"{"+l.join("")+"}"),l=!1),o.pop();else if("{"===e[s]){var f=e.slice(r.end,s).trim().replace(/,[\s]*/,",& ");0===f.indexOf("animation")&&r.out.push(["animation",f.slice(10)+" "+t]),w(i||u||l||n,s,t,r,o),r.prop=r.value=r.propEnd=null,0===f.indexOf("@supports")?l=Object.assign([],{selector:f}):"@"===f[0]?u=Object.assign([],{selector:a.reduce((function(e,t){return t(e)}),f.trim())}):0===f.indexOf("animation")?i=Object.assign([],{selector:"@keyframes "+t}):i?o.splice(0,o.length,f):o.push(f)}return n.name=t,n}function w(e,t,n,r,o){var i=r.out.length&&r.out.map((function(e){return e.join(":")})).join(";"),u=o.length&&":"!==o[0][0],l=!e.selector||0!==e.selector.indexOf("@keyframes ");i&&e.push((o.length&&"&"===o[0][0]||!l?"":(u?"":"."+n)+"."+n+(u?" ":""))+(l?o.join(" ").replace(/&/g,"."+n).replace(/ :/g,":"):o.join(" ").replace(/&/g,""))+"{"+i+";}"),r.end=t+1,r.out=[]}function E(e,t,r,o){!o.value&&null!==o.prop&&o.lean&&":"===r&&(o.lean=!1),!o.value&&null!==o.prop&&o.out.length&&","===r?(o.value=o.comma,o.prop=o.out[o.out.length-1][0]):!o.value&&null===o.prop&&p(r)?o.prop=t:!m(o.prop)||o.propEnd||p(r)?m(o.propEnd)&&!m(o.value)&&" "!==r&&"\n"!==r&&":"!==r&&(o.value=t):o.propEnd=t,function(e,t,r,o){o.value&&g(r)&&(o.quote=!o.quote);!o.quote&&null!==o.prop&&(t===e.length-1||";"===e[t+1]||"}"===e[t+1]||o.lean&&","!==e[t-1]&&"\n"===r)&&(o.out.push(function(e,t,r){if(!r.lean)return[e,t];e=l.reduce((function(e,t){return t(e)}),e.trim());for(var o="",i=0,u="px",a=0;a<t.length;a++){if(h(t[a])||a===t.length-1){var c=t.slice(i,a+1).trim();o+=(u&&n(e)?c.replace(/(^|[( ,])([-0-9.]+)([ ,)]|$)/g,"$1$2"+u+"$3").trim():c)+(","===t[a]?"":" "),i=a+1}"("!==t[a]&&")"!==t[a-1]||(u=0===t.slice(i,a).indexOf("translate")?"px":0===t.slice(i,a).indexOf("rotate")?"deg":"")}return[e,o.trim().replace(/[\n ]+/g," ")]}(e.slice(o.prop,o.propEnd),e.slice(o.value,t+1),o)),o.end=t+(o.lean?1:2),o.comma=o.value,o.value=o.prop=o.propEnd=null,o.lean=!0)}(e,t,r,o)}}u.forEach((function(e){var t=e.match(/-(ms|o|webkit|moz)-/g);if(t){var n=e.replace(/-(ms|o|webkit|moz)-/,"");if(-1===u.indexOf(n))return"flexDirection"===n&&(x.flex="-"+t[1].toLowerCase()+"-flex"),void(v[n]=e)}}));var y=b();return y.create=b,y}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).b=t()}(this,(function(){"use strict";var e="undefined"!=typeof document&&document.createElement("div"),t={flex:0,border:1,transform:1,"line-height":0,"box-shadow":1,"border-top":1,"border-left":1,"border-right":1,"border-bottom":1};function n(n){if("-"===n[0]&&"-"===n[1]||n in t)return t[n];try{return e.style[n]="1px",e.style.setProperty(n,"1px"),t[n]="1px"===e.style[n].slice(-3)}catch(e){return t[n]=!1}}var r=/^(o|O|ms|MS|Ms|moz|Moz|webkit|Webkit|WebKit)([A-Z])/,o=function(e){return e.replace(/(\B[A-Z])/g,"-$1").toLowerCase()},i=function(e){return e?e.hasOwnProperty("width")?e:i(Object.getPrototypeOf(e)):{}},u=["float"].concat(Object.keys("undefined"==typeof document?{}:i(document.documentElement.style))).filter((function(e,t,n){return-1===e.indexOf("-")&&"length"!==e&&n.indexOf(e)===t})).map((function(e){return e.match(r)?"-"+o(e):o(e)})).sort(),l=function(e,t){var n;return Object.assign(e,((n={})[t.split("-").map((function(e){return e[0]})).join("")]=t,n))},a=Object.assign(u.reduce(l,{}),["align-items","bottom","background-color","border-radius","box-shadow","background-image","color","display","float","flex-direction","font-family","font-size","height","justify-content","left","line-height","letter-spacing","margin","margin-bottom","margin-left","margin-right","margin-top","opacity","padding","padding-bottom","padding-left","padding-right","padding-top","right","top","text-align","text-decoration","text-transform","width"].reduce(l,{}));function c(e){return a[e]||e}var s="undefined"!=typeof document&&window.document,p=function(e,t){return t?function(t){return e.indexOf(t.toLowerCase())>-1}:function(t){return e.indexOf(t)>-1}},f=p("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-"),d=p("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_",!0),g=p("'\""),m=p(" ,)"),h=function(e){return"number"==typeof e},b=Object.create(null,{}),v=Object.create(null,{});function x(e){void 0===e&&(e={});var t=e.style;void 0===t&&(t=s&&s.querySelector&&(s.querySelector(".bss_style")||s.createElement("style")));var r=e.prefix;void 0===r&&(r=t&&t.getAttribute("id")||"bss"+("000000"+(Math.random()*Math.pow(36,6)|0).toString(36)).slice(-6));var o=e.append;void 0===o&&(o=!0);var i={},l=[],a=[],p=x();return p.count=0,p.rules=t&&t.textContent&&t.textContent.split(p.prefix+"{}")||[],p.debug=!1,p.prefix=r,p.properties=u,p.at=function(e){return a.unshift("function"==typeof e?e:function(t){return e[t.slice(1)]||t})},p.prop=function(e){return l.unshift(e)},p.create=x,p.ssr=function(){return'<style class="bss_style" id="'+p.prefix+'">'+p.rules.join(p.prefix+"{}")+"</style>"},p.global=function(){var e=p.apply(p,arguments);j(e.content.replace(/@import[^;]*;/g,y).trim(),"__global").forEach((function(e){return y(e.replace(/\.__global/g,"").trim())}))},p.prop((function(e){if(-1===u.indexOf(e)){if(b[e])return p.debug&&console.log(e,"prefixed to",b[e]),b[e];p.debug&&0!==e.indexOf("--")&&console.log(e,"not found")}return e})),p.prop(c),t&&(t.id=p.prefix),p;function v(){if(this.className)return this.className;this.className=p.prefix+ ++p.count;var e=j(this.content.trim(),this.className);return e.forEach(y),e.name}function x(e){return function(t){for(var n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];for(var o=(e||"")+t[0],u=1;u<t.length;u++){var l=n[u-1];o+=(l&&l.toString===v?l.content:Array.isArray(l)?l.map((function(e){return e.content||e})).join("\n"):l)+t[u]}if(o in i)return i[o];var a=x("\n"+o+"\n");return a.toString=a.valueOf=v,a.content=o,i[o]=a,a}}function y(e){o&&(t&&s.head&&s.head.appendChild(t),o=!1);var n=0===e.indexOf("@import")?0:p.rules.length;if(p.debug&&t)0===n?p.rules.unshift(e):p.rules.push(e),t.textContent=p.rules.map(O).join("\n");else if(t&&t.sheet)try{t.sheet.insertRule(e,n),0===n?p.rules.unshift(e):p.rules.push(e)}catch(e){p.debug&&console.log("Ignored error:",e)}else 0===n?p.rules.unshift(e):p.rules.push(e)}function O(e){return e.replace(/{/g," {\n").replace(/([;{])\n*/g,"$1\n ").replace(/(.*):(.*);/g,"$1: $2;").replace(/[\s]*}/g,"\n}\n").replace(/,\s*/g,", ").replace(/@.*{[\s\S]*?}[\s]*}/g,(function(e){return e.split("\n").reduce((function(e,t,n,r){return e+(n<r.length-1?"\n":"")+(n>1&&n<r.length-2?" ":"")+t}),"")})).trim().replace("}\n\n}","}\n}")}function j(e,t){for(var n=[],r={prop:null,propEnd:null,value:null,out:[],lean:!0,comma:0,end:0,quote:!1},o=[],i=!1,u=!1,l=!1,c=!1,s=0;s<e.length;s++)if(s>0&&c&&!d(e[s])&&(t=e.slice(1,s)+"-"+t,c=!1),c||0===s&&"."===e[s])c=!0;else if(E(e,s,e[s],r),"}"===e[s]||s===e.length-1)w(i||u||l||n,s,t,r,o),i&&!o.length&&((u||l||n).push(i.selector+"{"+i.join("")+"}"),i=!1),u&&!o.length&&((l||n).push("@font-face"===u.selector?u.selector+u.join(""):u.selector+"{"+u.join("")+"}"),u=!1),l&&!o.length&&(n.push(l.selector+"{"+l.join("")+"}"),l=!1),o.pop();else if("{"===e[s]){var p=e.slice(r.end,s).trim().replace(/,[\s]*/,",& ");0===p.indexOf("animation")&&r.out.push(["animation",p.slice(10)+" "+t]),w(i||u||l||n,s,t,r,o),r.prop=r.value=r.propEnd=null,0===p.indexOf("@supports")?l=Object.assign([],{selector:p}):"@"===p[0]?u=Object.assign([],{selector:a.reduce((function(e,t){return t(e)}),p.trim())}):0===p.indexOf("animation")?i=Object.assign([],{selector:"@keyframes "+t}):i?o.splice(0,o.length,p):o.push(p)}return n.name=t,n}function w(e,t,n,r,o){var i=r.out.length&&r.out.map((function(e){return e.join(":")})).join(";"),u=o.length&&":"!==o[0][0],l=!e.selector||0!==e.selector.indexOf("@keyframes ");i&&e.push((o.length&&"&"===o[0][0]||!l?"":(u?"":"."+n)+"."+n+(u?" ":""))+(l?o.join(" ").replace(/&/g,"."+n).replace(/ :/g,":"):o.join(" ").replace(/&/g,""))+"{"+i+";}"),r.end=t+1,r.out=[]}function E(e,t,r,o){!o.value&&null!==o.prop&&o.lean&&":"===r&&(o.lean=!1),!o.value&&null!==o.prop&&o.out.length&&","===r?(o.value=o.comma,o.prop=o.out[o.out.length-1][0]):!o.value&&null===o.prop&&f(r)?o.prop=t:!h(o.prop)||o.propEnd||f(r)?h(o.propEnd)&&!h(o.value)&&" "!==r&&"\n"!==r&&":"!==r&&(o.value=t):o.propEnd=t,function(e,t,r,o){o.value&&g(r)&&(o.quote=!o.quote);!o.quote&&null!==o.prop&&(t===e.length-1||";"===e[t+1]||"}"===e[t+1]||o.lean&&","!==e[t-1]&&"\n"===r)&&(o.out.push(function(e,t,r){if(!r.lean)return[e,t];e=l.reduce((function(e,t){return t(e)}),e.trim());for(var o="",i=0,u="px",a=0;a<t.length;a++){if(m(t[a])||a===t.length-1){var c=t.slice(i,a+1).trim();o+=(u&&n(e)?c.replace(/(^|[( ,])([-0-9.]+)([ ,)]|$)/g,"$1$2"+u+"$3").trim():c)+(","===t[a]?"":" "),i=a+1}"("!==t[a]&&")"!==t[a-1]||(u=0===t.slice(i,a).indexOf("translate")?"px":0===t.slice(i,a).indexOf("rotate")?"deg":"")}return[e,o.trim().replace(/[\n ]+/g," ")]}(e.slice(o.prop,o.propEnd),e.slice(o.value,t+1).trim(),o)),o.end=t+(";"===e[t+1]?2:1),o.comma=o.value,o.value=o.prop=o.propEnd=null,o.lean=!0)}(e,t,r,o)}}u.forEach((function(e){var t=e.match(/-(ms|o|webkit|moz)-/g);if(t){var n=e.replace(/-(ms|o|webkit|moz)-/,"");if(-1===u.indexOf(n))return"flexDirection"===n&&(v.flex="-"+t[1].toLowerCase()+"-flex"),void(b[n]=e)}}));var y=x();return y.create=x,y}));
//# sourceMappingURL=bss.min.js.map

@@ -60,4 +60,4 @@ import px from './px.js'

const style = b.apply(b, arguments)
parse(style.content.trim(), '__raw').forEach(x =>
insert(x.replace(/\.__raw/g, '').trim())
parse(style.content.replace(/@import[^;]*;/g, insert).trim(), '__global').forEach(x =>
insert(x.replace(/\.__global/g, '').trim())
)

@@ -291,6 +291,6 @@ }

propParse(
s.slice(x.prop, x.propEnd), s.slice(x.value, i + 1), x
s.slice(x.prop, x.propEnd), s.slice(x.value, i + 1).trim(), x
)
)
x.end = i + (x.lean ? 1 : 2)
x.end = i + (s[i + 1] === ';' ? 2 : 1)
x.comma = x.value

@@ -297,0 +297,0 @@ x.value = x.prop = x.propEnd = null

{
"name": "bss",
"version": "3.0.0-rc.9",
"version": "3.0.0-rc.10",
"description": "Better Style Sheets",

@@ -5,0 +5,0 @@ "main": "dist/bss.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc