vue-pointing-bubble 0.5.2 → 0.6.1

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/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export { PointingBubble, PointingBubble as Callout, PointingBubble as default, PointingBubblePlugin, type PointingBubblePluginOptions, } from './pointing-bubble';
1
+ export { PointingBubble, PointingBubble as default, } from './pointing-bubble';
2
2
  export type { Placement, ResolvedPlacement, TargetAnchor, Point, BubbleTarget, BubbleConfig, BubbleController, BubbleRenderState, } from './pointing-bubble';
3
3
  export { DEFAULT_BUBBLE_CONFIG, createBubbleController, resolveElement, isPoint, computeGeometry, buildTailPaths, } from './pointing-bubble';
@@ -1,11 +1,5 @@
1
- import { Plugin } from 'vue';
2
1
  import { default as PointingBubble } from './PointingBubble.vue';
3
2
  export type { Placement, ResolvedPlacement, TargetAnchor, Point, BubbleTarget, BubbleConfig, BubbleController, BubbleRenderState, } from './core';
4
3
  export { DEFAULT_BUBBLE_CONFIG, createBubbleController, resolveElement, isPoint, computeGeometry, buildTailPaths, } from './core';
5
4
  export { PointingBubble };
6
- export { PointingBubble as Callout };
7
5
  export { PointingBubble as default };
