@maudecode/cove 2026.2.13 → 2026.2.17
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/README.md +5 -0
- package/dist/assets/400-BMkBL_OY.css +1 -0
- package/dist/assets/400-Bigd7ufU.css +1 -0
- package/dist/assets/400-DIm2vEr-.css +1 -0
- package/dist/assets/400-QlzHorXL.css +1 -0
- package/dist/assets/400-WFOKBYV6.css +1 -0
- package/dist/assets/400-lAWKXRoJ.css +1 -0
- package/dist/assets/500-C9oGlv8Y.css +1 -0
- package/dist/assets/500-CQUBMBhA.css +1 -0
- package/dist/assets/500-CRBx2u7m.css +1 -0
- package/dist/assets/500-DnnFFs0Q.css +1 -0
- package/dist/assets/500-QKfiiXYO.css +1 -0
- package/dist/assets/600-B7Ikl3KO.css +1 -0
- package/dist/assets/600-BRVR-SPy.css +1 -0
- package/dist/assets/600-BmBzHULK.css +1 -0
- package/dist/assets/600-C2ZgMpi4.css +1 -0
- package/dist/assets/600-D8Jk2OB9.css +1 -0
- package/dist/assets/CanvasPanel-Dx2GXBHI.js +12 -0
- package/dist/assets/fira-code-cyrillic-400-normal-UC0NFL4U.woff2 +0 -0
- package/dist/assets/fira-code-cyrillic-400-normal-dc1q3VD7.woff +0 -0
- package/dist/assets/fira-code-cyrillic-500-normal-Bu7VCL72.woff +0 -0
- package/dist/assets/fira-code-cyrillic-500-normal-CX35h3Mg.woff2 +0 -0
- package/dist/assets/fira-code-cyrillic-600-normal-BD56RyRT.woff +0 -0
- package/dist/assets/fira-code-cyrillic-600-normal-CPRdbepc.woff2 +0 -0
- package/dist/assets/fira-code-cyrillic-ext-400-normal-Buh61xzB.woff +0 -0
- package/dist/assets/fira-code-cyrillic-ext-400-normal-txZ9Fk_1.woff2 +0 -0
- package/dist/assets/fira-code-cyrillic-ext-500-normal-CYRspHgm.woff2 +0 -0
- package/dist/assets/fira-code-cyrillic-ext-500-normal-CwtLmSFD.woff +0 -0
- package/dist/assets/fira-code-cyrillic-ext-600-normal-B9wE0zmr.woff2 +0 -0
- package/dist/assets/fira-code-cyrillic-ext-600-normal-DldcyWhZ.woff +0 -0
- package/dist/assets/fira-code-greek-400-normal-B2Gh_Y8s.woff2 +0 -0
- package/dist/assets/fira-code-greek-400-normal-DobhaxvF.woff +0 -0
- package/dist/assets/fira-code-greek-500-normal-CVO0IRNt.woff2 +0 -0
- package/dist/assets/fira-code-greek-500-normal-DEXIWiey.woff +0 -0
- package/dist/assets/fira-code-greek-600-normal-D_h3X2X5.woff +0 -0
- package/dist/assets/fira-code-greek-600-normal-Dxp52_By.woff2 +0 -0
- package/dist/assets/fira-code-greek-ext-400-normal-DR7mBgIM.woff2 +0 -0
- package/dist/assets/fira-code-greek-ext-400-normal-DSPUheWg.woff +0 -0
- package/dist/assets/fira-code-greek-ext-500-normal-BO3iq16n.woff2 +0 -0
- package/dist/assets/fira-code-greek-ext-500-normal-CMiNLXER.woff +0 -0
- package/dist/assets/fira-code-greek-ext-600-normal-C-cQDoOk.woff +0 -0
- package/dist/assets/fira-code-greek-ext-600-normal-DtBpFRLc.woff2 +0 -0
- package/dist/assets/fira-code-latin-400-normal-C-QZfXAs.woff +0 -0
- package/dist/assets/fira-code-latin-400-normal-DGosTW8U.woff2 +0 -0
- package/dist/assets/fira-code-latin-500-normal-B6gioGu8.woff2 +0 -0
- package/dist/assets/fira-code-latin-500-normal-aMLC2AMm.woff +0 -0
- package/dist/assets/fira-code-latin-600-normal-BmSSHshu.woff +0 -0
- package/dist/assets/fira-code-latin-600-normal-CvYZpPHg.woff2 +0 -0
- package/dist/assets/fira-code-latin-ext-400-normal-DG73JjOf.woff +0 -0
- package/dist/assets/fira-code-latin-ext-400-normal-KSMg0QLl.woff2 +0 -0
- package/dist/assets/fira-code-latin-ext-500-normal-CaANqXjI.woff +0 -0
- package/dist/assets/fira-code-latin-ext-500-normal-Crd9e_oI.woff2 +0 -0
- package/dist/assets/fira-code-latin-ext-600-normal-0PFQL1eg.woff +0 -0
- package/dist/assets/fira-code-latin-ext-600-normal-Cb7jxoAi.woff2 +0 -0
- package/dist/assets/fira-code-symbols2-400-normal-_QEZCEwe.woff +0 -0
- package/dist/assets/fira-code-symbols2-500-normal-DwsgbIjQ.woff +0 -0
- package/dist/assets/fira-code-symbols2-600-normal-Dvq6IQE5.woff +0 -0
- package/dist/assets/index-BNzzAKO0.css +1 -0
- package/dist/assets/index-Dud32C8a.js +443 -0
- package/dist/assets/jetbrains-mono-cyrillic-400-normal-BEIGL1Tu.woff2 +0 -0
- package/dist/assets/jetbrains-mono-cyrillic-400-normal-ugxPyKxw.woff +0 -0
- package/dist/assets/jetbrains-mono-cyrillic-500-normal-DJqRU3vO.woff +0 -0
- package/dist/assets/jetbrains-mono-cyrillic-500-normal-DmUKJPL_.woff2 +0 -0
- package/dist/assets/jetbrains-mono-cyrillic-600-normal-8K4wrrwR.woff +0 -0
- package/dist/assets/jetbrains-mono-cyrillic-600-normal-EVf6-Yzo.woff2 +0 -0
- package/dist/assets/jetbrains-mono-greek-400-normal-B9oWc5Lo.woff +0 -0
- package/dist/assets/jetbrains-mono-greek-400-normal-C190GLew.woff2 +0 -0
- package/dist/assets/jetbrains-mono-greek-500-normal-D7SFKleX.woff +0 -0
- package/dist/assets/jetbrains-mono-greek-500-normal-JpySY46c.woff2 +0 -0
- package/dist/assets/jetbrains-mono-greek-600-normal-H7WoG9Et.woff2 +0 -0
- package/dist/assets/jetbrains-mono-greek-600-normal-mc2nkWzM.woff +0 -0
- package/dist/assets/jetbrains-mono-latin-400-normal-6-qcROiO.woff +0 -0
- package/dist/assets/jetbrains-mono-latin-400-normal-V6pRDFza.woff2 +0 -0
- package/dist/assets/jetbrains-mono-latin-500-normal-BWZEU5yA.woff2 +0 -0
- package/dist/assets/jetbrains-mono-latin-500-normal-CJOVTJB7.woff +0 -0
- package/dist/assets/jetbrains-mono-latin-600-normal-BfsvjouI.woff +0 -0
- package/dist/assets/jetbrains-mono-latin-600-normal-C8RAYTDA.woff2 +0 -0
- package/dist/assets/jetbrains-mono-latin-ext-400-normal-Bc8Ftmh3.woff2 +0 -0
- package/dist/assets/jetbrains-mono-latin-ext-400-normal-fXTG6kC5.woff +0 -0
- package/dist/assets/jetbrains-mono-latin-ext-500-normal-Cut-4mMH.woff2 +0 -0
- package/dist/assets/jetbrains-mono-latin-ext-500-normal-ckzbgY84.woff +0 -0
- package/dist/assets/jetbrains-mono-latin-ext-600-normal-BfB_LPfz.woff2 +0 -0
- package/dist/assets/jetbrains-mono-latin-ext-600-normal-DObL3zCW.woff +0 -0
- package/dist/assets/jetbrains-mono-vietnamese-400-normal-CqNFfHCs.woff +0 -0
- package/dist/assets/jetbrains-mono-vietnamese-500-normal-DNRqzVM1.woff +0 -0
- package/dist/assets/jetbrains-mono-vietnamese-600-normal-OWROknRo.woff +0 -0
- package/dist/assets/source-code-pro-cyrillic-400-normal-BxAVGXSA.woff +0 -0
- package/dist/assets/source-code-pro-cyrillic-400-normal-zAQh90eX.woff2 +0 -0
- package/dist/assets/source-code-pro-cyrillic-500-normal-B11lr0U2.woff +0 -0
- package/dist/assets/source-code-pro-cyrillic-500-normal-ByWPmmoj.woff2 +0 -0
- package/dist/assets/source-code-pro-cyrillic-600-normal-BNz7v_mr.woff2 +0 -0
- package/dist/assets/source-code-pro-cyrillic-600-normal-DUFre9N-.woff +0 -0
- package/dist/assets/source-code-pro-cyrillic-ext-400-normal-BlBdefdy.woff +0 -0
- package/dist/assets/source-code-pro-cyrillic-ext-400-normal-DMj7z5uw.woff2 +0 -0
- package/dist/assets/source-code-pro-cyrillic-ext-500-normal-Czknif28.woff +0 -0
- package/dist/assets/source-code-pro-cyrillic-ext-500-normal-tqeAES4j.woff2 +0 -0
- package/dist/assets/source-code-pro-cyrillic-ext-600-normal-Bk2yO1tA.woff2 +0 -0
- package/dist/assets/source-code-pro-cyrillic-ext-600-normal-Dlnx0AYk.woff +0 -0
- package/dist/assets/source-code-pro-greek-400-normal-D-pDoyqc.woff +0 -0
- package/dist/assets/source-code-pro-greek-400-normal-loYmywBR.woff2 +0 -0
- package/dist/assets/source-code-pro-greek-500-normal-C6-i8gwR.woff2 +0 -0
- package/dist/assets/source-code-pro-greek-500-normal-TDi6g5fW.woff +0 -0
- package/dist/assets/source-code-pro-greek-600-normal-D1ll-qYC.woff2 +0 -0
- package/dist/assets/source-code-pro-greek-600-normal-lDQpIXR8.woff +0 -0
- package/dist/assets/source-code-pro-latin-400-normal-Bf_aQirX.woff +0 -0
- package/dist/assets/source-code-pro-latin-400-normal-DEXWLoHG.woff2 +0 -0
- package/dist/assets/source-code-pro-latin-500-normal-DrRT_DWv.woff2 +0 -0
- package/dist/assets/source-code-pro-latin-500-normal-FgltuOLy.woff +0 -0
- package/dist/assets/source-code-pro-latin-600-normal-B5rj6vMs.woff +0 -0
- package/dist/assets/source-code-pro-latin-600-normal-DVVSlvOB.woff2 +0 -0
- package/dist/assets/source-code-pro-latin-ext-400-normal-C8wU-ygL.woff2 +0 -0
- package/dist/assets/source-code-pro-latin-ext-400-normal-GB-6ZST1.woff +0 -0
- package/dist/assets/source-code-pro-latin-ext-500-normal-BCopTyd8.woff +0 -0
- package/dist/assets/source-code-pro-latin-ext-500-normal-DcnsLkKi.woff2 +0 -0
- package/dist/assets/source-code-pro-latin-ext-600-normal-CdOS3fMr.woff +0 -0
- package/dist/assets/source-code-pro-latin-ext-600-normal-kg67jYQv.woff2 +0 -0
- package/dist/assets/source-code-pro-vietnamese-400-normal-CSQ0MR64.woff +0 -0
- package/dist/assets/source-code-pro-vietnamese-400-normal-Cp62Zi-a.woff2 +0 -0
- package/dist/assets/source-code-pro-vietnamese-500-normal-9qef99rm.woff2 +0 -0
- package/dist/assets/source-code-pro-vietnamese-500-normal-Di6EYwJE.woff +0 -0
- package/dist/assets/source-code-pro-vietnamese-600-normal-BG1XwByG.woff +0 -0
- package/dist/assets/source-code-pro-vietnamese-600-normal-CWDSnRUT.woff2 +0 -0
- package/dist/confused-lobster.png +0 -0
- package/dist/index.html +2 -2
- package/package.json +15 -10
- package/dist/assets/CanvasPanel-B6DhcK2j.js +0 -12
- package/dist/assets/index-B3H4uilc.js +0 -426
- package/dist/assets/index-CzHQWoDQ.css +0 -1
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/index.html
CHANGED
|
@@ -85,8 +85,8 @@
|
|
|
85
85
|
}
|
|
86
86
|
})();
|
|
87
87
|
</script>
|
|
88
|
-
<script type="module" crossorigin src="/assets/index-
|
|
89
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
88
|
+
<script type="module" crossorigin src="/assets/index-Dud32C8a.js"></script>
|
|
89
|
+
<link rel="stylesheet" crossorigin href="/assets/index-BNzzAKO0.css">
|
|
90
90
|
</head>
|
|
91
91
|
<body>
|
|
92
92
|
<div id="app"></div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maudecode/cove",
|
|
3
|
-
"version": "2026.2.
|
|
3
|
+
"version": "2026.2.17",
|
|
4
4
|
"description": "A beautiful, full-featured WebUI for OpenClaw",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -45,39 +45,44 @@
|
|
|
45
45
|
"typecheck": "tsc -b --noEmit",
|
|
46
46
|
"knip": "knip",
|
|
47
47
|
"check": "bun run lint && bun run format:check && bun run typecheck && pnpm knip",
|
|
48
|
+
"i18n:check": "bun scripts/check-i18n.ts",
|
|
49
|
+
"i18n:fix": "bun scripts/check-i18n.ts --fix",
|
|
48
50
|
"prepare": "husky",
|
|
49
51
|
"serve": "bun run server.ts",
|
|
50
52
|
"start": "NODE_ENV=production bun run server.ts",
|
|
51
53
|
"server": "bun run server.ts"
|
|
52
54
|
},
|
|
53
55
|
"dependencies": {
|
|
56
|
+
"@fontsource/fira-code": "^5.2.7",
|
|
54
57
|
"@fontsource/geist-sans": "^5.2.5",
|
|
55
58
|
"@fontsource/inter": "^5.2.8",
|
|
59
|
+
"@fontsource/jetbrains-mono": "^5.2.8",
|
|
56
60
|
"@fontsource/opendyslexic": "^5.2.5",
|
|
57
|
-
"@
|
|
61
|
+
"@fontsource/source-code-pro": "^5.2.7",
|
|
62
|
+
"@preact/signals": "^2.8.1",
|
|
58
63
|
"dompurify": "^3.3.1",
|
|
59
64
|
"lucide-preact": "^0.563.0",
|
|
60
|
-
"marked": "^17.0.
|
|
65
|
+
"marked": "^17.0.3",
|
|
61
66
|
"preact": "^10.28.3",
|
|
62
67
|
"preact-router": "^4.1.2",
|
|
63
68
|
"prismjs": "^1.30.0",
|
|
64
|
-
"simple-icons": "^16.
|
|
69
|
+
"simple-icons": "^16.9.0",
|
|
65
70
|
"tokenx": "^1.3.0"
|
|
66
71
|
},
|
|
67
72
|
"devDependencies": {
|
|
68
73
|
"@commitlint/cli": "^20.4.1",
|
|
69
74
|
"@commitlint/config-conventional": "^20.4.1",
|
|
70
75
|
"@preact/preset-vite": "^2.10.3",
|
|
71
|
-
"@tailwindcss/vite": "^4.
|
|
76
|
+
"@tailwindcss/vite": "^4.2.0",
|
|
72
77
|
"@types/dompurify": "^3.2.0",
|
|
73
|
-
"@types/node": "^25.
|
|
74
|
-
"@types/prismjs": "^1.26.
|
|
78
|
+
"@types/node": "^25.3.0",
|
|
79
|
+
"@types/prismjs": "^1.26.6",
|
|
75
80
|
"conventional-changelog-cli": "^5.0.0",
|
|
76
81
|
"husky": "^9.1.7",
|
|
77
|
-
"knip": "^5.
|
|
82
|
+
"knip": "^5.84.1",
|
|
78
83
|
"oxfmt": "^0.28.0",
|
|
79
|
-
"oxlint": "^1.
|
|
80
|
-
"tailwindcss": "^4.
|
|
84
|
+
"oxlint": "^1.48.0",
|
|
85
|
+
"tailwindcss": "^4.2.0",
|
|
81
86
|
"typescript": "~5.9.3",
|
|
82
87
|
"vite": "^7.3.1",
|
|
83
88
|
"vitepress": "^1.6.4"
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import{c as $,A as W,q as A,y as j,i as c,p as E,a as T,H as q,D as B,d as r,b as L,e as Y,M as R,f as G,g as X,h as J,j as ie,k as ce,l as Q,m as V,n as Z,o as ee,r as m,s as ue,t as de,u as ve,v as he,w as t,x as D,I as _,E as te,X as ne,C as ae,z as me,B as oe,F as fe,G as pe,J as we,L as se}from"./index-B3H4uilc.js";const xe=$("grip-horizontal",[["circle",{cx:"12",cy:"9",r:"1",key:"124mty"}],["circle",{cx:"19",cy:"9",r:"1",key:"1ruzo2"}],["circle",{cx:"5",cy:"9",r:"1",key:"1a8b28"}],["circle",{cx:"12",cy:"15",r:"1",key:"1e56xg"}],["circle",{cx:"19",cy:"15",r:"1",key:"1a92ep"}],["circle",{cx:"5",cy:"15",r:"1",key:"5r1jwy"}]]);const ge=$("maximize-2",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]]);const ye=$("minimize-2",[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]]);const be=$("picture-in-picture-2",[["path",{d:"M21 9V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v10c0 1.1.9 2 2 2h4",key:"daa4of"}],["rect",{width:"10",height:"7",x:"12",y:"13",rx:"2",key:"1nb8gs"}]]);function Me(){const I=W(!1),a=W(!1),d=W({x:0,y:0,panelX:0,panelY:0}),l=W({x:0,y:0,width:0,height:0,panelX:0,panelY:0}),P=W(""),O=A(s=>{if(s.target.closest("button"))return;s.preventDefault(),I.current=!0,X.value=!0;const u=J(s);d.current={x:u.x,y:u.y,panelX:E.value,panelY:T.value},document.body.style.cursor="grabbing",document.body.style.userSelect="none"},[]),U=A((s,u)=>{s.preventDefault(),"stopPropagation"in s&&s.stopPropagation(),a.current=!0,X.value=!0,P.current=u;const v=J(s);l.current={x:v.x,y:v.y,width:L.value,height:Y.value,panelX:E.value,panelY:T.value};const z={n:"n-resize",s:"s-resize",e:"e-resize",w:"w-resize",ne:"ne-resize",nw:"nw-resize",se:"se-resize",sw:"sw-resize"};document.body.style.cursor=z[u]||"nwse-resize",document.body.style.userSelect="none"},[]),N=A(s=>{s.preventDefault(),a.current=!0,X.value=!0,l.current={x:s.clientX,y:s.clientY,width:L.value,height:Y.value,panelX:E.value,panelY:T.value},document.body.style.userSelect="none";const u=window.innerWidth*ie,v=window.innerHeight*ce,z=S=>{if(r.value==="left"){const n=S.clientX-l.current.x;L.value=Math.min(u,Math.max(R,l.current.width+n))}else if(r.value==="right"){const n=l.current.x-S.clientX;L.value=Math.min(u,Math.max(R,l.current.width+n))}else if(r.value==="top"){const n=S.clientY-l.current.y;Y.value=Math.min(v,Math.max(G,l.current.height+n))}},H=()=>{a.current=!1,X.value=!1,document.body.style.userSelect="",document.removeEventListener("mousemove",z),document.removeEventListener("mouseup",H)};document.addEventListener("mousemove",z),document.addEventListener("mouseup",H)},[]);return j(()=>{const s=(n,f)=>{if(I.current){const y=window.innerWidth,e=window.innerHeight;if(c.value){const o=n-d.current.x,b=f-d.current.y,p=d.current.panelX+o,M=d.current.panelY+b,h=200;E.value=Math.max(0,Math.min(p,y-h)),T.value=Math.max(0,Math.min(M,e-q));return}if(n<B)r.value="left";else if(n>y-B)r.value="right";else if(f<B)r.value="top";else{if(r.value!=="floating")E.value=Math.max(0,Math.min(n-L.value/2,y-L.value)),T.value=Math.max(0,Math.min(f-q/2,e-Y.value)),d.current={x:n,y:f,panelX:E.value,panelY:T.value};else{const o=n-d.current.x,b=f-d.current.y,p=d.current.panelX+o,M=d.current.panelY+b;E.value=Math.max(0,Math.min(p,y-L.value)),T.value=Math.max(0,Math.min(M,e-Y.value))}r.value="floating"}}if(a.current&&r.value==="floating"){const y=P.current,{x:e,y:o,width:b,height:p}=l.current,M=window.innerWidth,h=window.innerHeight;let i=b,k=p,C=l.current.panelX,w=l.current.panelY;if(y.includes("e")&&(i=Math.max(R,b+(n-e))),y.includes("w")){const x=e-n,g=b+x;g>=R&&(i=g,C=l.current.panelX-x)}if(y.includes("s")&&(k=Math.max(G,p+(f-o))),y.includes("n")){const x=o-f,g=p+x;g>=G&&(k=g,w=l.current.panelY-x)}C+i>M&&(i=M-C),w+k>h&&(k=h-w),C<0&&(i+=C,C=0),w<0&&(k+=w,w=0),L.value=Math.max(R,i),Y.value=Math.max(G,k),E.value=Math.max(0,C),T.value=Math.max(0,w)}},u=()=>{(I.current||a.current)&&(I.current=!1,a.current=!1,X.value=!1,document.body.style.cursor="",document.body.style.userSelect="")},v=n=>s(n.clientX,n.clientY),z=n=>{if(n.touches.length===1){const f=n.touches[0];s(f.clientX,f.clientY)}},H=()=>u(),S=()=>u();return document.addEventListener("mousemove",v),document.addEventListener("mouseup",H),document.addEventListener("touchmove",z,{passive:!1}),document.addEventListener("touchend",S),()=>{document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",H),document.removeEventListener("touchmove",z),document.removeEventListener("touchend",S)}},[]),{handleDragStart:O,handleResizeStart:U,handleDockedResizeStart:N}}function ze(){if(V.value&&!m.value){if(pe.value)return;m.value=!0,c.value=!1}else!V.value&&m.value&&(m.value=!1)}const re=we(typeof window<"u"&&window.innerWidth<se);typeof window<"u"&&window.addEventListener("resize",()=>{re.value=window.innerWidth<se});const Se=100;function De(){const{handleDragStart:I,handleResizeStart:a,handleDockedResizeStart:d}=Me(),[l,P]=Q(0),[O,U]=Q(!1),N=W(0),s=W(null),u=W(null);j(()=>V.subscribe(ze),[]),j(()=>Z.subscribe(e=>{if(!e)return;const{js:o,resolve:b,reject:p}=e;Z.value=null;const M=s.current;if(!M?.contentWindow){p("No iframe available for eval");return}try{const h=M.contentWindow.eval(o);b(h)}catch(h){p(String(h))}}),[]),j(()=>ee.subscribe(e=>{if(!e)return;const{maxWidth:o,quality:b,outputFormat:p,resolve:M,reject:h}=e;ee.value=null;try{const i=u.current;if(i&&i.complete){const w=document.createElement("canvas");let x=i.naturalWidth||i.width||100,g=i.naturalHeight||i.height||100;if(x>o||g>o){const K=o/Math.max(x,g);x=Math.round(x*K),g=Math.round(g*K)}w.width=x,w.height=g;const F=w.getContext("2d");if(F){F.drawImage(i,0,0,x,g);const K=p==="png"?"image/png":"image/jpeg",le=w.toDataURL(K,b);M(le);return}}const k=s.current;if(!k?.contentWindow){h("No canvas content available for snapshot (no img or iframe ref)");return}if(!k.contentDocument){h("Cannot access iframe document (cross-origin?)");return}h("HTML snapshot not yet implemented - use images for now")}catch(i){h(`Snapshot failed: ${i}`)}}),[]),j(()=>{const e=o=>{o.key==="Escape"&&m.value&&(m.value=!1),(o.metaKey||o.ctrlKey)&&o.shiftKey&&o.key==="c"&&(o.preventDefault(),m.value=!m.value)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[]);const v=ue.value,z=de.value,H=ve.value,S=he.value;if(!m.value)return null;const n=e=>{N.current=e.touches[0].clientY,U(!0)},f=e=>{if(!O)return;const o=e.touches[0].clientY-N.current;P(Math.max(0,o))},y=()=>{U(!1),l>Se&&(m.value=!1),P(0)};return re.value?t("div",{class:`fixed inset-x-0 bottom-0 z-50 bg-[var(--color-bg-surface)] rounded-t-2xl border-t border-[var(--color-border)] shadow-soft-xl flex flex-col ${O?"":"transition-transform duration-200"}`,style:{height:"70vh",maxHeight:"70vh",transform:`translateY(${l}px)`},children:[t("div",{class:"flex flex-col items-center pt-2 pb-1 cursor-grab active:cursor-grabbing touch-none",onTouchStart:n,onTouchMove:f,onTouchEnd:y,children:t("div",{class:"w-10 h-1 bg-[var(--color-border)] rounded-full"})}),t("div",{class:"flex items-center justify-between px-4 py-2 border-b border-[var(--color-border)]",children:[t("span",{class:"text-sm font-medium text-[var(--color-text-primary)]",children:D("canvas.title")}),t("div",{class:"flex items-center gap-1",children:[v&&t(_,{icon:t(te,{}),label:D("canvas.openUrlInNewTab"),size:"sm",onClick:()=>window.open(v,"_blank")}),t(_,{icon:t(ne,{}),label:D("canvas.close"),size:"sm",onClick:()=>m.value=!1})]})]}),t("div",{class:"flex-1 overflow-hidden",children:t(ae,{url:v,blobUrl:z,contentType:H,content:S,iframeRef:s,imgRef:u})})]}):t("div",{class:`
|
|
2
|
-
fixed z-50
|
|
3
|
-
bg-[var(--color-bg-surface)]
|
|
4
|
-
shadow-soft-xl
|
|
5
|
-
flex flex-col
|
|
6
|
-
overflow-hidden
|
|
7
|
-
animate-[fade-in-scale_150ms_ease-out]
|
|
8
|
-
${c.value?"rounded-full border-0":"rounded-xl border border-[var(--color-border)]"}
|
|
9
|
-
`,style:{...me.value,position:"fixed"},children:[t("div",{class:`
|
|
10
|
-
flex items-center gap-2 px-3 cursor-grab active:cursor-grabbing select-none shrink-0
|
|
11
|
-
${c.value?"py-2":"py-2 border-b border-[var(--color-border)]"}
|
|
12
|
-
`,style:{height:`${q}px`},onMouseDown:I,onTouchStart:I,children:[t(xe,{class:"w-4 h-4 text-[var(--color-text-muted)] shrink-0"}),t("span",{class:"text-sm font-medium text-[var(--color-text-primary)] truncate flex-1",children:D("canvas.title")}),t("div",{class:"flex items-center gap-1",children:[v&&!c.value&&t(_,{icon:t(te,{}),label:D("canvas.openUrlInNewTab"),size:"sm",onClick:()=>window.open(v,"_blank")}),!c.value&&t(_,{icon:t(be,{}),label:D("canvas.openCanvasTab"),size:"sm",onClick:()=>{window.open("/canvas","_blank"),m.value=!1}}),t(_,{icon:c.value?t(ge,{}):t(ye,{}),label:c.value?D("canvas.maximize"):D("canvas.minimize"),size:"sm",onClick:()=>{c.value?r.value=oe.value:(oe.value=r.value,r.value!=="floating"&&(E.value=window.innerWidth-220,T.value=window.innerHeight-60),r.value="floating"),c.value=!c.value}}),t(_,{icon:t(ne,{}),label:D("canvas.close"),size:"sm",onClick:()=>m.value=!1})]})]}),!c.value&&t("div",{class:"flex-1 overflow-hidden relative",children:[t(ae,{url:v,blobUrl:z,contentType:H,content:S,iframeRef:s,imgRef:u}),X.value&&t("div",{class:"absolute inset-0 z-10"})]}),r.value==="floating"&&!c.value&&t(fe,{children:[t("div",{class:"absolute bottom-0 right-0 w-4 h-4 cursor-se-resize z-10 touch-none",onMouseDown:e=>a(e,"se"),onTouchStart:e=>a(e,"se")}),t("div",{class:"absolute bottom-0 left-0 w-4 h-4 cursor-sw-resize z-10 touch-none",onMouseDown:e=>a(e,"sw"),onTouchStart:e=>a(e,"sw")}),t("div",{class:"absolute top-11 right-0 w-4 h-4 cursor-ne-resize z-10 touch-none",onMouseDown:e=>a(e,"ne"),onTouchStart:e=>a(e,"ne")}),t("div",{class:"absolute top-11 left-0 w-4 h-4 cursor-nw-resize z-10 touch-none",onMouseDown:e=>a(e,"nw"),onTouchStart:e=>a(e,"nw")}),t("div",{class:"absolute right-0 w-2 cursor-e-resize touch-none",style:{top:"60px",height:"calc(100% - 76px)"},onMouseDown:e=>a(e,"e"),onTouchStart:e=>a(e,"e")}),t("div",{class:"absolute left-0 w-2 cursor-w-resize touch-none",style:{top:"60px",height:"calc(100% - 76px)"},onMouseDown:e=>a(e,"w"),onTouchStart:e=>a(e,"w")}),t("div",{class:"absolute bottom-0 h-2 cursor-s-resize touch-none",style:{left:"16px",width:"calc(100% - 32px)"},onMouseDown:e=>a(e,"s"),onTouchStart:e=>a(e,"s")})]}),r.value==="left"&&!c.value&&t("div",{class:"absolute right-0 top-0 w-2 h-full cursor-e-resize",onMouseDown:d}),r.value==="right"&&!c.value&&t("div",{class:"absolute left-0 top-0 w-2 h-full cursor-w-resize",onMouseDown:d}),r.value==="top"&&!c.value&&t("div",{class:"absolute left-0 bottom-0 w-full h-2 cursor-s-resize",onMouseDown:d})]})}export{De as CanvasPanel};
|