troncell-vue-component 1.0.0 → 1.0.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.cjs CHANGED
@@ -401,7 +401,7 @@ void main() {
401
401
  velocity.xy -= vec2(R - L, T - B);
402
402
  gl_FragColor = vec4(velocity, 0.0, 1.0);
403
403
  }
404
- `),N=(()=>{const g=a.createBuffer();a.bindBuffer(a.ARRAY_BUFFER,g),a.bufferData(a.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),a.STATIC_DRAW);const M=a.createBuffer();return a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,M),a.bufferData(a.ELEMENT_ARRAY_BUFFER,new Uint16Array([0,1,2,0,2,3]),a.STATIC_DRAW),a.vertexAttribPointer(0,2,a.FLOAT,!1,0,0),a.enableVertexAttribArray(0),(T,P=!1)=>{a&&(T?(a.viewport(0,0,T.width,T.height),a.bindFramebuffer(a.FRAMEBUFFER,T.fbo)):(a.viewport(0,0,a.drawingBufferWidth,a.drawingBufferHeight),a.bindFramebuffer(a.FRAMEBUFFER,null)),P&&(a.clearColor(0,0,0,1),a.clear(a.COLOR_BUFFER_BIT)),a.drawElements(a.TRIANGLES,6,a.UNSIGNED_SHORT,0))}})();let V,A,J,y,R;const G=new p(k,b),le=new p(k,I),q=new p(k,H),Y=new p(k,E),se=new p(k,C),ie=new p(k,S),ce=new p(k,D),fe=new p(k,B),we=new p(k,L),be=new _(k,U);function Ee(g,M,T,P,O,Q){a.activeTexture(a.TEXTURE0);const ne=a.createTexture();a.bindTexture(a.TEXTURE_2D,ne),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,Q),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,Q),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE),a.texImage2D(a.TEXTURE_2D,0,T,g,M,0,P,O,null);const ke=a.createFramebuffer();a.bindFramebuffer(a.FRAMEBUFFER,ke),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,ne,0),a.viewport(0,0,g,M),a.clear(a.COLOR_BUFFER_BIT);const Se=1/g,Ie=1/M;return{texture:ne,fbo:ke,width:g,height:M,texelSizeX:Se,texelSizeY:Ie,attach(Ge){return a.activeTexture(a.TEXTURE0+Ge),a.bindTexture(a.TEXTURE_2D,ne),Ge}}}function De(g,M,T,P,O,Q){const ne=Ee(g,M,T,P,O,Q),ke=Ee(g,M,T,P,O,Q);return{width:g,height:M,texelSizeX:ne.texelSizeX,texelSizeY:ne.texelSizeY,read:ne,write:ke,swap(){const Se=this.read;this.read=this.write,this.write=Se}}}function Fe(g,M,T,P,O,Q,ne){const ke=Ee(M,T,P,O,Q,ne);return G.bind(),G.uniforms.uTexture&&a.uniform1i(G.uniforms.uTexture,g.attach(0)),N(ke,!1),ke}function z(g,M,T,P,O,Q,ne){return g.width===M&&g.height===T||(g.read=Fe(g.read,M,T,P,O,Q,ne),g.write=Ee(M,T,P,O,Q,ne),g.width=M,g.height=T,g.texelSizeX=1/M,g.texelSizeY=1/T),g}function $(){const g=te(l.SIM_RESOLUTION),M=te(l.DYE_RESOLUTION),T=c.halfFloatTexType,P=c.formatRGBA,O=c.formatRG,Q=c.formatR,ne=c.supportLinearFiltering?a.LINEAR:a.NEAREST;a.disable(a.BLEND),V?V=z(V,M.width,M.height,P.internalFormat,P.format,T,ne):V=De(M.width,M.height,P.internalFormat,P.format,T,ne),A?A=z(A,g.width,g.height,O.internalFormat,O.format,T,ne):A=De(g.width,g.height,O.internalFormat,O.format,T,ne),J=Ee(g.width,g.height,Q.internalFormat,Q.format,T,a.NEAREST),y=Ee(g.width,g.height,Q.internalFormat,Q.format,T,a.NEAREST),R=De(g.width,g.height,Q.internalFormat,Q.format,T,a.NEAREST)}function j(){const g=[];l.SHADING&&g.push("SHADING"),be.setKeywords(g)}function te(g){const M=a.drawingBufferWidth,T=a.drawingBufferHeight,P=M/T,O=P<1?1/P:P,Q=Math.round(g),ne=Math.round(g*O);return M>T?{width:ne,height:Q}:{width:Q,height:ne}}function W(g){const M=window.devicePixelRatio||1;return Math.floor(g*M)}j(),$();let ae=Date.now(),oe=0;function me(){const g=ue();Z()&&$(),re(g),pe(),ve(g),Re(null),requestAnimationFrame(me)}function ue(){const g=Date.now();let M=(g-ae)/1e3;return M=Math.min(M,.016666),ae=g,M}function Z(){const g=W(o.clientWidth),M=W(o.clientHeight);return o.width!==g||o.height!==M?(o.width=g,o.height=M,!0):!1}function re(g){oe+=g*l.COLOR_UPDATE_SPEED,oe>=1&&(oe=ot(oe,0,1),r.forEach(M=>{M.color=He()}))}function pe(){for(const g of r)g.moved&&(g.moved=!1,X(g))}function ve(g){a.disable(a.BLEND),ie.bind(),ie.uniforms.texelSize&&a.uniform2f(ie.uniforms.texelSize,A.texelSizeX,A.texelSizeY),ie.uniforms.uVelocity&&a.uniform1i(ie.uniforms.uVelocity,A.read.attach(0)),N(y),ce.bind(),ce.uniforms.texelSize&&a.uniform2f(ce.uniforms.texelSize,A.texelSizeX,A.texelSizeY),ce.uniforms.uVelocity&&a.uniform1i(ce.uniforms.uVelocity,A.read.attach(0)),ce.uniforms.uCurl&&a.uniform1i(ce.uniforms.uCurl,y.attach(1)),ce.uniforms.curl&&a.uniform1f(ce.uniforms.curl,l.CURL),ce.uniforms.dt&&a.uniform1f(ce.uniforms.dt,g),N(A.write),A.swap(),se.bind(),se.uniforms.texelSize&&a.uniform2f(se.uniforms.texelSize,A.texelSizeX,A.texelSizeY),se.uniforms.uVelocity&&a.uniform1i(se.uniforms.uVelocity,A.read.attach(0)),N(J),le.bind(),le.uniforms.uTexture&&a.uniform1i(le.uniforms.uTexture,R.read.attach(0)),le.uniforms.value&&a.uniform1f(le.uniforms.value,l.PRESSURE),N(R.write),R.swap(),fe.bind(),fe.uniforms.texelSize&&a.uniform2f(fe.uniforms.texelSize,A.texelSizeX,A.texelSizeY),fe.uniforms.uDivergence&&a.uniform1i(fe.uniforms.uDivergence,J.attach(0));for(let T=0;T<l.PRESSURE_ITERATIONS;T++)fe.uniforms.uPressure&&a.uniform1i(fe.uniforms.uPressure,R.read.attach(1)),N(R.write),R.swap();we.bind(),we.uniforms.texelSize&&a.uniform2f(we.uniforms.texelSize,A.texelSizeX,A.texelSizeY),we.uniforms.uPressure&&a.uniform1i(we.uniforms.uPressure,R.read.attach(0)),we.uniforms.uVelocity&&a.uniform1i(we.uniforms.uVelocity,A.read.attach(1)),N(A.write),A.swap(),Y.bind(),Y.uniforms.texelSize&&a.uniform2f(Y.uniforms.texelSize,A.texelSizeX,A.texelSizeY),!c.supportLinearFiltering&&Y.uniforms.dyeTexelSize&&a.uniform2f(Y.uniforms.dyeTexelSize,A.texelSizeX,A.texelSizeY);const M=A.read.attach(0);Y.uniforms.uVelocity&&a.uniform1i(Y.uniforms.uVelocity,M),Y.uniforms.uSource&&a.uniform1i(Y.uniforms.uSource,M),Y.uniforms.dt&&a.uniform1f(Y.uniforms.dt,g),Y.uniforms.dissipation&&a.uniform1f(Y.uniforms.dissipation,l.VELOCITY_DISSIPATION),N(A.write),A.swap(),!c.supportLinearFiltering&&Y.uniforms.dyeTexelSize&&a.uniform2f(Y.uniforms.dyeTexelSize,V.texelSizeX,V.texelSizeY),Y.uniforms.uVelocity&&a.uniform1i(Y.uniforms.uVelocity,A.read.attach(0)),Y.uniforms.uSource&&a.uniform1i(Y.uniforms.uSource,V.read.attach(1)),Y.uniforms.dissipation&&a.uniform1f(Y.uniforms.dissipation,l.DENSITY_DISSIPATION),N(V.write),V.swap()}function Re(g){a.blendFunc(a.ONE,a.ONE_MINUS_SRC_ALPHA),a.enable(a.BLEND),ge(g)}function ge(g){const M=a.drawingBufferWidth,T=a.drawingBufferHeight;be.bind(),l.SHADING&&be.uniforms.texelSize&&a.uniform2f(be.uniforms.texelSize,1/M,1/T),be.uniforms.uTexture&&a.uniform1i(be.uniforms.uTexture,V.read.attach(0)),N(g,!1)}function X(g){const M=g.deltaX*l.SPLAT_FORCE,T=g.deltaY*l.SPLAT_FORCE;Te(g.texcoordX,g.texcoordY,M,T,g.color)}function _e(g){const M=He();M.r*=10,M.g*=10,M.b*=10;const T=10*(Math.random()-.5),P=30*(Math.random()-.5);Te(g.texcoordX,g.texcoordY,T,P,M)}function Te(g,M,T,P,O){q.bind(),q.uniforms.uTarget&&a.uniform1i(q.uniforms.uTarget,A.read.attach(0)),q.uniforms.aspectRatio&&a.uniform1f(q.uniforms.aspectRatio,o.width/o.height),q.uniforms.point&&a.uniform2f(q.uniforms.point,g,M),q.uniforms.color&&a.uniform3f(q.uniforms.color,T,P,0),q.uniforms.radius&&a.uniform1f(q.uniforms.radius,Pe(l.SPLAT_RADIUS/100)),N(A.write),A.swap(),q.uniforms.uTarget&&a.uniform1i(q.uniforms.uTarget,V.read.attach(0)),q.uniforms.color&&a.uniform3f(q.uniforms.color,O.r,O.g,O.b),N(V.write),V.swap()}function Pe(g){const M=o.width/o.height;return M>1&&(g*=M),g}function Ne(g,M,T,P){g.id=M,g.down=!0,g.moved=!1,g.texcoordX=T/o.width,g.texcoordY=1-P/o.height,g.prevTexcoordX=g.texcoordX,g.prevTexcoordY=g.texcoordY,g.deltaX=0,g.deltaY=0,g.color=He()}function Oe(g,M,T,P){g.prevTexcoordX=g.texcoordX,g.prevTexcoordY=g.texcoordY,g.texcoordX=M/o.width,g.texcoordY=1-T/o.height,g.deltaX=St(g.texcoordX-g.prevTexcoordX),g.deltaY=it(g.texcoordY-g.prevTexcoordY),g.moved=Math.abs(g.deltaX)>0||Math.abs(g.deltaY)>0,g.color=P}function We(g){g.down=!1}function St(g){const M=o.width/o.height;return M<1&&(g*=M),g}function it(g){const M=o.width/o.height;return M>1&&(g/=M),g}function He(){const g=ut(Math.random(),1,1);return g.r*=.15,g.g*=.15,g.b*=.15,g}function ut(g,M,T){let P=0,O=0,Q=0;const ne=Math.floor(g*6),ke=g*6-ne,Se=T*(1-M),Ie=T*(1-ke*M),Ge=T*(1-(1-ke)*M);switch(ne%6){case 0:P=T,O=Ge,Q=Se;break;case 1:P=Ie,O=T,Q=Se;break;case 2:P=Se,O=T,Q=Ge;break;case 3:P=Se,O=Ie,Q=T;break;case 4:P=Ge,O=Se,Q=T;break;case 5:P=T,O=Se,Q=Ie;break}return{r:P,g:O,b:Q}}function ot(g,M,T){const P=T-M;return(g-M)%P+M}window.addEventListener("mousedown",g=>{const M=r[0],T=W(g.clientX),P=W(g.clientY);Ne(M,-1,T,P),_e(M)});function Xe(g){const M=r[0],T=W(g.clientX),P=W(g.clientY),O=He();me(),Oe(M,T,P,O),document.body.removeEventListener("mousemove",Xe)}document.body.addEventListener("mousemove",Xe),window.addEventListener("mousemove",g=>{const M=r[0],T=W(g.clientX),P=W(g.clientY),O=M.color;Oe(M,T,P,O)});function qe(g){const M=g.targetTouches,T=r[0];for(let P=0;P<M.length;P++){const O=W(M[P].clientX),Q=W(M[P].clientY);me(),Ne(T,M[P].identifier,O,Q)}document.body.removeEventListener("touchstart",qe)}document.body.addEventListener("touchstart",qe),window.addEventListener("touchstart",g=>{const M=g.targetTouches,T=r[0];for(let P=0;P<M.length;P++){const O=W(M[P].clientX),Q=W(M[P].clientY);Ne(T,M[P].identifier,O,Q)}},!1),window.addEventListener("touchmove",g=>{const M=g.targetTouches,T=r[0];for(let P=0;P<M.length;P++){const O=W(M[P].clientX),Q=W(M[P].clientY);Oe(T,O,Q,T.color)}},!1),window.addEventListener("touchend",g=>{const M=g.changedTouches,T=r[0];for(let P=0;P<M.length;P++)We(T)}),e.watch(()=>t.simResolution,g=>{l.SIM_RESOLUTION=g,$()}),e.watch(()=>t.dyeResolution,g=>{l.DYE_RESOLUTION=g,$()}),e.watch(()=>t.shading,g=>{l.SHADING=g,j()}),me()}),(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(K)("pointer-events-none fixed left-0 top-0 z-50 size-full",t.class))},[e.createElementVNode("canvas",{id:"fluid",ref_key:"canvasRef",ref:s,class:"block h-screen w-screen"},null,512)],2))}}),xi={class:"relative h-60 w-full flex flex-col items-center justify-center gap-4"},yi={class:"flex flex-row items-center justify-center gap-4"},wi={key:0,class:"opacity-50 text-4xl font-semibold"},bi=e.defineComponent({__name:"index",props:{title:{type:String,default:void 0},classList:{type:Object,default:()=>({})}},setup(n){const t=e.ref(!1);return(i,s)=>{const o=e.resolveComponent("el-switch");return e.openBlock(),e.createElementBlock("div",xi,[e.createElementVNode("div",yi,[e.createElementVNode("span",null,e.toDisplayString(n.title),1),e.createVNode(o,{modelValue:t.value,"onUpdate:modelValue":s[0]||(s[0]=r=>t.value=r)},null,8,["modelValue"])]),t.value?(e.openBlock(),e.createElementBlock("span",wi," Hover anywhere ")):e.createCommentVNode("",!0),t.value?(e.openBlock(),e.createBlock(vi,{key:1})):e.createCommentVNode("",!0)])}}});class Ct{static instance=null;constructor(){}static getInstance(){return this.instance===null&&(this.instance=new Ct),this.instance}canPost(){return typeof window<"u"&&!!window.chrome&&!!window.chrome.webview&&typeof window.chrome.webview.postMessage=="function"}post(t){if(this.canPost())return window.chrome.webview.postMessage(t),!0}send(t,i){return this.post({type:t,payload:i})}sendRaw(t){if(this.canPost())return window.chrome.webview.postMessage(t),!0}addBehaviorRecord(t,i,s,o,r,l,a,c,u,d,m,h,f,x,v){return this.send("addBehaviorRecord",{thingId:t,thingName:i,thingCategory:s,action:o,increment:r,collectionTime:l,collectEndTime:a,softwareName:c,pageName:u,pageArea:d,previousPageName:m,previousPageArea:h,position:f,pSource:x,comments:v})}addBehaviorRecordObject(t){return this.send("addBehaviorRecord",t)}doDropCargo(t){return this.send("doDropCargo",{cargoRoad:t})}printPayData(t){return this.send("printPayData",{printJsonData:t})}sendSerialCommand(t,i){return this.send("sendSerialCommand",{command:t,isHex:i})}log(t){return this.send("log",{content:t})}CloseFaceRecognition(){return this.send("CloseFaceRecognition")}sendAction(t,i){return this.send("sendAction",{v1:t,v2:i})}facedetect(){return this.send("facedetect")}}const Ci=e.defineComponent({__name:"index",props:{title:{type:String,default:void 0},class:{type:String,default:void 0},classList:{type:Object,default:()=>({})},events:{type:Object,default:()=>({emitEventName:void 0,emitPayload:void 0,postToWebview:!1})}},emits:["click"],setup(n,{emit:t}){const i=n,s=e.computed(()=>{const d=i.classList&&i.classList.Location||{};return[d.position,d.width,d.height,d.left,d.top].filter(Boolean)}),o=e.computed(()=>i.title??"Button"),r=e.ref(null),l=Vt.useRouter(),a=t,c=d=>{if(!Array.isArray(d)||d.length===0)return null;const m=d[0];if(typeof m!="string")return null;const h=m.match(/^s:navigate\?page=([^&\s]+)/);return h?{type:"navigate",page:h[1]}:{type:"custom",command:m}},u=d=>{a("click",d);const m=i.events.emitPayload,h=m?.Data;if(i.events.postToWebview===!0){try{const f=Ct.getInstance(),x=m||{PageName:"unknown",ControlName:"IButtonComp",Data:h||[]};console.log("Posting to WebView via bridge:",x),f.sendRaw(x)||console.warn("WebView bridge not available; message not sent")}catch(f){console.warn("Failed to postMessage to webview",f)}return}if(h&&Array.isArray(h)){const f=c(h);if(f?.type==="navigate"&&f.page){console.log("Navigating to page:",f.page),l.push(`/${f.page}`);return}}if(i.events.emitEventName){const f={payload:m,originalEvent:d};console.log("Dispatching custom event:",i.events.emitEventName,f),window.dispatchEvent(new CustomEvent(i.events.emitEventName,{detail:f}))}};return(d,m)=>(e.openBlock(),e.createElementBlock("button",e.mergeProps({ref_key:"buttonRef",ref:r},d.$attrs,{onClick:u,class:e.unref(K)(n.classList?.buttonClass,i.class,s.value)}),[e.createElementVNode("div",{class:e.normalizeClass(e.unref(K)(n.classList?.containerClass))},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(K)(n.classList?.dotClass))},null,2),e.createElementVNode("span",{class:e.normalizeClass(e.unref(K)(n.classList?.textClass))},e.toDisplayString(o.value),3)],2),e.createElementVNode("div",{class:e.normalizeClass(e.unref(K)(n.classList?.hoverContainerClass))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(K)(n.classList?.hoverTextClass))},e.toDisplayString(o.value),3),(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(e.unref(K)(n.classList?.iconClass))},[...m[0]||(m[0]=[e.createElementVNode("path",{d:"M5 12h14"},null,-1),e.createElementVNode("path",{d:"m12 5 7 7-7 7"},null,-1)])],2))],2)],16))}}),Ei=e.defineComponent({__name:"IconCloud",props:{class:{},images:{}},setup(n){const t=n,{images:i}=t,s=e.ref(null),o=e.ref(0),r=e.ref([]),l=e.ref([]),a=e.ref([]),c=e.reactive({x:0,y:0}),u=e.ref(!1),d=e.reactive({x:0,y:0}),m=e.reactive({x:0,y:0}),h=e.ref(null);function f(p){return 1-(1-p)**3}e.watchEffect(()=>{if(!i)return;l.value=new Array(i.length).fill(!1);const p=i.map((_,k)=>{const b=document.createElement("canvas");b.width=40,b.height=40;const I=b.getContext("2d");if(!I)return b;const U=new Image;return U.crossOrigin="anonymous",U.src=_,U.onload=()=>{I.clearRect(0,0,b.width,b.height),I.beginPath(),I.arc(20,20,20,0,Math.PI*2),I.closePath(),I.clip(),I.drawImage(U,0,0,40,40),l.value[k]=!0},b});r.value=p}),e.watchEffect(()=>{const p=i?.length||0;if(p===0){a.value=[];return}const _=[],k=2/p,b=Math.PI*(3-Math.sqrt(5));for(let I=0;I<p;I++){const U=I*k-1+k/2,H=Math.sqrt(1-U*U),E=I*b,C=Math.cos(E)*H,S=Math.sin(E)*H;_.push({x:C*100,y:U*100,z:S*100,scale:1,opacity:1,id:I})}a.value=_});function x(p){const _=s.value;if(!_)return;const k=_.getBoundingClientRect(),b=p.clientX-k.left,I=p.clientY-k.top;_.getContext("2d")&&(a.value.forEach(H=>{const E=Math.cos(c.x),C=Math.sin(c.x),S=Math.cos(c.y),D=Math.sin(c.y),B=H.x*S-H.z*D,L=H.x*D+H.z*S,N=H.y*E+L*C,V=_.width/2+B,A=_.height/2+N,y=20*((L+200)/300),R=b-V,G=I-A;if(R*R+G*G<y*y){const le=-Math.atan2(H.y,Math.sqrt(H.x*H.x+H.z*H.z)),q=Math.atan2(H.x,H.z),Y=c.x,se=c.y,ie=Math.sqrt((le-Y)**2+(q-se)**2),ce=Math.min(2e3,Math.max(800,ie*1e3));h.value={x:le,y:q,startX:Y,startY:se,distance:ie,startTime:performance.now(),duration:ce};return}}),u.value=!0,d.x=p.clientX,d.y=p.clientY)}function v(p){const _=s.value;if(!_)return;const k=_.getBoundingClientRect();if(m.x=p.clientX-k.left,m.y=p.clientY-k.top,u.value){const b=p.clientX-d.x,I=p.clientY-d.y;c.x+=I*.002,c.y+=b*.002,d.x=p.clientX,d.y=p.clientY}}function w(){u.value=!1}return e.onMounted(()=>{const p=s.value;if(!p)return;const _=p.getContext("2d");if(!_)return;function k(){if(!_||!p)return;_.clearRect(0,0,p.width,p.height);const b=p.width/2,I=p.height/2,U=m.x-b,H=m.y-I,E=Math.sqrt(b*b+I*I),S=.003+Math.sqrt(U*U+H*H)/E*.01;if(h.value){const{startX:D,startY:B,x:L,y:N,startTime:V,duration:A}=h.value,J=performance.now()-V,y=Math.min(1,J/A),R=f(y);c.x=D+(L-D)*R,c.y=B+(N-B)*R,y>=1&&(h.value=null)}else u.value||(c.x+=H/p.height*S,c.y+=U/p.width*S);a.value.forEach((D,B)=>{const L=Math.cos(c.x),N=Math.sin(c.x),V=Math.cos(c.y),A=Math.sin(c.y),J=D.x*V-D.z*A,y=D.x*A+D.z*V,R=D.y*L+y*N,G=(y+200)/300,le=Math.max(.2,Math.min(1,(y+150)/200));_.save(),_.translate(b+J,I+R),_.scale(G,G),_.globalAlpha=le,r.value[B]&&l.value[B]&&_.drawImage(r.value[B],-20,-20,40,40),_.restore()}),o.value=requestAnimationFrame(k)}o.value=requestAnimationFrame(k)}),e.onBeforeUnmount(()=>{o.value&&cancelAnimationFrame(o.value)}),(p,_)=>(e.openBlock(),e.createElementBlock("canvas",{ref_key:"canvasRef",ref:s,width:"300",height:"300",class:e.normalizeClass(e.unref(K)("rounded-lg",p.$props.class)),role:"img","aria-label":"Interactive 3D Image Cloud",onMousedown:x,onMousemove:v,onMouseup:w,onMouseleave:w},null,34))}}),ki=e.defineComponent({__name:"index",props:{slugs:{default:()=>["typescript","javascript","dart","java","react","flutter","android","html5","css3","nodedotjs","express","nextdotjs","prisma","amazonaws","postgresql","firebase","nginx","vercel","testinglibrary","jest","cypress","docker","git","jira","github","gitlab","visualstudiocode","androidstudio","sonarqube","figma"]},useColorSlugAsColor:{type:Boolean,default:!0},classList:{default:()=>({})}},setup(n){const t=n,i=e.computed(()=>t.slugs.map(o=>o)),s=e.computed(()=>{const o=t.classList?.Location,r=[];return t.classList?.overallClass?r.push(t.classList.overallClass):r.push("grid place-content-center p-6"),o?.width&&r.push(o.width),o?.height&&r.push(o.height),o?.position&&r.push(o.position),o?.left&&r.push(o.left),o?.top&&r.push(o.top),r.join(" ")});return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(s.value)},[e.createVNode(Ei,{images:i.value},null,8,["images"])],2))}}),Si=["placeholder"],_i=100,Ti=e.defineComponent({inheritAttrs:!1,__name:"index",props:{defaultValue:{},modelValue:{},placeholder:{},class:{},containerClass:{},classList:{}},emits:["update:modelValue"],setup(n,{emit:t}){const i=n,s=t,o=Ce.useVModel(i,"modelValue",s,{passive:!0,defaultValue:i.defaultValue}),r=e.ref(null),l=e.ref({x:0,y:0}),a=e.ref(!1),c=e.computed(()=>`
404
+ `),N=(()=>{const g=a.createBuffer();a.bindBuffer(a.ARRAY_BUFFER,g),a.bufferData(a.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),a.STATIC_DRAW);const M=a.createBuffer();return a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,M),a.bufferData(a.ELEMENT_ARRAY_BUFFER,new Uint16Array([0,1,2,0,2,3]),a.STATIC_DRAW),a.vertexAttribPointer(0,2,a.FLOAT,!1,0,0),a.enableVertexAttribArray(0),(T,P=!1)=>{a&&(T?(a.viewport(0,0,T.width,T.height),a.bindFramebuffer(a.FRAMEBUFFER,T.fbo)):(a.viewport(0,0,a.drawingBufferWidth,a.drawingBufferHeight),a.bindFramebuffer(a.FRAMEBUFFER,null)),P&&(a.clearColor(0,0,0,1),a.clear(a.COLOR_BUFFER_BIT)),a.drawElements(a.TRIANGLES,6,a.UNSIGNED_SHORT,0))}})();let V,A,J,y,R;const G=new p(k,b),le=new p(k,I),q=new p(k,H),Y=new p(k,E),se=new p(k,C),ie=new p(k,S),ce=new p(k,D),fe=new p(k,B),we=new p(k,L),be=new _(k,U);function Ee(g,M,T,P,O,Q){a.activeTexture(a.TEXTURE0);const ne=a.createTexture();a.bindTexture(a.TEXTURE_2D,ne),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,Q),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,Q),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE),a.texImage2D(a.TEXTURE_2D,0,T,g,M,0,P,O,null);const ke=a.createFramebuffer();a.bindFramebuffer(a.FRAMEBUFFER,ke),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,ne,0),a.viewport(0,0,g,M),a.clear(a.COLOR_BUFFER_BIT);const Se=1/g,Ie=1/M;return{texture:ne,fbo:ke,width:g,height:M,texelSizeX:Se,texelSizeY:Ie,attach(Ge){return a.activeTexture(a.TEXTURE0+Ge),a.bindTexture(a.TEXTURE_2D,ne),Ge}}}function De(g,M,T,P,O,Q){const ne=Ee(g,M,T,P,O,Q),ke=Ee(g,M,T,P,O,Q);return{width:g,height:M,texelSizeX:ne.texelSizeX,texelSizeY:ne.texelSizeY,read:ne,write:ke,swap(){const Se=this.read;this.read=this.write,this.write=Se}}}function Fe(g,M,T,P,O,Q,ne){const ke=Ee(M,T,P,O,Q,ne);return G.bind(),G.uniforms.uTexture&&a.uniform1i(G.uniforms.uTexture,g.attach(0)),N(ke,!1),ke}function z(g,M,T,P,O,Q,ne){return g.width===M&&g.height===T||(g.read=Fe(g.read,M,T,P,O,Q,ne),g.write=Ee(M,T,P,O,Q,ne),g.width=M,g.height=T,g.texelSizeX=1/M,g.texelSizeY=1/T),g}function $(){const g=te(l.SIM_RESOLUTION),M=te(l.DYE_RESOLUTION),T=c.halfFloatTexType,P=c.formatRGBA,O=c.formatRG,Q=c.formatR,ne=c.supportLinearFiltering?a.LINEAR:a.NEAREST;a.disable(a.BLEND),V?V=z(V,M.width,M.height,P.internalFormat,P.format,T,ne):V=De(M.width,M.height,P.internalFormat,P.format,T,ne),A?A=z(A,g.width,g.height,O.internalFormat,O.format,T,ne):A=De(g.width,g.height,O.internalFormat,O.format,T,ne),J=Ee(g.width,g.height,Q.internalFormat,Q.format,T,a.NEAREST),y=Ee(g.width,g.height,Q.internalFormat,Q.format,T,a.NEAREST),R=De(g.width,g.height,Q.internalFormat,Q.format,T,a.NEAREST)}function j(){const g=[];l.SHADING&&g.push("SHADING"),be.setKeywords(g)}function te(g){const M=a.drawingBufferWidth,T=a.drawingBufferHeight,P=M/T,O=P<1?1/P:P,Q=Math.round(g),ne=Math.round(g*O);return M>T?{width:ne,height:Q}:{width:Q,height:ne}}function W(g){const M=window.devicePixelRatio||1;return Math.floor(g*M)}j(),$();let ae=Date.now(),oe=0;function me(){const g=ue();Z()&&$(),re(g),pe(),ve(g),Re(null),requestAnimationFrame(me)}function ue(){const g=Date.now();let M=(g-ae)/1e3;return M=Math.min(M,.016666),ae=g,M}function Z(){const g=W(o.clientWidth),M=W(o.clientHeight);return o.width!==g||o.height!==M?(o.width=g,o.height=M,!0):!1}function re(g){oe+=g*l.COLOR_UPDATE_SPEED,oe>=1&&(oe=ot(oe,0,1),r.forEach(M=>{M.color=He()}))}function pe(){for(const g of r)g.moved&&(g.moved=!1,X(g))}function ve(g){a.disable(a.BLEND),ie.bind(),ie.uniforms.texelSize&&a.uniform2f(ie.uniforms.texelSize,A.texelSizeX,A.texelSizeY),ie.uniforms.uVelocity&&a.uniform1i(ie.uniforms.uVelocity,A.read.attach(0)),N(y),ce.bind(),ce.uniforms.texelSize&&a.uniform2f(ce.uniforms.texelSize,A.texelSizeX,A.texelSizeY),ce.uniforms.uVelocity&&a.uniform1i(ce.uniforms.uVelocity,A.read.attach(0)),ce.uniforms.uCurl&&a.uniform1i(ce.uniforms.uCurl,y.attach(1)),ce.uniforms.curl&&a.uniform1f(ce.uniforms.curl,l.CURL),ce.uniforms.dt&&a.uniform1f(ce.uniforms.dt,g),N(A.write),A.swap(),se.bind(),se.uniforms.texelSize&&a.uniform2f(se.uniforms.texelSize,A.texelSizeX,A.texelSizeY),se.uniforms.uVelocity&&a.uniform1i(se.uniforms.uVelocity,A.read.attach(0)),N(J),le.bind(),le.uniforms.uTexture&&a.uniform1i(le.uniforms.uTexture,R.read.attach(0)),le.uniforms.value&&a.uniform1f(le.uniforms.value,l.PRESSURE),N(R.write),R.swap(),fe.bind(),fe.uniforms.texelSize&&a.uniform2f(fe.uniforms.texelSize,A.texelSizeX,A.texelSizeY),fe.uniforms.uDivergence&&a.uniform1i(fe.uniforms.uDivergence,J.attach(0));for(let T=0;T<l.PRESSURE_ITERATIONS;T++)fe.uniforms.uPressure&&a.uniform1i(fe.uniforms.uPressure,R.read.attach(1)),N(R.write),R.swap();we.bind(),we.uniforms.texelSize&&a.uniform2f(we.uniforms.texelSize,A.texelSizeX,A.texelSizeY),we.uniforms.uPressure&&a.uniform1i(we.uniforms.uPressure,R.read.attach(0)),we.uniforms.uVelocity&&a.uniform1i(we.uniforms.uVelocity,A.read.attach(1)),N(A.write),A.swap(),Y.bind(),Y.uniforms.texelSize&&a.uniform2f(Y.uniforms.texelSize,A.texelSizeX,A.texelSizeY),!c.supportLinearFiltering&&Y.uniforms.dyeTexelSize&&a.uniform2f(Y.uniforms.dyeTexelSize,A.texelSizeX,A.texelSizeY);const M=A.read.attach(0);Y.uniforms.uVelocity&&a.uniform1i(Y.uniforms.uVelocity,M),Y.uniforms.uSource&&a.uniform1i(Y.uniforms.uSource,M),Y.uniforms.dt&&a.uniform1f(Y.uniforms.dt,g),Y.uniforms.dissipation&&a.uniform1f(Y.uniforms.dissipation,l.VELOCITY_DISSIPATION),N(A.write),A.swap(),!c.supportLinearFiltering&&Y.uniforms.dyeTexelSize&&a.uniform2f(Y.uniforms.dyeTexelSize,V.texelSizeX,V.texelSizeY),Y.uniforms.uVelocity&&a.uniform1i(Y.uniforms.uVelocity,A.read.attach(0)),Y.uniforms.uSource&&a.uniform1i(Y.uniforms.uSource,V.read.attach(1)),Y.uniforms.dissipation&&a.uniform1f(Y.uniforms.dissipation,l.DENSITY_DISSIPATION),N(V.write),V.swap()}function Re(g){a.blendFunc(a.ONE,a.ONE_MINUS_SRC_ALPHA),a.enable(a.BLEND),ge(g)}function ge(g){const M=a.drawingBufferWidth,T=a.drawingBufferHeight;be.bind(),l.SHADING&&be.uniforms.texelSize&&a.uniform2f(be.uniforms.texelSize,1/M,1/T),be.uniforms.uTexture&&a.uniform1i(be.uniforms.uTexture,V.read.attach(0)),N(g,!1)}function X(g){const M=g.deltaX*l.SPLAT_FORCE,T=g.deltaY*l.SPLAT_FORCE;Te(g.texcoordX,g.texcoordY,M,T,g.color)}function _e(g){const M=He();M.r*=10,M.g*=10,M.b*=10;const T=10*(Math.random()-.5),P=30*(Math.random()-.5);Te(g.texcoordX,g.texcoordY,T,P,M)}function Te(g,M,T,P,O){q.bind(),q.uniforms.uTarget&&a.uniform1i(q.uniforms.uTarget,A.read.attach(0)),q.uniforms.aspectRatio&&a.uniform1f(q.uniforms.aspectRatio,o.width/o.height),q.uniforms.point&&a.uniform2f(q.uniforms.point,g,M),q.uniforms.color&&a.uniform3f(q.uniforms.color,T,P,0),q.uniforms.radius&&a.uniform1f(q.uniforms.radius,Pe(l.SPLAT_RADIUS/100)),N(A.write),A.swap(),q.uniforms.uTarget&&a.uniform1i(q.uniforms.uTarget,V.read.attach(0)),q.uniforms.color&&a.uniform3f(q.uniforms.color,O.r,O.g,O.b),N(V.write),V.swap()}function Pe(g){const M=o.width/o.height;return M>1&&(g*=M),g}function Ne(g,M,T,P){g.id=M,g.down=!0,g.moved=!1,g.texcoordX=T/o.width,g.texcoordY=1-P/o.height,g.prevTexcoordX=g.texcoordX,g.prevTexcoordY=g.texcoordY,g.deltaX=0,g.deltaY=0,g.color=He()}function Oe(g,M,T,P){g.prevTexcoordX=g.texcoordX,g.prevTexcoordY=g.texcoordY,g.texcoordX=M/o.width,g.texcoordY=1-T/o.height,g.deltaX=St(g.texcoordX-g.prevTexcoordX),g.deltaY=it(g.texcoordY-g.prevTexcoordY),g.moved=Math.abs(g.deltaX)>0||Math.abs(g.deltaY)>0,g.color=P}function We(g){g.down=!1}function St(g){const M=o.width/o.height;return M<1&&(g*=M),g}function it(g){const M=o.width/o.height;return M>1&&(g/=M),g}function He(){const g=ut(Math.random(),1,1);return g.r*=.15,g.g*=.15,g.b*=.15,g}function ut(g,M,T){let P=0,O=0,Q=0;const ne=Math.floor(g*6),ke=g*6-ne,Se=T*(1-M),Ie=T*(1-ke*M),Ge=T*(1-(1-ke)*M);switch(ne%6){case 0:P=T,O=Ge,Q=Se;break;case 1:P=Ie,O=T,Q=Se;break;case 2:P=Se,O=T,Q=Ge;break;case 3:P=Se,O=Ie,Q=T;break;case 4:P=Ge,O=Se,Q=T;break;case 5:P=T,O=Se,Q=Ie;break}return{r:P,g:O,b:Q}}function ot(g,M,T){const P=T-M;return(g-M)%P+M}window.addEventListener("mousedown",g=>{const M=r[0],T=W(g.clientX),P=W(g.clientY);Ne(M,-1,T,P),_e(M)});function Xe(g){const M=r[0],T=W(g.clientX),P=W(g.clientY),O=He();me(),Oe(M,T,P,O),document.body.removeEventListener("mousemove",Xe)}document.body.addEventListener("mousemove",Xe),window.addEventListener("mousemove",g=>{const M=r[0],T=W(g.clientX),P=W(g.clientY),O=M.color;Oe(M,T,P,O)});function qe(g){const M=g.targetTouches,T=r[0];for(let P=0;P<M.length;P++){const O=W(M[P].clientX),Q=W(M[P].clientY);me(),Ne(T,M[P].identifier,O,Q)}document.body.removeEventListener("touchstart",qe)}document.body.addEventListener("touchstart",qe),window.addEventListener("touchstart",g=>{const M=g.targetTouches,T=r[0];for(let P=0;P<M.length;P++){const O=W(M[P].clientX),Q=W(M[P].clientY);Ne(T,M[P].identifier,O,Q)}},!1),window.addEventListener("touchmove",g=>{const M=g.targetTouches,T=r[0];for(let P=0;P<M.length;P++){const O=W(M[P].clientX),Q=W(M[P].clientY);Oe(T,O,Q,T.color)}},!1),window.addEventListener("touchend",g=>{const M=g.changedTouches,T=r[0];for(let P=0;P<M.length;P++)We(T)}),e.watch(()=>t.simResolution,g=>{l.SIM_RESOLUTION=g,$()}),e.watch(()=>t.dyeResolution,g=>{l.DYE_RESOLUTION=g,$()}),e.watch(()=>t.shading,g=>{l.SHADING=g,j()}),me()}),(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(K)("pointer-events-none fixed left-0 top-0 z-50 size-full",t.class))},[e.createElementVNode("canvas",{id:"fluid",ref_key:"canvasRef",ref:s,class:"block h-screen w-screen"},null,512)],2))}}),xi={class:"relative h-60 w-full flex flex-col items-center justify-center gap-4"},yi={class:"flex flex-row items-center justify-center gap-4"},wi={key:0,class:"opacity-50 text-4xl font-semibold"},bi=e.defineComponent({__name:"index",props:{title:{type:String,default:void 0},classList:{type:Object,default:()=>({})}},setup(n){const t=e.ref(!1);return(i,s)=>{const o=e.resolveComponent("el-switch");return e.openBlock(),e.createElementBlock("div",xi,[e.createElementVNode("div",yi,[e.createElementVNode("span",null,e.toDisplayString(n.title),1),e.createVNode(o,{modelValue:t.value,"onUpdate:modelValue":s[0]||(s[0]=r=>t.value=r)},null,8,["modelValue"])]),t.value?(e.openBlock(),e.createElementBlock("span",wi," Hover anywhere ")):e.createCommentVNode("",!0),t.value?(e.openBlock(),e.createBlock(vi,{key:1})):e.createCommentVNode("",!0)])}}});class Ct{static instance=null;constructor(){}static getInstance(){return this.instance===null&&(this.instance=new Ct),this.instance}canPost(){return typeof window<"u"&&!!window.chrome&&!!window.chrome.webview&&typeof window.chrome.webview.postMessage=="function"}post(t){if(this.canPost())return window.chrome.webview.postMessage(t),!0}send(t,i){return this.post({type:t,payload:i})}sendRaw(t){if(this.canPost())return window.chrome.webview.postMessage(t),!0}addBehaviorRecord(t,i,s,o,r,l,a,c,u,d,m,h,f,x,v){return this.send("addBehaviorRecord",{thingId:t,thingName:i,thingCategory:s,action:o,increment:r,collectionTime:l,collectEndTime:a,softwareName:c,pageName:u,pageArea:d,previousPageName:m,previousPageArea:h,position:f,pSource:x,comments:v})}addBehaviorRecordObject(t){return this.send("addBehaviorRecord",t)}doDropCargo(t){return this.send("doDropCargo",{cargoRoad:t})}printPayData(t){return this.send("printPayData",{printJsonData:t})}sendSerialCommand(t,i){return this.send("sendSerialCommand",{command:t,isHex:i})}log(t){return this.send("log",{content:t})}CloseFaceRecognition(){return this.send("CloseFaceRecognition")}sendAction(t,i){return this.send("sendAction",{v1:t,v2:i})}facedetect(){return this.send("facedetect")}}const Ci=e.defineComponent({__name:"index",props:{title:{type:String,default:void 0},class:{type:String,default:void 0},classList:{type:Object,default:()=>({})},events:{type:Object,default:()=>({emitEventName:void 0,emitPayload:void 0,postToWebview:!1})},onCustomClick:{type:Function,default:void 0}},emits:["click"],setup(n,{emit:t}){const i=n,s=e.computed(()=>{const d=i.classList&&i.classList.Location||{};return[d.position,d.width,d.height,d.left,d.top].filter(Boolean)}),o=e.computed(()=>i.title??"Button"),r=e.ref(null),l=Vt.useRouter(),a=t,c=d=>{if(!Array.isArray(d)||d.length===0)return null;const m=d[0];if(typeof m!="string")return null;const h=m.match(/^s:navigate\?page=([^&\s]+)/);return h?{type:"navigate",page:h[1]}:{type:"custom",command:m}},u=d=>{if(a("click",d),i.onCustomClick&&typeof i.onCustomClick=="function"){i.onCustomClick({event:d,events:i.events,payload:i.events.emitPayload});return}const m=i.events.emitPayload,h=m?.Data;if(i.events.postToWebview===!0){try{const f=Ct.getInstance(),x=m||{PageName:"unknown",ControlName:"IButtonComp",Data:h||[]};console.log("Posting to WebView via bridge:",x),f.sendRaw(x)||console.warn("WebView bridge not available; message not sent")}catch(f){console.warn("Failed to postMessage to webview",f)}return}if(h&&Array.isArray(h)){const f=c(h);if(f?.type==="navigate"&&f.page){console.log("Navigating to page:",f.page),l.push(`/${f.page}`);return}}if(i.events.emitEventName){const f={payload:m,originalEvent:d};console.log("Dispatching custom event:",i.events.emitEventName,f),window.dispatchEvent(new CustomEvent(i.events.emitEventName,{detail:f}))}};return(d,m)=>(e.openBlock(),e.createElementBlock("button",e.mergeProps({ref_key:"buttonRef",ref:r},d.$attrs,{onClick:u,class:e.unref(K)(n.classList?.buttonClass,i.class,s.value)}),[e.createElementVNode("div",{class:e.normalizeClass(e.unref(K)(n.classList?.containerClass))},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(K)(n.classList?.dotClass))},null,2),e.createElementVNode("span",{class:e.normalizeClass(e.unref(K)(n.classList?.textClass))},e.toDisplayString(o.value),3)],2),e.createElementVNode("div",{class:e.normalizeClass(e.unref(K)(n.classList?.hoverContainerClass))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(K)(n.classList?.hoverTextClass))},e.toDisplayString(o.value),3),(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(e.unref(K)(n.classList?.iconClass))},[...m[0]||(m[0]=[e.createElementVNode("path",{d:"M5 12h14"},null,-1),e.createElementVNode("path",{d:"m12 5 7 7-7 7"},null,-1)])],2))],2)],16))}}),Ei=e.defineComponent({__name:"IconCloud",props:{class:{},images:{}},setup(n){const t=n,{images:i}=t,s=e.ref(null),o=e.ref(0),r=e.ref([]),l=e.ref([]),a=e.ref([]),c=e.reactive({x:0,y:0}),u=e.ref(!1),d=e.reactive({x:0,y:0}),m=e.reactive({x:0,y:0}),h=e.ref(null);function f(p){return 1-(1-p)**3}e.watchEffect(()=>{if(!i)return;l.value=new Array(i.length).fill(!1);const p=i.map((_,k)=>{const b=document.createElement("canvas");b.width=40,b.height=40;const I=b.getContext("2d");if(!I)return b;const U=new Image;return U.crossOrigin="anonymous",U.src=_,U.onload=()=>{I.clearRect(0,0,b.width,b.height),I.beginPath(),I.arc(20,20,20,0,Math.PI*2),I.closePath(),I.clip(),I.drawImage(U,0,0,40,40),l.value[k]=!0},b});r.value=p}),e.watchEffect(()=>{const p=i?.length||0;if(p===0){a.value=[];return}const _=[],k=2/p,b=Math.PI*(3-Math.sqrt(5));for(let I=0;I<p;I++){const U=I*k-1+k/2,H=Math.sqrt(1-U*U),E=I*b,C=Math.cos(E)*H,S=Math.sin(E)*H;_.push({x:C*100,y:U*100,z:S*100,scale:1,opacity:1,id:I})}a.value=_});function x(p){const _=s.value;if(!_)return;const k=_.getBoundingClientRect(),b=p.clientX-k.left,I=p.clientY-k.top;_.getContext("2d")&&(a.value.forEach(H=>{const E=Math.cos(c.x),C=Math.sin(c.x),S=Math.cos(c.y),D=Math.sin(c.y),B=H.x*S-H.z*D,L=H.x*D+H.z*S,N=H.y*E+L*C,V=_.width/2+B,A=_.height/2+N,y=20*((L+200)/300),R=b-V,G=I-A;if(R*R+G*G<y*y){const le=-Math.atan2(H.y,Math.sqrt(H.x*H.x+H.z*H.z)),q=Math.atan2(H.x,H.z),Y=c.x,se=c.y,ie=Math.sqrt((le-Y)**2+(q-se)**2),ce=Math.min(2e3,Math.max(800,ie*1e3));h.value={x:le,y:q,startX:Y,startY:se,distance:ie,startTime:performance.now(),duration:ce};return}}),u.value=!0,d.x=p.clientX,d.y=p.clientY)}function v(p){const _=s.value;if(!_)return;const k=_.getBoundingClientRect();if(m.x=p.clientX-k.left,m.y=p.clientY-k.top,u.value){const b=p.clientX-d.x,I=p.clientY-d.y;c.x+=I*.002,c.y+=b*.002,d.x=p.clientX,d.y=p.clientY}}function w(){u.value=!1}return e.onMounted(()=>{const p=s.value;if(!p)return;const _=p.getContext("2d");if(!_)return;function k(){if(!_||!p)return;_.clearRect(0,0,p.width,p.height);const b=p.width/2,I=p.height/2,U=m.x-b,H=m.y-I,E=Math.sqrt(b*b+I*I),S=.003+Math.sqrt(U*U+H*H)/E*.01;if(h.value){const{startX:D,startY:B,x:L,y:N,startTime:V,duration:A}=h.value,J=performance.now()-V,y=Math.min(1,J/A),R=f(y);c.x=D+(L-D)*R,c.y=B+(N-B)*R,y>=1&&(h.value=null)}else u.value||(c.x+=H/p.height*S,c.y+=U/p.width*S);a.value.forEach((D,B)=>{const L=Math.cos(c.x),N=Math.sin(c.x),V=Math.cos(c.y),A=Math.sin(c.y),J=D.x*V-D.z*A,y=D.x*A+D.z*V,R=D.y*L+y*N,G=(y+200)/300,le=Math.max(.2,Math.min(1,(y+150)/200));_.save(),_.translate(b+J,I+R),_.scale(G,G),_.globalAlpha=le,r.value[B]&&l.value[B]&&_.drawImage(r.value[B],-20,-20,40,40),_.restore()}),o.value=requestAnimationFrame(k)}o.value=requestAnimationFrame(k)}),e.onBeforeUnmount(()=>{o.value&&cancelAnimationFrame(o.value)}),(p,_)=>(e.openBlock(),e.createElementBlock("canvas",{ref_key:"canvasRef",ref:s,width:"300",height:"300",class:e.normalizeClass(e.unref(K)("rounded-lg",p.$props.class)),role:"img","aria-label":"Interactive 3D Image Cloud",onMousedown:x,onMousemove:v,onMouseup:w,onMouseleave:w},null,34))}}),ki=e.defineComponent({__name:"index",props:{slugs:{default:()=>["typescript","javascript","dart","java","react","flutter","android","html5","css3","nodedotjs","express","nextdotjs","prisma","amazonaws","postgresql","firebase","nginx","vercel","testinglibrary","jest","cypress","docker","git","jira","github","gitlab","visualstudiocode","androidstudio","sonarqube","figma"]},useColorSlugAsColor:{type:Boolean,default:!0},classList:{default:()=>({})}},setup(n){const t=n,i=e.computed(()=>t.slugs.map(o=>o)),s=e.computed(()=>{const o=t.classList?.Location,r=[];return t.classList?.overallClass?r.push(t.classList.overallClass):r.push("grid place-content-center p-6"),o?.width&&r.push(o.width),o?.height&&r.push(o.height),o?.position&&r.push(o.position),o?.left&&r.push(o.left),o?.top&&r.push(o.top),r.join(" ")});return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(s.value)},[e.createVNode(Ei,{images:i.value},null,8,["images"])],2))}}),Si=["placeholder"],_i=100,Ti=e.defineComponent({inheritAttrs:!1,__name:"index",props:{defaultValue:{},modelValue:{},placeholder:{},class:{},containerClass:{},classList:{}},emits:["update:modelValue"],setup(n,{emit:t}){const i=n,s=t,o=Ce.useVModel(i,"modelValue",s,{passive:!0,defaultValue:i.defaultValue}),r=e.ref(null),l=e.ref({x:0,y:0}),a=e.ref(!1),c=e.computed(()=>`
405
405
  radial-gradient(
406
406
  ${a.value?_i+"px":"0px"} circle at ${l.value.x}px ${l.value.y}px,
407
407
  rgba(59,130,246,0.45),
package/dist/index.mjs CHANGED
@@ -3337,11 +3337,19 @@ const Yr = /* @__PURE__ */ V({
3337
3337
  type: Object,
3338
3338
  default: () => ({})
3339
3339
  },
3340
- events: { type: Object, default: () => ({
3341
- emitEventName: void 0,
3342
- emitPayload: void 0,
3343
- postToWebview: !1
3344
- }) }
3340
+ events: {
3341
+ type: Object,
3342
+ default: () => ({
3343
+ emitEventName: void 0,
3344
+ emitPayload: void 0,
3345
+ postToWebview: !1
3346
+ })
3347
+ },
3348
+ // 外部传入的自定义点击处理函数
3349
+ onCustomClick: {
3350
+ type: Function,
3351
+ default: void 0
3352
+ }
3345
3353
  },
3346
3354
  emits: ["click"],
3347
3355
  setup(a, { emit: e }) {
@@ -3355,7 +3363,14 @@ const Yr = /* @__PURE__ */ V({
3355
3363
  const d = h.match(/^s:navigate\?page=([^&\s]+)/);
3356
3364
  return d ? { type: "navigate", page: d[1] } : { type: "custom", command: h };
3357
3365
  }, c = (u) => {
3358
- n("click", u);
3366
+ if (n("click", u), s.onCustomClick && typeof s.onCustomClick == "function") {
3367
+ s.onCustomClick({
3368
+ event: u,
3369
+ events: s.events,
3370
+ payload: s.events.emitPayload
3371
+ });
3372
+ return;
3373
+ }
3359
3374
  const h = s.events.emitPayload, d = h?.Data;
3360
3375
  if (s.events.postToWebview === !0) {
3361
3376
  try {
@@ -19,6 +19,10 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
19
19
  postToWebview: boolean;
20
20
  };
21
21
  };
22
+ onCustomClick: {
23
+ type: FunctionConstructor;
24
+ default: undefined;
25
+ };
22
26
  }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
23
27
  click: (...args: any[]) => void;
24
28
  }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
@@ -42,6 +46,10 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
42
46
  postToWebview: boolean;
43
47
  };
44
48
  };
