solely 0.5.6 → 0.5.7
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t={FAST:200,NORMAL:300,SLOW:500};let e=0,o=null;const n=new Set;exports.ANIMATION_DURATION=t,exports.Z_INDEX={TOOLTIP:1070,POPOVER:1060,MODAL:1050,TOAST:1100},exports.addClosingAnimation=function(e,o=t.NORMAL){return new Promise(t=>{e.classList.add("is-closing"),setTimeout(()=>t(),o)})},exports.calculatePosition=function(t,e,o="top",n=8){const r=t.getBoundingClientRect(),a=(null==e?void 0:e.offsetWidth)??250,s=(null==e?void 0:e.offsetHeight)??100,i=window.pageYOffset||document.documentElement.scrollTop,c=window.pageXOffset||document.documentElement.scrollLeft;let l,m,
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t={FAST:200,NORMAL:300,SLOW:500};let e=0,o=null;const n=new Set;exports.ANIMATION_DURATION=t,exports.Z_INDEX={TOOLTIP:1070,POPOVER:1060,MODAL:1050,TOAST:1100},exports.addClosingAnimation=function(e,o=t.NORMAL){return new Promise(t=>{e.classList.add("is-closing"),setTimeout(()=>t(),o)})},exports.calculatePosition=function(t,e,o="top",n=8){const r=t.getBoundingClientRect(),a=(null==e?void 0:e.offsetWidth)??250,s=(null==e?void 0:e.offsetHeight)??100,i=window.pageYOffset||document.documentElement.scrollTop,c=window.pageXOffset||document.documentElement.scrollLeft;let l,m,d=0,u=0;switch(o){case"top":d=r.top+i-s-n,u=r.left+c+(r.width-a)/2,l=a/2-4;break;case"topLeft":d=r.top+i-s-n,u=r.left+c,l=16;break;case"topRight":d=r.top+i-s-n,u=r.right+c-a,l=a-24;break;case"bottom":d=r.bottom+i+n,u=r.left+c+(r.width-a)/2,l=a/2-4;break;case"bottomLeft":d=r.bottom+i+n,u=r.left+c,l=16;break;case"bottomRight":d=r.bottom+i+n,u=r.right+c-a,l=a-24;break;case"left":d=r.top+i+(r.height-s)/2,u=r.left+c-a-n,m=s/2-4;break;case"leftTop":d=r.top+i,u=r.left+c-a-n,m=16;break;case"leftBottom":d=r.bottom+i-s,u=r.left+c-a-n,m=s-24;break;case"right":d=r.top+i+(r.height-s)/2,u=r.right+c+n,m=s/2-4;break;case"rightTop":d=r.top+i,u=r.right+c+n,m=16;break;case"rightBottom":d=r.bottom+i-s,u=r.right+c+n,m=s-24}const h=d,f=u;return d=Math.max(8,Math.min(d,window.innerHeight+i-s-8)),u=Math.max(8,Math.min(u,window.innerWidth+c-a-8)),void 0!==l&&u!==f&&(l+=f-u,l=Math.max(8,Math.min(l,a-8))),void 0!==m&&d!==h&&(m+=h-d,m=Math.max(8,Math.min(m,s-8))),{top:d,left:u,arrowLeft:l,arrowTop:m}},exports.createElement=function(t,e){const o=document.createElement(t);return(null==e?void 0:e.className)&&(o.className=e.className),void 0!==(null==e?void 0:e.textContent)&&(o.textContent=e.textContent),(null==e?void 0:e.styles)&&Object.assign(o.style,e.styles),(null==e?void 0:e.attrs)&&Object.entries(e.attrs).forEach(([t,e])=>{o.setAttribute(t,e)}),o},exports.generateId=function(){return e=(e+1)%Number.MAX_SAFE_INTEGER,e},exports.injectStyle=function(t,e){if(document.getElementById(t))return;const o=document.createElement("style");o.id=t,o.textContent=e,document.head.appendChild(o)},exports.observeTheme=function(t){const e=()=>{const e=t();if(!e)return;const o=Array.isArray(e)?e:[e],n=document.documentElement.getAttribute("data-theme");o.forEach(t=>{n?t.setAttribute("data-theme",n):t.removeAttribute("data-theme")})};return e(),n.add(e),o||(o=new MutationObserver(()=>{n.forEach(t=>t())}),o.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]})),()=>{n.delete(e),0===n.size&&o&&(o.disconnect(),o=null)}},exports.removeStyle=function(t){const e=document.getElementById(t);e&&e.remove()},exports.safeAsyncCallback=async function(t,e){try{return await t()}catch(o){return console.error("[Solely Commands] Async callback error:",o),void(null==e||e())}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const t={FAST:200,NORMAL:300,SLOW:500},e={TOOLTIP:1070,POPOVER:1060,MODAL:1050,TOAST:1100};let o=0;function n(){return o=(o+1)%Number.MAX_SAFE_INTEGER,o}function r(t,e){if(document.getElementById(t))return;const o=document.createElement("style");o.id=t,o.textContent=e,document.head.appendChild(o)}function a(t){const e=document.getElementById(t);e&&e.remove()}function i(t,e){const o=document.createElement(t);return(null==e?void 0:e.className)&&(o.className=e.className),void 0!==(null==e?void 0:e.textContent)&&(o.textContent=e.textContent),(null==e?void 0:e.styles)&&Object.assign(o.style,e.styles),(null==e?void 0:e.attrs)&&Object.entries(e.attrs).forEach(([t,e])=>{o.setAttribute(t,e)}),o}function c(t,e,o="top",n=8){const r=t.getBoundingClientRect(),a=(null==e?void 0:e.offsetWidth)??250,i=(null==e?void 0:e.offsetHeight)??100,c=window.pageYOffset||document.documentElement.scrollTop,s=window.pageXOffset||document.documentElement.scrollLeft;let l,m,
|
|
1
|
+
const t={FAST:200,NORMAL:300,SLOW:500},e={TOOLTIP:1070,POPOVER:1060,MODAL:1050,TOAST:1100};let o=0;function n(){return o=(o+1)%Number.MAX_SAFE_INTEGER,o}function r(t,e){if(document.getElementById(t))return;const o=document.createElement("style");o.id=t,o.textContent=e,document.head.appendChild(o)}function a(t){const e=document.getElementById(t);e&&e.remove()}function i(t,e){const o=document.createElement(t);return(null==e?void 0:e.className)&&(o.className=e.className),void 0!==(null==e?void 0:e.textContent)&&(o.textContent=e.textContent),(null==e?void 0:e.styles)&&Object.assign(o.style,e.styles),(null==e?void 0:e.attrs)&&Object.entries(e.attrs).forEach(([t,e])=>{o.setAttribute(t,e)}),o}function c(t,e,o="top",n=8){const r=t.getBoundingClientRect(),a=(null==e?void 0:e.offsetWidth)??250,i=(null==e?void 0:e.offsetHeight)??100,c=window.pageYOffset||document.documentElement.scrollTop,s=window.pageXOffset||document.documentElement.scrollLeft;let l,m,d=0,u=0;switch(o){case"top":d=r.top+c-i-n,u=r.left+s+(r.width-a)/2,l=a/2-4;break;case"topLeft":d=r.top+c-i-n,u=r.left+s,l=16;break;case"topRight":d=r.top+c-i-n,u=r.right+s-a,l=a-24;break;case"bottom":d=r.bottom+c+n,u=r.left+s+(r.width-a)/2,l=a/2-4;break;case"bottomLeft":d=r.bottom+c+n,u=r.left+s,l=16;break;case"bottomRight":d=r.bottom+c+n,u=r.right+s-a,l=a-24;break;case"left":d=r.top+c+(r.height-i)/2,u=r.left+s-a-n,m=i/2-4;break;case"leftTop":d=r.top+c,u=r.left+s-a-n,m=16;break;case"leftBottom":d=r.bottom+c-i,u=r.left+s-a-n,m=i-24;break;case"right":d=r.top+c+(r.height-i)/2,u=r.right+s+n,m=i/2-4;break;case"rightTop":d=r.top+c,u=r.right+s+n,m=16;break;case"rightBottom":d=r.bottom+c-i,u=r.right+s+n,m=i-24}const h=d,f=u;return d=Math.max(8,Math.min(d,window.innerHeight+c-i-8)),u=Math.max(8,Math.min(u,window.innerWidth+s-a-8)),void 0!==l&&u!==f&&(l+=f-u,l=Math.max(8,Math.min(l,a-8))),void 0!==m&&d!==h&&(m+=h-d,m=Math.max(8,Math.min(m,i-8))),{top:d,left:u,arrowLeft:l,arrowTop:m}}async function s(t,e){try{return await t()}catch(o){return console.error("[Solely Commands] Async callback error:",o),void(null==e||e())}}function l(e,o=t.NORMAL){return new Promise(t=>{e.classList.add("is-closing"),setTimeout(()=>t(),o)})}let m=null;const d=new Set;function u(t){const e=()=>{const e=t();if(!e)return;const o=Array.isArray(e)?e:[e],n=document.documentElement.getAttribute("data-theme");o.forEach(t=>{n?t.setAttribute("data-theme",n):t.removeAttribute("data-theme")})};return e(),d.add(e),m||(m=new MutationObserver(()=>{d.forEach(t=>t())}),m.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]})),()=>{d.delete(e),0===d.size&&m&&(m.disconnect(),m=null)}}export{t as ANIMATION_DURATION,e as Z_INDEX,l as addClosingAnimation,c as calculatePosition,i as createElement,n as generateId,r as injectStyle,u as observeTheme,a as removeStyle,s as safeAsyncCallback};
|
package/dist/shared/env.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=(()=>{var o,e;if("undefined"!=typeof window){if(null==(o=window.location)?void 0:o.search.includes("debug"))return!0;const e=globalThis;if(!0===e.__DEBUG__||!0===e.__IS_DEV__)return!0}return!("undefined"==typeof window||!["localhost","127.0.0.1","0.0.0.0"].includes((null==(e=window.location)?void 0:e.hostname)||""))})(),e=!o;exports.IS_DEV=o,exports.IS_PROD=e,exports.SOLELY_VERSION="0.5.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=(()=>{var o,e;if("undefined"!=typeof window){if(null==(o=window.location)?void 0:o.search.includes("debug"))return!0;const e=globalThis;if(!0===e.__DEBUG__||!0===e.__IS_DEV__)return!0}return!("undefined"==typeof window||!["localhost","127.0.0.1","0.0.0.0"].includes((null==(e=window.location)?void 0:e.hostname)||""))})(),e=!o;exports.IS_DEV=o,exports.IS_PROD=e,exports.SOLELY_VERSION="0.5.7";
|
package/dist/shared/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const n=(()=>{var n,o;if("undefined"!=typeof window){if(null==(n=window.location)?void 0:n.search.includes("debug"))return!0;const o=globalThis;if(!0===o.__DEBUG__||!0===o.__IS_DEV__)return!0}return!("undefined"==typeof window||!["localhost","127.0.0.1","0.0.0.0"].includes((null==(o=window.location)?void 0:o.hostname)||""))})(),o=!n,i="0.5.
|
|
1
|
+
const n=(()=>{var n,o;if("undefined"!=typeof window){if(null==(n=window.location)?void 0:n.search.includes("debug"))return!0;const o=globalThis;if(!0===o.__DEBUG__||!0===o.__IS_DEV__)return!0}return!("undefined"==typeof window||!["localhost","127.0.0.1","0.0.0.0"].includes((null==(o=window.location)?void 0:o.hostname)||""))})(),o=!n,i="0.5.7";export{n as IS_DEV,o as IS_PROD,i as SOLELY_VERSION};
|
package/package.json
CHANGED