efficient-shell 4.137.0 → 4.145.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/LICENSE +6 -17
- package/README.md +80 -12
- package/dist/Browser-24YNRTKT.js +43 -0
- package/dist/Calculator-LER6KUQC.js +29 -0
- package/dist/ConfirmDialog-GAYETRMG.js +1 -0
- package/dist/CurrencyConverter-Y35GFDFF.js +21 -0
- package/dist/Documents-7FYX2CGT.js +52 -0
- package/dist/Files-RZOML2N6.js +89 -0
- package/dist/Notepad-VVDCBDUA.js +25 -0
- package/dist/PdfViewer-CvLb2j_l.d.ts +40 -0
- package/dist/PdfViewer-ZCT3PYXU.js +1 -0
- package/dist/PomodoroTimer-VAM3AJOX.js +99 -0
- package/dist/Preview-HZ37D7QJ.js +187 -0
- package/dist/Sidebar-CVF7C6BO.js +23 -0
- package/dist/Spreadsheet-6WX3P6AB.js +37 -0
- package/dist/Stock-AUWI3TUX.js +16 -0
- package/dist/Weather-HU75TH7T.js +60 -0
- package/dist/WorldClock-T64MDRMJ.js +32 -0
- package/dist/apps/index.d.ts +3 -23
- package/dist/apps/index.js +1 -151
- package/dist/brand.css +1 -1
- package/dist/chunk-2RHMSFZV.js +9 -0
- package/dist/chunk-4FS742BM.js +1 -0
- package/dist/chunk-57MIENLJ.js +1 -0
- package/dist/chunk-7DAQ3WVP.js +106 -0
- package/dist/chunk-BR22X7E5.js +1 -0
- package/dist/chunk-BUTSU7FO.js +1 -0
- package/dist/chunk-CVTOZCM3.js +24 -0
- package/dist/chunk-D65T4H6J.js +1 -0
- package/dist/chunk-ESL5TDNA.js +1 -0
- package/dist/chunk-FBDZGO3V.js +1 -0
- package/dist/chunk-FHTLC7HH.js +1 -0
- package/dist/chunk-GDSGXDET.js +34 -0
- package/dist/chunk-I55UMU3R.js +6 -0
- package/dist/chunk-KKOHUQPF.js +1 -0
- package/dist/chunk-L7TEFXIS.js +69 -0
- package/dist/chunk-LVDRBRYU.js +1 -0
- package/dist/chunk-LVFMK5OQ.js +29 -0
- package/dist/chunk-LWLCNQY7.js +1 -0
- package/dist/chunk-MAIHBBWT.js +1 -0
- package/dist/chunk-MU5H2CDL.js +2 -0
- package/dist/chunk-NBBOFQPL.js +947 -0
- package/dist/chunk-NPJH5MD7.js +13 -0
- package/dist/chunk-OCSOMMY2.js +1 -0
- package/dist/chunk-PH3PRIFP.js +5 -0
- package/dist/chunk-RJ4LACFH.js +9 -0
- package/dist/chunk-SLCR26NK.js +4 -0
- package/dist/chunk-TFKB2WEB.js +19 -0
- package/dist/chunk-TR6PLN7W.js +1 -0
- package/dist/chunk-TWV42Q3K.js +1 -0
- package/dist/chunk-UB22J6EF.js +1 -0
- package/dist/chunk-UB4JIOLD.js +2 -0
- package/dist/chunk-V453E4KU.js +11 -0
- package/dist/chunk-VTVSMRFX.js +1 -0
- package/dist/file-intake/index.js +1 -4
- package/dist/{index-DVI9DMSu.d.ts → index-NhR7frRu.d.ts} +189 -17
- package/dist/index.d.ts +2 -2
- package/dist/index.js +639 -7473
- package/dist/map/index.d.ts +266 -13
- package/dist/map/index.js +22 -540
- package/dist/markdown/index.js +6 -184
- package/dist/markup/index.js +1 -135
- package/dist/page-tabs/index.js +21 -709
- package/dist/pdf/index.d.ts +9 -0
- package/dist/pdf/index.js +2 -0
- package/dist/sounds-OMHXVVQ4.js +1 -0
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +1 -19
- package/dist/ui.css +7 -0
- package/package.json +9 -3
- package/dist/Browser-ZNX4WFUH.js +0 -482
- package/dist/Browser-ZNX4WFUH.js.map +0 -1
- package/dist/Calculator-6FGNKOXU.js +0 -192
- package/dist/Calculator-6FGNKOXU.js.map +0 -1
- package/dist/ConfirmDialog-NPQMIGUR.js +0 -4
- package/dist/ConfirmDialog-NPQMIGUR.js.map +0 -1
- package/dist/CurrencyConverter-FF7EXRYL.js +0 -236
- package/dist/CurrencyConverter-FF7EXRYL.js.map +0 -1
- package/dist/Documents-H3R7XSBH.js +0 -441
- package/dist/Documents-H3R7XSBH.js.map +0 -1
- package/dist/Files-ZHJIAUC2.js +0 -805
- package/dist/Files-ZHJIAUC2.js.map +0 -1
- package/dist/Notepad-VE7ISWRQ.js +0 -410
- package/dist/Notepad-VE7ISWRQ.js.map +0 -1
- package/dist/PdfViewer-SQBFYAGW.js +0 -5
- package/dist/PdfViewer-SQBFYAGW.js.map +0 -1
- package/dist/PomodoroTimer-IR3WREED.js +0 -633
- package/dist/PomodoroTimer-IR3WREED.js.map +0 -1
- package/dist/Preview-DAQGRNRM.js +0 -2959
- package/dist/Preview-DAQGRNRM.js.map +0 -1
- package/dist/Sidebar-YW6H4NDJ.js +0 -291
- package/dist/Sidebar-YW6H4NDJ.js.map +0 -1
- package/dist/Spreadsheet-HOCPHJOC.js +0 -519
- package/dist/Spreadsheet-HOCPHJOC.js.map +0 -1
- package/dist/Stock-LVRQPURG.js +0 -158
- package/dist/Stock-LVRQPURG.js.map +0 -1
- package/dist/Weather-LZQGVDJL.js +0 -431
- package/dist/Weather-LZQGVDJL.js.map +0 -1
- package/dist/WorldClock-XPD7WOZT.js +0 -202
- package/dist/WorldClock-XPD7WOZT.js.map +0 -1
- package/dist/apps/index.js.map +0 -1
- package/dist/chunk-5O42JXQE.js +0 -26
- package/dist/chunk-5O42JXQE.js.map +0 -1
- package/dist/chunk-5RPTS3BT.js +0 -70
- package/dist/chunk-5RPTS3BT.js.map +0 -1
- package/dist/chunk-6XJEJWNJ.js +0 -61
- package/dist/chunk-6XJEJWNJ.js.map +0 -1
- package/dist/chunk-7CCHEEYC.js +0 -94
- package/dist/chunk-7CCHEEYC.js.map +0 -1
- package/dist/chunk-BE7FZOFU.js +0 -17
- package/dist/chunk-BE7FZOFU.js.map +0 -1
- package/dist/chunk-COWYSHG2.js +0 -79
- package/dist/chunk-COWYSHG2.js.map +0 -1
- package/dist/chunk-D7PYW2QS.js +0 -265
- package/dist/chunk-D7PYW2QS.js.map +0 -1
- package/dist/chunk-DVZWYWSD.js +0 -26
- package/dist/chunk-DVZWYWSD.js.map +0 -1
- package/dist/chunk-E7TB6WD2.js +0 -153
- package/dist/chunk-E7TB6WD2.js.map +0 -1
- package/dist/chunk-FIHOGVUP.js +0 -416
- package/dist/chunk-FIHOGVUP.js.map +0 -1
- package/dist/chunk-GA35NEND.js +0 -56
- package/dist/chunk-GA35NEND.js.map +0 -1
- package/dist/chunk-HUBJAUGG.js +0 -316
- package/dist/chunk-HUBJAUGG.js.map +0 -1
- package/dist/chunk-I2TAAJHS.js +0 -465
- package/dist/chunk-I2TAAJHS.js.map +0 -1
- package/dist/chunk-ICTRCKUE.js +0 -3710
- package/dist/chunk-ICTRCKUE.js.map +0 -1
- package/dist/chunk-IPXN646P.js +0 -14
- package/dist/chunk-IPXN646P.js.map +0 -1
- package/dist/chunk-IRWSRJ4K.js +0 -48
- package/dist/chunk-IRWSRJ4K.js.map +0 -1
- package/dist/chunk-JOPU6WPY.js +0 -504
- package/dist/chunk-JOPU6WPY.js.map +0 -1
- package/dist/chunk-MGGY74RY.js +0 -14
- package/dist/chunk-MGGY74RY.js.map +0 -1
- package/dist/chunk-PVPPAWVM.js +0 -46
- package/dist/chunk-PVPPAWVM.js.map +0 -1
- package/dist/chunk-R7QGMK6N.js +0 -102
- package/dist/chunk-R7QGMK6N.js.map +0 -1
- package/dist/chunk-RT6DSB5Y.js +0 -143
- package/dist/chunk-RT6DSB5Y.js.map +0 -1
- package/dist/chunk-TRCWINHF.js +0 -105
- package/dist/chunk-TRCWINHF.js.map +0 -1
- package/dist/chunk-TW7LPMVR.js +0 -16
- package/dist/chunk-TW7LPMVR.js.map +0 -1
- package/dist/chunk-UTYKLGGT.js +0 -195
- package/dist/chunk-UTYKLGGT.js.map +0 -1
- package/dist/chunk-VNJJCH5A.js +0 -822
- package/dist/chunk-VNJJCH5A.js.map +0 -1
- package/dist/chunk-XJHZWSKV.js +0 -1103
- package/dist/chunk-XJHZWSKV.js.map +0 -1
- package/dist/chunk-Y3GYJ7YR.js +0 -549
- package/dist/chunk-Y3GYJ7YR.js.map +0 -1
- package/dist/chunk-YA4EE7ST.js +0 -14107
- package/dist/chunk-YA4EE7ST.js.map +0 -1
- package/dist/chunk-YDHXWCCJ.js +0 -145
- package/dist/chunk-YDHXWCCJ.js.map +0 -1
- package/dist/chunk-YE6GUDGP.js +0 -548
- package/dist/chunk-YE6GUDGP.js.map +0 -1
- package/dist/chunk-YNKK7NE3.js +0 -171
- package/dist/chunk-YNKK7NE3.js.map +0 -1
- package/dist/chunk-YPO6RDMX.js +0 -20
- package/dist/chunk-YPO6RDMX.js.map +0 -1
- package/dist/chunk-ZS7PMGUW.js +0 -7
- package/dist/chunk-ZS7PMGUW.js.map +0 -1
- package/dist/file-intake/index.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/map/index.js.map +0 -1
- package/dist/markdown/index.js.map +0 -1
- package/dist/markup/index.js.map +0 -1
- package/dist/page-tabs/index.js.map +0 -1
- package/dist/sounds-NT4DEZGD.js +0 -3
- package/dist/sounds-NT4DEZGD.js.map +0 -1
- package/dist/ui/index.js.map +0 -1
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import{fetchCityWeather as e,getCondition as t,AVAILABLE_CITIES as a,toFahrenheit as r}from"./chunk-FBDZGO3V.js";import{loadAppearance as n,WidgetSettingsModal as i}from"./chunk-GDSGXDET.js";import{useWidgetSettings as s}from"./chunk-7DAQ3WVP.js";import{useShellPrefs as o}from"./chunk-V453E4KU.js";import"./chunk-UB4JIOLD.js";import"./chunk-PH3PRIFP.js";import"./chunk-2RHMSFZV.js";import"./chunk-LVFMK5OQ.js";import"./chunk-57MIENLJ.js";import"./chunk-MAIHBBWT.js";import"./chunk-TR6PLN7W.js";import"./chunk-D65T4H6J.js";import{useState as l,useEffect as c,useCallback as d}from"react";import{jsx as m,jsxs as p,Fragment as h}from"react/jsx-runtime";var f="weather_city",u="weather_appearance",y={useFahrenheit:!1,showLocalTime:!0,use24Hour:!1};function g(){const e="undefined"!=typeof localStorage?localStorage.getItem(f):null;if(e&&a[e])return e;try{const e=JSON.parse(localStorage.getItem("weather_cities")||"");if(Array.isArray(e)&&e[0]&&a[e[0]])return localStorage.setItem(f,e[0]),e[0]}catch{}return function(){try{const e=Intl.DateTimeFormat().resolvedOptions().timeZone;for(const[t,r]of Object.entries(a))if(r.tz===e)return t}catch{}return"London"}()}var x=r;function b(e,t=!1){try{if(t){const t=new Intl.DateTimeFormat("en-US",{timeZone:e,hour:"numeric",minute:"2-digit",hour12:!1}).formatToParts(/* @__PURE__ */new Date),a=parseInt(t.find(e=>"hour"===e.type)?.value||"0"),r=parseInt(t.find(e=>"minute"===e.type)?.value||"0");return`${String(a).padStart(2,"0")}:${String(r).padStart(2,"0")}`}const a=new Intl.DateTimeFormat("en-US",{timeZone:e,hour:"numeric",minute:"2-digit",hour12:!0}).formatToParts(/* @__PURE__ */new Date),r=parseInt(a.find(e=>"hour"===e.type)?.value||"12"),n=parseInt(a.find(e=>"minute"===e.type)?.value||"0"),i=a.find(e=>"dayPeriod"===e.type)?.value||"";return`${r}:${String(n).padStart(2,"0")} ${i}`}catch{return""}}function w(){/* @__PURE__ */
|
|
2
|
+
return p("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[
|
|
3
|
+
/* @__PURE__ */m("div",{className:"absolute -top-5 -right-5 w-24 h-24",style:{animation:"wx-sun-rays 70s linear infinite"},children:/* @__PURE__ */m("svg",{viewBox:"0 0 100 100",className:"w-full h-full",children:Array.from({length:12}).map((e,t)=>/* @__PURE__ */m("rect",{x:49,y:3,width:2,height:14,rx:1,fill:"rgba(255, 232, 130, 0.55)",transform:`rotate(${30*t} 50 50)`},t))})}),
|
|
4
|
+
/* @__PURE__ */m("div",{className:"absolute top-1 right-1 w-10 h-10 rounded-full",style:{background:"radial-gradient(circle at 35% 35%, #fff8cc 0%, #ffd84a 55%, #ff9e2a 100%)",boxShadow:"0 0 18px 5px rgba(255, 200, 80, 0.55)",animation:"wx-sun-pulse 4.5s ease-in-out infinite"}})]})}function v(){const e=Array.from({length:16}).map((e,t)=>({left:(53*t+11)%95+"%",top:(37*t+9)%78+"%",size:1+13*t%3,delay:.41*t%4+"s",duration:2.5+7*t%5*.6+"s"}));/* @__PURE__ */
|
|
5
|
+
return p("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[
|
|
6
|
+
/* @__PURE__ */m("div",{className:"absolute top-1 right-1",children:/* @__PURE__ */p("svg",{viewBox:"0 0 40 40",className:"w-9 h-9",style:{filter:"drop-shadow(0 0 6px rgba(255,250,220,0.4))"},children:[
|
|
7
|
+
/* @__PURE__ */m("defs",{children:/* @__PURE__ */p("radialGradient",{id:"wx-moon-grad",cx:"35%",cy:"35%",children:[
|
|
8
|
+
/* @__PURE__ */m("stop",{offset:"0",stopColor:"#fffae0"}),
|
|
9
|
+
/* @__PURE__ */m("stop",{offset:"1",stopColor:"#d4c98a"})]})}),
|
|
10
|
+
/* @__PURE__ */m("circle",{cx:20,cy:20,r:13,fill:"url(#wx-moon-grad)"}),
|
|
11
|
+
/* @__PURE__ */m("circle",{cx:26,cy:16,r:11,fill:"rgba(15,23,42,1)"})]})}),e.map((e,t)=>/* @__PURE__ */m("div",{className:"absolute rounded-full bg-white",style:{left:e.left,top:e.top,width:e.size,height:e.size,animation:`wx-twinkle ${e.duration} ease-in-out ${e.delay} infinite`}},t)),
|
|
12
|
+
/* @__PURE__ */m("div",{className:"absolute",style:{left:"15%",top:"20%",animation:"wx-shooting-star 12s ease-out infinite"},children:/* @__PURE__ */m("div",{className:"w-12 h-px",style:{background:"linear-gradient(to right, transparent, rgba(255,255,255,0.95))",boxShadow:"0 0 4px rgba(255,255,255,0.8)"}})})]})}function N({tone:e="light"}){const t="light"===e?"rgba(255,255,255,0.78)":"rgba(220,228,240,0.45)",a=({scale:e=1})=>/* @__PURE__ */p("svg",{viewBox:"0 0 120 50",className:"w-32 h-12",style:{transform:`scale(${e})`,filter:"blur(0.6px)"},children:[
|
|
13
|
+
/* @__PURE__ */m("ellipse",{cx:28,cy:36,rx:18,ry:11,fill:t}),
|
|
14
|
+
/* @__PURE__ */m("ellipse",{cx:50,cy:28,rx:22,ry:15,fill:t}),
|
|
15
|
+
/* @__PURE__ */m("ellipse",{cx:75,cy:32,rx:20,ry:12,fill:t}),
|
|
16
|
+
/* @__PURE__ */m("ellipse",{cx:95,cy:38,rx:15,ry:9,fill:t})]});/* @__PURE__ */
|
|
17
|
+
return p("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[
|
|
18
|
+
/* @__PURE__ */m("div",{className:"absolute",style:{top:"8%",animation:"wx-drift-cloud 42s linear infinite"},children:/* @__PURE__ */m(a,{scale:.9})}),
|
|
19
|
+
/* @__PURE__ */m("div",{className:"absolute",style:{top:"40%",animation:"wx-drift-cloud 60s linear -22s infinite",opacity:.85},children:/* @__PURE__ */m(a,{scale:1.25})}),
|
|
20
|
+
/* @__PURE__ */m("div",{className:"absolute",style:{top:"68%",animation:"wx-drift-cloud 78s linear -45s infinite",opacity:.7},children:/* @__PURE__ */m(a,{scale:.75})})]})}function k({heavy:e=!1}){const t=e?26:16,a=["wx-rain-a","wx-rain-b","wx-rain-c"],r=Array.from({length:t}).map((e,r)=>({left:(100*r/t+11*r%7)%100+"%",delay:.087*r%1.3+"s",height:12+r%4*5+"px",duration:.7+r%3*.18+"s",variant:a[r%a.length]}));/* @__PURE__ */
|
|
21
|
+
return m("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:r.map((e,t)=>/* @__PURE__ */m("div",{className:"absolute",style:{left:e.left,top:"-20px",width:"1px",height:e.height,background:"linear-gradient(180deg, rgba(180,210,255,0) 0%, rgba(220,235,255,0.85) 90%, rgba(255,255,255,0.95) 100%)",transform:"rotate(8deg)",animation:`${e.variant} ${e.duration} linear ${e.delay} infinite`,transformOrigin:"top"}},t))})}function S(){const e=["wx-snow-a","wx-snow-b","wx-snow-c"],t=Array.from({length:16}).map((t,a)=>({left:(100*a/16+13*a%5)%100+"%",delay:.43*a%5+"s",duration:4.5+a%5+"s",size:3+a%4*1.4,opacity:.65+7*a%4*.08,variant:e[a%e.length]}));/* @__PURE__ */
|
|
22
|
+
return m("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:t.map((e,t)=>/* @__PURE__ */m("div",{className:"absolute rounded-full bg-white",style:{left:e.left,top:"-12px",width:e.size,height:e.size,opacity:e.opacity,boxShadow:"0 0 4px rgba(255,255,255,0.65)",animation:`${e.variant} ${e.duration} linear ${e.delay} infinite`}},t))})}function $(){/* @__PURE__ */
|
|
23
|
+
return p("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[
|
|
24
|
+
/* @__PURE__ */m(k,{heavy:!0}),
|
|
25
|
+
/* @__PURE__ */m("div",{className:"absolute inset-0 bg-white",style:{animation:"wx-flash 6s ease-out infinite"}}),
|
|
26
|
+
/* @__PURE__ */m("div",{className:"absolute inset-y-0 right-1/3 flex items-center justify-center pointer-events-none",style:{animation:"wx-bolt 6s ease-out infinite"},children:/* @__PURE__ */m("svg",{viewBox:"0 0 18 60",className:"h-4/5",style:{filter:"drop-shadow(0 0 6px rgba(255, 240, 150, 0.95)) drop-shadow(0 0 14px rgba(255, 220, 90, 0.7))"},children:/* @__PURE__ */m("path",{d:"M11 0 L2 28 L8 30 L4 60 L16 24 L9 22 Z",fill:"rgba(255, 250, 200, 0.98)",stroke:"rgba(255, 255, 255, 0.9)",strokeWidth:.3})})})]})}function j(){/* @__PURE__ */
|
|
27
|
+
return m("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:Array.from({length:4}).map((e,t)=>/* @__PURE__ */m("div",{className:"absolute left-0 right-0",style:{top:10+22*t+"%",height:"14px",background:"linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.55) 50%, rgba(255,255,255,0) 100%)",filter:"blur(2px)",animation:`wx-fog-drift ${10+3*t}s ease-in-out ${.7*t}s infinite alternate`}},t))})}function I({code:e,isDay:t}){return 0===e||1===e?/* @__PURE__ */m(t?w:v,{}):2===e?/* @__PURE__ */p(h,{children:[/* @__PURE__ */m(t?w:v,{}),
|
|
28
|
+
/* @__PURE__ */m(N,{tone:t?"light":"dark"})]}):3===e?/* @__PURE__ */m(N,{tone:t?"light":"dark"}):45===e||48===e?/* @__PURE__ */m(j,{}):[51,53,61,80,81].includes(e)?/* @__PURE__ */m(k,{}):[55,63,65,82].includes(e)?/* @__PURE__ */m(k,{heavy:!0}):[71,73,75].includes(e)?/* @__PURE__ */m(S,{}):[95,96,99].includes(e)?/* @__PURE__ */m($,{}):null}function D(){const[r,w]=l(g),[v,N]=l(()=>n(u)),[k,S]=l(null),[$,j]=l(!0),[,D]=l(0);c(()=>{const e=setInterval(()=>D(e=>e+1),6e4);return()=>clearInterval(e)},[]);const[L,F]=l(!1),[T,A]=l(r),[C,H]=l(v),{prefs:z,save:B}=o(),O={...y,...z.weather_prefs??{}},[P,M]=l(O);s(d(()=>{A(r),H({...v}),M({...O}),F(!0)},[r,v,O])),c(()=>{let t=!1;return j(!0),e(r).then(e=>{t||(S(e),j(!1))}),()=>{t=!0}},[r]);const Z=e=>O.useFahrenheit?`${x(e)}°F`:`${e}°`;if($&&!k)/* @__PURE__ */
|
|
29
|
+
return m("div",{className:"flex items-center justify-center h-full bg-gradient-to-b from-sky-400 to-blue-500 rounded-lg text-white/80 text-xs",style:{minHeight:110},children:"Loading…"});if(!k)/* @__PURE__ */
|
|
30
|
+
return m("div",{className:"flex items-center justify-center h-full bg-slate-700 rounded-lg text-white/80 text-xs",style:{minHeight:110},children:"Couldn't load weather"});const[J,V,W]=t(k.code,k.isDay);/* @__PURE__ */
|
|
31
|
+
return p(h,{children:[
|
|
32
|
+
/* @__PURE__ */m("style",{children:"\n@keyframes wx-rain-a { 0% { transform: translate(0,-20px); opacity: 0; } 10% { opacity: 0.95; } 100% { transform: translate(8px,140px); opacity: 0; } }\n@keyframes wx-rain-b { 0% { transform: translate(0,-20px); opacity: 0; } 12% { opacity: 0.85; } 100% { transform: translate(12px,140px); opacity: 0; } }\n@keyframes wx-rain-c { 0% { transform: translate(0,-20px); opacity: 0; } 10% { opacity: 1; } 100% { transform: translate(5px,140px); opacity: 0; } }\n@keyframes wx-snow-a { 0% { transform: translate(0,-12px) rotate(0deg); opacity: 0; } 10% { opacity: 0.9; } 50% { transform: translate(10px,55px) rotate(180deg); } 100% { transform: translate(-4px,140px) rotate(360deg); opacity: 0; } }\n@keyframes wx-snow-b { 0% { transform: translate(0,-12px) rotate(0deg); opacity: 0; } 10% { opacity: 0.85; } 50% { transform: translate(-12px,55px) rotate(-180deg); } 100% { transform: translate(6px,140px) rotate(-360deg); opacity: 0; } }\n@keyframes wx-snow-c { 0% { transform: translate(0,-12px); opacity: 0; } 10% { opacity: 0.7; } 100% { transform: translate(2px,140px); opacity: 0; } }\n@keyframes wx-drift-cloud { 0% { transform: translateX(-40%); } 100% { transform: translateX(140%); } }\n@keyframes wx-twinkle { 0%, 100% { opacity: 0.25; transform: scale(1); } 50% { opacity: 1; transform: scale(1.6); } }\n@keyframes wx-flash { 0%, 86%, 100% { opacity: 0; } 87% { opacity: 0.95; } 88% { opacity: 0.15; } 89% { opacity: 0.85; } 90% { opacity: 0; } }\n@keyframes wx-bolt { 0%, 86%, 90%, 100% { opacity: 0; } 87% { opacity: 1; } 89% { opacity: 0.85; } }\n@keyframes wx-sun-pulse { 0%, 100% { transform: scale(1); opacity: 0.65; } 50% { transform: scale(1.12); opacity: 0.95; } }\n@keyframes wx-sun-rays { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }\n@keyframes wx-fog-drift { 0% { transform: translateX(-25%); opacity: 0.3; } 50% { opacity: 0.65; } 100% { transform: translateX(25%); opacity: 0.3; } }\n@keyframes wx-shooting-star { 0%, 95% { opacity: 0; transform: translate(0,0) scale(0); } 96% { opacity: 1; transform: translate(0,0) scale(1); } 100% { opacity: 0; transform: translate(40px,30px) scale(1); } }\n"}),
|
|
33
|
+
/* @__PURE__ */m("div",{className:"rounded-lg overflow-hidden",style:{backgroundColor:`rgba(15, 23, 42, ${v.activeOpacity/100})`,backdropFilter:v.activeBlur>0?`blur(${v.activeBlur}px)`:void 0},children:/* @__PURE__ */p("div",{className:`relative rounded-lg overflow-hidden text-white bg-gradient-to-br ${W}`,style:{height:110},children:[
|
|
34
|
+
/* @__PURE__ */m(I,{code:k.code,isDay:k.isDay}),
|
|
35
|
+
/* @__PURE__ */p("div",{className:"relative z-10 px-3 py-2.5 flex flex-col h-full justify-between",children:[
|
|
36
|
+
/* @__PURE__ */p("div",{className:"flex items-start justify-between gap-2",children:[
|
|
37
|
+
/* @__PURE__ */p("div",{className:"min-w-0 flex-1",children:[
|
|
38
|
+
/* @__PURE__ */m("div",{className:"text-base font-semibold leading-tight truncate drop-shadow-sm",children:k.city}),O.showLocalTime&&/* @__PURE__ */m("div",{className:"text-[10px] opacity-90 leading-tight tabular-nums drop-shadow-sm",children:b(k.timezone,O.use24Hour)})]}),
|
|
39
|
+
/* @__PURE__ */m("div",{className:"text-3xl font-extralight leading-none tracking-tight tabular-nums shrink-0 drop-shadow-sm",children:Z(k.temp)})]}),
|
|
40
|
+
/* @__PURE__ */p("div",{className:"flex items-end justify-between gap-2",children:[
|
|
41
|
+
/* @__PURE__ */p("div",{className:"flex items-center gap-1.5 min-w-0",children:[
|
|
42
|
+
/* @__PURE__ */m("span",{className:"text-lg leading-none drop-shadow-sm",children:V}),
|
|
43
|
+
/* @__PURE__ */m("span",{className:"text-[11px] font-medium drop-shadow-sm truncate",children:J})]}),
|
|
44
|
+
/* @__PURE__ */p("span",{className:"text-[10px] opacity-90 tabular-nums drop-shadow-sm shrink-0",children:["H:",Z(k.high)," L:",Z(k.low)]})]})]})]})}),
|
|
45
|
+
/* @__PURE__ */p(i,{open:L,onClose:()=>F(!1),title:"Weather Settings",appearance:C,onAppearanceChange:H,onSave:()=>{w(T),N(C),B({weather_prefs:P}),localStorage.setItem(f,T),localStorage.setItem(u,JSON.stringify(C)),F(!1)},children:[
|
|
46
|
+
/* @__PURE__ */m("div",{className:"space-y-3",children:/* @__PURE__ */p("div",{children:[
|
|
47
|
+
/* @__PURE__ */m("h3",{className:"text-sm font-semibold text-gray-700 mb-2",children:"Display"}),
|
|
48
|
+
/* @__PURE__ */p("div",{className:"flex items-center gap-3 mb-2",children:[
|
|
49
|
+
/* @__PURE__ */m("span",{className:"text-sm text-gray-600 w-24",children:"Temperature"}),
|
|
50
|
+
/* @__PURE__ */m("div",{className:"flex gap-1",children:[{key:!1,label:"°C"},{key:!0,label:"°F"}].map(e=>/* @__PURE__ */m("button",{onClick:()=>M(t=>({...t,useFahrenheit:e.key})),className:"px-3 py-1 text-xs font-medium rounded-lg border transition-colors "+(P.useFahrenheit===e.key?"bg-blue-600 text-white border-blue-600":"bg-white text-gray-700 border-gray-300 hover:bg-gray-50"),children:e.label},String(e.key)))})]}),
|
|
51
|
+
/* @__PURE__ */p("div",{className:"flex items-center gap-3 mb-2",children:[
|
|
52
|
+
/* @__PURE__ */m("span",{className:"text-sm text-gray-600 w-24",children:"Time Format"}),
|
|
53
|
+
/* @__PURE__ */m("div",{className:"flex gap-1",children:[{key:!1,label:"AM/PM"},{key:!0,label:"24H"}].map(e=>/* @__PURE__ */m("button",{onClick:()=>M(t=>({...t,use24Hour:e.key})),className:"px-3 py-1 text-xs font-medium rounded-lg border transition-colors "+(P.use24Hour===e.key?"bg-blue-600 text-white border-blue-600":"bg-white text-gray-700 border-gray-300 hover:bg-gray-50"),children:e.label},String(e.key)))})]}),
|
|
54
|
+
/* @__PURE__ */p("label",{className:"flex items-center gap-2 cursor-pointer",children:[
|
|
55
|
+
/* @__PURE__ */m("input",{type:"checkbox",checked:P.showLocalTime,onChange:e=>M(t=>({...t,showLocalTime:e.target.checked})),className:"rounded border-gray-300 text-blue-600 h-3.5 w-3.5"}),
|
|
56
|
+
/* @__PURE__ */m("span",{className:"text-sm text-gray-600",children:"Show local time"})]})]})}),
|
|
57
|
+
/* @__PURE__ */p("div",{children:[
|
|
58
|
+
/* @__PURE__ */m("h3",{className:"text-sm font-semibold text-gray-700 mb-2",children:"City"}),
|
|
59
|
+
/* @__PURE__ */m("select",{value:T,onChange:e=>A(e.target.value),className:"w-full bg-gray-50 border border-gray-200 rounded px-2 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:Object.keys(a).map(e=>/* @__PURE__ */m("option",{value:e,children:e},e))}),
|
|
60
|
+
/* @__PURE__ */m("p",{className:"mt-1 text-[10px] text-gray-400",children:"Auto-detected from your timezone; change if needed."})]})]})]})}export{D as default};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import{AVAILABLE_CITIES as e,fetchCityWeather as t,getCondition as a,toFahrenheit as r}from"./chunk-FBDZGO3V.js";import{loadAppearance as n,WidgetSettingsModal as i}from"./chunk-GDSGXDET.js";import{useWidgetSettings as s}from"./chunk-7DAQ3WVP.js";import{useShellPrefs as c}from"./chunk-V453E4KU.js";import"./chunk-UB4JIOLD.js";import"./chunk-PH3PRIFP.js";import"./chunk-2RHMSFZV.js";import"./chunk-LVFMK5OQ.js";import"./chunk-57MIENLJ.js";import"./chunk-MAIHBBWT.js";import"./chunk-TR6PLN7W.js";import"./chunk-D65T4H6J.js";import{useState as l,useEffect as o,useCallback as m}from"react";import{jsxs as h,Fragment as d,jsx as p}from"react/jsx-runtime";var u="world_clock_appearance",g=["London","Shanghai","New York"];function x(){const{prefs:x,save:y}=c(),[b,f]=l(()=>n(u)),[k,v]=l(!1),[N,w]=l([]),[j,F]=l(b),D={useFahrenheit:!!x.weather_prefs?.useFahrenheit},[C,S]=l(D),[I,L]=l(()=>/* @__PURE__ */new Date);o(()=>{const e=setInterval(()=>L(/* @__PURE__ */new Date),3e4);return()=>clearInterval(e)},[]);const O=Object.fromEntries(Object.entries(e).map(([e,t])=>[t.tz,e])),P=x.world_clocks,T=(()=>{if(!Array.isArray(P)||0===P.length)return g;const t=[];for(const a of P){const r=e[a]?a:O[a];r&&!t.includes(r)&&t.push(r)}return t.length?t:g})(),[_,B]=l({}),[$,A]=l(!0);o(()=>{let e=!1;return A(!0),(async()=>{const a={};await Promise.all(T.map(async e=>{const r=await t(e);r&&(a[e]=r)})),e||(B(a),A(!1))})(),()=>{e=!0}},[T.join(",")]),s(m(()=>{w([...T]),F({...b}),S({...D}),v(!0)},[T.join(","),b,D.useFahrenheit]));const H=e=>D.useFahrenheit?`${r(e)}°`:`${e}°`;/* @__PURE__ */
|
|
2
|
+
return h(d,{children:[
|
|
3
|
+
/* @__PURE__ */p("div",{style:{backgroundColor:`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${b.activeOpacity/100})`,backdropFilter:b.activeBlur>0?`blur(${b.activeBlur}px)`:void 0},children:/* @__PURE__ */h("div",{className:"divide-y divide-gray-200",children:[$&&T.every(e=>!_[e])&&/* @__PURE__ */p("div",{className:"px-3 py-6 text-center text-xs text-gray-500",children:"Loading…"}),T.map(t=>{const r=_[t],n=e[t]?.tz??"UTC",{time:i,ampm:s}=function(e,t){try{const a=new Intl.DateTimeFormat("en-US",{timeZone:e,hour:"numeric",minute:"2-digit",hour12:!0}).formatToParts(t),r=a.find(e=>"hour"===e.type)?.value||"12";return{time:`${r}:${a.find(e=>"minute"===e.type)?.value||"00"}`,ampm:(a.find(e=>"dayPeriod"===e.type)?.value||"").toUpperCase()}}catch{return{time:"",ampm:""}}}(n,I);if(!r)/* @__PURE__ */
|
|
4
|
+
return h("div",{className:"px-4 py-3",children:[
|
|
5
|
+
/* @__PURE__ */h("div",{className:"flex items-baseline justify-between gap-2",children:[
|
|
6
|
+
/* @__PURE__ */p("span",{className:"text-[15px] font-semibold tracking-tight text-gray-900 truncate",children:t}),
|
|
7
|
+
/* @__PURE__ */h("span",{className:"tabular-nums text-[13px] font-medium text-gray-500",children:[i,
|
|
8
|
+
/* @__PURE__ */p("span",{className:"text-[9px] ml-0.5 opacity-70",children:s})]})]}),
|
|
9
|
+
/* @__PURE__ */p("div",{className:"text-[11px] text-gray-400 mt-1",children:"Loading weather…"})]},t);const[c,l]=a(r.code,r.isDay);/* @__PURE__ */
|
|
10
|
+
return h("div",{className:"px-4 py-3",children:[
|
|
11
|
+
/* @__PURE__ */h("div",{className:"flex items-baseline justify-between gap-2",children:[
|
|
12
|
+
/* @__PURE__ */p("span",{className:"text-[15px] font-semibold tracking-tight text-gray-900 truncate",children:t}),
|
|
13
|
+
/* @__PURE__ */p("span",{className:"text-[26px] font-extralight leading-none tabular-nums tracking-tight text-gray-900 shrink-0",children:H(r.temp)})]}),
|
|
14
|
+
/* @__PURE__ */h("div",{className:"flex items-center justify-between gap-2 mt-1.5 text-[11px]",children:[
|
|
15
|
+
/* @__PURE__ */h("div",{className:"flex items-center gap-1.5 min-w-0 text-gray-500",children:[
|
|
16
|
+
/* @__PURE__ */p("span",{className:"text-base leading-none shrink-0",children:l}),
|
|
17
|
+
/* @__PURE__ */h("span",{className:"tabular-nums font-semibold text-gray-700 shrink-0",children:[i,
|
|
18
|
+
/* @__PURE__ */p("span",{className:"text-[9px] font-medium ml-0.5 opacity-70",children:s})]}),
|
|
19
|
+
/* @__PURE__ */p("span",{className:"text-gray-300 shrink-0",children:"·"}),
|
|
20
|
+
/* @__PURE__ */p("span",{className:"truncate",children:c})]}),
|
|
21
|
+
/* @__PURE__ */h("span",{className:"tabular-nums text-gray-500 shrink-0",children:["H:",H(r.high)," L:",H(r.low)]})]})]},t)})]})}),
|
|
22
|
+
/* @__PURE__ */h(i,{open:k,onClose:()=>v(!1),title:"World Clock Settings",appearance:j,onAppearanceChange:F,onSave:()=>{0!==N.length&&(y({world_clocks:N,weather_prefs:{...x.weather_prefs??{},useFahrenheit:C.useFahrenheit}}),f(j),localStorage.setItem(u,JSON.stringify(j)),v(!1))},children:[
|
|
23
|
+
/* @__PURE__ */h("div",{children:[
|
|
24
|
+
/* @__PURE__ */p("h3",{className:"text-sm font-semibold text-gray-700 mb-2",children:"Display"}),
|
|
25
|
+
/* @__PURE__ */h("div",{className:"flex items-center gap-3 mb-2",children:[
|
|
26
|
+
/* @__PURE__ */p("span",{className:"text-sm text-gray-600 w-24",children:"Temperature"}),
|
|
27
|
+
/* @__PURE__ */p("div",{className:"flex gap-1",children:[{key:!1,label:"°C"},{key:!0,label:"°F"}].map(e=>/* @__PURE__ */p("button",{onClick:()=>S(t=>({...t,useFahrenheit:e.key})),className:"px-3 py-1 text-xs font-medium rounded-lg border transition-colors "+(C.useFahrenheit===e.key?"bg-blue-600 text-white border-blue-600":"bg-white text-gray-700 border-gray-300 hover:bg-gray-50"),children:e.label},String(e.key)))})]}),
|
|
28
|
+
/* @__PURE__ */p("p",{className:"text-[10px] text-gray-400 mt-1",children:"Shared with the Weather widget."})]}),
|
|
29
|
+
/* @__PURE__ */h("div",{children:[
|
|
30
|
+
/* @__PURE__ */p("h3",{className:"text-sm font-semibold text-gray-700 mb-2",children:"Cities"}),
|
|
31
|
+
/* @__PURE__ */p("div",{className:"grid grid-cols-2 gap-1 max-h-56 overflow-y-auto",children:Object.keys(e).map(e=>/* @__PURE__ */h("label",{className:"flex items-center gap-2 text-sm py-1 cursor-pointer hover:bg-gray-50 rounded px-2",children:[
|
|
32
|
+
/* @__PURE__ */p("input",{type:"checkbox",checked:N.includes(e),onChange:()=>w(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]),className:"rounded border-gray-300 text-blue-600 focus:ring-blue-500 h-3.5 w-3.5"}),e]},e))})]})]})]})}export{x as default};
|
package/dist/apps/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { P as PdfViewer$1 } from '../PdfViewer-CvLb2j_l.js';
|
|
3
|
+
export { a as PdfViewerProps } from '../PdfViewer-CvLb2j_l.js';
|
|
2
4
|
import * as react from 'react';
|
|
3
5
|
import { W as WindowRegistry } from '../types-BOinJXUf.js';
|
|
4
6
|
|
|
@@ -8,28 +10,6 @@ declare function Files$1(): react_jsx_runtime.JSX.Element;
|
|
|
8
10
|
|
|
9
11
|
declare function Documents$1(): react_jsx_runtime.JSX.Element;
|
|
10
12
|
|
|
11
|
-
interface PdfViewerProps {
|
|
12
|
-
/** Object URL or remote URL of the PDF. */
|
|
13
|
-
url: string;
|
|
14
|
-
/** Display name — also the filename the built-in Download uses. */
|
|
15
|
-
filename: string;
|
|
16
|
-
/**
|
|
17
|
-
* What the auto-fit scale tracks until the reader picks a manual zoom.
|
|
18
|
-
*
|
|
19
|
-
* `'width'` fills the container's width and lets a tall page scroll — right
|
|
20
|
-
* for a viewer that owns a whole window, and what the Preview app uses.
|
|
21
|
-
* `'page'` fits the WHOLE page, which is what an embedded preview pane
|
|
22
|
-
* wants: someone checking a document before sending it needs to see that it
|
|
23
|
-
* is the right document, and a page cropped at the fold reads as broken.
|
|
24
|
-
*/
|
|
25
|
-
fit?: 'width' | 'page';
|
|
26
|
-
/** Replaces the built-in "save `url` as `filename`" download. */
|
|
27
|
-
onDownload?: () => void;
|
|
28
|
-
/** An Email button joins the toolbar only when this is supplied. */
|
|
29
|
-
onEmail?: () => void;
|
|
30
|
-
}
|
|
31
|
-
declare function PdfViewer$1({ url, filename, fit, onDownload, onEmail }: PdfViewerProps): react_jsx_runtime.JSX.Element;
|
|
32
|
-
|
|
33
13
|
declare function Preview$1(): react_jsx_runtime.JSX.Element;
|
|
34
14
|
|
|
35
15
|
declare function Stock$1(): react_jsx_runtime.JSX.Element;
|
|
@@ -264,4 +244,4 @@ declare const documentApps: WindowRegistry;
|
|
|
264
244
|
declare const webApps: WindowRegistry;
|
|
265
245
|
declare const bundledApps: WindowRegistry;
|
|
266
246
|
|
|
267
|
-
export { BUILTIN_APP_INFO, Browser, type BuiltinAppId, type BuiltinAppInfo, Calculator, CurrencyConverter, Documents, Files, type FilesDemoNode, Notepad, type OpenAttachmentOptions, type OpenPage, type OpenableAttachment, type PdfPreviewData, type PdfPreviewHandle, PdfViewer,
|
|
247
|
+
export { BUILTIN_APP_INFO, Browser, type BuiltinAppId, type BuiltinAppInfo, Calculator, CurrencyConverter, Documents, Files, type FilesDemoNode, Notepad, type OpenAttachmentOptions, type OpenPage, type OpenableAttachment, type PdfPreviewData, type PdfPreviewHandle, PdfViewer, PomodoroTimer, Preview, Spreadsheet, type SpreadsheetPreviewData, type SpreadsheetPreviewHandle, Stock, Weather, WorldClock, attachmentKind, bundledApps, documentApps, openAttachment, openFilesInTrashMode, setBrowserStartUrl, setFilesDemoTree, setPdfPreview, setSpreadsheetPreview, utilityApps, webApps };
|
package/dist/apps/index.js
CHANGED
|
@@ -1,152 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export
|
|
3
|
-
export { setBrowserStartUrl } from '../chunk-TW7LPMVR.js';
|
|
4
|
-
export { BUILTIN_APP_INFO } from '../chunk-COWYSHG2.js';
|
|
5
|
-
import '../chunk-YNKK7NE3.js';
|
|
6
|
-
import { setPdfPreview } from '../chunk-DVZWYWSD.js';
|
|
7
|
-
export { setPdfPreview } from '../chunk-DVZWYWSD.js';
|
|
8
|
-
import { setSpreadsheetPreview } from '../chunk-5O42JXQE.js';
|
|
9
|
-
export { setSpreadsheetPreview } from '../chunk-5O42JXQE.js';
|
|
10
|
-
import '../chunk-ICTRCKUE.js';
|
|
11
|
-
import '../chunk-GA35NEND.js';
|
|
12
|
-
import '../chunk-ZS7PMGUW.js';
|
|
13
|
-
import { toast_default } from '../chunk-UTYKLGGT.js';
|
|
14
|
-
import '../chunk-HUBJAUGG.js';
|
|
15
|
-
import '../chunk-RT6DSB5Y.js';
|
|
16
|
-
import '../chunk-JOPU6WPY.js';
|
|
17
|
-
import '../chunk-I2TAAJHS.js';
|
|
18
|
-
import '../chunk-6XJEJWNJ.js';
|
|
19
|
-
import '../chunk-YE6GUDGP.js';
|
|
20
|
-
import '../chunk-IPXN646P.js';
|
|
21
|
-
import '../chunk-IRWSRJ4K.js';
|
|
22
|
-
import { lazy } from 'react';
|
|
23
|
-
|
|
24
|
-
// src/apps/openAttachment.ts
|
|
25
|
-
function extOf(name) {
|
|
26
|
-
const m = /\.([a-z0-9]+)(?:[?#].*)?$/i.exec((name || "").trim());
|
|
27
|
-
return m ? m[1].toLowerCase() : "";
|
|
28
|
-
}
|
|
29
|
-
var DELIMITED_TEXT_EXT = /* @__PURE__ */ new Set(["csv", "tsv"]);
|
|
30
|
-
var BINARY_WORKBOOK_EXT = /* @__PURE__ */ new Set(["xlsx", "xls", "xlsm", "ods"]);
|
|
31
|
-
var IMAGE_EXT = /* @__PURE__ */ new Set(["png", "jpg", "jpeg", "gif", "webp", "bmp", "svg", "avif"]);
|
|
32
|
-
var THREED_EXT = /* @__PURE__ */ new Set(["step", "stp", "stl", "obj", "gltf", "glb", "3mf", "iges", "igs"]);
|
|
33
|
-
function attachmentKind(nameOrUrl) {
|
|
34
|
-
const ext = extOf(nameOrUrl);
|
|
35
|
-
if (ext === "pdf") return "pdf";
|
|
36
|
-
if (ext === "dxf") return "dxf";
|
|
37
|
-
if (DELIMITED_TEXT_EXT.has(ext)) return "csv";
|
|
38
|
-
if (IMAGE_EXT.has(ext)) return "image";
|
|
39
|
-
if (THREED_EXT.has(ext)) return "3d";
|
|
40
|
-
return null;
|
|
41
|
-
}
|
|
42
|
-
function openInNewTab(url) {
|
|
43
|
-
window.open(url, "_blank", "noopener,noreferrer");
|
|
44
|
-
}
|
|
45
|
-
async function readText(url, opts, att) {
|
|
46
|
-
if (opts.fetchBlob) return (await opts.fetchBlob(att)).text();
|
|
47
|
-
const res = await fetch(url);
|
|
48
|
-
if (!res.ok) throw new Error(`fetch failed: ${res.status}`);
|
|
49
|
-
return res.text();
|
|
50
|
-
}
|
|
51
|
-
function errorText(err, fallback) {
|
|
52
|
-
const message = err instanceof Error ? err.message : "";
|
|
53
|
-
return message || fallback;
|
|
54
|
-
}
|
|
55
|
-
async function openAttachment(att, openPage, opts = {}) {
|
|
56
|
-
const url = att?.url || "";
|
|
57
|
-
const filename = att?.filename || "attachment";
|
|
58
|
-
if (!url && !opts.fetchBlob) {
|
|
59
|
-
toast_default.error("This attachment has no download link.");
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
const kind = attachmentKind(filename) ?? attachmentKind(url);
|
|
63
|
-
if (kind === "csv") {
|
|
64
|
-
try {
|
|
65
|
-
setSpreadsheetPreview({ csv: await readText(url, opts, att), filename });
|
|
66
|
-
openPage("/spreadsheet");
|
|
67
|
-
} catch {
|
|
68
|
-
toast_default.error("Could not open the spreadsheet \u2014 opening the file instead.");
|
|
69
|
-
if (url) openInNewTab(url);
|
|
70
|
-
}
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
if (BINARY_WORKBOOK_EXT.has(extOf(filename) || extOf(url))) {
|
|
74
|
-
toast_default.error("Spreadsheet preview is unavailable for this file type. Opening the file instead.");
|
|
75
|
-
if (url) openInNewTab(url);
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
if (!kind) {
|
|
79
|
-
if (!url) {
|
|
80
|
-
toast_default.error("This attachment has no download link.");
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
toast_default.info("Opening this file outside the app \u2014 no viewer can show it here.");
|
|
84
|
-
openInNewTab(url);
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
if (!opts.fetchBlob) {
|
|
88
|
-
setPdfPreview({ url, filename, kind });
|
|
89
|
-
openPage("/preview");
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
const handle = setPdfPreview({
|
|
93
|
-
filename,
|
|
94
|
-
kind,
|
|
95
|
-
converting: true,
|
|
96
|
-
convertingMessage: opts.loadingMessage || "LOADING FILE"
|
|
97
|
-
});
|
|
98
|
-
openPage("/preview");
|
|
99
|
-
try {
|
|
100
|
-
const blob = await opts.fetchBlob(att);
|
|
101
|
-
handle.update({ url: URL.createObjectURL(blob), filename, kind });
|
|
102
|
-
} catch (err) {
|
|
103
|
-
handle.update({
|
|
104
|
-
filename,
|
|
105
|
-
kind,
|
|
106
|
-
converting: false,
|
|
107
|
-
convertingMessage: errorText(err, "Failed to load this file.")
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
// src/apps/index.ts
|
|
113
|
-
var Calculator = lazy(() => import('../Calculator-6FGNKOXU.js'));
|
|
114
|
-
var Spreadsheet = lazy(() => import('../Spreadsheet-HOCPHJOC.js'));
|
|
115
|
-
var Weather = lazy(() => import('../Weather-LZQGVDJL.js'));
|
|
116
|
-
var CurrencyConverter = lazy(() => import('../CurrencyConverter-FF7EXRYL.js'));
|
|
117
|
-
var PomodoroTimer = lazy(() => import('../PomodoroTimer-IR3WREED.js'));
|
|
118
|
-
var Notepad = lazy(() => import('../Notepad-VE7ISWRQ.js'));
|
|
119
|
-
var WorldClock = lazy(() => import('../WorldClock-XPD7WOZT.js'));
|
|
120
|
-
var Stock = lazy(() => import('../Stock-LVRQPURG.js'));
|
|
121
|
-
var Preview = lazy(() => import('../Preview-DAQGRNRM.js'));
|
|
122
|
-
var PdfViewer = lazy(() => import('../PdfViewer-SQBFYAGW.js'));
|
|
123
|
-
var Documents = lazy(() => import('../Documents-H3R7XSBH.js'));
|
|
124
|
-
var Files = lazy(() => import('../Files-ZHJIAUC2.js'));
|
|
125
|
-
var Browser = lazy(() => import('../Browser-ZNX4WFUH.js'));
|
|
126
|
-
var utilityApps = {
|
|
127
|
-
"/calculator": { component: Calculator, label: "Calculator", size: "sm", allowPinOnTop: true, utility: true, widget: true, dimensions: [280, 420] },
|
|
128
|
-
"/spreadsheet": { component: Spreadsheet, label: "Spreadsheets", size: "2xl", appStyle: true, multiInstance: true },
|
|
129
|
-
"/notepad": { component: Notepad, label: "Notepad", size: "lg", allowPinOnTop: true, flushBody: true },
|
|
130
|
-
"/weather": { component: Weather, label: "Weather", size: "sm", utility: true, widget: true, autoHeight: true, dimensions: [320, 400] },
|
|
131
|
-
"/currency": { component: CurrencyConverter, label: "Currency Converter", size: "sm", utility: true, widget: true, autoHeight: true, dimensions: [320, 480] },
|
|
132
|
-
"/pomodoro": { component: PomodoroTimer, label: "Pomodoro Timer", size: "sm", utility: true, widget: true, dimensions: [320, 600] },
|
|
133
|
-
"/world-clock": { component: WorldClock, label: "World Clock", size: "sm", utility: true, widget: true, autoHeight: true, dimensions: [320, 480] },
|
|
134
|
-
"/stock": { component: Stock, label: "Stocks", size: "sm", utility: true, widget: true, autoHeight: true, dimensions: [320, 360] }
|
|
135
|
-
};
|
|
136
|
-
var documentApps = {
|
|
137
|
-
"/preview": { component: Preview, label: "Preview", size: "2xl", appStyle: true, multiInstance: true },
|
|
138
|
-
"/documents": { component: Documents, label: "Documents", size: "xl", appStyle: true, multiInstance: true },
|
|
139
|
-
"/files": { component: Files, label: "Files", size: "xl", appStyle: true }
|
|
140
|
-
};
|
|
141
|
-
var webApps = {
|
|
142
|
-
"/browser": { component: Browser, label: "Browser", size: "2xl", appStyle: true, multiInstance: true }
|
|
143
|
-
};
|
|
144
|
-
var bundledApps = {
|
|
145
|
-
...utilityApps,
|
|
146
|
-
...documentApps,
|
|
147
|
-
...webApps
|
|
148
|
-
};
|
|
149
|
-
|
|
150
|
-
export { Browser, Calculator, CurrencyConverter, Documents, Files, Notepad, PdfViewer, PomodoroTimer, Preview, Spreadsheet, Stock, Weather, WorldClock, attachmentKind, bundledApps, documentApps, openAttachment, utilityApps, webApps };
|
|
151
|
-
//# sourceMappingURL=index.js.map
|
|
152
|
-
//# sourceMappingURL=index.js.map
|
|
2
|
+
export{setBrowserStartUrl}from"../chunk-LWLCNQY7.js";export{openFilesInTrashMode,setFilesDemoTree}from"../chunk-FHTLC7HH.js";export{BUILTIN_APP_INFO}from"../chunk-RJ4LACFH.js";import"../chunk-NPJH5MD7.js";import{setPdfPreview as e}from"../chunk-ESL5TDNA.js";export{setPdfPreview}from"../chunk-ESL5TDNA.js";import{toast_default as t}from"../chunk-KKOHUQPF.js";import{setSpreadsheetPreview as o}from"../chunk-VTVSMRFX.js";export{setSpreadsheetPreview}from"../chunk-VTVSMRFX.js";import"../chunk-TWV42Q3K.js";import"../chunk-7DAQ3WVP.js";import"../chunk-V453E4KU.js";import"../chunk-UB4JIOLD.js";import"../chunk-PH3PRIFP.js";import"../chunk-2RHMSFZV.js";import"../chunk-LVFMK5OQ.js";import"../chunk-57MIENLJ.js";import"../chunk-MAIHBBWT.js";import"../chunk-TR6PLN7W.js";import"../chunk-D65T4H6J.js";import{lazy as i}from"react";function n(e){const t=/\.([a-z0-9]+)(?:[?#].*)?$/i.exec((e||"").trim());return t?t[1].toLowerCase():""}var r=/* @__PURE__ */new Set(["csv","tsv"]),s=/* @__PURE__ */new Set(["xlsx","xls","xlsm","ods"]),a=/* @__PURE__ */new Set(["png","jpg","jpeg","gif","webp","bmp","svg","avif"]),l=/* @__PURE__ */new Set(["step","stp","stl","obj","gltf","glb","3mf","iges","igs"]);function c(e){const t=n(e);return"pdf"===t?"pdf":"dxf"===t?"dxf":r.has(t)?"csv":a.has(t)?"image":l.has(t)?"3d":null}function p(e){window.open(e,"_blank","noopener,noreferrer")}async function m(e,t,o){if(t.fetchBlob)return(await t.fetchBlob(o)).text();const i=await fetch(e);if(!i.ok)throw new Error(`fetch failed: ${i.status}`);return i.text()}function u(e,t){return(e instanceof Error?e.message:"")||t}async function h(i,r,a={}){const l=i?.url||"",h=i?.filename||"attachment";if(!l&&!a.fetchBlob)return void t.error("This attachment has no download link.");const d=c(h)??c(l);if("csv"===d){try{o({csv:await m(l,a,i),filename:h}),r("/spreadsheet")}catch{t.error("Could not open the spreadsheet — opening the file instead."),l&&p(l)}return}if(s.has(n(h)||n(l)))return t.error("Spreadsheet preview is unavailable for this file type. Opening the file instead."),void(l&&p(l));if(!d)return l?(t.info("Opening this file outside the app — no viewer can show it here."),void p(l)):void t.error("This attachment has no download link.");if(!a.fetchBlob)return e({url:l,filename:h,kind:d}),void r("/preview");const f=e({filename:h,kind:d,converting:!0,convertingMessage:a.loadingMessage||"LOADING FILE"});r("/preview");try{const e=await a.fetchBlob(i);f.update({url:URL.createObjectURL(e),filename:h,kind:d})}catch(e){f.update({filename:h,kind:d,converting:!1,convertingMessage:u(e,"Failed to load this file.")})}}var d=i(()=>import("../Calculator-LER6KUQC.js")),f=i(()=>import("../Spreadsheet-6WX3P6AB.js")),w=i(()=>import("../Weather-HU75TH7T.js")),j=i(()=>import("../CurrencyConverter-Y35GFDFF.js")),k=i(()=>import("../PomodoroTimer-VAM3AJOX.js")),g=i(()=>import("../Notepad-VVDCBDUA.js")),v=i(()=>import("../WorldClock-T64MDRMJ.js")),T=i(()=>import("../Stock-AUWI3TUX.js")),b=i(()=>import("../Preview-HZ37D7QJ.js")),P=i(()=>import("../PdfViewer-ZCT3PYXU.js")),S=i(()=>import("../Documents-7FYX2CGT.js")),x=i(()=>import("../Files-RZOML2N6.js")),y=i(()=>import("../Browser-24YNRTKT.js")),F={"/calculator":{component:d,label:"Calculator",size:"sm",allowPinOnTop:!0,utility:!0,widget:!0,dimensions:[280,420]},"/spreadsheet":{component:f,label:"Spreadsheets",size:"2xl",appStyle:!0,multiInstance:!0},"/notepad":{component:g,label:"Notepad",size:"lg",allowPinOnTop:!0,flushBody:!0},"/weather":{component:w,label:"Weather",size:"sm",utility:!0,widget:!0,autoHeight:!0,dimensions:[320,400]},"/currency":{component:j,label:"Currency Converter",size:"sm",utility:!0,widget:!0,autoHeight:!0,dimensions:[320,480]},"/pomodoro":{component:k,label:"Pomodoro Timer",size:"sm",utility:!0,widget:!0,dimensions:[320,600]},"/world-clock":{component:v,label:"World Clock",size:"sm",utility:!0,widget:!0,autoHeight:!0,dimensions:[320,480]},"/stock":{component:T,label:"Stocks",size:"sm",utility:!0,widget:!0,autoHeight:!0,dimensions:[320,360]}},L={"/preview":{component:b,label:"Preview",size:"2xl",appStyle:!0,multiInstance:!0},"/documents":{component:S,label:"Documents",size:"xl",appStyle:!0,multiInstance:!0},"/files":{component:x,label:"Files",size:"xl",appStyle:!0}},C={"/browser":{component:y,label:"Browser",size:"2xl",appStyle:!0,multiInstance:!0}},H={...F,...L,...C};export{y as Browser,d as Calculator,j as CurrencyConverter,S as Documents,x as Files,g as Notepad,P as PdfViewer,k as PomodoroTimer,b as Preview,f as Spreadsheet,T as Stock,w as Weather,v as WorldClock,c as attachmentKind,H as bundledApps,L as documentApps,h as openAttachment,F as utilityApps,C as webApps};
|