vizor_styler 1.0.7 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/vizor_styler.min.js +1 -1
- package/package.json +1 -1
package/dist/vizor_styler.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e={d:(t,n)=>{for(var
|
|
1
|
+
var e={d:(t,n)=>{for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},t={};function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,l,i,a=[],c=!0,u=!1;try{if(l=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(o=l.call(n)).done)&&(a.push(o.value),a.length!==t);c=!0);}catch(e){u=!0,r=e}finally{try{if(!c&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return r(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function l(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,i(o.key),o)}}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var r=o.call(e,t||"default");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}e.d(t,{Y:()=>a});var a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),console.log("instance created")}return t=e,r=[{key:"my_static_method",value:function(){return"return of static method"}},{key:"setStyle",value:function(e,t){var n=document.getElementById("".concat(e,"-style"));n||((n=document.createElement("style")).id="".concat(e,"-style"),document.head.appendChild(n));var r="\n ".concat(e," {\n ").concat(Object.entries(t).map((function(e){var t=o(e,2),n=t[0],r=t[1];return"".concat(n,": ").concat(r,";")})).join(" "),"\n }\n ");n.innerHTML=r}},{key:"updateStyle",value:function(e,t){var n,r=document.getElementById("".concat(e,"-style"));if(!r)return console.warn("Style for ".concat(e," not found. Creating new one.")),void createOrModifyStyles(e,t);var l=null===(n=r.innerHTML.match(new RegExp("".concat(e," {([^}]*)}"))))||void 0===n?void 0:n[1].split(";").filter(Boolean).map((function(e){return e.trim().split(":").map((function(e){return e.trim()}))})),i=Object.fromEntries(l);Object.assign(i,t);var a="\n ".concat(e," {\n ").concat(Object.entries(i).map((function(e){var t=o(e,2),n=t[0],r=t[1];return"".concat(n,": ").concat(r,";")})).join(" "),"\n }\n ");r.innerHTML=a}},{key:"addLabelToBody",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"black",o=document.createElement(2===t?"h2":"h1");o.textContent=e,o.style.color=n,document.body.appendChild(o)}},{key:"replaceImageInDiv",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200;console.log("reemplazado");var o=document.getElementById("header");o&&(o.innerHTML='<img src="'.concat(t,'" alt="New Logo" width="').concat(n,'px">'))}},{key:"setLogo",value:function(t,n){e.replaceImageInDiv("header",t,n)}},{key:"setBackgroundColor",value:function(e){document.body.style.backgroundColor=e}},{key:"setTitle",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"white",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;e.addLabelToBody(t,o,n)}},{key:"setSelectorColor",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"rgba(255, 255, 255, 0.2)";e.setStyle(".selection-wrapper path",{fill:t})}},{key:"goFullScreen",value:function(){var e=document.documentElement;e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.msRequestFullscreen?e.msRequestFullscreen():console.log("Fullscreen API is not supported in this browser.")}},{key:"SetWindowColorTheme",value:function(e){e||(document.querySelectorAll(".ui-resizable-handle.ui-resizable-se.ui-icon.ui-icon-gripsmall-diagonal-se").forEach((function(e){for(var t=[],n=e.parentElement;n;)"div"===n.tagName.toLowerCase()&&t.push(n),n=n.parentElement;t.forEach((function(e){e.style.border="rgba(61, 87, 113, 0.8)",e.style.borderStyle="solid",e.style.borderWidth="1px",e.style.boxShadow="rgba(0, 0, 0, 0.5) 4px 4px 27px"}))})),document.querySelectorAll(".top-bar").forEach((function(e){e.style.backgroundColor="#3F4A67",e.style.fontSize="12px",e.style.margin="0px",e.style.padding="9px",e.style.color="#73BDDA",e.style.border="#547697",e.style.borderStyle="solid",e.style.borderWidth="1px"})))}},{key:"createHeader",value:function(e){var t,n=document.createElement("p");t=host.includes("monitor.ert.mx")?"https://qh4wzmakbgwqvzku.public.blob.vercel-storage.com/b2cff9fb-a38e-4a11-a540-32d833b7f117/icon%20ERT-bXJP7FInYZHqvu5mKKvegGZ6tXal69.png":"https://dev.vizor.studio/_next/image?url=%2Fmini_logo_transparent.png&w=128&q=75",n.innerHTML='\n <div style="\n position: fixed;\n top: 5px;\n left: 20px;\n right: 20px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 9px 0px;\n background-color: #686b9b;\n color: white;\n border-radius: 8px;\n box-sizing: border-box;\n ">\n <div style="display: flex; align-items: center; gap: 12px;">\n <img src="'.concat(t,'"\n alt="menu"\n style="width: 54px;">\n <div>\n <div style="font-size: 0.9rem; font-weight: 600;">\n ').concat(e,"\n </div>\n </div>\n </div>\n </div>\n"),document.body.appendChild(n)}}],(n=[{key:"doSomething",value:function(){console.log("done")}}])&&l(t.prototype,n),r&&l(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,r}(),c=t.Y;export{c as vi_Styler};
|