@almadar/ui 2.27.3 → 2.27.4
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/components/atoms/flow/FlowLabel.d.ts +23 -0
- package/dist/components/atoms/flow/FlowMinimap.d.ts +28 -0
- package/dist/components/atoms/flow/FlowNodeShell.d.ts +25 -0
- package/dist/components/atoms/flow/FlowPort.d.ts +26 -0
- package/dist/components/atoms/flow/FlowWire.d.ts +39 -0
- package/dist/components/atoms/flow/index.d.ts +13 -0
- package/dist/components/atoms/index.d.ts +1 -0
- package/dist/components/index.cjs +1744 -1017
- package/dist/components/index.js +853 -141
- package/dist/components/molecules/avl/AvlBehaviorGlyph.d.ts +61 -0
- package/dist/components/molecules/avl/index.d.ts +1 -0
- package/dist/components/molecules/flow/BehaviorNode.d.ts +28 -0
- package/dist/components/molecules/flow/EffectNode.d.ts +26 -0
- package/dist/components/molecules/flow/EventWireEdge.d.ts +23 -0
- package/dist/components/molecules/flow/ExprNode.d.ts +27 -0
- package/dist/components/molecules/flow/FlowStateNode.d.ts +18 -0
- package/dist/components/molecules/flow/NodePalette.d.ts +36 -0
- package/dist/components/molecules/flow/OrbitalNode.d.ts +31 -0
- package/dist/components/molecules/flow/TransitionEdge.d.ts +26 -0
- package/dist/components/molecules/flow/index.d.ts +8 -0
- package/dist/components/molecules/index.d.ts +1 -0
- package/dist/flow/index.cjs +3832 -0
- package/dist/flow/index.d.cts +367 -0
- package/dist/flow/index.d.ts +10 -0
- package/dist/flow/index.js +3793 -0
- package/dist/providers/index.cjs +145 -143
- package/dist/providers/index.js +43 -41
- package/dist/runtime/index.cjs +976 -919
- package/dist/runtime/index.js +202 -145
- package/package.json +7 -1
package/dist/providers/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var React113 = require('react');
|
|
4
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
5
5
|
var providers = require('@almadar/ui/providers');
|
|
6
6
|
require('react-dom');
|
|
@@ -20,6 +20,7 @@ var remarkMath = require('remark-math');
|
|
|
20
20
|
var rehypeKatex = require('rehype-katex');
|
|
21
21
|
var SyntaxHighlighter = require('react-syntax-highlighter/dist/esm/prism');
|
|
22
22
|
var dark = require('react-syntax-highlighter/dist/esm/styles/prism/vsc-dark-plus');
|
|
23
|
+
require('@xyflow/react');
|
|
23
24
|
|
|
24
25
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
25
26
|
|
|
@@ -41,7 +42,7 @@ function _interopNamespace(e) {
|
|
|
41
42
|
return Object.freeze(n);
|
|
42
43
|
}
|
|
43
44
|
|
|
44
|
-
var
|
|
45
|
+
var React113__namespace = /*#__PURE__*/_interopNamespace(React113);
|
|
45
46
|
var LucideIcons__namespace = /*#__PURE__*/_interopNamespace(LucideIcons);
|
|
46
47
|
var L__default = /*#__PURE__*/_interopDefault(L);
|
|
47
48
|
var ReactMarkdown__default = /*#__PURE__*/_interopDefault(ReactMarkdown);
|
|
@@ -153,7 +154,7 @@ var BUILT_IN_THEMES = [
|
|
|
153
154
|
hasDarkMode: true
|
|
154
155
|
}
|
|
155
156
|
];
|
|
156
|
-
var ThemeContext =
|
|
157
|
+
var ThemeContext = React113.createContext(void 0);
|
|
157
158
|
var THEME_STORAGE_KEY = "theme";
|
|
158
159
|
var MODE_STORAGE_KEY = "theme-mode";
|
|
159
160
|
function getSystemMode() {
|
|
@@ -173,14 +174,14 @@ var ThemeProvider = ({
|
|
|
173
174
|
defaultMode = "system",
|
|
174
175
|
targetRef
|
|
175
176
|
}) => {
|
|
176
|
-
const availableThemes =
|
|
177
|
+
const availableThemes = React113.useMemo(() => {
|
|
177
178
|
const themeMap = /* @__PURE__ */ new Map();
|
|
178
179
|
BUILT_IN_THEMES.forEach((t) => themeMap.set(t.name, t));
|
|
179
180
|
themes.forEach((t) => themeMap.set(t.name, t));
|
|
180
181
|
return Array.from(themeMap.values());
|
|
181
182
|
}, [themes]);
|
|
182
183
|
const isScoped = !!targetRef;
|
|
183
|
-
const [theme, setThemeState] =
|
|
184
|
+
const [theme, setThemeState] = React113.useState(() => {
|
|
184
185
|
if (isScoped || typeof window === "undefined") return defaultTheme;
|
|
185
186
|
const stored = localStorage.getItem(THEME_STORAGE_KEY);
|
|
186
187
|
const validThemes = [
|
|
@@ -192,7 +193,7 @@ var ThemeProvider = ({
|
|
|
192
193
|
}
|
|
193
194
|
return defaultTheme;
|
|
194
195
|
});
|
|
195
|
-
const [mode, setModeState] =
|
|
196
|
+
const [mode, setModeState] = React113.useState(() => {
|
|
196
197
|
if (isScoped || typeof window === "undefined") return defaultMode;
|
|
197
198
|
const stored = localStorage.getItem(MODE_STORAGE_KEY);
|
|
198
199
|
if (stored === "light" || stored === "dark" || stored === "system") {
|
|
@@ -200,14 +201,14 @@ var ThemeProvider = ({
|
|
|
200
201
|
}
|
|
201
202
|
return defaultMode;
|
|
202
203
|
});
|
|
203
|
-
const [resolvedMode, setResolvedMode] =
|
|
204
|
+
const [resolvedMode, setResolvedMode] = React113.useState(
|
|
204
205
|
() => resolveMode(mode)
|
|
205
206
|
);
|
|
206
|
-
const appliedTheme =
|
|
207
|
+
const appliedTheme = React113.useMemo(
|
|
207
208
|
() => `${theme}-${resolvedMode}`,
|
|
208
209
|
[theme, resolvedMode]
|
|
209
210
|
);
|
|
210
|
-
|
|
211
|
+
React113.useEffect(() => {
|
|
211
212
|
const updateResolved = () => {
|
|
212
213
|
setResolvedMode(resolveMode(mode));
|
|
213
214
|
};
|
|
@@ -220,7 +221,7 @@ var ThemeProvider = ({
|
|
|
220
221
|
}
|
|
221
222
|
return void 0;
|
|
222
223
|
}, [mode]);
|
|
223
|
-
|
|
224
|
+
React113.useEffect(() => {
|
|
224
225
|
if (isScoped) {
|
|
225
226
|
if (targetRef?.current) {
|
|
226
227
|
targetRef.current.setAttribute("data-theme", appliedTheme);
|
|
@@ -234,7 +235,7 @@ var ThemeProvider = ({
|
|
|
234
235
|
root.classList.remove("light", "dark");
|
|
235
236
|
root.classList.add(resolvedMode);
|
|
236
237
|
}, [appliedTheme, resolvedMode, targetRef, isScoped]);
|
|
237
|
-
const setTheme =
|
|
238
|
+
const setTheme = React113.useCallback(
|
|
238
239
|
(newTheme) => {
|
|
239
240
|
const validTheme = availableThemes.find((t) => t.name === newTheme);
|
|
240
241
|
if (validTheme) {
|
|
@@ -250,17 +251,17 @@ var ThemeProvider = ({
|
|
|
250
251
|
},
|
|
251
252
|
[availableThemes]
|
|
252
253
|
);
|
|
253
|
-
const setMode =
|
|
254
|
+
const setMode = React113.useCallback((newMode) => {
|
|
254
255
|
setModeState(newMode);
|
|
255
256
|
if (!isScoped && typeof window !== "undefined") {
|
|
256
257
|
localStorage.setItem(MODE_STORAGE_KEY, newMode);
|
|
257
258
|
}
|
|
258
259
|
}, []);
|
|
259
|
-
const toggleMode =
|
|
260
|
+
const toggleMode = React113.useCallback(() => {
|
|
260
261
|
const newMode = resolvedMode === "dark" ? "light" : "dark";
|
|
261
262
|
setMode(newMode);
|
|
262
263
|
}, [resolvedMode, setMode]);
|
|
263
|
-
const contextValue =
|
|
264
|
+
const contextValue = React113.useMemo(
|
|
264
265
|
() => ({
|
|
265
266
|
theme,
|
|
266
267
|
mode,
|
|
@@ -356,15 +357,15 @@ var fallbackEventBus = {
|
|
|
356
357
|
}
|
|
357
358
|
};
|
|
358
359
|
function useEventBus() {
|
|
359
|
-
const context =
|
|
360
|
+
const context = React113.useContext(providers.EventBusContext);
|
|
360
361
|
return context ?? getGlobalEventBus() ?? fallbackEventBus;
|
|
361
362
|
}
|
|
362
|
-
var EventBusContext2 =
|
|
363
|
+
var EventBusContext2 = React113.createContext(null);
|
|
363
364
|
function EventBusProvider({ children, debug: debug2 = false }) {
|
|
364
|
-
const listenersRef =
|
|
365
|
-
const anyListenersRef =
|
|
366
|
-
const deprecationWarningShown =
|
|
367
|
-
const getSelectedEntity =
|
|
365
|
+
const listenersRef = React113.useRef(/* @__PURE__ */ new Map());
|
|
366
|
+
const anyListenersRef = React113.useRef(/* @__PURE__ */ new Set());
|
|
367
|
+
const deprecationWarningShown = React113.useRef(false);
|
|
368
|
+
const getSelectedEntity = React113.useCallback(() => {
|
|
368
369
|
if (!deprecationWarningShown.current) {
|
|
369
370
|
console.warn(
|
|
370
371
|
"[EventBus] getSelectedEntity is deprecated. Use SelectionProvider and useSelection hook instead. See SelectionProvider.tsx for migration guide."
|
|
@@ -373,7 +374,7 @@ function EventBusProvider({ children, debug: debug2 = false }) {
|
|
|
373
374
|
}
|
|
374
375
|
return null;
|
|
375
376
|
}, []);
|
|
376
|
-
const clearSelectedEntity =
|
|
377
|
+
const clearSelectedEntity = React113.useCallback(() => {
|
|
377
378
|
if (!deprecationWarningShown.current) {
|
|
378
379
|
console.warn(
|
|
379
380
|
"[EventBus] clearSelectedEntity is deprecated. Use SelectionProvider and useSelection hook instead. See SelectionProvider.tsx for migration guide."
|
|
@@ -381,7 +382,7 @@ function EventBusProvider({ children, debug: debug2 = false }) {
|
|
|
381
382
|
deprecationWarningShown.current = true;
|
|
382
383
|
}
|
|
383
384
|
}, []);
|
|
384
|
-
const emit =
|
|
385
|
+
const emit = React113.useCallback((type, payload) => {
|
|
385
386
|
const event = {
|
|
386
387
|
type,
|
|
387
388
|
payload,
|
|
@@ -415,7 +416,7 @@ function EventBusProvider({ children, debug: debug2 = false }) {
|
|
|
415
416
|
}
|
|
416
417
|
}
|
|
417
418
|
}, [debug2]);
|
|
418
|
-
const on =
|
|
419
|
+
const on = React113.useCallback((type, listener) => {
|
|
419
420
|
if (!listenersRef.current.has(type)) {
|
|
420
421
|
listenersRef.current.set(type, /* @__PURE__ */ new Set());
|
|
421
422
|
}
|
|
@@ -434,18 +435,18 @@ function EventBusProvider({ children, debug: debug2 = false }) {
|
|
|
434
435
|
}
|
|
435
436
|
};
|
|
436
437
|
}, [debug2]);
|
|
437
|
-
const once =
|
|
438
|
+
const once = React113.useCallback((type, listener) => {
|
|
438
439
|
const wrappedListener = (event) => {
|
|
439
440
|
listenersRef.current.get(type)?.delete(wrappedListener);
|
|
440
441
|
listener(event);
|
|
441
442
|
};
|
|
442
443
|
return on(type, wrappedListener);
|
|
443
444
|
}, [on]);
|
|
444
|
-
const hasListeners =
|
|
445
|
+
const hasListeners = React113.useCallback((type) => {
|
|
445
446
|
const listeners6 = listenersRef.current.get(type);
|
|
446
447
|
return listeners6 !== void 0 && listeners6.size > 0;
|
|
447
448
|
}, []);
|
|
448
|
-
const onAny =
|
|
449
|
+
const onAny = React113.useCallback((listener) => {
|
|
449
450
|
anyListenersRef.current.add(listener);
|
|
450
451
|
if (debug2) {
|
|
451
452
|
console.log(`[EventBus] onAny subscribed, total: ${anyListenersRef.current.size}`);
|
|
@@ -457,7 +458,7 @@ function EventBusProvider({ children, debug: debug2 = false }) {
|
|
|
457
458
|
}
|
|
458
459
|
};
|
|
459
460
|
}, [debug2]);
|
|
460
|
-
const contextValue =
|
|
461
|
+
const contextValue = React113.useMemo(
|
|
461
462
|
() => ({
|
|
462
463
|
emit,
|
|
463
464
|
on,
|
|
@@ -469,7 +470,7 @@ function EventBusProvider({ children, debug: debug2 = false }) {
|
|
|
469
470
|
}),
|
|
470
471
|
[emit, on, once, hasListeners, onAny, getSelectedEntity, clearSelectedEntity]
|
|
471
472
|
);
|
|
472
|
-
|
|
473
|
+
React113.useEffect(() => {
|
|
473
474
|
setGlobalEventBus(contextValue);
|
|
474
475
|
return () => {
|
|
475
476
|
setGlobalEventBus(null);
|
|
@@ -477,7 +478,7 @@ function EventBusProvider({ children, debug: debug2 = false }) {
|
|
|
477
478
|
}, [contextValue]);
|
|
478
479
|
return /* @__PURE__ */ jsxRuntime.jsx(EventBusContext2.Provider, { value: contextValue, children });
|
|
479
480
|
}
|
|
480
|
-
var SelectionContext =
|
|
481
|
+
var SelectionContext = React113.createContext(null);
|
|
481
482
|
var defaultCompareEntities = (a, b) => {
|
|
482
483
|
if (a === b) return true;
|
|
483
484
|
if (!a || !b) return false;
|
|
@@ -494,8 +495,8 @@ function SelectionProvider({
|
|
|
494
495
|
compareEntities = defaultCompareEntities
|
|
495
496
|
}) {
|
|
496
497
|
const eventBus = useEventBus();
|
|
497
|
-
const [selected, setSelectedState] =
|
|
498
|
-
const setSelected =
|
|
498
|
+
const [selected, setSelectedState] = React113.useState(null);
|
|
499
|
+
const setSelected = React113.useCallback(
|
|
499
500
|
(entity) => {
|
|
500
501
|
setSelectedState(entity);
|
|
501
502
|
if (debug2) {
|
|
@@ -504,19 +505,19 @@ function SelectionProvider({
|
|
|
504
505
|
},
|
|
505
506
|
[debug2]
|
|
506
507
|
);
|
|
507
|
-
const clearSelection =
|
|
508
|
+
const clearSelection = React113.useCallback(() => {
|
|
508
509
|
setSelectedState(null);
|
|
509
510
|
if (debug2) {
|
|
510
511
|
console.log("[SelectionProvider] Selection cleared");
|
|
511
512
|
}
|
|
512
513
|
}, [debug2]);
|
|
513
|
-
const isSelected =
|
|
514
|
+
const isSelected = React113.useCallback(
|
|
514
515
|
(entity) => {
|
|
515
516
|
return compareEntities(selected, entity);
|
|
516
517
|
},
|
|
517
518
|
[selected, compareEntities]
|
|
518
519
|
);
|
|
519
|
-
|
|
520
|
+
React113.useEffect(() => {
|
|
520
521
|
const handleSelect = (event) => {
|
|
521
522
|
const row = event.payload?.row;
|
|
522
523
|
if (row) {
|
|
@@ -554,14 +555,14 @@ function SelectionProvider({
|
|
|
554
555
|
return /* @__PURE__ */ jsxRuntime.jsx(SelectionContext.Provider, { value: contextValue, children });
|
|
555
556
|
}
|
|
556
557
|
function useSelection() {
|
|
557
|
-
const context =
|
|
558
|
+
const context = React113.useContext(SelectionContext);
|
|
558
559
|
if (!context) {
|
|
559
560
|
throw new Error("useSelection must be used within a SelectionProvider");
|
|
560
561
|
}
|
|
561
562
|
return context;
|
|
562
563
|
}
|
|
563
564
|
function useSelectionOptional() {
|
|
564
|
-
const context =
|
|
565
|
+
const context = React113.useContext(SelectionContext);
|
|
565
566
|
return context;
|
|
566
567
|
}
|
|
567
568
|
function cn(...inputs) {
|
|
@@ -704,7 +705,7 @@ var positionStyles = {
|
|
|
704
705
|
fixed: "fixed",
|
|
705
706
|
sticky: "sticky"
|
|
706
707
|
};
|
|
707
|
-
var Box =
|
|
708
|
+
var Box = React113__namespace.default.forwardRef(
|
|
708
709
|
({
|
|
709
710
|
padding,
|
|
710
711
|
paddingX,
|
|
@@ -733,20 +734,20 @@ var Box = React112__namespace.default.forwardRef(
|
|
|
733
734
|
...rest
|
|
734
735
|
}, ref) => {
|
|
735
736
|
const eventBus = useEventBus();
|
|
736
|
-
const handleClick =
|
|
737
|
+
const handleClick = React113.useCallback((e) => {
|
|
737
738
|
if (action) {
|
|
738
739
|
e.stopPropagation();
|
|
739
740
|
eventBus.emit(`UI:${action}`, actionPayload ?? {});
|
|
740
741
|
}
|
|
741
742
|
onClick?.(e);
|
|
742
743
|
}, [action, actionPayload, eventBus, onClick]);
|
|
743
|
-
const handleMouseEnter =
|
|
744
|
+
const handleMouseEnter = React113.useCallback((e) => {
|
|
744
745
|
if (hoverEvent) {
|
|
745
746
|
eventBus.emit(`UI:${hoverEvent}`, { hovered: true });
|
|
746
747
|
}
|
|
747
748
|
onMouseEnter?.(e);
|
|
748
749
|
}, [hoverEvent, eventBus, onMouseEnter]);
|
|
749
|
-
const handleMouseLeave =
|
|
750
|
+
const handleMouseLeave = React113.useCallback((e) => {
|
|
750
751
|
if (hoverEvent) {
|
|
751
752
|
eventBus.emit(`UI:${hoverEvent}`, { hovered: false });
|
|
752
753
|
}
|
|
@@ -873,7 +874,7 @@ var Typography = ({
|
|
|
873
874
|
align,
|
|
874
875
|
weight,
|
|
875
876
|
size,
|
|
876
|
-
truncate = false,
|
|
877
|
+
truncate: truncate2 = false,
|
|
877
878
|
overflow,
|
|
878
879
|
as,
|
|
879
880
|
id,
|
|
@@ -895,7 +896,7 @@ var Typography = ({
|
|
|
895
896
|
weight && weightStyles[weight],
|
|
896
897
|
size && typographySizeStyles[size],
|
|
897
898
|
align && `text-${align}`,
|
|
898
|
-
|
|
899
|
+
truncate2 && "truncate overflow-hidden text-ellipsis",
|
|
899
900
|
overflow && overflowStyles2[overflow],
|
|
900
901
|
className
|
|
901
902
|
),
|
|
@@ -975,7 +976,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
975
976
|
const IconComp = value;
|
|
976
977
|
return /* @__PURE__ */ jsxRuntime.jsx(IconComp, { className: sizeClass });
|
|
977
978
|
}
|
|
978
|
-
if (
|
|
979
|
+
if (React113__namespace.default.isValidElement(value)) {
|
|
979
980
|
return value;
|
|
980
981
|
}
|
|
981
982
|
if (typeof value === "object" && value !== null && "render" in value) {
|
|
@@ -984,7 +985,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
984
985
|
}
|
|
985
986
|
return value;
|
|
986
987
|
}
|
|
987
|
-
var Button =
|
|
988
|
+
var Button = React113__namespace.default.forwardRef(
|
|
988
989
|
({
|
|
989
990
|
className,
|
|
990
991
|
variant = "primary",
|
|
@@ -1080,7 +1081,7 @@ var sizeStyles3 = {
|
|
|
1080
1081
|
md: "px-2.5 py-1 text-sm",
|
|
1081
1082
|
lg: "px-3 py-1.5 text-base"
|
|
1082
1083
|
};
|
|
1083
|
-
var Badge =
|
|
1084
|
+
var Badge = React113__namespace.default.forwardRef(
|
|
1084
1085
|
({ className, variant = "default", size = "sm", amount, label, icon, children, ...props }, ref) => {
|
|
1085
1086
|
const iconSizes2 = { sm: "w-3 h-3", md: "w-3.5 h-3.5", lg: "w-4 h-4" };
|
|
1086
1087
|
const resolvedIcon = typeof icon === "string" ? (() => {
|
|
@@ -1107,7 +1108,7 @@ var Badge = React112__namespace.default.forwardRef(
|
|
|
1107
1108
|
}
|
|
1108
1109
|
);
|
|
1109
1110
|
Badge.displayName = "Badge";
|
|
1110
|
-
var Input =
|
|
1111
|
+
var Input = React113__namespace.default.forwardRef(
|
|
1111
1112
|
({
|
|
1112
1113
|
className,
|
|
1113
1114
|
inputType,
|
|
@@ -1219,7 +1220,7 @@ var Input = React112__namespace.default.forwardRef(
|
|
|
1219
1220
|
}
|
|
1220
1221
|
);
|
|
1221
1222
|
Input.displayName = "Input";
|
|
1222
|
-
var Label =
|
|
1223
|
+
var Label = React113__namespace.default.forwardRef(
|
|
1223
1224
|
({ className, required, children, ...props }, ref) => {
|
|
1224
1225
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1225
1226
|
"label",
|
|
@@ -1239,7 +1240,7 @@ var Label = React112__namespace.default.forwardRef(
|
|
|
1239
1240
|
}
|
|
1240
1241
|
);
|
|
1241
1242
|
Label.displayName = "Label";
|
|
1242
|
-
var Textarea =
|
|
1243
|
+
var Textarea = React113__namespace.default.forwardRef(
|
|
1243
1244
|
({ className, error, ...props }, ref) => {
|
|
1244
1245
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1245
1246
|
"textarea",
|
|
@@ -1262,7 +1263,7 @@ var Textarea = React112__namespace.default.forwardRef(
|
|
|
1262
1263
|
}
|
|
1263
1264
|
);
|
|
1264
1265
|
Textarea.displayName = "Textarea";
|
|
1265
|
-
var Select =
|
|
1266
|
+
var Select = React113__namespace.default.forwardRef(
|
|
1266
1267
|
({ className, options, placeholder, error, ...props }, ref) => {
|
|
1267
1268
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
1268
1269
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -1298,7 +1299,7 @@ var Select = React112__namespace.default.forwardRef(
|
|
|
1298
1299
|
}
|
|
1299
1300
|
);
|
|
1300
1301
|
Select.displayName = "Select";
|
|
1301
|
-
var Checkbox =
|
|
1302
|
+
var Checkbox = React113__namespace.default.forwardRef(
|
|
1302
1303
|
({ className, label, id, ...props }, ref) => {
|
|
1303
1304
|
const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
1304
1305
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center", children: [
|
|
@@ -1374,7 +1375,7 @@ var shadowStyles2 = {
|
|
|
1374
1375
|
md: "shadow",
|
|
1375
1376
|
lg: "shadow-lg"
|
|
1376
1377
|
};
|
|
1377
|
-
var Card =
|
|
1378
|
+
var Card = React113__namespace.default.forwardRef(
|
|
1378
1379
|
({
|
|
1379
1380
|
className,
|
|
1380
1381
|
variant = "bordered",
|
|
@@ -1410,9 +1411,9 @@ var Card = React112__namespace.default.forwardRef(
|
|
|
1410
1411
|
}
|
|
1411
1412
|
);
|
|
1412
1413
|
Card.displayName = "Card";
|
|
1413
|
-
var CardHeader =
|
|
1414
|
+
var CardHeader = React113__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
1414
1415
|
CardHeader.displayName = "CardHeader";
|
|
1415
|
-
var CardTitle =
|
|
1416
|
+
var CardTitle = React113__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1416
1417
|
"h3",
|
|
1417
1418
|
{
|
|
1418
1419
|
ref,
|
|
@@ -1425,11 +1426,11 @@ var CardTitle = React112__namespace.default.forwardRef(({ className, ...props },
|
|
|
1425
1426
|
}
|
|
1426
1427
|
));
|
|
1427
1428
|
CardTitle.displayName = "CardTitle";
|
|
1428
|
-
var CardContent =
|
|
1429
|
+
var CardContent = React113__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("", className), ...props }));
|
|
1429
1430
|
CardContent.displayName = "CardContent";
|
|
1430
1431
|
var CardBody = CardContent;
|
|
1431
1432
|
CardBody.displayName = "CardBody";
|
|
1432
|
-
var CardFooter =
|
|
1433
|
+
var CardFooter = React113__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1433
1434
|
"div",
|
|
1434
1435
|
{
|
|
1435
1436
|
ref,
|
|
@@ -1444,7 +1445,7 @@ var sizeStyles4 = {
|
|
|
1444
1445
|
md: "h-6 w-6",
|
|
1445
1446
|
lg: "h-8 w-8"
|
|
1446
1447
|
};
|
|
1447
|
-
var Spinner =
|
|
1448
|
+
var Spinner = React113__namespace.default.forwardRef(
|
|
1448
1449
|
({ className, size = "md", ...props }, ref) => {
|
|
1449
1450
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1450
1451
|
"div",
|
|
@@ -1458,7 +1459,7 @@ var Spinner = React112__namespace.default.forwardRef(
|
|
|
1458
1459
|
}
|
|
1459
1460
|
);
|
|
1460
1461
|
Spinner.displayName = "Spinner";
|
|
1461
|
-
var Radio =
|
|
1462
|
+
var Radio = React113__namespace.default.forwardRef(
|
|
1462
1463
|
({
|
|
1463
1464
|
label,
|
|
1464
1465
|
helperText,
|
|
@@ -1562,7 +1563,7 @@ var Radio = React112__namespace.default.forwardRef(
|
|
|
1562
1563
|
}
|
|
1563
1564
|
);
|
|
1564
1565
|
Radio.displayName = "Radio";
|
|
1565
|
-
var Switch =
|
|
1566
|
+
var Switch = React113__namespace.forwardRef(
|
|
1566
1567
|
({
|
|
1567
1568
|
checked,
|
|
1568
1569
|
defaultChecked = false,
|
|
@@ -1573,10 +1574,10 @@ var Switch = React112__namespace.forwardRef(
|
|
|
1573
1574
|
name,
|
|
1574
1575
|
className
|
|
1575
1576
|
}, ref) => {
|
|
1576
|
-
const [isChecked, setIsChecked] =
|
|
1577
|
+
const [isChecked, setIsChecked] = React113__namespace.useState(
|
|
1577
1578
|
checked !== void 0 ? checked : defaultChecked
|
|
1578
1579
|
);
|
|
1579
|
-
|
|
1580
|
+
React113__namespace.useEffect(() => {
|
|
1580
1581
|
if (checked !== void 0) {
|
|
1581
1582
|
setIsChecked(checked);
|
|
1582
1583
|
}
|
|
@@ -1734,7 +1735,7 @@ var sizeStyles5 = {
|
|
|
1734
1735
|
md: "w-2.5 h-2.5",
|
|
1735
1736
|
lg: "w-3 h-3"
|
|
1736
1737
|
};
|
|
1737
|
-
var StatusDot =
|
|
1738
|
+
var StatusDot = React113__namespace.default.forwardRef(
|
|
1738
1739
|
({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
|
|
1739
1740
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1740
1741
|
"span",
|
|
@@ -1781,7 +1782,7 @@ var iconMap2 = {
|
|
|
1781
1782
|
down: LucideIcons.TrendingDown,
|
|
1782
1783
|
flat: LucideIcons.ArrowRight
|
|
1783
1784
|
};
|
|
1784
|
-
var TrendIndicator =
|
|
1785
|
+
var TrendIndicator = React113__namespace.default.forwardRef(
|
|
1785
1786
|
({
|
|
1786
1787
|
className,
|
|
1787
1788
|
value,
|
|
@@ -1840,7 +1841,7 @@ var thumbSizes = {
|
|
|
1840
1841
|
md: "w-4 h-4",
|
|
1841
1842
|
lg: "w-5 h-5"
|
|
1842
1843
|
};
|
|
1843
|
-
var RangeSlider =
|
|
1844
|
+
var RangeSlider = React113__namespace.default.forwardRef(
|
|
1844
1845
|
({
|
|
1845
1846
|
className,
|
|
1846
1847
|
min = 0,
|
|
@@ -1858,14 +1859,14 @@ var RangeSlider = React112__namespace.default.forwardRef(
|
|
|
1858
1859
|
formatValue: formatValue5,
|
|
1859
1860
|
...props
|
|
1860
1861
|
}, ref) => {
|
|
1861
|
-
const [isDragging, setIsDragging] =
|
|
1862
|
-
const [showTip, setShowTip] =
|
|
1863
|
-
const inputRef =
|
|
1862
|
+
const [isDragging, setIsDragging] = React113.useState(false);
|
|
1863
|
+
const [showTip, setShowTip] = React113.useState(false);
|
|
1864
|
+
const inputRef = React113.useRef(null);
|
|
1864
1865
|
const eventBus = useSafeEventBus();
|
|
1865
1866
|
const percentage = max !== min ? (value - min) / (max - min) * 100 : 0;
|
|
1866
1867
|
const bufferedPercentage = buffered !== void 0 ? Math.min(buffered, 100) : void 0;
|
|
1867
1868
|
const displayValue = formatValue5 ? formatValue5(value) : String(value);
|
|
1868
|
-
const handleChange =
|
|
1869
|
+
const handleChange = React113.useCallback(
|
|
1869
1870
|
(e) => {
|
|
1870
1871
|
const newValue = Number(e.target.value);
|
|
1871
1872
|
onChange?.(newValue);
|
|
@@ -2043,7 +2044,7 @@ var paddingClasses = {
|
|
|
2043
2044
|
md: "py-16",
|
|
2044
2045
|
lg: "py-24"
|
|
2045
2046
|
};
|
|
2046
|
-
var ContentSection =
|
|
2047
|
+
var ContentSection = React113__namespace.default.forwardRef(
|
|
2047
2048
|
({ children, background = "default", padding = "lg", id, className }, ref) => {
|
|
2048
2049
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2049
2050
|
Box,
|
|
@@ -2082,7 +2083,7 @@ var animatedStyles = {
|
|
|
2082
2083
|
"scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
|
|
2083
2084
|
"none": {}
|
|
2084
2085
|
};
|
|
2085
|
-
var AnimatedReveal =
|
|
2086
|
+
var AnimatedReveal = React113__namespace.default.forwardRef(
|
|
2086
2087
|
({
|
|
2087
2088
|
trigger = "scroll",
|
|
2088
2089
|
animation = "fade-up",
|
|
@@ -2097,10 +2098,10 @@ var AnimatedReveal = React112__namespace.default.forwardRef(
|
|
|
2097
2098
|
style,
|
|
2098
2099
|
...props
|
|
2099
2100
|
}, forwardedRef) => {
|
|
2100
|
-
const [isAnimated, setIsAnimated] =
|
|
2101
|
-
const internalRef =
|
|
2102
|
-
const hasAnimated =
|
|
2103
|
-
const setRef =
|
|
2101
|
+
const [isAnimated, setIsAnimated] = React113.useState(false);
|
|
2102
|
+
const internalRef = React113.useRef(null);
|
|
2103
|
+
const hasAnimated = React113.useRef(false);
|
|
2104
|
+
const setRef = React113.useCallback(
|
|
2104
2105
|
(node) => {
|
|
2105
2106
|
internalRef.current = node;
|
|
2106
2107
|
if (typeof forwardedRef === "function") forwardedRef(node);
|
|
@@ -2108,7 +2109,7 @@ var AnimatedReveal = React112__namespace.default.forwardRef(
|
|
|
2108
2109
|
},
|
|
2109
2110
|
[forwardedRef]
|
|
2110
2111
|
);
|
|
2111
|
-
|
|
2112
|
+
React113.useEffect(() => {
|
|
2112
2113
|
if (trigger !== "scroll") return;
|
|
2113
2114
|
const el = internalRef.current;
|
|
2114
2115
|
if (!el) return;
|
|
@@ -2134,7 +2135,7 @@ var AnimatedReveal = React112__namespace.default.forwardRef(
|
|
|
2134
2135
|
setIsAnimated(false);
|
|
2135
2136
|
}
|
|
2136
2137
|
} : void 0;
|
|
2137
|
-
|
|
2138
|
+
React113.useEffect(() => {
|
|
2138
2139
|
if (trigger === "manual" && manualAnimate !== void 0) {
|
|
2139
2140
|
setIsAnimated(manualAnimate);
|
|
2140
2141
|
}
|
|
@@ -2164,9 +2165,9 @@ var AnimatedReveal = React112__namespace.default.forwardRef(
|
|
|
2164
2165
|
);
|
|
2165
2166
|
AnimatedReveal.displayName = "AnimatedReveal";
|
|
2166
2167
|
function useFetchedSvg(src) {
|
|
2167
|
-
const [svg, setSvg] =
|
|
2168
|
-
const cache =
|
|
2169
|
-
|
|
2168
|
+
const [svg, setSvg] = React113.useState(null);
|
|
2169
|
+
const cache = React113.useRef({});
|
|
2170
|
+
React113.useEffect(() => {
|
|
2170
2171
|
if (!src) {
|
|
2171
2172
|
setSvg(null);
|
|
2172
2173
|
return;
|
|
@@ -2235,7 +2236,7 @@ function applyMorphAnimation(container, animate, duration, delay, easing) {
|
|
|
2235
2236
|
el.style.opacity = animate ? "1" : "0";
|
|
2236
2237
|
});
|
|
2237
2238
|
}
|
|
2238
|
-
var AnimatedGraphic =
|
|
2239
|
+
var AnimatedGraphic = React113__namespace.default.forwardRef(
|
|
2239
2240
|
({
|
|
2240
2241
|
src,
|
|
2241
2242
|
svgContent,
|
|
@@ -2254,11 +2255,11 @@ var AnimatedGraphic = React112__namespace.default.forwardRef(
|
|
|
2254
2255
|
children,
|
|
2255
2256
|
...props
|
|
2256
2257
|
}, ref) => {
|
|
2257
|
-
const containerRef =
|
|
2258
|
+
const containerRef = React113.useRef(null);
|
|
2258
2259
|
const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
|
|
2259
2260
|
const resolvedSvg = svgContent ?? fetchedSvg;
|
|
2260
|
-
const prevAnimateRef =
|
|
2261
|
-
const setRef =
|
|
2261
|
+
const prevAnimateRef = React113.useRef(animate);
|
|
2262
|
+
const setRef = React113__namespace.default.useCallback(
|
|
2262
2263
|
(node) => {
|
|
2263
2264
|
containerRef.current = node;
|
|
2264
2265
|
if (typeof ref === "function") ref(node);
|
|
@@ -2266,7 +2267,7 @@ var AnimatedGraphic = React112__namespace.default.forwardRef(
|
|
|
2266
2267
|
},
|
|
2267
2268
|
[ref]
|
|
2268
2269
|
);
|
|
2269
|
-
|
|
2270
|
+
React113.useEffect(() => {
|
|
2270
2271
|
const el = containerRef.current;
|
|
2271
2272
|
if (!el || !strokeColor) return;
|
|
2272
2273
|
const paths = el.querySelectorAll("path, line, polyline, polygon, circle, ellipse, rect");
|
|
@@ -2274,7 +2275,7 @@ var AnimatedGraphic = React112__namespace.default.forwardRef(
|
|
|
2274
2275
|
p2.style.stroke = strokeColor;
|
|
2275
2276
|
});
|
|
2276
2277
|
}, [resolvedSvg, strokeColor]);
|
|
2277
|
-
|
|
2278
|
+
React113.useEffect(() => {
|
|
2278
2279
|
const el = containerRef.current;
|
|
2279
2280
|
if (!el || !resolvedSvg) return;
|
|
2280
2281
|
if (animation === "draw" || animation === "fill") {
|
|
@@ -2299,7 +2300,7 @@ var AnimatedGraphic = React112__namespace.default.forwardRef(
|
|
|
2299
2300
|
});
|
|
2300
2301
|
}
|
|
2301
2302
|
}, [resolvedSvg, animation]);
|
|
2302
|
-
|
|
2303
|
+
React113.useEffect(() => {
|
|
2303
2304
|
const el = containerRef.current;
|
|
2304
2305
|
if (!el) return;
|
|
2305
2306
|
const id = requestAnimationFrame(() => {
|
|
@@ -2455,7 +2456,7 @@ var en_default = {
|
|
|
2455
2456
|
// hooks/useTranslate.ts
|
|
2456
2457
|
var { $meta: _meta, ...coreMessages } = en_default;
|
|
2457
2458
|
var coreLocale = coreMessages;
|
|
2458
|
-
var I18nContext =
|
|
2459
|
+
var I18nContext = React113.createContext({
|
|
2459
2460
|
locale: "en",
|
|
2460
2461
|
direction: "ltr",
|
|
2461
2462
|
t: (key) => coreLocale[key] ?? key
|
|
@@ -2464,7 +2465,7 @@ var I18nContext = React112.createContext({
|
|
|
2464
2465
|
I18nContext.displayName = "I18nContext";
|
|
2465
2466
|
I18nContext.Provider;
|
|
2466
2467
|
function useTranslate() {
|
|
2467
|
-
return
|
|
2468
|
+
return React113.useContext(I18nContext);
|
|
2468
2469
|
}
|
|
2469
2470
|
var ErrorState = ({
|
|
2470
2471
|
title,
|
|
@@ -2500,7 +2501,7 @@ var ErrorState = ({
|
|
|
2500
2501
|
);
|
|
2501
2502
|
};
|
|
2502
2503
|
ErrorState.displayName = "ErrorState";
|
|
2503
|
-
var ErrorBoundary = class extends
|
|
2504
|
+
var ErrorBoundary = class extends React113__namespace.default.Component {
|
|
2504
2505
|
constructor(props) {
|
|
2505
2506
|
super(props);
|
|
2506
2507
|
__publicField(this, "reset", () => {
|
|
@@ -2599,7 +2600,7 @@ function executeNotify(message, options, config) {
|
|
|
2599
2600
|
function executeEmit(event, payload, config) {
|
|
2600
2601
|
config.eventBus.emit(event, payload);
|
|
2601
2602
|
}
|
|
2602
|
-
var ClientEffectConfigContext =
|
|
2603
|
+
var ClientEffectConfigContext = React113.createContext(null);
|
|
2603
2604
|
ClientEffectConfigContext.Provider;
|
|
2604
2605
|
var effectIdCounter = 0;
|
|
2605
2606
|
function generateEffectId() {
|
|
@@ -2838,14 +2839,14 @@ var OfflineExecutor = class {
|
|
|
2838
2839
|
}
|
|
2839
2840
|
};
|
|
2840
2841
|
function useOfflineExecutor(options) {
|
|
2841
|
-
const executorRef =
|
|
2842
|
-
const [state, setState] =
|
|
2842
|
+
const executorRef = React113.useRef(null);
|
|
2843
|
+
const [state, setState] = React113.useState({
|
|
2843
2844
|
isOffline: false,
|
|
2844
2845
|
syncQueue: [],
|
|
2845
2846
|
localEffectsProcessed: 0,
|
|
2846
2847
|
effectsSynced: 0
|
|
2847
2848
|
});
|
|
2848
|
-
|
|
2849
|
+
React113.useEffect(() => {
|
|
2849
2850
|
const executor = new OfflineExecutor({
|
|
2850
2851
|
...options,
|
|
2851
2852
|
onQueueChange: (queue) => {
|
|
@@ -2860,7 +2861,7 @@ function useOfflineExecutor(options) {
|
|
|
2860
2861
|
executorRef.current = null;
|
|
2861
2862
|
};
|
|
2862
2863
|
}, []);
|
|
2863
|
-
|
|
2864
|
+
React113.useEffect(() => {
|
|
2864
2865
|
if (!options.autoSync || !options.serverUrl) return;
|
|
2865
2866
|
const handleOnline = async () => {
|
|
2866
2867
|
if (executorRef.current) {
|
|
@@ -2874,13 +2875,13 @@ function useOfflineExecutor(options) {
|
|
|
2874
2875
|
window.addEventListener("online", handleOnline);
|
|
2875
2876
|
return () => window.removeEventListener("online", handleOnline);
|
|
2876
2877
|
}, [options.autoSync, options.serverUrl, options.authToken]);
|
|
2877
|
-
const executeEffects =
|
|
2878
|
+
const executeEffects = React113.useCallback((effects) => {
|
|
2878
2879
|
executorRef.current?.executeClientEffects(effects);
|
|
2879
2880
|
if (executorRef.current) {
|
|
2880
2881
|
setState(executorRef.current.getState());
|
|
2881
2882
|
}
|
|
2882
2883
|
}, []);
|
|
2883
|
-
const processEventOffline =
|
|
2884
|
+
const processEventOffline = React113.useCallback(
|
|
2884
2885
|
(event, payload, effects) => {
|
|
2885
2886
|
const result = executorRef.current?.processEventOffline(event, payload, effects);
|
|
2886
2887
|
if (executorRef.current) {
|
|
@@ -2890,7 +2891,7 @@ function useOfflineExecutor(options) {
|
|
|
2890
2891
|
},
|
|
2891
2892
|
[]
|
|
2892
2893
|
);
|
|
2893
|
-
const sync =
|
|
2894
|
+
const sync = React113.useCallback(async () => {
|
|
2894
2895
|
if (!executorRef.current || !options.serverUrl) return 0;
|
|
2895
2896
|
const count = await executorRef.current.syncPendingEffects(
|
|
2896
2897
|
options.serverUrl,
|
|
@@ -2899,7 +2900,7 @@ function useOfflineExecutor(options) {
|
|
|
2899
2900
|
setState(executorRef.current.getState());
|
|
2900
2901
|
return count;
|
|
2901
2902
|
}, [options.serverUrl, options.authToken]);
|
|
2902
|
-
const clearQueue =
|
|
2903
|
+
const clearQueue = React113.useCallback(() => {
|
|
2903
2904
|
executorRef.current?.clearQueue();
|
|
2904
2905
|
if (executorRef.current) {
|
|
2905
2906
|
setState(executorRef.current.getState());
|
|
@@ -2915,7 +2916,7 @@ function useOfflineExecutor(options) {
|
|
|
2915
2916
|
clearQueue
|
|
2916
2917
|
};
|
|
2917
2918
|
}
|
|
2918
|
-
|
|
2919
|
+
React113.createContext(null);
|
|
2919
2920
|
var defaultIcon = L__default.default.icon({
|
|
2920
2921
|
iconUrl: "https://unpkg.com/leaflet@1.9.4/dist/images/marker-icon.png",
|
|
2921
2922
|
iconRetinaUrl: "https://unpkg.com/leaflet@1.9.4/dist/images/marker-icon-2x.png",
|
|
@@ -3093,7 +3094,7 @@ function bindTraitStateGetter(getter) {
|
|
|
3093
3094
|
}
|
|
3094
3095
|
}
|
|
3095
3096
|
exposeOnWindow();
|
|
3096
|
-
var MarkdownContent =
|
|
3097
|
+
var MarkdownContent = React113__namespace.default.memo(
|
|
3097
3098
|
({ content, direction, className }) => {
|
|
3098
3099
|
const { t: _t } = useTranslate();
|
|
3099
3100
|
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
@@ -3195,7 +3196,7 @@ var MarkdownContent = React112__namespace.default.memo(
|
|
|
3195
3196
|
(prev, next) => prev.content === next.content && prev.className === next.className && prev.direction === next.direction
|
|
3196
3197
|
);
|
|
3197
3198
|
MarkdownContent.displayName = "MarkdownContent";
|
|
3198
|
-
var CodeBlock =
|
|
3199
|
+
var CodeBlock = React113__namespace.default.memo(
|
|
3199
3200
|
({
|
|
3200
3201
|
code: rawCode,
|
|
3201
3202
|
language = "text",
|
|
@@ -3207,20 +3208,20 @@ var CodeBlock = React112__namespace.default.memo(
|
|
|
3207
3208
|
const code = typeof rawCode === "string" ? rawCode : String(rawCode ?? "");
|
|
3208
3209
|
const eventBus = useEventBus();
|
|
3209
3210
|
const { t: _t } = useTranslate();
|
|
3210
|
-
const scrollRef =
|
|
3211
|
-
const savedScrollLeftRef =
|
|
3212
|
-
const [copied, setCopied] =
|
|
3213
|
-
|
|
3211
|
+
const scrollRef = React113.useRef(null);
|
|
3212
|
+
const savedScrollLeftRef = React113.useRef(0);
|
|
3213
|
+
const [copied, setCopied] = React113.useState(false);
|
|
3214
|
+
React113.useLayoutEffect(() => {
|
|
3214
3215
|
const el = scrollRef.current;
|
|
3215
3216
|
return () => {
|
|
3216
3217
|
if (el) savedScrollLeftRef.current = el.scrollLeft;
|
|
3217
3218
|
};
|
|
3218
3219
|
}, [language, code]);
|
|
3219
|
-
|
|
3220
|
+
React113.useLayoutEffect(() => {
|
|
3220
3221
|
const el = scrollRef.current;
|
|
3221
3222
|
if (el) el.scrollLeft = savedScrollLeftRef.current;
|
|
3222
3223
|
}, [language, code]);
|
|
3223
|
-
|
|
3224
|
+
React113.useEffect(() => {
|
|
3224
3225
|
const el = scrollRef.current;
|
|
3225
3226
|
if (!el) return;
|
|
3226
3227
|
const handle = () => {
|
|
@@ -3306,18 +3307,18 @@ CodeBlock.displayName = "CodeBlock";
|
|
|
3306
3307
|
|
|
3307
3308
|
// lib/debug.ts
|
|
3308
3309
|
typeof window !== "undefined" && (localStorage.getItem("debug") === "true" || process.env.NODE_ENV === "development");
|
|
3309
|
-
|
|
3310
|
-
var GameAudioContext =
|
|
3310
|
+
React113.lazy(() => import('react-markdown'));
|
|
3311
|
+
var GameAudioContext = React113.createContext(null);
|
|
3311
3312
|
GameAudioContext.displayName = "GameAudioContext";
|
|
3312
3313
|
|
|
3313
3314
|
// components/organisms/component-registry.generated.ts
|
|
3314
3315
|
function lazyThree(name, loader) {
|
|
3315
|
-
const Lazy =
|
|
3316
|
+
const Lazy = React113__namespace.default.lazy(() => loader().then((m) => ({ default: m[name] })));
|
|
3316
3317
|
function ThreeWrapper(props) {
|
|
3317
|
-
return
|
|
3318
|
-
|
|
3318
|
+
return React113__namespace.default.createElement(
|
|
3319
|
+
React113__namespace.default.Suspense,
|
|
3319
3320
|
{ fallback: null },
|
|
3320
|
-
|
|
3321
|
+
React113__namespace.default.createElement(Lazy, props)
|
|
3321
3322
|
);
|
|
3322
3323
|
}
|
|
3323
3324
|
ThreeWrapper.displayName = `Lazy(${name})`;
|
|
@@ -3338,13 +3339,13 @@ lazyThree("PhysicsObject3D", () => import('@almadar/ui/components/organisms/game
|
|
|
3338
3339
|
lazyThree("Scene3D", () => import('@almadar/ui/components/organisms/game/three'));
|
|
3339
3340
|
lazyThree("TileRenderer", () => import('@almadar/ui/components/organisms/game/three'));
|
|
3340
3341
|
lazyThree("UnitRenderer", () => import('@almadar/ui/components/organisms/game/three'));
|
|
3341
|
-
var SuspenseConfigContext =
|
|
3342
|
-
|
|
3342
|
+
var SuspenseConfigContext = React113.createContext({ enabled: false });
|
|
3343
|
+
React113.createContext(false);
|
|
3343
3344
|
function SuspenseConfigProvider({
|
|
3344
3345
|
config,
|
|
3345
3346
|
children
|
|
3346
3347
|
}) {
|
|
3347
|
-
return
|
|
3348
|
+
return React113__namespace.default.createElement(
|
|
3348
3349
|
SuspenseConfigContext.Provider,
|
|
3349
3350
|
{ value: config },
|
|
3350
3351
|
children
|
|
@@ -3389,8 +3390,8 @@ function VerificationProvider({
|
|
|
3389
3390
|
}) {
|
|
3390
3391
|
const isEnabled = enabled ?? (typeof process !== "undefined" && process.env?.NODE_ENV !== "production");
|
|
3391
3392
|
const eventBus = useEventBus();
|
|
3392
|
-
const pendingRef =
|
|
3393
|
-
|
|
3393
|
+
const pendingRef = React113.useRef(/* @__PURE__ */ new Map());
|
|
3394
|
+
React113.useEffect(() => {
|
|
3394
3395
|
if (!isEnabled) return;
|
|
3395
3396
|
if (!eventBus.onAny) return;
|
|
3396
3397
|
const unsub = eventBus.onAny((evt) => {
|
|
@@ -3417,7 +3418,7 @@ function VerificationProvider({
|
|
|
3417
3418
|
})) : [];
|
|
3418
3419
|
recordTransition({
|
|
3419
3420
|
traitName: parsed.traitName,
|
|
3420
|
-
from: pending?.from ??
|
|
3421
|
+
from: pending?.from ?? payload["currentState"] ?? newState,
|
|
3421
3422
|
to: newState,
|
|
3422
3423
|
event: parsed.event,
|
|
3423
3424
|
effects,
|
|
@@ -3428,10 +3429,11 @@ function VerificationProvider({
|
|
|
3428
3429
|
const pending = pendingRef.current.get(key);
|
|
3429
3430
|
pendingRef.current.delete(key);
|
|
3430
3431
|
const errorMsg = payload["error"] ?? "Unknown error";
|
|
3432
|
+
const fromState = pending?.from ?? payload["currentState"] ?? "unknown";
|
|
3431
3433
|
recordTransition({
|
|
3432
3434
|
traitName: parsed.traitName,
|
|
3433
|
-
from:
|
|
3434
|
-
to:
|
|
3435
|
+
from: fromState,
|
|
3436
|
+
to: fromState,
|
|
3435
3437
|
// state didn't change on error
|
|
3436
3438
|
event: parsed.event,
|
|
3437
3439
|
effects: [{
|
|
@@ -3451,7 +3453,7 @@ function VerificationProvider({
|
|
|
3451
3453
|
);
|
|
3452
3454
|
return unsub;
|
|
3453
3455
|
}, [isEnabled, eventBus]);
|
|
3454
|
-
|
|
3456
|
+
React113.useEffect(() => {
|
|
3455
3457
|
if (!isEnabled) return;
|
|
3456
3458
|
if (!runtimeManager) return;
|
|
3457
3459
|
runtimeManager.setObserver({
|
|
@@ -3473,11 +3475,11 @@ function VerificationProvider({
|
|
|
3473
3475
|
"pass"
|
|
3474
3476
|
);
|
|
3475
3477
|
}, [isEnabled, runtimeManager]);
|
|
3476
|
-
|
|
3478
|
+
React113.useEffect(() => {
|
|
3477
3479
|
if (!isEnabled) return;
|
|
3478
3480
|
bindEventBus(eventBus);
|
|
3479
3481
|
}, [isEnabled, eventBus]);
|
|
3480
|
-
|
|
3482
|
+
React113.useEffect(() => {
|
|
3481
3483
|
if (!isEnabled) return;
|
|
3482
3484
|
if (traitStateGetter) {
|
|
3483
3485
|
bindTraitStateGetter(traitStateGetter);
|
|
@@ -3501,7 +3503,7 @@ function OrbitalProvider({
|
|
|
3501
3503
|
suspense = false,
|
|
3502
3504
|
verification
|
|
3503
3505
|
}) {
|
|
3504
|
-
const suspenseConfig =
|
|
3506
|
+
const suspenseConfig = React113.useMemo(
|
|
3505
3507
|
() => ({ enabled: suspense }),
|
|
3506
3508
|
[suspense]
|
|
3507
3509
|
);
|
|
@@ -3521,43 +3523,43 @@ function OrbitalProvider({
|
|
|
3521
3523
|
);
|
|
3522
3524
|
}
|
|
3523
3525
|
OrbitalProvider.displayName = "OrbitalProvider";
|
|
3524
|
-
var FetchedDataContext =
|
|
3526
|
+
var FetchedDataContext = React113.createContext(null);
|
|
3525
3527
|
function FetchedDataProvider({
|
|
3526
3528
|
initialData,
|
|
3527
3529
|
children
|
|
3528
3530
|
}) {
|
|
3529
|
-
const [state, setState] =
|
|
3531
|
+
const [state, setState] = React113.useState(() => ({
|
|
3530
3532
|
data: initialData || {},
|
|
3531
3533
|
fetchedAt: {},
|
|
3532
3534
|
loading: false,
|
|
3533
3535
|
error: null
|
|
3534
3536
|
}));
|
|
3535
|
-
const getData =
|
|
3537
|
+
const getData = React113.useCallback(
|
|
3536
3538
|
(entityName) => {
|
|
3537
3539
|
return state.data[entityName] || [];
|
|
3538
3540
|
},
|
|
3539
3541
|
[state.data]
|
|
3540
3542
|
);
|
|
3541
|
-
const getById =
|
|
3543
|
+
const getById = React113.useCallback(
|
|
3542
3544
|
(entityName, id) => {
|
|
3543
3545
|
const records = state.data[entityName];
|
|
3544
3546
|
return records?.find((r) => r.id === id);
|
|
3545
3547
|
},
|
|
3546
3548
|
[state.data]
|
|
3547
3549
|
);
|
|
3548
|
-
const hasData =
|
|
3550
|
+
const hasData = React113.useCallback(
|
|
3549
3551
|
(entityName) => {
|
|
3550
3552
|
return entityName in state.data && state.data[entityName].length > 0;
|
|
3551
3553
|
},
|
|
3552
3554
|
[state.data]
|
|
3553
3555
|
);
|
|
3554
|
-
const getFetchedAt =
|
|
3556
|
+
const getFetchedAt = React113.useCallback(
|
|
3555
3557
|
(entityName) => {
|
|
3556
3558
|
return state.fetchedAt[entityName];
|
|
3557
3559
|
},
|
|
3558
3560
|
[state.fetchedAt]
|
|
3559
3561
|
);
|
|
3560
|
-
const setData =
|
|
3562
|
+
const setData = React113.useCallback((data) => {
|
|
3561
3563
|
const now = Date.now();
|
|
3562
3564
|
setState((prev) => ({
|
|
3563
3565
|
...prev,
|
|
@@ -3576,14 +3578,14 @@ function FetchedDataProvider({
|
|
|
3576
3578
|
error: null
|
|
3577
3579
|
}));
|
|
3578
3580
|
}, []);
|
|
3579
|
-
const clearData =
|
|
3581
|
+
const clearData = React113.useCallback(() => {
|
|
3580
3582
|
setState((prev) => ({
|
|
3581
3583
|
...prev,
|
|
3582
3584
|
data: {},
|
|
3583
3585
|
fetchedAt: {}
|
|
3584
3586
|
}));
|
|
3585
3587
|
}, []);
|
|
3586
|
-
const clearEntity =
|
|
3588
|
+
const clearEntity = React113.useCallback((entityName) => {
|
|
3587
3589
|
setState((prev) => {
|
|
3588
3590
|
const newData = { ...prev.data };
|
|
3589
3591
|
const newFetchedAt = { ...prev.fetchedAt };
|
|
@@ -3596,13 +3598,13 @@ function FetchedDataProvider({
|
|
|
3596
3598
|
};
|
|
3597
3599
|
});
|
|
3598
3600
|
}, []);
|
|
3599
|
-
const setLoading =
|
|
3601
|
+
const setLoading = React113.useCallback((loading) => {
|
|
3600
3602
|
setState((prev) => ({ ...prev, loading }));
|
|
3601
3603
|
}, []);
|
|
3602
|
-
const setError =
|
|
3604
|
+
const setError = React113.useCallback((error) => {
|
|
3603
3605
|
setState((prev) => ({ ...prev, error, loading: false }));
|
|
3604
3606
|
}, []);
|
|
3605
|
-
const contextValue =
|
|
3607
|
+
const contextValue = React113.useMemo(
|
|
3606
3608
|
() => ({
|
|
3607
3609
|
getData,
|
|
3608
3610
|
getById,
|
|
@@ -3633,10 +3635,10 @@ function FetchedDataProvider({
|
|
|
3633
3635
|
return /* @__PURE__ */ jsxRuntime.jsx(FetchedDataContext.Provider, { value: contextValue, children });
|
|
3634
3636
|
}
|
|
3635
3637
|
function useFetchedDataContext() {
|
|
3636
|
-
return
|
|
3638
|
+
return React113.useContext(FetchedDataContext);
|
|
3637
3639
|
}
|
|
3638
3640
|
function useFetchedData() {
|
|
3639
|
-
const context =
|
|
3641
|
+
const context = React113.useContext(FetchedDataContext);
|
|
3640
3642
|
if (!context) {
|
|
3641
3643
|
return {
|
|
3642
3644
|
getData: () => [],
|
|
@@ -3676,15 +3678,15 @@ function useFetchedEntity(entityName) {
|
|
|
3676
3678
|
error: context.error
|
|
3677
3679
|
};
|
|
3678
3680
|
}
|
|
3679
|
-
var OfflineModeContext =
|
|
3681
|
+
var OfflineModeContext = React113.createContext(null);
|
|
3680
3682
|
function OfflineModeProvider({
|
|
3681
3683
|
children,
|
|
3682
3684
|
...executorOptions
|
|
3683
3685
|
}) {
|
|
3684
|
-
const [forceOffline, setForceOffline] =
|
|
3686
|
+
const [forceOffline, setForceOffline] = React113.useState(false);
|
|
3685
3687
|
const executor = useOfflineExecutor(executorOptions);
|
|
3686
3688
|
const effectivelyOffline = executor.isOffline || forceOffline;
|
|
3687
|
-
const contextValue =
|
|
3689
|
+
const contextValue = React113.useMemo(
|
|
3688
3690
|
() => ({
|
|
3689
3691
|
...executor,
|
|
3690
3692
|
forceOffline,
|
|
@@ -3696,14 +3698,14 @@ function OfflineModeProvider({
|
|
|
3696
3698
|
return /* @__PURE__ */ jsxRuntime.jsx(OfflineModeContext.Provider, { value: contextValue, children });
|
|
3697
3699
|
}
|
|
3698
3700
|
function useOfflineMode() {
|
|
3699
|
-
const context =
|
|
3701
|
+
const context = React113.useContext(OfflineModeContext);
|
|
3700
3702
|
if (!context) {
|
|
3701
3703
|
throw new Error("useOfflineMode must be used within OfflineModeProvider");
|
|
3702
3704
|
}
|
|
3703
3705
|
return context;
|
|
3704
3706
|
}
|
|
3705
3707
|
function useOptionalOfflineMode() {
|
|
3706
|
-
return
|
|
3708
|
+
return React113.useContext(OfflineModeContext);
|
|
3707
3709
|
}
|
|
3708
3710
|
|
|
3709
3711
|
exports.EventBusContext = EventBusContext2;
|