fermmap-shared 0.1.8 → 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.
package/dist/main.cjs CHANGED
@@ -2482,6 +2482,49 @@ function $e00b7714d9bed1e1$export$3d96ec278d3efce4({ children: children, ...prop
2482
2482
 
2483
2483
 
2484
2484
 
2485
+ /**
2486
+ * Safe browser API wrappers that work in SSR
2487
+ */ const $de0c62f65c50224a$export$4e09c449d6c407f7 = typeof window !== 'undefined';
2488
+ const $de0c62f65c50224a$export$7dd80fbc14cd23b1 = {
2489
+ get innerHeight () {
2490
+ return $de0c62f65c50224a$export$4e09c449d6c407f7 ? window.innerHeight : 0;
2491
+ },
2492
+ matchMedia: (query)=>{
2493
+ if (!$de0c62f65c50224a$export$4e09c449d6c407f7) return {
2494
+ matches: false,
2495
+ media: query,
2496
+ addEventListener: ()=>{},
2497
+ removeEventListener: ()=>{}
2498
+ };
2499
+ return window.matchMedia(query);
2500
+ }
2501
+ };
2502
+ const $de0c62f65c50224a$export$9aee702616bdf23c = {
2503
+ get documentElement () {
2504
+ if (!$de0c62f65c50224a$export$4e09c449d6c407f7) return null;
2505
+ return document.documentElement;
2506
+ }
2507
+ };
2508
+ const $de0c62f65c50224a$export$2aa78e70b3d79ddc = {
2509
+ getItem: (key)=>{
2510
+ if (!$de0c62f65c50224a$export$4e09c449d6c407f7) return null;
2511
+ try {
2512
+ return localStorage.getItem(key);
2513
+ } catch {
2514
+ return null;
2515
+ }
2516
+ },
2517
+ setItem: (key, value)=>{
2518
+ if (!$de0c62f65c50224a$export$4e09c449d6c407f7) return;
2519
+ try {
2520
+ localStorage.setItem(key, value);
2521
+ } catch {
2522
+ // Silent fail
2523
+ }
2524
+ }
2525
+ };
2526
+
2527
+
2485
2528
 
2486
2529
  const $fad215bb6064e329$var$textareaStyles = function anonymous(props) {
2487
2530
  let rules = " ";
@@ -2535,7 +2578,7 @@ function $fad215bb6064e329$export$f5c9f3c2c4054eec({ label: label, error: error,
2535
2578
  // Reset height to recalculate
2536
2579
  textarea.style.height = '75px';
2537
2580
  // Set to scrollHeight (content height)
2538
- const newHeight = Math.min(textarea.scrollHeight, window.innerHeight * 0.75);
2581
+ const newHeight = Math.min(textarea.scrollHeight, (0, $de0c62f65c50224a$export$7dd80fbc14cd23b1).innerHeight * 0.75);
2539
2582
  textarea.style.height = `${newHeight}px`;
2540
2583
  }, [
2541
2584
  value
@@ -2578,24 +2621,28 @@ $parcel$export($885bdde2b07b7632$exports, "AxeDevTools", () => $ac6c22366fad60ff
2578
2621
  // Contexts & Providers
2579
2622
 
2580
2623
 
2624
+
2581
2625
  const $3a1d0d18027ba81c$var$ThemeContext = /*#__PURE__*/ (0, $fs04y$react.createContext)(undefined);
2582
2626
  const $3a1d0d18027ba81c$var$THEME_STORAGE_KEY = 'fermmap-theme';
2583
2627
  // Get initial theme synchronously to prevent flicker
2584
2628
  function $3a1d0d18027ba81c$var$getInitialTheme() {
2585
- if (typeof window === 'undefined') return 'light';
2629
+ if (!(0, $de0c62f65c50224a$export$4e09c449d6c407f7)) return 'light';
2586
2630
  // 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;
2631
+ const htmlElement = (0, $de0c62f65c50224a$export$9aee702616bdf23c).documentElement;
2632
+ if (htmlElement) {
2633
+ const htmlAttribute = htmlElement.getAttribute('data-color-scheme');
2634
+ if (htmlAttribute && (htmlAttribute === 'light' || htmlAttribute === 'dark')) return htmlAttribute;
2635
+ }
2589
2636
  // Fallback to localStorage
2590
- const stored = localStorage.getItem($3a1d0d18027ba81c$var$THEME_STORAGE_KEY);
2637
+ const stored = (0, $de0c62f65c50224a$export$2aa78e70b3d79ddc).getItem($3a1d0d18027ba81c$var$THEME_STORAGE_KEY);
2591
2638
  if (stored && (stored === 'light' || stored === 'dark')) return stored;
2592
2639
  // Final fallback to system preference
2593
- return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
2640
+ return (0, $de0c62f65c50224a$export$7dd80fbc14cd23b1).matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
2594
2641
  }
2595
2642
  function $3a1d0d18027ba81c$export$d8964aec282183a3({ children: children }) {
2596
2643
  // Initialize with a function to avoid SSR issues
2597
2644
  const [colorScheme, setColorScheme] = (0, $fs04y$react.useState)(()=>{
2598
- if (typeof window === 'undefined') return 'light';
2645
+ if (!(0, $de0c62f65c50224a$export$4e09c449d6c407f7)) return 'light';
2599
2646
  return $3a1d0d18027ba81c$var$getInitialTheme();
2600
2647
  });
2601
2648
  const [mounted, setMounted] = (0, $fs04y$react.useState)(false);
@@ -2608,9 +2655,10 @@ function $3a1d0d18027ba81c$export$d8964aec282183a3({ children: children }) {
2608
2655
  }, []);
2609
2656
  // Update html attribute and localStorage when scheme changes
2610
2657
  (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);
2658
+ if (!mounted || !(0, $de0c62f65c50224a$export$4e09c449d6c407f7)) return;
2659
+ const htmlElement = (0, $de0c62f65c50224a$export$9aee702616bdf23c).documentElement;
2660
+ if (htmlElement) htmlElement.setAttribute('data-color-scheme', colorScheme);
2661
+ (0, $de0c62f65c50224a$export$2aa78e70b3d79ddc).setItem($3a1d0d18027ba81c$var$THEME_STORAGE_KEY, colorScheme);
2614
2662
  }, [
2615
2663
  colorScheme,
2616
2664
  mounted
@@ -2736,6 +2784,10 @@ var $0911ce1d49060a15$exports = {};
2736
2784
  $parcel$export($0911ce1d49060a15$exports, "textFieldInputStyles", () => $53c8911eec26a318$export$457d6d213bf79459);
2737
2785
  $parcel$export($0911ce1d49060a15$exports, "getCategoryColors", () => $9df03defd63c82e0$export$2514cbae0d5c71c5);
2738
2786
  $parcel$export($0911ce1d49060a15$exports, "api", () => $ace12160cbee4ea7$export$644d8ea042df96a6);
2787
+ $parcel$export($0911ce1d49060a15$exports, "isBrowser", () => $de0c62f65c50224a$export$4e09c449d6c407f7);
2788
+ $parcel$export($0911ce1d49060a15$exports, "safeWindow", () => $de0c62f65c50224a$export$7dd80fbc14cd23b1);
2789
+ $parcel$export($0911ce1d49060a15$exports, "safeDocument", () => $de0c62f65c50224a$export$9aee702616bdf23c);
2790
+ $parcel$export($0911ce1d49060a15$exports, "safeLocalStorage", () => $de0c62f65c50224a$export$2aa78e70b3d79ddc);
2739
2791
  // Utilities
2740
2792
  const $53c8911eec26a318$export$457d6d213bf79459 = ()=>({
2741
2793
  padding: 12,
@@ -2873,6 +2925,7 @@ const $53c8911eec26a318$export$457d6d213bf79459 = ()=>({
2873
2925
 
2874
2926
 
2875
2927
 
2928
+
2876
2929
  var $fef1a353edd33d81$exports = {};
2877
2930
  var $26e22b40e52bb1d8$exports = {};
2878
2931