@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/avl/index.cjs
CHANGED
|
@@ -12207,16 +12207,6 @@ var init_Skeleton = __esm({
|
|
|
12207
12207
|
Skeleton.displayName = "Skeleton";
|
|
12208
12208
|
}
|
|
12209
12209
|
});
|
|
12210
|
-
function isKnownPattern(type) {
|
|
12211
|
-
return type in componentMapping;
|
|
12212
|
-
}
|
|
12213
|
-
var componentMapping;
|
|
12214
|
-
var init_pattern_resolver = __esm({
|
|
12215
|
-
"renderer/pattern-resolver.ts"() {
|
|
12216
|
-
logger.createLogger("almadar:ui:pattern-resolver");
|
|
12217
|
-
componentMapping = {};
|
|
12218
|
-
}
|
|
12219
|
-
});
|
|
12220
12210
|
|
|
12221
12211
|
// renderer/slot-definitions.ts
|
|
12222
12212
|
function isPortalSlot(slot) {
|
|
@@ -12325,7 +12315,6 @@ var init_navigation = __esm({
|
|
|
12325
12315
|
// renderer/index.ts
|
|
12326
12316
|
var init_renderer = __esm({
|
|
12327
12317
|
"renderer/index.ts"() {
|
|
12328
|
-
init_pattern_resolver();
|
|
12329
12318
|
init_slot_definitions();
|
|
12330
12319
|
}
|
|
12331
12320
|
});
|
|
@@ -14029,7 +14018,7 @@ function recordTransition(trace) {
|
|
|
14029
14018
|
...trace,
|
|
14030
14019
|
id: `t-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`
|
|
14031
14020
|
};
|
|
14032
|
-
|
|
14021
|
+
log4.debug("transition:recorded", { trait: trace.traitName, from: trace.from, to: trace.to, event: trace.event, effectCount: trace.effects.length });
|
|
14033
14022
|
getState().transitions.push(entry);
|
|
14034
14023
|
if (getState().transitions.length > MAX_TRANSITIONS) {
|
|
14035
14024
|
getState().transitions.shift();
|
|
@@ -14128,7 +14117,7 @@ function getTraitSnapshots() {
|
|
|
14128
14117
|
try {
|
|
14129
14118
|
snapshots.push(getter());
|
|
14130
14119
|
} catch (err) {
|
|
14131
|
-
|
|
14120
|
+
log4.error("traitSnapshot getter failed", { trait: traitName, err: String(err) });
|
|
14132
14121
|
}
|
|
14133
14122
|
}
|
|
14134
14123
|
return snapshots;
|
|
@@ -14227,10 +14216,10 @@ function updateAssetStatus(url, status) {
|
|
|
14227
14216
|
window.__orbitalVerification.assetStatus[url] = status;
|
|
14228
14217
|
}
|
|
14229
14218
|
}
|
|
14230
|
-
var
|
|
14219
|
+
var log4, MAX_TRANSITIONS;
|
|
14231
14220
|
var init_verificationRegistry = __esm({
|
|
14232
14221
|
"lib/verificationRegistry.ts"() {
|
|
14233
|
-
|
|
14222
|
+
log4 = logger.createLogger("almadar:bridge");
|
|
14234
14223
|
MAX_TRANSITIONS = 500;
|
|
14235
14224
|
exposeOnWindow();
|
|
14236
14225
|
}
|
|
@@ -16161,7 +16150,7 @@ function generateDiff(oldVal, newVal) {
|
|
|
16161
16150
|
}
|
|
16162
16151
|
return diff;
|
|
16163
16152
|
}
|
|
16164
|
-
var orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle,
|
|
16153
|
+
var orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log5, CODE_LANGUAGES, CODE_LANGUAGE_SET, DIFF_STYLES, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS, CodeBlock;
|
|
16165
16154
|
var init_CodeBlock = __esm({
|
|
16166
16155
|
"components/core/molecules/markdown/CodeBlock.tsx"() {
|
|
16167
16156
|
init_cn();
|
|
@@ -16244,7 +16233,7 @@ var init_CodeBlock = __esm({
|
|
|
16244
16233
|
"lolo-op-async": { color: syntax.ORB_COLORS.dark.async }
|
|
16245
16234
|
};
|
|
16246
16235
|
loloStyle = { ...dark__default.default, ...loloStyleOverrides };
|
|
16247
|
-
|
|
16236
|
+
log5 = logger.createLogger("almadar:ui:markdown-code");
|
|
16248
16237
|
CODE_LANGUAGES = [
|
|
16249
16238
|
"text",
|
|
16250
16239
|
"json",
|
|
@@ -16508,7 +16497,7 @@ var init_CodeBlock = __esm({
|
|
|
16508
16497
|
eventBus.emit("UI:COPY_CODE", { language: activeLanguage, success: true });
|
|
16509
16498
|
setTimeout(() => setCopied(false), 2e3);
|
|
16510
16499
|
} catch (err) {
|
|
16511
|
-
|
|
16500
|
+
log5.error("Failed to copy code", { error: err instanceof Error ? err : String(err) });
|
|
16512
16501
|
eventBus.emit("UI:COPY_CODE", { language: activeLanguage, success: false });
|
|
16513
16502
|
}
|
|
16514
16503
|
};
|
|
@@ -20389,14 +20378,14 @@ function useSafeEventBus2() {
|
|
|
20389
20378
|
} };
|
|
20390
20379
|
}
|
|
20391
20380
|
}
|
|
20392
|
-
var
|
|
20381
|
+
var log6, lookStyles4, ButtonGroup;
|
|
20393
20382
|
var init_ButtonGroup = __esm({
|
|
20394
20383
|
"components/core/molecules/ButtonGroup.tsx"() {
|
|
20395
20384
|
"use client";
|
|
20396
20385
|
init_cn();
|
|
20397
20386
|
init_atoms2();
|
|
20398
20387
|
init_useEventBus();
|
|
20399
|
-
|
|
20388
|
+
log6 = logger.createLogger("almadar:ui:button-group");
|
|
20400
20389
|
lookStyles4 = {
|
|
20401
20390
|
"right-aligned-buttons": "",
|
|
20402
20391
|
"floating-bar": "fixed bottom-section left-1/2 -translate-x-1/2 shadow-elevation-toast bg-card p-card-sm rounded-container",
|
|
@@ -20477,7 +20466,7 @@ var init_ButtonGroup = __esm({
|
|
|
20477
20466
|
{
|
|
20478
20467
|
variant: "ghost",
|
|
20479
20468
|
onClick: () => {
|
|
20480
|
-
|
|
20469
|
+
log6.debug("Filter clicked", { field: filter.field });
|
|
20481
20470
|
},
|
|
20482
20471
|
children: filter.label
|
|
20483
20472
|
},
|
|
@@ -28139,9 +28128,9 @@ function debug(...args) {
|
|
|
28139
28128
|
const [first, ...rest] = args;
|
|
28140
28129
|
const message = typeof first === "string" ? first : "<debug>";
|
|
28141
28130
|
if (rest.length === 0 && typeof first === "string") {
|
|
28142
|
-
|
|
28131
|
+
log7.debug(message);
|
|
28143
28132
|
} else {
|
|
28144
|
-
|
|
28133
|
+
log7.debug(message, { args: rest.length > 0 ? formatArgs(rest) : formatArgs([first]) });
|
|
28145
28134
|
}
|
|
28146
28135
|
}
|
|
28147
28136
|
function debugGroup(label) {
|
|
@@ -28169,11 +28158,11 @@ function toLogMetaValue(v) {
|
|
|
28169
28158
|
}
|
|
28170
28159
|
return String(v);
|
|
28171
28160
|
}
|
|
28172
|
-
var NAMESPACE,
|
|
28161
|
+
var NAMESPACE, log7;
|
|
28173
28162
|
var init_debug = __esm({
|
|
28174
28163
|
"lib/debug.ts"() {
|
|
28175
28164
|
NAMESPACE = "almadar:ui:debug";
|
|
28176
|
-
|
|
28165
|
+
log7 = logger.createLogger(NAMESPACE);
|
|
28177
28166
|
logger.createLogger("almadar:ui:debug:input");
|
|
28178
28167
|
logger.createLogger("almadar:ui:debug:collision");
|
|
28179
28168
|
logger.createLogger("almadar:ui:debug:physics");
|
|
@@ -40169,6 +40158,12 @@ function getGroupColor(group, groups) {
|
|
|
40169
40158
|
const idx = groups.indexOf(group);
|
|
40170
40159
|
return GROUP_COLORS2[idx % GROUP_COLORS2.length];
|
|
40171
40160
|
}
|
|
40161
|
+
function resolveColor2(color, el) {
|
|
40162
|
+
const m = /^var\((--[^,)]+)(?:,\s*([^)]+))?\)$/.exec(color.trim());
|
|
40163
|
+
if (!m) return color;
|
|
40164
|
+
const resolved = getComputedStyle(el).getPropertyValue(m[1]).trim();
|
|
40165
|
+
return resolved || (m[2]?.trim() ?? "#888888");
|
|
40166
|
+
}
|
|
40172
40167
|
var GROUP_COLORS2, GraphCanvas;
|
|
40173
40168
|
var init_GraphCanvas = __esm({
|
|
40174
40169
|
"components/core/molecules/GraphCanvas.tsx"() {
|
|
@@ -40198,6 +40193,7 @@ var init_GraphCanvas = __esm({
|
|
|
40198
40193
|
draggable = true,
|
|
40199
40194
|
actions,
|
|
40200
40195
|
onNodeClick,
|
|
40196
|
+
onNodeDoubleClick,
|
|
40201
40197
|
nodeClickEvent,
|
|
40202
40198
|
selectedNodeId,
|
|
40203
40199
|
repulsion = 800,
|
|
@@ -40217,6 +40213,19 @@ var init_GraphCanvas = __esm({
|
|
|
40217
40213
|
const [hoveredNode, setHoveredNode] = React90.useState(null);
|
|
40218
40214
|
const nodesRef = React90.useRef([]);
|
|
40219
40215
|
const [, forceUpdate] = React90.useState(0);
|
|
40216
|
+
const [logicalW, setLogicalW] = React90.useState(800);
|
|
40217
|
+
React90.useEffect(() => {
|
|
40218
|
+
const canvas = canvasRef.current;
|
|
40219
|
+
if (!canvas || typeof ResizeObserver === "undefined") return;
|
|
40220
|
+
const measure = () => {
|
|
40221
|
+
const width = Math.round(canvas.clientWidth);
|
|
40222
|
+
if (width > 0) setLogicalW(width);
|
|
40223
|
+
};
|
|
40224
|
+
measure();
|
|
40225
|
+
const ro = new ResizeObserver(measure);
|
|
40226
|
+
ro.observe(canvas);
|
|
40227
|
+
return () => ro.disconnect();
|
|
40228
|
+
}, []);
|
|
40220
40229
|
const interactionRef = React90.useRef({
|
|
40221
40230
|
mode: "none",
|
|
40222
40231
|
dragNodeId: null,
|
|
@@ -40270,8 +40279,8 @@ var init_GraphCanvas = __esm({
|
|
|
40270
40279
|
React90.useEffect(() => {
|
|
40271
40280
|
const canvas = canvasRef.current;
|
|
40272
40281
|
if (!canvas || propNodes.length === 0) return;
|
|
40273
|
-
const w =
|
|
40274
|
-
const h =
|
|
40282
|
+
const w = logicalW;
|
|
40283
|
+
const h = height;
|
|
40275
40284
|
const simNodes = propNodes.map((n, idx) => {
|
|
40276
40285
|
let x = n.x ?? 0;
|
|
40277
40286
|
let y = n.y ?? 0;
|
|
@@ -40361,28 +40370,41 @@ var init_GraphCanvas = __esm({
|
|
|
40361
40370
|
return () => {
|
|
40362
40371
|
cancelAnimationFrame(animRef.current);
|
|
40363
40372
|
};
|
|
40364
|
-
}, [propNodes, propEdges, layout, repulsion, linkDistance]);
|
|
40373
|
+
}, [propNodes, propEdges, layout, repulsion, linkDistance, logicalW, height]);
|
|
40365
40374
|
React90.useEffect(() => {
|
|
40366
40375
|
const canvas = canvasRef.current;
|
|
40367
40376
|
if (!canvas) return;
|
|
40368
40377
|
const ctx = canvas.getContext("2d");
|
|
40369
40378
|
if (!ctx) return;
|
|
40370
|
-
const w =
|
|
40371
|
-
const h =
|
|
40379
|
+
const w = logicalW;
|
|
40380
|
+
const h = height;
|
|
40372
40381
|
const nodes = nodesRef.current;
|
|
40382
|
+
const accentColor = resolveColor2("var(--color-accent)", canvas);
|
|
40383
|
+
const dpr = typeof window !== "undefined" && window.devicePixelRatio || 1;
|
|
40384
|
+
ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
|
|
40373
40385
|
ctx.clearRect(0, 0, w, h);
|
|
40374
40386
|
ctx.save();
|
|
40375
40387
|
ctx.translate(offset.x, offset.y);
|
|
40376
40388
|
ctx.scale(zoom, zoom);
|
|
40389
|
+
const neighbors = /* @__PURE__ */ new Set();
|
|
40390
|
+
if (hoveredNode) {
|
|
40391
|
+
neighbors.add(hoveredNode);
|
|
40392
|
+
for (const edge of propEdges) {
|
|
40393
|
+
if (edge.source === hoveredNode) neighbors.add(String(edge.target));
|
|
40394
|
+
else if (edge.target === hoveredNode) neighbors.add(String(edge.source));
|
|
40395
|
+
}
|
|
40396
|
+
}
|
|
40377
40397
|
for (const edge of propEdges) {
|
|
40378
40398
|
const source = nodes.find((n) => n.id === edge.source);
|
|
40379
40399
|
const target = nodes.find((n) => n.id === edge.target);
|
|
40380
40400
|
if (!source || !target) continue;
|
|
40401
|
+
const incident = !!hoveredNode && (edge.source === hoveredNode || edge.target === hoveredNode);
|
|
40402
|
+
ctx.globalAlpha = hoveredNode ? incident ? 1 : 0.12 : 1;
|
|
40381
40403
|
ctx.beginPath();
|
|
40382
40404
|
ctx.moveTo(source.x, source.y);
|
|
40383
40405
|
ctx.lineTo(target.x, target.y);
|
|
40384
|
-
ctx.strokeStyle = edge.color || "#88888866";
|
|
40385
|
-
ctx.lineWidth = edge.weight ? Math.max(1, edge.weight) : 1;
|
|
40406
|
+
ctx.strokeStyle = incident ? accentColor : edge.color || "#88888866";
|
|
40407
|
+
ctx.lineWidth = incident ? 2 : edge.weight ? Math.max(1, edge.weight) : 1;
|
|
40386
40408
|
ctx.stroke();
|
|
40387
40409
|
if (edge.label && showLabels) {
|
|
40388
40410
|
const mx = (source.x + target.x) / 2;
|
|
@@ -40393,18 +40415,20 @@ var init_GraphCanvas = __esm({
|
|
|
40393
40415
|
ctx.fillText(edge.label, mx, my - 4);
|
|
40394
40416
|
}
|
|
40395
40417
|
}
|
|
40418
|
+
ctx.globalAlpha = 1;
|
|
40396
40419
|
for (const node of nodes) {
|
|
40397
40420
|
const size = node.size || 8;
|
|
40398
|
-
const color = node.color || getGroupColor(node.group, groups);
|
|
40421
|
+
const color = resolveColor2(node.color || getGroupColor(node.group, groups), canvas);
|
|
40399
40422
|
const isHovered = hoveredNode === node.id;
|
|
40400
40423
|
const isSelected = selectedNodeId !== void 0 && node.id === selectedNodeId;
|
|
40424
|
+
ctx.globalAlpha = hoveredNode && !neighbors.has(node.id) ? 0.2 : 1;
|
|
40401
40425
|
const radius = isSelected ? size + 4 : isHovered ? size + 2 : size;
|
|
40402
40426
|
ctx.beginPath();
|
|
40403
40427
|
ctx.arc(node.x, node.y, radius, 0, Math.PI * 2);
|
|
40404
40428
|
ctx.fillStyle = color;
|
|
40405
40429
|
ctx.fill();
|
|
40406
40430
|
if (isSelected) {
|
|
40407
|
-
ctx.strokeStyle =
|
|
40431
|
+
ctx.strokeStyle = accentColor;
|
|
40408
40432
|
ctx.lineWidth = 3;
|
|
40409
40433
|
} else {
|
|
40410
40434
|
ctx.strokeStyle = isHovered ? "#ffffff" : "#00000020";
|
|
@@ -40517,6 +40541,15 @@ var init_GraphCanvas = __esm({
|
|
|
40517
40541
|
interactionRef.current.dragNodeId = null;
|
|
40518
40542
|
setHoveredNode(null);
|
|
40519
40543
|
}, []);
|
|
40544
|
+
const handleDoubleClick = React90.useCallback(
|
|
40545
|
+
(e) => {
|
|
40546
|
+
const coords = toCoords(e);
|
|
40547
|
+
if (!coords) return;
|
|
40548
|
+
const node = nodeAt(coords.graphX, coords.graphY);
|
|
40549
|
+
if (node) onNodeDoubleClick?.(node);
|
|
40550
|
+
},
|
|
40551
|
+
[toCoords, nodeAt, onNodeDoubleClick]
|
|
40552
|
+
);
|
|
40520
40553
|
if (isLoading) {
|
|
40521
40554
|
return /* @__PURE__ */ jsxRuntime.jsx(LoadingState, { message: t("common.loading"), className });
|
|
40522
40555
|
}
|
|
@@ -40574,15 +40607,16 @@ var init_GraphCanvas = __esm({
|
|
|
40574
40607
|
"canvas",
|
|
40575
40608
|
{
|
|
40576
40609
|
ref: canvasRef,
|
|
40577
|
-
width:
|
|
40578
|
-
height,
|
|
40610
|
+
width: Math.round(logicalW * (typeof window !== "undefined" && window.devicePixelRatio || 1)),
|
|
40611
|
+
height: Math.round(height * (typeof window !== "undefined" && window.devicePixelRatio || 1)),
|
|
40579
40612
|
className: "w-full cursor-grab active:cursor-grabbing",
|
|
40580
40613
|
style: { height },
|
|
40581
40614
|
onWheel: handleWheel,
|
|
40582
40615
|
onMouseDown: handleMouseDown,
|
|
40583
40616
|
onMouseMove: handleMouseMove,
|
|
40584
40617
|
onMouseUp: handleMouseUp,
|
|
40585
|
-
onMouseLeave: handleMouseLeave
|
|
40618
|
+
onMouseLeave: handleMouseLeave,
|
|
40619
|
+
onDoubleClick: handleDoubleClick
|
|
40586
40620
|
}
|
|
40587
40621
|
) }),
|
|
40588
40622
|
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: [
|
|
@@ -44176,11 +44210,11 @@ var init_Canvas3DErrorBoundary = __esm({
|
|
|
44176
44210
|
"components/game/molecules/three/components/Canvas3DErrorBoundary.css"() {
|
|
44177
44211
|
}
|
|
44178
44212
|
});
|
|
44179
|
-
var
|
|
44213
|
+
var log8, Canvas3DErrorBoundary;
|
|
44180
44214
|
var init_Canvas3DErrorBoundary2 = __esm({
|
|
44181
44215
|
"components/game/molecules/three/components/Canvas3DErrorBoundary.tsx"() {
|
|
44182
44216
|
init_Canvas3DErrorBoundary();
|
|
44183
|
-
|
|
44217
|
+
log8 = logger.createLogger("almadar:ui:game:canvas3d:error-boundary");
|
|
44184
44218
|
Canvas3DErrorBoundary = class extends React90.Component {
|
|
44185
44219
|
constructor(props) {
|
|
44186
44220
|
super(props);
|
|
@@ -44208,8 +44242,8 @@ var init_Canvas3DErrorBoundary2 = __esm({
|
|
|
44208
44242
|
componentDidCatch(error, errorInfo) {
|
|
44209
44243
|
this.setState({ errorInfo });
|
|
44210
44244
|
this.props.onError?.(error, errorInfo);
|
|
44211
|
-
|
|
44212
|
-
|
|
44245
|
+
log8.error("Error caught", { error });
|
|
44246
|
+
log8.error("Component stack", { componentStack: errorInfo.componentStack ?? "<none>" });
|
|
44213
44247
|
}
|
|
44214
44248
|
render() {
|
|
44215
44249
|
if (this.state.hasError) {
|
|
@@ -44272,7 +44306,7 @@ function useGLTFModel(url, resourceBasePath) {
|
|
|
44272
44306
|
setState({ model: null, isLoading: false, error: null });
|
|
44273
44307
|
return;
|
|
44274
44308
|
}
|
|
44275
|
-
|
|
44309
|
+
log9.debug("Loading", { url });
|
|
44276
44310
|
setState((prev) => ({ ...prev, isLoading: true, error: null }));
|
|
44277
44311
|
const assetRoot = resourceBasePath || detectAssetRoot2(url);
|
|
44278
44312
|
const loader = new GLTFLoader.GLTFLoader();
|
|
@@ -44280,7 +44314,7 @@ function useGLTFModel(url, resourceBasePath) {
|
|
|
44280
44314
|
loader.load(
|
|
44281
44315
|
url,
|
|
44282
44316
|
(gltf) => {
|
|
44283
|
-
|
|
44317
|
+
log9.debug("Loaded", { url });
|
|
44284
44318
|
setState({
|
|
44285
44319
|
model: gltf.scene,
|
|
44286
44320
|
isLoading: false,
|
|
@@ -44289,7 +44323,7 @@ function useGLTFModel(url, resourceBasePath) {
|
|
|
44289
44323
|
},
|
|
44290
44324
|
void 0,
|
|
44291
44325
|
(err) => {
|
|
44292
|
-
|
|
44326
|
+
log9.warn("Failed", { url, error: err instanceof Error ? err : String(err) });
|
|
44293
44327
|
setState({
|
|
44294
44328
|
model: null,
|
|
44295
44329
|
isLoading: false,
|
|
@@ -44405,11 +44439,11 @@ function ModelLoader({
|
|
|
44405
44439
|
}
|
|
44406
44440
|
);
|
|
44407
44441
|
}
|
|
44408
|
-
var
|
|
44442
|
+
var log9;
|
|
44409
44443
|
var init_ModelLoader = __esm({
|
|
44410
44444
|
"components/game/molecules/three/components/ModelLoader.tsx"() {
|
|
44411
44445
|
"use client";
|
|
44412
|
-
|
|
44446
|
+
log9 = logger.createLogger("almadar:ui:game:model-loader");
|
|
44413
44447
|
}
|
|
44414
44448
|
});
|
|
44415
44449
|
|
|
@@ -44670,24 +44704,28 @@ var init_GameCanvas3D2 = __esm({
|
|
|
44670
44704
|
const cameraConfig = React90.useMemo(() => {
|
|
44671
44705
|
const size = Math.max(
|
|
44672
44706
|
gridBounds.maxX - gridBounds.minX,
|
|
44673
|
-
gridBounds.maxZ - gridBounds.minZ
|
|
44707
|
+
gridBounds.maxZ - gridBounds.minZ,
|
|
44708
|
+
4
|
|
44709
|
+
// minimum framing distance so a tiny board isn't zoomed in
|
|
44674
44710
|
);
|
|
44675
|
-
const
|
|
44711
|
+
const cx = (gridBounds.minX + gridBounds.maxX) / 2;
|
|
44712
|
+
const cz = (gridBounds.minZ + gridBounds.maxZ) / 2;
|
|
44713
|
+
const d = size * 1.5;
|
|
44676
44714
|
switch (cameraMode) {
|
|
44677
44715
|
case "isometric":
|
|
44678
44716
|
return {
|
|
44679
|
-
position: [
|
|
44717
|
+
position: [cx + d, d * 0.8, cz + d],
|
|
44680
44718
|
fov: 45
|
|
44681
44719
|
};
|
|
44682
44720
|
case "top-down":
|
|
44683
44721
|
return {
|
|
44684
|
-
position: [
|
|
44722
|
+
position: [cx, d * 2, cz],
|
|
44685
44723
|
fov: 45
|
|
44686
44724
|
};
|
|
44687
44725
|
case "perspective":
|
|
44688
44726
|
default:
|
|
44689
44727
|
return {
|
|
44690
|
-
position: [
|
|
44728
|
+
position: [cx + d, d, cz + d],
|
|
44691
44729
|
fov: 45
|
|
44692
44730
|
};
|
|
44693
44731
|
}
|
|
@@ -44926,7 +44964,8 @@ var init_GameCanvas3D2 = __esm({
|
|
|
44926
44964
|
"div",
|
|
44927
44965
|
{
|
|
44928
44966
|
ref: containerRef,
|
|
44929
|
-
className: cn("game-canvas-3d relative w-full
|
|
44967
|
+
className: cn("game-canvas-3d relative w-full overflow-hidden", className),
|
|
44968
|
+
style: { minHeight: "85vh" },
|
|
44930
44969
|
"data-orientation": orientation,
|
|
44931
44970
|
"data-camera-mode": cameraMode,
|
|
44932
44971
|
"data-overlay": overlay,
|
|
@@ -44941,7 +44980,7 @@ var init_GameCanvas3D2 = __esm({
|
|
|
44941
44980
|
near: 0.1,
|
|
44942
44981
|
far: 1e3
|
|
44943
44982
|
},
|
|
44944
|
-
style: { background: backgroundColor },
|
|
44983
|
+
style: { background: backgroundColor, height: "85vh", width: "100%" },
|
|
44945
44984
|
onClick: (e) => {
|
|
44946
44985
|
if (e.target === e.currentTarget) {
|
|
44947
44986
|
eventHandlers.handleCanvasClick(e);
|
|
@@ -48743,7 +48782,7 @@ function getAllEvents(traits2) {
|
|
|
48743
48782
|
function EventDispatcherTab({ traits: traits2, schema }) {
|
|
48744
48783
|
const eventBus = useEventBus();
|
|
48745
48784
|
const { t } = hooks.useTranslate();
|
|
48746
|
-
const [
|
|
48785
|
+
const [log15, setLog] = React90__namespace.useState([]);
|
|
48747
48786
|
const prevStatesRef = React90__namespace.useRef(/* @__PURE__ */ new Map());
|
|
48748
48787
|
React90__namespace.useEffect(() => {
|
|
48749
48788
|
for (const trait of traits2) {
|
|
@@ -48807,9 +48846,9 @@ function EventDispatcherTab({ traits: traits2, schema }) {
|
|
|
48807
48846
|
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-1", children: t("debug.otherEvents") }),
|
|
48808
48847
|
/* @__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)) })
|
|
48809
48848
|
] }),
|
|
48810
|
-
|
|
48849
|
+
log15.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
48811
48850
|
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-1", children: t("debug.recentTransitions") }),
|
|
48812
|
-
/* @__PURE__ */ jsxRuntime.jsx(Stack, { gap: "xs", children:
|
|
48851
|
+
/* @__PURE__ */ jsxRuntime.jsx(Stack, { gap: "xs", children: log15.map((entry, i) => /* @__PURE__ */ jsxRuntime.jsxs(Typography, { variant: "small", className: "font-mono text-xs", children: [
|
|
48813
48852
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-purple-400", children: entry.traitName }),
|
|
48814
48853
|
" ",
|
|
48815
48854
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-gray-500", children: entry.from }),
|
|
@@ -53824,7 +53863,7 @@ function isPatternConfig(value) {
|
|
|
53824
53863
|
if (value instanceof Date) return false;
|
|
53825
53864
|
if (typeof value === "function") return false;
|
|
53826
53865
|
const record = value;
|
|
53827
|
-
return "type" in record && typeof record.type === "string" &&
|
|
53866
|
+
return "type" in record && typeof record.type === "string" && patterns.getComponentForPattern(record.type) !== null;
|
|
53828
53867
|
}
|
|
53829
53868
|
function isPlainConfigObject(value) {
|
|
53830
53869
|
if (React90__namespace.default.isValidElement(value)) return false;
|
|
@@ -57736,7 +57775,7 @@ function convertObjectProps(props) {
|
|
|
57736
57775
|
function convertFnFormLambdasInProps(props) {
|
|
57737
57776
|
return convertObjectProps(props);
|
|
57738
57777
|
}
|
|
57739
|
-
var
|
|
57778
|
+
var log10 = logger.createLogger("almadar:ui:effects:client-handlers");
|
|
57740
57779
|
function createClientEffectHandlers(options) {
|
|
57741
57780
|
const { eventBus, slotSetter, navigate, notify, callService, liveEntity } = options;
|
|
57742
57781
|
return {
|
|
@@ -57745,11 +57784,11 @@ function createClientEffectHandlers(options) {
|
|
|
57745
57784
|
eventBus.emit(prefixedEvent, payload);
|
|
57746
57785
|
},
|
|
57747
57786
|
persist: async () => {
|
|
57748
|
-
|
|
57787
|
+
log10.warn("persist is server-side only, ignored on client");
|
|
57749
57788
|
},
|
|
57750
57789
|
set: (_entityId, field, value) => {
|
|
57751
57790
|
if (!liveEntity) {
|
|
57752
|
-
|
|
57791
|
+
log10.warn("set is server-side only, ignored on client (no live entity)");
|
|
57753
57792
|
return;
|
|
57754
57793
|
}
|
|
57755
57794
|
liveEntity[field] = value;
|
|
@@ -57781,10 +57820,10 @@ function createClientEffectHandlers(options) {
|
|
|
57781
57820
|
slotSetter.addPattern(slot, pattern, props);
|
|
57782
57821
|
},
|
|
57783
57822
|
navigate: navigate ?? ((path) => {
|
|
57784
|
-
|
|
57823
|
+
log10.warn("No navigate handler, ignoring", { path });
|
|
57785
57824
|
}),
|
|
57786
57825
|
notify: notify ?? ((msg, type) => {
|
|
57787
|
-
|
|
57826
|
+
log10.debug("notify", { type, message: msg });
|
|
57788
57827
|
})
|
|
57789
57828
|
};
|
|
57790
57829
|
}
|
|
@@ -58016,7 +58055,7 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
|
|
|
58016
58055
|
};
|
|
58017
58056
|
}, [traitBindings]);
|
|
58018
58057
|
const executeTransitionEffects = React90.useCallback(async (params) => {
|
|
58019
|
-
const { binding, previousState, newState, payload, flushEvent, syncOnly, log:
|
|
58058
|
+
const { binding, previousState, newState, payload, flushEvent, syncOnly, log: log15 } = params;
|
|
58020
58059
|
const traitName = binding.trait.name;
|
|
58021
58060
|
const linkedEntity = binding.linkedEntity || "";
|
|
58022
58061
|
const entityId = payload?.entityId;
|
|
@@ -58104,7 +58143,7 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
|
|
|
58104
58143
|
...handlers,
|
|
58105
58144
|
set: async (targetId, field, value) => {
|
|
58106
58145
|
if (baseSet) await baseSet(targetId, field, value);
|
|
58107
|
-
|
|
58146
|
+
log15.debug("set:write", {
|
|
58108
58147
|
traitName,
|
|
58109
58148
|
field,
|
|
58110
58149
|
value: JSON.stringify(value),
|
|
@@ -58144,7 +58183,7 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
|
|
|
58144
58183
|
const executor = new runtime.EffectExecutor({ handlers: trackingHandlers, bindings: bindingCtx, context: effectContext });
|
|
58145
58184
|
try {
|
|
58146
58185
|
await executor.executeAll(effects);
|
|
58147
|
-
|
|
58186
|
+
log15.debug("effects:executed", () => ({
|
|
58148
58187
|
traitName,
|
|
58149
58188
|
transition: `${previousState}->${newState}`,
|
|
58150
58189
|
event: flushEvent,
|
|
@@ -58154,7 +58193,7 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
|
|
|
58154
58193
|
slotsTouched: Array.from(pendingSlots.keys()).join(",")
|
|
58155
58194
|
}));
|
|
58156
58195
|
for (const [slot, patterns] of pendingSlots) {
|
|
58157
|
-
|
|
58196
|
+
log15.debug("flush:slot", {
|
|
58158
58197
|
traitName,
|
|
58159
58198
|
slot,
|
|
58160
58199
|
patternCount: patterns.length,
|
|
@@ -58169,7 +58208,7 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
|
|
|
58169
58208
|
});
|
|
58170
58209
|
}
|
|
58171
58210
|
} catch (error) {
|
|
58172
|
-
|
|
58211
|
+
log15.error("effects:error", {
|
|
58173
58212
|
traitName,
|
|
58174
58213
|
transition: `${previousState}->${newState}`,
|
|
58175
58214
|
event: flushEvent,
|
|
@@ -59164,7 +59203,7 @@ OrbitalThemeProvider.displayName = "OrbitalThemeProvider";
|
|
|
59164
59203
|
init_navigation();
|
|
59165
59204
|
init_verificationRegistry();
|
|
59166
59205
|
var PERF_NAMESPACE = "almadar:perf:canvas";
|
|
59167
|
-
var
|
|
59206
|
+
var log12 = logger.createLogger(PERF_NAMESPACE);
|
|
59168
59207
|
var RING_SIZE = 50;
|
|
59169
59208
|
var ring = [];
|
|
59170
59209
|
var writeIdx = 0;
|
|
@@ -59215,7 +59254,7 @@ function perfEnd(name, startToken, detail) {
|
|
|
59215
59254
|
}
|
|
59216
59255
|
}
|
|
59217
59256
|
push({ name, durationMs, ts: endTs, detail });
|
|
59218
|
-
|
|
59257
|
+
log12.debug(name, () => ({ durationMs, ...detail ?? {} }));
|
|
59219
59258
|
}
|
|
59220
59259
|
var profilerOnRender = (id, phase, actualDuration, baseDuration, _startTime, commitTime) => {
|
|
59221
59260
|
if (!isEnabled()) return;
|
|
@@ -59225,7 +59264,7 @@ var profilerOnRender = (id, phase, actualDuration, baseDuration, _startTime, com
|
|
|
59225
59264
|
ts: commitTime,
|
|
59226
59265
|
detail: { baseDuration }
|
|
59227
59266
|
});
|
|
59228
|
-
|
|
59267
|
+
log12.debug(`profiler:${id}:${phase}`, () => ({ actualDuration, baseDuration }));
|
|
59229
59268
|
};
|
|
59230
59269
|
|
|
59231
59270
|
// runtime/prepareSchemaForPreview.ts
|
|
@@ -59868,7 +59907,7 @@ init_useEventBus();
|
|
|
59868
59907
|
// components/avl/molecules/useCanvasDnd.tsx
|
|
59869
59908
|
init_useEventBus();
|
|
59870
59909
|
init_useAlmadarDndCollision();
|
|
59871
|
-
var
|
|
59910
|
+
var log13 = logger.createLogger("almadar:ui:canvas-dnd");
|
|
59872
59911
|
function useCanvasDraggable({
|
|
59873
59912
|
id,
|
|
59874
59913
|
payload,
|
|
@@ -59907,7 +59946,7 @@ function defaultEmit(eventBus, drop) {
|
|
|
59907
59946
|
if (payload.kind === "pattern") {
|
|
59908
59947
|
const patternType = payload.data.type;
|
|
59909
59948
|
if (typeof patternType !== "string") {
|
|
59910
|
-
|
|
59949
|
+
log13.warn("default-emit:pattern:missing-type");
|
|
59911
59950
|
return;
|
|
59912
59951
|
}
|
|
59913
59952
|
const out = { patternType, containerNode: target.containerNode };
|
|
@@ -59916,23 +59955,23 @@ function defaultEmit(eventBus, drop) {
|
|
|
59916
59955
|
out.index = resolved.index;
|
|
59917
59956
|
}
|
|
59918
59957
|
eventBus.emit("UI:PATTERN_DROP", out);
|
|
59919
|
-
|
|
59958
|
+
log13.info("default-emit:pattern", { patternType, level: target.level });
|
|
59920
59959
|
return;
|
|
59921
59960
|
}
|
|
59922
59961
|
if (payload.kind === "behavior") {
|
|
59923
59962
|
const behaviorName = payload.data.name;
|
|
59924
59963
|
if (typeof behaviorName !== "string") {
|
|
59925
|
-
|
|
59964
|
+
log13.warn("default-emit:behavior:missing-name");
|
|
59926
59965
|
return;
|
|
59927
59966
|
}
|
|
59928
59967
|
eventBus.emit("UI:BEHAVIOR_DROP", {
|
|
59929
59968
|
behaviorName,
|
|
59930
59969
|
containerNode: target.containerNode
|
|
59931
59970
|
});
|
|
59932
|
-
|
|
59971
|
+
log13.info("default-emit:behavior", { behaviorName, level: target.level });
|
|
59933
59972
|
return;
|
|
59934
59973
|
}
|
|
59935
|
-
|
|
59974
|
+
log13.debug("default-emit:unhandled-kind", { kind: payload.kind });
|
|
59936
59975
|
}
|
|
59937
59976
|
function CanvasDndProvider({
|
|
59938
59977
|
children,
|
|
@@ -59948,9 +59987,9 @@ function CanvasDndProvider({
|
|
|
59948
59987
|
if (payload) {
|
|
59949
59988
|
setActivePayload(payload);
|
|
59950
59989
|
eventBus.emit("UI:DRAG_START", { kind: payload.kind, data: payload.data });
|
|
59951
|
-
|
|
59990
|
+
log13.info("dragStart", { id: e.active.id, kind: payload.kind });
|
|
59952
59991
|
} else {
|
|
59953
|
-
|
|
59992
|
+
log13.warn("dragStart:missing-payload", { id: e.active.id });
|
|
59954
59993
|
}
|
|
59955
59994
|
}, [eventBus]);
|
|
59956
59995
|
const handleDragEnd = React90__namespace.default.useCallback((e) => {
|
|
@@ -59960,7 +59999,7 @@ function CanvasDndProvider({
|
|
|
59960
59999
|
const overData = e.over?.data.current;
|
|
59961
60000
|
const target = overData?.target;
|
|
59962
60001
|
const accepts = overData?.accepts;
|
|
59963
|
-
|
|
60002
|
+
log13.info("dragEnd", {
|
|
59964
60003
|
activeId: e.active.id,
|
|
59965
60004
|
overId: e.over?.id,
|
|
59966
60005
|
hasPayload: !!payload,
|
|
@@ -59972,7 +60011,7 @@ function CanvasDndProvider({
|
|
|
59972
60011
|
}
|
|
59973
60012
|
if (!payload || !target) return;
|
|
59974
60013
|
if (accepts && !accepts.includes(payload.kind)) {
|
|
59975
|
-
|
|
60014
|
+
log13.debug("dragEnd:rejected:kind", { kind: payload.kind, accepts: [...accepts] });
|
|
59976
60015
|
return;
|
|
59977
60016
|
}
|
|
59978
60017
|
const activator = e.activatorEvent;
|
|
@@ -59984,7 +60023,7 @@ function CanvasDndProvider({
|
|
|
59984
60023
|
}, [eventBus, onDrop]);
|
|
59985
60024
|
const handleDragCancel = React90__namespace.default.useCallback(() => {
|
|
59986
60025
|
setActivePayload(null);
|
|
59987
|
-
|
|
60026
|
+
log13.info("dragCancel");
|
|
59988
60027
|
}, []);
|
|
59989
60028
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
59990
60029
|
core$1.DndContext,
|
|
@@ -61799,7 +61838,7 @@ init_AvlTransitionLane();
|
|
|
61799
61838
|
init_AvlSwimLane();
|
|
61800
61839
|
init_types();
|
|
61801
61840
|
init_avl_elk_layout();
|
|
61802
|
-
var
|
|
61841
|
+
var log14 = logger.createLogger("almadar:ui:avl:trait-scene");
|
|
61803
61842
|
var SWIM_GUTTER2 = 120;
|
|
61804
61843
|
var CENTER_W2 = 360;
|
|
61805
61844
|
var AvlTraitScene = ({
|
|
@@ -61812,7 +61851,7 @@ var AvlTraitScene = ({
|
|
|
61812
61851
|
const dataKey = React90.useMemo(() => JSON.stringify(data), [data]);
|
|
61813
61852
|
React90.useEffect(() => {
|
|
61814
61853
|
computeTraitLayout(data).then(setLayout).catch((error) => {
|
|
61815
|
-
|
|
61854
|
+
log14.error("computeTraitLayout failed", { error: error instanceof Error ? error : String(error) });
|
|
61816
61855
|
});
|
|
61817
61856
|
}, [dataKey]);
|
|
61818
61857
|
if (!layout) {
|