49
+ onCustomClick: {
50
+ type: FunctionConstructor;
51
+ default: undefined;
52
+ };
45
53
  }>> & Readonly<{
46
54
  onClick?: ((...args: any[]) => any) | undefined;
47
55
  }>, {
@@ -49,6 +57,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
49
57
  title: string;
50
58
  classList: Record<string, any>;
51
59
  events: Record<string, any>;
60
+ onCustomClick: Function;
52
61
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
53
62
  buttonRef: HTMLButtonElement;
54
63
  }, HTMLButtonElement>;
@@ -2,6 +2,17 @@ interface ComponentConfig {
2
2
  type: string;
3
3
  conf?: Record<string, any>;
4
4
  }
5
+ /**
6
+ * 注册自定义事件处理器
7
+ * @param name - 处理器名称(在配置中引用)
8
+ * @param handler - 处理函数
9
+ */
10
+ export declare function registerEventHandler(name: string, handler: Function): void;
11
+ /**
12
+ * 获取已注册的事件处理器
13
+ * @param name - 处理器名称
14
+ */
15
+ export declare function getEventHandler(name: string): Function | undefined;
5
16
  interface PageConfig {
6
17
  components?: ComponentConfig[];
7
18
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "troncell-vue-component",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "A collection of beautiful Vue 3 UI components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",