fermmap-shared 0.1.7 → 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/module.mjs CHANGED
@@ -2478,6 +2478,49 @@ function $73303ac6ce50c127$export$3d96ec278d3efce4({ children: children, ...prop
2478
2478
 
2479
2479
 
2480
2480
 
2481
+ /**
2482
+ * Safe browser API wrappers that work in SSR
2483
+ */ const $20eaf1306ff19a16$export$4e09c449d6c407f7 = typeof window !== 'undefined';
2484
+ const $20eaf1306ff19a16$export$7dd80fbc14cd23b1 = {
2485
+ get innerHeight () {
2486
+ return $20eaf1306ff19a16$export$4e09c449d6c407f7 ? window.innerHeight : 0;
2487
+ },
2488
+ matchMedia: (query)=>{
2489
+ if (!$20eaf1306ff19a16$export$4e09c449d6c407f7) return {
2490
+ matches: false,
2491
+ media: query,
2492
+ addEventListener: ()=>{},
2493
+ removeEventListener: ()=>{}
2494
+ };
2495
+ return window.matchMedia(query);
2496
+ }
2497
+ };
2498
+ const $20eaf1306ff19a16$export$9aee702616bdf23c = {
2499
+ get documentElement () {
2500
+ if (!$20eaf1306ff19a16$export$4e09c449d6c407f7) return null;
2501
+ return document.documentElement;
2502
+ }
2503
+ };
2504
+ const $20eaf1306ff19a16$export$2aa78e70b3d79ddc = {
2505
+ getItem: (key)=>{
2506
+ if (!$20eaf1306ff19a16$export$4e09c449d6c407f7) return null;
2507
+ try {
2508
+ return localStorage.getItem(key);
2509
+ } catch {
2510
+ return null;
2511
+ }
2512
+ },
2513
+ setItem: (key, value)=>{
2514
+ if (!$20eaf1306ff19a16$export$4e09c449d6c407f7) return;
2515
+ try {
2516
+ localStorage.setItem(key, value);
2517
+ } catch {
2518
+ // Silent fail
2519
+ }
2520
+ }
2521
+ };
2522
+
2523
+
2481
2524
 
2482
2525
  const $db470a4073e4639a$var$textareaStyles = function anonymous(props) {
2483
2526
  let rules = " ";
@@ -2526,13 +2569,12 @@ function $db470a4073e4639a$export$f5c9f3c2c4054eec({ label: label, error: error,
2526
2569
  const textareaRef = (0, $3A86U$useRef)(null);
2527
2570
  // Auto-grow on value change
2528
2571
  (0, $3A86U$useEffect)(()=>{
2529
- if (typeof window === 'undefined') return;
2530
2572
  const textarea = textareaRef.current;
2531
2573
  if (!textarea) return;
2532
2574
  // Reset height to recalculate
2533
2575
  textarea.style.height = '75px';
2534
2576
  // Set to scrollHeight (content height)
2535
- const newHeight = Math.min(textarea.scrollHeight, window.innerHeight * 0.75);
2577
+ const newHeight = Math.min(textarea.scrollHeight, (0, $20eaf1306ff19a16$export$7dd80fbc14cd23b1).innerHeight * 0.75);
2536
2578
  textarea.style.height = `${newHeight}px`;
2537
2579
  }, [
2538
2580
  value
@@ -2575,29 +2617,28 @@ $parcel$export($b9dc9736b0835428$exports, "AxeDevTools", () => $cc88703bd59b1580
2575
2617
  // Contexts & Providers
2576
2618
 
2577
2619
 
2620
+
2578
2621
  const $14dac782240849bf$var$ThemeContext = /*#__PURE__*/ (0, $3A86U$createContext)(undefined);
2579
2622
  const $14dac782240849bf$var$THEME_STORAGE_KEY = 'fermmap-theme';
2580
2623
  // Get initial theme synchronously to prevent flicker
2581
2624
  function $14dac782240849bf$var$getInitialTheme() {
2582
- if (typeof window === 'undefined') return 'light';
2583
- try {
2584
- // First check if blocking script already set the attribute
2585
- const htmlAttribute = document.documentElement.getAttribute('data-color-scheme');
2625
+ if (!(0, $20eaf1306ff19a16$export$4e09c449d6c407f7)) return 'light';
2626
+ // First check if blocking script already set the attribute
2627
+ const htmlElement = (0, $20eaf1306ff19a16$export$9aee702616bdf23c).documentElement;
2628
+ if (htmlElement) {
2629
+ const htmlAttribute = htmlElement.getAttribute('data-color-scheme');
2586
2630
  if (htmlAttribute && (htmlAttribute === 'light' || htmlAttribute === 'dark')) return htmlAttribute;
2587
- // Fallback to localStorage
2588
- const stored = localStorage.getItem($14dac782240849bf$var$THEME_STORAGE_KEY);
2589
- if (stored && (stored === 'light' || stored === 'dark')) return stored;
2590
- // Final fallback to system preference
2591
- return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
2592
- } catch {
2593
- // Fallback if any browser API fails
2594
- return 'light';
2595
2631
  }
2632
+ // Fallback to localStorage
2633
+ const stored = (0, $20eaf1306ff19a16$export$2aa78e70b3d79ddc).getItem($14dac782240849bf$var$THEME_STORAGE_KEY);
2634
+ if (stored && (stored === 'light' || stored === 'dark')) return stored;
2635
+ // Final fallback to system preference
2636
+ return (0, $20eaf1306ff19a16$export$7dd80fbc14cd23b1).matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
2596
2637
  }
2597
2638
  function $14dac782240849bf$export$d8964aec282183a3({ children: children }) {
2598
2639
  // Initialize with a function to avoid SSR issues
2599
2640
  const [colorScheme, setColorScheme] = (0, $3A86U$useState)(()=>{
2600
- if (typeof window === 'undefined') return 'light';
2641
+ if (!(0, $20eaf1306ff19a16$export$4e09c449d6c407f7)) return 'light';
2601
2642
  return $14dac782240849bf$var$getInitialTheme();
2602
2643
  });
2603
2644
  const [mounted, setMounted] = (0, $3A86U$useState)(false);
@@ -2610,9 +2651,10 @@ function $14dac782240849bf$export$d8964aec282183a3({ children: children }) {
2610
2651
  }, []);
2611
2652
  // Update html attribute and localStorage when scheme changes
2612
2653
  (0, $3A86U$useEffect)(()=>{
2613
- if (!mounted) return;
2614
- document.documentElement.setAttribute('data-color-scheme', colorScheme);
2615
- localStorage.setItem($14dac782240849bf$var$THEME_STORAGE_KEY, colorScheme);
2654
+ if (!mounted || !(0, $20eaf1306ff19a16$export$4e09c449d6c407f7)) return;
2655
+ const htmlElement = (0, $20eaf1306ff19a16$export$9aee702616bdf23c).documentElement;
2656
+ if (htmlElement) htmlElement.setAttribute('data-color-scheme', colorScheme);
2657
+ (0, $20eaf1306ff19a16$export$2aa78e70b3d79ddc).setItem($14dac782240849bf$var$THEME_STORAGE_KEY, colorScheme);
2616
2658
  }, [
2617
2659
  colorScheme,
2618
2660
  mounted
@@ -2738,6 +2780,10 @@ var $b5d45cad097c69a9$exports = {};
2738
2780
  $parcel$export($b5d45cad097c69a9$exports, "textFieldInputStyles", () => $4ae0d6a0ccb53610$export$457d6d213bf79459);
2739
2781
  $parcel$export($b5d45cad097c69a9$exports, "getCategoryColors", () => $b413b04534c20d7d$export$2514cbae0d5c71c5);
2740
2782
  $parcel$export($b5d45cad097c69a9$exports, "api", () => $0e62a2c35fb1f646$export$644d8ea042df96a6);
2783
+ $parcel$export($b5d45cad097c69a9$exports, "isBrowser", () => $20eaf1306ff19a16$export$4e09c449d6c407f7);
2784
+ $parcel$export($b5d45cad097c69a9$exports, "safeWindow", () => $20eaf1306ff19a16$export$7dd80fbc14cd23b1);
2785
+ $parcel$export($b5d45cad097c69a9$exports, "safeDocument", () => $20eaf1306ff19a16$export$9aee702616bdf23c);
2786
+ $parcel$export($b5d45cad097c69a9$exports, "safeLocalStorage", () => $20eaf1306ff19a16$export$2aa78e70b3d79ddc);
2741
2787
  // Utilities
2742
2788
  const $4ae0d6a0ccb53610$export$457d6d213bf79459 = ()=>({
2743
2789
  padding: 12,
@@ -2875,6 +2921,7 @@ const $4ae0d6a0ccb53610$export$457d6d213bf79459 = ()=>({
2875
2921
 
2876
2922
 
2877
2923
 
2924
+
2878
2925
  var $be9c1f6b736f678e$exports = {};
2879
2926
  var $2c570e2bb65234ea$exports = {};
2880
2927
 
@@ -2884,5 +2931,5 @@ $parcel$exportWildcard($be9c1f6b736f678e$exports, $2c570e2bb65234ea$exports);
2884
2931
 
2885
2932
 
2886
2933
 
2887
- export {$a6c6e9de70b2177d$export$de466dd8317b0b75 as AlertDialog, $a6c6e9de70b2177d$export$a551a871839880f9 as PromptDialog, $f156c2ac5fd12c51$export$2f2b9559550c7bbc as Autocomplete, $07375c4c274a5e99$export$5f8b5a1eceff31bd as AutocompleteTable, $e2023e6e190b3690$export$37acb3580601e69a as Badge, $4aac1ae7c2a46df4$export$353f5b6fc5456de1 as Button, $35fcc32020885daa$export$48513f6b9f8ce62d as Checkbox, $07aaa6869c77f679$export$de65de8213222d10 as CloseButton, $d6f6f2bb59cbf8cf$export$72b9695b8216309a as ComboBox, $5ddfe94eba6154eb$export$944aceb4f8c89f10 as DisclosureGroup, $a7c96df248e47957$export$221f31a87e5a826c as FilterTabs, $e6c4d3d9e51c440a$export$d1328f67a56fa517 as LabeledValue, $7e3a08a0d5ffc4c6$export$a6c7ac8248d6e38a as Link, $61479464bb5fd0ad$export$c17561cb55d4db30 as ProgressBar, $4f3552ad992cebcc$export$a98f0dcb43a68a25 as RadioGroup, $9260936bb33ab2d4$export$b94867ecbd698f21 as SearchField, $dc7b7ce521817383$export$668709c620d0b8e2 as SegmentedControl, $4c94f3494e92f172$export$ef9b1a59e592288f as Select, $c7af66d6eab82960$export$b5cddb1a6bf990a0 as StatCard, $b32787d33db6deae$export$b5d5cf8927ab7262 as Switch, $8fd64f6a3d6adad1$export$54ec01a60f47d33d as Table, $73303ac6ce50c127$export$b2539bed5023c21c as Tabs, $73303ac6ce50c127$export$e51a686c67fdaa2d as TabList, $73303ac6ce50c127$export$3e41faf802a29e71 as Tab, $73303ac6ce50c127$export$3d96ec278d3efce4 as TabPanel, $db470a4073e4639a$export$f5c9f3c2c4054eec as TextArea, $f62becf1f473d668$export$2c73285ae9390cec as TextField, $14dac782240849bf$export$d8964aec282183a3 as ThemeProvider, $14dac782240849bf$export$93d4e7f90805808f as useTheme, $e4a23425e1acf543$export$a54013f0d02a8f82 as I18nProvider, $e4a23425e1acf543$export$5aebe9a147f4d146 as useIntl, $5035dda096f080f5$export$66b627500eff8faa as FilterProvider, $5035dda096f080f5$export$973ca22476b0e05f as useFilters, $cc88703bd59b1580$export$dad69b6e16969c68 as AxeDevTools, $63f988b4583af0b2$export$42d0f19526e5d9da as DEFAULT_FILTERS, $63f988b4583af0b2$export$a15c90bdf31a4ff3 as hasActiveFilters, $63f988b4583af0b2$export$d0e6b6bfede2a57 as clearFilters, $63f988b4583af0b2$export$fa59a93dacecf201 as updateFilter, $63f988b4583af0b2$export$5d7f9913734d3d5f as filtersToQueryParams, $4ae0d6a0ccb53610$export$457d6d213bf79459 as textFieldInputStyles, $b413b04534c20d7d$export$2514cbae0d5c71c5 as getCategoryColors, $0e62a2c35fb1f646$export$644d8ea042df96a6 as api};
2934
+ export {$a6c6e9de70b2177d$export$de466dd8317b0b75 as AlertDialog, $a6c6e9de70b2177d$export$a551a871839880f9 as PromptDialog, $f156c2ac5fd12c51$export$2f2b9559550c7bbc as Autocomplete, $07375c4c274a5e99$export$5f8b5a1eceff31bd as AutocompleteTable, $e2023e6e190b3690$export$37acb3580601e69a as Badge, $4aac1ae7c2a46df4$export$353f5b6fc5456de1 as Button, $35fcc32020885daa$export$48513f6b9f8ce62d as Checkbox, $07aaa6869c77f679$export$de65de8213222d10 as CloseButton, $d6f6f2bb59cbf8cf$export$72b9695b8216309a as ComboBox, $5ddfe94eba6154eb$export$944aceb4f8c89f10 as DisclosureGroup, $a7c96df248e47957$export$221f31a87e5a826c as FilterTabs, $e6c4d3d9e51c440a$export$d1328f67a56fa517 as LabeledValue, $7e3a08a0d5ffc4c6$export$a6c7ac8248d6e38a as Link, $61479464bb5fd0ad$export$c17561cb55d4db30 as ProgressBar, $4f3552ad992cebcc$export$a98f0dcb43a68a25 as RadioGroup, $9260936bb33ab2d4$export$b94867ecbd698f21 as SearchField, $dc7b7ce521817383$export$668709c620d0b8e2 as SegmentedControl, $4c94f3494e92f172$export$ef9b1a59e592288f as Select, $c7af66d6eab82960$export$b5cddb1a6bf990a0 as StatCard, $b32787d33db6deae$export$b5d5cf8927ab7262 as Switch, $8fd64f6a3d6adad1$export$54ec01a60f47d33d as Table, $73303ac6ce50c127$export$b2539bed5023c21c as Tabs, $73303ac6ce50c127$export$e51a686c67fdaa2d as TabList, $73303ac6ce50c127$export$3e41faf802a29e71 as Tab, $73303ac6ce50c127$export$3d96ec278d3efce4 as TabPanel, $db470a4073e4639a$export$f5c9f3c2c4054eec as TextArea, $f62becf1f473d668$export$2c73285ae9390cec as TextField, $14dac782240849bf$export$d8964aec282183a3 as ThemeProvider, $14dac782240849bf$export$93d4e7f90805808f as useTheme, $e4a23425e1acf543$export$a54013f0d02a8f82 as I18nProvider, $e4a23425e1acf543$export$5aebe9a147f4d146 as useIntl, $5035dda096f080f5$export$66b627500eff8faa as FilterProvider, $5035dda096f080f5$export$973ca22476b0e05f as useFilters, $cc88703bd59b1580$export$dad69b6e16969c68 as AxeDevTools, $63f988b4583af0b2$export$42d0f19526e5d9da as DEFAULT_FILTERS, $63f988b4583af0b2$export$a15c90bdf31a4ff3 as hasActiveFilters, $63f988b4583af0b2$export$d0e6b6bfede2a57 as clearFilters, $63f988b4583af0b2$export$fa59a93dacecf201 as updateFilter, $63f988b4583af0b2$export$5d7f9913734d3d5f as filtersToQueryParams, $4ae0d6a0ccb53610$export$457d6d213bf79459 as textFieldInputStyles, $b413b04534c20d7d$export$2514cbae0d5c71c5 as getCategoryColors, $0e62a2c35fb1f646$export$644d8ea042df96a6 as api, $20eaf1306ff19a16$export$4e09c449d6c407f7 as isBrowser, $20eaf1306ff19a16$export$7dd80fbc14cd23b1 as safeWindow, $20eaf1306ff19a16$export$9aee702616bdf23c as safeDocument, $20eaf1306ff19a16$export$2aa78e70b3d79ddc as safeLocalStorage};
2888
2935
  //# sourceMappingURL=module.mjs.map