@almadar/ui 2.55.1 → 2.57.0
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/avl/index.cjs +1245 -1236
- package/dist/avl/index.js +174 -165
- package/dist/components/index.cjs +1175 -1053
- package/dist/components/index.js +272 -151
- package/dist/components/molecules/FileTree.d.ts +37 -0
- package/dist/components/molecules/index.d.ts +1 -0
- package/dist/components/organisms/game/three/index.cjs +5 -0
- package/dist/components/organisms/game/three/index.js +5 -0
- package/dist/providers/index.cjs +180 -179
- package/dist/providers/index.js +43 -42
- package/dist/runtime/index.cjs +911 -910
- package/dist/runtime/index.js +147 -146
- package/package.json +1 -1
package/dist/providers/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var React115 = require('react');
|
|
4
4
|
var providers = require('@almadar/ui/providers');
|
|
5
5
|
var clsx = require('clsx');
|
|
6
6
|
var tailwindMerge = require('tailwind-merge');
|
|
@@ -55,7 +55,7 @@ function _interopNamespace(e) {
|
|
|
55
55
|
return Object.freeze(n);
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
var
|
|
58
|
+
var React115__namespace = /*#__PURE__*/_interopNamespace(React115);
|
|
59
59
|
var LucideIcons__namespace = /*#__PURE__*/_interopNamespace(LucideIcons);
|
|
60
60
|
var ReactMarkdown__default = /*#__PURE__*/_interopDefault(ReactMarkdown);
|
|
61
61
|
var remarkGfm__default = /*#__PURE__*/_interopDefault(remarkGfm);
|
|
@@ -168,14 +168,14 @@ function getGlobalEventBus() {
|
|
|
168
168
|
return null;
|
|
169
169
|
}
|
|
170
170
|
function useEventBus() {
|
|
171
|
-
const context =
|
|
171
|
+
const context = React115.useContext(providers.EventBusContext);
|
|
172
172
|
return context ?? getGlobalEventBus() ?? fallbackEventBus;
|
|
173
173
|
}
|
|
174
174
|
function useEventListener(event, handler) {
|
|
175
175
|
const eventBus = useEventBus();
|
|
176
|
-
const handlerRef =
|
|
176
|
+
const handlerRef = React115.useRef(handler);
|
|
177
177
|
handlerRef.current = handler;
|
|
178
|
-
|
|
178
|
+
React115.useEffect(() => {
|
|
179
179
|
const wrappedHandler = (evt) => {
|
|
180
180
|
handlerRef.current(evt);
|
|
181
181
|
};
|
|
@@ -187,7 +187,7 @@ function useEventListener(event, handler) {
|
|
|
187
187
|
}
|
|
188
188
|
function useEmitEvent() {
|
|
189
189
|
const eventBus = useEventBus();
|
|
190
|
-
return
|
|
190
|
+
return React115.useCallback(
|
|
191
191
|
(type, payload) => {
|
|
192
192
|
eventBus.emit(type, payload);
|
|
193
193
|
},
|
|
@@ -535,7 +535,7 @@ var BUILT_IN_THEMES = [
|
|
|
535
535
|
hasDarkMode: true
|
|
536
536
|
}
|
|
537
537
|
];
|
|
538
|
-
var ThemeContext =
|
|
538
|
+
var ThemeContext = React115.createContext(void 0);
|
|
539
539
|
var THEME_STORAGE_KEY = "theme";
|
|
540
540
|
var MODE_STORAGE_KEY = "theme-mode";
|
|
541
541
|
function getSystemMode() {
|
|
@@ -555,14 +555,14 @@ var ThemeProvider = ({
|
|
|
555
555
|
defaultMode = "system",
|
|
556
556
|
targetRef
|
|
557
557
|
}) => {
|
|
558
|
-
const availableThemes =
|
|
558
|
+
const availableThemes = React115.useMemo(() => {
|
|
559
559
|
const themeMap = /* @__PURE__ */ new Map();
|
|
560
560
|
BUILT_IN_THEMES.forEach((t) => themeMap.set(t.name, t));
|
|
561
561
|
themes.forEach((t) => themeMap.set(t.name, t));
|
|
562
562
|
return Array.from(themeMap.values());
|
|
563
563
|
}, [themes]);
|
|
564
564
|
const isScoped = !!targetRef;
|
|
565
|
-
const [theme, setThemeState] =
|
|
565
|
+
const [theme, setThemeState] = React115.useState(() => {
|
|
566
566
|
if (isScoped || typeof window === "undefined") return defaultTheme;
|
|
567
567
|
const stored = localStorage.getItem(THEME_STORAGE_KEY);
|
|
568
568
|
const validThemes = [
|
|
@@ -574,7 +574,7 @@ var ThemeProvider = ({
|
|
|
574
574
|
}
|
|
575
575
|
return defaultTheme;
|
|
576
576
|
});
|
|
577
|
-
const [mode, setModeState] =
|
|
577
|
+
const [mode, setModeState] = React115.useState(() => {
|
|
578
578
|
if (isScoped || typeof window === "undefined") return defaultMode;
|
|
579
579
|
const stored = localStorage.getItem(MODE_STORAGE_KEY);
|
|
580
580
|
if (stored === "light" || stored === "dark" || stored === "system") {
|
|
@@ -582,14 +582,14 @@ var ThemeProvider = ({
|
|
|
582
582
|
}
|
|
583
583
|
return defaultMode;
|
|
584
584
|
});
|
|
585
|
-
const [resolvedMode, setResolvedMode] =
|
|
585
|
+
const [resolvedMode, setResolvedMode] = React115.useState(
|
|
586
586
|
() => resolveMode(mode)
|
|
587
587
|
);
|
|
588
|
-
const appliedTheme =
|
|
588
|
+
const appliedTheme = React115.useMemo(
|
|
589
589
|
() => `${theme}-${resolvedMode}`,
|
|
590
590
|
[theme, resolvedMode]
|
|
591
591
|
);
|
|
592
|
-
|
|
592
|
+
React115.useEffect(() => {
|
|
593
593
|
const updateResolved = () => {
|
|
594
594
|
setResolvedMode(resolveMode(mode));
|
|
595
595
|
};
|
|
@@ -602,7 +602,7 @@ var ThemeProvider = ({
|
|
|
602
602
|
}
|
|
603
603
|
return void 0;
|
|
604
604
|
}, [mode]);
|
|
605
|
-
|
|
605
|
+
React115.useEffect(() => {
|
|
606
606
|
if (isScoped) {
|
|
607
607
|
if (targetRef?.current) {
|
|
608
608
|
targetRef.current.setAttribute("data-theme", appliedTheme);
|
|
@@ -616,7 +616,7 @@ var ThemeProvider = ({
|
|
|
616
616
|
root.classList.remove("light", "dark");
|
|
617
617
|
root.classList.add(resolvedMode);
|
|
618
618
|
}, [appliedTheme, resolvedMode, targetRef, isScoped]);
|
|
619
|
-
const setTheme =
|
|
619
|
+
const setTheme = React115.useCallback(
|
|
620
620
|
(newTheme) => {
|
|
621
621
|
const validTheme = availableThemes.find((t) => t.name === newTheme);
|
|
622
622
|
if (validTheme) {
|
|
@@ -632,17 +632,17 @@ var ThemeProvider = ({
|
|
|
632
632
|
},
|
|
633
633
|
[availableThemes]
|
|
634
634
|
);
|
|
635
|
-
const setMode =
|
|
635
|
+
const setMode = React115.useCallback((newMode) => {
|
|
636
636
|
setModeState(newMode);
|
|
637
637
|
if (!isScoped && typeof window !== "undefined") {
|
|
638
638
|
localStorage.setItem(MODE_STORAGE_KEY, newMode);
|
|
639
639
|
}
|
|
640
640
|
}, []);
|
|
641
|
-
const toggleMode =
|
|
641
|
+
const toggleMode = React115.useCallback(() => {
|
|
642
642
|
const newMode = resolvedMode === "dark" ? "light" : "dark";
|
|
643
643
|
setMode(newMode);
|
|
644
644
|
}, [resolvedMode, setMode]);
|
|
645
|
-
const contextValue2 =
|
|
645
|
+
const contextValue2 = React115.useMemo(
|
|
646
646
|
() => ({
|
|
647
647
|
theme,
|
|
648
648
|
mode,
|
|
@@ -786,9 +786,9 @@ function addWatch(entityType, callback) {
|
|
|
786
786
|
};
|
|
787
787
|
}
|
|
788
788
|
function useEntityRef(entityType) {
|
|
789
|
-
const versionRef =
|
|
790
|
-
const dataRef =
|
|
791
|
-
const getSnapshotStable =
|
|
789
|
+
const versionRef = React115.useRef(0);
|
|
790
|
+
const dataRef = React115.useRef([]);
|
|
791
|
+
const getSnapshotStable = React115__namespace.default.useCallback(() => {
|
|
792
792
|
const currentVersion = getVersion(entityType);
|
|
793
793
|
if (currentVersion !== versionRef.current) {
|
|
794
794
|
versionRef.current = currentVersion;
|
|
@@ -796,12 +796,12 @@ function useEntityRef(entityType) {
|
|
|
796
796
|
}
|
|
797
797
|
return dataRef.current;
|
|
798
798
|
}, [entityType]);
|
|
799
|
-
return
|
|
799
|
+
return React115.useSyncExternalStore(subscribeToStore, getSnapshotStable, () => []);
|
|
800
800
|
}
|
|
801
801
|
function useEntityById(entityType, id) {
|
|
802
|
-
const versionRef =
|
|
803
|
-
const dataRef =
|
|
804
|
-
const getSnapshotStable =
|
|
802
|
+
const versionRef = React115.useRef(0);
|
|
803
|
+
const dataRef = React115.useRef(null);
|
|
804
|
+
const getSnapshotStable = React115__namespace.default.useCallback(() => {
|
|
805
805
|
if (!id) return null;
|
|
806
806
|
const currentVersion = getVersion(entityType);
|
|
807
807
|
if (currentVersion !== versionRef.current) {
|
|
@@ -810,12 +810,12 @@ function useEntityById(entityType, id) {
|
|
|
810
810
|
}
|
|
811
811
|
return dataRef.current;
|
|
812
812
|
}, [entityType, id]);
|
|
813
|
-
return
|
|
813
|
+
return React115.useSyncExternalStore(subscribeToStore, getSnapshotStable, () => null);
|
|
814
814
|
}
|
|
815
815
|
function useEntityWatch(entityType, callback) {
|
|
816
|
-
const callbackRef =
|
|
816
|
+
const callbackRef = React115.useRef(callback);
|
|
817
817
|
callbackRef.current = callback;
|
|
818
|
-
|
|
818
|
+
React115.useEffect(() => {
|
|
819
819
|
return addWatch(entityType, (oldData, newData) => {
|
|
820
820
|
callbackRef.current(oldData, newData);
|
|
821
821
|
});
|
|
@@ -830,9 +830,9 @@ var contextValue = {
|
|
|
830
830
|
getSnapshot,
|
|
831
831
|
getById
|
|
832
832
|
};
|
|
833
|
-
var EntityStoreContext =
|
|
833
|
+
var EntityStoreContext = React115.createContext(contextValue);
|
|
834
834
|
function useEntityStore() {
|
|
835
|
-
return
|
|
835
|
+
return React115.useContext(EntityStoreContext);
|
|
836
836
|
}
|
|
837
837
|
function EntityStoreProvider({ children }) {
|
|
838
838
|
return /* @__PURE__ */ jsxRuntime.jsx(EntityStoreContext.Provider, { value: contextValue, children });
|
|
@@ -843,12 +843,12 @@ init_useEventBus();
|
|
|
843
843
|
init_logger();
|
|
844
844
|
var busLog = createLogger("almadar:eventbus");
|
|
845
845
|
var subLog2 = createLogger("almadar:eventbus:subscribe");
|
|
846
|
-
var EventBusContext2 =
|
|
846
|
+
var EventBusContext2 = React115.createContext(null);
|
|
847
847
|
function EventBusProvider({ children, debug: debug2 = false }) {
|
|
848
|
-
const listenersRef =
|
|
849
|
-
const anyListenersRef =
|
|
850
|
-
const deprecationWarningShown =
|
|
851
|
-
const getSelectedEntity =
|
|
848
|
+
const listenersRef = React115.useRef(/* @__PURE__ */ new Map());
|
|
849
|
+
const anyListenersRef = React115.useRef(/* @__PURE__ */ new Set());
|
|
850
|
+
const deprecationWarningShown = React115.useRef(false);
|
|
851
|
+
const getSelectedEntity = React115.useCallback(() => {
|
|
852
852
|
if (!deprecationWarningShown.current) {
|
|
853
853
|
console.warn(
|
|
854
854
|
"[EventBus] getSelectedEntity is deprecated. Use SelectionProvider and useSelection hook instead. See SelectionProvider.tsx for migration guide."
|
|
@@ -857,7 +857,7 @@ function EventBusProvider({ children, debug: debug2 = false }) {
|
|
|
857
857
|
}
|
|
858
858
|
return null;
|
|
859
859
|
}, []);
|
|
860
|
-
const clearSelectedEntity =
|
|
860
|
+
const clearSelectedEntity = React115.useCallback(() => {
|
|
861
861
|
if (!deprecationWarningShown.current) {
|
|
862
862
|
console.warn(
|
|
863
863
|
"[EventBus] clearSelectedEntity is deprecated. Use SelectionProvider and useSelection hook instead. See SelectionProvider.tsx for migration guide."
|
|
@@ -865,7 +865,7 @@ function EventBusProvider({ children, debug: debug2 = false }) {
|
|
|
865
865
|
deprecationWarningShown.current = true;
|
|
866
866
|
}
|
|
867
867
|
}, []);
|
|
868
|
-
const emit =
|
|
868
|
+
const emit = React115.useCallback((type, payload) => {
|
|
869
869
|
const event = {
|
|
870
870
|
type,
|
|
871
871
|
payload,
|
|
@@ -900,7 +900,7 @@ function EventBusProvider({ children, debug: debug2 = false }) {
|
|
|
900
900
|
}
|
|
901
901
|
}
|
|
902
902
|
}, [debug2]);
|
|
903
|
-
const on =
|
|
903
|
+
const on = React115.useCallback((type, listener) => {
|
|
904
904
|
if (!listenersRef.current.has(type)) {
|
|
905
905
|
listenersRef.current.set(type, /* @__PURE__ */ new Set());
|
|
906
906
|
}
|
|
@@ -920,18 +920,18 @@ function EventBusProvider({ children, debug: debug2 = false }) {
|
|
|
920
920
|
}
|
|
921
921
|
};
|
|
922
922
|
}, [debug2]);
|
|
923
|
-
const once =
|
|
923
|
+
const once = React115.useCallback((type, listener) => {
|
|
924
924
|
const wrappedListener = (event) => {
|
|
925
925
|
listenersRef.current.get(type)?.delete(wrappedListener);
|
|
926
926
|
listener(event);
|
|
927
927
|
};
|
|
928
928
|
return on(type, wrappedListener);
|
|
929
929
|
}, [on]);
|
|
930
|
-
const hasListeners =
|
|
930
|
+
const hasListeners = React115.useCallback((type) => {
|
|
931
931
|
const listeners6 = listenersRef.current.get(type);
|
|
932
932
|
return listeners6 !== void 0 && listeners6.size > 0;
|
|
933
933
|
}, []);
|
|
934
|
-
const onAny =
|
|
934
|
+
const onAny = React115.useCallback((listener) => {
|
|
935
935
|
anyListenersRef.current.add(listener);
|
|
936
936
|
subLog2.debug("subscribe:any", { totalAnyListeners: anyListenersRef.current.size });
|
|
937
937
|
if (debug2) {
|
|
@@ -944,7 +944,7 @@ function EventBusProvider({ children, debug: debug2 = false }) {
|
|
|
944
944
|
}
|
|
945
945
|
};
|
|
946
946
|
}, [debug2]);
|
|
947
|
-
const contextValue2 =
|
|
947
|
+
const contextValue2 = React115.useMemo(
|
|
948
948
|
() => ({
|
|
949
949
|
emit,
|
|
950
950
|
on,
|
|
@@ -956,7 +956,7 @@ function EventBusProvider({ children, debug: debug2 = false }) {
|
|
|
956
956
|
}),
|
|
957
957
|
[emit, on, once, hasListeners, onAny, getSelectedEntity, clearSelectedEntity]
|
|
958
958
|
);
|
|
959
|
-
|
|
959
|
+
React115.useEffect(() => {
|
|
960
960
|
setGlobalEventBus(contextValue2);
|
|
961
961
|
return () => {
|
|
962
962
|
setGlobalEventBus(null);
|
|
@@ -967,7 +967,7 @@ function EventBusProvider({ children, debug: debug2 = false }) {
|
|
|
967
967
|
|
|
968
968
|
// providers/SelectionProvider.tsx
|
|
969
969
|
init_useEventBus();
|
|
970
|
-
var SelectionContext =
|
|
970
|
+
var SelectionContext = React115.createContext(null);
|
|
971
971
|
var defaultCompareEntities = (a, b) => {
|
|
972
972
|
if (a === b) return true;
|
|
973
973
|
if (!a || !b) return false;
|
|
@@ -984,8 +984,8 @@ function SelectionProvider({
|
|
|
984
984
|
compareEntities = defaultCompareEntities
|
|
985
985
|
}) {
|
|
986
986
|
const eventBus = useEventBus();
|
|
987
|
-
const [selected, setSelectedState] =
|
|
988
|
-
const setSelected =
|
|
987
|
+
const [selected, setSelectedState] = React115.useState(null);
|
|
988
|
+
const setSelected = React115.useCallback(
|
|
989
989
|
(entity) => {
|
|
990
990
|
setSelectedState(entity);
|
|
991
991
|
if (debug2) {
|
|
@@ -994,19 +994,19 @@ function SelectionProvider({
|
|
|
994
994
|
},
|
|
995
995
|
[debug2]
|
|
996
996
|
);
|
|
997
|
-
const clearSelection =
|
|
997
|
+
const clearSelection = React115.useCallback(() => {
|
|
998
998
|
setSelectedState(null);
|
|
999
999
|
if (debug2) {
|
|
1000
1000
|
console.log("[SelectionProvider] Selection cleared");
|
|
1001
1001
|
}
|
|
1002
1002
|
}, [debug2]);
|
|
1003
|
-
const isSelected =
|
|
1003
|
+
const isSelected = React115.useCallback(
|
|
1004
1004
|
(entity) => {
|
|
1005
1005
|
return compareEntities(selected, entity);
|
|
1006
1006
|
},
|
|
1007
1007
|
[selected, compareEntities]
|
|
1008
1008
|
);
|
|
1009
|
-
|
|
1009
|
+
React115.useEffect(() => {
|
|
1010
1010
|
const handleSelect = (event) => {
|
|
1011
1011
|
const row = event.payload?.row;
|
|
1012
1012
|
if (row) {
|
|
@@ -1044,17 +1044,17 @@ function SelectionProvider({
|
|
|
1044
1044
|
return /* @__PURE__ */ jsxRuntime.jsx(SelectionContext.Provider, { value: contextValue2, children });
|
|
1045
1045
|
}
|
|
1046
1046
|
function useSelection() {
|
|
1047
|
-
const context =
|
|
1047
|
+
const context = React115.useContext(SelectionContext);
|
|
1048
1048
|
if (!context) {
|
|
1049
1049
|
throw new Error("useSelection must be used within a SelectionProvider");
|
|
1050
1050
|
}
|
|
1051
1051
|
return context;
|
|
1052
1052
|
}
|
|
1053
1053
|
function useSelectionOptional() {
|
|
1054
|
-
const context =
|
|
1054
|
+
const context = React115.useContext(SelectionContext);
|
|
1055
1055
|
return context;
|
|
1056
1056
|
}
|
|
1057
|
-
|
|
1057
|
+
React115.createContext(null);
|
|
1058
1058
|
|
|
1059
1059
|
// components/atoms/Icon.tsx
|
|
1060
1060
|
init_cn();
|
|
@@ -1199,7 +1199,7 @@ var positionStyles = {
|
|
|
1199
1199
|
fixed: "fixed",
|
|
1200
1200
|
sticky: "sticky"
|
|
1201
1201
|
};
|
|
1202
|
-
var Box =
|
|
1202
|
+
var Box = React115__namespace.default.forwardRef(
|
|
1203
1203
|
({
|
|
1204
1204
|
padding,
|
|
1205
1205
|
paddingX,
|
|
@@ -1229,20 +1229,20 @@ var Box = React114__namespace.default.forwardRef(
|
|
|
1229
1229
|
...rest
|
|
1230
1230
|
}, ref) => {
|
|
1231
1231
|
const eventBus = useEventBus();
|
|
1232
|
-
const handleClick =
|
|
1232
|
+
const handleClick = React115.useCallback((e) => {
|
|
1233
1233
|
if (action) {
|
|
1234
1234
|
e.stopPropagation();
|
|
1235
1235
|
eventBus.emit(`UI:${action}`, actionPayload ?? {});
|
|
1236
1236
|
}
|
|
1237
1237
|
onClick?.(e);
|
|
1238
1238
|
}, [action, actionPayload, eventBus, onClick]);
|
|
1239
|
-
const handleMouseEnter =
|
|
1239
|
+
const handleMouseEnter = React115.useCallback((e) => {
|
|
1240
1240
|
if (hoverEvent) {
|
|
1241
1241
|
eventBus.emit(`UI:${hoverEvent}`, { hovered: true });
|
|
1242
1242
|
}
|
|
1243
1243
|
onMouseEnter?.(e);
|
|
1244
1244
|
}, [hoverEvent, eventBus, onMouseEnter]);
|
|
1245
|
-
const handleMouseLeave =
|
|
1245
|
+
const handleMouseLeave = React115.useCallback((e) => {
|
|
1246
1246
|
if (hoverEvent) {
|
|
1247
1247
|
eventBus.emit(`UI:${hoverEvent}`, { hovered: false });
|
|
1248
1248
|
}
|
|
@@ -1384,7 +1384,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
1384
1384
|
const IconComp = value;
|
|
1385
1385
|
return /* @__PURE__ */ jsxRuntime.jsx(IconComp, { className: sizeClass });
|
|
1386
1386
|
}
|
|
1387
|
-
if (
|
|
1387
|
+
if (React115__namespace.default.isValidElement(value)) {
|
|
1388
1388
|
return value;
|
|
1389
1389
|
}
|
|
1390
1390
|
if (typeof value === "object" && value !== null && "render" in value) {
|
|
@@ -1393,7 +1393,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
1393
1393
|
}
|
|
1394
1394
|
return value;
|
|
1395
1395
|
}
|
|
1396
|
-
var Button =
|
|
1396
|
+
var Button = React115__namespace.default.forwardRef(
|
|
1397
1397
|
({
|
|
1398
1398
|
className,
|
|
1399
1399
|
variant = "primary",
|
|
@@ -1492,7 +1492,7 @@ var sizeStyles3 = {
|
|
|
1492
1492
|
md: "px-2.5 py-1 text-sm",
|
|
1493
1493
|
lg: "px-3 py-1.5 text-base"
|
|
1494
1494
|
};
|
|
1495
|
-
var Badge =
|
|
1495
|
+
var Badge = React115__namespace.default.forwardRef(
|
|
1496
1496
|
({ className, variant = "default", size = "sm", amount, label, icon, children, ...props }, ref) => {
|
|
1497
1497
|
const iconSizes2 = { sm: "w-3 h-3", md: "w-3.5 h-3.5", lg: "w-4 h-4" };
|
|
1498
1498
|
const resolvedIcon = typeof icon === "string" ? (() => {
|
|
@@ -1536,7 +1536,7 @@ init_cn();
|
|
|
1536
1536
|
|
|
1537
1537
|
// components/atoms/Input.tsx
|
|
1538
1538
|
init_cn();
|
|
1539
|
-
var Input =
|
|
1539
|
+
var Input = React115__namespace.default.forwardRef(
|
|
1540
1540
|
({
|
|
1541
1541
|
className,
|
|
1542
1542
|
inputType,
|
|
@@ -1651,7 +1651,7 @@ Input.displayName = "Input";
|
|
|
1651
1651
|
|
|
1652
1652
|
// components/atoms/Label.tsx
|
|
1653
1653
|
init_cn();
|
|
1654
|
-
var Label =
|
|
1654
|
+
var Label = React115__namespace.default.forwardRef(
|
|
1655
1655
|
({ className, required, children, ...props }, ref) => {
|
|
1656
1656
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1657
1657
|
"label",
|
|
@@ -1674,7 +1674,7 @@ Label.displayName = "Label";
|
|
|
1674
1674
|
|
|
1675
1675
|
// components/atoms/Textarea.tsx
|
|
1676
1676
|
init_cn();
|
|
1677
|
-
var Textarea =
|
|
1677
|
+
var Textarea = React115__namespace.default.forwardRef(
|
|
1678
1678
|
({ className, error, ...props }, ref) => {
|
|
1679
1679
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1680
1680
|
"textarea",
|
|
@@ -1700,7 +1700,7 @@ Textarea.displayName = "Textarea";
|
|
|
1700
1700
|
|
|
1701
1701
|
// components/atoms/Select.tsx
|
|
1702
1702
|
init_cn();
|
|
1703
|
-
var Select =
|
|
1703
|
+
var Select = React115__namespace.default.forwardRef(
|
|
1704
1704
|
({ className, options, placeholder, error, ...props }, ref) => {
|
|
1705
1705
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
1706
1706
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -1739,7 +1739,7 @@ Select.displayName = "Select";
|
|
|
1739
1739
|
|
|
1740
1740
|
// components/atoms/Checkbox.tsx
|
|
1741
1741
|
init_cn();
|
|
1742
|
-
var Checkbox =
|
|
1742
|
+
var Checkbox = React115__namespace.default.forwardRef(
|
|
1743
1743
|
({ className, label, id, ...props }, ref) => {
|
|
1744
1744
|
const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
1745
1745
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center", children: [
|
|
@@ -1818,7 +1818,7 @@ var shadowStyles2 = {
|
|
|
1818
1818
|
md: "shadow",
|
|
1819
1819
|
lg: "shadow-lg"
|
|
1820
1820
|
};
|
|
1821
|
-
var Card =
|
|
1821
|
+
var Card = React115__namespace.default.forwardRef(
|
|
1822
1822
|
({
|
|
1823
1823
|
className,
|
|
1824
1824
|
variant = "bordered",
|
|
@@ -1854,9 +1854,9 @@ var Card = React114__namespace.default.forwardRef(
|
|
|
1854
1854
|
}
|
|
1855
1855
|
);
|
|
1856
1856
|
Card.displayName = "Card";
|
|
1857
|
-
var CardHeader =
|
|
1857
|
+
var CardHeader = React115__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
1858
1858
|
CardHeader.displayName = "CardHeader";
|
|
1859
|
-
var CardTitle =
|
|
1859
|
+
var CardTitle = React115__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1860
1860
|
"h3",
|
|
1861
1861
|
{
|
|
1862
1862
|
ref,
|
|
@@ -1869,11 +1869,11 @@ var CardTitle = React114__namespace.default.forwardRef(({ className, ...props },
|
|
|
1869
1869
|
}
|
|
1870
1870
|
));
|
|
1871
1871
|
CardTitle.displayName = "CardTitle";
|
|
1872
|
-
var CardContent =
|
|
1872
|
+
var CardContent = React115__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("", className), ...props }));
|
|
1873
1873
|
CardContent.displayName = "CardContent";
|
|
1874
1874
|
var CardBody = CardContent;
|
|
1875
1875
|
CardBody.displayName = "CardBody";
|
|
1876
|
-
var CardFooter =
|
|
1876
|
+
var CardFooter = React115__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1877
1877
|
"div",
|
|
1878
1878
|
{
|
|
1879
1879
|
ref,
|
|
@@ -1891,7 +1891,7 @@ var sizeStyles4 = {
|
|
|
1891
1891
|
md: "h-6 w-6",
|
|
1892
1892
|
lg: "h-8 w-8"
|
|
1893
1893
|
};
|
|
1894
|
-
var Spinner =
|
|
1894
|
+
var Spinner = React115__namespace.default.forwardRef(
|
|
1895
1895
|
({ className, size = "md", ...props }, ref) => {
|
|
1896
1896
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1897
1897
|
"div",
|
|
@@ -1921,7 +1921,7 @@ init_cn();
|
|
|
1921
1921
|
|
|
1922
1922
|
// components/atoms/Radio.tsx
|
|
1923
1923
|
init_cn();
|
|
1924
|
-
var Radio =
|
|
1924
|
+
var Radio = React115__namespace.default.forwardRef(
|
|
1925
1925
|
({
|
|
1926
1926
|
label,
|
|
1927
1927
|
helperText,
|
|
@@ -2028,7 +2028,7 @@ Radio.displayName = "Radio";
|
|
|
2028
2028
|
|
|
2029
2029
|
// components/atoms/Switch.tsx
|
|
2030
2030
|
init_cn();
|
|
2031
|
-
var Switch =
|
|
2031
|
+
var Switch = React115__namespace.forwardRef(
|
|
2032
2032
|
({
|
|
2033
2033
|
checked,
|
|
2034
2034
|
defaultChecked = false,
|
|
@@ -2039,10 +2039,10 @@ var Switch = React114__namespace.forwardRef(
|
|
|
2039
2039
|
name,
|
|
2040
2040
|
className
|
|
2041
2041
|
}, ref) => {
|
|
2042
|
-
const [isChecked, setIsChecked] =
|
|
2042
|
+
const [isChecked, setIsChecked] = React115__namespace.useState(
|
|
2043
2043
|
checked !== void 0 ? checked : defaultChecked
|
|
2044
2044
|
);
|
|
2045
|
-
|
|
2045
|
+
React115__namespace.useEffect(() => {
|
|
2046
2046
|
if (checked !== void 0) {
|
|
2047
2047
|
setIsChecked(checked);
|
|
2048
2048
|
}
|
|
@@ -2232,7 +2232,7 @@ var sizeStyles5 = {
|
|
|
2232
2232
|
md: "w-2.5 h-2.5",
|
|
2233
2233
|
lg: "w-3 h-3"
|
|
2234
2234
|
};
|
|
2235
|
-
var StatusDot =
|
|
2235
|
+
var StatusDot = React115__namespace.default.forwardRef(
|
|
2236
2236
|
({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
|
|
2237
2237
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2238
2238
|
"span",
|
|
@@ -2282,7 +2282,7 @@ var iconMap2 = {
|
|
|
2282
2282
|
down: LucideIcons.TrendingDown,
|
|
2283
2283
|
flat: LucideIcons.ArrowRight
|
|
2284
2284
|
};
|
|
2285
|
-
var TrendIndicator =
|
|
2285
|
+
var TrendIndicator = React115__namespace.default.forwardRef(
|
|
2286
2286
|
({
|
|
2287
2287
|
className,
|
|
2288
2288
|
value,
|
|
@@ -2345,7 +2345,7 @@ var thumbSizes = {
|
|
|
2345
2345
|
md: "w-4 h-4",
|
|
2346
2346
|
lg: "w-5 h-5"
|
|
2347
2347
|
};
|
|
2348
|
-
var RangeSlider =
|
|
2348
|
+
var RangeSlider = React115__namespace.default.forwardRef(
|
|
2349
2349
|
({
|
|
2350
2350
|
className,
|
|
2351
2351
|
min = 0,
|
|
@@ -2363,14 +2363,14 @@ var RangeSlider = React114__namespace.default.forwardRef(
|
|
|
2363
2363
|
formatValue: formatValue5,
|
|
2364
2364
|
...props
|
|
2365
2365
|
}, ref) => {
|
|
2366
|
-
const [isDragging, setIsDragging] =
|
|
2367
|
-
const [showTip, setShowTip] =
|
|
2368
|
-
const inputRef =
|
|
2366
|
+
const [isDragging, setIsDragging] = React115.useState(false);
|
|
2367
|
+
const [showTip, setShowTip] = React115.useState(false);
|
|
2368
|
+
const inputRef = React115.useRef(null);
|
|
2369
2369
|
const eventBus = useSafeEventBus();
|
|
2370
2370
|
const percentage = max !== min ? (value - min) / (max - min) * 100 : 0;
|
|
2371
2371
|
const bufferedPercentage = buffered !== void 0 ? Math.min(buffered, 100) : void 0;
|
|
2372
2372
|
const displayValue = formatValue5 ? formatValue5(value) : String(value);
|
|
2373
|
-
const handleChange =
|
|
2373
|
+
const handleChange = React115.useCallback(
|
|
2374
2374
|
(e) => {
|
|
2375
2375
|
const newValue = Number(e.target.value);
|
|
2376
2376
|
onChange?.(newValue);
|
|
@@ -2576,7 +2576,7 @@ var paddingClasses = {
|
|
|
2576
2576
|
md: "py-16",
|
|
2577
2577
|
lg: "py-24"
|
|
2578
2578
|
};
|
|
2579
|
-
var ContentSection =
|
|
2579
|
+
var ContentSection = React115__namespace.default.forwardRef(
|
|
2580
2580
|
({ children, background = "default", padding = "lg", id, className }, ref) => {
|
|
2581
2581
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2582
2582
|
Box,
|
|
@@ -2618,7 +2618,7 @@ var animatedStyles = {
|
|
|
2618
2618
|
"scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
|
|
2619
2619
|
"none": {}
|
|
2620
2620
|
};
|
|
2621
|
-
var AnimatedReveal =
|
|
2621
|
+
var AnimatedReveal = React115__namespace.default.forwardRef(
|
|
2622
2622
|
({
|
|
2623
2623
|
trigger = "scroll",
|
|
2624
2624
|
animation = "fade-up",
|
|
@@ -2633,10 +2633,10 @@ var AnimatedReveal = React114__namespace.default.forwardRef(
|
|
|
2633
2633
|
style,
|
|
2634
2634
|
...props
|
|
2635
2635
|
}, forwardedRef) => {
|
|
2636
|
-
const [isAnimated, setIsAnimated] =
|
|
2637
|
-
const internalRef =
|
|
2638
|
-
const hasAnimated =
|
|
2639
|
-
const setRef =
|
|
2636
|
+
const [isAnimated, setIsAnimated] = React115.useState(false);
|
|
2637
|
+
const internalRef = React115.useRef(null);
|
|
2638
|
+
const hasAnimated = React115.useRef(false);
|
|
2639
|
+
const setRef = React115.useCallback(
|
|
2640
2640
|
(node) => {
|
|
2641
2641
|
internalRef.current = node;
|
|
2642
2642
|
if (typeof forwardedRef === "function") forwardedRef(node);
|
|
@@ -2644,7 +2644,7 @@ var AnimatedReveal = React114__namespace.default.forwardRef(
|
|
|
2644
2644
|
},
|
|
2645
2645
|
[forwardedRef]
|
|
2646
2646
|
);
|
|
2647
|
-
|
|
2647
|
+
React115.useEffect(() => {
|
|
2648
2648
|
if (trigger !== "scroll") return;
|
|
2649
2649
|
const el = internalRef.current;
|
|
2650
2650
|
if (!el) return;
|
|
@@ -2670,7 +2670,7 @@ var AnimatedReveal = React114__namespace.default.forwardRef(
|
|
|
2670
2670
|
setIsAnimated(false);
|
|
2671
2671
|
}
|
|
2672
2672
|
} : void 0;
|
|
2673
|
-
|
|
2673
|
+
React115.useEffect(() => {
|
|
2674
2674
|
if (trigger === "manual" && manualAnimate !== void 0) {
|
|
2675
2675
|
setIsAnimated(manualAnimate);
|
|
2676
2676
|
}
|
|
@@ -2703,9 +2703,9 @@ AnimatedReveal.displayName = "AnimatedReveal";
|
|
|
2703
2703
|
// components/atoms/AnimatedGraphic.tsx
|
|
2704
2704
|
init_cn();
|
|
2705
2705
|
function useFetchedSvg(src) {
|
|
2706
|
-
const [svg, setSvg] =
|
|
2707
|
-
const cache =
|
|
2708
|
-
|
|
2706
|
+
const [svg, setSvg] = React115.useState(null);
|
|
2707
|
+
const cache = React115.useRef({});
|
|
2708
|
+
React115.useEffect(() => {
|
|
2709
2709
|
if (!src) {
|
|
2710
2710
|
setSvg(null);
|
|
2711
2711
|
return;
|
|
@@ -2774,7 +2774,7 @@ function applyMorphAnimation(container, animate, duration, delay, easing) {
|
|
|
2774
2774
|
el.style.opacity = animate ? "1" : "0";
|
|
2775
2775
|
});
|
|
2776
2776
|
}
|
|
2777
|
-
var AnimatedGraphic =
|
|
2777
|
+
var AnimatedGraphic = React115__namespace.default.forwardRef(
|
|
2778
2778
|
({
|
|
2779
2779
|
src,
|
|
2780
2780
|
svgContent,
|
|
@@ -2793,11 +2793,11 @@ var AnimatedGraphic = React114__namespace.default.forwardRef(
|
|
|
2793
2793
|
children,
|
|
2794
2794
|
...props
|
|
2795
2795
|
}, ref) => {
|
|
2796
|
-
const containerRef =
|
|
2796
|
+
const containerRef = React115.useRef(null);
|
|
2797
2797
|
const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
|
|
2798
2798
|
const resolvedSvg = svgContent ?? fetchedSvg;
|
|
2799
|
-
const prevAnimateRef =
|
|
2800
|
-
const setRef =
|
|
2799
|
+
const prevAnimateRef = React115.useRef(animate);
|
|
2800
|
+
const setRef = React115__namespace.default.useCallback(
|
|
2801
2801
|
(node) => {
|
|
2802
2802
|
containerRef.current = node;
|
|
2803
2803
|
if (typeof ref === "function") ref(node);
|
|
@@ -2805,7 +2805,7 @@ var AnimatedGraphic = React114__namespace.default.forwardRef(
|
|
|
2805
2805
|
},
|
|
2806
2806
|
[ref]
|
|
2807
2807
|
);
|
|
2808
|
-
|
|
2808
|
+
React115.useEffect(() => {
|
|
2809
2809
|
const el = containerRef.current;
|
|
2810
2810
|
if (!el || !strokeColor) return;
|
|
2811
2811
|
const paths = el.querySelectorAll("path, line, polyline, polygon, circle, ellipse, rect");
|
|
@@ -2813,7 +2813,7 @@ var AnimatedGraphic = React114__namespace.default.forwardRef(
|
|
|
2813
2813
|
p2.style.stroke = strokeColor;
|
|
2814
2814
|
});
|
|
2815
2815
|
}, [resolvedSvg, strokeColor]);
|
|
2816
|
-
|
|
2816
|
+
React115.useEffect(() => {
|
|
2817
2817
|
const el = containerRef.current;
|
|
2818
2818
|
if (!el || !resolvedSvg) return;
|
|
2819
2819
|
if (animation === "draw" || animation === "fill") {
|
|
@@ -2838,7 +2838,7 @@ var AnimatedGraphic = React114__namespace.default.forwardRef(
|
|
|
2838
2838
|
});
|
|
2839
2839
|
}
|
|
2840
2840
|
}, [resolvedSvg, animation]);
|
|
2841
|
-
|
|
2841
|
+
React115.useEffect(() => {
|
|
2842
2842
|
const el = containerRef.current;
|
|
2843
2843
|
if (!el) return;
|
|
2844
2844
|
const id = requestAnimationFrame(() => {
|
|
@@ -3053,7 +3053,7 @@ var en_default = {
|
|
|
3053
3053
|
// hooks/useTranslate.ts
|
|
3054
3054
|
var { $meta: _meta, ...coreMessages } = en_default;
|
|
3055
3055
|
var coreLocale = coreMessages;
|
|
3056
|
-
var I18nContext =
|
|
3056
|
+
var I18nContext = React115.createContext({
|
|
3057
3057
|
locale: "en",
|
|
3058
3058
|
direction: "ltr",
|
|
3059
3059
|
t: (key) => coreLocale[key] ?? key
|
|
@@ -3062,7 +3062,7 @@ var I18nContext = React114.createContext({
|
|
|
3062
3062
|
I18nContext.displayName = "I18nContext";
|
|
3063
3063
|
I18nContext.Provider;
|
|
3064
3064
|
function useTranslate() {
|
|
3065
|
-
return
|
|
3065
|
+
return React115.useContext(I18nContext);
|
|
3066
3066
|
}
|
|
3067
3067
|
var ErrorState = ({
|
|
3068
3068
|
title,
|
|
@@ -3098,7 +3098,7 @@ var ErrorState = ({
|
|
|
3098
3098
|
);
|
|
3099
3099
|
};
|
|
3100
3100
|
ErrorState.displayName = "ErrorState";
|
|
3101
|
-
var ErrorBoundary = class extends
|
|
3101
|
+
var ErrorBoundary = class extends React115__namespace.default.Component {
|
|
3102
3102
|
constructor(props) {
|
|
3103
3103
|
super(props);
|
|
3104
3104
|
__publicField(this, "reset", () => {
|
|
@@ -3200,7 +3200,7 @@ function executeNotify(message, options, config) {
|
|
|
3200
3200
|
function executeEmit(event, payload, config) {
|
|
3201
3201
|
config.eventBus.emit(event, payload);
|
|
3202
3202
|
}
|
|
3203
|
-
var ClientEffectConfigContext =
|
|
3203
|
+
var ClientEffectConfigContext = React115.createContext(null);
|
|
3204
3204
|
ClientEffectConfigContext.Provider;
|
|
3205
3205
|
var effectIdCounter = 0;
|
|
3206
3206
|
function generateEffectId() {
|
|
@@ -3439,14 +3439,14 @@ var OfflineExecutor = class {
|
|
|
3439
3439
|
}
|
|
3440
3440
|
};
|
|
3441
3441
|
function useOfflineExecutor(options) {
|
|
3442
|
-
const executorRef =
|
|
3443
|
-
const [state, setState] =
|
|
3442
|
+
const executorRef = React115.useRef(null);
|
|
3443
|
+
const [state, setState] = React115.useState({
|
|
3444
3444
|
isOffline: false,
|
|
3445
3445
|
syncQueue: [],
|
|
3446
3446
|
localEffectsProcessed: 0,
|
|
3447
3447
|
effectsSynced: 0
|
|
3448
3448
|
});
|
|
3449
|
-
|
|
3449
|
+
React115.useEffect(() => {
|
|
3450
3450
|
const executor = new OfflineExecutor({
|
|
3451
3451
|
...options,
|
|
3452
3452
|
onQueueChange: (queue) => {
|
|
@@ -3461,7 +3461,7 @@ function useOfflineExecutor(options) {
|
|
|
3461
3461
|
executorRef.current = null;
|
|
3462
3462
|
};
|
|
3463
3463
|
}, []);
|
|
3464
|
-
|
|
3464
|
+
React115.useEffect(() => {
|
|
3465
3465
|
if (!options.autoSync || !options.serverUrl) return;
|
|
3466
3466
|
const handleOnline = async () => {
|
|
3467
3467
|
if (executorRef.current) {
|
|
@@ -3475,13 +3475,13 @@ function useOfflineExecutor(options) {
|
|
|
3475
3475
|
window.addEventListener("online", handleOnline);
|
|
3476
3476
|
return () => window.removeEventListener("online", handleOnline);
|
|
3477
3477
|
}, [options.autoSync, options.serverUrl, options.authToken]);
|
|
3478
|
-
const executeEffects =
|
|
3478
|
+
const executeEffects = React115.useCallback((effects) => {
|
|
3479
3479
|
executorRef.current?.executeClientEffects(effects);
|
|
3480
3480
|
if (executorRef.current) {
|
|
3481
3481
|
setState(executorRef.current.getState());
|
|
3482
3482
|
}
|
|
3483
3483
|
}, []);
|
|
3484
|
-
const processEventOffline =
|
|
3484
|
+
const processEventOffline = React115.useCallback(
|
|
3485
3485
|
(event, payload, effects) => {
|
|
3486
3486
|
const result = executorRef.current?.processEventOffline(event, payload, effects);
|
|
3487
3487
|
if (executorRef.current) {
|
|
@@ -3491,7 +3491,7 @@ function useOfflineExecutor(options) {
|
|
|
3491
3491
|
},
|
|
3492
3492
|
[]
|
|
3493
3493
|
);
|
|
3494
|
-
const sync =
|
|
3494
|
+
const sync = React115.useCallback(async () => {
|
|
3495
3495
|
if (!executorRef.current || !options.serverUrl) return 0;
|
|
3496
3496
|
const count = await executorRef.current.syncPendingEffects(
|
|
3497
3497
|
options.serverUrl,
|
|
@@ -3500,7 +3500,7 @@ function useOfflineExecutor(options) {
|
|
|
3500
3500
|
setState(executorRef.current.getState());
|
|
3501
3501
|
return count;
|
|
3502
3502
|
}, [options.serverUrl, options.authToken]);
|
|
3503
|
-
const clearQueue =
|
|
3503
|
+
const clearQueue = React115.useCallback(() => {
|
|
3504
3504
|
executorRef.current?.clearQueue();
|
|
3505
3505
|
if (executorRef.current) {
|
|
3506
3506
|
setState(executorRef.current.getState());
|
|
@@ -3516,7 +3516,7 @@ function useOfflineExecutor(options) {
|
|
|
3516
3516
|
clearQueue
|
|
3517
3517
|
};
|
|
3518
3518
|
}
|
|
3519
|
-
|
|
3519
|
+
React115.createContext(null);
|
|
3520
3520
|
|
|
3521
3521
|
// components/organisms/ComponentPatterns.tsx
|
|
3522
3522
|
init_useEventBus();
|
|
@@ -3550,7 +3550,7 @@ init_Typography();
|
|
|
3550
3550
|
init_cn();
|
|
3551
3551
|
init_useEventBus();
|
|
3552
3552
|
init_cn();
|
|
3553
|
-
|
|
3553
|
+
React115.lazy(async () => {
|
|
3554
3554
|
const [reactLeaflet, leafletMod] = await Promise.all([
|
|
3555
3555
|
import('react-leaflet'),
|
|
3556
3556
|
import('leaflet')
|
|
@@ -3568,7 +3568,7 @@ React114.lazy(async () => {
|
|
|
3568
3568
|
shadowSize: [41, 41]
|
|
3569
3569
|
});
|
|
3570
3570
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
3571
|
-
const { useEffect: useEffect62, useRef: useRef63, useCallback:
|
|
3571
|
+
const { useEffect: useEffect62, useRef: useRef63, useCallback: useCallback95, useState: useState86 } = React115__namespace.default;
|
|
3572
3572
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
3573
3573
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
3574
3574
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
@@ -3612,8 +3612,8 @@ React114.lazy(async () => {
|
|
|
3612
3612
|
showAttribution = true
|
|
3613
3613
|
}) {
|
|
3614
3614
|
const eventBus = useEventBus2();
|
|
3615
|
-
const [clickedPosition, setClickedPosition] =
|
|
3616
|
-
const handleMapClick =
|
|
3615
|
+
const [clickedPosition, setClickedPosition] = useState86(null);
|
|
3616
|
+
const handleMapClick = useCallback95((lat, lng) => {
|
|
3617
3617
|
if (showClickedPin) {
|
|
3618
3618
|
setClickedPosition({ lat, lng });
|
|
3619
3619
|
}
|
|
@@ -3622,7 +3622,7 @@ React114.lazy(async () => {
|
|
|
3622
3622
|
eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
|
|
3623
3623
|
}
|
|
3624
3624
|
}, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
|
|
3625
|
-
const handleMarkerClick =
|
|
3625
|
+
const handleMarkerClick = useCallback95((marker) => {
|
|
3626
3626
|
onMarkerClick?.(marker);
|
|
3627
3627
|
if (markerClickEvent) {
|
|
3628
3628
|
eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
|
|
@@ -3880,7 +3880,7 @@ exposeOnWindow();
|
|
|
3880
3880
|
init_Typography();
|
|
3881
3881
|
init_cn();
|
|
3882
3882
|
init_cn();
|
|
3883
|
-
var MarkdownContent =
|
|
3883
|
+
var MarkdownContent = React115__namespace.default.memo(
|
|
3884
3884
|
({ content, direction, className }) => {
|
|
3885
3885
|
const { t: _t } = useTranslate();
|
|
3886
3886
|
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
@@ -4086,7 +4086,7 @@ function computeFoldRegions(code) {
|
|
|
4086
4086
|
}
|
|
4087
4087
|
var LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
4088
4088
|
var HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
4089
|
-
var CodeBlock =
|
|
4089
|
+
var CodeBlock = React115__namespace.default.memo(
|
|
4090
4090
|
({
|
|
4091
4091
|
code: rawCode,
|
|
4092
4092
|
language = "text",
|
|
@@ -4105,23 +4105,23 @@ var CodeBlock = React114__namespace.default.memo(
|
|
|
4105
4105
|
const activeStyle = isOrb ? orbStyle : isLolo ? loloStyle : dark__default.default;
|
|
4106
4106
|
const eventBus = useEventBus();
|
|
4107
4107
|
const { t: _t } = useTranslate();
|
|
4108
|
-
const scrollRef =
|
|
4109
|
-
const codeRef =
|
|
4110
|
-
const savedScrollLeftRef =
|
|
4111
|
-
const [copied, setCopied] =
|
|
4112
|
-
const [editableValue, setEditableValue] =
|
|
4113
|
-
const [editableTextareaKey, setEditableTextareaKey] =
|
|
4114
|
-
const lastPropCodeRef =
|
|
4115
|
-
const editableTextareaRef =
|
|
4116
|
-
const editableOverlayRef =
|
|
4117
|
-
|
|
4108
|
+
const scrollRef = React115.useRef(null);
|
|
4109
|
+
const codeRef = React115.useRef(null);
|
|
4110
|
+
const savedScrollLeftRef = React115.useRef(0);
|
|
4111
|
+
const [copied, setCopied] = React115.useState(false);
|
|
4112
|
+
const [editableValue, setEditableValue] = React115.useState(code);
|
|
4113
|
+
const [editableTextareaKey, setEditableTextareaKey] = React115.useState(0);
|
|
4114
|
+
const lastPropCodeRef = React115.useRef(code);
|
|
4115
|
+
const editableTextareaRef = React115.useRef(null);
|
|
4116
|
+
const editableOverlayRef = React115.useRef(null);
|
|
4117
|
+
React115.useEffect(() => {
|
|
4118
4118
|
if (code !== lastPropCodeRef.current) {
|
|
4119
4119
|
lastPropCodeRef.current = code;
|
|
4120
4120
|
setEditableValue(code);
|
|
4121
4121
|
setEditableTextareaKey((k) => k + 1);
|
|
4122
4122
|
}
|
|
4123
4123
|
}, [code]);
|
|
4124
|
-
const handleEditableScroll =
|
|
4124
|
+
const handleEditableScroll = React115.useCallback(() => {
|
|
4125
4125
|
const ta = editableTextareaRef.current;
|
|
4126
4126
|
const ov = editableOverlayRef.current;
|
|
4127
4127
|
if (ta && ov) {
|
|
@@ -4129,7 +4129,7 @@ var CodeBlock = React114__namespace.default.memo(
|
|
|
4129
4129
|
ov.scrollLeft = ta.scrollLeft;
|
|
4130
4130
|
}
|
|
4131
4131
|
}, []);
|
|
4132
|
-
const errorLineProps =
|
|
4132
|
+
const errorLineProps = React115.useMemo(() => {
|
|
4133
4133
|
if (!errorLines || errorLines.size === 0) {
|
|
4134
4134
|
return LINE_PROPS_FN;
|
|
4135
4135
|
}
|
|
@@ -4152,17 +4152,17 @@ var CodeBlock = React114__namespace.default.memo(
|
|
|
4152
4152
|
};
|
|
4153
4153
|
}, [errorLines]);
|
|
4154
4154
|
const isFoldable = foldableProp ?? (language === "orb" || language === "json");
|
|
4155
|
-
const [collapsed, setCollapsed] =
|
|
4156
|
-
const foldRegions =
|
|
4155
|
+
const [collapsed, setCollapsed] = React115.useState(() => /* @__PURE__ */ new Set());
|
|
4156
|
+
const foldRegions = React115.useMemo(
|
|
4157
4157
|
() => isFoldable ? computeFoldRegions(code) : [],
|
|
4158
4158
|
[code, isFoldable]
|
|
4159
4159
|
);
|
|
4160
|
-
const foldStartMap =
|
|
4160
|
+
const foldStartMap = React115.useMemo(() => {
|
|
4161
4161
|
const m = /* @__PURE__ */ new Map();
|
|
4162
4162
|
for (const r of foldRegions) m.set(r.start, r);
|
|
4163
4163
|
return m;
|
|
4164
4164
|
}, [foldRegions]);
|
|
4165
|
-
const hiddenLines =
|
|
4165
|
+
const hiddenLines = React115.useMemo(() => {
|
|
4166
4166
|
const h = /* @__PURE__ */ new Set();
|
|
4167
4167
|
for (const r of foldRegions) {
|
|
4168
4168
|
if (!collapsed.has(r.start)) continue;
|
|
@@ -4170,11 +4170,11 @@ var CodeBlock = React114__namespace.default.memo(
|
|
|
4170
4170
|
}
|
|
4171
4171
|
return h;
|
|
4172
4172
|
}, [foldRegions, collapsed]);
|
|
4173
|
-
const collapsedRef =
|
|
4173
|
+
const collapsedRef = React115.useRef(collapsed);
|
|
4174
4174
|
collapsedRef.current = collapsed;
|
|
4175
|
-
const foldStartMapRef =
|
|
4175
|
+
const foldStartMapRef = React115.useRef(foldStartMap);
|
|
4176
4176
|
foldStartMapRef.current = foldStartMap;
|
|
4177
|
-
const toggleFold =
|
|
4177
|
+
const toggleFold = React115.useCallback((lineNum) => {
|
|
4178
4178
|
setCollapsed((prev) => {
|
|
4179
4179
|
const next = new Set(prev);
|
|
4180
4180
|
if (next.has(lineNum)) next.delete(lineNum);
|
|
@@ -4182,12 +4182,12 @@ var CodeBlock = React114__namespace.default.memo(
|
|
|
4182
4182
|
return next;
|
|
4183
4183
|
});
|
|
4184
4184
|
}, []);
|
|
4185
|
-
const toggleFoldRef =
|
|
4185
|
+
const toggleFoldRef = React115.useRef(toggleFold);
|
|
4186
4186
|
toggleFoldRef.current = toggleFold;
|
|
4187
|
-
|
|
4187
|
+
React115.useEffect(() => {
|
|
4188
4188
|
setCollapsed(/* @__PURE__ */ new Set());
|
|
4189
4189
|
}, [code]);
|
|
4190
|
-
const highlightedElement =
|
|
4190
|
+
const highlightedElement = React115.useMemo(
|
|
4191
4191
|
() => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4192
4192
|
SyntaxHighlighter__default.default,
|
|
4193
4193
|
{
|
|
@@ -4212,7 +4212,7 @@ var CodeBlock = React114__namespace.default.memo(
|
|
|
4212
4212
|
),
|
|
4213
4213
|
[code, language, activeStyle]
|
|
4214
4214
|
);
|
|
4215
|
-
|
|
4215
|
+
React115.useLayoutEffect(() => {
|
|
4216
4216
|
const container = codeRef.current;
|
|
4217
4217
|
if (!container) return;
|
|
4218
4218
|
container.querySelectorAll(".fold-toggle, .fold-summary").forEach((el) => el.remove());
|
|
@@ -4256,17 +4256,17 @@ var CodeBlock = React114__namespace.default.memo(
|
|
|
4256
4256
|
}
|
|
4257
4257
|
});
|
|
4258
4258
|
}, [collapsed, hiddenLines, foldStartMap, foldRegions, isFoldable]);
|
|
4259
|
-
|
|
4259
|
+
React115.useLayoutEffect(() => {
|
|
4260
4260
|
const el = scrollRef.current;
|
|
4261
4261
|
return () => {
|
|
4262
4262
|
if (el) savedScrollLeftRef.current = el.scrollLeft;
|
|
4263
4263
|
};
|
|
4264
4264
|
}, [language, code]);
|
|
4265
|
-
|
|
4265
|
+
React115.useLayoutEffect(() => {
|
|
4266
4266
|
const el = scrollRef.current;
|
|
4267
4267
|
if (el) el.scrollLeft = savedScrollLeftRef.current;
|
|
4268
4268
|
}, [language, code]);
|
|
4269
|
-
|
|
4269
|
+
React115.useEffect(() => {
|
|
4270
4270
|
const el = scrollRef.current;
|
|
4271
4271
|
if (!el) return;
|
|
4272
4272
|
const handle = () => {
|
|
@@ -4589,6 +4589,7 @@ init_Typography();
|
|
|
4589
4589
|
// components/organisms/DataTable.tsx
|
|
4590
4590
|
init_cn();
|
|
4591
4591
|
init_Typography();
|
|
4592
|
+
init_Typography();
|
|
4592
4593
|
|
|
4593
4594
|
// components/molecules/FormField.tsx
|
|
4594
4595
|
init_cn();
|
|
@@ -4837,7 +4838,7 @@ init_useEventBus();
|
|
|
4837
4838
|
init_useEventBus();
|
|
4838
4839
|
init_cn();
|
|
4839
4840
|
init_useEventBus();
|
|
4840
|
-
|
|
4841
|
+
React115.lazy(() => import('react-markdown'));
|
|
4841
4842
|
|
|
4842
4843
|
// components/organisms/DocumentViewer.tsx
|
|
4843
4844
|
init_cn();
|
|
@@ -4860,7 +4861,7 @@ init_useEventBus();
|
|
|
4860
4861
|
|
|
4861
4862
|
// components/organisms/game/GameAudioProvider.tsx
|
|
4862
4863
|
init_useEventBus();
|
|
4863
|
-
var GameAudioContext =
|
|
4864
|
+
var GameAudioContext = React115.createContext(null);
|
|
4864
4865
|
GameAudioContext.displayName = "GameAudioContext";
|
|
4865
4866
|
init_cn();
|
|
4866
4867
|
|
|
@@ -5000,12 +5001,12 @@ init_useEventBus();
|
|
|
5000
5001
|
|
|
5001
5002
|
// components/organisms/component-registry.generated.ts
|
|
5002
5003
|
function lazyThree(name, loader) {
|
|
5003
|
-
const Lazy =
|
|
5004
|
+
const Lazy = React115__namespace.default.lazy(() => loader().then((m) => ({ default: m[name] })));
|
|
5004
5005
|
function ThreeWrapper(props) {
|
|
5005
|
-
return
|
|
5006
|
-
|
|
5006
|
+
return React115__namespace.default.createElement(
|
|
5007
|
+
React115__namespace.default.Suspense,
|
|
5007
5008
|
{ fallback: null },
|
|
5008
|
-
|
|
5009
|
+
React115__namespace.default.createElement(Lazy, props)
|
|
5009
5010
|
);
|
|
5010
5011
|
}
|
|
5011
5012
|
ThreeWrapper.displayName = `Lazy(${name})`;
|
|
@@ -5026,13 +5027,13 @@ lazyThree("PhysicsObject3D", () => import('@almadar/ui/components/organisms/game
|
|
|
5026
5027
|
lazyThree("Scene3D", () => import('@almadar/ui/components/organisms/game/three'));
|
|
5027
5028
|
lazyThree("TileRenderer", () => import('@almadar/ui/components/organisms/game/three'));
|
|
5028
5029
|
lazyThree("UnitRenderer", () => import('@almadar/ui/components/organisms/game/three'));
|
|
5029
|
-
var SuspenseConfigContext =
|
|
5030
|
-
|
|
5030
|
+
var SuspenseConfigContext = React115.createContext({ enabled: false });
|
|
5031
|
+
React115.createContext(false);
|
|
5031
5032
|
function SuspenseConfigProvider({
|
|
5032
5033
|
config,
|
|
5033
5034
|
children
|
|
5034
5035
|
}) {
|
|
5035
|
-
return
|
|
5036
|
+
return React115__namespace.default.createElement(
|
|
5036
5037
|
SuspenseConfigContext.Provider,
|
|
5037
5038
|
{ value: config },
|
|
5038
5039
|
children
|
|
@@ -5082,8 +5083,8 @@ function VerificationProvider({
|
|
|
5082
5083
|
}) {
|
|
5083
5084
|
const isEnabled = enabled ?? (typeof process !== "undefined" && process.env?.NODE_ENV !== "production");
|
|
5084
5085
|
const eventBus = useEventBus();
|
|
5085
|
-
const pendingRef =
|
|
5086
|
-
|
|
5086
|
+
const pendingRef = React115.useRef(/* @__PURE__ */ new Map());
|
|
5087
|
+
React115.useEffect(() => {
|
|
5087
5088
|
if (!isEnabled) return;
|
|
5088
5089
|
if (!eventBus.onAny) return;
|
|
5089
5090
|
const unsub = eventBus.onAny((evt) => {
|
|
@@ -5182,7 +5183,7 @@ function VerificationProvider({
|
|
|
5182
5183
|
);
|
|
5183
5184
|
return unsub;
|
|
5184
5185
|
}, [isEnabled, eventBus]);
|
|
5185
|
-
|
|
5186
|
+
React115.useEffect(() => {
|
|
5186
5187
|
if (!isEnabled) return;
|
|
5187
5188
|
if (!runtimeManager) return;
|
|
5188
5189
|
runtimeManager.setObserver({
|
|
@@ -5204,11 +5205,11 @@ function VerificationProvider({
|
|
|
5204
5205
|
"pass"
|
|
5205
5206
|
);
|
|
5206
5207
|
}, [isEnabled, runtimeManager]);
|
|
5207
|
-
|
|
5208
|
+
React115.useEffect(() => {
|
|
5208
5209
|
if (!isEnabled) return;
|
|
5209
5210
|
bindEventBus(eventBus);
|
|
5210
5211
|
}, [isEnabled, eventBus]);
|
|
5211
|
-
|
|
5212
|
+
React115.useEffect(() => {
|
|
5212
5213
|
if (!isEnabled) return;
|
|
5213
5214
|
if (traitStateGetter) {
|
|
5214
5215
|
bindTraitStateGetter(traitStateGetter);
|
|
@@ -5232,7 +5233,7 @@ function OrbitalProvider({
|
|
|
5232
5233
|
suspense = false,
|
|
5233
5234
|
verification
|
|
5234
5235
|
}) {
|
|
5235
|
-
const suspenseConfig =
|
|
5236
|
+
const suspenseConfig = React115.useMemo(
|
|
5236
5237
|
() => ({ enabled: suspense }),
|
|
5237
5238
|
[suspense]
|
|
5238
5239
|
);
|
|
@@ -5252,43 +5253,43 @@ function OrbitalProvider({
|
|
|
5252
5253
|
);
|
|
5253
5254
|
}
|
|
5254
5255
|
OrbitalProvider.displayName = "OrbitalProvider";
|
|
5255
|
-
var FetchedDataContext =
|
|
5256
|
+
var FetchedDataContext = React115.createContext(null);
|
|
5256
5257
|
function FetchedDataProvider({
|
|
5257
5258
|
initialData,
|
|
5258
5259
|
children
|
|
5259
5260
|
}) {
|
|
5260
|
-
const [state, setState] =
|
|
5261
|
+
const [state, setState] = React115.useState(() => ({
|
|
5261
5262
|
data: initialData || {},
|
|
5262
5263
|
fetchedAt: {},
|
|
5263
5264
|
loading: false,
|
|
5264
5265
|
error: null
|
|
5265
5266
|
}));
|
|
5266
|
-
const getData =
|
|
5267
|
+
const getData = React115.useCallback(
|
|
5267
5268
|
(entityName) => {
|
|
5268
5269
|
return state.data[entityName] || [];
|
|
5269
5270
|
},
|
|
5270
5271
|
[state.data]
|
|
5271
5272
|
);
|
|
5272
|
-
const getById2 =
|
|
5273
|
+
const getById2 = React115.useCallback(
|
|
5273
5274
|
(entityName, id) => {
|
|
5274
5275
|
const records = state.data[entityName];
|
|
5275
5276
|
return records?.find((r) => r.id === id);
|
|
5276
5277
|
},
|
|
5277
5278
|
[state.data]
|
|
5278
5279
|
);
|
|
5279
|
-
const hasData =
|
|
5280
|
+
const hasData = React115.useCallback(
|
|
5280
5281
|
(entityName) => {
|
|
5281
5282
|
return entityName in state.data && state.data[entityName].length > 0;
|
|
5282
5283
|
},
|
|
5283
5284
|
[state.data]
|
|
5284
5285
|
);
|
|
5285
|
-
const getFetchedAt =
|
|
5286
|
+
const getFetchedAt = React115.useCallback(
|
|
5286
5287
|
(entityName) => {
|
|
5287
5288
|
return state.fetchedAt[entityName];
|
|
5288
5289
|
},
|
|
5289
5290
|
[state.fetchedAt]
|
|
5290
5291
|
);
|
|
5291
|
-
const setData =
|
|
5292
|
+
const setData = React115.useCallback((data) => {
|
|
5292
5293
|
const now = Date.now();
|
|
5293
5294
|
setState((prev) => ({
|
|
5294
5295
|
...prev,
|
|
@@ -5307,14 +5308,14 @@ function FetchedDataProvider({
|
|
|
5307
5308
|
error: null
|
|
5308
5309
|
}));
|
|
5309
5310
|
}, []);
|
|
5310
|
-
const clearData =
|
|
5311
|
+
const clearData = React115.useCallback(() => {
|
|
5311
5312
|
setState((prev) => ({
|
|
5312
5313
|
...prev,
|
|
5313
5314
|
data: {},
|
|
5314
5315
|
fetchedAt: {}
|
|
5315
5316
|
}));
|
|
5316
5317
|
}, []);
|
|
5317
|
-
const clearEntity =
|
|
5318
|
+
const clearEntity = React115.useCallback((entityName) => {
|
|
5318
5319
|
setState((prev) => {
|
|
5319
5320
|
const newData = { ...prev.data };
|
|
5320
5321
|
const newFetchedAt = { ...prev.fetchedAt };
|
|
@@ -5327,13 +5328,13 @@ function FetchedDataProvider({
|
|
|
5327
5328
|
};
|
|
5328
5329
|
});
|
|
5329
5330
|
}, []);
|
|
5330
|
-
const setLoading =
|
|
5331
|
+
const setLoading = React115.useCallback((loading) => {
|
|
5331
5332
|
setState((prev) => ({ ...prev, loading }));
|
|
5332
5333
|
}, []);
|
|
5333
|
-
const setError =
|
|
5334
|
+
const setError = React115.useCallback((error) => {
|
|
5334
5335
|
setState((prev) => ({ ...prev, error, loading: false }));
|
|
5335
5336
|
}, []);
|
|
5336
|
-
const contextValue2 =
|
|
5337
|
+
const contextValue2 = React115.useMemo(
|
|
5337
5338
|
() => ({
|
|
5338
5339
|
getData,
|
|
5339
5340
|
getById: getById2,
|
|
@@ -5364,10 +5365,10 @@ function FetchedDataProvider({
|
|
|
5364
5365
|
return /* @__PURE__ */ jsxRuntime.jsx(FetchedDataContext.Provider, { value: contextValue2, children });
|
|
5365
5366
|
}
|
|
5366
5367
|
function useFetchedDataContext() {
|
|
5367
|
-
return
|
|
5368
|
+
return React115.useContext(FetchedDataContext);
|
|
5368
5369
|
}
|
|
5369
5370
|
function useFetchedData() {
|
|
5370
|
-
const context =
|
|
5371
|
+
const context = React115.useContext(FetchedDataContext);
|
|
5371
5372
|
if (!context) {
|
|
5372
5373
|
return {
|
|
5373
5374
|
getData: () => [],
|
|
@@ -5407,15 +5408,15 @@ function useFetchedEntity(entityName) {
|
|
|
5407
5408
|
error: context.error
|
|
5408
5409
|
};
|
|
5409
5410
|
}
|
|
5410
|
-
var OfflineModeContext =
|
|
5411
|
+
var OfflineModeContext = React115.createContext(null);
|
|
5411
5412
|
function OfflineModeProvider({
|
|
5412
5413
|
children,
|
|
5413
5414
|
...executorOptions
|
|
5414
5415
|
}) {
|
|
5415
|
-
const [forceOffline, setForceOffline] =
|
|
5416
|
+
const [forceOffline, setForceOffline] = React115.useState(false);
|
|
5416
5417
|
const executor = useOfflineExecutor(executorOptions);
|
|
5417
5418
|
const effectivelyOffline = executor.isOffline || forceOffline;
|
|
5418
|
-
const contextValue2 =
|
|
5419
|
+
const contextValue2 = React115.useMemo(
|
|
5419
5420
|
() => ({
|
|
5420
5421
|
...executor,
|
|
5421
5422
|
forceOffline,
|
|
@@ -5427,14 +5428,14 @@ function OfflineModeProvider({
|
|
|
5427
5428
|
return /* @__PURE__ */ jsxRuntime.jsx(OfflineModeContext.Provider, { value: contextValue2, children });
|
|
5428
5429
|
}
|
|
5429
5430
|
function useOfflineMode() {
|
|
5430
|
-
const context =
|
|
5431
|
+
const context = React115.useContext(OfflineModeContext);
|
|
5431
5432
|
if (!context) {
|
|
5432
5433
|
throw new Error("useOfflineMode must be used within OfflineModeProvider");
|
|
5433
5434
|
}
|
|
5434
5435
|
return context;
|
|
5435
5436
|
}
|
|
5436
5437
|
function useOptionalOfflineMode() {
|
|
5437
|
-
return
|
|
5438
|
+
return React115.useContext(OfflineModeContext);
|
|
5438
5439
|
}
|
|
5439
5440
|
|
|
5440
5441
|
exports.EntityStoreContext = EntityStoreContext;
|