proto-float-wc 0.1.88 → 0.1.90
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/cjs/{index-DaUiRF-a.js → index-BBv8QqQs.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/proto-float-wc.cjs.js +2 -2
- package/dist/cjs/proto-floater-demo.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/esm/{index-wT1ZHNJv.js → index-D3NxIFzo.js} +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/proto-float-wc.js +3 -3
- package/dist/esm/proto-floater-demo.entry.js +1 -1
- package/dist/proto-float-wc/{p-25fc3bfa.entry.js → p-be4e597a.entry.js} +1 -1
- package/dist/proto-float-wc/proto-float-wc.esm.js +1 -1
- package/package.json +3 -3
- /package/dist/proto-float-wc/{p-wT1ZHNJv.js → p-D3NxIFzo.js} +0 -0
|
@@ -4,7 +4,7 @@ const NAMESPACE = 'proto-float-wc';
|
|
|
4
4
|
const BUILD = /* proto-float-wc */ { hotModuleReplacement: false, hydratedSelectorName: "hydrated", lazyLoad: true, propChangeCallback: false, state: true, updatable: true};
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
|
-
Stencil Client Platform v4.
|
|
7
|
+
Stencil Client Platform v4.43.0 | MIT Licensed | https://stenciljs.com
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
var reWireGetterSetter = (instance, hostRef) => {
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-BBv8QqQs.js');
|
|
4
4
|
var appGlobals = require('./app-globals-V2Kpy_OQ.js');
|
|
5
5
|
|
|
6
6
|
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
7
7
|
/*
|
|
8
|
-
Stencil Client Patch Browser v4.
|
|
8
|
+
Stencil Client Patch Browser v4.43.0 | MIT Licensed | https://stenciljs.com
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
var patchBrowser = () => {
|
|
@@ -2,7 +2,7 @@ const NAMESPACE = 'proto-float-wc';
|
|
|
2
2
|
const BUILD = /* proto-float-wc */ { hotModuleReplacement: false, hydratedSelectorName: "hydrated", lazyLoad: true, propChangeCallback: false, state: true, updatable: true};
|
|
3
3
|
|
|
4
4
|
/*
|
|
5
|
-
Stencil Client Platform v4.
|
|
5
|
+
Stencil Client Platform v4.43.0 | MIT Licensed | https://stenciljs.com
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
var reWireGetterSetter = (instance, hostRef) => {
|
package/dist/esm/loader.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b as bootstrapLazy } from './index-
|
|
2
|
-
export { s as setNonce } from './index-
|
|
1
|
+
import { b as bootstrapLazy } from './index-D3NxIFzo.js';
|
|
2
|
+
export { s as setNonce } from './index-D3NxIFzo.js';
|
|
3
3
|
import { g as globalScripts } from './app-globals-DQuL1Twl.js';
|
|
4
4
|
|
|
5
5
|
const defineCustomElements = async (win, options) => {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
2
|
-
export { s as setNonce } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-D3NxIFzo.js';
|
|
2
|
+
export { s as setNonce } from './index-D3NxIFzo.js';
|
|
3
3
|
import { g as globalScripts } from './app-globals-DQuL1Twl.js';
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
|
-
Stencil Client Patch Browser v4.
|
|
6
|
+
Stencil Client Patch Browser v4.43.0 | MIT Licensed | https://stenciljs.com
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
var patchBrowser = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,h as e}from"./p-wT1ZHNJv.js";const n=Math.min,o=Math.max,i=Math.round,r=t=>({x:t,y:t}),s={left:"right",right:"left",bottom:"top",top:"bottom"},a={start:"end",end:"start"};function l(t,e,i){return o(t,n(e,i))}function c(t,e){return"function"==typeof t?t(e):t}function f(t){return t.split("-")[0]}function u(t){return t.split("-")[1]}function d(t){return"x"===t?"y":"x"}function h(t){return"y"===t?"height":"width"}const p=new Set(["top","bottom"]);function m(t){return p.has(f(t))?"y":"x"}function y(t){return d(m(t))}function g(t){return t.replace(/start|end/g,(t=>a[t]))}const w=["left","right"],x=["right","left"],b=["top","bottom"],v=["bottom","top"];function k(t){return t.replace(/left|right|bottom|top/g,(t=>s[t]))}function S(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function A(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function C(t,e,n){let{reference:o,floating:i}=t;const r=m(e),s=y(e),a=h(s),l=f(e),c="y"===r,d=o.x+o.width/2-i.width/2,p=o.y+o.height/2-i.height/2,g=o[a]/2-i[a]/2;let w;switch(l){case"top":w={x:d,y:o.y-i.height};break;case"bottom":w={x:d,y:o.y+o.height};break;case"right":w={x:o.x+o.width,y:p};break;case"left":w={x:o.x-i.width,y:p};break;default:w={x:o.x,y:o.y}}switch(u(e)){case"start":w[s]-=g*(n&&c?-1:1);break;case"end":w[s]+=g*(n&&c?-1:1)}return w}async function D(t,e){var n;void 0===e&&(e={});const{x:o,y:i,platform:r,rects:s,elements:a,strategy:l}=t,{boundary:f="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:p=0}=c(e,t),m=S(p),y=a[h?"floating"===d?"reference":"floating":d],g=A(await r.getClippingRect({element:null==(n=await(null==r.isElement?void 0:r.isElement(y)))||n?y:y.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(a.floating)),boundary:f,rootBoundary:u,strategy:l})),w="floating"===d?{x:o,y:i,width:s.floating.width,height:s.floating.height}:s.reference,x=await(null==r.getOffsetParent?void 0:r.getOffsetParent(a.floating)),b=await(null==r.isElement?void 0:r.isElement(x))&&await(null==r.getScale?void 0:r.getScale(x))||{x:1,y:1},v=A(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:x,strategy:l}):w);return{top:(g.top-v.top+m.top)/b.y,bottom:(v.bottom-g.bottom+m.bottom)/b.y,left:(g.left-v.left+m.left)/b.x,right:(v.right-g.right+m.right)/b.x}}const R=new Set(["left","top"]);function F(){return"undefined"!=typeof window}function L(t){return P(t)?(t.nodeName||"").toLowerCase():"#document"}function T(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function O(t){var e;return null==(e=(P(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function P(t){return!!F()&&(t instanceof Node||t instanceof T(t).Node)}function $(t){return!!F()&&(t instanceof Element||t instanceof T(t).Element)}function E(t){return!!F()&&(t instanceof HTMLElement||t instanceof T(t).HTMLElement)}function M(t){return!(!F()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof T(t).ShadowRoot)}const j=new Set(["inline","contents"]);function B(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=Y(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!j.has(i)}const H=new Set(["table","td","th"]);function N(t){return H.has(L(t))}const _=[":popover-open",":modal"];function z(t){return _.some((e=>{try{return t.matches(e)}catch(t){return!1}}))}const q=["transform","translate","scale","rotate","perspective"],I=["transform","translate","scale","rotate","perspective","filter"],J=["paint","layout","strict","content"];function U(t){const e=V(),n=$(t)?Y(t):t;return q.some((t=>!!n[t]&&"none"!==n[t]))||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||I.some((t=>(n.willChange||"").includes(t)))||J.some((t=>(n.contain||"").includes(t)))}function V(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const W=new Set(["html","body","#document"]);function X(t){return W.has(L(t))}function Y(t){return T(t).getComputedStyle(t)}function Z(t){return $(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function G(t){if("html"===L(t))return t;const e=t.assignedSlot||t.parentNode||M(t)&&t.host||O(t);return M(e)?e.host:e}function K(t){const e=G(t);return X(e)?t.ownerDocument?t.ownerDocument.body:t.body:E(e)&&B(e)?e:K(e)}function Q(t,e){var n;void 0===e&&(e=[]);const o=K(t),i=o===(null==(n=t.ownerDocument)?void 0:n.body),r=T(o);return i?e.concat(r,r.visualViewport||[],B(o)?o:[],[]):e.concat(o,Q(o,[]))}function tt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function et(t){const e=Y(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const r=E(t),s=r?t.offsetWidth:n,a=r?t.offsetHeight:o,l=i(n)!==s||i(o)!==a;return l&&(n=s,o=a),{width:n,height:o,$:l}}function nt(t){return $(t)?t:t.contextElement}function ot(t){const e=nt(t);if(!E(e))return r(1);const n=e.getBoundingClientRect(),{width:o,height:s,$:a}=et(e);let l=(a?i(n.width):n.width)/o,c=(a?i(n.height):n.height)/s;return l&&Number.isFinite(l)||(l=1),c&&Number.isFinite(c)||(c=1),{x:l,y:c}}const it=r(0);function rt(t){const e=T(t);return V()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:it}function st(t,e,n,o){void 0===e&&(e=!1),void 0===n&&(n=!1);const i=t.getBoundingClientRect(),s=nt(t);let a=r(1);e&&(o?$(o)&&(a=ot(o)):a=ot(t));const l=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==T(t))&&e}(s,n,o)?rt(s):r(0);let c=(i.left+l.x)/a.x,f=(i.top+l.y)/a.y,u=i.width/a.x,d=i.height/a.y;if(s){const t=T(s),e=o&&$(o)?T(o):o;let n=t,i=tt(n);for(;i&&o&&e!==n;){const t=ot(i),e=i.getBoundingClientRect(),o=Y(i),r=e.left+(i.clientLeft+parseFloat(o.paddingLeft))*t.x,s=e.top+(i.clientTop+parseFloat(o.paddingTop))*t.y;c*=t.x,f*=t.y,u*=t.x,d*=t.y,c+=r,f+=s,n=T(i),i=tt(n)}}return A({width:u,height:d,x:c,y:f})}function at(t,e){const n=Z(t).scrollLeft;return e?e.left+n:st(O(t)).left+n}function lt(t,e){const n=t.getBoundingClientRect();return{x:n.left+e.scrollLeft-at(t,n),y:n.top+e.scrollTop}}const ct=new Set(["absolute","fixed"]);function ft(t,e,n){let i;if("viewport"===e)i=function(t,e){const n=T(t),o=O(t),i=n.visualViewport;let r=o.clientWidth,s=o.clientHeight,a=0,l=0;if(i){r=i.width,s=i.height;const t=V();(!t||t&&"fixed"===e)&&(a=i.offsetLeft,l=i.offsetTop)}const c=at(o);if(c<=0){const t=o.ownerDocument,e=t.body,n=getComputedStyle(e),i="CSS1Compat"===t.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,s=Math.abs(o.clientWidth-e.clientWidth-i);s<=25&&(r-=s)}else c<=25&&(r+=c);return{width:r,height:s,x:a,y:l}}(t,n);else if("document"===e)i=function(t){const e=O(t),n=Z(t),i=t.ownerDocument.body,r=o(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),s=o(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let a=-n.scrollLeft+at(t);const l=-n.scrollTop;return"rtl"===Y(i).direction&&(a+=o(e.clientWidth,i.clientWidth)-r),{width:r,height:s,x:a,y:l}}(O(t));else if($(e))i=function(t,e){const n=st(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,s=E(t)?ot(t):r(1);return{width:t.clientWidth*s.x,height:t.clientHeight*s.y,x:i*s.x,y:o*s.y}}(e,n);else{const n=rt(t);i={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return A(i)}function ut(t,e){const n=G(t);return!(n===e||!$(n)||X(n))&&("fixed"===Y(n).position||ut(n,e))}function dt(t,e,n){const o=E(e),i=O(e),s="fixed"===n,a=st(t,!0,s,e);let l={scrollLeft:0,scrollTop:0};const c=r(0);function f(){c.x=at(i)}if(o||!o&&!s)if(("body"!==L(e)||B(i))&&(l=Z(e)),o){const t=st(e,!0,s,e);c.x=t.x+e.clientLeft,c.y=t.y+e.clientTop}else i&&f();s&&!o&&i&&f();const u=!i||o||s?r(0):lt(i,l);return{x:a.left+l.scrollLeft-c.x-u.x,y:a.top+l.scrollTop-c.y-u.y,width:a.width,height:a.height}}function ht(t){return"static"===Y(t).position}function pt(t,e){if(!E(t)||"fixed"===Y(t).position)return null;if(e)return e(t);let n=t.offsetParent;return O(t)===n&&(n=n.ownerDocument.body),n}function mt(t,e){const n=T(t);if(z(t))return n;if(!E(t)){let e=G(t);for(;e&&!X(e);){if($(e)&&!ht(e))return e;e=G(e)}return n}let o=pt(t,e);for(;o&&N(o)&&ht(o);)o=pt(o,e);return o&&X(o)&&ht(o)&&!U(o)?n:o||function(t){let e=G(t);for(;E(e)&&!X(e);){if(U(e))return e;if(z(e))return null;e=G(e)}return null}(t)||n}const yt={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const s="fixed"===i,a=O(o),l=!!e&&z(e.floating);if(o===a||l&&s)return n;let c={scrollLeft:0,scrollTop:0},f=r(1);const u=r(0),d=E(o);if((d||!d&&!s)&&(("body"!==L(o)||B(a))&&(c=Z(o)),E(o))){const t=st(o);f=ot(o),u.x=t.x+o.clientLeft,u.y=t.y+o.clientTop}const h=!a||d||s?r(0):lt(a,c);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-c.scrollLeft*f.x+u.x+h.x,y:n.y*f.y-c.scrollTop*f.y+u.y+h.y}},getDocumentElement:O,getClippingRect:function(t){let{element:e,boundary:i,rootBoundary:r,strategy:s}=t;const a=[..."clippingAncestors"===i?z(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let o=Q(t,[]).filter((t=>$(t)&&"body"!==L(t))),i=null;const r="fixed"===Y(t).position;let s=r?G(t):t;for(;$(s)&&!X(s);){const e=Y(s),n=U(s);n||"fixed"!==e.position||(i=null),(r?!n&&!i:!n&&"static"===e.position&&i&&ct.has(i.position)||B(s)&&!n&&ut(t,s))?o=o.filter((t=>t!==s)):i=e,s=G(s)}return e.set(t,o),o}(e,this._c):[].concat(i),r],l=a.reduce(((t,i)=>{const r=ft(e,i,s);return t.top=o(r.top,t.top),t.right=n(r.right,t.right),t.bottom=n(r.bottom,t.bottom),t.left=o(r.left,t.left),t}),ft(e,a[0],s));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:mt,getElementRects:async function(t){const e=this.getOffsetParent||mt,n=this.getDimensions,o=await n(t.floating);return{reference:dt(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:n}=et(t);return{width:e,height:n}},getScale:ot,isElement:$,isRTL:function(t){return"rtl"===Y(t).direction}},gt=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i,platform:r}=e,{mainAxis:s=!0,crossAxis:a=!1,limiter:u={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...h}=c(t,e),p={x:n,y:o},y=await r.detectOverflow(e,h),g=m(f(i)),w=d(g);let x=p[w],b=p[g];s&&(x=l(x+y["y"===w?"top":"left"],x,x-y["y"===w?"bottom":"right"])),a&&(b=l(b+y["y"===g?"top":"left"],b,b-y["y"===g?"bottom":"right"]));const v=u.fn({...e,[w]:x,[g]:b});return{...v,data:{x:v.x-n,y:v.y-o,enabled:{[w]:s,[g]:a}}}}}},wt=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:r,rects:s,initialPlacement:a,platform:l,elements:d}=e,{mainAxis:p=!0,crossAxis:S=!0,fallbackPlacements:A,fallbackStrategy:C="bestFit",fallbackAxisSideDirection:D="none",flipAlignment:R=!0,...F}=c(t,e);if(null!=(n=r.arrow)&&n.alignmentOffset)return{};const L=f(i),T=m(a),O=f(a)===a,P=await(null==l.isRTL?void 0:l.isRTL(d.floating)),$=A||(O||!R?[k(a)]:function(t){const e=k(t);return[g(t),e,g(e)]}(a)),E="none"!==D;!A&&E&&$.push(...function(t,e,n,o){const i=u(t);let r=function(t,e,n){switch(t){case"top":case"bottom":return n?e?x:w:e?w:x;case"left":case"right":return e?b:v;default:return[]}}(f(t),"start"===n,o);return i&&(r=r.map((t=>t+"-"+i)),e&&(r=r.concat(r.map(g)))),r}(a,R,D,P));const M=[a,...$],j=await l.detectOverflow(e,F),B=[];let H=(null==(o=r.flip)?void 0:o.overflows)||[];if(p&&B.push(j[L]),S){const t=function(t,e,n){void 0===n&&(n=!1);const o=u(t),i=y(t),r=h(i);let s="x"===i?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=k(s)),[s,k(s)]}(i,s,P);B.push(j[t[0]],j[t[1]])}if(H=[...H,{placement:i,overflows:B}],!B.every((t=>t<=0))){var N,_;const t=((null==(N=r.flip)?void 0:N.index)||0)+1,e=M[t];if(e&&("alignment"!==S||T===m(e)||H.every((t=>m(t.placement)!==T||t.overflows[0]>0))))return{data:{index:t,overflows:H},reset:{placement:e}};let n=null==(_=H.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:_.placement;if(!n)switch(C){case"bestFit":{var z;const t=null==(z=H.filter((t=>{if(E){const e=m(t.placement);return e===T||"y"===e}return!0})).map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:z[0];t&&(n=t);break}case"initialPlacement":n=a}if(i!==n)return{reset:{placement:n}}}return{}}}},xt=t=>({name:"arrow",options:t,async fn(e){const{x:o,y:i,placement:r,rects:s,platform:a,elements:f,middlewareData:d}=e,{element:p,padding:m=0}=c(t,e)||{};if(null==p)return{};const g=S(m),w={x:o,y:i},x=y(r),b=h(x),v=await a.getDimensions(p),k="y"===x,A=k?"top":"left",C=k?"bottom":"right",D=k?"clientHeight":"clientWidth",R=s.reference[b]+s.reference[x]-w[x]-s.floating[b],F=w[x]-s.reference[x],L=await(null==a.getOffsetParent?void 0:a.getOffsetParent(p));let T=L?L[D]:0;T&&await(null==a.isElement?void 0:a.isElement(L))||(T=f.floating[D]||s.floating[b]);const O=R/2-F/2,P=T/2-v[b]/2-1,$=n(g[A],P),E=n(g[C],P),M=$,j=T-v[b]-E,B=T/2-v[b]/2+O,H=l(M,B,j),N=!d.arrow&&null!=u(r)&&B!==H&&s.reference[b]/2-(B<M?$:E)-v[b]/2<0,_=N?B<M?B-M:B-j:0;return{[x]:w[x]+_,data:{[x]:H,centerOffset:B-H-_,...N&&{alignmentOffset:_}},reset:N}}}),bt="Checking...",vt=class{constructor(e){t(this,e),this.vin=void 0,this.snapshot=void 0,this.label=bt,this.failed=!0,this.loaded=!1,this.time=void 0,this.eventBus=window.eventBus,this.message=void 0,this.nanoId=((t=21)=>{let e="",n=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&n[t]];return e})(),this.messageHandler=t=>{const{origin:e,data:n}=t,{targetId:o}=n;if(console.log("-- messageHandler:",n,e),"http://localhost:3000"===e&&o===this.nanoId)if(void 0===this.message){if(n.type&&"resize-iframe"===n.type){this.iframe.style.width=n.payload.width+"px",this.iframe.style.height=n.payload.height+"px",this.iframe.style.display="block",this.loaded=!0,this.label="",this.message=n;const{vin:t,snapshot:e}=this;this.iframe&&this.iframe.contentWindow.postMessage({targetId:this.nanoId,type:"data-payload",payload:{vin:t,snapshot:e}},"*"),this.update()}}else this.hideTooltip()},this.register=()=>{this.eventBus.emit("activate",this.nanoId),window.addEventListener("message",this.messageHandler,!1)},this.unregister=()=>{window.removeEventListener("message",this.messageHandler)},this.update=()=>{const{target:t,tooltip:e,arrowEl:n}=this;var o;((t,e,n)=>{const o=new Map,i={platform:yt,...n},r={...i.platform,_c:o};return(async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:s}=n,a=r.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:u}=C(c,o,l),d=o,h={},p=0;for(let n=0;n<a.length;n++){var m;const{name:r,fn:y}=a[n],{x:g,y:w,data:x,reset:b}=await y({x:f,y:u,initialPlacement:o,placement:d,strategy:i,middlewareData:h,rects:c,platform:{...s,detectOverflow:null!=(m=s.detectOverflow)?m:D},elements:{reference:t,floating:e}});f=null!=g?g:f,u=null!=w?w:u,h={...h,[r]:{...h[r],...x}},b&&p<=50&&(p++,"object"==typeof b&&(b.placement&&(d=b.placement),b.rects&&(c=!0===b.rects?await s.getElementRects({reference:t,floating:e,strategy:i}):b.rects),({x:f,y:u}=C(c,d,l))),n=-1)}return{x:f,y:u,placement:d,strategy:i,middlewareData:h}})(t,e,{...i,platform:r})})(t,e,{placement:"right",middleware:[(o=6,void 0===o&&(o=0),{name:"offset",options:o,async fn(t){var e,n;const{x:i,y:r,placement:s,middlewareData:a}=t,l=await async function(t,e){const{placement:n,platform:o,elements:i}=t,r=await(null==o.isRTL?void 0:o.isRTL(i.floating)),s=f(n),a=u(n),l="y"===m(n),d=R.has(s)?-1:1,h=r&&l?-1:1,p=c(e,t);let{mainAxis:y,crossAxis:g,alignmentAxis:w}="number"==typeof p?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return a&&"number"==typeof w&&(g="end"===a?-1*w:w),l?{x:g*h,y:y*d}:{x:y*d,y:g*h}}(t,o);return s===(null==(e=a.offset)?void 0:e.placement)&&null!=(n=a.arrow)&&n.alignmentOffset?{}:{x:i+l.x,y:r+l.y,data:{...l,placement:s}}}}),wt(),gt({padding:5}),xt({element:n})]}).then((({x:t,y:o,placement:i,middlewareData:r})=>{Object.assign(e.style,{left:`${t}px`,top:`${o}px`});const{x:s,y:a}=r.arrow,l={top:"bottom",right:"left",bottom:"top",left:"right"}[i.split("-")[0]];Object.assign(n.style,{left:null!=s?`${s}px`:"",top:null!=a?`${a}px`:"",right:"",bottom:"",[l]:"-4px"})}))},this.onIframeLoad=()=>{this.update(),setTimeout((()=>{this.loaded||(this.label="Content Failed to Load...")}),3e3)},this.hideTooltip=()=>{this.iframe.style.display="",this.tooltip.style.display="",this.message=void 0,this.unregister()},this.showTooltip=()=>{this.register(),this.loaded=!1,this.label=bt,this.loaded=!1,this.time=Date.now(),this.tooltip.style.display="block",this.update()},this.clickHandler=()=>{"block"===this.tooltip.style.display?this.hideTooltip():this.showTooltip()}}componentDidLoad(){this.eventBus.on("activate",(t=>{this.nanoId!==t&&(void 0!==this.message||"block"===this.tooltip.style.display)&&this.hideTooltip()})),this.update()}render(){const t=`http://localhost:3000/demo_iframe.html?q=${this.time}&nid=${this.nanoId}`;return e("div",{key:"1da684903d9253b204641b4184bc5e1f79326405",id:"root"},e("div",{key:"84665f15de5991870ad2a16f42f1984789f4631f",id:"target",ref:t=>this.target=t,onClick:()=>this.clickHandler()},"i"),e("div",{key:"178c42dc946b455c8873e06d481a93d095a2e752",id:"tooltip",role:"tooltip",ref:t=>this.tooltip=t},e("div",{key:"75921e81ce12a64df3500d1492b6d782ff2881e3"},this.label),this.time?e("iframe",{id:"content",src:t,ref:t=>this.iframe=t,onLoad:t=>this.onIframeLoad(t)}):"",e("div",{key:"99722c505d254559b6a89a3d173c0925b12e53be",id:"arrow",ref:t=>this.arrowEl=t})))}};vt.style="#root{--clrs-navy:#001f3f;--clrs-blue:#0074d9;--clrs-aqua:#7fdbff;--clrs-teal:#39cccc;--clrs-olive:#3d9970;--clrs-green:#2ecc40;--clrs-lime:#01ff70;--clrs-yellow:#ffdc00;--clrs-orange:#ff851b;--clrs-red:#ff4136;--clrs-maroon:#85144b;--clrs-fuchsia:#f012be;--clrs-purple:#b10dc9;--clrs-black:#111111;--clrs-gray:#aaaaaa;--clrs-silver:#dddddd;--clrs-bada55:#bada55;--clrs-slate:#708090;--clrs-slate4:#4e5964;--clrs-white:#ffffff}#target{width:24px;height:24px;line-height:24px;text-align:center;border-radius:12px;background:var(--clrs-blue);font-weight:bold;font-size:120%;color:var(--clrs-white);cursor:pointer}#tooltip{display:none;position:absolute;min-height:18px;background:var(--clrs-navy);color:var(--clrs-white);font-weight:bold;padding:5px;padding-right:10px;padding-left:10px;border-radius:4px;font-size:90%;pointer-events:none}#arrow{position:absolute;background:var(--clrs-navy);width:8px;height:8px;transform:rotate(45deg)}#content{display:none;border:none}";export{vt as proto_floater_demo}
|
|
1
|
+
import{r as t,h as e}from"./p-D3NxIFzo.js";const n=Math.min,o=Math.max,i=Math.round,r=t=>({x:t,y:t}),s={left:"right",right:"left",bottom:"top",top:"bottom"},a={start:"end",end:"start"};function l(t,e,i){return o(t,n(e,i))}function c(t,e){return"function"==typeof t?t(e):t}function f(t){return t.split("-")[0]}function u(t){return t.split("-")[1]}function d(t){return"x"===t?"y":"x"}function h(t){return"y"===t?"height":"width"}const p=new Set(["top","bottom"]);function m(t){return p.has(f(t))?"y":"x"}function y(t){return d(m(t))}function g(t){return t.replace(/start|end/g,(t=>a[t]))}const w=["left","right"],x=["right","left"],b=["top","bottom"],v=["bottom","top"];function k(t){return t.replace(/left|right|bottom|top/g,(t=>s[t]))}function S(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function A(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function C(t,e,n){let{reference:o,floating:i}=t;const r=m(e),s=y(e),a=h(s),l=f(e),c="y"===r,d=o.x+o.width/2-i.width/2,p=o.y+o.height/2-i.height/2,g=o[a]/2-i[a]/2;let w;switch(l){case"top":w={x:d,y:o.y-i.height};break;case"bottom":w={x:d,y:o.y+o.height};break;case"right":w={x:o.x+o.width,y:p};break;case"left":w={x:o.x-i.width,y:p};break;default:w={x:o.x,y:o.y}}switch(u(e)){case"start":w[s]-=g*(n&&c?-1:1);break;case"end":w[s]+=g*(n&&c?-1:1)}return w}async function D(t,e){var n;void 0===e&&(e={});const{x:o,y:i,platform:r,rects:s,elements:a,strategy:l}=t,{boundary:f="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:p=0}=c(e,t),m=S(p),y=a[h?"floating"===d?"reference":"floating":d],g=A(await r.getClippingRect({element:null==(n=await(null==r.isElement?void 0:r.isElement(y)))||n?y:y.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(a.floating)),boundary:f,rootBoundary:u,strategy:l})),w="floating"===d?{x:o,y:i,width:s.floating.width,height:s.floating.height}:s.reference,x=await(null==r.getOffsetParent?void 0:r.getOffsetParent(a.floating)),b=await(null==r.isElement?void 0:r.isElement(x))&&await(null==r.getScale?void 0:r.getScale(x))||{x:1,y:1},v=A(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:x,strategy:l}):w);return{top:(g.top-v.top+m.top)/b.y,bottom:(v.bottom-g.bottom+m.bottom)/b.y,left:(g.left-v.left+m.left)/b.x,right:(v.right-g.right+m.right)/b.x}}const F=new Set(["left","top"]);function R(){return"undefined"!=typeof window}function L(t){return T(t)?(t.nodeName||"").toLowerCase():"#document"}function O(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function P(t){var e;return null==(e=(T(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function T(t){return!!R()&&(t instanceof Node||t instanceof O(t).Node)}function $(t){return!!R()&&(t instanceof Element||t instanceof O(t).Element)}function E(t){return!!R()&&(t instanceof HTMLElement||t instanceof O(t).HTMLElement)}function M(t){return!(!R()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof O(t).ShadowRoot)}const j=new Set(["inline","contents"]);function B(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=G(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!j.has(i)}const z=new Set(["table","td","th"]);function N(t){return z.has(L(t))}const _=[":popover-open",":modal"];function H(t){return _.some((e=>{try{return t.matches(e)}catch(t){return!1}}))}const I=["transform","translate","scale","rotate","perspective"],q=["transform","translate","scale","rotate","perspective","filter"],U=["paint","layout","strict","content"];function V(t){const e=W(),n=$(t)?G(t):t;return I.some((t=>!!n[t]&&"none"!==n[t]))||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||q.some((t=>(n.willChange||"").includes(t)))||U.some((t=>(n.contain||"").includes(t)))}function W(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const X=new Set(["html","body","#document"]);function Y(t){return X.has(L(t))}function G(t){return O(t).getComputedStyle(t)}function J(t){return $(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function K(t){if("html"===L(t))return t;const e=t.assignedSlot||t.parentNode||M(t)&&t.host||P(t);return M(e)?e.host:e}function Q(t){const e=K(t);return Y(e)?t.ownerDocument?t.ownerDocument.body:t.body:E(e)&&B(e)?e:Q(e)}function Z(t,e){var n;void 0===e&&(e=[]);const o=Q(t),i=o===(null==(n=t.ownerDocument)?void 0:n.body),r=O(o);return i?e.concat(r,r.visualViewport||[],B(o)?o:[],[]):e.concat(o,Z(o,[]))}function tt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function et(t){const e=G(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const r=E(t),s=r?t.offsetWidth:n,a=r?t.offsetHeight:o,l=i(n)!==s||i(o)!==a;return l&&(n=s,o=a),{width:n,height:o,$:l}}function nt(t){return $(t)?t:t.contextElement}function ot(t){const e=nt(t);if(!E(e))return r(1);const n=e.getBoundingClientRect(),{width:o,height:s,$:a}=et(e);let l=(a?i(n.width):n.width)/o,c=(a?i(n.height):n.height)/s;return l&&Number.isFinite(l)||(l=1),c&&Number.isFinite(c)||(c=1),{x:l,y:c}}const it=r(0);function rt(t){const e=O(t);return W()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:it}function st(t,e,n,o){void 0===e&&(e=!1),void 0===n&&(n=!1);const i=t.getBoundingClientRect(),s=nt(t);let a=r(1);e&&(o?$(o)&&(a=ot(o)):a=ot(t));const l=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==O(t))&&e}(s,n,o)?rt(s):r(0);let c=(i.left+l.x)/a.x,f=(i.top+l.y)/a.y,u=i.width/a.x,d=i.height/a.y;if(s){const t=O(s),e=o&&$(o)?O(o):o;let n=t,i=tt(n);for(;i&&o&&e!==n;){const t=ot(i),e=i.getBoundingClientRect(),o=G(i),r=e.left+(i.clientLeft+parseFloat(o.paddingLeft))*t.x,s=e.top+(i.clientTop+parseFloat(o.paddingTop))*t.y;c*=t.x,f*=t.y,u*=t.x,d*=t.y,c+=r,f+=s,n=O(i),i=tt(n)}}return A({width:u,height:d,x:c,y:f})}function at(t,e){const n=J(t).scrollLeft;return e?e.left+n:st(P(t)).left+n}function lt(t,e){const n=t.getBoundingClientRect();return{x:n.left+e.scrollLeft-at(t,n),y:n.top+e.scrollTop}}const ct=new Set(["absolute","fixed"]);function ft(t,e,n){let i;if("viewport"===e)i=function(t,e){const n=O(t),o=P(t),i=n.visualViewport;let r=o.clientWidth,s=o.clientHeight,a=0,l=0;if(i){r=i.width,s=i.height;const t=W();(!t||t&&"fixed"===e)&&(a=i.offsetLeft,l=i.offsetTop)}const c=at(o);if(c<=0){const t=o.ownerDocument,e=t.body,n=getComputedStyle(e),i="CSS1Compat"===t.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,s=Math.abs(o.clientWidth-e.clientWidth-i);s<=25&&(r-=s)}else c<=25&&(r+=c);return{width:r,height:s,x:a,y:l}}(t,n);else if("document"===e)i=function(t){const e=P(t),n=J(t),i=t.ownerDocument.body,r=o(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),s=o(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let a=-n.scrollLeft+at(t);const l=-n.scrollTop;return"rtl"===G(i).direction&&(a+=o(e.clientWidth,i.clientWidth)-r),{width:r,height:s,x:a,y:l}}(P(t));else if($(e))i=function(t,e){const n=st(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,s=E(t)?ot(t):r(1);return{width:t.clientWidth*s.x,height:t.clientHeight*s.y,x:i*s.x,y:o*s.y}}(e,n);else{const n=rt(t);i={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return A(i)}function ut(t,e){const n=K(t);return!(n===e||!$(n)||Y(n))&&("fixed"===G(n).position||ut(n,e))}function dt(t,e,n){const o=E(e),i=P(e),s="fixed"===n,a=st(t,!0,s,e);let l={scrollLeft:0,scrollTop:0};const c=r(0);function f(){c.x=at(i)}if(o||!o&&!s)if(("body"!==L(e)||B(i))&&(l=J(e)),o){const t=st(e,!0,s,e);c.x=t.x+e.clientLeft,c.y=t.y+e.clientTop}else i&&f();s&&!o&&i&&f();const u=!i||o||s?r(0):lt(i,l);return{x:a.left+l.scrollLeft-c.x-u.x,y:a.top+l.scrollTop-c.y-u.y,width:a.width,height:a.height}}function ht(t){return"static"===G(t).position}function pt(t,e){if(!E(t)||"fixed"===G(t).position)return null;if(e)return e(t);let n=t.offsetParent;return P(t)===n&&(n=n.ownerDocument.body),n}function mt(t,e){const n=O(t);if(H(t))return n;if(!E(t)){let e=K(t);for(;e&&!Y(e);){if($(e)&&!ht(e))return e;e=K(e)}return n}let o=pt(t,e);for(;o&&N(o)&&ht(o);)o=pt(o,e);return o&&Y(o)&&ht(o)&&!V(o)?n:o||function(t){let e=K(t);for(;E(e)&&!Y(e);){if(V(e))return e;if(H(e))return null;e=K(e)}return null}(t)||n}const yt={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const s="fixed"===i,a=P(o),l=!!e&&H(e.floating);if(o===a||l&&s)return n;let c={scrollLeft:0,scrollTop:0},f=r(1);const u=r(0),d=E(o);if((d||!d&&!s)&&(("body"!==L(o)||B(a))&&(c=J(o)),E(o))){const t=st(o);f=ot(o),u.x=t.x+o.clientLeft,u.y=t.y+o.clientTop}const h=!a||d||s?r(0):lt(a,c);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-c.scrollLeft*f.x+u.x+h.x,y:n.y*f.y-c.scrollTop*f.y+u.y+h.y}},getDocumentElement:P,getClippingRect:function(t){let{element:e,boundary:i,rootBoundary:r,strategy:s}=t;const a=[..."clippingAncestors"===i?H(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let o=Z(t,[]).filter((t=>$(t)&&"body"!==L(t))),i=null;const r="fixed"===G(t).position;let s=r?K(t):t;for(;$(s)&&!Y(s);){const e=G(s),n=V(s);n||"fixed"!==e.position||(i=null),(r?!n&&!i:!n&&"static"===e.position&&i&&ct.has(i.position)||B(s)&&!n&&ut(t,s))?o=o.filter((t=>t!==s)):i=e,s=K(s)}return e.set(t,o),o}(e,this._c):[].concat(i),r],l=a.reduce(((t,i)=>{const r=ft(e,i,s);return t.top=o(r.top,t.top),t.right=n(r.right,t.right),t.bottom=n(r.bottom,t.bottom),t.left=o(r.left,t.left),t}),ft(e,a[0],s));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:mt,getElementRects:async function(t){const e=this.getOffsetParent||mt,n=this.getDimensions,o=await n(t.floating);return{reference:dt(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:n}=et(t);return{width:e,height:n}},getScale:ot,isElement:$,isRTL:function(t){return"rtl"===G(t).direction}},gt=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i,platform:r}=e,{mainAxis:s=!0,crossAxis:a=!1,limiter:u={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...h}=c(t,e),p={x:n,y:o},y=await r.detectOverflow(e,h),g=m(f(i)),w=d(g);let x=p[w],b=p[g];s&&(x=l(x+y["y"===w?"top":"left"],x,x-y["y"===w?"bottom":"right"])),a&&(b=l(b+y["y"===g?"top":"left"],b,b-y["y"===g?"bottom":"right"]));const v=u.fn({...e,[w]:x,[g]:b});return{...v,data:{x:v.x-n,y:v.y-o,enabled:{[w]:s,[g]:a}}}}}},wt=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:r,rects:s,initialPlacement:a,platform:l,elements:d}=e,{mainAxis:p=!0,crossAxis:S=!0,fallbackPlacements:A,fallbackStrategy:C="bestFit",fallbackAxisSideDirection:D="none",flipAlignment:F=!0,...R}=c(t,e);if(null!=(n=r.arrow)&&n.alignmentOffset)return{};const L=f(i),O=m(a),P=f(a)===a,T=await(null==l.isRTL?void 0:l.isRTL(d.floating)),$=A||(P||!F?[k(a)]:function(t){const e=k(t);return[g(t),e,g(e)]}(a)),E="none"!==D;!A&&E&&$.push(...function(t,e,n,o){const i=u(t);let r=function(t,e,n){switch(t){case"top":case"bottom":return n?e?x:w:e?w:x;case"left":case"right":return e?b:v;default:return[]}}(f(t),"start"===n,o);return i&&(r=r.map((t=>t+"-"+i)),e&&(r=r.concat(r.map(g)))),r}(a,F,D,T));const M=[a,...$],j=await l.detectOverflow(e,R),B=[];let z=(null==(o=r.flip)?void 0:o.overflows)||[];if(p&&B.push(j[L]),S){const t=function(t,e,n){void 0===n&&(n=!1);const o=u(t),i=y(t),r=h(i);let s="x"===i?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=k(s)),[s,k(s)]}(i,s,T);B.push(j[t[0]],j[t[1]])}if(z=[...z,{placement:i,overflows:B}],!B.every((t=>t<=0))){var N,_;const t=((null==(N=r.flip)?void 0:N.index)||0)+1,e=M[t];if(e&&("alignment"!==S||O===m(e)||z.every((t=>m(t.placement)!==O||t.overflows[0]>0))))return{data:{index:t,overflows:z},reset:{placement:e}};let n=null==(_=z.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:_.placement;if(!n)switch(C){case"bestFit":{var H;const t=null==(H=z.filter((t=>{if(E){const e=m(t.placement);return e===O||"y"===e}return!0})).map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:H[0];t&&(n=t);break}case"initialPlacement":n=a}if(i!==n)return{reset:{placement:n}}}return{}}}},xt=t=>({name:"arrow",options:t,async fn(e){const{x:o,y:i,placement:r,rects:s,platform:a,elements:f,middlewareData:d}=e,{element:p,padding:m=0}=c(t,e)||{};if(null==p)return{};const g=S(m),w={x:o,y:i},x=y(r),b=h(x),v=await a.getDimensions(p),k="y"===x,A=k?"top":"left",C=k?"bottom":"right",D=k?"clientHeight":"clientWidth",F=s.reference[b]+s.reference[x]-w[x]-s.floating[b],R=w[x]-s.reference[x],L=await(null==a.getOffsetParent?void 0:a.getOffsetParent(p));let O=L?L[D]:0;O&&await(null==a.isElement?void 0:a.isElement(L))||(O=f.floating[D]||s.floating[b]);const P=F/2-R/2,T=O/2-v[b]/2-1,$=n(g[A],T),E=n(g[C],T),M=$,j=O-v[b]-E,B=O/2-v[b]/2+P,z=l(M,B,j),N=!d.arrow&&null!=u(r)&&B!==z&&s.reference[b]/2-(B<M?$:E)-v[b]/2<0,_=N?B<M?B-M:B-j:0;return{[x]:w[x]+_,data:{[x]:z,centerOffset:B-z-_,...N&&{alignmentOffset:_}},reset:N}}}),bt="Checking...",vt=class{constructor(e){t(this,e),this.vin=void 0,this.snapshot=void 0,this.label=bt,this.failed=!0,this.loaded=!1,this.time=void 0,this.eventBus=window.eventBus,this.message=void 0,this.nanoId=((t=21)=>{let e="",n=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&n[t]];return e})(),this.messageHandler=t=>{const{origin:e,data:n}=t,{targetId:o}=n;if(console.log("-- messageHandler:",n,e),"http://localhost:3000"===e&&o===this.nanoId)if(void 0===this.message){if(n.type&&"resize-iframe"===n.type){this.iframe.style.width=n.payload.width+"px",this.iframe.style.height=n.payload.height+"px",this.iframe.style.display="block",this.loaded=!0,this.label="",this.message=n;const{vin:t,snapshot:e}=this;this.iframe&&this.iframe.contentWindow.postMessage({targetId:this.nanoId,type:"data-payload",payload:{vin:t,snapshot:e}},"*"),this.update()}}else this.hideTooltip()},this.register=()=>{this.eventBus.emit("activate",this.nanoId),window.addEventListener("message",this.messageHandler,!1)},this.unregister=()=>{window.removeEventListener("message",this.messageHandler)},this.update=()=>{const{target:t,tooltip:e,arrowEl:n}=this;var o;((t,e,n)=>{const o=new Map,i={platform:yt,...n},r={...i.platform,_c:o};return(async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:s}=n,a=r.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:u}=C(c,o,l),d=o,h={},p=0;for(let n=0;n<a.length;n++){var m;const{name:r,fn:y}=a[n],{x:g,y:w,data:x,reset:b}=await y({x:f,y:u,initialPlacement:o,placement:d,strategy:i,middlewareData:h,rects:c,platform:{...s,detectOverflow:null!=(m=s.detectOverflow)?m:D},elements:{reference:t,floating:e}});f=null!=g?g:f,u=null!=w?w:u,h={...h,[r]:{...h[r],...x}},b&&p<=50&&(p++,"object"==typeof b&&(b.placement&&(d=b.placement),b.rects&&(c=!0===b.rects?await s.getElementRects({reference:t,floating:e,strategy:i}):b.rects),({x:f,y:u}=C(c,d,l))),n=-1)}return{x:f,y:u,placement:d,strategy:i,middlewareData:h}})(t,e,{...i,platform:r})})(t,e,{placement:"right",middleware:[(o=6,void 0===o&&(o=0),{name:"offset",options:o,async fn(t){var e,n;const{x:i,y:r,placement:s,middlewareData:a}=t,l=await async function(t,e){const{placement:n,platform:o,elements:i}=t,r=await(null==o.isRTL?void 0:o.isRTL(i.floating)),s=f(n),a=u(n),l="y"===m(n),d=F.has(s)?-1:1,h=r&&l?-1:1,p=c(e,t);let{mainAxis:y,crossAxis:g,alignmentAxis:w}="number"==typeof p?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return a&&"number"==typeof w&&(g="end"===a?-1*w:w),l?{x:g*h,y:y*d}:{x:y*d,y:g*h}}(t,o);return s===(null==(e=a.offset)?void 0:e.placement)&&null!=(n=a.arrow)&&n.alignmentOffset?{}:{x:i+l.x,y:r+l.y,data:{...l,placement:s}}}}),wt(),gt({padding:5}),xt({element:n})]}).then((({x:t,y:o,placement:i,middlewareData:r})=>{Object.assign(e.style,{left:`${t}px`,top:`${o}px`});const{x:s,y:a}=r.arrow,l={top:"bottom",right:"left",bottom:"top",left:"right"}[i.split("-")[0]];Object.assign(n.style,{left:null!=s?`${s}px`:"",top:null!=a?`${a}px`:"",right:"",bottom:"",[l]:"-4px"})}))},this.onIframeLoad=()=>{this.update(),setTimeout((()=>{this.loaded||(this.label="Content Failed to Load...")}),3e3)},this.hideTooltip=()=>{this.iframe.style.display="",this.tooltip.style.display="",this.message=void 0,this.unregister()},this.showTooltip=()=>{this.register(),this.loaded=!1,this.label=bt,this.loaded=!1,this.time=Date.now(),this.tooltip.style.display="block",this.update()},this.clickHandler=()=>{"block"===this.tooltip.style.display?this.hideTooltip():this.showTooltip()}}componentDidLoad(){this.eventBus.on("activate",(t=>{this.nanoId!==t&&(void 0!==this.message||"block"===this.tooltip.style.display)&&this.hideTooltip()})),this.update()}render(){const t=`http://localhost:3000/demo_iframe.html?q=${this.time}&nid=${this.nanoId}`;return e("div",{key:"1da684903d9253b204641b4184bc5e1f79326405",id:"root"},e("div",{key:"84665f15de5991870ad2a16f42f1984789f4631f",id:"target",ref:t=>this.target=t,onClick:()=>this.clickHandler()},"i"),e("div",{key:"178c42dc946b455c8873e06d481a93d095a2e752",id:"tooltip",role:"tooltip",ref:t=>this.tooltip=t},e("div",{key:"75921e81ce12a64df3500d1492b6d782ff2881e3"},this.label),this.time?e("iframe",{id:"content",src:t,ref:t=>this.iframe=t,onLoad:t=>this.onIframeLoad(t)}):"",e("div",{key:"99722c505d254559b6a89a3d173c0925b12e53be",id:"arrow",ref:t=>this.arrowEl=t})))}};vt.style="#root{--clrs-navy:#001f3f;--clrs-blue:#0074d9;--clrs-aqua:#7fdbff;--clrs-teal:#39cccc;--clrs-olive:#3d9970;--clrs-green:#2ecc40;--clrs-lime:#01ff70;--clrs-yellow:#ffdc00;--clrs-orange:#ff851b;--clrs-red:#ff4136;--clrs-maroon:#85144b;--clrs-fuchsia:#f012be;--clrs-purple:#b10dc9;--clrs-black:#111111;--clrs-gray:#aaaaaa;--clrs-silver:#dddddd;--clrs-bada55:#bada55;--clrs-slate:#708090;--clrs-slate4:#4e5964;--clrs-white:#ffffff}#target{width:24px;height:24px;line-height:24px;text-align:center;border-radius:12px;background:var(--clrs-blue);font-weight:bold;font-size:120%;color:var(--clrs-white);cursor:pointer}#tooltip{display:none;position:absolute;min-height:18px;background:var(--clrs-navy);color:var(--clrs-white);font-weight:bold;padding:5px;padding-right:10px;padding-left:10px;border-radius:4px;font-size:90%;pointer-events:none}#arrow{position:absolute;background:var(--clrs-navy);width:8px;height:8px;transform:rotate(45deg)}#content{display:none;border:none}";export{vt as proto_floater_demo}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as o,b as a}from"./p-
|
|
1
|
+
import{p as o,b as a}from"./p-D3NxIFzo.js";export{s as setNonce}from"./p-D3NxIFzo.js";import{g as e}from"./p-DQuL1Twl.js";(()=>{const a=import.meta.url,e={};return""!==a&&(e.resourcesUrl=new URL(".",a).href),o(e)})().then((async o=>(await e(),a([["p-be4e597a",[[1,"proto-floater-demo",{vin:[1],snapshot:[1],label:[32],failed:[32],loaded:[32],time:[32]}]]]],o))));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "proto-float-wc",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.90",
|
|
4
4
|
"description": "Stencil Component Starter",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -16,14 +16,14 @@
|
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@floating-ui/dom": "1.7.5",
|
|
19
|
-
"@stencil/core": "4.
|
|
19
|
+
"@stencil/core": "4.43.0",
|
|
20
20
|
"nanoid": "5.1.6"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"bumpp": "10.4.1",
|
|
24
24
|
"concurrently": "9.2.1",
|
|
25
25
|
"cspell": "9.6.4",
|
|
26
|
-
"eslint": "
|
|
26
|
+
"eslint": "10.0.0",
|
|
27
27
|
"http-server": "14.1.1",
|
|
28
28
|
"only-allow": "1.2.2",
|
|
29
29
|
"prettier": "3.8.1",
|
|
File without changes
|