@almadar/ui 5.150.0 → 5.152.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.
@@ -1,8 +1,8 @@
1
- export { U as UISlotContext, a as UISlotProvider, u as useSlotContent, b as useSlotHasContent, c as useUISlots } from '../UISlotContext-D8_SoDsD.cjs';
1
+ export { U as UISlotContext, a as UISlotProvider, u as useSlotContent, b as useSlotHasContent, c as useUISlots } from '../UISlotContext-BlRDbHDy.cjs';
2
2
  export { B as BUILT_IN_THEMES, C as ColorMode, a as CurrentPagePathContext, b as CurrentPagePathProvider, c as CurrentPagePathProviderProps, D as DesignTheme, d as DesignThemeProvider, O as OrbitalThemeProvider, e as OrbitalThemeProviderProps, R as ResolvedMode, T as ThemeContext, f as ThemeProvider, g as ThemeProviderProps, U as UIThemeDefinition, h as UserContext, i as UserContextValue, j as UserData, k as UserProvider, l as UserProviderProps, u as useCurrentPagePath, m as useDesignTheme, n as useHasPermission, o as useHasRole, p as useTheme, q as useUser, r as useUserForEvaluation } from '../UserContext-g_LcDiGN.cjs';
3
3
  import { ThemeRef, ThemeDefinition, ThemeTokens, ThemeVariant } from '@almadar/core';
4
4
  export { ANONYMOUS_USER, UISlot } from '@almadar/core';
5
- export { S as SlotAnimation, a as SlotChangeCallback, b as SlotContent, c as SlotRenderConfig, U as UISlotManager } from '../useUISlots-BesZYMks.cjs';
5
+ export { S as SlotAnimation, a as SlotChangeCallback, b as SlotContent, c as SlotRenderConfig, U as UISlotManager } from '../useUISlots-GNwGLlW2.cjs';
6
6
  import 'react';
7
7
 
