react-os-shell 0.2.42 → 0.2.43
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/dist/{WorldClock-GCN4NKQT.js → WorldClock-OFK2EA2H.js} +42 -30
- package/dist/WorldClock-OFK2EA2H.js.map +1 -0
- package/dist/apps/index.d.ts +10 -4
- package/dist/apps/index.js +1 -1
- package/dist/{chunk-WAMARCOS.js → chunk-7KZWBIDL.js} +3 -3
- package/dist/{chunk-WAMARCOS.js.map → chunk-7KZWBIDL.js.map} +1 -1
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/dist/WorldClock-GCN4NKQT.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ALL_TIMEZONES } from './chunk-
|
|
1
|
+
import { ALL_TIMEZONES } from './chunk-7KZWBIDL.js';
|
|
2
2
|
import './chunk-PDFQNHW7.js';
|
|
3
3
|
import './chunk-NSU7OHPC.js';
|
|
4
4
|
import './chunk-46LICZUM.js';
|
|
@@ -30,6 +30,19 @@ function WorldClock() {
|
|
|
30
30
|
setConfigAppearance({ ...appearance });
|
|
31
31
|
setSettingsOpen(true);
|
|
32
32
|
}, [worldClocks, appearance]));
|
|
33
|
+
const hourIn = (tz) => {
|
|
34
|
+
try {
|
|
35
|
+
const parts = new Intl.DateTimeFormat("en-US", { timeZone: tz, hour: "numeric", hour12: false }).formatToParts(now);
|
|
36
|
+
const h = parseInt(parts.find((p) => p.type === "hour")?.value || "0", 10);
|
|
37
|
+
return h === 24 ? 0 : h;
|
|
38
|
+
} catch {
|
|
39
|
+
return 12;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
const isDay = (tz) => {
|
|
43
|
+
const h = hourIn(tz);
|
|
44
|
+
return h >= 6 && h < 18;
|
|
45
|
+
};
|
|
33
46
|
const fmtTime = (tz) => now.toLocaleTimeString(void 0, { hour: "2-digit", minute: "2-digit", timeZone: tz });
|
|
34
47
|
const fmtOffset = (tz) => {
|
|
35
48
|
const parts = new Intl.DateTimeFormat("en", { timeZone: tz, timeZoneName: "shortOffset" }).formatToParts(now);
|
|
@@ -45,39 +58,38 @@ function WorldClock() {
|
|
|
45
58
|
setSettingsOpen(false);
|
|
46
59
|
};
|
|
47
60
|
const labelFor = (tz) => ALL_TIMEZONES.find((t) => t.tz === tz)?.label || tz.split("/").pop()?.replace(/_/g, " ") || tz;
|
|
61
|
+
const cards = [{ tz: localTz, isLocal: true }, ...worldClocks.map((tz) => ({ tz, isLocal: false }))];
|
|
62
|
+
const dynamicHeight = 96 + worldClocks.length * 84 + 16;
|
|
48
63
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
49
|
-
/* @__PURE__ */
|
|
64
|
+
/* @__PURE__ */ jsx(
|
|
50
65
|
"div",
|
|
51
66
|
{
|
|
52
|
-
className: "flex flex-col
|
|
67
|
+
className: "flex flex-col rounded-lg text-white overflow-hidden",
|
|
53
68
|
style: {
|
|
54
|
-
|
|
69
|
+
minHeight: dynamicHeight,
|
|
70
|
+
backgroundColor: `rgba(15, 23, 42, ${appearance.activeOpacity / 100})`,
|
|
55
71
|
backdropFilter: appearance.activeBlur > 0 ? `blur(${appearance.activeBlur}px)` : void 0
|
|
56
72
|
},
|
|
57
|
-
children:
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
/* @__PURE__ */ jsx("span", { className: "text-sm font-semibold text-gray-700 tabular-nums shrink-0", children: fmtTime(tz) })
|
|
78
|
-
] }, tz))
|
|
79
|
-
] })
|
|
80
|
-
]
|
|
73
|
+
children: /* @__PURE__ */ jsx("div", { className: "flex-1 flex flex-col gap-2 p-2", children: cards.map(({ tz, isLocal }) => {
|
|
74
|
+
const day = isDay(tz);
|
|
75
|
+
const rowBg = day ? "bg-gradient-to-br from-sky-400 via-sky-300 to-sky-500" : "bg-gradient-to-br from-slate-800 via-blue-950 to-slate-900";
|
|
76
|
+
const sub = isLocal ? `${fmtDate(tz)} \xB7 ${tz.replace(/_/g, " ")}` : `${fmtDate(tz)} \xB7 ${fmtOffset(tz)}`;
|
|
77
|
+
return /* @__PURE__ */ jsxs(
|
|
78
|
+
"div",
|
|
79
|
+
{
|
|
80
|
+
className: `rounded-2xl px-4 py-3 flex items-center justify-between gap-3 ${rowBg}`,
|
|
81
|
+
children: [
|
|
82
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
83
|
+
isLocal && /* @__PURE__ */ jsx("div", { className: "text-[10px] uppercase tracking-wide opacity-80 mb-0.5", children: "Local Time" }),
|
|
84
|
+
/* @__PURE__ */ jsx("div", { className: "text-base font-semibold leading-tight truncate", children: labelFor(tz) }),
|
|
85
|
+
/* @__PURE__ */ jsx("div", { className: "text-[10px] opacity-90 truncate mt-0.5", children: sub })
|
|
86
|
+
] }),
|
|
87
|
+
/* @__PURE__ */ jsx("div", { className: `${isLocal ? "text-3xl" : "text-2xl"} font-extralight leading-none tracking-tight tabular-nums shrink-0`, children: fmtTime(tz) })
|
|
88
|
+
]
|
|
89
|
+
},
|
|
90
|
+
(isLocal ? "local-" : "") + tz
|
|
91
|
+
);
|
|
92
|
+
}) })
|
|
81
93
|
}
|
|
82
94
|
),
|
|
83
95
|
/* @__PURE__ */ jsx(
|
|
@@ -110,5 +122,5 @@ function WorldClock() {
|
|
|
110
122
|
}
|
|
111
123
|
|
|
112
124
|
export { WorldClock as default };
|
|
113
|
-
//# sourceMappingURL=WorldClock-
|
|
114
|
-
//# sourceMappingURL=WorldClock-
|
|
125
|
+
//# sourceMappingURL=WorldClock-OFK2EA2H.js.map
|
|
126
|
+
//# sourceMappingURL=WorldClock-OFK2EA2H.js.map
|
|
@@ -0,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AAE,CAAA,GAAI,IAAA,CAAK,MAAA,CAAO,CAAA,CAAA,KAAK,MAAM,EAAE,CAAA,GAAI,CAAC,GAAG,IAAA,EAAM,EAAE,CAAC,CAAA;AAAA,gBACtG,SAAA,EAAU;AAAA;AAAA,aAAwE;AAAA,YACnF;AAAA,WAAA,EAAA,EAJS,EAKZ,CACD,CAAA,EACH;AAAA,SAAA,EACF;AAAA;AAAA;AACF,GAAA,EACF,CAAA;AAEJ","file":"WorldClock-OFK2EA2H.js","sourcesContent":["import { useState, useEffect, useCallback } from 'react';\nimport { useWidgetSettings } from '../shell/Modal';\nimport WidgetSettingsModal, { loadAppearance, type WidgetAppearance } from '../shell/WidgetSettingsModal';\nimport { useShellPrefs } from '../shell/ShellPrefs';\nimport { ALL_TIMEZONES } from '../shell/Layout';\n\nconst DEFAULT_CLOCKS = ['Europe/London', 'Asia/Shanghai', 'America/Los_Angeles', 'America/New_York'];\nconst SETTINGS_KEY = 'world_clock_appearance';\n\n/**\n * World Clock widget — iOS-style city cards with a per-row day/night\n * gradient that flips based on the local hour at each city. Day cards use\n * a bright sky blue, night cards a deep navy — same palette as the\n * Weather widget so the two read as a set when stacked.\n *\n * Settings (city list + appearance sliders) live in the right-click menu\n * via `useWidgetSettings` — there is no inline \"+ Add World Clock\"\n * button. Translucency is applied as a background-color alpha on the\n * outer panel (slate-900 base) so the row gradients stay vivid even at\n * lower opacity.\n */\nexport default function WorldClock() {\n const [now, setNow] = useState(new Date());\n const [appearance, setAppearance] = useState(() => loadAppearance(SETTINGS_KEY));\n const [settingsOpen, setSettingsOpen] = useState(false);\n const [configClocks, setConfigClocks] = useState<string[]>([]);\n const [configAppearance, setConfigAppearance] = useState<WidgetAppearance>(appearance);\n\n const { prefs, save } = useShellPrefs();\n const worldClocks: string[] = (prefs.world_clocks as string[] | undefined) ?? DEFAULT_CLOCKS;\n\n useEffect(() => {\n const t = setInterval(() => setNow(new Date()), 10000);\n return () => clearInterval(t);\n }, []);\n\n useWidgetSettings(useCallback(() => {\n setConfigClocks([...worldClocks]);\n setConfigAppearance({ ...appearance });\n setSettingsOpen(true);\n }, [worldClocks, appearance]));\n\n /** Local hour (0–23) at the given timezone — used to flip day/night. */\n const hourIn = (tz: string): number => {\n try {\n const parts = new Intl.DateTimeFormat('en-US', { timeZone: tz, hour: 'numeric', hour12: false }).formatToParts(now);\n const h = parseInt(parts.find(p => p.type === 'hour')?.value || '0', 10);\n // `hourCycle: h23` would be cleanest but isn't universally supported;\n // `hour12: false` returns 24 for midnight on some Node versions, so\n // normalize that to 0.\n return h === 24 ? 0 : h;\n } catch { return 12; }\n };\n /** Crude sunrise/sunset proxy — good enough for \"should this card look\n * bright or dark.\" Real solar calc would need the city's latitude. */\n const isDay = (tz: string) => { const h = hourIn(tz); return h >= 6 && h < 18; };\n\n const fmtTime = (tz: string) => now.toLocaleTimeString(undefined, { hour: '2-digit', minute: '2-digit', timeZone: tz });\n const fmtOffset = (tz: string) => {\n const parts = new Intl.DateTimeFormat('en', { timeZone: tz, timeZoneName: 'shortOffset' }).formatToParts(now);\n return parts.find(p => p.type === 'timeZoneName')?.value || '';\n };\n const fmtDate = (tz: string) => now.toLocaleDateString(undefined, { weekday: 'short', month: 'short', day: 'numeric', timeZone: tz });\n\n const localTz = (typeof localStorage !== 'undefined' && localStorage.getItem('user_timezone'))\n || Intl.DateTimeFormat().resolvedOptions().timeZone;\n\n const saveSettings = () => {\n if (configClocks.length === 0) return;\n save({ world_clocks: configClocks });\n setAppearance(configAppearance);\n localStorage.setItem(SETTINGS_KEY, JSON.stringify(configAppearance));\n setSettingsOpen(false);\n };\n\n const labelFor = (tz: string) =>\n ALL_TIMEZONES.find(t => t.tz === tz)?.label\n || tz.split('/').pop()?.replace(/_/g, ' ')\n || tz;\n\n // Local time gets the \"featured\" card at the top, then the user's chosen\n // cities. Each card is its own day/night-coloured tile sitting on the\n // panel's slate backdrop with `gap-2` between cards — same idiom as\n // Weather.\n const cards = [{ tz: localTz, isLocal: true }, ...worldClocks.map(tz => ({ tz, isLocal: false }))];\n\n // Card heights: featured local-time card is taller (3 lines + larger\n // time), each city card is ~76 px. Plus the panel's p-2 padding.\n const dynamicHeight = 96 /* local card */ + worldClocks.length * 84 /* city cards */ + 16;\n\n return (\n <>\n <div className=\"flex flex-col rounded-lg text-white overflow-hidden\"\n style={{\n minHeight: dynamicHeight,\n backgroundColor: `rgba(15, 23, 42, ${appearance.activeOpacity / 100})`,\n backdropFilter: appearance.activeBlur > 0 ? `blur(${appearance.activeBlur}px)` : undefined,\n }}>\n <div className=\"flex-1 flex flex-col gap-2 p-2\">\n {cards.map(({ tz, isLocal }) => {\n const day = isDay(tz);\n const rowBg = day\n ? 'bg-gradient-to-br from-sky-400 via-sky-300 to-sky-500'\n : 'bg-gradient-to-br from-slate-800 via-blue-950 to-slate-900';\n const sub = isLocal\n ? `${fmtDate(tz)} · ${tz.replace(/_/g, ' ')}`\n : `${fmtDate(tz)} · ${fmtOffset(tz)}`;\n return (\n <div key={(isLocal ? 'local-' : '') + tz}\n className={`rounded-2xl px-4 py-3 flex items-center justify-between gap-3 ${rowBg}`}>\n <div className=\"min-w-0 flex-1\">\n {isLocal && (\n <div className=\"text-[10px] uppercase tracking-wide opacity-80 mb-0.5\">Local Time</div>\n )}\n <div className=\"text-base font-semibold leading-tight truncate\">{labelFor(tz)}</div>\n <div className=\"text-[10px] opacity-90 truncate mt-0.5\">{sub}</div>\n </div>\n <div className={`${isLocal ? 'text-3xl' : 'text-2xl'} font-extralight leading-none tracking-tight tabular-nums shrink-0`}>\n {fmtTime(tz)}\n </div>\n </div>\n );\n })}\n </div>\n </div>\n\n <WidgetSettingsModal open={settingsOpen} onClose={() => setSettingsOpen(false)} title=\"World Clock Settings\"\n appearance={configAppearance} onAppearanceChange={setConfigAppearance} onSave={saveSettings}>\n <div>\n <h3 className=\"text-sm font-semibold text-gray-700 mb-2\">Cities</h3>\n <div className=\"grid grid-cols-2 gap-1 max-h-56 overflow-y-auto\">\n {ALL_TIMEZONES.filter(t => t.tz !== localTz).map(({ tz, label }) => (\n <label key={tz} className=\"flex items-center gap-2 text-sm py-1 cursor-pointer hover:bg-gray-50 rounded px-2\">\n <input type=\"checkbox\" checked={configClocks.includes(tz)}\n onChange={() => setConfigClocks(prev => prev.includes(tz) ? prev.filter(t => t !== tz) : [...prev, tz])}\n className=\"rounded border-gray-300 text-blue-600 focus:ring-blue-500 h-3.5 w-3.5\" />\n {label}\n </label>\n ))}\n </div>\n </div>\n </WidgetSettingsModal>\n </>\n );\n}\n"]}
|
package/dist/apps/index.d.ts
CHANGED
|
@@ -54,10 +54,16 @@ declare function Checkers$1(): react_jsx_runtime.JSX.Element;
|
|
|
54
54
|
declare function Chess$1(): react_jsx_runtime.JSX.Element;
|
|
55
55
|
|
|
56
56
|
/**
|
|
57
|
-
* World Clock widget —
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
57
|
+
* World Clock widget — iOS-style city cards with a per-row day/night
|
|
58
|
+
* gradient that flips based on the local hour at each city. Day cards use
|
|
59
|
+
* a bright sky blue, night cards a deep navy — same palette as the
|
|
60
|
+
* Weather widget so the two read as a set when stacked.
|
|
61
|
+
*
|
|
62
|
+
* Settings (city list + appearance sliders) live in the right-click menu
|
|
63
|
+
* via `useWidgetSettings` — there is no inline "+ Add World Clock"
|
|
64
|
+
* button. Translucency is applied as a background-color alpha on the
|
|
65
|
+
* outer panel (slate-900 base) so the row gradients stay vivid even at
|
|
66
|
+
* lower opacity.
|
|
61
67
|
*/
|
|
62
68
|
declare function WorldClock$1(): react_jsx_runtime.JSX.Element;
|
|
63
69
|
|
package/dist/apps/index.js
CHANGED
|
@@ -12,7 +12,7 @@ var Weather = lazy(() => import('../Weather-XTADR7Z3.js'));
|
|
|
12
12
|
var CurrencyConverter = lazy(() => import('../CurrencyConverter-XZVZ7XOF.js'));
|
|
13
13
|
var PomodoroTimer = lazy(() => import('../PomodoroTimer-T2J5NDJR.js'));
|
|
14
14
|
var Notepad = lazy(() => import('../Notepad-W3YYZ3GS.js'));
|
|
15
|
-
var WorldClock = lazy(() => import('../WorldClock-
|
|
15
|
+
var WorldClock = lazy(() => import('../WorldClock-OFK2EA2H.js'));
|
|
16
16
|
var Chess = lazy(() => import('../Chess-C5BY45NA.js'));
|
|
17
17
|
var Checkers = lazy(() => import('../Checkers-MIAHIKJH.js'));
|
|
18
18
|
var Sudoku = lazy(() => import('../Sudoku-XHLYCEVT.js'));
|
|
@@ -668,7 +668,7 @@ function BugReportAnnotator({
|
|
|
668
668
|
}
|
|
669
669
|
|
|
670
670
|
// src/version.ts
|
|
671
|
-
var VERSION = "0.2.
|
|
671
|
+
var VERSION = "0.2.43" ;
|
|
672
672
|
var APP_VERSION = VERSION;
|
|
673
673
|
|
|
674
674
|
// src/utils/reportBug.ts
|
|
@@ -4140,5 +4140,5 @@ function Layout({
|
|
|
4140
4140
|
}
|
|
4141
4141
|
|
|
4142
4142
|
export { ALL_TIMEZONES, ALT, ALT_SHIFT_D, ALT_SHIFT_E, ALT_SHIFT_N, BugReportConfigProvider, BugReportProvider, CMD_A, CMD_DOT, CMD_ENTER, CMD_K, CMD_S, Desktop, DesktopHostProvider, ENTER, GlobalSearch, Layout, MOD, NotificationBell, SHIFT, ShellAuthProvider, ShortcutHelp, StartMenu, VERSION, isMac, openBugReportDialog, reportBug, setShellAuthBridge, useBugReport, useClickOutside, useDesktopHost, useShellAuth };
|
|
4143
|
-
//# sourceMappingURL=chunk-
|
|
4144
|
-
//# sourceMappingURL=chunk-
|
|
4143
|
+
//# sourceMappingURL=chunk-7KZWBIDL.js.map
|
|
4144
|
+
//# sourceMappingURL=chunk-7KZWBIDL.js.map
|