@almadar/ui 2.1.11 → 2.2.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,17 +1,18 @@
1
- import { useAuthContext } from '../chunk-6OACETQB.js';
2
- export { ENTITY_EVENTS, useAgentChat, useAuthContext, useCompile, useConnectGitHub, useCreateEntity, useDeepAgentGeneration, useDeleteEntity, useDisconnectGitHub, useEntities, useEntitiesByType, useEntity as useEntityById, useEntityMutations, useExtensions, useFileEditor, useFileSystem, useGitHubBranches, useGitHubRepo, useGitHubRepos, useGitHubStatus, useInput, useOrbitalHistory, useOrbitalMutations, usePhysics, usePlayer, usePreview, useResolvedEntity, useSelectedEntity, useSendOrbitalEvent, useSingletonEntity, useUIEvents, useUpdateEntity, useValidation } from '../chunk-6OACETQB.js';
1
+ import { useAuthContext } from '../chunk-42WRQA7T.js';
2
+ export { ENTITY_EVENTS, useAgentChat, useAuthContext, useCompile, useConnectGitHub, useCreateEntity, useDeepAgentGeneration, useDeleteEntity, useDisconnectGitHub, useEntities, useEntitiesByType, useEntity as useEntityById, useEntityMutations, useExtensions, useFileEditor, useFileSystem, useGitHubBranches, useGitHubRepo, useGitHubRepos, useGitHubStatus, useInput, useOrbitalHistory, useOrbitalMutations, usePhysics, usePlayer, usePreview, useResolvedEntity, useSelectedEntity, useSendOrbitalEvent, useSingletonEntity, useUIEvents, useUpdateEntity, useValidation } from '../chunk-42WRQA7T.js';
3
3
  import { DEFAULT_CONFIG, renderStateMachineToDomData, parseContentSegments } from '../chunk-N6DJVKZ6.js';
4
4
  import '../chunk-3HJHHULT.js';
5
- import { VStack, HStack, Typography, Button, Icon, Box, Card, Avatar, Badge, SearchInput, Checkbox, Menu as Menu$1, Pagination, LoadingState, EmptyState, Modal, ErrorState, QuizBlock, CodeBlock, ScaledDiagram, MarkdownContent, Divider, ProgressBar, Stack, Select, Drawer, Toast, Tabs, Input, ThemeToggle, EntityDisplayEvents, HealthBar, ScoreDisplay, StateIndicator, Container } from '../chunk-CTNDYHXY.js';
6
- export { Accordion, Card2 as ActionCard, Alert, Avatar, Badge, Box, Breadcrumb, Button, ButtonGroup, Card, CardBody, CardContent, CardFooter, CardGrid, CardHeader, CardTitle, Center, Checkbox, CodeBlock, ConditionalWrapper, Container, ControlButton, DataTable, DetailPanel, Divider, Drawer, EmptyState, EntityDisplayEvents, ErrorBoundary, ErrorState, FilterGroup, Flex, FloatingActionButton, Form, FormField, FormSectionHeader, Grid, HStack, Heading, HealthBar, Icon, Input, InputGroup, Label, LawReferenceTooltip, LoadingState, MarkdownContent, MasterDetail, Menu, Modal, Overlay, PageHeader, Pagination, Popover, ProgressBar, QuizBlock, Radio, RelationSelect, RepeatableFormSection, ScaledDiagram, ScoreDisplay, SearchInput, Select, SidePanel, SimpleGrid, Skeleton, SlotContentRenderer, Spacer, Spinner, Sprite, Stack, StatCard, StateIndicator, Switch, Tabs, Text, TextHighlight, Textarea, ThemeSelector, ThemeToggle, Toast, Tooltip, Typography, UISlotComponent, UISlotRenderer, VStack, ViolationAlert, WizardNavigation, WizardProgress, drawSprite } from '../chunk-CTNDYHXY.js';
7
- import '../chunk-BTXQJGFB.js';
8
- import { useTranslate } from '../chunk-JLEMVREZ.js';
9
- export { EntityDataProvider, I18nProvider, createTranslate, entityDataKeys, parseQueryBinding, useEntity, useEntityDataAdapter, useEntityDetail, useEntityList, useEntityListSuspense, useEntitySuspense, useQuerySingleton, useTranslate } from '../chunk-JLEMVREZ.js';
5
+ import { VStack, HStack, Typography, Button, Icon, Box, Card, Avatar, Badge, SearchInput, Checkbox, Menu as Menu$1, Pagination, LoadingState, EmptyState, Modal, ErrorState, QuizBlock, CodeBlock, ScaledDiagram, MarkdownContent, Divider, ProgressBar, Stack, Select, Drawer, Toast, Tabs, Input, ThemeToggle, EntityDisplayEvents, HealthBar, ScoreDisplay, StateIndicator, Container } from '../chunk-CC3UOKHI.js';
6
+ export { Accordion, Card2 as ActionCard, Alert, Avatar, Badge, Box, Breadcrumb, Button, ButtonGroup, Card, CardBody, CardContent, CardFooter, CardGrid, CardHeader, CardTitle, Center, Checkbox, CodeBlock, ConditionalWrapper, Container, ControlButton, DataTable, DetailPanel, Divider, Drawer, EmptyState, EntityDisplayEvents, ErrorBoundary, ErrorState, FilterGroup, Flex, FloatingActionButton, Form, FormField, FormSectionHeader, Grid, HStack, Heading, HealthBar, Icon, Input, InputGroup, Label, LawReferenceTooltip, LoadingState, MarkdownContent, MasterDetail, Menu, Modal, Overlay, PageHeader, Pagination, Popover, ProgressBar, QuizBlock, Radio, RelationSelect, RepeatableFormSection, ScaledDiagram, ScoreDisplay, SearchInput, Select, SidePanel, SimpleGrid, Skeleton, SlotContentRenderer, Spacer, Spinner, Sprite, Stack, StatCard, StateIndicator, Switch, Tabs, Text, TextHighlight, Textarea, ThemeSelector, ThemeToggle, Toast, Tooltip, Typography, UISlotComponent, UISlotRenderer, VStack, ViolationAlert, WizardNavigation, WizardProgress, drawSprite } from '../chunk-CC3UOKHI.js';
7
+ import '../chunk-DKQN5FVU.js';
8
+ import { useTranslate } from '../chunk-GOZKH7QW.js';
9
+ export { EntityDataProvider, I18nProvider, createTranslate, entityDataKeys, parseQueryBinding, useEntity, useEntityDataAdapter, useEntityDetail, useEntityList, useEntityListSuspense, useEntitySuspense, useQuerySingleton, useTranslate } from '../chunk-GOZKH7QW.js';
10
10
  import { useEventBus, useEventListener } from '../chunk-YXZM3WCF.js';
