@almadar/ui 5.54.0 → 5.55.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.
@@ -8421,6 +8421,16 @@ var init_Skeleton = __esm({
8421
8421
  Skeleton.displayName = "Skeleton";
8422
8422
  }
8423
8423
  });
8424
+ function isKnownPattern(type) {
8425
+ return type in componentMapping;
8426
+ }
8427
+ var componentMapping;
8428
+ var init_pattern_resolver = __esm({
8429
+ "renderer/pattern-resolver.ts"() {
8430
+ createLogger("almadar:ui:pattern-resolver");
8431
+ componentMapping = {};
8432
+ }
8433
+ });
8424
8434
 
8425
8435
  // renderer/slot-definitions.ts
8426
8436
  function isPortalSlot(slot) {
@@ -8529,6 +8539,7 @@ var init_navigation = __esm({
8529
8539
  // renderer/index.ts
8530
8540
  var init_renderer = __esm({
8531
8541
  "renderer/index.ts"() {
8542
+ init_pattern_resolver();
8532
8543
  init_slot_definitions();
8533
8544
  }
8534
8545
  });
@@ -10232,7 +10243,7 @@ function recordTransition(trace) {
10232
10243
  ...trace,
10233
10244
  id: `t-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`
10234
10245
  };
10235
- log4.debug("transition:recorded", { trait: trace.traitName, from: trace.from, to: trace.to, event: trace.event, effectCount: trace.effects.length });
10246
+ log5.debug("transition:recorded", { trait: trace.traitName, from: trace.from, to: trace.to, event: trace.event, effectCount: trace.effects.length });
10236
10247
  getState().transitions.push(entry);
10237
10248
  if (getState().transitions.length > MAX_TRANSITIONS) {
10238
10249
  getState().transitions.shift();
@@ -10331,7 +10342,7 @@ function getTraitSnapshots() {
10331
10342
  try {
10332
10343
  snapshots.push(getter());
10333
10344
  } catch (err) {
10334
- log4.error("traitSnapshot getter failed", { trait: traitName, err: String(err) });
10345
+ log5.error("traitSnapshot getter failed", { trait: traitName, err: String(err) });
10335
10346
  }
10336
10347
  }
10337
10348
  return snapshots;
@@ -10430,10 +10441,10 @@ function updateAssetStatus(url, status) {
10430
10441
  window.__orbitalVerification.assetStatus[url] = status;
10431
10442
  }
10432
10443
  }
10433
- var log4, MAX_TRANSITIONS;
10444
+ var log5, MAX_TRANSITIONS;
10434
10445
  var init_verificationRegistry = __esm({
10435
10446
  "lib/verificationRegistry.ts"() {
10436
- log4 = createLogger("almadar:bridge");
10447
+ log5 = createLogger("almadar:bridge");
10437
10448
  MAX_TRANSITIONS = 500;
10438
10449
  exposeOnWindow();
10439
10450
  }
@@ -12727,7 +12738,7 @@ var init_avl_elk_layout = __esm({
12727
12738
  elk = new ELK();
12728
12739
  }
12729
12740
  });
12730
- var log5, SWIM_GUTTER, CENTER_W, BehaviorView;
12741
+ var log6, SWIM_GUTTER, CENTER_W, BehaviorView;
12731
12742
  var init_BehaviorView = __esm({
12732
12743
  "components/avl/molecules/BehaviorView.tsx"() {
12733
12744
  "use client";
@@ -12736,7 +12747,7 @@ var init_BehaviorView = __esm({
12736
12747
  init_AvlSwimLane();
12737
12748
  init_types();
12738
12749
  init_avl_elk_layout();
12739
- log5 = createLogger("almadar:ui:avl:behavior-view");
12750
+ log6 = createLogger("almadar:ui:avl:behavior-view");
12740
12751
  SWIM_GUTTER = 120;
12741
12752
  CENTER_W = 360;
12742
12753
  BehaviorView = ({ data }) => {
@@ -12747,7 +12758,7 @@ var init_BehaviorView = __esm({
12747
12758
  const dataKey = useMemo(() => JSON.stringify(traitData), [traitData]);
12748
12759
  useEffect(() => {
12749
12760
  if (!traitData) return;
12750
- computeTraitLayout(traitData).then(setLayout).catch((err) => log5.error("compute-trait-layout-failed", { error: err instanceof Error ? err : String(err) }));
12761
+ computeTraitLayout(traitData).then(setLayout).catch((err) => log6.error("compute-trait-layout-failed", { error: err instanceof Error ? err : String(err) }));
12751
12762
  }, [dataKey]);
12752
12763
  if (!traitData) {
12753
12764
  return /* @__PURE__ */ 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") });
@@ -13158,7 +13169,7 @@ function generateDiff(oldVal, newVal) {
13158
13169
  }
13159
13170
  return diff;
13160
13171
  }
13161
- var orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log6, CODE_LANGUAGES, CODE_LANGUAGE_SET, DIFF_STYLES, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS, CodeBlock;
13172
+ var orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log7, CODE_LANGUAGES, CODE_LANGUAGE_SET, DIFF_STYLES, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS, CodeBlock;
13162
13173
  var init_CodeBlock = __esm({
13163
13174
  "components/core/molecules/markdown/CodeBlock.tsx"() {
13164
13175
  init_cn();
@@ -13241,7 +13252,7 @@ var init_CodeBlock = __esm({
13241
13252
  "lolo-op-async": { color: ORB_COLORS.dark.async }
13242
13253
  };
13243
13254
  loloStyle = { ...dark, ...loloStyleOverrides };
13244
- log6 = createLogger("almadar:ui:markdown-code");
13255
+ log7 = createLogger("almadar:ui:markdown-code");
13245
13256
  CODE_LANGUAGES = [
13246
13257
  "text",
13247
13258
  "json",
@@ -13505,7 +13516,7 @@ var init_CodeBlock = __esm({
13505
13516
  eventBus.emit("UI:COPY_CODE", { language: activeLanguage, success: true });
13506
13517
  setTimeout(() => setCopied(false), 2e3);
13507
13518
  } catch (err) {
13508
- log6.error("Failed to copy code", { error: err instanceof Error ? err : String(err) });
13519
+ log7.error("Failed to copy code", { error: err instanceof Error ? err : String(err) });
13509
13520
  eventBus.emit("UI:COPY_CODE", { language: activeLanguage, success: false });
13510
13521
  }
13511
13522
  };
@@ -17386,14 +17397,14 @@ function useSafeEventBus2() {
17386
17397
  } };
17387
17398
  }
17388
17399
  }
17389
- var log7, lookStyles4, ButtonGroup;
17400
+ var log8, lookStyles4, ButtonGroup;
17390
17401
  var init_ButtonGroup = __esm({
17391
17402
  "components/core/molecules/ButtonGroup.tsx"() {
17392
17403
  "use client";
17393
17404
  init_cn();
17394
17405
  init_atoms2();
17395
17406
  init_useEventBus();
17396
- log7 = createLogger("almadar:ui:button-group");
17407
+ log8 = createLogger("almadar:ui:button-group");
17397
17408
  lookStyles4 = {
17398
17409
  "right-aligned-buttons": "",
17399
17410
  "floating-bar": "fixed bottom-section left-1/2 -translate-x-1/2 shadow-elevation-toast bg-card p-card-sm rounded-container",
@@ -17474,7 +17485,7 @@ var init_ButtonGroup = __esm({
17474
17485
  {
17475
17486
  variant: "ghost",
17476
17487
  onClick: () => {
17477
- log7.debug("Filter clicked", { field: filter.field });
17488
+ log8.debug("Filter clicked", { field: filter.field });
17478
17489
  },
17479
17490
  children: filter.label
17480
17491
  },
@@ -25136,9 +25147,9 @@ function debug(...args) {
25136
25147
  const [first, ...rest] = args;
25137
25148
  const message = typeof first === "string" ? first : "<debug>";
25138
25149
  if (rest.length === 0 && typeof first === "string") {
25139
- log8.debug(message);
25150
+ log9.debug(message);
25140
25151
  } else {
25141
- log8.debug(message, { args: rest.length > 0 ? formatArgs(rest) : formatArgs([first]) });
25152
+ log9.debug(message, { args: rest.length > 0 ? formatArgs(rest) : formatArgs([first]) });
25142
25153
  }
25143
25154
  }
25144
25155
  function debugGroup(label) {
@@ -25166,11 +25177,11 @@ function toLogMetaValue(v) {
25166
25177
  }
25167
25178
  return String(v);
25168
25179
  }
25169
- var NAMESPACE, log8;
25180
+ var NAMESPACE, log9;
25170
25181
  var init_debug = __esm({
25171
25182
  "lib/debug.ts"() {
25172
25183
  NAMESPACE = "almadar:ui:debug";
25173
- log8 = createLogger(NAMESPACE);
25184
+ log9 = createLogger(NAMESPACE);
25174
25185
  createLogger("almadar:ui:debug:input");
25175
25186
  createLogger("almadar:ui:debug:collision");
25176
25187
  createLogger("almadar:ui:debug:physics");
@@ -41461,11 +41472,11 @@ var init_Canvas3DErrorBoundary = __esm({
41461
41472
  "components/game/molecules/three/components/Canvas3DErrorBoundary.css"() {
41462
41473
  }
41463
41474
  });
41464
- var log9, Canvas3DErrorBoundary;
41475
+ var log10, Canvas3DErrorBoundary;
41465
41476
  var init_Canvas3DErrorBoundary2 = __esm({
41466
41477
  "components/game/molecules/three/components/Canvas3DErrorBoundary.tsx"() {
41467
41478
  init_Canvas3DErrorBoundary();
41468
- log9 = createLogger("almadar:ui:game:canvas3d:error-boundary");
41479
+ log10 = createLogger("almadar:ui:game:canvas3d:error-boundary");
41469
41480
  Canvas3DErrorBoundary = class extends Component {
41470
41481
  constructor(props) {
41471
41482
  super(props);
@@ -41493,8 +41504,8 @@ var init_Canvas3DErrorBoundary2 = __esm({
41493
41504
  componentDidCatch(error, errorInfo) {
41494
41505
  this.setState({ errorInfo });
41495
41506
  this.props.onError?.(error, errorInfo);
41496
- log9.error("Error caught", { error });
41497
- log9.error("Component stack", { componentStack: errorInfo.componentStack ?? "<none>" });
41507
+ log10.error("Error caught", { error });
41508
+ log10.error("Component stack", { componentStack: errorInfo.componentStack ?? "<none>" });
41498
41509
  }
41499
41510
  render() {
41500
41511
  if (this.state.hasError) {
@@ -41557,7 +41568,7 @@ function useGLTFModel(url, resourceBasePath) {
41557
41568
  setState({ model: null, isLoading: false, error: null });
41558
41569
  return;
41559
41570
  }
41560
- log10.debug("Loading", { url });
41571
+ log11.debug("Loading", { url });
41561
41572
  setState((prev) => ({ ...prev, isLoading: true, error: null }));
41562
41573
  const assetRoot = resourceBasePath || detectAssetRoot2(url);
41563
41574
  const loader = new GLTFLoader$1();
@@ -41565,7 +41576,7 @@ function useGLTFModel(url, resourceBasePath) {
41565
41576
  loader.load(
41566
41577
  url,
41567
41578
  (gltf) => {
41568
- log10.debug("Loaded", { url });
41579
+ log11.debug("Loaded", { url });
41569
41580
  setState({
41570
41581
  model: gltf.scene,
41571
41582
  isLoading: false,
@@ -41574,7 +41585,7 @@ function useGLTFModel(url, resourceBasePath) {
41574
41585
  },
41575
41586
  void 0,
41576
41587
  (err) => {
41577
- log10.warn("Failed", { url, error: err instanceof Error ? err : String(err) });
41588
+ log11.warn("Failed", { url, error: err instanceof Error ? err : String(err) });
41578
41589
  setState({
41579
41590
  model: null,
41580
41591
  isLoading: false,
@@ -41690,11 +41701,11 @@ function ModelLoader({
41690
41701
  }
41691
41702
  );
41692
41703
  }
41693
- var log10;
41704
+ var log11;
41694
41705
  var init_ModelLoader = __esm({
41695
41706
  "components/game/molecules/three/components/ModelLoader.tsx"() {
41696
41707
  "use client";
41697
- log10 = createLogger("almadar:ui:game:model-loader");
41708
+ log11 = createLogger("almadar:ui:game:model-loader");
41698
41709
  }
41699
41710
  });
41700
41711
 
@@ -45999,7 +46010,7 @@ function getAllEvents(traits2) {
45999
46010
  function EventDispatcherTab({ traits: traits2, schema }) {
46000
46011
  const eventBus = useEventBus();
46001
46012
  const { t } = useTranslate();
46002
- const [log14, setLog] = React81.useState([]);
46013
+ const [log15, setLog] = React81.useState([]);
46003
46014
  const prevStatesRef = React81.useRef(/* @__PURE__ */ new Map());
46004
46015
  React81.useEffect(() => {
46005
46016
  for (const trait of traits2) {
@@ -46063,9 +46074,9 @@ function EventDispatcherTab({ traits: traits2, schema }) {
46063
46074
  /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-1", children: t("debug.otherEvents") }),
46064
46075
  /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1", children: unavailableEvents.map((event) => /* @__PURE__ */ jsx(Badge, { variant: "default", size: "sm", className: "opacity-50", children: event }, event)) })
46065
46076
  ] }),
46066
- log14.length > 0 && /* @__PURE__ */ jsxs("div", { children: [
46077
+ log15.length > 0 && /* @__PURE__ */ jsxs("div", { children: [
46067
46078
  /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-1", children: t("debug.recentTransitions") }),
46068
- /* @__PURE__ */ jsx(Stack, { gap: "xs", children: log14.map((entry, i) => /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "font-mono text-xs", children: [
46079
+ /* @__PURE__ */ jsx(Stack, { gap: "xs", children: log15.map((entry, i) => /* @__PURE__ */ jsxs(Typography, { variant: "small", className: "font-mono text-xs", children: [
46069
46080
  /* @__PURE__ */ jsx("span", { className: "text-purple-400", children: entry.traitName }),
46070
46081
  " ",
46071
46082
  /* @__PURE__ */ jsx("span", { className: "text-gray-500", children: entry.from }),
@@ -50930,7 +50941,7 @@ function isPatternConfig(value) {
50930
50941
  if (value instanceof Date) return false;
50931
50942
  if (typeof value === "function") return false;
50932
50943
  const record = value;
50933
- return "type" in record && typeof record.type === "string";
50944
+ return "type" in record && typeof record.type === "string" && isKnownPattern(record.type);
50934
50945
  }
50935
50946
  function isPlainConfigObject(value) {
50936
50947
  if (React81__default.isValidElement(value)) return false;
@@ -51677,7 +51688,7 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
51677
51688
  };
51678
51689
  }, [traitBindings]);
51679
51690
  const executeTransitionEffects = useCallback(async (params) => {
51680
- const { binding, previousState, newState, payload, flushEvent, syncOnly, log: log14 } = params;
51691
+ const { binding, previousState, newState, payload, flushEvent, syncOnly, log: log15 } = params;
51681
51692
  const traitName = binding.trait.name;
51682
51693
  const linkedEntity = binding.linkedEntity || "";
51683
51694
  const entityId = payload?.entityId;
@@ -51765,7 +51776,7 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
51765
51776
  ...handlers,
51766
51777
  set: async (targetId, field, value) => {
51767
51778
  if (baseSet) await baseSet(targetId, field, value);
51768
- log14.debug("set:write", {
51779
+ log15.debug("set:write", {
51769
51780
  traitName,
51770
51781
  field,
51771
51782
  value: JSON.stringify(value),
@@ -51805,7 +51816,7 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
51805
51816
  const executor = new EffectExecutor({ handlers: trackingHandlers, bindings: bindingCtx, context: effectContext });
51806
51817
  try {
51807
51818
  await executor.executeAll(effects);
51808
- log14.debug("effects:executed", () => ({
51819
+ log15.debug("effects:executed", () => ({
51809
51820
  traitName,
51810
51821
  transition: `${previousState}->${newState}`,
51811
51822
  event: flushEvent,
@@ -51815,7 +51826,7 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
51815
51826
  slotsTouched: Array.from(pendingSlots.keys()).join(",")
51816
51827
  }));
51817
51828
  for (const [slot, patterns] of pendingSlots) {
51818
- log14.debug("flush:slot", {
51829
+ log15.debug("flush:slot", {
51819
51830
  traitName,
51820
51831
  slot,
51821
51832
  patternCount: patterns.length,
@@ -51830,7 +51841,7 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
51830
51841
  });
51831
51842
  }
51832
51843
  } catch (error) {
51833
- log14.error("effects:error", {
51844
+ log15.error("effects:error", {
51834
51845
  traitName,
51835
51846
  transition: `${previousState}->${newState}`,
51836
51847
  event: flushEvent,
@@ -52302,7 +52313,7 @@ function clearSchemaCache() {
52302
52313
 
52303
52314
  // runtime/index.ts
52304
52315
  init_EntitySchemaContext();
52305
- var log11 = createLogger("almadar:ui:trait-provider");
52316
+ var log12 = createLogger("almadar:ui:trait-provider");
52306
52317
  var TraitContext = createContext(null);
52307
52318
  function TraitProvider({
52308
52319
  traits: traitBindings,
@@ -52319,7 +52330,7 @@ function TraitProvider({
52319
52330
  currentState: stateName,
52320
52331
  availableEvents: trait.transitions.filter((t) => t.from === stateName).map((t) => t.event),
52321
52332
  dispatch: (eventKey, payload) => {
52322
- log11.debug("Dispatch", () => ({
52333
+ log12.debug("Dispatch", () => ({
52323
52334
  trait: trait.name,
52324
52335
  event: eventKey,
52325
52336
  payloadKeys: payload ? Object.keys(payload) : []
@@ -53069,7 +53080,7 @@ OrbitalThemeProvider.displayName = "OrbitalThemeProvider";
53069
53080
  init_navigation();
53070
53081
  init_verificationRegistry();
53071
53082
  var PERF_NAMESPACE = "almadar:perf:canvas";
53072
- var log13 = createLogger(PERF_NAMESPACE);
53083
+ var log14 = createLogger(PERF_NAMESPACE);
53073
53084
  var RING_SIZE = 50;
53074
53085
  var ring = [];
53075
53086
  var writeIdx = 0;
@@ -53124,7 +53135,7 @@ function perfEnd(name, startToken, detail) {
53124
53135
  }
53125
53136
  }
53126
53137
  push({ name, durationMs, ts: endTs, detail });
53127
- log13.debug(name, () => ({ durationMs, ...detail ?? {} }));
53138
+ log14.debug(name, () => ({ durationMs, ...detail ?? {} }));
53128
53139
  }
53129
53140
  function perfTime(name, fn, detail) {
53130
53141
  const t = perfStart(name);
@@ -53142,7 +53153,7 @@ var profilerOnRender = (id, phase, actualDuration, baseDuration, _startTime, com
53142
53153
  ts: commitTime,
53143
53154
  detail: { baseDuration }
53144
53155
  });
53145
- log13.debug(`profiler:${id}:${phase}`, () => ({ actualDuration, baseDuration }));
53156
+ log14.debug(`profiler:${id}:${phase}`, () => ({ actualDuration, baseDuration }));
53146
53157
  };
53147
53158
  function getPerfSnapshot() {
53148
53159
  if (ring.length < RING_SIZE) return ring.slice();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almadar/ui",
3
- "version": "5.54.0",
3
+ "version": "5.55.0",
4
4
  "description": "React UI components, hooks, and providers for Almadar",
5
5
  "type": "module",
6
6
  "sideEffects": [