fermmap-shared 0.1.10 → 0.1.11

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, typeof window !== 'undefined' ? window?.innerHeight * 0.75 : 64);
2538
+ const newHeight = Math.min(textarea.scrollHeight, safeWindow.innerHeight * 0.75 || 64);
2539
2539
  textarea.style.height = `${newHeight}px`;
2540
2540
  }, [
2541
2541
  value
@@ -2578,24 +2578,82 @@ $parcel$export($885bdde2b07b7632$exports, "AxeDevTools", () => $ac6c22366fad60ff
2578
2578
  // Contexts & Providers
2579
2579
 
2580
2580
 
2581
+ /**
2582
+ * Safe browser API wrappers that work in SSR
2583
+ */ const $de0c62f65c50224a$export$4e09c449d6c407f7 = typeof window !== 'undefined';
2584
+ const $de0c62f65c50224a$export$62858bae88b53fd0 = typeof document !== 'undefined';
2585
+ const $de0c62f65c50224a$export$7dd80fbc14cd23b1 = {
2586
+ get innerHeight () {
2587
+ return $de0c62f65c50224a$export$4e09c449d6c407f7 ? window.innerHeight : 0;
2588
+ },
2589
+ get location () {
2590
+ return $de0c62f65c50224a$export$4e09c449d6c407f7 ? window.location : null;
2591
+ },
2592
+ matchMedia: (query)=>{
2593
+ if (!$de0c62f65c50224a$export$4e09c449d6c407f7) return {
2594
+ matches: false,
2595
+ media: query,
2596
+ addEventListener: ()=>{},
2597
+ removeEventListener: ()=>{}
2598
+ };
2599
+ return window.matchMedia(query);
2600
+ },
2601
+ reload: ()=>{
2602
+ if ($de0c62f65c50224a$export$4e09c449d6c407f7) window.location.reload();
2603
+ }
2604
+ };
2605
+ const $de0c62f65c50224a$export$9aee702616bdf23c = {
2606
+ get documentElement () {
2607
+ return $de0c62f65c50224a$export$62858bae88b53fd0 ? document.documentElement : null;
2608
+ },
2609
+ get referrer () {
2610
+ return $de0c62f65c50224a$export$62858bae88b53fd0 ? document.referrer : '';
2611
+ },
2612
+ createElement: (tag)=>{
2613
+ return $de0c62f65c50224a$export$62858bae88b53fd0 ? document.createElement(tag) : null;
2614
+ }
2615
+ };
2616
+ const $de0c62f65c50224a$export$2aa78e70b3d79ddc = {
2617
+ getItem: (key)=>{
2618
+ if (!$de0c62f65c50224a$export$4e09c449d6c407f7) return null;
2619
+ try {
2620
+ return localStorage.getItem(key);
2621
+ } catch {
2622
+ return null;
2623
+ }
2624
+ },
2625
+ setItem: (key, value)=>{
2626
+ if (!$de0c62f65c50224a$export$4e09c449d6c407f7) return;
2627
+ try {
2628
+ localStorage.setItem(key, value);
2629
+ } catch {
2630
+ // Silent fail
2631
+ }
2632
+ }
2633
+ };
2634
+
2635
+
2581
2636
  const $3a1d0d18027ba81c$var$ThemeContext = /*#__PURE__*/ (0, $fs04y$react.createContext)(undefined);
2582
2637
  const $3a1d0d18027ba81c$var$THEME_STORAGE_KEY = 'fermmap-theme';
2583
2638
  // Get initial theme synchronously to prevent flicker
2584
2639
  function $3a1d0d18027ba81c$var$getInitialTheme() {
2585
- if (typeof window === 'undefined' || typeof document === 'undefined') return 'light';
2640
+ if (!(0, $de0c62f65c50224a$export$4e09c449d6c407f7)) return 'light';
2586
2641
  // 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;
2642
+ const htmlElement = (0, $de0c62f65c50224a$export$9aee702616bdf23c).documentElement;
2643
+ if (htmlElement) {
2644
+ const htmlAttribute = htmlElement.getAttribute('data-color-scheme');
2645
+ if (htmlAttribute && (htmlAttribute === 'light' || htmlAttribute === 'dark')) return htmlAttribute;
2646
+ }
2589
2647
  // Fallback to localStorage
2590
- const stored = localStorage.getItem($3a1d0d18027ba81c$var$THEME_STORAGE_KEY);
2648
+ const stored = (0, $de0c62f65c50224a$export$2aa78e70b3d79ddc).getItem($3a1d0d18027ba81c$var$THEME_STORAGE_KEY);
2591
2649
  if (stored && (stored === 'light' || stored === 'dark')) return stored;
2592
2650
  // Final fallback to system preference
2593
- return typeof window !== 'undefined' && window?.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
2651
+ return (0, $de0c62f65c50224a$export$7dd80fbc14cd23b1).matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
2594
2652
  }
2595
2653
  function $3a1d0d18027ba81c$export$d8964aec282183a3({ children: children }) {
2596
2654
  // Initialize with a function to avoid SSR issues
2597
2655
  const [colorScheme, setColorScheme] = (0, $fs04y$react.useState)(()=>{
2598
- if (typeof window === 'undefined') return 'light';
2656
+ if (!(0, $de0c62f65c50224a$export$4e09c449d6c407f7)) return 'light';
2599
2657
  return $3a1d0d18027ba81c$var$getInitialTheme();
2600
2658
  });
2601
2659
  const [mounted, setMounted] = (0, $fs04y$react.useState)(false);
@@ -2608,9 +2666,10 @@ function $3a1d0d18027ba81c$export$d8964aec282183a3({ children: children }) {
2608
2666
  }, []);
2609
2667
  // Update html attribute and localStorage when scheme changes
2610
2668
  (0, $fs04y$react.useEffect)(()=>{
2611
- if (!mounted) return;
2612
- document.documentElement.setAttribute('data-color-scheme', colorScheme);
2613
- localStorage.setItem($3a1d0d18027ba81c$var$THEME_STORAGE_KEY, colorScheme);
2669
+ if (!mounted || !(0, $de0c62f65c50224a$export$4e09c449d6c407f7)) return;
2670
+ const htmlElement = (0, $de0c62f65c50224a$export$9aee702616bdf23c).documentElement;
2671
+ if (htmlElement) htmlElement.setAttribute('data-color-scheme', colorScheme);
2672
+ (0, $de0c62f65c50224a$export$2aa78e70b3d79ddc).setItem($3a1d0d18027ba81c$var$THEME_STORAGE_KEY, colorScheme);
2614
2673
  }, [
2615
2674
  colorScheme,
2616
2675
  mounted
@@ -2736,6 +2795,11 @@ var $0911ce1d49060a15$exports = {};
2736
2795
  $parcel$export($0911ce1d49060a15$exports, "textFieldInputStyles", () => $53c8911eec26a318$export$457d6d213bf79459);
2737
2796
  $parcel$export($0911ce1d49060a15$exports, "getCategoryColors", () => $9df03defd63c82e0$export$2514cbae0d5c71c5);
2738
2797
  $parcel$export($0911ce1d49060a15$exports, "api", () => $ace12160cbee4ea7$export$644d8ea042df96a6);
2798
+ $parcel$export($0911ce1d49060a15$exports, "isBrowser", () => $de0c62f65c50224a$export$4e09c449d6c407f7);
2799
+ $parcel$export($0911ce1d49060a15$exports, "isDocument", () => $de0c62f65c50224a$export$62858bae88b53fd0);
2800
+ $parcel$export($0911ce1d49060a15$exports, "safeWindow", () => $de0c62f65c50224a$export$7dd80fbc14cd23b1);
2801
+ $parcel$export($0911ce1d49060a15$exports, "safeDocument", () => $de0c62f65c50224a$export$9aee702616bdf23c);
2802
+ $parcel$export($0911ce1d49060a15$exports, "safeLocalStorage", () => $de0c62f65c50224a$export$2aa78e70b3d79ddc);
2739
2803
  // Utilities
2740
2804
  const $53c8911eec26a318$export$457d6d213bf79459 = ()=>({
2741
2805
  padding: 12,
@@ -2873,6 +2937,7 @@ const $53c8911eec26a318$export$457d6d213bf79459 = ()=>({
2873
2937
 
2874
2938
 
2875
2939
 
2940
+
2876
2941
  var $fef1a353edd33d81$exports = {};
2877
2942
  var $26e22b40e52bb1d8$exports = {};
2878
2943