efficient-shell 10.2.1 → 10.4.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 +12 -1
- package/dist/{Browser-YHMFQIN5.js → Browser-WZTJDJPT.js} +14 -14
- package/dist/Calculator-S5OP2NS6.js +29 -0
- package/dist/{CurrencyConverter-YQ2AZ7ZG.js → CurrencyConverter-MQ3OOVX4.js} +12 -12
- package/dist/{Documents-CMCZA5PH.js → Documents-KZ2V5CYE.js} +17 -17
- package/dist/{Files-UW65YMFW.js → Files-KV3ZHSLP.js} +77 -77
- package/dist/{Notepad-RSYZ7HZA.js → Notepad-U2I5IPBD.js} +9 -9
- package/dist/{PomodoroTimer-5KCWCL62.js → PomodoroTimer-CX677P57.js} +20 -20
- package/dist/{Preview-PK4QI7SK.js → Preview-VZIROQOT.js} +22 -22
- package/dist/{Spreadsheet-MQR4TQGV.js → Spreadsheet-676YI5OX.js} +13 -13
- package/dist/{Stock-DMW2REHR.js → Stock-PWPUDMK2.js} +6 -6
- package/dist/{Weather-PN7XVCZY.js → Weather-3N3MSFQV.js} +13 -13
- package/dist/{WorldClock-JYLOJCUS.js → WorldClock-6QYLEBLL.js} +6 -6
- package/dist/ai/index.d.ts +25 -5
- package/dist/ai/index.js +59 -59
- package/dist/apps/index.js +1 -1
- package/dist/bin/media-host-check.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/brand.css +1 -1
- package/dist/chunk-3DVNXNTF.js +1 -0
- package/dist/{chunk-QL4757YL.js → chunk-4WXF5E3O.js} +3 -3
- package/dist/{chunk-RP3GUVAI.js → chunk-573EHCD7.js} +39 -39
- package/dist/chunk-ANDANM5V.js +1 -0
- package/dist/{chunk-YATWJMLM.js → chunk-GTNJAKFO.js} +18 -18
- package/dist/{chunk-O42AN43Q.js → chunk-JQYNMUZW.js} +1 -1
- package/dist/chunk-LNWQBSYD.js +5 -0
- package/dist/{chunk-XDQGIW4X.js → chunk-LYIXZFMP.js} +1 -1
- package/dist/{chunk-VJJMWJPZ.js → chunk-OKL56EZ5.js} +1 -1
- package/dist/chunk-OTGQYHVC.js +9 -0
- package/dist/{chunk-MTX5LMJD.js → chunk-QWWJUYZI.js} +15 -15
- package/dist/forms/MediaLibrary.js +1 -1
- package/dist/hooks/useTheme.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +57 -57
- package/dist/page-tabs/index.js +5 -5
- package/dist/shell/ConfirmDialog.js +1 -1
- package/dist/shell/Dialog.d.ts +2 -2
- package/dist/shell/Dialog.js +1 -1
- package/dist/shell/Drawer.d.ts +2 -2
- package/dist/shell/Drawer.js +1 -1
- package/dist/shell/discardGuard.js +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/templates/ErrorBoundary.d.ts +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/Calculator-NSYIXONM.js +0 -29
- package/dist/chunk-6OMCCEYA.js +0 -1
- package/dist/chunk-AKJHVOSD.js +0 -8
- package/dist/chunk-SDI2UGAG.js +0 -1
- package/dist/chunk-XLYCWGTK.js +0 -4
- /package/dist/{chunk-YMYY5G6V.js → chunk-OW7MLJ3Y.js} +0 -0
|
@@ -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-LYIXZFMP.js";import{useWidgetSettings as s}from"./chunk-573EHCD7.js";import"./chunk-CY5N5OA3.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-URERZUX5.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-RBQWIHYD.js";import"./chunk-QWWJUYZI.js";import"./chunk-LNWQBSYD.js";import{useShellPrefs as o}from"./chunk-KC3EX26K.js";import"./chunk-QHOBK35Y.js";import"./chunk-3DVNXNTF.js";import"./chunk-OW7MLJ3Y.js";import"./chunk-VWGWZY7A.js";import"./chunk-PKXQDCNR.js";import"./chunk-UGTRSRIW.js";import"./chunk-PXQG5EIH.js";import"./chunk-CDAJKLGL.js";import"./chunk-37U326EL.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-TXDA7TTP.js";import"./chunk-I4VIEGCX.js";import"./chunk-UQYNPYF4.js";import"./chunk-34URULVW.js";import"./chunk-KKSVRIMP.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as l}from"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import"./chunk-MVZRZTQP.js";import"./chunk-6XBWM453.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-F27JJHNJ.js";import"./chunk-TWVUQUUD.js";import"./chunk-4PAWQEXM.js";import"./chunk-C3QOHMR6.js";import{useState as c,useEffect as d,useCallback as m}from"react";import{jsx as p,jsxs as h,Fragment as u}from"react/jsx-runtime";var f="weather_city",y="weather_appearance",g={useFahrenheit:!1,showLocalTime:!0,use24Hour:!1};function x(){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 b=r;function w(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 v(){/* @__PURE__ */
|
|
2
2
|
return h("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[
|
|
3
3
|
/* @__PURE__ */p("div",{className:"absolute -top-5 -right-5 w-24 h-24",style:{animation:"wx-sun-rays 70s linear infinite"},children:/* @__PURE__ */p("svg",{viewBox:"0 0 100 100",className:"w-full h-full",children:Array.from({length:12}).map((e,t)=>/* @__PURE__ */p("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__ */p("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 k(){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 h("div",{className:"absolute inset-0 overflow-hidden pointer-events-none"
|
|
|
25
25
|
/* @__PURE__ */p("div",{className:"absolute inset-0 bg-white",style:{animation:"wx-flash 6s ease-out infinite"}}),
|
|
26
26
|
/* @__PURE__ */p("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__ */p("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__ */p("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 T(){/* @__PURE__ */
|
|
27
27
|
return p("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:Array.from({length:4}).map((e,t)=>/* @__PURE__ */p("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__ */p(t?v:k,{}):2===e?/* @__PURE__ */h(u,{children:[/* @__PURE__ */p(t?v:k,{}),
|
|
28
|
-
/* @__PURE__ */p(N,{tone:t?"light":"dark"})]}):3===e?/* @__PURE__ */p(N,{tone:t?"light":"dark"}):45===e||48===e?/* @__PURE__ */p(T,{}):[51,53,61,80,81].includes(e)?/* @__PURE__ */p(j,{}):[55,63,65,82].includes(e)?/* @__PURE__ */p(j,{heavy:!0}):[71,73,75].includes(e)?/* @__PURE__ */p(S,{}):[95,96,99].includes(e)?/* @__PURE__ */p(D,{}):null}function $(){const[r,v]=c(x),[k,N]=c(()=>n(y)),[j,S]=c(null),[D,T]=c(!0),[,$]=c(0);d(()=>{const e=setInterval(()=>$(e=>e+1),6e4);return()=>clearInterval(e)},[]);const[C
|
|
28
|
+
/* @__PURE__ */p(N,{tone:t?"light":"dark"})]}):3===e?/* @__PURE__ */p(N,{tone:t?"light":"dark"}):45===e||48===e?/* @__PURE__ */p(T,{}):[51,53,61,80,81].includes(e)?/* @__PURE__ */p(j,{}):[55,63,65,82].includes(e)?/* @__PURE__ */p(j,{heavy:!0}):[71,73,75].includes(e)?/* @__PURE__ */p(S,{}):[95,96,99].includes(e)?/* @__PURE__ */p(D,{}):null}function $(){const[r,v]=c(x),[k,N]=c(()=>n(y)),[j,S]=c(null),[D,T]=c(!0),[,$]=c(0);d(()=>{const e=setInterval(()=>$(e=>e+1),6e4);return()=>clearInterval(e)},[]);const[L,C]=c(!1),[H,W]=c(r),[F,A]=c(k),{prefs:M,save:U}=o(),X={...g,...M.weather_prefs??{}},[Z,J]=c(X);s(m(()=>{W(r),A({...k}),J({...X}),C(!0)},[r,k,X])),d(()=>{let t=!1;return T(!0),e(r).then(e=>{t||(S(e),T(!1))}),()=>{t=!0}},[r]);const B=e=>X.useFahrenheit?`${b(e)}°F`:`${e}°`;if(D&&!j)/* @__PURE__ */
|
|
29
29
|
return p("div",{className:"flex items-center justify-center h-full bg-gradient-to-b from-sky-400 to-blue-500 rounded-lg text-on-accent/80 text-xs",style:{minHeight:110},children:/* @__PURE__ */p(l,{size:"sm",padding:"",label:"Loading"})});if(!j)/* @__PURE__ */
|
|
30
|
-
return p("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,
|
|
30
|
+
return p("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,Q,R]=t(j.code,j.isDay);/* @__PURE__ */
|
|
31
31
|
return h(u,{children:[
|
|
32
32
|
/* @__PURE__ */p("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__ */p("div",{className:"rounded-lg overflow-hidden",style:{backgroundColor:`rgba(15, 23, 42, ${k.activeOpacity/100})`,backdropFilter:k.activeBlur>0?`blur(${k.activeBlur}px)`:void 0},children:/* @__PURE__ */h("div",{className:`relative rounded-lg overflow-hidden text-white bg-gradient-to-br ${
|
|
33
|
+
/* @__PURE__ */p("div",{className:"rounded-lg overflow-hidden",style:{backgroundColor:`rgba(15, 23, 42, ${k.activeOpacity/100})`,backdropFilter:k.activeBlur>0?`blur(${k.activeBlur}px)`:void 0},children:/* @__PURE__ */h("div",{className:`relative rounded-lg overflow-hidden text-white bg-gradient-to-br ${R}`,style:{height:110},children:[
|
|
34
34
|
/* @__PURE__ */p(I,{code:j.code,isDay:j.isDay}),
|
|
35
35
|
/* @__PURE__ */h("div",{className:"relative z-10 px-3 py-3 flex flex-col h-full justify-between",children:[
|
|
36
36
|
/* @__PURE__ */h("div",{className:"flex items-start justify-between gap-2",children:[
|
|
37
37
|
/* @__PURE__ */h("div",{className:"min-w-0 flex-1",children:[
|
|
38
|
-
/* @__PURE__ */p("div",{className:"text-base font-semibold leading-tight truncate drop-shadow-sm",children:j.city}),
|
|
39
|
-
/* @__PURE__ */p("div",{className:"text-3xl font-extralight leading-none tracking-tight tabular-nums shrink-0 drop-shadow-sm",children:
|
|
38
|
+
/* @__PURE__ */p("div",{className:"text-base font-semibold leading-tight truncate drop-shadow-sm",children:j.city}),X.showLocalTime&&/* @__PURE__ */p("div",{className:"text-2xs opacity-90 leading-tight tabular-nums drop-shadow-sm",children:w(j.timezone,X.use24Hour)})]}),
|
|
39
|
+
/* @__PURE__ */p("div",{className:"text-3xl font-extralight leading-none tracking-tight tabular-nums shrink-0 drop-shadow-sm",children:B(j.temp)})]}),
|
|
40
40
|
/* @__PURE__ */h("div",{className:"flex items-end justify-between gap-2",children:[
|
|
41
41
|
/* @__PURE__ */h("div",{className:"flex items-center gap-2 min-w-0",children:[
|
|
42
|
-
/* @__PURE__ */p("span",{className:"text-lg leading-none drop-shadow-sm",children:
|
|
42
|
+
/* @__PURE__ */p("span",{className:"text-lg leading-none drop-shadow-sm",children:Q}),
|
|
43
43
|
/* @__PURE__ */p("span",{className:"text-2xs font-medium drop-shadow-sm truncate",children:P})]}),
|
|
44
|
-
/* @__PURE__ */h("span",{className:"text-2xs opacity-90 tabular-nums drop-shadow-sm shrink-0",children:["H:",
|
|
45
|
-
/* @__PURE__ */h(i,{open:
|
|
44
|
+
/* @__PURE__ */h("span",{className:"text-2xs opacity-90 tabular-nums drop-shadow-sm shrink-0",children:["H:",B(j.high)," L:",B(j.low)]})]})]})]})}),
|
|
45
|
+
/* @__PURE__ */h(i,{open:L,onClose:()=>C(!1),title:"Weather Settings",appearance:F,onAppearanceChange:A,onSave:()=>{v(H),N(F),U({weather_prefs:Z}),localStorage.setItem(f,H),localStorage.setItem(y,JSON.stringify(F)),C(!1)},children:[
|
|
46
46
|
/* @__PURE__ */p("div",{className:"space-y-3",children:/* @__PURE__ */h("div",{children:[
|
|
47
47
|
/* @__PURE__ */p("h3",{className:"text-sm font-semibold text-gray-700 mb-2",children:"Display"}),
|
|
48
48
|
/* @__PURE__ */h("div",{className:"flex items-center gap-3 mb-2",children:[
|
|
49
49
|
/* @__PURE__ */p("span",{className:"text-sm text-gray-600 w-24",children:"Temperature"}),
|
|
50
|
-
/* @__PURE__ */p("div",{className:"flex gap-1",children:[{key:!1,label:"°C"},{key:!0,label:"°F"}].map(e=>/* @__PURE__ */p("button",{onClick:()=>
|
|
50
|
+
/* @__PURE__ */p("div",{className:"flex gap-1",children:[{key:!1,label:"°C"},{key:!0,label:"°F"}].map(e=>/* @__PURE__ */p("button",{onClick:()=>J(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__ */h("div",{className:"flex items-center gap-3 mb-2",children:[
|
|
52
52
|
/* @__PURE__ */p("span",{className:"text-sm text-gray-600 w-24",children:"Time Format"}),
|
|
53
|
-
/* @__PURE__ */p("div",{className:"flex gap-1",children:[{key:!1,label:"AM/PM"},{key:!0,label:"24H"}].map(e=>/* @__PURE__ */p("button",{onClick:()=>
|
|
53
|
+
/* @__PURE__ */p("div",{className:"flex gap-1",children:[{key:!1,label:"AM/PM"},{key:!0,label:"24H"}].map(e=>/* @__PURE__ */p("button",{onClick:()=>J(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__ */h("label",{className:"flex items-center gap-2 cursor-pointer",children:[
|
|
55
|
-
/* @__PURE__ */p("input",{type:"checkbox",checked:
|
|
55
|
+
/* @__PURE__ */p("input",{type:"checkbox",checked:Z.showLocalTime,onChange:e=>J(t=>({...t,showLocalTime:e.target.checked})),className:"rounded border-gray-300 text-blue-600 h-3.5 w-3.5"}),
|
|
56
56
|
/* @__PURE__ */p("span",{className:"text-sm text-gray-600",children:"Show local time"})]})]})}),
|
|
57
57
|
/* @__PURE__ */h("div",{children:[
|
|
58
58
|
/* @__PURE__ */p("h3",{className:"text-sm font-semibold text-gray-700 mb-2",children:"City"}),
|
|
59
|
-
/* @__PURE__ */p("select",{value:
|
|
59
|
+
/* @__PURE__ */p("select",{value:H,onChange:e=>W(e.target.value),className:"w-full bg-surface-sunken border border-line rounded px-2 h-8 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:Object.keys(a).map(e=>/* @__PURE__ */p("option",{value:e,children:e},e))}),
|
|
60
60
|
/* @__PURE__ */p("p",{className:"mt-1 text-2xs text-ink-faintest",children:"Auto-detected from your timezone; change if needed."})]})]})]})}export{$ as default};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{AVAILABLE_CITIES as e,fetchCityWeather as t,getCondition as n,toFahrenheit as r}from"./chunk-FBDZGO3V.js";import{loadAppearance as s,WidgetSettingsModal as i}from"./chunk-
|
|
1
|
+
import{AVAILABLE_CITIES as e,fetchCityWeather as t,getCondition as n,toFahrenheit as r}from"./chunk-FBDZGO3V.js";import{loadAppearance as s,WidgetSettingsModal as i}from"./chunk-LYIXZFMP.js";import{useWidgetSettings as a}from"./chunk-573EHCD7.js";import"./chunk-CY5N5OA3.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-URERZUX5.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-RBQWIHYD.js";import"./chunk-QWWJUYZI.js";import"./chunk-LNWQBSYD.js";import{useShellPrefs as c}from"./chunk-KC3EX26K.js";import"./chunk-QHOBK35Y.js";import"./chunk-3DVNXNTF.js";import"./chunk-OW7MLJ3Y.js";import"./chunk-VWGWZY7A.js";import"./chunk-PKXQDCNR.js";import"./chunk-UGTRSRIW.js";import"./chunk-PXQG5EIH.js";import"./chunk-CDAJKLGL.js";import"./chunk-37U326EL.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-TXDA7TTP.js";import"./chunk-I4VIEGCX.js";import"./chunk-UQYNPYF4.js";import"./chunk-34URULVW.js";import"./chunk-KKSVRIMP.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as o}from"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import"./chunk-MVZRZTQP.js";import"./chunk-6XBWM453.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-F27JJHNJ.js";import"./chunk-TWVUQUUD.js";import"./chunk-4PAWQEXM.js";import"./chunk-C3QOHMR6.js";import{useState as m,useEffect as l,useCallback as h}from"react";import{jsxs as p,Fragment as u,jsx as d}from"react/jsx-runtime";var k="world_clock_appearance",g=["London","Shanghai","New York"];function j(){const{prefs:j,save:x}=c(),[b,f]=m(()=>s(k)),[y,N]=m(!1),[v,w]=m([]),[D,W]=m(b),C={useFahrenheit:!!j.weather_prefs?.useFahrenheit},[F,U]=m(C),[T,J]=m(()=>/* @__PURE__ */new Date);l(()=>{const e=setInterval(()=>J(/* @__PURE__ */new Date),3e4);return()=>clearInterval(e)},[]);const M=Object.fromEntries(Object.entries(e).map(([e,t])=>[t.tz,e])),Q=j.world_clocks,R=(()=>{if(!Array.isArray(Q)||0===Q.length)return g;const t=[];for(const n of Q){const r=e[n]?n:M[n];r&&!t.includes(r)&&t.push(r)}return t.length?t:g})(),[H,L]=m({}),[P,X]=m(!0);l(()=>{let e=!1;return X(!0),(async()=>{const n={};await Promise.all(R.map(async e=>{const r=await t(e);r&&(n[e]=r)})),e||(L(n),X(!1))})(),()=>{e=!0}},[R.join(",")]),a(h(()=>{w([...R]),W({...b}),U({...C}),N(!0)},[R.join(","),b,C.useFahrenheit]));const Z=e=>C.useFahrenheit?`${r(e)}°`:`${e}°`;/* @__PURE__ */
|
|
2
2
|
return p(u,{children:[
|
|
3
|
-
/* @__PURE__ */d("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__ */p("div",{className:"divide-y divide-gray-200",children:[P&&
|
|
3
|
+
/* @__PURE__ */d("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__ */p("div",{className:"divide-y divide-gray-200",children:[P&&R.every(e=>!H[e])&&/* @__PURE__ */d(o,{size:"sm",padding:"py-6",label:"Loading"}),R.map(t=>{const r=H[t],s=e[t]?.tz??"UTC",{time:i,ampm:a}=function(e,t){try{const n=new Intl.DateTimeFormat("en-US",{timeZone:e,hour:"numeric",minute:"2-digit",hour12:!0}).formatToParts(t),r=n.find(e=>"hour"===e.type)?.value||"12";return{time:`${r}:${n.find(e=>"minute"===e.type)?.value||"00"}`,ampm:(n.find(e=>"dayPeriod"===e.type)?.value||"").toUpperCase()}}catch{return{time:"",ampm:""}}}(s,T);if(!r)/* @__PURE__ */
|
|
4
4
|
return p("div",{className:"px-4 py-3",children:[
|
|
5
5
|
/* @__PURE__ */p("div",{className:"flex items-baseline justify-between gap-2",children:[
|
|
6
6
|
/* @__PURE__ */d("span",{className:"text-base font-semibold tracking-tight text-ink-strongest truncate",children:t}),
|
|
@@ -10,7 +10,7 @@ return p("div",{className:"px-4 py-3",children:[
|
|
|
10
10
|
return p("div",{className:"px-4 py-3",children:[
|
|
11
11
|
/* @__PURE__ */p("div",{className:"flex items-baseline justify-between gap-2",children:[
|
|
12
12
|
/* @__PURE__ */d("span",{className:"text-base font-semibold tracking-tight text-ink-strongest truncate",children:t}),
|
|
13
|
-
/* @__PURE__ */d("span",{className:"text-2xl font-extralight leading-none tabular-nums tracking-tight text-ink-strongest shrink-0",children:
|
|
13
|
+
/* @__PURE__ */d("span",{className:"text-2xl font-extralight leading-none tabular-nums tracking-tight text-ink-strongest shrink-0",children:Z(r.temp)})]}),
|
|
14
14
|
/* @__PURE__ */p("div",{className:"flex items-center justify-between gap-2 mt-2 text-2xs",children:[
|
|
15
15
|
/* @__PURE__ */p("div",{className:"flex items-center gap-2 min-w-0 text-ink-faint",children:[
|
|
16
16
|
/* @__PURE__ */d("span",{className:"text-base leading-none shrink-0",children:m}),
|
|
@@ -18,13 +18,13 @@ return p("div",{className:"px-4 py-3",children:[
|
|
|
18
18
|
/* @__PURE__ */d("span",{className:"text-3xs font-medium ml-0.5 opacity-70",children:a})]}),
|
|
19
19
|
/* @__PURE__ */d("span",{className:"text-gray-300 shrink-0",children:"·"}),
|
|
20
20
|
/* @__PURE__ */d("span",{className:"truncate",children:c})]}),
|
|
21
|
-
/* @__PURE__ */p("span",{className:"tabular-nums text-gray-500 shrink-0",children:["H:",
|
|
22
|
-
/* @__PURE__ */p(i,{open:y,onClose:()=>N(!1),title:"World Clock Settings",appearance:D,onAppearanceChange:
|
|
21
|
+
/* @__PURE__ */p("span",{className:"tabular-nums text-gray-500 shrink-0",children:["H:",Z(r.high)," L:",Z(r.low)]})]})]},t)})]})}),
|
|
22
|
+
/* @__PURE__ */p(i,{open:y,onClose:()=>N(!1),title:"World Clock Settings",appearance:D,onAppearanceChange:W,onSave:()=>{0!==v.length&&(x({world_clocks:v,weather_prefs:{...j.weather_prefs??{},useFahrenheit:F.useFahrenheit}}),f(D),localStorage.setItem(k,JSON.stringify(D)),N(!1))},children:[
|
|
23
23
|
/* @__PURE__ */p("div",{children:[
|
|
24
24
|
/* @__PURE__ */d("h3",{className:"text-sm font-semibold text-gray-700 mb-2",children:"Display"}),
|
|
25
25
|
/* @__PURE__ */p("div",{className:"flex items-center gap-3 mb-2",children:[
|
|
26
26
|
/* @__PURE__ */d("span",{className:"text-sm text-gray-600 w-24",children:"Temperature"}),
|
|
27
|
-
/* @__PURE__ */d("div",{className:"flex gap-1",children:[{key:!1,label:"°C"},{key:!0,label:"°F"}].map(e=>/* @__PURE__ */d("button",{onClick:()=>
|
|
27
|
+
/* @__PURE__ */d("div",{className:"flex gap-1",children:[{key:!1,label:"°C"},{key:!0,label:"°F"}].map(e=>/* @__PURE__ */d("button",{onClick:()=>U(t=>({...t,useFahrenheit:e.key})),className:"px-3 py-1 text-xs font-medium rounded-lg border transition-colors "+(F.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__ */d("p",{className:"text-2xs text-ink-faintest mt-1",children:"Shared with the Weather widget."})]}),
|
|
29
29
|
/* @__PURE__ */p("div",{children:[
|
|
30
30
|
/* @__PURE__ */d("h3",{className:"text-sm font-semibold text-gray-700 mb-2",children:"Cities"}),
|
package/dist/ai/index.d.ts
CHANGED
|
@@ -284,14 +284,27 @@ interface AssistantChatLabels {
|
|
|
284
284
|
/** A file card's action, for assistive technology: "{name}" is filled in. */
|
|
285
285
|
openFile: string;
|
|
286
286
|
/** In a chat with several people in it: the word that sends a message to
|
|
287
|
-
* the assistant ("@JARVIS"). A message without it goes to the people
|
|
287
|
+
* the assistant ("@JARVIS"). A message without it goes to the people, or,
|
|
288
|
+
* with `assistantDecides`, to whoever the assistant decides it is for. */
|
|
288
289
|
assistantMention: string;
|
|
290
|
+
/** The assistant's bare name ("JARVIS"): a message that names it so asks it
|
|
291
|
+
* too, as the mention does. Empty: only the mention asks. */
|
|
292
|
+
assistantName: string;
|
|
289
293
|
/** Above the box when the draft goes to the people: "{names}" is filled in. */
|
|
290
294
|
toPeople: string;
|
|
291
295
|
/** Above the box when the draft names the assistant. */
|
|
292
296
|
toAssistant: string;
|
|
297
|
+
/** Above the box, with `assistantDecides`, when the draft names nobody. */
|
|
298
|
+
assistantDecides: string;
|
|
299
|
+
/** Above the box while the assistant decides who a sent message is for;
|
|
300
|
+
* Send shows the loading part meanwhile. */
|
|
301
|
+
deciding: string;
|
|
293
302
|
/** The button that addresses the draft to the assistant. */
|
|
294
303
|
askAssistant: string;
|
|
304
|
+
/** With `assistantDecides`: the button that sends to the people only. */
|
|
305
|
+
peopleOnly: string;
|
|
306
|
+
/** With `assistantDecides`: the button that undoes `peopleOnly`. */
|
|
307
|
+
letAssistantDecide: string;
|
|
295
308
|
/** The box's placeholder there: "{names}" and "{mention}" are filled in. */
|
|
296
309
|
peoplePlaceholder: string;
|
|
297
310
|
/** Over an answer to someone else's question: "{name}" is filled in. */
|
|
@@ -429,6 +442,12 @@ interface AssistantChatProps {
|
|
|
429
442
|
* `PUT …/runs/<run>/rating/`); reject to show that it was not saved.
|
|
430
443
|
* Without it, no thumbs are drawn. */
|
|
431
444
|
onRate?: (request: AssistantRateRequest) => Promise<void> | void;
|
|
445
|
+
/** In a chat several people share, a message that names nobody goes to
|
|
446
|
+
* whoever the server decides it is for (`POST chat/<id>/addressee/`): the
|
|
447
|
+
* assistant answers it, or it goes to the people. The composer's "People
|
|
448
|
+
* only" keeps a message from the assistant. Off: only a message that names
|
|
449
|
+
* the assistant asks it. */
|
|
450
|
+
assistantDecides?: boolean;
|
|
432
451
|
/** Replaces `fetch`, for hosts that need to wrap requests. */
|
|
433
452
|
fetch?: typeof fetch;
|
|
434
453
|
className?: string;
|
|
@@ -514,10 +533,11 @@ declare function attachmentsOf(message: AssistantUIMessage): AssistantAttachment
|
|
|
514
533
|
*/
|
|
515
534
|
declare const OWN_DATA_PARTS: ReadonlySet<string>;
|
|
516
535
|
declare function buildRequestBody(messages: AssistantUIMessage[], conversationId: string | null): AssistantChatRequestBody;
|
|
517
|
-
/** Whether a draft names the assistant
|
|
518
|
-
*
|
|
519
|
-
*
|
|
520
|
-
|
|
536
|
+
/** Whether a draft names the assistant, as a word of its own and in any case:
|
|
537
|
+
* by `mention` (say "@JARVIS") or, when the host gives one, by its bare `name`
|
|
538
|
+
* ("JARVIS"). An address such as "jarvis@example.com" names nobody. In a chat
|
|
539
|
+
* with several people in it, such a message always goes to the assistant. */
|
|
540
|
+
declare function mentionsAssistant(text: string, mention: string, name?: string): boolean;
|
|
521
541
|
/** The draft as a question to the assistant: `mention` first, unless it is
|
|
522
542
|
* already there. */
|
|
523
543
|
declare function addressedToAssistant(text: string, mention: string): string;
|