@erain20029/tooltips 2.0.92 → 2.0.93

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(d){typeof define=="function"&&define.amd?define(d):d()})((function(){"use strict";const d=".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{position:relative}.tooltip-arrow .icon{width:40px;height:40px;position:absolute}.tooltip-arrow.left_top .icon{top:-40px;left:10px}.tooltip-arrow.left_bottom .icon{top:100%;left:10px}.tooltip-arrow.right_bottom .icon{top:100%;right:10px}.tooltip-arrow.right_top .icon{top:-40px;right:10px}";(function(){function x(){if(document.getElementById("tooltip-overlay-styles"))return;const i=document.createElement("style");i.id="tooltip-overlay-styles",i.textContent=d,document.head.appendChild(i)}let s=null,p=null,m=[],u=!1;function v(i){const t=i.getBoundingClientRect(),e=window.innerWidth,n=window.innerHeight,r=t.left+t.width/2,o=t.top+t.height/2;return{coordinates:{x:t.left,y:t.top,width:t.width,height:t.height},position:{horizontal:r<e/2?"left":"right",vertical:o<n/2?"top":"bottom"}}}function y(i,t){if(!i)return{titleSize:16,descriptionSize:12};let e=16,n=12,r="left",o="left";switch(i.title){case"small":e=16,r="left";break;case"medium":e=18;break;case"large":e=22;break}switch(i.description){case"small":n=12;break;case"medium":n=14;break;case"large":n=16;break}switch(t.title){case"left":r="left";break;case"center":r="center";break;case"right":r="right";break}switch(t.description){case"left":o="left";break;case"center":o="center";break;case"right":o="right";break}return{titleSize:e,descriptionSize:n,titleAlign:r,descriptionAlign:o}}function w(){s&&(s.remove(),s=null,p=null)}async function b(){if(u)return;const i=localStorage.getItem("product");if(!i)return;const{id:t}=JSON.parse(i),e=document.createElement("script");e.src=`http://localhost:3000/documentation/${t}/tooltip.js`,await new Promise((n,r)=>{e.onload=n,e.onerror=r,document.head.appendChild(e)}),typeof window.tooltipGetter=="function"&&(m=await window.tooltipGetter(),u=!0)}function k(i,t){w(),x();const e=document.createElement("div");e.className="tooltip-overlay",e.style.left="-9999px",e.style.top="-9999px",t.image&&e.classList.add("with-image");const n=`http://localhost:3000${t.image}`,r=t.image?`<img class="tooltip-image" src="${n}" />`:"";e.innerHTML=`
1
+ (function(d){typeof define=="function"&&define.amd?define(d):d()})((function(){"use strict";const d=".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{position:relative}.tooltip-arrow .icon{width:40px;height:40px;position:absolute}.tooltip-arrow.left_top .icon{top:-20px;left:10px}.tooltip-arrow.left_bottom .icon{top:100%;left:10px}.tooltip-arrow.right_bottom .icon{top:100%;right:10px}.tooltip-arrow.right_top .icon{top:-20px;right:10px}";(function(){function x(){if(document.getElementById("tooltip-overlay-styles"))return;const i=document.createElement("style");i.id="tooltip-overlay-styles",i.textContent=d,document.head.appendChild(i)}let s=null,p=null,m=[],u=!1;function v(i){const t=i.getBoundingClientRect(),e=window.innerWidth,n=window.innerHeight,r=t.left+t.width/2,o=t.top+t.height/2;return{coordinates:{x:t.left,y:t.top,width:t.width,height:t.height},position:{horizontal:r<e/2?"left":"right",vertical:o<n/2?"top":"bottom"}}}function y(i,t){if(!i)return{titleSize:16,descriptionSize:12};let e=16,n=12,r="left",o="left";switch(i.title){case"small":e=16,r="left";break;case"medium":e=18;break;case"large":e=22;break}switch(i.description){case"small":n=12;break;case"medium":n=14;break;case"large":n=16;break}switch(t.title){case"left":r="left";break;case"center":r="center";break;case"right":r="right";break}switch(t.description){case"left":o="left";break;case"center":o="center";break;case"right":o="right";break}return{titleSize:e,descriptionSize:n,titleAlign:r,descriptionAlign:o}}function w(){s&&(s.remove(),s=null,p=null)}async function b(){if(u)return;const i=localStorage.getItem("product");if(!i)return;const{id:t}=JSON.parse(i),e=document.createElement("script");e.src=`http://localhost:3000/documentation/${t}/tooltip.js`,await new Promise((n,r)=>{e.onload=n,e.onerror=r,document.head.appendChild(e)}),typeof window.tooltipGetter=="function"&&(m=await window.tooltipGetter(),u=!0)}function k(i,t){w(),x();const e=document.createElement("div");e.className="tooltip-overlay",e.style.left="-9999px",e.style.top="-9999px",t.image&&e.classList.add("with-image");const n=`http://localhost:3000${t.image}`,r=t.image?`<img class="tooltip-image" src="${n}" />`:"";e.innerHTML=`
2
2
  <div class="tooltip-arrow">
3
3
  <div class="icon">
4
4
  <svg
package/dist/tooltip.css CHANGED
@@ -60,7 +60,7 @@
60
60
  }
61
61
 
62
62
  .tooltip-arrow.left_top .icon {
63
- top: -40px;
63
+ top: -20px;
64
64
  left: 10px;
65
65
  }
66
66
 
@@ -75,6 +75,6 @@
75
75
  }
76
76
 
77
77
  .tooltip-arrow.right_top .icon {
78
- top: -40px;
78
+ top: -20px;
79
79
  right: 10px;
80
80
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@erain20029/tooltips",
3
- "version": "2.0.92",
3
+ "version": "2.0.93",
4
4
  "description": "Universal tooltip overlay for any HTML project",
5
5
  "license": "MIT",
6
6
  "author": "Erik",