react-os-shell 0.2.32 → 0.2.36
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.
|
@@ -83,43 +83,6 @@ function getTimeInTz(timezone, use24Hour = false) {
|
|
|
83
83
|
return { hours: 0, minutes: 0, text: "" };
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
-
function MiniClock({ hours, minutes, size = 20 }) {
|
|
87
|
-
const r = size / 2;
|
|
88
|
-
const hAngle = (hours % 12 + minutes / 60) * 30 - 90;
|
|
89
|
-
const mAngle = minutes * 6 - 90;
|
|
90
|
-
const hRad = hAngle * Math.PI / 180;
|
|
91
|
-
const mRad = mAngle * Math.PI / 180;
|
|
92
|
-
const hLen = r * 0.5;
|
|
93
|
-
const mLen = r * 0.7;
|
|
94
|
-
return /* @__PURE__ */ jsxs("svg", { width: size, height: size, className: "shrink-0", children: [
|
|
95
|
-
/* @__PURE__ */ jsx("circle", { cx: r, cy: r, r: r - 1, fill: "rgba(255,255,255,0.15)", stroke: "rgba(255,255,255,0.4)", strokeWidth: 1 }),
|
|
96
|
-
/* @__PURE__ */ jsx(
|
|
97
|
-
"line",
|
|
98
|
-
{
|
|
99
|
-
x1: r,
|
|
100
|
-
y1: r,
|
|
101
|
-
x2: r + Math.cos(hRad) * hLen,
|
|
102
|
-
y2: r + Math.sin(hRad) * hLen,
|
|
103
|
-
stroke: "white",
|
|
104
|
-
strokeWidth: 1.5,
|
|
105
|
-
strokeLinecap: "round"
|
|
106
|
-
}
|
|
107
|
-
),
|
|
108
|
-
/* @__PURE__ */ jsx(
|
|
109
|
-
"line",
|
|
110
|
-
{
|
|
111
|
-
x1: r,
|
|
112
|
-
y1: r,
|
|
113
|
-
x2: r + Math.cos(mRad) * mLen,
|
|
114
|
-
y2: r + Math.sin(mRad) * mLen,
|
|
115
|
-
stroke: "white",
|
|
116
|
-
strokeWidth: 1,
|
|
117
|
-
strokeLinecap: "round"
|
|
118
|
-
}
|
|
119
|
-
),
|
|
120
|
-
/* @__PURE__ */ jsx("circle", { cx: r, cy: r, r: 1, fill: "white" })
|
|
121
|
-
] });
|
|
122
|
-
}
|
|
123
86
|
function Weather() {
|
|
124
87
|
const [cities, setCities] = useState(loadCities);
|
|
125
88
|
const [appearance, setAppearance] = useState(() => loadAppearance(SETTINGS_KEY));
|
|
@@ -192,36 +155,36 @@ function Weather() {
|
|
|
192
155
|
if (loading && data.length === 0) {
|
|
193
156
|
return /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center h-full bg-gradient-to-b from-sky-400 to-blue-500 rounded-lg text-white/70 text-sm", children: "Loading..." });
|
|
194
157
|
}
|
|
195
|
-
const
|
|
196
|
-
const [, , gradient] = data.length > 0 ? getCondition(data[0].code, firstIsDay) : ["", "", "from-sky-400 to-blue-500"];
|
|
197
|
-
const dynamicHeight = data.length * 48 + 16;
|
|
158
|
+
const dynamicHeight = data.length * 96 + 16;
|
|
198
159
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
199
160
|
/* @__PURE__ */ jsx(
|
|
200
161
|
"div",
|
|
201
162
|
{
|
|
202
|
-
className:
|
|
203
|
-
style: {
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
163
|
+
className: "flex flex-col rounded-lg text-white overflow-hidden",
|
|
164
|
+
style: {
|
|
165
|
+
minHeight: dynamicHeight,
|
|
166
|
+
backgroundColor: `rgba(15, 23, 42, ${appearance.activeOpacity / 100})`,
|
|
167
|
+
// slate-900 with alpha
|
|
168
|
+
backdropFilter: appearance.activeBlur > 0 ? `blur(${appearance.activeBlur}px)` : void 0
|
|
169
|
+
},
|
|
170
|
+
children: /* @__PURE__ */ jsx("div", { className: "flex-1 flex flex-col gap-2 p-2", children: data.map((d) => {
|
|
171
|
+
const [condition] = getCondition(d.code, d.isDay);
|
|
172
|
+
const rowBg = d.isDay ? "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";
|
|
173
|
+
return /* @__PURE__ */ jsxs("div", { className: `rounded-2xl px-4 py-3 flex flex-col justify-between gap-3 ${rowBg}`, children: [
|
|
174
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-2", children: [
|
|
175
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
176
|
+
/* @__PURE__ */ jsx("div", { className: "text-lg font-semibold leading-tight truncate", children: d.city }),
|
|
177
|
+
prefs.showLocalTime && /* @__PURE__ */ jsx("div", { className: "text-xs opacity-90 mt-0.5 tabular-nums", children: getTimeInTz(d.timezone, prefs.use24Hour).text })
|
|
178
|
+
] }),
|
|
179
|
+
/* @__PURE__ */ jsx("div", { className: "text-4xl font-extralight leading-none tracking-tight tabular-nums shrink-0", children: t(d.temp) })
|
|
214
180
|
] }),
|
|
215
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-
|
|
216
|
-
/* @__PURE__ */ jsx("span", { className: "
|
|
217
|
-
/* @__PURE__ */ jsxs("
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
" L:",
|
|
223
|
-
t(d.low)
|
|
224
|
-
] })
|
|
181
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-end justify-between text-[11px]", children: [
|
|
182
|
+
/* @__PURE__ */ jsx("span", { className: "opacity-95", children: condition }),
|
|
183
|
+
/* @__PURE__ */ jsxs("span", { className: "opacity-90 tabular-nums", children: [
|
|
184
|
+
"H:",
|
|
185
|
+
t(d.high),
|
|
186
|
+
" L:",
|
|
187
|
+
t(d.low)
|
|
225
188
|
] })
|
|
226
189
|
] })
|
|
227
190
|
] }, d.city);
|
|
@@ -299,5 +262,5 @@ function Weather() {
|
|
|
299
262
|
}
|
|
300
263
|
|
|
301
264
|
export { Weather as default };
|
|
302
|
-
//# sourceMappingURL=Weather-
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ings } from '../shell/Modal';\nimport WidgetSettingsModal, { loadAppearance, type WidgetAppearance } from '../shell/WidgetSettingsModal';\nimport { useShellPrefs } from '../shell/ShellPrefs';\n\n// [condition, day emoji, night emoji, day gradient, night gradient]\nconst WMO: Record<number, [string, string, string, string, string]> = {\n 0: ['Clear Sky', '☀️', '🌙', 'from-sky-400 to-blue-500', 'from-indigo-800 to-slate-900'],\n 1: ['Mainly Clear', '🌤️', '🌙', 'from-sky-400 to-blue-500', 'from-indigo-800 to-slate-900'],\n 2: ['Partly Cloudy', '⛅', '☁️', 'from-sky-400 to-blue-400', 'from-indigo-700 to-slate-800'],\n 3: ['Overcast', '☁️', '☁️', 'from-gray-400 to-gray-500', 'from-gray-700 to-slate-800'],\n 45: ['Foggy', '🌫️', '🌫️', 'from-gray-400 to-gray-500', 'from-gray-700 to-slate-800'],\n 48: ['Foggy', '🌫️', '🌫️', 'from-gray-400 to-gray-500', 'from-gray-700 to-slate-800'],\n 51: ['Light Drizzle', '🌦️', '🌧️', 'from-gray-400 to-blue-500', 'from-gray-700 to-indigo-800'],\n 53: ['Drizzle', '🌧️', '🌧️', 'from-gray-500 to-blue-600', 'from-gray-700 to-indigo-800'],\n 55: ['Heavy Drizzle', '🌧️', '🌧️', 'from-gray-500 to-blue-600', 'from-gray-700 to-indigo-800'],\n 61: ['Light Rain', '🌦️', '🌧️', 'from-gray-400 to-blue-500', 'from-gray-700 to-indigo-800'],\n 63: ['Rain', '🌧️', '🌧️', 'from-gray-500 to-blue-600', 'from-gray-700 to-indigo-800'],\n 65: ['Heavy Rain', '🌧️', '🌧️', 'from-gray-600 to-blue-700', 'from-gray-700 to-indigo-900'],\n 71: ['Light Snow', '🌨️', '🌨️', 'from-blue-200 to-blue-400', 'from-blue-800 to-slate-900'],\n 73: ['Snow', '❄️', '❄️', 'from-blue-300 to-blue-500', 'from-blue-800 to-slate-900'],\n 75: ['Heavy Snow', '❄️', '❄️', 'from-blue-400 to-blue-600', 'from-blue-800 to-slate-900'],\n 80: ['Rain Showers', '🌧️', '🌧️', 'from-gray-500 to-blue-600', 'from-gray-700 to-indigo-800'],\n 82: ['Heavy Showers', '🌧️', '🌧️', 'from-gray-600 to-blue-700', 'from-gray-700 to-indigo-900'],\n 95: ['Thunderstorm', '⛈️', '⛈️', 'from-gray-700 to-indigo-800', 'from-gray-800 to-indigo-950'],\n 96: ['Thunderstorm', '⛈️', '⛈️', 'from-gray-700 to-indigo-800', 'from-gray-800 to-indigo-950'],\n 99: ['Thunderstorm', '⛈️', '⛈️', 'from-gray-700 to-indigo-900', 'from-gray-800 to-indigo-950'],\n};\n\nconst getCondition = (code: number, isDay = true) => {\n const entry = WMO[code] || ['Unknown', '❓', '❓', 'from-gray-400 to-gray-500', 'from-gray-700 to-slate-800'];\n return [entry[0], isDay ? entry[1] : entry[2], isDay ? entry[3] : entry[4]] as [string, string, string];\n};\n\nconst AVAILABLE_CITIES: Record<string, { lat: number; lon: number }> = {\n 'Sydney': { lat: -33.8688, lon: 151.2093 },\n 'London': { lat: 51.5074, lon: -0.1278 },\n 'Los Angeles': { lat: 34.0522, lon: -118.2437 },\n 'Shanghai': { lat: 31.2304, lon: 121.4737 },\n 'New York': { lat: 40.7128, lon: -74.0060 },\n 'Tokyo': { lat: 35.6762, lon: 139.6503 },\n 'Dubai': { lat: 25.2048, lon: 55.2708 },\n 'Singapore': { lat: 1.3521, lon: 103.8198 },\n 'Hong Kong': { lat: 22.3193, lon: 114.1694 },\n 'Paris': { lat: 48.8566, lon: 2.3522 },\n 'Berlin': { lat: 52.5200, lon: 13.4050 },\n 'Mumbai': { lat: 19.0760, lon: 72.8777 },\n 'Bangkok': { lat: 13.7563, lon: 100.5018 },\n 'Melbourne': { lat: -37.8136, lon: 144.9631 },\n 'Toronto': { lat: 43.6532, lon: -79.3832 },\n 'Miami': { lat: 25.7617, lon: -80.1918 },\n 'Chicago': { lat: 41.8781, lon: -87.6298 },\n 'Auckland': { lat: -36.8485, lon: 174.7633 },\n};\n\nconst DEFAULT_CITIES = ['Sydney', 'London', 'Los Angeles', 'Shanghai'];\nconst STORAGE_KEY = 'weather_cities';\nconst SETTINGS_KEY = 'weather_appearance';\nconst CACHE_KEY = 'weather_multi_cache';\nconst CACHE_TTL = 30 * 60 * 1000;\n\ninterface CityWeather { city: string; temp: number; code: number; high: number; low: number; isDay: boolean; timezone: string }\ninterface WeatherPrefs { useFahrenheit: boolean; showLocalTime: boolean; use24Hour: boolean }\nconst DEFAULT_PREFS: WeatherPrefs = { useFahrenheit: false, showLocalTime: false, use24Hour: false };\n\nfunction loadCities(): string[] {\n try { const s = JSON.parse(localStorage.getItem(STORAGE_KEY) || ''); if (Array.isArray(s) && s.length) return s; } catch {}\n return DEFAULT_CITIES;\n}\n\nconst toF = (c: number) => Math.round(c * 9 / 5 + 32);\n\nfunction getTimeInTz(timezone: string, use24Hour = false): { hours: number; minutes: number; text: string } {\n try {\n const now = new Date();\n const h24Parts = new Intl.DateTimeFormat('en-US', { timeZone: timezone, hour: 'numeric', minute: '2-digit', hour12: false }).formatToParts(now);\n const h24 = parseInt(h24Parts.find(p => p.type === 'hour')?.value || '0');\n const m = parseInt(h24Parts.find(p => p.type === 'minute')?.value || '0');\n if (use24Hour) {\n return { hours: h24, minutes: m, text: `${String(h24).padStart(2, '0')}:${String(m).padStart(2, '0')}` };\n }\n const parts = new Intl.DateTimeFormat('en-US', { timeZone: timezone, hour: 'numeric', minute: '2-digit', hour12: true }).formatToParts(now);\n const h12 = parseInt(parts.find(p => p.type === 'hour')?.value || '12');\n const period = parts.find(p => p.type === 'dayPeriod')?.value || '';\n return { hours: h24, minutes: m, text: `${h12}:${String(m).padStart(2, '0')} ${period}` };\n } catch { return { hours: 0, minutes: 0, text: '' }; }\n}\n\n/** Tiny analog clock SVG */\nfunction MiniClock({ hours, minutes, size = 20 }: { hours: number; minutes: number; size?: number }) {\n const r = size / 2;\n const hAngle = ((hours % 12) + minutes / 60) * 30 - 90;\n const mAngle = minutes * 6 - 90;\n const hRad = (hAngle * Math.PI) / 180;\n const mRad = (mAngle * Math.PI) / 180;\n const hLen = r * 0.5;\n const mLen = r * 0.7;\n return (\n <svg width={size} height={size} className=\"shrink-0\">\n <circle cx={r} cy={r} r={r - 1} fill=\"rgba(255,255,255,0.15)\" stroke=\"rgba(255,255,255,0.4)\" strokeWidth={1} />\n {/* Hour hand */}\n <line x1={r} y1={r} x2={r + Math.cos(hRad) * hLen} y2={r + Math.sin(hRad) * hLen}\n stroke=\"white\" strokeWidth={1.5} strokeLinecap=\"round\" />\n {/* Minute hand */}\n <line x1={r} y1={r} x2={r + Math.cos(mRad) * mLen} y2={r + Math.sin(mRad) * mLen}\n stroke=\"white\" strokeWidth={1} strokeLinecap=\"round\" />\n {/* Center dot */}\n <circle cx={r} cy={r} r={1} fill=\"white\" />\n </svg>\n );\n}\n\nexport default function Weather() {\n const [cities, setCities] = useState(loadCities);\n const [appearance, setAppearance] = useState(() => loadAppearance(SETTINGS_KEY));\n const [data, setData] = useState<CityWeather[]>([]);\n const [loading, setLoading] = useState(true);\n // Tick every minute so clocks update\n const [, setTick] = useState(0);\n useEffect(() => { const t = setInterval(() => setTick(n => n + 1), 60000); return () => clearInterval(t); }, []);\n const [settingsOpen, setSettingsOpen] = useState(false);\n const [configCities, setConfigCities] = useState<string[]>([]);\n const [configAppearance, setConfigAppearance] = useState<WidgetAppearance>(appearance);\n // Prefs live in the consumer-supplied prefs adapter so they persist\n // reliably across re-mounts without the local useState/localStorage dance.\n const { prefs: shellPrefs, save: saveShellPrefs } = useShellPrefs();\n const prefs: WeatherPrefs = { ...DEFAULT_PREFS, ...(shellPrefs.weather_prefs as WeatherPrefs | undefined ?? {}) };\n const [configPrefs, setConfigPrefs] = useState<WeatherPrefs>(prefs);\n\n useWidgetSettings(useCallback(() => {\n setConfigCities([...cities]);\n setConfigAppearance({ ...appearance });\n setConfigPrefs({ ...prefs });\n setSettingsOpen(true);\n }, [cities, appearance, prefs]));\n\n const fetchAll = useCallback(async (cityList: string[], force = false) => {\n if (!force) {\n try {\n const cached = JSON.parse(localStorage.getItem(CACHE_KEY) || '{}');\n const key = cityList.join(',');\n if (cached[key] && Date.now() - cached[key].ts < CACHE_TTL) {\n setData(cached[key].data); setLoading(false); return;\n }\n } catch {}\n }\n setLoading(true);\n const results: CityWeather[] = [];\n for (const city of cityList) {\n const coords = AVAILABLE_CITIES[city];\n if (!coords) continue;\n try {\n const res = await fetch(`https://api.open-meteo.com/v1/forecast?latitude=${coords.lat}&longitude=${coords.lon}¤t=temperature_2m,weather_code,is_day&daily=temperature_2m_max,temperature_2m_min&forecast_days=1&timezone=auto`);\n const w = await res.json();\n results.push({ city, temp: Math.round(w.current.temperature_2m), code: w.current.weather_code, high: Math.round(w.daily.temperature_2m_max[0]), low: Math.round(w.daily.temperature_2m_min[0]), isDay: w.current.is_day === 1, timezone: w.timezone || 'UTC' });\n } catch {}\n }\n setData(results); setLoading(false);\n try { const c = JSON.parse(localStorage.getItem(CACHE_KEY) || '{}'); c[cityList.join(',')] = { data: results, ts: Date.now() }; localStorage.setItem(CACHE_KEY, JSON.stringify(c)); } catch {}\n }, []);\n\n useEffect(() => { fetchAll(cities); }, [cities, fetchAll]);\n\n const saveSettings = () => {\n if (configCities.length === 0) return;\n setCities(configCities);\n setAppearance(configAppearance);\n saveShellPrefs({ weather_prefs: configPrefs });\n localStorage.setItem(STORAGE_KEY, JSON.stringify(configCities));\n localStorage.setItem(SETTINGS_KEY, JSON.stringify(configAppearance));\n setSettingsOpen(false);\n };\n\n const t = (c: number) => prefs.useFahrenheit ? `${toF(c)}°F` : `${c}°`;\n\n if (loading && data.length === 0) {\n return <div className=\"flex items-center justify-center h-full bg-gradient-to-b from-sky-400 to-blue-500 rounded-lg text-white/70 text-sm\">Loading...</div>;\n }\n\n // Cards are ~88 px tall (px-4 py-3 + 2 stacked text rows) + 8 px gap. Add\n // 16 px for the panel's own p-2 padding so the widget never collapses below\n // its rendered height.\n const dynamicHeight = data.length * 96 + 16;\n\n return (\n <>\n {/* Outer panel sets the user-tunable translucency via background alpha\n * (NOT `opacity`, which would also fade the row colors into gray) and\n * carries the rounded clip. Rows fill the panel edge-to-edge so each\n * city's day/night gradient reads at full saturation. */}\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})`, // slate-900 with alpha\n backdropFilter: appearance.activeBlur > 0 ? `blur(${appearance.activeBlur}px)` : undefined,\n }}>\n {/* iOS-style city cards — each its own rounded tile sitting on the\n * panel's slate backdrop so the day/night gradient pops. Layout:\n * city + time on top-left, large temperature on top-right,\n * condition + H/L on the bottom row. */}\n <div className=\"flex-1 flex flex-col gap-2 p-2\">\n {data.map(d => {\n const [condition] = getCondition(d.code, d.isDay);\n const rowBg = d.isDay\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 return (\n <div key={d.city} className={`rounded-2xl px-4 py-3 flex flex-col justify-between gap-3 ${rowBg}`}>\n <div className=\"flex items-start justify-between gap-2\">\n <div className=\"min-w-0 flex-1\">\n <div className=\"text-lg font-semibold leading-tight truncate\">{d.city}</div>\n {prefs.showLocalTime && (\n <div className=\"text-xs opacity-90 mt-0.5 tabular-nums\">\n {getTimeInTz(d.timezone, prefs.use24Hour).text}\n </div>\n )}\n </div>\n <div className=\"text-4xl font-extralight leading-none tracking-tight tabular-nums shrink-0\">\n {t(d.temp)}\n </div>\n </div>\n <div className=\"flex items-end justify-between text-[11px]\">\n <span className=\"opacity-95\">{condition}</span>\n <span className=\"opacity-90 tabular-nums\">H:{t(d.high)} L:{t(d.low)}</span>\n </div>\n </div>\n );\n })}\n </div>\n </div>\n\n <WidgetSettingsModal open={settingsOpen} onClose={() => setSettingsOpen(false)} title=\"Weather Settings\"\n appearance={configAppearance} onAppearanceChange={setConfigAppearance} onSave={saveSettings}>\n <div className=\"space-y-3\">\n <div>\n <h3 className=\"text-sm font-semibold text-gray-700 mb-2\">Display</h3>\n <div className=\"flex items-center gap-3 mb-2\">\n <span className=\"text-sm text-gray-600 w-24\">Temperature</span>\n <div className=\"flex gap-1\">\n {([{ key: false, label: '°C' }, { key: true, label: '°F' }] as const).map(o => (\n <button key={String(o.key)} onClick={() => setConfigPrefs(p => ({ ...p, useFahrenheit: o.key }))}\n className={`px-3 py-1 text-xs font-medium rounded-lg border transition-colors ${configPrefs.useFahrenheit === o.key ? 'bg-blue-600 text-white border-blue-600' : 'bg-white text-gray-700 border-gray-300 hover:bg-gray-50'}`}>\n {o.label}\n </button>\n ))}\n </div>\n </div>\n <div className=\"flex items-center gap-3 mb-2\">\n <span className=\"text-sm text-gray-600 w-24\">Time Format</span>\n <div className=\"flex gap-1\">\n {([{ key: false, label: 'AM/PM' }, { key: true, label: '24H' }] as const).map(o => (\n <button key={String(o.key)} onClick={() => setConfigPrefs(p => ({ ...p, use24Hour: o.key }))}\n className={`px-3 py-1 text-xs font-medium rounded-lg border transition-colors ${configPrefs.use24Hour === o.key ? 'bg-blue-600 text-white border-blue-600' : 'bg-white text-gray-700 border-gray-300 hover:bg-gray-50'}`}>\n {o.label}\n </button>\n ))}\n </div>\n </div>\n <label className=\"flex items-center gap-2 cursor-pointer\">\n <input type=\"checkbox\" checked={configPrefs.showLocalTime} onChange={e => setConfigPrefs(p => ({ ...p, showLocalTime: e.target.checked }))}\n className=\"rounded border-gray-300 text-blue-600 h-3.5 w-3.5\" />\n <span className=\"text-sm text-gray-600\">Show local time</span>\n </label>\n </div>\n </div>\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-48 overflow-y-auto\">\n {Object.keys(AVAILABLE_CITIES).map(city => (\n <label key={city} className=\"flex items-center gap-2 text-sm py-1 cursor-pointer hover:bg-gray-50 rounded px-2\">\n <input type=\"checkbox\" checked={configCities.includes(city)}\n onChange={() => setConfigCities(prev => prev.includes(city) ? prev.filter(c => c !== city) : [...prev, city])}\n className=\"rounded border-gray-300 text-blue-600 focus:ring-blue-500 h-3.5 w-3.5\" />\n {city}\n </label>\n ))}\n </div>\n </div>\n </WidgetSettingsModal>\n </>\n );\n}\n"]}
|
package/dist/apps/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import { lazy } from 'react';
|
|
|
8
8
|
|
|
9
9
|
var Calculator = lazy(() => import('../Calculator-OHL2AZ52.js'));
|
|
10
10
|
var Spreadsheet = lazy(() => import('../Spreadsheet-FCFII6DW.js'));
|
|
11
|
-
var Weather = lazy(() => import('../Weather-
|
|
11
|
+
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'));
|
package/dist/index.js
CHANGED
|
@@ -516,91 +516,100 @@ function BugReportProvider({ children }) {
|
|
|
516
516
|
const isBug = reportType === "bug";
|
|
517
517
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
518
518
|
children,
|
|
519
|
-
/* @__PURE__ */ jsxs(
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
519
|
+
/* @__PURE__ */ jsxs(
|
|
520
|
+
Dialog,
|
|
521
|
+
{
|
|
522
|
+
open,
|
|
523
|
+
onClose: annotating ? () => {
|
|
524
|
+
} : handleCancel,
|
|
525
|
+
className: "relative z-[9999]",
|
|
526
|
+
children: [
|
|
527
|
+
/* @__PURE__ */ jsx(DialogBackdrop, { className: "fixed inset-0 bg-black/40" }),
|
|
528
|
+
/* @__PURE__ */ jsx("div", { className: "fixed inset-0 flex items-center justify-center p-4", children: /* @__PURE__ */ jsxs(DialogPanel, { className: "w-full max-w-2xl rounded-lg bg-white p-6 shadow-xl", children: [
|
|
529
|
+
/* @__PURE__ */ jsx(DialogTitle, { className: "text-base font-semibold text-gray-900", children: "Suggestion or Bug" }),
|
|
530
|
+
/* @__PURE__ */ jsx("p", { className: "mt-1 text-xs text-gray-500", children: "A screenshot of your current view will be sent to the admin team." }),
|
|
531
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-4 inline-flex rounded-lg border border-gray-300 bg-gray-50 p-0.5", children: [
|
|
532
|
+
/* @__PURE__ */ jsx(
|
|
533
|
+
"button",
|
|
534
|
+
{
|
|
535
|
+
type: "button",
|
|
536
|
+
onClick: () => setReportType("bug"),
|
|
537
|
+
className: `px-3 py-1 text-sm font-medium rounded-md transition-colors ${isBug ? "bg-white text-gray-900 shadow-sm" : "text-gray-600 hover:text-gray-900"}`,
|
|
538
|
+
children: "Bug"
|
|
539
|
+
}
|
|
540
|
+
),
|
|
541
|
+
/* @__PURE__ */ jsx(
|
|
542
|
+
"button",
|
|
543
|
+
{
|
|
544
|
+
type: "button",
|
|
545
|
+
onClick: () => setReportType("suggestion"),
|
|
546
|
+
className: `px-3 py-1 text-sm font-medium rounded-md transition-colors ${!isBug ? "bg-white text-gray-900 shadow-sm" : "text-gray-600 hover:text-gray-900"}`,
|
|
547
|
+
children: "Suggestion"
|
|
548
|
+
}
|
|
549
|
+
)
|
|
550
|
+
] }),
|
|
551
|
+
previewUrl && /* @__PURE__ */ jsxs("div", { className: "mt-4", children: [
|
|
552
|
+
/* @__PURE__ */ jsxs("div", { className: "relative rounded-md border border-gray-200 overflow-hidden bg-gray-50 max-h-64", children: [
|
|
553
|
+
/* @__PURE__ */ jsx("img", { src: previewUrl, alt: "Screenshot preview", className: "w-full h-auto max-h-64 object-contain" }),
|
|
554
|
+
/* @__PURE__ */ jsxs(
|
|
555
|
+
"button",
|
|
556
|
+
{
|
|
557
|
+
type: "button",
|
|
558
|
+
onClick: () => setAnnotating(true),
|
|
559
|
+
className: "absolute top-2 right-2 inline-flex items-center gap-1 px-2.5 py-1 rounded-md bg-white/95 backdrop-blur border border-gray-200 shadow-sm text-xs font-medium text-gray-700 hover:bg-white",
|
|
560
|
+
title: "Mark up the screenshot \u2014 circle, arrow, mosaic, text\u2026",
|
|
561
|
+
children: [
|
|
562
|
+
/* @__PURE__ */ jsx("svg", { className: "h-3.5 w-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.7, children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L6.832 19.82a4.5 4.5 0 01-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 011.13-1.897L16.863 4.487zm0 0L19.5 7.125" }) }),
|
|
563
|
+
"Annotate"
|
|
564
|
+
]
|
|
565
|
+
}
|
|
566
|
+
)
|
|
567
|
+
] }),
|
|
568
|
+
/* @__PURE__ */ jsx("p", { className: "mt-1 text-[11px] text-gray-400", children: "Click Annotate to mark up the screenshot before sending." })
|
|
569
|
+
] }),
|
|
570
|
+
!previewUrl && /* @__PURE__ */ jsx(UploadDropZone, { onSelect: (blob) => setScreenshot(blob) }),
|
|
571
|
+
/* @__PURE__ */ jsxs("label", { className: "mt-4 block text-sm font-medium text-gray-700", children: [
|
|
572
|
+
isBug ? "What went wrong?" : "What's your suggestion?",
|
|
573
|
+
/* @__PURE__ */ jsx("span", { className: "font-normal text-gray-400 ml-1", children: "(optional)" })
|
|
574
|
+
] }),
|
|
575
|
+
/* @__PURE__ */ jsx(
|
|
576
|
+
"textarea",
|
|
549
577
|
{
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
578
|
+
autoFocus: true,
|
|
579
|
+
value: description,
|
|
580
|
+
onChange: (e) => setDescription(e.target.value),
|
|
581
|
+
onKeyDown: (e) => {
|
|
582
|
+
if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) handleSubmit();
|
|
583
|
+
},
|
|
584
|
+
placeholder: isBug ? "Briefly describe the issue, what you were doing, what you expected to happen\u2026" : "Briefly describe what would make this better\u2026",
|
|
585
|
+
rows: 3,
|
|
586
|
+
className: "mt-1 w-full rounded-md border border-gray-300 px-3 py-2 text-sm focus:border-blue-500 focus:ring-1 focus:ring-blue-500 focus:outline-none resize-none"
|
|
558
587
|
}
|
|
559
|
-
)
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
}
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
"button",
|
|
585
|
-
{
|
|
586
|
-
type: "button",
|
|
587
|
-
onClick: handleCancel,
|
|
588
|
-
className: "bg-white text-gray-700 border border-gray-300 px-4 py-2 text-sm font-medium rounded-lg hover:bg-gray-50",
|
|
589
|
-
children: "Cancel"
|
|
590
|
-
}
|
|
591
|
-
),
|
|
592
|
-
/* @__PURE__ */ jsx(
|
|
593
|
-
"button",
|
|
594
|
-
{
|
|
595
|
-
type: "button",
|
|
596
|
-
onClick: handleSubmit,
|
|
597
|
-
className: "bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 text-sm font-medium rounded-lg",
|
|
598
|
-
children: "Send"
|
|
599
|
-
}
|
|
600
|
-
)
|
|
601
|
-
] })
|
|
602
|
-
] }) })
|
|
603
|
-
] }),
|
|
588
|
+
),
|
|
589
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-6 flex justify-end gap-3", children: [
|
|
590
|
+
/* @__PURE__ */ jsx(
|
|
591
|
+
"button",
|
|
592
|
+
{
|
|
593
|
+
type: "button",
|
|
594
|
+
onClick: handleCancel,
|
|
595
|
+
className: "bg-white text-gray-700 border border-gray-300 px-4 py-2 text-sm font-medium rounded-lg hover:bg-gray-50",
|
|
596
|
+
children: "Cancel"
|
|
597
|
+
}
|
|
598
|
+
),
|
|
599
|
+
/* @__PURE__ */ jsx(
|
|
600
|
+
"button",
|
|
601
|
+
{
|
|
602
|
+
type: "button",
|
|
603
|
+
onClick: handleSubmit,
|
|
604
|
+
className: "bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 text-sm font-medium rounded-lg",
|
|
605
|
+
children: "Send"
|
|
606
|
+
}
|
|
607
|
+
)
|
|
608
|
+
] })
|
|
609
|
+
] }) })
|
|
610
|
+
]
|
|
611
|
+
}
|
|
612
|
+
),
|
|
604
613
|
annotating && previewUrl && /* @__PURE__ */ jsx(
|
|
605
614
|
BugReportAnnotator,
|
|
606
615
|
{
|
|
@@ -615,6 +624,50 @@ function BugReportProvider({ children }) {
|
|
|
615
624
|
] });
|
|
616
625
|
}
|
|
617
626
|
var LazyImageAnnotator = lazy(() => import('./ImageAnnotator-CTTMAY5Z.js'));
|
|
627
|
+
function UploadDropZone({ onSelect }) {
|
|
628
|
+
const inputRef = useRef(null);
|
|
629
|
+
const [hover, setHover] = useState(false);
|
|
630
|
+
const accept = (file) => {
|
|
631
|
+
if (!file) return;
|
|
632
|
+
if (!file.type.startsWith("image/")) return;
|
|
633
|
+
onSelect(file);
|
|
634
|
+
};
|
|
635
|
+
return /* @__PURE__ */ jsxs(
|
|
636
|
+
"div",
|
|
637
|
+
{
|
|
638
|
+
onClick: () => inputRef.current?.click(),
|
|
639
|
+
onDragOver: (e) => {
|
|
640
|
+
e.preventDefault();
|
|
641
|
+
setHover(true);
|
|
642
|
+
},
|
|
643
|
+
onDragLeave: () => setHover(false),
|
|
644
|
+
onDrop: (e) => {
|
|
645
|
+
e.preventDefault();
|
|
646
|
+
setHover(false);
|
|
647
|
+
accept(e.dataTransfer.files?.[0]);
|
|
648
|
+
},
|
|
649
|
+
className: `mt-4 rounded-md border border-dashed px-4 py-6 text-center text-sm cursor-pointer transition-colors ${hover ? "border-blue-400 bg-blue-50 text-blue-700" : "border-gray-300 text-gray-500 hover:border-gray-400 hover:bg-gray-50"}`,
|
|
650
|
+
children: [
|
|
651
|
+
/* @__PURE__ */ jsx("p", { className: "text-gray-700 font-medium", children: "Screenshot capture failed" }),
|
|
652
|
+
/* @__PURE__ */ jsxs("p", { className: "mt-1 text-xs text-gray-500", children: [
|
|
653
|
+
"Drop an image here, or ",
|
|
654
|
+
/* @__PURE__ */ jsx("span", { className: "text-blue-600 underline", children: "click to upload" }),
|
|
655
|
+
". Your description will be sent either way."
|
|
656
|
+
] }),
|
|
657
|
+
/* @__PURE__ */ jsx(
|
|
658
|
+
"input",
|
|
659
|
+
{
|
|
660
|
+
ref: inputRef,
|
|
661
|
+
type: "file",
|
|
662
|
+
accept: "image/*",
|
|
663
|
+
onChange: (e) => accept(e.target.files?.[0]),
|
|
664
|
+
className: "hidden"
|
|
665
|
+
}
|
|
666
|
+
)
|
|
667
|
+
]
|
|
668
|
+
}
|
|
669
|
+
);
|
|
670
|
+
}
|
|
618
671
|
function BugReportAnnotator({
|
|
619
672
|
src,
|
|
620
673
|
onApply,
|
|
@@ -805,7 +858,7 @@ function StatusBadge({ status }) {
|
|
|
805
858
|
}
|
|
806
859
|
|
|
807
860
|
// src/version.ts
|
|
808
|
-
var VERSION = "0.2.
|
|
861
|
+
var VERSION = "0.2.36" ;
|
|
809
862
|
var APP_VERSION = VERSION;
|
|
810
863
|
|
|
811
864
|
// src/changelog.ts
|