11
11
  export { useEmitEvent, useEventBus, useEventListener } from '../chunk-YXZM3WCF.js';
12
- export { DEFAULT_SLOTS, useUISlotManager } from '../chunk-7NEWMNNU.js';
12
+ export { DEFAULT_SLOTS, useUISlotManager } from '../chunk-3JGAROCW.js';
13
13
  import { cn, getNestedValue } from '../chunk-KKCVDUK7.js';
14
14
  export { cn } from '../chunk-KKCVDUK7.js';
15
+ import '../chunk-TSETXL2E.js';
15
16
  export { clearEntities, getAllEntities, getByType, getEntity, getSingleton, removeEntity, spawnEntity, updateEntity, updateSingleton } from '../chunk-N7MVUW4R.js';
16
17
  import { __publicField } from '../chunk-PKBMQBKP.js';
17
18
  import * as React from 'react';
@@ -446,7 +447,7 @@ var SidebarNavItem = ({ item, collapsed }) => {
446
447
  )
447
448
  }
448
449
  ),
449
- !collapsed && /* @__PURE__ */ jsx(Typography, { variant: "body", className: "font-medium truncate flex-1 text-left", children: item.label }),
450
+ !collapsed && /* @__PURE__ */ jsx(Typography, { variant: "body", color: isActive ? "inherit" : "primary", className: "font-medium truncate flex-1 text-left", children: item.label }),
450
451
  !collapsed && item.badge !== void 0 && /* @__PURE__ */ jsx(Badge, { variant: "danger", size: "sm", children: item.badge }),
