home-assistant-styles-manager
Advanced tools
Comparing version 1.1.1 to 2.0.0
@@ -1,1 +0,1 @@ | ||
var e=/([A-Z])([a-z0-9_-]+)/g,n=function(){return n=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},n.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;var t=function(n){return Object.entries(n).map((function(n){var t=n[0],r=n[1];return"".concat(function(n){return n.replace(e,(function(e,n,t,r){var o=n.toLocaleLowerCase();return r?"-".concat(o).concat(t):"--".concat(o).concat(t)}))}(t),":").concat(r)})).join(";")+";"},r=function(e){var r=Array.isArray(e)?e.reduce((function(e,t){return n(n({},e),t)}),{}):e;return Object.entries(r).map((function(e){var n=e[0],r=e[1];return!1===r?"".concat(n,"{display: none !important}"):"".concat(n,"{").concat(t(r),"}")})).join("")},o=function(e,n){return"".concat(n,"_").concat(e)},a=function(e){return e instanceof ShadowRoot?e.host.localName:e.localName},c=function(e,n){var t=o(a(e),n);return e.querySelector("#".concat(t))},i=function(){function e(e){var n,t;void 0===e&&(e={}),this._prefix=null!==(n=e.prefix)&&void 0!==n?n:"ha-styles-manager",this._namespace=null!==(t=e.namespace)&&void 0!==t?t:"home-assistant-styles-manager"}return e.prototype.getStyleElement=function(e){return c(e,this._prefix)},e.prototype.addStyle=function(e,n){!function(e,n,t,i){if(n){var s=c(n,t);if(!s){var u=o(a(n),t);(s=document.createElement("style")).setAttribute("id",u),n.appendChild(s)}s.innerHTML="string"==typeof e?e:r(e)}else console.warn("".concat(i,': not element has been provided in "addStyle"'))}(e,n,this._prefix,this._namespace)},e.prototype.removeStyle=function(e){!function(e,n,t){if(e){var r=c(e,n);r?r.remove():console.warn("".concat(t,': not style to remove in "removeStyle"'))}else console.warn("".concat(t,': not element has been provided in "removeStyle"'))}(e,this._prefix,this._namespace)},e}();export{i as HomeAssistantStylesManager,r as getCSSRulesString,t as getCSSString}; | ||
var e=/([A-Z])([a-z0-9_-]+)/g,n=function(){return n=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},n.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;var t=function(n){return Object.entries(n).map((function(n){var t=n[0],r=n[1];return"".concat(function(n){return n.replace(e,(function(e,n,t,r){var o=n.toLocaleLowerCase();return r?"-".concat(o).concat(t):"--".concat(o).concat(t)}))}(t),":").concat(r)})).join(";")+";"},r=function(e){var r=Array.isArray(e)?e.reduce((function(e,t){return n(n({},e),t)}),{}):e;return Object.entries(r).map((function(e){var n=e[0],r=e[1];return!1===r?"".concat(n,"{display: none !important}"):"".concat(n,"{").concat(t(r),"}")})).join("")},o=function(e,n){return"".concat(n,"_").concat(e)},a=function(e){return e instanceof ShadowRoot?e.host.localName:e.localName},c=function(e,n){var t=o(a(e),n);return e.querySelector("#".concat(t))},i=function(){function e(e){var n,t;void 0===e&&(e={}),this._prefix=null!==(n=e.prefix)&&void 0!==n?n:"ha-styles-manager",this._namespace=null!==(t=e.namespace)&&void 0!==t?t:"home-assistant-styles-manager"}return e.prototype.getStyleElement=function(e){return c(e,this._prefix)},e.prototype.addStyle=function(e,n){!function(e,n,t,i){if(n){var s=c(n,t);if(!s){var u=o(a(n),t);(s=document.createElement("style")).setAttribute("id",u),n.appendChild(s)}s.innerHTML="string"==typeof e?e:r(e)}else console.warn("".concat(i,': no element has been provided in "addStyle"'))}(e,n,this._prefix,this._namespace)},e.prototype.removeStyle=function(e){!function(e,n,t){if(e){var r=c(e,n);r&&r.remove()}else console.warn("".concat(t,': no element has been provided in "removeStyle"'))}(e,this._prefix,this._namespace)},e}();export{i as HomeAssistantStylesManager,r as getCSSRulesString,t as getCSSString}; |
@@ -1,1 +0,1 @@ | ||
"use strict";var e=/([A-Z])([a-z0-9_-]+)/g,t=function(){return t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},t.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;var n=function(t){return Object.entries(t).map((function(t){var n=t[0],r=t[1];return"".concat(function(t){return t.replace(e,(function(e,t,n,r){var o=t.toLocaleLowerCase();return r?"-".concat(o).concat(n):"--".concat(o).concat(n)}))}(n),":").concat(r)})).join(";")+";"},r=function(e){var r=Array.isArray(e)?e.reduce((function(e,n){return t(t({},e),n)}),{}):e;return Object.entries(r).map((function(e){var t=e[0],r=e[1];return!1===r?"".concat(t,"{display: none !important}"):"".concat(t,"{").concat(n(r),"}")})).join("")},o=function(e,t){return"".concat(t,"_").concat(e)},a=function(e){return e instanceof ShadowRoot?e.host.localName:e.localName},c=function(e,t){var n=o(a(e),t);return e.querySelector("#".concat(n))},i=function(){function e(e){var t,n;void 0===e&&(e={}),this._prefix=null!==(t=e.prefix)&&void 0!==t?t:"ha-styles-manager",this._namespace=null!==(n=e.namespace)&&void 0!==n?n:"home-assistant-styles-manager"}return e.prototype.getStyleElement=function(e){return c(e,this._prefix)},e.prototype.addStyle=function(e,t){!function(e,t,n,i){if(t){var s=c(t,n);if(!s){var u=o(a(t),n);(s=document.createElement("style")).setAttribute("id",u),t.appendChild(s)}s.innerHTML="string"==typeof e?e:r(e)}else console.warn("".concat(i,': not element has been provided in "addStyle"'))}(e,t,this._prefix,this._namespace)},e.prototype.removeStyle=function(e){!function(e,t,n){if(e){var r=c(e,t);r?r.remove():console.warn("".concat(n,': not style to remove in "removeStyle"'))}else console.warn("".concat(n,': not element has been provided in "removeStyle"'))}(e,this._prefix,this._namespace)},e}();exports.HomeAssistantStylesManager=i,exports.getCSSRulesString=r,exports.getCSSString=n; | ||
"use strict";var e=/([A-Z])([a-z0-9_-]+)/g,t=function(){return t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},t.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;var n=function(t){return Object.entries(t).map((function(t){var n=t[0],r=t[1];return"".concat(function(t){return t.replace(e,(function(e,t,n,r){var o=t.toLocaleLowerCase();return r?"-".concat(o).concat(n):"--".concat(o).concat(n)}))}(n),":").concat(r)})).join(";")+";"},r=function(e){var r=Array.isArray(e)?e.reduce((function(e,n){return t(t({},e),n)}),{}):e;return Object.entries(r).map((function(e){var t=e[0],r=e[1];return!1===r?"".concat(t,"{display: none !important}"):"".concat(t,"{").concat(n(r),"}")})).join("")},o=function(e,t){return"".concat(t,"_").concat(e)},a=function(e){return e instanceof ShadowRoot?e.host.localName:e.localName},c=function(e,t){var n=o(a(e),t);return e.querySelector("#".concat(n))},i=function(){function e(e){var t,n;void 0===e&&(e={}),this._prefix=null!==(t=e.prefix)&&void 0!==t?t:"ha-styles-manager",this._namespace=null!==(n=e.namespace)&&void 0!==n?n:"home-assistant-styles-manager"}return e.prototype.getStyleElement=function(e){return c(e,this._prefix)},e.prototype.addStyle=function(e,t){!function(e,t,n,i){if(t){var s=c(t,n);if(!s){var u=o(a(t),n);(s=document.createElement("style")).setAttribute("id",u),t.appendChild(s)}s.innerHTML="string"==typeof e?e:r(e)}else console.warn("".concat(i,': no element has been provided in "addStyle"'))}(e,t,this._prefix,this._namespace)},e.prototype.removeStyle=function(e){!function(e,t,n){if(e){var r=c(e,t);r&&r.remove()}else console.warn("".concat(n,': no element has been provided in "removeStyle"'))}(e,this._prefix,this._namespace)},e}();exports.HomeAssistantStylesManager=i,exports.getCSSRulesString=r,exports.getCSSString=n; |
{ | ||
"name": "home-assistant-styles-manager", | ||
"version": "1.1.1", | ||
"version": "2.0.0", | ||
"description": "Manage Home Assistant styles per DOM elements", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
10136