fermmap-shared 0.1.9 → 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 +10 -63
- package/dist/main.cjs.map +1 -1
- package/dist/module.mjs +11 -64
- package/dist/module.mjs.map +1 -1
- package/dist/types.d.ts +0 -20
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/main.cjs
CHANGED
|
@@ -2482,49 +2482,6 @@ 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
|
-
|
|
2528
2485
|
|
|
2529
2486
|
const $fad215bb6064e329$var$textareaStyles = function anonymous(props) {
|
|
2530
2487
|
let rules = " ";
|
|
@@ -2578,7 +2535,7 @@ function $fad215bb6064e329$export$f5c9f3c2c4054eec({ label: label, error: error,
|
|
|
2578
2535
|
// Reset height to recalculate
|
|
2579
2536
|
textarea.style.height = '75px';
|
|
2580
2537
|
// Set to scrollHeight (content height)
|
|
2581
|
-
const newHeight = Math.min(textarea.scrollHeight,
|
|
2538
|
+
const newHeight = Math.min(textarea.scrollHeight, typeof window !== 'undefined' ? window?.innerHeight * 0.75 : 64);
|
|
2582
2539
|
textarea.style.height = `${newHeight}px`;
|
|
2583
2540
|
}, [
|
|
2584
2541
|
value
|
|
@@ -2621,28 +2578,24 @@ $parcel$export($885bdde2b07b7632$exports, "AxeDevTools", () => $ac6c22366fad60ff
|
|
|
2621
2578
|
// Contexts & Providers
|
|
2622
2579
|
|
|
2623
2580
|
|
|
2624
|
-
|
|
2625
2581
|
const $3a1d0d18027ba81c$var$ThemeContext = /*#__PURE__*/ (0, $fs04y$react.createContext)(undefined);
|
|
2626
2582
|
const $3a1d0d18027ba81c$var$THEME_STORAGE_KEY = 'fermmap-theme';
|
|
2627
2583
|
// Get initial theme synchronously to prevent flicker
|
|
2628
2584
|
function $3a1d0d18027ba81c$var$getInitialTheme() {
|
|
2629
|
-
if (
|
|
2585
|
+
if (typeof window === 'undefined' || typeof document === 'undefined') return 'light';
|
|
2630
2586
|
// First check if blocking script already set the attribute
|
|
2631
|
-
const
|
|
2632
|
-
if (
|
|
2633
|
-
const htmlAttribute = htmlElement.getAttribute('data-color-scheme');
|
|
2634
|
-
if (htmlAttribute && (htmlAttribute === 'light' || htmlAttribute === 'dark')) return htmlAttribute;
|
|
2635
|
-
}
|
|
2587
|
+
const htmlAttribute = document?.documentElement.getAttribute('data-color-scheme');
|
|
2588
|
+
if (htmlAttribute && (htmlAttribute === 'light' || htmlAttribute === 'dark')) return htmlAttribute;
|
|
2636
2589
|
// Fallback to localStorage
|
|
2637
|
-
const stored =
|
|
2590
|
+
const stored = localStorage.getItem($3a1d0d18027ba81c$var$THEME_STORAGE_KEY);
|
|
2638
2591
|
if (stored && (stored === 'light' || stored === 'dark')) return stored;
|
|
2639
2592
|
// Final fallback to system preference
|
|
2640
|
-
return
|
|
2593
|
+
return typeof window !== 'undefined' && window?.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
|
2641
2594
|
}
|
|
2642
2595
|
function $3a1d0d18027ba81c$export$d8964aec282183a3({ children: children }) {
|
|
2643
2596
|
// Initialize with a function to avoid SSR issues
|
|
2644
2597
|
const [colorScheme, setColorScheme] = (0, $fs04y$react.useState)(()=>{
|
|
2645
|
-
if (
|
|
2598
|
+
if (typeof window === 'undefined') return 'light';
|
|
2646
2599
|
return $3a1d0d18027ba81c$var$getInitialTheme();
|
|
2647
2600
|
});
|
|
2648
2601
|
const [mounted, setMounted] = (0, $fs04y$react.useState)(false);
|
|
@@ -2655,10 +2608,9 @@ function $3a1d0d18027ba81c$export$d8964aec282183a3({ children: children }) {
|
|
|
2655
2608
|
}, []);
|
|
2656
2609
|
// Update html attribute and localStorage when scheme changes
|
|
2657
2610
|
(0, $fs04y$react.useEffect)(()=>{
|
|
2658
|
-
if (!mounted
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
(0, $de0c62f65c50224a$export$2aa78e70b3d79ddc).setItem($3a1d0d18027ba81c$var$THEME_STORAGE_KEY, colorScheme);
|
|
2611
|
+
if (!mounted) return;
|
|
2612
|
+
document.documentElement.setAttribute('data-color-scheme', colorScheme);
|
|
2613
|
+
localStorage.setItem($3a1d0d18027ba81c$var$THEME_STORAGE_KEY, colorScheme);
|
|
2662
2614
|
}, [
|
|
2663
2615
|
colorScheme,
|
|
2664
2616
|
mounted
|
|
@@ -2784,10 +2736,6 @@ var $0911ce1d49060a15$exports = {};
|
|
|
2784
2736
|
$parcel$export($0911ce1d49060a15$exports, "textFieldInputStyles", () => $53c8911eec26a318$export$457d6d213bf79459);
|
|
2785
2737
|
$parcel$export($0911ce1d49060a15$exports, "getCategoryColors", () => $9df03defd63c82e0$export$2514cbae0d5c71c5);
|
|
2786
2738
|
$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);
|
|
2791
2739
|
// Utilities
|
|
2792
2740
|
const $53c8911eec26a318$export$457d6d213bf79459 = ()=>({
|
|
2793
2741
|
padding: 12,
|
|
@@ -2925,7 +2873,6 @@ const $53c8911eec26a318$export$457d6d213bf79459 = ()=>({
|
|
|
2925
2873
|
|
|
2926
2874
|
|
|
2927
2875
|
|
|
2928
|
-
|
|
2929
2876
|
var $fef1a353edd33d81$exports = {};
|
|
2930
2877
|
var $26e22b40e52bb1d8$exports = {};
|
|
2931
2878
|
|