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