efficient-shell 5.2.0 → 5.6.0
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 +160 -31
- package/THIRD_PARTY_NOTICES.md +32 -0
- package/dist/{Browser-FKZ6M2MK.js → Browser-6QB2QTO7.js} +17 -17
- package/dist/Calculator-KOWRV2VK.js +29 -0
- package/dist/ConfirmDialog-32NLLK4K.js +1 -0
- package/dist/{CurrencyConverter-OV5ZQIAJ.js → CurrencyConverter-YJ47A3L5.js} +7 -7
- package/dist/{Documents-HGGL3AWI.js → Documents-TGGI2QBV.js} +24 -24
- package/dist/Files-KSDK3EO4.js +87 -0
- package/dist/{Notepad-PO724TVP.js → Notepad-EKB6FJPR.js} +10 -10
- package/dist/PdfViewer-KW5B44AX.js +1 -0
- package/dist/{PomodoroTimer-LN5MYRZO.js → PomodoroTimer-RD5GRRA5.js} +19 -19
- package/dist/{Preview-CUOO5WQ7.js → Preview-AQVXKT2I.js} +29 -29
- package/dist/Sidebar-VYXN5YIJ.js +44 -0
- package/dist/{Spreadsheet-2N2JXBCY.js → Spreadsheet-INXG5UMI.js} +13 -13
- package/dist/{Stock-65WVUGLI.js → Stock-CBQN2IJF.js} +4 -4
- package/dist/{Weather-TXJICMJN.js → Weather-2EVUTIXX.js} +18 -18
- package/dist/{WorldClock-RIHLKZGC.js → WorldClock-TZUF7MOB.js} +5 -5
- package/dist/apps/index.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/brand.css +1 -1
- package/dist/{chunk-Y553QKEH.js → chunk-3GPU3JOW.js} +12 -12
- package/dist/{chunk-TKFAFZRY.js → chunk-3HJTOINK.js} +1 -1
- package/dist/{chunk-YJ6JMGMS.js → chunk-4SWPNARR.js} +4 -4
- package/dist/{chunk-JJIPGAXI.js → chunk-6LTDJKIL.js} +72 -71
- package/dist/chunk-AP2QEJXQ.js +1 -0
- package/dist/{chunk-3PTA2C74.js → chunk-CLPJDJH4.js} +1 -1
- package/dist/{chunk-SSBOC52S.js → chunk-FROOMUJ7.js} +4 -4
- package/dist/{chunk-UG4ZPXXU.js → chunk-GG7AE6OC.js} +1 -1
- package/dist/{chunk-UAJQB45Y.js → chunk-HRLPFUPB.js} +1 -1
- package/dist/{chunk-OTP5WPI4.js → chunk-JEM73E4C.js} +14 -14
- package/dist/{chunk-ML22KF7T.js → chunk-JXAAZGLJ.js} +1 -1
- package/dist/{chunk-BFUBBDU6.js → chunk-KXAUDC3A.js} +26 -26
- package/dist/{chunk-TLTFS2D6.js → chunk-L5XA5MLK.js} +60 -60
- package/dist/{chunk-QZNRMJE6.js → chunk-MLYC5VQI.js} +2 -2
- package/dist/{chunk-KHJ5XSEH.js → chunk-N3A3GWJI.js} +8 -8
- package/dist/{chunk-BFFXVA53.js → chunk-PKEQ7XOH.js} +1 -1
- package/dist/{chunk-ASSDCWKP.js → chunk-R4XSSHDI.js} +1 -1
- package/dist/{chunk-R3622MOL.js → chunk-RCHCT7AO.js} +1 -1
- package/dist/chunk-RDQ7OXUA.js +1026 -0
- package/dist/{chunk-YQI7KXX3.js → chunk-RL626E7Q.js} +2 -2
- package/dist/{chunk-HIAHERCD.js → chunk-RMJZOKHY.js} +9 -9
- package/dist/{chunk-M4OGNYOM.js → chunk-SKB6L53D.js} +11 -11
- package/dist/{chunk-H3UEYXRA.js → chunk-TFETN2GI.js} +1 -1
- package/dist/chunk-TNBCUZVE.js +1 -0
- package/dist/chunk-WOEFPBQF.js +1 -0
- package/dist/chunk-WRBXEZFN.js +1 -0
- package/dist/chunk-XWSWYMGM.js +2 -0
- package/dist/{chunk-6GV4467L.js → chunk-Z2353HNE.js} +5 -5
- package/dist/{chunk-MTH7EAH3.js → chunk-ZUCYJAQH.js} +21 -21
- package/dist/file-intake/index.js +1 -1
- package/dist/format/index.d.ts +1 -1
- package/dist/format/index.js +1 -1
- package/dist/i18n/index.d.ts +1 -1
- package/dist/icons/efficient-looks.d.ts +28 -0
- package/dist/icons/efficient-looks.js +920 -0
- package/dist/icons/efficient.d.ts +746 -298
- package/dist/icons/efficient.js +336 -470
- package/dist/icons/heroicons.d.ts +1 -1
- package/dist/icons/index.d.ts +10 -4
- package/dist/icons/index.js +1 -1
- package/dist/icons/lucide.d.ts +1 -1
- package/dist/{index-Dk5VKml6.d.ts → index-BgM75MC6.d.ts} +365 -78
- package/dist/{index-DpUDK9zG.d.ts → index-CHufemKB.d.ts} +69 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +211 -211
- package/dist/locales/zh-Hans.d.ts +1 -1
- package/dist/locales/zh-Hans.js +1 -1
- package/dist/map/index.js +5 -5
- package/dist/markdown/index.js +1 -1
- package/dist/page-tabs/index.js +5 -5
- package/dist/pdf/index.js +1 -1
- package/dist/{registry-FHdUeVww.d.ts → registry-J-TU7zKx.d.ts} +14 -4
- package/dist/{strings-aKfRDZWB.d.ts → strings-BVB64Nck.d.ts} +26 -0
- package/dist/ui/index.d.ts +4 -4
- package/dist/ui/index.js +1 -1
- package/dist/ui.css +61 -1
- package/package.json +8 -2
- package/dist/Calculator-LBFBTFSD.js +0 -29
- package/dist/ConfirmDialog-JAEFVRJM.js +0 -1
- package/dist/Files-DAQKIF6W.js +0 -87
- package/dist/PdfViewer-6ALXGVTV.js +0 -1
- package/dist/Sidebar-T4ABK2WV.js +0 -44
- package/dist/chunk-4QBLTEFU.js +0 -1
- package/dist/chunk-AJB5G52B.js +0 -1
- package/dist/chunk-FWOPZB6I.js +0 -1
- package/dist/chunk-PS6PSCOR.js +0 -1018
- package/dist/chunk-YKZHOXI4.js +0 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-
|
|
1
|
+
import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-PKEQ7XOH.js";import{useWidgetSettings as r}from"./chunk-L5XA5MLK.js";import"./chunk-FROOMUJ7.js";import"./chunk-DSSLOQDW.js";import"./chunk-5A7MWTXX.js";import"./chunk-OGXU7QFW.js";import"./chunk-HRLPFUPB.js";import"./chunk-ZUCYJAQH.js";import"./chunk-RMJZOKHY.js";import"./chunk-AFYQTVZO.js";import"./chunk-HZZNJHRH.js";import"./chunk-X4FJ54PP.js";import"./chunk-D65T4H6J.js";import"./chunk-6LTDJKIL.js";import"./chunk-TNBCUZVE.js";import"./chunk-C3QOHMR6.js";import"./chunk-XWSWYMGM.js";import{useState as n,useCallback as a,useEffect as s}from"react";import{jsxs as c,Fragment as o,jsx as i}from"react/jsx-runtime";var l=["USD","CNY","AUD","GBP","EUR","JPY","CAD","THB","NZD","SGD","HKD","CHF","KRW","INR","MXN","BRL"],m=[["USD","CNY"],["USD","AUD"],["GBP","USD"],["USD","JPY"]],u="currency_pairs",p="currency_appearance",d="currency_rates_cache";function h(e){try{const t=JSON.parse(localStorage.getItem(d)||"{}")[e];if(t&&Date.now()-t.timestamp<36e5)return t.rates}catch{}return null}function g(e,t){try{const r=JSON.parse(localStorage.getItem(d)||"{}");r[e]={rates:t,timestamp:Date.now()},localStorage.setItem(d,JSON.stringify(r))}catch{}}function x(){try{const e=JSON.parse(localStorage.getItem(u)||"");if(Array.isArray(e)&&e.length)return e.slice(0,4)}catch{}return m}var y={USD:"🇺🇸",CNY:"🇨🇳",AUD:"🇦🇺",GBP:"🇬🇧",JPY:"🇯🇵",CAD:"🇨🇦",EUR:"🇪🇺",THB:"🇹🇭",NZD:"🇳🇿",SGD:"🇸🇬",HKD:"🇭🇰",CHF:"🇨🇭",KRW:"🇰🇷",INR:"🇮🇳",MXN:"🇲🇽",BRL:"🇧🇷"};function f(){const[m,d]=n(x),[f,N]=n(()=>e(p)),[b,v]=n({}),[S,k]=n(!1),[D,j]=n(!1),[C,J]=n([]),[U,O]=n(f),[H,A]=n("USD"),[L,R]=n("CNY");r(a(()=>{J([...m]),O({...f}),j(!0)},[m,f])),s(()=>{const e=[...new Set(m.map(([e])=>e))];let t=!0;return async function(){k(!0);const r={};for(const t of e){const e=h(t);if(e)r[t]=e;else try{const e=await fetch(`https://open.er-api.com/v6/latest/${t}`),n=await e.json();n.rates&&(r[t]=n.rates,g(t,n.rates))}catch{}}t&&(v(r),k(!1))}(),()=>{t=!1}},[m]);/* @__PURE__ */
|
|
2
2
|
return c(o,{children:[
|
|
3
|
-
/* @__PURE__ */i("div",{style:{backgroundColor:`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${f.activeOpacity/100})`,backdropFilter:f.activeBlur>0?`blur(${f.activeBlur}px)`:void 0},children:/* @__PURE__ */c("div",{className:"px-4 py-3 space-y-1",children:[
|
|
3
|
+
/* @__PURE__ */i("div",{style:{backgroundColor:`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${f.activeOpacity/100})`,backdropFilter:f.activeBlur>0?`blur(${f.activeBlur}px)`:void 0},children:/* @__PURE__ */c("div",{className:"px-4 py-3 space-y-1",children:[S&&/* @__PURE__ */i("div",{className:"text-xs text-gray-400 text-center py-4",children:"Loading rates..."}),m.map(([e,t],r)=>{const n=b[e]?.[t];/* @__PURE__ */
|
|
4
4
|
return c("button",{onClick:()=>{const e=m.map((e,t)=>t===r?[e[1],e[0]]:e);d(e),localStorage.setItem(u,JSON.stringify(e))},className:"flex items-center justify-between px-2 py-2 border-b border-gray-200 last:border-0 w-full hover:bg-gray-100 rounded transition-colors cursor-pointer",children:[
|
|
5
5
|
/* @__PURE__ */c("div",{className:"flex items-center gap-1.5",children:[
|
|
6
6
|
/* @__PURE__ */i("span",{className:"text-base",children:y[e]||""}),
|
|
@@ -9,13 +9,13 @@ return c("button",{onClick:()=>{const e=m.map((e,t)=>t===r?[e[1],e[0]]:e);d(e),l
|
|
|
9
9
|
/* @__PURE__ */i("span",{className:"text-base",children:y[t]||""}),
|
|
10
10
|
/* @__PURE__ */i("span",{className:"text-sm font-semibold text-gray-700",children:t})]}),
|
|
11
11
|
/* @__PURE__ */i("div",{className:"text-base font-mono font-semibold text-gray-900 tabular-nums",children:null!=n?n.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:4}):"—"})]},`${e}-${t}-${r}`)})]})}),
|
|
12
|
-
/* @__PURE__ */i(t,{open:D,onClose:()=>j(!1),title:"Currency Settings",appearance:
|
|
12
|
+
/* @__PURE__ */i(t,{open:D,onClose:()=>j(!1),title:"Currency Settings",appearance:U,onAppearanceChange:O,onSave:()=>{if(0===C.length)return;const e=C.slice(0,4);d(e),N(U),localStorage.setItem(u,JSON.stringify(e)),localStorage.setItem(p,JSON.stringify(U)),j(!1)},children:/* @__PURE__ */c("div",{children:[
|
|
13
13
|
/* @__PURE__ */c("h3",{className:"text-sm font-semibold text-gray-700 mb-2",children:["Currency Pairs ",
|
|
14
14
|
/* @__PURE__ */c("span",{className:"text-[11px] font-normal text-gray-400",children:["(",C.length,"/",4,")"]})]}),
|
|
15
15
|
/* @__PURE__ */i("div",{className:"space-y-1 mb-2",children:C.map(([e,t],r)=>/* @__PURE__ */c("div",{className:"flex items-center justify-between py-1 px-2 bg-gray-50 rounded",children:[
|
|
16
16
|
/* @__PURE__ */c("span",{className:"text-sm",children:[y[e]||""," ",e," → ",y[t]||""," ",t]}),
|
|
17
|
-
/* @__PURE__ */i("button",{onClick:()=>
|
|
18
|
-
/* @__PURE__ */i("select",{value:
|
|
17
|
+
/* @__PURE__ */i("button",{onClick:()=>J(e=>e.filter((e,t)=>t!==r)),className:"text-red-400 hover:text-red-600",children:"×"})]},r))}),C.length<4?/* @__PURE__ */c("div",{className:"flex items-center gap-2",children:[
|
|
18
|
+
/* @__PURE__ */i("select",{value:H,onChange:e=>A(e.target.value),className:"bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:l.map(e=>/* @__PURE__ */i("option",{children:e},e))}),
|
|
19
19
|
/* @__PURE__ */i("span",{className:"text-gray-400",children:"→"}),
|
|
20
|
-
/* @__PURE__ */i("select",{value:
|
|
21
|
-
/* @__PURE__ */i("button",{onClick:()=>{
|
|
20
|
+
/* @__PURE__ */i("select",{value:L,onChange:e=>R(e.target.value),className:"bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:l.map(e=>/* @__PURE__ */i("option",{children:e},e))}),
|
|
21
|
+
/* @__PURE__ */i("button",{onClick:()=>{H!==L&&C.length<4&&J(e=>[...e,[H,L]])},className:"text-sm font-medium text-blue-600 hover:text-blue-800 px-2",children:"+ Add"})]}):/* @__PURE__ */c("p",{className:"text-[11px] text-gray-400 italic",children:["Max ",4," pairs — remove one to add another."]})]})})]})}export{f as default};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{escapeHtml as e}from"./chunk-BR22X7E5.js";import{AboutApp as t}from"./chunk-
|
|
1
|
+
import{escapeHtml as e}from"./chunk-BR22X7E5.js";import{AboutApp as t}from"./chunk-Z2353HNE.js";import{toast_default as n}from"./chunk-3HJTOINK.js";import"./chunk-WRBXEZFN.js";import{WindowTitle as r}from"./chunk-L5XA5MLK.js";import"./chunk-FROOMUJ7.js";import"./chunk-DSSLOQDW.js";import"./chunk-5A7MWTXX.js";import"./chunk-OGXU7QFW.js";import"./chunk-HRLPFUPB.js";import"./chunk-ZUCYJAQH.js";import{PopupMenu as o,PopupMenuLabel as l,PopupMenuItem as a,PopupMenuDivider as i}from"./chunk-RMJZOKHY.js";import"./chunk-AFYQTVZO.js";import"./chunk-HZZNJHRH.js";import"./chunk-X4FJ54PP.js";import"./chunk-D65T4H6J.js";import{FolderOpenFallback as s,ImageFallback as c}from"./chunk-6LTDJKIL.js";import"./chunk-TNBCUZVE.js";import"./chunk-C3QOHMR6.js";import{Icon as d}from"./chunk-XWSWYMGM.js";import{useState as m,useRef as h}from"react";import{jsxs as u,jsx as p}from"react/jsx-runtime";var g=/* @__PURE__ */new Set(["txt","md","markdown","csv","tsv","log","json","xml","html","htm","css","js","jsx","ts","tsx","py","rb","go","rs","java","c","h","cpp","hpp","sh","bash","yml","yaml","toml","ini","conf","env","sql"]),x=/* @__PURE__ */new Set(["docx"]),f={filename:"Untitled",kind:"docx",content:"",ext:"docx"};function y(){const[y,v]=m(f),[b,k]=m(!1),[w,N]=m(!1),[j,C]=m(!1),[D,L]=m(null),M=h(null),U=h(null),R=h(null),O=(e,t)=>{R.current?.focus(),document.execCommand(e,!1,t),C(!0)},W=e=>{for(const t of e){if(!t.type.startsWith("image/"))continue;const e=new FileReader;e.onload=()=>{R.current?.focus(),document.execCommand("insertImage",!1,String(e.result)),C(!0)},e.readAsDataURL(t)}},T=e=>{D&&(D.el.removeAttribute("width"),D.el.removeAttribute("height"),D.el.style.width=e??"",D.el.style.height=e?"auto":"",C(!0),L(null))},B=async t=>{const r=(t.name.split(".").pop()||"").toLowerCase();k(!0);try{if(g.has(r)||!x.has(r)&&t.type.startsWith("text/")){const n=await t.text(),o=e(n).replace(/\n/g,"<br>");v({filename:t.name,kind:"text",content:o,ext:r}),C(!1)}else if(x.has(r))try{const e=await(import(
|
|
2
2
|
/* @vite-ignore */
|
|
3
|
-
"mammoth")),
|
|
4
|
-
return u("div",{className:"relative flex flex-col h-full",onDragOver:e=>{e.preventDefault(),w||N(!0)},onDragLeave:e=>{e.currentTarget===e.target&&N(!1)},onDrop:e=>{e.preventDefault(),N(!1);const t=Array.from(e.dataTransfer.files??[]);0!==t.length&&(t.every(e=>e.type.startsWith("image/"))?
|
|
5
|
-
/* @__PURE__ */p(
|
|
3
|
+
"mammoth")),n=await t.arrayBuffer(),o=await e.convertToHtml({arrayBuffer:n});v({filename:t.name,kind:"docx",content:o.value||"<p><em>(empty document)</em></p>",ext:r}),C(!1)}catch(e){n.error('Install the optional "mammoth" peer dep to read .docx files.')}else"doc"===r?n.error(".doc is the legacy Word binary format — convert to .docx first."):n.error(`Unsupported file type: .${r||"unknown"}`)}finally{k(!1)}},A=y?.filename?(S=y.filename).length>24?`${S.slice(0,23)}…`:S:"Untitled";var S;/* @__PURE__ */
|
|
4
|
+
return u("div",{className:"relative flex flex-col h-full",onDragOver:e=>{e.preventDefault(),w||N(!0)},onDragLeave:e=>{e.currentTarget===e.target&&N(!1)},onDrop:e=>{e.preventDefault(),N(!1);const t=Array.from(e.dataTransfer.files??[]);0!==t.length&&(t.every(e=>e.type.startsWith("image/"))?W(t):B(t[0]))},children:[
|
|
5
|
+
/* @__PURE__ */p(r,{title:`${A}${j?" •":""} - Documents`}),
|
|
6
6
|
/* @__PURE__ */p(t,{app:"documents"}),
|
|
7
7
|
/* @__PURE__ */u("div",{className:"flex items-center flex-wrap gap-x-2 gap-y-1 px-3 py-2 border-b border-gray-200 bg-gray-50 shrink-0",children:[
|
|
8
|
-
/* @__PURE__ */p("input",{ref:M,type:"file",accept:".txt,.md,.csv,.tsv,.log,.json,.xml,.html,.htm,.css,.js,.jsx,.ts,.tsx,.py,.rb,.go,.rs,.java,.c,.h,.cpp,.hpp,.sh,.bash,.yml,.yaml,.toml,.ini,.conf,.env,.sql,.docx,text/*",onChange:e=>{const t=e.target.files?.[0];t&&
|
|
8
|
+
/* @__PURE__ */p("input",{ref:M,type:"file",accept:".txt,.md,.csv,.tsv,.log,.json,.xml,.html,.htm,.css,.js,.jsx,.ts,.tsx,.py,.rb,.go,.rs,.java,.c,.h,.cpp,.hpp,.sh,.bash,.yml,.yaml,.toml,.ini,.conf,.env,.sql,.docx,text/*",onChange:e=>{const t=e.target.files?.[0];t&&B(t),M.current&&(M.current.value="")},className:"hidden"}),
|
|
9
9
|
/* @__PURE__ */u("button",{onClick:()=>M.current?.click(),className:"text-xs text-gray-700 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors flex items-center gap-1",children:[
|
|
10
10
|
/* @__PURE__ */p(d,{name:"folder-open",fallback:s,className:"h-3.5 w-3.5",strokeWidth:1.5}),"Open"]}),
|
|
11
11
|
/* @__PURE__ */p("button",{onClick:()=>{if(!y)return;const t=R.current?.innerHTML??"";if("text"===y.kind){if(/<(b|strong|i|em|u|font|span style|ul|ol|img)|style="[^"]*text-align/i.test(t)){const n=new Blob([`<!doctype html><meta charset="utf-8"><title>${e(y.filename)}</title><body style="font-family:ui-monospace,monospace;white-space:pre-wrap">${t}`],{type:"text/html"}),r=URL.createObjectURL(n),o=document.createElement("a");o.href=r,o.download=`${y.filename.replace(/\.[^.]+$/,"")}.html`,o.click(),URL.revokeObjectURL(r)}else{const e=R.current?.innerText??"",t=new Blob([e],{type:"text/plain"}),n=URL.createObjectURL(t),r=document.createElement("a");r.href=n,r.download=y.filename,r.click(),URL.revokeObjectURL(n)}}else{const n=new Blob([`<!doctype html><meta charset="utf-8"><title>${e(y.filename)}</title>${t}`],{type:"text/html"}),r=URL.createObjectURL(n),o=document.createElement("a");o.href=r,o.download=`${y.filename.replace(/\.docx$/i,"")}.html`,o.click(),URL.revokeObjectURL(r)}},className:"text-xs text-gray-700 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors",children:"Save"}),
|
|
@@ -14,12 +14,12 @@ return u("div",{className:"relative flex flex-col h-full",onDragOver:e=>{e.preve
|
|
|
14
14
|
/* @__PURE__ */u("span",{className:"text-xs font-medium text-gray-700 truncate max-w-[200px]",title:y.filename,children:[y.filename,j?" •":""]}),
|
|
15
15
|
/* @__PURE__ */p("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
|
|
16
16
|
/* @__PURE__ */u("div",{className:"flex items-center gap-0.5",children:[
|
|
17
|
-
/* @__PURE__ */p("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>
|
|
18
|
-
/* @__PURE__ */p("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>
|
|
19
|
-
/* @__PURE__ */p("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>
|
|
20
|
-
/* @__PURE__ */p("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>
|
|
17
|
+
/* @__PURE__ */p("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>O("bold"),className:"px-2 py-1 text-xs rounded font-bold text-gray-700 hover:bg-gray-200 transition-colors",title:"Bold",children:"B"}),
|
|
18
|
+
/* @__PURE__ */p("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>O("italic"),className:"px-2 py-1 text-xs rounded italic text-gray-700 hover:bg-gray-200 transition-colors",title:"Italic",children:"I"}),
|
|
19
|
+
/* @__PURE__ */p("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>O("underline"),className:"px-2 py-1 text-xs rounded underline text-gray-700 hover:bg-gray-200 transition-colors",title:"Underline",children:"U"}),
|
|
20
|
+
/* @__PURE__ */p("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>O("strikeThrough"),className:"px-2 py-1 text-xs rounded line-through text-gray-700 hover:bg-gray-200 transition-colors",title:"Strikethrough",children:"S"})]}),
|
|
21
21
|
/* @__PURE__ */p("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
|
|
22
|
-
/* @__PURE__ */u("select",{onMouseDown:e=>e.preventDefault(),onChange:e=>{
|
|
22
|
+
/* @__PURE__ */u("select",{onMouseDown:e=>e.preventDefault(),onChange:e=>{O("fontSize",e.target.value),e.currentTarget.value=""},defaultValue:"",className:"text-xs border border-gray-300 rounded px-1 py-0.5 bg-white",children:[
|
|
23
23
|
/* @__PURE__ */p("option",{value:"",disabled:!0,children:"Size"}),
|
|
24
24
|
/* @__PURE__ */p("option",{value:"1",children:"XS"}),
|
|
25
25
|
/* @__PURE__ */p("option",{value:"2",children:"S"}),
|
|
@@ -27,26 +27,26 @@ return u("div",{className:"relative flex flex-col h-full",onDragOver:e=>{e.preve
|
|
|
27
27
|
/* @__PURE__ */p("option",{value:"4",children:"L"}),
|
|
28
28
|
/* @__PURE__ */p("option",{value:"5",children:"XL"}),
|
|
29
29
|
/* @__PURE__ */p("option",{value:"6",children:"2XL"})]}),
|
|
30
|
-
/* @__PURE__ */p("input",{type:"color",defaultValue:"#000000",onChange:e=>
|
|
30
|
+
/* @__PURE__ */p("input",{type:"color",defaultValue:"#000000",onChange:e=>O("foreColor",e.target.value),className:"w-7 h-6 border border-gray-300 rounded cursor-pointer",title:"Text color"}),
|
|
31
31
|
/* @__PURE__ */p("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
|
|
32
|
-
/* @__PURE__ */p("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>
|
|
33
|
-
/* @__PURE__ */p("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>
|
|
32
|
+
/* @__PURE__ */p("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>O("insertUnorderedList"),className:"px-2 py-1 text-xs rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Bulleted list",children:"• List"}),
|
|
33
|
+
/* @__PURE__ */p("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>O("insertOrderedList"),className:"px-2 py-1 text-xs rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Numbered list",children:"1."}),
|
|
34
34
|
/* @__PURE__ */p("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
|
|
35
35
|
/* @__PURE__ */u("div",{className:"flex items-center gap-0.5",children:[
|
|
36
|
-
/* @__PURE__ */p("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>
|
|
37
|
-
/* @__PURE__ */p("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>
|
|
38
|
-
/* @__PURE__ */p("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>
|
|
39
|
-
/* @__PURE__ */p("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>
|
|
36
|
+
/* @__PURE__ */p("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>O("justifyLeft"),className:"px-2 py-1 rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Align left",children:/* @__PURE__ */p("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */p("path",{strokeLinecap:"round",d:"M3.75 6h16.5M3.75 12h9.75M3.75 18h14.25"})})}),
|
|
37
|
+
/* @__PURE__ */p("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>O("justifyCenter"),className:"px-2 py-1 rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Align center",children:/* @__PURE__ */p("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */p("path",{strokeLinecap:"round",d:"M3.75 6h16.5M7.125 12h9.75M4.875 18h14.25"})})}),
|
|
38
|
+
/* @__PURE__ */p("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>O("justifyRight"),className:"px-2 py-1 rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Align right",children:/* @__PURE__ */p("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */p("path",{strokeLinecap:"round",d:"M3.75 6h16.5M10.5 12h9.75M6 18h14.25"})})}),
|
|
39
|
+
/* @__PURE__ */p("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>O("justifyFull"),className:"px-2 py-1 rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Justify",children:/* @__PURE__ */p("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */p("path",{strokeLinecap:"round",d:"M3.75 6h16.5M3.75 12h16.5M3.75 18h16.5"})})})]}),
|
|
40
40
|
/* @__PURE__ */p("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
|
|
41
|
-
/* @__PURE__ */p("input",{ref:U,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:e=>{e.target.files?.length&&
|
|
41
|
+
/* @__PURE__ */p("input",{ref:U,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:e=>{e.target.files?.length&&W(Array.from(e.target.files)),U.current&&(U.current.value="")}}),
|
|
42
42
|
/* @__PURE__ */u("button",{onClick:()=>U.current?.click(),className:"px-2 py-1 text-xs rounded text-gray-700 hover:bg-gray-200 transition-colors flex items-center gap-1",title:"Insert image (or paste / drop one)",children:[
|
|
43
43
|
/* @__PURE__ */p(d,{name:"image",fallback:c,className:"h-3.5 w-3.5",strokeWidth:1.5}),"Image"]})]}),
|
|
44
|
-
/* @__PURE__ */p("div",{className:"flex-1 min-h-0 overflow-hidden",children:/* @__PURE__ */p("div",b?{className:"flex items-center justify-center h-full text-sm text-gray-400",children:"Loading…"}:{className:"h-full overflow-auto "+("docx"===y.kind?"bg-gray-100 px-6 py-8":"bg-white"),children:/* @__PURE__ */p("div",{ref:R,contentEditable:!0,suppressContentEditableWarning:!0,spellCheck:!1,onInput:()=>C(!0),onPaste:e=>{const t=Array.from(e.clipboardData?.items??[]).filter(e=>"file"===e.kind&&e.type.startsWith("image/")).map(e=>e.getAsFile()).filter(e=>!!e);t.length&&(e.preventDefault(),
|
|
44
|
+
/* @__PURE__ */p("div",{className:"flex-1 min-h-0 overflow-hidden",children:/* @__PURE__ */p("div",b?{className:"flex items-center justify-center h-full text-sm text-gray-400",children:"Loading…"}:{className:"h-full overflow-auto "+("docx"===y.kind?"bg-gray-100 px-6 py-8":"bg-white"),children:/* @__PURE__ */p("div",{ref:R,contentEditable:!0,suppressContentEditableWarning:!0,spellCheck:!1,onInput:()=>C(!0),onPaste:e=>{const t=Array.from(e.clipboardData?.items??[]).filter(e=>"file"===e.kind&&e.type.startsWith("image/")).map(e=>e.getAsFile()).filter(e=>!!e);t.length&&(e.preventDefault(),W(t))},onClick:e=>{const t=e.target;"IMG"===t.tagName&&(e.preventDefault(),L({x:e.clientX,y:e.clientY,el:t}))},dangerouslySetInnerHTML:{__html:y.content},className:"docx"===y.kind?"docs-editor mx-auto w-[8.5in] min-h-[11in] bg-white p-[1in] shadow text-[14px] leading-relaxed text-gray-800 outline-none focus:ring-2 focus:ring-blue-400/40":"docs-editor block w-full min-h-full p-4 font-mono text-[13px] leading-relaxed text-gray-800 bg-white outline-none whitespace-pre-wrap"})})}),w&&/* @__PURE__ */p("div",{className:"absolute inset-0 bg-blue-500/15 border-4 border-dashed border-blue-500 pointer-events-none flex items-center justify-center z-20",children:/* @__PURE__ */p("div",{className:"px-4 py-2 rounded-md bg-blue-600 text-white text-sm font-medium shadow-lg",children:"Drop a document to open · images insert into the page"})}),D&&/* @__PURE__ */u(o,{minWidth:150,style:{left:D.x,top:D.y},onClose:()=>L(null),children:[
|
|
45
45
|
/* @__PURE__ */p(l,{children:"Image width"}),
|
|
46
|
-
/* @__PURE__ */p(a,{onClick:()=>
|
|
47
|
-
/* @__PURE__ */p(a,{onClick:()=>
|
|
48
|
-
/* @__PURE__ */p(a,{onClick:()=>
|
|
49
|
-
/* @__PURE__ */p(a,{onClick:()=>
|
|
50
|
-
/* @__PURE__ */p(a,{onClick:()=>
|
|
46
|
+
/* @__PURE__ */p(a,{onClick:()=>T("25%"),children:"25%"}),
|
|
47
|
+
/* @__PURE__ */p(a,{onClick:()=>T("50%"),children:"50%"}),
|
|
48
|
+
/* @__PURE__ */p(a,{onClick:()=>T("75%"),children:"75%"}),
|
|
49
|
+
/* @__PURE__ */p(a,{onClick:()=>T("100%"),children:"100%"}),
|
|
50
|
+
/* @__PURE__ */p(a,{onClick:()=>T(null),children:"Original size"}),
|
|
51
51
|
/* @__PURE__ */p(i,{}),
|
|
52
52
|
/* @__PURE__ */p(a,{danger:!0,onClick:()=>{D?.el.remove(),C(!0),L(null)},children:"Remove image"})]})]})}export{y as default};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import{openPreviewFile as e}from"./chunk-TFETN2GI.js";import{Breadcrumbs as t}from"./chunk-RCHCT7AO.js";import{SidebarLayout as a}from"./chunk-4SWPNARR.js";import{getFilesDemoTree as r}from"./chunk-JXAAZGLJ.js";import{AboutApp as n}from"./chunk-Z2353HNE.js";import{peekFilesViewRequest as i,consumeFilesViewRequest as s,FILES_SHOW_TRASH_EVENT as l,FILES_OPEN_DESKTOP_FOLDER_EVENT as o,subscribeDesktopFolders as c,getDesktopFoldersSnapshot as d,FolderGlyph as m,DesktopItemMiniIcon as h,desktopItemTypeLabel as p}from"./chunk-RL626E7Q.js";import"./chunk-ESL5TDNA.js";import{toast_default as f}from"./chunk-3HJTOINK.js";import"./chunk-VTVSMRFX.js";import"./chunk-WRBXEZFN.js";import{useWindowManager as u,WindowTitle as x}from"./chunk-L5XA5MLK.js";import"./chunk-FROOMUJ7.js";import"./chunk-DSSLOQDW.js";import"./chunk-5A7MWTXX.js";import"./chunk-OGXU7QFW.js";import"./chunk-HRLPFUPB.js";import{confirm as g,prompt as y}from"./chunk-ZUCYJAQH.js";import"./chunk-RMJZOKHY.js";import"./chunk-AFYQTVZO.js";import"./chunk-HZZNJHRH.js";import"./chunk-X4FJ54PP.js";import"./chunk-D65T4H6J.js";import{CloseCircleFallback as b,ArrowLeftFallback as k,RefreshFallback as N,TrashFallback as w,FolderPlusFallback as v,UploadFallbackB as j,FolderFallback as C,PageFallback as $}from"./chunk-6LTDJKIL.js";import{formatBytes as L}from"./chunk-W32SKK3D.js";import"./chunk-TNBCUZVE.js";import"./chunk-C3QOHMR6.js";import{Icon as T}from"./chunk-XWSWYMGM.js";import{useState as D,useEffect as E,useSyncExternalStore as R,useRef as F,useCallback as S}from"react";import{jsxs as O,jsx as P,Fragment as W}from"react/jsx-runtime";var A="undefined"!=typeof window&&window.__REACT_OS_SHELL_FILE_SERVER__||"http://localhost:4000",M={pdf:"pdf",dxf:"dxf",csv:"csv",jpg:"image",jpeg:"image",png:"image",gif:"image",webp:"image",svg:"image",avif:"image",bmp:"image",stp:"3d",step:"3d",stl:"3d",obj:"3d",gltf:"3d",glb:"3d","3mf":"3d",iges:"3d",igs:"3d",ply:"3d",fbx:"3d"};function I(e,t){return"/"===e||""===e?"/"+t:e.replace(/\/$/,"")+"/"+t}function U(e){if(!e)return"—";try{const t=new Date(e);return isNaN(t.getTime())?"—":t.toLocaleString(void 0,{dateStyle:"short",timeStyle:"short"})}catch{return e}}function H(){const H=A.replace(/\/$/,""),J=null!==r(),[V,z]=D("/"),[B,K]=D([]),[X,Z]=D([]),[_,Q]=D(null),[G,Y]=D(!0),[q,ee]=D(!1),[te,ae]=D(null),[re,ne]=D(!1),[ie,se]=D(()=>{const e=i();return"trash"===e?"trash":e?{desktopFolderId:e.folderId}:"files"});E(()=>{s()},[]);const[le,oe]=D([]);E(()=>{const e=()=>{s(),se("trash")},t=e=>{s();const t=e.detail?.folderId;t&&se({desktopFolderId:t})};return window.addEventListener(l,e),window.addEventListener(o,t),()=>{window.removeEventListener(l,e),window.removeEventListener(o,t)}},[]);const ce=R(c,d,d),de="object"==typeof ie?ie.desktopFolderId:null,me=de?ce?.folders.find(e=>e.id===de)??null:null,he=de&&ce?.itemsByFolder[de]||[];E(()=>{de&&ce&&!ce.folders.some(e=>e.id===de)&&se("files")},[de,ce]);const pe=F(0),fe=F(null),{openPage:ue,openEntity:xe}=u(),ge=t=>{"preview-file"===t.entityType&&t.filePath&&t.fileKind?e({filePath:t.filePath,filename:t.label,kind:t.fileKind,onStaged:e=>ue(e)}):"page"===t.entityType?ue(t.entityId):xe(t.entityType,t.entityId,null,t.label)},ye=S((e,t={})=>fetch(e,{...t,credentials:"include"}),[]),be=S(async()=>{try{const e=await ye(`${H}/api/quota`);if(e.ok){const t=await e.json();ae({used:t.used,limit:t.limit})}}catch{}},[ye,H]),ke=S(async e=>{if(Q(null),J){const t=function(e){const t=r();if(!t)return[];let a=t;for(const t of e.split("/").filter(Boolean)){const e=a.find(e=>"folder"===e.kind&&e.name===t);if(!e||!e.children)return[];a=e.children}return a.map(e=>({name:e.name,kind:e.kind,size:e.size??0,modifiedAt:e.modifiedAt??""}))}(e);return K(t),z(e),ee(!1),Y(!1),void("/"===e&&Z(t.filter(e=>"folder"===e.kind).map(e=>e.name)))}Y(!0);try{const t=await ye(`${H}/api/files?path=${encodeURIComponent(e)}`);if(!t.ok){const e=await t.json().catch(()=>({}));return void f.error(e.error||`Failed to list (${t.status})`)}const a=await t.json(),r=a.entries||[];K(r),z(a.path||e),ee(!1),"/"===(a.path||e)&&Z(r.filter(e=>"folder"===e.kind).map(e=>e.name))}catch(e){ee(!0)}finally{Y(!1)}be()},[ye,H,be,J]),Ne=S(async()=>{if(J)return oe([]),void Y(!1);Y(!0),Q(null);try{const e=await ye(`${H}/api/trash`);if(!e.ok){const t=await e.json().catch(()=>({}));return void f.error(t.error||`Failed to list trash (${e.status})`)}const t=await e.json();oe(t.entries||[]),ee(!1)}catch{ee(!0)}finally{Y(!1)}be()},[ye,H,be,J]);E(()=>{"files"===ie?ke(V):"trash"===ie&&Ne()},[V,ie]);const we=async e=>{const t=I(V,e.name);try{const a=await ye(`${H}/api/file?path=${encodeURIComponent(t)}`);if(!a.ok)return void f.error(`Download failed (${a.status})`);const r=await a.blob(),n=URL.createObjectURL(r),i=document.createElement("a");i.href=n,i.download=e.name,i.click(),setTimeout(()=>URL.revokeObjectURL(n),1e3)}catch(e){f.error(e?.message||"Download failed")}},ve=async e=>{const t=Array.from(e);for(const e of t){const t=new FormData;t.append("file",e);try{const a=await ye(`${H}/api/upload?path=${encodeURIComponent(V)}`,{method:"POST",body:t});if(!a.ok){const t=await a.json().catch(()=>({}));if(413===a.status){const a=Math.max(0,(t.limit||0)-(t.used||0));f.error(`Quota exceeded — ${L(a)} free, ${e.name} is ${L(t.attempted||e.size)}`)}else f.error(`Upload ${e.name}: ${t.error||a.status}`)}}catch(t){f.error(`Upload ${e.name}: ${t?.message||"failed"}`)}}ke(V)},je=()=>{pe.current=0,ne(!1)};if(E(()=>{const e=()=>je();return window.addEventListener("dragend",e),window.addEventListener("drop",e),()=>{window.removeEventListener("dragend",e),window.removeEventListener("drop",e)}},[]),q)/* @__PURE__ */
|
|
2
|
+
return O("div",{className:"flex flex-col h-full bg-white",children:[
|
|
3
|
+
/* @__PURE__ */P(x,{title:"Files - offline"}),
|
|
4
|
+
/* @__PURE__ */P("div",{className:"flex-1 flex items-center justify-center p-8 text-center",children:/* @__PURE__ */O("div",{className:"max-w-md",children:[
|
|
5
|
+
/* @__PURE__ */P(T,{name:"close-circle",fallback:b,className:"h-12 w-12 mx-auto text-gray-300 mb-3",strokeWidth:1.4}),
|
|
6
|
+
/* @__PURE__ */P("h3",{className:"text-base font-semibold text-gray-800 mb-1",children:"Can't reach the file server"}),
|
|
7
|
+
/* @__PURE__ */O("p",{className:"text-sm text-gray-500 mb-3",children:["No response from ",
|
|
8
|
+
/* @__PURE__ */P("span",{className:"font-mono",children:H}),". Make sure the server is running — see ",
|
|
9
|
+
/* @__PURE__ */P("span",{className:"font-mono",children:"examples/file-server/README.md"}),"."]}),
|
|
10
|
+
/* @__PURE__ */P("button",{onClick:()=>ke(V),className:"px-3 py-1.5 text-sm bg-blue-500 text-white rounded hover:bg-blue-600",children:"Retry"})]})})]});const Ce="/"===V?[]:V.split("/").filter(Boolean),$e=te&&te.limit>0?Math.min(100,Math.round(te.used/te.limit*100)):0,Le=$e>90?"bg-red-500":$e>75?"bg-amber-500":"bg-blue-500",Te=[{label:"My files",onClick:()=>z("/")},...Ce.map((e,t)=>({label:e,onClick:()=>z("/"+Ce.slice(0,t+1).join("/"))}))],De=e=>"flex w-full items-center gap-2 rounded-md px-2.5 py-1.5 text-left text-sm transition-colors "+(e?"bg-blue-50 font-medium text-blue-700":"text-gray-700 hover:bg-gray-100"),Ee=e=>/* @__PURE__ */P("svg",{className:"h-4 w-4 shrink-0 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.6,children:/* @__PURE__ */P("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})}),Re=/* @__PURE__ */O("nav",{className:"p-2",children:[
|
|
11
|
+
/* @__PURE__ */P("div",{className:"px-2 py-1.5 text-[11px] font-semibold uppercase tracking-wide text-gray-400",children:"Locations"}),
|
|
12
|
+
/* @__PURE__ */O("button",{onClick:()=>{se("files"),z("/")},className:De("files"===ie&&"/"===V),children:[Ee("M2.25 12l8.954-8.955a1.5 1.5 0 012.122 0L21.75 12M4.5 9.75v9.75a.75.75 0 00.75.75H9V15a.75.75 0 01.75-.75h4.5A.75.75 0 0115 15v5.25h3.75a.75.75 0 00.75-.75V9.75"),"My files"]}),X.map(e=>/* @__PURE__ */O("button",{onClick:()=>{se("files"),z("/"+e)},className:De("files"===ie&&V==="/"+e),children:[Ee("M2.25 12.75V12A2.25 2.25 0 014.5 9.75h15A2.25 2.25 0 0121.75 12v.75m-8.69-6.44l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z"),
|
|
13
|
+
/* @__PURE__ */P("span",{className:"truncate",children:e})]},e)),!J&&/* @__PURE__ */O("button",{onClick:()=>se("trash"),className:De("trash"===ie),children:[Ee("M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79"),"Trash"]}),ce&&ce.folders.length>0&&/* @__PURE__ */O(W,{children:[
|
|
14
|
+
/* @__PURE__ */P("div",{className:"px-2 pt-3 pb-1.5 text-[11px] font-semibold uppercase tracking-wide text-gray-400",children:"Desktop"}),ce.folders.map(e=>/* @__PURE__ */O("button",{onClick:()=>se({desktopFolderId:e.id}),className:De(de===e.id),children:[
|
|
15
|
+
/* @__PURE__ */P(m,{className:"h-4 w-4 shrink-0 text-amber-500"}),
|
|
16
|
+
/* @__PURE__ */P("span",{className:"truncate",children:e.name}),e.itemCount>0&&/* @__PURE__ */P("span",{className:"ml-auto text-[10px] text-gray-400 tabular-nums",children:e.itemCount})]},e.id))]})]});/* @__PURE__ */
|
|
17
|
+
return O("div",{className:"relative flex flex-col h-full bg-white",onDragEnter:e=>{J||"object"==typeof ie||e.dataTransfer?.types?.includes?.("Files")&&(e.preventDefault(),pe.current++,re||ne(!0))},onDragOver:e=>{e.dataTransfer?.types?.includes?.("Files")&&e.preventDefault()},onDragLeave:()=>{pe.current>0&&pe.current--,0===pe.current&&ne(!1)},onDrop:e=>{e.preventDefault(),je(),J||"object"==typeof ie||e.dataTransfer.files?.length&&ve(e.dataTransfer.files)},children:[
|
|
18
|
+
/* @__PURE__ */P(x,{title:me?`Files - ${me.name}`:"Files"+("/"===V?"":" - "+V)}),
|
|
19
|
+
/* @__PURE__ */P(n,{app:"files"}),
|
|
20
|
+
/* @__PURE__ */P("input",{ref:fe,type:"file",multiple:!0,className:"hidden",onChange:e=>{e.target.files?.length&&ve(e.target.files),fe.current&&(fe.current.value="")}}),
|
|
21
|
+
/* @__PURE__ */P("div",{className:"flex-1 min-h-0",children:/* @__PURE__ */P(a,{sidebar:Re,storageKey:"files.sidebarWidth",defaultWidth:200,minWidth:150,maxWidth:320,children:/* @__PURE__ */O("div",{className:"flex h-full min-w-0 flex-col",children:[
|
|
22
|
+
/* @__PURE__ */O("div",{className:"flex items-center gap-1 px-2 py-1.5 border-b border-gray-200 bg-gray-50 shrink-0 text-xs",children:[/* @__PURE__ */O(W,"files"===ie?{children:[
|
|
23
|
+
/* @__PURE__ */P("button",{onClick:()=>z(function(e){if("/"===e||""===e)return"/";const t=e.replace(/\/$/,""),a=t.lastIndexOf("/");return a<=0?"/":t.slice(0,a)}(V)),disabled:"/"===V,className:"px-2 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",title:"Parent folder",children:/* @__PURE__ */P(T,{name:"arrow-left",fallback:k,className:"h-3.5 w-3.5",strokeWidth:2})}),
|
|
24
|
+
/* @__PURE__ */P("div",{className:"flex-1 min-w-0",children:/* @__PURE__ */P(t,{items:Te,maxItems:5})}),
|
|
25
|
+
/* @__PURE__ */P("button",{onClick:()=>ke(V),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600",title:"Refresh",children:/* @__PURE__ */P(T,{name:"refresh",fallback:N,className:"h-3.5 w-3.5",strokeWidth:1.8})}),!J&&/* @__PURE__ */O(W,{children:[
|
|
26
|
+
/* @__PURE__ */O("button",{onClick:()=>se("trash"),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600 flex items-center gap-1",title:"Open trash",children:[
|
|
27
|
+
/* @__PURE__ */P(T,{name:"trash",fallback:w,className:"h-3.5 w-3.5",strokeWidth:1.5}),"Trash"]}),
|
|
28
|
+
/* @__PURE__ */O("button",{onClick:async()=>{const e=await y({title:"New folder",placeholder:"Folder name",confirmLabel:"Create"});if(!e)return;if(/[\\/]/.test(e))return void f.error("Folder names cannot contain slashes");const t=I(V,e),a=await ye(`${H}/api/folder`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:t})});if(!a.ok){const e=await a.json().catch(()=>({}));return void f.error(e.error||`Create folder failed (${a.status})`)}ke(V)},className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600 flex items-center gap-1",children:[
|
|
29
|
+
/* @__PURE__ */P(T,{name:"folder-plus",fallback:v,className:"h-3.5 w-3.5",strokeWidth:1.5}),"New Folder"]}),
|
|
30
|
+
/* @__PURE__ */O("button",{onClick:()=>fe.current?.click(),className:"px-2 py-1 rounded bg-blue-500 text-white hover:bg-blue-600 flex items-center gap-1",children:[
|
|
31
|
+
/* @__PURE__ */P(T,{name:"upload",fallback:j,className:"h-3.5 w-3.5",strokeWidth:1.8}),"Upload"]})]})]}:"trash"===ie?{children:[
|
|
32
|
+
/* @__PURE__ */P("button",{onClick:()=>se("files"),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600",title:"Back to files",children:/* @__PURE__ */P(T,{name:"arrow-left",fallback:k,className:"h-3.5 w-3.5",strokeWidth:2})}),
|
|
33
|
+
/* @__PURE__ */P("span",{className:"flex-1 text-gray-700 font-medium px-2",children:"Trash"}),
|
|
34
|
+
/* @__PURE__ */P("button",{onClick:Ne,className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600",title:"Refresh",children:/* @__PURE__ */P(T,{name:"refresh",fallback:N,className:"h-3.5 w-3.5",strokeWidth:1.8})}),
|
|
35
|
+
/* @__PURE__ */P("button",{onClick:async()=>{if(0===le.length)return;if(!await g({title:"Empty trash",message:`${le.length} item${1===le.length?"":"s"} will be permanently removed. This can't be undone.`,confirmLabel:"Empty trash",variant:"danger"}))return;const e=await ye(`${H}/api/trash`,{method:"DELETE"});if(!e.ok){const t=await e.json().catch(()=>({}));return void f.error(t.error||`Empty trash failed (${e.status})`)}Ne()},disabled:0===le.length,className:"px-2 py-1 rounded text-red-600 hover:bg-red-50 disabled:opacity-30 flex items-center gap-1",children:"Empty trash"})]}:{children:[
|
|
36
|
+
/* @__PURE__ */P("button",{onClick:()=>se("files"),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600",title:"Back to files",children:/* @__PURE__ */P(T,{name:"arrow-left",fallback:k,className:"h-3.5 w-3.5",strokeWidth:2})}),
|
|
37
|
+
/* @__PURE__ */P(m,{className:"h-4 w-4 text-amber-500 ml-1"}),
|
|
38
|
+
/* @__PURE__ */P("span",{className:"flex-1 text-gray-700 font-medium px-1 truncate",children:me?.name??"Desktop folder"}),
|
|
39
|
+
/* @__PURE__ */P("span",{className:"text-[10px] text-gray-400 px-2",children:"Desktop shortcuts"})]}),te&&/* @__PURE__ */O(W,{children:[
|
|
40
|
+
/* @__PURE__ */P("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
|
|
41
|
+
/* @__PURE__ */O("div",{className:"flex items-center gap-1.5",title:`${L(te.used)} of ${L(te.limit)} used`,children:[
|
|
42
|
+
/* @__PURE__ */P("div",{className:"w-20 h-1.5 rounded-full bg-gray-200 overflow-hidden",children:/* @__PURE__ */P("div",{className:`h-full ${Le} transition-all`,style:{width:`${$e}%`}})}),
|
|
43
|
+
/* @__PURE__ */O("span",{className:"text-[10px] text-gray-500 tabular-nums whitespace-nowrap",children:[L(te.used)," / ",L(te.limit)]})]})]})]}),
|
|
44
|
+
/* @__PURE__ */P("div",{className:"flex-1 overflow-auto",children:"object"==typeof ie?0===he.length?/* @__PURE__ */P("div",{className:"p-10 text-center text-sm text-gray-400",children:"This desktop folder is empty. Drag shortcuts onto it on the desktop."}):/* @__PURE__ */O("table",{className:"w-full text-sm",children:[
|
|
45
|
+
/* @__PURE__ */P("thead",{className:"bg-gray-50 text-[11px] uppercase tracking-wide text-gray-500",children:/* @__PURE__ */O("tr",{children:[
|
|
46
|
+
/* @__PURE__ */P("th",{className:"text-left font-medium px-3 py-1.5",children:"Name"}),
|
|
47
|
+
/* @__PURE__ */P("th",{className:"text-left font-medium px-3 py-1.5 w-28",children:"Type"}),
|
|
48
|
+
/* @__PURE__ */P("th",{className:"w-56"})]})}),
|
|
49
|
+
/* @__PURE__ */P("tbody",{children:he.map(e=>{const t=`${e.entityType}|${e.entityId}`;/* @__PURE__ */
|
|
50
|
+
return O("tr",{onClick:()=>Q(t),onDoubleClick:()=>ge(e),className:"cursor-default border-b border-gray-100 "+(_===t?"bg-blue-50":"hover:bg-gray-50"),children:[
|
|
51
|
+
/* @__PURE__ */O("td",{className:"px-3 py-1.5 flex items-center gap-2",children:[
|
|
52
|
+
/* @__PURE__ */P(h,{item:e}),
|
|
53
|
+
/* @__PURE__ */P("span",{className:"truncate",title:e.label,children:e.label})]}),
|
|
54
|
+
/* @__PURE__ */P("td",{className:"px-3 py-1.5 text-xs text-gray-500",children:p(e)}),
|
|
55
|
+
/* @__PURE__ */O("td",{className:"px-3 py-1.5 text-right whitespace-nowrap",children:[
|
|
56
|
+
/* @__PURE__ */P("button",{onClick:t=>{t.stopPropagation(),ge(e)},className:"px-1.5 py-0.5 rounded hover:bg-gray-200 text-blue-600 text-[11px]",children:"Open"}),
|
|
57
|
+
/* @__PURE__ */P("button",{onClick:t=>{t.stopPropagation(),ce?.moveToDesktop([e])},className:"px-1.5 py-0.5 rounded hover:bg-gray-200 text-gray-500 text-[11px] ml-1",children:"Move to desktop"}),
|
|
58
|
+
/* @__PURE__ */P("button",{onClick:t=>{t.stopPropagation(),ce?.removeShortcuts([e])},className:"px-1.5 py-0.5 rounded hover:bg-red-100 text-red-600 text-[11px] ml-1",children:"Remove"})]})]},t)})})]}):"trash"===ie?G&&0===le.length?/* @__PURE__ */P("div",{className:"p-6 text-center text-sm text-gray-400",children:"Loading…"}):0===le.length?/* @__PURE__ */P("div",{className:"p-10 text-center text-sm text-gray-400",children:"Trash is empty."}):/* @__PURE__ */O("table",{className:"w-full text-sm",children:[
|
|
59
|
+
/* @__PURE__ */P("thead",{className:"bg-gray-50 text-[11px] uppercase tracking-wide text-gray-500",children:/* @__PURE__ */O("tr",{children:[
|
|
60
|
+
/* @__PURE__ */P("th",{className:"text-left font-medium px-3 py-1.5",children:"Name"}),
|
|
61
|
+
/* @__PURE__ */P("th",{className:"text-left font-medium px-3 py-1.5",children:"Original location"}),
|
|
62
|
+
/* @__PURE__ */P("th",{className:"text-right font-medium px-3 py-1.5 w-24",children:"Size"}),
|
|
63
|
+
/* @__PURE__ */P("th",{className:"text-right font-medium px-3 py-1.5 w-40",children:"Deleted"}),
|
|
64
|
+
/* @__PURE__ */P("th",{className:"w-44"})]})}),
|
|
65
|
+
/* @__PURE__ */P("tbody",{children:le.map(e=>/* @__PURE__ */O("tr",{className:"border-b border-gray-100 hover:bg-gray-50",children:[
|
|
66
|
+
/* @__PURE__ */O("td",{className:"px-3 py-1.5 flex items-center gap-2",children:["folder"===e.kind?/* @__PURE__ */P(T,{name:"folder",fallback:C,className:"h-4 w-4 text-amber-500 shrink-0"}):/* @__PURE__ */P(T,{name:"page",fallback:$,className:"h-4 w-4 text-gray-400 shrink-0",strokeWidth:1.5}),
|
|
67
|
+
/* @__PURE__ */P("span",{className:"truncate",title:e.name,children:e.name})]}),
|
|
68
|
+
/* @__PURE__ */P("td",{className:"px-3 py-1.5 text-gray-500 text-xs font-mono truncate",title:e.originalPath,children:e.originalPath||"—"}),
|
|
69
|
+
/* @__PURE__ */P("td",{className:"px-3 py-1.5 text-right tabular-nums text-gray-500",children:L(e.size)}),
|
|
70
|
+
/* @__PURE__ */P("td",{className:"px-3 py-1.5 text-right text-gray-500 tabular-nums",children:e.deletedAt?U(e.deletedAt):"—"}),
|
|
71
|
+
/* @__PURE__ */O("td",{className:"px-3 py-1.5 text-right whitespace-nowrap",children:[
|
|
72
|
+
/* @__PURE__ */P("button",{onClick:()=>(async e=>{const t=await ye(`${H}/api/trash/restore`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e.id})});if(!t.ok){const e=await t.json().catch(()=>({}));return void f.error(e.error||`Restore failed (${t.status})`)}f.success(`Restored "${e.name}"`),Ne()})(e),className:"px-1.5 py-0.5 rounded hover:bg-gray-200 text-blue-600 text-[11px]",children:"Restore"}),
|
|
73
|
+
/* @__PURE__ */P("button",{onClick:()=>(async e=>{if(!await g({title:"Permanently delete",message:`"${e.name}" will be permanently removed. This can't be undone.`,confirmLabel:"Delete forever",variant:"danger"}))return;const t=await ye(`${H}/api/trash/${encodeURIComponent(e.id)}`,{method:"DELETE"});if(!t.ok){const e=await t.json().catch(()=>({}));return void f.error(e.error||`Delete failed (${t.status})`)}Ne()})(e),className:"px-1.5 py-0.5 rounded hover:bg-red-100 text-red-600 text-[11px] ml-1",children:"Delete forever"})]})]},e.id))})]}):G&&0===B.length?/* @__PURE__ */P("div",{className:"p-6 text-center text-sm text-gray-400",children:"Loading…"}):0===B.length?/* @__PURE__ */O("div",{className:"p-10 text-center text-sm text-gray-400",children:["Empty folder.",!J&&/* @__PURE__ */O(W,{children:[" Drop files here or click ",
|
|
74
|
+
/* @__PURE__ */P("span",{className:"font-medium",children:"Upload"}),"."]})]}):/* @__PURE__ */O("table",{className:"w-full text-sm",children:[
|
|
75
|
+
/* @__PURE__ */P("thead",{className:"bg-gray-50 text-[11px] uppercase tracking-wide text-gray-500",children:/* @__PURE__ */O("tr",{children:[
|
|
76
|
+
/* @__PURE__ */P("th",{className:"text-left font-medium px-3 py-1.5",children:"Name"}),
|
|
77
|
+
/* @__PURE__ */P("th",{className:"text-right font-medium px-3 py-1.5 w-24",children:"Size"}),
|
|
78
|
+
/* @__PURE__ */P("th",{className:"text-right font-medium px-3 py-1.5 w-40",children:"Modified"}),
|
|
79
|
+
/* @__PURE__ */P("th",{className:"w-32"})]})}),
|
|
80
|
+
/* @__PURE__ */P("tbody",{children:B.map(t=>/* @__PURE__ */O("tr",{onClick:()=>Q(t.name),onDoubleClick:()=>{"folder"===t.kind?z(I(V,t.name)):(async t=>{if(J)return;const a=I(V,t.name),r=(t.name.split(".").pop()||"").toLowerCase(),n=M[r];n?await e({filePath:a,filename:t.name,kind:n,onStaged:e=>ue(e)}):we(t)})(t)},className:"cursor-default border-b border-gray-100 "+(_===t.name?"bg-blue-50":"hover:bg-gray-50"),children:[
|
|
81
|
+
/* @__PURE__ */O("td",{className:"px-3 py-1.5 flex items-center gap-2",children:["folder"===t.kind?/* @__PURE__ */P(T,{name:"folder",fallback:C,className:"h-4 w-4 text-amber-500 shrink-0"}):/* @__PURE__ */P(T,{name:"page",fallback:$,className:"h-4 w-4 text-gray-400 shrink-0",strokeWidth:1.5}),
|
|
82
|
+
/* @__PURE__ */P("span",{className:"truncate",title:t.name,children:t.name})]}),
|
|
83
|
+
/* @__PURE__ */P("td",{className:"px-3 py-1.5 text-right tabular-nums text-gray-500",children:"folder"===t.kind?"—":L(t.size)}),
|
|
84
|
+
/* @__PURE__ */P("td",{className:"px-3 py-1.5 text-right text-gray-500 tabular-nums",children:U(t.modifiedAt)}),
|
|
85
|
+
/* @__PURE__ */P("td",{className:"px-3 py-1.5 text-right whitespace-nowrap",children:!J&&/* @__PURE__ */O(W,{children:["file"===t.kind&&/* @__PURE__ */P("button",{onClick:e=>{e.stopPropagation(),we(t)},className:"px-1.5 py-0.5 rounded hover:bg-gray-200 text-gray-500 text-[11px]",children:"Download"}),
|
|
86
|
+
/* @__PURE__ */P("button",{onClick:e=>{e.stopPropagation(),(async e=>{const t=await y({title:`Rename ${e.kind}`,defaultValue:e.name,confirmLabel:"Rename"});if(!t||t===e.name)return;if(/[\\/]/.test(t))return void f.error("Names cannot contain slashes");const a=I(V,e.name),r=I(V,t),n=await ye(`${H}/api/rename`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({from:a,to:r})});if(!n.ok){const e=await n.json().catch(()=>({}));return void f.error(e.error||`Rename failed (${n.status})`)}ke(V)})(t)},className:"px-1.5 py-0.5 rounded hover:bg-gray-200 text-gray-500 text-[11px] ml-1",children:"Rename"}),
|
|
87
|
+
/* @__PURE__ */P("button",{onClick:e=>{e.stopPropagation(),(async e=>{if(!await g({title:`Delete ${e.kind}`,message:`"${e.name}"${"folder"===e.kind?" and everything inside":""} will be permanently removed.`,confirmLabel:"Delete",variant:"danger"}))return;const t=I(V,e.name),a=await ye(`${H}/api/files?path=${encodeURIComponent(t)}`,{method:"DELETE"});if(!a.ok){const e=await a.json().catch(()=>({}));return void f.error(e.error||`Delete failed (${a.status})`)}ke(V)})(t)},className:"px-1.5 py-0.5 rounded hover:bg-red-100 text-red-600 text-[11px] ml-1",children:"Delete"})]})})]},t.name))})]})})]})})}),re&&/* @__PURE__ */P("div",{className:"absolute inset-0 bg-blue-500/15 border-4 border-dashed border-blue-500 pointer-events-none flex items-center justify-center z-20",children:/* @__PURE__ */P("div",{className:"px-4 py-2 rounded-md bg-blue-600 text-white text-sm font-medium shadow-lg",children:"Drop to upload"})})]})}export{H as default};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{getNumberingConfigs as e}from"./chunk-
|
|
2
|
-
/* @__PURE__ */N("div",{className:"p-2 border-b border-gray-200",children:/* @__PURE__ */k("button",{onClick:()=>{
|
|
1
|
+
import{getNumberingConfigs as e}from"./chunk-R4XSSHDI.js";import{SidebarLayout as t}from"./chunk-4SWPNARR.js";import{AboutApp as r}from"./chunk-Z2353HNE.js";import{toast_default as n}from"./chunk-3HJTOINK.js";import"./chunk-WRBXEZFN.js";import{useWindowManager as o,client_default as i}from"./chunk-L5XA5MLK.js";import{useShellPrefs as a}from"./chunk-FROOMUJ7.js";import"./chunk-DSSLOQDW.js";import"./chunk-5A7MWTXX.js";import"./chunk-OGXU7QFW.js";import"./chunk-HRLPFUPB.js";import"./chunk-ZUCYJAQH.js";import"./chunk-RMJZOKHY.js";import"./chunk-AFYQTVZO.js";import"./chunk-HZZNJHRH.js";import"./chunk-X4FJ54PP.js";import"./chunk-D65T4H6J.js";import{AddFallback as l,BookmarkFallback as s,BookmarkFallbackB as c,TrashFallback as d,PageFallback as p,CheckFallback as m}from"./chunk-6LTDJKIL.js";import{timeAgo as u}from"./chunk-W32SKK3D.js";import"./chunk-TNBCUZVE.js";import"./chunk-C3QOHMR6.js";import{Icon as h}from"./chunk-XWSWYMGM.js";import{useRef as y,useEffect as g,useState as x,useCallback as b}from"react";import{useQuery as f}from"@tanstack/react-query";import{jsxs as k,Fragment as v,jsx as N}from"react/jsx-runtime";var w=[{key:"yellow",bg:"bg-yellow-100",border:"border-yellow-300",text:"text-yellow-900",dot:"bg-yellow-400"},{key:"blue",bg:"bg-blue-100",border:"border-blue-300",text:"text-blue-900",dot:"bg-blue-400"},{key:"green",bg:"bg-green-100",border:"border-green-300",text:"text-green-900",dot:"bg-green-400"},{key:"pink",bg:"bg-pink-100",border:"border-pink-300",text:"text-pink-900",dot:"bg-pink-400"},{key:"purple",bg:"bg-purple-100",border:"border-purple-300",text:"text-purple-900",dot:"bg-purple-400"},{key:"orange",bg:"bg-orange-100",border:"border-orange-300",text:"text-orange-900",dot:"bg-orange-400"},{key:"white",bg:"bg-white",border:"border-gray-300",text:"text-gray-900",dot:"bg-gray-300"}];var _={sales_order:{entityType:"order",endpoint:"/orders/sales-orders/"},purchase_order:{entityType:"purchase_order",endpoint:"/purchase-orders/"},invoice:{entityType:"invoice",endpoint:"/invoicing/invoices/"},vendor_invoice:{entityType:"vendor_invoice",endpoint:"/invoicing/vendor-invoices/"},shipment:{entityType:"shipment",endpoint:"/shipments/delivery-notes/"},receipt:{entityType:"payment",endpoint:"/invoicing/payments/"},vendor_payment:{entityType:"vendor_payment",endpoint:"/invoicing/vendor-payments/"},vendor_price_sheet:{entityType:"vendor_price_sheet",endpoint:"/pricing/manufacturer-price-sheets/"},client_price_sheet:{entityType:"price_sheet",endpoint:"/pricing/price-sheets/"},qc_report:{entityType:"qc_report",endpoint:"/qc-reports/"},warranty_claim:{entityType:"warranty_claim",endpoint:"/warranty-claims/claims/"},vendor_shipment:{entityType:"vendor_shipment",endpoint:"/shipments/goods-receipts/"}},T=/\[([ xX]?)\]/g;function j(){const{openEntity:j}=o(),{prefs:C,save:$}=a(),{data:S}=f({queryKey:["numbering-configs"],queryFn:()=>e(),retry:!1}),W=y({});g(()=>{if(!S)return;const e={};for(const t of S){const r=_[t.entity_type];if(!r)continue;const n=(t.prefix||"").replace("#","").toUpperCase();if(n&&(e[n]={...r,prefix:t.prefix}),t.alt_prefix){const n=t.alt_prefix.replace("#","").toUpperCase();n&&(e[n]={...r,prefix:t.alt_prefix})}}W.current=e},[S]);const X=C.notepad_notes||[],[O,H]=x(null),[R,D]=x(""),[P,Z]=x(""),[F,I]=x("yellow"),[J,K]=x(!1),[M,U]=x(!1),L=y(null),q=y(),A=X.find(e=>e.id===O);g(()=>{if(!O&&X.length>0){const e=X[0];H(e.id),D(e.title),Z(e.content),I(e.color)}},[X.length]);const E=b(e=>{$({notepad_notes:e})},[$]),Q=b(()=>{if(!O||!J)return;const e=X.map(e=>e.id===O?{...e,title:R,content:P,color:F,updated_at:/* @__PURE__ */(new Date).toISOString()}:e);E(e),K(!1)},[O,J,R,P,F,X,E]);g(()=>{if(J)return q.current&&clearTimeout(q.current),q.current=setTimeout(Q,800),()=>{q.current&&clearTimeout(q.current)}},[J,Q]),g(()=>()=>{J&&Q()},[]);const B=e=>{J&&Q(),H(e.id),D(e.title),Z(e.content),I(e.color),K(!1),U(!1)},Y=e=>{const t=P.slice(0,e),r=P.slice(e).match(/^\[([ xX]?)\]/);if(!r)return;const n="x"===r[1]||"X"===r[1]?"[ ]":"[x]",o=P.slice(e+r[0].length);Z(t+n+o),K(!0)},V=async(e,t)=>{const r=W.current[e];if(!r)return;const o=`${e}#${t}`;try{const{data:e}=await i.get(r.endpoint,{params:{search:o,page_size:1}}),t=(e?.results??e??[])[0];t?j(r.entityType,t.id,t,o):n.error(`${o} not found`)}catch{n.error(`Failed to look up ${o}`)}},z="Start writing...\n\nTips:\n [] Type [] for a checkbox, click to toggle\n SO#35001 Type XX#NNNNN to link entities (SO, PO, CI, VI, PL, etc.)",G=/* @__PURE__ */k(v,{children:[
|
|
2
|
+
/* @__PURE__ */N("div",{className:"p-2 border-b border-gray-200",children:/* @__PURE__ */k("button",{onClick:()=>{J&&Q();const e={id:`note-${Date.now()}-${Math.random().toString(36).slice(2,6)}`,title:"",content:"",color:"yellow",sticky:!1,updated_at:/* @__PURE__ */(new Date).toISOString()},t=[e,...X];E(t),H(e.id),D(""),Z(""),I("yellow"),K(!1),U(!0),setTimeout(()=>L.current?.focus(),50)},className:"w-full flex items-center justify-center gap-1.5 rounded-lg bg-blue-600 text-white px-3 py-1.5 text-sm font-medium hover:bg-blue-700 transition-colors",children:[
|
|
3
3
|
/* @__PURE__ */N(h,{name:"add",fallback:l,className:"h-4 w-4",strokeWidth:2}),"New Note"]})}),
|
|
4
4
|
/* @__PURE__ */N("div",{className:"flex-1 overflow-y-auto",children:0===X.length?/* @__PURE__ */N("p",{className:"text-sm text-gray-400 text-center py-8 px-4",children:"No notes yet. Create one to get started."}):X.map(e=>{const t=(r=e.color,w.find(e=>e.key===r)||w[0]);var r;/* @__PURE__ */
|
|
5
|
-
return k("button",{onClick:()=>
|
|
5
|
+
return k("button",{onClick:()=>B(e),className:"w-full text-left px-3 py-2.5 border-b border-gray-100 transition-colors "+(O===e.id?"bg-blue-50":"hover:bg-gray-50"),children:[
|
|
6
6
|
/* @__PURE__ */k("div",{className:"flex items-center gap-2",children:[
|
|
7
7
|
/* @__PURE__ */N("div",{className:`w-2.5 h-2.5 rounded-full shrink-0 ${t.dot}`}),
|
|
8
8
|
/* @__PURE__ */N("span",{className:"text-sm font-medium text-gray-900 truncate flex-1",children:e.title||"Untitled"}),e.sticky&&/* @__PURE__ */N(h,{name:"bookmark",fallback:s,className:"h-3 w-3 text-amber-500 shrink-0"})]}),
|
|
@@ -10,16 +10,16 @@ return k("button",{onClick:()=>G(e),className:"w-full text-left px-3 py-2.5 bord
|
|
|
10
10
|
/* @__PURE__ */N("p",{className:"text-[10px] text-gray-300 mt-0.5 ml-4.5",children:u(e.updated_at)})]},e.id)})})]});/* @__PURE__ */
|
|
11
11
|
return k("div",{className:"h-full",children:[
|
|
12
12
|
/* @__PURE__ */N(r,{app:"notepad"}),
|
|
13
|
-
/* @__PURE__ */N(t,{sidebar:
|
|
13
|
+
/* @__PURE__ */N(t,{sidebar:G,storageKey:"notepad.sidebarWidth",defaultWidth:224,minWidth:180,maxWidth:360,children:O?/* @__PURE__ */k("div",{className:"flex-1 flex flex-col min-w-0",children:[
|
|
14
14
|
/* @__PURE__ */k("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-gray-200",children:[
|
|
15
|
-
/* @__PURE__ */N("input",{value:
|
|
16
|
-
/* @__PURE__ */N("div",{className:"flex gap-1",children:w.map(e=>/* @__PURE__ */N("button",{onClick:()=>{
|
|
17
|
-
/* @__PURE__ */N("button",{onClick:()=>(e=>{const t=X.map(t=>t.id===e?{...t,sticky:!t.sticky}:t);
|
|
18
|
-
/* @__PURE__ */N("button",{onClick:()=>(e=>{const t=X.filter(t=>t.id!==e);if(
|
|
19
|
-
return N("div",{className:c?"line-through text-gray-400":"",children:n},r)})})(
|
|
15
|
+
/* @__PURE__ */N("input",{value:R,onChange:e=>{D(e.target.value),K(!0)},placeholder:"Note title...",className:"flex-1 text-lg font-semibold text-gray-900 outline-none bg-transparent placeholder:text-gray-300"}),
|
|
16
|
+
/* @__PURE__ */N("div",{className:"flex gap-1",children:w.map(e=>/* @__PURE__ */N("button",{onClick:()=>{I(e.key),K(!0)},className:`w-5 h-5 rounded-full border-2 transition-all ${e.dot} ${F===e.key?"border-gray-600 scale-110":"border-transparent hover:border-gray-400"}`,title:e.key},e.key))}),
|
|
17
|
+
/* @__PURE__ */N("button",{onClick:()=>(e=>{const t=X.map(t=>t.id===e?{...t,sticky:!t.sticky}:t);E(t);const r=t.find(t=>t.id===e);n.success(r?.sticky?"Pinned to desktop":"Removed from desktop")})(O),title:A?.sticky?"Remove from desktop":"Pin to desktop",className:"p-1 rounded transition-colors "+(A?.sticky?"text-amber-500 hover:text-amber-600":"text-gray-300 hover:text-amber-400"),children:/* @__PURE__ */N(h,{name:"bookmark",fallback:c,className:"h-4 w-4",fill:A?.sticky?"currentColor":"none",strokeWidth:1.5})}),
|
|
18
|
+
/* @__PURE__ */N("button",{onClick:()=>(e=>{const t=X.filter(t=>t.id!==e);if(E(t),O===e){const e=t[0];e?B(e):(H(null),D(""),Z(""))}})(O),title:"Delete note",className:"p-1 rounded text-gray-300 hover:text-red-500 transition-colors",children:/* @__PURE__ */N(h,{name:"trash",fallback:d,className:"h-4 w-4",strokeWidth:1.5})})]}),M?/* @__PURE__ */N("textarea",{ref:L,value:P,onChange:e=>{Z(e.target.value),K(!0)},onBlur:()=>{U(!1),J&&Q()},placeholder:z,className:"flex-1 p-4 text-sm text-gray-700 outline-none resize-none bg-transparent leading-relaxed placeholder:text-gray-300 font-mono"}):/* @__PURE__ */N("div",{onClick:()=>{U(!0),setTimeout(()=>L.current?.focus(),50)},className:"flex-1 p-4 text-sm text-gray-700 overflow-y-auto leading-relaxed cursor-text",children:P?(e=>{if(!e)return[];const t=e.split("\n");return t.map((e,r)=>{const n=[];let o=0;const i=[],a=/([A-Z]{2,4})#(\d{4,6})/g;let l;for(;null!==(l=a.exec(e));){const e=l[1],t=l[2];if(W.current[e]){const n=l.index,o=l[0];i.push({idx:n,len:o.length,render:()=>/* @__PURE__ */N("button",{onClick:()=>V(e,t),className:"text-blue-600 hover:text-blue-800 hover:underline font-medium cursor-pointer",children:o},`ref-${r}-${n}`)})}}T.lastIndex=0;let s=0;for(let e=0;e<r;e++)s+=t[e].length+1;for(;null!==(l=T.exec(e));){const e="x"===l[1]||"X"===l[1],t=l.index,n=s+t;i.push({idx:t,len:l[0].length,render:()=>/* @__PURE__ */N("button",{onClick:()=>Y(n),className:`inline-flex items-center justify-center w-4 h-4 rounded border ${e?"bg-blue-500 border-blue-500 text-white":"border-gray-400 bg-white hover:border-blue-400"} cursor-pointer align-text-bottom mr-0.5`,children:e&&/* @__PURE__ */N(h,{name:"check",fallback:m,className:"w-3 h-3",strokeWidth:3})},`cb-${r}-${t}`)})}i.sort((e,t)=>e.idx-t.idx);for(const t of i)t.idx>o&&n.push(/* @__PURE__ */N("span",{children:e.slice(o,t.idx)},`t-${r}-${o}`)),n.push(t.render()),o=t.idx+t.len;o<e.length&&n.push(/* @__PURE__ */N("span",{children:e.slice(o)},`t-${r}-${o}`)),0===n.length&&n.push(/* @__PURE__ */N("span",{children:""},`empty-${r}`));const c=/^\[x\]/i.test(e.trimStart());/* @__PURE__ */
|
|
19
|
+
return N("div",{className:c?"line-through text-gray-400":"",children:n},r)})})(P):/* @__PURE__ */N("p",{className:"text-gray-300 whitespace-pre-line",children:z})}),
|
|
20
20
|
/* @__PURE__ */k("div",{className:"px-4 py-1.5 border-t border-gray-100 flex items-center gap-4 text-[10px] text-gray-400",children:[
|
|
21
21
|
/* @__PURE__ */N("span",{children:"[] checkbox"}),
|
|
22
22
|
/* @__PURE__ */N("span",{children:"SO#35001 entity link"}),
|
|
23
|
-
/* @__PURE__ */N("span",{className:"ml-auto",children:
|
|
23
|
+
/* @__PURE__ */N("span",{className:"ml-auto",children:M?"Editing":"Click to edit"})]})]}):/* @__PURE__ */N("div",{className:"flex-1 flex items-center justify-center",children:/* @__PURE__ */k("div",{className:"text-center text-gray-400",children:[
|
|
24
24
|
/* @__PURE__ */N(h,{name:"page",fallback:p,className:"h-12 w-12 mx-auto mb-3 text-gray-300",strokeWidth:1}),
|
|
25
25
|
/* @__PURE__ */N("p",{className:"text-sm",children:"Select a note or create a new one"})]})})})]})}export{j as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{PdfViewer as default,fitScale,pdfWasmParams}from"./chunk-3GPU3JOW.js";import"./chunk-3HJTOINK.js";import"./chunk-6LTDJKIL.js";import"./chunk-TNBCUZVE.js";import"./chunk-C3QOHMR6.js";import"./chunk-XWSWYMGM.js";
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-
|
|
1
|
+
import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-PKEQ7XOH.js";import{subscribePomo as a,getPomoSnapshot as o,setPomoDurations as n,setPomoAlarm as r,setPomoAlarmConfig as l,setPomoBehaviour as s,setPomoFocusSound as i,useTodoTasks as c,migratePomodoroTasksOnce as d,pomoSwitchMode as u,pomoPause as m,pomoStart as h,ALARM_OPTIONS as p,playAlarm as g,FOCUS_SOUND_OPTIONS as f,previewFocusSound as b}from"./chunk-MLYC5VQI.js";import"./chunk-3HJTOINK.js";import{useWidgetSettings as k}from"./chunk-L5XA5MLK.js";import{useShellPrefs as x}from"./chunk-FROOMUJ7.js";import"./chunk-DSSLOQDW.js";import"./chunk-5A7MWTXX.js";import"./chunk-OGXU7QFW.js";import"./chunk-HRLPFUPB.js";import"./chunk-ZUCYJAQH.js";import"./chunk-RMJZOKHY.js";import"./chunk-AFYQTVZO.js";import"./chunk-HZZNJHRH.js";import"./chunk-X4FJ54PP.js";import"./chunk-D65T4H6J.js";import{MoreVerticalFallback as v,AddCircleFallback as y,ChevronDownFallbackC as N}from"./chunk-6LTDJKIL.js";import"./chunk-TNBCUZVE.js";import"./chunk-C3QOHMR6.js";import{Icon as w}from"./chunk-XWSWYMGM.js";import{useSyncExternalStore as C,useEffect as S,useMemo as B,useState as M,useRef as T,useCallback as j}from"react";import{jsxs as P,Fragment as I,jsx as A}from"react/jsx-runtime";var L="pomodoro_appearance",$="pomodoro_active_task_id",V={focus:"Pomodoro",short:"Short Break",long:"Long Break"},D={focus:"#0f172a",short:"#508a52",long:"#5b7898"};var O=25,R=5,W=15,_=!1,F=!1,H=4,E=!0,J=!0,K="bell",Q=100,U=1,X="none",Z=50,z=(e,t,a,o)=>"number"==typeof e&&isFinite(e)?Math.max(t,Math.min(a,Math.round(e))):o;function Y(){const t=C(a,o,o),{prefs:g,save:b}=x(),N=function(e){const t=e&&"object"==typeof e?e:{};return{focusMinutes:z(t.focusMinutes,1,120,O),shortBreakMinutes:z(t.shortBreakMinutes,1,120,R),longBreakMinutes:z(t.longBreakMinutes,1,120,W),autoStartBreaks:"boolean"==typeof t.autoStartBreaks?t.autoStartBreaks:_,autoStartPomodoros:"boolean"==typeof t.autoStartPomodoros?t.autoStartPomodoros:F,longBreakInterval:z(t.longBreakInterval,1,20,H),autoCheckTasks:"boolean"==typeof t.autoCheckTasks?t.autoCheckTasks:E,checkToBottom:"boolean"==typeof t.checkToBottom?t.checkToBottom:J,alarmSound:p.some(e=>e.id===t.alarmSound)?t.alarmSound:K,alarmVolume:z(t.alarmVolume,0,100,Q),alarmRepeat:z(t.alarmRepeat,1,5,U),focusSound:f.some(e=>e.id===t.focusSound)?t.focusSound:X,focusVolume:z(t.focusVolume,0,100,Z)}}(g.pomodoro_settings);S(()=>{n({focus:60*N.focusMinutes,short:60*N.shortBreakMinutes,long:60*N.longBreakMinutes})},[N.focusMinutes,N.shortBreakMinutes,N.longBreakMinutes]),S(()=>{r(N.alarmSound),l(N.alarmVolume,N.alarmRepeat)},[N.alarmSound,N.alarmVolume,N.alarmRepeat]),S(()=>{s({autoStartBreaks:N.autoStartBreaks,autoStartPomodoros:N.autoStartPomodoros,longBreakInterval:N.longBreakInterval})},[N.autoStartBreaks,N.autoStartPomodoros,N.longBreakInterval]),S(()=>{i(N.focusSound,N.focusVolume)},[N.focusSound,N.focusVolume]),S(()=>{if("undefined"!=typeof Notification&&"default"===Notification.permission)try{Notification.requestPermission()}catch{}},[]);const Y=c(),q=Y.tasks,ee=B(()=>/* @__PURE__ */(new Date).toISOString().slice(0,10),[]),te=function(e,t){return B(()=>t?(e=>{const t=[],a=[];for(const o of e)(o.done?a:t).push(o);return[...t,...a]})(e):e,[e,t])}(B(()=>q.filter(e=>!!e.dueDate&&(e.dueDate===ee||e.dueDate<ee&&!e.done)),[q,ee]),N.checkToBottom),[ae,oe]=M(()=>localStorage.getItem($)),[ne,re]=M(!1),[le,se]=M(null),ie=T(!1);S(()=>{ie.current||(ie.current=!0,d(q,Y.setAllTasks))},[]),S(()=>{try{ae?localStorage.setItem($,ae):localStorage.removeItem($)}catch{}},[ae]),S(()=>{if(!le)return;const e=()=>se(null),t=setTimeout(()=>document.addEventListener("click",e),0);return()=>{clearTimeout(t),document.removeEventListener("click",e)}},[le]);const ce=T(t.streak);S(()=>{if(t.streak>ce.current&&ae){const e=q.find(e=>e.id===ae);if(e){const t=(e.completed??0)+1,a=e.estimated??0,o=N.autoCheckTasks&&a>0&&t>=a;Y.updateTask(ae,{completed:t,done:e.done||o})}}ce.current=t.streak},[t.streak,ae,N.autoCheckTasks,q,Y]);const ue=te.reduce((e,t)=>e+(t.completed??0),0),me=te.reduce((e,t)=>e+Math.max(t.estimated??0,t.completed??0),0),he=te.reduce((e,t)=>t.done?e:e+Math.max(0,(t.estimated??0)-(t.completed??0)),0),pe=t.running&&"focus"===t.mode?t.remaining:0,ge=he*N.focusMinutes*60+pe,fe=new Date(Date.now()+1e3*ge).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1}),be=(ge/3600).toFixed(1),ke=ae?q.find(e=>e.id===ae)??null:null,xe=String(Math.floor(t.remaining/60)).padStart(2,"0"),ve=String(t.remaining%60).padStart(2,"0"),[ye,Ne]=M(()=>e(L)),[we,Ce]=M(!1),[Se,Be]=M(ye),[Me,Te]=M(N);k(j(()=>{Be({...ye}),Te({...N}),Ce(!0)},[ye,N]));const je="focus"!==t.mode,Pe=D[t.mode],Ie=je?(Ae=Pe,Le=ye.activeOpacity/100,`rgba(${parseInt(Ae.slice(1,3),16)}, ${parseInt(Ae.slice(3,5),16)}, ${parseInt(Ae.slice(5,7),16)}, ${Le})`):`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${ye.activeOpacity/100})`;var Ae,Le;const $e={primary:je?"text-white":"text-gray-900",secondary:je?"text-white/85":"text-gray-700",muted:je?"text-white/65":"text-gray-500",tabActive:je?"bg-white/15 text-white":"bg-gray-200 text-gray-900",tabInactive:je?"text-white/75 hover:bg-white/10":"text-gray-500 hover:bg-gray-200",divider:je?"border-white/30":"border-gray-200",softDivider:je?"border-white/20":"border-gray-200",iconBtn:je?"bg-black/15 hover:bg-black/25 text-white/85":"bg-gray-200 hover:bg-gray-300 text-gray-600",addTaskBtn:je?"border-white/45 text-white/90 hover:bg-white/[0.06]":"border-gray-300 text-gray-500 hover:bg-gray-200/50"},Ve=je?Pe:"#0f172a";/* @__PURE__ */
|
|
2
2
|
return P(I,{children:[
|
|
3
|
-
/* @__PURE__ */P("div",{className:`flex flex-col h-full select-none transition-colors duration-300 ${
|
|
4
|
-
/* @__PURE__ */A("div",{className:"px-3 pt-3 flex justify-center gap-1.5",children:["focus","short","long"].map(e=>/* @__PURE__ */A("button",{onClick:()=>u(e),className:`px-2.5 py-1 text-[13px] font-bold rounded transition-colors ${t.mode===e
|
|
3
|
+
/* @__PURE__ */P("div",{className:`flex flex-col h-full select-none transition-colors duration-300 ${$e.primary}`,style:{backgroundColor:Ie,backdropFilter:ye.activeBlur>0?`blur(${ye.activeBlur}px)`:void 0},children:[
|
|
4
|
+
/* @__PURE__ */A("div",{className:"px-3 pt-3 flex justify-center gap-1.5",children:["focus","short","long"].map(e=>/* @__PURE__ */A("button",{onClick:()=>u(e),className:`px-2.5 py-1 text-[13px] font-bold rounded transition-colors ${t.mode===e?$e.tabActive:$e.tabInactive}`,children:V[e]},e))}),
|
|
5
5
|
/* @__PURE__ */P("div",{className:"text-center font-bold tabular-nums leading-none tracking-tight mt-3",style:{fontSize:"4.5rem"},children:[xe,":",ve]}),
|
|
6
|
-
/* @__PURE__ */A("div",{className:"flex justify-center mt-3 mb-2",children:/* @__PURE__ */A("button",{onClick:()=>t.running?m():h(),className:"bg-white px-12 py-2.5 rounded-md font-bold text-base shadow-[0_4px_0_rgba(0,0,0,0.12)] hover:shadow-[0_3px_0_rgba(0,0,0,0.12)] active:translate-y-1 active:shadow-none transition-all",style:{color:
|
|
6
|
+
/* @__PURE__ */A("div",{className:"flex justify-center mt-3 mb-2",children:/* @__PURE__ */A("button",{onClick:()=>t.running?m():h(),className:"bg-white px-12 py-2.5 rounded-md font-bold text-base shadow-[0_4px_0_rgba(0,0,0,0.12)] hover:shadow-[0_3px_0_rgba(0,0,0,0.12)] active:translate-y-1 active:shadow-none transition-all",style:{color:Ve,letterSpacing:"0.08em"},children:t.running?"PAUSE":"START"})}),
|
|
7
7
|
/* @__PURE__ */A("div",{className:"px-3 py-3 text-center",children:ke?/* @__PURE__ */P(I,{children:[
|
|
8
|
-
/* @__PURE__ */P("div",{className:`text-xs leading-tight ${
|
|
9
|
-
/* @__PURE__ */A("div",{className:`text-[15px] font-medium leading-tight truncate mt-0.5 ${
|
|
8
|
+
/* @__PURE__ */P("div",{className:`text-xs leading-tight ${$e.muted}`,children:["#",(ke.completed??0)+1]}),
|
|
9
|
+
/* @__PURE__ */A("div",{className:`text-[15px] font-medium leading-tight truncate mt-0.5 ${$e.primary}`,children:ke.name})]}):/* @__PURE__ */A("div",{className:`text-xs italic ${$e.muted}`,children:"No task selected"})}),
|
|
10
10
|
/* @__PURE__ */P("div",{className:"px-3 mt-1 flex items-center justify-between",children:[
|
|
11
|
-
/* @__PURE__ */A("h3",{className:`text-base font-bold tracking-tight ${
|
|
12
|
-
/* @__PURE__ */A("button",{className:`rounded p-1 transition-colors ${
|
|
13
|
-
/* @__PURE__ */A("div",{className:`border-t mx-3 mt-2 ${
|
|
11
|
+
/* @__PURE__ */A("h3",{className:`text-base font-bold tracking-tight ${$e.primary}`,children:"Tasks"}),
|
|
12
|
+
/* @__PURE__ */A("button",{className:`rounded p-1 transition-colors ${$e.iconBtn}`,"aria-label":"Tasks menu",tabIndex:-1,children:/* @__PURE__ */A(w,{name:"more-vertical",fallback:v,className:"h-4 w-4"})})]}),
|
|
13
|
+
/* @__PURE__ */A("div",{className:`border-t mx-3 mt-2 ${$e.divider}`}),
|
|
14
14
|
/* @__PURE__ */P("div",{className:"flex-1 px-3 py-3 space-y-2 overflow-y-auto",children:[te.map(e=>{const t=e.id===ae;/* @__PURE__ */
|
|
15
15
|
return P("div",{onClick:()=>oe(e.id),className:"bg-white text-gray-800 rounded-md flex items-center pr-2 py-2.5 shadow-sm cursor-pointer transition-shadow hover:shadow-md "+(t?"border-l-4 border-gray-700 pl-2":"pl-3 border-l-4 border-transparent"),children:[
|
|
16
|
-
/* @__PURE__ */A("button",{onClick:t=>{var a;t.stopPropagation(),a=e.id,Y.toggleDone(a)},className:"shrink-0",children:e.done?/* @__PURE__ */A("svg",{className:"h-5 w-5",fill:"currentColor",viewBox:"0 0 20 20",style:{color:
|
|
16
|
+
/* @__PURE__ */A("button",{onClick:t=>{var a;t.stopPropagation(),a=e.id,Y.toggleDone(a)},className:"shrink-0",children:e.done?/* @__PURE__ */A("svg",{className:"h-5 w-5",fill:"currentColor",viewBox:"0 0 20 20",style:{color:Ve},children:/* @__PURE__ */A("path",{d:"M10 0a10 10 0 100 20 10 10 0 000-20zm-1 14.5l-4.5-4.5 1.4-1.4 3.1 3.1 6.1-6.1 1.4 1.4z"})}):/* @__PURE__ */A("svg",{className:"h-5 w-5 text-gray-300",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:/* @__PURE__ */A("circle",{cx:"12",cy:"12",r:"10"})})}),
|
|
17
17
|
/* @__PURE__ */A("span",{className:"ml-3 flex-1 font-semibold truncate "+(e.done?"line-through text-gray-400":"text-gray-800"),children:e.name}),
|
|
18
18
|
/* @__PURE__ */P("span",{className:"text-sm tabular-nums mr-1.5 shrink-0",children:[
|
|
19
19
|
/* @__PURE__ */A("span",{className:"font-bold text-gray-500",children:e.completed??0}),
|
|
20
20
|
/* @__PURE__ */A("span",{className:"text-gray-400",children:" / "}),
|
|
21
21
|
/* @__PURE__ */A("span",{className:"text-gray-400",children:e.estimated??"–"})]}),
|
|
22
22
|
/* @__PURE__ */P("div",{className:"relative",children:[
|
|
23
|
-
/* @__PURE__ */A("button",{onClick:t=>{t.stopPropagation(),se(le===e.id?null:e.id)},className:"rounded p-1 bg-gray-100 hover:bg-gray-200",children:/* @__PURE__ */A(w,{name:"more-vertical",fallback:v,className:"h-4 w-4 text-gray-500"})}),le===e.id&&/* @__PURE__ */A("div",{className:"absolute right-0 top-full mt-1 bg-white text-gray-800 rounded shadow-lg border border-gray-200 z-10 min-w-[110px] overflow-hidden",onClick:e=>e.stopPropagation(),children:/* @__PURE__ */A("button",{onClick:t=>{var a;t.stopPropagation(),a=e.id,Y.removeTask(a),ae===a&&oe(null),se(null)},className:"block w-full px-3 py-1.5 text-sm text-left hover:bg-red-50 text-red-600",children:"Delete"})})]})]},e.id)}),ne?/* @__PURE__ */A(de,{onSubmit:(e,t)=>{const a=e.trim();if(!a)return;const o=Y.addTask({name:a,estimated:t,completed:0,dueDate:ee});ae||oe(o),re(!1)},onCancel:()=>re(!1),accentColor:
|
|
23
|
+
/* @__PURE__ */A("button",{onClick:t=>{t.stopPropagation(),se(le===e.id?null:e.id)},className:"rounded p-1 bg-gray-100 hover:bg-gray-200",children:/* @__PURE__ */A(w,{name:"more-vertical",fallback:v,className:"h-4 w-4 text-gray-500"})}),le===e.id&&/* @__PURE__ */A("div",{className:"absolute right-0 top-full mt-1 bg-white text-gray-800 rounded shadow-lg border border-gray-200 z-10 min-w-[110px] overflow-hidden",onClick:e=>e.stopPropagation(),children:/* @__PURE__ */A("button",{onClick:t=>{var a;t.stopPropagation(),a=e.id,Y.removeTask(a),ae===a&&oe(null),se(null)},className:"block w-full px-3 py-1.5 text-sm text-left hover:bg-red-50 text-red-600",children:"Delete"})})]})]},e.id)}),ne?/* @__PURE__ */A(de,{onSubmit:(e,t)=>{const a=e.trim();if(!a)return;const o=Y.addTask({name:a,estimated:t,completed:0,dueDate:ee});ae||oe(o),re(!1)},onCancel:()=>re(!1),accentColor:Ve}):/* @__PURE__ */P("button",{onClick:()=>re(!0),className:`w-full border-2 border-dashed rounded-md py-3 font-semibold flex items-center justify-center gap-2 transition-colors ${$e.addTaskBtn}`,children:[
|
|
24
24
|
/* @__PURE__ */A(w,{name:"add-circle",fallback:y,className:"h-5 w-5",strokeWidth:2}),"Add Task"]})]}),
|
|
25
|
-
/* @__PURE__ */P("div",{className:`border-t px-3 py-2.5 flex items-center justify-center gap-5 text-sm ${
|
|
26
|
-
/* @__PURE__ */P("span",{className
|
|
27
|
-
/* @__PURE__ */A("span",{className:`font-bold ${
|
|
28
|
-
/* @__PURE__ */A("span",{className
|
|
29
|
-
/* @__PURE__ */A("span",{className:`font-bold ${
|
|
30
|
-
/* @__PURE__ */A("span",{className:`font-bold ${
|
|
31
|
-
/* @__PURE__ */P("span",{className
|
|
32
|
-
/* @__PURE__ */A(G,{open:we,onClose:()=>Ce(!1),onSave:()=>{Ne(Se),localStorage.setItem(
|
|
25
|
+
/* @__PURE__ */P("div",{className:`border-t px-3 py-2.5 flex items-center justify-center gap-5 text-sm ${$e.softDivider}`,children:[
|
|
26
|
+
/* @__PURE__ */P("span",{className:$e.secondary,children:["Pomos: ",
|
|
27
|
+
/* @__PURE__ */A("span",{className:`font-bold ${$e.primary}`,children:ue}),
|
|
28
|
+
/* @__PURE__ */A("span",{className:$e.muted,children:" / "}),
|
|
29
|
+
/* @__PURE__ */A("span",{className:`font-bold ${$e.primary}`,children:me})]}),ge>0&&/* @__PURE__ */P("span",{className:$e.secondary,children:["Finish At: ",
|
|
30
|
+
/* @__PURE__ */A("span",{className:`font-bold ${$e.primary}`,children:fe}),
|
|
31
|
+
/* @__PURE__ */P("span",{className:$e.muted,children:[" (",be,"h)"]})]})]})]}),
|
|
32
|
+
/* @__PURE__ */A(G,{open:we,onClose:()=>Ce(!1),onSave:()=>{Ne(Se),localStorage.setItem(L,JSON.stringify(Se)),b({pomodoro_settings:Me}),Ce(!1)},configAppearance:Se,setConfigAppearance:Be,configPrefs:Me,setConfigPrefs:Te})]})}function G({open:e,onClose:a,onSave:o,configAppearance:n,setConfigAppearance:r,configPrefs:l,setConfigPrefs:s}){const i=(e,t)=>s(a=>({...a,[e]:t}));/* @__PURE__ */
|
|
33
33
|
return P(t,{open:e,onClose:a,title:"Pomodoro Settings",appearance:n,onAppearanceChange:r,onSave:o,children:[
|
|
34
34
|
/* @__PURE__ */P(q,{icon:/* @__PURE__ */A(se,{}),label:"TIMER",children:[
|
|
35
35
|
/* @__PURE__ */P("div",{children:[
|