8
8
  /**
@@ -1,8 +1,8 @@
1
- export { U as UISlotContext, a as UISlotProvider, u as useSlotContent, b as useSlotHasContent, c as useUISlots } from '../UISlotContext-C1FsU9GB.js';
1
+ export { U as UISlotContext, a as UISlotProvider, u as useSlotContent, b as useSlotHasContent, c as useUISlots } from '../UISlotContext-CB89mv7N.js';
2
2
  export { B as BUILT_IN_THEMES, C as ColorMode, a as CurrentPagePathContext, b as CurrentPagePathProvider, c as CurrentPagePathProviderProps, D as DesignTheme, d as DesignThemeProvider, O as OrbitalThemeProvider, e as OrbitalThemeProviderProps, R as ResolvedMode, T as ThemeContext, f as ThemeProvider, g as ThemeProviderProps, U as UIThemeDefinition, h as UserContext, i as UserContextValue, j as UserData, k as UserProvider, l as UserProviderProps, u as useCurrentPagePath, m as useDesignTheme, n as useHasPermission, o as useHasRole, p as useTheme, q as useUser, r as useUserForEvaluation } from '../UserContext-g_LcDiGN.js';
3
3
  import { ThemeRef, ThemeDefinition, ThemeTokens, ThemeVariant } from '@almadar/core';
4
4
  export { ANONYMOUS_USER, UISlot } from '@almadar/core';
5
- export { S as SlotAnimation, a as SlotChangeCallback, b as SlotContent, c as SlotRenderConfig, U as UISlotManager } from '../useUISlots-BesZYMks.js';
5
+ export { S as SlotAnimation, a as SlotChangeCallback, b as SlotContent, c as SlotRenderConfig, U as UISlotManager } from '../useUISlots-GNwGLlW2.js';
6
6
  import 'react';
7
7
 
8
8
  /**
@@ -3,7 +3,7 @@ export { BusEvent, BusEventListener, BusEventSource, BusEventListener as EventLi
3
3
  import { a as useEventBus } from '../useEventBus-Ckr4wqW3.cjs';
4
4
  export { u as useEmitEvent, b as useEventListener } from '../useEventBus-Ckr4wqW3.cjs';
5
5
  export { E as EventBusContextType } from '../event-bus-types-Bl78kokd.cjs';
6
- export { D as DEFAULT_SLOTS, S as SlotAnimation, a as SlotChangeCallback, b as SlotContent, c as SlotRenderConfig, U as UISlotManager, u as useUISlotManager } from '../useUISlots-BesZYMks.cjs';
6
+ export { D as DEFAULT_SLOTS, S as SlotAnimation, a as SlotChangeCallback, b as SlotContent, c as SlotRenderConfig, U as UISlotManager, u as useUISlotManager } from '../useUISlots-GNwGLlW2.cjs';
7
7
  import * as React$1 from 'react';
8
8
  import React__default from 'react';
9
9
  import * as _tanstack_react_query from '@tanstack/react-query';
@@ -3,7 +3,7 @@ export { BusEvent, BusEventListener, BusEventSource, BusEventListener as EventLi
3
3
  import { a as useEventBus } from '../useEventBus-CQWyAWpK.js';
4
4
  export { u as useEmitEvent, b as useEventListener } from '../useEventBus-CQWyAWpK.js';
5
5
  export { E as EventBusContextType } from '../event-bus-types-Bl78kokd.js';
6
- export { D as DEFAULT_SLOTS, S as SlotAnimation, a as SlotChangeCallback, b as SlotContent, c as SlotRenderConfig, U as UISlotManager, u as useUISlotManager } from '../useUISlots-BesZYMks.js';
6
+ export { D as DEFAULT_SLOTS, S as SlotAnimation, a as SlotChangeCallback, b as SlotContent, c as SlotRenderConfig, U as UISlotManager, u as useUISlotManager } from '../useUISlots-GNwGLlW2.js';
7
7
  import * as React$1 from 'react';
8
8
  import React__default from 'react';
9
9
  import * as _tanstack_react_query from '@tanstack/react-query';
@@ -3,6 +3,7 @@
3
3
  var clsx = require('clsx');
4
4
  var tailwindMerge = require('tailwind-merge');
5
5
  var logger = require('@almadar/logger');
6
+ var core = require('@almadar/core');
6
7
 
7
8
  var __defProp = Object.defineProperty;
8
9
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
@@ -866,8 +867,6 @@ function sortRows(rows, field, direction = "asc") {
866
867
  const dir = direction === "desc" ? -1 : 1;
867
868
  return [...rows].sort((a, b) => dir * compareCellValues(a?.[field], b?.[field]));
868
869
  }
869
-
870
- // lib/getNestedValue.ts
871
870
  function getNestedValue(obj, path) {
872
871
  if (obj === null || obj === void 0 || !path) {
873
872
  return void 0;
@@ -888,6 +887,15 @@ function getNestedValue(obj, path) {
888
887
  }
889
888
  return value;
890
889
  }
890
+ function resolveImageUrl(value) {
891
+ if (typeof value === "string") {
892
+ return value;
893
+ }
894
+ if (core.isFileValue(value)) {
895
+ return value.url;
896
+ }
897
+ return void 0;
898
+ }
891
899
  function formatNestedFieldLabel(path) {
892
900
  const lastPart = path.includes(".") ? path.split(".").pop() : path;
893
901
  return lastPart.replace(/([A-Z])/g, " $1").replace(/^./, (str) => str.toUpperCase()).replace(/Id$/, "").trim();
@@ -2116,6 +2124,7 @@ exports.registerTrait = registerTrait;
2116
2124
  exports.registerTraitSnapshot = registerTraitSnapshot;
2117
2125
  exports.renderStateMachineToDomData = renderStateMachineToDomData;
2118
2126
  exports.renderStateMachineToSvg = renderStateMachineToSvg;
2127
+ exports.resolveImageUrl = resolveImageUrl;
2119
2128
  exports.setDebugEnabled = setDebugEnabled;
2120
2129
  exports.setEntityProvider = setEntityProvider;
2121
2130
  exports.setTickActive = setTickActive;
@@ -354,6 +354,13 @@ declare function sortRows<T extends Record<string, FieldValue | undefined>>(rows
354
354
  * getNestedValue(data, "company.missing"); // => undefined
355
355
  */