451
452
  collapsed && /* @__PURE__ */ jsx(Box, { className: cn(
452
453
  "absolute left-full ml-2 px-2 py-1 text-xs opacity-0 group-hover:opacity-100",
@@ -520,13 +521,7 @@ var Sidebar = ({
520
521
  ),
521
522
  onClick: handleLogoClick,
522
523
  children: [
523
- logo ? typeof logo === "string" ? (
524
- // eslint-disable-next-line almadar/no-raw-dom-elements -- semantic img with src/alt
525
- /* @__PURE__ */ jsx("img", { src: logo, alt: brandName, className: "h-8 w-8" })
526
- ) : logo : logoSrc ? (
527
- // eslint-disable-next-line almadar/no-raw-dom-elements -- semantic img with src/alt
528
- /* @__PURE__ */ jsx("img", { src: logoSrc, alt: brandName, className: "h-8 w-8" })
529
- ) : /* @__PURE__ */ jsx(Box, { className: "h-8 w-8 bg-[var(--color-primary)] flex items-center justify-center rounded-[var(--radius-sm)]", children: /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-[var(--color-primary-foreground)] font-bold text-sm", children: "K" }) }),
524
+ logo ? typeof logo === "string" ? /* @__PURE__ */ jsx("img", { src: logo, alt: brandName, className: "h-8 w-8" }) : logo : logoSrc ? /* @__PURE__ */ jsx("img", { src: logoSrc, alt: brandName, className: "h-8 w-8" }) : /* @__PURE__ */ jsx(Box, { className: "h-8 w-8 bg-[var(--color-primary)] flex items-center justify-center rounded-[var(--radius-sm)]", children: /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-[var(--color-primary-foreground)] font-bold text-sm", children: "K" }) }),
530
525
  !collapsed && /* @__PURE__ */ jsx(Typography, { variant: "body", className: "text-xl font-bold text-[var(--color-foreground)]", children: brandName })
531
526
  ]
532
527
  }
@@ -737,109 +732,90 @@ var Table = ({
737
732
  ) }),
738
733
  /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsx(Box, { className: "overflow-x-auto", children: /* @__PURE__ */ jsxs("table", { className: "w-full", children: [
739
734
  /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { className: "border-b-[length:var(--border-width)] border-[var(--color-table-border)]", children: [
740
- selectable && // eslint-disable-next-line almadar/no-raw-dom-elements -- native table elements needed
741
- /* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left bg-[var(--color-table-header)]", children: /* @__PURE__ */ jsx(
735
+ selectable && /* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left bg-[var(--color-table-header)]", children: /* @__PURE__ */ jsx(
742
736
  Checkbox,
743
737
  {
744
738
  checked: allSelected,
745
739
  onChange: (e) => handleSelectAll(e.target.checked)
746
740
  }
747
741
  ) }),
748
- columns.map((column) => (
749
- // eslint-disable-next-line almadar/no-raw-dom-elements -- native table elements needed
750
- /* @__PURE__ */ jsx(
751
- "th",
752
- {
753
- className: cn(
754
- "px-4 py-3 text-left text-xs font-bold text-[var(--color-foreground)] uppercase tracking-wider bg-[var(--color-table-header)]",
755
- sortable && column.sortable && "cursor-pointer hover:bg-[var(--color-table-row-hover)]"
756
- ),
757
- style: { width: column.width },
758
- onClick: () => column.sortable && handleSort(column.key),
759
- children: /* @__PURE__ */ jsxs(HStack, { className: "flex items-center gap-2", children: [
760
- /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "semibold", children: column.label }),
761
- sortable && column.sortable && resolvedSortColumn === column.key && /* @__PURE__ */ jsx(
762
- Icon,
763
- {
764
- icon: resolvedSortDirection === "asc" ? ArrowUp : ArrowDown,
765
- size: "sm"
766
- }
767
- )
768
- ] })
769
- },
770
- column.key
771
- )
742
+ columns.map((column) => /* @__PURE__ */ jsx(
743
+ "th",
744
+ {
745
+ className: cn(
746
+ "px-4 py-3 text-left text-xs font-bold text-[var(--color-foreground)] uppercase tracking-wider bg-[var(--color-table-header)]",
747
+ sortable && column.sortable && "cursor-pointer hover:bg-[var(--color-table-row-hover)]"
748
+ ),
749
+ style: { width: column.width },
750
+ onClick: () => column.sortable && handleSort(column.key),
751
+ children: /* @__PURE__ */ jsxs(HStack, { className: "flex items-center gap-2", children: [
752
+ /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "semibold", children: column.label }),
753
+ sortable && column.sortable && resolvedSortColumn === column.key && /* @__PURE__ */ jsx(
754
+ Icon,
755
+ {
756
+ icon: resolvedSortDirection === "asc" ? ArrowUp : ArrowDown,
757
+ size: "sm"
758
+ }
759
+ )
760
+ ] })
761
+ },
762
+ column.key
772
763
  )),
773
- rowActions && // eslint-disable-next-line almadar/no-raw-dom-elements -- native table elements needed
774
- /* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-right", children: "Actions" })
764
+ rowActions && /* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-right", children: "Actions" })
775
765
  ] }) }),
776
- /* @__PURE__ */ jsx("tbody", { children: loading || isLoading ? (
777
- // eslint-disable-next-line almadar/no-raw-dom-elements -- native table elements needed
778
- /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx(
779
- "td",
780
- {
781
- colSpan: columns.length + (selectable ? 1 : 0) + (rowActions ? 1 : 0),
782
- className: "px-4 py-8 text-center",
783
- children: /* @__PURE__ */ jsx(Typography, { variant: "body", color: "secondary", children: t("common.loading") })
784
- }
785
- ) })
786
- ) : resolvedData.length === 0 ? (
787
- // eslint-disable-next-line almadar/no-raw-dom-elements -- native table elements needed
788
- /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx(
789
- "td",
790
- {
791
- colSpan: columns.length + (selectable ? 1 : 0) + (rowActions ? 1 : 0),
792
- className: "px-4 py-8 text-center",
793
- children: /* @__PURE__ */ jsx(Typography, { variant: "body", color: "secondary", children: resolvedEmptyMessage })
794
- }
795
- ) })
796
- ) : resolvedData.map((row, index) => {
766
+ /* @__PURE__ */ jsx("tbody", { children: loading || isLoading ? /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx(
767
+ "td",
768
+ {
769
+ colSpan: columns.length + (selectable ? 1 : 0) + (rowActions ? 1 : 0),
770
+ className: "px-4 py-8 text-center",
771
+ children: /* @__PURE__ */ jsx(Typography, { variant: "body", color: "secondary", children: t("common.loading") })
772
+ }
773
+ ) }) : resolvedData.length === 0 ? /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx(
774
+ "td",
775
+ {
776
+ colSpan: columns.length + (selectable ? 1 : 0) + (rowActions ? 1 : 0),
777
+ className: "px-4 py-8 text-center",
778
+ children: /* @__PURE__ */ jsx(Typography, { variant: "body", color: "secondary", children: resolvedEmptyMessage })
779
+ }
780
+ ) }) : resolvedData.map((row, index) => {
797
781
  const rowKey = String(row.id ?? index);
798
782
  const isSelected = selectedRows.includes(rowKey);
799
- return (
800
- // eslint-disable-next-line almadar/no-raw-dom-elements -- native table elements needed
801
- /* @__PURE__ */ jsxs(
802
- "tr",
803
- {
804
- className: cn(
805
- "border-b border-[var(--color-table-border)] last:border-b-0",
806
- "hover:bg-[var(--color-table-row-hover)]",
807
- isSelected && "bg-[var(--color-table-header)] font-medium"
808
- ),
809
- children: [
810
- selectable && // eslint-disable-next-line almadar/no-raw-dom-elements -- native table elements needed
811
- /* @__PURE__ */ jsx("td", { className: "px-4 py-3", children: /* @__PURE__ */ jsx(
812
- Checkbox,
813
- {
814
- checked: isSelected,
815
- onChange: (e) => handleSelectRow(rowKey, e.target.checked)
816
- }
817
- ) }),
818
- columns.map((column) => (
819
- // eslint-disable-next-line almadar/no-raw-dom-elements -- native table elements needed
820
- /* @__PURE__ */ jsx("td", { className: "px-4 py-3", children: column.render ? column.render(row[column.key], row, index) : /* @__PURE__ */ jsx(Typography, { variant: "body", children: row[column.key]?.toString() || "-" }) }, column.key)
821
- )),
822
- rowActions && // eslint-disable-next-line almadar/no-raw-dom-elements -- native table elements needed
823
- /* @__PURE__ */ jsx("td", { className: "px-4 py-3 text-right", children: /* @__PURE__ */ jsx(
824
- Menu$1,
825
- {
826
- trigger: /* @__PURE__ */ jsx(
827
- Button,
828
- {
829
- variant: "ghost",
830
- size: "sm",
831
- icon: MoreVertical,
832
- children: "Actions"
833
- }
834
- ),
835
- items: rowActions(row),
836
- position: "bottom-right"
837
- }
838
- ) })
839
- ]
840
- },
841
- rowKey
842
- )
783
+ return /* @__PURE__ */ jsxs(
784
+ "tr",
785
+ {
786
+ className: cn(
787
+ "border-b border-[var(--color-table-border)] last:border-b-0",
788
+ "hover:bg-[var(--color-table-row-hover)]",
789
+ isSelected && "bg-[var(--color-table-header)] font-medium"
790
+ ),
791
+ children: [
792
+ selectable && /* @__PURE__ */ jsx("td", { className: "px-4 py-3", children: /* @__PURE__ */ jsx(
793
+ Checkbox,
794
+ {
795
+ checked: isSelected,
796
+ onChange: (e) => handleSelectRow(rowKey, e.target.checked)
797
+ }
798
+ ) }),
799
+ columns.map((column) => /* @__PURE__ */ jsx("td", { className: "px-4 py-3", children: column.render ? column.render(row[column.key], row, index) : /* @__PURE__ */ jsx(Typography, { variant: "body", children: row[column.key]?.toString() || "-" }) }, column.key)),
800
+ rowActions && /* @__PURE__ */ jsx("td", { className: "px-4 py-3 text-right", children: /* @__PURE__ */ jsx(
801
+ Menu$1,
802
+ {
803
+ trigger: /* @__PURE__ */ jsx(
804
+ Button,
805
+ {
806
+ variant: "ghost",
807
+ size: "sm",
808
+ icon: MoreVertical,
809
+ children: "Actions"
810
+ }
811
+ ),
812
+ items: rowActions(row),
813
+ position: "bottom-right"
814
+ }
815
+ ) })
816
+ ]
817
+ },
818
+ rowKey
843
819
  );
844
820
  }) })
845
821
  ] }) }) }),
