@circadian/sol 0.2.6 → 0.2.8
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 +4 -0
- package/dist/devtools/index.js +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/{solar-theme-provider-BWHxbh0l.js → solar-theme-provider-6-EJ4jGB.js} +23 -11
- package/dist/{solar-theme-provider-BWHxbh0l.js.map → solar-theme-provider-6-EJ4jGB.js.map} +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -366,6 +366,7 @@ The slim pill/bar variant. Accepts an optional `design` prop to override the pro
|
|
|
366
366
|
| `showFlag` | `boolean` | `false` | Show country flag |
|
|
367
367
|
| `showTemperature` | `boolean` | `true` | Show live temperature |
|
|
368
368
|
| `overridePhase` | `SolarPhase \| null` | — | Force a discrete phase |
|
|
369
|
+
| `weatherCategoryOverride` | `WeatherCategory \| null` | — | Force a weather category for preview |
|
|
369
370
|
| `customPalettes` | `CustomPalettes` | — | Override bg gradient per phase |
|
|
370
371
|
| `simulatedDate` | `Date` | — | Simulate a time |
|
|
371
372
|
| `className` | `string` | — | Wrapper CSS class |
|
|
@@ -411,6 +412,9 @@ Supported positions: `top-left` `top-center` `top-right` `center-left` `center`
|
|
|
411
412
|
|
|
412
413
|
// Force a category for preview
|
|
413
414
|
<SolarWidget showWeather weatherCategoryOverride="thunder" />
|
|
415
|
+
|
|
416
|
+
// Works on CompactWidget too
|
|
417
|
+
<CompactWidget showWeather weatherCategoryOverride="thunder" />
|
|
414
418
|
```
|
|
415
419
|
|
|
416
420
|
Powered by [Open-Meteo](https://open-meteo.com/) — free, no API key. Available categories: `clear` `partly-cloudy` `overcast` `fog` `drizzle` `rain` `heavy-rain` `snow` `heavy-snow` `thunder`
|
package/dist/devtools/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as getSessionIsLive, c as setSessionTimeMinutes, i as clearSessionTimeMinutes, n as useSolarTheme, o as getSessionTimeMinutes, s as setSessionLive } from "../solar-theme-provider-
|
|
1
|
+
import { a as getSessionIsLive, c as setSessionTimeMinutes, i as clearSessionTimeMinutes, n as useSolarTheme, o as getSessionTimeMinutes, s as setSessionLive } from "../solar-theme-provider-6-EJ4jGB.js";
|
|
2
2
|
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { createPortal } from "react-dom";
|
package/dist/index.d.ts
CHANGED
|
@@ -115,6 +115,7 @@ interface CompactWidgetProps {
|
|
|
115
115
|
flag?: string;
|
|
116
116
|
temperature?: string;
|
|
117
117
|
weather?: WeatherCategory$1 | null;
|
|
118
|
+
weatherCategoryOverride?: WeatherCategory$1 | null;
|
|
118
119
|
showFlag?: boolean;
|
|
119
120
|
showWeather?: boolean;
|
|
120
121
|
showTemperature?: boolean;
|
|
@@ -137,6 +138,7 @@ declare function CompactWidget({
|
|
|
137
138
|
flag,
|
|
138
139
|
temperature,
|
|
139
140
|
weather,
|
|
141
|
+
weatherCategoryOverride,
|
|
140
142
|
showFlag,
|
|
141
143
|
showWeather,
|
|
142
144
|
showTemperature,
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/hooks/useSolarPosition.tsx","../src/widgets/solar-widget.shell.tsx","../src/widgets/compact-widget.shell.tsx","../src/skins/types/widget-skin.types.ts","../src/provider/solar-theme-provider.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;AAgBA;AAWA;AAWA;AAmBA;;UAzCiB,UAAA;;ECQL,OAAA,EAAA,MAAA;EAWA,SAAA,EAAA,MAAU;EAEV,MAAA,EAAA,MAAA;EAYA;EAAgC,SAAA,EAAA,MAAA;EAAP;EAAR,SAAA,EAAA,MAAA;;AAiFZ,KDvGL,UAAA,GCuGqB,OAAA,GAAA,MAAA,GAAA,SAAA,GAAA,SAAA,GAAA,YAAA,GAAA,WAAA,GAAA,QAAA,GAAA,MAAA,GAAA,UAAA;AACb,UD7FH,aAAA,CC6FG;EACX;EAIU,QAAA,EAAA,MAAA;EACD;EACU,OAAA,EAAA,MAAA;EAGV;EAAI,WAAA,EAAA,MAAA;EAyBN;EACd,aAAA,EAAA,MAAA;EACA;EACA,SAAA,EAAA,OAAA;EACA;EACA,KAAA,EDzHO,UCyHP;EACA;EACA,KAAA,EDzHO,UCyHP;EACA;EACe,YAAA,EAAA,MAAA;;AAEd,UDxHc,UAAA,CCwHd;EAAgB,KAAA,EDvHV,UCuHU;EAAA,SAAA,EDtHN,UCsHM;;;;;;KAzJP,eAAA;KAWA,UAAA;ADnBK,KCqBL,eAAA,GDrBe,OAAA,GAAA,eAAA,GAAA,UAAA,GAAA,KAAA,GAAA,SAAA,GAAA,MAAA,GAAA,YAAA,GAAA,MAAA,GAAA,YAAA,GAAA,SAAA;AAWf,KCsBA,cAAA,GAAiB,ODtBP,CCsBe,MDtBf,CCsBsB,UDtBtB,EAAA;EAWL,EAAA,EAAA,CAAA,MAAA,EAAA,MAAa,EAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/hooks/useSolarPosition.tsx","../src/widgets/solar-widget.shell.tsx","../src/widgets/compact-widget.shell.tsx","../src/skins/types/widget-skin.types.ts","../src/provider/solar-theme-provider.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;AAgBA;AAWA;AAWA;AAmBA;;UAzCiB,UAAA;;ECQL,OAAA,EAAA,MAAA;EAWA,SAAA,EAAA,MAAU;EAEV,MAAA,EAAA,MAAA;EAYA;EAAgC,SAAA,EAAA,MAAA;EAAP;EAAR,SAAA,EAAA,MAAA;;AAiFZ,KDvGL,UAAA,GCuGqB,OAAA,GAAA,MAAA,GAAA,SAAA,GAAA,SAAA,GAAA,YAAA,GAAA,WAAA,GAAA,QAAA,GAAA,MAAA,GAAA,UAAA;AACb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ACb;;EAKD,aAAA,EG1EF,IH0EE,GAAA,SAAA;EACD,gBAAA,EAAA,CAAA,IAAA,EG1ES,IH0ET,GAAA,SAAA,EAAA,GAAA,IAAA;EACU;EAGV,cAAA,EG5EA,cH4EA,GAAA,SAAA;EAAI,iBAAA,EAAA,CAAA,QAAA,EG3EU,cH2EV,GAAA,SAAA,EAAA,GAAA,IAAA;AAyBtB;AACE,iBG+Gc,aAAA,CAAA,CH/Gd,EG+G+B,UH/G/B;UGqHQ,KAAA,CHpHR;EACA,QAAA,EGoHU,SHpHV;EACA,aAAA,CAAA,EGoHgB,UHpHhB;EACA;;;;;;EAMC,QAAA,CAAA,EAAA,OAAA;;AAAgB,iBGuHH,kBAAA,CHvHG;EAAA,QAAA;EAAA,aAAA;EAAA;AAAA,CAAA,EG2HhB,KH3HgB,CAAA,EG2HX,kBAAA,CAAA,GAAA,CAAA,OH3HW"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as lerpHex, n as useSolarTheme, r as SKINS, t as SolarThemeProvider } from "./solar-theme-provider-
|
|
1
|
+
import { l as lerpHex, n as useSolarTheme, r as SKINS, t as SolarThemeProvider } from "./solar-theme-provider-6-EJ4jGB.js";
|
|
2
2
|
import { useEffect, useLayoutEffect, useMemo, useState } from "react";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
|
|
@@ -223,7 +223,7 @@ function blendPalette(skin, blend) {
|
|
|
223
223
|
mode: from.mode
|
|
224
224
|
};
|
|
225
225
|
}
|
|
226
|
-
function CompactWidget({ design: designOverride, overridePhase, time, location = "", flag, temperature, weather = null, showFlag = false, showWeather = false, showTemperature = true, size = "md", latitude, longitude, timezone, customPalettes, simulatedDate: simulatedDateProp, className = "" }) {
|
|
226
|
+
function CompactWidget({ design: designOverride, overridePhase, time, location = "", flag, temperature, weather = null, weatherCategoryOverride, showFlag = false, showWeather = false, showTemperature = true, size = "md", latitude, longitude, timezone, customPalettes, simulatedDate: simulatedDateProp, className = "" }) {
|
|
227
227
|
const [mounted, setMounted] = useState(false);
|
|
228
228
|
useLayoutEffect(() => setMounted(true), []);
|
|
229
229
|
const ctx = useSolarTheme();
|
|
@@ -262,7 +262,7 @@ function CompactWidget({ design: designOverride, overridePhase, time, location =
|
|
|
262
262
|
const resolvedLon = longitude ?? ctx.longitude;
|
|
263
263
|
const resolvedTz = timezone ?? ctx.timezone;
|
|
264
264
|
const liveWeather = useWeatherData(resolvedLat ?? null, resolvedLon ?? null);
|
|
265
|
-
const liveWeatherCategory = showWeather ? weather ?? liveWeather?.category ?? null : null;
|
|
265
|
+
const liveWeatherCategory = showWeather ? weatherCategoryOverride ?? weather ?? liveWeather?.category ?? null : null;
|
|
266
266
|
const liveTemperatureC = liveWeather?.temperatureC ?? null;
|
|
267
267
|
const props = {
|
|
268
268
|
phase,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["WMO_MAP: Record<number, WeatherCategory>","fetchWeather","WMO_MAP","useWeatherData","finalPalette: WidgetPalette","opts: Intl.DateTimeFormatOptions","liveWeatherCategory: WeatherCategory | null","liveTemperatureC: number | null","WMO_MAP: Record<number, WeatherCategory>","palette: WidgetPalette","liveWeatherCategory: WeatherCategory | null","liveTemperatureC: number | null","props: CompactSkinProps","opts: Intl.DateTimeFormatOptions"],"sources":["../src/widgets/solar-widget.shell.tsx","../src/widgets/compact-widget.shell.tsx"],"sourcesContent":["'use client';\n\n/**\n * widgets/solar-widget.shell.tsx (skin-aware shell)\n *\n * Weather fetch is now centralised here alongside the compact shell:\n * - Fetches temperature + weather_code from open-meteo once per mount\n * - Resolves liveWeatherCategory: weatherCategoryOverride ?? live category\n * - Passes liveWeatherCategory + liveTemperatureC down to skin components\n * - Skins should prefer these props over running their own fetch\n *\n * simulatedDate prop wins over ctx.simulatedDate (set by SolarDevTools),\n * which wins over undefined (live time). This means the devtools timeline\n * scrubber moves the orb in every widget without requiring any prop wiring.\n */\n\nimport { useEffect, useLayoutEffect, useMemo, useState } from 'react';\nimport type { SolarPhase } from '../hooks/useSolarPosition';\nimport { lerpHex } from '../lib/solar-lerp';\nimport { useSolarTheme } from '../provider/solar-theme-provider';\nimport type { DesignMode, WidgetPalette } from '../skins/types/widget-skin.types';\n\n// ─── Re-exported types ────────────────────────────────────────────────────────\n\nexport type ExpandDirection =\n | 'top-left'\n | 'top-center'\n | 'top-right'\n | 'center-left'\n | 'center'\n | 'center-right'\n | 'bottom-left'\n | 'bottom-center'\n | 'bottom-right';\n\nexport type WidgetSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n\nexport type WeatherCategory =\n | 'clear'\n | 'partly-cloudy'\n | 'overcast'\n | 'fog'\n | 'drizzle'\n | 'rain'\n | 'heavy-rain'\n | 'snow'\n | 'heavy-snow'\n | 'thunder';\n\nexport type CustomPalettes = Partial<Record<SolarPhase, { bg: [string, string, string] }>>;\n\nimport { SKINS } from '../skins/index';\nexport const PALETTES = SKINS.foundry.widgetPalettes;\n\n// ─── WMO weather code map ─────────────────────────────────────────────────────\n\nconst WMO_MAP: Record<number, WeatherCategory> = {\n 0: 'clear',\n 1: 'clear',\n 2: 'partly-cloudy',\n 3: 'overcast',\n 45: 'fog',\n 48: 'fog',\n 51: 'drizzle',\n 53: 'drizzle',\n 55: 'drizzle',\n 61: 'rain',\n 63: 'rain',\n 65: 'heavy-rain',\n 71: 'snow',\n 73: 'snow',\n 75: 'heavy-snow',\n 80: 'rain',\n 82: 'heavy-rain',\n 85: 'snow',\n 86: 'heavy-snow',\n 95: 'thunder',\n 96: 'thunder',\n 99: 'thunder',\n};\n\ninterface LiveWeather {\n temperatureC: number;\n category: WeatherCategory;\n}\n\nasync function fetchWeather(lat: number, lon: number): Promise<LiveWeather> {\n const url = new URL('https://api.open-meteo.com/v1/forecast');\n url.searchParams.set('latitude', String(lat));\n url.searchParams.set('longitude', String(lon));\n url.searchParams.set('current', 'temperature_2m,weather_code');\n url.searchParams.set('forecast_days', '1');\n const data = (await fetch(url.toString()).then((r) => r.json())) as {\n current: { temperature_2m: number; weather_code: number };\n };\n return {\n temperatureC: Math.round(data.current.temperature_2m),\n category: WMO_MAP[data.current.weather_code] ?? 'clear',\n };\n}\n\nfunction useWeatherData(lat: number | null, lon: number | null) {\n const [weather, setWeather] = useState<LiveWeather | null>(null);\n useEffect(() => {\n if (!lat || !lon) return;\n let dead = false;\n fetchWeather(lat, lon)\n .then((w) => {\n if (!dead) setWeather(w);\n })\n .catch(() => {});\n const id = setInterval(\n () =>\n fetchWeather(lat, lon)\n .then((w) => {\n if (!dead) setWeather(w);\n })\n .catch(() => {}),\n 30 * 60 * 1000,\n );\n return () => {\n dead = true;\n clearInterval(id);\n };\n }, [lat, lon]);\n return weather;\n}\n\n// ─── Widget props ─────────────────────────────────────────────────────────────\n\nexport interface SolarWidgetProps {\n expandDirection?: ExpandDirection;\n size?: WidgetSize;\n showFlag?: boolean;\n showWeather?: boolean;\n hoverEffect?: boolean;\n customPalettes?: CustomPalettes;\n phaseOverride?: SolarPhase;\n weatherCategoryOverride?: WeatherCategory | null;\n /** Explicit simulated date. Falls back to ctx.simulatedDate (from SolarDevTools)\n * then to real current time. */\n simulatedDate?: Date;\n /** Lock the widget state: `true` = always expanded, `false` = always collapsed.\n * Omit or pass `undefined` for default localStorage-driven behaviour. */\n forceExpanded?: boolean;\n}\n\n// ─── Palette blending helper ──────────────────────────────────────────────────\n\nfunction blendWidgetPalette(from: WidgetPalette, to: WidgetPalette, t: number): WidgetPalette {\n return {\n bg: [\n lerpHex(from.bg[0], to.bg[0], t),\n lerpHex(from.bg[1], to.bg[1], t),\n lerpHex(from.bg[2], to.bg[2], t),\n ],\n textColor: lerpHex(from.textColor, to.textColor, t),\n accentColor: lerpHex(from.accentColor, to.accentColor, t),\n orb: lerpHex(from.orb, to.orb, t),\n outerGlow: from.outerGlow,\n mode: t < 0.5 ? from.mode : to.mode,\n };\n}\n\n// ─── Shell component ──────────────────────────────────────────────────────────\n\nexport function SolarWidget({\n expandDirection = 'bottom-right',\n size = 'lg',\n showFlag = false,\n showWeather = false,\n hoverEffect = false,\n customPalettes,\n phaseOverride,\n weatherCategoryOverride,\n simulatedDate: simulatedDateProp,\n forceExpanded,\n}: SolarWidgetProps) {\n const [mounted, setMounted] = useState(false);\n useLayoutEffect(() => setMounted(true), []);\n\n const {\n phase,\n blend,\n activeSkin,\n timezone,\n latitude,\n longitude,\n simulatedDate: ctxSimulatedDate,\n setCustomPalettes,\n } = useSolarTheme();\n\n // Register customPalettes into context so DevTools can read them\n useEffect(() => {\n setCustomPalettes(customPalettes);\n return () => setCustomPalettes(undefined);\n }, [customPalettes, setCustomPalettes]);\n\n // prop wins → context (devtools) → undefined (live)\n const simulatedDate = simulatedDateProp ?? ctxSimulatedDate;\n\n const [expanded, setExpanded] = useState(false);\n\n const activePhase = phaseOverride ?? phase;\n const activeBlend = phaseOverride\n ? { phase: phaseOverride, nextPhase: phaseOverride, t: 0 }\n : blend;\n\n const fromPalette = activeSkin.widgetPalettes[activeBlend.phase];\n const toPalette = activeSkin.widgetPalettes[activeBlend.nextPhase];\n\n const blendedPalette = useMemo(\n () => blendWidgetPalette(fromPalette, toPalette, activeBlend.t),\n [fromPalette, toPalette, activeBlend.t],\n );\n\n const finalPalette: WidgetPalette = useMemo(() => {\n if (!customPalettes?.[activePhase]) return blendedPalette;\n return { ...blendedPalette, bg: customPalettes[activePhase]?.bg };\n }, [blendedPalette, customPalettes, activePhase]);\n\n const time = useMemo(() => {\n const d = simulatedDate ?? new Date();\n const opts: Intl.DateTimeFormatOptions = {\n hour: '2-digit',\n minute: '2-digit',\n hourCycle: 'h23',\n };\n if (timezone) opts.timeZone = timezone;\n const parts = new Intl.DateTimeFormat('en-GB', opts).formatToParts(d);\n const hh = parts.find((p) => p.type === 'hour')?.value ?? '00';\n const mm = parts.find((p) => p.type === 'minute')?.value ?? '00';\n return `${hh}:${mm}`;\n }, [simulatedDate, timezone]);\n\n // ── Centralised weather fetch ────────────────────────────────────────────\n const liveWeather = useWeatherData(latitude ?? null, longitude ?? null);\n\n const liveWeatherCategory: WeatherCategory | null = showWeather\n ? (weatherCategoryOverride ?? liveWeather?.category ?? null)\n : null;\n\n const liveTemperatureC: number | null = liveWeather?.temperatureC ?? null;\n\n const SkinComponent = activeSkin.Component;\n\n return (\n <div style={{ visibility: mounted ? 'visible' : 'hidden' }}>\n <SkinComponent\n phase={activePhase}\n blend={activeBlend}\n expanded={expanded}\n onToggle={() => setExpanded((v) => !v)}\n expandDirection={expandDirection}\n size={size}\n time={time}\n location=\"\"\n showFlag={showFlag}\n showWeather={showWeather}\n hoverEffect={hoverEffect}\n weather={weatherCategoryOverride}\n liveWeatherCategory={liveWeatherCategory}\n liveTemperatureC={liveTemperatureC}\n palette={finalPalette}\n latitude={latitude}\n longitude={longitude}\n timezone={timezone}\n simulatedDate={simulatedDate}\n forceExpanded={forceExpanded}\n />\n </div>\n );\n}\n","'use client';\n\n/**\n * widgets/compact-widget.shell.tsx\n *\n * Shell for the compact solar widget — a slim pill/bar format.\n *\n * simulatedDate prop wins over ctx.simulatedDate (set by SolarDevTools),\n * which wins over undefined (live time). This means the devtools timeline\n * scrubber moves the orb in compact widgets without requiring any prop wiring.\n */\n\nimport { useEffect, useLayoutEffect, useMemo, useState } from 'react';\nimport type { SolarBlend, SolarPhase } from '../hooks/useSolarPosition';\nimport { lerpHex } from '../lib/solar-lerp';\nimport { useSolarTheme } from '../provider/solar-theme-provider';\nimport type { DesignMode, SkinDefinition, WidgetPalette } from '../skins/types/widget-skin.types';\nimport type { CustomPalettes } from './solar-widget.shell';\n\n// ─── Types ────────────────────────────────────────────────────────────────────\n\nexport type WeatherCategory =\n | 'clear'\n | 'partly-cloudy'\n | 'overcast'\n | 'fog'\n | 'drizzle'\n | 'rain'\n | 'heavy-rain'\n | 'snow'\n | 'heavy-snow'\n | 'thunder';\n\nexport type CompactSize = 'sm' | 'md' | 'lg';\n\n// ─── WMO weather code map ─────────────────────────────────────────────────────\n\nconst WMO_MAP: Record<number, WeatherCategory> = {\n 0: 'clear',\n 1: 'clear',\n 2: 'partly-cloudy',\n 3: 'overcast',\n 45: 'fog',\n 48: 'fog',\n 51: 'drizzle',\n 53: 'drizzle',\n 55: 'drizzle',\n 61: 'rain',\n 63: 'rain',\n 65: 'heavy-rain',\n 71: 'snow',\n 73: 'snow',\n 75: 'heavy-snow',\n 80: 'rain',\n 82: 'heavy-rain',\n 85: 'snow',\n 86: 'heavy-snow',\n 95: 'thunder',\n 96: 'thunder',\n 99: 'thunder',\n};\n\n// ─── Centralised weather fetch ────────────────────────────────────────────────\n\ninterface LiveWeather {\n temperatureC: number;\n category: WeatherCategory;\n}\n\nasync function fetchWeather(lat: number, lon: number): Promise<LiveWeather> {\n const url = new URL('https://api.open-meteo.com/v1/forecast');\n url.searchParams.set('latitude', String(lat));\n url.searchParams.set('longitude', String(lon));\n url.searchParams.set('current', 'temperature_2m,weather_code');\n url.searchParams.set('forecast_days', '1');\n const data = (await fetch(url.toString()).then((r) => r.json())) as {\n current: { temperature_2m: number; weather_code: number };\n };\n return {\n temperatureC: Math.round(data.current.temperature_2m),\n category: WMO_MAP[data.current.weather_code] ?? 'clear',\n };\n}\n\nfunction useWeatherData(lat: number | null, lon: number | null) {\n const [weather, setWeather] = useState<LiveWeather | null>(null);\n useEffect(() => {\n if (!lat || !lon) return;\n let dead = false;\n fetchWeather(lat, lon)\n .then((w) => {\n if (!dead) setWeather(w);\n })\n .catch(() => {});\n const id = setInterval(\n () =>\n fetchWeather(lat, lon)\n .then((w) => {\n if (!dead) setWeather(w);\n })\n .catch(() => {}),\n 30 * 60 * 1000,\n );\n return () => {\n dead = true;\n clearInterval(id);\n };\n }, [lat, lon]);\n return weather;\n}\n\n// ─── Props passed to every compact skin component ─────────────────────────────\n\nexport interface CompactSkinProps {\n phase: SolarPhase;\n blend: SolarBlend;\n time: string;\n location: string;\n flag?: string;\n temperature?: string;\n weather?: WeatherCategory | null;\n liveWeatherCategory: WeatherCategory | null;\n liveTemperatureC: number | null;\n latitude?: number | null;\n longitude?: number | null;\n timezone?: string | null;\n simulatedDate?: Date;\n showFlag: boolean;\n showWeather: boolean;\n showTemperature: boolean;\n size: CompactSize;\n palette: WidgetPalette;\n}\n\n// ─── Public props for the shell ───────────────────────────────────────────────\n\nexport interface CompactWidgetProps {\n design?: DesignMode;\n overridePhase?: SolarPhase | null;\n time?: string;\n location?: string;\n flag?: string;\n temperature?: string;\n weather?: WeatherCategory | null;\n showFlag?: boolean;\n showWeather?: boolean;\n showTemperature?: boolean;\n size?: CompactSize;\n latitude?: number | null;\n longitude?: number | null;\n timezone?: string | null;\n /** Override background colors per phase */\n customPalettes?: CustomPalettes;\n /** Explicit simulated date. Falls back to ctx.simulatedDate (from SolarDevTools)\n * then to real current time. */\n simulatedDate?: Date;\n className?: string;\n}\n\n// ─── Palette blending ─────────────────────────────────────────────────────────\n\nfunction blendPalette(skin: SkinDefinition, blend: SolarBlend): WidgetPalette {\n const from = skin.widgetPalettes[blend.phase];\n const to = skin.widgetPalettes[blend.nextPhase];\n const t = blend.t;\n if (t === 0) return from;\n const lerp = (a: string, b: string) => lerpHex(a, b, t);\n return {\n bg: [lerp(from.bg[0], to.bg[0]), lerp(from.bg[1], to.bg[1]), lerp(from.bg[2], to.bg[2])] as [\n string,\n string,\n string,\n ],\n textColor: lerp(from.textColor, to.textColor),\n accentColor: lerp(from.accentColor, to.accentColor),\n orb: lerp(from.orb, to.orb),\n outerGlow: lerp(from.outerGlow, to.outerGlow),\n mode: from.mode,\n };\n}\n\n// ─── Shell ────────────────────────────────────────────────────────────────────\n\nexport function CompactWidget({\n design: designOverride,\n overridePhase,\n time,\n location = '',\n flag,\n temperature,\n weather = null,\n showFlag = false,\n showWeather = false,\n showTemperature = true,\n size = 'md',\n latitude,\n longitude,\n timezone,\n customPalettes,\n simulatedDate: simulatedDateProp,\n className = '',\n}: CompactWidgetProps) {\n const [mounted, setMounted] = useState(false);\n useLayoutEffect(() => setMounted(true), []);\n\n const ctx = useSolarTheme();\n\n // Register customPalettes into context so DevTools can read them\n useEffect(() => {\n ctx.setCustomPalettes(customPalettes);\n return () => ctx.setCustomPalettes(undefined);\n }, [customPalettes, ctx.setCustomPalettes]);\n\n // prop wins → context (devtools) → undefined (live)\n const simulatedDate = simulatedDateProp ?? ctx.simulatedDate;\n\n const skin = useMemo(() => {\n if (!designOverride || designOverride === ctx.design) return ctx.activeSkin;\n return ctx.activeSkin;\n }, [designOverride, ctx.design, ctx.activeSkin]);\n\n const phase = overridePhase ?? ctx.phase;\n const blend = overridePhase\n ? { phase: overridePhase, nextPhase: overridePhase, t: 0 }\n : ctx.blend;\n\n const blendedPalette = useMemo(() => blendPalette(skin, blend), [skin, blend]);\n\n const palette: WidgetPalette = useMemo(() => {\n if (!customPalettes?.[phase]) return blendedPalette;\n return { ...blendedPalette, bg: customPalettes[phase]?.bg };\n }, [blendedPalette, customPalettes, phase]);\n\n const resolvedLat = latitude ?? ctx.latitude;\n const resolvedLon = longitude ?? ctx.longitude;\n const resolvedTz = timezone ?? ctx.timezone;\n\n // ── Centralised weather fetch ────────────────────────────────────────────\n const liveWeather = useWeatherData(resolvedLat ?? null, resolvedLon ?? null);\n\n const liveWeatherCategory: WeatherCategory | null = showWeather\n ? (weather ?? liveWeather?.category ?? null)\n : null;\n\n const liveTemperatureC: number | null = liveWeather?.temperatureC ?? null;\n\n // ── Resolve time string ──────────────────────────────────────────────────\n // If caller passes an explicit time string, use it. Otherwise derive from\n // simulatedDate (or real time) so the clock display matches the orb.\n const resolvedTime = useMemo(() => {\n if (time) return time;\n const d = simulatedDate ?? new Date();\n const opts: Intl.DateTimeFormatOptions = {\n hour: '2-digit',\n minute: '2-digit',\n hourCycle: 'h23',\n };\n if (resolvedTz) opts.timeZone = resolvedTz;\n const parts = new Intl.DateTimeFormat('en-GB', opts).formatToParts(d);\n const hh = parts.find((p) => p.type === 'hour')?.value ?? '00';\n const mm = parts.find((p) => p.type === 'minute')?.value ?? '00';\n return `${hh}:${mm}`;\n }, [time, simulatedDate, resolvedTz]);\n\n const props: CompactSkinProps = {\n phase,\n blend,\n time: resolvedTime,\n location,\n flag,\n temperature,\n weather,\n liveWeatherCategory,\n liveTemperatureC,\n latitude: resolvedLat,\n longitude: resolvedLon,\n timezone: resolvedTz,\n simulatedDate,\n showFlag,\n showWeather,\n showTemperature,\n size,\n palette,\n };\n\n const CompactComponent = (\n skin as SkinDefinition & {\n CompactComponent?: React.ComponentType<CompactSkinProps>;\n }\n ).CompactComponent;\n\n if (!CompactComponent) {\n return (\n <div className={className} style={{ opacity: 0.4, fontSize: 11, color: '#888' }}>\n Compact not implemented for {skin.id}\n </div>\n );\n }\n\n return (\n <div\n className={className}\n style={{ visibility: mounted ? 'visible' : 'hidden', isolation: 'isolate' }}\n >\n <CompactComponent {...props} />\n </div>\n );\n}\n"],"mappings":";;;;;AAoDA,MAAa,WAAW,MAAM,QAAQ;AAItC,MAAMA,YAA2C;CAC/C,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACL;AAOD,eAAeC,eAAa,KAAa,KAAmC;CAC1E,MAAM,MAAM,IAAI,IAAI,yCAAyC;AAC7D,KAAI,aAAa,IAAI,YAAY,OAAO,IAAI,CAAC;AAC7C,KAAI,aAAa,IAAI,aAAa,OAAO,IAAI,CAAC;AAC9C,KAAI,aAAa,IAAI,WAAW,8BAA8B;AAC9D,KAAI,aAAa,IAAI,iBAAiB,IAAI;CAC1C,MAAM,OAAQ,MAAM,MAAM,IAAI,UAAU,CAAC,CAAC,MAAM,MAAM,EAAE,MAAM,CAAC;AAG/D,QAAO;EACL,cAAc,KAAK,MAAM,K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D;CAED,MAAM,mBACJ,KAGA;AAEF,KAAI,CAAC,iBACH,QACE,qBAAC;EAAe;EAAW,OAAO;GAAE,SAAS;GAAK,UAAU;GAAI,OAAO;GAAQ;aAAE,gCAClD,KAAK;GAC9B;AAIV,QACE,oBAAC;EACY;EACX,OAAO;GAAE,YAAY,UAAU,YAAY;GAAU,WAAW;GAAW;YAE3E,oBAAC,oBAAiB,GAAI,QAAS;GAC3B"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["WMO_MAP: Record<number, WeatherCategory>","fetchWeather","WMO_MAP","useWeatherData","finalPalette: WidgetPalette","opts: Intl.DateTimeFormatOptions","liveWeatherCategory: WeatherCategory | null","liveTemperatureC: number | null","WMO_MAP: Record<number, WeatherCategory>","palette: WidgetPalette","liveWeatherCategory: WeatherCategory | null","liveTemperatureC: number | null","props: CompactSkinProps","opts: Intl.DateTimeFormatOptions"],"sources":["../src/widgets/solar-widget.shell.tsx","../src/widgets/compact-widget.shell.tsx"],"sourcesContent":["'use client';\n\n/**\n * widgets/solar-widget.shell.tsx (skin-aware shell)\n *\n * Weather fetch is now centralised here alongside the compact shell:\n * - Fetches temperature + weather_code from open-meteo once per mount\n * - Resolves liveWeatherCategory: weatherCategoryOverride ?? live category\n * - Passes liveWeatherCategory + liveTemperatureC down to skin components\n * - Skins should prefer these props over running their own fetch\n *\n * simulatedDate prop wins over ctx.simulatedDate (set by SolarDevTools),\n * which wins over undefined (live time). This means the devtools timeline\n * scrubber moves the orb in every widget without requiring any prop wiring.\n */\n\nimport { useEffect, useLayoutEffect, useMemo, useState } from 'react';\nimport type { SolarPhase } from '../hooks/useSolarPosition';\nimport { lerpHex } from '../lib/solar-lerp';\nimport { useSolarTheme } from '../provider/solar-theme-provider';\nimport type { DesignMode, WidgetPalette } from '../skins/types/widget-skin.types';\n\n// ─── Re-exported types ────────────────────────────────────────────────────────\n\nexport type ExpandDirection =\n | 'top-left'\n | 'top-center'\n | 'top-right'\n | 'center-left'\n | 'center'\n | 'center-right'\n | 'bottom-left'\n | 'bottom-center'\n | 'bottom-right';\n\nexport type WidgetSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n\nexport type WeatherCategory =\n | 'clear'\n | 'partly-cloudy'\n | 'overcast'\n | 'fog'\n | 'drizzle'\n | 'rain'\n | 'heavy-rain'\n | 'snow'\n | 'heavy-snow'\n | 'thunder';\n\nexport type CustomPalettes = Partial<Record<SolarPhase, { bg: [string, string, string] }>>;\n\nimport { SKINS } from '../skins/index';\nexport const PALETTES = SKINS.foundry.widgetPalettes;\n\n// ─── WMO weather code map ─────────────────────────────────────────────────────\n\nconst WMO_MAP: Record<number, WeatherCategory> = {\n 0: 'clear',\n 1: 'clear',\n 2: 'partly-cloudy',\n 3: 'overcast',\n 45: 'fog',\n 48: 'fog',\n 51: 'drizzle',\n 53: 'drizzle',\n 55: 'drizzle',\n 61: 'rain',\n 63: 'rain',\n 65: 'heavy-rain',\n 71: 'snow',\n 73: 'snow',\n 75: 'heavy-snow',\n 80: 'rain',\n 82: 'heavy-rain',\n 85: 'snow',\n 86: 'heavy-snow',\n 95: 'thunder',\n 96: 'thunder',\n 99: 'thunder',\n};\n\ninterface LiveWeather {\n temperatureC: number;\n category: WeatherCategory;\n}\n\nasync function fetchWeather(lat: number, lon: number): Promise<LiveWeather> {\n const url = new URL('https://api.open-meteo.com/v1/forecast');\n url.searchParams.set('latitude', String(lat));\n url.searchParams.set('longitude', String(lon));\n url.searchParams.set('current', 'temperature_2m,weather_code');\n url.searchParams.set('forecast_days', '1');\n const data = (await fetch(url.toString()).then((r) => r.json())) as {\n current: { temperature_2m: number; weather_code: number };\n };\n return {\n temperatureC: Math.round(data.current.temperature_2m),\n category: WMO_MAP[data.current.weather_code] ?? 'clear',\n };\n}\n\nfunction useWeatherData(lat: number | null, lon: number | null) {\n const [weather, setWeather] = useState<LiveWeather | null>(null);\n useEffect(() => {\n if (!lat || !lon) return;\n let dead = false;\n fetchWeather(lat, lon)\n .then((w) => {\n if (!dead) setWeather(w);\n })\n .catch(() => {});\n const id = setInterval(\n () =>\n fetchWeather(lat, lon)\n .then((w) => {\n if (!dead) setWeather(w);\n })\n .catch(() => {}),\n 30 * 60 * 1000,\n );\n return () => {\n dead = true;\n clearInterval(id);\n };\n }, [lat, lon]);\n return weather;\n}\n\n// ─── Widget props ─────────────────────────────────────────────────────────────\n\nexport interface SolarWidgetProps {\n expandDirection?: ExpandDirection;\n size?: WidgetSize;\n showFlag?: boolean;\n showWeather?: boolean;\n hoverEffect?: boolean;\n customPalettes?: CustomPalettes;\n phaseOverride?: SolarPhase;\n weatherCategoryOverride?: WeatherCategory | null;\n /** Explicit simulated date. Falls back to ctx.simulatedDate (from SolarDevTools)\n * then to real current time. */\n simulatedDate?: Date;\n /** Lock the widget state: `true` = always expanded, `false` = always collapsed.\n * Omit or pass `undefined` for default localStorage-driven behaviour. */\n forceExpanded?: boolean;\n}\n\n// ─── Palette blending helper ──────────────────────────────────────────────────\n\nfunction blendWidgetPalette(from: WidgetPalette, to: WidgetPalette, t: number): WidgetPalette {\n return {\n bg: [\n lerpHex(from.bg[0], to.bg[0], t),\n lerpHex(from.bg[1], to.bg[1], t),\n lerpHex(from.bg[2], to.bg[2], t),\n ],\n textColor: lerpHex(from.textColor, to.textColor, t),\n accentColor: lerpHex(from.accentColor, to.accentColor, t),\n orb: lerpHex(from.orb, to.orb, t),\n outerGlow: from.outerGlow,\n mode: t < 0.5 ? from.mode : to.mode,\n };\n}\n\n// ─── Shell component ──────────────────────────────────────────────────────────\n\nexport function SolarWidget({\n expandDirection = 'bottom-right',\n size = 'lg',\n showFlag = false,\n showWeather = false,\n hoverEffect = false,\n customPalettes,\n phaseOverride,\n weatherCategoryOverride,\n simulatedDate: simulatedDateProp,\n forceExpanded,\n}: SolarWidgetProps) {\n const [mounted, setMounted] = useState(false);\n useLayoutEffect(() => setMounted(true), []);\n\n const {\n phase,\n blend,\n activeSkin,\n timezone,\n latitude,\n longitude,\n simulatedDate: ctxSimulatedDate,\n setCustomPalettes,\n } = useSolarTheme();\n\n // Register customPalettes into context so DevTools can read them\n useEffect(() => {\n setCustomPalettes(customPalettes);\n return () => setCustomPalettes(undefined);\n }, [customPalettes, setCustomPalettes]);\n\n // prop wins → context (devtools) → undefined (live)\n const simulatedDate = simulatedDateProp ?? ctxSimulatedDate;\n\n const [expanded, setExpanded] = useState(false);\n\n const activePhase = phaseOverride ?? phase;\n const activeBlend = phaseOverride\n ? { phase: phaseOverride, nextPhase: phaseOverride, t: 0 }\n : blend;\n\n const fromPalette = activeSkin.widgetPalettes[activeBlend.phase];\n const toPalette = activeSkin.widgetPalettes[activeBlend.nextPhase];\n\n const blendedPalette = useMemo(\n () => blendWidgetPalette(fromPalette, toPalette, activeBlend.t),\n [fromPalette, toPalette, activeBlend.t],\n );\n\n const finalPalette: WidgetPalette = useMemo(() => {\n if (!customPalettes?.[activePhase]) return blendedPalette;\n return { ...blendedPalette, bg: customPalettes[activePhase]?.bg };\n }, [blendedPalette, customPalettes, activePhase]);\n\n const time = useMemo(() => {\n const d = simulatedDate ?? new Date();\n const opts: Intl.DateTimeFormatOptions = {\n hour: '2-digit',\n minute: '2-digit',\n hourCycle: 'h23',\n };\n if (timezone) opts.timeZone = timezone;\n const parts = new Intl.DateTimeFormat('en-GB', opts).formatToParts(d);\n const hh = parts.find((p) => p.type === 'hour')?.value ?? '00';\n const mm = parts.find((p) => p.type === 'minute')?.value ?? '00';\n return `${hh}:${mm}`;\n }, [simulatedDate, timezone]);\n\n // ── Centralised weather fetch ────────────────────────────────────────────\n const liveWeather = useWeatherData(latitude ?? null, longitude ?? null);\n\n const liveWeatherCategory: WeatherCategory | null = showWeather\n ? (weatherCategoryOverride ?? liveWeather?.category ?? null)\n : null;\n\n const liveTemperatureC: number | null = liveWeather?.temperatureC ?? null;\n\n const SkinComponent = activeSkin.Component;\n\n return (\n <div style={{ visibility: mounted ? 'visible' : 'hidden' }}>\n <SkinComponent\n phase={activePhase}\n blend={activeBlend}\n expanded={expanded}\n onToggle={() => setExpanded((v) => !v)}\n expandDirection={expandDirection}\n size={size}\n time={time}\n location=\"\"\n showFlag={showFlag}\n showWeather={showWeather}\n hoverEffect={hoverEffect}\n weather={weatherCategoryOverride}\n liveWeatherCategory={liveWeatherCategory}\n liveTemperatureC={liveTemperatureC}\n palette={finalPalette}\n latitude={latitude}\n longitude={longitude}\n timezone={timezone}\n simulatedDate={simulatedDate}\n forceExpanded={forceExpanded}\n />\n </div>\n );\n}\n","'use client';\n\n/**\n * widgets/compact-widget.shell.tsx\n *\n * Shell for the compact solar widget — a slim pill/bar format.\n *\n * simulatedDate prop wins over ctx.simulatedDate (set by SolarDevTools),\n * which wins over undefined (live time). This means the devtools timeline\n * scrubber moves the orb in compact widgets without requiring any prop wiring.\n */\n\nimport { useEffect, useLayoutEffect, useMemo, useState } from 'react';\nimport type { SolarBlend, SolarPhase } from '../hooks/useSolarPosition';\nimport { lerpHex } from '../lib/solar-lerp';\nimport { useSolarTheme } from '../provider/solar-theme-provider';\nimport type { DesignMode, SkinDefinition, WidgetPalette } from '../skins/types/widget-skin.types';\nimport type { CustomPalettes } from './solar-widget.shell';\n\n// ─── Types ────────────────────────────────────────────────────────────────────\n\nexport type WeatherCategory =\n | 'clear'\n | 'partly-cloudy'\n | 'overcast'\n | 'fog'\n | 'drizzle'\n | 'rain'\n | 'heavy-rain'\n | 'snow'\n | 'heavy-snow'\n | 'thunder';\n\nexport type CompactSize = 'sm' | 'md' | 'lg';\n\n// ─── WMO weather code map ─────────────────────────────────────────────────────\n\nconst WMO_MAP: Record<number, WeatherCategory> = {\n 0: 'clear',\n 1: 'clear',\n 2: 'partly-cloudy',\n 3: 'overcast',\n 45: 'fog',\n 48: 'fog',\n 51: 'drizzle',\n 53: 'drizzle',\n 55: 'drizzle',\n 61: 'rain',\n 63: 'rain',\n 65: 'heavy-rain',\n 71: 'snow',\n 73: 'snow',\n 75: 'heavy-snow',\n 80: 'rain',\n 82: 'heavy-rain',\n 85: 'snow',\n 86: 'heavy-snow',\n 95: 'thunder',\n 96: 'thunder',\n 99: 'thunder',\n};\n\n// ─── Centralised weather fetch ────────────────────────────────────────────────\n\ninterface LiveWeather {\n temperatureC: number;\n category: WeatherCategory;\n}\n\nasync function fetchWeather(lat: number, lon: number): Promise<LiveWeather> {\n const url = new URL('https://api.open-meteo.com/v1/forecast');\n url.searchParams.set('latitude', String(lat));\n url.searchParams.set('longitude', String(lon));\n url.searchParams.set('current', 'temperature_2m,weather_code');\n url.searchParams.set('forecast_days', '1');\n const data = (await fetch(url.toString()).then((r) => r.json())) as {\n current: { temperature_2m: number; weather_code: number };\n };\n return {\n temperatureC: Math.round(data.current.temperature_2m),\n category: WMO_MAP[data.current.weather_code] ?? 'clear',\n };\n}\n\nfunction useWeatherData(lat: number | null, lon: number | null) {\n const [weather, setWeather] = useState<LiveWeather | null>(null);\n useEffect(() => {\n if (!lat || !lon) return;\n let dead = false;\n fetchWeather(lat, lon)\n .then((w) => {\n if (!dead) setWeather(w);\n })\n .catch(() => {});\n const id = setInterval(\n () =>\n fetchWeather(lat, lon)\n .then((w) => {\n if (!dead) setWeather(w);\n })\n .catch(() => {}),\n 30 * 60 * 1000,\n );\n return () => {\n dead = true;\n clearInterval(id);\n };\n }, [lat, lon]);\n return weather;\n}\n\n// ─── Props passed to every compact skin component ─────────────────────────────\n\nexport interface CompactSkinProps {\n phase: SolarPhase;\n blend: SolarBlend;\n time: string;\n location: string;\n flag?: string;\n temperature?: string;\n weather?: WeatherCategory | null;\n liveWeatherCategory: WeatherCategory | null;\n liveTemperatureC: number | null;\n latitude?: number | null;\n longitude?: number | null;\n timezone?: string | null;\n simulatedDate?: Date;\n showFlag: boolean;\n showWeather: boolean;\n showTemperature: boolean;\n size: CompactSize;\n palette: WidgetPalette;\n}\n\n// ─── Public props for the shell ───────────────────────────────────────────────\n\nexport interface CompactWidgetProps {\n design?: DesignMode;\n overridePhase?: SolarPhase | null;\n time?: string;\n location?: string;\n flag?: string;\n temperature?: string;\n weather?: WeatherCategory | null;\n weatherCategoryOverride?: WeatherCategory | null;\n showFlag?: boolean;\n showWeather?: boolean;\n showTemperature?: boolean;\n size?: CompactSize;\n latitude?: number | null;\n longitude?: number | null;\n timezone?: string | null;\n /** Override background colors per phase */\n customPalettes?: CustomPalettes;\n /** Explicit simulated date. Falls back to ctx.simulatedDate (from SolarDevTools)\n * then to real current time. */\n simulatedDate?: Date;\n className?: string;\n}\n\n// ─── Palette blending ─────────────────────────────────────────────────────────\n\nfunction blendPalette(skin: SkinDefinition, blend: SolarBlend): WidgetPalette {\n const from = skin.widgetPalettes[blend.phase];\n const to = skin.widgetPalettes[blend.nextPhase];\n const t = blend.t;\n if (t === 0) return from;\n const lerp = (a: string, b: string) => lerpHex(a, b, t);\n return {\n bg: [lerp(from.bg[0], to.bg[0]), lerp(from.bg[1], to.bg[1]), lerp(from.bg[2], to.bg[2])] as [\n string,\n string,\n string,\n ],\n textColor: lerp(from.textColor, to.textColor),\n accentColor: lerp(from.accentColor, to.accentColor),\n orb: lerp(from.orb, to.orb),\n outerGlow: lerp(from.outerGlow, to.outerGlow),\n mode: from.mode,\n };\n}\n\n// ─── Shell ────────────────────────────────────────────────────────────────────\n\nexport function CompactWidget({\n design: designOverride,\n overridePhase,\n time,\n location = '',\n flag,\n temperature,\n weather = null,\n weatherCategoryOverride,\n showFlag = false,\n showWeather = false,\n showTemperature = true,\n size = 'md',\n latitude,\n longitude,\n timezone,\n customPalettes,\n simulatedDate: simulatedDateProp,\n className = '',\n}: CompactWidgetProps) {\n const [mounted, setMounted] = useState(false);\n useLayoutEffect(() => setMounted(true), []);\n\n const ctx = useSolarTheme();\n\n // Register customPalettes into context so DevTools can read them\n useEffect(() => {\n ctx.setCustomPalettes(customPalettes);\n return () => ctx.setCustomPalettes(undefined);\n }, [customPalettes, ctx.setCustomPalettes]);\n\n // prop wins → context (devtools) → undefined (live)\n const simulatedDate = simulatedDateProp ?? ctx.simulatedDate;\n\n const skin = useMemo(() => {\n if (!designOverride || designOverride === ctx.design) return ctx.activeSkin;\n return ctx.activeSkin;\n }, [designOverride, ctx.design, ctx.activeSkin]);\n\n const phase = overridePhase ?? ctx.phase;\n const blend = overridePhase\n ? { phase: overridePhase, nextPhase: overridePhase, t: 0 }\n : ctx.blend;\n\n const blendedPalette = useMemo(() => blendPalette(skin, blend), [skin, blend]);\n\n const palette: WidgetPalette = useMemo(() => {\n if (!customPalettes?.[phase]) return blendedPalette;\n return { ...blendedPalette, bg: customPalettes[phase]?.bg };\n }, [blendedPalette, customPalettes, phase]);\n\n const resolvedLat = latitude ?? ctx.latitude;\n const resolvedLon = longitude ?? ctx.longitude;\n const resolvedTz = timezone ?? ctx.timezone;\n\n // ── Centralised weather fetch ────────────────────────────────────────────\n const liveWeather = useWeatherData(resolvedLat ?? null, resolvedLon ?? null);\n\n const liveWeatherCategory: WeatherCategory | null = showWeather\n ? (weatherCategoryOverride ?? weather ?? liveWeather?.category ?? null)\n : null;\n\n const liveTemperatureC: number | null = liveWeather?.temperatureC ?? null;\n\n // ── Resolve time string ──────────────────────────────────────────────────\n // If caller passes an explicit time string, use it. Otherwise derive from\n // simulatedDate (or real time) so the clock display matches the orb.\n const resolvedTime = useMemo(() => {\n if (time) return time;\n const d = simulatedDate ?? new Date();\n const opts: Intl.DateTimeFormatOptions = {\n hour: '2-digit',\n minute: '2-digit',\n hourCycle: 'h23',\n };\n if (resolvedTz) opts.timeZone = resolvedTz;\n const parts = new Intl.DateTimeFormat('en-GB', opts).formatToParts(d);\n const hh = parts.find((p) => p.type === 'hour')?.value ?? '00';\n const mm = parts.find((p) => p.type === 'minute')?.value ?? '00';\n return `${hh}:${mm}`;\n }, [time, simulatedDate, resolvedTz]);\n\n const props: CompactSkinProps = {\n phase,\n blend,\n time: resolvedTime,\n location,\n flag,\n temperature,\n weather,\n liveWeatherCategory,\n liveTemperatureC,\n latitude: resolvedLat,\n longitude: resolvedLon,\n timezone: resolvedTz,\n simulatedDate,\n showFlag,\n showWeather,\n showTemperature,\n size,\n palette,\n };\n\n const CompactComponent = (\n skin as SkinDefinition & {\n CompactComponent?: React.ComponentType<CompactSkinProps>;\n }\n ).CompactComponent;\n\n if (!CompactComponent) {\n return (\n <div className={className} style={{ opacity: 0.4, fontSize: 11, color: '#888' }}>\n Compact not implemented for {skin.id}\n </div>\n );\n }\n\n return (\n <div\n className={className}\n style={{ visibility: mounted ? 'visible' : 'hidden', isolation: 'isolate' }}\n >\n <CompactComponent {...props} />\n </div>\n );\n}\n"],"mappings":";;;;;AAoDA,MAAa,WAAW,MAAM,QAAQ;AAItC,MAAMA,YAA2C;CAC/C,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACL;AAOD,eAAeC,eAAa,KAAa,KAAmC;CAC1E,MAAM,MAAM,IAAI,IAAI,yCAAyC;AAC7D,KAAI,aAAa,IAAI,YAAY,OAAO,IAAI,CAAC;AAC7C,KAAI,aAAa,IAAI,aAAa,OAAO,IAAI,CAAC;AAC9C,KAAI,aAAa,IAAI,WAAW,8BAA8B;AAC9D,KAAI,aAAa,IAAI,iBAAiB,IAAI;CAC1C,MAAM,OAAQ,MAAM,MAAM,IAAI,UAAU,CAAC,CAAC,MAAM,MAAM,EAAE,MAAM,CAAC;AAG/D,QAAO;EACL,cAAc,KAAK,MAAM,KAAK,QAAQ,eAAe;EACrD,UAAUC,UAAQ,KAAK,QAAQ,iBAAiB;EACjD;;AAGH,SAASC,iBAAe,KAAoB,KAAoB;CAC9D,MAAM,CAAC,SAAS,cAAc,SAA6B,KAAK;AAChE,iBAAgB;AACd,MAAI,CAAC,OAAO,CAAC,IAAK;EAClB,IAAI,OAAO;AACX,iBAAa,KAAK,IAAI,CACnB,MA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E,oBAAC,oBAAiB,GAAI,QAAS;GAC3B"}
|
|
@@ -27685,7 +27685,8 @@ function AuroraWidget({ phase, blend, expandDirection = "top-right", size = "lg"
|
|
|
27685
27685
|
fontFamily: SANS,
|
|
27686
27686
|
fontSize: 11,
|
|
27687
27687
|
fontWeight: 400,
|
|
27688
|
-
letterSpacing: "0.01em"
|
|
27688
|
+
letterSpacing: "0.01em",
|
|
27689
|
+
whiteSpace: "nowrap"
|
|
27689
27690
|
},
|
|
27690
27691
|
animate: { color: palette.textSecondary },
|
|
27691
27692
|
transition: { duration: 1.4 },
|
|
@@ -29273,7 +29274,10 @@ function FoundryWidget({ phase, blend, expandDirection = "top-right", size = "lg
|
|
|
29273
29274
|
} }),
|
|
29274
29275
|
/* @__PURE__ */ jsx(motion.span, {
|
|
29275
29276
|
className: "text-[11px] uppercase tracking-[0.1em]",
|
|
29276
|
-
style: {
|
|
29277
|
+
style: {
|
|
29278
|
+
fontFamily: "'SF Pro Text','Helvetica Neue',sans-serif",
|
|
29279
|
+
whiteSpace: "nowrap"
|
|
29280
|
+
},
|
|
29277
29281
|
animate: { color: palette.textSecondary },
|
|
29278
29282
|
transition: { duration: 2 },
|
|
29279
29283
|
children: palette.label
|
|
@@ -33295,7 +33299,8 @@ function MeridianWidget({ phase, blend, expandDirection = "top-right", size = "l
|
|
|
33295
33299
|
fontFamily: SANS,
|
|
33296
33300
|
fontSize: 11,
|
|
33297
33301
|
fontWeight: 400,
|
|
33298
|
-
letterSpacing: "0.01em"
|
|
33302
|
+
letterSpacing: "0.01em",
|
|
33303
|
+
whiteSpace: "nowrap"
|
|
33299
33304
|
},
|
|
33300
33305
|
animate: { color: palette.textSecondary },
|
|
33301
33306
|
transition: { duration: 1.5 },
|
|
@@ -35526,7 +35531,8 @@ function MineralWidget({ phase, blend, expandDirection = "top-right", size = "lg
|
|
|
35526
35531
|
fontSize: 11,
|
|
35527
35532
|
fontWeight: 400,
|
|
35528
35533
|
letterSpacing: "0.06em",
|
|
35529
|
-
textTransform: "uppercase"
|
|
35534
|
+
textTransform: "uppercase",
|
|
35535
|
+
whiteSpace: "nowrap"
|
|
35530
35536
|
},
|
|
35531
35537
|
animate: { color: palette.textSecondary },
|
|
35532
35538
|
transition: { duration: 1.2 },
|
|
@@ -37580,7 +37586,8 @@ function PaperWidget({ phase, blend, expandDirection = "top-right", size = "lg",
|
|
|
37580
37586
|
fontFamily: SERIF,
|
|
37581
37587
|
fontStyle: "italic",
|
|
37582
37588
|
fontSize: 11,
|
|
37583
|
-
letterSpacing: "0.08em"
|
|
37589
|
+
letterSpacing: "0.08em",
|
|
37590
|
+
whiteSpace: "nowrap"
|
|
37584
37591
|
},
|
|
37585
37592
|
animate: { color: palette.textSecondary },
|
|
37586
37593
|
transition: { duration: 2 },
|
|
@@ -46137,7 +46144,8 @@ function ParchmentWidget({ phase, blend, expandDirection = "top-right", size = "
|
|
|
46137
46144
|
fontSize: 12,
|
|
46138
46145
|
fontWeight: 400,
|
|
46139
46146
|
color: N_TEXT_MED$1,
|
|
46140
|
-
letterSpacing: "0.01em"
|
|
46147
|
+
letterSpacing: "0.01em",
|
|
46148
|
+
whiteSpace: "nowrap"
|
|
46141
46149
|
},
|
|
46142
46150
|
children: PHASE_LABEL[phase]
|
|
46143
46151
|
}),
|
|
@@ -47297,7 +47305,8 @@ function SignalWidget({ phase, blend, expandDirection = "top-right", size = "lg"
|
|
|
47297
47305
|
fontWeight: 700,
|
|
47298
47306
|
letterSpacing: "0.12em",
|
|
47299
47307
|
textTransform: "uppercase",
|
|
47300
|
-
color: palette.textPrimary
|
|
47308
|
+
color: palette.textPrimary,
|
|
47309
|
+
whiteSpace: "nowrap"
|
|
47301
47310
|
},
|
|
47302
47311
|
children: palette.phaseCode
|
|
47303
47312
|
}),
|
|
@@ -50111,7 +50120,8 @@ function SundialWidget({ phase, blend, expandDirection = "top-right", size = "lg
|
|
|
50111
50120
|
fontStyle: "italic",
|
|
50112
50121
|
fontSize: 10,
|
|
50113
50122
|
fontWeight: 400,
|
|
50114
|
-
letterSpacing: "0.12em"
|
|
50123
|
+
letterSpacing: "0.12em",
|
|
50124
|
+
whiteSpace: "nowrap"
|
|
50115
50125
|
},
|
|
50116
50126
|
animate: { color: palette.textSecondary },
|
|
50117
50127
|
transition: { duration: 2 },
|
|
@@ -52390,7 +52400,8 @@ function TideWidget({ phase, blend, expandDirection = "top-right", size = "lg",
|
|
|
52390
52400
|
fontSize: 10,
|
|
52391
52401
|
fontWeight: 500,
|
|
52392
52402
|
letterSpacing: "0.16em",
|
|
52393
|
-
textTransform: "uppercase"
|
|
52403
|
+
textTransform: "uppercase",
|
|
52404
|
+
whiteSpace: "nowrap"
|
|
52394
52405
|
},
|
|
52395
52406
|
animate: { color: palette.textSecondary },
|
|
52396
52407
|
transition: { duration: 2 },
|
|
@@ -54072,7 +54083,8 @@ function VoidWidget({ phase, blend, expandDirection = "top-right", size = "lg",
|
|
|
54072
54083
|
letterSpacing: "0.18em",
|
|
54073
54084
|
textTransform: "lowercase",
|
|
54074
54085
|
color: palette.textPrimary,
|
|
54075
|
-
opacity: .4
|
|
54086
|
+
opacity: .4,
|
|
54087
|
+
whiteSpace: "nowrap"
|
|
54076
54088
|
},
|
|
54077
54089
|
className: "group-hover:opacity-68 transition-opacity duration-300",
|
|
54078
54090
|
children: palette.label
|
|
@@ -54736,4 +54748,4 @@ function SolarThemeProvider({ children, initialDesign = "foundry", isolated = fa
|
|
|
54736
54748
|
|
|
54737
54749
|
//#endregion
|
|
54738
54750
|
export { getSessionIsLive as a, setSessionTimeMinutes as c, clearSessionTimeMinutes as i, lerpHex as l, useSolarTheme as n, getSessionTimeMinutes as o, SKINS as r, setSessionLive as s, SolarThemeProvider as t };
|
|
54739
|
-
//# sourceMappingURL=solar-theme-provider-
|
|
54751
|
+
//# sourceMappingURL=solar-theme-provider-6-EJ4jGB.js.map
|