@almadar/ui 5.60.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.
@@ -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
- log5.debug("transition:recorded", { trait: trace.traitName, from: trace.from, to: trace.to, event: trace.event, effectCount: trace.effects.length });
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
- log5.error("traitSnapshot getter failed", { trait: traitName, err: String(err) });
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 log5, MAX_TRANSITIONS;
14219
+ var log4, MAX_TRANSITIONS;
14231
14220
  var init_verificationRegistry = __esm({
14232
14221
  "lib/verificationRegistry.ts"() {
14233
- log5 = logger.createLogger("almadar:bridge");
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, log6, CODE_LANGUAGES, CODE_LANGUAGE_SET, DIFF_STYLES, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS, CodeBlock;
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
- log6 = logger.createLogger("almadar:ui:markdown-code");
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
- log6.error("Failed to copy code", { error: err instanceof Error ? err : String(err) });
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 log7, lookStyles4, ButtonGroup;
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
- log7 = logger.createLogger("almadar:ui:button-group");
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
- log7.debug("Filter clicked", { field: filter.field });
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
- log8.debug(message);
28131
+ log7.debug(message);
28143
28132
  } else {
28144
- log8.debug(message, { args: rest.length > 0 ? formatArgs(rest) : formatArgs([first]) });
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, log8;
28161
+ var NAMESPACE, log7;
28173
28162
  var init_debug = __esm({
28174
28163
  "lib/debug.ts"() {
28175
28164
  NAMESPACE = "almadar:ui:debug";
28176
- log8 = logger.createLogger(NAMESPACE);
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");
@@ -40204,6 +40193,7 @@ var init_GraphCanvas = __esm({
40204
40193
  draggable = true,
40205
40194
  actions,
40206
40195
  onNodeClick,
40196
+ onNodeDoubleClick,
40207
40197
  nodeClickEvent,
40208
40198
  selectedNodeId,
40209
40199
  repulsion = 800,
@@ -40223,6 +40213,19 @@ var init_GraphCanvas = __esm({
40223
40213
  const [hoveredNode, setHoveredNode] = React90.useState(null);
40224
40214
  const nodesRef = React90.useRef([]);
40225
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
+ }, []);
40226
40229
  const interactionRef = React90.useRef({
40227
40230
  mode: "none",
40228
40231
  dragNodeId: null,
@@ -40235,10 +40238,8 @@ var init_GraphCanvas = __esm({
40235
40238
  const canvas = canvasRef.current;
40236
40239
  if (!canvas) return null;
40237
40240
  const rect = canvas.getBoundingClientRect();
40238
- const scaleX = rect.width > 0 ? canvas.width / rect.width : 1;
40239
- const scaleY = rect.height > 0 ? canvas.height / rect.height : 1;
40240
- const screenX = (e.clientX - rect.left) * scaleX;
40241
- const screenY = (e.clientY - rect.top) * scaleY;
40241
+ const screenX = e.clientX - rect.left;
40242
+ const screenY = e.clientY - rect.top;
40242
40243
  return {
40243
40244
  screenX,
40244
40245
  screenY,
@@ -40278,8 +40279,8 @@ var init_GraphCanvas = __esm({
40278
40279
  React90.useEffect(() => {
40279
40280
  const canvas = canvasRef.current;
40280
40281
  if (!canvas || propNodes.length === 0) return;
40281
- const w = canvas.width;
40282
- const h = canvas.height;
40282
+ const w = logicalW;
40283
+ const h = height;
40283
40284
  const simNodes = propNodes.map((n, idx) => {
40284
40285
  let x = n.x ?? 0;
40285
40286
  let y = n.y ?? 0;
@@ -40369,29 +40370,41 @@ var init_GraphCanvas = __esm({
40369
40370
  return () => {
40370
40371
  cancelAnimationFrame(animRef.current);
40371
40372
  };
40372
- }, [propNodes, propEdges, layout, repulsion, linkDistance]);
40373
+ }, [propNodes, propEdges, layout, repulsion, linkDistance, logicalW, height]);
40373
40374
  React90.useEffect(() => {
40374
40375
  const canvas = canvasRef.current;
40375
40376
  if (!canvas) return;
40376
40377
  const ctx = canvas.getContext("2d");
40377
40378
  if (!ctx) return;
40378
- const w = canvas.width;
40379
- const h = canvas.height;
40379
+ const w = logicalW;
40380
+ const h = height;
40380
40381
  const nodes = nodesRef.current;
40381
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);
40382
40385
  ctx.clearRect(0, 0, w, h);
40383
40386
  ctx.save();
40384
40387
  ctx.translate(offset.x, offset.y);
40385
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
+ }
40386
40397
  for (const edge of propEdges) {
40387
40398
  const source = nodes.find((n) => n.id === edge.source);
40388
40399
  const target = nodes.find((n) => n.id === edge.target);
40389
40400
  if (!source || !target) continue;
40401
+ const incident = !!hoveredNode && (edge.source === hoveredNode || edge.target === hoveredNode);
40402
+ ctx.globalAlpha = hoveredNode ? incident ? 1 : 0.12 : 1;
40390
40403
  ctx.beginPath();
40391
40404
  ctx.moveTo(source.x, source.y);
40392
40405
  ctx.lineTo(target.x, target.y);
40393
- ctx.strokeStyle = edge.color || "#88888866";
40394
- 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;
40395
40408
  ctx.stroke();
40396
40409
  if (edge.label && showLabels) {
40397
40410
  const mx = (source.x + target.x) / 2;
@@ -40402,11 +40415,13 @@ var init_GraphCanvas = __esm({
40402
40415
  ctx.fillText(edge.label, mx, my - 4);
40403
40416
  }
40404
40417
  }
40418
+ ctx.globalAlpha = 1;
40405
40419
  for (const node of nodes) {
40406
40420
  const size = node.size || 8;
40407
40421
  const color = resolveColor2(node.color || getGroupColor(node.group, groups), canvas);
40408
40422
  const isHovered = hoveredNode === node.id;
40409
40423
  const isSelected = selectedNodeId !== void 0 && node.id === selectedNodeId;
40424
+ ctx.globalAlpha = hoveredNode && !neighbors.has(node.id) ? 0.2 : 1;
40410
40425
  const radius = isSelected ? size + 4 : isHovered ? size + 2 : size;
40411
40426
  ctx.beginPath();
40412
40427
  ctx.arc(node.x, node.y, radius, 0, Math.PI * 2);
@@ -40526,6 +40541,15 @@ var init_GraphCanvas = __esm({
40526
40541
  interactionRef.current.dragNodeId = null;
40527
40542
  setHoveredNode(null);
40528
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
+ );
40529
40553
  if (isLoading) {
40530
40554
  return /* @__PURE__ */ jsxRuntime.jsx(LoadingState, { message: t("common.loading"), className });
40531
40555
  }
@@ -40583,15 +40607,16 @@ var init_GraphCanvas = __esm({
40583
40607
  "canvas",
40584
40608
  {
40585
40609
  ref: canvasRef,
40586
- width: 800,
40587
- height,
40610
+ width: Math.round(logicalW * (typeof window !== "undefined" && window.devicePixelRatio || 1)),
40611
+ height: Math.round(height * (typeof window !== "undefined" && window.devicePixelRatio || 1)),
40588
40612
  className: "w-full cursor-grab active:cursor-grabbing",
40589
40613
  style: { height },
40590
40614
  onWheel: handleWheel,
40591
40615
  onMouseDown: handleMouseDown,
40592
40616
  onMouseMove: handleMouseMove,
40593
40617
  onMouseUp: handleMouseUp,
40594
- onMouseLeave: handleMouseLeave
40618
+ onMouseLeave: handleMouseLeave,
40619
+ onDoubleClick: handleDoubleClick
40595
40620
  }
40596
40621
  ) }),
40597
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: [
@@ -44185,11 +44210,11 @@ var init_Canvas3DErrorBoundary = __esm({
44185
44210
  "components/game/molecules/three/components/Canvas3DErrorBoundary.css"() {
44186
44211
  }
44187
44212
  });
44188
- var log9, Canvas3DErrorBoundary;
44213
+ var log8, Canvas3DErrorBoundary;
44189
44214
  var init_Canvas3DErrorBoundary2 = __esm({
44190
44215
  "components/game/molecules/three/components/Canvas3DErrorBoundary.tsx"() {
44191
44216
  init_Canvas3DErrorBoundary();
44192
- log9 = logger.createLogger("almadar:ui:game:canvas3d:error-boundary");
44217
+ log8 = logger.createLogger("almadar:ui:game:canvas3d:error-boundary");
44193
44218
  Canvas3DErrorBoundary = class extends React90.Component {
44194
44219
  constructor(props) {
44195
44220
  super(props);
@@ -44217,8 +44242,8 @@ var init_Canvas3DErrorBoundary2 = __esm({
44217
44242
  componentDidCatch(error, errorInfo) {
44218
44243
  this.setState({ errorInfo });
44219
44244
  this.props.onError?.(error, errorInfo);
44220
- log9.error("Error caught", { error });
44221
- log9.error("Component stack", { componentStack: errorInfo.componentStack ?? "<none>" });
44245
+ log8.error("Error caught", { error });
44246
+ log8.error("Component stack", { componentStack: errorInfo.componentStack ?? "<none>" });
44222
44247
  }
44223
44248
  render() {
44224
44249
  if (this.state.hasError) {
@@ -44281,7 +44306,7 @@ function useGLTFModel(url, resourceBasePath) {
44281
44306
  setState({ model: null, isLoading: false, error: null });
44282
44307
  return;
44283
44308
  }
44284
- log10.debug("Loading", { url });
44309
+ log9.debug("Loading", { url });
44285
44310
  setState((prev) => ({ ...prev, isLoading: true, error: null }));
44286
44311
  const assetRoot = resourceBasePath || detectAssetRoot2(url);
44287
44312
  const loader = new GLTFLoader.GLTFLoader();
@@ -44289,7 +44314,7 @@ function useGLTFModel(url, resourceBasePath) {
44289
44314
  loader.load(
44290
44315
  url,
44291
44316
  (gltf) => {
44292
- log10.debug("Loaded", { url });
44317
+ log9.debug("Loaded", { url });
44293
44318
  setState({
44294
44319
  model: gltf.scene,
44295
44320
  isLoading: false,
@@ -44298,7 +44323,7 @@ function useGLTFModel(url, resourceBasePath) {
44298
44323
  },
44299
44324
  void 0,
44300
44325
  (err) => {
44301
- log10.warn("Failed", { url, error: err instanceof Error ? err : String(err) });
44326
+ log9.warn("Failed", { url, error: err instanceof Error ? err : String(err) });
44302
44327
  setState({
44303
44328
  model: null,
44304
44329
  isLoading: false,
@@ -44414,11 +44439,11 @@ function ModelLoader({
44414
44439
  }
44415
44440
  );
44416
44441
  }
44417
- var log10;
44442
+ var log9;
44418
44443
  var init_ModelLoader = __esm({
44419
44444
  "components/game/molecules/three/components/ModelLoader.tsx"() {
44420
44445
  "use client";
44421
- log10 = logger.createLogger("almadar:ui:game:model-loader");
44446
+ log9 = logger.createLogger("almadar:ui:game:model-loader");
44422
44447
  }
44423
44448
  });
44424
44449
 
@@ -44679,24 +44704,28 @@ var init_GameCanvas3D2 = __esm({
44679
44704
  const cameraConfig = React90.useMemo(() => {
44680
44705
  const size = Math.max(
44681
44706
  gridBounds.maxX - gridBounds.minX,
44682
- gridBounds.maxZ - gridBounds.minZ
44707
+ gridBounds.maxZ - gridBounds.minZ,
44708
+ 4
44709
+ // minimum framing distance so a tiny board isn't zoomed in
44683
44710
  );
44684
- const distance = size * 1.5;
44711
+ const cx = (gridBounds.minX + gridBounds.maxX) / 2;
44712
+ const cz = (gridBounds.minZ + gridBounds.maxZ) / 2;
44713
+ const d = size * 1.5;
44685
44714
  switch (cameraMode) {
44686
44715
  case "isometric":
44687
44716
  return {
44688
- position: [distance, distance * 0.8, distance],
44717
+ position: [cx + d, d * 0.8, cz + d],
44689
44718
  fov: 45
44690
44719
  };
44691
44720
  case "top-down":
44692
44721
  return {
44693
- position: [0, distance * 2, 0],
44722
+ position: [cx, d * 2, cz],
44694
44723
  fov: 45
44695
44724
  };
44696
44725
  case "perspective":
44697
44726
  default:
44698
44727
  return {
44699
- position: [distance, distance, distance],
44728
+ position: [cx + d, d, cz + d],
44700
44729
  fov: 45
44701
44730
  };
44702
44731
  }
@@ -44935,7 +44964,8 @@ var init_GameCanvas3D2 = __esm({
44935
44964
  "div",
44936
44965
  {
44937
44966
  ref: containerRef,
44938
- className: cn("game-canvas-3d relative w-full h-full min-h-[85vh] overflow-hidden", className),
44967
+ className: cn("game-canvas-3d relative w-full overflow-hidden", className),
44968
+ style: { minHeight: "85vh" },
44939
44969
  "data-orientation": orientation,
44940
44970
  "data-camera-mode": cameraMode,
44941
44971
  "data-overlay": overlay,
@@ -44950,7 +44980,7 @@ var init_GameCanvas3D2 = __esm({
44950
44980
  near: 0.1,
44951
44981
  far: 1e3
44952
44982
  },
44953
- style: { background: backgroundColor },
44983
+ style: { background: backgroundColor, height: "85vh", width: "100%" },
44954
44984
  onClick: (e) => {
44955
44985
  if (e.target === e.currentTarget) {
44956
44986
  eventHandlers.handleCanvasClick(e);
@@ -48752,7 +48782,7 @@ function getAllEvents(traits2) {
48752
48782
  function EventDispatcherTab({ traits: traits2, schema }) {
48753
48783
  const eventBus = useEventBus();
48754
48784
  const { t } = hooks.useTranslate();
48755
- const [log16, setLog] = React90__namespace.useState([]);
48785
+ const [log15, setLog] = React90__namespace.useState([]);
48756
48786
  const prevStatesRef = React90__namespace.useRef(/* @__PURE__ */ new Map());
48757
48787
  React90__namespace.useEffect(() => {
48758
48788
  for (const trait of traits2) {
@@ -48816,9 +48846,9 @@ function EventDispatcherTab({ traits: traits2, schema }) {
48816
48846
  /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-1", children: t("debug.otherEvents") }),
48817
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)) })
48818
48848
  ] }),
48819
- log16.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
48849
+ log15.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
48820
48850
  /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-1", children: t("debug.recentTransitions") }),
48821
- /* @__PURE__ */ jsxRuntime.jsx(Stack, { gap: "xs", children: log16.map((entry, i) => /* @__PURE__ */ jsxRuntime.jsxs(Typography, { variant: "small", className: "font-mono text-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: [
48822
48852
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-purple-400", children: entry.traitName }),
48823
48853
  " ",
48824
48854
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-gray-500", children: entry.from }),
@@ -53833,7 +53863,7 @@ function isPatternConfig(value) {
53833
53863
  if (value instanceof Date) return false;
53834
53864
  if (typeof value === "function") return false;
53835
53865
  const record = value;
53836
- return "type" in record && typeof record.type === "string" && isKnownPattern(record.type);
53866
+ return "type" in record && typeof record.type === "string" && patterns.getComponentForPattern(record.type) !== null;
53837
53867
  }
53838
53868
  function isPlainConfigObject(value) {
53839
53869
  if (React90__namespace.default.isValidElement(value)) return false;
@@ -57745,7 +57775,7 @@ function convertObjectProps(props) {
57745
57775
  function convertFnFormLambdasInProps(props) {
57746
57776
  return convertObjectProps(props);
57747
57777
  }
57748
- var log11 = logger.createLogger("almadar:ui:effects:client-handlers");
57778
+ var log10 = logger.createLogger("almadar:ui:effects:client-handlers");
57749
57779
  function createClientEffectHandlers(options) {
57750
57780
  const { eventBus, slotSetter, navigate, notify, callService, liveEntity } = options;
57751
57781
  return {
@@ -57754,11 +57784,11 @@ function createClientEffectHandlers(options) {
57754
57784
  eventBus.emit(prefixedEvent, payload);
57755
57785
  },
57756
57786
  persist: async () => {
57757
- log11.warn("persist is server-side only, ignored on client");
57787
+ log10.warn("persist is server-side only, ignored on client");
57758
57788
  },
57759
57789
  set: (_entityId, field, value) => {
57760
57790
  if (!liveEntity) {
57761
- log11.warn("set is server-side only, ignored on client (no live entity)");
57791
+ log10.warn("set is server-side only, ignored on client (no live entity)");
57762
57792
  return;
57763
57793
  }
57764
57794
  liveEntity[field] = value;
@@ -57790,10 +57820,10 @@ function createClientEffectHandlers(options) {
57790
57820
  slotSetter.addPattern(slot, pattern, props);
57791
57821
  },
57792
57822
  navigate: navigate ?? ((path) => {
57793
- log11.warn("No navigate handler, ignoring", { path });
57823
+ log10.warn("No navigate handler, ignoring", { path });
57794
57824
  }),
57795
57825
  notify: notify ?? ((msg, type) => {
57796
- log11.debug("notify", { type, message: msg });
57826
+ log10.debug("notify", { type, message: msg });
57797
57827
  })
57798
57828
  };
57799
57829
  }
@@ -58025,7 +58055,7 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
58025
58055
  };
58026
58056
  }, [traitBindings]);
58027
58057
  const executeTransitionEffects = React90.useCallback(async (params) => {
58028
- const { binding, previousState, newState, payload, flushEvent, syncOnly, log: log16 } = params;
58058
+ const { binding, previousState, newState, payload, flushEvent, syncOnly, log: log15 } = params;
58029
58059
  const traitName = binding.trait.name;
58030
58060
  const linkedEntity = binding.linkedEntity || "";
58031
58061
  const entityId = payload?.entityId;
@@ -58113,7 +58143,7 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
58113
58143
  ...handlers,
58114
58144
  set: async (targetId, field, value) => {
58115
58145
  if (baseSet) await baseSet(targetId, field, value);
58116
- log16.debug("set:write", {
58146
+ log15.debug("set:write", {
58117
58147
  traitName,
58118
58148
  field,
58119
58149
  value: JSON.stringify(value),
@@ -58153,7 +58183,7 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
58153
58183
  const executor = new runtime.EffectExecutor({ handlers: trackingHandlers, bindings: bindingCtx, context: effectContext });
58154
58184
  try {
58155
58185
  await executor.executeAll(effects);
58156
- log16.debug("effects:executed", () => ({
58186
+ log15.debug("effects:executed", () => ({
58157
58187
  traitName,
58158
58188
  transition: `${previousState}->${newState}`,
58159
58189
  event: flushEvent,
@@ -58163,7 +58193,7 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
58163
58193
  slotsTouched: Array.from(pendingSlots.keys()).join(",")
58164
58194
  }));
58165
58195
  for (const [slot, patterns] of pendingSlots) {
58166
- log16.debug("flush:slot", {
58196
+ log15.debug("flush:slot", {
58167
58197
  traitName,
58168
58198
  slot,
58169
58199
  patternCount: patterns.length,
@@ -58178,7 +58208,7 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
58178
58208
  });
58179
58209
  }
58180
58210
  } catch (error) {
58181
- log16.error("effects:error", {
58211
+ log15.error("effects:error", {
58182
58212
  traitName,
58183
58213
  transition: `${previousState}->${newState}`,
58184
58214
  event: flushEvent,
@@ -59173,7 +59203,7 @@ OrbitalThemeProvider.displayName = "OrbitalThemeProvider";
59173
59203
  init_navigation();
59174
59204
  init_verificationRegistry();
59175
59205
  var PERF_NAMESPACE = "almadar:perf:canvas";
59176
- var log13 = logger.createLogger(PERF_NAMESPACE);
59206
+ var log12 = logger.createLogger(PERF_NAMESPACE);
59177
59207
  var RING_SIZE = 50;
59178
59208
  var ring = [];
59179
59209
  var writeIdx = 0;
@@ -59224,7 +59254,7 @@ function perfEnd(name, startToken, detail) {
59224
59254
  }
59225
59255
  }
59226
59256
  push({ name, durationMs, ts: endTs, detail });
59227
- log13.debug(name, () => ({ durationMs, ...detail ?? {} }));
59257
+ log12.debug(name, () => ({ durationMs, ...detail ?? {} }));
59228
59258
  }
59229
59259
  var profilerOnRender = (id, phase, actualDuration, baseDuration, _startTime, commitTime) => {
59230
59260
  if (!isEnabled()) return;
@@ -59234,7 +59264,7 @@ var profilerOnRender = (id, phase, actualDuration, baseDuration, _startTime, com
59234
59264
  ts: commitTime,
59235
59265
  detail: { baseDuration }
59236
59266
  });
59237
- log13.debug(`profiler:${id}:${phase}`, () => ({ actualDuration, baseDuration }));
59267
+ log12.debug(`profiler:${id}:${phase}`, () => ({ actualDuration, baseDuration }));
59238
59268
  };
59239
59269
 
59240
59270
  // runtime/prepareSchemaForPreview.ts
@@ -59877,7 +59907,7 @@ init_useEventBus();
59877
59907
  // components/avl/molecules/useCanvasDnd.tsx
59878
59908
  init_useEventBus();
59879
59909
  init_useAlmadarDndCollision();
59880
- var log14 = logger.createLogger("almadar:ui:canvas-dnd");
59910
+ var log13 = logger.createLogger("almadar:ui:canvas-dnd");
59881
59911
  function useCanvasDraggable({
59882
59912
  id,
59883
59913
  payload,
@@ -59916,7 +59946,7 @@ function defaultEmit(eventBus, drop) {
59916
59946
  if (payload.kind === "pattern") {
59917
59947
  const patternType = payload.data.type;
59918
59948
  if (typeof patternType !== "string") {
59919
- log14.warn("default-emit:pattern:missing-type");
59949
+ log13.warn("default-emit:pattern:missing-type");
59920
59950
  return;
59921
59951
  }
59922
59952
  const out = { patternType, containerNode: target.containerNode };
@@ -59925,23 +59955,23 @@ function defaultEmit(eventBus, drop) {
59925
59955
  out.index = resolved.index;
59926
59956
  }
59927
59957
  eventBus.emit("UI:PATTERN_DROP", out);
59928
- log14.info("default-emit:pattern", { patternType, level: target.level });
59958
+ log13.info("default-emit:pattern", { patternType, level: target.level });
59929
59959
  return;
59930
59960
  }
59931
59961
  if (payload.kind === "behavior") {
59932
59962
  const behaviorName = payload.data.name;
59933
59963
  if (typeof behaviorName !== "string") {
59934
- log14.warn("default-emit:behavior:missing-name");
59964
+ log13.warn("default-emit:behavior:missing-name");
59935
59965
  return;
59936
59966
  }
59937
59967
  eventBus.emit("UI:BEHAVIOR_DROP", {
59938
59968
  behaviorName,
59939
59969
  containerNode: target.containerNode
59940
59970
  });
59941
- log14.info("default-emit:behavior", { behaviorName, level: target.level });
59971
+ log13.info("default-emit:behavior", { behaviorName, level: target.level });
59942
59972
  return;
59943
59973
  }
59944
- log14.debug("default-emit:unhandled-kind", { kind: payload.kind });
59974
+ log13.debug("default-emit:unhandled-kind", { kind: payload.kind });
59945
59975
  }
59946
59976
  function CanvasDndProvider({
59947
59977
  children,
@@ -59957,9 +59987,9 @@ function CanvasDndProvider({
59957
59987
  if (payload) {
59958
59988
  setActivePayload(payload);
59959
59989
  eventBus.emit("UI:DRAG_START", { kind: payload.kind, data: payload.data });
59960
- log14.info("dragStart", { id: e.active.id, kind: payload.kind });
59990
+ log13.info("dragStart", { id: e.active.id, kind: payload.kind });
59961
59991
  } else {
59962
- log14.warn("dragStart:missing-payload", { id: e.active.id });
59992
+ log13.warn("dragStart:missing-payload", { id: e.active.id });
59963
59993
  }
59964
59994
  }, [eventBus]);
59965
59995
  const handleDragEnd = React90__namespace.default.useCallback((e) => {
@@ -59969,7 +59999,7 @@ function CanvasDndProvider({
59969
59999
  const overData = e.over?.data.current;
59970
60000
  const target = overData?.target;
59971
60001
  const accepts = overData?.accepts;
59972
- log14.info("dragEnd", {
60002
+ log13.info("dragEnd", {
59973
60003
  activeId: e.active.id,
59974
60004
  overId: e.over?.id,
59975
60005
  hasPayload: !!payload,
@@ -59981,7 +60011,7 @@ function CanvasDndProvider({
59981
60011
  }
59982
60012
  if (!payload || !target) return;
59983
60013
  if (accepts && !accepts.includes(payload.kind)) {
59984
- log14.debug("dragEnd:rejected:kind", { kind: payload.kind, accepts: [...accepts] });
60014
+ log13.debug("dragEnd:rejected:kind", { kind: payload.kind, accepts: [...accepts] });
59985
60015
  return;
59986
60016
  }
59987
60017
  const activator = e.activatorEvent;
@@ -59993,7 +60023,7 @@ function CanvasDndProvider({
59993
60023
  }, [eventBus, onDrop]);
59994
60024
  const handleDragCancel = React90__namespace.default.useCallback(() => {
59995
60025
  setActivePayload(null);
59996
- log14.info("dragCancel");
60026
+ log13.info("dragCancel");
59997
60027
  }, []);
59998
60028
  return /* @__PURE__ */ jsxRuntime.jsxs(
59999
60029
  core$1.DndContext,
@@ -61808,7 +61838,7 @@ init_AvlTransitionLane();
61808
61838
  init_AvlSwimLane();
61809
61839
  init_types();
61810
61840
  init_avl_elk_layout();
61811
- var log15 = logger.createLogger("almadar:ui:avl:trait-scene");
61841
+ var log14 = logger.createLogger("almadar:ui:avl:trait-scene");
61812
61842
  var SWIM_GUTTER2 = 120;
61813
61843
  var CENTER_W2 = 360;
61814
61844
  var AvlTraitScene = ({
@@ -61821,7 +61851,7 @@ var AvlTraitScene = ({
61821
61851
  const dataKey = React90.useMemo(() => JSON.stringify(data), [data]);
61822
61852
  React90.useEffect(() => {
61823
61853
  computeTraitLayout(data).then(setLayout).catch((error) => {
61824
- log15.error("computeTraitLayout failed", { error: error instanceof Error ? error : String(error) });
61854
+ log14.error("computeTraitLayout failed", { error: error instanceof Error ? error : String(error) });
61825
61855
  });
61826
61856
  }, [dataKey]);
61827
61857
  if (!layout) {