@almadar/ui 5.49.0 → 5.49.1
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 +1586 -1596
- package/dist/avl/index.js +437 -447
- package/dist/components/index.cjs +1259 -1436
- package/dist/components/index.js +259 -436
- package/dist/providers/index.cjs +1262 -1572
- package/dist/providers/index.js +274 -584
- package/dist/runtime/index.cjs +1451 -1461
- package/dist/runtime/index.js +417 -427
- package/package.json +1 -1
package/dist/providers/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as React82 from 'react';
|
|
2
|
+
import React82__default, { createContext, useContext, useMemo, useRef, useEffect, useCallback, Suspense, useState, useLayoutEffect, lazy, useId, useSyncExternalStore, forwardRef, useImperativeHandle, Component } from 'react';
|
|
3
|
+
import { EventBusContext, useTraitScope, TraitScopeProvider } from '@almadar/ui/providers';
|
|
3
4
|
import { createLogger, isLogLevelEnabled } from '@almadar/logger';
|
|
4
5
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
5
|
-
import { EventBusContext, useTraitScope, TraitScopeProvider } from '@almadar/ui/providers';
|
|
6
6
|
import { clsx } from 'clsx';
|
|
7
7
|
import { twMerge } from 'tailwind-merge';
|
|
8
8
|
import * as LucideIcons2 from 'lucide-react';
|
|
9
9
|
import { Loader2, X, Lightbulb, CheckCircle, List, Printer, ChevronRight, ChevronLeft, GitBranch, Pencil, Eye, Plus, ArrowRight, Trash, Code, FileText, WrapText, Check, Copy, RotateCcw, Play, Terminal, XCircle, AlertTriangle, Trash2, Link2, ZoomOut, ZoomIn, Download, Menu as Menu$1, Package, Calendar, MoreHorizontal, Image as Image$1, Upload, ArrowLeft, HelpCircle, PauseCircle, Search, Type, Heading1, Heading2, Heading3, ListOrdered, Quote, Minus, Eraser, TrendingUp, TrendingDown, AlertCircle, Circle, Clock, CheckCircle2, Bug, Send, ChevronUp, ChevronDown, Wrench, Tag, User, DollarSign, Zap, Sword, Move, Heart, Shield } from 'lucide-react';
|
|
10
10
|
import { createPortal } from 'react-dom';
|
|
11
11
|
import { useTranslate } from '@almadar/ui/hooks';
|
|
12
|
+
import { useUISlots, ThemeProvider, useTheme } from '@almadar/ui/context';
|
|
12
13
|
import { evaluate, createMinimalContext } from '@almadar/evaluator';
|
|
13
|
-
import { useUISlots } from '@almadar/ui/context';
|
|
14
14
|
import { Link, Outlet, useLocation } from 'react-router-dom';
|
|
15
15
|
import ELK from 'elkjs/lib/elk.bundled.js';
|
|
16
16
|
import SyntaxHighlighter from 'react-syntax-highlighter/dist/esm/prism-light.js';
|
|
@@ -71,312 +71,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
71
71
|
};
|
|
72
72
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
73
73
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
74
|
-
function getSystemMode() {
|
|
75
|
-
if (typeof window === "undefined") return "light";
|
|
76
|
-
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
77
|
-
}
|
|
78
|
-
function resolveMode(mode) {
|
|
79
|
-
if (mode === "system") {
|
|
80
|
-
return getSystemMode();
|
|
81
|
-
}
|
|
82
|
-
return mode;
|
|
83
|
-
}
|
|
84
|
-
function useTheme() {
|
|
85
|
-
const context = useContext(ThemeContext);
|
|
86
|
-
if (context === void 0) {
|
|
87
|
-
return {
|
|
88
|
-
theme: "wireframe",
|
|
89
|
-
mode: "light",
|
|
90
|
-
resolvedMode: "light",
|
|
91
|
-
setTheme: () => {
|
|
92
|
-
},
|
|
93
|
-
setMode: () => {
|
|
94
|
-
},
|
|
95
|
-
toggleMode: () => {
|
|
96
|
-
},
|
|
97
|
-
availableThemes: BUILT_IN_THEMES,
|
|
98
|
-
appliedTheme: "wireframe-light"
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
return context;
|
|
102
|
-
}
|
|
103
|
-
var log, BUILT_IN_THEMES, ThemeContext, THEME_STORAGE_KEY, MODE_STORAGE_KEY, ThemeProvider;
|
|
104
|
-
var init_ThemeContext = __esm({
|
|
105
|
-
"context/ThemeContext.tsx"() {
|
|
106
|
-
"use client";
|
|
107
|
-
log = createLogger("almadar:ui:theme");
|
|
108
|
-
BUILT_IN_THEMES = [
|
|
109
|
-
{
|
|
110
|
-
name: "wireframe",
|
|
111
|
-
displayName: "Wireframe",
|
|
112
|
-
hasLightMode: true,
|
|
113
|
-
hasDarkMode: true
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
name: "minimalist",
|
|
117
|
-
displayName: "Minimalist",
|
|
118
|
-
hasLightMode: true,
|
|
119
|
-
hasDarkMode: true
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
name: "almadar",
|
|
123
|
-
displayName: "Almadar",
|
|
124
|
-
hasLightMode: true,
|
|
125
|
-
hasDarkMode: true
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
name: "trait-wars",
|
|
129
|
-
displayName: "Trait Wars",
|
|
130
|
-
hasLightMode: false,
|
|
131
|
-
hasDarkMode: true
|
|
132
|
-
},
|
|
133
|
-
// Extended themes
|
|
134
|
-
{
|
|
135
|
-
name: "ocean",
|
|
136
|
-
displayName: "Ocean",
|
|
137
|
-
hasLightMode: true,
|
|
138
|
-
hasDarkMode: true
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
name: "forest",
|
|
142
|
-
displayName: "Forest",
|
|
143
|
-
hasLightMode: true,
|
|
144
|
-
hasDarkMode: true
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
name: "sunset",
|
|
148
|
-
displayName: "Sunset",
|
|
149
|
-
hasLightMode: true,
|
|
150
|
-
hasDarkMode: true
|
|
151
|
-
},
|
|
152
|
-
{
|
|
153
|
-
name: "lavender",
|
|
154
|
-
displayName: "Lavender",
|
|
155
|
-
hasLightMode: true,
|
|
156
|
-
hasDarkMode: true
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
name: "rose",
|
|
160
|
-
displayName: "Rose",
|
|
161
|
-
hasLightMode: true,
|
|
162
|
-
hasDarkMode: true
|
|
163
|
-
},
|
|
164
|
-
{
|
|
165
|
-
name: "slate",
|
|
166
|
-
displayName: "Slate",
|
|
167
|
-
hasLightMode: true,
|
|
168
|
-
hasDarkMode: true
|
|
169
|
-
},
|
|
170
|
-
{
|
|
171
|
-
name: "ember",
|
|
172
|
-
displayName: "Ember",
|
|
173
|
-
hasLightMode: true,
|
|
174
|
-
hasDarkMode: true
|
|
175
|
-
},
|
|
176
|
-
{
|
|
177
|
-
name: "midnight",
|
|
178
|
-
displayName: "Midnight",
|
|
179
|
-
hasLightMode: true,
|
|
180
|
-
hasDarkMode: true
|
|
181
|
-
},
|
|
182
|
-
{
|
|
183
|
-
name: "sand",
|
|
184
|
-
displayName: "Sand",
|
|
185
|
-
hasLightMode: true,
|
|
186
|
-
hasDarkMode: true
|
|
187
|
-
},
|
|
188
|
-
{
|
|
189
|
-
name: "neon",
|
|
190
|
-
displayName: "Neon",
|
|
191
|
-
hasLightMode: true,
|
|
192
|
-
hasDarkMode: true
|
|
193
|
-
},
|
|
194
|
-
{
|
|
195
|
-
name: "arctic",
|
|
196
|
-
displayName: "Arctic",
|
|
197
|
-
hasLightMode: true,
|
|
198
|
-
hasDarkMode: true
|
|
199
|
-
},
|
|
200
|
-
{
|
|
201
|
-
name: "copper",
|
|
202
|
-
displayName: "Copper",
|
|
203
|
-
hasLightMode: true,
|
|
204
|
-
hasDarkMode: true
|
|
205
|
-
},
|
|
206
|
-
// Layer 1 skin axes — truly-unique themes (compact tech / editorial / brutalist dense / display-heavy / touch-first)
|
|
207
|
-
{
|
|
208
|
-
name: "prism",
|
|
209
|
-
displayName: "Prism",
|
|
210
|
-
hasLightMode: true,
|
|
211
|
-
hasDarkMode: true
|
|
212
|
-
},
|
|
213
|
-
{
|
|
214
|
-
name: "gazette",
|
|
215
|
-
displayName: "Gazette",
|
|
216
|
-
hasLightMode: true,
|
|
217
|
-
hasDarkMode: true
|
|
218
|
-
},
|
|
219
|
-
{
|
|
220
|
-
name: "terminal",
|
|
221
|
-
displayName: "Terminal",
|
|
222
|
-
hasLightMode: true,
|
|
223
|
-
hasDarkMode: true
|
|
224
|
-
},
|
|
225
|
-
{
|
|
226
|
-
name: "atelier",
|
|
227
|
-
displayName: "Atelier",
|
|
228
|
-
hasLightMode: true,
|
|
229
|
-
hasDarkMode: true
|
|
230
|
-
},
|
|
231
|
-
{
|
|
232
|
-
name: "kiosk",
|
|
233
|
-
displayName: "Kiosk",
|
|
234
|
-
hasLightMode: true,
|
|
235
|
-
hasDarkMode: true
|
|
236
|
-
},
|
|
237
|
-
{
|
|
238
|
-
name: "linear-clean",
|
|
239
|
-
displayName: "Linear Clean",
|
|
240
|
-
hasLightMode: true,
|
|
241
|
-
hasDarkMode: true
|
|
242
|
-
},
|
|
243
|
-
{
|
|
244
|
-
name: "notion-editorial",
|
|
245
|
-
displayName: "Notion Editorial",
|
|
246
|
-
hasLightMode: true,
|
|
247
|
-
hasDarkMode: true
|
|
248
|
-
},
|
|
249
|
-
{
|
|
250
|
-
name: "bloomberg-dense",
|
|
251
|
-
displayName: "Bloomberg Dense",
|
|
252
|
-
hasLightMode: true,
|
|
253
|
-
hasDarkMode: true
|
|
254
|
-
}
|
|
255
|
-
];
|
|
256
|
-
ThemeContext = createContext(void 0);
|
|
257
|
-
THEME_STORAGE_KEY = "theme";
|
|
258
|
-
MODE_STORAGE_KEY = "theme-mode";
|
|
259
|
-
ThemeProvider = ({
|
|
260
|
-
children,
|
|
261
|
-
themes = [],
|
|
262
|
-
defaultTheme = "wireframe",
|
|
263
|
-
defaultMode = "system",
|
|
264
|
-
targetRef
|
|
265
|
-
}) => {
|
|
266
|
-
const availableThemes = useMemo(() => {
|
|
267
|
-
const themeMap = /* @__PURE__ */ new Map();
|
|
268
|
-
BUILT_IN_THEMES.forEach((t) => themeMap.set(t.name, t));
|
|
269
|
-
themes.forEach((t) => themeMap.set(t.name, t));
|
|
270
|
-
return Array.from(themeMap.values());
|
|
271
|
-
}, [themes]);
|
|
272
|
-
const isScoped = !!targetRef;
|
|
273
|
-
const [theme, setThemeState] = useState(() => {
|
|
274
|
-
if (isScoped || typeof window === "undefined") return defaultTheme;
|
|
275
|
-
const stored = localStorage.getItem(THEME_STORAGE_KEY);
|
|
276
|
-
const validThemes = [
|
|
277
|
-
...BUILT_IN_THEMES.map((t) => t.name),
|
|
278
|
-
...themes.map((t) => t.name)
|
|
279
|
-
];
|
|
280
|
-
if (stored && validThemes.includes(stored)) {
|
|
281
|
-
return stored;
|
|
282
|
-
}
|
|
283
|
-
return defaultTheme;
|
|
284
|
-
});
|
|
285
|
-
const [mode, setModeState] = useState(() => {
|
|
286
|
-
if (isScoped || typeof window === "undefined") return defaultMode;
|
|
287
|
-
const stored = localStorage.getItem(MODE_STORAGE_KEY);
|
|
288
|
-
if (stored === "light" || stored === "dark" || stored === "system") {
|
|
289
|
-
return stored;
|
|
290
|
-
}
|
|
291
|
-
return defaultMode;
|
|
292
|
-
});
|
|
293
|
-
const [resolvedMode, setResolvedMode] = useState(
|
|
294
|
-
() => resolveMode(mode)
|
|
295
|
-
);
|
|
296
|
-
const appliedTheme = useMemo(
|
|
297
|
-
() => `${theme}-${resolvedMode}`,
|
|
298
|
-
[theme, resolvedMode]
|
|
299
|
-
);
|
|
300
|
-
useEffect(() => {
|
|
301
|
-
const updateResolved = () => {
|
|
302
|
-
setResolvedMode(resolveMode(mode));
|
|
303
|
-
};
|
|
304
|
-
updateResolved();
|
|
305
|
-
if (mode === "system") {
|
|
306
|
-
const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
307
|
-
const handleChange = () => updateResolved();
|
|
308
|
-
mediaQuery.addEventListener("change", handleChange);
|
|
309
|
-
return () => mediaQuery.removeEventListener("change", handleChange);
|
|
310
|
-
}
|
|
311
|
-
return void 0;
|
|
312
|
-
}, [mode]);
|
|
313
|
-
useEffect(() => {
|
|
314
|
-
if (isScoped) {
|
|
315
|
-
if (targetRef?.current) {
|
|
316
|
-
targetRef.current.setAttribute("data-theme", appliedTheme);
|
|
317
|
-
targetRef.current.classList.remove("light", "dark");
|
|
318
|
-
targetRef.current.classList.add(resolvedMode);
|
|
319
|
-
}
|
|
320
|
-
return;
|
|
321
|
-
}
|
|
322
|
-
const root = document.documentElement;
|
|
323
|
-
root.setAttribute("data-theme", appliedTheme);
|
|
324
|
-
root.classList.remove("light", "dark");
|
|
325
|
-
root.classList.add(resolvedMode);
|
|
326
|
-
}, [appliedTheme, resolvedMode, targetRef, isScoped]);
|
|
327
|
-
const setTheme = useCallback(
|
|
328
|
-
(newTheme) => {
|
|
329
|
-
const validTheme = availableThemes.find((t) => t.name === newTheme);
|
|
330
|
-
if (validTheme) {
|
|
331
|
-
setThemeState(newTheme);
|
|
332
|
-
if (!isScoped && typeof window !== "undefined") {
|
|
333
|
-
localStorage.setItem(THEME_STORAGE_KEY, newTheme);
|
|
334
|
-
}
|
|
335
|
-
} else {
|
|
336
|
-
log.warn("Theme not found", {
|
|
337
|
-
theme: newTheme,
|
|
338
|
-
available: availableThemes.map((t) => t.name)
|
|
339
|
-
});
|
|
340
|
-
}
|
|
341
|
-
},
|
|
342
|
-
[availableThemes]
|
|
343
|
-
);
|
|
344
|
-
const setMode = useCallback((newMode) => {
|
|
345
|
-
setModeState(newMode);
|
|
346
|
-
if (!isScoped && typeof window !== "undefined") {
|
|
347
|
-
localStorage.setItem(MODE_STORAGE_KEY, newMode);
|
|
348
|
-
}
|
|
349
|
-
}, []);
|
|
350
|
-
const toggleMode = useCallback(() => {
|
|
351
|
-
const newMode = resolvedMode === "dark" ? "light" : "dark";
|
|
352
|
-
setMode(newMode);
|
|
353
|
-
}, [resolvedMode, setMode]);
|
|
354
|
-
const contextValue = useMemo(
|
|
355
|
-
() => ({
|
|
356
|
-
theme,
|
|
357
|
-
mode,
|
|
358
|
-
resolvedMode,
|
|
359
|
-
setTheme,
|
|
360
|
-
setMode,
|
|
361
|
-
toggleMode,
|
|
362
|
-
availableThemes,
|
|
363
|
-
appliedTheme
|
|
364
|
-
}),
|
|
365
|
-
[
|
|
366
|
-
theme,
|
|
367
|
-
mode,
|
|
368
|
-
resolvedMode,
|
|
369
|
-
setTheme,
|
|
370
|
-
setMode,
|
|
371
|
-
toggleMode,
|
|
372
|
-
availableThemes,
|
|
373
|
-
appliedTheme
|
|
374
|
-
]
|
|
375
|
-
);
|
|
376
|
-
return /* @__PURE__ */ jsx(ThemeContext.Provider, { value: contextValue, children });
|
|
377
|
-
};
|
|
378
|
-
}
|
|
379
|
-
});
|
|
380
74
|
|
|
381
75
|
// hooks/useEventBus.ts
|
|
382
76
|
var useEventBus_exports = {};
|
|
@@ -461,11 +155,11 @@ function useEmitEvent() {
|
|
|
461
155
|
[eventBus]
|
|
462
156
|
);
|
|
463
157
|
}
|
|
464
|
-
var
|
|
158
|
+
var log, subLog, scopeLog, fallbackListeners, fallbackAnyListeners, fallbackEventBus, useEventSubscription, useEventBus_default;
|
|
465
159
|
var init_useEventBus = __esm({
|
|
466
160
|
"hooks/useEventBus.ts"() {
|
|
467
161
|
"use client";
|
|
468
|
-
|
|
162
|
+
log = createLogger("almadar:eventbus");
|
|
469
163
|
subLog = createLogger("almadar:eventbus:subscribe");
|
|
470
164
|
scopeLog = createLogger("almadar:ui:trait-scope");
|
|
471
165
|
fallbackListeners = /* @__PURE__ */ new Map();
|
|
@@ -479,13 +173,13 @@ var init_useEventBus = __esm({
|
|
|
479
173
|
source
|
|
480
174
|
};
|
|
481
175
|
const handlers = fallbackListeners.get(type);
|
|
482
|
-
|
|
176
|
+
log.debug("emit", { type, payloadKeys: payload ? Object.keys(payload).length : 0, listenerCount: (handlers?.size ?? 0) + fallbackAnyListeners.size });
|
|
483
177
|
if (handlers) {
|
|
484
178
|
handlers.forEach((handler) => {
|
|
485
179
|
try {
|
|
486
180
|
handler(event);
|
|
487
181
|
} catch (error) {
|
|
488
|
-
|
|
182
|
+
log.error("Error in listener", { type, error: error instanceof Error ? error : String(error) });
|
|
489
183
|
}
|
|
490
184
|
});
|
|
491
185
|
}
|
|
@@ -493,7 +187,7 @@ var init_useEventBus = __esm({
|
|
|
493
187
|
try {
|
|
494
188
|
handler(event);
|
|
495
189
|
} catch (error) {
|
|
496
|
-
|
|
190
|
+
log.error("Error in onAny listener", { type, error: error instanceof Error ? error : String(error) });
|
|
497
191
|
}
|
|
498
192
|
});
|
|
499
193
|
},
|
|
@@ -660,7 +354,7 @@ var init_Box = __esm({
|
|
|
660
354
|
fixed: "fixed",
|
|
661
355
|
sticky: "sticky"
|
|
662
356
|
};
|
|
663
|
-
Box =
|
|
357
|
+
Box = React82__default.forwardRef(
|
|
664
358
|
({
|
|
665
359
|
padding,
|
|
666
360
|
paddingX,
|
|
@@ -710,7 +404,7 @@ var init_Box = __esm({
|
|
|
710
404
|
onMouseLeave?.(e);
|
|
711
405
|
}, [hoverEvent, eventBus, onMouseLeave]);
|
|
712
406
|
const isClickable = action || onClick;
|
|
713
|
-
return
|
|
407
|
+
return React82__default.createElement(
|
|
714
408
|
Component2,
|
|
715
409
|
{
|
|
716
410
|
ref,
|
|
@@ -805,7 +499,7 @@ function loadLib(key, importer) {
|
|
|
805
499
|
return p2;
|
|
806
500
|
}
|
|
807
501
|
function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
|
|
808
|
-
const Lazy =
|
|
502
|
+
const Lazy = React82__default.lazy(async () => {
|
|
809
503
|
const lib = await loadLib(libKey, importer);
|
|
810
504
|
const Comp = pick(lib);
|
|
811
505
|
if (!Comp) {
|
|
@@ -815,7 +509,7 @@ function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
|
|
|
815
509
|
return { default: Comp };
|
|
816
510
|
});
|
|
817
511
|
const Wrapped = (props) => /* @__PURE__ */ jsx(
|
|
818
|
-
|
|
512
|
+
React82__default.Suspense,
|
|
819
513
|
{
|
|
820
514
|
fallback: /* @__PURE__ */ jsx(
|
|
821
515
|
"span",
|
|
@@ -1541,7 +1235,7 @@ var init_Icon = __esm({
|
|
|
1541
1235
|
const directIcon = typeof icon === "string" ? void 0 : icon;
|
|
1542
1236
|
const effectiveName = typeof icon === "string" ? icon : name;
|
|
1543
1237
|
const family = useIconFamily();
|
|
1544
|
-
const RenderedComponent =
|
|
1238
|
+
const RenderedComponent = React82__default.useMemo(() => {
|
|
1545
1239
|
if (directIcon) return null;
|
|
1546
1240
|
return effectiveName ? resolveIconForFamily(effectiveName, family) : null;
|
|
1547
1241
|
}, [directIcon, effectiveName, family]);
|
|
@@ -1600,7 +1294,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
1600
1294
|
const IconComp = value;
|
|
1601
1295
|
return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
|
|
1602
1296
|
}
|
|
1603
|
-
if (
|
|
1297
|
+
if (React82__default.isValidElement(value)) {
|
|
1604
1298
|
return value;
|
|
1605
1299
|
}
|
|
1606
1300
|
if (typeof value === "object" && value !== null && "render" in value) {
|
|
@@ -1676,7 +1370,7 @@ var init_Button = __esm({
|
|
|
1676
1370
|
md: "h-icon-default w-icon-default",
|
|
1677
1371
|
lg: "h-icon-default w-icon-default"
|
|
1678
1372
|
};
|
|
1679
|
-
Button =
|
|
1373
|
+
Button = React82__default.forwardRef(
|
|
1680
1374
|
({
|
|
1681
1375
|
className,
|
|
1682
1376
|
variant = "primary",
|
|
@@ -1741,7 +1435,7 @@ var Dialog;
|
|
|
1741
1435
|
var init_Dialog = __esm({
|
|
1742
1436
|
"components/core/atoms/Dialog.tsx"() {
|
|
1743
1437
|
init_cn();
|
|
1744
|
-
Dialog =
|
|
1438
|
+
Dialog = React82__default.forwardRef(
|
|
1745
1439
|
({
|
|
1746
1440
|
role = "dialog",
|
|
1747
1441
|
"aria-modal": ariaModal = true,
|
|
@@ -2355,7 +2049,7 @@ var init_Badge = __esm({
|
|
|
2355
2049
|
md: "px-2.5 py-1 text-sm",
|
|
2356
2050
|
lg: "px-3 py-1.5 text-base"
|
|
2357
2051
|
};
|
|
2358
|
-
Badge =
|
|
2052
|
+
Badge = React82__default.forwardRef(
|
|
2359
2053
|
({ className, variant = "default", size = "sm", amount, label, icon, children, onRemove, removeLabel, ...props }, ref) => {
|
|
2360
2054
|
const iconSizes3 = {
|
|
2361
2055
|
sm: "h-icon-default w-icon-default",
|
|
@@ -2691,7 +2385,7 @@ var init_SvgFlow = __esm({
|
|
|
2691
2385
|
width = 100,
|
|
2692
2386
|
height = 100
|
|
2693
2387
|
}) => {
|
|
2694
|
-
const markerId =
|
|
2388
|
+
const markerId = React82__default.useMemo(() => {
|
|
2695
2389
|
flowIdCounter += 1;
|
|
2696
2390
|
return `almadar-flow-arrow-${flowIdCounter}`;
|
|
2697
2391
|
}, []);
|
|
@@ -3284,7 +2978,7 @@ var init_SvgRing = __esm({
|
|
|
3284
2978
|
width = 100,
|
|
3285
2979
|
height = 100
|
|
3286
2980
|
}) => {
|
|
3287
|
-
const gradientId =
|
|
2981
|
+
const gradientId = React82__default.useMemo(() => {
|
|
3288
2982
|
ringIdCounter += 1;
|
|
3289
2983
|
return `almadar-ring-glow-${ringIdCounter}`;
|
|
3290
2984
|
}, []);
|
|
@@ -3465,7 +3159,7 @@ var init_Input = __esm({
|
|
|
3465
3159
|
init_cn();
|
|
3466
3160
|
init_Icon();
|
|
3467
3161
|
init_useEventBus();
|
|
3468
|
-
Input =
|
|
3162
|
+
Input = React82__default.forwardRef(
|
|
3469
3163
|
({
|
|
3470
3164
|
className,
|
|
3471
3165
|
inputType,
|
|
@@ -3625,7 +3319,7 @@ var Label;
|
|
|
3625
3319
|
var init_Label = __esm({
|
|
3626
3320
|
"components/core/atoms/Label.tsx"() {
|
|
3627
3321
|
init_cn();
|
|
3628
|
-
Label =
|
|
3322
|
+
Label = React82__default.forwardRef(
|
|
3629
3323
|
({ className, required, children, ...props }, ref) => {
|
|
3630
3324
|
return /* @__PURE__ */ jsxs(
|
|
3631
3325
|
"label",
|
|
@@ -3652,7 +3346,7 @@ var init_Textarea = __esm({
|
|
|
3652
3346
|
"components/core/atoms/Textarea.tsx"() {
|
|
3653
3347
|
init_cn();
|
|
3654
3348
|
init_useEventBus();
|
|
3655
|
-
Textarea =
|
|
3349
|
+
Textarea = React82__default.forwardRef(
|
|
3656
3350
|
({ className, error, onChange, ...props }, ref) => {
|
|
3657
3351
|
const eventBus = useEventBus();
|
|
3658
3352
|
const handleChange = (e) => {
|
|
@@ -3891,7 +3585,7 @@ var init_Select = __esm({
|
|
|
3891
3585
|
init_cn();
|
|
3892
3586
|
init_Icon();
|
|
3893
3587
|
init_useEventBus();
|
|
3894
|
-
Select =
|
|
3588
|
+
Select = React82__default.forwardRef(
|
|
3895
3589
|
(props, _ref) => {
|
|
3896
3590
|
const { multiple, searchable, clearable } = props;
|
|
3897
3591
|
if (multiple || searchable || clearable) {
|
|
@@ -3908,7 +3602,7 @@ var init_Checkbox = __esm({
|
|
|
3908
3602
|
"components/core/atoms/Checkbox.tsx"() {
|
|
3909
3603
|
init_cn();
|
|
3910
3604
|
init_useEventBus();
|
|
3911
|
-
Checkbox =
|
|
3605
|
+
Checkbox = React82__default.forwardRef(
|
|
3912
3606
|
({ className, label, id, onChange, ...props }, ref) => {
|
|
3913
3607
|
const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
3914
3608
|
const eventBus = useEventBus();
|
|
@@ -3962,7 +3656,7 @@ var init_Spinner = __esm({
|
|
|
3962
3656
|
md: "h-6 w-6",
|
|
3963
3657
|
lg: "h-8 w-8"
|
|
3964
3658
|
};
|
|
3965
|
-
Spinner =
|
|
3659
|
+
Spinner = React82__default.forwardRef(
|
|
3966
3660
|
({ className, size = "md", overlay, ...props }, ref) => {
|
|
3967
3661
|
if (overlay) {
|
|
3968
3662
|
return /* @__PURE__ */ jsx(
|
|
@@ -4052,7 +3746,7 @@ var init_Card = __esm({
|
|
|
4052
3746
|
chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
|
|
4053
3747
|
"tile-image-first": "p-0 overflow-hidden"
|
|
4054
3748
|
};
|
|
4055
|
-
Card =
|
|
3749
|
+
Card = React82__default.forwardRef(
|
|
4056
3750
|
({
|
|
4057
3751
|
className,
|
|
4058
3752
|
variant = "bordered",
|
|
@@ -4100,9 +3794,9 @@ var init_Card = __esm({
|
|
|
4100
3794
|
}
|
|
4101
3795
|
);
|
|
4102
3796
|
Card.displayName = "Card";
|
|
4103
|
-
CardHeader =
|
|
3797
|
+
CardHeader = React82__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
4104
3798
|
CardHeader.displayName = "CardHeader";
|
|
4105
|
-
CardTitle =
|
|
3799
|
+
CardTitle = React82__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
4106
3800
|
"h3",
|
|
4107
3801
|
{
|
|
4108
3802
|
ref,
|
|
@@ -4115,11 +3809,11 @@ var init_Card = __esm({
|
|
|
4115
3809
|
}
|
|
4116
3810
|
));
|
|
4117
3811
|
CardTitle.displayName = "CardTitle";
|
|
4118
|
-
CardContent =
|
|
3812
|
+
CardContent = React82__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
|
|
4119
3813
|
CardContent.displayName = "CardContent";
|
|
4120
3814
|
CardBody = CardContent;
|
|
4121
3815
|
CardBody.displayName = "CardBody";
|
|
4122
|
-
CardFooter =
|
|
3816
|
+
CardFooter = React82__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
4123
3817
|
"div",
|
|
4124
3818
|
{
|
|
4125
3819
|
ref,
|
|
@@ -4174,7 +3868,7 @@ var init_FilterPill = __esm({
|
|
|
4174
3868
|
md: "w-3.5 h-3.5",
|
|
4175
3869
|
lg: "w-4 h-4"
|
|
4176
3870
|
};
|
|
4177
|
-
FilterPill =
|
|
3871
|
+
FilterPill = React82__default.forwardRef(
|
|
4178
3872
|
({
|
|
4179
3873
|
className,
|
|
4180
3874
|
variant = "default",
|
|
@@ -4303,8 +3997,8 @@ var init_Avatar = __esm({
|
|
|
4303
3997
|
actionPayload
|
|
4304
3998
|
}) => {
|
|
4305
3999
|
const eventBus = useEventBus();
|
|
4306
|
-
const [imgFailed, setImgFailed] =
|
|
4307
|
-
|
|
4000
|
+
const [imgFailed, setImgFailed] = React82__default.useState(false);
|
|
4001
|
+
React82__default.useEffect(() => {
|
|
4308
4002
|
setImgFailed(false);
|
|
4309
4003
|
}, [src]);
|
|
4310
4004
|
const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
|
|
@@ -4689,7 +4383,7 @@ var init_Radio = __esm({
|
|
|
4689
4383
|
md: "w-2.5 h-2.5",
|
|
4690
4384
|
lg: "w-3 h-3"
|
|
4691
4385
|
};
|
|
4692
|
-
Radio =
|
|
4386
|
+
Radio = React82__default.forwardRef(
|
|
4693
4387
|
({
|
|
4694
4388
|
label,
|
|
4695
4389
|
helperText,
|
|
@@ -4706,12 +4400,12 @@ var init_Radio = __esm({
|
|
|
4706
4400
|
onChange,
|
|
4707
4401
|
...props
|
|
4708
4402
|
}, ref) => {
|
|
4709
|
-
const reactId =
|
|
4403
|
+
const reactId = React82__default.useId();
|
|
4710
4404
|
const baseId = id || `radio-${reactId}`;
|
|
4711
4405
|
const hasError = !!error;
|
|
4712
4406
|
const eventBus = useEventBus();
|
|
4713
|
-
const [selected, setSelected] =
|
|
4714
|
-
|
|
4407
|
+
const [selected, setSelected] = React82__default.useState(value);
|
|
4408
|
+
React82__default.useEffect(() => {
|
|
4715
4409
|
if (value !== void 0) setSelected(value);
|
|
4716
4410
|
}, [value]);
|
|
4717
4411
|
const pick = (next, e) => {
|
|
@@ -4893,7 +4587,7 @@ var init_Switch = __esm({
|
|
|
4893
4587
|
"components/core/atoms/Switch.tsx"() {
|
|
4894
4588
|
"use client";
|
|
4895
4589
|
init_cn();
|
|
4896
|
-
Switch =
|
|
4590
|
+
Switch = React82.forwardRef(
|
|
4897
4591
|
({
|
|
4898
4592
|
checked,
|
|
4899
4593
|
defaultChecked = false,
|
|
@@ -4904,10 +4598,10 @@ var init_Switch = __esm({
|
|
|
4904
4598
|
name,
|
|
4905
4599
|
className
|
|
4906
4600
|
}, ref) => {
|
|
4907
|
-
const [isChecked, setIsChecked] =
|
|
4601
|
+
const [isChecked, setIsChecked] = React82.useState(
|
|
4908
4602
|
checked !== void 0 ? checked : defaultChecked
|
|
4909
4603
|
);
|
|
4910
|
-
|
|
4604
|
+
React82.useEffect(() => {
|
|
4911
4605
|
if (checked !== void 0) {
|
|
4912
4606
|
setIsChecked(checked);
|
|
4913
4607
|
}
|
|
@@ -5168,7 +4862,6 @@ var init_ThemeToggle = __esm({
|
|
|
5168
4862
|
"use client";
|
|
5169
4863
|
init_Icon();
|
|
5170
4864
|
init_cn();
|
|
5171
|
-
init_ThemeContext();
|
|
5172
4865
|
sizeClasses5 = {
|
|
5173
4866
|
sm: "p-1.5",
|
|
5174
4867
|
md: "p-2",
|
|
@@ -5263,7 +4956,7 @@ var Aside;
|
|
|
5263
4956
|
var init_Aside = __esm({
|
|
5264
4957
|
"components/core/atoms/Aside.tsx"() {
|
|
5265
4958
|
init_cn();
|
|
5266
|
-
Aside =
|
|
4959
|
+
Aside = React82__default.forwardRef(
|
|
5267
4960
|
({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
|
|
5268
4961
|
);
|
|
5269
4962
|
Aside.displayName = "Aside";
|
|
@@ -5341,8 +5034,8 @@ var init_LawReferenceTooltip = __esm({
|
|
|
5341
5034
|
className
|
|
5342
5035
|
}) => {
|
|
5343
5036
|
const { t } = useTranslate();
|
|
5344
|
-
const [isVisible, setIsVisible] =
|
|
5345
|
-
const timeoutRef =
|
|
5037
|
+
const [isVisible, setIsVisible] = React82__default.useState(false);
|
|
5038
|
+
const timeoutRef = React82__default.useRef(null);
|
|
5346
5039
|
const handleMouseEnter = () => {
|
|
5347
5040
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
5348
5041
|
timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
|
|
@@ -5351,7 +5044,7 @@ var init_LawReferenceTooltip = __esm({
|
|
|
5351
5044
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
5352
5045
|
setIsVisible(false);
|
|
5353
5046
|
};
|
|
5354
|
-
|
|
5047
|
+
React82__default.useEffect(() => {
|
|
5355
5048
|
return () => {
|
|
5356
5049
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
5357
5050
|
};
|
|
@@ -5561,7 +5254,7 @@ var init_StatusDot = __esm({
|
|
|
5561
5254
|
md: "w-2.5 h-2.5",
|
|
5562
5255
|
lg: "w-3 h-3"
|
|
5563
5256
|
};
|
|
5564
|
-
StatusDot =
|
|
5257
|
+
StatusDot = React82__default.forwardRef(
|
|
5565
5258
|
({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
|
|
5566
5259
|
return /* @__PURE__ */ jsx(
|
|
5567
5260
|
"span",
|
|
@@ -5615,7 +5308,7 @@ var init_TrendIndicator = __esm({
|
|
|
5615
5308
|
down: "trending-down",
|
|
5616
5309
|
flat: "arrow-right"
|
|
5617
5310
|
};
|
|
5618
|
-
TrendIndicator =
|
|
5311
|
+
TrendIndicator = React82__default.forwardRef(
|
|
5619
5312
|
({
|
|
5620
5313
|
className,
|
|
5621
5314
|
value,
|
|
@@ -5682,7 +5375,7 @@ var init_RangeSlider = __esm({
|
|
|
5682
5375
|
md: "w-4 h-4",
|
|
5683
5376
|
lg: "w-5 h-5"
|
|
5684
5377
|
};
|
|
5685
|
-
RangeSlider =
|
|
5378
|
+
RangeSlider = React82__default.forwardRef(
|
|
5686
5379
|
({
|
|
5687
5380
|
className,
|
|
5688
5381
|
min = 0,
|
|
@@ -6190,7 +5883,7 @@ var init_ContentSection = __esm({
|
|
|
6190
5883
|
md: "py-16",
|
|
6191
5884
|
lg: "py-24"
|
|
6192
5885
|
};
|
|
6193
|
-
ContentSection =
|
|
5886
|
+
ContentSection = React82__default.forwardRef(
|
|
6194
5887
|
({ children, background = "default", padding = "lg", id, className }, ref) => {
|
|
6195
5888
|
return /* @__PURE__ */ jsx(
|
|
6196
5889
|
Box,
|
|
@@ -6724,7 +6417,7 @@ var init_AnimatedReveal = __esm({
|
|
|
6724
6417
|
"scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
|
|
6725
6418
|
"none": {}
|
|
6726
6419
|
};
|
|
6727
|
-
AnimatedReveal =
|
|
6420
|
+
AnimatedReveal = React82__default.forwardRef(
|
|
6728
6421
|
({
|
|
6729
6422
|
trigger = "scroll",
|
|
6730
6423
|
animation = "fade-up",
|
|
@@ -6884,7 +6577,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
6884
6577
|
"components/marketing/atoms/AnimatedGraphic.tsx"() {
|
|
6885
6578
|
"use client";
|
|
6886
6579
|
init_cn();
|
|
6887
|
-
AnimatedGraphic =
|
|
6580
|
+
AnimatedGraphic = React82__default.forwardRef(
|
|
6888
6581
|
({
|
|
6889
6582
|
src,
|
|
6890
6583
|
svgContent,
|
|
@@ -6907,7 +6600,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
6907
6600
|
const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
|
|
6908
6601
|
const resolvedSvg = svgContent ?? fetchedSvg;
|
|
6909
6602
|
const prevAnimateRef = useRef(animate);
|
|
6910
|
-
const setRef =
|
|
6603
|
+
const setRef = React82__default.useCallback(
|
|
6911
6604
|
(node) => {
|
|
6912
6605
|
containerRef.current = node;
|
|
6913
6606
|
if (typeof ref === "function") ref(node);
|
|
@@ -7133,9 +6826,9 @@ function ScoreDisplay({
|
|
|
7133
6826
|
...rest
|
|
7134
6827
|
}) {
|
|
7135
6828
|
const resolvedValue = typeof value === "number" && !Number.isNaN(value) ? value : typeof rest.score === "number" && !Number.isNaN(rest.score) ? rest.score : 0;
|
|
7136
|
-
const [displayValue, setDisplayValue] =
|
|
7137
|
-
const [isAnimating, setIsAnimating] =
|
|
7138
|
-
|
|
6829
|
+
const [displayValue, setDisplayValue] = React82.useState(resolvedValue);
|
|
6830
|
+
const [isAnimating, setIsAnimating] = React82.useState(false);
|
|
6831
|
+
React82.useEffect(() => {
|
|
7139
6832
|
if (!animated || displayValue === resolvedValue) {
|
|
7140
6833
|
setDisplayValue(resolvedValue);
|
|
7141
6834
|
return;
|
|
@@ -7218,9 +6911,9 @@ function ControlButton({
|
|
|
7218
6911
|
className
|
|
7219
6912
|
}) {
|
|
7220
6913
|
const eventBus = useEventBus();
|
|
7221
|
-
const [isPressed, setIsPressed] =
|
|
6914
|
+
const [isPressed, setIsPressed] = React82.useState(false);
|
|
7222
6915
|
const actualPressed = pressed ?? isPressed;
|
|
7223
|
-
const handlePointerDown =
|
|
6916
|
+
const handlePointerDown = React82.useCallback(
|
|
7224
6917
|
(e) => {
|
|
7225
6918
|
e.preventDefault();
|
|
7226
6919
|
if (disabled) return;
|
|
@@ -7230,7 +6923,7 @@ function ControlButton({
|
|
|
7230
6923
|
},
|
|
7231
6924
|
[disabled, pressEvent, eventBus, onPress]
|
|
7232
6925
|
);
|
|
7233
|
-
const handlePointerUp =
|
|
6926
|
+
const handlePointerUp = React82.useCallback(
|
|
7234
6927
|
(e) => {
|
|
7235
6928
|
e.preventDefault();
|
|
7236
6929
|
if (disabled) return;
|
|
@@ -7240,7 +6933,7 @@ function ControlButton({
|
|
|
7240
6933
|
},
|
|
7241
6934
|
[disabled, releaseEvent, eventBus, onRelease]
|
|
7242
6935
|
);
|
|
7243
|
-
const handlePointerLeave =
|
|
6936
|
+
const handlePointerLeave = React82.useCallback(
|
|
7244
6937
|
(e) => {
|
|
7245
6938
|
if (isPressed) {
|
|
7246
6939
|
setIsPressed(false);
|
|
@@ -7818,8 +7511,8 @@ function XPBar({
|
|
|
7818
7511
|
}) {
|
|
7819
7512
|
const sizes = sizeMap9[size];
|
|
7820
7513
|
const percentage = max > 0 ? Math.max(0, Math.min(100, current / max * 100)) : 0;
|
|
7821
|
-
const [fillWidth, setFillWidth] =
|
|
7822
|
-
|
|
7514
|
+
const [fillWidth, setFillWidth] = React82.useState(animated ? 0 : percentage);
|
|
7515
|
+
React82.useEffect(() => {
|
|
7823
7516
|
if (!animated) {
|
|
7824
7517
|
setFillWidth(percentage);
|
|
7825
7518
|
return;
|
|
@@ -8307,9 +8000,9 @@ function MiniMap({
|
|
|
8307
8000
|
viewportRect = DEFAULT_VIEWPORT,
|
|
8308
8001
|
className
|
|
8309
8002
|
}) {
|
|
8310
|
-
const canvasRef =
|
|
8311
|
-
const frameRef =
|
|
8312
|
-
|
|
8003
|
+
const canvasRef = React82.useRef(null);
|
|
8004
|
+
const frameRef = React82.useRef(0);
|
|
8005
|
+
React82.useEffect(() => {
|
|
8313
8006
|
const canvas = canvasRef.current;
|
|
8314
8007
|
if (!canvas) return;
|
|
8315
8008
|
const ctx = canvas.getContext("2d");
|
|
@@ -8498,7 +8191,7 @@ var init_ErrorBoundary = __esm({
|
|
|
8498
8191
|
}
|
|
8499
8192
|
);
|
|
8500
8193
|
};
|
|
8501
|
-
ErrorBoundary = class extends
|
|
8194
|
+
ErrorBoundary = class extends React82__default.Component {
|
|
8502
8195
|
constructor(props) {
|
|
8503
8196
|
super(props);
|
|
8504
8197
|
__publicField(this, "reset", () => {
|
|
@@ -8651,7 +8344,7 @@ function executeClientEffects(effects, config) {
|
|
|
8651
8344
|
try {
|
|
8652
8345
|
executeEffect(effect, config);
|
|
8653
8346
|
} catch (error) {
|
|
8654
|
-
|
|
8347
|
+
log3.error("Error executing effect", () => ({
|
|
8655
8348
|
effect: JSON.stringify(effect),
|
|
8656
8349
|
error: error instanceof Error ? error : String(error)
|
|
8657
8350
|
}));
|
|
@@ -8683,7 +8376,7 @@ function executeEffect(effect, config) {
|
|
|
8683
8376
|
break;
|
|
8684
8377
|
}
|
|
8685
8378
|
default:
|
|
8686
|
-
|
|
8379
|
+
log3.warn("Unknown effect type", { effectType: String(effectType) });
|
|
8687
8380
|
}
|
|
8688
8381
|
}
|
|
8689
8382
|
function executeRenderUI(slot, patternConfig, config) {
|
|
@@ -8698,10 +8391,10 @@ function executeNotify(message, options, config) {
|
|
|
8698
8391
|
function executeEmit(event, payload, config) {
|
|
8699
8392
|
config.eventBus.emit(event, payload);
|
|
8700
8393
|
}
|
|
8701
|
-
var
|
|
8394
|
+
var log3;
|
|
8702
8395
|
var init_client_effect_executor = __esm({
|
|
8703
8396
|
"renderer/client-effect-executor.ts"() {
|
|
8704
|
-
|
|
8397
|
+
log3 = createLogger("almadar:ui:effects:client");
|
|
8705
8398
|
}
|
|
8706
8399
|
});
|
|
8707
8400
|
|
|
@@ -8862,12 +8555,12 @@ function useOfflineExecutor(options) {
|
|
|
8862
8555
|
clearQueue
|
|
8863
8556
|
};
|
|
8864
8557
|
}
|
|
8865
|
-
var
|
|
8558
|
+
var log4, effectIdCounter, OfflineExecutor;
|
|
8866
8559
|
var init_offline_executor = __esm({
|
|
8867
8560
|
"renderer/offline-executor.ts"() {
|
|
8868
8561
|
"use client";
|
|
8869
8562
|
init_client_effect_executor();
|
|
8870
|
-
|
|
8563
|
+
log4 = createLogger("almadar:ui:effects:offline");
|
|
8871
8564
|
effectIdCounter = 0;
|
|
8872
8565
|
OfflineExecutor = class {
|
|
8873
8566
|
constructor(config) {
|
|
@@ -8921,7 +8614,7 @@ var init_offline_executor = __esm({
|
|
|
8921
8614
|
this.state.syncQueue = JSON.parse(stored);
|
|
8922
8615
|
}
|
|
8923
8616
|
} catch (error) {
|
|
8924
|
-
|
|
8617
|
+
log4.warn("Failed to load sync queue", { error: error instanceof Error ? error : String(error) });
|
|
8925
8618
|
}
|
|
8926
8619
|
}
|
|
8927
8620
|
/**
|
|
@@ -8932,7 +8625,7 @@ var init_offline_executor = __esm({
|
|
|
8932
8625
|
try {
|
|
8933
8626
|
this.storage.setItem("orbital-offline-queue", JSON.stringify(this.state.syncQueue));
|
|
8934
8627
|
} catch (error) {
|
|
8935
|
-
|
|
8628
|
+
log4.warn("Failed to save sync queue", { error: error instanceof Error ? error : String(error) });
|
|
8936
8629
|
}
|
|
8937
8630
|
}
|
|
8938
8631
|
/**
|
|
@@ -9002,7 +8695,7 @@ var init_offline_executor = __esm({
|
|
|
9002
8695
|
this.queueForSync(type, { args, event, payload });
|
|
9003
8696
|
break;
|
|
9004
8697
|
default:
|
|
9005
|
-
|
|
8698
|
+
log4.warn("Unknown effect type", { type });
|
|
9006
8699
|
}
|
|
9007
8700
|
}
|
|
9008
8701
|
}
|
|
@@ -9889,8 +9582,8 @@ function ActionButtons({
|
|
|
9889
9582
|
disabled
|
|
9890
9583
|
}) {
|
|
9891
9584
|
const eventBus = useEventBus();
|
|
9892
|
-
const [activeButtons, setActiveButtons] =
|
|
9893
|
-
const handlePress =
|
|
9585
|
+
const [activeButtons, setActiveButtons] = React82.useState(/* @__PURE__ */ new Set());
|
|
9586
|
+
const handlePress = React82.useCallback(
|
|
9894
9587
|
(id) => {
|
|
9895
9588
|
setActiveButtons((prev) => new Set(prev).add(id));
|
|
9896
9589
|
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
|
|
@@ -9898,7 +9591,7 @@ function ActionButtons({
|
|
|
9898
9591
|
},
|
|
9899
9592
|
[actionEvent, eventBus, onAction]
|
|
9900
9593
|
);
|
|
9901
|
-
const handleRelease =
|
|
9594
|
+
const handleRelease = React82.useCallback(
|
|
9902
9595
|
(id) => {
|
|
9903
9596
|
setActiveButtons((prev) => {
|
|
9904
9597
|
const next = new Set(prev);
|
|
@@ -10810,7 +10503,7 @@ function recordTransition(trace) {
|
|
|
10810
10503
|
...trace,
|
|
10811
10504
|
id: `t-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`
|
|
10812
10505
|
};
|
|
10813
|
-
|
|
10506
|
+
log5.debug("transition:recorded", { trait: trace.traitName, from: trace.from, to: trace.to, event: trace.event, effectCount: trace.effects.length });
|
|
10814
10507
|
getState().transitions.push(entry);
|
|
10815
10508
|
if (getState().transitions.length > MAX_TRANSITIONS) {
|
|
10816
10509
|
getState().transitions.shift();
|
|
@@ -10879,7 +10572,7 @@ function getTraitSnapshots() {
|
|
|
10879
10572
|
try {
|
|
10880
10573
|
snapshots.push(getter());
|
|
10881
10574
|
} catch (err) {
|
|
10882
|
-
|
|
10575
|
+
log5.error("traitSnapshot getter failed", { trait: traitName, err: String(err) });
|
|
10883
10576
|
}
|
|
10884
10577
|
}
|
|
10885
10578
|
return snapshots;
|
|
@@ -10942,12 +10635,12 @@ function waitForTransition(event, timeoutMs = 1e4) {
|
|
|
10942
10635
|
}
|
|
10943
10636
|
function bindEventBus(eventBus) {
|
|
10944
10637
|
if (typeof window === "undefined") return;
|
|
10945
|
-
|
|
10638
|
+
log5.info("bindEventBus", { hasOnAny: !!eventBus.onAny });
|
|
10946
10639
|
exposeOnWindow();
|
|
10947
10640
|
if (window.__orbitalVerification) {
|
|
10948
10641
|
window.__orbitalVerification.sendEvent = (event, payload, traitScope) => {
|
|
10949
10642
|
const prefixed = event.startsWith("UI:") ? event : traitScope ? `UI:${traitScope}.${event}` : `UI:${event}`;
|
|
10950
|
-
|
|
10643
|
+
log5.debug("sendEvent", { event: prefixed, traitScope, payloadKeys: payload ? Object.keys(payload) : [] });
|
|
10951
10644
|
eventBus.emit(prefixed, payload);
|
|
10952
10645
|
};
|
|
10953
10646
|
const eventLog = [];
|
|
@@ -10996,10 +10689,10 @@ function updateAssetStatus(url, status) {
|
|
|
10996
10689
|
window.__orbitalVerification.assetStatus[url] = status;
|
|
10997
10690
|
}
|
|
10998
10691
|
}
|
|
10999
|
-
var
|
|
10692
|
+
var log5, MAX_TRANSITIONS;
|
|
11000
10693
|
var init_verificationRegistry = __esm({
|
|
11001
10694
|
"lib/verificationRegistry.ts"() {
|
|
11002
|
-
|
|
10695
|
+
log5 = createLogger("almadar:bridge");
|
|
11003
10696
|
MAX_TRANSITIONS = 500;
|
|
11004
10697
|
exposeOnWindow();
|
|
11005
10698
|
}
|
|
@@ -13130,7 +12823,7 @@ var init_avl_elk_layout = __esm({
|
|
|
13130
12823
|
elk = new ELK();
|
|
13131
12824
|
}
|
|
13132
12825
|
});
|
|
13133
|
-
var
|
|
12826
|
+
var log6, SWIM_GUTTER, CENTER_W, BehaviorView;
|
|
13134
12827
|
var init_BehaviorView = __esm({
|
|
13135
12828
|
"components/avl/molecules/BehaviorView.tsx"() {
|
|
13136
12829
|
"use client";
|
|
@@ -13139,7 +12832,7 @@ var init_BehaviorView = __esm({
|
|
|
13139
12832
|
init_AvlSwimLane();
|
|
13140
12833
|
init_types();
|
|
13141
12834
|
init_avl_elk_layout();
|
|
13142
|
-
|
|
12835
|
+
log6 = createLogger("almadar:ui:avl:behavior-view");
|
|
13143
12836
|
SWIM_GUTTER = 120;
|
|
13144
12837
|
CENTER_W = 360;
|
|
13145
12838
|
BehaviorView = ({ data }) => {
|
|
@@ -13150,7 +12843,7 @@ var init_BehaviorView = __esm({
|
|
|
13150
12843
|
const dataKey = useMemo(() => JSON.stringify(traitData), [traitData]);
|
|
13151
12844
|
useEffect(() => {
|
|
13152
12845
|
if (!traitData) return;
|
|
13153
|
-
computeTraitLayout(traitData).then(setLayout).catch((err) =>
|
|
12846
|
+
computeTraitLayout(traitData).then(setLayout).catch((err) => log6.error("compute-trait-layout-failed", { error: err instanceof Error ? err : String(err) }));
|
|
13154
12847
|
}, [dataKey]);
|
|
13155
12848
|
if (!traitData) {
|
|
13156
12849
|
return /* @__PURE__ */ jsx("div", { className: "rounded-lg border border-[var(--color-border)] bg-[var(--color-card)] p-4 text-center text-[var(--color-muted-foreground)] text-sm", children: t("avl.noTraitData") });
|
|
@@ -13561,7 +13254,7 @@ function generateDiff(oldVal, newVal) {
|
|
|
13561
13254
|
}
|
|
13562
13255
|
return diff;
|
|
13563
13256
|
}
|
|
13564
|
-
var orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle,
|
|
13257
|
+
var orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log7, CODE_LANGUAGES, CODE_LANGUAGE_SET, DIFF_STYLES, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS, CodeBlock;
|
|
13565
13258
|
var init_CodeBlock = __esm({
|
|
13566
13259
|
"components/core/molecules/markdown/CodeBlock.tsx"() {
|
|
13567
13260
|
init_cn();
|
|
@@ -13644,7 +13337,7 @@ var init_CodeBlock = __esm({
|
|
|
13644
13337
|
"lolo-op-async": { color: ORB_COLORS.dark.async }
|
|
13645
13338
|
};
|
|
13646
13339
|
loloStyle = { ...dark, ...loloStyleOverrides };
|
|
13647
|
-
|
|
13340
|
+
log7 = createLogger("almadar:ui:markdown-code");
|
|
13648
13341
|
CODE_LANGUAGES = [
|
|
13649
13342
|
"text",
|
|
13650
13343
|
"json",
|
|
@@ -13683,7 +13376,7 @@ var init_CodeBlock = __esm({
|
|
|
13683
13376
|
};
|
|
13684
13377
|
LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
13685
13378
|
HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
13686
|
-
CodeBlock =
|
|
13379
|
+
CodeBlock = React82__default.memo(
|
|
13687
13380
|
({
|
|
13688
13381
|
code: rawCode,
|
|
13689
13382
|
language = "text",
|
|
@@ -13908,7 +13601,7 @@ var init_CodeBlock = __esm({
|
|
|
13908
13601
|
eventBus.emit("UI:COPY_CODE", { language: activeLanguage, success: true });
|
|
13909
13602
|
setTimeout(() => setCopied(false), 2e3);
|
|
13910
13603
|
} catch (err) {
|
|
13911
|
-
|
|
13604
|
+
log7.error("Failed to copy code", { error: err instanceof Error ? err : String(err) });
|
|
13912
13605
|
eventBus.emit("UI:COPY_CODE", { language: activeLanguage, success: false });
|
|
13913
13606
|
}
|
|
13914
13607
|
};
|
|
@@ -14270,7 +13963,7 @@ var init_MarkdownContent = __esm({
|
|
|
14270
13963
|
init_Box();
|
|
14271
13964
|
init_CodeBlock();
|
|
14272
13965
|
init_cn();
|
|
14273
|
-
MarkdownContent =
|
|
13966
|
+
MarkdownContent = React82__default.memo(
|
|
14274
13967
|
({ content, direction = "ltr", className }) => {
|
|
14275
13968
|
const { t: _t } = useTranslate();
|
|
14276
13969
|
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
@@ -15587,7 +15280,7 @@ var init_StateMachineView = __esm({
|
|
|
15587
15280
|
style: { top: title ? 30 : 0 },
|
|
15588
15281
|
children: [
|
|
15589
15282
|
entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
|
|
15590
|
-
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(
|
|
15283
|
+
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React82__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
|
|
15591
15284
|
StateNode,
|
|
15592
15285
|
{
|
|
15593
15286
|
state,
|
|
@@ -17789,14 +17482,14 @@ function useSafeEventBus2() {
|
|
|
17789
17482
|
} };
|
|
17790
17483
|
}
|
|
17791
17484
|
}
|
|
17792
|
-
var
|
|
17485
|
+
var log8, lookStyles4, ButtonGroup;
|
|
17793
17486
|
var init_ButtonGroup = __esm({
|
|
17794
17487
|
"components/core/molecules/ButtonGroup.tsx"() {
|
|
17795
17488
|
"use client";
|
|
17796
17489
|
init_cn();
|
|
17797
17490
|
init_atoms2();
|
|
17798
17491
|
init_useEventBus();
|
|
17799
|
-
|
|
17492
|
+
log8 = createLogger("almadar:ui:button-group");
|
|
17800
17493
|
lookStyles4 = {
|
|
17801
17494
|
"right-aligned-buttons": "",
|
|
17802
17495
|
"floating-bar": "fixed bottom-section left-1/2 -translate-x-1/2 shadow-elevation-toast bg-card p-card-sm rounded-container",
|
|
@@ -17877,7 +17570,7 @@ var init_ButtonGroup = __esm({
|
|
|
17877
17570
|
{
|
|
17878
17571
|
variant: "ghost",
|
|
17879
17572
|
onClick: () => {
|
|
17880
|
-
|
|
17573
|
+
log8.debug("Filter clicked", { field: filter.field });
|
|
17881
17574
|
},
|
|
17882
17575
|
children: filter.label
|
|
17883
17576
|
},
|
|
@@ -22128,7 +21821,7 @@ function CraftingRecipe({
|
|
|
22128
21821
|
className
|
|
22129
21822
|
}) {
|
|
22130
21823
|
const eventBus = useEventBus();
|
|
22131
|
-
const handleCraft =
|
|
21824
|
+
const handleCraft = React82.useCallback(() => {
|
|
22132
21825
|
onCraft?.();
|
|
22133
21826
|
if (craftEvent) {
|
|
22134
21827
|
eventBus.emit(craftEvent, { output: output.label });
|
|
@@ -22145,7 +21838,7 @@ function CraftingRecipe({
|
|
|
22145
21838
|
children: [
|
|
22146
21839
|
/* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-wrap items-center", children: inputs.map((ingredient, index) => {
|
|
22147
21840
|
const hasSufficient = ingredient.available >= ingredient.required;
|
|
22148
|
-
return /* @__PURE__ */ jsxs(
|
|
21841
|
+
return /* @__PURE__ */ jsxs(React82.Fragment, { children: [
|
|
22149
21842
|
/* @__PURE__ */ jsx(Box, { className: "relative", children: /* @__PURE__ */ jsx(
|
|
22150
21843
|
ItemSlot,
|
|
22151
21844
|
{
|
|
@@ -22217,8 +21910,8 @@ function DPad({
|
|
|
22217
21910
|
}) {
|
|
22218
21911
|
const eventBus = useEventBus();
|
|
22219
21912
|
const sizes = sizeMap15[size];
|
|
22220
|
-
const [activeDirections, setActiveDirections] =
|
|
22221
|
-
const handlePress =
|
|
21913
|
+
const [activeDirections, setActiveDirections] = React82.useState(/* @__PURE__ */ new Set());
|
|
21914
|
+
const handlePress = React82.useCallback(
|
|
22222
21915
|
(direction) => {
|
|
22223
21916
|
setActiveDirections((prev) => new Set(prev).add(direction));
|
|
22224
21917
|
if (directionEvent) eventBus.emit(`UI:${directionEvent}`, { direction, pressed: true });
|
|
@@ -22226,7 +21919,7 @@ function DPad({
|
|
|
22226
21919
|
},
|
|
22227
21920
|
[directionEvent, eventBus, onDirection]
|
|
22228
21921
|
);
|
|
22229
|
-
const handleRelease =
|
|
21922
|
+
const handleRelease = React82.useCallback(
|
|
22230
21923
|
(direction) => {
|
|
22231
21924
|
setActiveDirections((prev) => {
|
|
22232
21925
|
const next = new Set(prev);
|
|
@@ -23033,8 +22726,8 @@ var init_Menu = __esm({
|
|
|
23033
22726
|
"bottom-end": "bottom-start"
|
|
23034
22727
|
};
|
|
23035
22728
|
const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
|
|
23036
|
-
const triggerChild =
|
|
23037
|
-
const triggerElement =
|
|
22729
|
+
const triggerChild = React82__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
|
|
22730
|
+
const triggerElement = React82__default.cloneElement(
|
|
23038
22731
|
triggerChild,
|
|
23039
22732
|
{
|
|
23040
22733
|
ref: triggerRef,
|
|
@@ -23168,14 +22861,14 @@ function useDataDnd(args) {
|
|
|
23168
22861
|
const isZone = Boolean(dragGroup || accepts || sortable);
|
|
23169
22862
|
const enabled = isZone || Boolean(dndRoot);
|
|
23170
22863
|
const eventBus = useEventBus();
|
|
23171
|
-
const parentRoot =
|
|
22864
|
+
const parentRoot = React82__default.useContext(RootCtx);
|
|
23172
22865
|
const isRoot = enabled && parentRoot === null;
|
|
23173
|
-
const zoneId =
|
|
22866
|
+
const zoneId = React82__default.useId();
|
|
23174
22867
|
const ownGroup = dragGroup ?? accepts ?? zoneId;
|
|
23175
|
-
const [optimisticOrders, setOptimisticOrders] =
|
|
23176
|
-
const optimisticOrdersRef =
|
|
22868
|
+
const [optimisticOrders, setOptimisticOrders] = React82__default.useState(() => /* @__PURE__ */ new Map());
|
|
22869
|
+
const optimisticOrdersRef = React82__default.useRef(optimisticOrders);
|
|
23177
22870
|
optimisticOrdersRef.current = optimisticOrders;
|
|
23178
|
-
const clearOptimisticOrder =
|
|
22871
|
+
const clearOptimisticOrder = React82__default.useCallback((group) => {
|
|
23179
22872
|
setOptimisticOrders((prev) => {
|
|
23180
22873
|
if (!prev.has(group)) return prev;
|
|
23181
22874
|
const next = new Map(prev);
|
|
@@ -23200,7 +22893,7 @@ function useDataDnd(args) {
|
|
|
23200
22893
|
const raw = it[dndItemIdField];
|
|
23201
22894
|
return String(raw ?? `__idx_${idx}`);
|
|
23202
22895
|
}).join("|");
|
|
23203
|
-
const itemIds =
|
|
22896
|
+
const itemIds = React82__default.useMemo(
|
|
23204
22897
|
() => orderedItems.map((it, idx) => {
|
|
23205
22898
|
const raw = it[dndItemIdField];
|
|
23206
22899
|
return raw ?? `__idx_${idx}`;
|
|
@@ -23208,7 +22901,7 @@ function useDataDnd(args) {
|
|
|
23208
22901
|
[itemIdsSignature]
|
|
23209
22902
|
);
|
|
23210
22903
|
const itemsContentSig = items.map((it, idx) => String(it[dndItemIdField] ?? `__${idx}`)).join("|");
|
|
23211
|
-
|
|
22904
|
+
React82__default.useEffect(() => {
|
|
23212
22905
|
const root = isRoot ? null : parentRoot;
|
|
23213
22906
|
if (root) {
|
|
23214
22907
|
root.clearOptimisticOrder(ownGroup);
|
|
@@ -23216,20 +22909,20 @@ function useDataDnd(args) {
|
|
|
23216
22909
|
clearOptimisticOrder(ownGroup);
|
|
23217
22910
|
}
|
|
23218
22911
|
}, [itemsContentSig, ownGroup]);
|
|
23219
|
-
const zonesRef =
|
|
23220
|
-
const registerZone =
|
|
22912
|
+
const zonesRef = React82__default.useRef(/* @__PURE__ */ new Map());
|
|
22913
|
+
const registerZone = React82__default.useCallback((zoneId2, meta2) => {
|
|
23221
22914
|
zonesRef.current.set(zoneId2, meta2);
|
|
23222
22915
|
}, []);
|
|
23223
|
-
const unregisterZone =
|
|
22916
|
+
const unregisterZone = React82__default.useCallback((zoneId2) => {
|
|
23224
22917
|
zonesRef.current.delete(zoneId2);
|
|
23225
22918
|
}, []);
|
|
23226
|
-
const [activeDrag, setActiveDrag] =
|
|
23227
|
-
const [overZoneGroup, setOverZoneGroup] =
|
|
23228
|
-
const meta =
|
|
22919
|
+
const [activeDrag, setActiveDrag] = React82__default.useState(null);
|
|
22920
|
+
const [overZoneGroup, setOverZoneGroup] = React82__default.useState(null);
|
|
22921
|
+
const meta = React82__default.useMemo(
|
|
23229
22922
|
() => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
|
|
23230
22923
|
[ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
|
|
23231
22924
|
);
|
|
23232
|
-
|
|
22925
|
+
React82__default.useEffect(() => {
|
|
23233
22926
|
const target = isRoot ? null : parentRoot;
|
|
23234
22927
|
if (!target) {
|
|
23235
22928
|
zonesRef.current.set(zoneId, meta);
|
|
@@ -23248,7 +22941,7 @@ function useDataDnd(args) {
|
|
|
23248
22941
|
}, [parentRoot, isRoot, zoneId, meta]);
|
|
23249
22942
|
const sensors = useAlmadarDndSensors(true);
|
|
23250
22943
|
const collisionDetection = almadarDndCollisionDetection;
|
|
23251
|
-
const findZoneByItem =
|
|
22944
|
+
const findZoneByItem = React82__default.useCallback(
|
|
23252
22945
|
(id) => {
|
|
23253
22946
|
for (const z of zonesRef.current.values()) {
|
|
23254
22947
|
if (z.itemIds.includes(id)) return z;
|
|
@@ -23257,7 +22950,7 @@ function useDataDnd(args) {
|
|
|
23257
22950
|
},
|
|
23258
22951
|
[]
|
|
23259
22952
|
);
|
|
23260
|
-
|
|
22953
|
+
React82__default.useCallback(
|
|
23261
22954
|
(group) => {
|
|
23262
22955
|
for (const z of zonesRef.current.values()) {
|
|
23263
22956
|
if (z.group === group) return z;
|
|
@@ -23266,7 +22959,7 @@ function useDataDnd(args) {
|
|
|
23266
22959
|
},
|
|
23267
22960
|
[]
|
|
23268
22961
|
);
|
|
23269
|
-
const handleDragEnd =
|
|
22962
|
+
const handleDragEnd = React82__default.useCallback(
|
|
23270
22963
|
(event) => {
|
|
23271
22964
|
const { active, over } = event;
|
|
23272
22965
|
const activeIdStr = String(active.id);
|
|
@@ -23357,8 +23050,8 @@ function useDataDnd(args) {
|
|
|
23357
23050
|
},
|
|
23358
23051
|
[eventBus]
|
|
23359
23052
|
);
|
|
23360
|
-
const sortableData =
|
|
23361
|
-
const SortableItem =
|
|
23053
|
+
const sortableData = React82__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
|
|
23054
|
+
const SortableItem = React82__default.useCallback(
|
|
23362
23055
|
({ id, children }) => {
|
|
23363
23056
|
const {
|
|
23364
23057
|
attributes,
|
|
@@ -23398,7 +23091,7 @@ function useDataDnd(args) {
|
|
|
23398
23091
|
id: droppableId,
|
|
23399
23092
|
data: sortableData
|
|
23400
23093
|
});
|
|
23401
|
-
const ctx =
|
|
23094
|
+
const ctx = React82__default.useContext(RootCtx);
|
|
23402
23095
|
const activeDrag2 = ctx?.activeDrag ?? null;
|
|
23403
23096
|
const overZoneGroup2 = ctx?.overZoneGroup ?? null;
|
|
23404
23097
|
const isThisZoneOver = overZoneGroup2 === ownGroup;
|
|
@@ -23413,7 +23106,7 @@ function useDataDnd(args) {
|
|
|
23413
23106
|
showForeignPlaceholder,
|
|
23414
23107
|
ctxAvailable: ctx != null
|
|
23415
23108
|
});
|
|
23416
|
-
|
|
23109
|
+
React82__default.useEffect(() => {
|
|
23417
23110
|
dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
|
|
23418
23111
|
}, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
|
|
23419
23112
|
return /* @__PURE__ */ jsx(
|
|
@@ -23427,11 +23120,11 @@ function useDataDnd(args) {
|
|
|
23427
23120
|
}
|
|
23428
23121
|
);
|
|
23429
23122
|
};
|
|
23430
|
-
const rootContextValue =
|
|
23123
|
+
const rootContextValue = React82__default.useMemo(
|
|
23431
23124
|
() => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
|
|
23432
23125
|
[registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
|
|
23433
23126
|
);
|
|
23434
|
-
const handleDragStart =
|
|
23127
|
+
const handleDragStart = React82__default.useCallback((event) => {
|
|
23435
23128
|
const sourceZone = findZoneByItem(event.active.id);
|
|
23436
23129
|
const rect = event.active.rect.current.initial;
|
|
23437
23130
|
const height = rect?.height && rect.height > 0 ? rect.height : 64;
|
|
@@ -23450,7 +23143,7 @@ function useDataDnd(args) {
|
|
|
23450
23143
|
isRoot
|
|
23451
23144
|
});
|
|
23452
23145
|
}, [findZoneByItem, isRoot, zoneId]);
|
|
23453
|
-
const handleDragOver =
|
|
23146
|
+
const handleDragOver = React82__default.useCallback((event) => {
|
|
23454
23147
|
const { active, over } = event;
|
|
23455
23148
|
const overData = over?.data?.current;
|
|
23456
23149
|
const overGroup = overData?.dndGroup ?? null;
|
|
@@ -23520,7 +23213,7 @@ function useDataDnd(args) {
|
|
|
23520
23213
|
return next;
|
|
23521
23214
|
});
|
|
23522
23215
|
}, []);
|
|
23523
|
-
const handleDragCancel =
|
|
23216
|
+
const handleDragCancel = React82__default.useCallback((event) => {
|
|
23524
23217
|
setActiveDrag(null);
|
|
23525
23218
|
setOverZoneGroup(null);
|
|
23526
23219
|
dndLog.warn("dragCancel", {
|
|
@@ -23528,12 +23221,12 @@ function useDataDnd(args) {
|
|
|
23528
23221
|
reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
|
|
23529
23222
|
});
|
|
23530
23223
|
}, []);
|
|
23531
|
-
const handleDragEndWithCleanup =
|
|
23224
|
+
const handleDragEndWithCleanup = React82__default.useCallback((event) => {
|
|
23532
23225
|
handleDragEnd(event);
|
|
23533
23226
|
setActiveDrag(null);
|
|
23534
23227
|
setOverZoneGroup(null);
|
|
23535
23228
|
}, [handleDragEnd]);
|
|
23536
|
-
const wrapContainer =
|
|
23229
|
+
const wrapContainer = React82__default.useCallback(
|
|
23537
23230
|
(children) => {
|
|
23538
23231
|
if (!enabled) return children;
|
|
23539
23232
|
const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
|
|
@@ -23587,7 +23280,7 @@ var init_useDataDnd = __esm({
|
|
|
23587
23280
|
init_useAlmadarDndCollision();
|
|
23588
23281
|
init_Box();
|
|
23589
23282
|
dndLog = createLogger("almadar:ui:dnd");
|
|
23590
|
-
RootCtx =
|
|
23283
|
+
RootCtx = React82__default.createContext(null);
|
|
23591
23284
|
}
|
|
23592
23285
|
});
|
|
23593
23286
|
function renderIconInput(icon, props) {
|
|
@@ -24113,7 +23806,7 @@ function DataList({
|
|
|
24113
23806
|
}) {
|
|
24114
23807
|
const eventBus = useEventBus();
|
|
24115
23808
|
const { t } = useTranslate();
|
|
24116
|
-
const [visibleCount, setVisibleCount] =
|
|
23809
|
+
const [visibleCount, setVisibleCount] = React82__default.useState(pageSize || Infinity);
|
|
24117
23810
|
const fieldDefs = fields ?? columns ?? [];
|
|
24118
23811
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
24119
23812
|
const dnd = useDataDnd({
|
|
@@ -24132,7 +23825,7 @@ function DataList({
|
|
|
24132
23825
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
24133
23826
|
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
24134
23827
|
const hasRenderProp = typeof children === "function";
|
|
24135
|
-
|
|
23828
|
+
React82__default.useEffect(() => {
|
|
24136
23829
|
const renderItemTypeOf = typeof schemaRenderItem;
|
|
24137
23830
|
const childrenTypeOf = typeof children;
|
|
24138
23831
|
if (data.length > 0 && !hasRenderProp) {
|
|
@@ -24237,7 +23930,7 @@ function DataList({
|
|
|
24237
23930
|
const items2 = data.map((item) => item);
|
|
24238
23931
|
const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
|
|
24239
23932
|
const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
|
|
24240
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
23933
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React82__default.Fragment, { children: [
|
|
24241
23934
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
|
|
24242
23935
|
group.items.map((itemData, index) => {
|
|
24243
23936
|
const id = itemData.id || `${gi}-${index}`;
|
|
@@ -24378,7 +24071,7 @@ function DataList({
|
|
|
24378
24071
|
className
|
|
24379
24072
|
),
|
|
24380
24073
|
children: [
|
|
24381
|
-
groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
24074
|
+
groups.map((group, gi) => /* @__PURE__ */ jsxs(React82__default.Fragment, { children: [
|
|
24382
24075
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
|
|
24383
24076
|
group.items.map(
|
|
24384
24077
|
(itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
|
|
@@ -25294,7 +24987,7 @@ var init_Grid = __esm({
|
|
|
25294
24987
|
as: Component2 = "div"
|
|
25295
24988
|
}) => {
|
|
25296
24989
|
const mergedStyle = rows2 ? { gridTemplateRows: `repeat(${rows2}, minmax(0, 1fr))`, ...style } : style;
|
|
25297
|
-
return
|
|
24990
|
+
return React82__default.createElement(
|
|
25298
24991
|
Component2,
|
|
25299
24992
|
{
|
|
25300
24993
|
className: cn(
|
|
@@ -25482,8 +25175,8 @@ var init_Popover = __esm({
|
|
|
25482
25175
|
onMouseEnter: handleOpen,
|
|
25483
25176
|
onMouseLeave: handleClose
|
|
25484
25177
|
};
|
|
25485
|
-
const childElement =
|
|
25486
|
-
const triggerElement =
|
|
25178
|
+
const childElement = React82__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
25179
|
+
const triggerElement = React82__default.cloneElement(
|
|
25487
25180
|
childElement,
|
|
25488
25181
|
{
|
|
25489
25182
|
ref: triggerRef,
|
|
@@ -25539,9 +25232,9 @@ function debug(...args) {
|
|
|
25539
25232
|
const [first, ...rest] = args;
|
|
25540
25233
|
const message = typeof first === "string" ? first : "<debug>";
|
|
25541
25234
|
if (rest.length === 0 && typeof first === "string") {
|
|
25542
|
-
|
|
25235
|
+
log9.debug(message);
|
|
25543
25236
|
} else {
|
|
25544
|
-
|
|
25237
|
+
log9.debug(message, { args: rest.length > 0 ? formatArgs(rest) : formatArgs([first]) });
|
|
25545
25238
|
}
|
|
25546
25239
|
}
|
|
25547
25240
|
function debugGroup(label) {
|
|
@@ -25569,11 +25262,11 @@ function toLogMetaValue(v) {
|
|
|
25569
25262
|
}
|
|
25570
25263
|
return String(v);
|
|
25571
25264
|
}
|
|
25572
|
-
var NAMESPACE,
|
|
25265
|
+
var NAMESPACE, log9;
|
|
25573
25266
|
var init_debug = __esm({
|
|
25574
25267
|
"lib/debug.ts"() {
|
|
25575
25268
|
NAMESPACE = "almadar:ui:debug";
|
|
25576
|
-
|
|
25269
|
+
log9 = createLogger(NAMESPACE);
|
|
25577
25270
|
createLogger("almadar:ui:debug:input");
|
|
25578
25271
|
createLogger("almadar:ui:debug:collision");
|
|
25579
25272
|
createLogger("almadar:ui:debug:physics");
|
|
@@ -26073,8 +25766,8 @@ var init_Tooltip = __esm({
|
|
|
26073
25766
|
if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
|
|
26074
25767
|
};
|
|
26075
25768
|
}, []);
|
|
26076
|
-
const triggerElement =
|
|
26077
|
-
const trigger =
|
|
25769
|
+
const triggerElement = React82__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
25770
|
+
const trigger = React82__default.cloneElement(triggerElement, {
|
|
26078
25771
|
ref: triggerRef,
|
|
26079
25772
|
onMouseEnter: handleMouseEnter,
|
|
26080
25773
|
onMouseLeave: handleMouseLeave,
|
|
@@ -26160,7 +25853,7 @@ var init_WizardProgress = __esm({
|
|
|
26160
25853
|
children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
|
|
26161
25854
|
const isActive = index === currentStep;
|
|
26162
25855
|
const isCompleted = index < currentStep;
|
|
26163
|
-
return /* @__PURE__ */ jsxs(
|
|
25856
|
+
return /* @__PURE__ */ jsxs(React82__default.Fragment, { children: [
|
|
26164
25857
|
/* @__PURE__ */ jsx(
|
|
26165
25858
|
"button",
|
|
26166
25859
|
{
|
|
@@ -27224,7 +26917,7 @@ function InventoryGrid({
|
|
|
27224
26917
|
const eventBus = useEventBus();
|
|
27225
26918
|
const slotCount = totalSlots ?? items.length;
|
|
27226
26919
|
const emptySlotCount = Math.max(0, slotCount - items.length);
|
|
27227
|
-
const handleSelect =
|
|
26920
|
+
const handleSelect = React82.useCallback(
|
|
27228
26921
|
(id) => {
|
|
27229
26922
|
onSelect?.(id);
|
|
27230
26923
|
if (selectEvent) {
|
|
@@ -27458,31 +27151,31 @@ function GameCanvas2D({
|
|
|
27458
27151
|
assetBaseUrl = "https://almadar-kflow-assets.web.app/shared/",
|
|
27459
27152
|
className
|
|
27460
27153
|
}) {
|
|
27461
|
-
const canvasRef =
|
|
27462
|
-
const rafRef =
|
|
27463
|
-
const frameRef =
|
|
27464
|
-
const lastTimeRef =
|
|
27465
|
-
const imageCache =
|
|
27154
|
+
const canvasRef = React82.useRef(null);
|
|
27155
|
+
const rafRef = React82.useRef(0);
|
|
27156
|
+
const frameRef = React82.useRef(0);
|
|
27157
|
+
const lastTimeRef = React82.useRef(0);
|
|
27158
|
+
const imageCache = React82.useRef(/* @__PURE__ */ new Map());
|
|
27466
27159
|
const emit = useEmitEvent();
|
|
27467
|
-
const onDrawRef =
|
|
27160
|
+
const onDrawRef = React82.useRef(onDraw);
|
|
27468
27161
|
onDrawRef.current = onDraw;
|
|
27469
|
-
const onTickRef =
|
|
27162
|
+
const onTickRef = React82.useRef(onTick);
|
|
27470
27163
|
onTickRef.current = onTick;
|
|
27471
|
-
const tickEventRef =
|
|
27164
|
+
const tickEventRef = React82.useRef(tickEvent);
|
|
27472
27165
|
tickEventRef.current = tickEvent;
|
|
27473
|
-
const drawEventRef =
|
|
27166
|
+
const drawEventRef = React82.useRef(drawEvent);
|
|
27474
27167
|
drawEventRef.current = drawEvent;
|
|
27475
|
-
const emitRef =
|
|
27168
|
+
const emitRef = React82.useRef(emit);
|
|
27476
27169
|
emitRef.current = emit;
|
|
27477
|
-
const assetBaseUrlRef =
|
|
27170
|
+
const assetBaseUrlRef = React82.useRef(assetBaseUrl);
|
|
27478
27171
|
assetBaseUrlRef.current = assetBaseUrl;
|
|
27479
|
-
const backgroundImageRef =
|
|
27172
|
+
const backgroundImageRef = React82.useRef(backgroundImage);
|
|
27480
27173
|
backgroundImageRef.current = backgroundImage;
|
|
27481
|
-
const widthRef =
|
|
27174
|
+
const widthRef = React82.useRef(width);
|
|
27482
27175
|
widthRef.current = width;
|
|
27483
|
-
const heightRef =
|
|
27176
|
+
const heightRef = React82.useRef(height);
|
|
27484
27177
|
heightRef.current = height;
|
|
27485
|
-
const loadImage =
|
|
27178
|
+
const loadImage = React82.useCallback((url) => {
|
|
27486
27179
|
const fullUrl = url.startsWith("http") ? url : `${assetBaseUrlRef.current}${url}`;
|
|
27487
27180
|
const cached = imageCache.current.get(fullUrl);
|
|
27488
27181
|
if (cached?.complete && cached.naturalWidth > 0) return cached;
|
|
@@ -27494,7 +27187,7 @@ function GameCanvas2D({
|
|
|
27494
27187
|
}
|
|
27495
27188
|
return null;
|
|
27496
27189
|
}, []);
|
|
27497
|
-
|
|
27190
|
+
React82.useEffect(() => {
|
|
27498
27191
|
const canvas = canvasRef.current;
|
|
27499
27192
|
if (!canvas) return;
|
|
27500
27193
|
const ctx = canvas.getContext("2d");
|
|
@@ -27806,7 +27499,7 @@ function TurnPanel({
|
|
|
27806
27499
|
className
|
|
27807
27500
|
}) {
|
|
27808
27501
|
const eventBus = useEventBus();
|
|
27809
|
-
const handleAction =
|
|
27502
|
+
const handleAction = React82.useCallback(
|
|
27810
27503
|
(event) => {
|
|
27811
27504
|
if (event) {
|
|
27812
27505
|
eventBus.emit(event, { turn: currentTurn, phase, activeTeam });
|
|
@@ -27975,7 +27668,7 @@ function UnitCommandBar({
|
|
|
27975
27668
|
className
|
|
27976
27669
|
}) {
|
|
27977
27670
|
const eventBus = useEventBus();
|
|
27978
|
-
const handleCommand =
|
|
27671
|
+
const handleCommand = React82.useCallback(
|
|
27979
27672
|
(event) => {
|
|
27980
27673
|
if (event) {
|
|
27981
27674
|
eventBus.emit(event, { unitId: selectedUnitId });
|
|
@@ -28489,7 +28182,7 @@ function GameMenu({
|
|
|
28489
28182
|
} catch {
|
|
28490
28183
|
}
|
|
28491
28184
|
const eventBus = eventBusProp || eventBusFromHook;
|
|
28492
|
-
const handleOptionClick =
|
|
28185
|
+
const handleOptionClick = React82.useCallback(
|
|
28493
28186
|
(option) => {
|
|
28494
28187
|
if (option.event && eventBus) {
|
|
28495
28188
|
eventBus.emit(`UI:${option.event}`, { option });
|
|
@@ -28608,7 +28301,7 @@ function GameOverScreen({
|
|
|
28608
28301
|
} catch {
|
|
28609
28302
|
}
|
|
28610
28303
|
const eventBus = eventBusProp || eventBusFromHook;
|
|
28611
|
-
const handleActionClick =
|
|
28304
|
+
const handleActionClick = React82.useCallback(
|
|
28612
28305
|
(action) => {
|
|
28613
28306
|
if (action.event && eventBus) {
|
|
28614
28307
|
eventBus.emit(`UI:${action.event}`, { action });
|
|
@@ -29497,13 +29190,13 @@ var init_MapView = __esm({
|
|
|
29497
29190
|
shadowSize: [41, 41]
|
|
29498
29191
|
});
|
|
29499
29192
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
29500
|
-
const { useEffect:
|
|
29193
|
+
const { useEffect: useEffect78, useRef: useRef74, useCallback: useCallback117, useState: useState108 } = React82__default;
|
|
29501
29194
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
29502
29195
|
const { useEventBus: useEventBus3 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
29503
29196
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
29504
29197
|
const map = useMap();
|
|
29505
29198
|
const prevRef = useRef74({ centerLat, centerLng, zoom });
|
|
29506
|
-
|
|
29199
|
+
useEffect78(() => {
|
|
29507
29200
|
const prev = prevRef.current;
|
|
29508
29201
|
if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
|
|
29509
29202
|
map.setView([centerLat, centerLng], zoom);
|
|
@@ -29514,7 +29207,7 @@ var init_MapView = __esm({
|
|
|
29514
29207
|
}
|
|
29515
29208
|
function MapClickHandler({ onMapClick }) {
|
|
29516
29209
|
const map = useMap();
|
|
29517
|
-
|
|
29210
|
+
useEffect78(() => {
|
|
29518
29211
|
if (!onMapClick) return;
|
|
29519
29212
|
const handler = (e) => {
|
|
29520
29213
|
onMapClick(e.latlng.lat, e.latlng.lng);
|
|
@@ -29542,8 +29235,8 @@ var init_MapView = __esm({
|
|
|
29542
29235
|
showAttribution = true
|
|
29543
29236
|
}) {
|
|
29544
29237
|
const eventBus = useEventBus3();
|
|
29545
|
-
const [clickedPosition, setClickedPosition] =
|
|
29546
|
-
const handleMapClick =
|
|
29238
|
+
const [clickedPosition, setClickedPosition] = useState108(null);
|
|
29239
|
+
const handleMapClick = useCallback117((lat, lng) => {
|
|
29547
29240
|
if (showClickedPin) {
|
|
29548
29241
|
setClickedPosition({ lat, lng });
|
|
29549
29242
|
}
|
|
@@ -29552,7 +29245,7 @@ var init_MapView = __esm({
|
|
|
29552
29245
|
eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
|
|
29553
29246
|
}
|
|
29554
29247
|
}, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
|
|
29555
|
-
const handleMarkerClick =
|
|
29248
|
+
const handleMarkerClick = useCallback117((marker) => {
|
|
29556
29249
|
onMarkerClick?.(marker);
|
|
29557
29250
|
if (markerClickEvent) {
|
|
29558
29251
|
eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
|
|
@@ -30403,8 +30096,8 @@ function TableView({
|
|
|
30403
30096
|
}) {
|
|
30404
30097
|
const eventBus = useEventBus();
|
|
30405
30098
|
const { t } = useTranslate();
|
|
30406
|
-
const [visibleCount, setVisibleCount] =
|
|
30407
|
-
const [localSelected, setLocalSelected] =
|
|
30099
|
+
const [visibleCount, setVisibleCount] = React82__default.useState(pageSize > 0 ? pageSize : Infinity);
|
|
30100
|
+
const [localSelected, setLocalSelected] = React82__default.useState(/* @__PURE__ */ new Set());
|
|
30408
30101
|
const colDefs = columns ?? fields ?? [];
|
|
30409
30102
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
30410
30103
|
const dnd = useDataDnd({
|
|
@@ -30599,12 +30292,12 @@ function TableView({
|
|
|
30599
30292
|
]
|
|
30600
30293
|
}
|
|
30601
30294
|
);
|
|
30602
|
-
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(
|
|
30295
|
+
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React82__default.Fragment, { children: rowInner }, id);
|
|
30603
30296
|
};
|
|
30604
30297
|
const items = data.map((row) => row);
|
|
30605
30298
|
const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
|
|
30606
30299
|
let runningIndex = 0;
|
|
30607
|
-
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
30300
|
+
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React82__default.Fragment, { children: [
|
|
30608
30301
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
|
|
30609
30302
|
group.items.map((row) => renderRow(row, runningIndex++))
|
|
30610
30303
|
] }, gi)) });
|
|
@@ -31961,7 +31654,7 @@ var init_StepFlow = __esm({
|
|
|
31961
31654
|
className
|
|
31962
31655
|
}) => {
|
|
31963
31656
|
if (orientation === "vertical") {
|
|
31964
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(
|
|
31657
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React82__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
|
|
31965
31658
|
/* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
|
|
31966
31659
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
31967
31660
|
showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
|
|
@@ -31972,7 +31665,7 @@ var init_StepFlow = __esm({
|
|
|
31972
31665
|
] })
|
|
31973
31666
|
] }) }, index)) });
|
|
31974
31667
|
}
|
|
31975
|
-
return /* @__PURE__ */ jsx(Box, { className: cn("w-full flex flex-col md:flex-row items-start gap-0", className), children: steps.map((step, index) => /* @__PURE__ */ jsxs(
|
|
31668
|
+
return /* @__PURE__ */ jsx(Box, { className: cn("w-full flex flex-col md:flex-row items-start gap-0", className), children: steps.map((step, index) => /* @__PURE__ */ jsxs(React82__default.Fragment, { children: [
|
|
31976
31669
|
/* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
|
|
31977
31670
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
31978
31671
|
/* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
|
|
@@ -32957,7 +32650,7 @@ var init_LikertScale = __esm({
|
|
|
32957
32650
|
md: "text-base",
|
|
32958
32651
|
lg: "text-lg"
|
|
32959
32652
|
};
|
|
32960
|
-
LikertScale =
|
|
32653
|
+
LikertScale = React82__default.forwardRef(
|
|
32961
32654
|
({
|
|
32962
32655
|
question,
|
|
32963
32656
|
options = DEFAULT_LIKERT_OPTIONS,
|
|
@@ -32969,7 +32662,7 @@ var init_LikertScale = __esm({
|
|
|
32969
32662
|
variant = "radios",
|
|
32970
32663
|
className
|
|
32971
32664
|
}, ref) => {
|
|
32972
|
-
const groupId =
|
|
32665
|
+
const groupId = React82__default.useId();
|
|
32973
32666
|
const eventBus = useEventBus();
|
|
32974
32667
|
const handleSelect = useCallback(
|
|
32975
32668
|
(next) => {
|
|
@@ -35251,7 +34944,7 @@ var init_DocBreadcrumb = __esm({
|
|
|
35251
34944
|
"aria-label": t("aria.breadcrumb"),
|
|
35252
34945
|
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
|
|
35253
34946
|
const isLast = idx === items.length - 1;
|
|
35254
|
-
return /* @__PURE__ */ jsxs(
|
|
34947
|
+
return /* @__PURE__ */ jsxs(React82__default.Fragment, { children: [
|
|
35255
34948
|
idx > 0 && /* @__PURE__ */ jsx(
|
|
35256
34949
|
Icon,
|
|
35257
34950
|
{
|
|
@@ -36120,7 +35813,7 @@ var init_MiniStateMachine = __esm({
|
|
|
36120
35813
|
const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
|
|
36121
35814
|
const tc = transitionCounts[s.name] ?? 0;
|
|
36122
35815
|
const role = getStateRole(s.name, s.isInitial, s.isTerminal, tc, maxTC);
|
|
36123
|
-
return /* @__PURE__ */ jsxs(
|
|
35816
|
+
return /* @__PURE__ */ jsxs(React82__default.Fragment, { children: [
|
|
36124
35817
|
/* @__PURE__ */ jsx(
|
|
36125
35818
|
AvlState,
|
|
36126
35819
|
{
|
|
@@ -36324,7 +36017,7 @@ var init_PageHeader = __esm({
|
|
|
36324
36017
|
info: "bg-info/10 text-info"
|
|
36325
36018
|
};
|
|
36326
36019
|
return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
|
|
36327
|
-
breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */ jsx(Box, { as: "nav", className: "mb-4", children: /* @__PURE__ */ jsx(Box, { as: "ol", className: "flex items-center gap-2 text-sm", children: breadcrumbs.map((crumb, idx) => /* @__PURE__ */ jsxs(
|
|
36020
|
+
breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */ jsx(Box, { as: "nav", className: "mb-4", children: /* @__PURE__ */ jsx(Box, { as: "ol", className: "flex items-center gap-2 text-sm", children: breadcrumbs.map((crumb, idx) => /* @__PURE__ */ jsxs(React82__default.Fragment, { children: [
|
|
36328
36021
|
idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
|
|
36329
36022
|
crumb.href ? /* @__PURE__ */ jsx(
|
|
36330
36023
|
"a",
|
|
@@ -37053,7 +36746,7 @@ var init_WizardContainer = __esm({
|
|
|
37053
36746
|
const isCompleted = index < currentStep;
|
|
37054
36747
|
const stepKey = step.id ?? step.tabId ?? `step-${index}`;
|
|
37055
36748
|
const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
|
|
37056
|
-
return /* @__PURE__ */ jsxs(
|
|
36749
|
+
return /* @__PURE__ */ jsxs(React82__default.Fragment, { children: [
|
|
37057
36750
|
/* @__PURE__ */ jsx(
|
|
37058
36751
|
Button,
|
|
37059
36752
|
{
|
|
@@ -39388,7 +39081,7 @@ var init_DetailPanel = __esm({
|
|
|
39388
39081
|
}
|
|
39389
39082
|
});
|
|
39390
39083
|
function extractTitle(children) {
|
|
39391
|
-
if (!
|
|
39084
|
+
if (!React82__default.isValidElement(children)) return void 0;
|
|
39392
39085
|
const props = children.props;
|
|
39393
39086
|
if (typeof props.title === "string") {
|
|
39394
39087
|
return props.title;
|
|
@@ -39443,7 +39136,7 @@ function LinearView({
|
|
|
39443
39136
|
/* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
|
|
39444
39137
|
const isDone = i < currentIdx;
|
|
39445
39138
|
const isCurrent = i === currentIdx;
|
|
39446
|
-
return /* @__PURE__ */ jsxs(
|
|
39139
|
+
return /* @__PURE__ */ jsxs(React82__default.Fragment, { children: [
|
|
39447
39140
|
i > 0 && /* @__PURE__ */ jsx(
|
|
39448
39141
|
Typography,
|
|
39449
39142
|
{
|
|
@@ -40393,12 +40086,12 @@ var init_Form = __esm({
|
|
|
40393
40086
|
const isSchemaEntity = isOrbitalEntitySchema(entity);
|
|
40394
40087
|
const resolvedEntity = isSchemaEntity ? entity : void 0;
|
|
40395
40088
|
const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
|
|
40396
|
-
const normalizedInitialData =
|
|
40089
|
+
const normalizedInitialData = React82__default.useMemo(() => {
|
|
40397
40090
|
const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
|
|
40398
40091
|
const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
|
|
40399
40092
|
return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
|
|
40400
40093
|
}, [entity, initialData]);
|
|
40401
|
-
const entityDerivedFields =
|
|
40094
|
+
const entityDerivedFields = React82__default.useMemo(() => {
|
|
40402
40095
|
if (fields && fields.length > 0) return void 0;
|
|
40403
40096
|
if (!resolvedEntity) return void 0;
|
|
40404
40097
|
return resolvedEntity.fields.map(
|
|
@@ -40418,16 +40111,16 @@ var init_Form = __esm({
|
|
|
40418
40111
|
const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
|
|
40419
40112
|
const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
|
|
40420
40113
|
const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
|
|
40421
|
-
const [formData, setFormData] =
|
|
40114
|
+
const [formData, setFormData] = React82__default.useState(
|
|
40422
40115
|
normalizedInitialData
|
|
40423
40116
|
);
|
|
40424
|
-
const [collapsedSections, setCollapsedSections] =
|
|
40117
|
+
const [collapsedSections, setCollapsedSections] = React82__default.useState(
|
|
40425
40118
|
/* @__PURE__ */ new Set()
|
|
40426
40119
|
);
|
|
40427
|
-
const [submitError, setSubmitError] =
|
|
40428
|
-
const formRef =
|
|
40120
|
+
const [submitError, setSubmitError] = React82__default.useState(null);
|
|
40121
|
+
const formRef = React82__default.useRef(null);
|
|
40429
40122
|
const formMode = props.mode;
|
|
40430
|
-
const mountedRef =
|
|
40123
|
+
const mountedRef = React82__default.useRef(false);
|
|
40431
40124
|
if (!mountedRef.current) {
|
|
40432
40125
|
mountedRef.current = true;
|
|
40433
40126
|
debug("forms", "mount", {
|
|
@@ -40440,7 +40133,7 @@ var init_Form = __esm({
|
|
|
40440
40133
|
});
|
|
40441
40134
|
}
|
|
40442
40135
|
const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
|
|
40443
|
-
const evalContext =
|
|
40136
|
+
const evalContext = React82__default.useMemo(
|
|
40444
40137
|
() => ({
|
|
40445
40138
|
formValues: formData,
|
|
40446
40139
|
globalVariables: externalContext?.globalVariables ?? {},
|
|
@@ -40449,7 +40142,7 @@ var init_Form = __esm({
|
|
|
40449
40142
|
}),
|
|
40450
40143
|
[formData, externalContext]
|
|
40451
40144
|
);
|
|
40452
|
-
|
|
40145
|
+
React82__default.useEffect(() => {
|
|
40453
40146
|
debug("forms", "initialData-sync", {
|
|
40454
40147
|
mode: formMode,
|
|
40455
40148
|
normalizedInitialData,
|
|
@@ -40460,7 +40153,7 @@ var init_Form = __esm({
|
|
|
40460
40153
|
setFormData(normalizedInitialData);
|
|
40461
40154
|
}
|
|
40462
40155
|
}, [normalizedInitialData]);
|
|
40463
|
-
const processCalculations =
|
|
40156
|
+
const processCalculations = React82__default.useCallback(
|
|
40464
40157
|
(changedFieldId, newFormData) => {
|
|
40465
40158
|
if (!hiddenCalculations.length) return;
|
|
40466
40159
|
const context = {
|
|
@@ -40485,7 +40178,7 @@ var init_Form = __esm({
|
|
|
40485
40178
|
},
|
|
40486
40179
|
[hiddenCalculations, externalContext, eventBus]
|
|
40487
40180
|
);
|
|
40488
|
-
const checkViolations =
|
|
40181
|
+
const checkViolations = React82__default.useCallback(
|
|
40489
40182
|
(changedFieldId, newFormData) => {
|
|
40490
40183
|
if (!violationTriggers.length) return;
|
|
40491
40184
|
const context = {
|
|
@@ -40523,7 +40216,7 @@ var init_Form = __esm({
|
|
|
40523
40216
|
processCalculations(name, newFormData);
|
|
40524
40217
|
checkViolations(name, newFormData);
|
|
40525
40218
|
};
|
|
40526
|
-
const isFieldVisible =
|
|
40219
|
+
const isFieldVisible = React82__default.useCallback(
|
|
40527
40220
|
(fieldName) => {
|
|
40528
40221
|
const condition = conditionalFields[fieldName];
|
|
40529
40222
|
if (!condition) return true;
|
|
@@ -40531,7 +40224,7 @@ var init_Form = __esm({
|
|
|
40531
40224
|
},
|
|
40532
40225
|
[conditionalFields, evalContext]
|
|
40533
40226
|
);
|
|
40534
|
-
const isSectionVisible =
|
|
40227
|
+
const isSectionVisible = React82__default.useCallback(
|
|
40535
40228
|
(section) => {
|
|
40536
40229
|
if (!section.condition) return true;
|
|
40537
40230
|
return Boolean(evaluateFormExpression(section.condition, evalContext));
|
|
@@ -40607,7 +40300,7 @@ var init_Form = __esm({
|
|
|
40607
40300
|
eventBus.emit(`UI:${onCancel}`);
|
|
40608
40301
|
}
|
|
40609
40302
|
};
|
|
40610
|
-
const renderField =
|
|
40303
|
+
const renderField = React82__default.useCallback(
|
|
40611
40304
|
(field) => {
|
|
40612
40305
|
const fieldName = field.name || field.field;
|
|
40613
40306
|
if (!fieldName) return null;
|
|
@@ -40628,7 +40321,7 @@ var init_Form = __esm({
|
|
|
40628
40321
|
[formData, isFieldVisible, relationsData, relationsLoading, isLoading]
|
|
40629
40322
|
);
|
|
40630
40323
|
const effectiveFields = entityDerivedFields ?? fields;
|
|
40631
|
-
const normalizedFields =
|
|
40324
|
+
const normalizedFields = React82__default.useMemo(() => {
|
|
40632
40325
|
if (!effectiveFields || effectiveFields.length === 0) return [];
|
|
40633
40326
|
return effectiveFields.map((field) => {
|
|
40634
40327
|
if (typeof field === "string") {
|
|
@@ -40651,7 +40344,7 @@ var init_Form = __esm({
|
|
|
40651
40344
|
return field;
|
|
40652
40345
|
});
|
|
40653
40346
|
}, [effectiveFields, resolvedEntity]);
|
|
40654
|
-
const schemaFields =
|
|
40347
|
+
const schemaFields = React82__default.useMemo(() => {
|
|
40655
40348
|
if (normalizedFields.length === 0) return null;
|
|
40656
40349
|
if (isDebugEnabled()) {
|
|
40657
40350
|
debugGroup(`Form: ${entityName || "unknown"}`);
|
|
@@ -40661,7 +40354,7 @@ var init_Form = __esm({
|
|
|
40661
40354
|
}
|
|
40662
40355
|
return normalizedFields.map(renderField).filter(Boolean);
|
|
40663
40356
|
}, [normalizedFields, renderField, entityName, conditionalFields]);
|
|
40664
|
-
const sectionElements =
|
|
40357
|
+
const sectionElements = React82__default.useMemo(() => {
|
|
40665
40358
|
if (!sections || sections.length === 0) return null;
|
|
40666
40359
|
return sections.map((section) => {
|
|
40667
40360
|
if (!isSectionVisible(section)) {
|
|
@@ -41831,11 +41524,11 @@ var init_Canvas3DErrorBoundary = __esm({
|
|
|
41831
41524
|
"components/game/molecules/three/components/Canvas3DErrorBoundary.css"() {
|
|
41832
41525
|
}
|
|
41833
41526
|
});
|
|
41834
|
-
var
|
|
41527
|
+
var log10, Canvas3DErrorBoundary;
|
|
41835
41528
|
var init_Canvas3DErrorBoundary2 = __esm({
|
|
41836
41529
|
"components/game/molecules/three/components/Canvas3DErrorBoundary.tsx"() {
|
|
41837
41530
|
init_Canvas3DErrorBoundary();
|
|
41838
|
-
|
|
41531
|
+
log10 = createLogger("almadar:ui:game:canvas3d:error-boundary");
|
|
41839
41532
|
Canvas3DErrorBoundary = class extends Component {
|
|
41840
41533
|
constructor(props) {
|
|
41841
41534
|
super(props);
|
|
@@ -41863,8 +41556,8 @@ var init_Canvas3DErrorBoundary2 = __esm({
|
|
|
41863
41556
|
componentDidCatch(error, errorInfo) {
|
|
41864
41557
|
this.setState({ errorInfo });
|
|
41865
41558
|
this.props.onError?.(error, errorInfo);
|
|
41866
|
-
|
|
41867
|
-
|
|
41559
|
+
log10.error("Error caught", { error });
|
|
41560
|
+
log10.error("Component stack", { componentStack: errorInfo.componentStack ?? "<none>" });
|
|
41868
41561
|
}
|
|
41869
41562
|
render() {
|
|
41870
41563
|
if (this.state.hasError) {
|
|
@@ -41927,7 +41620,7 @@ function useGLTFModel(url, resourceBasePath) {
|
|
|
41927
41620
|
setState({ model: null, isLoading: false, error: null });
|
|
41928
41621
|
return;
|
|
41929
41622
|
}
|
|
41930
|
-
|
|
41623
|
+
log11.debug("Loading", { url });
|
|
41931
41624
|
setState((prev) => ({ ...prev, isLoading: true, error: null }));
|
|
41932
41625
|
const assetRoot = resourceBasePath || detectAssetRoot2(url);
|
|
41933
41626
|
const loader = new GLTFLoader$1();
|
|
@@ -41935,7 +41628,7 @@ function useGLTFModel(url, resourceBasePath) {
|
|
|
41935
41628
|
loader.load(
|
|
41936
41629
|
url,
|
|
41937
41630
|
(gltf) => {
|
|
41938
|
-
|
|
41631
|
+
log11.debug("Loaded", { url });
|
|
41939
41632
|
setState({
|
|
41940
41633
|
model: gltf.scene,
|
|
41941
41634
|
isLoading: false,
|
|
@@ -41944,7 +41637,7 @@ function useGLTFModel(url, resourceBasePath) {
|
|
|
41944
41637
|
},
|
|
41945
41638
|
void 0,
|
|
41946
41639
|
(err) => {
|
|
41947
|
-
|
|
41640
|
+
log11.warn("Failed", { url, error: err instanceof Error ? err : String(err) });
|
|
41948
41641
|
setState({
|
|
41949
41642
|
model: null,
|
|
41950
41643
|
isLoading: false,
|
|
@@ -42060,11 +41753,11 @@ function ModelLoader({
|
|
|
42060
41753
|
}
|
|
42061
41754
|
);
|
|
42062
41755
|
}
|
|
42063
|
-
var
|
|
41756
|
+
var log11;
|
|
42064
41757
|
var init_ModelLoader = __esm({
|
|
42065
41758
|
"components/game/molecules/three/components/ModelLoader.tsx"() {
|
|
42066
41759
|
"use client";
|
|
42067
|
-
|
|
41760
|
+
log11 = createLogger("almadar:ui:game:model-loader");
|
|
42068
41761
|
}
|
|
42069
41762
|
});
|
|
42070
41763
|
|
|
@@ -43498,7 +43191,7 @@ var init_List = __esm({
|
|
|
43498
43191
|
if (entity && typeof entity === "object" && "id" in entity) return [entity];
|
|
43499
43192
|
return [];
|
|
43500
43193
|
}, [entity]);
|
|
43501
|
-
const getItemActions =
|
|
43194
|
+
const getItemActions = React82__default.useCallback(
|
|
43502
43195
|
(item) => {
|
|
43503
43196
|
if (!itemActions) return [];
|
|
43504
43197
|
if (typeof itemActions === "function") {
|
|
@@ -43974,7 +43667,7 @@ var init_MediaGallery = __esm({
|
|
|
43974
43667
|
[selectable, selectedItems, selectionEvent, eventBus]
|
|
43975
43668
|
);
|
|
43976
43669
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
43977
|
-
const items =
|
|
43670
|
+
const items = React82__default.useMemo(() => {
|
|
43978
43671
|
if (propItems) return propItems;
|
|
43979
43672
|
if (entityData.length === 0) return [];
|
|
43980
43673
|
return entityData.map((record, idx) => ({
|
|
@@ -44135,7 +43828,7 @@ var init_MediaGallery = __esm({
|
|
|
44135
43828
|
}
|
|
44136
43829
|
});
|
|
44137
43830
|
function extractTitle2(children) {
|
|
44138
|
-
if (!
|
|
43831
|
+
if (!React82__default.isValidElement(children)) return void 0;
|
|
44139
43832
|
const props = children.props;
|
|
44140
43833
|
if (typeof props.title === "string") {
|
|
44141
43834
|
return props.title;
|
|
@@ -45140,7 +44833,7 @@ var init_debugRegistry = __esm({
|
|
|
45140
44833
|
}
|
|
45141
44834
|
});
|
|
45142
44835
|
function useDebugData() {
|
|
45143
|
-
const [data, setData] =
|
|
44836
|
+
const [data, setData] = React82.useState(() => ({
|
|
45144
44837
|
traits: [],
|
|
45145
44838
|
ticks: [],
|
|
45146
44839
|
guards: [],
|
|
@@ -45154,7 +44847,7 @@ function useDebugData() {
|
|
|
45154
44847
|
},
|
|
45155
44848
|
lastUpdate: Date.now()
|
|
45156
44849
|
}));
|
|
45157
|
-
|
|
44850
|
+
React82.useEffect(() => {
|
|
45158
44851
|
const updateData = () => {
|
|
45159
44852
|
setData({
|
|
45160
44853
|
traits: getAllTraits(),
|
|
@@ -45263,12 +44956,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
|
|
|
45263
44956
|
return positions;
|
|
45264
44957
|
}
|
|
45265
44958
|
function WalkMinimap() {
|
|
45266
|
-
const [walkStep, setWalkStep] =
|
|
45267
|
-
const [traits2, setTraits] =
|
|
45268
|
-
const [coveredEdges, setCoveredEdges] =
|
|
45269
|
-
const [completedTraits, setCompletedTraits] =
|
|
45270
|
-
const prevTraitRef =
|
|
45271
|
-
|
|
44959
|
+
const [walkStep, setWalkStep] = React82.useState(null);
|
|
44960
|
+
const [traits2, setTraits] = React82.useState([]);
|
|
44961
|
+
const [coveredEdges, setCoveredEdges] = React82.useState([]);
|
|
44962
|
+
const [completedTraits, setCompletedTraits] = React82.useState(/* @__PURE__ */ new Set());
|
|
44963
|
+
const prevTraitRef = React82.useRef(null);
|
|
44964
|
+
React82.useEffect(() => {
|
|
45272
44965
|
const interval = setInterval(() => {
|
|
45273
44966
|
const w = window;
|
|
45274
44967
|
const step = w.__orbitalWalkStep;
|
|
@@ -45704,15 +45397,15 @@ var init_EntitiesTab = __esm({
|
|
|
45704
45397
|
});
|
|
45705
45398
|
function EventFlowTab({ events: events2 }) {
|
|
45706
45399
|
const { t } = useTranslate();
|
|
45707
|
-
const [filter, setFilter] =
|
|
45708
|
-
const containerRef =
|
|
45709
|
-
const [autoScroll, setAutoScroll] =
|
|
45710
|
-
|
|
45400
|
+
const [filter, setFilter] = React82.useState("all");
|
|
45401
|
+
const containerRef = React82.useRef(null);
|
|
45402
|
+
const [autoScroll, setAutoScroll] = React82.useState(true);
|
|
45403
|
+
React82.useEffect(() => {
|
|
45711
45404
|
if (autoScroll && containerRef.current) {
|
|
45712
45405
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
45713
45406
|
}
|
|
45714
45407
|
}, [events2.length, autoScroll]);
|
|
45715
|
-
const filteredEvents =
|
|
45408
|
+
const filteredEvents = React82.useMemo(() => {
|
|
45716
45409
|
if (filter === "all") return events2;
|
|
45717
45410
|
return events2.filter((e) => e.type === filter);
|
|
45718
45411
|
}, [events2, filter]);
|
|
@@ -45828,7 +45521,7 @@ var init_EventFlowTab = __esm({
|
|
|
45828
45521
|
});
|
|
45829
45522
|
function GuardsPanel({ guards }) {
|
|
45830
45523
|
const { t } = useTranslate();
|
|
45831
|
-
const [filter, setFilter] =
|
|
45524
|
+
const [filter, setFilter] = React82.useState("all");
|
|
45832
45525
|
if (guards.length === 0) {
|
|
45833
45526
|
return /* @__PURE__ */ jsx(
|
|
45834
45527
|
EmptyState,
|
|
@@ -45841,7 +45534,7 @@ function GuardsPanel({ guards }) {
|
|
|
45841
45534
|
}
|
|
45842
45535
|
const passedCount = guards.filter((g) => g.result).length;
|
|
45843
45536
|
const failedCount = guards.length - passedCount;
|
|
45844
|
-
const filteredGuards =
|
|
45537
|
+
const filteredGuards = React82.useMemo(() => {
|
|
45845
45538
|
if (filter === "all") return guards;
|
|
45846
45539
|
if (filter === "passed") return guards.filter((g) => g.result);
|
|
45847
45540
|
return guards.filter((g) => !g.result);
|
|
@@ -46004,10 +45697,10 @@ function EffectBadge({ effect }) {
|
|
|
46004
45697
|
}
|
|
46005
45698
|
function TransitionTimeline({ transitions }) {
|
|
46006
45699
|
const { t } = useTranslate();
|
|
46007
|
-
const containerRef =
|
|
46008
|
-
const [autoScroll, setAutoScroll] =
|
|
46009
|
-
const [expandedId, setExpandedId] =
|
|
46010
|
-
|
|
45700
|
+
const containerRef = React82.useRef(null);
|
|
45701
|
+
const [autoScroll, setAutoScroll] = React82.useState(true);
|
|
45702
|
+
const [expandedId, setExpandedId] = React82.useState(null);
|
|
45703
|
+
React82.useEffect(() => {
|
|
46011
45704
|
if (autoScroll && containerRef.current) {
|
|
46012
45705
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
46013
45706
|
}
|
|
@@ -46287,9 +45980,9 @@ function getAllEvents(traits2) {
|
|
|
46287
45980
|
function EventDispatcherTab({ traits: traits2, schema }) {
|
|
46288
45981
|
const eventBus = useEventBus();
|
|
46289
45982
|
const { t } = useTranslate();
|
|
46290
|
-
const [
|
|
46291
|
-
const prevStatesRef =
|
|
46292
|
-
|
|
45983
|
+
const [log13, setLog] = React82.useState([]);
|
|
45984
|
+
const prevStatesRef = React82.useRef(/* @__PURE__ */ new Map());
|
|
45985
|
+
React82.useEffect(() => {
|
|
46293
45986
|
for (const trait of traits2) {
|
|
46294
45987
|
const prev = prevStatesRef.current.get(trait.id);
|
|
46295
45988
|
if (prev && prev !== trait.currentState) {
|
|
@@ -46351,9 +46044,9 @@ function EventDispatcherTab({ traits: traits2, schema }) {
|
|
|
46351
46044
|
/* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-1", children: t("debug.otherEvents") }),
|
|
46352
46045
|
/* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1", children: unavailableEvents.map((event) => /* @__PURE__ */ jsx(Badge, { variant: "default", size: "sm", className: "opacity-50", children: event }, event)) })
|
|
46353
46046
|
] }),
|
|
46354
|
-
|
|
46047
|
+
log13.length > 0 && /* @__PURE__ */ jsxs("div", { children: [
|
|
46355
46048
|
/* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-1", children: t("debug.recentTransitions") }),
|
|
46356
|
-
/* @__PURE__ */ jsx(Stack, { gap: "xs", children:
|
|
46049
|
+
/* @__PURE__ */ jsx(Stack, { gap: "xs", children: log13.map((entry, i) => /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "font-mono text-xs", children: [
|
|
46357
46050
|
/* @__PURE__ */ jsx("span", { className: "text-purple-400", children: entry.traitName }),
|
|
46358
46051
|
" ",
|
|
46359
46052
|
/* @__PURE__ */ jsx("span", { className: "text-gray-500", children: entry.from }),
|
|
@@ -46458,10 +46151,10 @@ function VerifyModePanel({
|
|
|
46458
46151
|
localCount
|
|
46459
46152
|
}) {
|
|
46460
46153
|
const { t } = useTranslate();
|
|
46461
|
-
const [expanded, setExpanded] =
|
|
46462
|
-
const scrollRef =
|
|
46463
|
-
const prevCountRef =
|
|
46464
|
-
|
|
46154
|
+
const [expanded, setExpanded] = React82.useState(true);
|
|
46155
|
+
const scrollRef = React82.useRef(null);
|
|
46156
|
+
const prevCountRef = React82.useRef(0);
|
|
46157
|
+
React82.useEffect(() => {
|
|
46465
46158
|
if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
|
|
46466
46159
|
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
46467
46160
|
}
|
|
@@ -46518,10 +46211,10 @@ function RuntimeDebugger({
|
|
|
46518
46211
|
schema
|
|
46519
46212
|
}) {
|
|
46520
46213
|
const { t } = useTranslate();
|
|
46521
|
-
const [isCollapsed, setIsCollapsed] =
|
|
46522
|
-
const [isVisible, setIsVisible] =
|
|
46214
|
+
const [isCollapsed, setIsCollapsed] = React82.useState(mode === "verify" ? true : defaultCollapsed);
|
|
46215
|
+
const [isVisible, setIsVisible] = React82.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
|
|
46523
46216
|
const debugData = useDebugData();
|
|
46524
|
-
|
|
46217
|
+
React82.useEffect(() => {
|
|
46525
46218
|
if (mode === "inline") return;
|
|
46526
46219
|
return onDebugToggle((enabled) => {
|
|
46527
46220
|
setIsVisible(enabled);
|
|
@@ -46530,7 +46223,7 @@ function RuntimeDebugger({
|
|
|
46530
46223
|
}
|
|
46531
46224
|
});
|
|
46532
46225
|
}, [mode]);
|
|
46533
|
-
|
|
46226
|
+
React82.useEffect(() => {
|
|
46534
46227
|
if (mode === "inline") return;
|
|
46535
46228
|
const handleKeyDown = (e) => {
|
|
46536
46229
|
if (e.key === "`" && isVisible) {
|
|
@@ -47090,7 +46783,7 @@ function SequenceBar({
|
|
|
47090
46783
|
onSlotRemove(index);
|
|
47091
46784
|
}, [onSlotRemove, playing]);
|
|
47092
46785
|
const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
|
|
47093
|
-
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(
|
|
46786
|
+
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React82__default.Fragment, { children: [
|
|
47094
46787
|
i > 0 && /* @__PURE__ */ jsx(
|
|
47095
46788
|
Typography,
|
|
47096
46789
|
{
|
|
@@ -47979,7 +47672,7 @@ var init_StatCard = __esm({
|
|
|
47979
47672
|
const labelToUse = propLabel ?? propTitle;
|
|
47980
47673
|
const eventBus = useEventBus();
|
|
47981
47674
|
const { t } = useTranslate();
|
|
47982
|
-
const handleActionClick =
|
|
47675
|
+
const handleActionClick = React82__default.useCallback(() => {
|
|
47983
47676
|
if (action?.event) {
|
|
47984
47677
|
eventBus.emit(`UI:${action.event}`, {});
|
|
47985
47678
|
}
|
|
@@ -47990,7 +47683,7 @@ var init_StatCard = __esm({
|
|
|
47990
47683
|
const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
47991
47684
|
const isLoading = externalLoading ?? false;
|
|
47992
47685
|
const error = externalError;
|
|
47993
|
-
const computeMetricValue =
|
|
47686
|
+
const computeMetricValue = React82__default.useCallback(
|
|
47994
47687
|
(metric, items) => {
|
|
47995
47688
|
if (metric.value !== void 0) {
|
|
47996
47689
|
return metric.value;
|
|
@@ -48029,7 +47722,7 @@ var init_StatCard = __esm({
|
|
|
48029
47722
|
},
|
|
48030
47723
|
[]
|
|
48031
47724
|
);
|
|
48032
|
-
const schemaStats =
|
|
47725
|
+
const schemaStats = React82__default.useMemo(() => {
|
|
48033
47726
|
if (!metrics || metrics.length === 0) return null;
|
|
48034
47727
|
return metrics.map((metric) => ({
|
|
48035
47728
|
label: metric.label,
|
|
@@ -48037,7 +47730,7 @@ var init_StatCard = __esm({
|
|
|
48037
47730
|
format: metric.format
|
|
48038
47731
|
}));
|
|
48039
47732
|
}, [metrics, data, computeMetricValue]);
|
|
48040
|
-
const calculatedTrend =
|
|
47733
|
+
const calculatedTrend = React82__default.useMemo(() => {
|
|
48041
47734
|
if (manualTrend !== void 0) return manualTrend;
|
|
48042
47735
|
if (previousValue === void 0 || currentValue === void 0)
|
|
48043
47736
|
return void 0;
|
|
@@ -49003,7 +48696,7 @@ var init_Timeline = __esm({
|
|
|
49003
48696
|
}) => {
|
|
49004
48697
|
const { t } = useTranslate();
|
|
49005
48698
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
49006
|
-
const items =
|
|
48699
|
+
const items = React82__default.useMemo(() => {
|
|
49007
48700
|
if (propItems) return propItems;
|
|
49008
48701
|
if (entityData.length === 0) return [];
|
|
49009
48702
|
return entityData.map((record, idx) => {
|
|
@@ -49110,7 +48803,7 @@ var init_Timeline = __esm({
|
|
|
49110
48803
|
}
|
|
49111
48804
|
});
|
|
49112
48805
|
function extractToastProps(children) {
|
|
49113
|
-
if (!
|
|
48806
|
+
if (!React82__default.isValidElement(children)) {
|
|
49114
48807
|
if (typeof children === "string") {
|
|
49115
48808
|
return { message: children };
|
|
49116
48809
|
}
|
|
@@ -49148,7 +48841,7 @@ var init_ToastSlot = __esm({
|
|
|
49148
48841
|
eventBus.emit("UI:CLOSE");
|
|
49149
48842
|
};
|
|
49150
48843
|
if (!isVisible) return null;
|
|
49151
|
-
const isCustomContent =
|
|
48844
|
+
const isCustomContent = React82__default.isValidElement(children) && !message;
|
|
49152
48845
|
return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
|
|
49153
48846
|
Toast,
|
|
49154
48847
|
{
|
|
@@ -50017,7 +49710,7 @@ var init_WorldMapTemplate = __esm({
|
|
|
50017
49710
|
}
|
|
50018
49711
|
});
|
|
50019
49712
|
function lazyThree(name, loader) {
|
|
50020
|
-
const Lazy =
|
|
49713
|
+
const Lazy = React82__default.lazy(
|
|
50021
49714
|
() => loader().then((m) => {
|
|
50022
49715
|
const Resolved = m[name];
|
|
50023
49716
|
if (!Resolved) {
|
|
@@ -50029,13 +49722,13 @@ function lazyThree(name, loader) {
|
|
|
50029
49722
|
})
|
|
50030
49723
|
);
|
|
50031
49724
|
function ThreeWrapper(props) {
|
|
50032
|
-
return
|
|
49725
|
+
return React82__default.createElement(
|
|
50033
49726
|
ThreeBoundary,
|
|
50034
49727
|
{ name },
|
|
50035
|
-
|
|
50036
|
-
|
|
49728
|
+
React82__default.createElement(
|
|
49729
|
+
React82__default.Suspense,
|
|
50037
49730
|
{ fallback: null },
|
|
50038
|
-
|
|
49731
|
+
React82__default.createElement(Lazy, props)
|
|
50039
49732
|
)
|
|
50040
49733
|
);
|
|
50041
49734
|
}
|
|
@@ -50333,7 +50026,7 @@ var init_component_registry_generated = __esm({
|
|
|
50333
50026
|
init_WorldMapBoard();
|
|
50334
50027
|
init_WorldMapTemplate();
|
|
50335
50028
|
init_XPBar();
|
|
50336
|
-
ThreeBoundary = class extends
|
|
50029
|
+
ThreeBoundary = class extends React82__default.Component {
|
|
50337
50030
|
constructor() {
|
|
50338
50031
|
super(...arguments);
|
|
50339
50032
|
__publicField(this, "state", { failed: false });
|
|
@@ -50343,7 +50036,7 @@ var init_component_registry_generated = __esm({
|
|
|
50343
50036
|
}
|
|
50344
50037
|
render() {
|
|
50345
50038
|
if (this.state.failed) {
|
|
50346
|
-
return
|
|
50039
|
+
return React82__default.createElement(
|
|
50347
50040
|
"div",
|
|
50348
50041
|
{
|
|
50349
50042
|
"data-testid": "three-unavailable",
|
|
@@ -50684,7 +50377,7 @@ function SuspenseConfigProvider({
|
|
|
50684
50377
|
config,
|
|
50685
50378
|
children
|
|
50686
50379
|
}) {
|
|
50687
|
-
return
|
|
50380
|
+
return React82__default.createElement(
|
|
50688
50381
|
SuspenseConfigContext.Provider,
|
|
50689
50382
|
{ value: config },
|
|
50690
50383
|
children
|
|
@@ -51174,7 +50867,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
|
|
|
51174
50867
|
const key = `${parentId}-${index}-trait:${traitName}`;
|
|
51175
50868
|
return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
|
|
51176
50869
|
}
|
|
51177
|
-
return /* @__PURE__ */ jsx(
|
|
50870
|
+
return /* @__PURE__ */ jsx(React82__default.Fragment, { children: child }, `${parentId}-${index}`);
|
|
51178
50871
|
}
|
|
51179
50872
|
if (!child || typeof child !== "object") return null;
|
|
51180
50873
|
const childId = `${parentId}-${index}`;
|
|
@@ -51214,14 +50907,14 @@ function isPatternConfig(value) {
|
|
|
51214
50907
|
if (value === null || value === void 0) return false;
|
|
51215
50908
|
if (typeof value !== "object") return false;
|
|
51216
50909
|
if (Array.isArray(value)) return false;
|
|
51217
|
-
if (
|
|
50910
|
+
if (React82__default.isValidElement(value)) return false;
|
|
51218
50911
|
if (value instanceof Date) return false;
|
|
51219
50912
|
if (typeof value === "function") return false;
|
|
51220
50913
|
const record = value;
|
|
51221
50914
|
return "type" in record && typeof record.type === "string";
|
|
51222
50915
|
}
|
|
51223
50916
|
function isPlainConfigObject(value) {
|
|
51224
|
-
if (
|
|
50917
|
+
if (React82__default.isValidElement(value)) return false;
|
|
51225
50918
|
if (value instanceof Date) return false;
|
|
51226
50919
|
const proto = Object.getPrototypeOf(value);
|
|
51227
50920
|
return proto === Object.prototype || proto === null;
|
|
@@ -51560,9 +51253,6 @@ var init_UISlotRenderer = __esm({
|
|
|
51560
51253
|
}
|
|
51561
51254
|
});
|
|
51562
51255
|
|
|
51563
|
-
// providers/OrbitalProvider.tsx
|
|
51564
|
-
init_ThemeContext();
|
|
51565
|
-
|
|
51566
51256
|
// providers/EventBusProvider.tsx
|
|
51567
51257
|
init_useEventBus();
|
|
51568
51258
|
var busLog = createLogger("almadar:eventbus");
|
|
@@ -51714,7 +51404,7 @@ function EventBusProvider({ children, isolated = false }) {
|
|
|
51714
51404
|
|
|
51715
51405
|
// providers/SelectionProvider.tsx
|
|
51716
51406
|
init_useEventBus();
|
|
51717
|
-
var
|
|
51407
|
+
var log2 = createLogger("almadar:ui:selection");
|
|
51718
51408
|
var SelectionContext = createContext(null);
|
|
51719
51409
|
var defaultCompareEntities = (a, b) => {
|
|
51720
51410
|
if (a === b) return true;
|
|
@@ -51737,7 +51427,7 @@ function SelectionProvider({
|
|
|
51737
51427
|
(entity) => {
|
|
51738
51428
|
setSelectedState(entity);
|
|
51739
51429
|
if (debug2) {
|
|
51740
|
-
|
|
51430
|
+
log2.debug("Selection set", () => ({
|
|
51741
51431
|
hasEntity: entity !== null && entity !== void 0,
|
|
51742
51432
|
entityId: entity && typeof entity === "object" ? String(entity.id ?? "") : ""
|
|
51743
51433
|
}));
|
|
@@ -51748,7 +51438,7 @@ function SelectionProvider({
|
|
|
51748
51438
|
const clearSelection = useCallback(() => {
|
|
51749
51439
|
setSelectedState(null);
|
|
51750
51440
|
if (debug2) {
|
|
51751
|
-
|
|
51441
|
+
log2.debug("Selection cleared");
|
|
51752
51442
|
}
|
|
51753
51443
|
}, [debug2]);
|
|
51754
51444
|
const isSelected = useCallback(
|
|
@@ -51763,7 +51453,7 @@ function SelectionProvider({
|
|
|
51763
51453
|
if (row) {
|
|
51764
51454
|
setSelected(row);
|
|
51765
51455
|
if (debug2) {
|
|
51766
|
-
|
|
51456
|
+
log2.debug("event received", () => ({
|
|
51767
51457
|
type: event.type,
|
|
51768
51458
|
rowId: row && typeof row === "object" ? String(row.id ?? "") : ""
|
|
51769
51459
|
}));
|
|
@@ -51773,7 +51463,7 @@ function SelectionProvider({
|
|
|
51773
51463
|
const handleDeselect = (event) => {
|
|
51774
51464
|
clearSelection();
|
|
51775
51465
|
if (debug2) {
|
|
51776
|
-
|
|
51466
|
+
log2.debug("event received - clearing selection", { type: event.type });
|
|
51777
51467
|
}
|
|
51778
51468
|
};
|
|
51779
51469
|
const unsubView = eventBus.on("UI:VIEW", handleSelect);
|
|
@@ -51815,7 +51505,7 @@ init_UISlotRenderer();
|
|
|
51815
51505
|
// providers/VerificationProvider.tsx
|
|
51816
51506
|
init_useEventBus();
|
|
51817
51507
|
init_verificationRegistry();
|
|
51818
|
-
var
|
|
51508
|
+
var log12 = createLogger("almadar:verify");
|
|
51819
51509
|
var DISPATCH_SUFFIX = ":DISPATCH";
|
|
51820
51510
|
var SUCCESS_SUFFIX = ":SUCCESS";
|
|
51821
51511
|
var ERROR_SUFFIX = ":ERROR";
|
|
@@ -51862,7 +51552,7 @@ function VerificationProvider({
|
|
|
51862
51552
|
const verificationProviderLifecycleListener = (evt) => {
|
|
51863
51553
|
const parsed = parseLifecycleEvent(evt.type);
|
|
51864
51554
|
if (!parsed) return;
|
|
51865
|
-
|
|
51555
|
+
log12.debug("lifecycle:event", { kind: parsed.kind, traitName: parsed.traitName, event: parsed.event, type: evt.type });
|
|
51866
51556
|
const payload = evt.payload ?? {};
|
|
51867
51557
|
if (parsed.kind === "dispatch") {
|
|
51868
51558
|
const key = `${parsed.traitName}:${String(payload["event"] ?? "")}`;
|
|
@@ -51917,7 +51607,7 @@ function VerificationProvider({
|
|
|
51917
51607
|
},
|
|
51918
51608
|
timestamp: Date.now()
|
|
51919
51609
|
});
|
|
51920
|
-
|
|
51610
|
+
log12.debug("transition:success", { trait: parsed.traitName, event: parsed.event, from: pending?.from, to: newState, effectCount: effects.length });
|
|
51921
51611
|
} else if (parsed.kind === "error" && parsed.event) {
|
|
51922
51612
|
const key = `${parsed.traitName}:${parsed.event}`;
|
|
51923
51613
|
const pending = pendingRef.current.get(key);
|
|
@@ -51947,7 +51637,7 @@ function VerificationProvider({
|
|
|
51947
51637
|
},
|
|
51948
51638
|
timestamp: Date.now()
|
|
51949
51639
|
});
|
|
51950
|
-
|
|
51640
|
+
log12.warn("transition:error", { trait: parsed.traitName, event: parsed.event, from: fromState, error: errorMsg });
|
|
51951
51641
|
}
|
|
51952
51642
|
};
|
|
51953
51643
|
Object.defineProperty(verificationProviderLifecycleListener, "name", {
|