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.6 to 3.0.0-rc.7

19

dist/bss.esm.js

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

index === 0 ? b.rules.unshift(rule) : b.rules.push(rule);
if (b.debug && style) {
index === 0 ? b.rules.unshift(rule) : b.rules.push(rule);
style.textContent = b.rules.map(pretty).join('\n');

@@ -227,5 +226,8 @@ } else if (style && style.sheet) {

style.sheet.insertRule(rule, index);
index === 0 ? b.rules.unshift(rule) : b.rules.push(rule);
} catch (e) {
b.debug && console.log('Ignored error:', e); // eslint-disable-line
}
} else {
index === 0 ? b.rules.unshift(rule) : b.rules.push(rule);
}

@@ -298,3 +300,5 @@ }

? ani = Object.assign([], { selector: '@keyframes ' + x })
: level.push(selector);
: ani
? level.splice(0, level.length, selector)
: level.push(selector);
}

@@ -311,8 +315,13 @@ }

var base = level.length && level[0][0] !== ':';
var ani = !xs.selector || xs.selector.indexOf('@keyframes ') !== 0;
content && xs.push(
((!level.length || level[0][0] !== '&') && (!xs.selector || xs.selector.indexOf('@keyframes ')) !== 0
((!level.length || level[0][0] !== '&') && ani
? (base ? '' : '.' + name) + '.' + name + (base ? ' ' : '')
: ''
)
+ level.join(' ').replace(/&/g, '.' + name).replace(/ :/g, ':')
+ (
ani
? level.join(' ').replace(/&/g, '.' + name).replace(/ :/g, ':')
: level.join(' ').replace(/&/g, '')
)
+ '{' + content + ';}'

@@ -319,0 +328,0 @@ );

@@ -225,5 +225,4 @@ (function (global, factory) {

index === 0 ? b.rules.unshift(rule) : b.rules.push(rule);
if (b.debug && style) {
index === 0 ? b.rules.unshift(rule) : b.rules.push(rule);
style.textContent = b.rules.map(pretty).join('\n');

@@ -233,5 +232,8 @@ } else if (style && style.sheet) {

style.sheet.insertRule(rule, index);
index === 0 ? b.rules.unshift(rule) : b.rules.push(rule);
} catch (e) {
b.debug && console.log('Ignored error:', e); // eslint-disable-line
}
} else {
index === 0 ? b.rules.unshift(rule) : b.rules.push(rule);
}

@@ -304,3 +306,5 @@ }

? ani = Object.assign([], { selector: '@keyframes ' + x })
: level.push(selector);
: ani
? level.splice(0, level.length, selector)
: level.push(selector);
}

@@ -317,8 +321,13 @@ }

