fermmap-shared 0.1.10 → 0.1.12
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 +76 -10
- package/dist/main.cjs.map +1 -1
- package/dist/module.mjs +77 -11
- package/dist/module.mjs.map +1 -1
- package/dist/types.d.ts +25 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/main.cjs
CHANGED
|
@@ -2483,6 +2483,61 @@ function $e00b7714d9bed1e1$export$3d96ec278d3efce4({ children: children, ...prop
|
|
|
2483
2483
|
|
|
2484
2484
|
|
|
2485
2485
|
|
|
2486
|
+
/**
|
|
2487
|
+
* Safe browser API wrappers that work in SSR
|
|
2488
|
+
*/ const $de0c62f65c50224a$export$4e09c449d6c407f7 = typeof window !== 'undefined';
|
|
2489
|
+
const $de0c62f65c50224a$export$62858bae88b53fd0 = typeof document !== 'undefined';
|
|
2490
|
+
const $de0c62f65c50224a$export$7dd80fbc14cd23b1 = {
|
|
2491
|
+
get innerHeight () {
|
|
2492
|
+
return $de0c62f65c50224a$export$4e09c449d6c407f7 ? window.innerHeight : 0;
|
|
2493
|
+
},
|
|
2494
|
+
get location () {
|
|
2495
|
+
return $de0c62f65c50224a$export$4e09c449d6c407f7 ? window.location : null;
|
|
2496
|
+
},
|
|
2497
|
+
matchMedia: (query)=>{
|
|
2498
|
+
if (!$de0c62f65c50224a$export$4e09c449d6c407f7) return {
|
|
2499
|
+
matches: false,
|
|
2500
|
+
media: query,
|
|
2501
|
+
addEventListener: ()=>{},
|
|
2502
|
+
removeEventListener: ()=>{}
|
|
2503
|
+
};
|
|
2504
|
+
return window.matchMedia(query);
|
|
2505
|
+
},
|
|
2506
|
+
reload: ()=>{
|
|
2507
|
+
if ($de0c62f65c50224a$export$4e09c449d6c407f7) window.location.reload();
|
|
2508
|
+
}
|
|
2509
|
+
};
|
|
2510
|
+
const $de0c62f65c50224a$export$9aee702616bdf23c = {
|
|
2511
|
+
get documentElement () {
|
|
2512
|
+
return $de0c62f65c50224a$export$62858bae88b53fd0 ? document.documentElement : null;
|
|
2513
|
+
},
|
|
2514
|
+
get referrer () {
|
|
2515
|
+
return $de0c62f65c50224a$export$62858bae88b53fd0 ? document.referrer : '';
|
|
2516
|
+
},
|
|
2517
|
+
createElement: (tag)=>{
|
|
2518
|
+
return $de0c62f65c50224a$export$62858bae88b53fd0 ? document.createElement(tag) : HTMLUnknownElement.prototype;
|
|
2519
|
+
}
|
|
2520
|
+
};
|
|
2521
|
+
const $de0c62f65c50224a$export$2aa78e70b3d79ddc = {
|
|
2522
|
+
getItem: (key)=>{
|
|
2523
|
+
if (!$de0c62f65c50224a$export$4e09c449d6c407f7) return null;
|
|
2524
|
+
try {
|
|
2525
|
+
return localStorage.getItem(key);
|
|
2526
|
+
} catch {
|
|
2527
|
+
return null;
|
|
2528
|
+
}
|
|
2529
|
+
},
|
|
2530
|
+
setItem: (key, value)=>{
|
|
2531
|
+
if (!$de0c62f65c50224a$export$4e09c449d6c407f7) return;
|
|
2532
|
+
try {
|
|
2533
|
+
localStorage.setItem(key, value);
|
|
2534
|
+
} catch {
|
|
2535
|
+
// Silent fail
|
|
2536
|
+
}
|
|
2537
|
+
}
|
|
2538
|
+
};
|
|
2539
|
+
|
|
2540
|
+
|
|
2486
2541
|
const $fad215bb6064e329$var$textareaStyles = function anonymous(props) {
|
|
2487
2542
|
let rules = " ";
|
|
2488
2543
|
rules += ' Te12';
|
|
@@ -2535,7 +2590,7 @@ function $fad215bb6064e329$export$f5c9f3c2c4054eec({ label: label, error: error,
|
|
|
2535
2590
|
// Reset height to recalculate
|
|
2536
2591
|
textarea.style.height = '75px';
|
|
2537
2592
|
// Set to scrollHeight (content height)
|
|
2538
|
-
const newHeight = Math.min(textarea.scrollHeight,
|
|
2593
|
+
const newHeight = Math.min(textarea.scrollHeight, (0, $de0c62f65c50224a$export$7dd80fbc14cd23b1).innerHeight * 0.75 || 64);
|
|
2539
2594
|
textarea.style.height = `${newHeight}px`;
|
|
2540
2595
|
}, [
|
|
2541
2596
|
value
|
|
@@ -2578,24 +2633,28 @@ $parcel$export($885bdde2b07b7632$exports, "AxeDevTools", () => $ac6c22366fad60ff
|
|
|
2578
2633
|
// Contexts & Providers
|
|
2579
2634
|
|
|
2580
2635
|
|
|
2636
|
+
|
|
2581
2637
|
const $3a1d0d18027ba81c$var$ThemeContext = /*#__PURE__*/ (0, $fs04y$react.createContext)(undefined);
|
|
2582
2638
|
const $3a1d0d18027ba81c$var$THEME_STORAGE_KEY = 'fermmap-theme';
|
|
2583
2639
|
// Get initial theme synchronously to prevent flicker
|
|
2584
2640
|
function $3a1d0d18027ba81c$var$getInitialTheme() {
|
|
2585
|
-
if (
|
|
2641
|
+
if (!(0, $de0c62f65c50224a$export$4e09c449d6c407f7)) return 'light';
|
|
2586
2642
|
// First check if blocking script already set the attribute
|
|
2587
|
-
const
|
|
2588
|
-
if (
|
|
2643
|
+
const htmlElement = (0, $de0c62f65c50224a$export$9aee702616bdf23c).documentElement;
|
|
2644
|
+
if (htmlElement) {
|
|
2645
|
+
const htmlAttribute = htmlElement.getAttribute('data-color-scheme');
|
|
2646
|
+
if (htmlAttribute && (htmlAttribute === 'light' || htmlAttribute === 'dark')) return htmlAttribute;
|
|
2647
|
+
}
|
|
2589
2648
|
// Fallback to localStorage
|
|
2590
|
-
const stored =
|
|
2649
|
+
const stored = (0, $de0c62f65c50224a$export$2aa78e70b3d79ddc).getItem($3a1d0d18027ba81c$var$THEME_STORAGE_KEY);
|
|
2591
2650
|
if (stored && (stored === 'light' || stored === 'dark')) return stored;
|
|
2592
2651
|
// Final fallback to system preference
|
|
2593
|
-
return
|
|
2652
|
+
return (0, $de0c62f65c50224a$export$7dd80fbc14cd23b1).matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
|
2594
2653
|
}
|
|
2595
2654
|
function $3a1d0d18027ba81c$export$d8964aec282183a3({ children: children }) {
|
|
2596
2655
|
// Initialize with a function to avoid SSR issues
|
|
2597
2656
|
const [colorScheme, setColorScheme] = (0, $fs04y$react.useState)(()=>{
|
|
2598
|
-
if (
|
|
2657
|
+
if (!(0, $de0c62f65c50224a$export$4e09c449d6c407f7)) return 'light';
|
|
2599
2658
|
return $3a1d0d18027ba81c$var$getInitialTheme();
|
|
2600
2659
|
});
|
|
2601
2660
|
const [mounted, setMounted] = (0, $fs04y$react.useState)(false);
|
|
@@ -2608,9 +2667,10 @@ function $3a1d0d18027ba81c$export$d8964aec282183a3({ children: children }) {
|
|
|
2608
2667
|
}, []);
|
|
2609
2668
|
// Update html attribute and localStorage when scheme changes
|
|
2610
2669
|
(0, $fs04y$react.useEffect)(()=>{
|
|
2611
|
-
if (!mounted) return;
|
|
2612
|
-
|
|
2613
|
-
|
|
2670
|
+
if (!mounted || !(0, $de0c62f65c50224a$export$4e09c449d6c407f7)) return;
|
|
2671
|
+
const htmlElement = (0, $de0c62f65c50224a$export$9aee702616bdf23c).documentElement;
|
|
2672
|
+
if (htmlElement) htmlElement.setAttribute('data-color-scheme', colorScheme);
|
|
2673
|
+
(0, $de0c62f65c50224a$export$2aa78e70b3d79ddc).setItem($3a1d0d18027ba81c$var$THEME_STORAGE_KEY, colorScheme);
|
|
2614
2674
|
}, [
|
|
2615
2675
|
colorScheme,
|
|
2616
2676
|
mounted
|
|
@@ -2736,6 +2796,11 @@ var $0911ce1d49060a15$exports = {};
|
|
|
2736
2796
|
$parcel$export($0911ce1d49060a15$exports, "textFieldInputStyles", () => $53c8911eec26a318$export$457d6d213bf79459);
|
|
2737
2797
|
$parcel$export($0911ce1d49060a15$exports, "getCategoryColors", () => $9df03defd63c82e0$export$2514cbae0d5c71c5);
|
|
2738
2798
|
$parcel$export($0911ce1d49060a15$exports, "api", () => $ace12160cbee4ea7$export$644d8ea042df96a6);
|
|
2799
|
+
$parcel$export($0911ce1d49060a15$exports, "isBrowser", () => $de0c62f65c50224a$export$4e09c449d6c407f7);
|
|
2800
|
+
$parcel$export($0911ce1d49060a15$exports, "isDocument", () => $de0c62f65c50224a$export$62858bae88b53fd0);
|
|
2801
|
+
$parcel$export($0911ce1d49060a15$exports, "safeWindow", () => $de0c62f65c50224a$export$7dd80fbc14cd23b1);
|
|
2802
|
+
$parcel$export($0911ce1d49060a15$exports, "safeDocument", () => $de0c62f65c50224a$export$9aee702616bdf23c);
|
|
2803
|
+
$parcel$export($0911ce1d49060a15$exports, "safeLocalStorage", () => $de0c62f65c50224a$export$2aa78e70b3d79ddc);
|
|
2739
2804
|
// Utilities
|
|
2740
2805
|
const $53c8911eec26a318$export$457d6d213bf79459 = ()=>({
|
|
2741
2806
|
padding: 12,
|
|
@@ -2873,6 +2938,7 @@ const $53c8911eec26a318$export$457d6d213bf79459 = ()=>({
|
|
|
2873
2938
|
|
|
2874
2939
|
|
|
2875
2940
|
|
|
2941
|
+
|
|
2876
2942
|
var $fef1a353edd33d81$exports = {};
|
|
2877
2943
|
var $26e22b40e52bb1d8$exports = {};
|
|
2878
2944
|
|