8
- export interface PointingBubblePluginOptions {
9
- name?: string;
10
- }
11
- export declare const PointingBubblePlugin: Plugin;
@@ -5,9 +5,10 @@ export declare function sameKeys(a: Record<string, unknown> | null | undefined,
5
5
  * frame. Falls back to `document.documentElement`.
6
6
  */
7
7
  export declare function positioningFrameEl(boxEl: HTMLElement): HTMLElement;
8
+ export declare function effectiveZoom(el: Element): number;
8
9
  /** Measure a frame element including ancestor CSS scale (e.g. Slidev). */
9
10
  export declare function measureFrame(frameEl: HTMLElement): FrameRect;
10
11
  /** Frame for tip/tail math: the bubble's positioning containing block. */
11
12
  export declare function measureFrameFrom(boxEl: HTMLElement): FrameRect;
12
13
  /** Box size and top-left in frame-local coordinates. */
13
- export declare function measureBox(boxEl: HTMLElement, frame: FrameRect): BoxMeasure;
14
+ export declare function measureBox(boxEl: HTMLElement, frame: FrameRect, boxZoom?: number, frameZoom?: number): BoxMeasure;
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const p=require("vue"),Z={target:null,placement:"auto",targetAnchor:"center",tailLength:45,tailBaseWidth:24,padding:8,shadow:!0,transitionDuration:200},U="pointing-bubble-styles",ot=`:where(.pointing-bubble__inner) {
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const p=require("vue"),et={target:null,placement:"auto",targetAnchor:"center",tailLength:45,tailBaseWidth:24,padding:8,shadow:!0,transitionDuration:200},K="pointing-bubble-styles",ct=`:where(.pointing-bubble__inner) {
2
2
  box-sizing: border-box;
3
3
  width: var(--pb-width, max-content);
4
4
  max-width: var(--pb-max-width, none);
@@ -6,4 +6,4 @@
6
6
  background: white;
7
7
  border: 2px solid gray;
8
8
  border-radius: 8px;
9
- }`,lt="drop-shadow(0 6px 8px rgba(0, 0, 0, 0.25))";function it(e=document){if(e.getElementById(U))return;const t=e.createElement("style");t.id=U,t.textContent=ot,e.head.prepend(t)}function K(e){return typeof e=="object"&&e!==null&&typeof e.x=="number"&&typeof e.y=="number"&&e.nodeType!==1}function q(e){return typeof Element>"u"||e==null?null:typeof e=="string"?document.querySelector(e):e instanceof Element?e:null}function Y(e,t){return!e||!t?!1:Object.keys(e).every(n=>e[n]===t[n])}function J(e){let t=e.parentElement;for(;t;){const n=getComputedStyle(t).position;if(n&&n!=="static")return t;if(t===document.documentElement)break;t=t.parentElement}return document.documentElement}function rt(e){const t=e.getBoundingClientRect(),n=getComputedStyle(e),l=parseFloat(n.width)||0,o=parseFloat(n.height)||0;return{left:t.left,top:t.top,width:l,height:o,scaleX:l?t.width/l:1,scaleY:o?t.height/o:1,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight}}function st(e){return rt(J(e))}function at(e,t){const n=getComputedStyle(e),{scaleX:l,scaleY:o,left:u,top:a}=t,i=e.getBoundingClientRect();return{x:(i.left-u)/l,y:(i.top-a)/o,width:i.width/l,height:i.height/o,fill:n.backgroundColor,stroke:n.borderTopColor,strokeWidth:parseFloat(n.borderTopWidth)||0,borderLeft:(parseFloat(n.borderLeftWidth)||0)/l,borderTop:(parseFloat(n.borderTopWidth)||0)/o,radius:n.borderTopLeftRadius,zIndex:n.zIndex}}function V(e,t,n){const l=e.x-n;let o=l,u=t.width?t.width-e.x-n:1/0;return t.viewportWidth&&(o=Math.min(o,t.left/t.scaleX+l),u=Math.min(u,(t.viewportWidth-t.left)/t.scaleX-e.x-n)),{left:Math.max(0,o),right:Math.max(0,u)}}function Q(e){return e.left>e.right?"left":"right"}function tt(e){const{tip:t,box:n,frame:l,placement:o,targetRect:u,room:a,tailLength:i}=e;if(!n.width||!n.height)return null;const{width:r,height:f}=n,{x:h,y:g}=t,E=o==="manual",c=e.targetAnchor==="edge"?u:null;if(E){if(c){const k=n.x+r/2,B=n.y+f/2;if(!(k>=c.left&&k<=c.right&&B>=c.top&&B<=c.bottom)){const b=Math.min(c.right,Math.max(c.left,k)),W=Math.min(c.bottom,Math.max(c.top,B));return{placement:"manual",tx:b,ty:W,bx:n.x,by:n.y,w:r,h:f}}}return{placement:"manual",tx:h,ty:g,bx:n.x,by:n.y,w:r,h:f}}const _=k=>c?k==="top"?c.top:c.bottom:g;let w=o;if(o==="auto"){let k=g>(l.height||600)/2?"top":"bottom",B=Q(a);const{scaleX:$,scaleY:b}=l;if(l.viewportHeight){const W=l.top+(_("top")-f-i)*b>=0,A=l.top+(_("bottom")+f+i)*b<=l.viewportHeight;k==="top"&&!W&&A?k="bottom":k==="bottom"&&!A&&W&&(k="top")}if(l.viewportWidth){const W=l.left+(h-r-i)*$>=0,A=l.left+(h+r+i)*$<=l.viewportWidth;B==="left"&&!W&&A?B="right":B==="right"&&!A&&W&&(B="left")}w=`${k}-${B}`}const[d,T]=w.split("-"),v=_(d);return{placement:w,tx:h,ty:v,bx:T==="left"?h-r-i:h+i,by:d==="top"?v-f-i:v+i,w:r,h:f}}const ct=["tx","ty","bx","by"],ut=["tx","ty"];function dt(){return typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches}function ft(e,t,n,l){let o=0;const u=()=>{typeof cancelAnimationFrame<"u"&&cancelAnimationFrame(o)};if(!t||!e||n<=0||typeof requestAnimationFrame>"u"||dt())return l(t),{cancel:u};const a=performance.now(),i=r=>{const f=Math.min(1,(r-a)/n),h=1-Math.pow(1-f,3),g={...t},E=t.placement==="manual"?ut:ct;for(const c of E)g[c]=e[c]+(t[c]-e[c])*h;l(g),f<1&&(o=requestAnimationFrame(i))};return o=requestAnimationFrame(i),{cancel:u}}function et(e){const{geometry:t,strokeWidth:n,radius:l,tailBaseWidth:o}=e,{placement:u,tx:a,ty:i,bx:r,by:f,w:h,h:g}=t,E=parseFloat(l)*(l.endsWith("%")?Math.min(h,g)/100:1)||0,c=o/2,_=(y,m,P)=>m>P?(m+P)/2:Math.min(P,Math.max(m,y));let w=null,d=0;if(u==="manual"){const y=Math.max(r-a,a-(r+h),0),m=Math.max(f-i,i-(f+g),0);if(y>0&&y>=m)w=a<r?"left":"right",d=i;else if(m>0)w=i<f?"top":"bottom",d=a;else return null}else if(u!=="none"){const[y,m]=u.split("-");w=m==="left"?"right":"left",d=f+g*(y==="top"?.65:.35)}else return null;const T=w==="top"||w==="bottom",v={left:(y,m)=>[r-m,y],right:(y,m)=>[r+h+m,y],top:(y,m)=>[y,f-m],bottom:(y,m)=>[y,f+g+m]}[w],k=T?r:f,B=T?r+h:f+g,$=_(d,k+c+n/2+E,B-c-n/2-E),b=([y,m])=>`${y} ${m}`,W=n>0?-n/2:0,A=2,j=2,s=$-c,x=$+c,z=v(s-A,W),S=v(s,W),C=v(x,W),M=v(x+A,W),F=v(s,-(n+j)),O=v(x,-(n+j)),L=v(s,1),I=v(x,1);return{fill:`M ${b(F)} L ${b(L)} L ${b(S)} L ${a} ${i} L ${b(C)} L ${b(I)} L ${b(O)} Z`,stroke:n?`M ${b(z)} L ${b(S)} L ${a} ${i} L ${b(C)} L ${b(M)}`:null}}const pt=["left","top","right","bottom","width","height","transform","translate","inset","inset-inline","inset-block"];function ht(e){return{hasTarget:e,placement:"none",tip:null,slotTip:null,boxStyle:{},svgStyle:{},tail:null,boxFill:"",boxStroke:"",boxStrokeWidth:0,boxZIndex:"auto"}}function N(e,t){return e===t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function mt(e,t){return e===t?!0:!e||!t?!1:e.placement===t.placement&&e.tx===t.tx&&e.ty===t.ty&&e.bx===t.bx&&e.by===t.by&&e.w===t.w&&e.h===t.h}function gt(e,t){return e.hasTarget===t.hasTarget&&e.placement===t.placement&&e.boxFill===t.boxFill&&e.boxStroke===t.boxStroke&&e.boxStrokeWidth===t.boxStrokeWidth&&e.boxZIndex===t.boxZIndex&&N(e.tip,t.tip)&&N(e.slotTip,t.slotTip)&&Y(e.boxStyle,t.boxStyle)&&Y(e.svgStyle,t.svgStyle)&&e.tail?.fill===t.tail?.fill&&e.tail?.stroke===t.tail?.stroke}function X(e){if(typeof e.checkVisibility=="function")return e.checkVisibility({checkOpacity:!0,checkVisibilityCSS:!0});const t=getComputedStyle(e);return!(t.display==="none"||t.visibility==="hidden"||parseFloat(t.opacity)===0)}function G(e){const t=e.style;return pt.map(n=>t.getPropertyValue(n)).join("|")}function nt(e){it();let t={...Z},n=null,l=null,o=null,u={left:0,top:0,width:0,height:0,scaleX:1,scaleY:1,viewportWidth:0,viewportHeight:0},a=null,i=null,r=null,f=null,h=null,g=null,E=ht(!1),c=!1,_="";const w=()=>{const s=d();gt(E,s)||(E=s,e.onChange?.(E))};function d(){const s=t.target!=null,x=t.placement==="manual",z=s?a?.placement??"none":"none",S={"--pb-padding":typeof t.padding=="number"?`${t.padding}px`:t.padding};if(t.maxWidth!=null&&(S["--pb-max-width"]=`${t.maxWidth}px`),t.shadow&&(S.filter=lt),!s)S["--pb-width"]="fit-content";else if(Object.assign(S,{position:"absolute",pointerEvents:"auto",overflow:"visible"}),x)S["--pb-width"]="fit-content";else if(Object.assign(S,{left:`${a?.bx??0}px`,top:`${a?.by??0}px`,margin:"0"}),t.maxWidth==null&&n){const O=V(n,u,t.tailLength),L=i?.placement??t.placement,I=L==="auto"?Q(O):L.split("-")[1];S["--pb-max-width"]=`${O[I]}px`}const C=o?.zIndex;C&&C!=="auto"&&(S.zIndex=C);const M=s&&a&&o?et({geometry:a,strokeWidth:o.strokeWidth,radius:o.radius,tailBaseWidth:t.tailBaseWidth}):null;let F={};if(M&&a&&u.width&&u.height){const O=o?.borderLeft??0,L=o?.borderTop??0;F={position:"absolute",left:`${-a.bx-O}px`,top:`${-a.by-L}px`,width:`${u.width}px`,height:`${u.height}px`,overflow:"visible",pointerEvents:"none",zIndex:o?.zIndex??"auto"}}return{hasTarget:s,placement:z,tip:n,slotTip:i?{x:i.tx,y:i.ty}:n,boxStyle:S,svgStyle:F,tail:M,boxFill:o?.fill??"",boxStroke:o?.stroke??"",boxStrokeWidth:o?.strokeWidth??0,boxZIndex:o?.zIndex??"auto"}}function T(){if(!n||!o){(i!==null||a!==null)&&(i=null,v(null));return}const s=V(n,u,t.tailLength),x=tt({tip:n,box:o,frame:u,placement:t.placement,targetAnchor:t.targetAnchor,targetRect:l,room:s,tailLength:t.tailLength});mt(i,x)||(i=x,v(i))}function v(s){r?.cancel(),r=ft(a,s,t.transitionDuration,x=>{a=x,w()})}function k(s){const x=at(s,u);return Y(x,o)?!1:(o=x,!0)}function B(){const s=e.getBoxEl();if(!s){n=null,l=null,o=null,i=null,a=null,c=!1,w();return}if(!X(s)){r?.cancel(),c=!0;return}const x=c;if(c=!1,t.target==null){n=null,l=null,o=null,i=null,a=null,w();return}const z=u;u=st(s);const S=!Y(u,z),C=typeof t.target=="string"?J(s).querySelector(t.target)??q(t.target):q(t.target);let M=!1,F=!1;if(C){const L=C.getBoundingClientRect(),{scaleX:I,scaleY:y,left:m,top:P}=u,R={left:(L.left-m)/I,top:(L.top-P)/y,right:(L.right-m)/I,bottom:(L.bottom-P)/y};F=!Y(R,l),F&&(l=R);const H={x:(R.left+R.right)/2,y:(R.top+R.bottom)/2};M=!N(n,H),n=H}else if(K(t.target)){F=l!=null,l=null;const L={x:t.target.x,y:t.target.y};M=!N(n,L),n=L}else{n=null,l=null,o=null,i=null,a=null,w();return}const O=k(s);_=G(s),!(!x&&!S&&!M&&!F&&!O&&a)&&T()}function $(){B()}typeof window<"u"&&(window.addEventListener("resize",$),window.addEventListener("scroll",$,!0));const b=B;function W(s){const x=e.getBoxEl();if(!x)return;if(s.some(C=>C.attributeName==="class"||C.attributeName==="hidden")){if(!X(x)){r?.cancel(),c=!0;return}b();return}const S=G(x);S!==_&&(_=S,b())}function A(){const s=e.getBoxEl();s!==g&&(g=s,f?.disconnect(),h?.disconnect(),f=null,h=null,s&&(typeof ResizeObserver<"u"&&(f=new ResizeObserver(()=>b()),f.observe(s)),typeof MutationObserver<"u"&&(h=new MutationObserver(W),h.observe(s,{attributes:!0,attributeFilter:["style","class","hidden"]}))))}function j(){A(),b()}return{update:j,setConfig(s){t={...t,...s},j()},getConfig:()=>t,getState:()=>E,destroy(){r?.cancel(),f?.disconnect(),h?.disconnect(),g=null,typeof window<"u"&&(window.removeEventListener("resize",$),window.removeEventListener("scroll",$,!0))}}}const bt=["data-placement"],xt=["d","fill"],yt=["d","stroke","stroke-width"],D=p.defineComponent({name:"PointingBubble",inheritAttrs:!1,__name:"PointingBubble",props:{target:{default:null},placement:{default:"auto"},targetAnchor:{default:"center"},maxWidth:{default:void 0},tailLength:{default:45},tailBaseWidth:{default:24},padding:{default:8},shadow:{type:Boolean,default:!0},transitionDuration:{default:200}},setup(e,{expose:t}){const n=e,l=p.useAttrs(),o=p.computed(()=>l.class),u=p.computed(()=>l.style),a=p.computed(()=>{const{class:d,style:T,...v}=l;return v}),i=p.ref(null),r=p.reactive({hasTarget:!1,placement:"none",tip:null,slotTip:null,boxStyle:{},svgStyle:{},tail:null,boxFill:"",boxStroke:"",boxStrokeWidth:0,boxZIndex:"auto"});function f(d){return d==null?null:typeof d=="string"||typeof Element<"u"&&d instanceof Element?d:typeof d=="object"&&"$el"in d&&d.$el instanceof Element?d.$el:typeof d=="object"&&typeof d.x=="number"&&typeof d.y=="number"?d:null}const h=p.getCurrentInstance(),g=nt({getBoxEl:()=>i.value,onChange:d=>{Object.assign(r,d),h?.update()}});function E(){g.setConfig({target:f(n.target),placement:n.placement,targetAnchor:n.targetAnchor,maxWidth:n.maxWidth,tailLength:n.tailLength,tailBaseWidth:n.tailBaseWidth,padding:n.padding,shadow:n.shadow,transitionDuration:n.transitionDuration})}p.watch(()=>[n.target,typeof n.target=="object"&&n.target&&"x"in n.target?n.target.x:null,typeof n.target=="object"&&n.target&&"y"in n.target?n.target.y:null,n.placement,n.targetAnchor,n.maxWidth,n.tailLength,n.tailBaseWidth,n.padding,n.shadow,n.transitionDuration],E,{flush:"post"}),p.onMounted(()=>{E()}),p.onBeforeUnmount(()=>{g.destroy()});function c(){g.update()}t({update:c});const _=p.computed(()=>({...u.value,...r.boxStyle})),w=p.computed(()=>r.svgStyle);return(d,T)=>(p.openBlock(),p.createElementBlock("div",p.mergeProps({ref_key:"rootRef",ref:i,class:["pointing-bubble","pointing-bubble__inner",o.value],"data-placement":r.placement},a.value,{style:_.value}),[p.renderSlot(d.$slots,"default",{placement:r.placement,tip:r.slotTip},()=>[T[0]||(T[0]=p.createElementVNode("p",{style:{margin:0,fontSize:"14px",fontWeight:600,color:"#1e293b"}}," Callout content ",-1))]),e.target&&r.tail?(p.openBlock(),p.createElementBlock("svg",{key:0,class:"pointing-bubble__svg",style:p.normalizeStyle(w.value)},[p.createElementVNode("path",{class:"pointing-bubble__path",d:r.tail.fill,fill:r.boxFill},null,8,xt),r.tail.stroke?(p.openBlock(),p.createElementBlock("path",{key:0,class:"pointing-bubble__path",d:r.tail.stroke,fill:"none",stroke:r.boxStroke,"stroke-width":r.boxStrokeWidth,"stroke-linejoin":"round","stroke-linecap":"butt"},null,8,yt)):p.createCommentVNode("",!0)],4)):p.createCommentVNode("",!0)],16,bt))}}),wt={install(e,t={}){const n=t.name??"PointingBubble";e.component(n,D),e.component("Callout",D)}};exports.Callout=D;exports.DEFAULT_BUBBLE_CONFIG=Z;exports.PointingBubble=D;exports.PointingBubblePlugin=wt;exports.buildTailPaths=et;exports.computeGeometry=tt;exports.createBubbleController=nt;exports.default=D;exports.isPoint=K;exports.resolveElement=q;
9
+ }`,ut="drop-shadow(0 6px 8px rgba(0, 0, 0, 0.25))";function dt(e=document){if(e.getElementById(K))return;const t=e.createElement("style");t.id=K,t.textContent=ct,e.head.prepend(t)}function nt(e){return typeof e=="object"&&e!==null&&typeof e.x=="number"&&typeof e.y=="number"&&e.nodeType!==1}function q(e){return typeof Element>"u"||e==null?null:typeof e=="string"?document.querySelector(e):e instanceof Element?e:null}function j(e,t){return!e||!t?!1:Object.keys(e).every(n=>e[n]===t[n])}function ot(e){let t=e.parentElement;for(;t;){const n=getComputedStyle(t).position;if(n&&n!=="static")return t;if(t===document.documentElement)break;t=t.parentElement}return document.documentElement}function X(e){let t=1,n=e;for(;n;){const i=Number.parseFloat(getComputedStyle(n).zoom);Number.isFinite(i)&&i>0&&(t*=i),n=n.parentElement}return t}function ft(e){const t=e.getBoundingClientRect(),n=getComputedStyle(e),i=parseFloat(n.width)||0,o=parseFloat(n.height)||0;return{left:t.left,top:t.top,width:i,height:o,scaleX:i?t.width/i:1,scaleY:o?t.height/o:1,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight}}function pt(e){return ft(ot(e))}function ht(e,t,n=1,i=1){const o=getComputedStyle(e),{scaleX:u,scaleY:f,left:r,top:l}=t,a=e.getBoundingClientRect();return{x:(a.left*n-r*i)/(u*n),y:(a.top*n-l*i)/(f*n),width:a.width/u,height:a.height/f,fill:o.backgroundColor,stroke:o.borderTopColor,strokeWidth:parseFloat(o.borderTopWidth)||0,borderLeft:(parseFloat(o.borderLeftWidth)||0)/u,borderTop:(parseFloat(o.borderTopWidth)||0)/f,radius:o.borderTopLeftRadius,zIndex:o.zIndex}}function J(e,t,n){const i=e.x-n;let o=i,u=t.width?t.width-e.x-n:1/0;return t.viewportWidth&&(o=Math.min(o,t.left/t.scaleX+i),u=Math.min(u,(t.viewportWidth-t.left)/t.scaleX-e.x-n)),{left:Math.max(0,o),right:Math.max(0,u)}}function lt(e){return e.left>e.right?"left":"right"}function it(e){const{tip:t,box:n,frame:i,placement:o,targetRect:u,room:f,tailLength:r}=e;if(!n.width||!n.height)return null;const{width:l,height:a}=n,{x:g,y:m}=t,L=o==="manual",d=e.targetAnchor==="edge"?u:null;if(L){if(d){const E=n.x+l/2,F=n.y+a/2;if(!(E>=d.left&&E<=d.right&&F>=d.top&&F<=d.bottom)){const y=Math.min(d.right,Math.max(d.left,E)),v=Math.min(d.bottom,Math.max(d.top,F));return{placement:"manual",tx:y,ty:v,bx:n.x,by:n.y,w:l,h:a}}}return{placement:"manual",tx:g,ty:m,bx:n.x,by:n.y,w:l,h:a}}const C=E=>d?E==="top"?d.top:d.bottom:m;let S=o;if(o==="auto"){let E=m>(i.height||600)/2?"top":"bottom",F=lt(f);const{scaleX:z,scaleY:y}=i;if(i.viewportHeight){const v=i.top+(C("top")-a-r)*y>=0,T=i.top+(C("bottom")+a+r)*y<=i.viewportHeight;E==="top"&&!v&&T?E="bottom":E==="bottom"&&!T&&v&&(E="top")}if(i.viewportWidth){const v=i.left+(g-l-r)*z>=0,T=i.left+(g+l+r)*z<=i.viewportWidth;F==="left"&&!v&&T?F="right":F==="right"&&!T&&v&&(F="left")}S=`${E}-${F}`}const[c,$]=S.split("-"),k=C(c);return{placement:S,tx:g,ty:k,bx:$==="left"?g-l-r:g+r,by:c==="top"?k-a-r:k+r,w:l,h:a}}const mt=["tx","ty","bx","by"],gt=["tx","ty"];function bt(){return typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches}function yt(e,t,n,i){let o=0;const u=()=>{typeof cancelAnimationFrame<"u"&&cancelAnimationFrame(o)};if(!t||!e||n<=0||typeof requestAnimationFrame>"u"||bt())return i(t),{cancel:u};const f=performance.now(),r=l=>{const a=Math.min(1,(l-f)/n),g=1-Math.pow(1-a,3),m={...t},L=t.placement==="manual"?gt:mt;for(const d of L)m[d]=e[d]+(t[d]-e[d])*g;i(m),a<1&&(o=requestAnimationFrame(r))};return o=requestAnimationFrame(r),{cancel:u}}function rt(e){const{geometry:t,strokeWidth:n,radius:i,tailBaseWidth:o}=e,{placement:u,tx:f,ty:r,bx:l,by:a,w:g,h:m}=t,L=parseFloat(i)*(i.endsWith("%")?Math.min(g,m)/100:1)||0,d=o/2,C=(h,x,_)=>x>_?(x+_)/2:Math.min(_,Math.max(x,h));let S=null,c=0;if(u==="manual"){const h=Math.max(l-f,f-(l+g),0),x=Math.max(a-r,r-(a+m),0);if(h>0&&h>=x)S=f<l?"left":"right",c=r;else if(x>0)S=r<a?"top":"bottom",c=f;else return null}else if(u!=="none"){const[h,x]=u.split("-");S=x==="left"?"right":"left",c=a+m*(h==="top"?.65:.35)}else return null;const $=S==="top"||S==="bottom",k={left:(h,x)=>[l-x,h],right:(h,x)=>[l+g+x,h],top:(h,x)=>[h,a-x],bottom:(h,x)=>[h,a+m+x]}[S],E=$?l:a,F=$?l+g:a+m,z=C(c,E+d+n/2+L,F-d-n/2-L),y=([h,x])=>`${h} ${x}`,v=n>0?-n/2:0,T=2,N=2,I=z-d,s=z+d,W=k(I-T,v),O=k(I,v),b=k(s,v),w=k(s+T,v),B=k(I,-(n+N)),R=k(s,-(n+N)),A=k(I,1),M=k(s,1);return{fill:`M ${y(B)} L ${y(A)} L ${y(O)} L ${f} ${r} L ${y(b)} L ${y(M)} L ${y(R)} Z`,stroke:n?`M ${y(W)} L ${y(O)} L ${f} ${r} L ${y(b)} L ${y(w)}`:null}}const xt=["left","top","right","bottom","width","height","transform","translate","inset","inset-inline","inset-block"];function wt(e){return{hasTarget:e,placement:"none",tip:null,slotTip:null,boxStyle:{},svgStyle:{},tail:null,boxFill:"",boxStroke:"",boxStrokeWidth:0,boxZIndex:"auto"}}function D(e,t){return e===t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function vt(e,t){return e===t?!0:!e||!t?!1:e.placement===t.placement&&e.tx===t.tx&&e.ty===t.ty&&e.bx===t.bx&&e.by===t.by&&e.w===t.w&&e.h===t.h}function St(e,t){return e.hasTarget===t.hasTarget&&e.placement===t.placement&&e.boxFill===t.boxFill&&e.boxStroke===t.boxStroke&&e.boxStrokeWidth===t.boxStrokeWidth&&e.boxZIndex===t.boxZIndex&&D(e.tip,t.tip)&&D(e.slotTip,t.slotTip)&&j(e.boxStyle,t.boxStyle)&&j(e.svgStyle,t.svgStyle)&&e.tail?.fill===t.tail?.fill&&e.tail?.stroke===t.tail?.stroke}function Q(e){if(typeof e.checkVisibility=="function")return e.checkVisibility({checkOpacity:!0,checkVisibilityCSS:!0});const t=getComputedStyle(e);return!(t.display==="none"||t.visibility==="hidden"||parseFloat(t.opacity)===0)}function tt(e){const t=e.style;return xt.map(n=>t.getPropertyValue(n)).join("|")}function st(e){dt();let t={...et},n=null,i=null,o=null,u={left:0,top:0,width:0,height:0,scaleX:1,scaleY:1,viewportWidth:0,viewportHeight:0},f={...u},r=null,l=null,a=null,g=null,m=null,L=null,d=wt(!1),C=!1,S="";const c=()=>{const s=$();St(d,s)||(d=s,e.onChange?.(d))};function $(){const s=t.target!=null,W=t.placement==="manual",O=s?r?.placement??"none":"none",b={"--pb-padding":typeof t.padding=="number"?`${t.padding}px`:t.padding};if(t.maxWidth!=null&&(b["--pb-max-width"]=`${t.maxWidth}px`),t.shadow&&(b.filter=ut),!s)b["--pb-width"]="fit-content";else if(Object.assign(b,{position:"absolute",pointerEvents:"auto",overflow:"visible"}),W)b["--pb-width"]="fit-content";else if(Object.assign(b,{left:`${r?.bx??0}px`,top:`${r?.by??0}px`,margin:"0"}),t.maxWidth==null&&n){const A=J(n,f,t.tailLength),M=l?.placement??t.placement,h=M==="auto"?lt(A):M.split("-")[1];b["--pb-max-width"]=`${A[h]}px`}const w=o?.zIndex;w&&w!=="auto"&&(b.zIndex=w);const B=s&&r&&o?rt({geometry:r,strokeWidth:o.strokeWidth,radius:o.radius,tailBaseWidth:t.tailBaseWidth}):null;let R={};if(B&&r&&f.width&&f.height){const A=o?.borderLeft??0,M=o?.borderTop??0;R={position:"absolute",left:`${-r.bx-A}px`,top:`${-r.by-M}px`,width:`${f.width}px`,height:`${f.height}px`,overflow:"visible",pointerEvents:"none",zIndex:o?.zIndex??"auto"}}return{hasTarget:s,placement:O,tip:n,slotTip:l?{x:l.tx,y:l.ty}:n,boxStyle:b,svgStyle:R,tail:B,boxFill:o?.fill??"",boxStroke:o?.stroke??"",boxStrokeWidth:o?.strokeWidth??0,boxZIndex:o?.zIndex??"auto"}}function k(){if(!n||!o){(l!==null||r!==null)&&(l=null,E(null));return}const s=J(n,f,t.tailLength),W=it({tip:n,box:o,frame:f,placement:t.placement,targetAnchor:t.targetAnchor,targetRect:i,room:s,tailLength:t.tailLength});vt(l,W)||(l=W,E(l))}function E(s){a?.cancel(),a=yt(r,s,t.transitionDuration,W=>{r=W,c()})}function F(s,W,O){const b=ht(s,u,W,O);return j(b,o)?!1:(o=b,!0)}function z(){const s=e.getBoxEl();if(!s){n=null,i=null,o=null,l=null,r=null,C=!1,c();return}if(!Q(s)){a?.cancel(),C=!0;return}const W=C;if(C=!1,t.target==null){n=null,i=null,o=null,l=null,r=null,c();return}const O=f;u=pt(s);const b=ot(s),w=X(b),B=X(s);f={...u,left:u.left*w,top:u.top*w,width:u.width*w/B,height:u.height*w/B,scaleX:u.scaleX*B,scaleY:u.scaleY*B};const R=!j(f,O),A=typeof t.target=="string"?b.querySelector(t.target)??q(t.target):q(t.target);let M=!1,h=!1;if(A){const _=A.getBoundingClientRect(),P=X(A),{scaleX:H,scaleY:U,left:V,top:G}=u,Y={left:(_.left*P-V*w)/(H*B),top:(_.top*P-G*w)/(U*B),right:(_.right*P-V*w)/(H*B),bottom:(_.bottom*P-G*w)/(U*B)};h=!j(Y,i),h&&(i=Y);const Z={x:(Y.left+Y.right)/2,y:(Y.top+Y.bottom)/2};M=!D(n,Z),n=Z}else if(nt(t.target)){h=i!=null,i=null;const _={x:t.target.x,y:t.target.y};M=!D(n,_),n=_}else{n=null,i=null,o=null,l=null,r=null,c();return}const x=F(s,B,w);S=tt(s),!(!W&&!R&&!M&&!h&&!x&&r)&&k()}function y(){z()}typeof window<"u"&&(window.addEventListener("resize",y),window.addEventListener("scroll",y,!0));const v=z;function T(s){const W=e.getBoxEl();if(!W)return;if(s.some(w=>w.attributeName==="class"||w.attributeName==="hidden")){if(!Q(W)){a?.cancel(),C=!0;return}v();return}const b=tt(W);b!==S&&(S=b,v())}function N(){const s=e.getBoxEl();s!==L&&(L=s,g?.disconnect(),m?.disconnect(),g=null,m=null,s&&(typeof ResizeObserver<"u"&&(g=new ResizeObserver(()=>v()),g.observe(s)),typeof MutationObserver<"u"&&(m=new MutationObserver(T),m.observe(s,{attributes:!0,attributeFilter:["style","class","hidden"]}))))}function I(){N(),v()}return{update:I,setConfig(s){t={...t,...s},I()},getConfig:()=>t,getState:()=>d,destroy(){a?.cancel(),g?.disconnect(),m?.disconnect(),L=null,typeof window<"u"&&(window.removeEventListener("resize",y),window.removeEventListener("scroll",y,!0))}}}const kt=["data-placement"],Et=["d","fill"],Wt=["d","stroke","stroke-width"],at=p.defineComponent({name:"PointingBubble",inheritAttrs:!1,__name:"PointingBubble",props:{target:{default:null},placement:{default:"auto"},targetAnchor:{default:"center"},maxWidth:{default:void 0},tailLength:{default:45},tailBaseWidth:{default:24},padding:{default:8},shadow:{type:Boolean,default:!0},transitionDuration:{default:200}},setup(e,{expose:t}){const n=e,i=p.useAttrs(),o=p.computed(()=>i.class),u=p.computed(()=>i.style),f=p.computed(()=>{const{class:c,style:$,...k}=i;return k}),r=p.ref(null),l=p.reactive({hasTarget:!1,placement:"none",tip:null,slotTip:null,boxStyle:{},svgStyle:{},tail:null,boxFill:"",boxStroke:"",boxStrokeWidth:0,boxZIndex:"auto"});function a(c){return c==null?null:typeof c=="string"||typeof Element<"u"&&c instanceof Element?c:typeof c=="object"&&"$el"in c&&c.$el instanceof Element?c.$el:typeof c=="object"&&typeof c.x=="number"&&typeof c.y=="number"?c:null}const g=p.getCurrentInstance(),m=st({getBoxEl:()=>r.value,onChange:c=>{Object.assign(l,c),g?.update()}});function L(){m.setConfig({target:a(n.target),placement:n.placement,targetAnchor:n.targetAnchor,maxWidth:n.maxWidth,tailLength:n.tailLength,tailBaseWidth:n.tailBaseWidth,padding:n.padding,shadow:n.shadow,transitionDuration:n.transitionDuration})}p.watch(()=>[n.target,typeof n.target=="object"&&n.target&&"x"in n.target?n.target.x:null,typeof n.target=="object"&&n.target&&"y"in n.target?n.target.y:null,n.placement,n.targetAnchor,n.maxWidth,n.tailLength,n.tailBaseWidth,n.padding,n.shadow,n.transitionDuration],L,{flush:"post"}),p.onMounted(()=>{L()}),p.onBeforeUnmount(()=>{m.destroy()});function d(){m.update()}t({update:d});const C=p.computed(()=>({...u.value,...l.boxStyle})),S=p.computed(()=>l.svgStyle);return(c,$)=>(p.openBlock(),p.createElementBlock("div",p.mergeProps({ref_key:"rootRef",ref:r,class:["pointing-bubble","pointing-bubble__inner",o.value],"data-placement":l.placement},f.value,{style:C.value}),[p.renderSlot(c.$slots,"default",{placement:l.placement,tip:l.slotTip},()=>[$[0]||($[0]=p.createElementVNode("p",{style:{margin:0,fontSize:"14px",fontWeight:600,color:"#1e293b"}}," Callout content ",-1))]),e.target&&l.tail?(p.openBlock(),p.createElementBlock("svg",{key:0,class:"pointing-bubble__svg",style:p.normalizeStyle(S.value)},[p.createElementVNode("path",{class:"pointing-bubble__path",d:l.tail.fill,fill:l.boxFill},null,8,Et),l.tail.stroke?(p.openBlock(),p.createElementBlock("path",{key:0,class:"pointing-bubble__path",d:l.tail.stroke,fill:"none",stroke:l.boxStroke,"stroke-width":l.boxStrokeWidth,"stroke-linejoin":"round","stroke-linecap":"butt"},null,8,Wt)):p.createCommentVNode("",!0)],4)):p.createCommentVNode("",!0)],16,kt))}});exports.DEFAULT_BUBBLE_CONFIG=et;exports.PointingBubble=at;exports.buildTailPaths=rt;exports.computeGeometry=it;exports.createBubbleController=st;exports.default=at;exports.isPoint=nt;exports.resolveElement=q;
@@ -1,5 +1,5 @@
1
- import { defineComponent as nt, useAttrs as ot, computed as Y, ref as it, reactive as lt, getCurrentInstance as rt, watch as st, onMounted as at, onBeforeUnmount as ct, openBlock as H, createElementBlock as q, mergeProps as ut, renderSlot as dt, createElementVNode as X, normalizeStyle as ft, createCommentVNode as U } from "vue";
2
- const pt = {
1
+ import { defineComponent as st, useAttrs as at, computed as Y, ref as ct, reactive as ut, getCurrentInstance as dt, watch as ft, onMounted as pt, onBeforeUnmount as ht, openBlock as X, createElementBlock as H, mergeProps as mt, renderSlot as gt, createElementVNode as J, normalizeStyle as bt, createCommentVNode as Q } from "vue";
2
+ const xt = {
3
3
  target: null,
4
4
  placement: "auto",
5
5
  targetAnchor: "center",
@@ -8,7 +8,7 @@ const pt = {
8
8
  padding: 8,
9
9
  shadow: !0,
10
10
  transitionDuration: 200
11
- }, V = "pointing-bubble-styles", ht = `:where(.pointing-bubble__inner) {
11
+ }, tt = "pointing-bubble-styles", yt = `:where(.pointing-bubble__inner) {
12
12
  box-sizing: border-box;
13
13
  width: var(--pb-width, max-content);
14
14
  max-width: var(--pb-max-width, none);
@@ -16,22 +16,22 @@ const pt = {
16
16
  background: white;
17
17
  border: 2px solid gray;
18
18
  border-radius: 8px;
19
- }`, mt = "drop-shadow(0 6px 8px rgba(0, 0, 0, 0.25))";
20
- function gt(e = document) {
21
- if (e.getElementById(V)) return;
19
+ }`, wt = "drop-shadow(0 6px 8px rgba(0, 0, 0, 0.25))";
20
+ function vt(e = document) {
21
+ if (e.getElementById(tt)) return;
22
22
  const t = e.createElement("style");
23
- t.id = V, t.textContent = ht, e.head.prepend(t);
23
+ t.id = tt, t.textContent = yt, e.head.prepend(t);
24
24
  }
25
- function bt(e) {
25
+ function St(e) {
26
26
  return typeof e == "object" && e !== null && typeof e.x == "number" && typeof e.y == "number" && e.nodeType !== 1;
27
27
  }
28
- function Z(e) {
28
+ function et(e) {
29
29
  return typeof Element > "u" || e == null ? null : typeof e == "string" ? document.querySelector(e) : e instanceof Element ? e : null;
30
30
  }
31
31
  function j(e, t) {
32
32
  return !e || !t ? !1 : Object.keys(e).every((n) => e[n] === t[n]);
33
33
  }
34
- function tt(e) {
34
+ function lt(e) {
35
35
  let t = e.parentElement;
36
36
  for (; t; ) {
37
37
  const n = getComputedStyle(t).position;
@@ -41,142 +41,150 @@ function tt(e) {
41
41
  }
42
42
  return document.documentElement;
43
43
  }
44
- function xt(e) {
45
- const t = e.getBoundingClientRect(), n = getComputedStyle(e), i = parseFloat(n.width) || 0, o = parseFloat(n.height) || 0;
44
+ function q(e) {
45
+ let t = 1, n = e;
46
+ for (; n; ) {
47
+ const l = Number.parseFloat(getComputedStyle(n).zoom);
48
+ Number.isFinite(l) && l > 0 && (t *= l), n = n.parentElement;
49
+ }
50
+ return t;
51
+ }
52
+ function kt(e) {
53
+ const t = e.getBoundingClientRect(), n = getComputedStyle(e), l = parseFloat(n.width) || 0, o = parseFloat(n.height) || 0;
46
54
  return {
47
55
  left: t.left,
48
56
  top: t.top,
49
- width: i,
57
+ width: l,
50
58
  height: o,
51
- scaleX: i ? t.width / i : 1,
59
+ scaleX: l ? t.width / l : 1,
52
60
  scaleY: o ? t.height / o : 1,
53
61
  viewportWidth: window.innerWidth,
54
62
  viewportHeight: window.innerHeight
55
63
  };
56
64
  }
57
- function yt(e) {
58
- return xt(tt(e));
65
+ function Wt(e) {
66
+ return kt(lt(e));
59
67
  }
60
- function wt(e, t) {
61
- const n = getComputedStyle(e), { scaleX: i, scaleY: o, left: u, top: a } = t, l = e.getBoundingClientRect();
68
+ function Et(e, t, n = 1, l = 1) {
69
+ const o = getComputedStyle(e), { scaleX: u, scaleY: f, left: r, top: i } = t, a = e.getBoundingClientRect();
62
70
  return {
63
- x: (l.left - u) / i,
64
- y: (l.top - a) / o,
65
- width: l.width / i,
66
- height: l.height / o,
67
- fill: n.backgroundColor,
68
- stroke: n.borderTopColor,
69
- strokeWidth: parseFloat(n.borderTopWidth) || 0,
71
+ x: (a.left * n - r * l) / (u * n),
72
+ y: (a.top * n - i * l) / (f * n),
73
+ width: a.width / u,
74
+ height: a.height / f,
75
+ fill: o.backgroundColor,
76
+ stroke: o.borderTopColor,
77
+ strokeWidth: parseFloat(o.borderTopWidth) || 0,
70
78
  // Abspos SVG is positioned against the padding edge; path math uses the
71
79
  // border box from getBoundingClientRect — subtract these when offsetting.
72
- borderLeft: (parseFloat(n.borderLeftWidth) || 0) / i,
73
- borderTop: (parseFloat(n.borderTopWidth) || 0) / o,
74
- radius: n.borderTopLeftRadius,
75
- zIndex: n.zIndex
80
+ borderLeft: (parseFloat(o.borderLeftWidth) || 0) / u,
81
+ borderTop: (parseFloat(o.borderTopWidth) || 0) / f,
82
+ radius: o.borderTopLeftRadius,
83
+ zIndex: o.zIndex
76
84
  };
77
85
  }
78
- function G(e, t, n) {
79
- const i = e.x - n;
80
- let o = i, u = t.width ? t.width - e.x - n : 1 / 0;
81
- return t.viewportWidth && (o = Math.min(o, t.left / t.scaleX + i), u = Math.min(
86
+ function nt(e, t, n) {
87
+ const l = e.x - n;
88
+ let o = l, u = t.width ? t.width - e.x - n : 1 / 0;
89
+ return t.viewportWidth && (o = Math.min(o, t.left / t.scaleX + l), u = Math.min(
82
90
  u,
83
91
  (t.viewportWidth - t.left) / t.scaleX - e.x - n
84
92
  )), { left: Math.max(0, o), right: Math.max(0, u) };
85
93
  }
86
- function et(e) {
94
+ function rt(e) {
87
95
  return e.left > e.right ? "left" : "right";
88
96
  }
89
- function vt(e) {
90
- const { tip: t, box: n, frame: i, placement: o, targetRect: u, room: a, tailLength: l } = e;
97
+ function Lt(e) {
98
+ const { tip: t, box: n, frame: l, placement: o, targetRect: u, room: f, tailLength: r } = e;
91
99
  if (!n.width || !n.height) return null;
92
- const { width: r, height: f } = n, { x: p, y: m } = t, k = o === "manual", c = e.targetAnchor === "edge" ? u : null;
93
- if (k) {
94
- if (c) {
95
- const S = n.x + r / 2, W = n.y + f / 2;
96
- if (!(S >= c.left && S <= c.right && W >= c.top && W <= c.bottom)) {
97
- const g = Math.min(c.right, Math.max(c.left, S)), E = Math.min(c.bottom, Math.max(c.top, W));
98
- return { placement: "manual", tx: g, ty: E, bx: n.x, by: n.y, w: r, h: f };
100
+ const { width: i, height: a } = n, { x: m, y: h } = t, L = o === "manual", d = e.targetAnchor === "edge" ? u : null;
101
+ if (L) {
102
+ if (d) {
103
+ const k = n.x + i / 2, $ = n.y + a / 2;
104
+ if (!(k >= d.left && k <= d.right && $ >= d.top && $ <= d.bottom)) {
105
+ const b = Math.min(d.right, Math.max(d.left, k)), w = Math.min(d.bottom, Math.max(d.top, $));
106
+ return { placement: "manual", tx: b, ty: w, bx: n.x, by: n.y, w: i, h: a };
99
107
  }
100
108
  }
101
- return { placement: "manual", tx: p, ty: m, bx: n.x, by: n.y, w: r, h: f };
109
+ return { placement: "manual", tx: m, ty: h, bx: n.x, by: n.y, w: i, h: a };
102
110
  }
103
- const C = (S) => c ? S === "top" ? c.top : c.bottom : m;
104
- let y = o;
111
+ const B = (k) => d ? k === "top" ? d.top : d.bottom : h;
112
+ let v = o;
105
113
  if (o === "auto") {
106
- let S = m > (i.height || 600) / 2 ? "top" : "bottom", W = et(a);
107
- const { scaleX: $, scaleY: g } = i;
108
- if (i.viewportHeight) {
109
- const E = i.top + (C("top") - f - l) * g >= 0, A = i.top + (C("bottom") + f + l) * g <= i.viewportHeight;
110
- S === "top" && !E && A ? S = "bottom" : S === "bottom" && !A && E && (S = "top");
114
+ let k = h > (l.height || 600) / 2 ? "top" : "bottom", $ = rt(f);
115
+ const { scaleX: M, scaleY: b } = l;
116
+ if (l.viewportHeight) {
117
+ const w = l.top + (B("top") - a - r) * b >= 0, _ = l.top + (B("bottom") + a + r) * b <= l.viewportHeight;
118
+ k === "top" && !w && _ ? k = "bottom" : k === "bottom" && !_ && w && (k = "top");
111
119
  }
112
- if (i.viewportWidth) {
113
- const E = i.left + (p - r - l) * $ >= 0, A = i.left + (p + r + l) * $ <= i.viewportWidth;
114
- W === "left" && !E && A ? W = "right" : W === "right" && !A && E && (W = "left");
120
+ if (l.viewportWidth) {
121
+ const w = l.left + (m - i - r) * M >= 0, _ = l.left + (m + i + r) * M <= l.viewportWidth;
122
+ $ === "left" && !w && _ ? $ = "right" : $ === "right" && !_ && w && ($ = "left");
115
123
  }
116
- y = `${S}-${W}`;
124
+ v = `${k}-${$}`;
117
125
  }
118
- const [d, _] = y.split("-"), w = C(d);
126
+ const [c, F] = v.split("-"), S = B(c);
119
127
  return {
120
- placement: y,
121
- tx: p,
122
- ty: w,
123
- bx: _ === "left" ? p - r - l : p + l,
124
- by: d === "top" ? w - f - l : w + l,
125
- w: r,
126
- h: f
128
+ placement: v,
129
+ tx: m,
130
+ ty: S,
131
+ bx: F === "left" ? m - i - r : m + r,
132
+ by: c === "top" ? S - a - r : S + r,
133
+ w: i,
134
+ h: a
127
135
  };
128
136
  }
129
- const St = ["tx", "ty", "bx", "by"], kt = ["tx", "ty"];
130
- function Wt() {
137
+ const Bt = ["tx", "ty", "bx", "by"], $t = ["tx", "ty"];
138
+ function Ct() {
131
139
  return typeof matchMedia < "u" && matchMedia("(prefers-reduced-motion: reduce)").matches;
132
140
  }
133
- function Et(e, t, n, i) {
141
+ function Ft(e, t, n, l) {
134
142
  let o = 0;
135
143
  const u = () => {
136
144
  typeof cancelAnimationFrame < "u" && cancelAnimationFrame(o);
137
145
  };
138
- if (!t || !e || n <= 0 || typeof requestAnimationFrame > "u" || Wt())
139
- return i(t), { cancel: u };
140
- const a = performance.now(), l = (r) => {
141
- const f = Math.min(1, (r - a) / n), p = 1 - Math.pow(1 - f, 3), m = { ...t }, k = t.placement === "manual" ? kt : St;
142
- for (const c of k)
143
- m[c] = e[c] + (t[c] - e[c]) * p;
144
- i(m), f < 1 && (o = requestAnimationFrame(l));
146
+ if (!t || !e || n <= 0 || typeof requestAnimationFrame > "u" || Ct())
147
+ return l(t), { cancel: u };
148
+ const f = performance.now(), r = (i) => {
149
+ const a = Math.min(1, (i - f) / n), m = 1 - Math.pow(1 - a, 3), h = { ...t }, L = t.placement === "manual" ? $t : Bt;
150
+ for (const d of L)
151
+ h[d] = e[d] + (t[d] - e[d]) * m;
152
+ l(h), a < 1 && (o = requestAnimationFrame(r));
145
153
  };
146
- return o = requestAnimationFrame(l), { cancel: u };
154
+ return o = requestAnimationFrame(r), { cancel: u };
147
155
  }
148
- function Bt(e) {
149
- const { geometry: t, strokeWidth: n, radius: i, tailBaseWidth: o } = e, { placement: u, tx: a, ty: l, bx: r, by: f, w: p, h: m } = t, k = parseFloat(i) * (i.endsWith("%") ? Math.min(p, m) / 100 : 1) || 0, c = o / 2, C = (x, h, O) => h > O ? (h + O) / 2 : Math.min(O, Math.max(h, x));
150
- let y = null, d = 0;
156
+ function _t(e) {
157
+ const { geometry: t, strokeWidth: n, radius: l, tailBaseWidth: o } = e, { placement: u, tx: f, ty: r, bx: i, by: a, w: m, h } = t, L = parseFloat(l) * (l.endsWith("%") ? Math.min(m, h) / 100 : 1) || 0, d = o / 2, B = (p, x, C) => x > C ? (x + C) / 2 : Math.min(C, Math.max(x, p));
158
+ let v = null, c = 0;
151
159
  if (u === "manual") {
152
- const x = Math.max(r - a, a - (r + p), 0), h = Math.max(f - l, l - (f + m), 0);
153
- if (x > 0 && x >= h)
154
- y = a < r ? "left" : "right", d = l;
155
- else if (h > 0)
156
- y = l < f ? "top" : "bottom", d = a;
160
+ const p = Math.max(i - f, f - (i + m), 0), x = Math.max(a - r, r - (a + h), 0);
161
+ if (p > 0 && p >= x)
162
+ v = f < i ? "left" : "right", c = r;
163
+ else if (x > 0)
164
+ v = r < a ? "top" : "bottom", c = f;
157
165
  else
158
166
  return null;
159
167
  } else if (u !== "none") {
160
- const [x, h] = u.split("-");
161
- y = h === "left" ? "right" : "left", d = f + m * (x === "top" ? 0.65 : 0.35);
168
+ const [p, x] = u.split("-");
169
+ v = x === "left" ? "right" : "left", c = a + h * (p === "top" ? 0.65 : 0.35);
162
170
  } else
163
171
  return null;
164
- const _ = y === "top" || y === "bottom", w = {
165
- left: (x, h) => [r - h, x],
166
- right: (x, h) => [r + p + h, x],
167
- top: (x, h) => [x, f - h],
168
- bottom: (x, h) => [x, f + m + h]
169
- }[y], S = _ ? r : f, W = _ ? r + p : f + m, $ = C(
170
- d,
171
- S + c + n / 2 + k,
172
- W - c - n / 2 - k
173
- ), g = ([x, h]) => `${x} ${h}`, E = n > 0 ? -n / 2 : 0, A = 2, P = 2, s = $ - c, b = $ + c, z = w(s - A, E), v = w(s, E), L = w(b, E), F = w(b + A, E), T = w(s, -(n + P)), M = w(b, -(n + P)), B = w(s, 1), I = w(b, 1);
172
+ const F = v === "top" || v === "bottom", S = {
173
+ left: (p, x) => [i - x, p],
174
+ right: (p, x) => [i + m + x, p],
175
+ top: (p, x) => [p, a - x],
176
+ bottom: (p, x) => [p, a + h + x]
177
+ }[v], k = F ? i : a, $ = F ? i + m : a + h, M = B(
178
+ c,
179
+ k + d + n / 2 + L,
180
+ $ - d - n / 2 - L
181
+ ), b = ([p, x]) => `${p} ${x}`, w = n > 0 ? -n / 2 : 0, _ = 2, D = 2, I = M - d, s = M + d, W = S(I - _, w), z = S(I, w), g = S(s, w), y = S(s + _, w), E = S(I, -(n + D)), O = S(s, -(n + D)), A = S(I, 1), T = S(s, 1);
174
182
  return {
175
- fill: `M ${g(T)} L ${g(B)} L ${g(v)} L ${a} ${l} L ${g(L)} L ${g(I)} L ${g(M)} Z`,
176
- stroke: n ? `M ${g(z)} L ${g(v)} L ${a} ${l} L ${g(L)} L ${g(F)}` : null
183
+ fill: `M ${b(E)} L ${b(A)} L ${b(z)} L ${f} ${r} L ${b(g)} L ${b(T)} L ${b(O)} Z`,
184
+ stroke: n ? `M ${b(W)} L ${b(z)} L ${f} ${r} L ${b(g)} L ${b(y)}` : null
177
185
  };
178
186
  }
179
- const Lt = [
187
+ const At = [
180
188
  "left",
181
189
  "top",
182
190
  "right",
@@ -189,7 +197,7 @@ const Lt = [
189
197
  "inset-inline",
190
198
  "inset-block"
191
199
  ];
192
- function Ct(e) {
200
+ function Tt(e) {
193
201
  return {
194
202
  hasTarget: e,
195
203
  placement: "none",
@@ -204,16 +212,16 @@ function Ct(e) {
204
212
  boxZIndex: "auto"
205
213
  };
206
214
  }
207
- function D(e, t) {
215
+ function P(e, t) {
208
216
  return e === t ? !0 : !e || !t ? !1 : e.x === t.x && e.y === t.y;
209
217
  }
210
- function $t(e, t) {
218
+ function Mt(e, t) {
211
219
  return e === t ? !0 : !e || !t ? !1 : e.placement === t.placement && e.tx === t.tx && e.ty === t.ty && e.bx === t.bx && e.by === t.by && e.w === t.w && e.h === t.h;
212
220
  }
213
- function _t(e, t) {
214
- return e.hasTarget === t.hasTarget && e.placement === t.placement && e.boxFill === t.boxFill && e.boxStroke === t.boxStroke && e.boxStrokeWidth === t.boxStrokeWidth && e.boxZIndex === t.boxZIndex && D(e.tip, t.tip) && D(e.slotTip, t.slotTip) && j(e.boxStyle, t.boxStyle) && j(e.svgStyle, t.svgStyle) && e.tail?.fill === t.tail?.fill && e.tail?.stroke === t.tail?.stroke;
221
+ function zt(e, t) {
222
+ return e.hasTarget === t.hasTarget && e.placement === t.placement && e.boxFill === t.boxFill && e.boxStroke === t.boxStroke && e.boxStrokeWidth === t.boxStrokeWidth && e.boxZIndex === t.boxZIndex && P(e.tip, t.tip) && P(e.slotTip, t.slotTip) && j(e.boxStyle, t.boxStyle) && j(e.svgStyle, t.svgStyle) && e.tail?.fill === t.tail?.fill && e.tail?.stroke === t.tail?.stroke;
215
223
  }
216
- function K(e) {
224
+ function ot(e) {
217
225
  if (typeof e.checkVisibility == "function")
218
226
  return e.checkVisibility({
219
227
  checkOpacity: !0,
@@ -222,13 +230,13 @@ function K(e) {
222
230
  const t = getComputedStyle(e);
223
231
  return !(t.display === "none" || t.visibility === "hidden" || parseFloat(t.opacity) === 0);
224
232
  }
225
- function J(e) {
233
+ function it(e) {
226
234
  const t = e.style;
227
- return Lt.map((n) => t.getPropertyValue(n)).join("|");
235
+ return At.map((n) => t.getPropertyValue(n)).join("|");
228
236
  }
229
- function At(e) {
230
- gt();
231
- let t = { ...pt }, n = null, i = null, o = null, u = {
237
+ function It(e) {
238
+ vt();
239
+ let t = { ...xt }, n = null, l = null, o = null, u = {
232
240
  left: 0,
233
241
  top: 0,
234
242
  width: 0,
@@ -237,48 +245,48 @@ function At(e) {
237
245
  scaleY: 1,
238
246
  viewportWidth: 0,
239
247
  viewportHeight: 0
240
- }, a = null, l = null, r = null, f = null, p = null, m = null, k = Ct(!1), c = !1, C = "";
241
- const y = () => {
242
- const s = d();
243
- _t(k, s) || (k = s, e.onChange?.(k));
248
+ }, f = { ...u }, r = null, i = null, a = null, m = null, h = null, L = null, d = Tt(!1), B = !1, v = "";
249
+ const c = () => {
250
+ const s = F();
251
+ zt(d, s) || (d = s, e.onChange?.(d));
244
252
  };
245
- function d() {
246
- const s = t.target != null, b = t.placement === "manual", z = s ? a?.placement ?? "none" : "none", v = {
253
+ function F() {
254
+ const s = t.target != null, W = t.placement === "manual", z = s ? r?.placement ?? "none" : "none", g = {
247
255
  "--pb-padding": typeof t.padding == "number" ? `${t.padding}px` : t.padding
248
256
  };
249
- if (t.maxWidth != null && (v["--pb-max-width"] = `${t.maxWidth}px`), t.shadow && (v.filter = mt), !s)
250
- v["--pb-width"] = "fit-content";
251
- else if (Object.assign(v, {
257
+ if (t.maxWidth != null && (g["--pb-max-width"] = `${t.maxWidth}px`), t.shadow && (g.filter = wt), !s)
258
+ g["--pb-width"] = "fit-content";
259
+ else if (Object.assign(g, {
252
260
  position: "absolute",
253
261
  pointerEvents: "auto",
254
262
  overflow: "visible"
255
- }), b)
256
- v["--pb-width"] = "fit-content";
257
- else if (Object.assign(v, {
258
- left: `${a?.bx ?? 0}px`,
259
- top: `${a?.by ?? 0}px`,
263
+ }), W)
264
+ g["--pb-width"] = "fit-content";
265
+ else if (Object.assign(g, {
266
+ left: `${r?.bx ?? 0}px`,
267
+ top: `${r?.by ?? 0}px`,
260
268
  margin: "0"
261
269
  }), t.maxWidth == null && n) {
262
- const M = G(n, u, t.tailLength), B = l?.placement ?? t.placement, I = B === "auto" ? et(M) : B.split("-")[1];
263
- v["--pb-max-width"] = `${M[I]}px`;
270
+ const A = nt(n, f, t.tailLength), T = i?.placement ?? t.placement, p = T === "auto" ? rt(A) : T.split("-")[1];
271
+ g["--pb-max-width"] = `${A[p]}px`;
264
272
  }
265
- const L = o?.zIndex;
266
- L && L !== "auto" && (v.zIndex = L);
267
- const F = s && a && o ? Bt({
268
- geometry: a,
273
+ const y = o?.zIndex;
274
+ y && y !== "auto" && (g.zIndex = y);
275
+ const E = s && r && o ? _t({
276
+ geometry: r,
269
277
  strokeWidth: o.strokeWidth,
270
278
  radius: o.radius,
271
279
  tailBaseWidth: t.tailBaseWidth
272
280
  }) : null;
273
- let T = {};
274
- if (F && a && u.width && u.height) {
275
- const M = o?.borderLeft ?? 0, B = o?.borderTop ?? 0;
276
- T = {
281
+ let O = {};
282
+ if (E && r && f.width && f.height) {
283
+ const A = o?.borderLeft ?? 0, T = o?.borderTop ?? 0;
284
+ O = {
277
285
  position: "absolute",
278
- left: `${-a.bx - M}px`,
279
- top: `${-a.by - B}px`,
280
- width: `${u.width}px`,
281
- height: `${u.height}px`,
286
+ left: `${-r.bx - A}px`,
287
+ top: `${-r.by - T}px`,
288
+ width: `${f.width}px`,
289
+ height: `${f.height}px`,
282
290
  overflow: "visible",
283
291
  pointerEvents: "none",
284
292
  zIndex: o?.zIndex ?? "auto"
@@ -288,143 +296,153 @@ function At(e) {
288
296
  hasTarget: s,
289
297
  placement: z,
290
298
  tip: n,
291
- slotTip: l ? { x: l.tx, y: l.ty } : n,
292
- boxStyle: v,
293
- svgStyle: T,
294
- tail: F,
299
+ slotTip: i ? { x: i.tx, y: i.ty } : n,
300
+ boxStyle: g,
301
+ svgStyle: O,
302
+ tail: E,
295
303
  boxFill: o?.fill ?? "",
296
304
  boxStroke: o?.stroke ?? "",
297
305
  boxStrokeWidth: o?.strokeWidth ?? 0,
298
306
  boxZIndex: o?.zIndex ?? "auto"
299
307
  };
300
308
  }
301
- function _() {
309
+ function S() {
302
310
  if (!n || !o) {
303
- (l !== null || a !== null) && (l = null, w(null));
311
+ (i !== null || r !== null) && (i = null, k(null));
304
312
  return;
305
313
  }
306
- const s = G(n, u, t.tailLength), b = vt({
314
+ const s = nt(n, f, t.tailLength), W = Lt({
307
315
  tip: n,
308
316
  box: o,
309
- frame: u,
317
+ frame: f,
310
318
  placement: t.placement,
311
319
  targetAnchor: t.targetAnchor,
312
- targetRect: i,
320
+ targetRect: l,
313
321
  room: s,
314
322
  tailLength: t.tailLength
315
323
  });
316
- $t(l, b) || (l = b, w(l));
324
+ Mt(i, W) || (i = W, k(i));
317
325
  }
318
- function w(s) {
319
- r?.cancel(), r = Et(
320
- a,
326
+ function k(s) {
327
+ a?.cancel(), a = Ft(
328
+ r,
321
329
  s,
322
330
  t.transitionDuration,
323
- (b) => {
324
- a = b, y();
331
+ (W) => {
332
+ r = W, c();
325
333
  }
326
334
  );
327
335
  }
328
- function S(s) {
329
- const b = wt(s, u);
336
+ function $(s, W, z) {
337
+ const g = Et(s, u, W, z);
330
338
  return j(
331
- b,
339
+ g,
332
340
  o
333
- ) ? !1 : (o = b, !0);
341
+ ) ? !1 : (o = g, !0);
334
342
  }
335
- function W() {
343
+ function M() {
336
344
  const s = e.getBoxEl();
337
345
  if (!s) {
338
- n = null, i = null, o = null, l = null, a = null, c = !1, y();
346
+ n = null, l = null, o = null, i = null, r = null, B = !1, c();
339
347
  return;
340
348
  }
341
- if (!K(s)) {
342
- r?.cancel(), c = !0;
349
+ if (!ot(s)) {
350
+ a?.cancel(), B = !0;
343
351
  return;
344
352
  }
345
- const b = c;
346
- if (c = !1, t.target == null) {
347
- n = null, i = null, o = null, l = null, a = null, y();
353
+ const W = B;
354
+ if (B = !1, t.target == null) {
355
+ n = null, l = null, o = null, i = null, r = null, c();
348
356
  return;
349
357
  }
350
- const z = u;
351
- u = yt(s);
352
- const v = !j(
353
- u,
358
+ const z = f;
359
+ u = Wt(s);
360
+ const g = lt(s), y = q(g), E = q(s);
361
+ f = {
362
+ ...u,
363
+ left: u.left * y,
364
+ top: u.top * y,
365
+ width: u.width * y / E,
366
+ height: u.height * y / E,
367
+ scaleX: u.scaleX * E,
368
+ scaleY: u.scaleY * E
369
+ };
370
+ const O = !j(
371
+ f,
354
372
  z
355
- ), L = typeof t.target == "string" ? tt(s).querySelector(t.target) ?? Z(t.target) : Z(t.target);
356
- let F = !1, T = !1;
357
- if (L) {
358
- const B = L.getBoundingClientRect(), { scaleX: I, scaleY: x, left: h, top: O } = u, R = {
359
- left: (B.left - h) / I,
360
- top: (B.top - O) / x,
361
- right: (B.right - h) / I,
362
- bottom: (B.bottom - O) / x
373
+ ), A = typeof t.target == "string" ? g.querySelector(t.target) ?? et(t.target) : et(t.target);
374
+ let T = !1, p = !1;
375
+ if (A) {
376
+ const C = A.getBoundingClientRect(), N = q(A), { scaleX: U, scaleY: V, left: Z, top: G } = u, R = {
377
+ left: (C.left * N - Z * y) / (U * E),
378
+ top: (C.top * N - G * y) / (V * E),
379
+ right: (C.right * N - Z * y) / (U * E),
380
+ bottom: (C.bottom * N - G * y) / (V * E)
363
381
  };
364
- T = !j(
382
+ p = !j(
365
383
  R,
366
- i
367
- ), T && (i = R);
368
- const N = {
384
+ l
385
+ ), p && (l = R);
386
+ const K = {
369
387
  x: (R.left + R.right) / 2,
370
388
  y: (R.top + R.bottom) / 2
371
389
  };
372
- F = !D(n, N), n = N;
373
- } else if (bt(t.target)) {
374
- T = i != null, i = null;
375
- const B = { x: t.target.x, y: t.target.y };
376
- F = !D(n, B), n = B;
390
+ T = !P(n, K), n = K;
391
+ } else if (St(t.target)) {
392
+ p = l != null, l = null;
393
+ const C = { x: t.target.x, y: t.target.y };
394
+ T = !P(n, C), n = C;
377
395
  } else {
378
- n = null, i = null, o = null, l = null, a = null, y();
396
+ n = null, l = null, o = null, i = null, r = null, c();
379
397
  return;
380
398
  }
381
- const M = S(s);
382
- C = J(s), !(!b && !v && !F && !T && !M && a) && _();
399
+ const x = $(s, E, y);
400
+ v = it(s), !(!W && !O && !T && !p && !x && r) && S();
383
401
  }
384
- function $() {
385
- W();
402
+ function b() {
403
+ M();
386
404
  }
387
- typeof window < "u" && (window.addEventListener("resize", $), window.addEventListener("scroll", $, !0));
388
- const g = W;
389
- function E(s) {
390
- const b = e.getBoxEl();
391
- if (!b) return;
405
+ typeof window < "u" && (window.addEventListener("resize", b), window.addEventListener("scroll", b, !0));
406
+ const w = M;
407
+ function _(s) {
408
+ const W = e.getBoxEl();
409
+ if (!W) return;
392
410
  if (s.some(
393
- (L) => L.attributeName === "class" || L.attributeName === "hidden"
411
+ (y) => y.attributeName === "class" || y.attributeName === "hidden"
394
412
  )) {
395
- if (!K(b)) {
396
- r?.cancel(), c = !0;
413
+ if (!ot(W)) {
414
+ a?.cancel(), B = !0;
397
415
  return;
398
416
  }
399
- g();
417
+ w();
400
418
  return;
401
419
  }
402
- const v = J(b);
403
- v !== C && (C = v, g());
420
+ const g = it(W);
421
+ g !== v && (v = g, w());
404
422
  }
405
- function A() {
423
+ function D() {
406
424
  const s = e.getBoxEl();
407
- s !== m && (m = s, f?.disconnect(), p?.disconnect(), f = null, p = null, s && (typeof ResizeObserver < "u" && (f = new ResizeObserver(() => g()), f.observe(s)), typeof MutationObserver < "u" && (p = new MutationObserver(E), p.observe(s, {
425
+ s !== L && (L = s, m?.disconnect(), h?.disconnect(), m = null, h = null, s && (typeof ResizeObserver < "u" && (m = new ResizeObserver(() => w()), m.observe(s)), typeof MutationObserver < "u" && (h = new MutationObserver(_), h.observe(s, {
408
426
  attributes: !0,
409
427
  attributeFilter: ["style", "class", "hidden"]
410
428
  }))));
411
429
  }
412
- function P() {
413
- A(), g();
430
+ function I() {
431
+ D(), w();
414
432
  }
415
433
  return {
416
- update: P,
434
+ update: I,
417
435
  setConfig(s) {
418
- t = { ...t, ...s }, P();
436
+ t = { ...t, ...s }, I();
419
437
  },
420
438
  getConfig: () => t,
421
- getState: () => k,
439
+ getState: () => d,
422
440
  destroy() {
423
- r?.cancel(), f?.disconnect(), p?.disconnect(), m = null, typeof window < "u" && (window.removeEventListener("resize", $), window.removeEventListener("scroll", $, !0));
441
+ a?.cancel(), m?.disconnect(), h?.disconnect(), L = null, typeof window < "u" && (window.removeEventListener("resize", b), window.removeEventListener("scroll", b, !0));
424
442
  }
425
443
  };
426
444
  }
427
- const Tt = ["data-placement"], Ft = ["d", "fill"], Mt = ["d", "stroke", "stroke-width"], Q = /* @__PURE__ */ nt({
445
+ const Ot = ["data-placement"], Rt = ["d", "fill"], Yt = ["d", "stroke", "stroke-width"], Dt = /* @__PURE__ */ st({
428
446
  name: "PointingBubble",
429
447
  inheritAttrs: !1,
430
448
  __name: "PointingBubble",
@@ -440,10 +458,10 @@ const Tt = ["data-placement"], Ft = ["d", "fill"], Mt = ["d", "stroke", "stroke-
440
458
  transitionDuration: { default: 200 }
441
459
  },
442
460
  setup(e, { expose: t }) {
443
- const n = e, i = ot(), o = Y(() => i.class), u = Y(() => i.style), a = Y(() => {
444
- const { class: d, style: _, ...w } = i;
445
- return w;
446
- }), l = it(null), r = lt({
461
+ const n = e, l = at(), o = Y(() => l.class), u = Y(() => l.style), f = Y(() => {
462
+ const { class: c, style: F, ...S } = l;
463
+ return S;
464
+ }), r = ct(null), i = ut({
447
465
  hasTarget: !1,
448
466
  placement: "none",
449
467
  tip: null,
@@ -456,18 +474,18 @@ const Tt = ["data-placement"], Ft = ["d", "fill"], Mt = ["d", "stroke", "stroke-
456
474
  boxStrokeWidth: 0,
457
475
  boxZIndex: "auto"
458
476
  });
459
- function f(d) {
460
- return d == null ? null : typeof d == "string" || typeof Element < "u" && d instanceof Element ? d : typeof d == "object" && "$el" in d && d.$el instanceof Element ? d.$el : typeof d == "object" && typeof d.x == "number" && typeof d.y == "number" ? d : null;
477
+ function a(c) {
478
+ return c == null ? null : typeof c == "string" || typeof Element < "u" && c instanceof Element ? c : typeof c == "object" && "$el" in c && c.$el instanceof Element ? c.$el : typeof c == "object" && typeof c.x == "number" && typeof c.y == "number" ? c : null;
461
479
  }
462
- const p = rt(), m = At({
463
- getBoxEl: () => l.value,
464
- onChange: (d) => {
465
- Object.assign(r, d), p?.update();
480
+ const m = dt(), h = It({
481
+ getBoxEl: () => r.value,
482
+ onChange: (c) => {
483
+ Object.assign(i, c), m?.update();
466
484
  }
467
485
  });
468
- function k() {
469
- m.setConfig({
470
- target: f(n.target),
486
+ function L() {
487
+ h.setConfig({
488
+ target: a(n.target),
471
489
  placement: n.placement,
472
490
  targetAnchor: n.targetAnchor,
473
491
  maxWidth: n.maxWidth,
@@ -478,7 +496,7 @@ const Tt = ["data-placement"], Ft = ["d", "fill"], Mt = ["d", "stroke", "stroke-
478
496
  transitionDuration: n.transitionDuration
479
497
  });
480
498
  }
481
- st(
499
+ ft(
482
500
  () => [
483
501
  n.target,
484
502
  typeof n.target == "object" && n.target && "x" in n.target ? n.target.x : null,
@@ -492,78 +510,71 @@ const Tt = ["data-placement"], Ft = ["d", "fill"], Mt = ["d", "stroke", "stroke-
492
510
  n.shadow,
493
511
  n.transitionDuration
494
512
  ],
495
- k,
513
+ L,
496
514
  { flush: "post" }
497
- ), at(() => {
498
- k();
499
- }), ct(() => {
500
- m.destroy();
515
+ ), pt(() => {
516
+ L();
517
+ }), ht(() => {
518
+ h.destroy();
501
519
  });
502
- function c() {
503
- m.update();
520
+ function d() {
521
+ h.update();
504
522
  }
505
- t({ update: c });
506
- const C = Y(
523
+ t({ update: d });
524
+ const B = Y(
507
525
  () => ({
508
526
  ...u.value,
509
- ...r.boxStyle
527
+ ...i.boxStyle
510
528
  })
511
- ), y = Y(() => r.svgStyle);
512
- return (d, _) => (H(), q("div", ut({
529
+ ), v = Y(() => i.svgStyle);
530
+ return (c, F) => (X(), H("div", mt({
513
531
  ref_key: "rootRef",
514
- ref: l,
532
+ ref: r,
515
533
  class: ["pointing-bubble", "pointing-bubble__inner", o.value],
516
- "data-placement": r.placement
517
- }, a.value, { style: C.value }), [
518
- dt(d.$slots, "default", {
519
- placement: r.placement,
520
- tip: r.slotTip
534
+ "data-placement": i.placement
535
+ }, f.value, { style: B.value }), [
536
+ gt(c.$slots, "default", {
537
+ placement: i.placement,
538
+ tip: i.slotTip
521
539
  }, () => [
522
- _[0] || (_[0] = X("p", { style: {
540
+ F[0] || (F[0] = J("p", { style: {
523
541
  margin: 0,
524
542
  fontSize: "14px",
525
543
  fontWeight: 600,
526
544
  color: "#1e293b"
527
545
  } }, " Callout content ", -1))
528
546
  ]),
529
- e.target && r.tail ? (H(), q("svg", {
547
+ e.target && i.tail ? (X(), H("svg", {
530
548
  key: 0,
531
549
  class: "pointing-bubble__svg",
532
- style: ft(y.value)
550
+ style: bt(v.value)
533
551
  }, [
534
- X("path", {
552
+ J("path", {
535
553
  class: "pointing-bubble__path",
536
- d: r.tail.fill,
537
- fill: r.boxFill
538
- }, null, 8, Ft),
539
- r.tail.stroke ? (H(), q("path", {
554
+ d: i.tail.fill,
555
+ fill: i.boxFill
556
+ }, null, 8, Rt),
557
+ i.tail.stroke ? (X(), H("path", {
540
558
  key: 0,
541
559
  class: "pointing-bubble__path",
542
- d: r.tail.stroke,
560
+ d: i.tail.stroke,
543
561
  fill: "none",
544
- stroke: r.boxStroke,
545
- "stroke-width": r.boxStrokeWidth,
562
+ stroke: i.boxStroke,
563
+ "stroke-width": i.boxStrokeWidth,
546
564
  "stroke-linejoin": "round",
547
565
  "stroke-linecap": "butt"
548
- }, null, 8, Mt)) : U("", !0)
549
- ], 4)) : U("", !0)
550
- ], 16, Tt));
551
- }
552
- }), It = {
553
- install(e, t = {}) {
554
- const n = t.name ?? "PointingBubble";
555
- e.component(n, Q), e.component("Callout", Q);
566
+ }, null, 8, Yt)) : Q("", !0)
567
+ ], 4)) : Q("", !0)
568
+ ], 16, Ot));
556
569
  }
557
- };
570
+ });
558
571
  export {
559
- Q as Callout,
560
- pt as DEFAULT_BUBBLE_CONFIG,
561
- Q as PointingBubble,
562
- It as PointingBubblePlugin,
563
- Bt as buildTailPaths,
564
- vt as computeGeometry,
565
- At as createBubbleController,
566
- Q as default,
567
- bt as isPoint,
568
- Z as resolveElement
572
+ xt as DEFAULT_BUBBLE_CONFIG,
573
+ Dt as PointingBubble,
574
+ _t as buildTailPaths,
575
+ Lt as computeGeometry,
576
+ It as createBubbleController,
577
+ Dt as default,
578
+ St as isPoint,
579
+ et as resolveElement
569
580
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-pointing-bubble",
3
- "version": "0.5.2",
3
+ "version": "0.6.1",
4
4
  "description": "Vue 3 callout / speech bubble whose SVG tail points exactly at coordinates or a DOM element.",
5
5
  "type": "module",
6
6
  "sideEffects": false,