@qodin-co/sol 0.1.7 → 0.1.9
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.
Potentially problematic release.
This version of @qodin-co/sol might be problematic. Click here for more details.
- package/dist/devtools/index.js +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +34 -24
- package/dist/index.js.map +1 -1
- package/dist/{solar-theme-provider-B3Pya6MA.js → solar-theme-provider-CXILKRrU.js} +177 -174
- package/dist/solar-theme-provider-CXILKRrU.js.map +1 -0
- package/package.json +1 -1
- package/dist/solar-theme-provider-B3Pya6MA.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React$1 from "react";
|
|
2
|
-
import React, { Children, Component, Fragment, createContext, createElement, forwardRef, isValidElement, useCallback, useContext, useEffect, useId, useInsertionEffect, useLayoutEffect, useMemo, useRef, useState
|
|
2
|
+
import React, { Children, Component, Fragment, createContext, createElement, forwardRef, isValidElement, useCallback, useContext, useEffect, useId, useInsertionEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
3
3
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
//#region rolldown:runtime
|
|
@@ -700,29 +700,28 @@ function useSolarPosition(options = {}) {
|
|
|
700
700
|
const lon = longitude ?? DEFAULT_LON;
|
|
701
701
|
const tz = timezone ?? DEFAULT_TZ;
|
|
702
702
|
simulatedDate?.getTime();
|
|
703
|
-
const [position, setPosition] = useState(
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
sunset: 1080,
|
|
719
|
-
dawnCivil: 330,
|
|
720
|
-
duskCivil: 1110
|
|
721
|
-
},
|
|
722
|
-
localMinutes: 720
|
|
723
|
-
};
|
|
703
|
+
const [position, setPosition] = useState({
|
|
704
|
+
altitude: 45,
|
|
705
|
+
azimuth: 180,
|
|
706
|
+
dayProgress: .5,
|
|
707
|
+
nightProgress: .5,
|
|
708
|
+
isDaytime: true,
|
|
709
|
+
phase: "morning",
|
|
710
|
+
times: {
|
|
711
|
+
sunrise: 360,
|
|
712
|
+
solarNoon: 720,
|
|
713
|
+
sunset: 1080,
|
|
714
|
+
dawnCivil: 330,
|
|
715
|
+
duskCivil: 1110
|
|
716
|
+
},
|
|
717
|
+
localMinutes: 720
|
|
724
718
|
});
|
|
725
|
-
const [isReady, setIsReady] = useState(
|
|
719
|
+
const [isReady, setIsReady] = useState(false);
|
|
720
|
+
useLayoutEffect(() => {
|
|
721
|
+
const date = simulatedDate ?? /* @__PURE__ */ new Date();
|
|
722
|
+
setPosition(computeSolarPosition(date, lat, lon, utcOffsetFromTimezone(tz, date)));
|
|
723
|
+
setIsReady(true);
|
|
724
|
+
}, []);
|
|
726
725
|
useEffect(() => {
|
|
727
726
|
const update = (d) => {
|
|
728
727
|
setPosition(computeSolarPosition(d, lat, lon, utcOffsetFromTimezone(tz, d)));
|
|
@@ -7420,18 +7419,18 @@ function newChildrenMap() {
|
|
|
7420
7419
|
*
|
|
7421
7420
|
* @public
|
|
7422
7421
|
*/
|
|
7423
|
-
function usePresence(subscribe
|
|
7422
|
+
function usePresence(subscribe = true) {
|
|
7424
7423
|
const context = useContext(PresenceContext);
|
|
7425
7424
|
if (context === null) return [true, null];
|
|
7426
7425
|
const { isPresent, onExitComplete, register } = context;
|
|
7427
7426
|
const id$2 = useId();
|
|
7428
7427
|
useEffect(() => {
|
|
7429
|
-
if (subscribe
|
|
7430
|
-
}, [subscribe
|
|
7431
|
-
const safeToRemove = useCallback(() => subscribe
|
|
7428
|
+
if (subscribe) register(id$2);
|
|
7429
|
+
}, [subscribe]);
|
|
7430
|
+
const safeToRemove = useCallback(() => subscribe && onExitComplete && onExitComplete(id$2), [
|
|
7432
7431
|
id$2,
|
|
7433
7432
|
onExitComplete,
|
|
7434
|
-
subscribe
|
|
7433
|
+
subscribe
|
|
7435
7434
|
]);
|
|
7436
7435
|
return !isPresent && onExitComplete ? [false, safeToRemove] : [true];
|
|
7437
7436
|
}
|
|
@@ -19705,7 +19704,7 @@ function withAlpha(color$1, alpha$1) {
|
|
|
19705
19704
|
return `rgba(${parts[0]},${parts[1]},${parts[2]},${alpha$1})`;
|
|
19706
19705
|
}
|
|
19707
19706
|
function TideCloudRenderer({ w, h, colors: colors$1, opacity }) {
|
|
19708
|
-
const id$2 =
|
|
19707
|
+
const id$2 = useId().replace(/:/g, "");
|
|
19709
19708
|
const waveBand = (yBase, amp, phaseOff, pts = 80) => {
|
|
19710
19709
|
const top = Array.from({ length: pts }, (_, i$1) => {
|
|
19711
19710
|
const x = i$1 / (pts - 1) * w;
|
|
@@ -19769,7 +19768,7 @@ function TideCloudRenderer({ w, h, colors: colors$1, opacity }) {
|
|
|
19769
19768
|
});
|
|
19770
19769
|
}
|
|
19771
19770
|
function TideRainRenderer({ w, h, colors: colors$1, opacity }) {
|
|
19772
|
-
const id$2 =
|
|
19771
|
+
const id$2 = useId().replace(/:/g, "");
|
|
19773
19772
|
const drops = Array.from({ length: 28 }, (_, i$1) => ({
|
|
19774
19773
|
x: i$1 / 27 * w * 1.2 - w * .1,
|
|
19775
19774
|
delay: i$1 * .18 % 1.4,
|
|
@@ -19804,7 +19803,7 @@ function TideRainRenderer({ w, h, colors: colors$1, opacity }) {
|
|
|
19804
19803
|
});
|
|
19805
19804
|
}
|
|
19806
19805
|
function SundialCloudRenderer({ w, h, colors: colors$1, opacity }) {
|
|
19807
|
-
const id$2 =
|
|
19806
|
+
const id$2 = useId().replace(/:/g, "");
|
|
19808
19807
|
const slabs = [
|
|
19809
19808
|
{
|
|
19810
19809
|
x: w * .05,
|
|
@@ -19886,7 +19885,7 @@ function SundialCloudRenderer({ w, h, colors: colors$1, opacity }) {
|
|
|
19886
19885
|
});
|
|
19887
19886
|
}
|
|
19888
19887
|
function SundialRainRenderer({ w, h, colors: colors$1, opacity }) {
|
|
19889
|
-
const id$2 =
|
|
19888
|
+
const id$2 = useId().replace(/:/g, "");
|
|
19890
19889
|
const streaks = Array.from({ length: 22 }, (_, i$1) => ({
|
|
19891
19890
|
x: i$1 / 21 * w * 1.1 - w * .05,
|
|
19892
19891
|
delay: i$1 * .22 % 1.6,
|
|
@@ -19921,7 +19920,7 @@ function SundialRainRenderer({ w, h, colors: colors$1, opacity }) {
|
|
|
19921
19920
|
});
|
|
19922
19921
|
}
|
|
19923
19922
|
function VoidCloudRenderer({ w, h, colors: colors$1, opacity }) {
|
|
19924
|
-
const id$2 =
|
|
19923
|
+
const id$2 = useId().replace(/:/g, "");
|
|
19925
19924
|
return /* @__PURE__ */ jsxs("svg", {
|
|
19926
19925
|
"aria-hidden": "true",
|
|
19927
19926
|
width: w,
|
|
@@ -19962,7 +19961,7 @@ function VoidCloudRenderer({ w, h, colors: colors$1, opacity }) {
|
|
|
19962
19961
|
});
|
|
19963
19962
|
}
|
|
19964
19963
|
function VoidThunderRenderer({ w, h, colors: colors$1, opacity }) {
|
|
19965
|
-
const id$2 =
|
|
19964
|
+
const id$2 = useId().replace(/:/g, "");
|
|
19966
19965
|
const flashColor = colors$1?.thunderColor ?? "#FFFFFF";
|
|
19967
19966
|
return /* @__PURE__ */ jsxs("div", {
|
|
19968
19967
|
style: {
|
|
@@ -21603,122 +21602,6 @@ function AuroraCompact({ phase, blend, time: time$1, location, temperature, weat
|
|
|
21603
21602
|
});
|
|
21604
21603
|
}
|
|
21605
21604
|
|
|
21606
|
-
//#endregion
|
|
21607
|
-
//#region node_modules/@usefy/use-local-storage/dist/index.mjs
|
|
21608
|
-
var listeners = /* @__PURE__ */ new Map();
|
|
21609
|
-
function subscribe(key, listener) {
|
|
21610
|
-
if (!listeners.has(key)) listeners.set(key, /* @__PURE__ */ new Set());
|
|
21611
|
-
const keyListeners = listeners.get(key);
|
|
21612
|
-
keyListeners.add(listener);
|
|
21613
|
-
return () => {
|
|
21614
|
-
keyListeners.delete(listener);
|
|
21615
|
-
if (keyListeners.size === 0) listeners.delete(key);
|
|
21616
|
-
};
|
|
21617
|
-
}
|
|
21618
|
-
function notifyListeners(key) {
|
|
21619
|
-
const keyListeners = listeners.get(key);
|
|
21620
|
-
if (keyListeners) keyListeners.forEach((listener) => listener());
|
|
21621
|
-
}
|
|
21622
|
-
function resolveInitialValue(initialValue) {
|
|
21623
|
-
return typeof initialValue === "function" ? initialValue() : initialValue;
|
|
21624
|
-
}
|
|
21625
|
-
function useLocalStorage(key, initialValue, options = {}) {
|
|
21626
|
-
const { serializer = JSON.stringify, deserializer = JSON.parse, syncTabs = true, onError } = options;
|
|
21627
|
-
const serializerRef = useRef(serializer);
|
|
21628
|
-
const deserializerRef = useRef(deserializer);
|
|
21629
|
-
const onErrorRef = useRef(onError);
|
|
21630
|
-
const initialValueRef = useRef(initialValue);
|
|
21631
|
-
serializerRef.current = serializer;
|
|
21632
|
-
deserializerRef.current = deserializer;
|
|
21633
|
-
onErrorRef.current = onError;
|
|
21634
|
-
initialValueRef.current = initialValue;
|
|
21635
|
-
const cacheRef = useRef(null);
|
|
21636
|
-
const isClient = typeof window !== "undefined";
|
|
21637
|
-
return [
|
|
21638
|
-
useSyncExternalStore(useCallback((onStoreChange) => {
|
|
21639
|
-
const unsubscribeStore = subscribe(key, onStoreChange);
|
|
21640
|
-
let handleStorageEvent = null;
|
|
21641
|
-
if (isClient && syncTabs) {
|
|
21642
|
-
handleStorageEvent = (event) => {
|
|
21643
|
-
if (event.key === key) onStoreChange();
|
|
21644
|
-
};
|
|
21645
|
-
window.addEventListener("storage", handleStorageEvent);
|
|
21646
|
-
}
|
|
21647
|
-
return () => {
|
|
21648
|
-
unsubscribeStore();
|
|
21649
|
-
if (handleStorageEvent) window.removeEventListener("storage", handleStorageEvent);
|
|
21650
|
-
};
|
|
21651
|
-
}, [
|
|
21652
|
-
key,
|
|
21653
|
-
syncTabs,
|
|
21654
|
-
isClient
|
|
21655
|
-
]), useCallback(() => {
|
|
21656
|
-
if (!isClient) return resolveInitialValue(initialValueRef.current);
|
|
21657
|
-
try {
|
|
21658
|
-
const rawValue = window.localStorage.getItem(key);
|
|
21659
|
-
if (cacheRef.current && cacheRef.current.rawValue === rawValue) return cacheRef.current.parsedValue;
|
|
21660
|
-
let parsedValue;
|
|
21661
|
-
if (rawValue !== null) parsedValue = deserializerRef.current(rawValue);
|
|
21662
|
-
else parsedValue = resolveInitialValue(initialValueRef.current);
|
|
21663
|
-
cacheRef.current = {
|
|
21664
|
-
rawValue,
|
|
21665
|
-
parsedValue
|
|
21666
|
-
};
|
|
21667
|
-
return parsedValue;
|
|
21668
|
-
} catch (error) {
|
|
21669
|
-
onErrorRef.current?.(error);
|
|
21670
|
-
const fallbackValue = resolveInitialValue(initialValueRef.current);
|
|
21671
|
-
cacheRef.current = {
|
|
21672
|
-
rawValue: null,
|
|
21673
|
-
parsedValue: fallbackValue
|
|
21674
|
-
};
|
|
21675
|
-
return fallbackValue;
|
|
21676
|
-
}
|
|
21677
|
-
}, [key, isClient]), useCallback(() => {
|
|
21678
|
-
return resolveInitialValue(initialValueRef.current);
|
|
21679
|
-
}, [])),
|
|
21680
|
-
useCallback((value) => {
|
|
21681
|
-
try {
|
|
21682
|
-
const currentValue = (() => {
|
|
21683
|
-
try {
|
|
21684
|
-
const item = window.localStorage.getItem(key);
|
|
21685
|
-
if (item !== null) return deserializerRef.current(item);
|
|
21686
|
-
return resolveInitialValue(initialValueRef.current);
|
|
21687
|
-
} catch {
|
|
21688
|
-
return resolveInitialValue(initialValueRef.current);
|
|
21689
|
-
}
|
|
21690
|
-
})();
|
|
21691
|
-
const valueToStore = value instanceof Function ? value(currentValue) : value;
|
|
21692
|
-
if (typeof window !== "undefined") {
|
|
21693
|
-
const serialized = serializerRef.current(valueToStore);
|
|
21694
|
-
window.localStorage.setItem(key, serialized);
|
|
21695
|
-
cacheRef.current = {
|
|
21696
|
-
rawValue: serialized,
|
|
21697
|
-
parsedValue: valueToStore
|
|
21698
|
-
};
|
|
21699
|
-
notifyListeners(key);
|
|
21700
|
-
}
|
|
21701
|
-
} catch (error) {
|
|
21702
|
-
onErrorRef.current?.(error);
|
|
21703
|
-
}
|
|
21704
|
-
}, [key]),
|
|
21705
|
-
useCallback(() => {
|
|
21706
|
-
try {
|
|
21707
|
-
if (typeof window !== "undefined") {
|
|
21708
|
-
window.localStorage.removeItem(key);
|
|
21709
|
-
cacheRef.current = {
|
|
21710
|
-
rawValue: null,
|
|
21711
|
-
parsedValue: resolveInitialValue(initialValueRef.current)
|
|
21712
|
-
};
|
|
21713
|
-
notifyListeners(key);
|
|
21714
|
-
}
|
|
21715
|
-
} catch (error) {
|
|
21716
|
-
onErrorRef.current?.(error);
|
|
21717
|
-
}
|
|
21718
|
-
}, [key])
|
|
21719
|
-
];
|
|
21720
|
-
}
|
|
21721
|
-
|
|
21722
21605
|
//#endregion
|
|
21723
21606
|
//#region src/shared/pill-weather-glyphs.tsx
|
|
21724
21607
|
const NIGHT_KEYWORDS = /moon|night|midnight|lunar|crescent|gibbous|waning|waxing|new-moon|full-moon/i;
|
|
@@ -26568,9 +26451,21 @@ function HorizonIcon$4({ color: color$1 }) {
|
|
|
26568
26451
|
}
|
|
26569
26452
|
function AuroraWidget({ phase, blend, expandDirection = "top-right", size = "lg", showFlag = false, showWeather = false, hoverEffect = true, weather: weatherCategoryOverride = null, latitude, longitude, timezone, simulatedDate, temperatureOverride, temperatureUnit = "C", forceExpanded, className = "", liveWeatherCategory, liveTemperatureC }) {
|
|
26570
26453
|
const { coordsReady } = useSolarTheme();
|
|
26571
|
-
const [storedExpanded, setStoredExpanded] =
|
|
26454
|
+
const [storedExpanded, setStoredExpanded] = useState(true);
|
|
26455
|
+
useEffect(() => {
|
|
26456
|
+
try {
|
|
26457
|
+
const raw = localStorage.getItem("aurora-widget-expanded");
|
|
26458
|
+
if (raw != null) setStoredExpanded(JSON.parse(raw));
|
|
26459
|
+
} catch {}
|
|
26460
|
+
}, []);
|
|
26461
|
+
const updateExpanded = useCallback((next) => {
|
|
26462
|
+
setStoredExpanded(next);
|
|
26463
|
+
try {
|
|
26464
|
+
localStorage.setItem("aurora-widget-expanded", JSON.stringify(next));
|
|
26465
|
+
} catch {}
|
|
26466
|
+
}, []);
|
|
26572
26467
|
const isExpanded = forceExpanded !== void 0 ? forceExpanded : storedExpanded;
|
|
26573
|
-
const setIsExpanded = forceExpanded !== void 0 ? () => {} :
|
|
26468
|
+
const setIsExpanded = forceExpanded !== void 0 ? () => {} : updateExpanded;
|
|
26574
26469
|
const origin = TRANSFORM_ORIGINS$9[expandDirection];
|
|
26575
26470
|
const yNudge = getYNudge$9(expandDirection);
|
|
26576
26471
|
const solar = useSolarPosition({
|
|
@@ -28085,9 +27980,21 @@ const CATEGORY_META$3 = {
|
|
|
28085
27980
|
};
|
|
28086
27981
|
function FoundryWidget({ phase, blend, expandDirection = "top-right", size = "lg", showFlag = false, showWeather = false, hoverEffect = true, weather: weatherCategoryOverride = null, latitude, longitude, timezone, simulatedDate, temperatureOverride, temperatureUnit = "C", forceExpanded, customPalettes, className = "", liveWeatherCategory, liveTemperatureC }) {
|
|
28087
27982
|
const { coordsReady } = useSolarTheme();
|
|
28088
|
-
const [storedExpanded, setStoredExpanded] =
|
|
27983
|
+
const [storedExpanded, setStoredExpanded] = useState(true);
|
|
27984
|
+
useEffect(() => {
|
|
27985
|
+
try {
|
|
27986
|
+
const raw = localStorage.getItem("solar-widget-expanded");
|
|
27987
|
+
if (raw != null) setStoredExpanded(JSON.parse(raw));
|
|
27988
|
+
} catch {}
|
|
27989
|
+
}, []);
|
|
27990
|
+
const updateExpanded = useCallback((next) => {
|
|
27991
|
+
setStoredExpanded(next);
|
|
27992
|
+
try {
|
|
27993
|
+
localStorage.setItem("solar-widget-expanded", JSON.stringify(next));
|
|
27994
|
+
} catch {}
|
|
27995
|
+
}, []);
|
|
28089
27996
|
const isExpanded = forceExpanded !== void 0 ? forceExpanded : storedExpanded;
|
|
28090
|
-
const setIsExpanded = forceExpanded !== void 0 ? () => {} :
|
|
27997
|
+
const setIsExpanded = forceExpanded !== void 0 ? () => {} : updateExpanded;
|
|
28091
27998
|
const origin = TRANSFORM_ORIGINS$8[expandDirection];
|
|
28092
27999
|
const yNudge = getYNudge$8(expandDirection);
|
|
28093
28000
|
const solar = useSolarPosition({
|
|
@@ -32131,9 +32038,21 @@ function HorizonIcon$2({ color: color$1 }) {
|
|
|
32131
32038
|
}
|
|
32132
32039
|
function MeridianWidget({ phase, blend, expandDirection = "top-right", size = "lg", showFlag = false, showWeather = false, hoverEffect = true, weather: weatherCategoryOverride = null, latitude, longitude, timezone, simulatedDate, temperatureOverride, temperatureUnit = "C", forceExpanded, className = "", liveWeatherCategory, liveTemperatureC }) {
|
|
32133
32040
|
const { coordsReady } = useSolarTheme();
|
|
32134
|
-
const [storedExpanded, setStoredExpanded] =
|
|
32041
|
+
const [storedExpanded, setStoredExpanded] = useState(true);
|
|
32042
|
+
useEffect(() => {
|
|
32043
|
+
try {
|
|
32044
|
+
const raw = localStorage.getItem("meridian-widget-expanded");
|
|
32045
|
+
if (raw != null) setStoredExpanded(JSON.parse(raw));
|
|
32046
|
+
} catch {}
|
|
32047
|
+
}, []);
|
|
32048
|
+
const updateExpanded = useCallback((next) => {
|
|
32049
|
+
setStoredExpanded(next);
|
|
32050
|
+
try {
|
|
32051
|
+
localStorage.setItem("meridian-widget-expanded", JSON.stringify(next));
|
|
32052
|
+
} catch {}
|
|
32053
|
+
}, []);
|
|
32135
32054
|
const isExpanded = forceExpanded !== void 0 ? forceExpanded : storedExpanded;
|
|
32136
|
-
const setIsExpanded = forceExpanded !== void 0 ? () => {} :
|
|
32055
|
+
const setIsExpanded = forceExpanded !== void 0 ? () => {} : updateExpanded;
|
|
32137
32056
|
const origin = TRANSFORM_ORIGINS$7[expandDirection];
|
|
32138
32057
|
const yNudge = getYNudge$7(expandDirection);
|
|
32139
32058
|
const solar = useSolarPosition({
|
|
@@ -34263,9 +34182,21 @@ function HorizonIcon$1({ color: color$1 }) {
|
|
|
34263
34182
|
}
|
|
34264
34183
|
function MineralWidget({ phase, blend, expandDirection = "top-right", size = "lg", showFlag = false, showWeather = false, hoverEffect = true, weather: weatherCategoryOverride = null, latitude, longitude, timezone, simulatedDate, temperatureOverride, temperatureUnit = "C", forceExpanded, className = "", liveWeatherCategory, liveTemperatureC }) {
|
|
34265
34184
|
const { coordsReady } = useSolarTheme();
|
|
34266
|
-
const [storedExpanded, setStoredExpanded] =
|
|
34185
|
+
const [storedExpanded, setStoredExpanded] = useState(true);
|
|
34186
|
+
useEffect(() => {
|
|
34187
|
+
try {
|
|
34188
|
+
const raw = localStorage.getItem("mineral-widget-expanded");
|
|
34189
|
+
if (raw != null) setStoredExpanded(JSON.parse(raw));
|
|
34190
|
+
} catch {}
|
|
34191
|
+
}, []);
|
|
34192
|
+
const updateExpanded = useCallback((next) => {
|
|
34193
|
+
setStoredExpanded(next);
|
|
34194
|
+
try {
|
|
34195
|
+
localStorage.setItem("mineral-widget-expanded", JSON.stringify(next));
|
|
34196
|
+
} catch {}
|
|
34197
|
+
}, []);
|
|
34267
34198
|
const isExpanded = forceExpanded !== void 0 ? forceExpanded : storedExpanded;
|
|
34268
|
-
const setIsExpanded = forceExpanded !== void 0 ? () => {} :
|
|
34199
|
+
const setIsExpanded = forceExpanded !== void 0 ? () => {} : updateExpanded;
|
|
34269
34200
|
const origin = TRANSFORM_ORIGINS$6[expandDirection];
|
|
34270
34201
|
const yNudge = getYNudge$6(expandDirection);
|
|
34271
34202
|
const solar = useSolarPosition({
|
|
@@ -36224,9 +36155,21 @@ const CATEGORY_META = {
|
|
|
36224
36155
|
const SERIF = "'Georgia','Times New Roman',serif";
|
|
36225
36156
|
function PaperWidget({ phase, blend, expandDirection = "top-right", size = "lg", showFlag = false, showWeather = false, hoverEffect = true, weather: weatherCategoryOverride = null, latitude, longitude, timezone, simulatedDate, temperatureOverride, temperatureUnit = "C", forceExpanded, className = "", liveWeatherCategory, liveTemperatureC }) {
|
|
36226
36157
|
const { coordsReady } = useSolarTheme();
|
|
36227
|
-
const [storedExpanded, setStoredExpanded] =
|
|
36158
|
+
const [storedExpanded, setStoredExpanded] = useState(true);
|
|
36159
|
+
useEffect(() => {
|
|
36160
|
+
try {
|
|
36161
|
+
const raw = localStorage.getItem("paper-widget-expanded");
|
|
36162
|
+
if (raw != null) setStoredExpanded(JSON.parse(raw));
|
|
36163
|
+
} catch {}
|
|
36164
|
+
}, []);
|
|
36165
|
+
const updateExpanded = useCallback((next) => {
|
|
36166
|
+
setStoredExpanded(next);
|
|
36167
|
+
try {
|
|
36168
|
+
localStorage.setItem("paper-widget-expanded", JSON.stringify(next));
|
|
36169
|
+
} catch {}
|
|
36170
|
+
}, []);
|
|
36228
36171
|
const isExpanded = forceExpanded !== void 0 ? forceExpanded : storedExpanded;
|
|
36229
|
-
const setIsExpanded = forceExpanded !== void 0 ? () => {} :
|
|
36172
|
+
const setIsExpanded = forceExpanded !== void 0 ? () => {} : updateExpanded;
|
|
36230
36173
|
const origin = TRANSFORM_ORIGINS$5[expandDirection];
|
|
36231
36174
|
const yNudge = getYNudge$5(expandDirection);
|
|
36232
36175
|
const solar = useSolarPosition({
|
|
@@ -37009,7 +36952,7 @@ function usePaperCompactOrbRaf(refs) {
|
|
|
37009
36952
|
function InkWashTrack({ trackW, trackH, pal, isDaytime, initX, washRef, featherRef, outerRef, coreRef, wrapGRef, orbOpacity = 1 }) {
|
|
37010
36953
|
const orbR = isDaytime ? trackH * .48 : trackH * .36;
|
|
37011
36954
|
const lineY = trackH / 2 + trackH * .05;
|
|
37012
|
-
const filterId =
|
|
36955
|
+
const filterId = `pw${useId().replace(/:/g, "")}`;
|
|
37013
36956
|
return /* @__PURE__ */ jsxs("svg", {
|
|
37014
36957
|
"aria-hidden": "true",
|
|
37015
36958
|
width: trackW,
|
|
@@ -37160,7 +37103,7 @@ function PaperCompact({ phase, blend, time: time$1, location, temperature, weath
|
|
|
37160
37103
|
if (!timezone || !showFlag) return null;
|
|
37161
37104
|
return getTimezone(timezone)?.countries?.[0] ?? null;
|
|
37162
37105
|
}, [timezone, showFlag]);
|
|
37163
|
-
const grainId =
|
|
37106
|
+
const grainId = `pg${useId().replace(/:/g, "")}`;
|
|
37164
37107
|
const trackW = size.width - size.px * 2;
|
|
37165
37108
|
const isItalic = ITALIC_PHASES.has(phase);
|
|
37166
37109
|
const row1H = size.labelSize + 2;
|
|
@@ -44822,9 +44765,21 @@ const SPRING_CONTENT$3 = {
|
|
|
44822
44765
|
};
|
|
44823
44766
|
function ParchmentWidget({ phase, blend, expandDirection = "top-right", size = "lg", showFlag = false, showWeather = false, hoverEffect = true, weather: weatherCategoryOverride = null, latitude, longitude, timezone, simulatedDate, temperatureUnit = "C", forceExpanded, className = "", liveWeatherCategory, liveTemperatureC }) {
|
|
44824
44767
|
const { coordsReady } = useSolarTheme();
|
|
44825
|
-
const [storedExpanded, setStoredExpanded] =
|
|
44768
|
+
const [storedExpanded, setStoredExpanded] = useState(true);
|
|
44769
|
+
useEffect(() => {
|
|
44770
|
+
try {
|
|
44771
|
+
const raw = localStorage.getItem("solar-widget-parchment-expanded");
|
|
44772
|
+
if (raw != null) setStoredExpanded(JSON.parse(raw));
|
|
44773
|
+
} catch {}
|
|
44774
|
+
}, []);
|
|
44775
|
+
const updateExpanded = useCallback((next) => {
|
|
44776
|
+
setStoredExpanded(next);
|
|
44777
|
+
try {
|
|
44778
|
+
localStorage.setItem("solar-widget-parchment-expanded", JSON.stringify(next));
|
|
44779
|
+
} catch {}
|
|
44780
|
+
}, []);
|
|
44826
44781
|
const isExpanded = forceExpanded !== void 0 ? forceExpanded : storedExpanded;
|
|
44827
|
-
const setIsExpanded = forceExpanded !== void 0 ? () => {} :
|
|
44782
|
+
const setIsExpanded = forceExpanded !== void 0 ? () => {} : updateExpanded;
|
|
44828
44783
|
const origin = TRANSFORM_ORIGINS$4[expandDirection];
|
|
44829
44784
|
const yNudge = getYNudge$4(expandDirection);
|
|
44830
44785
|
const solar = useSolarPosition({
|
|
@@ -46020,9 +45975,21 @@ function useCountryCode$1(timezone) {
|
|
|
46020
45975
|
}
|
|
46021
45976
|
function SignalWidget({ phase, blend, expandDirection = "top-right", size = "lg", showFlag = false, showWeather = false, hoverEffect = true, weather: weatherCategoryOverride = null, latitude, longitude, timezone, simulatedDate, temperatureOverride, temperatureUnit = "C", forceExpanded, className = "", liveWeatherCategory, liveTemperatureC }) {
|
|
46022
45977
|
const { coordsReady } = useSolarTheme();
|
|
46023
|
-
const [storedExpanded, setStoredExpanded] =
|
|
45978
|
+
const [storedExpanded, setStoredExpanded] = useState(true);
|
|
45979
|
+
useEffect(() => {
|
|
45980
|
+
try {
|
|
45981
|
+
const raw = localStorage.getItem("signal-widget-expanded");
|
|
45982
|
+
if (raw != null) setStoredExpanded(JSON.parse(raw));
|
|
45983
|
+
} catch {}
|
|
45984
|
+
}, []);
|
|
45985
|
+
const updateExpanded = useCallback((next) => {
|
|
45986
|
+
setStoredExpanded(next);
|
|
45987
|
+
try {
|
|
45988
|
+
localStorage.setItem("signal-widget-expanded", JSON.stringify(next));
|
|
45989
|
+
} catch {}
|
|
45990
|
+
}, []);
|
|
46024
45991
|
const isExpanded = forceExpanded !== void 0 ? forceExpanded : storedExpanded;
|
|
46025
|
-
const setIsExpanded = forceExpanded !== void 0 ? () => {} :
|
|
45992
|
+
const setIsExpanded = forceExpanded !== void 0 ? () => {} : updateExpanded;
|
|
46026
45993
|
const origin = TRANSFORM_ORIGINS$3[expandDirection];
|
|
46027
45994
|
const yNudge = getYNudge$3(expandDirection);
|
|
46028
45995
|
const solar = useSolarPosition({
|
|
@@ -47593,7 +47560,7 @@ function ArcTrack({ progress: progress$1, trackW, trackH, pal, orbOpacity = 1 })
|
|
|
47593
47560
|
for (const el of orbGroupRef.current?.querySelectorAll("[data-orb-fill]") ?? []) el.style.fill = pal.orbFill;
|
|
47594
47561
|
for (const el of orbGroupRef.current?.querySelectorAll("[data-orb-glow]") ?? []) el.style.fill = pal.orbGlow;
|
|
47595
47562
|
});
|
|
47596
|
-
const filterId =
|
|
47563
|
+
const filterId = `sd${useId().replace(/:/g, "")}`;
|
|
47597
47564
|
const ROMAN_TICKS$1 = [
|
|
47598
47565
|
"VI",
|
|
47599
47566
|
"IX",
|
|
@@ -48598,9 +48565,21 @@ const SPRING_CONTENT$2 = {
|
|
|
48598
48565
|
};
|
|
48599
48566
|
function SundialWidget({ phase, blend, expandDirection = "top-right", size = "lg", showFlag = false, showWeather = false, hoverEffect = true, weather: weatherOverride = null, latitude, longitude, timezone, simulatedDate, temperatureOverride, temperatureUnit = "C", forceExpanded, className = "", liveWeatherCategory, liveTemperatureC }) {
|
|
48600
48567
|
const { coordsReady } = useSolarTheme();
|
|
48601
|
-
const [stored, setStored] =
|
|
48568
|
+
const [stored, setStored] = useState(true);
|
|
48569
|
+
useEffect(() => {
|
|
48570
|
+
try {
|
|
48571
|
+
const raw = localStorage.getItem("sundial-widget-expanded");
|
|
48572
|
+
if (raw != null) setStored(JSON.parse(raw));
|
|
48573
|
+
} catch {}
|
|
48574
|
+
}, []);
|
|
48575
|
+
const updateExpanded = useCallback((next) => {
|
|
48576
|
+
setStored(next);
|
|
48577
|
+
try {
|
|
48578
|
+
localStorage.setItem("sundial-widget-expanded", JSON.stringify(next));
|
|
48579
|
+
} catch {}
|
|
48580
|
+
}, []);
|
|
48602
48581
|
const isExpanded = forceExpanded !== void 0 ? forceExpanded : stored;
|
|
48603
|
-
const setIsExpanded = forceExpanded !== void 0 ? () => {} :
|
|
48582
|
+
const setIsExpanded = forceExpanded !== void 0 ? () => {} : updateExpanded;
|
|
48604
48583
|
const origin = TRANSFORM_ORIGINS$2[expandDirection];
|
|
48605
48584
|
const yNudge = getYNudge$2(expandDirection);
|
|
48606
48585
|
const solar = useSolarPosition({
|
|
@@ -50755,9 +50734,21 @@ const SPRING_CONTENT$1 = {
|
|
|
50755
50734
|
};
|
|
50756
50735
|
function TideWidget({ phase, blend, expandDirection = "top-right", size = "lg", showFlag = false, showWeather = false, hoverEffect = true, weather: weatherOverride = null, latitude, longitude, timezone, simulatedDate, temperatureOverride, temperatureUnit = "C", forceExpanded, className = "", liveWeatherCategory, liveTemperatureC }) {
|
|
50757
50736
|
const { coordsReady } = useSolarTheme();
|
|
50758
|
-
const [stored, setStored] =
|
|
50737
|
+
const [stored, setStored] = useState(true);
|
|
50738
|
+
useEffect(() => {
|
|
50739
|
+
try {
|
|
50740
|
+
const raw = localStorage.getItem("tide-widget-expanded");
|
|
50741
|
+
if (raw != null) setStored(JSON.parse(raw));
|
|
50742
|
+
} catch {}
|
|
50743
|
+
}, []);
|
|
50744
|
+
const updateExpanded = useCallback((next) => {
|
|
50745
|
+
setStored(next);
|
|
50746
|
+
try {
|
|
50747
|
+
localStorage.setItem("tide-widget-expanded", JSON.stringify(next));
|
|
50748
|
+
} catch {}
|
|
50749
|
+
}, []);
|
|
50759
50750
|
const isExpanded = forceExpanded !== void 0 ? forceExpanded : stored;
|
|
50760
|
-
const setIsExpanded = forceExpanded !== void 0 ? () => {} :
|
|
50751
|
+
const setIsExpanded = forceExpanded !== void 0 ? () => {} : updateExpanded;
|
|
50761
50752
|
const origin = TRANSFORM_ORIGINS$1[expandDirection];
|
|
50762
50753
|
const yNudge = getYNudge$1(expandDirection);
|
|
50763
50754
|
const solar = useSolarPosition({
|
|
@@ -52549,9 +52540,21 @@ const SPRING_CONTENT = {
|
|
|
52549
52540
|
};
|
|
52550
52541
|
function VoidWidget({ phase, blend, expandDirection = "top-right", size = "lg", showFlag = false, showWeather = false, hoverEffect = true, weather: weatherOverride = null, latitude, longitude, timezone, simulatedDate, temperatureOverride, temperatureUnit = "C", forceExpanded, className = "", liveWeatherCategory, liveTemperatureC }) {
|
|
52551
52542
|
const { coordsReady } = useSolarTheme();
|
|
52552
|
-
const [stored, setStored] =
|
|
52543
|
+
const [stored, setStored] = useState(true);
|
|
52544
|
+
useEffect(() => {
|
|
52545
|
+
try {
|
|
52546
|
+
const raw = localStorage.getItem("void-widget-expanded");
|
|
52547
|
+
if (raw != null) setStored(JSON.parse(raw));
|
|
52548
|
+
} catch {}
|
|
52549
|
+
}, []);
|
|
52550
|
+
const updateExpanded = useCallback((next) => {
|
|
52551
|
+
setStored(next);
|
|
52552
|
+
try {
|
|
52553
|
+
localStorage.setItem("void-widget-expanded", JSON.stringify(next));
|
|
52554
|
+
} catch {}
|
|
52555
|
+
}, []);
|
|
52553
52556
|
const isExpanded = forceExpanded !== void 0 ? forceExpanded : stored;
|
|
52554
|
-
const setIsExpanded = forceExpanded !== void 0 ? () => {} :
|
|
52557
|
+
const setIsExpanded = forceExpanded !== void 0 ? () => {} : updateExpanded;
|
|
52555
52558
|
const origin = TRANSFORM_ORIGINS[expandDirection];
|
|
52556
52559
|
const yNudge = getYNudge(expandDirection);
|
|
52557
52560
|
const solar = useSolarPosition({
|
|
@@ -53718,4 +53721,4 @@ function SolarThemeProvider({ children, initialDesign = "foundry", isolated = fa
|
|
|
53718
53721
|
|
|
53719
53722
|
//#endregion
|
|
53720
53723
|
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 };
|
|
53721
|
-
//# sourceMappingURL=solar-theme-provider-
|
|
53724
|
+
//# sourceMappingURL=solar-theme-provider-CXILKRrU.js.map
|