fermmap-shared 0.1.7 → 0.1.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/dist/main.cjs +8 -14
- package/dist/main.cjs.map +1 -1
- package/dist/module.mjs +8 -14
- package/dist/module.mjs.map +1 -1
- package/package.json +1 -1
package/dist/main.cjs
CHANGED
|
@@ -2530,7 +2530,6 @@ function $fad215bb6064e329$export$f5c9f3c2c4054eec({ label: label, error: error,
|
|
|
2530
2530
|
const textareaRef = (0, $fs04y$react.useRef)(null);
|
|
2531
2531
|
// Auto-grow on value change
|
|
2532
2532
|
(0, $fs04y$react.useEffect)(()=>{
|
|
2533
|
-
if (typeof window === 'undefined') return;
|
|
2534
2533
|
const textarea = textareaRef.current;
|
|
2535
2534
|
if (!textarea) return;
|
|
2536
2535
|
// Reset height to recalculate
|
|
@@ -2584,19 +2583,14 @@ const $3a1d0d18027ba81c$var$THEME_STORAGE_KEY = 'fermmap-theme';
|
|
|
2584
2583
|
// Get initial theme synchronously to prevent flicker
|
|
2585
2584
|
function $3a1d0d18027ba81c$var$getInitialTheme() {
|
|
2586
2585
|
if (typeof window === 'undefined') return 'light';
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
|
2596
|
-
} catch {
|
|
2597
|
-
// Fallback if any browser API fails
|
|
2598
|
-
return 'light';
|
|
2599
|
-
}
|
|
2586
|
+
// First check if blocking script already set the attribute
|
|
2587
|
+
const htmlAttribute = document.documentElement.getAttribute('data-color-scheme');
|
|
2588
|
+
if (htmlAttribute && (htmlAttribute === 'light' || htmlAttribute === 'dark')) return htmlAttribute;
|
|
2589
|
+
// Fallback to localStorage
|
|
2590
|
+
const stored = localStorage.getItem($3a1d0d18027ba81c$var$THEME_STORAGE_KEY);
|
|
2591
|
+
if (stored && (stored === 'light' || stored === 'dark')) return stored;
|
|
2592
|
+
// Final fallback to system preference
|
|
2593
|
+
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
|
2600
2594
|
}
|
|
2601
2595
|
function $3a1d0d18027ba81c$export$d8964aec282183a3({ children: children }) {
|
|
2602
2596
|
// Initialize with a function to avoid SSR issues
|