@almadar/ui 2.1.10 → 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.
- package/dist/{chunk-7NEWMNNU.js → chunk-3JGAROCW.js} +2 -0
- package/dist/{chunk-6OACETQB.js → chunk-42WRQA7T.js} +2 -2
- package/dist/{chunk-XDCOHA5C.js → chunk-CC3UOKHI.js} +228 -260
- package/dist/{chunk-BTXQJGFB.js → chunk-DKQN5FVU.js} +1 -1
- package/dist/{chunk-JLEMVREZ.js → chunk-GOZKH7QW.js} +6 -3
- package/dist/chunk-TSETXL2E.js +103 -0
- package/dist/components/index.d.ts +68 -32
- package/dist/components/index.js +139 -144
- package/dist/components/organisms/game/three/index.d.ts +7 -1
- package/dist/context/index.d.ts +2 -2
- package/dist/context/index.js +3 -3
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.js +4 -3
- package/dist/locales/index.js +1 -102
- package/dist/providers/index.js +6 -5
- package/dist/renderer/index.js +0 -1
- package/dist/{useUISlots-D0mttBSP.d.ts → useUISlots-BBjNvQtb.d.ts} +1 -1
- package/package.json +6 -2
package/dist/components/index.js
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { useAuthContext } from '../chunk-
|
|
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-
|
|
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-
|
|
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-
|
|
7
|
-
import '../chunk-
|
|
8
|
-
import { useTranslate } from '../chunk-
|
|
9
|
-
export { EntityDataProvider, I18nProvider, createTranslate, entityDataKeys, parseQueryBinding, useEntity, useEntityDataAdapter, useEntityDetail, useEntityList, useEntityListSuspense, useEntitySuspense, useQuerySingleton, useTranslate } from '../chunk-
|
|
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-
|
|
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 &&
|
|
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
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
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 &&
|
|
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
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
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
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
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
|
] }) }) }),
|
|
@@ -3961,6 +3937,7 @@ function IsometricCanvas({
|
|
|
3961
3937
|
assetManifest
|
|
3962
3938
|
}) {
|
|
3963
3939
|
const eventBus = useEventBus();
|
|
3940
|
+
const { t } = useTranslate();
|
|
3964
3941
|
const canvasRef = useRef(null);
|
|
3965
3942
|
const containerRef = useRef(null);
|
|
3966
3943
|
const minimapRef = useRef(null);
|
|
@@ -3994,11 +3971,11 @@ function IsometricCanvas({
|
|
|
3994
3971
|
}, [tilesProp]);
|
|
3995
3972
|
const gridWidth = useMemo(() => {
|
|
3996
3973
|
if (sortedTiles.length === 0) return 0;
|
|
3997
|
-
return Math.max(...sortedTiles.map((
|
|
3974
|
+
return Math.max(...sortedTiles.map((t2) => t2.x)) + 1;
|
|
3998
3975
|
}, [sortedTiles]);
|
|
3999
3976
|
const gridHeight = useMemo(() => {
|
|
4000
3977
|
if (sortedTiles.length === 0) return 0;
|
|
4001
|
-
return Math.max(...sortedTiles.map((
|
|
3978
|
+
return Math.max(...sortedTiles.map((t2) => t2.y)) + 1;
|
|
4002
3979
|
}, [sortedTiles]);
|
|
4003
3980
|
const scaledTileWidth = TILE_WIDTH * scale;
|
|
4004
3981
|
const scaledTileHeight = TILE_HEIGHT * scale;
|
|
@@ -4095,7 +4072,7 @@ function IsometricCanvas({
|
|
|
4095
4072
|
miniCanvas.width = mW;
|
|
4096
4073
|
miniCanvas.height = mH;
|
|
4097
4074
|
mCtx.clearRect(0, 0, mW, mH);
|
|
4098
|
-
const allScreenPos = sortedTiles.map((
|
|
4075
|
+
const allScreenPos = sortedTiles.map((t2) => isoToScreen(t2.x, t2.y, scale, baseOffsetX));
|
|
4099
4076
|
const minX = Math.min(...allScreenPos.map((p2) => p2.x));
|
|
4100
4077
|
const maxX = Math.max(...allScreenPos.map((p2) => p2.x + scaledTileWidth));
|
|
4101
4078
|
const minY = Math.min(...allScreenPos.map((p2) => p2.y));
|
|
@@ -4508,7 +4485,7 @@ function IsometricCanvas({
|
|
|
4508
4485
|
const adjustedX = world.x - scaledTileWidth / 2;
|
|
4509
4486
|
const adjustedY = world.y - scaledDiamondTopY - scaledFloorHeight / 2;
|
|
4510
4487
|
const isoPos = screenToIso(adjustedX, adjustedY, scale, baseOffsetX);
|
|
4511
|
-
const tileExists = tilesProp.some((
|
|
4488
|
+
const tileExists = tilesProp.some((t2) => t2.x === isoPos.x && t2.y === isoPos.y);
|
|
4512
4489
|
if (tileExists) {
|
|
4513
4490
|
if (tileHoverEvent) eventBus.emit(`UI:${tileHoverEvent}`, { x: isoPos.x, y: isoPos.y });
|
|
4514
4491
|
onTileHover?.(isoPos.x, isoPos.y);
|
|
@@ -4536,7 +4513,7 @@ function IsometricCanvas({
|
|
|
4536
4513
|
if (unitClickEvent) eventBus.emit(`UI:${unitClickEvent}`, { unitId: clickedUnit.id });
|
|
4537
4514
|
onUnitClick?.(clickedUnit.id);
|
|
4538
4515
|
} else if (onTileClick || tileClickEvent) {
|
|
4539
|
-
const tileExists = tilesProp.some((
|
|
4516
|
+
const tileExists = tilesProp.some((t2) => t2.x === isoPos.x && t2.y === isoPos.y);
|
|
4540
4517
|
if (tileExists) {
|
|
4541
4518
|
if (tileClickEvent) eventBus.emit(`UI:${tileClickEvent}`, { x: isoPos.x, y: isoPos.y });
|
|
4542
4519
|
onTileClick?.(isoPos.x, isoPos.y);
|
|
@@ -4544,7 +4521,7 @@ function IsometricCanvas({
|
|
|
4544
4521
|
}
|
|
4545
4522
|
}, [dragDistance, screenToWorld, viewportSize, scaledTileWidth, scaledDiamondTopY, scaledFloorHeight, scale, baseOffsetX, units, tilesProp, onUnitClick, onTileClick, unitClickEvent, tileClickEvent, eventBus]);
|
|
4546
4523
|
if (error) {
|
|
4547
|
-
return /* @__PURE__ */ jsx(ErrorState, { title: "
|
|
4524
|
+
return /* @__PURE__ */ jsx(ErrorState, { title: t("canvas.errorTitle"), message: error.message, className });
|
|
4548
4525
|
}
|
|
4549
4526
|
if (isLoading) {
|
|
4550
4527
|
return /* @__PURE__ */ jsx(LoadingState, { className });
|
|
@@ -7824,6 +7801,7 @@ function defaultIsInRange(from, to, range) {
|
|
|
7824
7801
|
}
|
|
7825
7802
|
function WorldMapBoard({
|
|
7826
7803
|
entity,
|
|
7804
|
+
isLoading,
|
|
7827
7805
|
scale = 0.4,
|
|
7828
7806
|
unitScale = 2.5,
|
|
7829
7807
|
allowMoveAllHeroes = false,
|
|
@@ -7848,12 +7826,13 @@ function WorldMapBoard({
|
|
|
7848
7826
|
className
|
|
7849
7827
|
}) {
|
|
7850
7828
|
const eventBus = useEventBus();
|
|
7851
|
-
const
|
|
7852
|
-
const
|
|
7853
|
-
const
|
|
7854
|
-
const
|
|
7855
|
-
const
|
|
7856
|
-
const
|
|
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;
|
|
7857
7836
|
const [hoveredTile, setHoveredTile] = useState(null);
|
|
7858
7837
|
const selectedHero = useMemo(
|
|
7859
7838
|
() => heroes.find((h) => h.id === selectedHeroId) ?? null,
|
|
@@ -8009,6 +7988,9 @@ function WorldMapBoard({
|
|
|
8009
7988
|
}),
|
|
8010
7989
|
[hoveredTile, hoveredHex, hoveredHero, selectedHero, validMoves, selectHero, tileToScreen, scale]
|
|
8011
7990
|
);
|
|
7991
|
+
if (isLoading || !resolved) {
|
|
7992
|
+
return /* @__PURE__ */ jsx(LoadingState, { message: "Loading map..." });
|
|
7993
|
+
}
|
|
8012
7994
|
return /* @__PURE__ */ jsxs(VStack, { className: cn("world-map-board min-h-screen bg-[var(--color-background)]", className), gap: "none", children: [
|
|
8013
7995
|
header && header(ctx),
|
|
8014
7996
|
/* @__PURE__ */ jsxs(HStack, { className: "flex-1 overflow-hidden", gap: "none", children: [
|
|
@@ -12949,7 +12931,8 @@ var DashboardLayout = ({
|
|
|
12949
12931
|
headerActions,
|
|
12950
12932
|
showSearch = true,
|
|
12951
12933
|
sidebarFooter,
|
|
12952
|
-
onSignOut: onSignOutProp
|
|
12934
|
+
onSignOut: onSignOutProp,
|
|
12935
|
+
children
|
|
12953
12936
|
}) => {
|
|
12954
12937
|
const [sidebarOpen, setSidebarOpen] = useState(false);
|
|
12955
12938
|
const [userMenuOpen, setUserMenuOpen] = useState(false);
|
|
@@ -13197,7 +13180,7 @@ var DashboardLayout = ({
|
|
|
13197
13180
|
)
|
|
13198
13181
|
}
|
|
13199
13182
|
),
|
|
13200
|
-
/* @__PURE__ */ jsx(Box, { as: "main", className: "p-4 sm:p-6 pb-20 sm:pb-6", children
|
|
13183
|
+
/* @__PURE__ */ jsx(Box, { as: "main", className: "p-4 sm:p-6 pb-20 sm:pb-6", children })
|
|
13201
13184
|
] })
|
|
13202
13185
|
] });
|
|
13203
13186
|
};
|
|
@@ -13214,15 +13197,15 @@ var NavLink = ({
|
|
|
13214
13197
|
to: item.href,
|
|
13215
13198
|
className: cn(
|
|
13216
13199
|
"flex items-center gap-3 px-3 py-2 rounded-[var(--radius-lg)] text-sm font-medium transition-colors",
|
|
13217
|
-
isActive ? "bg-[var(--color-
|
|
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)]"
|
|
13218
13201
|
),
|
|
13219
13202
|
children: [
|
|
13220
|
-
/* @__PURE__ */ jsx(
|
|
13203
|
+
Icon3 && /* @__PURE__ */ jsx(
|
|
13221
13204
|
Icon3,
|
|
13222
13205
|
{
|
|
13223
13206
|
className: cn(
|
|
13224
13207
|
"h-5 w-5",
|
|
13225
|
-
isActive ? "text-[var(--color-
|
|
13208
|
+
isActive ? "text-[var(--color-primary-foreground)]" : "text-[var(--color-muted-foreground)]"
|
|
13226
13209
|
)
|
|
13227
13210
|
}
|
|
13228
13211
|
),
|
|
@@ -13230,6 +13213,7 @@ var NavLink = ({
|
|
|
13230
13213
|
Typography,
|
|
13231
13214
|
{
|
|
13232
13215
|
variant: "small",
|
|
13216
|
+
color: isActive ? "inherit" : "primary",
|
|
13233
13217
|
className: "flex-1",
|
|
13234
13218
|
as: "span",
|
|
13235
13219
|
children: item.label
|
|
@@ -13384,6 +13368,8 @@ function CounterMinimal({
|
|
|
13384
13368
|
onIncrement,
|
|
13385
13369
|
className
|
|
13386
13370
|
}) {
|
|
13371
|
+
const resolved = entity && typeof entity === "object" && !Array.isArray(entity) ? entity : void 0;
|
|
13372
|
+
if (!resolved) return null;
|
|
13387
13373
|
return /* @__PURE__ */ jsxs(HStack, { gap: "lg", align: "center", justify: "center", className, children: [
|
|
13388
13374
|
/* @__PURE__ */ jsx(
|
|
13389
13375
|
Button,
|
|
@@ -13391,9 +13377,9 @@ function CounterMinimal({
|
|
|
13391
13377
|
variant: "secondary",
|
|
13392
13378
|
size: sizeStyles[size].button,
|
|
13393
13379
|
onClick: onDecrement,
|
|
13394
|
-
disabled:
|
|
13380
|
+
disabled: resolved.decrementDisabled,
|
|
13395
13381
|
icon: Minus,
|
|
13396
|
-
children:
|
|
13382
|
+
children: resolved.decrementLabel
|
|
13397
13383
|
}
|
|
13398
13384
|
),
|
|
13399
13385
|
/* @__PURE__ */ jsx(
|
|
@@ -13404,7 +13390,7 @@ function CounterMinimal({
|
|
|
13404
13390
|
sizeStyles[size].display,
|
|
13405
13391
|
"font-bold tabular-nums min-w-[3ch] text-center"
|
|
13406
13392
|
),
|
|
13407
|
-
children:
|
|
13393
|
+
children: resolved.count
|
|
13408
13394
|
}
|
|
13409
13395
|
),
|
|
13410
13396
|
/* @__PURE__ */ jsx(
|
|
@@ -13413,9 +13399,9 @@ function CounterMinimal({
|
|
|
13413
13399
|
variant: "secondary",
|
|
13414
13400
|
size: sizeStyles[size].button,
|
|
13415
13401
|
onClick: onIncrement,
|
|
13416
|
-
disabled:
|
|
13402
|
+
disabled: resolved.incrementDisabled,
|
|
13417
13403
|
icon: Plus,
|
|
13418
|
-
children:
|
|
13404
|
+
children: resolved.incrementLabel
|
|
13419
13405
|
}
|
|
13420
13406
|
)
|
|
13421
13407
|
] });
|
|
@@ -13431,6 +13417,8 @@ function CounterStandard({
|
|
|
13431
13417
|
onReset,
|
|
13432
13418
|
className
|
|
13433
13419
|
}) {
|
|
13420
|
+
const resolved = entity && typeof entity === "object" && !Array.isArray(entity) ? entity : void 0;
|
|
13421
|
+
if (!resolved) return null;
|
|
13434
13422
|
return /* @__PURE__ */ jsx(Container, { size: "sm", padding: "lg", className, children: /* @__PURE__ */ jsxs(VStack, { gap: "lg", align: "center", children: [
|
|
13435
13423
|
/* @__PURE__ */ jsx(
|
|
13436
13424
|
Typography,
|
|
@@ -13448,7 +13436,7 @@ function CounterStandard({
|
|
|
13448
13436
|
sizeStyles[size].display,
|
|
13449
13437
|
"font-bold tabular-nums text-primary-600"
|
|
13450
13438
|
),
|
|
13451
|
-
children:
|
|
13439
|
+
children: resolved.count
|
|
13452
13440
|
}
|
|
13453
13441
|
),
|
|
13454
13442
|
/* @__PURE__ */ jsxs(HStack, { gap: "md", children: [
|
|
@@ -13458,7 +13446,7 @@ function CounterStandard({
|
|
|
13458
13446
|
variant: "secondary",
|
|
13459
13447
|
size: sizeStyles[size].button,
|
|
13460
13448
|
onClick: onDecrement,
|
|
13461
|
-
disabled:
|
|
13449
|
+
disabled: resolved.decrementDisabled,
|
|
13462
13450
|
icon: Minus
|
|
13463
13451
|
}
|
|
13464
13452
|
),
|
|
@@ -13468,7 +13456,7 @@ function CounterStandard({
|
|
|
13468
13456
|
variant: "primary",
|
|
13469
13457
|
size: sizeStyles[size].button,
|
|
13470
13458
|
onClick: onIncrement,
|
|
13471
|
-
disabled:
|
|
13459
|
+
disabled: resolved.incrementDisabled,
|
|
13472
13460
|
icon: Plus
|
|
13473
13461
|
}
|
|
13474
13462
|
)
|
|
@@ -13496,6 +13484,8 @@ function CounterFull({
|
|
|
13496
13484
|
onReset,
|
|
13497
13485
|
className
|
|
13498
13486
|
}) {
|
|
13487
|
+
const resolved = entity && typeof entity === "object" && !Array.isArray(entity) ? entity : void 0;
|
|
13488
|
+
if (!resolved) return null;
|
|
13499
13489
|
return /* @__PURE__ */ jsx(Container, { size: "sm", padding: "lg", className, children: /* @__PURE__ */ jsxs(VStack, { gap: "xl", align: "center", children: [
|
|
13500
13490
|
/* @__PURE__ */ jsx(
|
|
13501
13491
|
Typography,
|
|
@@ -13514,10 +13504,10 @@ function CounterFull({
|
|
|
13514
13504
|
sizeStyles[size].display,
|
|
13515
13505
|
"font-bold tabular-nums text-primary-600"
|
|
13516
13506
|
),
|
|
13517
|
-
children:
|
|
13507
|
+
children: resolved.count
|
|
13518
13508
|
}
|
|
13519
13509
|
),
|
|
13520
|
-
|
|
13510
|
+
resolved.rangeText && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: resolved.rangeText })
|
|
13521
13511
|
] }),
|
|
13522
13512
|
/* @__PURE__ */ jsxs(HStack, { gap: "md", children: [
|
|
13523
13513
|
/* @__PURE__ */ jsx(
|
|
@@ -13526,9 +13516,9 @@ function CounterFull({
|
|
|
13526
13516
|
variant: "secondary",
|
|
13527
13517
|
size: sizeStyles[size].button,
|
|
13528
13518
|
onClick: onDecrement,
|
|
13529
|
-
disabled:
|
|
13519
|
+
disabled: resolved.decrementDisabled,
|
|
13530
13520
|
icon: Minus,
|
|
13531
|
-
children:
|
|
13521
|
+
children: resolved.decrementLabel
|
|
13532
13522
|
}
|
|
13533
13523
|
),
|
|
13534
13524
|
/* @__PURE__ */ jsx(
|
|
@@ -13537,9 +13527,9 @@ function CounterFull({
|
|
|
13537
13527
|
variant: "primary",
|
|
13538
13528
|
size: sizeStyles[size].button,
|
|
13539
13529
|
onClick: onIncrement,
|
|
13540
|
-
disabled:
|
|
13530
|
+
disabled: resolved.incrementDisabled,
|
|
13541
13531
|
icon: Plus,
|
|
13542
|
-
children:
|
|
13532
|
+
children: resolved.incrementLabel
|
|
13543
13533
|
}
|
|
13544
13534
|
)
|
|
13545
13535
|
] }),
|
|
@@ -13717,7 +13707,8 @@ var GameShell = ({
|
|
|
13717
13707
|
appName = "Game",
|
|
13718
13708
|
hud,
|
|
13719
13709
|
className,
|
|
13720
|
-
showTopBar = true
|
|
13710
|
+
showTopBar = true,
|
|
13711
|
+
children
|
|
13721
13712
|
}) => {
|
|
13722
13713
|
return /* @__PURE__ */ jsxs(
|
|
13723
13714
|
Box,
|
|
@@ -13773,7 +13764,7 @@ var GameShell = ({
|
|
|
13773
13764
|
overflow: "hidden",
|
|
13774
13765
|
position: "relative"
|
|
13775
13766
|
},
|
|
13776
|
-
children
|
|
13767
|
+
children
|
|
13777
13768
|
}
|
|
13778
13769
|
)
|
|
13779
13770
|
]
|
|
@@ -13787,10 +13778,12 @@ function BattleTemplate({
|
|
|
13787
13778
|
unitScale = 1,
|
|
13788
13779
|
className
|
|
13789
13780
|
}) {
|
|
13781
|
+
const resolved = entity && typeof entity === "object" && !Array.isArray(entity) ? entity : void 0;
|
|
13782
|
+
if (!resolved) return null;
|
|
13790
13783
|
return /* @__PURE__ */ jsx(
|
|
13791
13784
|
BattleBoard,
|
|
13792
13785
|
{
|
|
13793
|
-
entity,
|
|
13786
|
+
entity: resolved,
|
|
13794
13787
|
scale,
|
|
13795
13788
|
unitScale,
|
|
13796
13789
|
tileClickEvent: "TILE_CLICK",
|
|
@@ -13810,10 +13803,12 @@ function CastleTemplate({
|
|
|
13810
13803
|
scale = 0.45,
|
|
13811
13804
|
className
|
|
13812
13805
|
}) {
|
|
13806
|
+
const resolved = entity && typeof entity === "object" && !Array.isArray(entity) ? entity : void 0;
|
|
13807
|
+
if (!resolved) return null;
|
|
13813
13808
|
return /* @__PURE__ */ jsx(
|
|
13814
13809
|
CastleBoard,
|
|
13815
13810
|
{
|
|
13816
|
-
entity,
|
|
13811
|
+
entity: resolved,
|
|
13817
13812
|
scale,
|
|
13818
13813
|
featureClickEvent: "FEATURE_CLICK",
|
|
13819
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:
|
|
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 */
|
package/dist/context/index.d.ts
CHANGED
|
@@ -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-
|
|
4
|
-
export { R as RenderUIConfig, b as SlotAnimation, c as SlotChangeCallback } from '../useUISlots-
|
|
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
|
|
package/dist/context/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ThemeProvider, useTheme } from '../chunk-
|
|
2
|
-
export { BUILT_IN_THEMES, ThemeContext_default as ThemeContext, ThemeProvider, UISlotContext, UISlotProvider, useSlotContent, useSlotHasContent, useTheme, useUISlots } from '../chunk-
|
|
3
|
-
import '../chunk-
|
|
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';
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -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-
|
|
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';
|
package/dist/hooks/index.js
CHANGED
|
@@ -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-
|
|
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-
|
|
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-
|
|
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';
|