efficient-shell 4.166.0 → 4.167.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 +42 -1
- package/dist/{Browser-2MBG34IR.js → Browser-6JAAEWKO.js} +14 -14
- package/dist/{Calculator-R3WJTNZ6.js → Calculator-NXMUEH5D.js} +22 -22
- package/dist/{CurrencyConverter-PEXSQQUK.js → CurrencyConverter-3BTIZ2LT.js} +6 -6
- package/dist/{Documents-YL4RIOZO.js → Documents-DJI7WGXG.js} +2 -2
- package/dist/{Files-3ZRUTRSB.js → Files-T5EUM5IQ.js} +25 -25
- package/dist/{Notepad-3ZM2FR6C.js → Notepad-KNRYFOM4.js} +10 -10
- package/dist/{PomodoroTimer-5QHA5UOY.js → PomodoroTimer-SCPEOG6W.js} +27 -27
- package/dist/{Preview-32F4DTCK.js → Preview-XLDGT7V4.js} +16 -16
- package/dist/{Sidebar-QQSRLMJG.js → Sidebar-C5RXL72L.js} +17 -17
- package/dist/{Spreadsheet-GOZI7I4L.js → Spreadsheet-3GOYRHZ3.js} +12 -12
- package/dist/{Stock-XJFITZZA.js → Stock-UGDIALNB.js} +4 -4
- package/dist/{Weather-BDC633GV.js → Weather-CR2MN5XF.js} +15 -15
- package/dist/{WorldClock-ROOVRRCJ.js → WorldClock-JBNJ7C7J.js} +6 -6
- package/dist/apps/index.js +1 -1
- package/dist/brand.css +1 -1
- package/dist/{chunk-CRI4UFBU.js → chunk-A7Q4BCPI.js} +5 -5
- package/dist/{chunk-HGG5M5AB.js → chunk-B5OVATHU.js} +1 -1
- package/dist/{chunk-7TQ7NMT3.js → chunk-CUX4XGLS.js} +1 -1
- package/dist/chunk-CZMMBYNN.js +1 -0
- package/dist/{chunk-G5J6YSN5.js → chunk-FVXBJGY5.js} +3 -3
- package/dist/{chunk-JKVDTKBE.js → chunk-GVZLCY3B.js} +290 -284
- package/dist/{chunk-QASZIYLG.js → chunk-JLPJBO7K.js} +1 -1
- package/dist/{chunk-BKDE67DB.js → chunk-JYLI2WXW.js} +2 -2
- package/dist/{chunk-VXBJNMAA.js → chunk-LW27IM3S.js} +98 -98
- package/dist/{chunk-UVZIPXIA.js → chunk-N3ZXQE4M.js} +3 -3
- package/dist/{chunk-7YFAFXQG.js → chunk-PLX2N4N6.js} +2 -2
- package/dist/{chunk-DTRXR6JQ.js → chunk-XKHAP6N2.js} +11 -11
- package/dist/{chunk-HA2WG27U.js → chunk-YWXYBJ5Y.js} +2 -2
- package/dist/{index-DcLqfJX3.d.ts → index-CbLbd__n.d.ts} +61 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.js +48 -48
- package/dist/map/index.js +3 -3
- package/dist/page-tabs/index.js +5 -5
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/ui.css +12 -0
- package/package.json +1 -1
- package/dist/chunk-VRHUY4P4.js +0 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-
|
|
1
|
+
import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-JLPJBO7K.js";import{useWidgetSettings as a}from"./chunk-LW27IM3S.js";import"./chunk-A7Q4BCPI.js";import"./chunk-DSSLOQDW.js";import"./chunk-5A7MWTXX.js";import"./chunk-JYLI2WXW.js";import"./chunk-6KO2U66R.js";import"./chunk-M4DB7UBZ.js";import"./chunk-N3ZXQE4M.js";import"./chunk-AFYQTVZO.js";import"./chunk-HZZNJHRH.js";import"./chunk-X4FJ54PP.js";import"./chunk-NCQLGQYR.js";import"./chunk-D65T4H6J.js";import{useState as r,useCallback as n}from"react";import{jsxs as c,Fragment as s,jsx as i}from"react/jsx-runtime";var l=["AAPL","MSFT","GOOGL","TSLA","NVDA"],o="stock_symbols",m="stock_appearance",p={AAPL:{price:229.87,change:1.42,changePct:.62},MSFT:{price:451.16,change:-2.31,changePct:-.51},GOOGL:{price:178.34,change:.89,changePct:.5},AMZN:{price:201.45,change:-1.08,changePct:-.53},TSLA:{price:248.92,change:6.74,changePct:2.78},NVDA:{price:134.81,change:-3.12,changePct:-2.26},META:{price:563.27,change:4.55,changePct:.81}},d=Object.keys(p);function g(){try{const e=JSON.parse(localStorage.getItem(o)||"");if(Array.isArray(e)&&e.length)return e.slice(0,8)}catch{}return l}var h=e=>`${e>=0?"+":""}${e.toFixed(2)}`;function x(){const[l,x]=r(g),[u,y]=r(()=>e(m)),[b,f]=r(!1),[N,v]=r([]),[k,j]=r(u),[A,S]=r(""),P=n(()=>{v([...l]),j({...u}),S(""),f(!0)},[l,u]);a(P);const O=()=>{const e=A.trim().toUpperCase();!e||N.includes(e)||N.length>=8||(v(t=>[...t,e]),S(""))},L=d.filter(e=>!N.includes(e));/* @__PURE__ */
|
|
2
2
|
return c(s,{children:[
|
|
3
3
|
/* @__PURE__ */i("div",{style:{backgroundColor:`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${u.activeOpacity/100})`,backdropFilter:u.activeBlur>0?`blur(${u.activeBlur}px)`:void 0},children:/* @__PURE__ */i("div",{className:"px-4 py-3",children:0===l.length?/* @__PURE__ */i("div",{className:"text-xs text-gray-500 text-center py-6",children:"No symbols yet — add some in settings."}):/* @__PURE__ */i("div",{className:"space-y-0.5",children:l.map(e=>{const t=p[e],a=(t?.change??0)>=0,r=t?t.change>0?"text-green-600":t.change<0?"text-red-600":"text-gray-500":"text-gray-400";/* @__PURE__ */
|
|
4
4
|
return c("div",{className:"flex items-center justify-between px-2 py-2 border-b border-gray-200 last:border-0",children:[
|
|
5
5
|
/* @__PURE__ */i("span",{className:"text-sm font-bold text-gray-800 tracking-tight",children:e}),t?/* @__PURE__ */c("div",{className:"flex flex-col items-end leading-tight",children:[
|
|
6
6
|
/* @__PURE__ */i("span",{className:"text-sm font-mono font-semibold text-gray-900 tabular-nums",children:(n=t.price,`$${n.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})}`)}),
|
|
7
7
|
/* @__PURE__ */c("span",{className:`text-[11px] font-medium tabular-nums ${r}`,children:[a?"▲":"▼"," ",h(t.change)," (",h(t.changePct),"%)"]})]}):/* @__PURE__ */i("span",{className:"text-sm font-mono text-gray-400 tabular-nums",children:"—"})]},e);var n})})})}),
|
|
8
|
-
/* @__PURE__ */i(t,{open:b,onClose:()=>f(!1),title:"Stock Settings",appearance:k,onAppearanceChange:
|
|
8
|
+
/* @__PURE__ */i(t,{open:b,onClose:()=>f(!1),title:"Stock Settings",appearance:k,onAppearanceChange:j,onSave:()=>{const e=N.map(e=>e.toUpperCase()).slice(0,8);x(e),y(k),localStorage.setItem(o,JSON.stringify(e)),localStorage.setItem(m,JSON.stringify(k)),f(!1)},children:/* @__PURE__ */c("div",{children:[
|
|
9
9
|
/* @__PURE__ */c("h3",{className:"text-sm font-semibold text-gray-700 mb-2",children:["Symbols ",
|
|
10
10
|
/* @__PURE__ */c("span",{className:"text-[11px] font-normal text-gray-400",children:["(",N.length,"/",8,")"]})]}),
|
|
11
11
|
/* @__PURE__ */c("div",{className:"space-y-1 mb-2",children:[N.map((e,t)=>/* @__PURE__ */c("div",{className:"flex items-center justify-between py-1 px-2 bg-gray-50 rounded",children:[
|
|
12
12
|
/* @__PURE__ */i("span",{className:"text-sm font-semibold text-gray-700",children:e}),
|
|
13
13
|
/* @__PURE__ */i("button",{onClick:()=>v(e=>e.filter((e,a)=>a!==t)),className:"text-red-400 hover:text-red-600",children:"×"})]},t)),0===N.length&&/* @__PURE__ */i("p",{className:"text-[11px] text-gray-400 italic",children:"No symbols — add a ticker below."})]}),N.length<8?/* @__PURE__ */c("div",{className:"flex items-center gap-2",children:[
|
|
14
|
-
/* @__PURE__ */i("input",{value:
|
|
15
|
-
/* @__PURE__ */i("button",{onClick:
|
|
14
|
+
/* @__PURE__ */i("input",{value:A,onChange:e=>S(e.target.value),onKeyDown:e=>{"Enter"===e.key&&O()},placeholder:"e.g. NVDA",className:"flex-1 bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm uppercase focus:outline-none focus:ring-1 focus:ring-blue-500"}),
|
|
15
|
+
/* @__PURE__ */i("button",{onClick:O,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 ",8," symbols — remove one to add another."]}),L.length>0&&N.length<8&&/* @__PURE__ */i("div",{className:"flex flex-wrap gap-1.5 mt-2",children:L.map(e=>/* @__PURE__ */i("button",{onClick:()=>v(t=>t.length<8?[...t,e]:t),className:"text-[11px] font-medium text-gray-600 bg-gray-100 hover:bg-gray-200 rounded px-2 py-0.5 transition-colors",children:e},e))}),
|
|
16
16
|
/* @__PURE__ */i("p",{className:"text-[11px] text-gray-400 mt-2",children:"Demo prices — static sample data, no live feed."})]})})]})}export{x as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
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-
|
|
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-JLPJBO7K.js";import{useWidgetSettings as s}from"./chunk-LW27IM3S.js";import{useShellPrefs as o}from"./chunk-A7Q4BCPI.js";import"./chunk-DSSLOQDW.js";import"./chunk-5A7MWTXX.js";import"./chunk-JYLI2WXW.js";import"./chunk-6KO2U66R.js";import"./chunk-M4DB7UBZ.js";import"./chunk-N3ZXQE4M.js";import"./chunk-AFYQTVZO.js";import"./chunk-HZZNJHRH.js";import"./chunk-X4FJ54PP.js";import"./chunk-NCQLGQYR.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
2
|
return p("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[
|
|
3
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
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__ */
|
|
@@ -25,36 +25,36 @@ return p("div",{className:"absolute inset-0 overflow-hidden pointer-events-none"
|
|
|
25
25
|
/* @__PURE__ */m("div",{className:"absolute inset-0 bg-white",style:{animation:"wx-flash 6s ease-out infinite"}}),
|
|
26
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 $(){/* @__PURE__ */
|
|
27
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(k,{tone:t?"light":"dark"})]}):3===e?/* @__PURE__ */m(k,{tone:t?"light":"dark"}):45===e||48===e?/* @__PURE__ */m($,{}):[51,53,61,80,81].includes(e)?/* @__PURE__ */m(N,{}):[55,63,65,82].includes(e)?/* @__PURE__ */m(N,{heavy:!0}):[71,73,75].includes(e)?/* @__PURE__ */m(S,{}):[95,96,99].includes(e)?/* @__PURE__ */m(j,{}):null}function
|
|
28
|
+
/* @__PURE__ */m(k,{tone:t?"light":"dark"})]}):3===e?/* @__PURE__ */m(k,{tone:t?"light":"dark"}):45===e||48===e?/* @__PURE__ */m($,{}):[51,53,61,80,81].includes(e)?/* @__PURE__ */m(N,{}):[55,63,65,82].includes(e)?/* @__PURE__ */m(N,{heavy:!0}):[71,73,75].includes(e)?/* @__PURE__ */m(S,{}):[95,96,99].includes(e)?/* @__PURE__ */m(j,{}):null}function L(){const[r,w]=l(g),[v,k]=l(()=>n(u)),[N,S]=l(null),[j,$]=l(!0),[,L]=l(0);c(()=>{const e=setInterval(()=>L(e=>e+1),6e4);return()=>clearInterval(e)},[]);const[D,C]=l(!1),[F,T]=l(r),[A,H]=l(v),{prefs:O,save:B}=o(),z={...y,...O.weather_prefs??{}},[Z,X]=l(z);s(d(()=>{T(r),H({...v}),X({...z}),C(!0)},[r,v,z])),c(()=>{let t=!1;return $(!0),e(r).then(e=>{t||(S(e),$(!1))}),()=>{t=!0}},[r]);const J=e=>z.useFahrenheit?`${x(e)}°F`:`${e}°`;if(j&&!N)/* @__PURE__ */
|
|
29
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(!N)/* @__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[
|
|
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[P,M,W]=t(N.code,N.isDay);/* @__PURE__ */
|
|
31
31
|
return p(h,{children:[
|
|
32
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 ${
|
|
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
34
|
/* @__PURE__ */m(I,{code:N.code,isDay:N.isDay}),
|
|
35
35
|
/* @__PURE__ */p("div",{className:"relative z-10 px-3 py-2.5 flex flex-col h-full justify-between",children:[
|
|
36
36
|
/* @__PURE__ */p("div",{className:"flex items-start justify-between gap-2",children:[
|
|
37
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:N.city}),
|
|
39
|
-
/* @__PURE__ */m("div",{className:"text-3xl font-extralight leading-none tracking-tight tabular-nums shrink-0 drop-shadow-sm",children:
|
|
38
|
+
/* @__PURE__ */m("div",{className:"text-base font-semibold leading-tight truncate drop-shadow-sm",children:N.city}),z.showLocalTime&&/* @__PURE__ */m("div",{className:"text-[10px] opacity-90 leading-tight tabular-nums drop-shadow-sm",children:b(N.timezone,z.use24Hour)})]}),
|
|
39
|
+
/* @__PURE__ */m("div",{className:"text-3xl font-extralight leading-none tracking-tight tabular-nums shrink-0 drop-shadow-sm",children:J(N.temp)})]}),
|
|
40
40
|
/* @__PURE__ */p("div",{className:"flex items-end justify-between gap-2",children:[
|
|
41
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:
|
|
43
|
-
/* @__PURE__ */m("span",{className:"text-[11px] font-medium drop-shadow-sm truncate",children:
|
|
44
|
-
/* @__PURE__ */p("span",{className:"text-[10px] opacity-90 tabular-nums drop-shadow-sm shrink-0",children:["H:",
|
|
45
|
-
/* @__PURE__ */p(i,{open:
|
|
42
|
+
/* @__PURE__ */m("span",{className:"text-lg leading-none drop-shadow-sm",children:M}),
|
|
43
|
+
/* @__PURE__ */m("span",{className:"text-[11px] font-medium drop-shadow-sm truncate",children:P})]}),
|
|
44
|
+
/* @__PURE__ */p("span",{className:"text-[10px] opacity-90 tabular-nums drop-shadow-sm shrink-0",children:["H:",J(N.high)," L:",J(N.low)]})]})]})]})}),
|
|
45
|
+
/* @__PURE__ */p(i,{open:D,onClose:()=>C(!1),title:"Weather Settings",appearance:A,onAppearanceChange:H,onSave:()=>{w(F),k(A),B({weather_prefs:Z}),localStorage.setItem(f,F),localStorage.setItem(u,JSON.stringify(A)),C(!1)},children:[
|
|
46
46
|
/* @__PURE__ */m("div",{className:"space-y-3",children:/* @__PURE__ */p("div",{children:[
|
|
47
47
|
/* @__PURE__ */m("h3",{className:"text-sm font-semibold text-gray-700 mb-2",children:"Display"}),
|
|
48
48
|
/* @__PURE__ */p("div",{className:"flex items-center gap-3 mb-2",children:[
|
|
49
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:()=>X(t=>({...t,useFahrenheit:e.key})),className:"px-3 py-1 text-xs font-medium rounded-lg border transition-colors "+(
|
|
50
|
+
/* @__PURE__ */m("div",{className:"flex gap-1",children:[{key:!1,label:"°C"},{key:!0,label:"°F"}].map(e=>/* @__PURE__ */m("button",{onClick:()=>X(t=>({...t,useFahrenheit:e.key})),className:"px-3 py-1 text-xs font-medium rounded-lg border transition-colors "+(Z.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
51
|
/* @__PURE__ */p("div",{className:"flex items-center gap-3 mb-2",children:[
|
|
52
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:()=>X(t=>({...t,use24Hour:e.key})),className:"px-3 py-1 text-xs font-medium rounded-lg border transition-colors "+(
|
|
53
|
+
/* @__PURE__ */m("div",{className:"flex gap-1",children:[{key:!1,label:"AM/PM"},{key:!0,label:"24H"}].map(e=>/* @__PURE__ */m("button",{onClick:()=>X(t=>({...t,use24Hour:e.key})),className:"px-3 py-1 text-xs font-medium rounded-lg border transition-colors "+(Z.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
54
|
/* @__PURE__ */p("label",{className:"flex items-center gap-2 cursor-pointer",children:[
|
|
55
|
-
/* @__PURE__ */m("input",{type:"checkbox",checked:
|
|
55
|
+
/* @__PURE__ */m("input",{type:"checkbox",checked:Z.showLocalTime,onChange:e=>X(t=>({...t,showLocalTime:e.target.checked})),className:"rounded border-gray-300 text-blue-600 h-3.5 w-3.5"}),
|
|
56
56
|
/* @__PURE__ */m("span",{className:"text-sm text-gray-600",children:"Show local time"})]})]})}),
|
|
57
57
|
/* @__PURE__ */p("div",{children:[
|
|
58
58
|
/* @__PURE__ */m("h3",{className:"text-sm font-semibold text-gray-700 mb-2",children:"City"}),
|
|
59
|
-
/* @__PURE__ */m("select",{value:
|
|
60
|
-
/* @__PURE__ */m("p",{className:"mt-1 text-[10px] text-gray-400",children:"Auto-detected from your timezone; change if needed."})]})]})]})}export{
|
|
59
|
+
/* @__PURE__ */m("select",{value:F,onChange:e=>T(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{L as default};
|
|
@@ -1,6 +1,6 @@
|
|
|
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-
|
|
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-JLPJBO7K.js";import{useWidgetSettings as s}from"./chunk-LW27IM3S.js";import{useShellPrefs as c}from"./chunk-A7Q4BCPI.js";import"./chunk-DSSLOQDW.js";import"./chunk-5A7MWTXX.js";import"./chunk-JYLI2WXW.js";import"./chunk-6KO2U66R.js";import"./chunk-M4DB7UBZ.js";import"./chunk-N3ZXQE4M.js";import"./chunk-AFYQTVZO.js";import"./chunk-HZZNJHRH.js";import"./chunk-X4FJ54PP.js";import"./chunk-NCQLGQYR.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,N]=l(!1),[v,w]=l([]),[j,F]=l(b),C={useFahrenheit:!!x.weather_prefs?.useFahrenheit},[S,D]=l(C),[O,L]=l(()=>/* @__PURE__ */new Date);o(()=>{const e=setInterval(()=>L(/* @__PURE__ */new Date),3e4);return()=>clearInterval(e)},[]);const B=Object.fromEntries(Object.entries(e).map(([e,t])=>[t.tz,e])),I=x.world_clocks,J=(()=>{if(!Array.isArray(I)||0===I.length)return g;const t=[];for(const a of I){const r=e[a]?a:B[a];r&&!t.includes(r)&&t.push(r)}return t.length?t:g})(),[P,T]=l({}),[W,Z]=l(!0);o(()=>{let e=!1;return Z(!0),(async()=>{const a={};await Promise.all(J.map(async e=>{const r=await t(e);r&&(a[e]=r)})),e||(T(a),Z(!1))})(),()=>{e=!0}},[J.join(",")]),s(m(()=>{w([...J]),F({...b}),D({...C}),N(!0)},[J.join(","),b,C.useFahrenheit]));const _=e=>C.useFahrenheit?`${r(e)}°`:`${e}°`;/* @__PURE__ */
|
|
2
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:[
|
|
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:[W&&J.every(e=>!P[e])&&/* @__PURE__ */p("div",{className:"px-3 py-6 text-center text-xs text-gray-500",children:"Loading…"}),J.map(t=>{const r=P[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,O);if(!r)/* @__PURE__ */
|
|
4
4
|
return h("div",{className:"px-4 py-3",children:[
|
|
5
5
|
/* @__PURE__ */h("div",{className:"flex items-baseline justify-between gap-2",children:[
|
|
6
6
|
/* @__PURE__ */p("span",{className:"text-[15px] font-semibold tracking-tight text-gray-900 truncate",children:t}),
|
|
@@ -10,7 +10,7 @@ return h("div",{className:"px-4 py-3",children:[
|
|
|
10
10
|
return h("div",{className:"px-4 py-3",children:[
|
|
11
11
|
/* @__PURE__ */h("div",{className:"flex items-baseline justify-between gap-2",children:[
|
|
12
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:
|
|
13
|
+
/* @__PURE__ */p("span",{className:"text-[26px] font-extralight leading-none tabular-nums tracking-tight text-gray-900 shrink-0",children:_(r.temp)})]}),
|
|
14
14
|
/* @__PURE__ */h("div",{className:"flex items-center justify-between gap-2 mt-1.5 text-[11px]",children:[
|
|
15
15
|
/* @__PURE__ */h("div",{className:"flex items-center gap-1.5 min-w-0 text-gray-500",children:[
|
|
16
16
|
/* @__PURE__ */p("span",{className:"text-base leading-none shrink-0",children:l}),
|
|
@@ -18,13 +18,13 @@ return h("div",{className:"px-4 py-3",children:[
|
|
|
18
18
|
/* @__PURE__ */p("span",{className:"text-[9px] font-medium ml-0.5 opacity-70",children:s})]}),
|
|
19
19
|
/* @__PURE__ */p("span",{className:"text-gray-300 shrink-0",children:"·"}),
|
|
20
20
|
/* @__PURE__ */p("span",{className:"truncate",children:c})]}),
|
|
21
|
-
/* @__PURE__ */h("span",{className:"tabular-nums text-gray-500 shrink-0",children:["H:",
|
|
22
|
-
/* @__PURE__ */h(i,{open:k,onClose:()=>N(!1),title:"World Clock Settings",appearance:j,onAppearanceChange:F,onSave:()=>{0!==v.length&&(y({world_clocks:v,weather_prefs:{...x.weather_prefs??{},useFahrenheit:
|
|
21
|
+
/* @__PURE__ */h("span",{className:"tabular-nums text-gray-500 shrink-0",children:["H:",_(r.high)," L:",_(r.low)]})]})]},t)})]})}),
|
|
22
|
+
/* @__PURE__ */h(i,{open:k,onClose:()=>N(!1),title:"World Clock Settings",appearance:j,onAppearanceChange:F,onSave:()=>{0!==v.length&&(y({world_clocks:v,weather_prefs:{...x.weather_prefs??{},useFahrenheit:S.useFahrenheit}}),f(j),localStorage.setItem(u,JSON.stringify(j)),N(!1))},children:[
|
|
23
23
|
/* @__PURE__ */h("div",{children:[
|
|
24
24
|
/* @__PURE__ */p("h3",{className:"text-sm font-semibold text-gray-700 mb-2",children:"Display"}),
|
|
25
25
|
/* @__PURE__ */h("div",{className:"flex items-center gap-3 mb-2",children:[
|
|
26
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:()=>
|
|
27
|
+
/* @__PURE__ */p("div",{className:"flex gap-1",children:[{key:!1,label:"°C"},{key:!0,label:"°F"}].map(e=>/* @__PURE__ */p("button",{onClick:()=>D(t=>({...t,useFahrenheit:e.key})),className:"px-3 py-1 text-xs font-medium rounded-lg border transition-colors "+(S.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
28
|
/* @__PURE__ */p("p",{className:"text-[10px] text-gray-400 mt-1",children:"Shared with the Weather widget."})]}),
|
|
29
29
|
/* @__PURE__ */h("div",{children:[
|
|
30
30
|
/* @__PURE__ */p("h3",{className:"text-sm font-semibold text-gray-700 mb-2",children:"Cities"}),
|
package/dist/apps/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{openFilesInTrashMode,setFilesDemoTree}from"../chunk-ILTSTULF.js";export{setBrowserStartUrl}from"../chunk-LWLCNQY7.js";export{BUILTIN_APP_INFO}from"../chunk-
|
|
2
|
+
export{openFilesInTrashMode,setFilesDemoTree}from"../chunk-ILTSTULF.js";export{setBrowserStartUrl}from"../chunk-LWLCNQY7.js";export{BUILTIN_APP_INFO}from"../chunk-B5OVATHU.js";import"../chunk-C2A4PIGZ.js";import{setPdfPreview as e}from"../chunk-ESL5TDNA.js";export{setPdfPreview}from"../chunk-ESL5TDNA.js";import{toast_default as t}from"../chunk-KSSAVLO7.js";import{setSpreadsheetPreview as o}from"../chunk-VTVSMRFX.js";export{setSpreadsheetPreview}from"../chunk-VTVSMRFX.js";import"../chunk-CZMMBYNN.js";import"../chunk-LW27IM3S.js";import"../chunk-A7Q4BCPI.js";import"../chunk-DSSLOQDW.js";import"../chunk-5A7MWTXX.js";import"../chunk-JYLI2WXW.js";import"../chunk-6KO2U66R.js";import"../chunk-M4DB7UBZ.js";import"../chunk-N3ZXQE4M.js";import"../chunk-AFYQTVZO.js";import"../chunk-HZZNJHRH.js";import"../chunk-X4FJ54PP.js";import"../chunk-NCQLGQYR.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-NXMUEH5D.js")),f=i(()=>import("../Spreadsheet-3GOYRHZ3.js")),w=i(()=>import("../Weather-CR2MN5XF.js")),j=i(()=>import("../CurrencyConverter-3BTIZ2LT.js")),k=i(()=>import("../PomodoroTimer-SCPEOG6W.js")),g=i(()=>import("../Notepad-KNRYFOM4.js")),v=i(()=>import("../WorldClock-JBNJ7C7J.js")),S=i(()=>import("../Stock-UGDIALNB.js")),b=i(()=>import("../Preview-XLDGT7V4.js")),T=i(()=>import("../PdfViewer-S2B2DZYB.js")),x=i(()=>import("../Documents-DJI7WGXG.js")),y=i(()=>import("../Files-T5EUM5IQ.js")),B=i(()=>import("../Browser-6JAAEWKO.js")),L={"/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:S,label:"Stocks",size:"sm",utility:!0,widget:!0,autoHeight:!0,dimensions:[320,360]}},I={"/preview":{component:b,label:"Preview",size:"2xl",appStyle:!0,multiInstance:!0},"/documents":{component:x,label:"Documents",size:"xl",appStyle:!0,multiInstance:!0},"/files":{component:y,label:"Files",size:"xl",appStyle:!0}},C={"/browser":{component:B,label:"Browser",size:"2xl",appStyle:!0,multiInstance:!0}},N={...L,...I,...C};export{B as Browser,d as Calculator,j as CurrencyConverter,x as Documents,y as Files,g as Notepad,T as PdfViewer,k as PomodoroTimer,b as Preview,f as Spreadsheet,S as Stock,w as Weather,v as WorldClock,c as attachmentKind,N as bundledApps,I as documentApps,h as openAttachment,L as utilityApps,C as webApps};
|