@@ -7825,6 +7801,7 @@ function defaultIsInRange(from, to, range) {
7825
7801
  }
7826
7802
  function WorldMapBoard({
7827
7803
  entity,
7804
+ isLoading,
7828
7805
  scale = 0.4,
7829
7806
  unitScale = 2.5,
7830
7807
  allowMoveAllHeroes = false,
@@ -7849,12 +7826,13 @@ function WorldMapBoard({
7849
7826
  className
7850
7827
  }) {
7851
7828
  const eventBus = useEventBus();
7852
- const hexes = entity.hexes;
7853
- const heroes = entity.heroes;
7854
- const features = entity.features ?? [];
7855
- const selectedHeroId = entity.selectedHeroId;
7856
- const assetManifest = entity.assetManifest;
7857
- const backgroundImage = entity.backgroundImage;
7829
+ const resolved = Array.isArray(entity) ? entity[0] : entity;
7830
+ const hexes = resolved?.hexes ?? [];
7831
+ const heroes = resolved?.heroes ?? [];
7832
+ const features = resolved?.features ?? [];
7833
+ const selectedHeroId = resolved?.selectedHeroId;
7834
+ const assetManifest = resolved?.assetManifest;
7835
+ const backgroundImage = resolved?.backgroundImage;
7858
7836
  const [hoveredTile, setHoveredTile] = useState(null);
7859
7837
  const selectedHero = useMemo(
7860
7838
  () => heroes.find((h) => h.id === selectedHeroId) ?? null,
@@ -8010,6 +7988,9 @@ function WorldMapBoard({
8010
7988
  }),
8011
7989
  [hoveredTile, hoveredHex, hoveredHero, selectedHero, validMoves, selectHero, tileToScreen, scale]
8012
7990
  );
7991
+ if (isLoading || !resolved) {
7992
+ return /* @__PURE__ */ jsx(LoadingState, { message: "Loading map..." });
7993
+ }
8013
7994
  return /* @__PURE__ */ jsxs(VStack, { className: cn("world-map-board min-h-screen bg-[var(--color-background)]", className), gap: "none", children: [
8014
7995
  header && header(ctx),
8015
7996
  /* @__PURE__ */ jsxs(HStack, { className: "flex-1 overflow-hidden", gap: "none", children: [
@@ -13216,15 +13197,15 @@ var NavLink = ({
13216
13197
  to: item.href,
13217
13198
  className: cn(
13218
13199
  "flex items-center gap-3 px-3 py-2 rounded-[var(--radius-lg)] text-sm font-medium transition-colors",
13219
- isActive ? "bg-[var(--color-foreground)] text-[var(--color-background)] shadow-[var(--shadow-sm)]" : "text-[var(--color-muted-foreground)] hover:bg-[var(--color-muted)] hover:text-[var(--color-foreground)]"
13200
+ isActive ? "bg-[var(--color-primary)] text-[var(--color-primary-foreground)] shadow-[var(--shadow-sm)]" : "text-[var(--color-muted-foreground)] hover:bg-[var(--color-muted)] hover:text-[var(--color-foreground)]"
13220
13201
  ),
13221
13202
  children: [
13222
- /* @__PURE__ */ jsx(
13203
+ Icon3 && /* @__PURE__ */ jsx(
13223
13204
  Icon3,
13224
13205
  {
13225
13206
  className: cn(
13226
13207
  "h-5 w-5",
13227
- isActive ? "text-[var(--color-background)]" : "text-[var(--color-muted-foreground)]"
13208
+ isActive ? "text-[var(--color-primary-foreground)]" : "text-[var(--color-muted-foreground)]"
13228
13209
  )
13229
13210
  }
13230
13211
  ),
@@ -13232,6 +13213,7 @@ var NavLink = ({
13232
13213
  Typography,
13233
13214
  {
13234
13215
  variant: "small",
13216
+ color: isActive ? "inherit" : "primary",
13235
13217
  className: "flex-1",
13236
13218
  as: "span",
13237
13219
  children: item.label
@@ -13386,6 +13368,8 @@ function CounterMinimal({
13386
13368
  onIncrement,
13387
13369
  className
13388
13370
  }) {
13371
+ const resolved = entity && typeof entity === "object" && !Array.isArray(entity) ? entity : void 0;
13372
+ if (!resolved) return null;
13389
13373
  return /* @__PURE__ */ jsxs(HStack, { gap: "lg", align: "center", justify: "center", className, children: [
13390
13374
  /* @__PURE__ */ jsx(
13391
13375
  Button,
@@ -13393,9 +13377,9 @@ function CounterMinimal({
13393
13377
  variant: "secondary",
13394
13378
  size: sizeStyles[size].button,
13395
13379
  onClick: onDecrement,
13396
- disabled: entity.decrementDisabled,
13380
+ disabled: resolved.decrementDisabled,
13397
13381
  icon: Minus,
13398
- children: entity.decrementLabel
13382
+ children: resolved.decrementLabel
13399
13383
  }
13400
13384
  ),
13401
13385
  /* @__PURE__ */ jsx(
@@ -13406,7 +13390,7 @@ function CounterMinimal({
13406
13390
  sizeStyles[size].display,
13407
13391
  "font-bold tabular-nums min-w-[3ch] text-center"
13408
13392
  ),
13409
- children: entity.count
13393
+ children: resolved.count
13410
13394
  }
13411
13395
  ),
13412
13396
  /* @__PURE__ */ jsx(
@@ -13415,9 +13399,9 @@ function CounterMinimal({
13415
13399
  variant: "secondary",
13416
13400
  size: sizeStyles[size].button,
13417
13401
  onClick: onIncrement,
13418
- disabled: entity.incrementDisabled,
13402
+ disabled: resolved.incrementDisabled,
13419
13403
  icon: Plus,
13420
- children: entity.incrementLabel
13404
+ children: resolved.incrementLabel
13421
13405
  }
13422
13406
  )
13423
13407
  ] });
@@ -13433,6 +13417,8 @@ function CounterStandard({
13433
13417
  onReset,
13434
13418
  className
13435
13419
  }) {
13420
+ const resolved = entity && typeof entity === "object" && !Array.isArray(entity) ? entity : void 0;
13421
+ if (!resolved) return null;
13436
13422
  return /* @__PURE__ */ jsx(Container, { size: "sm", padding: "lg", className, children: /* @__PURE__ */ jsxs(VStack, { gap: "lg", align: "center", children: [
13437
13423
  /* @__PURE__ */ jsx(
13438
13424
  Typography,
@@ -13450,7 +13436,7 @@ function CounterStandard({
13450
13436
  sizeStyles[size].display,
13451
13437
  "font-bold tabular-nums text-primary-600"
13452
13438
  ),
13453
- children: entity.count
13439
+ children: resolved.count
13454
13440
  }
13455
13441
  ),
13456
13442
  /* @__PURE__ */ jsxs(HStack, { gap: "md", children: [
@@ -13460,7 +13446,7 @@ function CounterStandard({
13460
13446
  variant: "secondary",
13461
13447
  size: sizeStyles[size].button,
13462
13448
  onClick: onDecrement,
13463
- disabled: entity.decrementDisabled,
13449
+ disabled: resolved.decrementDisabled,
13464
13450
  icon: Minus
13465
13451
  }
13466
13452
  ),
@@ -13470,7 +13456,7 @@ function CounterStandard({
13470
13456
  variant: "primary",
13471
13457
  size: sizeStyles[size].button,
13472
13458
  onClick: onIncrement,
13473
- disabled: entity.incrementDisabled,
13459
+ disabled: resolved.incrementDisabled,
13474
13460
  icon: Plus
13475
13461
  }
13476
13462
  )
@@ -13498,6 +13484,8 @@ function CounterFull({
13498
13484
  onReset,
13499
13485
  className
13500
13486
  }) {
13487
+ const resolved = entity && typeof entity === "object" && !Array.isArray(entity) ? entity : void 0;
13488
+ if (!resolved) return null;
13501
13489
  return /* @__PURE__ */ jsx(Container, { size: "sm", padding: "lg", className, children: /* @__PURE__ */ jsxs(VStack, { gap: "xl", align: "center", children: [
13502
13490
  /* @__PURE__ */ jsx(
13503
13491
  Typography,
@@ -13516,10 +13504,10 @@ function CounterFull({
13516
13504
  sizeStyles[size].display,
13517
13505
  "font-bold tabular-nums text-primary-600"
13518
13506
  ),
13519
- children: entity.count
13507
+ children: resolved.count
13520
13508
  }
13521
13509
  ),
13522
- entity.rangeText && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: entity.rangeText })
13510
+ resolved.rangeText && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: resolved.rangeText })
13523
13511
  ] }),
13524
13512
  /* @__PURE__ */ jsxs(HStack, { gap: "md", children: [
13525
13513
  /* @__PURE__ */ jsx(
@@ -13528,9 +13516,9 @@ function CounterFull({
13528
13516
  variant: "secondary",
13529
13517
  size: sizeStyles[size].button,
13530
13518
  onClick: onDecrement,
13531
- disabled: entity.decrementDisabled,
13519
+ disabled: resolved.decrementDisabled,
13532
13520
  icon: Minus,
13533
- children: entity.decrementLabel
13521
+ children: resolved.decrementLabel
13534
13522
  }
13535
13523
  ),
13536
13524
  /* @__PURE__ */ jsx(
@@ -13539,9 +13527,9 @@ function CounterFull({
13539
13527
  variant: "primary",
13540
13528
  size: sizeStyles[size].button,
13541
13529
  onClick: onIncrement,
13542
- disabled: entity.incrementDisabled,
13530
+ disabled: resolved.incrementDisabled,
13543
13531
  icon: Plus,
13544
- children: entity.incrementLabel
13532
+ children: resolved.incrementLabel
13545
13533
  }
13546
13534
  )
13547
13535
  ] }),
@@ -13790,10 +13778,12 @@ function BattleTemplate({
13790
13778
  unitScale = 1,
13791
13779
  className
13792
13780
  }) {
13781
+ const resolved = entity && typeof entity === "object" && !Array.isArray(entity) ? entity : void 0;
13782
+ if (!resolved) return null;
13793
13783
  return /* @__PURE__ */ jsx(
13794
13784
  BattleBoard,
13795
13785
  {
13796
- entity,
13786
+ entity: resolved,
13797
13787
  scale,
13798
13788
  unitScale,
13799
13789
  tileClickEvent: "TILE_CLICK",
@@ -13813,10 +13803,12 @@ function CastleTemplate({
13813
13803
  scale = 0.45,
13814
13804
  className
13815
13805
  }) {
13806
+ const resolved = entity && typeof entity === "object" && !Array.isArray(entity) ? entity : void 0;
13807
+ if (!resolved) return null;
13816
13808
  return /* @__PURE__ */ jsx(
13817
13809
  CastleBoard,
13818
13810
  {
13819
- entity,
13811
+ entity: resolved,
13820
13812
  scale,
13821
13813
  featureClickEvent: "FEATURE_CLICK",
13822
13814
  unitClickEvent: "UNIT_CLICK",
@@ -716,6 +716,12 @@ interface GameCanvas3DEventConfig {
716
716
  /** Event name for camera changes */
717
717
  cameraChangeEvent?: string;
718
718
  }
719
+ /** Minimal mouse event interface — satisfied by both React.MouseEvent and ThreeEvent<MouseEvent> */
720
+ interface MinimalMouseEvent {
721
+ clientX: number;
722
+ clientY: number;
723
+ button: number;
724
+ }
719
725
  interface UseGameCanvas3DEventsOptions extends GameCanvas3DEventConfig {
720
726
  /** Callback for tile clicks (direct) */
721
727
  onTileClick?: (tile: IsometricTile, event: React.MouseEvent) => void;
@@ -738,7 +744,7 @@ interface UseGameCanvas3DEventsReturn {
738
744
  /** Handle feature click - emits event and calls callback */
739
745
  handleFeatureClick: (feature: IsometricFeature, event: React.MouseEvent) => void;
740
746
  /** Handle canvas click - emits event and calls callback */
741
- handleCanvasClick: (event: React.MouseEvent) => void;
747
+ handleCanvasClick: (event: MinimalMouseEvent) => void;
742
748
  /** Handle tile hover - emits event and calls callback */
743
749
  handleTileHover: (tile: IsometricTile | null, event: React.MouseEvent) => void;
744
750
  /** Handle unit animation - emits event and calls callback */
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import React__default from 'react';
3
- import { U as UISlotManager, a as UISlot, S as SlotContent } from '../useUISlots-D0mttBSP.js';
4
- export { R as RenderUIConfig, b as SlotAnimation, c as SlotChangeCallback } from '../useUISlots-D0mttBSP.js';
3
+ import { U as UISlotManager, a as UISlot, S as SlotContent } from '../useUISlots-BBjNvQtb.js';
4
+ export { R as RenderUIConfig, b as SlotAnimation, c as SlotChangeCallback } from '../useUISlots-BBjNvQtb.js';
5
5
  import { T as ThemeProviderProps } from '../ThemeContext-D9xUORq5.js';
6
6
  export { B as BUILT_IN_THEMES, C as ColorMode, D as DesignTheme, R as ResolvedMode, a as ThemeContext, b as ThemeDefinition, c as ThemeProvider, u as useTheme } from '../ThemeContext-D9xUORq5.js';
7
7
 
@@ -1,6 +1,6 @@
1
- import { ThemeProvider, useTheme } from '../chunk-BTXQJGFB.js';
2
- export { BUILT_IN_THEMES, ThemeContext_default as ThemeContext, ThemeProvider, UISlotContext, UISlotProvider, useSlotContent, useSlotHasContent, useTheme, useUISlots } from '../chunk-BTXQJGFB.js';
3
- import '../chunk-7NEWMNNU.js';
1
+ import { ThemeProvider, useTheme } from '../chunk-DKQN5FVU.js';
2
+ export { BUILT_IN_THEMES, ThemeContext_default as ThemeContext, ThemeProvider, UISlotContext, UISlotProvider, useSlotContent, useSlotHasContent, useTheme, useUISlots } from '../chunk-DKQN5FVU.js';
3
+ import '../chunk-3JGAROCW.js';
4
4
  import '../chunk-PKBMQBKP.js';
5
5
  import { createContext, useCallback, useMemo, useContext } from 'react';
6
6
  import { jsx } from 'react/jsx-runtime';
@@ -1,7 +1,7 @@
1
1
  import { OrbitalSchema } from '@almadar/core';
2
2
  import { E as EventBusContextType, a as EventListener } from '../event-bus-types-CjJduURa.js';
3
3
  export { K as KFlowEvent, U as Unsubscribe } from '../event-bus-types-CjJduURa.js';
4
- export { D as DEFAULT_SLOTS, R as RenderUIConfig, b as SlotAnimation, c as SlotChangeCallback, S as SlotContent, a as UISlot, U as UISlotManager, u as useUISlotManager } from '../useUISlots-D0mttBSP.js';
4
+ export { D as DEFAULT_SLOTS, R as RenderUIConfig, b as SlotAnimation, c as SlotChangeCallback, S as SlotContent, a as UISlot, U as UISlotManager, u as useUISlotManager } from '../useUISlots-BBjNvQtb.js';
5
5
  import * as React from 'react';
6
6
  import React__default, { ReactNode } from 'react';
7
7
  import * as _tanstack_react_query from '@tanstack/react-query';
@@ -1,7 +1,8 @@
1
- export { ENTITY_EVENTS, useAgentChat, useAuthContext, useCompile, useConnectGitHub, useCreateEntity, useDeepAgentGeneration, useDeleteEntity, useDisconnectGitHub, useEntities, useEntitiesByType, useEntity as useEntityById, useEntityMutations, useExtensions, useFileEditor, useFileSystem, useGitHubBranches, useGitHubRepo, useGitHubRepos, useGitHubStatus, useInput, useOrbitalHistory, useOrbitalMutations, usePhysics, usePlayer, usePreview, useResolvedEntity, useSelectedEntity, useSendOrbitalEvent, useSingletonEntity, useUIEvents, useUpdateEntity, useValidation } from '../chunk-6OACETQB.js';
1
+ export { ENTITY_EVENTS, useAgentChat, useAuthContext, useCompile, useConnectGitHub, useCreateEntity, useDeepAgentGeneration, useDeleteEntity, useDisconnectGitHub, useEntities, useEntitiesByType, useEntity as useEntityById, useEntityMutations, useExtensions, useFileEditor, useFileSystem, useGitHubBranches, useGitHubRepo, useGitHubRepos, useGitHubStatus, useInput, useOrbitalHistory, useOrbitalMutations, usePhysics, usePlayer, usePreview, useResolvedEntity, useSelectedEntity, useSendOrbitalEvent, useSingletonEntity, useUIEvents, useUpdateEntity, useValidation } from '../chunk-42WRQA7T.js';
2
2
  import '../chunk-3HJHHULT.js';
3
- export { EntityDataProvider, I18nProvider, createTranslate, entityDataKeys, parseQueryBinding, useEntity, useEntityDataAdapter, useEntityDetail, useEntityList, useEntityListSuspense, useEntitySuspense, useQuerySingleton, useTranslate } from '../chunk-JLEMVREZ.js';
3
+ export { EntityDataProvider, I18nProvider, createTranslate, entityDataKeys, parseQueryBinding, useEntity, useEntityDataAdapter, useEntityDetail, useEntityList, useEntityListSuspense, useEntitySuspense, useQuerySingleton, useTranslate } from '../chunk-GOZKH7QW.js';
4
4
  export { useEmitEvent, useEventBus, useEventListener } from '../chunk-YXZM3WCF.js';
5
- export { DEFAULT_SLOTS, useUISlotManager } from '../chunk-7NEWMNNU.js';
5
+ export { DEFAULT_SLOTS, useUISlotManager } from '../chunk-3JGAROCW.js';
6
+ import '../chunk-TSETXL2E.js';
6
7
  export { clearEntities, getAllEntities, getByType, getEntity, getSingleton, removeEntity, spawnEntity, updateEntity, updateSingleton } from '../chunk-N7MVUW4R.js';
7
8
  import '../chunk-PKBMQBKP.js';
@@ -1,107 +1,6 @@
1
+ import { en_default } from '../chunk-TSETXL2E.js';
1
2
  import '../chunk-PKBMQBKP.js';
2
3
 
3
- // locales/en.json
4
- var en_default = {
5
- $meta: { locale: "en", direction: "ltr" },
6
- "common.save": "Save",
7
- "common.cancel": "Cancel",
8
- "common.delete": "Delete",
9
- "common.close": "Close",
10
- "common.confirm": "Are you sure?",
11
- "common.create": "Create",
12
- "common.edit": "Edit",
13
- "common.view": "View",
14
- "common.add": "Add",
15
- "common.remove": "Remove",
16
- "common.search": "Search...",
17
- "common.filter": "Filter",
18
- "common.actions": "Actions",
19
- "common.yes": "Yes",
20
- "common.no": "No",
21
- "common.ok": "OK",
22
- "common.done": "Done",
23
- "common.apply": "Apply",
24
- "common.reset": "Reset",
25
- "common.refresh": "Refresh",
26
- "common.export": "Export",
27
- "common.import": "Import",
28
- "common.copy": "Copy",
29
- "common.settings": "Settings",
30
- "nav.previous": "Previous",
31
- "nav.next": "Next",
32
- "nav.back": "Back",
33
- "nav.home": "Home",
34
- "form.submit": "Submit",
35
- "form.saving": "Saving...",
36
- "form.required": "This field is required",
37
- "form.invalidEmail": "Enter a valid email address",
38
- "form.selectPlaceholder": "Select {{label}}...",
39
- "form.searchPlaceholder": "Search {{entity}}...",
40
- "table.empty.title": "No items found",
41
- "table.empty.description": "No items to display.",
42
- "table.search.placeholder": "Search...",
43
- "table.pagination.showing": "Showing {{start}} to {{end}} of {{total}} results",
44
- "table.pagination.page": "Page {{page}} of {{totalPages}}",
45
- "table.bulk.selected": "{{count}} selected",
46
- "table.loading": "Loading...",
47
- "status.loading": "Loading...",
48
- "status.scheduled": "Scheduled",
49
- "status.inProgress": "In Progress",
50
- "status.completed": "Completed",
51
- "status.cancelled": "Cancelled",
52
- "status.pending": "Pending",
53
- "status.active": "Active",
54
- "status.inactive": "Inactive",
55
- "status.draft": "Draft",
56
- "status.archived": "Archived",
57
- "error.generic": "Something went wrong",
58
- "error.retry": "Try again",
59
- "error.notFound": "Not found",
60
- "error.loadFailed": "Failed to load: {{message}}",
61
- "error.configMissing": "Configuration not found for: {{id}}",
62
- "common.loading": "Loading...",
63
- "common.saveChanges": "Save Changes",
64
- "common.retry": "Retry",
65
- "common.open": "Open",
66
- "common.back": "Back",
67
- "empty.noItems": "No items",
68
- "empty.noData": "No data available",
69
- "empty.noItemsYet": "No items yet",
70
- "empty.noItemsAdded": "No items added yet",
71
- "empty.noOptionsFound": "No options found",
72
- "list.addItemPlaceholder": "Add new item...",
73
- "error.occurred": "An error occurred",
74
- "error.failedToLoad": "Failed to load data",
75
- "wizard.back": "Back",
76
- "wizard.next": "Next",
77
- "wizard.complete": "Complete",
78
- "wizard.stepOf": "Step {{current}} of {{total}}",
79
- "pagination.previous": "Previous",
80
- "pagination.next": "Next",
81
- "pagination.total": "Total:",
82
- "pagination.show": "Show:",
83
- "pagination.goTo": "Go to:",
84
- "pagination.go": "Go",
85
- "auth.signIn": "Sign in",
86
- "auth.signOut": "Sign out",
87
- "dialog.confirm": "Confirm",
88
- "dialog.cancel": "Cancel",
89
- "dialog.loading": "Loading...",
90
- "dialog.delete.title": "Delete {{item}}?",
91
- "dialog.delete.message": "This action cannot be undone.",
92
- "trait.availableActions": "Available Actions",
93
- "trait.transitions": "Transitions",
94
- "trait.availableNow": "Available now",
95
- "book.startReading": "Start Reading",
96
- "book.tableOfContents": "Table of Contents",
97
- "book.partNumber": "Part {{number}}",
98
- "book.print": "Print",
99
- "book.previousPage": "Previous page",
100
- "book.nextPage": "Next page",
101
- "quiz.showAnswer": "Show answer",
102
- "quiz.hideAnswer": "Hide answer"
103
- };
104
-
105
4
  // locales/ar.json
106
5
  var ar_default = {
107
6
  $meta: { locale: "ar", direction: "rtl" },