@almadar/ui 5.59.0 → 5.61.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 +122 -83
- package/dist/avl/index.js +122 -83
- package/dist/components/core/molecules/GraphCanvas.d.ts +2 -0
- package/dist/components/game/molecules/three/index.cjs +12 -7
- package/dist/components/game/molecules/three/index.js +12 -7
- package/dist/components/index.cjs +70 -24
- package/dist/components/index.js +70 -24
- package/dist/providers/index.cjs +114 -75
- package/dist/providers/index.js +114 -75
- package/dist/runtime/index.cjs +109 -70
- package/dist/runtime/index.js +109 -70
- package/package.json +1 -1
package/dist/runtime/index.cjs
CHANGED
|
@@ -8468,16 +8468,6 @@ var init_Skeleton = __esm({
|
|
|
8468
8468
|
Skeleton.displayName = "Skeleton";
|
|
8469
8469
|
}
|
|
8470
8470
|
});
|
|
8471
|
-
function isKnownPattern(type) {
|
|
8472
|
-
return type in componentMapping;
|
|
8473
|
-
}
|
|
8474
|
-
var componentMapping;
|
|
8475
|
-
var init_pattern_resolver = __esm({
|
|
8476
|
-
"renderer/pattern-resolver.ts"() {
|
|
8477
|
-
logger.createLogger("almadar:ui:pattern-resolver");
|
|
8478
|
-
componentMapping = {};
|
|
8479
|
-
}
|
|
8480
|
-
});
|
|
8481
8471
|
|
|
8482
8472
|
// renderer/slot-definitions.ts
|
|
8483
8473
|
function isPortalSlot(slot) {
|
|
@@ -8586,7 +8576,6 @@ var init_navigation = __esm({
|
|
|
8586
8576
|
// renderer/index.ts
|
|
8587
8577
|
var init_renderer = __esm({
|
|
8588
8578
|
"renderer/index.ts"() {
|
|
8589
|
-
init_pattern_resolver();
|
|
8590
8579
|
init_slot_definitions();
|
|
8591
8580
|
}
|
|
8592
8581
|
});
|
|
@@ -10290,7 +10279,7 @@ function recordTransition(trace) {
|
|
|
10290
10279
|
...trace,
|
|
10291
10280
|
id: `t-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`
|
|
10292
10281
|
};
|
|
10293
|
-
|
|
10282
|
+
log4.debug("transition:recorded", { trait: trace.traitName, from: trace.from, to: trace.to, event: trace.event, effectCount: trace.effects.length });
|
|
10294
10283
|
getState().transitions.push(entry);
|
|
10295
10284
|
if (getState().transitions.length > MAX_TRANSITIONS) {
|
|
10296
10285
|
getState().transitions.shift();
|
|
@@ -10389,7 +10378,7 @@ function getTraitSnapshots() {
|
|
|
10389
10378
|
try {
|
|
10390
10379
|
snapshots.push(getter());
|
|
10391
10380
|
} catch (err) {
|
|
10392
|
-
|
|
10381
|
+
log4.error("traitSnapshot getter failed", { trait: traitName, err: String(err) });
|
|
10393
10382
|
}
|
|
10394
10383
|
}
|
|
10395
10384
|
return snapshots;
|
|
@@ -10488,10 +10477,10 @@ function updateAssetStatus(url, status) {
|
|
|
10488
10477
|
window.__orbitalVerification.assetStatus[url] = status;
|
|
10489
10478
|
}
|
|
10490
10479
|
}
|
|
10491
|
-
var
|
|
10480
|
+
var log4, MAX_TRANSITIONS;
|
|
10492
10481
|
var init_verificationRegistry = __esm({
|
|
10493
10482
|
"lib/verificationRegistry.ts"() {
|
|
10494
|
-
|
|
10483
|
+
log4 = logger.createLogger("almadar:bridge");
|
|
10495
10484
|
MAX_TRANSITIONS = 500;
|
|
10496
10485
|
exposeOnWindow();
|
|
10497
10486
|
}
|
|
@@ -12820,7 +12809,7 @@ var init_avl_elk_layout = __esm({
|
|
|
12820
12809
|
elk = new ELK__default.default();
|
|
12821
12810
|
}
|
|
12822
12811
|
});
|
|
12823
|
-
var
|
|
12812
|
+
var log5, SWIM_GUTTER, CENTER_W, BehaviorView;
|
|
12824
12813
|
var init_BehaviorView = __esm({
|
|
12825
12814
|
"components/avl/molecules/BehaviorView.tsx"() {
|
|
12826
12815
|
"use client";
|
|
@@ -12829,7 +12818,7 @@ var init_BehaviorView = __esm({
|
|
|
12829
12818
|
init_AvlSwimLane();
|
|
12830
12819
|
init_types();
|
|
12831
12820
|
init_avl_elk_layout();
|
|
12832
|
-
|
|
12821
|
+
log5 = logger.createLogger("almadar:ui:avl:behavior-view");
|
|
12833
12822
|
SWIM_GUTTER = 120;
|
|
12834
12823
|
CENTER_W = 360;
|
|
12835
12824
|
BehaviorView = ({ data }) => {
|
|
@@ -12840,7 +12829,7 @@ var init_BehaviorView = __esm({
|
|
|
12840
12829
|
const dataKey = React81.useMemo(() => JSON.stringify(traitData), [traitData]);
|
|
12841
12830
|
React81.useEffect(() => {
|
|
12842
12831
|
if (!traitData) return;
|
|
12843
|
-
computeTraitLayout(traitData).then(setLayout).catch((err) =>
|
|
12832
|
+
computeTraitLayout(traitData).then(setLayout).catch((err) => log5.error("compute-trait-layout-failed", { error: err instanceof Error ? err : String(err) }));
|
|
12844
12833
|
}, [dataKey]);
|
|
12845
12834
|
if (!traitData) {
|
|
12846
12835
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-lg border border-[var(--color-border)] bg-[var(--color-card)] p-4 text-center text-[var(--color-muted-foreground)] text-sm", children: t("avl.noTraitData") });
|
|
@@ -13251,7 +13240,7 @@ function generateDiff(oldVal, newVal) {
|
|
|
13251
13240
|
}
|
|
13252
13241
|
return diff;
|
|
13253
13242
|
}
|
|
13254
|
-
var orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle,
|
|
13243
|
+
var orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log6, CODE_LANGUAGES, CODE_LANGUAGE_SET, DIFF_STYLES, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS, CodeBlock;
|
|
13255
13244
|
var init_CodeBlock = __esm({
|
|
13256
13245
|
"components/core/molecules/markdown/CodeBlock.tsx"() {
|
|
13257
13246
|
init_cn();
|
|
@@ -13334,7 +13323,7 @@ var init_CodeBlock = __esm({
|
|
|
13334
13323
|
"lolo-op-async": { color: syntax.ORB_COLORS.dark.async }
|
|
13335
13324
|
};
|
|
13336
13325
|
loloStyle = { ...dark__default.default, ...loloStyleOverrides };
|
|
13337
|
-
|
|
13326
|
+
log6 = logger.createLogger("almadar:ui:markdown-code");
|
|
13338
13327
|
CODE_LANGUAGES = [
|
|
13339
13328
|
"text",
|
|
13340
13329
|
"json",
|
|
@@ -13598,7 +13587,7 @@ var init_CodeBlock = __esm({
|
|
|
13598
13587
|
eventBus.emit("UI:COPY_CODE", { language: activeLanguage, success: true });
|
|
13599
13588
|
setTimeout(() => setCopied(false), 2e3);
|
|
13600
13589
|
} catch (err) {
|
|
13601
|
-
|
|
13590
|
+
log6.error("Failed to copy code", { error: err instanceof Error ? err : String(err) });
|
|
13602
13591
|
eventBus.emit("UI:COPY_CODE", { language: activeLanguage, success: false });
|
|
13603
13592
|
}
|
|
13604
13593
|
};
|
|
@@ -17479,14 +17468,14 @@ function useSafeEventBus2() {
|
|
|
17479
17468
|
} };
|
|
17480
17469
|
}
|
|
17481
17470
|
}
|
|
17482
|
-
var
|
|
17471
|
+
var log7, lookStyles4, ButtonGroup;
|
|
17483
17472
|
var init_ButtonGroup = __esm({
|
|
17484
17473
|
"components/core/molecules/ButtonGroup.tsx"() {
|
|
17485
17474
|
"use client";
|
|
17486
17475
|
init_cn();
|
|
17487
17476
|
init_atoms2();
|
|
17488
17477
|
init_useEventBus();
|
|
17489
|
-
|
|
17478
|
+
log7 = logger.createLogger("almadar:ui:button-group");
|
|
17490
17479
|
lookStyles4 = {
|
|
17491
17480
|
"right-aligned-buttons": "",
|
|
17492
17481
|
"floating-bar": "fixed bottom-section left-1/2 -translate-x-1/2 shadow-elevation-toast bg-card p-card-sm rounded-container",
|
|
@@ -17567,7 +17556,7 @@ var init_ButtonGroup = __esm({
|
|
|
17567
17556
|
{
|
|
17568
17557
|
variant: "ghost",
|
|
17569
17558
|
onClick: () => {
|
|
17570
|
-
|
|
17559
|
+
log7.debug("Filter clicked", { field: filter.field });
|
|
17571
17560
|
},
|
|
17572
17561
|
children: filter.label
|
|
17573
17562
|
},
|
|
@@ -25229,9 +25218,9 @@ function debug(...args) {
|
|
|
25229
25218
|
const [first, ...rest] = args;
|
|
25230
25219
|
const message = typeof first === "string" ? first : "<debug>";
|
|
25231
25220
|
if (rest.length === 0 && typeof first === "string") {
|
|
25232
|
-
|
|
25221
|
+
log8.debug(message);
|
|
25233
25222
|
} else {
|
|
25234
|
-
|
|
25223
|
+
log8.debug(message, { args: rest.length > 0 ? formatArgs(rest) : formatArgs([first]) });
|
|
25235
25224
|
}
|
|
25236
25225
|
}
|
|
25237
25226
|
function debugGroup(label) {
|
|
@@ -25259,11 +25248,11 @@ function toLogMetaValue(v) {
|
|
|
25259
25248
|
}
|
|
25260
25249
|
return String(v);
|
|
25261
25250
|
}
|
|
25262
|
-
var NAMESPACE,
|
|
25251
|
+
var NAMESPACE, log8;
|
|
25263
25252
|
var init_debug = __esm({
|
|
25264
25253
|
"lib/debug.ts"() {
|
|
25265
25254
|
NAMESPACE = "almadar:ui:debug";
|
|
25266
|
-
|
|
25255
|
+
log8 = logger.createLogger(NAMESPACE);
|
|
25267
25256
|
logger.createLogger("almadar:ui:debug:input");
|
|
25268
25257
|
logger.createLogger("almadar:ui:debug:collision");
|
|
25269
25258
|
logger.createLogger("almadar:ui:debug:physics");
|
|
@@ -37668,6 +37657,12 @@ function getGroupColor(group, groups) {
|
|
|
37668
37657
|
const idx = groups.indexOf(group);
|
|
37669
37658
|
return GROUP_COLORS2[idx % GROUP_COLORS2.length];
|
|
37670
37659
|
}
|
|
37660
|
+
function resolveColor2(color, el) {
|
|
37661
|
+
const m = /^var\((--[^,)]+)(?:,\s*([^)]+))?\)$/.exec(color.trim());
|
|
37662
|
+
if (!m) return color;
|
|
37663
|
+
const resolved = getComputedStyle(el).getPropertyValue(m[1]).trim();
|
|
37664
|
+
return resolved || (m[2]?.trim() ?? "#888888");
|
|
37665
|
+
}
|
|
37671
37666
|
var GROUP_COLORS2, GraphCanvas;
|
|
37672
37667
|
var init_GraphCanvas = __esm({
|
|
37673
37668
|
"components/core/molecules/GraphCanvas.tsx"() {
|
|
@@ -37697,6 +37692,7 @@ var init_GraphCanvas = __esm({
|
|
|
37697
37692
|
draggable = true,
|
|
37698
37693
|
actions,
|
|
37699
37694
|
onNodeClick,
|
|
37695
|
+
onNodeDoubleClick,
|
|
37700
37696
|
nodeClickEvent,
|
|
37701
37697
|
selectedNodeId,
|
|
37702
37698
|
repulsion = 800,
|
|
@@ -37716,6 +37712,19 @@ var init_GraphCanvas = __esm({
|
|
|
37716
37712
|
const [hoveredNode, setHoveredNode] = React81.useState(null);
|
|
37717
37713
|
const nodesRef = React81.useRef([]);
|
|
37718
37714
|
const [, forceUpdate] = React81.useState(0);
|
|
37715
|
+
const [logicalW, setLogicalW] = React81.useState(800);
|
|
37716
|
+
React81.useEffect(() => {
|
|
37717
|
+
const canvas = canvasRef.current;
|
|
37718
|
+
if (!canvas || typeof ResizeObserver === "undefined") return;
|
|
37719
|
+
const measure = () => {
|
|
37720
|
+
const width = Math.round(canvas.clientWidth);
|
|
37721
|
+
if (width > 0) setLogicalW(width);
|
|
37722
|
+
};
|
|
37723
|
+
measure();
|
|
37724
|
+
const ro = new ResizeObserver(measure);
|
|
37725
|
+
ro.observe(canvas);
|
|
37726
|
+
return () => ro.disconnect();
|
|
37727
|
+
}, []);
|
|
37719
37728
|
const interactionRef = React81.useRef({
|
|
37720
37729
|
mode: "none",
|
|
37721
37730
|
dragNodeId: null,
|
|
@@ -37769,8 +37778,8 @@ var init_GraphCanvas = __esm({
|
|
|
37769
37778
|
React81.useEffect(() => {
|
|
37770
37779
|
const canvas = canvasRef.current;
|
|
37771
37780
|
if (!canvas || propNodes.length === 0) return;
|
|
37772
|
-
const w =
|
|
37773
|
-
const h =
|
|
37781
|
+
const w = logicalW;
|
|
37782
|
+
const h = height;
|
|
37774
37783
|
const simNodes = propNodes.map((n, idx) => {
|
|
37775
37784
|
let x = n.x ?? 0;
|
|
37776
37785
|
let y = n.y ?? 0;
|
|
@@ -37860,28 +37869,41 @@ var init_GraphCanvas = __esm({
|
|
|
37860
37869
|
return () => {
|
|
37861
37870
|
cancelAnimationFrame(animRef.current);
|
|
37862
37871
|
};
|
|
37863
|
-
}, [propNodes, propEdges, layout, repulsion, linkDistance]);
|
|
37872
|
+
}, [propNodes, propEdges, layout, repulsion, linkDistance, logicalW, height]);
|
|
37864
37873
|
React81.useEffect(() => {
|
|
37865
37874
|
const canvas = canvasRef.current;
|
|
37866
37875
|
if (!canvas) return;
|
|
37867
37876
|
const ctx = canvas.getContext("2d");
|
|
37868
37877
|
if (!ctx) return;
|
|
37869
|
-
const w =
|
|
37870
|
-
const h =
|
|
37878
|
+
const w = logicalW;
|
|
37879
|
+
const h = height;
|
|
37871
37880
|
const nodes = nodesRef.current;
|
|
37881
|
+
const accentColor = resolveColor2("var(--color-accent)", canvas);
|
|
37882
|
+
const dpr = typeof window !== "undefined" && window.devicePixelRatio || 1;
|
|
37883
|
+
ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
|
|
37872
37884
|
ctx.clearRect(0, 0, w, h);
|
|
37873
37885
|
ctx.save();
|
|
37874
37886
|
ctx.translate(offset.x, offset.y);
|
|
37875
37887
|
ctx.scale(zoom, zoom);
|
|
37888
|
+
const neighbors = /* @__PURE__ */ new Set();
|
|
37889
|
+
if (hoveredNode) {
|
|
37890
|
+
neighbors.add(hoveredNode);
|
|
37891
|
+
for (const edge of propEdges) {
|
|
37892
|
+
if (edge.source === hoveredNode) neighbors.add(String(edge.target));
|
|
37893
|
+
else if (edge.target === hoveredNode) neighbors.add(String(edge.source));
|
|
37894
|
+
}
|
|
37895
|
+
}
|
|
37876
37896
|
for (const edge of propEdges) {
|
|
37877
37897
|
const source = nodes.find((n) => n.id === edge.source);
|
|
37878
37898
|
const target = nodes.find((n) => n.id === edge.target);
|
|
37879
37899
|
if (!source || !target) continue;
|
|
37900
|
+
const incident = !!hoveredNode && (edge.source === hoveredNode || edge.target === hoveredNode);
|
|
37901
|
+
ctx.globalAlpha = hoveredNode ? incident ? 1 : 0.12 : 1;
|
|
37880
37902
|
ctx.beginPath();
|
|
37881
37903
|
ctx.moveTo(source.x, source.y);
|
|
37882
37904
|
ctx.lineTo(target.x, target.y);
|
|
37883
|
-
ctx.strokeStyle = edge.color || "#88888866";
|
|
37884
|
-
ctx.lineWidth = edge.weight ? Math.max(1, edge.weight) : 1;
|
|
37905
|
+
ctx.strokeStyle = incident ? accentColor : edge.color || "#88888866";
|
|
37906
|
+
ctx.lineWidth = incident ? 2 : edge.weight ? Math.max(1, edge.weight) : 1;
|
|
37885
37907
|
ctx.stroke();
|
|
37886
37908
|
if (edge.label && showLabels) {
|
|
37887
37909
|
const mx = (source.x + target.x) / 2;
|
|
@@ -37892,18 +37914,20 @@ var init_GraphCanvas = __esm({
|
|
|
37892
37914
|
ctx.fillText(edge.label, mx, my - 4);
|
|
37893
37915
|
}
|
|
37894
37916
|
}
|
|
37917
|
+
ctx.globalAlpha = 1;
|
|
37895
37918
|
for (const node of nodes) {
|
|
37896
37919
|
const size = node.size || 8;
|
|
37897
|
-
const color = node.color || getGroupColor(node.group, groups);
|
|
37920
|
+
const color = resolveColor2(node.color || getGroupColor(node.group, groups), canvas);
|
|
37898
37921
|
const isHovered = hoveredNode === node.id;
|
|
37899
37922
|
const isSelected = selectedNodeId !== void 0 && node.id === selectedNodeId;
|
|
37923
|
+
ctx.globalAlpha = hoveredNode && !neighbors.has(node.id) ? 0.2 : 1;
|
|
37900
37924
|
const radius = isSelected ? size + 4 : isHovered ? size + 2 : size;
|
|
37901
37925
|
ctx.beginPath();
|
|
37902
37926
|
ctx.arc(node.x, node.y, radius, 0, Math.PI * 2);
|
|
37903
37927
|
ctx.fillStyle = color;
|
|
37904
37928
|
ctx.fill();
|
|
37905
37929
|
if (isSelected) {
|
|
37906
|
-
ctx.strokeStyle =
|
|
37930
|
+
ctx.strokeStyle = accentColor;
|
|
37907
37931
|
ctx.lineWidth = 3;
|
|
37908
37932
|
} else {
|
|
37909
37933
|
ctx.strokeStyle = isHovered ? "#ffffff" : "#00000020";
|
|
@@ -38016,6 +38040,15 @@ var init_GraphCanvas = __esm({
|
|
|
38016
38040
|
interactionRef.current.dragNodeId = null;
|
|
38017
38041
|
setHoveredNode(null);
|
|
38018
38042
|
}, []);
|
|
38043
|
+
const handleDoubleClick = React81.useCallback(
|
|
38044
|
+
(e) => {
|
|
38045
|
+
const coords = toCoords(e);
|
|
38046
|
+
if (!coords) return;
|
|
38047
|
+
const node = nodeAt(coords.graphX, coords.graphY);
|
|
38048
|
+
if (node) onNodeDoubleClick?.(node);
|
|
38049
|
+
},
|
|
38050
|
+
[toCoords, nodeAt, onNodeDoubleClick]
|
|
38051
|
+
);
|
|
38019
38052
|
if (isLoading) {
|
|
38020
38053
|
return /* @__PURE__ */ jsxRuntime.jsx(LoadingState, { message: t("common.loading"), className });
|
|
38021
38054
|
}
|
|
@@ -38073,15 +38106,16 @@ var init_GraphCanvas = __esm({
|
|
|
38073
38106
|
"canvas",
|
|
38074
38107
|
{
|
|
38075
38108
|
ref: canvasRef,
|
|
38076
|
-
width:
|
|
38077
|
-
height,
|
|
38109
|
+
width: Math.round(logicalW * (typeof window !== "undefined" && window.devicePixelRatio || 1)),
|
|
38110
|
+
height: Math.round(height * (typeof window !== "undefined" && window.devicePixelRatio || 1)),
|
|
38078
38111
|
className: "w-full cursor-grab active:cursor-grabbing",
|
|
38079
38112
|
style: { height },
|
|
38080
38113
|
onWheel: handleWheel,
|
|
38081
38114
|
onMouseDown: handleMouseDown,
|
|
38082
38115
|
onMouseMove: handleMouseMove,
|
|
38083
38116
|
onMouseUp: handleMouseUp,
|
|
38084
|
-
onMouseLeave: handleMouseLeave
|
|
38117
|
+
onMouseLeave: handleMouseLeave,
|
|
38118
|
+
onDoubleClick: handleDoubleClick
|
|
38085
38119
|
}
|
|
38086
38120
|
) }),
|
|
38087
38121
|
groups.length > 1 && /* @__PURE__ */ jsxRuntime.jsx(HStack, { gap: "md", className: "px-4 py-2 border-t border-border", wrap: true, children: groups.map((group, idx) => /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "xs", align: "center", children: [
|
|
@@ -41675,11 +41709,11 @@ var init_Canvas3DErrorBoundary = __esm({
|
|
|
41675
41709
|
"components/game/molecules/three/components/Canvas3DErrorBoundary.css"() {
|
|
41676
41710
|
}
|
|
41677
41711
|
});
|
|
41678
|
-
var
|
|
41712
|
+
var log9, Canvas3DErrorBoundary;
|
|
41679
41713
|
var init_Canvas3DErrorBoundary2 = __esm({
|
|
41680
41714
|
"components/game/molecules/three/components/Canvas3DErrorBoundary.tsx"() {
|
|
41681
41715
|
init_Canvas3DErrorBoundary();
|
|
41682
|
-
|
|
41716
|
+
log9 = logger.createLogger("almadar:ui:game:canvas3d:error-boundary");
|
|
41683
41717
|
Canvas3DErrorBoundary = class extends React81.Component {
|
|
41684
41718
|
constructor(props) {
|
|
41685
41719
|
super(props);
|
|
@@ -41707,8 +41741,8 @@ var init_Canvas3DErrorBoundary2 = __esm({
|
|
|
41707
41741
|
componentDidCatch(error, errorInfo) {
|
|
41708
41742
|
this.setState({ errorInfo });
|
|
41709
41743
|
this.props.onError?.(error, errorInfo);
|
|
41710
|
-
|
|
41711
|
-
|
|
41744
|
+
log9.error("Error caught", { error });
|
|
41745
|
+
log9.error("Component stack", { componentStack: errorInfo.componentStack ?? "<none>" });
|
|
41712
41746
|
}
|
|
41713
41747
|
render() {
|
|
41714
41748
|
if (this.state.hasError) {
|
|
@@ -41771,7 +41805,7 @@ function useGLTFModel(url, resourceBasePath) {
|
|
|
41771
41805
|
setState({ model: null, isLoading: false, error: null });
|
|
41772
41806
|
return;
|
|
41773
41807
|
}
|
|
41774
|
-
|
|
41808
|
+
log10.debug("Loading", { url });
|
|
41775
41809
|
setState((prev) => ({ ...prev, isLoading: true, error: null }));
|
|
41776
41810
|
const assetRoot = resourceBasePath || detectAssetRoot2(url);
|
|
41777
41811
|
const loader = new GLTFLoader.GLTFLoader();
|
|
@@ -41779,7 +41813,7 @@ function useGLTFModel(url, resourceBasePath) {
|
|
|
41779
41813
|
loader.load(
|
|
41780
41814
|
url,
|
|
41781
41815
|
(gltf) => {
|
|
41782
|
-
|
|
41816
|
+
log10.debug("Loaded", { url });
|
|
41783
41817
|
setState({
|
|
41784
41818
|
model: gltf.scene,
|
|
41785
41819
|
isLoading: false,
|
|
@@ -41788,7 +41822,7 @@ function useGLTFModel(url, resourceBasePath) {
|
|
|
41788
41822
|
},
|
|
41789
41823
|
void 0,
|
|
41790
41824
|
(err) => {
|
|
41791
|
-
|
|
41825
|
+
log10.warn("Failed", { url, error: err instanceof Error ? err : String(err) });
|
|
41792
41826
|
setState({
|
|
41793
41827
|
model: null,
|
|
41794
41828
|
isLoading: false,
|
|
@@ -41904,11 +41938,11 @@ function ModelLoader({
|
|
|
41904
41938
|
}
|
|
41905
41939
|
);
|
|
41906
41940
|
}
|
|
41907
|
-
var
|
|
41941
|
+
var log10;
|
|
41908
41942
|
var init_ModelLoader = __esm({
|
|
41909
41943
|
"components/game/molecules/three/components/ModelLoader.tsx"() {
|
|
41910
41944
|
"use client";
|
|
41911
|
-
|
|
41945
|
+
log10 = logger.createLogger("almadar:ui:game:model-loader");
|
|
41912
41946
|
}
|
|
41913
41947
|
});
|
|
41914
41948
|
|
|
@@ -42169,24 +42203,28 @@ var init_GameCanvas3D2 = __esm({
|
|
|
42169
42203
|
const cameraConfig = React81.useMemo(() => {
|
|
42170
42204
|
const size = Math.max(
|
|
42171
42205
|
gridBounds.maxX - gridBounds.minX,
|
|
42172
|
-
gridBounds.maxZ - gridBounds.minZ
|
|
42206
|
+
gridBounds.maxZ - gridBounds.minZ,
|
|
42207
|
+
4
|
|
42208
|
+
// minimum framing distance so a tiny board isn't zoomed in
|
|
42173
42209
|
);
|
|
42174
|
-
const
|
|
42210
|
+
const cx = (gridBounds.minX + gridBounds.maxX) / 2;
|
|
42211
|
+
const cz = (gridBounds.minZ + gridBounds.maxZ) / 2;
|
|
42212
|
+
const d = size * 1.5;
|
|
42175
42213
|
switch (cameraMode) {
|
|
42176
42214
|
case "isometric":
|
|
42177
42215
|
return {
|
|
42178
|
-
position: [
|
|
42216
|
+
position: [cx + d, d * 0.8, cz + d],
|
|
42179
42217
|
fov: 45
|
|
42180
42218
|
};
|
|
42181
42219
|
case "top-down":
|
|
42182
42220
|
return {
|
|
42183
|
-
position: [
|
|
42221
|
+
position: [cx, d * 2, cz],
|
|
42184
42222
|
fov: 45
|
|
42185
42223
|
};
|
|
42186
42224
|
case "perspective":
|
|
42187
42225
|
default:
|
|
42188
42226
|
return {
|
|
42189
|
-
position: [
|
|
42227
|
+
position: [cx + d, d, cz + d],
|
|
42190
42228
|
fov: 45
|
|
42191
42229
|
};
|
|
42192
42230
|
}
|
|
@@ -42425,7 +42463,8 @@ var init_GameCanvas3D2 = __esm({
|
|
|
42425
42463
|
"div",
|
|
42426
42464
|
{
|
|
42427
42465
|
ref: containerRef,
|
|
42428
|
-
className: cn("game-canvas-3d relative w-full
|
|
42466
|
+
className: cn("game-canvas-3d relative w-full overflow-hidden", className),
|
|
42467
|
+
style: { minHeight: "85vh" },
|
|
42429
42468
|
"data-orientation": orientation,
|
|
42430
42469
|
"data-camera-mode": cameraMode,
|
|
42431
42470
|
"data-overlay": overlay,
|
|
@@ -42440,7 +42479,7 @@ var init_GameCanvas3D2 = __esm({
|
|
|
42440
42479
|
near: 0.1,
|
|
42441
42480
|
far: 1e3
|
|
42442
42481
|
},
|
|
42443
|
-
style: { background: backgroundColor },
|
|
42482
|
+
style: { background: backgroundColor, height: "85vh", width: "100%" },
|
|
42444
42483
|
onClick: (e) => {
|
|
42445
42484
|
if (e.target === e.currentTarget) {
|
|
42446
42485
|
eventHandlers.handleCanvasClick(e);
|
|
@@ -46242,7 +46281,7 @@ function getAllEvents(traits2) {
|
|
|
46242
46281
|
function EventDispatcherTab({ traits: traits2, schema }) {
|
|
46243
46282
|
const eventBus = useEventBus();
|
|
46244
46283
|
const { t } = hooks.useTranslate();
|
|
46245
|
-
const [
|
|
46284
|
+
const [log14, setLog] = React81__namespace.useState([]);
|
|
46246
46285
|
const prevStatesRef = React81__namespace.useRef(/* @__PURE__ */ new Map());
|
|
46247
46286
|
React81__namespace.useEffect(() => {
|
|
46248
46287
|
for (const trait of traits2) {
|
|
@@ -46306,9 +46345,9 @@ function EventDispatcherTab({ traits: traits2, schema }) {
|
|
|
46306
46345
|
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-1", children: t("debug.otherEvents") }),
|
|
46307
46346
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap gap-1", children: unavailableEvents.map((event) => /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "default", size: "sm", className: "opacity-50", children: event }, event)) })
|
|
46308
46347
|
] }),
|
|
46309
|
-
|
|
46348
|
+
log14.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
46310
46349
|
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-1", children: t("debug.recentTransitions") }),
|
|
46311
|
-
/* @__PURE__ */ jsxRuntime.jsx(Stack, { gap: "xs", children:
|
|
46350
|
+
/* @__PURE__ */ jsxRuntime.jsx(Stack, { gap: "xs", children: log14.map((entry, i) => /* @__PURE__ */ jsxRuntime.jsxs(Typography, { variant: "small", className: "font-mono text-xs", children: [
|
|
46312
46351
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-purple-400", children: entry.traitName }),
|
|
46313
46352
|
" ",
|
|
46314
46353
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-gray-500", children: entry.from }),
|
|
@@ -51323,7 +51362,7 @@ function isPatternConfig(value) {
|
|
|
51323
51362
|
if (value instanceof Date) return false;
|
|
51324
51363
|
if (typeof value === "function") return false;
|
|
51325
51364
|
const record = value;
|
|
51326
|
-
return "type" in record && typeof record.type === "string" &&
|
|
51365
|
+
return "type" in record && typeof record.type === "string" && patterns.getComponentForPattern(record.type) !== null;
|
|
51327
51366
|
}
|
|
51328
51367
|
function isPlainConfigObject(value) {
|
|
51329
51368
|
if (React81__namespace.default.isValidElement(value)) return false;
|
|
@@ -52070,7 +52109,7 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
|
|
|
52070
52109
|
};
|
|
52071
52110
|
}, [traitBindings]);
|
|
52072
52111
|
const executeTransitionEffects = React81.useCallback(async (params) => {
|
|
52073
|
-
const { binding, previousState, newState, payload, flushEvent, syncOnly, log:
|
|
52112
|
+
const { binding, previousState, newState, payload, flushEvent, syncOnly, log: log14 } = params;
|
|
52074
52113
|
const traitName = binding.trait.name;
|
|
52075
52114
|
const linkedEntity = binding.linkedEntity || "";
|
|
52076
52115
|
const entityId = payload?.entityId;
|
|
@@ -52158,7 +52197,7 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
|
|
|
52158
52197
|
...handlers,
|
|
52159
52198
|
set: async (targetId, field, value) => {
|
|
52160
52199
|
if (baseSet) await baseSet(targetId, field, value);
|
|
52161
|
-
|
|
52200
|
+
log14.debug("set:write", {
|
|
52162
52201
|
traitName,
|
|
52163
52202
|
field,
|
|
52164
52203
|
value: JSON.stringify(value),
|
|
@@ -52198,7 +52237,7 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
|
|
|
52198
52237
|
const executor = new runtime.EffectExecutor({ handlers: trackingHandlers, bindings: bindingCtx, context: effectContext });
|
|
52199
52238
|
try {
|
|
52200
52239
|
await executor.executeAll(effects);
|
|
52201
|
-
|
|
52240
|
+
log14.debug("effects:executed", () => ({
|
|
52202
52241
|
traitName,
|
|
52203
52242
|
transition: `${previousState}->${newState}`,
|
|
52204
52243
|
event: flushEvent,
|
|
@@ -52208,7 +52247,7 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
|
|
|
52208
52247
|
slotsTouched: Array.from(pendingSlots.keys()).join(",")
|
|
52209
52248
|
}));
|
|
52210
52249
|
for (const [slot, patterns] of pendingSlots) {
|
|
52211
|
-
|
|
52250
|
+
log14.debug("flush:slot", {
|
|
52212
52251
|
traitName,
|
|
52213
52252
|
slot,
|
|
52214
52253
|
patternCount: patterns.length,
|
|
@@ -52223,7 +52262,7 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
|
|
|
52223
52262
|
});
|
|
52224
52263
|
}
|
|
52225
52264
|
} catch (error) {
|
|
52226
|
-
|
|
52265
|
+
log14.error("effects:error", {
|
|
52227
52266
|
traitName,
|
|
52228
52267
|
transition: `${previousState}->${newState}`,
|
|
52229
52268
|
event: flushEvent,
|
|
@@ -52698,7 +52737,7 @@ function clearSchemaCache() {
|
|
|
52698
52737
|
|
|
52699
52738
|
// runtime/index.ts
|
|
52700
52739
|
init_EntitySchemaContext();
|
|
52701
|
-
var
|
|
52740
|
+
var log11 = logger.createLogger("almadar:ui:trait-provider");
|
|
52702
52741
|
var TraitContext = React81.createContext(null);
|
|
52703
52742
|
function TraitProvider({
|
|
52704
52743
|
traits: traitBindings,
|
|
@@ -52715,7 +52754,7 @@ function TraitProvider({
|
|
|
52715
52754
|
currentState: stateName,
|
|
52716
52755
|
availableEvents: trait.transitions.filter((t) => t.from === stateName).map((t) => t.event),
|
|
52717
52756
|
dispatch: (eventKey, payload) => {
|
|
52718
|
-
|
|
52757
|
+
log11.debug("Dispatch", () => ({
|
|
52719
52758
|
trait: trait.name,
|
|
52720
52759
|
event: eventKey,
|
|
52721
52760
|
payloadKeys: payload ? Object.keys(payload) : []
|
|
@@ -53465,7 +53504,7 @@ OrbitalThemeProvider.displayName = "OrbitalThemeProvider";
|
|
|
53465
53504
|
init_navigation();
|
|
53466
53505
|
init_verificationRegistry();
|
|
53467
53506
|
var PERF_NAMESPACE = "almadar:perf:canvas";
|
|
53468
|
-
var
|
|
53507
|
+
var log13 = logger.createLogger(PERF_NAMESPACE);
|
|
53469
53508
|
var RING_SIZE = 50;
|
|
53470
53509
|
var ring = [];
|
|
53471
53510
|
var writeIdx = 0;
|
|
@@ -53520,7 +53559,7 @@ function perfEnd(name, startToken, detail) {
|
|
|
53520
53559
|
}
|
|
53521
53560
|
}
|
|
53522
53561
|
push({ name, durationMs, ts: endTs, detail });
|
|
53523
|
-
|
|
53562
|
+
log13.debug(name, () => ({ durationMs, ...detail ?? {} }));
|
|
53524
53563
|
}
|
|
53525
53564
|
function perfTime(name, fn, detail) {
|
|
53526
53565
|
const t = perfStart(name);
|
|
@@ -53538,7 +53577,7 @@ var profilerOnRender = (id, phase, actualDuration, baseDuration, _startTime, com
|
|
|
53538
53577
|
ts: commitTime,
|
|
53539
53578
|
detail: { baseDuration }
|
|
53540
53579
|
});
|
|
53541
|
-
|
|
53580
|
+
log13.debug(`profiler:${id}:${phase}`, () => ({ actualDuration, baseDuration }));
|
|
53542
53581
|
};
|
|
53543
53582
|
function getPerfSnapshot() {
|
|
53544
53583
|
if (ring.length < RING_SIZE) return ring.slice();
|