@erain20029/tooltips 2.0.126 → 2.0.127

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,4 +1,4 @@
1
- (function(p){typeof define=="function"&&define.amd?define(p):p()})((function(){"use strict";const p=".tooltip-overlay{position:fixed;z-index:9999;pointer-events:none;background:#53616e;border-radius:8px;box-shadow:0 4px 20px #00000040;color:#dadadb;min-width:45px;max-width:300px;overflow:visible}.tooltip-overlay.with-image{max-width:384px}.tooltip-card{display:flex;align-items:center;gap:16px;padding:10px;box-sizing:border-box}.tooltip-image{width:80px;height:80px;border-radius:8px;object-fit:cover}.tooltip-text{flex:1;color:#fff}.tooltip-title{font-weight:300;line-height:1.3}.tooltip-desc{margin-top:8px;line-height:1.5;font-weight:300;letter-spacing:.2px;overflow-wrap:break-word}.tooltip-arrow .icon{width:40px;height:40px;position:absolute}.tooltip-arrow.left_top .icon{top:-25px;left:6px}.tooltip-arrow.left_bottom .icon{bottom:-25px;left:5px;transform:rotate(180deg)}.tooltip-arrow.right_bottom .icon{bottom:-25px;right:10px;transform:rotate(180deg)}.tooltip-arrow.right_top .icon{top:-25px;right:10px}";(function(){function x(){if(document.getElementById("tooltip-overlay-styles"))return;const i=document.createElement("style");i.id="tooltip-overlay-styles",i.textContent=p,document.head.appendChild(i)}let c=null,d=null,f=[],g=!1;function w(i){const e=i.getBoundingClientRect(),t=window.innerWidth,o=window.innerHeight,n=e.left+e.width/2,l=e.top+e.height/2;return{coordinates:{x:e.left,y:e.top,left:e.left,top:e.top,right:t-e.right,bottom:o-e.bottom,width:e.width,height:e.height},position:{horizontal:n<t/2?"left":"right",vertical:l<o/2?"top":"bottom"}}}function y(i,e){if(!i)return{titleSize:16,descriptionSize:12};let t=16,o=12,n="left",l="left";switch(i.title){case"small":t=16,n="left";break;case"medium":t=18;break;case"large":t=22;break}switch(i.description){case"small":o=12;break;case"medium":o=14;break;case"large":o=16;break}switch(e.title){case"left":n="left";break;case"center":n="center";break;case"right":n="right";break}switch(e.description){case"left":l="left";break;case"center":l="center";break;case"right":l="right";break}return{titleSize:t,descriptionSize:o,titleAlign:n,descriptionAlign:l}}function m(){c&&(c.remove(),c=null,d=null)}async function b(){if(g)return;const i=localStorage.getItem("product");if(!i)return;const e=JSON.parse(i).id,t=document.createElement("script");if(t.type="module",t.src=`http://localhost:3000/documentation/${e}/tooltip.js`,await new Promise((n,l)=>{t.onload=n,t.onerror=l,document.head.appendChild(t)}),typeof window.tooltipGetter!="function")return;const o=await window.tooltipGetter();f=Array.isArray(o)?o:[],g=!0}const s=15,u=15;function v(i,e){m(),x();const t=document.createElement("div");t.className="tooltip-overlay",t.style.position="fixed",t.style.pointerEvents="none",t.style.zIndex="9999";const o=document.createElement("div");o.className="tooltip-arrow",o.style.position="absolute";const n=document.createElement("div");n.className="tooltip-card";const l=e.image?`<img class="tooltip-image" src="http://localhost:3000${e.image}" />`:"";n.innerHTML=`
1
+ (function(p){typeof define=="function"&&define.amd?define(p):p()})((function(){"use strict";const p=".tooltip-overlay{position:fixed;z-index:9999;pointer-events:none;background:#53616e;border-radius:8px;box-shadow:0 4px 20px #00000040;color:#dadadb;min-width:45px;max-width:300px;overflow:visible}.tooltip-overlay.with-image{max-width:384px}.tooltip-card{display:flex;align-items:center;gap:16px;padding:10px;box-sizing:border-box}.tooltip-image{width:80px;height:80px;border-radius:8px;object-fit:cover}.tooltip-text{flex:1;color:#fff}.tooltip-title{font-weight:300;line-height:1.3}.tooltip-desc{margin-top:8px;line-height:1.5;font-weight:300;letter-spacing:.2px;overflow-wrap:break-word}.tooltip-arrow .icon{width:40px;height:40px;position:absolute}.tooltip-arrow.left_top .icon{top:-25px;left:6px}.tooltip-arrow.left_bottom .icon{bottom:-25px;left:5px;transform:rotate(180deg)}.tooltip-arrow.right_bottom .icon{bottom:-50px;right:10px;transform:rotate(180deg)}.tooltip-arrow.right_top .icon{top:-50px;right:10px}";(function(){function x(){if(document.getElementById("tooltip-overlay-styles"))return;const i=document.createElement("style");i.id="tooltip-overlay-styles",i.textContent=p,document.head.appendChild(i)}let c=null,d=null,f=[],g=!1;function w(i){const e=i.getBoundingClientRect(),t=window.innerWidth,o=window.innerHeight,n=e.left+e.width/2,l=e.top+e.height/2;return{coordinates:{x:e.left,y:e.top,left:e.left,top:e.top,right:t-e.right,bottom:o-e.bottom,width:e.width,height:e.height},position:{horizontal:n<t/2?"left":"right",vertical:l<o/2?"top":"bottom"}}}function y(i,e){if(!i)return{titleSize:16,descriptionSize:12};let t=16,o=12,n="left",l="left";switch(i.title){case"small":t=16,n="left";break;case"medium":t=18;break;case"large":t=22;break}switch(i.description){case"small":o=12;break;case"medium":o=14;break;case"large":o=16;break}switch(e.title){case"left":n="left";break;case"center":n="center";break;case"right":n="right";break}switch(e.description){case"left":l="left";break;case"center":l="center";break;case"right":l="right";break}return{titleSize:t,descriptionSize:o,titleAlign:n,descriptionAlign:l}}function m(){c&&(c.remove(),c=null,d=null)}async function b(){if(g)return;const i=localStorage.getItem("product");if(!i)return;const e=JSON.parse(i).id,t=document.createElement("script");if(t.type="module",t.src=`http://localhost:3000/documentation/${e}/tooltip.js`,await new Promise((n,l)=>{t.onload=n,t.onerror=l,document.head.appendChild(t)}),typeof window.tooltipGetter!="function")return;const o=await window.tooltipGetter();f=Array.isArray(o)?o:[],g=!0}const s=15,u=15;function v(i,e){m(),x();const t=document.createElement("div");t.className="tooltip-overlay",t.style.position="fixed",t.style.pointerEvents="none",t.style.zIndex="9999";const o=document.createElement("div");o.className="tooltip-arrow",o.style.position="absolute";const n=document.createElement("div");n.className="tooltip-card";const l=e.image?`<img class="tooltip-image" src="http://localhost:3000${e.image}" />`:"";n.innerHTML=`
2
2
  ${e.position?.image==="left"?l:""}
3
3
  <div class="tooltip-text">
4
4
  <div class="tooltip-title">${e.title}</div>
package/dist/tooltip.css CHANGED
@@ -67,12 +67,12 @@
67
67
  }
68
68
 
69
69
  .tooltip-arrow.right_bottom .icon {
70
- bottom: -25px;
70
+ bottom: -50px;
71
71
  right: 10px;
72
72
  transform: rotate(180deg);
73
73
  }
74
74
 
75
75
  .tooltip-arrow.right_top .icon {
76
- top: -25px;
76
+ top: -50px;
77
77
  right: 10px;
78
78
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@erain20029/tooltips",
3
- "version": "2.0.126",
3
+ "version": "2.0.127",
4
4
  "description": "Universal tooltip overlay for any HTML project",
5
5
  "license": "MIT",
6
6
  "author": "Erik",