@almadar/ui 2.43.0 → 2.46.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 +1986 -1330
- package/dist/avl/index.d.cts +196 -3
- package/dist/avl/index.d.ts +3 -0
- package/dist/avl/index.js +966 -313
- package/dist/components/index.cjs +402 -115
- package/dist/components/index.js +402 -115
- package/dist/components/molecules/avl/BehaviorComposeNode.d.ts +13 -0
- package/dist/components/molecules/avl/avl-behavior-compose-converter.d.ts +53 -0
- package/dist/components/molecules/avl/avl-behavior-compose-types.d.ts +100 -0
- package/dist/components/molecules/avl/avl-preview-converter.d.ts +3 -1
- package/dist/components/molecules/avl/avl-preview-types.d.ts +8 -0
- package/dist/components/molecules/avl/index.d.ts +3 -0
- package/dist/components/molecules/avl/wire-validation.d.ts +30 -0
- package/dist/components/organisms/avl/FlowCanvas.d.ts +19 -0
- package/dist/components/organisms/debug/WalkMinimap.d.ts +17 -0
- package/dist/providers/index.cjs +165 -164
- package/dist/providers/index.js +41 -40
- package/dist/runtime/EntitySchemaContext.d.ts +5 -0
- package/dist/runtime/index.cjs +402 -115
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/index.js +402 -116
- 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 React114 = require('react');
|
|
4
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
5
5
|
var providers = require('@almadar/ui/providers');
|
|
6
6
|
require('react-dom');
|
|
@@ -58,7 +58,7 @@ function _interopNamespace(e) {
|
|
|
58
58
|
return Object.freeze(n);
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
var
|
|
61
|
+
var React114__namespace = /*#__PURE__*/_interopNamespace(React114);
|
|
62
62
|
var LucideIcons__namespace = /*#__PURE__*/_interopNamespace(LucideIcons);
|
|
63
63
|
var L__default = /*#__PURE__*/_interopDefault(L);
|
|
64
64
|
var ReactMarkdown__default = /*#__PURE__*/_interopDefault(ReactMarkdown);
|
|
@@ -186,7 +186,7 @@ var BUILT_IN_THEMES = [
|
|
|
186
186
|
hasDarkMode: true
|
|
187
187
|
}
|
|
188
188
|
];
|
|
189
|
-
var ThemeContext =
|
|
189
|
+
var ThemeContext = React114.createContext(void 0);
|
|
190
190
|
var THEME_STORAGE_KEY = "theme";
|
|
191
191
|
var MODE_STORAGE_KEY = "theme-mode";
|
|
192
192
|
function getSystemMode() {
|
|
@@ -206,14 +206,14 @@ var ThemeProvider = ({
|
|
|
206
206
|
defaultMode = "system",
|
|
207
207
|
targetRef
|
|
208
208
|
}) => {
|
|
209
|
-
const availableThemes =
|
|
209
|
+
const availableThemes = React114.useMemo(() => {
|
|
210
210
|
const themeMap = /* @__PURE__ */ new Map();
|
|
211
211
|
BUILT_IN_THEMES.forEach((t) => themeMap.set(t.name, t));
|
|
212
212
|
themes.forEach((t) => themeMap.set(t.name, t));
|
|
213
213
|
return Array.from(themeMap.values());
|
|
214
214
|
}, [themes]);
|
|
215
215
|
const isScoped = !!targetRef;
|
|
216
|
-
const [theme, setThemeState] =
|
|
216
|
+
const [theme, setThemeState] = React114.useState(() => {
|
|
217
217
|
if (isScoped || typeof window === "undefined") return defaultTheme;
|
|
218
218
|
const stored = localStorage.getItem(THEME_STORAGE_KEY);
|
|
219
219
|
const validThemes = [
|
|
@@ -225,7 +225,7 @@ var ThemeProvider = ({
|
|
|
225
225
|
}
|
|
226
226
|
return defaultTheme;
|
|
227
227
|
});
|
|
228
|
-
const [mode, setModeState] =
|
|
228
|
+
const [mode, setModeState] = React114.useState(() => {
|
|
229
229
|
if (isScoped || typeof window === "undefined") return defaultMode;
|
|
230
230
|
const stored = localStorage.getItem(MODE_STORAGE_KEY);
|
|
231
231
|
if (stored === "light" || stored === "dark" || stored === "system") {
|
|
@@ -233,14 +233,14 @@ var ThemeProvider = ({
|
|
|
233
233
|
}
|
|
234
234
|
return defaultMode;
|
|
235
235
|
});
|
|
236
|
-
const [resolvedMode, setResolvedMode] =
|
|
236
|
+
const [resolvedMode, setResolvedMode] = React114.useState(
|
|
237
237
|
() => resolveMode(mode)
|
|
238
238
|
);
|
|
239
|
-
const appliedTheme =
|
|
239
|
+
const appliedTheme = React114.useMemo(
|
|
240
240
|
() => `${theme}-${resolvedMode}`,
|
|
241
241
|
[theme, resolvedMode]
|
|
242
242
|
);
|
|
243
|
-
|
|
243
|
+
React114.useEffect(() => {
|
|
244
244
|
const updateResolved = () => {
|
|
245
245
|
setResolvedMode(resolveMode(mode));
|
|
246
246
|
};
|
|
@@ -253,7 +253,7 @@ var ThemeProvider = ({
|
|
|
253
253
|
}
|
|
254
254
|
return void 0;
|
|
255
255
|
}, [mode]);
|
|
256
|
-
|
|
256
|
+
React114.useEffect(() => {
|
|
257
257
|
if (isScoped) {
|
|
258
258
|
if (targetRef?.current) {
|
|
259
259
|
targetRef.current.setAttribute("data-theme", appliedTheme);
|
|
@@ -267,7 +267,7 @@ var ThemeProvider = ({
|
|
|
267
267
|
root.classList.remove("light", "dark");
|
|
268
268
|
root.classList.add(resolvedMode);
|
|
269
269
|
}, [appliedTheme, resolvedMode, targetRef, isScoped]);
|
|
270
|
-
const setTheme =
|
|
270
|
+
const setTheme = React114.useCallback(
|
|
271
271
|
(newTheme) => {
|
|
272
272
|
const validTheme = availableThemes.find((t) => t.name === newTheme);
|
|
273
273
|
if (validTheme) {
|
|
@@ -283,17 +283,17 @@ var ThemeProvider = ({
|
|
|
283
283
|
},
|
|
284
284
|
[availableThemes]
|
|
285
285
|
);
|
|
286
|
-
const setMode =
|
|
286
|
+
const setMode = React114.useCallback((newMode) => {
|
|
287
287
|
setModeState(newMode);
|
|
288
288
|
if (!isScoped && typeof window !== "undefined") {
|
|
289
289
|
localStorage.setItem(MODE_STORAGE_KEY, newMode);
|
|
290
290
|
}
|
|
291
291
|
}, []);
|
|
292
|
-
const toggleMode =
|
|
292
|
+
const toggleMode = React114.useCallback(() => {
|
|
293
293
|
const newMode = resolvedMode === "dark" ? "light" : "dark";
|
|
294
294
|
setMode(newMode);
|
|
295
295
|
}, [resolvedMode, setMode]);
|
|
296
|
-
const contextValue2 =
|
|
296
|
+
const contextValue2 = React114.useMemo(
|
|
297
297
|
() => ({
|
|
298
298
|
theme,
|
|
299
299
|
mode,
|
|
@@ -428,9 +428,9 @@ function addWatch(entityType, callback) {
|
|
|
428
428
|
};
|
|
429
429
|
}
|
|
430
430
|
function useEntityRef(entityType) {
|
|
431
|
-
const versionRef =
|
|
432
|
-
const dataRef =
|
|
433
|
-
const getSnapshotStable =
|
|
431
|
+
const versionRef = React114.useRef(0);
|
|
432
|
+
const dataRef = React114.useRef([]);
|
|
433
|
+
const getSnapshotStable = React114__namespace.default.useCallback(() => {
|
|
434
434
|
const currentVersion = getVersion(entityType);
|
|
435
435
|
if (currentVersion !== versionRef.current) {
|
|
436
436
|
versionRef.current = currentVersion;
|
|
@@ -438,12 +438,12 @@ function useEntityRef(entityType) {
|
|
|
438
438
|
}
|
|
439
439
|
return dataRef.current;
|
|
440
440
|
}, [entityType]);
|
|
441
|
-
return
|
|
441
|
+
return React114.useSyncExternalStore(subscribeToStore, getSnapshotStable, () => []);
|
|
442
442
|
}
|
|
443
443
|
function useEntityById(entityType, id) {
|
|
444
|
-
const versionRef =
|
|
445
|
-
const dataRef =
|
|
446
|
-
const getSnapshotStable =
|
|
444
|
+
const versionRef = React114.useRef(0);
|
|
445
|
+
const dataRef = React114.useRef(null);
|
|
446
|
+
const getSnapshotStable = React114__namespace.default.useCallback(() => {
|
|
447
447
|
if (!id) return null;
|
|
448
448
|
const currentVersion = getVersion(entityType);
|
|
449
449
|
if (currentVersion !== versionRef.current) {
|
|
@@ -452,12 +452,12 @@ function useEntityById(entityType, id) {
|
|
|
452
452
|
}
|
|
453
453
|
return dataRef.current;
|
|
454
454
|
}, [entityType, id]);
|
|
455
|
-
return
|
|
455
|
+
return React114.useSyncExternalStore(subscribeToStore, getSnapshotStable, () => null);
|
|
456
456
|
}
|
|
457
457
|
function useEntityWatch(entityType, callback) {
|
|
458
|
-
const callbackRef =
|
|
458
|
+
const callbackRef = React114.useRef(callback);
|
|
459
459
|
callbackRef.current = callback;
|
|
460
|
-
|
|
460
|
+
React114.useEffect(() => {
|
|
461
461
|
return addWatch(entityType, (oldData, newData) => {
|
|
462
462
|
callbackRef.current(oldData, newData);
|
|
463
463
|
});
|
|
@@ -472,9 +472,9 @@ var contextValue = {
|
|
|
472
472
|
getSnapshot,
|
|
473
473
|
getById
|
|
474
474
|
};
|
|
475
|
-
var EntityStoreContext =
|
|
475
|
+
var EntityStoreContext = React114.createContext(contextValue);
|
|
476
476
|
function useEntityStore() {
|
|
477
|
-
return
|
|
477
|
+
return React114.useContext(EntityStoreContext);
|
|
478
478
|
}
|
|
479
479
|
function EntityStoreProvider({ children }) {
|
|
480
480
|
return /* @__PURE__ */ jsxRuntime.jsx(EntityStoreContext.Provider, { value: contextValue, children });
|
|
@@ -551,15 +551,15 @@ var fallbackEventBus = {
|
|
|
551
551
|
}
|
|
552
552
|
};
|
|
553
553
|
function useEventBus() {
|
|
554
|
-
const context =
|
|
554
|
+
const context = React114.useContext(providers.EventBusContext);
|
|
555
555
|
return context ?? getGlobalEventBus() ?? fallbackEventBus;
|
|
556
556
|
}
|
|
557
|
-
var EventBusContext2 =
|
|
557
|
+
var EventBusContext2 = React114.createContext(null);
|
|
558
558
|
function EventBusProvider({ children, debug: debug2 = false }) {
|
|
559
|
-
const listenersRef =
|
|
560
|
-
const anyListenersRef =
|
|
561
|
-
const deprecationWarningShown =
|
|
562
|
-
const getSelectedEntity =
|
|
559
|
+
const listenersRef = React114.useRef(/* @__PURE__ */ new Map());
|
|
560
|
+
const anyListenersRef = React114.useRef(/* @__PURE__ */ new Set());
|
|
561
|
+
const deprecationWarningShown = React114.useRef(false);
|
|
562
|
+
const getSelectedEntity = React114.useCallback(() => {
|
|
563
563
|
if (!deprecationWarningShown.current) {
|
|
564
564
|
console.warn(
|
|
565
565
|
"[EventBus] getSelectedEntity is deprecated. Use SelectionProvider and useSelection hook instead. See SelectionProvider.tsx for migration guide."
|
|
@@ -568,7 +568,7 @@ function EventBusProvider({ children, debug: debug2 = false }) {
|
|
|
568
568
|
}
|
|
569
569
|
return null;
|
|
570
570
|
}, []);
|
|
571
|
-
const clearSelectedEntity =
|
|
571
|
+
const clearSelectedEntity = React114.useCallback(() => {
|
|
572
572
|
if (!deprecationWarningShown.current) {
|
|
573
573
|
console.warn(
|
|
574
574
|
"[EventBus] clearSelectedEntity is deprecated. Use SelectionProvider and useSelection hook instead. See SelectionProvider.tsx for migration guide."
|
|
@@ -576,7 +576,7 @@ function EventBusProvider({ children, debug: debug2 = false }) {
|
|
|
576
576
|
deprecationWarningShown.current = true;
|
|
577
577
|
}
|
|
578
578
|
}, []);
|
|
579
|
-
const emit =
|
|
579
|
+
const emit = React114.useCallback((type, payload) => {
|
|
580
580
|
const event = {
|
|
581
581
|
type,
|
|
582
582
|
payload,
|
|
@@ -610,7 +610,7 @@ function EventBusProvider({ children, debug: debug2 = false }) {
|
|
|
610
610
|
}
|
|
611
611
|
}
|
|
612
612
|
}, [debug2]);
|
|
613
|
-
const on =
|
|
613
|
+
const on = React114.useCallback((type, listener) => {
|
|
614
614
|
if (!listenersRef.current.has(type)) {
|
|
615
615
|
listenersRef.current.set(type, /* @__PURE__ */ new Set());
|
|
616
616
|
}
|
|
@@ -629,18 +629,18 @@ function EventBusProvider({ children, debug: debug2 = false }) {
|
|
|
629
629
|
}
|
|
630
630
|
};
|
|
631
631
|
}, [debug2]);
|
|
632
|
-
const once =
|
|
632
|
+
const once = React114.useCallback((type, listener) => {
|
|
633
633
|
const wrappedListener = (event) => {
|
|
634
634
|
listenersRef.current.get(type)?.delete(wrappedListener);
|
|
635
635
|
listener(event);
|
|
636
636
|
};
|
|
637
637
|
return on(type, wrappedListener);
|
|
638
638
|
}, [on]);
|
|
639
|
-
const hasListeners =
|
|
639
|
+
const hasListeners = React114.useCallback((type) => {
|
|
640
640
|
const listeners6 = listenersRef.current.get(type);
|
|
641
641
|
return listeners6 !== void 0 && listeners6.size > 0;
|
|
642
642
|
}, []);
|
|
643
|
-
const onAny =
|
|
643
|
+
const onAny = React114.useCallback((listener) => {
|
|
644
644
|
anyListenersRef.current.add(listener);
|
|
645
645
|
if (debug2) {
|
|
646
646
|
console.log(`[EventBus] onAny subscribed, total: ${anyListenersRef.current.size}`);
|
|
@@ -652,7 +652,7 @@ function EventBusProvider({ children, debug: debug2 = false }) {
|
|
|
652
652
|
}
|
|
653
653
|
};
|
|
654
654
|
}, [debug2]);
|
|
655
|
-
const contextValue2 =
|
|
655
|
+
const contextValue2 = React114.useMemo(
|
|
656
656
|
() => ({
|
|
657
657
|
emit,
|
|
658
658
|
on,
|
|
@@ -664,7 +664,7 @@ function EventBusProvider({ children, debug: debug2 = false }) {
|
|
|
664
664
|
}),
|
|
665
665
|
[emit, on, once, hasListeners, onAny, getSelectedEntity, clearSelectedEntity]
|
|
666
666
|
);
|
|
667
|
-
|
|
667
|
+
React114.useEffect(() => {
|
|
668
668
|
setGlobalEventBus(contextValue2);
|
|
669
669
|
return () => {
|
|
670
670
|
setGlobalEventBus(null);
|
|
@@ -672,7 +672,7 @@ function EventBusProvider({ children, debug: debug2 = false }) {
|
|
|
672
672
|
}, [contextValue2]);
|
|
673
673
|
return /* @__PURE__ */ jsxRuntime.jsx(EventBusContext2.Provider, { value: contextValue2, children });
|
|
674
674
|
}
|
|
675
|
-
var SelectionContext =
|
|
675
|
+
var SelectionContext = React114.createContext(null);
|
|
676
676
|
var defaultCompareEntities = (a, b) => {
|
|
677
677
|
if (a === b) return true;
|
|
678
678
|
if (!a || !b) return false;
|
|
@@ -689,8 +689,8 @@ function SelectionProvider({
|
|
|
689
689
|
compareEntities = defaultCompareEntities
|
|
690
690
|
}) {
|
|
691
691
|
const eventBus = useEventBus();
|
|
692
|
-
const [selected, setSelectedState] =
|
|
693
|
-
const setSelected =
|
|
692
|
+
const [selected, setSelectedState] = React114.useState(null);
|
|
693
|
+
const setSelected = React114.useCallback(
|
|
694
694
|
(entity) => {
|
|
695
695
|
setSelectedState(entity);
|
|
696
696
|
if (debug2) {
|
|
@@ -699,19 +699,19 @@ function SelectionProvider({
|
|
|
699
699
|
},
|
|
700
700
|
[debug2]
|
|
701
701
|
);
|
|
702
|
-
const clearSelection =
|
|
702
|
+
const clearSelection = React114.useCallback(() => {
|
|
703
703
|
setSelectedState(null);
|
|
704
704
|
if (debug2) {
|
|
705
705
|
console.log("[SelectionProvider] Selection cleared");
|
|
706
706
|
}
|
|
707
707
|
}, [debug2]);
|
|
708
|
-
const isSelected =
|
|
708
|
+
const isSelected = React114.useCallback(
|
|
709
709
|
(entity) => {
|
|
710
710
|
return compareEntities(selected, entity);
|
|
711
711
|
},
|
|
712
712
|
[selected, compareEntities]
|
|
713
713
|
);
|
|
714
|
-
|
|
714
|
+
React114.useEffect(() => {
|
|
715
715
|
const handleSelect = (event) => {
|
|
716
716
|
const row = event.payload?.row;
|
|
717
717
|
if (row) {
|
|
@@ -749,16 +749,17 @@ function SelectionProvider({
|
|
|
749
749
|
return /* @__PURE__ */ jsxRuntime.jsx(SelectionContext.Provider, { value: contextValue2, children });
|
|
750
750
|
}
|
|
751
751
|
function useSelection() {
|
|
752
|
-
const context =
|
|
752
|
+
const context = React114.useContext(SelectionContext);
|
|
753
753
|
if (!context) {
|
|
754
754
|
throw new Error("useSelection must be used within a SelectionProvider");
|
|
755
755
|
}
|
|
756
756
|
return context;
|
|
757
757
|
}
|
|
758
758
|
function useSelectionOptional() {
|
|
759
|
-
const context =
|
|
759
|
+
const context = React114.useContext(SelectionContext);
|
|
760
760
|
return context;
|
|
761
761
|
}
|
|
762
|
+
React114.createContext(null);
|
|
762
763
|
function cn(...inputs) {
|
|
763
764
|
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
764
765
|
}
|
|
@@ -899,7 +900,7 @@ var positionStyles = {
|
|
|
899
900
|
fixed: "fixed",
|
|
900
901
|
sticky: "sticky"
|
|
901
902
|
};
|
|
902
|
-
var Box =
|
|
903
|
+
var Box = React114__namespace.default.forwardRef(
|
|
903
904
|
({
|
|
904
905
|
padding,
|
|
905
906
|
paddingX,
|
|
@@ -928,20 +929,20 @@ var Box = React113__namespace.default.forwardRef(
|
|
|
928
929
|
...rest
|
|
929
930
|
}, ref) => {
|
|
930
931
|
const eventBus = useEventBus();
|
|
931
|
-
const handleClick =
|
|
932
|
+
const handleClick = React114.useCallback((e) => {
|
|
932
933
|
if (action) {
|
|
933
934
|
e.stopPropagation();
|
|
934
935
|
eventBus.emit(`UI:${action}`, actionPayload ?? {});
|
|
935
936
|
}
|
|
936
937
|
onClick?.(e);
|
|
937
938
|
}, [action, actionPayload, eventBus, onClick]);
|
|
938
|
-
const handleMouseEnter =
|
|
939
|
+
const handleMouseEnter = React114.useCallback((e) => {
|
|
939
940
|
if (hoverEvent) {
|
|
940
941
|
eventBus.emit(`UI:${hoverEvent}`, { hovered: true });
|
|
941
942
|
}
|
|
942
943
|
onMouseEnter?.(e);
|
|
943
944
|
}, [hoverEvent, eventBus, onMouseEnter]);
|
|
944
|
-
const handleMouseLeave =
|
|
945
|
+
const handleMouseLeave = React114.useCallback((e) => {
|
|
945
946
|
if (hoverEvent) {
|
|
946
947
|
eventBus.emit(`UI:${hoverEvent}`, { hovered: false });
|
|
947
948
|
}
|
|
@@ -1170,7 +1171,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
1170
1171
|
const IconComp = value;
|
|
1171
1172
|
return /* @__PURE__ */ jsxRuntime.jsx(IconComp, { className: sizeClass });
|
|
1172
1173
|
}
|
|
1173
|
-
if (
|
|
1174
|
+
if (React114__namespace.default.isValidElement(value)) {
|
|
1174
1175
|
return value;
|
|
1175
1176
|
}
|
|
1176
1177
|
if (typeof value === "object" && value !== null && "render" in value) {
|
|
@@ -1179,7 +1180,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
1179
1180
|
}
|
|
1180
1181
|
return value;
|
|
1181
1182
|
}
|
|
1182
|
-
var Button =
|
|
1183
|
+
var Button = React114__namespace.default.forwardRef(
|
|
1183
1184
|
({
|
|
1184
1185
|
className,
|
|
1185
1186
|
variant = "primary",
|
|
@@ -1275,7 +1276,7 @@ var sizeStyles3 = {
|
|
|
1275
1276
|
md: "px-2.5 py-1 text-sm",
|
|
1276
1277
|
lg: "px-3 py-1.5 text-base"
|
|
1277
1278
|
};
|
|
1278
|
-
var Badge =
|
|
1279
|
+
var Badge = React114__namespace.default.forwardRef(
|
|
1279
1280
|
({ className, variant = "default", size = "sm", amount, label, icon, children, ...props }, ref) => {
|
|
1280
1281
|
const iconSizes2 = { sm: "w-3 h-3", md: "w-3.5 h-3.5", lg: "w-4 h-4" };
|
|
1281
1282
|
const resolvedIcon = typeof icon === "string" ? (() => {
|
|
@@ -1302,7 +1303,7 @@ var Badge = React113__namespace.default.forwardRef(
|
|
|
1302
1303
|
}
|
|
1303
1304
|
);
|
|
1304
1305
|
Badge.displayName = "Badge";
|
|
1305
|
-
var Input =
|
|
1306
|
+
var Input = React114__namespace.default.forwardRef(
|
|
1306
1307
|
({
|
|
1307
1308
|
className,
|
|
1308
1309
|
inputType,
|
|
@@ -1414,7 +1415,7 @@ var Input = React113__namespace.default.forwardRef(
|
|
|
1414
1415
|
}
|
|
1415
1416
|
);
|
|
1416
1417
|
Input.displayName = "Input";
|
|
1417
|
-
var Label =
|
|
1418
|
+
var Label = React114__namespace.default.forwardRef(
|
|
1418
1419
|
({ className, required, children, ...props }, ref) => {
|
|
1419
1420
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1420
1421
|
"label",
|
|
@@ -1434,7 +1435,7 @@ var Label = React113__namespace.default.forwardRef(
|
|
|
1434
1435
|
}
|
|
1435
1436
|
);
|
|
1436
1437
|
Label.displayName = "Label";
|
|
1437
|
-
var Textarea =
|
|
1438
|
+
var Textarea = React114__namespace.default.forwardRef(
|
|
1438
1439
|
({ className, error, ...props }, ref) => {
|
|
1439
1440
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1440
1441
|
"textarea",
|
|
@@ -1457,7 +1458,7 @@ var Textarea = React113__namespace.default.forwardRef(
|
|
|
1457
1458
|
}
|
|
1458
1459
|
);
|
|
1459
1460
|
Textarea.displayName = "Textarea";
|
|
1460
|
-
var Select =
|
|
1461
|
+
var Select = React114__namespace.default.forwardRef(
|
|
1461
1462
|
({ className, options, placeholder, error, ...props }, ref) => {
|
|
1462
1463
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
1463
1464
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -1493,7 +1494,7 @@ var Select = React113__namespace.default.forwardRef(
|
|
|
1493
1494
|
}
|
|
1494
1495
|
);
|
|
1495
1496
|
Select.displayName = "Select";
|
|
1496
|
-
var Checkbox =
|
|
1497
|
+
var Checkbox = React114__namespace.default.forwardRef(
|
|
1497
1498
|
({ className, label, id, ...props }, ref) => {
|
|
1498
1499
|
const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
1499
1500
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center", children: [
|
|
@@ -1569,7 +1570,7 @@ var shadowStyles2 = {
|
|
|
1569
1570
|
md: "shadow",
|
|
1570
1571
|
lg: "shadow-lg"
|
|
1571
1572
|
};
|
|
1572
|
-
var Card =
|
|
1573
|
+
var Card = React114__namespace.default.forwardRef(
|
|
1573
1574
|
({
|
|
1574
1575
|
className,
|
|
1575
1576
|
variant = "bordered",
|
|
@@ -1605,9 +1606,9 @@ var Card = React113__namespace.default.forwardRef(
|
|
|
1605
1606
|
}
|
|
1606
1607
|
);
|
|
1607
1608
|
Card.displayName = "Card";
|
|
1608
|
-
var CardHeader =
|
|
1609
|
+
var CardHeader = React114__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
1609
1610
|
CardHeader.displayName = "CardHeader";
|
|
1610
|
-
var CardTitle =
|
|
1611
|
+
var CardTitle = React114__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1611
1612
|
"h3",
|
|
1612
1613
|
{
|
|
1613
1614
|
ref,
|
|
@@ -1620,11 +1621,11 @@ var CardTitle = React113__namespace.default.forwardRef(({ className, ...props },
|
|
|
1620
1621
|
}
|
|
1621
1622
|
));
|
|
1622
1623
|
CardTitle.displayName = "CardTitle";
|
|
1623
|
-
var CardContent =
|
|
1624
|
+
var CardContent = React114__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("", className), ...props }));
|
|
1624
1625
|
CardContent.displayName = "CardContent";
|
|
1625
1626
|
var CardBody = CardContent;
|
|
1626
1627
|
CardBody.displayName = "CardBody";
|
|
1627
|
-
var CardFooter =
|
|
1628
|
+
var CardFooter = React114__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1628
1629
|
"div",
|
|
1629
1630
|
{
|
|
1630
1631
|
ref,
|
|
@@ -1639,7 +1640,7 @@ var sizeStyles4 = {
|
|
|
1639
1640
|
md: "h-6 w-6",
|
|
1640
1641
|
lg: "h-8 w-8"
|
|
1641
1642
|
};
|
|
1642
|
-
var Spinner =
|
|
1643
|
+
var Spinner = React114__namespace.default.forwardRef(
|
|
1643
1644
|
({ className, size = "md", ...props }, ref) => {
|
|
1644
1645
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1645
1646
|
"div",
|
|
@@ -1653,7 +1654,7 @@ var Spinner = React113__namespace.default.forwardRef(
|
|
|
1653
1654
|
}
|
|
1654
1655
|
);
|
|
1655
1656
|
Spinner.displayName = "Spinner";
|
|
1656
|
-
var Radio =
|
|
1657
|
+
var Radio = React114__namespace.default.forwardRef(
|
|
1657
1658
|
({
|
|
1658
1659
|
label,
|
|
1659
1660
|
helperText,
|
|
@@ -1757,7 +1758,7 @@ var Radio = React113__namespace.default.forwardRef(
|
|
|
1757
1758
|
}
|
|
1758
1759
|
);
|
|
1759
1760
|
Radio.displayName = "Radio";
|
|
1760
|
-
var Switch =
|
|
1761
|
+
var Switch = React114__namespace.forwardRef(
|
|
1761
1762
|
({
|
|
1762
1763
|
checked,
|
|
1763
1764
|
defaultChecked = false,
|
|
@@ -1768,10 +1769,10 @@ var Switch = React113__namespace.forwardRef(
|
|
|
1768
1769
|
name,
|
|
1769
1770
|
className
|
|
1770
1771
|
}, ref) => {
|
|
1771
|
-
const [isChecked, setIsChecked] =
|
|
1772
|
+
const [isChecked, setIsChecked] = React114__namespace.useState(
|
|
1772
1773
|
checked !== void 0 ? checked : defaultChecked
|
|
1773
1774
|
);
|
|
1774
|
-
|
|
1775
|
+
React114__namespace.useEffect(() => {
|
|
1775
1776
|
if (checked !== void 0) {
|
|
1776
1777
|
setIsChecked(checked);
|
|
1777
1778
|
}
|
|
@@ -1929,7 +1930,7 @@ var sizeStyles5 = {
|
|
|
1929
1930
|
md: "w-2.5 h-2.5",
|
|
1930
1931
|
lg: "w-3 h-3"
|
|
1931
1932
|
};
|
|
1932
|
-
var StatusDot =
|
|
1933
|
+
var StatusDot = React114__namespace.default.forwardRef(
|
|
1933
1934
|
({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
|
|
1934
1935
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1935
1936
|
"span",
|
|
@@ -1976,7 +1977,7 @@ var iconMap2 = {
|
|
|
1976
1977
|
down: LucideIcons.TrendingDown,
|
|
1977
1978
|
flat: LucideIcons.ArrowRight
|
|
1978
1979
|
};
|
|
1979
|
-
var TrendIndicator =
|
|
1980
|
+
var TrendIndicator = React114__namespace.default.forwardRef(
|
|
1980
1981
|
({
|
|
1981
1982
|
className,
|
|
1982
1983
|
value,
|
|
@@ -2035,7 +2036,7 @@ var thumbSizes = {
|
|
|
2035
2036
|
md: "w-4 h-4",
|
|
2036
2037
|
lg: "w-5 h-5"
|
|
2037
2038
|
};
|
|
2038
|
-
var RangeSlider =
|
|
2039
|
+
var RangeSlider = React114__namespace.default.forwardRef(
|
|
2039
2040
|
({
|
|
2040
2041
|
className,
|
|
2041
2042
|
min = 0,
|
|
@@ -2053,14 +2054,14 @@ var RangeSlider = React113__namespace.default.forwardRef(
|
|
|
2053
2054
|
formatValue: formatValue5,
|
|
2054
2055
|
...props
|
|
2055
2056
|
}, ref) => {
|
|
2056
|
-
const [isDragging, setIsDragging] =
|
|
2057
|
-
const [showTip, setShowTip] =
|
|
2058
|
-
const inputRef =
|
|
2057
|
+
const [isDragging, setIsDragging] = React114.useState(false);
|
|
2058
|
+
const [showTip, setShowTip] = React114.useState(false);
|
|
2059
|
+
const inputRef = React114.useRef(null);
|
|
2059
2060
|
const eventBus = useSafeEventBus();
|
|
2060
2061
|
const percentage = max !== min ? (value - min) / (max - min) * 100 : 0;
|
|
2061
2062
|
const bufferedPercentage = buffered !== void 0 ? Math.min(buffered, 100) : void 0;
|
|
2062
2063
|
const displayValue = formatValue5 ? formatValue5(value) : String(value);
|
|
2063
|
-
const handleChange =
|
|
2064
|
+
const handleChange = React114.useCallback(
|
|
2064
2065
|
(e) => {
|
|
2065
2066
|
const newValue = Number(e.target.value);
|
|
2066
2067
|
onChange?.(newValue);
|
|
@@ -2238,7 +2239,7 @@ var paddingClasses = {
|
|
|
2238
2239
|
md: "py-16",
|
|
2239
2240
|
lg: "py-24"
|
|
2240
2241
|
};
|
|
2241
|
-
var ContentSection =
|
|
2242
|
+
var ContentSection = React114__namespace.default.forwardRef(
|
|
2242
2243
|
({ children, background = "default", padding = "lg", id, className }, ref) => {
|
|
2243
2244
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2244
2245
|
Box,
|
|
@@ -2277,7 +2278,7 @@ var animatedStyles = {
|
|
|
2277
2278
|
"scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
|
|
2278
2279
|
"none": {}
|
|
2279
2280
|
};
|
|
2280
|
-
var AnimatedReveal =
|
|
2281
|
+
var AnimatedReveal = React114__namespace.default.forwardRef(
|
|
2281
2282
|
({
|
|
2282
2283
|
trigger = "scroll",
|
|
2283
2284
|
animation = "fade-up",
|
|
@@ -2292,10 +2293,10 @@ var AnimatedReveal = React113__namespace.default.forwardRef(
|
|
|
2292
2293
|
style,
|
|
2293
2294
|
...props
|
|
2294
2295
|
}, forwardedRef) => {
|
|
2295
|
-
const [isAnimated, setIsAnimated] =
|
|
2296
|
-
const internalRef =
|
|
2297
|
-
const hasAnimated =
|
|
2298
|
-
const setRef =
|
|
2296
|
+
const [isAnimated, setIsAnimated] = React114.useState(false);
|
|
2297
|
+
const internalRef = React114.useRef(null);
|
|
2298
|
+
const hasAnimated = React114.useRef(false);
|
|
2299
|
+
const setRef = React114.useCallback(
|
|
2299
2300
|
(node) => {
|
|
2300
2301
|
internalRef.current = node;
|
|
2301
2302
|
if (typeof forwardedRef === "function") forwardedRef(node);
|
|
@@ -2303,7 +2304,7 @@ var AnimatedReveal = React113__namespace.default.forwardRef(
|
|
|
2303
2304
|
},
|
|
2304
2305
|
[forwardedRef]
|
|
2305
2306
|
);
|
|
2306
|
-
|
|
2307
|
+
React114.useEffect(() => {
|
|
2307
2308
|
if (trigger !== "scroll") return;
|
|
2308
2309
|
const el = internalRef.current;
|
|
2309
2310
|
if (!el) return;
|
|
@@ -2329,7 +2330,7 @@ var AnimatedReveal = React113__namespace.default.forwardRef(
|
|
|
2329
2330
|
setIsAnimated(false);
|
|
2330
2331
|
}
|
|
2331
2332
|
} : void 0;
|
|
2332
|
-
|
|
2333
|
+
React114.useEffect(() => {
|
|
2333
2334
|
if (trigger === "manual" && manualAnimate !== void 0) {
|
|
2334
2335
|
setIsAnimated(manualAnimate);
|
|
2335
2336
|
}
|
|
@@ -2359,9 +2360,9 @@ var AnimatedReveal = React113__namespace.default.forwardRef(
|
|
|
2359
2360
|
);
|
|
2360
2361
|
AnimatedReveal.displayName = "AnimatedReveal";
|
|
2361
2362
|
function useFetchedSvg(src) {
|
|
2362
|
-
const [svg, setSvg] =
|
|
2363
|
-
const cache =
|
|
2364
|
-
|
|
2363
|
+
const [svg, setSvg] = React114.useState(null);
|
|
2364
|
+
const cache = React114.useRef({});
|
|
2365
|
+
React114.useEffect(() => {
|
|
2365
2366
|
if (!src) {
|
|
2366
2367
|
setSvg(null);
|
|
2367
2368
|
return;
|
|
@@ -2430,7 +2431,7 @@ function applyMorphAnimation(container, animate, duration, delay, easing) {
|
|
|
2430
2431
|
el.style.opacity = animate ? "1" : "0";
|
|
2431
2432
|
});
|
|
2432
2433
|
}
|
|
2433
|
-
var AnimatedGraphic =
|
|
2434
|
+
var AnimatedGraphic = React114__namespace.default.forwardRef(
|
|
2434
2435
|
({
|
|
2435
2436
|
src,
|
|
2436
2437
|
svgContent,
|
|
@@ -2449,11 +2450,11 @@ var AnimatedGraphic = React113__namespace.default.forwardRef(
|
|
|
2449
2450
|
children,
|
|
2450
2451
|
...props
|
|
2451
2452
|
}, ref) => {
|
|
2452
|
-
const containerRef =
|
|
2453
|
+
const containerRef = React114.useRef(null);
|
|
2453
2454
|
const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
|
|
2454
2455
|
const resolvedSvg = svgContent ?? fetchedSvg;
|
|
2455
|
-
const prevAnimateRef =
|
|
2456
|
-
const setRef =
|
|
2456
|
+
const prevAnimateRef = React114.useRef(animate);
|
|
2457
|
+
const setRef = React114__namespace.default.useCallback(
|
|
2457
2458
|
(node) => {
|
|
2458
2459
|
containerRef.current = node;
|
|
2459
2460
|
if (typeof ref === "function") ref(node);
|
|
@@ -2461,7 +2462,7 @@ var AnimatedGraphic = React113__namespace.default.forwardRef(
|
|
|
2461
2462
|
},
|
|
2462
2463
|
[ref]
|
|
2463
2464
|
);
|
|
2464
|
-
|
|
2465
|
+
React114.useEffect(() => {
|
|
2465
2466
|
const el = containerRef.current;
|
|
2466
2467
|
if (!el || !strokeColor) return;
|
|
2467
2468
|
const paths = el.querySelectorAll("path, line, polyline, polygon, circle, ellipse, rect");
|
|
@@ -2469,7 +2470,7 @@ var AnimatedGraphic = React113__namespace.default.forwardRef(
|
|
|
2469
2470
|
p2.style.stroke = strokeColor;
|
|
2470
2471
|
});
|
|
2471
2472
|
}, [resolvedSvg, strokeColor]);
|
|
2472
|
-
|
|
2473
|
+
React114.useEffect(() => {
|
|
2473
2474
|
const el = containerRef.current;
|
|
2474
2475
|
if (!el || !resolvedSvg) return;
|
|
2475
2476
|
if (animation === "draw" || animation === "fill") {
|
|
@@ -2494,7 +2495,7 @@ var AnimatedGraphic = React113__namespace.default.forwardRef(
|
|
|
2494
2495
|
});
|
|
2495
2496
|
}
|
|
2496
2497
|
}, [resolvedSvg, animation]);
|
|
2497
|
-
|
|
2498
|
+
React114.useEffect(() => {
|
|
2498
2499
|
const el = containerRef.current;
|
|
2499
2500
|
if (!el) return;
|
|
2500
2501
|
const id = requestAnimationFrame(() => {
|
|
@@ -2650,7 +2651,7 @@ var en_default = {
|
|
|
2650
2651
|
// hooks/useTranslate.ts
|
|
2651
2652
|
var { $meta: _meta, ...coreMessages } = en_default;
|
|
2652
2653
|
var coreLocale = coreMessages;
|
|
2653
|
-
var I18nContext =
|
|
2654
|
+
var I18nContext = React114.createContext({
|
|
2654
2655
|
locale: "en",
|
|
2655
2656
|
direction: "ltr",
|
|
2656
2657
|
t: (key) => coreLocale[key] ?? key
|
|
@@ -2659,7 +2660,7 @@ var I18nContext = React113.createContext({
|
|
|
2659
2660
|
I18nContext.displayName = "I18nContext";
|
|
2660
2661
|
I18nContext.Provider;
|
|
2661
2662
|
function useTranslate() {
|
|
2662
|
-
return
|
|
2663
|
+
return React114.useContext(I18nContext);
|
|
2663
2664
|
}
|
|
2664
2665
|
var ErrorState = ({
|
|
2665
2666
|
title,
|
|
@@ -2695,7 +2696,7 @@ var ErrorState = ({
|
|
|
2695
2696
|
);
|
|
2696
2697
|
};
|
|
2697
2698
|
ErrorState.displayName = "ErrorState";
|
|
2698
|
-
var ErrorBoundary = class extends
|
|
2699
|
+
var ErrorBoundary = class extends React114__namespace.default.Component {
|
|
2699
2700
|
constructor(props) {
|
|
2700
2701
|
super(props);
|
|
2701
2702
|
__publicField(this, "reset", () => {
|
|
@@ -2794,7 +2795,7 @@ function executeNotify(message, options, config) {
|
|
|
2794
2795
|
function executeEmit(event, payload, config) {
|
|
2795
2796
|
config.eventBus.emit(event, payload);
|
|
2796
2797
|
}
|
|
2797
|
-
var ClientEffectConfigContext =
|
|
2798
|
+
var ClientEffectConfigContext = React114.createContext(null);
|
|
2798
2799
|
ClientEffectConfigContext.Provider;
|
|
2799
2800
|
var effectIdCounter = 0;
|
|
2800
2801
|
function generateEffectId() {
|
|
@@ -3033,14 +3034,14 @@ var OfflineExecutor = class {
|
|
|
3033
3034
|
}
|
|
3034
3035
|
};
|
|
3035
3036
|
function useOfflineExecutor(options) {
|
|
3036
|
-
const executorRef =
|
|
3037
|
-
const [state, setState] =
|
|
3037
|
+
const executorRef = React114.useRef(null);
|
|
3038
|
+
const [state, setState] = React114.useState({
|
|
3038
3039
|
isOffline: false,
|
|
3039
3040
|
syncQueue: [],
|
|
3040
3041
|
localEffectsProcessed: 0,
|
|
3041
3042
|
effectsSynced: 0
|
|
3042
3043
|
});
|
|
3043
|
-
|
|
3044
|
+
React114.useEffect(() => {
|
|
3044
3045
|
const executor = new OfflineExecutor({
|
|
3045
3046
|
...options,
|
|
3046
3047
|
onQueueChange: (queue) => {
|
|
@@ -3055,7 +3056,7 @@ function useOfflineExecutor(options) {
|
|
|
3055
3056
|
executorRef.current = null;
|
|
3056
3057
|
};
|
|
3057
3058
|
}, []);
|
|
3058
|
-
|
|
3059
|
+
React114.useEffect(() => {
|
|
3059
3060
|
if (!options.autoSync || !options.serverUrl) return;
|
|
3060
3061
|
const handleOnline = async () => {
|
|
3061
3062
|
if (executorRef.current) {
|
|
@@ -3069,13 +3070,13 @@ function useOfflineExecutor(options) {
|
|
|
3069
3070
|
window.addEventListener("online", handleOnline);
|
|
3070
3071
|
return () => window.removeEventListener("online", handleOnline);
|
|
3071
3072
|
}, [options.autoSync, options.serverUrl, options.authToken]);
|
|
3072
|
-
const executeEffects =
|
|
3073
|
+
const executeEffects = React114.useCallback((effects) => {
|
|
3073
3074
|
executorRef.current?.executeClientEffects(effects);
|
|
3074
3075
|
if (executorRef.current) {
|
|
3075
3076
|
setState(executorRef.current.getState());
|
|
3076
3077
|
}
|
|
3077
3078
|
}, []);
|
|
3078
|
-
const processEventOffline =
|
|
3079
|
+
const processEventOffline = React114.useCallback(
|
|
3079
3080
|
(event, payload, effects) => {
|
|
3080
3081
|
const result = executorRef.current?.processEventOffline(event, payload, effects);
|
|
3081
3082
|
if (executorRef.current) {
|
|
@@ -3085,7 +3086,7 @@ function useOfflineExecutor(options) {
|
|
|
3085
3086
|
},
|
|
3086
3087
|
[]
|
|
3087
3088
|
);
|
|
3088
|
-
const sync =
|
|
3089
|
+
const sync = React114.useCallback(async () => {
|
|
3089
3090
|
if (!executorRef.current || !options.serverUrl) return 0;
|
|
3090
3091
|
const count = await executorRef.current.syncPendingEffects(
|
|
3091
3092
|
options.serverUrl,
|
|
@@ -3094,7 +3095,7 @@ function useOfflineExecutor(options) {
|
|
|
3094
3095
|
setState(executorRef.current.getState());
|
|
3095
3096
|
return count;
|
|
3096
3097
|
}, [options.serverUrl, options.authToken]);
|
|
3097
|
-
const clearQueue =
|
|
3098
|
+
const clearQueue = React114.useCallback(() => {
|
|
3098
3099
|
executorRef.current?.clearQueue();
|
|
3099
3100
|
if (executorRef.current) {
|
|
3100
3101
|
setState(executorRef.current.getState());
|
|
@@ -3110,7 +3111,7 @@ function useOfflineExecutor(options) {
|
|
|
3110
3111
|
clearQueue
|
|
3111
3112
|
};
|
|
3112
3113
|
}
|
|
3113
|
-
|
|
3114
|
+
React114.createContext(null);
|
|
3114
3115
|
var defaultIcon = L__default.default.icon({
|
|
3115
3116
|
iconUrl: "https://unpkg.com/leaflet@1.9.4/dist/images/marker-icon.png",
|
|
3116
3117
|
iconRetinaUrl: "https://unpkg.com/leaflet@1.9.4/dist/images/marker-icon-2x.png",
|
|
@@ -3288,7 +3289,7 @@ function bindTraitStateGetter(getter) {
|
|
|
3288
3289
|
}
|
|
3289
3290
|
}
|
|
3290
3291
|
exposeOnWindow();
|
|
3291
|
-
var MarkdownContent =
|
|
3292
|
+
var MarkdownContent = React114__namespace.default.memo(
|
|
3292
3293
|
({ content, direction, className }) => {
|
|
3293
3294
|
const { t: _t } = useTranslate();
|
|
3294
3295
|
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
@@ -3354,7 +3355,7 @@ var MarkdownContent = React113__namespace.default.memo(
|
|
|
3354
3355
|
"th",
|
|
3355
3356
|
{
|
|
3356
3357
|
...props,
|
|
3357
|
-
className: "border border-gray-300 dark:border-gray-600 bg-
|
|
3358
|
+
className: "border border-gray-300 dark:border-gray-600 bg-[var(--color-muted)] px-4 py-2 text-left font-semibold",
|
|
3358
3359
|
children
|
|
3359
3360
|
}
|
|
3360
3361
|
);
|
|
@@ -3471,7 +3472,7 @@ function computeFoldRegions(code) {
|
|
|
3471
3472
|
}
|
|
3472
3473
|
var LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
3473
3474
|
var HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
3474
|
-
var CodeBlock =
|
|
3475
|
+
var CodeBlock = React114__namespace.default.memo(
|
|
3475
3476
|
({
|
|
3476
3477
|
code: rawCode,
|
|
3477
3478
|
language = "text",
|
|
@@ -3486,22 +3487,22 @@ var CodeBlock = React113__namespace.default.memo(
|
|
|
3486
3487
|
const activeStyle = isOrb ? orbStyle : dark__default.default;
|
|
3487
3488
|
const eventBus = useEventBus();
|
|
3488
3489
|
const { t: _t } = useTranslate();
|
|
3489
|
-
const scrollRef =
|
|
3490
|
-
const codeRef =
|
|
3491
|
-
const savedScrollLeftRef =
|
|
3492
|
-
const [copied, setCopied] =
|
|
3490
|
+
const scrollRef = React114.useRef(null);
|
|
3491
|
+
const codeRef = React114.useRef(null);
|
|
3492
|
+
const savedScrollLeftRef = React114.useRef(0);
|
|
3493
|
+
const [copied, setCopied] = React114.useState(false);
|
|
3493
3494
|
const isFoldable = foldableProp ?? (language === "orb" || language === "json");
|
|
3494
|
-
const [collapsed, setCollapsed] =
|
|
3495
|
-
const foldRegions =
|
|
3495
|
+
const [collapsed, setCollapsed] = React114.useState(() => /* @__PURE__ */ new Set());
|
|
3496
|
+
const foldRegions = React114.useMemo(
|
|
3496
3497
|
() => isFoldable ? computeFoldRegions(code) : [],
|
|
3497
3498
|
[code, isFoldable]
|
|
3498
3499
|
);
|
|
3499
|
-
const foldStartMap =
|
|
3500
|
+
const foldStartMap = React114.useMemo(() => {
|
|
3500
3501
|
const m = /* @__PURE__ */ new Map();
|
|
3501
3502
|
for (const r of foldRegions) m.set(r.start, r);
|
|
3502
3503
|
return m;
|
|
3503
3504
|
}, [foldRegions]);
|
|
3504
|
-
const hiddenLines =
|
|
3505
|
+
const hiddenLines = React114.useMemo(() => {
|
|
3505
3506
|
const h = /* @__PURE__ */ new Set();
|
|
3506
3507
|
for (const r of foldRegions) {
|
|
3507
3508
|
if (!collapsed.has(r.start)) continue;
|
|
@@ -3509,11 +3510,11 @@ var CodeBlock = React113__namespace.default.memo(
|
|
|
3509
3510
|
}
|
|
3510
3511
|
return h;
|
|
3511
3512
|
}, [foldRegions, collapsed]);
|
|
3512
|
-
const collapsedRef =
|
|
3513
|
+
const collapsedRef = React114.useRef(collapsed);
|
|
3513
3514
|
collapsedRef.current = collapsed;
|
|
3514
|
-
const foldStartMapRef =
|
|
3515
|
+
const foldStartMapRef = React114.useRef(foldStartMap);
|
|
3515
3516
|
foldStartMapRef.current = foldStartMap;
|
|
3516
|
-
const toggleFold =
|
|
3517
|
+
const toggleFold = React114.useCallback((lineNum) => {
|
|
3517
3518
|
setCollapsed((prev) => {
|
|
3518
3519
|
const next = new Set(prev);
|
|
3519
3520
|
if (next.has(lineNum)) next.delete(lineNum);
|
|
@@ -3521,12 +3522,12 @@ var CodeBlock = React113__namespace.default.memo(
|
|
|
3521
3522
|
return next;
|
|
3522
3523
|
});
|
|
3523
3524
|
}, []);
|
|
3524
|
-
const toggleFoldRef =
|
|
3525
|
+
const toggleFoldRef = React114.useRef(toggleFold);
|
|
3525
3526
|
toggleFoldRef.current = toggleFold;
|
|
3526
|
-
|
|
3527
|
+
React114.useEffect(() => {
|
|
3527
3528
|
setCollapsed(/* @__PURE__ */ new Set());
|
|
3528
3529
|
}, [code]);
|
|
3529
|
-
const highlightedElement =
|
|
3530
|
+
const highlightedElement = React114.useMemo(
|
|
3530
3531
|
() => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3531
3532
|
SyntaxHighlighter__default.default,
|
|
3532
3533
|
{
|
|
@@ -3551,7 +3552,7 @@ var CodeBlock = React113__namespace.default.memo(
|
|
|
3551
3552
|
),
|
|
3552
3553
|
[code, language, activeStyle]
|
|
3553
3554
|
);
|
|
3554
|
-
|
|
3555
|
+
React114.useLayoutEffect(() => {
|
|
3555
3556
|
const container = codeRef.current;
|
|
3556
3557
|
if (!container) return;
|
|
3557
3558
|
container.querySelectorAll(".fold-toggle, .fold-summary").forEach((el) => el.remove());
|
|
@@ -3595,17 +3596,17 @@ var CodeBlock = React113__namespace.default.memo(
|
|
|
3595
3596
|
}
|
|
3596
3597
|
});
|
|
3597
3598
|
}, [collapsed, hiddenLines, foldStartMap, foldRegions, isFoldable]);
|
|
3598
|
-
|
|
3599
|
+
React114.useLayoutEffect(() => {
|
|
3599
3600
|
const el = scrollRef.current;
|
|
3600
3601
|
return () => {
|
|
3601
3602
|
if (el) savedScrollLeftRef.current = el.scrollLeft;
|
|
3602
3603
|
};
|
|
3603
3604
|
}, [language, code]);
|
|
3604
|
-
|
|
3605
|
+
React114.useLayoutEffect(() => {
|
|
3605
3606
|
const el = scrollRef.current;
|
|
3606
3607
|
if (el) el.scrollLeft = savedScrollLeftRef.current;
|
|
3607
3608
|
}, [language, code]);
|
|
3608
|
-
|
|
3609
|
+
React114.useEffect(() => {
|
|
3609
3610
|
const el = scrollRef.current;
|
|
3610
3611
|
if (!el) return;
|
|
3611
3612
|
const handle = () => {
|
|
@@ -3632,7 +3633,7 @@ var CodeBlock = React113__namespace.default.memo(
|
|
|
3632
3633
|
{
|
|
3633
3634
|
justify: "between",
|
|
3634
3635
|
align: "center",
|
|
3635
|
-
className: "px-3 py-2 bg-
|
|
3636
|
+
className: "px-3 py-2 bg-[var(--color-card)] rounded-t-lg border-b border-gray-700",
|
|
3636
3637
|
children: [
|
|
3637
3638
|
showLanguageBadge && /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "default", size: "sm", children: language }),
|
|
3638
3639
|
showCopyButton && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3675,18 +3676,18 @@ CodeBlock.displayName = "CodeBlock";
|
|
|
3675
3676
|
|
|
3676
3677
|
// lib/debug.ts
|
|
3677
3678
|
typeof window !== "undefined" && (localStorage.getItem("debug") === "true" || process.env.NODE_ENV === "development");
|
|
3678
|
-
|
|
3679
|
-
var GameAudioContext =
|
|
3679
|
+
React114.lazy(() => import('react-markdown'));
|
|
3680
|
+
var GameAudioContext = React114.createContext(null);
|
|
3680
3681
|
GameAudioContext.displayName = "GameAudioContext";
|
|
3681
3682
|
|
|
3682
3683
|
// components/organisms/component-registry.generated.ts
|
|
3683
3684
|
function lazyThree(name, loader) {
|
|
3684
|
-
const Lazy =
|
|
3685
|
+
const Lazy = React114__namespace.default.lazy(() => loader().then((m) => ({ default: m[name] })));
|
|
3685
3686
|
function ThreeWrapper(props) {
|
|
3686
|
-
return
|
|
3687
|
-
|
|
3687
|
+
return React114__namespace.default.createElement(
|
|
3688
|
+
React114__namespace.default.Suspense,
|
|
3688
3689
|
{ fallback: null },
|
|
3689
|
-
|
|
3690
|
+
React114__namespace.default.createElement(Lazy, props)
|
|
3690
3691
|
);
|
|
3691
3692
|
}
|
|
3692
3693
|
ThreeWrapper.displayName = `Lazy(${name})`;
|
|
@@ -3707,13 +3708,13 @@ lazyThree("PhysicsObject3D", () => import('@almadar/ui/components/organisms/game
|
|
|
3707
3708
|
lazyThree("Scene3D", () => import('@almadar/ui/components/organisms/game/three'));
|
|
3708
3709
|
lazyThree("TileRenderer", () => import('@almadar/ui/components/organisms/game/three'));
|
|
3709
3710
|
lazyThree("UnitRenderer", () => import('@almadar/ui/components/organisms/game/three'));
|
|
3710
|
-
var SuspenseConfigContext =
|
|
3711
|
-
|
|
3711
|
+
var SuspenseConfigContext = React114.createContext({ enabled: false });
|
|
3712
|
+
React114.createContext(false);
|
|
3712
3713
|
function SuspenseConfigProvider({
|
|
3713
3714
|
config,
|
|
3714
3715
|
children
|
|
3715
3716
|
}) {
|
|
3716
|
-
return
|
|
3717
|
+
return React114__namespace.default.createElement(
|
|
3717
3718
|
SuspenseConfigContext.Provider,
|
|
3718
3719
|
{ value: config },
|
|
3719
3720
|
children
|
|
@@ -3758,8 +3759,8 @@ function VerificationProvider({
|
|
|
3758
3759
|
}) {
|
|
3759
3760
|
const isEnabled = enabled ?? (typeof process !== "undefined" && process.env?.NODE_ENV !== "production");
|
|
3760
3761
|
const eventBus = useEventBus();
|
|
3761
|
-
const pendingRef =
|
|
3762
|
-
|
|
3762
|
+
const pendingRef = React114.useRef(/* @__PURE__ */ new Map());
|
|
3763
|
+
React114.useEffect(() => {
|
|
3763
3764
|
if (!isEnabled) return;
|
|
3764
3765
|
if (!eventBus.onAny) return;
|
|
3765
3766
|
const unsub = eventBus.onAny((evt) => {
|
|
@@ -3855,7 +3856,7 @@ function VerificationProvider({
|
|
|
3855
3856
|
);
|
|
3856
3857
|
return unsub;
|
|
3857
3858
|
}, [isEnabled, eventBus]);
|
|
3858
|
-
|
|
3859
|
+
React114.useEffect(() => {
|
|
3859
3860
|
if (!isEnabled) return;
|
|
3860
3861
|
if (!runtimeManager) return;
|
|
3861
3862
|
runtimeManager.setObserver({
|
|
@@ -3877,11 +3878,11 @@ function VerificationProvider({
|
|
|
3877
3878
|
"pass"
|
|
3878
3879
|
);
|
|
3879
3880
|
}, [isEnabled, runtimeManager]);
|
|
3880
|
-
|
|
3881
|
+
React114.useEffect(() => {
|
|
3881
3882
|
if (!isEnabled) return;
|
|
3882
3883
|
bindEventBus(eventBus);
|
|
3883
3884
|
}, [isEnabled, eventBus]);
|
|
3884
|
-
|
|
3885
|
+
React114.useEffect(() => {
|
|
3885
3886
|
if (!isEnabled) return;
|
|
3886
3887
|
if (traitStateGetter) {
|
|
3887
3888
|
bindTraitStateGetter(traitStateGetter);
|
|
@@ -3905,7 +3906,7 @@ function OrbitalProvider({
|
|
|
3905
3906
|
suspense = false,
|
|
3906
3907
|
verification
|
|
3907
3908
|
}) {
|
|
3908
|
-
const suspenseConfig =
|
|
3909
|
+
const suspenseConfig = React114.useMemo(
|
|
3909
3910
|
() => ({ enabled: suspense }),
|
|
3910
3911
|
[suspense]
|
|
3911
3912
|
);
|
|
@@ -3925,43 +3926,43 @@ function OrbitalProvider({
|
|
|
3925
3926
|
);
|
|
3926
3927
|
}
|
|
3927
3928
|
OrbitalProvider.displayName = "OrbitalProvider";
|
|
3928
|
-
var FetchedDataContext =
|
|
3929
|
+
var FetchedDataContext = React114.createContext(null);
|
|
3929
3930
|
function FetchedDataProvider({
|
|
3930
3931
|
initialData,
|
|
3931
3932
|
children
|
|
3932
3933
|
}) {
|
|
3933
|
-
const [state, setState] =
|
|
3934
|
+
const [state, setState] = React114.useState(() => ({
|
|
3934
3935
|
data: initialData || {},
|
|
3935
3936
|
fetchedAt: {},
|
|
3936
3937
|
loading: false,
|
|
3937
3938
|
error: null
|
|
3938
3939
|
}));
|
|
3939
|
-
const getData =
|
|
3940
|
+
const getData = React114.useCallback(
|
|
3940
3941
|
(entityName) => {
|
|
3941
3942
|
return state.data[entityName] || [];
|
|
3942
3943
|
},
|
|
3943
3944
|
[state.data]
|
|
3944
3945
|
);
|
|
3945
|
-
const getById2 =
|
|
3946
|
+
const getById2 = React114.useCallback(
|
|
3946
3947
|
(entityName, id) => {
|
|
3947
3948
|
const records = state.data[entityName];
|
|
3948
3949
|
return records?.find((r) => r.id === id);
|
|
3949
3950
|
},
|
|
3950
3951
|
[state.data]
|
|
3951
3952
|
);
|
|
3952
|
-
const hasData =
|
|
3953
|
+
const hasData = React114.useCallback(
|
|
3953
3954
|
(entityName) => {
|
|
3954
3955
|
return entityName in state.data && state.data[entityName].length > 0;
|
|
3955
3956
|
},
|
|
3956
3957
|
[state.data]
|
|
3957
3958
|
);
|
|
3958
|
-
const getFetchedAt =
|
|
3959
|
+
const getFetchedAt = React114.useCallback(
|
|
3959
3960
|
(entityName) => {
|
|
3960
3961
|
return state.fetchedAt[entityName];
|
|
3961
3962
|
},
|
|
3962
3963
|
[state.fetchedAt]
|
|
3963
3964
|
);
|
|
3964
|
-
const setData =
|
|
3965
|
+
const setData = React114.useCallback((data) => {
|
|
3965
3966
|
const now = Date.now();
|
|
3966
3967
|
setState((prev) => ({
|
|
3967
3968
|
...prev,
|
|
@@ -3980,14 +3981,14 @@ function FetchedDataProvider({
|
|
|
3980
3981
|
error: null
|
|
3981
3982
|
}));
|
|
3982
3983
|
}, []);
|
|
3983
|
-
const clearData =
|
|
3984
|
+
const clearData = React114.useCallback(() => {
|
|
3984
3985
|
setState((prev) => ({
|
|
3985
3986
|
...prev,
|
|
3986
3987
|
data: {},
|
|
3987
3988
|
fetchedAt: {}
|
|
3988
3989
|
}));
|
|
3989
3990
|
}, []);
|
|
3990
|
-
const clearEntity =
|
|
3991
|
+
const clearEntity = React114.useCallback((entityName) => {
|
|
3991
3992
|
setState((prev) => {
|
|
3992
3993
|
const newData = { ...prev.data };
|
|
3993
3994
|
const newFetchedAt = { ...prev.fetchedAt };
|
|
@@ -4000,13 +4001,13 @@ function FetchedDataProvider({
|
|
|
4000
4001
|
};
|
|
4001
4002
|
});
|
|
4002
4003
|
}, []);
|
|
4003
|
-
const setLoading =
|
|
4004
|
+
const setLoading = React114.useCallback((loading) => {
|
|
4004
4005
|
setState((prev) => ({ ...prev, loading }));
|
|
4005
4006
|
}, []);
|
|
4006
|
-
const setError =
|
|
4007
|
+
const setError = React114.useCallback((error) => {
|
|
4007
4008
|
setState((prev) => ({ ...prev, error, loading: false }));
|
|
4008
4009
|
}, []);
|
|
4009
|
-
const contextValue2 =
|
|
4010
|
+
const contextValue2 = React114.useMemo(
|
|
4010
4011
|
() => ({
|
|
4011
4012
|
getData,
|
|
4012
4013
|
getById: getById2,
|
|
@@ -4037,10 +4038,10 @@ function FetchedDataProvider({
|
|
|
4037
4038
|
return /* @__PURE__ */ jsxRuntime.jsx(FetchedDataContext.Provider, { value: contextValue2, children });
|
|
4038
4039
|
}
|
|
4039
4040
|
function useFetchedDataContext() {
|
|
4040
|
-
return
|
|
4041
|
+
return React114.useContext(FetchedDataContext);
|
|
4041
4042
|
}
|
|
4042
4043
|
function useFetchedData() {
|
|
4043
|
-
const context =
|
|
4044
|
+
const context = React114.useContext(FetchedDataContext);
|
|
4044
4045
|
if (!context) {
|
|
4045
4046
|
return {
|
|
4046
4047
|
getData: () => [],
|
|
@@ -4080,15 +4081,15 @@ function useFetchedEntity(entityName) {
|
|
|
4080
4081
|
error: context.error
|
|
4081
4082
|
};
|
|
4082
4083
|
}
|
|
4083
|
-
var OfflineModeContext =
|
|
4084
|
+
var OfflineModeContext = React114.createContext(null);
|
|
4084
4085
|
function OfflineModeProvider({
|
|
4085
4086
|
children,
|
|
4086
4087
|
...executorOptions
|
|
4087
4088
|
}) {
|
|
4088
|
-
const [forceOffline, setForceOffline] =
|
|
4089
|
+
const [forceOffline, setForceOffline] = React114.useState(false);
|
|
4089
4090
|
const executor = useOfflineExecutor(executorOptions);
|
|
4090
4091
|
const effectivelyOffline = executor.isOffline || forceOffline;
|
|
4091
|
-
const contextValue2 =
|
|
4092
|
+
const contextValue2 = React114.useMemo(
|
|
4092
4093
|
() => ({
|
|
4093
4094
|
...executor,
|
|
4094
4095
|
forceOffline,
|
|
@@ -4100,14 +4101,14 @@ function OfflineModeProvider({
|
|
|
4100
4101
|
return /* @__PURE__ */ jsxRuntime.jsx(OfflineModeContext.Provider, { value: contextValue2, children });
|
|
4101
4102
|
}
|
|
4102
4103
|
function useOfflineMode() {
|
|
4103
|
-
const context =
|
|
4104
|
+
const context = React114.useContext(OfflineModeContext);
|
|
4104
4105
|
if (!context) {
|
|
4105
4106
|
throw new Error("useOfflineMode must be used within OfflineModeProvider");
|
|
4106
4107
|
}
|
|
4107
4108
|
return context;
|
|
4108
4109
|
}
|
|
4109
4110
|
function useOptionalOfflineMode() {
|
|
4110
|
-
return
|
|
4111
|
+
return React114.useContext(OfflineModeContext);
|
|
4111
4112
|
}
|
|
4112
4113
|
|
|
4113
4114
|
exports.EntityStoreContext = EntityStoreContext;
|