356
356
  declare function getNestedValue(obj: EventPayload | Record<string, FieldValue | undefined> | null | undefined, path: string): FieldValue | undefined;
357
+ /**
358
+ * Resolve a field value that may be a raw URL string (legacy `image`/`url` fields) or a
359
+ * structured `file`-typed {@link FileValue} into the URL an `<img src>` can use. Gallery/card
360
+ * grid image tiles only ever rendered the raw-string case before the file-type promotion —
361
+ * this keeps them working once a field is retyped to `file`.
362
+ */
363
+ declare function resolveImageUrl(value: FieldValue | undefined): string | undefined;
357
364
  /**
358
365
  * Format a nested field path as a human-readable label.
359
366
  *
@@ -551,4 +558,4 @@ declare function eightPointedStarPath(cx: number, cy: number, outerR: number, in
551
558
  */
552
559
  declare function arrowheadPath(size: number): string;
553
560
 
554
- export { ApiError, type DebugEvent, type DebugEventType, type EntitySnapshot, type EntityState, type GuardContext, type GuardEvaluation, JAZARI_COLORS, type JazariArmLayout, type JazariEffectInfo, type JazariGearLayout, type JazariGuardInfo, type JazariLayout, type LayoutInput, type LayoutState, type LayoutTransition, type PersistentEntityInfo, type RuntimeEntity, type SortDirection, type TickExecution, type TraitDebugInfo, type TraitGuard, type TraitTransition, type ValueFormat, apiClient, arrowheadPath, brainIconPath, clearDebugEvents, clearEntityProvider, clearGuardHistory, clearTicks, clearTraits, compareCellValues, computeJazariLayout, debug, debugCollision, debugError, debugGameState, debugGroup, debugGroupEnd, debugInput, debugPhysics, debugTable, debugTime, debugTimeEnd, debugWarn, eightPointedStarPath, formatDate, formatDateTime, formatNestedFieldLabel, formatTime, formatValue, gearTeethPath, getAllTicks, getAllTraits, getDebugEvents, getEntitiesByType, getEntityById, getEntitySnapshot, getEventsBySource, getEventsByType, getGuardEvaluationsForTrait, getGuardHistory, getNestedValue, getRecentEvents, getRecentGuardEvaluations, getTick, getTrait, humanizeEnumValue, humanizeFieldName, initDebugShortcut, isDebugEnabled, lockIconPath, logDebugEvent, logEffectExecuted, logError, logEventFired, logInfo, logStateChange, logWarning, onDebugToggle, pipeIconPath, recordGuardEvaluation, registerTick, registerTrait, setDebugEnabled, setEntityProvider, setTickActive, sortRows, subscribeToDebugEvents, subscribeToGuardChanges, subscribeToTickChanges, subscribeToTraitChanges, toggleDebug, unregisterTick, unregisterTrait, updateGuardResult, updateTickExecution, updateTraitState };
561
+ export { ApiError, type DebugEvent, type DebugEventType, type EntitySnapshot, type EntityState, type GuardContext, type GuardEvaluation, JAZARI_COLORS, type JazariArmLayout, type JazariEffectInfo, type JazariGearLayout, type JazariGuardInfo, type JazariLayout, type LayoutInput, type LayoutState, type LayoutTransition, type PersistentEntityInfo, type RuntimeEntity, type SortDirection, type TickExecution, type TraitDebugInfo, type TraitGuard, type TraitTransition, type ValueFormat, apiClient, arrowheadPath, brainIconPath, clearDebugEvents, clearEntityProvider, clearGuardHistory, clearTicks, clearTraits, compareCellValues, computeJazariLayout, debug, debugCollision, debugError, debugGameState, debugGroup, debugGroupEnd, debugInput, debugPhysics, debugTable, debugTime, debugTimeEnd, debugWarn, eightPointedStarPath, formatDate, formatDateTime, formatNestedFieldLabel, formatTime, formatValue, gearTeethPath, getAllTicks, getAllTraits, getDebugEvents, getEntitiesByType, getEntityById, getEntitySnapshot, getEventsBySource, getEventsByType, getGuardEvaluationsForTrait, getGuardHistory, getNestedValue, getRecentEvents, getRecentGuardEvaluations, getTick, getTrait, humanizeEnumValue, humanizeFieldName, initDebugShortcut, isDebugEnabled, lockIconPath, logDebugEvent, logEffectExecuted, logError, logEventFired, logInfo, logStateChange, logWarning, onDebugToggle, pipeIconPath, recordGuardEvaluation, registerTick, registerTrait, resolveImageUrl, setDebugEnabled, setEntityProvider, setTickActive, sortRows, subscribeToDebugEvents, subscribeToGuardChanges, subscribeToTickChanges, subscribeToTraitChanges, toggleDebug, unregisterTick, unregisterTrait, updateGuardResult, updateTickExecution, updateTraitState };
@@ -354,6 +354,13 @@ declare function sortRows<T extends Record<string, FieldValue | undefined>>(rows
354
354
  * getNestedValue(data, "company.missing"); // => undefined
355
355
  */
356
356
  declare function getNestedValue(obj: EventPayload | Record<string, FieldValue | undefined> | null | undefined, path: string): FieldValue | undefined;
357
+ /**
358
+ * Resolve a field value that may be a raw URL string (legacy `image`/`url` fields) or a
359
+ * structured `file`-typed {@link FileValue} into the URL an `<img src>` can use. Gallery/card
360
+ * grid image tiles only ever rendered the raw-string case before the file-type promotion —
361
+ * this keeps them working once a field is retyped to `file`.
362
+ */
363
+ declare function resolveImageUrl(value: FieldValue | undefined): string | undefined;
357
364
  /**
358
365
  * Format a nested field path as a human-readable label.
359
366
  *
@@ -551,4 +558,4 @@ declare function eightPointedStarPath(cx: number, cy: number, outerR: number, in
551
558
  */
552
559
  declare function arrowheadPath(size: number): string;
553
560
 
554
- export { ApiError, type DebugEvent, type DebugEventType, type EntitySnapshot, type EntityState, type GuardContext, type GuardEvaluation, JAZARI_COLORS, type JazariArmLayout, type JazariEffectInfo, type JazariGearLayout, type JazariGuardInfo, type JazariLayout, type LayoutInput, type LayoutState, type LayoutTransition, type PersistentEntityInfo, type RuntimeEntity, type SortDirection, type TickExecution, type TraitDebugInfo, type TraitGuard, type TraitTransition, type ValueFormat, apiClient, arrowheadPath, brainIconPath, clearDebugEvents, clearEntityProvider, clearGuardHistory, clearTicks, clearTraits, compareCellValues, computeJazariLayout, debug, debugCollision, debugError, debugGameState, debugGroup, debugGroupEnd, debugInput, debugPhysics, debugTable, debugTime, debugTimeEnd, debugWarn, eightPointedStarPath, formatDate, formatDateTime, formatNestedFieldLabel, formatTime, formatValue, gearTeethPath, getAllTicks, getAllTraits, getDebugEvents, getEntitiesByType, getEntityById, getEntitySnapshot, getEventsBySource, getEventsByType, getGuardEvaluationsForTrait, getGuardHistory, getNestedValue, getRecentEvents, getRecentGuardEvaluations, getTick, getTrait, humanizeEnumValue, humanizeFieldName, initDebugShortcut, isDebugEnabled, lockIconPath, logDebugEvent, logEffectExecuted, logError, logEventFired, logInfo, logStateChange, logWarning, onDebugToggle, pipeIconPath, recordGuardEvaluation, registerTick, registerTrait, setDebugEnabled, setEntityProvider, setTickActive, sortRows, subscribeToDebugEvents, subscribeToGuardChanges, subscribeToTickChanges, subscribeToTraitChanges, toggleDebug, unregisterTick, unregisterTrait, updateGuardResult, updateTickExecution, updateTraitState };
561
+ export { ApiError, type DebugEvent, type DebugEventType, type EntitySnapshot, type EntityState, type GuardContext, type GuardEvaluation, JAZARI_COLORS, type JazariArmLayout, type JazariEffectInfo, type JazariGearLayout, type JazariGuardInfo, type JazariLayout, type LayoutInput, type LayoutState, type LayoutTransition, type PersistentEntityInfo, type RuntimeEntity, type SortDirection, type TickExecution, type TraitDebugInfo, type TraitGuard, type TraitTransition, type ValueFormat, apiClient, arrowheadPath, brainIconPath, clearDebugEvents, clearEntityProvider, clearGuardHistory, clearTicks, clearTraits, compareCellValues, computeJazariLayout, debug, debugCollision, debugError, debugGameState, debugGroup, debugGroupEnd, debugInput, debugPhysics, debugTable, debugTime, debugTimeEnd, debugWarn, eightPointedStarPath, formatDate, formatDateTime, formatNestedFieldLabel, formatTime, formatValue, gearTeethPath, getAllTicks, getAllTraits, getDebugEvents, getEntitiesByType, getEntityById, getEntitySnapshot, getEventsBySource, getEventsByType, getGuardEvaluationsForTrait, getGuardHistory, getNestedValue, getRecentEvents, getRecentGuardEvaluations, getTick, getTrait, humanizeEnumValue, humanizeFieldName, initDebugShortcut, isDebugEnabled, lockIconPath, logDebugEvent, logEffectExecuted, logError, logEventFired, logInfo, logStateChange, logWarning, onDebugToggle, pipeIconPath, recordGuardEvaluation, registerTick, registerTrait, resolveImageUrl, setDebugEnabled, setEntityProvider, setTickActive, sortRows, subscribeToDebugEvents, subscribeToGuardChanges, subscribeToTickChanges, subscribeToTraitChanges, toggleDebug, unregisterTick, unregisterTrait, updateGuardResult, updateTickExecution, updateTraitState };
package/dist/lib/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { clsx } from 'clsx';
2
2
  import { twMerge } from 'tailwind-merge';
3
3
  import { createLogger, isLogLevelEnabled } from '@almadar/logger';
4
+ import { isFileValue } from '@almadar/core';
4
5
 
5
6
  var __defProp = Object.defineProperty;
6
7
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
@@ -864,8 +865,6 @@ function sortRows(rows, field, direction = "asc") {
864
865
  const dir = direction === "desc" ? -1 : 1;
865
866
  return [...rows].sort((a, b) => dir * compareCellValues(a?.[field], b?.[field]));
866
867
  }
867
-
868
- // lib/getNestedValue.ts
869
868
  function getNestedValue(obj, path) {
870
869
  if (obj === null || obj === void 0 || !path) {
871
870
  return void 0;
@@ -886,6 +885,15 @@ function getNestedValue(obj, path) {
886
885
  }
887
886
  return value;
888
887
  }
888
+ function resolveImageUrl(value) {
889
+ if (typeof value === "string") {
890
+ return value;
891
+ }
892
+ if (isFileValue(value)) {
893
+ return value.url;
894
+ }
895
+ return void 0;
896
+ }
889
897
  function formatNestedFieldLabel(path) {
890
898
  const lastPart = path.includes(".") ? path.split(".").pop() : path;
891
899
  return lastPart.replace(/([A-Z])/g, " $1").replace(/^./, (str) => str.toUpperCase()).replace(/Id$/, "").trim();
@@ -2024,4 +2032,4 @@ var JAZARI_COLORS = {
2024
2032
  darkBg: "#1a1a2e"
2025
2033
  };
2026
2034
 
2027
- export { ApiError, DEFAULT_CONFIG, JAZARI_COLORS, apiClient, arrowheadPath, bindCanvasCapture, bindEventBus, bindLastDrawables, bindTraitStateGetter, brainIconPath, clearDebugEvents, clearEntityProvider, clearGuardHistory, clearTicks, clearTraits, clearVerification, cn, compareCellValues, computeJazariLayout, debug, debugCollision, debugError, debugGameState, debugGroup, debugGroupEnd, debugInput, debugPhysics, debugTable, debugTime, debugTimeEnd, debugWarn, eightPointedStarPath, extractOutputsFromTransitions, extractStateMachine, formatDate, formatDateTime, formatGuard, formatNestedFieldLabel, formatTime, formatValue, gearTeethPath, getAllChecks, getAllTicks, getAllTraits, getBridgeHealth, getDebugEvents, getEffectSummary, getEntitiesByType, getEntityById, getEntitySnapshot, getEventsBySource, getEventsByType, getGuardEvaluationsForTrait, getGuardHistory, getNestedValue, getRecentEvents, getRecentGuardEvaluations, getSnapshot, getSummary, getTick, getTrait, getTraitSnapshots, getTransitions, getTransitionsForTrait, humanizeEnumValue, humanizeFieldName, initDebugShortcut, isDebugEnabled, lockIconPath, logDebugEvent, logEffectExecuted, logError, logEventFired, logInfo, logStateChange, logWarning, onDebugToggle, parseContentSegments, parseLessonSegments, parseMarkdownWithCodeBlocks, pipeIconPath, recordGuardEvaluation, recordServerResponse, recordTransition, registerCheck, registerTick, registerTrait, registerTraitSnapshot, renderStateMachineToDomData, renderStateMachineToSvg, setDebugEnabled, setEntityProvider, setTickActive, sortRows, subscribeToDebugEvents, subscribeToGuardChanges, subscribeToTickChanges, subscribeToTraitChanges, subscribeToVerification, toggleDebug, unregisterTick, unregisterTrait, updateAssetStatus, updateBridgeHealth, updateCheck, updateGuardResult, updateTickExecution, updateTraitState, waitForTransition };
2035
+ export { ApiError, DEFAULT_CONFIG, JAZARI_COLORS, apiClient, arrowheadPath, bindCanvasCapture, bindEventBus, bindLastDrawables, bindTraitStateGetter, brainIconPath, clearDebugEvents, clearEntityProvider, clearGuardHistory, clearTicks, clearTraits, clearVerification, cn, compareCellValues, computeJazariLayout, debug, debugCollision, debugError, debugGameState, debugGroup, debugGroupEnd, debugInput, debugPhysics, debugTable, debugTime, debugTimeEnd, debugWarn, eightPointedStarPath, extractOutputsFromTransitions, extractStateMachine, formatDate, formatDateTime, formatGuard, formatNestedFieldLabel, formatTime, formatValue, gearTeethPath, getAllChecks, getAllTicks, getAllTraits, getBridgeHealth, getDebugEvents, getEffectSummary, getEntitiesByType, getEntityById, getEntitySnapshot, getEventsBySource, getEventsByType, getGuardEvaluationsForTrait, getGuardHistory, getNestedValue, getRecentEvents, getRecentGuardEvaluations, getSnapshot, getSummary, getTick, getTrait, getTraitSnapshots, getTransitions, getTransitionsForTrait, humanizeEnumValue, humanizeFieldName, initDebugShortcut, isDebugEnabled, lockIconPath, logDebugEvent, logEffectExecuted, logError, logEventFired, logInfo, logStateChange, logWarning, onDebugToggle, parseContentSegments, parseLessonSegments, parseMarkdownWithCodeBlocks, pipeIconPath, recordGuardEvaluation, recordServerResponse, recordTransition, registerCheck, registerTick, registerTrait, registerTraitSnapshot, renderStateMachineToDomData, renderStateMachineToSvg, resolveImageUrl, setDebugEnabled, setEntityProvider, setTickActive, sortRows, subscribeToDebugEvents, subscribeToGuardChanges, subscribeToTickChanges, subscribeToTraitChanges, subscribeToVerification, toggleDebug, unregisterTick, unregisterTrait, updateAssetStatus, updateBridgeHealth, updateCheck, updateGuardResult, updateTickExecution, updateTraitState, waitForTransition };