var base = level.length && level[0][0] !== ':';
var ani = !xs.selector || xs.selector.indexOf('@keyframes ') !== 0;
content && xs.push(
((!level.length || level[0][0] !== '&') && (!xs.selector || xs.selector.indexOf('@keyframes ')) !== 0
((!level.length || level[0][0] !== '&') && ani
? (base ? '' : '.' + name) + '.' + name + (base ? ' ' : '')
: ''
)
+ level.join(' ').replace(/&/g, '.' + name).replace(/ :/g, ':')
+ (
ani
? level.join(' ').replace(/&/g, '.' + name).replace(/ :/g, ':')
: level.join(' ').replace(/&/g, '')
)
+ '{' + content + ';}'

@@ -325,0 +334,0 @@ );

@@ -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("abcdefghijklmnopqrstuvwxyz-"),d=f("abcdefghijklmnopqrstuvwxyz0123456789-_",!0),g=f("'\""),m=f(" :"),h=f(" ,)"),v=Object.create(null,{}),b=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=[],f=x();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=x,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);w(y(e.content).trim(),"__raw").forEach((function(e){return O(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&&console.log(e,"not found")}return e})),f.prop(c),t&&(t.id=f.prefix),f;function b(){if(this.className)return this.className;this.className=f.prefix+ ++f.count;var e=w(y(this.content).trim(),this.className);return e.forEach(O),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===b?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=b,a.content=o,i[o]=a,a}}function y(e){return e.replace(/\/\/.*?(\n|$)/g,"\n").replace(/\/\*[\s\S]*?\*\//g,"")}function O(e){o&&(t&&s.head&&s.head.appendChild(t),o=!1);var n=0===e.indexOf("@import")?0:f.rules.length;if(0===n?f.rules.unshift(e):f.rules.push(e),f.debug&&t)t.textContent=f.rules.map(j).join("\n");else if(t&&t.sheet)try{t.sheet.insertRule(e,n)}catch(e){f.debug&&console.log("Ignored error:",e)}}function j(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 w(e,t){for(var n=[],r={prop: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,s,e[s],r),"}"===e[s]||s===e.length-1)k(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]),k(i||u||l||n,s,t,r,o),r.prop=r.value=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}):o.push(f)}return n.name=t,n}function k(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];i&&e.push((o.length&&"&"===o[0][0]||0===(!e.selector||e.selector.indexOf("@keyframes "))?"":(u?"":"."+n)+"."+n+(u?" ":""))+o.join(" ").replace(/&/g,"."+n).replace(/ :/g,":")+"{"+i+";}"),r.end=t+1,r.out=[]}function $(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:function(e){return"number"==typeof e}(o.prop)&&(t===e.length-1||!o.value&&(m(r)||o.lean&&"\n"===r))&&(o.value=t+1),function(e,t,r,o){o.value&&g(r)&&(o.quote=!o.quote);!o.quote&&null!==o.prop&&(t===e.length-1||";"===r||"}"===e[t+1]||o.lean&&","!==e[t-1]&&"\n"===r)&&(o.out.push(function(e){var t=e[0],r=e[1];t=l.reduce((function(e,t){return t(e)}),t.trim());for(var o="",i=0,u="px",a=0;a<r.length;a++){if(h(r[a])||a===r.length-1){var c=r.slice(i,a+1).trim();o+=(u&&n(t)?c.replace(/(^|[( ,])([-0-9.]+)([ ,)]|$)/g,"$1$2"+u+"$3").trim():c)+(","===r[a]?"":" "),i=a+1}"("!==r[a]&&")"!==r[a-1]||(u=0===r.slice(i,a).indexOf("translate")?"px":0===r.slice(i,a).indexOf("rotate")?"deg":"")}return[t,o.trim().replace(/[\n ]+/g," ")]}(e.slice(o.prop,t+1).match(/\s*([a-z-]+)[\s:]*([^;]+)/i).slice(1))),o.end=t+1,o.comma=o.value,o.value=o.prop=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&&(b.flex="-"+t[1].toLowerCase()+"-flex"),void(v[n]=e)}}));var y=x();return y.create=x,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,f=function(e,t){return t?function(t){return e.indexOf(t.toLowerCase())>-1}:function(t){return e.indexOf(t)>-1}},p=f("abcdefghijklmnopqrstuvwxyz-"),d=f("abcdefghijklmnopqrstuvwxyz0123456789-_",!0),g=f("'\""),h=f(" :"),m=f(" ,)"),v=Object.create(null,{}),b=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=[],f=x();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=x,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);w(y(e.content).trim(),"__raw").forEach((function(e){return O(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&&console.log(e,"not found")}return e})),f.prop(c),t&&(t.id=f.prefix),f;function b(){if(this.className)return this.className;this.className=f.prefix+ ++f.count;var e=w(y(this.content).trim(),this.className);return e.forEach(O),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===b?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=b,a.content=o,i[o]=a,a}}function y(e){return e.replace(/\/\/.*?(\n|$)/g,"\n").replace(/\/\*[\s\S]*?\*\//g,"")}function O(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(j).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 j(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 w(e,t){for(var n=[],r={prop: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,s,e[s],r),"}"===e[s]||s===e.length-1)k(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]),k(i||u||l||n,s,t,r,o),r.prop=r.value=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 k(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,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:function(e){return"number"==typeof e}(o.prop)&&(t===e.length-1||!o.value&&(h(r)||o.lean&&"\n"===r))&&(o.value=t+1),function(e,t,r,o){o.value&&g(r)&&(o.quote=!o.quote);!o.quote&&null!==o.prop&&(t===e.length-1||";"===r||"}"===e[t+1]||o.lean&&","!==e[t-1]&&"\n"===r)&&(o.out.push(function(e){var t=e[0],r=e[1];t=l.reduce((function(e,t){return t(e)}),t.trim());for(var o="",i=0,u="px",a=0;a<r.length;a++){if(m(r[a])||a===r.length-1){var c=r.slice(i,a+1).trim();o+=(u&&n(t)?c.replace(/(^|[( ,])([-0-9.]+)([ ,)]|$)/g,"$1$2"+u+"$3").trim():c)+(","===r[a]?"":" "),i=a+1}"("!==r[a]&&")"!==r[a-1]||(u=0===r.slice(i,a).indexOf("translate")?"px":0===r.slice(i,a).indexOf("rotate")?"deg":"")}return[t,o.trim().replace(/[\n ]+/g," ")]}(e.slice(o.prop,t+1).match(/\s*([a-z-]+)[\s:]*([^;]+)/i).slice(1))),o.end=t+1,o.comma=o.value,o.value=o.prop=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&&(b.flex="-"+t[1].toLowerCase()+"-flex"),void(v[n]=e)}}));var y=x();return y.create=x,y}));
//# sourceMappingURL=bss.min.js.map

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

index === 0 ? b.rules.unshift(rule) : b.rules.push(rule)
if (b.debug && style) {
index === 0 ? b.rules.unshift(rule) : b.rules.push(rule)
style.textContent = b.rules.map(pretty).join('\n')

@@ -138,5 +137,8 @@ } else if (style && style.sheet) {

style.sheet.insertRule(rule, index)
index === 0 ? b.rules.unshift(rule) : b.rules.push(rule)
} catch (e) {
b.debug && console.log('Ignored error:', e) // eslint-disable-line
}
} else {
index === 0 ? b.rules.unshift(rule) : b.rules.push(rule)
}

@@ -211,3 +213,5 @@ }

? ani = Object.assign([], { selector: '@keyframes ' + x })
: level.push(selector)
: ani
? level.splice(0, level.length, selector)
: level.push(selector)
}

@@ -224,8 +228,13 @@ }

const base = level.length && level[0][0] !== ':'
const ani = !xs.selector || xs.selector.indexOf('@keyframes ') !== 0
content && xs.push(
((!level.length || level[0][0] !== '&') && (!xs.selector || xs.selector.indexOf('@keyframes ')) !== 0
((!level.length || level[0][0] !== '&') && ani
? (base ? '' : '.' + name) + '.' + name + (base ? ' ' : '')
: ''
)
+ level.join(' ').replace(/&/g, '.' + name).replace(/ :/g, ':')
+ (
ani
? level.join(' ').replace(/&/g, '.' + name).replace(/ :/g, ':')
: level.join(' ').replace(/&/g, '')
)
+ '{' + content + ';}'

@@ -232,0 +241,0 @@ )

{
"name": "bss",
"version": "3.0.0-rc.6",
"version": "3.0.0-rc.7",
"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