fermmap-shared 0.1.8 → 0.1.10

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 CHANGED
@@ -2535,7 +2535,7 @@ function $fad215bb6064e329$export$f5c9f3c2c4054eec({ label: label, error: error,
2535
2535
  // Reset height to recalculate
2536
2536
  textarea.style.height = '75px';
2537
2537
  // Set to scrollHeight (content height)
2538
- const newHeight = Math.min(textarea.scrollHeight, window.innerHeight * 0.75);
2538
+ const newHeight = Math.min(textarea.scrollHeight, typeof window !== 'undefined' ? window?.innerHeight * 0.75 : 64);
2539
2539
  textarea.style.height = `${newHeight}px`;
2540
2540
  }, [
2541
2541
  value
@@ -2582,15 +2582,15 @@ const $3a1d0d18027ba81c$var$ThemeContext = /*#__PURE__*/ (0, $fs04y$react.create
2582
2582
  const $3a1d0d18027ba81c$var$THEME_STORAGE_KEY = 'fermmap-theme';
2583
2583
  // Get initial theme synchronously to prevent flicker
2584
2584
  function $3a1d0d18027ba81c$var$getInitialTheme() {
2585
- if (typeof window === 'undefined') return 'light';
2585
+ if (typeof window === 'undefined' || typeof document === 'undefined') return 'light';
2586
2586
  // First check if blocking script already set the attribute
2587
- const htmlAttribute = document.documentElement.getAttribute('data-color-scheme');
2587
+ const htmlAttribute = document?.documentElement.getAttribute('data-color-scheme');
2588
2588
  if (htmlAttribute && (htmlAttribute === 'light' || htmlAttribute === 'dark')) return htmlAttribute;
2589
2589
  // Fallback to localStorage
2590
2590
  const stored = localStorage.getItem($3a1d0d18027ba81c$var$THEME_STORAGE_KEY);
2591
2591
  if (stored && (stored === 'light' || stored === 'dark')) return stored;
2592
2592
  // Final fallback to system preference
2593
- return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
2593
+ return typeof window !== 'undefined' && window?.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
2594
2594
  }
2595
2595
  function $3a1d0d18027ba81c$export$d8964aec282183a3({ children: children }) {
2596
2596
  // Initialize with a function to avoid SSR issues