@almadar/ui 4.13.0 → 4.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/avl/index.cjs +1354 -1485
- package/dist/avl/index.js +262 -393
- package/dist/components/index.cjs +1061 -1062
- package/dist/components/index.js +160 -161
- package/dist/providers/index.cjs +914 -915
- package/dist/providers/index.js +158 -159
- package/dist/runtime/index.cjs +1037 -1179
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/index.js +259 -397
- 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);
|
|
@@ -8643,9 +8551,9 @@ function ScoreDisplay({
|
|
|
8643
8551
|
...rest
|
|
8644
8552
|
}) {
|
|
8645
8553
|
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
|
-
|
|
8554
|
+
const [displayValue, setDisplayValue] = React127.useState(resolvedValue);
|
|
8555
|
+
const [isAnimating, setIsAnimating] = React127.useState(false);
|
|
8556
|
+
React127.useEffect(() => {
|
|
8649
8557
|
if (!animated || displayValue === resolvedValue) {
|
|
8650
8558
|
setDisplayValue(resolvedValue);
|
|
8651
8559
|
return;
|
|
@@ -8715,9 +8623,9 @@ function ControlButton({
|
|
|
8715
8623
|
className
|
|
8716
8624
|
}) {
|
|
8717
8625
|
const eventBus = useEventBus();
|
|
8718
|
-
const [isPressed, setIsPressed] =
|
|
8626
|
+
const [isPressed, setIsPressed] = React127.useState(false);
|
|
8719
8627
|
const actualPressed = pressed ?? isPressed;
|
|
8720
|
-
const handlePointerDown =
|
|
8628
|
+
const handlePointerDown = React127.useCallback(
|
|
8721
8629
|
(e) => {
|
|
8722
8630
|
e.preventDefault();
|
|
8723
8631
|
if (disabled) return;
|
|
@@ -8727,7 +8635,7 @@ function ControlButton({
|
|
|
8727
8635
|
},
|
|
8728
8636
|
[disabled, pressEvent, eventBus, onPress]
|
|
8729
8637
|
);
|
|
8730
|
-
const handlePointerUp =
|
|
8638
|
+
const handlePointerUp = React127.useCallback(
|
|
8731
8639
|
(e) => {
|
|
8732
8640
|
e.preventDefault();
|
|
8733
8641
|
if (disabled) return;
|
|
@@ -8737,7 +8645,7 @@ function ControlButton({
|
|
|
8737
8645
|
},
|
|
8738
8646
|
[disabled, releaseEvent, eventBus, onRelease]
|
|
8739
8647
|
);
|
|
8740
|
-
const handlePointerLeave =
|
|
8648
|
+
const handlePointerLeave = React127.useCallback(
|
|
8741
8649
|
(e) => {
|
|
8742
8650
|
if (isPressed) {
|
|
8743
8651
|
setIsPressed(false);
|
|
@@ -9635,9 +9543,9 @@ function MiniMap({
|
|
|
9635
9543
|
viewportRect,
|
|
9636
9544
|
className
|
|
9637
9545
|
}) {
|
|
9638
|
-
const canvasRef =
|
|
9639
|
-
const frameRef =
|
|
9640
|
-
|
|
9546
|
+
const canvasRef = React127.useRef(null);
|
|
9547
|
+
const frameRef = React127.useRef(0);
|
|
9548
|
+
React127.useEffect(() => {
|
|
9641
9549
|
const canvas = canvasRef.current;
|
|
9642
9550
|
if (!canvas) return;
|
|
9643
9551
|
const ctx = canvas.getContext("2d");
|
|
@@ -9976,7 +9884,7 @@ var init_ErrorBoundary = __esm({
|
|
|
9976
9884
|
"use client";
|
|
9977
9885
|
init_cn();
|
|
9978
9886
|
init_ErrorState();
|
|
9979
|
-
ErrorBoundary = class extends
|
|
9887
|
+
ErrorBoundary = class extends React127__default.Component {
|
|
9980
9888
|
constructor(props) {
|
|
9981
9889
|
super(props);
|
|
9982
9890
|
__publicField(this, "reset", () => {
|
|
@@ -10449,8 +10357,8 @@ var init_Tooltip = __esm({
|
|
|
10449
10357
|
if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
|
|
10450
10358
|
};
|
|
10451
10359
|
}, []);
|
|
10452
|
-
const triggerElement =
|
|
10453
|
-
const trigger =
|
|
10360
|
+
const triggerElement = React127__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
10361
|
+
const trigger = React127__default.cloneElement(triggerElement, {
|
|
10454
10362
|
ref: triggerRef,
|
|
10455
10363
|
onMouseEnter: handleMouseEnter,
|
|
10456
10364
|
onMouseLeave: handleMouseLeave,
|
|
@@ -10571,8 +10479,8 @@ var init_Popover = __esm({
|
|
|
10571
10479
|
onMouseEnter: handleOpen,
|
|
10572
10480
|
onMouseLeave: handleClose
|
|
10573
10481
|
};
|
|
10574
|
-
const childElement =
|
|
10575
|
-
const triggerElement =
|
|
10482
|
+
const childElement = React127__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
10483
|
+
const triggerElement = React127__default.cloneElement(
|
|
10576
10484
|
childElement,
|
|
10577
10485
|
{
|
|
10578
10486
|
ref: triggerRef,
|
|
@@ -10689,8 +10597,8 @@ var init_Menu = __esm({
|
|
|
10689
10597
|
"bottom-start": "top-full left-0 mt-2",
|
|
10690
10598
|
"bottom-end": "top-full right-0 mt-2"
|
|
10691
10599
|
};
|
|
10692
|
-
const triggerChild =
|
|
10693
|
-
const triggerElement =
|
|
10600
|
+
const triggerChild = React127__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx("span", { children: trigger });
|
|
10601
|
+
const triggerElement = React127__default.cloneElement(
|
|
10694
10602
|
triggerChild,
|
|
10695
10603
|
{
|
|
10696
10604
|
ref: triggerRef,
|
|
@@ -11209,12 +11117,12 @@ var init_MapView = __esm({
|
|
|
11209
11117
|
shadowSize: [41, 41]
|
|
11210
11118
|
});
|
|
11211
11119
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
11212
|
-
const { useEffect: useEffect88, useRef:
|
|
11120
|
+
const { useEffect: useEffect88, useRef: useRef86, useCallback: useCallback124, useState: useState123 } = React127__default;
|
|
11213
11121
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
11214
11122
|
const { useEventBus: useEventBus3 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
11215
11123
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
11216
11124
|
const map = useMap();
|
|
11217
|
-
const prevRef =
|
|
11125
|
+
const prevRef = useRef86({ centerLat, centerLng, zoom });
|
|
11218
11126
|
useEffect88(() => {
|
|
11219
11127
|
const prev = prevRef.current;
|
|
11220
11128
|
if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
|
|
@@ -11253,8 +11161,8 @@ var init_MapView = __esm({
|
|
|
11253
11161
|
showAttribution = true
|
|
11254
11162
|
}) {
|
|
11255
11163
|
const eventBus = useEventBus3();
|
|
11256
|
-
const [clickedPosition, setClickedPosition] =
|
|
11257
|
-
const handleMapClick =
|
|
11164
|
+
const [clickedPosition, setClickedPosition] = useState123(null);
|
|
11165
|
+
const handleMapClick = useCallback124((lat, lng) => {
|
|
11258
11166
|
if (showClickedPin) {
|
|
11259
11167
|
setClickedPosition({ lat, lng });
|
|
11260
11168
|
}
|
|
@@ -11263,7 +11171,7 @@ var init_MapView = __esm({
|
|
|
11263
11171
|
eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
|
|
11264
11172
|
}
|
|
11265
11173
|
}, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
|
|
11266
|
-
const handleMarkerClick =
|
|
11174
|
+
const handleMarkerClick = useCallback124((marker) => {
|
|
11267
11175
|
onMarkerClick?.(marker);
|
|
11268
11176
|
if (markerClickEvent) {
|
|
11269
11177
|
eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
|
|
@@ -11440,7 +11348,7 @@ function InputPattern({
|
|
|
11440
11348
|
fieldName
|
|
11441
11349
|
}) {
|
|
11442
11350
|
const { emit } = useEventBus();
|
|
11443
|
-
const [localValue, setLocalValue] =
|
|
11351
|
+
const [localValue, setLocalValue] = React127__default.useState(value);
|
|
11444
11352
|
const handleChange = (e) => {
|
|
11445
11353
|
setLocalValue(e.target.value);
|
|
11446
11354
|
if (onChange) {
|
|
@@ -11478,7 +11386,7 @@ function TextareaPattern({
|
|
|
11478
11386
|
fieldName
|
|
11479
11387
|
}) {
|
|
11480
11388
|
const { emit } = useEventBus();
|
|
11481
|
-
const [localValue, setLocalValue] =
|
|
11389
|
+
const [localValue, setLocalValue] = React127__default.useState(value);
|
|
11482
11390
|
const handleChange = (e) => {
|
|
11483
11391
|
setLocalValue(e.target.value);
|
|
11484
11392
|
if (onChange) {
|
|
@@ -11510,7 +11418,7 @@ function SelectPattern({
|
|
|
11510
11418
|
fieldName
|
|
11511
11419
|
}) {
|
|
11512
11420
|
const { emit } = useEventBus();
|
|
11513
|
-
const [localValue, setLocalValue] =
|
|
11421
|
+
const [localValue, setLocalValue] = React127__default.useState(value);
|
|
11514
11422
|
const handleChange = (e) => {
|
|
11515
11423
|
setLocalValue(e.target.value);
|
|
11516
11424
|
if (onChange) {
|
|
@@ -11539,7 +11447,7 @@ function CheckboxPattern({
|
|
|
11539
11447
|
className
|
|
11540
11448
|
}) {
|
|
11541
11449
|
const { emit } = useEventBus();
|
|
11542
|
-
const [localChecked, setLocalChecked] =
|
|
11450
|
+
const [localChecked, setLocalChecked] = React127__default.useState(checked);
|
|
11543
11451
|
const handleChange = (e) => {
|
|
11544
11452
|
setLocalChecked(e.target.checked);
|
|
11545
11453
|
if (onChange) {
|
|
@@ -11770,8 +11678,8 @@ function ActionButtons({
|
|
|
11770
11678
|
disabled
|
|
11771
11679
|
}) {
|
|
11772
11680
|
const eventBus = useEventBus();
|
|
11773
|
-
const [activeButtons, setActiveButtons] =
|
|
11774
|
-
const handlePress =
|
|
11681
|
+
const [activeButtons, setActiveButtons] = React127.useState(/* @__PURE__ */ new Set());
|
|
11682
|
+
const handlePress = React127.useCallback(
|
|
11775
11683
|
(id) => {
|
|
11776
11684
|
setActiveButtons((prev) => new Set(prev).add(id));
|
|
11777
11685
|
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
|
|
@@ -11779,7 +11687,7 @@ function ActionButtons({
|
|
|
11779
11687
|
},
|
|
11780
11688
|
[actionEvent, eventBus, onAction]
|
|
11781
11689
|
);
|
|
11782
|
-
const handleRelease =
|
|
11690
|
+
const handleRelease = React127.useCallback(
|
|
11783
11691
|
(id) => {
|
|
11784
11692
|
setActiveButtons((prev) => {
|
|
11785
11693
|
const next = new Set(prev);
|
|
@@ -13847,7 +13755,7 @@ var init_MarkdownContent = __esm({
|
|
|
13847
13755
|
init_Box();
|
|
13848
13756
|
init_useTranslate();
|
|
13849
13757
|
init_cn();
|
|
13850
|
-
MarkdownContent =
|
|
13758
|
+
MarkdownContent = React127__default.memo(
|
|
13851
13759
|
({ content, direction, className }) => {
|
|
13852
13760
|
const { t: _t } = useTranslate();
|
|
13853
13761
|
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
@@ -14064,7 +13972,7 @@ var init_CodeBlock = __esm({
|
|
|
14064
13972
|
loloStyle = { ...dark, ...loloStyleOverrides };
|
|
14065
13973
|
LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
14066
13974
|
HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
14067
|
-
CodeBlock =
|
|
13975
|
+
CodeBlock = React127__default.memo(
|
|
14068
13976
|
({
|
|
14069
13977
|
code: rawCode,
|
|
14070
13978
|
language = "text",
|
|
@@ -15373,7 +15281,7 @@ var init_StateMachineView = __esm({
|
|
|
15373
15281
|
style: { top: title ? 30 : 0 },
|
|
15374
15282
|
children: [
|
|
15375
15283
|
entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
|
|
15376
|
-
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(
|
|
15284
|
+
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React127__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
|
|
15377
15285
|
StateNode,
|
|
15378
15286
|
{
|
|
15379
15287
|
state,
|
|
@@ -21156,7 +21064,7 @@ function CraftingRecipe({
|
|
|
21156
21064
|
className
|
|
21157
21065
|
}) {
|
|
21158
21066
|
const eventBus = useEventBus();
|
|
21159
|
-
const handleCraft =
|
|
21067
|
+
const handleCraft = React127.useCallback(() => {
|
|
21160
21068
|
onCraft?.();
|
|
21161
21069
|
if (craftEvent) {
|
|
21162
21070
|
eventBus.emit(craftEvent, { output: output.label });
|
|
@@ -21173,7 +21081,7 @@ function CraftingRecipe({
|
|
|
21173
21081
|
children: [
|
|
21174
21082
|
/* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-wrap items-center", children: inputs.map((ingredient, index) => {
|
|
21175
21083
|
const hasSufficient = ingredient.available >= ingredient.required;
|
|
21176
|
-
return /* @__PURE__ */ jsxs(
|
|
21084
|
+
return /* @__PURE__ */ jsxs(React127.Fragment, { children: [
|
|
21177
21085
|
/* @__PURE__ */ jsx(Box, { className: "relative", children: /* @__PURE__ */ jsx(
|
|
21178
21086
|
ItemSlot,
|
|
21179
21087
|
{
|
|
@@ -21467,8 +21375,8 @@ function DPad({
|
|
|
21467
21375
|
}) {
|
|
21468
21376
|
const eventBus = useEventBus();
|
|
21469
21377
|
const sizes = sizeMap15[size];
|
|
21470
|
-
const [activeDirections, setActiveDirections] =
|
|
21471
|
-
const handlePress =
|
|
21378
|
+
const [activeDirections, setActiveDirections] = React127.useState(/* @__PURE__ */ new Set());
|
|
21379
|
+
const handlePress = React127.useCallback(
|
|
21472
21380
|
(direction) => {
|
|
21473
21381
|
setActiveDirections((prev) => new Set(prev).add(direction));
|
|
21474
21382
|
if (directionEvent) eventBus.emit(`UI:${directionEvent}`, { direction, pressed: true });
|
|
@@ -21476,7 +21384,7 @@ function DPad({
|
|
|
21476
21384
|
},
|
|
21477
21385
|
[directionEvent, eventBus, onDirection]
|
|
21478
21386
|
);
|
|
21479
|
-
const handleRelease =
|
|
21387
|
+
const handleRelease = React127.useCallback(
|
|
21480
21388
|
(direction) => {
|
|
21481
21389
|
setActiveDirections((prev) => {
|
|
21482
21390
|
const next = new Set(prev);
|
|
@@ -22376,7 +22284,7 @@ function DataList({
|
|
|
22376
22284
|
}) {
|
|
22377
22285
|
const eventBus = useEventBus();
|
|
22378
22286
|
const { t } = useTranslate();
|
|
22379
|
-
const [visibleCount, setVisibleCount] =
|
|
22287
|
+
const [visibleCount, setVisibleCount] = React127__default.useState(pageSize || Infinity);
|
|
22380
22288
|
const allData = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
22381
22289
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
22382
22290
|
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
@@ -22416,7 +22324,7 @@ function DataList({
|
|
|
22416
22324
|
const items2 = data.map((item) => item);
|
|
22417
22325
|
const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
|
|
22418
22326
|
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(
|
|
22327
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React127__default.Fragment, { children: [
|
|
22420
22328
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
|
|
22421
22329
|
group.items.map((itemData, index) => {
|
|
22422
22330
|
const id = itemData.id || `${gi}-${index}`;
|
|
@@ -22463,7 +22371,7 @@ function DataList({
|
|
|
22463
22371
|
] }, gi)) });
|
|
22464
22372
|
}
|
|
22465
22373
|
const hasRenderProp = typeof children === "function";
|
|
22466
|
-
|
|
22374
|
+
React127__default.useEffect(() => {
|
|
22467
22375
|
const renderItemTypeOf = typeof schemaRenderItem;
|
|
22468
22376
|
const childrenTypeOf = typeof children;
|
|
22469
22377
|
if (data.length > 0 && !hasRenderProp) {
|
|
@@ -22628,7 +22536,7 @@ function DataList({
|
|
|
22628
22536
|
className
|
|
22629
22537
|
),
|
|
22630
22538
|
children: [
|
|
22631
|
-
groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
22539
|
+
groups.map((group, gi) => /* @__PURE__ */ jsxs(React127__default.Fragment, { children: [
|
|
22632
22540
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
|
|
22633
22541
|
group.items.map(
|
|
22634
22542
|
(itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
|
|
@@ -23904,7 +23812,7 @@ var init_WizardProgress = __esm({
|
|
|
23904
23812
|
children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
|
|
23905
23813
|
const isActive = index === currentStep;
|
|
23906
23814
|
const isCompleted = index < currentStep;
|
|
23907
|
-
return /* @__PURE__ */ jsxs(
|
|
23815
|
+
return /* @__PURE__ */ jsxs(React127__default.Fragment, { children: [
|
|
23908
23816
|
/* @__PURE__ */ jsx(
|
|
23909
23817
|
"button",
|
|
23910
23818
|
{
|
|
@@ -24815,7 +24723,7 @@ function InventoryGrid({
|
|
|
24815
24723
|
const eventBus = useEventBus();
|
|
24816
24724
|
const slotCount = totalSlots ?? items.length;
|
|
24817
24725
|
const emptySlotCount = Math.max(0, slotCount - items.length);
|
|
24818
|
-
const handleSelect =
|
|
24726
|
+
const handleSelect = React127.useCallback(
|
|
24819
24727
|
(id) => {
|
|
24820
24728
|
onSelect?.(id);
|
|
24821
24729
|
if (selectEvent) {
|
|
@@ -25028,15 +24936,15 @@ function GameCanvas2D({
|
|
|
25028
24936
|
fps = 60,
|
|
25029
24937
|
className
|
|
25030
24938
|
}) {
|
|
25031
|
-
const canvasRef =
|
|
25032
|
-
const rafRef =
|
|
25033
|
-
const frameRef =
|
|
25034
|
-
const lastTimeRef =
|
|
25035
|
-
const onDrawRef =
|
|
24939
|
+
const canvasRef = React127.useRef(null);
|
|
24940
|
+
const rafRef = React127.useRef(0);
|
|
24941
|
+
const frameRef = React127.useRef(0);
|
|
24942
|
+
const lastTimeRef = React127.useRef(0);
|
|
24943
|
+
const onDrawRef = React127.useRef(onDraw);
|
|
25036
24944
|
onDrawRef.current = onDraw;
|
|
25037
|
-
const onTickRef =
|
|
24945
|
+
const onTickRef = React127.useRef(onTick);
|
|
25038
24946
|
onTickRef.current = onTick;
|
|
25039
|
-
|
|
24947
|
+
React127.useEffect(() => {
|
|
25040
24948
|
const canvas = canvasRef.current;
|
|
25041
24949
|
if (!canvas) return;
|
|
25042
24950
|
const ctx = canvas.getContext("2d");
|
|
@@ -25325,7 +25233,7 @@ function TurnPanel({
|
|
|
25325
25233
|
className
|
|
25326
25234
|
}) {
|
|
25327
25235
|
const eventBus = useEventBus();
|
|
25328
|
-
const handleAction =
|
|
25236
|
+
const handleAction = React127.useCallback(
|
|
25329
25237
|
(event) => {
|
|
25330
25238
|
if (event) {
|
|
25331
25239
|
eventBus.emit(event, { turn: currentTurn, phase, activeTeam });
|
|
@@ -25471,7 +25379,7 @@ function UnitCommandBar({
|
|
|
25471
25379
|
className
|
|
25472
25380
|
}) {
|
|
25473
25381
|
const eventBus = useEventBus();
|
|
25474
|
-
const handleCommand =
|
|
25382
|
+
const handleCommand = React127.useCallback(
|
|
25475
25383
|
(event) => {
|
|
25476
25384
|
if (event) {
|
|
25477
25385
|
eventBus.emit(event, { unitId: selectedUnitId });
|
|
@@ -25956,7 +25864,7 @@ function GameMenu({
|
|
|
25956
25864
|
} catch {
|
|
25957
25865
|
}
|
|
25958
25866
|
const eventBus = eventBusProp || eventBusFromHook;
|
|
25959
|
-
const handleOptionClick =
|
|
25867
|
+
const handleOptionClick = React127.useCallback(
|
|
25960
25868
|
(option) => {
|
|
25961
25869
|
if (option.event && eventBus) {
|
|
25962
25870
|
eventBus.emit(`UI:${option.event}`, { option });
|
|
@@ -26070,7 +25978,7 @@ function GameOverScreen({
|
|
|
26070
25978
|
} catch {
|
|
26071
25979
|
}
|
|
26072
25980
|
const eventBus = eventBusProp || eventBusFromHook;
|
|
26073
|
-
const handleActionClick =
|
|
25981
|
+
const handleActionClick = React127.useCallback(
|
|
26074
25982
|
(action) => {
|
|
26075
25983
|
if (action.event && eventBus) {
|
|
26076
25984
|
eventBus.emit(`UI:${action.event}`, { action });
|
|
@@ -29174,7 +29082,7 @@ var init_StepFlow = __esm({
|
|
|
29174
29082
|
className
|
|
29175
29083
|
}) => {
|
|
29176
29084
|
if (orientation === "vertical") {
|
|
29177
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(
|
|
29085
|
+
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
29086
|
/* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
|
|
29179
29087
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
29180
29088
|
showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
|
|
@@ -29185,7 +29093,7 @@ var init_StepFlow = __esm({
|
|
|
29185
29093
|
] })
|
|
29186
29094
|
] }) }, index)) });
|
|
29187
29095
|
}
|
|
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(
|
|
29096
|
+
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
29097
|
/* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
|
|
29190
29098
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
29191
29099
|
/* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
|
|
@@ -31299,7 +31207,7 @@ var init_DocumentViewer = __esm({
|
|
|
31299
31207
|
}
|
|
31300
31208
|
});
|
|
31301
31209
|
function extractTitle(children) {
|
|
31302
|
-
if (!
|
|
31210
|
+
if (!React127__default.isValidElement(children)) return void 0;
|
|
31303
31211
|
const props = children.props;
|
|
31304
31212
|
if (typeof props.title === "string") {
|
|
31305
31213
|
return props.title;
|
|
@@ -31354,7 +31262,7 @@ function LinearView({
|
|
|
31354
31262
|
/* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
|
|
31355
31263
|
const isDone = i < currentIdx;
|
|
31356
31264
|
const isCurrent = i === currentIdx;
|
|
31357
|
-
return /* @__PURE__ */ jsxs(
|
|
31265
|
+
return /* @__PURE__ */ jsxs(React127__default.Fragment, { children: [
|
|
31358
31266
|
i > 0 && /* @__PURE__ */ jsx(
|
|
31359
31267
|
Typography,
|
|
31360
31268
|
{
|
|
@@ -32138,12 +32046,12 @@ var init_Form = __esm({
|
|
|
32138
32046
|
const isSchemaEntity = isOrbitalEntitySchema(entity);
|
|
32139
32047
|
const resolvedEntity = isSchemaEntity ? entity : void 0;
|
|
32140
32048
|
const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
|
|
32141
|
-
const normalizedInitialData =
|
|
32049
|
+
const normalizedInitialData = React127__default.useMemo(() => {
|
|
32142
32050
|
const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
|
|
32143
32051
|
const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
|
|
32144
32052
|
return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
|
|
32145
32053
|
}, [entity, initialData]);
|
|
32146
|
-
const entityDerivedFields =
|
|
32054
|
+
const entityDerivedFields = React127__default.useMemo(() => {
|
|
32147
32055
|
if (fields && fields.length > 0) return void 0;
|
|
32148
32056
|
if (!resolvedEntity) return void 0;
|
|
32149
32057
|
return resolvedEntity.fields.map(
|
|
@@ -32162,14 +32070,14 @@ var init_Form = __esm({
|
|
|
32162
32070
|
const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
|
|
32163
32071
|
const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
|
|
32164
32072
|
const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
|
|
32165
|
-
const [formData, setFormData] =
|
|
32073
|
+
const [formData, setFormData] = React127__default.useState(
|
|
32166
32074
|
normalizedInitialData
|
|
32167
32075
|
);
|
|
32168
|
-
const [collapsedSections, setCollapsedSections] =
|
|
32076
|
+
const [collapsedSections, setCollapsedSections] = React127__default.useState(
|
|
32169
32077
|
/* @__PURE__ */ new Set()
|
|
32170
32078
|
);
|
|
32171
32079
|
const formMode = props.mode;
|
|
32172
|
-
const mountedRef =
|
|
32080
|
+
const mountedRef = React127__default.useRef(false);
|
|
32173
32081
|
if (!mountedRef.current) {
|
|
32174
32082
|
mountedRef.current = true;
|
|
32175
32083
|
debug("forms", "mount", {
|
|
@@ -32182,7 +32090,7 @@ var init_Form = __esm({
|
|
|
32182
32090
|
});
|
|
32183
32091
|
}
|
|
32184
32092
|
const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
|
|
32185
|
-
const evalContext =
|
|
32093
|
+
const evalContext = React127__default.useMemo(
|
|
32186
32094
|
() => ({
|
|
32187
32095
|
formValues: formData,
|
|
32188
32096
|
globalVariables: externalContext?.globalVariables ?? {},
|
|
@@ -32191,7 +32099,7 @@ var init_Form = __esm({
|
|
|
32191
32099
|
}),
|
|
32192
32100
|
[formData, externalContext]
|
|
32193
32101
|
);
|
|
32194
|
-
|
|
32102
|
+
React127__default.useEffect(() => {
|
|
32195
32103
|
debug("forms", "initialData-sync", {
|
|
32196
32104
|
mode: formMode,
|
|
32197
32105
|
normalizedInitialData,
|
|
@@ -32202,7 +32110,7 @@ var init_Form = __esm({
|
|
|
32202
32110
|
setFormData(normalizedInitialData);
|
|
32203
32111
|
}
|
|
32204
32112
|
}, [normalizedInitialData]);
|
|
32205
|
-
const processCalculations =
|
|
32113
|
+
const processCalculations = React127__default.useCallback(
|
|
32206
32114
|
(changedFieldId, newFormData) => {
|
|
32207
32115
|
if (!hiddenCalculations.length) return;
|
|
32208
32116
|
const context = {
|
|
@@ -32227,7 +32135,7 @@ var init_Form = __esm({
|
|
|
32227
32135
|
},
|
|
32228
32136
|
[hiddenCalculations, externalContext, eventBus]
|
|
32229
32137
|
);
|
|
32230
|
-
const checkViolations =
|
|
32138
|
+
const checkViolations = React127__default.useCallback(
|
|
32231
32139
|
(changedFieldId, newFormData) => {
|
|
32232
32140
|
if (!violationTriggers.length) return;
|
|
32233
32141
|
const context = {
|
|
@@ -32265,7 +32173,7 @@ var init_Form = __esm({
|
|
|
32265
32173
|
processCalculations(name, newFormData);
|
|
32266
32174
|
checkViolations(name, newFormData);
|
|
32267
32175
|
};
|
|
32268
|
-
const isFieldVisible =
|
|
32176
|
+
const isFieldVisible = React127__default.useCallback(
|
|
32269
32177
|
(fieldName) => {
|
|
32270
32178
|
const condition = conditionalFields[fieldName];
|
|
32271
32179
|
if (!condition) return true;
|
|
@@ -32273,7 +32181,7 @@ var init_Form = __esm({
|
|
|
32273
32181
|
},
|
|
32274
32182
|
[conditionalFields, evalContext]
|
|
32275
32183
|
);
|
|
32276
|
-
const isSectionVisible =
|
|
32184
|
+
const isSectionVisible = React127__default.useCallback(
|
|
32277
32185
|
(section) => {
|
|
32278
32186
|
if (!section.condition) return true;
|
|
32279
32187
|
return Boolean(evaluateFormExpression(section.condition, evalContext));
|
|
@@ -32317,7 +32225,7 @@ var init_Form = __esm({
|
|
|
32317
32225
|
eventBus.emit(`UI:${onCancel}`);
|
|
32318
32226
|
}
|
|
32319
32227
|
};
|
|
32320
|
-
const renderField =
|
|
32228
|
+
const renderField = React127__default.useCallback(
|
|
32321
32229
|
(field) => {
|
|
32322
32230
|
const fieldName = field.name || field.field;
|
|
32323
32231
|
if (!fieldName) return null;
|
|
@@ -32338,7 +32246,7 @@ var init_Form = __esm({
|
|
|
32338
32246
|
[formData, isFieldVisible, relationsData, relationsLoading, isLoading]
|
|
32339
32247
|
);
|
|
32340
32248
|
const effectiveFields = entityDerivedFields ?? fields;
|
|
32341
|
-
const normalizedFields =
|
|
32249
|
+
const normalizedFields = React127__default.useMemo(() => {
|
|
32342
32250
|
if (!effectiveFields || effectiveFields.length === 0) return [];
|
|
32343
32251
|
return effectiveFields.map((field) => {
|
|
32344
32252
|
if (typeof field === "string") {
|
|
@@ -32360,7 +32268,7 @@ var init_Form = __esm({
|
|
|
32360
32268
|
return field;
|
|
32361
32269
|
});
|
|
32362
32270
|
}, [effectiveFields, resolvedEntity]);
|
|
32363
|
-
const schemaFields =
|
|
32271
|
+
const schemaFields = React127__default.useMemo(() => {
|
|
32364
32272
|
if (normalizedFields.length === 0) return null;
|
|
32365
32273
|
if (isDebugEnabled()) {
|
|
32366
32274
|
debugGroup(`Form: ${entityName || "unknown"}`);
|
|
@@ -32370,7 +32278,7 @@ var init_Form = __esm({
|
|
|
32370
32278
|
}
|
|
32371
32279
|
return normalizedFields.map(renderField).filter(Boolean);
|
|
32372
32280
|
}, [normalizedFields, renderField, entityName, conditionalFields]);
|
|
32373
|
-
const sectionElements =
|
|
32281
|
+
const sectionElements = React127__default.useMemo(() => {
|
|
32374
32282
|
if (!sections || sections.length === 0) return null;
|
|
32375
32283
|
return sections.map((section) => {
|
|
32376
32284
|
if (!isSectionVisible(section)) {
|
|
@@ -33894,7 +33802,7 @@ var init_List = __esm({
|
|
|
33894
33802
|
if (entity && typeof entity === "object" && "id" in entity) return [entity];
|
|
33895
33803
|
return [];
|
|
33896
33804
|
}, [entity]);
|
|
33897
|
-
const getItemActions =
|
|
33805
|
+
const getItemActions = React127__default.useCallback(
|
|
33898
33806
|
(item) => {
|
|
33899
33807
|
if (!itemActions) return [];
|
|
33900
33808
|
if (typeof itemActions === "function") {
|
|
@@ -34331,7 +34239,7 @@ var init_MediaGallery = __esm({
|
|
|
34331
34239
|
[selectable, selectedItems, selectionEvent, eventBus]
|
|
34332
34240
|
);
|
|
34333
34241
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
34334
|
-
const items =
|
|
34242
|
+
const items = React127__default.useMemo(() => {
|
|
34335
34243
|
if (propItems) return propItems;
|
|
34336
34244
|
if (entityData.length === 0) return [];
|
|
34337
34245
|
return entityData.map((record, idx) => ({
|
|
@@ -34495,7 +34403,7 @@ var init_MediaGallery = __esm({
|
|
|
34495
34403
|
}
|
|
34496
34404
|
});
|
|
34497
34405
|
function extractTitle2(children) {
|
|
34498
|
-
if (!
|
|
34406
|
+
if (!React127__default.isValidElement(children)) return void 0;
|
|
34499
34407
|
const props = children.props;
|
|
34500
34408
|
if (typeof props.title === "string") {
|
|
34501
34409
|
return props.title;
|
|
@@ -35208,7 +35116,7 @@ var init_PageHeader = __esm({
|
|
|
35208
35116
|
info: "bg-info/10 text-info"
|
|
35209
35117
|
};
|
|
35210
35118
|
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(
|
|
35119
|
+
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
35120
|
idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
|
|
35213
35121
|
crumb.href ? /* @__PURE__ */ jsx(
|
|
35214
35122
|
"a",
|
|
@@ -35401,7 +35309,7 @@ var init_debugRegistry = __esm({
|
|
|
35401
35309
|
}
|
|
35402
35310
|
});
|
|
35403
35311
|
function useDebugData() {
|
|
35404
|
-
const [data, setData] =
|
|
35312
|
+
const [data, setData] = React127.useState(() => ({
|
|
35405
35313
|
traits: [],
|
|
35406
35314
|
ticks: [],
|
|
35407
35315
|
guards: [],
|
|
@@ -35415,7 +35323,7 @@ function useDebugData() {
|
|
|
35415
35323
|
},
|
|
35416
35324
|
lastUpdate: Date.now()
|
|
35417
35325
|
}));
|
|
35418
|
-
|
|
35326
|
+
React127.useEffect(() => {
|
|
35419
35327
|
const updateData = () => {
|
|
35420
35328
|
setData({
|
|
35421
35329
|
traits: getAllTraits(),
|
|
@@ -35524,12 +35432,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
|
|
|
35524
35432
|
return positions;
|
|
35525
35433
|
}
|
|
35526
35434
|
function WalkMinimap() {
|
|
35527
|
-
const [walkStep, setWalkStep] =
|
|
35528
|
-
const [traits2, setTraits] =
|
|
35529
|
-
const [coveredEdges, setCoveredEdges] =
|
|
35530
|
-
const [completedTraits, setCompletedTraits] =
|
|
35531
|
-
const prevTraitRef =
|
|
35532
|
-
|
|
35435
|
+
const [walkStep, setWalkStep] = React127.useState(null);
|
|
35436
|
+
const [traits2, setTraits] = React127.useState([]);
|
|
35437
|
+
const [coveredEdges, setCoveredEdges] = React127.useState([]);
|
|
35438
|
+
const [completedTraits, setCompletedTraits] = React127.useState(/* @__PURE__ */ new Set());
|
|
35439
|
+
const prevTraitRef = React127.useRef(null);
|
|
35440
|
+
React127.useEffect(() => {
|
|
35533
35441
|
const interval = setInterval(() => {
|
|
35534
35442
|
const w = window;
|
|
35535
35443
|
const step = w.__orbitalWalkStep;
|
|
@@ -35976,15 +35884,15 @@ var init_EntitiesTab = __esm({
|
|
|
35976
35884
|
}
|
|
35977
35885
|
});
|
|
35978
35886
|
function EventFlowTab({ events: events2 }) {
|
|
35979
|
-
const [filter, setFilter] =
|
|
35980
|
-
const containerRef =
|
|
35981
|
-
const [autoScroll, setAutoScroll] =
|
|
35982
|
-
|
|
35887
|
+
const [filter, setFilter] = React127.useState("all");
|
|
35888
|
+
const containerRef = React127.useRef(null);
|
|
35889
|
+
const [autoScroll, setAutoScroll] = React127.useState(true);
|
|
35890
|
+
React127.useEffect(() => {
|
|
35983
35891
|
if (autoScroll && containerRef.current) {
|
|
35984
35892
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
35985
35893
|
}
|
|
35986
35894
|
}, [events2.length, autoScroll]);
|
|
35987
|
-
const filteredEvents =
|
|
35895
|
+
const filteredEvents = React127.useMemo(() => {
|
|
35988
35896
|
if (filter === "all") return events2;
|
|
35989
35897
|
return events2.filter((e) => e.type === filter);
|
|
35990
35898
|
}, [events2, filter]);
|
|
@@ -36103,7 +36011,7 @@ var init_EventFlowTab = __esm({
|
|
|
36103
36011
|
}
|
|
36104
36012
|
});
|
|
36105
36013
|
function GuardsPanel({ guards }) {
|
|
36106
|
-
const [filter, setFilter] =
|
|
36014
|
+
const [filter, setFilter] = React127.useState("all");
|
|
36107
36015
|
if (guards.length === 0) {
|
|
36108
36016
|
return /* @__PURE__ */ jsx(
|
|
36109
36017
|
EmptyState,
|
|
@@ -36116,7 +36024,7 @@ function GuardsPanel({ guards }) {
|
|
|
36116
36024
|
}
|
|
36117
36025
|
const passedCount = guards.filter((g) => g.result).length;
|
|
36118
36026
|
const failedCount = guards.length - passedCount;
|
|
36119
|
-
const filteredGuards =
|
|
36027
|
+
const filteredGuards = React127.useMemo(() => {
|
|
36120
36028
|
if (filter === "all") return guards;
|
|
36121
36029
|
if (filter === "passed") return guards.filter((g) => g.result);
|
|
36122
36030
|
return guards.filter((g) => !g.result);
|
|
@@ -36277,10 +36185,10 @@ function EffectBadge({ effect }) {
|
|
|
36277
36185
|
] });
|
|
36278
36186
|
}
|
|
36279
36187
|
function TransitionTimeline({ transitions }) {
|
|
36280
|
-
const containerRef =
|
|
36281
|
-
const [autoScroll, setAutoScroll] =
|
|
36282
|
-
const [expandedId, setExpandedId] =
|
|
36283
|
-
|
|
36188
|
+
const containerRef = React127.useRef(null);
|
|
36189
|
+
const [autoScroll, setAutoScroll] = React127.useState(true);
|
|
36190
|
+
const [expandedId, setExpandedId] = React127.useState(null);
|
|
36191
|
+
React127.useEffect(() => {
|
|
36284
36192
|
if (autoScroll && containerRef.current) {
|
|
36285
36193
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
36286
36194
|
}
|
|
@@ -36566,9 +36474,9 @@ function getAllEvents(traits2) {
|
|
|
36566
36474
|
}
|
|
36567
36475
|
function EventDispatcherTab({ traits: traits2, schema }) {
|
|
36568
36476
|
const eventBus = useEventBus();
|
|
36569
|
-
const [log4, setLog] =
|
|
36570
|
-
const prevStatesRef =
|
|
36571
|
-
|
|
36477
|
+
const [log4, setLog] = React127.useState([]);
|
|
36478
|
+
const prevStatesRef = React127.useRef(/* @__PURE__ */ new Map());
|
|
36479
|
+
React127.useEffect(() => {
|
|
36572
36480
|
for (const trait of traits2) {
|
|
36573
36481
|
const prev = prevStatesRef.current.get(trait.id);
|
|
36574
36482
|
if (prev && prev !== trait.currentState) {
|
|
@@ -36738,10 +36646,10 @@ function VerifyModePanel({
|
|
|
36738
36646
|
serverCount,
|
|
36739
36647
|
localCount
|
|
36740
36648
|
}) {
|
|
36741
|
-
const [expanded, setExpanded] =
|
|
36742
|
-
const scrollRef =
|
|
36743
|
-
const prevCountRef =
|
|
36744
|
-
|
|
36649
|
+
const [expanded, setExpanded] = React127.useState(true);
|
|
36650
|
+
const scrollRef = React127.useRef(null);
|
|
36651
|
+
const prevCountRef = React127.useRef(0);
|
|
36652
|
+
React127.useEffect(() => {
|
|
36745
36653
|
if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
|
|
36746
36654
|
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
36747
36655
|
}
|
|
@@ -36807,10 +36715,10 @@ function RuntimeDebugger({
|
|
|
36807
36715
|
defaultTab,
|
|
36808
36716
|
schema
|
|
36809
36717
|
}) {
|
|
36810
|
-
const [isCollapsed, setIsCollapsed] =
|
|
36811
|
-
const [isVisible, setIsVisible] =
|
|
36718
|
+
const [isCollapsed, setIsCollapsed] = React127.useState(mode === "verify" ? true : defaultCollapsed);
|
|
36719
|
+
const [isVisible, setIsVisible] = React127.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
|
|
36812
36720
|
const debugData = useDebugData();
|
|
36813
|
-
|
|
36721
|
+
React127.useEffect(() => {
|
|
36814
36722
|
if (mode === "inline") return;
|
|
36815
36723
|
return onDebugToggle((enabled) => {
|
|
36816
36724
|
setIsVisible(enabled);
|
|
@@ -36819,7 +36727,7 @@ function RuntimeDebugger({
|
|
|
36819
36727
|
}
|
|
36820
36728
|
});
|
|
36821
36729
|
}, [mode]);
|
|
36822
|
-
|
|
36730
|
+
React127.useEffect(() => {
|
|
36823
36731
|
if (mode === "inline") return;
|
|
36824
36732
|
const handleKeyDown = (e) => {
|
|
36825
36733
|
if (e.key === "`" && isVisible) {
|
|
@@ -37368,7 +37276,7 @@ function SequenceBar({
|
|
|
37368
37276
|
onSlotRemove(index);
|
|
37369
37277
|
}, [onSlotRemove, playing]);
|
|
37370
37278
|
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(
|
|
37279
|
+
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React127__default.Fragment, { children: [
|
|
37372
37280
|
i > 0 && /* @__PURE__ */ jsx(
|
|
37373
37281
|
Typography,
|
|
37374
37282
|
{
|
|
@@ -38713,7 +38621,7 @@ var init_StatCard2 = __esm({
|
|
|
38713
38621
|
const labelToUse = propLabel ?? propTitle;
|
|
38714
38622
|
const eventBus = useEventBus();
|
|
38715
38623
|
const { t } = useTranslate();
|
|
38716
|
-
const handleActionClick =
|
|
38624
|
+
const handleActionClick = React127__default.useCallback(() => {
|
|
38717
38625
|
if (action?.event) {
|
|
38718
38626
|
eventBus.emit(`UI:${action.event}`, {});
|
|
38719
38627
|
}
|
|
@@ -38724,7 +38632,7 @@ var init_StatCard2 = __esm({
|
|
|
38724
38632
|
const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
38725
38633
|
const isLoading = externalLoading ?? false;
|
|
38726
38634
|
const error = externalError;
|
|
38727
|
-
const computeMetricValue =
|
|
38635
|
+
const computeMetricValue = React127__default.useCallback(
|
|
38728
38636
|
(metric, items) => {
|
|
38729
38637
|
if (metric.value !== void 0) {
|
|
38730
38638
|
return metric.value;
|
|
@@ -38763,7 +38671,7 @@ var init_StatCard2 = __esm({
|
|
|
38763
38671
|
},
|
|
38764
38672
|
[]
|
|
38765
38673
|
);
|
|
38766
|
-
const schemaStats =
|
|
38674
|
+
const schemaStats = React127__default.useMemo(() => {
|
|
38767
38675
|
if (!metrics || metrics.length === 0) return null;
|
|
38768
38676
|
return metrics.map((metric) => ({
|
|
38769
38677
|
label: metric.label,
|
|
@@ -38771,7 +38679,7 @@ var init_StatCard2 = __esm({
|
|
|
38771
38679
|
format: metric.format
|
|
38772
38680
|
}));
|
|
38773
38681
|
}, [metrics, data, computeMetricValue]);
|
|
38774
|
-
const calculatedTrend =
|
|
38682
|
+
const calculatedTrend = React127__default.useMemo(() => {
|
|
38775
38683
|
if (manualTrend !== void 0) return manualTrend;
|
|
38776
38684
|
if (previousValue === void 0 || currentValue === void 0)
|
|
38777
38685
|
return void 0;
|
|
@@ -39755,7 +39663,7 @@ var init_Timeline = __esm({
|
|
|
39755
39663
|
}) => {
|
|
39756
39664
|
const { t } = useTranslate();
|
|
39757
39665
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
39758
|
-
const items =
|
|
39666
|
+
const items = React127__default.useMemo(() => {
|
|
39759
39667
|
if (propItems) return propItems;
|
|
39760
39668
|
if (entityData.length === 0) return [];
|
|
39761
39669
|
return entityData.map((record, idx) => {
|
|
@@ -39862,7 +39770,7 @@ var init_Timeline = __esm({
|
|
|
39862
39770
|
}
|
|
39863
39771
|
});
|
|
39864
39772
|
function extractToastProps(children) {
|
|
39865
|
-
if (!
|
|
39773
|
+
if (!React127__default.isValidElement(children)) {
|
|
39866
39774
|
if (typeof children === "string") {
|
|
39867
39775
|
return { message: children };
|
|
39868
39776
|
}
|
|
@@ -39900,7 +39808,7 @@ var init_ToastSlot = __esm({
|
|
|
39900
39808
|
eventBus.emit("UI:CLOSE");
|
|
39901
39809
|
};
|
|
39902
39810
|
if (!isVisible) return null;
|
|
39903
|
-
const isCustomContent =
|
|
39811
|
+
const isCustomContent = React127__default.isValidElement(children) && !message;
|
|
39904
39812
|
return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
|
|
39905
39813
|
Toast,
|
|
39906
39814
|
{
|
|
@@ -40169,7 +40077,7 @@ var init_WizardContainer = __esm({
|
|
|
40169
40077
|
const isCompleted = index < currentStep;
|
|
40170
40078
|
const stepKey = step.id ?? step.tabId ?? `step-${index}`;
|
|
40171
40079
|
const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
|
|
40172
|
-
return /* @__PURE__ */ jsxs(
|
|
40080
|
+
return /* @__PURE__ */ jsxs(React127__default.Fragment, { children: [
|
|
40173
40081
|
/* @__PURE__ */ jsx(
|
|
40174
40082
|
Button,
|
|
40175
40083
|
{
|
|
@@ -42358,7 +42266,7 @@ function UnitRenderer({
|
|
|
42358
42266
|
onAnimationStateChange,
|
|
42359
42267
|
animationSpeed = 1
|
|
42360
42268
|
}) {
|
|
42361
|
-
const handleUnitClick =
|
|
42269
|
+
const handleUnitClick = React127__default.useCallback(
|
|
42362
42270
|
(unit) => {
|
|
42363
42271
|
onUnitClick?.(unit);
|
|
42364
42272
|
},
|
|
@@ -45552,7 +45460,7 @@ var init_Avl3DViewer = __esm({
|
|
|
45552
45460
|
const handleTraitClick = useCallback((name) => {
|
|
45553
45461
|
dispatch({ type: "ZOOM_INTO_TRAIT", trait: name, targetPosition: { x: 0, y: 0 } });
|
|
45554
45462
|
}, []);
|
|
45555
|
-
const [highlightedTrait, setHighlightedTrait] =
|
|
45463
|
+
const [highlightedTrait, setHighlightedTrait] = React127__default.useState(null);
|
|
45556
45464
|
const handleTransitionClick = useCallback((index) => {
|
|
45557
45465
|
dispatch({ type: "ZOOM_INTO_TRANSITION", transitionIndex: index, targetPosition: { x: 0, y: 0 } });
|
|
45558
45466
|
}, []);
|
|
@@ -45639,7 +45547,7 @@ var init_Avl3DViewer = __esm({
|
|
|
45639
45547
|
gap: "xs",
|
|
45640
45548
|
align: "center",
|
|
45641
45549
|
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(
|
|
45550
|
+
children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(React127__default.Fragment, { children: [
|
|
45643
45551
|
i > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", className: "mx-1", children: "/" }),
|
|
45644
45552
|
i < breadcrumbs.length - 1 ? /* @__PURE__ */ jsx(
|
|
45645
45553
|
Box,
|
|
@@ -46017,12 +45925,12 @@ var init_three = __esm({
|
|
|
46017
45925
|
}
|
|
46018
45926
|
});
|
|
46019
45927
|
function lazyThree(name, loader) {
|
|
46020
|
-
const Lazy =
|
|
45928
|
+
const Lazy = React127__default.lazy(() => loader().then((m) => ({ default: m[name] })));
|
|
46021
45929
|
function ThreeWrapper(props) {
|
|
46022
|
-
return
|
|
46023
|
-
|
|
45930
|
+
return React127__default.createElement(
|
|
45931
|
+
React127__default.Suspense,
|
|
46024
45932
|
{ fallback: null },
|
|
46025
|
-
|
|
45933
|
+
React127__default.createElement(Lazy, props)
|
|
46026
45934
|
);
|
|
46027
45935
|
}
|
|
46028
45936
|
ThreeWrapper.displayName = `Lazy(${name})`;
|
|
@@ -46510,7 +46418,7 @@ function SuspenseConfigProvider({
|
|
|
46510
46418
|
config,
|
|
46511
46419
|
children
|
|
46512
46420
|
}) {
|
|
46513
|
-
return
|
|
46421
|
+
return React127__default.createElement(
|
|
46514
46422
|
SuspenseConfigContext.Provider,
|
|
46515
46423
|
{ value: config },
|
|
46516
46424
|
children
|
|
@@ -46993,7 +46901,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
|
|
|
46993
46901
|
const key = `${parentId}-${index}-trait:${traitName}`;
|
|
46994
46902
|
return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
|
|
46995
46903
|
}
|
|
46996
|
-
return /* @__PURE__ */ jsx(
|
|
46904
|
+
return /* @__PURE__ */ jsx(React127__default.Fragment, { children: child }, `${parentId}-${index}`);
|
|
46997
46905
|
}
|
|
46998
46906
|
if (!child || typeof child !== "object") return null;
|
|
46999
46907
|
const childId = `${parentId}-${index}`;
|
|
@@ -47208,7 +47116,7 @@ var init_UISlotRenderer = __esm({
|
|
|
47208
47116
|
init_Box();
|
|
47209
47117
|
init_Typography();
|
|
47210
47118
|
init_useEventBus();
|
|
47211
|
-
|
|
47119
|
+
init_slot_types();
|
|
47212
47120
|
init_cn();
|
|
47213
47121
|
init_ErrorBoundary();
|
|
47214
47122
|
init_logger();
|
|
@@ -47637,7 +47545,7 @@ var AvlTransition = ({
|
|
|
47637
47545
|
opacity = 1,
|
|
47638
47546
|
className
|
|
47639
47547
|
}) => {
|
|
47640
|
-
const ids =
|
|
47548
|
+
const ids = React127__default.useMemo(() => {
|
|
47641
47549
|
avlTransitionId += 1;
|
|
47642
47550
|
return { arrow: `avl-tr-${avlTransitionId}-arrow` };
|
|
47643
47551
|
}, []);
|
|
@@ -48402,7 +48310,7 @@ var AvlStateMachine = ({
|
|
|
48402
48310
|
color = "var(--color-primary)",
|
|
48403
48311
|
animated = false
|
|
48404
48312
|
}) => {
|
|
48405
|
-
const ids =
|
|
48313
|
+
const ids = React127__default.useMemo(() => {
|
|
48406
48314
|
avlSmId += 1;
|
|
48407
48315
|
const base = `avl-sm-${avlSmId}`;
|
|
48408
48316
|
return { glow: `${base}-glow`, grad: `${base}-grad` };
|
|
@@ -48597,7 +48505,7 @@ var AvlOrbitalUnit = ({
|
|
|
48597
48505
|
color = "var(--color-primary)",
|
|
48598
48506
|
animated = false
|
|
48599
48507
|
}) => {
|
|
48600
|
-
const ids =
|
|
48508
|
+
const ids = React127__default.useMemo(() => {
|
|
48601
48509
|
avlOuId += 1;
|
|
48602
48510
|
const base = `avl-ou-${avlOuId}`;
|
|
48603
48511
|
return { glow: `${base}-glow`, grad: `${base}-grad` };
|
|
@@ -48689,7 +48597,7 @@ var AvlClosedCircuit = ({
|
|
|
48689
48597
|
color = "var(--color-primary)",
|
|
48690
48598
|
animated = false
|
|
48691
48599
|
}) => {
|
|
48692
|
-
const ids =
|
|
48600
|
+
const ids = React127__default.useMemo(() => {
|
|
48693
48601
|
avlCcId += 1;
|
|
48694
48602
|
const base = `avl-cc-${avlCcId}`;
|
|
48695
48603
|
return { glow: `${base}-glow`, grad: `${base}-grad`, arrow: `${base}-arrow` };
|
|
@@ -48842,7 +48750,7 @@ var AvlEmitListen = ({
|
|
|
48842
48750
|
color = "var(--color-primary)",
|
|
48843
48751
|
animated = false
|
|
48844
48752
|
}) => {
|
|
48845
|
-
const ids =
|
|
48753
|
+
const ids = React127__default.useMemo(() => {
|
|
48846
48754
|
avlElId += 1;
|
|
48847
48755
|
const base = `avl-el-${avlElId}`;
|
|
48848
48756
|
return { arrow: `${base}-arrow`, grad: `${base}-grad` };
|
|
@@ -49115,7 +49023,7 @@ function renderNode(node, color, glowId) {
|
|
|
49115
49023
|
const baseR = node.type === "operator" ? 20 : 16;
|
|
49116
49024
|
const r2 = Math.max(baseR, labelLen * 3.5 + 6);
|
|
49117
49025
|
const nc = nodeColor(node.type, color);
|
|
49118
|
-
return /* @__PURE__ */ jsxs(
|
|
49026
|
+
return /* @__PURE__ */ jsxs(React127__default.Fragment, { children: [
|
|
49119
49027
|
node.children.map((child, i) => {
|
|
49120
49028
|
const childR = Math.max(
|
|
49121
49029
|
child.type === "operator" ? 20 : 16,
|
|
@@ -49172,7 +49080,7 @@ var AvlExprTree = ({
|
|
|
49172
49080
|
className,
|
|
49173
49081
|
color = "var(--color-primary)"
|
|
49174
49082
|
}) => {
|
|
49175
|
-
const ids =
|
|
49083
|
+
const ids = React127__default.useMemo(() => {
|
|
49176
49084
|
avlEtId += 1;
|
|
49177
49085
|
return { glow: `avl-et-${avlEtId}-glow` };
|
|
49178
49086
|
}, []);
|
|
@@ -50146,7 +50054,7 @@ var SystemNode = ({ data }) => {
|
|
|
50146
50054
|
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
50055
|
const tc = transitionCounts[s.name] ?? 0;
|
|
50148
50056
|
const role = getStateRole(s.name, s.isInitial, s.isTerminal, tc, maxTC);
|
|
50149
|
-
return /* @__PURE__ */ jsxs(
|
|
50057
|
+
return /* @__PURE__ */ jsxs(React127__default.Fragment, { children: [
|
|
50150
50058
|
/* @__PURE__ */ jsx(AvlState, { x: i * 14 + 1, y: 1, width: 10, height: 8, name: "", role, isInitial: s.isInitial, isTerminal: s.isTerminal }),
|
|
50151
50059
|
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
50060
|
] }, s.name);
|
|
@@ -50186,7 +50094,7 @@ var MiniStateMachine = ({ data, className }) => {
|
|
|
50186
50094
|
const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
|
|
50187
50095
|
const tc = transitionCounts[s.name] ?? 0;
|
|
50188
50096
|
const role = getStateRole(s.name, s.isInitial, s.isTerminal, tc, maxTC);
|
|
50189
|
-
return /* @__PURE__ */ jsxs(
|
|
50097
|
+
return /* @__PURE__ */ jsxs(React127__default.Fragment, { children: [
|
|
50190
50098
|
/* @__PURE__ */ jsx(
|
|
50191
50099
|
AvlState,
|
|
50192
50100
|
{
|
|
@@ -51693,6 +51601,7 @@ init_EntitySchemaContext();
|
|
|
51693
51601
|
init_traitRegistry();
|
|
51694
51602
|
init_verificationRegistry();
|
|
51695
51603
|
var crossTraitLog = createLogger("almadar:ui:cross-trait");
|
|
51604
|
+
var flushLog = createLogger("almadar:ui:slot-flush");
|
|
51696
51605
|
function toTraitDefinition(binding) {
|
|
51697
51606
|
return {
|
|
51698
51607
|
name: binding.trait.name,
|
|
@@ -51704,7 +51613,7 @@ function toTraitDefinition(binding) {
|
|
|
51704
51613
|
function normalizeEventKey(eventKey) {
|
|
51705
51614
|
return eventKey.startsWith("UI:") ? eventKey.slice(3) : eventKey;
|
|
51706
51615
|
}
|
|
51707
|
-
function useTraitStateMachine(traitBindings,
|
|
51616
|
+
function useTraitStateMachine(traitBindings, uiSlots, options) {
|
|
51708
51617
|
const eventBus = useEventBus();
|
|
51709
51618
|
const { entities } = useEntitySchema();
|
|
51710
51619
|
const traitConfigsByName = options?.traitConfigsByName;
|
|
@@ -51727,7 +51636,8 @@ function useTraitStateMachine(traitBindings, slotsActions, options) {
|
|
|
51727
51636
|
const processingRef = useRef(false);
|
|
51728
51637
|
const traitBindingsRef = useRef(traitBindings);
|
|
51729
51638
|
const managerRef = useRef(manager);
|
|
51730
|
-
const
|
|
51639
|
+
const uiSlotsRef = useRef(uiSlots);
|
|
51640
|
+
const embeddedTraitsRef = useRef(options?.embeddedTraits);
|
|
51731
51641
|
const optionsRef = useRef(options);
|
|
51732
51642
|
useEffect(() => {
|
|
51733
51643
|
traitBindingsRef.current = traitBindings;
|
|
@@ -51737,8 +51647,59 @@ function useTraitStateMachine(traitBindings, slotsActions, options) {
|
|
|
51737
51647
|
setTraitStates(manager.getAllStates());
|
|
51738
51648
|
}, [manager]);
|
|
51739
51649
|
useEffect(() => {
|
|
51740
|
-
|
|
51741
|
-
}, [
|
|
51650
|
+
uiSlotsRef.current = uiSlots;
|
|
51651
|
+
}, [uiSlots]);
|
|
51652
|
+
useEffect(() => {
|
|
51653
|
+
embeddedTraitsRef.current = options?.embeddedTraits;
|
|
51654
|
+
}, [options?.embeddedTraits]);
|
|
51655
|
+
const flushSlot = useCallback(
|
|
51656
|
+
(traitName, slot, patterns) => {
|
|
51657
|
+
const slots = uiSlotsRef.current;
|
|
51658
|
+
const embedded = embeddedTraitsRef.current;
|
|
51659
|
+
if (patterns.length === 0) {
|
|
51660
|
+
flushLog.info("clear", { traitName, slot });
|
|
51661
|
+
slots.clearBySource(slot, traitName);
|
|
51662
|
+
return;
|
|
51663
|
+
}
|
|
51664
|
+
const last = patterns[patterns.length - 1];
|
|
51665
|
+
const record = last.pattern ?? {};
|
|
51666
|
+
const { type: patternType, children: nested, ...inlineProps } = record;
|
|
51667
|
+
const props = {
|
|
51668
|
+
...inlineProps,
|
|
51669
|
+
...last.props,
|
|
51670
|
+
...nested !== void 0 ? { children: nested } : {}
|
|
51671
|
+
};
|
|
51672
|
+
const isEmbedded = embedded?.has(traitName) ?? false;
|
|
51673
|
+
if (isEmbedded) {
|
|
51674
|
+
flushLog.info("embed-route", {
|
|
51675
|
+
traitName,
|
|
51676
|
+
slot,
|
|
51677
|
+
patternType: typeof patternType === "string" ? patternType : void 0,
|
|
51678
|
+
embeddedSize: embedded?.size ?? 0
|
|
51679
|
+
});
|
|
51680
|
+
slots.updateTraitContent(traitName, {
|
|
51681
|
+
pattern: patternType,
|
|
51682
|
+
props,
|
|
51683
|
+
priority: 0,
|
|
51684
|
+
animation: "fade"
|
|
51685
|
+
});
|
|
51686
|
+
return;
|
|
51687
|
+
}
|
|
51688
|
+
flushLog.info("slot-render", {
|
|
51689
|
+
traitName,
|
|
51690
|
+
slot,
|
|
51691
|
+
patternType: typeof patternType === "string" ? patternType : void 0,
|
|
51692
|
+
embedded: Array.from(embedded ?? [])
|
|
51693
|
+
});
|
|
51694
|
+
slots.render({
|
|
51695
|
+
target: slot,
|
|
51696
|
+
pattern: patternType,
|
|
51697
|
+
props,
|
|
51698
|
+
sourceTrait: traitName
|
|
51699
|
+
});
|
|
51700
|
+
},
|
|
51701
|
+
[]
|
|
51702
|
+
);
|
|
51742
51703
|
useEffect(() => {
|
|
51743
51704
|
optionsRef.current = options;
|
|
51744
51705
|
}, [options]);
|
|
@@ -51831,7 +51792,6 @@ function useTraitStateMachine(traitBindings, slotsActions, options) {
|
|
|
51831
51792
|
};
|
|
51832
51793
|
}, [traitBindings]);
|
|
51833
51794
|
const runTickEffects = useCallback((tick, binding) => {
|
|
51834
|
-
const actions = slotsActionsRef.current;
|
|
51835
51795
|
const currentState = traitStatesRef.current.get(binding.trait.name)?.currentState ?? "";
|
|
51836
51796
|
if (tick.appliesTo.length > 0 && !tick.appliesTo.includes(currentState)) return;
|
|
51837
51797
|
const bindingCtx = { entity: {}, payload: {}, state: currentState };
|
|
@@ -51844,13 +51804,12 @@ function useTraitStateMachine(traitBindings, slotsActions, options) {
|
|
|
51844
51804
|
if (!passed) return;
|
|
51845
51805
|
}
|
|
51846
51806
|
const pendingSlots = /* @__PURE__ */ new Map();
|
|
51847
|
-
|
|
51807
|
+
({
|
|
51848
51808
|
trait: binding.trait.name,
|
|
51849
|
-
state: currentState,
|
|
51850
51809
|
transition: `${currentState}->tick:${tick.name}`,
|
|
51851
51810
|
effects: tick.effects,
|
|
51852
51811
|
traitDefinition: binding.trait
|
|
51853
|
-
};
|
|
51812
|
+
});
|
|
51854
51813
|
for (const effect of tick.effects) {
|
|
51855
51814
|
if (!Array.isArray(effect)) continue;
|
|
51856
51815
|
const op = effect[0];
|
|
@@ -51869,13 +51828,9 @@ function useTraitStateMachine(traitBindings, slotsActions, options) {
|
|
|
51869
51828
|
}
|
|
51870
51829
|
}
|
|
51871
51830
|
for (const [slot, patterns] of pendingSlots) {
|
|
51872
|
-
|
|
51873
|
-
actions.clearSlot(slot);
|
|
51874
|
-
} else {
|
|
51875
|
-
actions.setSlotPatterns(slot, patterns, slotSource);
|
|
51876
|
-
}
|
|
51831
|
+
flushSlot(binding.trait.name, slot, patterns);
|
|
51877
51832
|
}
|
|
51878
|
-
}, []);
|
|
51833
|
+
}, [flushSlot]);
|
|
51879
51834
|
useEffect(() => {
|
|
51880
51835
|
const hasFrameTicks = traitBindingsRef.current.some(
|
|
51881
51836
|
(b) => b.trait.ticks?.some((t) => t.interval === "frame")
|
|
@@ -51918,7 +51873,6 @@ function useTraitStateMachine(traitBindings, slotsActions, options) {
|
|
|
51918
51873
|
const normalizedEvent = normalizeEventKey(eventKey);
|
|
51919
51874
|
const bindings = traitBindingsRef.current;
|
|
51920
51875
|
const currentManager = managerRef.current;
|
|
51921
|
-
const actions = slotsActionsRef.current;
|
|
51922
51876
|
console.log("[TraitStateMachine] Processing event:", normalizedEvent, "payload:", payload);
|
|
51923
51877
|
crossTraitLog.debug("processEvent:enter", {
|
|
51924
51878
|
event: normalizedEvent,
|
|
@@ -52069,12 +52023,9 @@ function useTraitStateMachine(traitBindings, slotsActions, options) {
|
|
|
52069
52023
|
"[TraitStateMachine] After executeAll, pendingSlots:",
|
|
52070
52024
|
Object.fromEntries(pendingSlots.entries())
|
|
52071
52025
|
);
|
|
52026
|
+
void slotSource;
|
|
52072
52027
|
for (const [slot, patterns] of pendingSlots) {
|
|
52073
|
-
|
|
52074
|
-
actions.clearSlot(slot);
|
|
52075
|
-
} else {
|
|
52076
|
-
actions.setSlotPatterns(slot, patterns, slotSource);
|
|
52077
|
-
}
|
|
52028
|
+
flushSlot(traitName, slot, patterns);
|
|
52078
52029
|
}
|
|
52079
52030
|
} catch (error) {
|
|
52080
52031
|
console.error(
|
|
@@ -52275,13 +52226,12 @@ function useTraitStateMachine(traitBindings, slotsActions, options) {
|
|
|
52275
52226
|
}
|
|
52276
52227
|
|
|
52277
52228
|
// runtime/OrbPreview.tsx
|
|
52278
|
-
init_SlotsContext();
|
|
52279
52229
|
init_EntitySchemaContext();
|
|
52280
52230
|
|
|
52281
52231
|
// runtime/ServerBridge.tsx
|
|
52282
52232
|
init_useEventBus();
|
|
52283
52233
|
init_logger();
|
|
52284
|
-
var
|
|
52234
|
+
var xOrbitalLog = createLogger("almadar:runtime:cross-orbital");
|
|
52285
52235
|
function createHttpTransport(serverUrl) {
|
|
52286
52236
|
return {
|
|
52287
52237
|
register: async (schema) => {
|
|
@@ -52387,14 +52337,14 @@ function ServerBridgeProvider({
|
|
|
52387
52337
|
for (const emitted of result.emittedEvents) {
|
|
52388
52338
|
const evTrait = emitted.source?.trait;
|
|
52389
52339
|
if (!evTrait) {
|
|
52390
|
-
|
|
52340
|
+
xOrbitalLog.warn("emit:dropped-no-source", {
|
|
52391
52341
|
event: emitted.event,
|
|
52392
52342
|
dispatchOrbital: orbitalName
|
|
52393
52343
|
});
|
|
52394
52344
|
continue;
|
|
52395
52345
|
}
|
|
52396
52346
|
const key = emitted.source?.orbital ? `UI:${emitted.source.orbital}.${evTrait}.${emitted.event}` : `UI:${evTrait}.${emitted.event}`;
|
|
52397
|
-
|
|
52347
|
+
xOrbitalLog.info("emit:rebroadcast", {
|
|
52398
52348
|
busKey: key,
|
|
52399
52349
|
sourceOrbital: emitted.source?.orbital,
|
|
52400
52350
|
sourceTrait: evTrait,
|
|
@@ -52404,7 +52354,7 @@ function ServerBridgeProvider({
|
|
|
52404
52354
|
}
|
|
52405
52355
|
}
|
|
52406
52356
|
} else if (result.error) {
|
|
52407
|
-
|
|
52357
|
+
xOrbitalLog.warn("response:fail", {
|
|
52408
52358
|
orbital: orbitalName,
|
|
52409
52359
|
event,
|
|
52410
52360
|
error: result.error
|
|
@@ -52412,7 +52362,7 @@ function ServerBridgeProvider({
|
|
|
52412
52362
|
}
|
|
52413
52363
|
return { effects, meta };
|
|
52414
52364
|
} catch (err) {
|
|
52415
|
-
|
|
52365
|
+
xOrbitalLog.error("response:network", {
|
|
52416
52366
|
orbital: orbitalName,
|
|
52417
52367
|
event,
|
|
52418
52368
|
error: err instanceof Error ? err.message : String(err)
|
|
@@ -52532,7 +52482,7 @@ function prepareSchemaForPreview(input) {
|
|
|
52532
52482
|
|
|
52533
52483
|
// runtime/OrbPreview.tsx
|
|
52534
52484
|
init_logger();
|
|
52535
|
-
var
|
|
52485
|
+
var xOrbitalLog2 = createLogger("almadar:runtime:cross-orbital");
|
|
52536
52486
|
function normalizeChild(child) {
|
|
52537
52487
|
if (typeof child === "string") return child;
|
|
52538
52488
|
if (child === null || typeof child !== "object" || Array.isArray(child)) {
|
|
@@ -52545,91 +52495,6 @@ function normalizeChild(child) {
|
|
|
52545
52495
|
props: { ...rest, ...normalizedChildren !== void 0 ? { children: normalizedChildren } : {} }
|
|
52546
52496
|
};
|
|
52547
52497
|
}
|
|
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
|
-
clear(slotName);
|
|
52584
|
-
continue;
|
|
52585
|
-
}
|
|
52586
|
-
const children = entries.map(({ entry }) => entry.patterns[entry.patterns.length - 1]).filter((p2) => Boolean(p2)).map((entry) => {
|
|
52587
|
-
const record = entry.pattern;
|
|
52588
|
-
const { type: patternType, children: nested, ...inlineProps } = record;
|
|
52589
|
-
const normalizedNested = Array.isArray(nested) ? nested.map((c) => normalizeChild(c)) : nested;
|
|
52590
|
-
return {
|
|
52591
|
-
type: patternType,
|
|
52592
|
-
...inlineProps,
|
|
52593
|
-
...entry.props,
|
|
52594
|
-
...normalizedNested !== void 0 ? { children: normalizedNested } : {}
|
|
52595
|
-
};
|
|
52596
|
-
});
|
|
52597
|
-
if (children.length === 1) {
|
|
52598
|
-
const only = children[0];
|
|
52599
|
-
const { type, children: nested, ...rest } = only;
|
|
52600
|
-
const lastEntry = entries[entries.length - 1];
|
|
52601
|
-
slotLog.debug("SlotBridge:render-single", {
|
|
52602
|
-
slot: slotName,
|
|
52603
|
-
patternType: type,
|
|
52604
|
-
entityRefId: refId(rest.entity),
|
|
52605
|
-
sourceTrait: lastEntry.entry.source?.trait
|
|
52606
|
-
});
|
|
52607
|
-
render({
|
|
52608
|
-
target: slotName,
|
|
52609
|
-
pattern: type,
|
|
52610
|
-
props: {
|
|
52611
|
-
...rest,
|
|
52612
|
-
...nested !== void 0 ? { children: nested } : {}
|
|
52613
|
-
},
|
|
52614
|
-
sourceTrait: lastEntry.entry.source?.trait
|
|
52615
|
-
});
|
|
52616
|
-
} else {
|
|
52617
|
-
const lastEntry = entries[entries.length - 1];
|
|
52618
|
-
render({
|
|
52619
|
-
target: slotName,
|
|
52620
|
-
pattern: "stack",
|
|
52621
|
-
props: {
|
|
52622
|
-
direction: "vertical",
|
|
52623
|
-
gap: "lg",
|
|
52624
|
-
children
|
|
52625
|
-
},
|
|
52626
|
-
sourceTrait: lastEntry.entry.source?.trait
|
|
52627
|
-
});
|
|
52628
|
-
}
|
|
52629
|
-
}
|
|
52630
|
-
}, [slots, render, clear, updateTraitContent, embeddedTraits]);
|
|
52631
|
-
return null;
|
|
52632
|
-
}
|
|
52633
52498
|
function applyServerEffects(effects, uiSlots, onNavigate, embeddedTraits) {
|
|
52634
52499
|
for (const eff of effects) {
|
|
52635
52500
|
if (eff.type === "render-ui" && eff.slot && eff.pattern) {
|
|
@@ -52643,7 +52508,7 @@ function applyServerEffects(effects, uiSlots, onNavigate, embeddedTraits) {
|
|
|
52643
52508
|
...normalizedChildren !== void 0 ? { children: normalizedChildren } : {}
|
|
52644
52509
|
};
|
|
52645
52510
|
if (isEmbedded) {
|
|
52646
|
-
|
|
52511
|
+
xOrbitalLog2.info("slot:embed-routed", {
|
|
52647
52512
|
sourceTrait,
|
|
52648
52513
|
slot: eff.slot,
|
|
52649
52514
|
patternType: typeof patternType === "string" ? patternType : void 0
|
|
@@ -52655,7 +52520,7 @@ function applyServerEffects(effects, uiSlots, onNavigate, embeddedTraits) {
|
|
|
52655
52520
|
animation: "fade"
|
|
52656
52521
|
});
|
|
52657
52522
|
} else {
|
|
52658
|
-
|
|
52523
|
+
xOrbitalLog2.info("slot-write", {
|
|
52659
52524
|
slot: eff.slot,
|
|
52660
52525
|
sourceTrait,
|
|
52661
52526
|
patternType: typeof patternType === "string" ? patternType : void 0
|
|
@@ -52673,13 +52538,12 @@ function applyServerEffects(effects, uiSlots, onNavigate, embeddedTraits) {
|
|
|
52673
52538
|
}
|
|
52674
52539
|
}
|
|
52675
52540
|
function TraitInitializer({ traits: traits2, orbitalNames, onNavigate, onLocalFallback, persistence, traitConfigsByName, orbitalsByTrait, embeddedTraits }) {
|
|
52676
|
-
const slotsActions = useSlotsActions();
|
|
52677
52541
|
const bridge = useServerBridge();
|
|
52678
52542
|
const uiSlots = useUISlots();
|
|
52679
52543
|
const onEventProcessed = useCallback(async (event, payload, dispatchedOrbitals) => {
|
|
52680
52544
|
if (!bridge.connected || !orbitalNames?.length) return;
|
|
52681
52545
|
const targets = dispatchedOrbitals && dispatchedOrbitals.size > 0 ? orbitalNames.filter((n) => dispatchedOrbitals.has(n)) : orbitalNames;
|
|
52682
|
-
|
|
52546
|
+
xOrbitalLog2.info("TraitInitializer:fanout", {
|
|
52683
52547
|
event,
|
|
52684
52548
|
sentTo: targets,
|
|
52685
52549
|
skipped: orbitalNames.filter((n) => !targets.includes(n)),
|
|
@@ -52691,8 +52555,8 @@ function TraitInitializer({ traits: traits2, orbitalNames, onNavigate, onLocalFa
|
|
|
52691
52555
|
applyServerEffects(effects, uiSlots, onNavigate, embeddedTraits);
|
|
52692
52556
|
}
|
|
52693
52557
|
}, [bridge.connected, bridge.sendEvent, orbitalNames, uiSlots, onNavigate, embeddedTraits]);
|
|
52694
|
-
const opts = orbitalNames ? { onEventProcessed, navigate: onNavigate, traitConfigsByName, orbitalsByTrait } : { navigate: onNavigate, persistence, traitConfigsByName, orbitalsByTrait };
|
|
52695
|
-
const { sendEvent } = useTraitStateMachine(traits2,
|
|
52558
|
+
const opts = orbitalNames ? { onEventProcessed, navigate: onNavigate, traitConfigsByName, orbitalsByTrait, embeddedTraits } : { navigate: onNavigate, persistence, traitConfigsByName, orbitalsByTrait, embeddedTraits };
|
|
52559
|
+
const { sendEvent } = useTraitStateMachine(traits2, uiSlots, opts);
|
|
52696
52560
|
const initSentRef = useRef(false);
|
|
52697
52561
|
useEffect(() => {
|
|
52698
52562
|
if (!orbitalNames?.length) {
|
|
@@ -52814,7 +52678,7 @@ function SchemaRunner({ schema, serverUrl, transport, mockData, pageName, onNavi
|
|
|
52814
52678
|
const orb = orbitalsByTrait[name];
|
|
52815
52679
|
if (orb) orbitalsByTraitForPage[name] = orb;
|
|
52816
52680
|
}
|
|
52817
|
-
|
|
52681
|
+
xOrbitalLog2.info("SchemaRunner:mount", {
|
|
52818
52682
|
pageName,
|
|
52819
52683
|
traitNames,
|
|
52820
52684
|
orbitalsByTraitForPage,
|
|
@@ -52840,9 +52704,15 @@ function SchemaRunner({ schema, serverUrl, transport, mockData, pageName, onNavi
|
|
|
52840
52704
|
return map;
|
|
52841
52705
|
}, [schema]);
|
|
52842
52706
|
const embeddedTraits = useMemo(() => {
|
|
52843
|
-
|
|
52844
|
-
|
|
52845
|
-
|
|
52707
|
+
const set = collectEmbeddedTraits(schema);
|
|
52708
|
+
xOrbitalLog2.info("SchemaRunner:embeddedTraits", {
|
|
52709
|
+
pageName,
|
|
52710
|
+
embedded: Array.from(set),
|
|
52711
|
+
embeddedCount: set.size
|
|
52712
|
+
});
|
|
52713
|
+
return set;
|
|
52714
|
+
}, [schema, pageName]);
|
|
52715
|
+
const inner = /* @__PURE__ */ jsx(VerificationProvider, { enabled: true, children: /* @__PURE__ */ jsxs(
|
|
52846
52716
|
EntitySchemaProvider,
|
|
52847
52717
|
{
|
|
52848
52718
|
entities: entitiesArray,
|
|
@@ -52862,11 +52732,10 @@ function SchemaRunner({ schema, serverUrl, transport, mockData, pageName, onNavi
|
|
|
52862
52732
|
persistence
|
|
52863
52733
|
}
|
|
52864
52734
|
),
|
|
52865
|
-
/* @__PURE__ */ jsx(SlotBridge, { embeddedTraits }),
|
|
52866
52735
|
/* @__PURE__ */ jsx(Box, { className: "h-full p-4", children: /* @__PURE__ */ jsx(UISlotRenderer, { includeHud: true, hudMode: "inline", includeFloating: true }) })
|
|
52867
52736
|
]
|
|
52868
52737
|
}
|
|
52869
|
-
) })
|
|
52738
|
+
) });
|
|
52870
52739
|
if (serverUrl || transport) {
|
|
52871
52740
|
return /* @__PURE__ */ jsx(ServerBridgeProvider, { schema, serverUrl, transport, children: inner });
|
|
52872
52741
|
}
|
|
@@ -53375,7 +53244,7 @@ var OrbPreviewNodeInner = (props) => {
|
|
|
53375
53244
|
}
|
|
53376
53245
|
);
|
|
53377
53246
|
};
|
|
53378
|
-
var OrbPreviewNode =
|
|
53247
|
+
var OrbPreviewNode = React127__default.memo(OrbPreviewNodeInner);
|
|
53379
53248
|
OrbPreviewNode.displayName = "OrbPreviewNode";
|
|
53380
53249
|
var EventFlowEdgeInner = (props) => {
|
|
53381
53250
|
const {
|
|
@@ -53452,7 +53321,7 @@ var EventFlowEdgeInner = (props) => {
|
|
|
53452
53321
|
) })
|
|
53453
53322
|
] });
|
|
53454
53323
|
};
|
|
53455
|
-
var EventFlowEdge =
|
|
53324
|
+
var EventFlowEdge = React127__default.memo(EventFlowEdgeInner);
|
|
53456
53325
|
EventFlowEdge.displayName = "EventFlowEdge";
|
|
53457
53326
|
|
|
53458
53327
|
// components/molecules/avl/BehaviorComposeNode.tsx
|
|
@@ -53591,7 +53460,7 @@ var BehaviorComposeNodeInner = (props) => {
|
|
|
53591
53460
|
}
|
|
53592
53461
|
);
|
|
53593
53462
|
};
|
|
53594
|
-
var BehaviorComposeNode =
|
|
53463
|
+
var BehaviorComposeNode = React127__default.memo(BehaviorComposeNodeInner);
|
|
53595
53464
|
BehaviorComposeNode.displayName = "BehaviorComposeNode";
|
|
53596
53465
|
|
|
53597
53466
|
// components/molecules/avl/avl-behavior-compose-converter.ts
|
|
@@ -54531,7 +54400,7 @@ var ZoomBreadcrumb = ({
|
|
|
54531
54400
|
if (eventName && band === "detail") {
|
|
54532
54401
|
segments.push({ icon: "\u26A1", label: eventName });
|
|
54533
54402
|
}
|
|
54534
|
-
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(
|
|
54403
|
+
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: [
|
|
54535
54404
|
i > 0 && /* @__PURE__ */ jsx("span", { className: "opacity-40", children: ">" }),
|
|
54536
54405
|
/* @__PURE__ */ jsx("span", { className: "opacity-60", children: seg.icon }),
|
|
54537
54406
|
/* @__PURE__ */ jsx("span", { children: seg.label })
|
|
@@ -54990,7 +54859,7 @@ var EventWireOverlay = ({
|
|
|
54990
54859
|
containerW,
|
|
54991
54860
|
containerH
|
|
54992
54861
|
}) => {
|
|
54993
|
-
const ids =
|
|
54862
|
+
const ids = React127__default.useMemo(() => {
|
|
54994
54863
|
avlOczWireId += 1;
|
|
54995
54864
|
return { arrow: `avl-ocz-wire-${avlOczWireId}-arrow` };
|
|
54996
54865
|
}, []);
|
|
@@ -55308,7 +55177,7 @@ var AvlOrbitalsCosmicZoom = ({
|
|
|
55308
55177
|
borderRadius: 6,
|
|
55309
55178
|
border: `1px solid ${color}`
|
|
55310
55179
|
},
|
|
55311
|
-
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(
|
|
55180
|
+
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(React127__default.Fragment, { children: [
|
|
55312
55181
|
i > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", style: { opacity: 0.5, color }, children: "/" }),
|
|
55313
55182
|
i < breadcrumbs.length - 1 ? /* @__PURE__ */ jsx(
|
|
55314
55183
|
Box,
|