@almadar/ui 4.13.1 → 4.14.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 +1363 -1493
- package/dist/avl/index.js +271 -401
- package/dist/components/index.cjs +1069 -1063
- package/dist/components/index.js +168 -162
- package/dist/providers/index.cjs +924 -918
- package/dist/providers/index.js +168 -162
- package/dist/runtime/index.cjs +1045 -1187
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/index.js +267 -405
- package/dist/runtime/ui/slot-types.d.ts +48 -0
- package/dist/runtime/useTraitStateMachine.d.ts +20 -2
- package/package.json +1 -1
- package/dist/runtime/ui/SlotsContext.d.ts +0 -114
package/dist/avl/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { Html, RoundedBox, OrbitControls as OrbitControls$1, Grid as Grid$1, Stars, Sparkles } from '@react-three/drei';
|
|
3
|
-
import * as
|
|
4
|
-
import
|
|
3
|
+
import * as React127 from 'react';
|
|
4
|
+
import React127__default, { createContext, useContext, useRef, useState, useCallback, useMemo, useEffect, Suspense, useLayoutEffect, useReducer, lazy, useId, forwardRef, useImperativeHandle, Component } from 'react';
|
|
5
5
|
import * as LucideIcons from 'lucide-react';
|
|
6
6
|
import { Loader2, ChevronDown, X, Check, Copy, AlertTriangle, Info, AlertCircle, CheckCircle, List, Printer, ChevronRight, ChevronLeft, Code, FileText, WrapText, Trash2, Settings, Menu as Menu$1, Search, Bell, LogOut, ZoomOut, ZoomIn, Download, FileQuestion, Inbox, XCircle, Filter, Plus, Pause, Play, RotateCcw, Package, Calendar, Pencil, Eye, MoreHorizontal, Image as Image$1, Upload, Minus, ArrowLeft, HelpCircle, ChevronUp, Eraser, Star, TrendingUp, TrendingDown, ArrowUp, ArrowDown, MoreVertical, Sun, Moon, Circle, Clock, CheckCircle2, ArrowRight, FileWarning, SkipForward, Bug, Send, Wrench, User, Tag, DollarSign, Zap, Sword, Move, Heart, Shield } from 'lucide-react';
|
|
7
7
|
import { evaluate, createMinimalContext } from '@almadar/evaluator';
|
|
@@ -3336,7 +3336,7 @@ var init_Box = __esm({
|
|
|
3336
3336
|
fixed: "fixed",
|
|
3337
3337
|
sticky: "sticky"
|
|
3338
3338
|
};
|
|
3339
|
-
Box =
|
|
3339
|
+
Box = React127__default.forwardRef(
|
|
3340
3340
|
({
|
|
3341
3341
|
padding,
|
|
3342
3342
|
paddingX,
|
|
@@ -5054,7 +5054,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
5054
5054
|
const IconComp = value;
|
|
5055
5055
|
return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
|
|
5056
5056
|
}
|
|
5057
|
-
if (
|
|
5057
|
+
if (React127__default.isValidElement(value)) {
|
|
5058
5058
|
return value;
|
|
5059
5059
|
}
|
|
5060
5060
|
if (typeof value === "object" && value !== null && "render" in value) {
|
|
@@ -5130,7 +5130,7 @@ var init_Button = __esm({
|
|
|
5130
5130
|
md: "h-4 w-4",
|
|
5131
5131
|
lg: "h-5 w-5"
|
|
5132
5132
|
};
|
|
5133
|
-
Button =
|
|
5133
|
+
Button = React127__default.forwardRef(
|
|
5134
5134
|
({
|
|
5135
5135
|
className,
|
|
5136
5136
|
variant = "primary",
|
|
@@ -5233,7 +5233,7 @@ var init_Badge = __esm({
|
|
|
5233
5233
|
md: "px-2.5 py-1 text-sm",
|
|
5234
5234
|
lg: "px-3 py-1.5 text-base"
|
|
5235
5235
|
};
|
|
5236
|
-
Badge =
|
|
5236
|
+
Badge = React127__default.forwardRef(
|
|
5237
5237
|
({ className, variant = "default", size = "sm", amount, label, icon, children, ...props }, ref) => {
|
|
5238
5238
|
const iconSizes2 = { sm: "w-3 h-3", md: "w-3.5 h-3.5", lg: "w-4 h-4" };
|
|
5239
5239
|
const resolvedIcon = typeof icon === "string" ? (() => {
|
|
@@ -5370,6 +5370,8 @@ var init_Toast = __esm({
|
|
|
5370
5370
|
Toast.displayName = "Toast";
|
|
5371
5371
|
}
|
|
5372
5372
|
});
|
|
5373
|
+
|
|
5374
|
+
// runtime/ui/slot-types.ts
|
|
5373
5375
|
function refId(obj) {
|
|
5374
5376
|
if (obj === null || obj === void 0 || typeof obj !== "object") return null;
|
|
5375
5377
|
const existing = refIds.get(obj);
|
|
@@ -5378,114 +5380,20 @@ function refId(obj) {
|
|
|
5378
5380
|
refIds.set(obj, id);
|
|
5379
5381
|
return id;
|
|
5380
5382
|
}
|
|
5381
|
-
|
|
5382
|
-
|
|
5383
|
-
|
|
5384
|
-
for (const [sourceKey, entry] of Object.entries(slot)) {
|
|
5385
|
-
if (entry.patterns.length > 0) {
|
|
5386
|
-
out.push({ sourceKey, entry });
|
|
5387
|
-
}
|
|
5388
|
-
}
|
|
5389
|
-
return out;
|
|
5390
|
-
}
|
|
5391
|
-
function SlotsProvider({ children }) {
|
|
5392
|
-
const [slots, setSlots] = useState({});
|
|
5393
|
-
const setSlotPatterns = useCallback((slot, patterns, source) => {
|
|
5394
|
-
const sourceKey = source?.trait ?? DEFAULT_SOURCE_KEY2;
|
|
5395
|
-
const entityProp = patterns[0]?.pattern && typeof patterns[0].pattern === "object" ? patterns[0].pattern.entity : void 0;
|
|
5396
|
-
const firstPatternType = patterns[0]?.pattern && typeof patterns[0].pattern === "object" ? patterns[0].pattern.type : void 0;
|
|
5397
|
-
slotLog.debug("setSlotPatterns", {
|
|
5398
|
-
slot,
|
|
5399
|
-
sourceKey,
|
|
5400
|
-
patternCount: patterns.length,
|
|
5401
|
-
firstPatternType,
|
|
5402
|
-
entityRefId: refId(entityProp)
|
|
5403
|
-
});
|
|
5404
|
-
if (source?.trait) {
|
|
5405
|
-
xOrbitalLog.info("slot-set", {
|
|
5406
|
-
slot,
|
|
5407
|
-
sourceTrait: source.trait,
|
|
5408
|
-
patternCount: patterns.length,
|
|
5409
|
-
firstPatternType,
|
|
5410
|
-
state: source.state
|
|
5411
|
-
});
|
|
5412
|
-
}
|
|
5413
|
-
setSlots((prev) => {
|
|
5414
|
-
const prevSlot = prev[slot] ?? {};
|
|
5415
|
-
return {
|
|
5416
|
-
...prev,
|
|
5417
|
-
[slot]: {
|
|
5418
|
-
...prevSlot,
|
|
5419
|
-
[sourceKey]: { patterns, source }
|
|
5420
|
-
}
|
|
5421
|
-
};
|
|
5422
|
-
});
|
|
5423
|
-
}, []);
|
|
5424
|
-
const clearSlot = useCallback((slot) => {
|
|
5425
|
-
setSlots((prev) => {
|
|
5426
|
-
const existing = prev[slot];
|
|
5427
|
-
if (existing && Object.keys(existing).length === 0) {
|
|
5428
|
-
return prev;
|
|
5429
|
-
}
|
|
5430
|
-
return { ...prev, [slot]: {} };
|
|
5431
|
-
});
|
|
5432
|
-
}, []);
|
|
5433
|
-
const clearSlotForSource = useCallback((slot, sourceTrait) => {
|
|
5434
|
-
xOrbitalLog.info("slot-clear-source", { slot, sourceTrait });
|
|
5435
|
-
setSlots((prev) => {
|
|
5436
|
-
const existing = prev[slot];
|
|
5437
|
-
if (!existing || !(sourceTrait in existing)) return prev;
|
|
5438
|
-
const next = { ...existing };
|
|
5439
|
-
delete next[sourceTrait];
|
|
5440
|
-
return { ...prev, [slot]: next };
|
|
5441
|
-
});
|
|
5442
|
-
}, []);
|
|
5443
|
-
const clearAllSlots = useCallback(() => {
|
|
5444
|
-
setSlots({});
|
|
5445
|
-
}, []);
|
|
5446
|
-
const actionsRef = useRef({
|
|
5447
|
-
setSlotPatterns,
|
|
5448
|
-
clearSlot,
|
|
5449
|
-
clearSlotForSource,
|
|
5450
|
-
clearAllSlots
|
|
5451
|
-
});
|
|
5452
|
-
actionsRef.current = { setSlotPatterns, clearSlot, clearSlotForSource, clearAllSlots };
|
|
5453
|
-
const [stableActions] = useState(() => ({
|
|
5454
|
-
setSlotPatterns: (...args) => actionsRef.current.setSlotPatterns(...args),
|
|
5455
|
-
clearSlot: (...args) => actionsRef.current.clearSlot(...args),
|
|
5456
|
-
clearSlotForSource: (...args) => actionsRef.current.clearSlotForSource(...args),
|
|
5457
|
-
clearAllSlots: () => actionsRef.current.clearAllSlots()
|
|
5458
|
-
}));
|
|
5459
|
-
return /* @__PURE__ */ jsx(SlotsActionsContext.Provider, { value: stableActions, children: /* @__PURE__ */ jsx(SlotsStateContext.Provider, { value: slots, children }) });
|
|
5460
|
-
}
|
|
5461
|
-
function useSlots() {
|
|
5462
|
-
return useContext(SlotsStateContext);
|
|
5463
|
-
}
|
|
5464
|
-
function useSlotsActions() {
|
|
5465
|
-
const actions = useContext(SlotsActionsContext);
|
|
5466
|
-
if (!actions) {
|
|
5467
|
-
throw new Error("useSlotsActions must be used within a SlotsProvider");
|
|
5468
|
-
}
|
|
5469
|
-
return actions;
|
|
5470
|
-
}
|
|
5471
|
-
var slotLog, xOrbitalLog, refIds, nextRefId, DEFAULT_SOURCE_KEY2, SlotsStateContext, SlotsActionsContext;
|
|
5472
|
-
var init_SlotsContext = __esm({
|
|
5473
|
-
"runtime/ui/SlotsContext.tsx"() {
|
|
5383
|
+
var slotLog, refIds, nextRefId;
|
|
5384
|
+
var init_slot_types = __esm({
|
|
5385
|
+
"runtime/ui/slot-types.ts"() {
|
|
5474
5386
|
init_logger();
|
|
5475
5387
|
slotLog = createLogger("almadar:ui:slot-render");
|
|
5476
|
-
xOrbitalLog = createLogger("almadar:runtime:cross-orbital");
|
|
5477
5388
|
refIds = /* @__PURE__ */ new WeakMap();
|
|
5478
5389
|
nextRefId = 1;
|
|
5479
|
-
DEFAULT_SOURCE_KEY2 = "__default__";
|
|
5480
|
-
SlotsStateContext = createContext({});
|
|
5481
|
-
SlotsActionsContext = createContext(null);
|
|
5482
5390
|
}
|
|
5483
5391
|
});
|
|
5484
5392
|
var Input;
|
|
5485
5393
|
var init_Input = __esm({
|
|
5486
5394
|
"components/atoms/Input.tsx"() {
|
|
5487
5395
|
init_cn();
|
|
5488
|
-
Input =
|
|
5396
|
+
Input = React127__default.forwardRef(
|
|
5489
5397
|
({
|
|
5490
5398
|
className,
|
|
5491
5399
|
inputType,
|
|
@@ -5603,7 +5511,7 @@ var Label;
|
|
|
5603
5511
|
var init_Label = __esm({
|
|
5604
5512
|
"components/atoms/Label.tsx"() {
|
|
5605
5513
|
init_cn();
|
|
5606
|
-
Label =
|
|
5514
|
+
Label = React127__default.forwardRef(
|
|
5607
5515
|
({ className, required, children, ...props }, ref) => {
|
|
5608
5516
|
return /* @__PURE__ */ jsxs(
|
|
5609
5517
|
"label",
|
|
@@ -5629,7 +5537,7 @@ var Textarea;
|
|
|
5629
5537
|
var init_Textarea = __esm({
|
|
5630
5538
|
"components/atoms/Textarea.tsx"() {
|
|
5631
5539
|
init_cn();
|
|
5632
|
-
Textarea =
|
|
5540
|
+
Textarea = React127__default.forwardRef(
|
|
5633
5541
|
({ className, error, ...props }, ref) => {
|
|
5634
5542
|
return /* @__PURE__ */ jsx(
|
|
5635
5543
|
"textarea",
|
|
@@ -5658,7 +5566,7 @@ var Select;
|
|
|
5658
5566
|
var init_Select = __esm({
|
|
5659
5567
|
"components/atoms/Select.tsx"() {
|
|
5660
5568
|
init_cn();
|
|
5661
|
-
Select =
|
|
5569
|
+
Select = React127__default.forwardRef(
|
|
5662
5570
|
({ className, options, placeholder, error, ...props }, ref) => {
|
|
5663
5571
|
return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
5664
5572
|
/* @__PURE__ */ jsxs(
|
|
@@ -5700,7 +5608,7 @@ var Checkbox;
|
|
|
5700
5608
|
var init_Checkbox = __esm({
|
|
5701
5609
|
"components/atoms/Checkbox.tsx"() {
|
|
5702
5610
|
init_cn();
|
|
5703
|
-
Checkbox =
|
|
5611
|
+
Checkbox = React127__default.forwardRef(
|
|
5704
5612
|
({ className, label, id, ...props }, ref) => {
|
|
5705
5613
|
const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
5706
5614
|
return /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
|
|
@@ -5782,7 +5690,7 @@ var init_Card = __esm({
|
|
|
5782
5690
|
md: "shadow",
|
|
5783
5691
|
lg: "shadow-lg"
|
|
5784
5692
|
};
|
|
5785
|
-
Card =
|
|
5693
|
+
Card = React127__default.forwardRef(
|
|
5786
5694
|
({
|
|
5787
5695
|
className,
|
|
5788
5696
|
variant = "bordered",
|
|
@@ -5818,9 +5726,9 @@ var init_Card = __esm({
|
|
|
5818
5726
|
}
|
|
5819
5727
|
);
|
|
5820
5728
|
Card.displayName = "Card";
|
|
5821
|
-
CardHeader =
|
|
5729
|
+
CardHeader = React127__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
5822
5730
|
CardHeader.displayName = "CardHeader";
|
|
5823
|
-
CardTitle =
|
|
5731
|
+
CardTitle = React127__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
5824
5732
|
"h3",
|
|
5825
5733
|
{
|
|
5826
5734
|
ref,
|
|
@@ -5833,11 +5741,11 @@ var init_Card = __esm({
|
|
|
5833
5741
|
}
|
|
5834
5742
|
));
|
|
5835
5743
|
CardTitle.displayName = "CardTitle";
|
|
5836
|
-
CardContent =
|
|
5744
|
+
CardContent = React127__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
|
|
5837
5745
|
CardContent.displayName = "CardContent";
|
|
5838
5746
|
CardBody = CardContent;
|
|
5839
5747
|
CardBody.displayName = "CardBody";
|
|
5840
|
-
CardFooter =
|
|
5748
|
+
CardFooter = React127__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
5841
5749
|
"div",
|
|
5842
5750
|
{
|
|
5843
5751
|
ref,
|
|
@@ -5858,7 +5766,7 @@ var init_Spinner = __esm({
|
|
|
5858
5766
|
md: "h-6 w-6",
|
|
5859
5767
|
lg: "h-8 w-8"
|
|
5860
5768
|
};
|
|
5861
|
-
Spinner =
|
|
5769
|
+
Spinner = React127__default.forwardRef(
|
|
5862
5770
|
({ className, size = "md", ...props }, ref) => {
|
|
5863
5771
|
return /* @__PURE__ */ jsx(
|
|
5864
5772
|
"div",
|
|
@@ -6306,7 +6214,7 @@ var Radio;
|
|
|
6306
6214
|
var init_Radio = __esm({
|
|
6307
6215
|
"components/atoms/Radio.tsx"() {
|
|
6308
6216
|
init_cn();
|
|
6309
|
-
Radio =
|
|
6217
|
+
Radio = React127__default.forwardRef(
|
|
6310
6218
|
({
|
|
6311
6219
|
label,
|
|
6312
6220
|
helperText,
|
|
@@ -6417,7 +6325,7 @@ var init_Switch = __esm({
|
|
|
6417
6325
|
"components/atoms/Switch.tsx"() {
|
|
6418
6326
|
"use client";
|
|
6419
6327
|
init_cn();
|
|
6420
|
-
Switch =
|
|
6328
|
+
Switch = React127.forwardRef(
|
|
6421
6329
|
({
|
|
6422
6330
|
checked,
|
|
6423
6331
|
defaultChecked = false,
|
|
@@ -6428,10 +6336,10 @@ var init_Switch = __esm({
|
|
|
6428
6336
|
name,
|
|
6429
6337
|
className
|
|
6430
6338
|
}, ref) => {
|
|
6431
|
-
const [isChecked, setIsChecked] =
|
|
6339
|
+
const [isChecked, setIsChecked] = React127.useState(
|
|
6432
6340
|
checked !== void 0 ? checked : defaultChecked
|
|
6433
6341
|
);
|
|
6434
|
-
|
|
6342
|
+
React127.useEffect(() => {
|
|
6435
6343
|
if (checked !== void 0) {
|
|
6436
6344
|
setIsChecked(checked);
|
|
6437
6345
|
}
|
|
@@ -6771,8 +6679,8 @@ var init_LawReferenceTooltip = __esm({
|
|
|
6771
6679
|
position = "top",
|
|
6772
6680
|
className
|
|
6773
6681
|
}) => {
|
|
6774
|
-
const [isVisible, setIsVisible] =
|
|
6775
|
-
const timeoutRef =
|
|
6682
|
+
const [isVisible, setIsVisible] = React127__default.useState(false);
|
|
6683
|
+
const timeoutRef = React127__default.useRef(null);
|
|
6776
6684
|
const handleMouseEnter = () => {
|
|
6777
6685
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
6778
6686
|
timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
|
|
@@ -6781,7 +6689,7 @@ var init_LawReferenceTooltip = __esm({
|
|
|
6781
6689
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
6782
6690
|
setIsVisible(false);
|
|
6783
6691
|
};
|
|
6784
|
-
|
|
6692
|
+
React127__default.useEffect(() => {
|
|
6785
6693
|
return () => {
|
|
6786
6694
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
6787
6695
|
};
|
|
@@ -6991,7 +6899,7 @@ var init_StatusDot = __esm({
|
|
|
6991
6899
|
md: "w-2.5 h-2.5",
|
|
6992
6900
|
lg: "w-3 h-3"
|
|
6993
6901
|
};
|
|
6994
|
-
StatusDot =
|
|
6902
|
+
StatusDot = React127__default.forwardRef(
|
|
6995
6903
|
({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
|
|
6996
6904
|
return /* @__PURE__ */ jsx(
|
|
6997
6905
|
"span",
|
|
@@ -7044,7 +6952,7 @@ var init_TrendIndicator = __esm({
|
|
|
7044
6952
|
down: TrendingDown,
|
|
7045
6953
|
flat: ArrowRight
|
|
7046
6954
|
};
|
|
7047
|
-
TrendIndicator =
|
|
6955
|
+
TrendIndicator = React127__default.forwardRef(
|
|
7048
6956
|
({
|
|
7049
6957
|
className,
|
|
7050
6958
|
value,
|
|
@@ -7111,7 +7019,7 @@ var init_RangeSlider = __esm({
|
|
|
7111
7019
|
md: "w-4 h-4",
|
|
7112
7020
|
lg: "w-5 h-5"
|
|
7113
7021
|
};
|
|
7114
|
-
RangeSlider =
|
|
7022
|
+
RangeSlider = React127__default.forwardRef(
|
|
7115
7023
|
({
|
|
7116
7024
|
className,
|
|
7117
7025
|
min = 0,
|
|
@@ -7707,7 +7615,7 @@ var init_ContentSection = __esm({
|
|
|
7707
7615
|
md: "py-16",
|
|
7708
7616
|
lg: "py-24"
|
|
7709
7617
|
};
|
|
7710
|
-
ContentSection =
|
|
7618
|
+
ContentSection = React127__default.forwardRef(
|
|
7711
7619
|
({ children, background = "default", padding = "lg", id, className }, ref) => {
|
|
7712
7620
|
return /* @__PURE__ */ jsx(
|
|
7713
7621
|
Box,
|
|
@@ -8241,7 +8149,7 @@ var init_AnimatedReveal = __esm({
|
|
|
8241
8149
|
"scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
|
|
8242
8150
|
"none": {}
|
|
8243
8151
|
};
|
|
8244
|
-
AnimatedReveal =
|
|
8152
|
+
AnimatedReveal = React127__default.forwardRef(
|
|
8245
8153
|
({
|
|
8246
8154
|
trigger = "scroll",
|
|
8247
8155
|
animation = "fade-up",
|
|
@@ -8401,7 +8309,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
8401
8309
|
"components/atoms/AnimatedGraphic.tsx"() {
|
|
8402
8310
|
"use client";
|
|
8403
8311
|
init_cn();
|
|
8404
|
-
AnimatedGraphic =
|
|
8312
|
+
AnimatedGraphic = React127__default.forwardRef(
|
|
8405
8313
|
({
|
|
8406
8314
|
src,
|
|
8407
8315
|
svgContent,
|
|
@@ -8424,7 +8332,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
8424
8332
|
const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
|
|
8425
8333
|
const resolvedSvg = svgContent ?? fetchedSvg;
|
|
8426
8334
|
const prevAnimateRef = useRef(animate);
|
|
8427
|
-
const setRef =
|
|
8335
|
+
const setRef = React127__default.useCallback(
|
|
8428
8336
|
(node) => {
|
|
8429
8337
|
containerRef.current = node;
|
|
8430
8338
|
if (typeof ref === "function") ref(node);
|
|
@@ -8532,11 +8440,13 @@ function TraitFrame({
|
|
|
8532
8440
|
fallback = null
|
|
8533
8441
|
}) {
|
|
8534
8442
|
const content = useTraitContent(traitName);
|
|
8443
|
+
const entitySchema = useEntitySchemaOptional();
|
|
8444
|
+
const orbital = entitySchema?.orbitalsByTrait.get(traitName);
|
|
8535
8445
|
if (!content) {
|
|
8536
8446
|
return /* @__PURE__ */ jsx(Fragment, { children: fallback });
|
|
8537
8447
|
}
|
|
8538
8448
|
const SlotContentRenderer2 = getSlotContentRenderer();
|
|
8539
|
-
|
|
8449
|
+
const rendered = /* @__PURE__ */ jsx(
|
|
8540
8450
|
SlotContentRenderer2,
|
|
8541
8451
|
{
|
|
8542
8452
|
content,
|
|
@@ -8544,6 +8454,10 @@ function TraitFrame({
|
|
|
8544
8454
|
}
|
|
8545
8455
|
}
|
|
8546
8456
|
);
|
|
8457
|
+
if (!orbital) {
|
|
8458
|
+
return rendered;
|
|
8459
|
+
}
|
|
8460
|
+
return /* @__PURE__ */ jsx(TraitScopeProvider, { orbital, trait: traitName, children: rendered });
|
|
8547
8461
|
}
|
|
8548
8462
|
function getSlotContentRenderer() {
|
|
8549
8463
|
if (_slotContentRenderer) return _slotContentRenderer;
|
|
@@ -8555,6 +8469,8 @@ var _slotContentRenderer;
|
|
|
8555
8469
|
var init_TraitFrame = __esm({
|
|
8556
8470
|
"components/atoms/TraitFrame.tsx"() {
|
|
8557
8471
|
init_UISlotContext();
|
|
8472
|
+
init_TraitScopeProvider();
|
|
8473
|
+
init_EntitySchemaContext();
|
|
8558
8474
|
TraitFrame.displayName = "TraitFrame";
|
|
8559
8475
|
_slotContentRenderer = null;
|
|
8560
8476
|
}
|
|
@@ -8643,9 +8559,9 @@ function ScoreDisplay({
|
|
|
8643
8559
|
...rest
|
|
8644
8560
|
}) {
|
|
8645
8561
|
const resolvedValue = typeof value === "number" && !Number.isNaN(value) ? value : typeof rest.score === "number" && !Number.isNaN(rest.score) ? rest.score : 0;
|
|
8646
|
-
const [displayValue, setDisplayValue] =
|
|
8647
|
-
const [isAnimating, setIsAnimating] =
|
|
8648
|
-
|
|
8562
|
+
const [displayValue, setDisplayValue] = React127.useState(resolvedValue);
|
|
8563
|
+
const [isAnimating, setIsAnimating] = React127.useState(false);
|
|
8564
|
+
React127.useEffect(() => {
|
|
8649
8565
|
if (!animated || displayValue === resolvedValue) {
|
|
8650
8566
|
setDisplayValue(resolvedValue);
|
|
8651
8567
|
return;
|
|
@@ -8715,9 +8631,9 @@ function ControlButton({
|
|
|
8715
8631
|
className
|
|
8716
8632
|
}) {
|
|
8717
8633
|
const eventBus = useEventBus();
|
|
8718
|
-
const [isPressed, setIsPressed] =
|
|
8634
|
+
const [isPressed, setIsPressed] = React127.useState(false);
|
|
8719
8635
|
const actualPressed = pressed ?? isPressed;
|
|
8720
|
-
const handlePointerDown =
|
|
8636
|
+
const handlePointerDown = React127.useCallback(
|
|
8721
8637
|
(e) => {
|
|
8722
8638
|
e.preventDefault();
|
|
8723
8639
|
if (disabled) return;
|
|
@@ -8727,7 +8643,7 @@ function ControlButton({
|
|
|
8727
8643
|
},
|
|
8728
8644
|
[disabled, pressEvent, eventBus, onPress]
|
|
8729
8645
|
);
|
|
8730
|
-
const handlePointerUp =
|
|
8646
|
+
const handlePointerUp = React127.useCallback(
|
|
8731
8647
|
(e) => {
|
|
8732
8648
|
e.preventDefault();
|
|
8733
8649
|
if (disabled) return;
|
|
@@ -8737,7 +8653,7 @@ function ControlButton({
|
|
|
8737
8653
|
},
|
|
8738
8654
|
[disabled, releaseEvent, eventBus, onRelease]
|
|
8739
8655
|
);
|
|
8740
|
-
const handlePointerLeave =
|
|
8656
|
+
const handlePointerLeave = React127.useCallback(
|
|
8741
8657
|
(e) => {
|
|
8742
8658
|
if (isPressed) {
|
|
8743
8659
|
setIsPressed(false);
|
|
@@ -9635,9 +9551,9 @@ function MiniMap({
|
|
|
9635
9551
|
viewportRect,
|
|
9636
9552
|
className
|
|
9637
9553
|
}) {
|
|
9638
|
-
const canvasRef =
|
|
9639
|
-
const frameRef =
|
|
9640
|
-
|
|
9554
|
+
const canvasRef = React127.useRef(null);
|
|
9555
|
+
const frameRef = React127.useRef(0);
|
|
9556
|
+
React127.useEffect(() => {
|
|
9641
9557
|
const canvas = canvasRef.current;
|
|
9642
9558
|
if (!canvas) return;
|
|
9643
9559
|
const ctx = canvas.getContext("2d");
|
|
@@ -9976,7 +9892,7 @@ var init_ErrorBoundary = __esm({
|
|
|
9976
9892
|
"use client";
|
|
9977
9893
|
init_cn();
|
|
9978
9894
|
init_ErrorState();
|
|
9979
|
-
ErrorBoundary = class extends
|
|
9895
|
+
ErrorBoundary = class extends React127__default.Component {
|
|
9980
9896
|
constructor(props) {
|
|
9981
9897
|
super(props);
|
|
9982
9898
|
__publicField(this, "reset", () => {
|
|
@@ -10449,8 +10365,8 @@ var init_Tooltip = __esm({
|
|
|
10449
10365
|
if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
|
|
10450
10366
|
};
|
|
10451
10367
|
}, []);
|
|
10452
|
-
const triggerElement =
|
|
10453
|
-
const trigger =
|
|
10368
|
+
const triggerElement = React127__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
10369
|
+
const trigger = React127__default.cloneElement(triggerElement, {
|
|
10454
10370
|
ref: triggerRef,
|
|
10455
10371
|
onMouseEnter: handleMouseEnter,
|
|
10456
10372
|
onMouseLeave: handleMouseLeave,
|
|
@@ -10571,8 +10487,8 @@ var init_Popover = __esm({
|
|
|
10571
10487
|
onMouseEnter: handleOpen,
|
|
10572
10488
|
onMouseLeave: handleClose
|
|
10573
10489
|
};
|
|
10574
|
-
const childElement =
|
|
10575
|
-
const triggerElement =
|
|
10490
|
+
const childElement = React127__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
10491
|
+
const triggerElement = React127__default.cloneElement(
|
|
10576
10492
|
childElement,
|
|
10577
10493
|
{
|
|
10578
10494
|
ref: triggerRef,
|
|
@@ -10689,8 +10605,8 @@ var init_Menu = __esm({
|
|
|
10689
10605
|
"bottom-start": "top-full left-0 mt-2",
|
|
10690
10606
|
"bottom-end": "top-full right-0 mt-2"
|
|
10691
10607
|
};
|
|
10692
|
-
const triggerChild =
|
|
10693
|
-
const triggerElement =
|
|
10608
|
+
const triggerChild = React127__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx("span", { children: trigger });
|
|
10609
|
+
const triggerElement = React127__default.cloneElement(
|
|
10694
10610
|
triggerChild,
|
|
10695
10611
|
{
|
|
10696
10612
|
ref: triggerRef,
|
|
@@ -11209,12 +11125,12 @@ var init_MapView = __esm({
|
|
|
11209
11125
|
shadowSize: [41, 41]
|
|
11210
11126
|
});
|
|
11211
11127
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
11212
|
-
const { useEffect: useEffect88, useRef:
|
|
11128
|
+
const { useEffect: useEffect88, useRef: useRef86, useCallback: useCallback124, useState: useState123 } = React127__default;
|
|
11213
11129
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
11214
11130
|
const { useEventBus: useEventBus3 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
11215
11131
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
11216
11132
|
const map = useMap();
|
|
11217
|
-
const prevRef =
|
|
11133
|
+
const prevRef = useRef86({ centerLat, centerLng, zoom });
|
|
11218
11134
|
useEffect88(() => {
|
|
11219
11135
|
const prev = prevRef.current;
|
|
11220
11136
|
if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
|
|
@@ -11253,8 +11169,8 @@ var init_MapView = __esm({
|
|
|
11253
11169
|
showAttribution = true
|
|
11254
11170
|
}) {
|
|
11255
11171
|
const eventBus = useEventBus3();
|
|
11256
|
-
const [clickedPosition, setClickedPosition] =
|
|
11257
|
-
const handleMapClick =
|
|
11172
|
+
const [clickedPosition, setClickedPosition] = useState123(null);
|
|
11173
|
+
const handleMapClick = useCallback124((lat, lng) => {
|
|
11258
11174
|
if (showClickedPin) {
|
|
11259
11175
|
setClickedPosition({ lat, lng });
|
|
11260
11176
|
}
|
|
@@ -11263,7 +11179,7 @@ var init_MapView = __esm({
|
|
|
11263
11179
|
eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
|
|
11264
11180
|
}
|
|
11265
11181
|
}, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
|
|
11266
|
-
const handleMarkerClick =
|
|
11182
|
+
const handleMarkerClick = useCallback124((marker) => {
|
|
11267
11183
|
onMarkerClick?.(marker);
|
|
11268
11184
|
if (markerClickEvent) {
|
|
11269
11185
|
eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
|
|
@@ -11440,7 +11356,7 @@ function InputPattern({
|
|
|
11440
11356
|
fieldName
|
|
11441
11357
|
}) {
|
|
11442
11358
|
const { emit } = useEventBus();
|
|
11443
|
-
const [localValue, setLocalValue] =
|
|
11359
|
+
const [localValue, setLocalValue] = React127__default.useState(value);
|
|
11444
11360
|
const handleChange = (e) => {
|
|
11445
11361
|
setLocalValue(e.target.value);
|
|
11446
11362
|
if (onChange) {
|
|
@@ -11478,7 +11394,7 @@ function TextareaPattern({
|
|
|
11478
11394
|
fieldName
|
|
11479
11395
|
}) {
|
|
11480
11396
|
const { emit } = useEventBus();
|
|
11481
|
-
const [localValue, setLocalValue] =
|
|
11397
|
+
const [localValue, setLocalValue] = React127__default.useState(value);
|
|
11482
11398
|
const handleChange = (e) => {
|
|
11483
11399
|
setLocalValue(e.target.value);
|
|
11484
11400
|
if (onChange) {
|
|
@@ -11510,7 +11426,7 @@ function SelectPattern({
|
|
|
11510
11426
|
fieldName
|
|
11511
11427
|
}) {
|
|
11512
11428
|
const { emit } = useEventBus();
|
|
11513
|
-
const [localValue, setLocalValue] =
|
|
11429
|
+
const [localValue, setLocalValue] = React127__default.useState(value);
|
|
11514
11430
|
const handleChange = (e) => {
|
|
11515
11431
|
setLocalValue(e.target.value);
|
|
11516
11432
|
if (onChange) {
|
|
@@ -11539,7 +11455,7 @@ function CheckboxPattern({
|
|
|
11539
11455
|
className
|
|
11540
11456
|
}) {
|
|
11541
11457
|
const { emit } = useEventBus();
|
|
11542
|
-
const [localChecked, setLocalChecked] =
|
|
11458
|
+
const [localChecked, setLocalChecked] = React127__default.useState(checked);
|
|
11543
11459
|
const handleChange = (e) => {
|
|
11544
11460
|
setLocalChecked(e.target.checked);
|
|
11545
11461
|
if (onChange) {
|
|
@@ -11770,8 +11686,8 @@ function ActionButtons({
|
|
|
11770
11686
|
disabled
|
|
11771
11687
|
}) {
|
|
11772
11688
|
const eventBus = useEventBus();
|
|
11773
|
-
const [activeButtons, setActiveButtons] =
|
|
11774
|
-
const handlePress =
|
|
11689
|
+
const [activeButtons, setActiveButtons] = React127.useState(/* @__PURE__ */ new Set());
|
|
11690
|
+
const handlePress = React127.useCallback(
|
|
11775
11691
|
(id) => {
|
|
11776
11692
|
setActiveButtons((prev) => new Set(prev).add(id));
|
|
11777
11693
|
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
|
|
@@ -11779,7 +11695,7 @@ function ActionButtons({
|
|
|
11779
11695
|
},
|
|
11780
11696
|
[actionEvent, eventBus, onAction]
|
|
11781
11697
|
);
|
|
11782
|
-
const handleRelease =
|
|
11698
|
+
const handleRelease = React127.useCallback(
|
|
11783
11699
|
(id) => {
|
|
11784
11700
|
setActiveButtons((prev) => {
|
|
11785
11701
|
const next = new Set(prev);
|
|
@@ -13847,7 +13763,7 @@ var init_MarkdownContent = __esm({
|
|
|
13847
13763
|
init_Box();
|
|
13848
13764
|
init_useTranslate();
|
|
13849
13765
|
init_cn();
|
|
13850
|
-
MarkdownContent =
|
|
13766
|
+
MarkdownContent = React127__default.memo(
|
|
13851
13767
|
({ content, direction, className }) => {
|
|
13852
13768
|
const { t: _t } = useTranslate();
|
|
13853
13769
|
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
@@ -14064,7 +13980,7 @@ var init_CodeBlock = __esm({
|
|
|
14064
13980
|
loloStyle = { ...dark, ...loloStyleOverrides };
|
|
14065
13981
|
LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
14066
13982
|
HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
14067
|
-
CodeBlock =
|
|
13983
|
+
CodeBlock = React127__default.memo(
|
|
14068
13984
|
({
|
|
14069
13985
|
code: rawCode,
|
|
14070
13986
|
language = "text",
|
|
@@ -15373,7 +15289,7 @@ var init_StateMachineView = __esm({
|
|
|
15373
15289
|
style: { top: title ? 30 : 0 },
|
|
15374
15290
|
children: [
|
|
15375
15291
|
entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
|
|
15376
|
-
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(
|
|
15292
|
+
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React127__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
|
|
15377
15293
|
StateNode,
|
|
15378
15294
|
{
|
|
15379
15295
|
state,
|
|
@@ -21156,7 +21072,7 @@ function CraftingRecipe({
|
|
|
21156
21072
|
className
|
|
21157
21073
|
}) {
|
|
21158
21074
|
const eventBus = useEventBus();
|
|
21159
|
-
const handleCraft =
|
|
21075
|
+
const handleCraft = React127.useCallback(() => {
|
|
21160
21076
|
onCraft?.();
|
|
21161
21077
|
if (craftEvent) {
|
|
21162
21078
|
eventBus.emit(craftEvent, { output: output.label });
|
|
@@ -21173,7 +21089,7 @@ function CraftingRecipe({
|
|
|
21173
21089
|
children: [
|
|
21174
21090
|
/* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-wrap items-center", children: inputs.map((ingredient, index) => {
|
|
21175
21091
|
const hasSufficient = ingredient.available >= ingredient.required;
|
|
21176
|
-
return /* @__PURE__ */ jsxs(
|
|
21092
|
+
return /* @__PURE__ */ jsxs(React127.Fragment, { children: [
|
|
21177
21093
|
/* @__PURE__ */ jsx(Box, { className: "relative", children: /* @__PURE__ */ jsx(
|
|
21178
21094
|
ItemSlot,
|
|
21179
21095
|
{
|
|
@@ -21467,8 +21383,8 @@ function DPad({
|
|
|
21467
21383
|
}) {
|
|
21468
21384
|
const eventBus = useEventBus();
|
|
21469
21385
|
const sizes = sizeMap15[size];
|
|
21470
|
-
const [activeDirections, setActiveDirections] =
|
|
21471
|
-
const handlePress =
|
|
21386
|
+
const [activeDirections, setActiveDirections] = React127.useState(/* @__PURE__ */ new Set());
|
|
21387
|
+
const handlePress = React127.useCallback(
|
|
21472
21388
|
(direction) => {
|
|
21473
21389
|
setActiveDirections((prev) => new Set(prev).add(direction));
|
|
21474
21390
|
if (directionEvent) eventBus.emit(`UI:${directionEvent}`, { direction, pressed: true });
|
|
@@ -21476,7 +21392,7 @@ function DPad({
|
|
|
21476
21392
|
},
|
|
21477
21393
|
[directionEvent, eventBus, onDirection]
|
|
21478
21394
|
);
|
|
21479
|
-
const handleRelease =
|
|
21395
|
+
const handleRelease = React127.useCallback(
|
|
21480
21396
|
(direction) => {
|
|
21481
21397
|
setActiveDirections((prev) => {
|
|
21482
21398
|
const next = new Set(prev);
|
|
@@ -22376,7 +22292,7 @@ function DataList({
|
|
|
22376
22292
|
}) {
|
|
22377
22293
|
const eventBus = useEventBus();
|
|
22378
22294
|
const { t } = useTranslate();
|
|
22379
|
-
const [visibleCount, setVisibleCount] =
|
|
22295
|
+
const [visibleCount, setVisibleCount] = React127__default.useState(pageSize || Infinity);
|
|
22380
22296
|
const allData = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
22381
22297
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
22382
22298
|
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
@@ -22416,7 +22332,7 @@ function DataList({
|
|
|
22416
22332
|
const items2 = data.map((item) => item);
|
|
22417
22333
|
const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
|
|
22418
22334
|
const contentField = titleField?.name ?? fields[0]?.name ?? "";
|
|
22419
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
22335
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React127__default.Fragment, { children: [
|
|
22420
22336
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
|
|
22421
22337
|
group.items.map((itemData, index) => {
|
|
22422
22338
|
const id = itemData.id || `${gi}-${index}`;
|
|
@@ -22463,7 +22379,7 @@ function DataList({
|
|
|
22463
22379
|
] }, gi)) });
|
|
22464
22380
|
}
|
|
22465
22381
|
const hasRenderProp = typeof children === "function";
|
|
22466
|
-
|
|
22382
|
+
React127__default.useEffect(() => {
|
|
22467
22383
|
const renderItemTypeOf = typeof schemaRenderItem;
|
|
22468
22384
|
const childrenTypeOf = typeof children;
|
|
22469
22385
|
if (data.length > 0 && !hasRenderProp) {
|
|
@@ -22628,7 +22544,7 @@ function DataList({
|
|
|
22628
22544
|
className
|
|
22629
22545
|
),
|
|
22630
22546
|
children: [
|
|
22631
|
-
groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
22547
|
+
groups.map((group, gi) => /* @__PURE__ */ jsxs(React127__default.Fragment, { children: [
|
|
22632
22548
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
|
|
22633
22549
|
group.items.map(
|
|
22634
22550
|
(itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
|
|
@@ -23904,7 +23820,7 @@ var init_WizardProgress = __esm({
|
|
|
23904
23820
|
children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
|
|
23905
23821
|
const isActive = index === currentStep;
|
|
23906
23822
|
const isCompleted = index < currentStep;
|
|
23907
|
-
return /* @__PURE__ */ jsxs(
|
|
23823
|
+
return /* @__PURE__ */ jsxs(React127__default.Fragment, { children: [
|
|
23908
23824
|
/* @__PURE__ */ jsx(
|
|
23909
23825
|
"button",
|
|
23910
23826
|
{
|
|
@@ -24815,7 +24731,7 @@ function InventoryGrid({
|
|
|
24815
24731
|
const eventBus = useEventBus();
|
|
24816
24732
|
const slotCount = totalSlots ?? items.length;
|
|
24817
24733
|
const emptySlotCount = Math.max(0, slotCount - items.length);
|
|
24818
|
-
const handleSelect =
|
|
24734
|
+
const handleSelect = React127.useCallback(
|
|
24819
24735
|
(id) => {
|
|
24820
24736
|
onSelect?.(id);
|
|
24821
24737
|
if (selectEvent) {
|
|
@@ -25028,15 +24944,15 @@ function GameCanvas2D({
|
|
|
25028
24944
|
fps = 60,
|
|
25029
24945
|
className
|
|
25030
24946
|
}) {
|
|
25031
|
-
const canvasRef =
|
|
25032
|
-
const rafRef =
|
|
25033
|
-
const frameRef =
|
|
25034
|
-
const lastTimeRef =
|
|
25035
|
-
const onDrawRef =
|
|
24947
|
+
const canvasRef = React127.useRef(null);
|
|
24948
|
+
const rafRef = React127.useRef(0);
|
|
24949
|
+
const frameRef = React127.useRef(0);
|
|
24950
|
+
const lastTimeRef = React127.useRef(0);
|
|
24951
|
+
const onDrawRef = React127.useRef(onDraw);
|
|
25036
24952
|
onDrawRef.current = onDraw;
|
|
25037
|
-
const onTickRef =
|
|
24953
|
+
const onTickRef = React127.useRef(onTick);
|
|
25038
24954
|
onTickRef.current = onTick;
|
|
25039
|
-
|
|
24955
|
+
React127.useEffect(() => {
|
|
25040
24956
|
const canvas = canvasRef.current;
|
|
25041
24957
|
if (!canvas) return;
|
|
25042
24958
|
const ctx = canvas.getContext("2d");
|
|
@@ -25325,7 +25241,7 @@ function TurnPanel({
|
|
|
25325
25241
|
className
|
|
25326
25242
|
}) {
|
|
25327
25243
|
const eventBus = useEventBus();
|
|
25328
|
-
const handleAction =
|
|
25244
|
+
const handleAction = React127.useCallback(
|
|
25329
25245
|
(event) => {
|
|
25330
25246
|
if (event) {
|
|
25331
25247
|
eventBus.emit(event, { turn: currentTurn, phase, activeTeam });
|
|
@@ -25471,7 +25387,7 @@ function UnitCommandBar({
|
|
|
25471
25387
|
className
|
|
25472
25388
|
}) {
|
|
25473
25389
|
const eventBus = useEventBus();
|
|
25474
|
-
const handleCommand =
|
|
25390
|
+
const handleCommand = React127.useCallback(
|
|
25475
25391
|
(event) => {
|
|
25476
25392
|
if (event) {
|
|
25477
25393
|
eventBus.emit(event, { unitId: selectedUnitId });
|
|
@@ -25956,7 +25872,7 @@ function GameMenu({
|
|
|
25956
25872
|
} catch {
|
|
25957
25873
|
}
|
|
25958
25874
|
const eventBus = eventBusProp || eventBusFromHook;
|
|
25959
|
-
const handleOptionClick =
|
|
25875
|
+
const handleOptionClick = React127.useCallback(
|
|
25960
25876
|
(option) => {
|
|
25961
25877
|
if (option.event && eventBus) {
|
|
25962
25878
|
eventBus.emit(`UI:${option.event}`, { option });
|
|
@@ -26070,7 +25986,7 @@ function GameOverScreen({
|
|
|
26070
25986
|
} catch {
|
|
26071
25987
|
}
|
|
26072
25988
|
const eventBus = eventBusProp || eventBusFromHook;
|
|
26073
|
-
const handleActionClick =
|
|
25989
|
+
const handleActionClick = React127.useCallback(
|
|
26074
25990
|
(action) => {
|
|
26075
25991
|
if (action.event && eventBus) {
|
|
26076
25992
|
eventBus.emit(`UI:${action.event}`, { action });
|
|
@@ -29174,7 +29090,7 @@ var init_StepFlow = __esm({
|
|
|
29174
29090
|
className
|
|
29175
29091
|
}) => {
|
|
29176
29092
|
if (orientation === "vertical") {
|
|
29177
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(
|
|
29093
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React127__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
|
|
29178
29094
|
/* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
|
|
29179
29095
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
29180
29096
|
showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
|
|
@@ -29185,7 +29101,7 @@ var init_StepFlow = __esm({
|
|
|
29185
29101
|
] })
|
|
29186
29102
|
] }) }, index)) });
|
|
29187
29103
|
}
|
|
29188
|
-
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(
|
|
29104
|
+
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(React127__default.Fragment, { children: [
|
|
29189
29105
|
/* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
|
|
29190
29106
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
29191
29107
|
/* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
|
|
@@ -31299,7 +31215,7 @@ var init_DocumentViewer = __esm({
|
|
|
31299
31215
|
}
|
|
31300
31216
|
});
|
|
31301
31217
|
function extractTitle(children) {
|
|
31302
|
-
if (!
|
|
31218
|
+
if (!React127__default.isValidElement(children)) return void 0;
|
|
31303
31219
|
const props = children.props;
|
|
31304
31220
|
if (typeof props.title === "string") {
|
|
31305
31221
|
return props.title;
|
|
@@ -31354,7 +31270,7 @@ function LinearView({
|
|
|
31354
31270
|
/* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
|
|
31355
31271
|
const isDone = i < currentIdx;
|
|
31356
31272
|
const isCurrent = i === currentIdx;
|
|
31357
|
-
return /* @__PURE__ */ jsxs(
|
|
31273
|
+
return /* @__PURE__ */ jsxs(React127__default.Fragment, { children: [
|
|
31358
31274
|
i > 0 && /* @__PURE__ */ jsx(
|
|
31359
31275
|
Typography,
|
|
31360
31276
|
{
|
|
@@ -32138,12 +32054,12 @@ var init_Form = __esm({
|
|
|
32138
32054
|
const isSchemaEntity = isOrbitalEntitySchema(entity);
|
|
32139
32055
|
const resolvedEntity = isSchemaEntity ? entity : void 0;
|
|
32140
32056
|
const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
|
|
32141
|
-
const normalizedInitialData =
|
|
32057
|
+
const normalizedInitialData = React127__default.useMemo(() => {
|
|
32142
32058
|
const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
|
|
32143
32059
|
const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
|
|
32144
32060
|
return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
|
|
32145
32061
|
}, [entity, initialData]);
|
|
32146
|
-
const entityDerivedFields =
|
|
32062
|
+
const entityDerivedFields = React127__default.useMemo(() => {
|
|
32147
32063
|
if (fields && fields.length > 0) return void 0;
|
|
32148
32064
|
if (!resolvedEntity) return void 0;
|
|
32149
32065
|
return resolvedEntity.fields.map(
|
|
@@ -32162,14 +32078,14 @@ var init_Form = __esm({
|
|
|
32162
32078
|
const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
|
|
32163
32079
|
const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
|
|
32164
32080
|
const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
|
|
32165
|
-
const [formData, setFormData] =
|
|
32081
|
+
const [formData, setFormData] = React127__default.useState(
|
|
32166
32082
|
normalizedInitialData
|
|
32167
32083
|
);
|
|
32168
|
-
const [collapsedSections, setCollapsedSections] =
|
|
32084
|
+
const [collapsedSections, setCollapsedSections] = React127__default.useState(
|
|
32169
32085
|
/* @__PURE__ */ new Set()
|
|
32170
32086
|
);
|
|
32171
32087
|
const formMode = props.mode;
|
|
32172
|
-
const mountedRef =
|
|
32088
|
+
const mountedRef = React127__default.useRef(false);
|
|
32173
32089
|
if (!mountedRef.current) {
|
|
32174
32090
|
mountedRef.current = true;
|
|
32175
32091
|
debug("forms", "mount", {
|
|
@@ -32182,7 +32098,7 @@ var init_Form = __esm({
|
|
|
32182
32098
|
});
|
|
32183
32099
|
}
|
|
32184
32100
|
const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
|
|
32185
|
-
const evalContext =
|
|
32101
|
+
const evalContext = React127__default.useMemo(
|
|
32186
32102
|
() => ({
|
|
32187
32103
|
formValues: formData,
|
|
32188
32104
|
globalVariables: externalContext?.globalVariables ?? {},
|
|
@@ -32191,7 +32107,7 @@ var init_Form = __esm({
|
|
|
32191
32107
|
}),
|
|
32192
32108
|
[formData, externalContext]
|
|
32193
32109
|
);
|
|
32194
|
-
|
|
32110
|
+
React127__default.useEffect(() => {
|
|
32195
32111
|
debug("forms", "initialData-sync", {
|
|
32196
32112
|
mode: formMode,
|
|
32197
32113
|
normalizedInitialData,
|
|
@@ -32202,7 +32118,7 @@ var init_Form = __esm({
|
|
|
32202
32118
|
setFormData(normalizedInitialData);
|
|
32203
32119
|
}
|
|
32204
32120
|
}, [normalizedInitialData]);
|
|
32205
|
-
const processCalculations =
|
|
32121
|
+
const processCalculations = React127__default.useCallback(
|
|
32206
32122
|
(changedFieldId, newFormData) => {
|
|
32207
32123
|
if (!hiddenCalculations.length) return;
|
|
32208
32124
|
const context = {
|
|
@@ -32227,7 +32143,7 @@ var init_Form = __esm({
|
|
|
32227
32143
|
},
|
|
32228
32144
|
[hiddenCalculations, externalContext, eventBus]
|
|
32229
32145
|
);
|
|
32230
|
-
const checkViolations =
|
|
32146
|
+
const checkViolations = React127__default.useCallback(
|
|
32231
32147
|
(changedFieldId, newFormData) => {
|
|
32232
32148
|
if (!violationTriggers.length) return;
|
|
32233
32149
|
const context = {
|
|
@@ -32265,7 +32181,7 @@ var init_Form = __esm({
|
|
|
32265
32181
|
processCalculations(name, newFormData);
|
|
32266
32182
|
checkViolations(name, newFormData);
|
|
32267
32183
|
};
|
|
32268
|
-
const isFieldVisible =
|
|
32184
|
+
const isFieldVisible = React127__default.useCallback(
|
|
32269
32185
|
(fieldName) => {
|
|
32270
32186
|
const condition = conditionalFields[fieldName];
|
|
32271
32187
|
if (!condition) return true;
|
|
@@ -32273,7 +32189,7 @@ var init_Form = __esm({
|
|
|
32273
32189
|
},
|
|
32274
32190
|
[conditionalFields, evalContext]
|
|
32275
32191
|
);
|
|
32276
|
-
const isSectionVisible =
|
|
32192
|
+
const isSectionVisible = React127__default.useCallback(
|
|
32277
32193
|
(section) => {
|
|
32278
32194
|
if (!section.condition) return true;
|
|
32279
32195
|
return Boolean(evaluateFormExpression(section.condition, evalContext));
|
|
@@ -32317,7 +32233,7 @@ var init_Form = __esm({
|
|
|
32317
32233
|
eventBus.emit(`UI:${onCancel}`);
|
|
32318
32234
|
}
|
|
32319
32235
|
};
|
|
32320
|
-
const renderField =
|
|
32236
|
+
const renderField = React127__default.useCallback(
|
|
32321
32237
|
(field) => {
|
|
32322
32238
|
const fieldName = field.name || field.field;
|
|
32323
32239
|
if (!fieldName) return null;
|
|
@@ -32338,7 +32254,7 @@ var init_Form = __esm({
|
|
|
32338
32254
|
[formData, isFieldVisible, relationsData, relationsLoading, isLoading]
|
|
32339
32255
|
);
|
|
32340
32256
|
const effectiveFields = entityDerivedFields ?? fields;
|
|
32341
|
-
const normalizedFields =
|
|
32257
|
+
const normalizedFields = React127__default.useMemo(() => {
|
|
32342
32258
|
if (!effectiveFields || effectiveFields.length === 0) return [];
|
|
32343
32259
|
return effectiveFields.map((field) => {
|
|
32344
32260
|
if (typeof field === "string") {
|
|
@@ -32360,7 +32276,7 @@ var init_Form = __esm({
|
|
|
32360
32276
|
return field;
|
|
32361
32277
|
});
|
|
32362
32278
|
}, [effectiveFields, resolvedEntity]);
|
|
32363
|
-
const schemaFields =
|
|
32279
|
+
const schemaFields = React127__default.useMemo(() => {
|
|
32364
32280
|
if (normalizedFields.length === 0) return null;
|
|
32365
32281
|
if (isDebugEnabled()) {
|
|
32366
32282
|
debugGroup(`Form: ${entityName || "unknown"}`);
|
|
@@ -32370,7 +32286,7 @@ var init_Form = __esm({
|
|
|
32370
32286
|
}
|
|
32371
32287
|
return normalizedFields.map(renderField).filter(Boolean);
|
|
32372
32288
|
}, [normalizedFields, renderField, entityName, conditionalFields]);
|
|
32373
|
-
const sectionElements =
|
|
32289
|
+
const sectionElements = React127__default.useMemo(() => {
|
|
32374
32290
|
if (!sections || sections.length === 0) return null;
|
|
32375
32291
|
return sections.map((section) => {
|
|
32376
32292
|
if (!isSectionVisible(section)) {
|
|
@@ -33894,7 +33810,7 @@ var init_List = __esm({
|
|
|
33894
33810
|
if (entity && typeof entity === "object" && "id" in entity) return [entity];
|
|
33895
33811
|
return [];
|
|
33896
33812
|
}, [entity]);
|
|
33897
|
-
const getItemActions =
|
|
33813
|
+
const getItemActions = React127__default.useCallback(
|
|
33898
33814
|
(item) => {
|
|
33899
33815
|
if (!itemActions) return [];
|
|
33900
33816
|
if (typeof itemActions === "function") {
|
|
@@ -34331,7 +34247,7 @@ var init_MediaGallery = __esm({
|
|
|
34331
34247
|
[selectable, selectedItems, selectionEvent, eventBus]
|
|
34332
34248
|
);
|
|
34333
34249
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
34334
|
-
const items =
|
|
34250
|
+
const items = React127__default.useMemo(() => {
|
|
34335
34251
|
if (propItems) return propItems;
|
|
34336
34252
|
if (entityData.length === 0) return [];
|
|
34337
34253
|
return entityData.map((record, idx) => ({
|
|
@@ -34495,7 +34411,7 @@ var init_MediaGallery = __esm({
|
|
|
34495
34411
|
}
|
|
34496
34412
|
});
|
|
34497
34413
|
function extractTitle2(children) {
|
|
34498
|
-
if (!
|
|
34414
|
+
if (!React127__default.isValidElement(children)) return void 0;
|
|
34499
34415
|
const props = children.props;
|
|
34500
34416
|
if (typeof props.title === "string") {
|
|
34501
34417
|
return props.title;
|
|
@@ -35208,7 +35124,7 @@ var init_PageHeader = __esm({
|
|
|
35208
35124
|
info: "bg-info/10 text-info"
|
|
35209
35125
|
};
|
|
35210
35126
|
return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
|
|
35211
|
-
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(
|
|
35127
|
+
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(React127__default.Fragment, { children: [
|
|
35212
35128
|
idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
|
|
35213
35129
|
crumb.href ? /* @__PURE__ */ jsx(
|
|
35214
35130
|
"a",
|
|
@@ -35401,7 +35317,7 @@ var init_debugRegistry = __esm({
|
|
|
35401
35317
|
}
|
|
35402
35318
|
});
|
|
35403
35319
|
function useDebugData() {
|
|
35404
|
-
const [data, setData] =
|
|
35320
|
+
const [data, setData] = React127.useState(() => ({
|
|
35405
35321
|
traits: [],
|
|
35406
35322
|
ticks: [],
|
|
35407
35323
|
guards: [],
|
|
@@ -35415,7 +35331,7 @@ function useDebugData() {
|
|
|
35415
35331
|
},
|
|
35416
35332
|
lastUpdate: Date.now()
|
|
35417
35333
|
}));
|
|
35418
|
-
|
|
35334
|
+
React127.useEffect(() => {
|
|
35419
35335
|
const updateData = () => {
|
|
35420
35336
|
setData({
|
|
35421
35337
|
traits: getAllTraits(),
|
|
@@ -35524,12 +35440,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
|
|
|
35524
35440
|
return positions;
|
|
35525
35441
|
}
|
|
35526
35442
|
function WalkMinimap() {
|
|
35527
|
-
const [walkStep, setWalkStep] =
|
|
35528
|
-
const [traits2, setTraits] =
|
|
35529
|
-
const [coveredEdges, setCoveredEdges] =
|
|
35530
|
-
const [completedTraits, setCompletedTraits] =
|
|
35531
|
-
const prevTraitRef =
|
|
35532
|
-
|
|
35443
|
+
const [walkStep, setWalkStep] = React127.useState(null);
|
|
35444
|
+
const [traits2, setTraits] = React127.useState([]);
|
|
35445
|
+
const [coveredEdges, setCoveredEdges] = React127.useState([]);
|
|
35446
|
+
const [completedTraits, setCompletedTraits] = React127.useState(/* @__PURE__ */ new Set());
|
|
35447
|
+
const prevTraitRef = React127.useRef(null);
|
|
35448
|
+
React127.useEffect(() => {
|
|
35533
35449
|
const interval = setInterval(() => {
|
|
35534
35450
|
const w = window;
|
|
35535
35451
|
const step = w.__orbitalWalkStep;
|
|
@@ -35976,15 +35892,15 @@ var init_EntitiesTab = __esm({
|
|
|
35976
35892
|
}
|
|
35977
35893
|
});
|
|
35978
35894
|
function EventFlowTab({ events: events2 }) {
|
|
35979
|
-
const [filter, setFilter] =
|
|
35980
|
-
const containerRef =
|
|
35981
|
-
const [autoScroll, setAutoScroll] =
|
|
35982
|
-
|
|
35895
|
+
const [filter, setFilter] = React127.useState("all");
|
|
35896
|
+
const containerRef = React127.useRef(null);
|
|
35897
|
+
const [autoScroll, setAutoScroll] = React127.useState(true);
|
|
35898
|
+
React127.useEffect(() => {
|
|
35983
35899
|
if (autoScroll && containerRef.current) {
|
|
35984
35900
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
35985
35901
|
}
|
|
35986
35902
|
}, [events2.length, autoScroll]);
|
|
35987
|
-
const filteredEvents =
|
|
35903
|
+
const filteredEvents = React127.useMemo(() => {
|
|
35988
35904
|
if (filter === "all") return events2;
|
|
35989
35905
|
return events2.filter((e) => e.type === filter);
|
|
35990
35906
|
}, [events2, filter]);
|
|
@@ -36103,7 +36019,7 @@ var init_EventFlowTab = __esm({
|
|
|
36103
36019
|
}
|
|
36104
36020
|
});
|
|
36105
36021
|
function GuardsPanel({ guards }) {
|
|
36106
|
-
const [filter, setFilter] =
|
|
36022
|
+
const [filter, setFilter] = React127.useState("all");
|
|
36107
36023
|
if (guards.length === 0) {
|
|
36108
36024
|
return /* @__PURE__ */ jsx(
|
|
36109
36025
|
EmptyState,
|
|
@@ -36116,7 +36032,7 @@ function GuardsPanel({ guards }) {
|
|
|
36116
36032
|
}
|
|
36117
36033
|
const passedCount = guards.filter((g) => g.result).length;
|
|
36118
36034
|
const failedCount = guards.length - passedCount;
|
|
36119
|
-
const filteredGuards =
|
|
36035
|
+
const filteredGuards = React127.useMemo(() => {
|
|
36120
36036
|
if (filter === "all") return guards;
|
|
36121
36037
|
if (filter === "passed") return guards.filter((g) => g.result);
|
|
36122
36038
|
return guards.filter((g) => !g.result);
|
|
@@ -36277,10 +36193,10 @@ function EffectBadge({ effect }) {
|
|
|
36277
36193
|
] });
|
|
36278
36194
|
}
|
|
36279
36195
|
function TransitionTimeline({ transitions }) {
|
|
36280
|
-
const containerRef =
|
|
36281
|
-
const [autoScroll, setAutoScroll] =
|
|
36282
|
-
const [expandedId, setExpandedId] =
|
|
36283
|
-
|
|
36196
|
+
const containerRef = React127.useRef(null);
|
|
36197
|
+
const [autoScroll, setAutoScroll] = React127.useState(true);
|
|
36198
|
+
const [expandedId, setExpandedId] = React127.useState(null);
|
|
36199
|
+
React127.useEffect(() => {
|
|
36284
36200
|
if (autoScroll && containerRef.current) {
|
|
36285
36201
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
36286
36202
|
}
|
|
@@ -36566,9 +36482,9 @@ function getAllEvents(traits2) {
|
|
|
36566
36482
|
}
|
|
36567
36483
|
function EventDispatcherTab({ traits: traits2, schema }) {
|
|
36568
36484
|
const eventBus = useEventBus();
|
|
36569
|
-
const [log4, setLog] =
|
|
36570
|
-
const prevStatesRef =
|
|
36571
|
-
|
|
36485
|
+
const [log4, setLog] = React127.useState([]);
|
|
36486
|
+
const prevStatesRef = React127.useRef(/* @__PURE__ */ new Map());
|
|
36487
|
+
React127.useEffect(() => {
|
|
36572
36488
|
for (const trait of traits2) {
|
|
36573
36489
|
const prev = prevStatesRef.current.get(trait.id);
|
|
36574
36490
|
if (prev && prev !== trait.currentState) {
|
|
@@ -36738,10 +36654,10 @@ function VerifyModePanel({
|
|
|
36738
36654
|
serverCount,
|
|
36739
36655
|
localCount
|
|
36740
36656
|
}) {
|
|
36741
|
-
const [expanded, setExpanded] =
|
|
36742
|
-
const scrollRef =
|
|
36743
|
-
const prevCountRef =
|
|
36744
|
-
|
|
36657
|
+
const [expanded, setExpanded] = React127.useState(true);
|
|
36658
|
+
const scrollRef = React127.useRef(null);
|
|
36659
|
+
const prevCountRef = React127.useRef(0);
|
|
36660
|
+
React127.useEffect(() => {
|
|
36745
36661
|
if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
|
|
36746
36662
|
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
36747
36663
|
}
|
|
@@ -36807,10 +36723,10 @@ function RuntimeDebugger({
|
|
|
36807
36723
|
defaultTab,
|
|
36808
36724
|
schema
|
|
36809
36725
|
}) {
|
|
36810
|
-
const [isCollapsed, setIsCollapsed] =
|
|
36811
|
-
const [isVisible, setIsVisible] =
|
|
36726
|
+
const [isCollapsed, setIsCollapsed] = React127.useState(mode === "verify" ? true : defaultCollapsed);
|
|
36727
|
+
const [isVisible, setIsVisible] = React127.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
|
|
36812
36728
|
const debugData = useDebugData();
|
|
36813
|
-
|
|
36729
|
+
React127.useEffect(() => {
|
|
36814
36730
|
if (mode === "inline") return;
|
|
36815
36731
|
return onDebugToggle((enabled) => {
|
|
36816
36732
|
setIsVisible(enabled);
|
|
@@ -36819,7 +36735,7 @@ function RuntimeDebugger({
|
|
|
36819
36735
|
}
|
|
36820
36736
|
});
|
|
36821
36737
|
}, [mode]);
|
|
36822
|
-
|
|
36738
|
+
React127.useEffect(() => {
|
|
36823
36739
|
if (mode === "inline") return;
|
|
36824
36740
|
const handleKeyDown = (e) => {
|
|
36825
36741
|
if (e.key === "`" && isVisible) {
|
|
@@ -37368,7 +37284,7 @@ function SequenceBar({
|
|
|
37368
37284
|
onSlotRemove(index);
|
|
37369
37285
|
}, [onSlotRemove, playing]);
|
|
37370
37286
|
const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
|
|
37371
|
-
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(
|
|
37287
|
+
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React127__default.Fragment, { children: [
|
|
37372
37288
|
i > 0 && /* @__PURE__ */ jsx(
|
|
37373
37289
|
Typography,
|
|
37374
37290
|
{
|
|
@@ -38713,7 +38629,7 @@ var init_StatCard2 = __esm({
|
|
|
38713
38629
|
const labelToUse = propLabel ?? propTitle;
|
|
38714
38630
|
const eventBus = useEventBus();
|
|
38715
38631
|
const { t } = useTranslate();
|
|
38716
|
-
const handleActionClick =
|
|
38632
|
+
const handleActionClick = React127__default.useCallback(() => {
|
|
38717
38633
|
if (action?.event) {
|
|
38718
38634
|
eventBus.emit(`UI:${action.event}`, {});
|
|
38719
38635
|
}
|
|
@@ -38724,7 +38640,7 @@ var init_StatCard2 = __esm({
|
|
|
38724
38640
|
const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
38725
38641
|
const isLoading = externalLoading ?? false;
|
|
38726
38642
|
const error = externalError;
|
|
38727
|
-
const computeMetricValue =
|
|
38643
|
+
const computeMetricValue = React127__default.useCallback(
|
|
38728
38644
|
(metric, items) => {
|
|
38729
38645
|
if (metric.value !== void 0) {
|
|
38730
38646
|
return metric.value;
|
|
@@ -38763,7 +38679,7 @@ var init_StatCard2 = __esm({
|
|
|
38763
38679
|
},
|
|
38764
38680
|
[]
|
|
38765
38681
|
);
|
|
38766
|
-
const schemaStats =
|
|
38682
|
+
const schemaStats = React127__default.useMemo(() => {
|
|
38767
38683
|
if (!metrics || metrics.length === 0) return null;
|
|
38768
38684
|
return metrics.map((metric) => ({
|
|
38769
38685
|
label: metric.label,
|
|
@@ -38771,7 +38687,7 @@ var init_StatCard2 = __esm({
|
|
|
38771
38687
|
format: metric.format
|
|
38772
38688
|
}));
|
|
38773
38689
|
}, [metrics, data, computeMetricValue]);
|
|
38774
|
-
const calculatedTrend =
|
|
38690
|
+
const calculatedTrend = React127__default.useMemo(() => {
|
|
38775
38691
|
if (manualTrend !== void 0) return manualTrend;
|
|
38776
38692
|
if (previousValue === void 0 || currentValue === void 0)
|
|
38777
38693
|
return void 0;
|
|
@@ -39755,7 +39671,7 @@ var init_Timeline = __esm({
|
|
|
39755
39671
|
}) => {
|
|
39756
39672
|
const { t } = useTranslate();
|
|
39757
39673
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
39758
|
-
const items =
|
|
39674
|
+
const items = React127__default.useMemo(() => {
|
|
39759
39675
|
if (propItems) return propItems;
|
|
39760
39676
|
if (entityData.length === 0) return [];
|
|
39761
39677
|
return entityData.map((record, idx) => {
|
|
@@ -39862,7 +39778,7 @@ var init_Timeline = __esm({
|
|
|
39862
39778
|
}
|
|
39863
39779
|
});
|
|
39864
39780
|
function extractToastProps(children) {
|
|
39865
|
-
if (!
|
|
39781
|
+
if (!React127__default.isValidElement(children)) {
|
|
39866
39782
|
if (typeof children === "string") {
|
|
39867
39783
|
return { message: children };
|
|
39868
39784
|
}
|
|
@@ -39900,7 +39816,7 @@ var init_ToastSlot = __esm({
|
|
|
39900
39816
|
eventBus.emit("UI:CLOSE");
|
|
39901
39817
|
};
|
|
39902
39818
|
if (!isVisible) return null;
|
|
39903
|
-
const isCustomContent =
|
|
39819
|
+
const isCustomContent = React127__default.isValidElement(children) && !message;
|
|
39904
39820
|
return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
|
|
39905
39821
|
Toast,
|
|
39906
39822
|
{
|
|
@@ -40169,7 +40085,7 @@ var init_WizardContainer = __esm({
|
|
|
40169
40085
|
const isCompleted = index < currentStep;
|
|
40170
40086
|
const stepKey = step.id ?? step.tabId ?? `step-${index}`;
|
|
40171
40087
|
const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
|
|
40172
|
-
return /* @__PURE__ */ jsxs(
|
|
40088
|
+
return /* @__PURE__ */ jsxs(React127__default.Fragment, { children: [
|
|
40173
40089
|
/* @__PURE__ */ jsx(
|
|
40174
40090
|
Button,
|
|
40175
40091
|
{
|
|
@@ -42358,7 +42274,7 @@ function UnitRenderer({
|
|
|
42358
42274
|
onAnimationStateChange,
|
|
42359
42275
|
animationSpeed = 1
|
|
42360
42276
|
}) {
|
|
42361
|
-
const handleUnitClick =
|
|
42277
|
+
const handleUnitClick = React127__default.useCallback(
|
|
42362
42278
|
(unit) => {
|
|
42363
42279
|
onUnitClick?.(unit);
|
|
42364
42280
|
},
|
|
@@ -45552,7 +45468,7 @@ var init_Avl3DViewer = __esm({
|
|
|
45552
45468
|
const handleTraitClick = useCallback((name) => {
|
|
45553
45469
|
dispatch({ type: "ZOOM_INTO_TRAIT", trait: name, targetPosition: { x: 0, y: 0 } });
|
|
45554
45470
|
}, []);
|
|
45555
|
-
const [highlightedTrait, setHighlightedTrait] =
|
|
45471
|
+
const [highlightedTrait, setHighlightedTrait] = React127__default.useState(null);
|
|
45556
45472
|
const handleTransitionClick = useCallback((index) => {
|
|
45557
45473
|
dispatch({ type: "ZOOM_INTO_TRANSITION", transitionIndex: index, targetPosition: { x: 0, y: 0 } });
|
|
45558
45474
|
}, []);
|
|
@@ -45639,7 +45555,7 @@ var init_Avl3DViewer = __esm({
|
|
|
45639
45555
|
gap: "xs",
|
|
45640
45556
|
align: "center",
|
|
45641
45557
|
className: "absolute top-2 left-2 z-10 bg-surface/80 backdrop-blur rounded-md px-3 py-1.5",
|
|
45642
|
-
children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(
|
|
45558
|
+
children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(React127__default.Fragment, { children: [
|
|
45643
45559
|
i > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", className: "mx-1", children: "/" }),
|
|
45644
45560
|
i < breadcrumbs.length - 1 ? /* @__PURE__ */ jsx(
|
|
45645
45561
|
Box,
|
|
@@ -46017,12 +45933,12 @@ var init_three = __esm({
|
|
|
46017
45933
|
}
|
|
46018
45934
|
});
|
|
46019
45935
|
function lazyThree(name, loader) {
|
|
46020
|
-
const Lazy =
|
|
45936
|
+
const Lazy = React127__default.lazy(() => loader().then((m) => ({ default: m[name] })));
|
|
46021
45937
|
function ThreeWrapper(props) {
|
|
46022
|
-
return
|
|
46023
|
-
|
|
45938
|
+
return React127__default.createElement(
|
|
45939
|
+
React127__default.Suspense,
|
|
46024
45940
|
{ fallback: null },
|
|
46025
|
-
|
|
45941
|
+
React127__default.createElement(Lazy, props)
|
|
46026
45942
|
);
|
|
46027
45943
|
}
|
|
46028
45944
|
ThreeWrapper.displayName = `Lazy(${name})`;
|
|
@@ -46510,7 +46426,7 @@ function SuspenseConfigProvider({
|
|
|
46510
46426
|
config,
|
|
46511
46427
|
children
|
|
46512
46428
|
}) {
|
|
46513
|
-
return
|
|
46429
|
+
return React127__default.createElement(
|
|
46514
46430
|
SuspenseConfigContext.Provider,
|
|
46515
46431
|
{ value: config },
|
|
46516
46432
|
children
|
|
@@ -46993,7 +46909,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
|
|
|
46993
46909
|
const key = `${parentId}-${index}-trait:${traitName}`;
|
|
46994
46910
|
return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
|
|
46995
46911
|
}
|
|
46996
|
-
return /* @__PURE__ */ jsx(
|
|
46912
|
+
return /* @__PURE__ */ jsx(React127__default.Fragment, { children: child }, `${parentId}-${index}`);
|
|
46997
46913
|
}
|
|
46998
46914
|
if (!child || typeof child !== "object") return null;
|
|
46999
46915
|
const childId = `${parentId}-${index}`;
|
|
@@ -47208,7 +47124,7 @@ var init_UISlotRenderer = __esm({
|
|
|
47208
47124
|
init_Box();
|
|
47209
47125
|
init_Typography();
|
|
47210
47126
|
init_useEventBus();
|
|
47211
|
-
|
|
47127
|
+
init_slot_types();
|
|
47212
47128
|
init_cn();
|
|
47213
47129
|
init_ErrorBoundary();
|
|
47214
47130
|
init_logger();
|
|
@@ -47637,7 +47553,7 @@ var AvlTransition = ({
|
|
|
47637
47553
|
opacity = 1,
|
|
47638
47554
|
className
|
|
47639
47555
|
}) => {
|
|
47640
|
-
const ids =
|
|
47556
|
+
const ids = React127__default.useMemo(() => {
|
|
47641
47557
|
avlTransitionId += 1;
|
|
47642
47558
|
return { arrow: `avl-tr-${avlTransitionId}-arrow` };
|
|
47643
47559
|
}, []);
|
|
@@ -48402,7 +48318,7 @@ var AvlStateMachine = ({
|
|
|
48402
48318
|
color = "var(--color-primary)",
|
|
48403
48319
|
animated = false
|
|
48404
48320
|
}) => {
|
|
48405
|
-
const ids =
|
|
48321
|
+
const ids = React127__default.useMemo(() => {
|
|
48406
48322
|
avlSmId += 1;
|
|
48407
48323
|
const base = `avl-sm-${avlSmId}`;
|
|
48408
48324
|
return { glow: `${base}-glow`, grad: `${base}-grad` };
|
|
@@ -48597,7 +48513,7 @@ var AvlOrbitalUnit = ({
|
|
|
48597
48513
|
color = "var(--color-primary)",
|
|
48598
48514
|
animated = false
|
|
48599
48515
|
}) => {
|
|
48600
|
-
const ids =
|
|
48516
|
+
const ids = React127__default.useMemo(() => {
|
|
48601
48517
|
avlOuId += 1;
|
|
48602
48518
|
const base = `avl-ou-${avlOuId}`;
|
|
48603
48519
|
return { glow: `${base}-glow`, grad: `${base}-grad` };
|
|
@@ -48689,7 +48605,7 @@ var AvlClosedCircuit = ({
|
|
|
48689
48605
|
color = "var(--color-primary)",
|
|
48690
48606
|
animated = false
|
|
48691
48607
|
}) => {
|
|
48692
|
-
const ids =
|
|
48608
|
+
const ids = React127__default.useMemo(() => {
|
|
48693
48609
|
avlCcId += 1;
|
|
48694
48610
|
const base = `avl-cc-${avlCcId}`;
|
|
48695
48611
|
return { glow: `${base}-glow`, grad: `${base}-grad`, arrow: `${base}-arrow` };
|
|
@@ -48842,7 +48758,7 @@ var AvlEmitListen = ({
|
|
|
48842
48758
|
color = "var(--color-primary)",
|
|
48843
48759
|
animated = false
|
|
48844
48760
|
}) => {
|
|
48845
|
-
const ids =
|
|
48761
|
+
const ids = React127__default.useMemo(() => {
|
|
48846
48762
|
avlElId += 1;
|
|
48847
48763
|
const base = `avl-el-${avlElId}`;
|
|
48848
48764
|
return { arrow: `${base}-arrow`, grad: `${base}-grad` };
|
|
@@ -49115,7 +49031,7 @@ function renderNode(node, color, glowId) {
|
|
|
49115
49031
|
const baseR = node.type === "operator" ? 20 : 16;
|
|
49116
49032
|
const r2 = Math.max(baseR, labelLen * 3.5 + 6);
|
|
49117
49033
|
const nc = nodeColor(node.type, color);
|
|
49118
|
-
return /* @__PURE__ */ jsxs(
|
|
49034
|
+
return /* @__PURE__ */ jsxs(React127__default.Fragment, { children: [
|
|
49119
49035
|
node.children.map((child, i) => {
|
|
49120
49036
|
const childR = Math.max(
|
|
49121
49037
|
child.type === "operator" ? 20 : 16,
|
|
@@ -49172,7 +49088,7 @@ var AvlExprTree = ({
|
|
|
49172
49088
|
className,
|
|
49173
49089
|
color = "var(--color-primary)"
|
|
49174
49090
|
}) => {
|
|
49175
|
-
const ids =
|
|
49091
|
+
const ids = React127__default.useMemo(() => {
|
|
49176
49092
|
avlEtId += 1;
|
|
49177
49093
|
return { glow: `avl-et-${avlEtId}-glow` };
|
|
49178
49094
|
}, []);
|
|
@@ -50146,7 +50062,7 @@ var SystemNode = ({ data }) => {
|
|
|
50146
50062
|
stateChain.length > 0 && /* @__PURE__ */ jsx("svg", { width: stateChain.length * 14 + 2, height: 10, viewBox: `0 0 ${stateChain.length * 14 + 2} 10`, children: stateChain.map((s, i) => {
|
|
50147
50063
|
const tc = transitionCounts[s.name] ?? 0;
|
|
50148
50064
|
const role = getStateRole(s.name, s.isInitial, s.isTerminal, tc, maxTC);
|
|
50149
|
-
return /* @__PURE__ */ jsxs(
|
|
50065
|
+
return /* @__PURE__ */ jsxs(React127__default.Fragment, { children: [
|
|
50150
50066
|
/* @__PURE__ */ jsx(AvlState, { x: i * 14 + 1, y: 1, width: 10, height: 8, name: "", role, isInitial: s.isInitial, isTerminal: s.isTerminal }),
|
|
50151
50067
|
i < stateChain.length - 1 && /* @__PURE__ */ jsx("line", { x1: i * 14 + 12, y1: 5, x2: i * 14 + 15, y2: 5, stroke: "var(--color-border)", strokeWidth: 0.5 })
|
|
50152
50068
|
] }, s.name);
|
|
@@ -50186,7 +50102,7 @@ var MiniStateMachine = ({ data, className }) => {
|
|
|
50186
50102
|
const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
|
|
50187
50103
|
const tc = transitionCounts[s.name] ?? 0;
|
|
50188
50104
|
const role = getStateRole(s.name, s.isInitial, s.isTerminal, tc, maxTC);
|
|
50189
|
-
return /* @__PURE__ */ jsxs(
|
|
50105
|
+
return /* @__PURE__ */ jsxs(React127__default.Fragment, { children: [
|
|
50190
50106
|
/* @__PURE__ */ jsx(
|
|
50191
50107
|
AvlState,
|
|
50192
50108
|
{
|
|
@@ -51693,6 +51609,7 @@ init_EntitySchemaContext();
|
|
|
51693
51609
|
init_traitRegistry();
|
|
51694
51610
|
init_verificationRegistry();
|
|
51695
51611
|
var crossTraitLog = createLogger("almadar:ui:cross-trait");
|
|
51612
|
+
var flushLog = createLogger("almadar:ui:slot-flush");
|
|
51696
51613
|
function toTraitDefinition(binding) {
|
|
51697
51614
|
return {
|
|
51698
51615
|
name: binding.trait.name,
|
|
@@ -51704,7 +51621,7 @@ function toTraitDefinition(binding) {
|
|
|
51704
51621
|
function normalizeEventKey(eventKey) {
|
|
51705
51622
|
return eventKey.startsWith("UI:") ? eventKey.slice(3) : eventKey;
|
|
51706
51623
|
}
|
|
51707
|
-
function useTraitStateMachine(traitBindings,
|
|
51624
|
+
function useTraitStateMachine(traitBindings, uiSlots, options) {
|
|
51708
51625
|
const eventBus = useEventBus();
|
|
51709
51626
|
const { entities } = useEntitySchema();
|
|
51710
51627
|
const traitConfigsByName = options?.traitConfigsByName;
|
|
@@ -51727,7 +51644,8 @@ function useTraitStateMachine(traitBindings, slotsActions, options) {
|
|
|
51727
51644
|
const processingRef = useRef(false);
|
|
51728
51645
|
const traitBindingsRef = useRef(traitBindings);
|
|
51729
51646
|
const managerRef = useRef(manager);
|
|
51730
|
-
const
|
|
51647
|
+
const uiSlotsRef = useRef(uiSlots);
|
|
51648
|
+
const embeddedTraitsRef = useRef(options?.embeddedTraits);
|
|
51731
51649
|
const optionsRef = useRef(options);
|
|
51732
51650
|
useEffect(() => {
|
|
51733
51651
|
traitBindingsRef.current = traitBindings;
|
|
@@ -51737,8 +51655,59 @@ function useTraitStateMachine(traitBindings, slotsActions, options) {
|
|
|
51737
51655
|
setTraitStates(manager.getAllStates());
|
|
51738
51656
|
}, [manager]);
|
|
51739
51657
|
useEffect(() => {
|
|
51740
|
-
|
|
51741
|
-
}, [
|
|
51658
|
+
uiSlotsRef.current = uiSlots;
|
|
51659
|
+
}, [uiSlots]);
|
|
51660
|
+
useEffect(() => {
|
|
51661
|
+
embeddedTraitsRef.current = options?.embeddedTraits;
|
|
51662
|
+
}, [options?.embeddedTraits]);
|
|
51663
|
+
const flushSlot = useCallback(
|
|
51664
|
+
(traitName, slot, patterns) => {
|
|
51665
|
+
const slots = uiSlotsRef.current;
|
|
51666
|
+
const embedded = embeddedTraitsRef.current;
|
|
51667
|
+
if (patterns.length === 0) {
|
|
51668
|
+
flushLog.info("clear", { traitName, slot });
|
|
51669
|
+
slots.clearBySource(slot, traitName);
|
|
51670
|
+
return;
|
|
51671
|
+
}
|
|
51672
|
+
const last = patterns[patterns.length - 1];
|
|
51673
|
+
const record = last.pattern ?? {};
|
|
51674
|
+
const { type: patternType, children: nested, ...inlineProps } = record;
|
|
51675
|
+
const props = {
|
|
51676
|
+
...inlineProps,
|
|
51677
|
+
...last.props,
|
|
51678
|
+
...nested !== void 0 ? { children: nested } : {}
|
|
51679
|
+
};
|
|
51680
|
+
const isEmbedded = embedded?.has(traitName) ?? false;
|
|
51681
|
+
if (isEmbedded) {
|
|
51682
|
+
flushLog.info("embed-route", {
|
|
51683
|
+
traitName,
|
|
51684
|
+
slot,
|
|
51685
|
+
patternType: typeof patternType === "string" ? patternType : void 0,
|
|
51686
|
+
embeddedSize: embedded?.size ?? 0
|
|
51687
|
+
});
|
|
51688
|
+
slots.updateTraitContent(traitName, {
|
|
51689
|
+
pattern: patternType,
|
|
51690
|
+
props,
|
|
51691
|
+
priority: 0,
|
|
51692
|
+
animation: "fade"
|
|
51693
|
+
});
|
|
51694
|
+
return;
|
|
51695
|
+
}
|
|
51696
|
+
flushLog.info("slot-render", {
|
|
51697
|
+
traitName,
|
|
51698
|
+
slot,
|
|
51699
|
+
patternType: typeof patternType === "string" ? patternType : void 0,
|
|
51700
|
+
embedded: Array.from(embedded ?? [])
|
|
51701
|
+
});
|
|
51702
|
+
slots.render({
|
|
51703
|
+
target: slot,
|
|
51704
|
+
pattern: patternType,
|
|
51705
|
+
props,
|
|
51706
|
+
sourceTrait: traitName
|
|
51707
|
+
});
|
|
51708
|
+
},
|
|
51709
|
+
[]
|
|
51710
|
+
);
|
|
51742
51711
|
useEffect(() => {
|
|
51743
51712
|
optionsRef.current = options;
|
|
51744
51713
|
}, [options]);
|
|
@@ -51831,7 +51800,6 @@ function useTraitStateMachine(traitBindings, slotsActions, options) {
|
|
|
51831
51800
|
};
|
|
51832
51801
|
}, [traitBindings]);
|
|
51833
51802
|
const runTickEffects = useCallback((tick, binding) => {
|
|
51834
|
-
const actions = slotsActionsRef.current;
|
|
51835
51803
|
const currentState = traitStatesRef.current.get(binding.trait.name)?.currentState ?? "";
|
|
51836
51804
|
if (tick.appliesTo.length > 0 && !tick.appliesTo.includes(currentState)) return;
|
|
51837
51805
|
const bindingCtx = { entity: {}, payload: {}, state: currentState };
|
|
@@ -51844,13 +51812,12 @@ function useTraitStateMachine(traitBindings, slotsActions, options) {
|
|
|
51844
51812
|
if (!passed) return;
|
|
51845
51813
|
}
|
|
51846
51814
|
const pendingSlots = /* @__PURE__ */ new Map();
|
|
51847
|
-
|
|
51815
|
+
({
|
|
51848
51816
|
trait: binding.trait.name,
|
|
51849
|
-
state: currentState,
|
|
51850
51817
|
transition: `${currentState}->tick:${tick.name}`,
|
|
51851
51818
|
effects: tick.effects,
|
|
51852
51819
|
traitDefinition: binding.trait
|
|
51853
|
-
};
|
|
51820
|
+
});
|
|
51854
51821
|
for (const effect of tick.effects) {
|
|
51855
51822
|
if (!Array.isArray(effect)) continue;
|
|
51856
51823
|
const op = effect[0];
|
|
@@ -51869,13 +51836,9 @@ function useTraitStateMachine(traitBindings, slotsActions, options) {
|
|
|
51869
51836
|
}
|
|
51870
51837
|
}
|
|
51871
51838
|
for (const [slot, patterns] of pendingSlots) {
|
|
51872
|
-
|
|
51873
|
-
actions.clearSlot(slot);
|
|
51874
|
-
} else {
|
|
51875
|
-
actions.setSlotPatterns(slot, patterns, slotSource);
|
|
51876
|
-
}
|
|
51839
|
+
flushSlot(binding.trait.name, slot, patterns);
|
|
51877
51840
|
}
|
|
51878
|
-
}, []);
|
|
51841
|
+
}, [flushSlot]);
|
|
51879
51842
|
useEffect(() => {
|
|
51880
51843
|
const hasFrameTicks = traitBindingsRef.current.some(
|
|
51881
51844
|
(b) => b.trait.ticks?.some((t) => t.interval === "frame")
|
|
@@ -51918,7 +51881,6 @@ function useTraitStateMachine(traitBindings, slotsActions, options) {
|
|
|
51918
51881
|
const normalizedEvent = normalizeEventKey(eventKey);
|
|
51919
51882
|
const bindings = traitBindingsRef.current;
|
|
51920
51883
|
const currentManager = managerRef.current;
|
|
51921
|
-
const actions = slotsActionsRef.current;
|
|
51922
51884
|
console.log("[TraitStateMachine] Processing event:", normalizedEvent, "payload:", payload);
|
|
51923
51885
|
crossTraitLog.debug("processEvent:enter", {
|
|
51924
51886
|
event: normalizedEvent,
|
|
@@ -52069,12 +52031,9 @@ function useTraitStateMachine(traitBindings, slotsActions, options) {
|
|
|
52069
52031
|
"[TraitStateMachine] After executeAll, pendingSlots:",
|
|
52070
52032
|
Object.fromEntries(pendingSlots.entries())
|
|
52071
52033
|
);
|
|
52034
|
+
void slotSource;
|
|
52072
52035
|
for (const [slot, patterns] of pendingSlots) {
|
|
52073
|
-
|
|
52074
|
-
actions.clearSlot(slot);
|
|
52075
|
-
} else {
|
|
52076
|
-
actions.setSlotPatterns(slot, patterns, slotSource);
|
|
52077
|
-
}
|
|
52036
|
+
flushSlot(traitName, slot, patterns);
|
|
52078
52037
|
}
|
|
52079
52038
|
} catch (error) {
|
|
52080
52039
|
console.error(
|
|
@@ -52275,13 +52234,12 @@ function useTraitStateMachine(traitBindings, slotsActions, options) {
|
|
|
52275
52234
|
}
|
|
52276
52235
|
|
|
52277
52236
|
// runtime/OrbPreview.tsx
|
|
52278
|
-
init_SlotsContext();
|
|
52279
52237
|
init_EntitySchemaContext();
|
|
52280
52238
|
|
|
52281
52239
|
// runtime/ServerBridge.tsx
|
|
52282
52240
|
init_useEventBus();
|
|
52283
52241
|
init_logger();
|
|
52284
|
-
var
|
|
52242
|
+
var xOrbitalLog = createLogger("almadar:runtime:cross-orbital");
|
|
52285
52243
|
function createHttpTransport(serverUrl) {
|
|
52286
52244
|
return {
|
|
52287
52245
|
register: async (schema) => {
|
|
@@ -52387,14 +52345,14 @@ function ServerBridgeProvider({
|
|
|
52387
52345
|
for (const emitted of result.emittedEvents) {
|
|
52388
52346
|
const evTrait = emitted.source?.trait;
|
|
52389
52347
|
if (!evTrait) {
|
|
52390
|
-
|
|
52348
|
+
xOrbitalLog.warn("emit:dropped-no-source", {
|
|
52391
52349
|
event: emitted.event,
|
|
52392
52350
|
dispatchOrbital: orbitalName
|
|
52393
52351
|
});
|
|
52394
52352
|
continue;
|
|
52395
52353
|
}
|
|
52396
52354
|
const key = emitted.source?.orbital ? `UI:${emitted.source.orbital}.${evTrait}.${emitted.event}` : `UI:${evTrait}.${emitted.event}`;
|
|
52397
|
-
|
|
52355
|
+
xOrbitalLog.info("emit:rebroadcast", {
|
|
52398
52356
|
busKey: key,
|
|
52399
52357
|
sourceOrbital: emitted.source?.orbital,
|
|
52400
52358
|
sourceTrait: evTrait,
|
|
@@ -52404,7 +52362,7 @@ function ServerBridgeProvider({
|
|
|
52404
52362
|
}
|
|
52405
52363
|
}
|
|
52406
52364
|
} else if (result.error) {
|
|
52407
|
-
|
|
52365
|
+
xOrbitalLog.warn("response:fail", {
|
|
52408
52366
|
orbital: orbitalName,
|
|
52409
52367
|
event,
|
|
52410
52368
|
error: result.error
|
|
@@ -52412,7 +52370,7 @@ function ServerBridgeProvider({
|
|
|
52412
52370
|
}
|
|
52413
52371
|
return { effects, meta };
|
|
52414
52372
|
} catch (err) {
|
|
52415
|
-
|
|
52373
|
+
xOrbitalLog.error("response:network", {
|
|
52416
52374
|
orbital: orbitalName,
|
|
52417
52375
|
event,
|
|
52418
52376
|
error: err instanceof Error ? err.message : String(err)
|
|
@@ -52532,7 +52490,7 @@ function prepareSchemaForPreview(input) {
|
|
|
52532
52490
|
|
|
52533
52491
|
// runtime/OrbPreview.tsx
|
|
52534
52492
|
init_logger();
|
|
52535
|
-
var
|
|
52493
|
+
var xOrbitalLog2 = createLogger("almadar:runtime:cross-orbital");
|
|
52536
52494
|
function normalizeChild(child) {
|
|
52537
52495
|
if (typeof child === "string") return child;
|
|
52538
52496
|
if (child === null || typeof child !== "object" || Array.isArray(child)) {
|
|
@@ -52545,98 +52503,6 @@ function normalizeChild(child) {
|
|
|
52545
52503
|
props: { ...rest, ...normalizedChildren !== void 0 ? { children: normalizedChildren } : {} }
|
|
52546
52504
|
};
|
|
52547
52505
|
}
|
|
52548
|
-
function SlotBridge({ embeddedTraits }) {
|
|
52549
|
-
const slots = useSlots();
|
|
52550
|
-
const { render, clear, updateTraitContent } = useUISlots();
|
|
52551
|
-
useEffect(() => {
|
|
52552
|
-
slotLog.debug("SlotBridge:effect-fired", {
|
|
52553
|
-
slotCount: Object.keys(slots).length,
|
|
52554
|
-
slots: Object.keys(slots)
|
|
52555
|
-
});
|
|
52556
|
-
for (const [slotName, slotState] of Object.entries(slots)) {
|
|
52557
|
-
const allEntries = slotEntriesInOrder(slotState);
|
|
52558
|
-
const entries = [];
|
|
52559
|
-
for (const e of allEntries) {
|
|
52560
|
-
const traitName = e.entry.source?.trait;
|
|
52561
|
-
if (traitName && embeddedTraits?.has(traitName)) {
|
|
52562
|
-
const last = e.entry.patterns[e.entry.patterns.length - 1];
|
|
52563
|
-
if (last?.pattern && typeof last.pattern === "object") {
|
|
52564
|
-
const record = last.pattern;
|
|
52565
|
-
const { type: patternType, children: nested, ...inlineProps } = record;
|
|
52566
|
-
const normalizedNested = Array.isArray(nested) ? nested.map((c) => normalizeChild(c)) : nested;
|
|
52567
|
-
updateTraitContent(traitName, {
|
|
52568
|
-
pattern: patternType,
|
|
52569
|
-
props: {
|
|
52570
|
-
...inlineProps,
|
|
52571
|
-
...last.props,
|
|
52572
|
-
...normalizedNested !== void 0 ? { children: normalizedNested } : {}
|
|
52573
|
-
},
|
|
52574
|
-
priority: 0,
|
|
52575
|
-
animation: "fade"
|
|
52576
|
-
});
|
|
52577
|
-
}
|
|
52578
|
-
continue;
|
|
52579
|
-
}
|
|
52580
|
-
entries.push(e);
|
|
52581
|
-
}
|
|
52582
|
-
if (entries.length === 0) {
|
|
52583
|
-
if (allEntries.length === 0) {
|
|
52584
|
-
clear(slotName);
|
|
52585
|
-
} else {
|
|
52586
|
-
slotLog.debug("SlotBridge:embed-only-skip", {
|
|
52587
|
-
slot: slotName,
|
|
52588
|
-
embeddedCount: allEntries.length
|
|
52589
|
-
});
|
|
52590
|
-
}
|
|
52591
|
-
continue;
|
|
52592
|
-
}
|
|
52593
|
-
const children = entries.map(({ entry }) => entry.patterns[entry.patterns.length - 1]).filter((p2) => Boolean(p2)).map((entry) => {
|
|
52594
|
-
const record = entry.pattern;
|
|
52595
|
-
const { type: patternType, children: nested, ...inlineProps } = record;
|
|
52596
|
-
const normalizedNested = Array.isArray(nested) ? nested.map((c) => normalizeChild(c)) : nested;
|
|
52597
|
-
return {
|
|
52598
|
-
type: patternType,
|
|
52599
|
-
...inlineProps,
|
|
52600
|
-
...entry.props,
|
|
52601
|
-
...normalizedNested !== void 0 ? { children: normalizedNested } : {}
|
|
52602
|
-
};
|
|
52603
|
-
});
|
|
52604
|
-
if (children.length === 1) {
|
|
52605
|
-
const only = children[0];
|
|
52606
|
-
const { type, children: nested, ...rest } = only;
|
|
52607
|
-
const lastEntry = entries[entries.length - 1];
|
|
52608
|
-
slotLog.debug("SlotBridge:render-single", {
|
|
52609
|
-
slot: slotName,
|
|
52610
|
-
patternType: type,
|
|
52611
|
-
entityRefId: refId(rest.entity),
|
|
52612
|
-
sourceTrait: lastEntry.entry.source?.trait
|
|
52613
|
-
});
|
|
52614
|
-
render({
|
|
52615
|
-
target: slotName,
|
|
52616
|
-
pattern: type,
|
|
52617
|
-
props: {
|
|
52618
|
-
...rest,
|
|
52619
|
-
...nested !== void 0 ? { children: nested } : {}
|
|
52620
|
-
},
|
|
52621
|
-
sourceTrait: lastEntry.entry.source?.trait
|
|
52622
|
-
});
|
|
52623
|
-
} else {
|
|
52624
|
-
const lastEntry = entries[entries.length - 1];
|
|
52625
|
-
render({
|
|
52626
|
-
target: slotName,
|
|
52627
|
-
pattern: "stack",
|
|
52628
|
-
props: {
|
|
52629
|
-
direction: "vertical",
|
|
52630
|
-
gap: "lg",
|
|
52631
|
-
children
|
|
52632
|
-
},
|
|
52633
|
-
sourceTrait: lastEntry.entry.source?.trait
|
|
52634
|
-
});
|
|
52635
|
-
}
|
|
52636
|
-
}
|
|
52637
|
-
}, [slots, render, clear, updateTraitContent, embeddedTraits]);
|
|
52638
|
-
return null;
|
|
52639
|
-
}
|
|
52640
52506
|
function applyServerEffects(effects, uiSlots, onNavigate, embeddedTraits) {
|
|
52641
52507
|
for (const eff of effects) {
|
|
52642
52508
|
if (eff.type === "render-ui" && eff.slot && eff.pattern) {
|
|
@@ -52650,7 +52516,7 @@ function applyServerEffects(effects, uiSlots, onNavigate, embeddedTraits) {
|
|
|
52650
52516
|
...normalizedChildren !== void 0 ? { children: normalizedChildren } : {}
|
|
52651
52517
|
};
|
|
52652
52518
|
if (isEmbedded) {
|
|
52653
|
-
|
|
52519
|
+
xOrbitalLog2.info("slot:embed-routed", {
|
|
52654
52520
|
sourceTrait,
|
|
52655
52521
|
slot: eff.slot,
|
|
52656
52522
|
patternType: typeof patternType === "string" ? patternType : void 0
|
|
@@ -52662,7 +52528,7 @@ function applyServerEffects(effects, uiSlots, onNavigate, embeddedTraits) {
|
|
|
52662
52528
|
animation: "fade"
|
|
52663
52529
|
});
|
|
52664
52530
|
} else {
|
|
52665
|
-
|
|
52531
|
+
xOrbitalLog2.info("slot-write", {
|
|
52666
52532
|
slot: eff.slot,
|
|
52667
52533
|
sourceTrait,
|
|
52668
52534
|
patternType: typeof patternType === "string" ? patternType : void 0
|
|
@@ -52680,13 +52546,12 @@ function applyServerEffects(effects, uiSlots, onNavigate, embeddedTraits) {
|
|
|
52680
52546
|
}
|
|
52681
52547
|
}
|
|
52682
52548
|
function TraitInitializer({ traits: traits2, orbitalNames, onNavigate, onLocalFallback, persistence, traitConfigsByName, orbitalsByTrait, embeddedTraits }) {
|
|
52683
|
-
const slotsActions = useSlotsActions();
|
|
52684
52549
|
const bridge = useServerBridge();
|
|
52685
52550
|
const uiSlots = useUISlots();
|
|
52686
52551
|
const onEventProcessed = useCallback(async (event, payload, dispatchedOrbitals) => {
|
|
52687
52552
|
if (!bridge.connected || !orbitalNames?.length) return;
|
|
52688
52553
|
const targets = dispatchedOrbitals && dispatchedOrbitals.size > 0 ? orbitalNames.filter((n) => dispatchedOrbitals.has(n)) : orbitalNames;
|
|
52689
|
-
|
|
52554
|
+
xOrbitalLog2.info("TraitInitializer:fanout", {
|
|
52690
52555
|
event,
|
|
52691
52556
|
sentTo: targets,
|
|
52692
52557
|
skipped: orbitalNames.filter((n) => !targets.includes(n)),
|
|
@@ -52698,8 +52563,8 @@ function TraitInitializer({ traits: traits2, orbitalNames, onNavigate, onLocalFa
|
|
|
52698
52563
|
applyServerEffects(effects, uiSlots, onNavigate, embeddedTraits);
|
|
52699
52564
|
}
|
|
52700
52565
|
}, [bridge.connected, bridge.sendEvent, orbitalNames, uiSlots, onNavigate, embeddedTraits]);
|
|
52701
|
-
const opts = orbitalNames ? { onEventProcessed, navigate: onNavigate, traitConfigsByName, orbitalsByTrait } : { navigate: onNavigate, persistence, traitConfigsByName, orbitalsByTrait };
|
|
52702
|
-
const { sendEvent } = useTraitStateMachine(traits2,
|
|
52566
|
+
const opts = orbitalNames ? { onEventProcessed, navigate: onNavigate, traitConfigsByName, orbitalsByTrait, embeddedTraits } : { navigate: onNavigate, persistence, traitConfigsByName, orbitalsByTrait, embeddedTraits };
|
|
52567
|
+
const { sendEvent } = useTraitStateMachine(traits2, uiSlots, opts);
|
|
52703
52568
|
const initSentRef = useRef(false);
|
|
52704
52569
|
useEffect(() => {
|
|
52705
52570
|
if (!orbitalNames?.length) {
|
|
@@ -52821,7 +52686,7 @@ function SchemaRunner({ schema, serverUrl, transport, mockData, pageName, onNavi
|
|
|
52821
52686
|
const orb = orbitalsByTrait[name];
|
|
52822
52687
|
if (orb) orbitalsByTraitForPage[name] = orb;
|
|
52823
52688
|
}
|
|
52824
|
-
|
|
52689
|
+
xOrbitalLog2.info("SchemaRunner:mount", {
|
|
52825
52690
|
pageName,
|
|
52826
52691
|
traitNames,
|
|
52827
52692
|
orbitalsByTraitForPage,
|
|
@@ -52847,9 +52712,15 @@ function SchemaRunner({ schema, serverUrl, transport, mockData, pageName, onNavi
|
|
|
52847
52712
|
return map;
|
|
52848
52713
|
}, [schema]);
|
|
52849
52714
|
const embeddedTraits = useMemo(() => {
|
|
52850
|
-
|
|
52851
|
-
|
|
52852
|
-
|
|
52715
|
+
const set = collectEmbeddedTraits(schema);
|
|
52716
|
+
xOrbitalLog2.info("SchemaRunner:embeddedTraits", {
|
|
52717
|
+
pageName,
|
|
52718
|
+
embedded: Array.from(set),
|
|
52719
|
+
embeddedCount: set.size
|
|
52720
|
+
});
|
|
52721
|
+
return set;
|
|
52722
|
+
}, [schema, pageName]);
|
|
52723
|
+
const inner = /* @__PURE__ */ jsx(VerificationProvider, { enabled: true, children: /* @__PURE__ */ jsxs(
|
|
52853
52724
|
EntitySchemaProvider,
|
|
52854
52725
|
{
|
|
52855
52726
|
entities: entitiesArray,
|
|
@@ -52869,11 +52740,10 @@ function SchemaRunner({ schema, serverUrl, transport, mockData, pageName, onNavi
|
|
|
52869
52740
|
persistence
|
|
52870
52741
|
}
|
|
52871
52742
|
),
|
|
52872
|
-
/* @__PURE__ */ jsx(SlotBridge, { embeddedTraits }),
|
|
52873
52743
|
/* @__PURE__ */ jsx(Box, { className: "h-full p-4", children: /* @__PURE__ */ jsx(UISlotRenderer, { includeHud: true, hudMode: "inline", includeFloating: true }) })
|
|
52874
52744
|
]
|
|
52875
52745
|
}
|
|
52876
|
-
) })
|
|
52746
|
+
) });
|
|
52877
52747
|
if (serverUrl || transport) {
|
|
52878
52748
|
return /* @__PURE__ */ jsx(ServerBridgeProvider, { schema, serverUrl, transport, children: inner });
|
|
52879
52749
|
}
|
|
@@ -53382,7 +53252,7 @@ var OrbPreviewNodeInner = (props) => {
|
|
|
53382
53252
|
}
|
|
53383
53253
|
);
|
|
53384
53254
|
};
|
|
53385
|
-
var OrbPreviewNode =
|
|
53255
|
+
var OrbPreviewNode = React127__default.memo(OrbPreviewNodeInner);
|
|
53386
53256
|
OrbPreviewNode.displayName = "OrbPreviewNode";
|
|
53387
53257
|
var EventFlowEdgeInner = (props) => {
|
|
53388
53258
|
const {
|
|
@@ -53459,7 +53329,7 @@ var EventFlowEdgeInner = (props) => {
|
|
|
53459
53329
|
) })
|
|
53460
53330
|
] });
|
|
53461
53331
|
};
|
|
53462
|
-
var EventFlowEdge =
|
|
53332
|
+
var EventFlowEdge = React127__default.memo(EventFlowEdgeInner);
|
|
53463
53333
|
EventFlowEdge.displayName = "EventFlowEdge";
|
|
53464
53334
|
|
|
53465
53335
|
// components/molecules/avl/BehaviorComposeNode.tsx
|
|
@@ -53598,7 +53468,7 @@ var BehaviorComposeNodeInner = (props) => {
|
|
|
53598
53468
|
}
|
|
53599
53469
|
);
|
|
53600
53470
|
};
|
|
53601
|
-
var BehaviorComposeNode =
|
|
53471
|
+
var BehaviorComposeNode = React127__default.memo(BehaviorComposeNodeInner);
|
|
53602
53472
|
BehaviorComposeNode.displayName = "BehaviorComposeNode";
|
|
53603
53473
|
|
|
53604
53474
|
// components/molecules/avl/avl-behavior-compose-converter.ts
|
|
@@ -54538,7 +54408,7 @@ var ZoomBreadcrumb = ({
|
|
|
54538
54408
|
if (eventName && band === "detail") {
|
|
54539
54409
|
segments.push({ icon: "\u26A1", label: eventName });
|
|
54540
54410
|
}
|
|
54541
|
-
return /* @__PURE__ */ jsx("div", { className: "absolute top-2 left-2 z-10 flex items-center gap-1 px-2 py-1 rounded-md bg-card/90 border border-border text-[11px] text-muted-foreground backdrop-blur-sm", children: segments.map((seg, i) => /* @__PURE__ */ jsxs(
|
|
54411
|
+
return /* @__PURE__ */ jsx("div", { className: "absolute top-2 left-2 z-10 flex items-center gap-1 px-2 py-1 rounded-md bg-card/90 border border-border text-[11px] text-muted-foreground backdrop-blur-sm", children: segments.map((seg, i) => /* @__PURE__ */ jsxs(React127__default.Fragment, { children: [
|
|
54542
54412
|
i > 0 && /* @__PURE__ */ jsx("span", { className: "opacity-40", children: ">" }),
|
|
54543
54413
|
/* @__PURE__ */ jsx("span", { className: "opacity-60", children: seg.icon }),
|
|
54544
54414
|
/* @__PURE__ */ jsx("span", { children: seg.label })
|
|
@@ -54997,7 +54867,7 @@ var EventWireOverlay = ({
|
|
|
54997
54867
|
containerW,
|
|
54998
54868
|
containerH
|
|
54999
54869
|
}) => {
|
|
55000
|
-
const ids =
|
|
54870
|
+
const ids = React127__default.useMemo(() => {
|
|
55001
54871
|
avlOczWireId += 1;
|
|
55002
54872
|
return { arrow: `avl-ocz-wire-${avlOczWireId}-arrow` };
|
|
55003
54873
|
}, []);
|
|
@@ -55315,7 +55185,7 @@ var AvlOrbitalsCosmicZoom = ({
|
|
|
55315
55185
|
borderRadius: 6,
|
|
55316
55186
|
border: `1px solid ${color}`
|
|
55317
55187
|
},
|
|
55318
|
-
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(
|
|
55188
|
+
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(React127__default.Fragment, { children: [
|
|
55319
55189
|
i > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", style: { opacity: 0.5, color }, children: "/" }),
|
|
55320
55190
|
i < breadcrumbs.length - 1 ? /* @__PURE__ */ jsx(
|
|
55321
55191
|
Box,
|