@almadar/ui 5.107.0 → 5.109.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/avl/index.cjs +1427 -2828
- package/dist/avl/index.js +525 -1926
- package/dist/components/core/atoms/Box.d.ts +2 -0
- package/dist/components/{game → core}/atoms/GameIcon.d.ts +1 -1
- package/dist/components/core/atoms/index.d.ts +1 -0
- package/dist/components/core/templates/index.d.ts +0 -1
- package/dist/components/game/molecules/index.d.ts +8 -28
- package/dist/components/index.cjs +223 -1691
- package/dist/components/index.js +213 -1671
- package/dist/lib/drawable/projector.d.ts +1 -1
- package/dist/{components/game/three/molecules/GameCanvas3D.d.ts → lib/drawable/three/Canvas3DHost.d.ts} +12 -9
- package/dist/lib/drawable/{Drawable3D.d.ts → three/Drawable3D.d.ts} +2 -2
- package/dist/lib/drawable/three/GameCamera3D.d.ts +16 -0
- package/dist/lib/drawable/three/game3dTheme.d.ts +14 -0
- package/dist/{components/game → lib/drawable}/three/hooks/useGameCanvas3DEvents.d.ts +1 -1
- package/dist/{components/game → lib/drawable}/three/index.cjs +2019 -2020
- package/dist/{components/game → lib/drawable}/three/index.css +3 -3
- package/dist/lib/drawable/three/index.d.ts +39 -0
- package/dist/{components/game → lib/drawable}/three/index.js +1932 -1934
- package/dist/lib/drawable/{mesh3d.d.ts → three/mesh3d.d.ts} +4 -4
- package/dist/{components/game/lib → lib}/puzzleObject.d.ts +11 -2
- package/dist/marketing/index.d.cts +2 -0
- package/dist/{components/game/providers → providers}/GameAudioProvider.d.ts +1 -1
- package/dist/providers/index.cjs +1619 -2690
- package/dist/providers/index.d.ts +2 -0
- package/dist/providers/index.js +827 -1902
- package/dist/runtime/index.cjs +1288 -2689
- package/dist/runtime/index.js +505 -1906
- package/package.json +7 -7
- package/dist/components/game/atoms/ActionButton.d.ts +0 -31
- package/dist/components/game/atoms/ComboCounter.d.ts +0 -20
- package/dist/components/game/atoms/DamageNumber.d.ts +0 -18
- package/dist/components/game/atoms/GameCard.d.ts +0 -34
- package/dist/components/game/atoms/ItemSlot.d.ts +0 -31
- package/dist/components/game/atoms/ResourceCounter.d.ts +0 -26
- package/dist/components/game/atoms/Sprite.d.ts +0 -52
- package/dist/components/game/atoms/StatusEffect.d.ts +0 -25
- package/dist/components/game/atoms/TurnIndicator.d.ts +0 -22
- package/dist/components/game/atoms/WaypointMarker.d.ts +0 -23
- package/dist/components/game/molecules/EventLog.d.ts +0 -31
- package/dist/components/game/molecules/InventoryGrid.d.ts +0 -35
- package/dist/components/game/molecules/ObjectRulePanel.d.ts +0 -32
- package/dist/components/game/molecules/ResourceBar.d.ts +0 -26
- package/dist/components/game/molecules/RuleEditor.d.ts +0 -39
- package/dist/components/game/molecules/VariablePanel.d.ts +0 -28
- package/dist/components/game/templates/GameTemplate.d.ts +0 -35
- package/dist/components/game/three/atoms/SpriteBillboard3D.d.ts +0 -18
- package/dist/components/game/three/game3dTheme.d.ts +0 -55
- package/dist/components/game/three/index.d.ts +0 -12
- package/dist/components/game/three/lib/game3dAssetManifest.d.ts +0 -48
- package/dist/components/game/three/molecules/GameCamera3D.d.ts +0 -35
- package/dist/components/game/three/molecules/index.d.ts +0 -32
- package/dist/components/game/three/patterns.d.ts +0 -16
- /package/dist/{components/game/hooks → hooks}/useCamera.d.ts +0 -0
- /package/dist/{components/game/hooks → hooks}/useGameAudio.d.ts +0 -0
- /package/dist/{components/game/hooks → hooks}/useImageCache.d.ts +0 -0
- /package/dist/{components/game/hooks → hooks}/useUnitSpriteAtlas.d.ts +0 -0
- /package/dist/{components/game/lib → lib}/boardEntity.d.ts +0 -0
- /package/dist/{components/game/three/molecules → lib/drawable/three}/Camera3D.d.ts +0 -0
- /package/dist/{components/game/three/molecules → lib/drawable/three}/Canvas3DErrorBoundary.d.ts +0 -0
- /package/dist/{components/game/three/molecules → lib/drawable/three}/Canvas3DLoadingState.d.ts +0 -0
- /package/dist/{components/game/three/molecules → lib/drawable/three}/Lighting3D.d.ts +0 -0
- /package/dist/{components/game/three/molecules → lib/drawable/three}/ModelLoader.d.ts +0 -0
- /package/dist/{components/game/three/molecules → lib/drawable/three}/Scene3D.d.ts +0 -0
- /package/dist/{components/game → lib/drawable}/three/hooks/useAssetLoader.d.ts +0 -0
- /package/dist/{components/game → lib/drawable}/three/hooks/useRaycaster.d.ts +0 -0
- /package/dist/{components/game → lib/drawable}/three/hooks/useSceneGraph.d.ts +0 -0
- /package/dist/{components/game → lib/drawable}/three/hooks/useThree.d.ts +0 -0
- /package/dist/{components/game → lib/drawable}/three/lib/AssetLoader.d.ts +0 -0
- /package/dist/{components/game → lib/drawable}/three/lib/culling.d.ts +0 -0
- /package/dist/{components/game → lib/drawable}/three/lib/grid3D.d.ts +0 -0
- /package/dist/{components/game/lib → lib}/editorUtils.d.ts +0 -0
- /package/dist/{components/game/lib → lib}/game.d.ts +0 -0
- /package/dist/{components/game/lib/index.d.ts → lib/gameShared.d.ts} +0 -0
- /package/dist/{components/game/lib → lib}/isometric.d.ts +0 -0
- /package/dist/{components/game/lib → lib}/isometricTypes.d.ts +0 -0
- /package/dist/{components/game/lib → lib}/makeAsset.d.ts +0 -0
- /package/dist/{components/game/lib → lib}/mechanics.d.ts +0 -0
- /package/dist/{components/game/lib → lib}/physicsPresets.d.ts +0 -0
- /package/dist/{components/game/lib → lib}/physicsTypes.d.ts +0 -0
- /package/dist/{components/game/lib → lib}/spriteAnimation.d.ts +0 -0
- /package/dist/{components/game/lib → lib}/spriteAnimationTypes.d.ts +0 -0
- /package/dist/{components/game/lib → lib}/spriteSheetConstants.d.ts +0 -0
package/dist/runtime/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
3
|
-
import { EventBusContext, useTraitScope, useEntitySchemaOptional, useEntitySchema, getAllPages, OrbitalProvider, TraitScopeProvider, ServerBridgeProvider, useCurrentPagePath, VerificationProvider, EntitySchemaProvider, OrbitalThemeProvider, useServerBridge } from '@almadar/ui/providers';
|
|
1
|
+
import * as React81 from 'react';
|
|
2
|
+
import React81__default, { useContext, useMemo, useRef, useEffect, useCallback, Suspense, useState, createContext, useSyncExternalStore, lazy, useLayoutEffect, useId } from 'react';
|
|
3
|
+
import { EventBusContext, useTraitScope, useEntitySchemaOptional, useEntitySchema, getAllPages, OrbitalProvider, TraitScopeProvider, ServerBridgeProvider, useCurrentPagePath, useGameAudioContextOptional, VerificationProvider, EntitySchemaProvider, OrbitalThemeProvider, useServerBridge } from '@almadar/ui/providers';
|
|
4
4
|
export { EntitySchemaProvider, ServerBridgeProvider, TraitContext, TraitProvider, useEntitySchema, useEntitySchemaOptional, useServerBridge, useTrait, useTraitContext } from '@almadar/ui/providers';
|
|
5
5
|
import { createLogger, setNamespaceLevel, isLogLevelEnabled } from '@almadar/logger';
|
|
6
6
|
import { clsx } from 'clsx';
|
|
@@ -865,7 +865,7 @@ var init_Box = __esm({
|
|
|
865
865
|
fixed: "fixed",
|
|
866
866
|
sticky: "sticky"
|
|
867
867
|
};
|
|
868
|
-
Box =
|
|
868
|
+
Box = React81__default.forwardRef(
|
|
869
869
|
({
|
|
870
870
|
padding,
|
|
871
871
|
paddingX,
|
|
@@ -930,7 +930,7 @@ var init_Box = __esm({
|
|
|
930
930
|
onPointerDown?.(e);
|
|
931
931
|
}, [hoverEvent, tapReveal, triggerProps, onPointerDown]);
|
|
932
932
|
const isClickable = action || onClick;
|
|
933
|
-
return
|
|
933
|
+
return React81__default.createElement(
|
|
934
934
|
Component,
|
|
935
935
|
{
|
|
936
936
|
ref,
|
|
@@ -1026,7 +1026,7 @@ function loadLib(key, importer) {
|
|
|
1026
1026
|
return p;
|
|
1027
1027
|
}
|
|
1028
1028
|
function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
|
|
1029
|
-
const Lazy =
|
|
1029
|
+
const Lazy = React81__default.lazy(async () => {
|
|
1030
1030
|
const lib = await loadLib(libKey, importer);
|
|
1031
1031
|
const Comp = pick(lib);
|
|
1032
1032
|
if (!Comp) {
|
|
@@ -1036,7 +1036,7 @@ function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
|
|
|
1036
1036
|
return { default: Comp };
|
|
1037
1037
|
});
|
|
1038
1038
|
const Wrapped = (props) => /* @__PURE__ */ jsx(
|
|
1039
|
-
|
|
1039
|
+
React81__default.Suspense,
|
|
1040
1040
|
{
|
|
1041
1041
|
fallback: /* @__PURE__ */ jsx(
|
|
1042
1042
|
"span",
|
|
@@ -1767,7 +1767,7 @@ var init_Icon = __esm({
|
|
|
1767
1767
|
const directIcon = typeof icon === "string" ? void 0 : icon;
|
|
1768
1768
|
const effectiveName = typeof icon === "string" ? icon : name;
|
|
1769
1769
|
const family = useIconFamily();
|
|
1770
|
-
const RenderedComponent =
|
|
1770
|
+
const RenderedComponent = React81__default.useMemo(() => {
|
|
1771
1771
|
if (directIcon) return null;
|
|
1772
1772
|
return effectiveName ? resolveIconForFamily(effectiveName, family) : null;
|
|
1773
1773
|
}, [directIcon, effectiveName, family]);
|
|
@@ -1888,7 +1888,7 @@ var init_atlasSlice = __esm({
|
|
|
1888
1888
|
}
|
|
1889
1889
|
});
|
|
1890
1890
|
function useAtlasSliceDataUrl(asset) {
|
|
1891
|
-
const [, bump] =
|
|
1891
|
+
const [, bump] = React81.useReducer((x) => x + 1, 0);
|
|
1892
1892
|
if (!isAtlasAsset(asset)) return void 0;
|
|
1893
1893
|
const key = `${asset.atlas}#${asset.sprite}`;
|
|
1894
1894
|
const cached = sliceDataUrlCache.get(key);
|
|
@@ -1951,13 +1951,13 @@ function AtlasImage({
|
|
|
1951
1951
|
style,
|
|
1952
1952
|
"aria-hidden": ariaHidden
|
|
1953
1953
|
}) {
|
|
1954
|
-
const [, bump] =
|
|
1955
|
-
const canvasRef =
|
|
1954
|
+
const [, bump] = React81.useReducer((x) => x + 1, 0);
|
|
1955
|
+
const canvasRef = React81.useRef(null);
|
|
1956
1956
|
const sliced = isAtlasAsset(asset);
|
|
1957
1957
|
const atlas = sliced ? getAtlas(asset.atlas, bump) : void 0;
|
|
1958
1958
|
const img = sliced && asset?.url ? getSheetImage(asset.url, bump) : null;
|
|
1959
1959
|
const rect = sliced && atlas ? subRectFor(atlas, asset.sprite) : null;
|
|
1960
|
-
|
|
1960
|
+
React81.useEffect(() => {
|
|
1961
1961
|
const canvas = canvasRef.current;
|
|
1962
1962
|
if (!canvas || !img || !rect) return;
|
|
1963
1963
|
canvas.width = rect.sw;
|
|
@@ -2033,7 +2033,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
2033
2033
|
const IconComp = value;
|
|
2034
2034
|
return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
|
|
2035
2035
|
}
|
|
2036
|
-
if (
|
|
2036
|
+
if (React81__default.isValidElement(value)) {
|
|
2037
2037
|
return value;
|
|
2038
2038
|
}
|
|
2039
2039
|
if (typeof value === "object" && value !== null && isIconLike(value)) {
|
|
@@ -2110,7 +2110,7 @@ var init_Button = __esm({
|
|
|
2110
2110
|
md: "h-icon-default w-icon-default",
|
|
2111
2111
|
lg: "h-icon-default w-icon-default"
|
|
2112
2112
|
};
|
|
2113
|
-
Button =
|
|
2113
|
+
Button = React81__default.forwardRef(
|
|
2114
2114
|
({
|
|
2115
2115
|
className,
|
|
2116
2116
|
variant = "primary",
|
|
@@ -2178,7 +2178,7 @@ var Dialog;
|
|
|
2178
2178
|
var init_Dialog = __esm({
|
|
2179
2179
|
"components/core/atoms/Dialog.tsx"() {
|
|
2180
2180
|
init_cn();
|
|
2181
|
-
Dialog =
|
|
2181
|
+
Dialog = React81__default.forwardRef(
|
|
2182
2182
|
({
|
|
2183
2183
|
role = "dialog",
|
|
2184
2184
|
"aria-modal": ariaModal = true,
|
|
@@ -2296,7 +2296,7 @@ var init_Typography = __esm({
|
|
|
2296
2296
|
}) => {
|
|
2297
2297
|
const variant = variantProp ?? (level ? `h${level}` : "body1");
|
|
2298
2298
|
const Component = as || defaultElements[variant];
|
|
2299
|
-
return
|
|
2299
|
+
return React81__default.createElement(
|
|
2300
2300
|
Component,
|
|
2301
2301
|
{
|
|
2302
2302
|
id,
|
|
@@ -2792,7 +2792,7 @@ var init_Badge = __esm({
|
|
|
2792
2792
|
md: "px-2.5 py-1 text-sm",
|
|
2793
2793
|
lg: "px-3 py-1.5 text-base"
|
|
2794
2794
|
};
|
|
2795
|
-
Badge =
|
|
2795
|
+
Badge = React81__default.forwardRef(
|
|
2796
2796
|
({ className, variant = "default", size = "sm", amount, label, icon, iconAsset, children, onRemove, removeLabel, ...props }, ref) => {
|
|
2797
2797
|
const iconSizes3 = {
|
|
2798
2798
|
sm: "h-icon-default w-icon-default",
|
|
@@ -3129,7 +3129,7 @@ var init_SvgFlow = __esm({
|
|
|
3129
3129
|
width = 100,
|
|
3130
3130
|
height = 100
|
|
3131
3131
|
}) => {
|
|
3132
|
-
const markerId =
|
|
3132
|
+
const markerId = React81__default.useMemo(() => {
|
|
3133
3133
|
flowIdCounter += 1;
|
|
3134
3134
|
return `almadar-flow-arrow-${flowIdCounter}`;
|
|
3135
3135
|
}, []);
|
|
@@ -3722,7 +3722,7 @@ var init_SvgRing = __esm({
|
|
|
3722
3722
|
width = 100,
|
|
3723
3723
|
height = 100
|
|
3724
3724
|
}) => {
|
|
3725
|
-
const gradientId =
|
|
3725
|
+
const gradientId = React81__default.useMemo(() => {
|
|
3726
3726
|
ringIdCounter += 1;
|
|
3727
3727
|
return `almadar-ring-glow-${ringIdCounter}`;
|
|
3728
3728
|
}, []);
|
|
@@ -3903,7 +3903,7 @@ var init_Input = __esm({
|
|
|
3903
3903
|
init_cn();
|
|
3904
3904
|
init_Icon();
|
|
3905
3905
|
init_useEventBus();
|
|
3906
|
-
Input =
|
|
3906
|
+
Input = React81__default.forwardRef(
|
|
3907
3907
|
({
|
|
3908
3908
|
className,
|
|
3909
3909
|
inputType,
|
|
@@ -4063,7 +4063,7 @@ var Label;
|
|
|
4063
4063
|
var init_Label = __esm({
|
|
4064
4064
|
"components/core/atoms/Label.tsx"() {
|
|
4065
4065
|
init_cn();
|
|
4066
|
-
Label =
|
|
4066
|
+
Label = React81__default.forwardRef(
|
|
4067
4067
|
({ className, required, children, ...props }, ref) => {
|
|
4068
4068
|
return /* @__PURE__ */ jsxs(
|
|
4069
4069
|
"label",
|
|
@@ -4090,7 +4090,7 @@ var init_Textarea = __esm({
|
|
|
4090
4090
|
"components/core/atoms/Textarea.tsx"() {
|
|
4091
4091
|
init_cn();
|
|
4092
4092
|
init_useEventBus();
|
|
4093
|
-
Textarea =
|
|
4093
|
+
Textarea = React81__default.forwardRef(
|
|
4094
4094
|
({ className, error, onChange, ...props }, ref) => {
|
|
4095
4095
|
const eventBus = useEventBus();
|
|
4096
4096
|
const handleChange = (e) => {
|
|
@@ -4329,7 +4329,7 @@ var init_Select = __esm({
|
|
|
4329
4329
|
init_cn();
|
|
4330
4330
|
init_Icon();
|
|
4331
4331
|
init_useEventBus();
|
|
4332
|
-
Select =
|
|
4332
|
+
Select = React81__default.forwardRef(
|
|
4333
4333
|
(props, _ref) => {
|
|
4334
4334
|
const { multiple, searchable, clearable } = props;
|
|
4335
4335
|
if (multiple || searchable || clearable) {
|
|
@@ -4346,7 +4346,7 @@ var init_Checkbox = __esm({
|
|
|
4346
4346
|
"components/core/atoms/Checkbox.tsx"() {
|
|
4347
4347
|
init_cn();
|
|
4348
4348
|
init_useEventBus();
|
|
4349
|
-
Checkbox =
|
|
4349
|
+
Checkbox = React81__default.forwardRef(
|
|
4350
4350
|
({ className, label, id, onChange, ...props }, ref) => {
|
|
4351
4351
|
const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
4352
4352
|
const eventBus = useEventBus();
|
|
@@ -4400,7 +4400,7 @@ var init_Spinner = __esm({
|
|
|
4400
4400
|
md: "h-6 w-6",
|
|
4401
4401
|
lg: "h-8 w-8"
|
|
4402
4402
|
};
|
|
4403
|
-
Spinner =
|
|
4403
|
+
Spinner = React81__default.forwardRef(
|
|
4404
4404
|
({ className, size = "md", overlay, ...props }, ref) => {
|
|
4405
4405
|
if (overlay) {
|
|
4406
4406
|
return /* @__PURE__ */ jsx(
|
|
@@ -4490,7 +4490,7 @@ var init_Card = __esm({
|
|
|
4490
4490
|
chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
|
|
4491
4491
|
"tile-image-first": "p-0 overflow-hidden"
|
|
4492
4492
|
};
|
|
4493
|
-
Card =
|
|
4493
|
+
Card = React81__default.forwardRef(
|
|
4494
4494
|
({
|
|
4495
4495
|
className,
|
|
4496
4496
|
variant = "bordered",
|
|
@@ -4538,9 +4538,9 @@ var init_Card = __esm({
|
|
|
4538
4538
|
}
|
|
4539
4539
|
);
|
|
4540
4540
|
Card.displayName = "Card";
|
|
4541
|
-
CardHeader =
|
|
4541
|
+
CardHeader = React81__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
4542
4542
|
CardHeader.displayName = "CardHeader";
|
|
4543
|
-
CardTitle =
|
|
4543
|
+
CardTitle = React81__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
4544
4544
|
"h3",
|
|
4545
4545
|
{
|
|
4546
4546
|
ref,
|
|
@@ -4553,11 +4553,11 @@ var init_Card = __esm({
|
|
|
4553
4553
|
}
|
|
4554
4554
|
));
|
|
4555
4555
|
CardTitle.displayName = "CardTitle";
|
|
4556
|
-
CardContent =
|
|
4556
|
+
CardContent = React81__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
|
|
4557
4557
|
CardContent.displayName = "CardContent";
|
|
4558
4558
|
CardBody = CardContent;
|
|
4559
4559
|
CardBody.displayName = "CardBody";
|
|
4560
|
-
CardFooter =
|
|
4560
|
+
CardFooter = React81__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
4561
4561
|
"div",
|
|
4562
4562
|
{
|
|
4563
4563
|
ref,
|
|
@@ -4568,6 +4568,38 @@ var init_Card = __esm({
|
|
|
4568
4568
|
CardFooter.displayName = "CardFooter";
|
|
4569
4569
|
}
|
|
4570
4570
|
});
|
|
4571
|
+
function GameIcon({ assetUrl, icon, size = "md", alt, className }) {
|
|
4572
|
+
const px = typeof size === "number" ? size : sizeMap[size];
|
|
4573
|
+
const family = useIconFamily();
|
|
4574
|
+
if (assetUrl?.url) {
|
|
4575
|
+
return /* @__PURE__ */ jsx(
|
|
4576
|
+
AtlasImage,
|
|
4577
|
+
{
|
|
4578
|
+
asset: assetUrl,
|
|
4579
|
+
size: px,
|
|
4580
|
+
alt: alt ?? assetUrl.category ?? "",
|
|
4581
|
+
className: cn("flex-shrink-0", className)
|
|
4582
|
+
}
|
|
4583
|
+
);
|
|
4584
|
+
}
|
|
4585
|
+
const I = typeof icon === "string" ? resolveIconForFamily(icon, family) : icon;
|
|
4586
|
+
return /* @__PURE__ */ jsx(I, { width: px, height: px, className: cn("flex-shrink-0", className) });
|
|
4587
|
+
}
|
|
4588
|
+
var sizeMap;
|
|
4589
|
+
var init_GameIcon = __esm({
|
|
4590
|
+
"components/core/atoms/GameIcon.tsx"() {
|
|
4591
|
+
"use client";
|
|
4592
|
+
init_cn();
|
|
4593
|
+
init_iconFamily();
|
|
4594
|
+
init_AtlasImage();
|
|
4595
|
+
sizeMap = {
|
|
4596
|
+
sm: 16,
|
|
4597
|
+
md: 24,
|
|
4598
|
+
lg: 32
|
|
4599
|
+
};
|
|
4600
|
+
GameIcon.displayName = "GameIcon";
|
|
4601
|
+
}
|
|
4602
|
+
});
|
|
4571
4603
|
var variantStyles5, sizeStyles4, iconSizes, FilterPill;
|
|
4572
4604
|
var init_FilterPill = __esm({
|
|
4573
4605
|
"components/core/atoms/FilterPill.tsx"() {
|
|
@@ -4612,7 +4644,7 @@ var init_FilterPill = __esm({
|
|
|
4612
4644
|
md: "w-3.5 h-3.5",
|
|
4613
4645
|
lg: "w-4 h-4"
|
|
4614
4646
|
};
|
|
4615
|
-
FilterPill =
|
|
4647
|
+
FilterPill = React81__default.forwardRef(
|
|
4616
4648
|
({
|
|
4617
4649
|
className,
|
|
4618
4650
|
variant = "default",
|
|
@@ -4741,8 +4773,8 @@ var init_Avatar = __esm({
|
|
|
4741
4773
|
actionPayload
|
|
4742
4774
|
}) => {
|
|
4743
4775
|
const eventBus = useEventBus();
|
|
4744
|
-
const [imgFailed, setImgFailed] =
|
|
4745
|
-
|
|
4776
|
+
const [imgFailed, setImgFailed] = React81__default.useState(false);
|
|
4777
|
+
React81__default.useEffect(() => {
|
|
4746
4778
|
setImgFailed(false);
|
|
4747
4779
|
}, [src]);
|
|
4748
4780
|
const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
|
|
@@ -4855,7 +4887,7 @@ var init_Center = __esm({
|
|
|
4855
4887
|
as: Component = "div"
|
|
4856
4888
|
}) => {
|
|
4857
4889
|
const mergedStyle = minHeight ? { minHeight, ...style } : style;
|
|
4858
|
-
return
|
|
4890
|
+
return React81__default.createElement(Component, {
|
|
4859
4891
|
className: cn(
|
|
4860
4892
|
inline ? "inline-flex" : "flex",
|
|
4861
4893
|
horizontal && "justify-center",
|
|
@@ -5123,7 +5155,7 @@ var init_Radio = __esm({
|
|
|
5123
5155
|
md: "w-2.5 h-2.5",
|
|
5124
5156
|
lg: "w-3 h-3"
|
|
5125
5157
|
};
|
|
5126
|
-
Radio =
|
|
5158
|
+
Radio = React81__default.forwardRef(
|
|
5127
5159
|
({
|
|
5128
5160
|
label,
|
|
5129
5161
|
helperText,
|
|
@@ -5140,12 +5172,12 @@ var init_Radio = __esm({
|
|
|
5140
5172
|
onChange,
|
|
5141
5173
|
...props
|
|
5142
5174
|
}, ref) => {
|
|
5143
|
-
const reactId =
|
|
5175
|
+
const reactId = React81__default.useId();
|
|
5144
5176
|
const baseId = id || `radio-${reactId}`;
|
|
5145
5177
|
const hasError = !!error;
|
|
5146
5178
|
const eventBus = useEventBus();
|
|
5147
|
-
const [selected, setSelected] =
|
|
5148
|
-
|
|
5179
|
+
const [selected, setSelected] = React81__default.useState(value);
|
|
5180
|
+
React81__default.useEffect(() => {
|
|
5149
5181
|
if (value !== void 0) setSelected(value);
|
|
5150
5182
|
}, [value]);
|
|
5151
5183
|
const pick = (next, e) => {
|
|
@@ -5327,7 +5359,7 @@ var init_Switch = __esm({
|
|
|
5327
5359
|
"components/core/atoms/Switch.tsx"() {
|
|
5328
5360
|
"use client";
|
|
5329
5361
|
init_cn();
|
|
5330
|
-
Switch =
|
|
5362
|
+
Switch = React81.forwardRef(
|
|
5331
5363
|
({
|
|
5332
5364
|
checked,
|
|
5333
5365
|
defaultChecked = false,
|
|
@@ -5338,10 +5370,10 @@ var init_Switch = __esm({
|
|
|
5338
5370
|
name,
|
|
5339
5371
|
className
|
|
5340
5372
|
}, ref) => {
|
|
5341
|
-
const [isChecked, setIsChecked] =
|
|
5373
|
+
const [isChecked, setIsChecked] = React81.useState(
|
|
5342
5374
|
checked !== void 0 ? checked : defaultChecked
|
|
5343
5375
|
);
|
|
5344
|
-
|
|
5376
|
+
React81.useEffect(() => {
|
|
5345
5377
|
if (checked !== void 0) {
|
|
5346
5378
|
setIsChecked(checked);
|
|
5347
5379
|
}
|
|
@@ -5504,7 +5536,7 @@ var init_Stack = __esm({
|
|
|
5504
5536
|
};
|
|
5505
5537
|
const isHorizontal = direction === "horizontal";
|
|
5506
5538
|
const directionClass = responsive && isHorizontal ? reverse ? "flex-col-reverse md:flex-row-reverse" : "flex-col md:flex-row" : isHorizontal ? reverse ? "flex-row-reverse" : "flex-row" : reverse ? "flex-col-reverse" : "flex-col";
|
|
5507
|
-
return
|
|
5539
|
+
return React81__default.createElement(
|
|
5508
5540
|
Component,
|
|
5509
5541
|
{
|
|
5510
5542
|
className: cn(
|
|
@@ -5550,7 +5582,7 @@ var init_TextHighlight = __esm({
|
|
|
5550
5582
|
}) => {
|
|
5551
5583
|
const eventBus = useEventBus();
|
|
5552
5584
|
const baseStyles = "cursor-pointer transition-all duration-150";
|
|
5553
|
-
const
|
|
5585
|
+
const typeStyles = {
|
|
5554
5586
|
question: cn(
|
|
5555
5587
|
// Blue border for questions
|
|
5556
5588
|
"bg-card border-b-2 border-primary-600",
|
|
@@ -5570,7 +5602,7 @@ var init_TextHighlight = __esm({
|
|
|
5570
5602
|
"data-highlight": "true",
|
|
5571
5603
|
"data-highlight-type": highlightType,
|
|
5572
5604
|
"data-annotation-id": annotationId,
|
|
5573
|
-
className: cn(baseStyles,
|
|
5605
|
+
className: cn(baseStyles, typeStyles[highlightType], className),
|
|
5574
5606
|
onClick: () => {
|
|
5575
5607
|
if (action) eventBus.emit(`UI:${action}`, { annotationId });
|
|
5576
5608
|
onClick?.();
|
|
@@ -5704,7 +5736,7 @@ var Aside;
|
|
|
5704
5736
|
var init_Aside = __esm({
|
|
5705
5737
|
"components/core/atoms/Aside.tsx"() {
|
|
5706
5738
|
init_cn();
|
|
5707
|
-
Aside =
|
|
5739
|
+
Aside = React81__default.forwardRef(
|
|
5708
5740
|
({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
|
|
5709
5741
|
);
|
|
5710
5742
|
Aside.displayName = "Aside";
|
|
@@ -5783,9 +5815,9 @@ var init_LawReferenceTooltip = __esm({
|
|
|
5783
5815
|
className
|
|
5784
5816
|
}) => {
|
|
5785
5817
|
const { t } = useTranslate();
|
|
5786
|
-
const [isVisible, setIsVisible] =
|
|
5787
|
-
const timeoutRef =
|
|
5788
|
-
const triggerRef =
|
|
5818
|
+
const [isVisible, setIsVisible] = React81__default.useState(false);
|
|
5819
|
+
const timeoutRef = React81__default.useRef(null);
|
|
5820
|
+
const triggerRef = React81__default.useRef(null);
|
|
5789
5821
|
const handleMouseEnter = () => {
|
|
5790
5822
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
5791
5823
|
timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
|
|
@@ -5796,7 +5828,7 @@ var init_LawReferenceTooltip = __esm({
|
|
|
5796
5828
|
};
|
|
5797
5829
|
const { revealed, triggerProps } = useTapReveal({ refs: [triggerRef] });
|
|
5798
5830
|
const open = isVisible || revealed;
|
|
5799
|
-
|
|
5831
|
+
React81__default.useEffect(() => {
|
|
5800
5832
|
return () => {
|
|
5801
5833
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
5802
5834
|
};
|
|
@@ -6006,7 +6038,7 @@ var init_StatusDot = __esm({
|
|
|
6006
6038
|
md: "w-2.5 h-2.5",
|
|
6007
6039
|
lg: "w-3 h-3"
|
|
6008
6040
|
};
|
|
6009
|
-
StatusDot =
|
|
6041
|
+
StatusDot = React81__default.forwardRef(
|
|
6010
6042
|
({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
|
|
6011
6043
|
return /* @__PURE__ */ jsx(
|
|
6012
6044
|
"span",
|
|
@@ -6060,7 +6092,7 @@ var init_TrendIndicator = __esm({
|
|
|
6060
6092
|
down: "trending-down",
|
|
6061
6093
|
flat: "arrow-right"
|
|
6062
6094
|
};
|
|
6063
|
-
TrendIndicator =
|
|
6095
|
+
TrendIndicator = React81__default.forwardRef(
|
|
6064
6096
|
({
|
|
6065
6097
|
className,
|
|
6066
6098
|
value,
|
|
@@ -6127,7 +6159,7 @@ var init_RangeSlider = __esm({
|
|
|
6127
6159
|
md: "w-4 h-4",
|
|
6128
6160
|
lg: "w-5 h-5"
|
|
6129
6161
|
};
|
|
6130
|
-
RangeSlider =
|
|
6162
|
+
RangeSlider = React81__default.forwardRef(
|
|
6131
6163
|
({
|
|
6132
6164
|
className,
|
|
6133
6165
|
min = 0,
|
|
@@ -6686,7 +6718,7 @@ var init_ContentSection = __esm({
|
|
|
6686
6718
|
md: "py-16",
|
|
6687
6719
|
lg: "py-24"
|
|
6688
6720
|
};
|
|
6689
|
-
ContentSection =
|
|
6721
|
+
ContentSection = React81__default.forwardRef(
|
|
6690
6722
|
({ children, background = "default", padding = "lg", id, className }, ref) => {
|
|
6691
6723
|
return /* @__PURE__ */ jsx(
|
|
6692
6724
|
Box,
|
|
@@ -7220,7 +7252,7 @@ var init_AnimatedReveal = __esm({
|
|
|
7220
7252
|
"scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
|
|
7221
7253
|
"none": {}
|
|
7222
7254
|
};
|
|
7223
|
-
AnimatedReveal =
|
|
7255
|
+
AnimatedReveal = React81__default.forwardRef(
|
|
7224
7256
|
({
|
|
7225
7257
|
trigger = "scroll",
|
|
7226
7258
|
animation = "fade-up",
|
|
@@ -7380,7 +7412,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
7380
7412
|
"components/marketing/atoms/AnimatedGraphic.tsx"() {
|
|
7381
7413
|
"use client";
|
|
7382
7414
|
init_cn();
|
|
7383
|
-
AnimatedGraphic =
|
|
7415
|
+
AnimatedGraphic = React81__default.forwardRef(
|
|
7384
7416
|
({
|
|
7385
7417
|
src,
|
|
7386
7418
|
svgContent,
|
|
@@ -7403,7 +7435,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
7403
7435
|
const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
|
|
7404
7436
|
const resolvedSvg = svgContent ?? fetchedSvg;
|
|
7405
7437
|
const prevAnimateRef = useRef(animate);
|
|
7406
|
-
const setRef =
|
|
7438
|
+
const setRef = React81__default.useCallback(
|
|
7407
7439
|
(node) => {
|
|
7408
7440
|
containerRef.current = node;
|
|
7409
7441
|
if (typeof ref === "function") ref(node);
|
|
@@ -7544,15 +7576,15 @@ var init_TraitFrame = __esm({
|
|
|
7544
7576
|
}
|
|
7545
7577
|
});
|
|
7546
7578
|
|
|
7547
|
-
//
|
|
7579
|
+
// lib/boardEntity.ts
|
|
7548
7580
|
var init_boardEntity = __esm({
|
|
7549
|
-
"
|
|
7581
|
+
"lib/boardEntity.ts"() {
|
|
7550
7582
|
}
|
|
7551
7583
|
});
|
|
7552
7584
|
|
|
7553
|
-
//
|
|
7585
|
+
// lib/makeAsset.ts
|
|
7554
7586
|
var init_makeAsset = __esm({
|
|
7555
|
-
"
|
|
7587
|
+
"lib/makeAsset.ts"() {
|
|
7556
7588
|
}
|
|
7557
7589
|
});
|
|
7558
7590
|
function getState() {
|
|
@@ -7841,13 +7873,13 @@ function useImageCache(urls) {
|
|
|
7841
7873
|
};
|
|
7842
7874
|
}
|
|
7843
7875
|
var init_useImageCache = __esm({
|
|
7844
|
-
"
|
|
7876
|
+
"hooks/useImageCache.ts"() {
|
|
7845
7877
|
"use client";
|
|
7846
7878
|
init_verificationRegistry();
|
|
7847
7879
|
}
|
|
7848
7880
|
});
|
|
7849
7881
|
|
|
7850
|
-
//
|
|
7882
|
+
// lib/isometric.ts
|
|
7851
7883
|
function isoToScreen(tileX, tileY, scale, baseOffsetX, layout = "isometric") {
|
|
7852
7884
|
const scaledTileWidth = TILE_WIDTH * scale;
|
|
7853
7885
|
const scaledFloorHeight = FLOOR_HEIGHT * scale;
|
|
@@ -7885,7 +7917,7 @@ function screenToIso(screenX, screenY, scale, baseOffsetX, layout = "isometric")
|
|
|
7885
7917
|
}
|
|
7886
7918
|
var TILE_WIDTH, FLOOR_HEIGHT, DIAMOND_TOP_Y, BACKGROUND_FALLBACK_COLOR, MINIMAP_TERRAIN_COLORS;
|
|
7887
7919
|
var init_isometric = __esm({
|
|
7888
|
-
"
|
|
7920
|
+
"lib/isometric.ts"() {
|
|
7889
7921
|
TILE_WIDTH = 256;
|
|
7890
7922
|
FLOOR_HEIGHT = 128;
|
|
7891
7923
|
DIAMOND_TOP_Y = 374;
|
|
@@ -7898,155 +7930,13 @@ var init_isometric = __esm({
|
|
|
7898
7930
|
}
|
|
7899
7931
|
});
|
|
7900
7932
|
|
|
7901
|
-
//
|
|
7902
|
-
|
|
7903
|
-
|
|
7904
|
-
sx: frame % columns * frameWidth,
|
|
7905
|
-
sy: row * frameHeight,
|
|
7906
|
-
sw: frameWidth,
|
|
7907
|
-
sh: frameHeight
|
|
7908
|
-
};
|
|
7909
|
-
}
|
|
7910
|
-
var init_spriteAnimation = __esm({
|
|
7911
|
-
"components/game/lib/spriteAnimation.ts"() {
|
|
7912
|
-
}
|
|
7913
|
-
});
|
|
7914
|
-
|
|
7915
|
-
// components/game/lib/index.ts
|
|
7916
|
-
var init_lib = __esm({
|
|
7917
|
-
"components/game/lib/index.ts"() {
|
|
7933
|
+
// lib/gameShared.ts
|
|
7934
|
+
var init_gameShared = __esm({
|
|
7935
|
+
"lib/gameShared.ts"() {
|
|
7918
7936
|
init_boardEntity();
|
|
7919
7937
|
init_makeAsset();
|
|
7920
7938
|
}
|
|
7921
7939
|
});
|
|
7922
|
-
function GameIcon({ assetUrl, icon, size = "md", alt, className }) {
|
|
7923
|
-
const px = typeof size === "number" ? size : sizeMap[size];
|
|
7924
|
-
if (assetUrl?.url) {
|
|
7925
|
-
return /* @__PURE__ */ jsx(
|
|
7926
|
-
AtlasImage,
|
|
7927
|
-
{
|
|
7928
|
-
asset: assetUrl,
|
|
7929
|
-
size: px,
|
|
7930
|
-
alt: alt ?? assetUrl.category ?? "",
|
|
7931
|
-
className: cn("flex-shrink-0", className)
|
|
7932
|
-
}
|
|
7933
|
-
);
|
|
7934
|
-
}
|
|
7935
|
-
const I = typeof icon === "string" ? resolveIcon(icon) : icon;
|
|
7936
|
-
return /* @__PURE__ */ jsx(I, { width: px, height: px, className: cn("flex-shrink-0", className) });
|
|
7937
|
-
}
|
|
7938
|
-
var sizeMap;
|
|
7939
|
-
var init_GameIcon = __esm({
|
|
7940
|
-
"components/game/atoms/GameIcon.tsx"() {
|
|
7941
|
-
"use client";
|
|
7942
|
-
init_cn();
|
|
7943
|
-
init_Icon();
|
|
7944
|
-
init_AtlasImage();
|
|
7945
|
-
sizeMap = {
|
|
7946
|
-
sm: 16,
|
|
7947
|
-
md: 24,
|
|
7948
|
-
lg: 32
|
|
7949
|
-
};
|
|
7950
|
-
GameIcon.displayName = "GameIcon";
|
|
7951
|
-
}
|
|
7952
|
-
});
|
|
7953
|
-
function GameCard({
|
|
7954
|
-
id,
|
|
7955
|
-
cost,
|
|
7956
|
-
art,
|
|
7957
|
-
frameAsset,
|
|
7958
|
-
attack,
|
|
7959
|
-
defense,
|
|
7960
|
-
name,
|
|
7961
|
-
selected = false,
|
|
7962
|
-
disabled = false,
|
|
7963
|
-
size = "md",
|
|
7964
|
-
animState = "idle",
|
|
7965
|
-
onClick,
|
|
7966
|
-
clickEvent,
|
|
7967
|
-
className
|
|
7968
|
-
}) {
|
|
7969
|
-
const eventBus = useEventBus();
|
|
7970
|
-
const handleClick = React88.useCallback(() => {
|
|
7971
|
-
if (disabled) return;
|
|
7972
|
-
onClick?.(id);
|
|
7973
|
-
if (clickEvent) eventBus.emit(`UI:${clickEvent}`, { cardId: id });
|
|
7974
|
-
}, [disabled, id, onClick, clickEvent, eventBus]);
|
|
7975
|
-
const artPx = artPxMap[size];
|
|
7976
|
-
return /* @__PURE__ */ jsxs(
|
|
7977
|
-
Button,
|
|
7978
|
-
{
|
|
7979
|
-
variant: "ghost",
|
|
7980
|
-
onClick: handleClick,
|
|
7981
|
-
disabled,
|
|
7982
|
-
title: name,
|
|
7983
|
-
className: cn(
|
|
7984
|
-
"relative isolate flex flex-col items-center rounded-interactive",
|
|
7985
|
-
"px-1.5 pt-1.5 pb-1 transition-all duration-150",
|
|
7986
|
-
frameAsset?.url ? "border-0" : "border-2 bg-card/90",
|
|
7987
|
-
cardSizeMap[size],
|
|
7988
|
-
disabled ? "border-border opacity-50 cursor-not-allowed" : "border-accent hover:brightness-125 hover:-translate-y-1 cursor-pointer",
|
|
7989
|
-
selected && "ring-2 ring-foreground ring-offset-1 ring-offset-background -translate-y-1",
|
|
7990
|
-
ANIM_STATE_CLASS[animState],
|
|
7991
|
-
className
|
|
7992
|
-
),
|
|
7993
|
-
children: [
|
|
7994
|
-
frameAsset?.url && /* @__PURE__ */ jsx(AtlasImage, { asset: frameAsset, fill: true, fit: "fill", "aria-hidden": true, style: { zIndex: -1 } }),
|
|
7995
|
-
cost != null && /* @__PURE__ */ jsx(
|
|
7996
|
-
Typography,
|
|
7997
|
-
{
|
|
7998
|
-
as: "span",
|
|
7999
|
-
className: cn(
|
|
8000
|
-
"absolute -top-2 -left-2 flex items-center justify-center",
|
|
8001
|
-
"min-w-[22px] h-[22px] rounded-full px-1",
|
|
8002
|
-
"bg-info text-foreground text-xs font-bold border border-background"
|
|
8003
|
-
),
|
|
8004
|
-
children: cost
|
|
8005
|
-
}
|
|
8006
|
-
),
|
|
8007
|
-
/* @__PURE__ */ jsx(Box, { className: "flex-1 flex items-center justify-center w-full", children: art ? /* @__PURE__ */ jsx(GameIcon, { assetUrl: art, icon: "image", size: artPx, alt: name ?? id, className: "flex-shrink-0" }) : /* @__PURE__ */ jsx(Box, { className: "rounded bg-muted/40", style: { width: artPx, height: artPx } }) }),
|
|
8008
|
-
name != null && /* @__PURE__ */ jsx(
|
|
8009
|
-
Typography,
|
|
8010
|
-
{
|
|
8011
|
-
variant: "small",
|
|
8012
|
-
className: "w-full truncate text-center text-[10px] leading-tight font-semibold",
|
|
8013
|
-
children: name
|
|
8014
|
-
}
|
|
8015
|
-
),
|
|
8016
|
-
(attack != null || defense != null) && /* @__PURE__ */ jsxs(Box, { className: "flex w-full items-center justify-between px-0.5 text-[10px] font-bold leading-none", children: [
|
|
8017
|
-
/* @__PURE__ */ jsx(Typography, { as: "span", className: "text-error", children: attack != null ? `\u2694${attack}` : "" }),
|
|
8018
|
-
/* @__PURE__ */ jsx(Typography, { as: "span", className: "text-info", children: defense != null ? `\u{1F6E1}${defense}` : "" })
|
|
8019
|
-
] })
|
|
8020
|
-
]
|
|
8021
|
-
}
|
|
8022
|
-
);
|
|
8023
|
-
}
|
|
8024
|
-
var cardSizeMap, artPxMap, ANIM_STATE_CLASS;
|
|
8025
|
-
var init_GameCard = __esm({
|
|
8026
|
-
"components/game/atoms/GameCard.tsx"() {
|
|
8027
|
-
"use client";
|
|
8028
|
-
init_cn();
|
|
8029
|
-
init_useEventBus();
|
|
8030
|
-
init_Box();
|
|
8031
|
-
init_Button();
|
|
8032
|
-
init_Typography();
|
|
8033
|
-
init_AtlasImage();
|
|
8034
|
-
init_GameIcon();
|
|
8035
|
-
cardSizeMap = {
|
|
8036
|
-
sm: "w-16 h-24",
|
|
8037
|
-
md: "w-20 h-28",
|
|
8038
|
-
lg: "w-24 h-36"
|
|
8039
|
-
};
|
|
8040
|
-
artPxMap = { sm: 40, md: 52, lg: 64 };
|
|
8041
|
-
ANIM_STATE_CLASS = {
|
|
8042
|
-
idle: "",
|
|
8043
|
-
drawn: "scale-105",
|
|
8044
|
-
played: "-translate-y-2 opacity-80",
|
|
8045
|
-
flipped: "scale-x-0"
|
|
8046
|
-
};
|
|
8047
|
-
GameCard.displayName = "GameCard";
|
|
8048
|
-
}
|
|
8049
|
-
});
|
|
8050
7940
|
function HealthBar({
|
|
8051
7941
|
current = 3,
|
|
8052
7942
|
max = 5,
|
|
@@ -8251,9 +8141,9 @@ function ControlButton({
|
|
|
8251
8141
|
className
|
|
8252
8142
|
}) {
|
|
8253
8143
|
const eventBus = useEventBus();
|
|
8254
|
-
const [isPressed, setIsPressed] =
|
|
8144
|
+
const [isPressed, setIsPressed] = React81.useState(false);
|
|
8255
8145
|
const actualPressed = pressed ?? isPressed;
|
|
8256
|
-
const handlePointerDown =
|
|
8146
|
+
const handlePointerDown = React81.useCallback(
|
|
8257
8147
|
(e) => {
|
|
8258
8148
|
e.preventDefault();
|
|
8259
8149
|
if (disabled) return;
|
|
@@ -8263,7 +8153,7 @@ function ControlButton({
|
|
|
8263
8153
|
},
|
|
8264
8154
|
[disabled, pressEvent, eventBus, onPress]
|
|
8265
8155
|
);
|
|
8266
|
-
const handlePointerUp =
|
|
8156
|
+
const handlePointerUp = React81.useCallback(
|
|
8267
8157
|
(e) => {
|
|
8268
8158
|
e.preventDefault();
|
|
8269
8159
|
if (disabled) return;
|
|
@@ -8273,7 +8163,7 @@ function ControlButton({
|
|
|
8273
8163
|
},
|
|
8274
8164
|
[disabled, releaseEvent, eventBus, onRelease]
|
|
8275
8165
|
);
|
|
8276
|
-
const handlePointerLeave =
|
|
8166
|
+
const handlePointerLeave = React81.useCallback(
|
|
8277
8167
|
(e) => {
|
|
8278
8168
|
if (isPressed) {
|
|
8279
8169
|
setIsPressed(false);
|
|
@@ -8344,157 +8234,6 @@ var init_ControlButton = __esm({
|
|
|
8344
8234
|
ControlButton.displayName = "ControlButton";
|
|
8345
8235
|
}
|
|
8346
8236
|
});
|
|
8347
|
-
function Sprite({
|
|
8348
|
-
spritesheet = DEFAULT_SPRITESHEET,
|
|
8349
|
-
frameWidth = 64,
|
|
8350
|
-
frameHeight = 64,
|
|
8351
|
-
frame = 0,
|
|
8352
|
-
x = 0,
|
|
8353
|
-
y = 0,
|
|
8354
|
-
scale = 1,
|
|
8355
|
-
flipX = false,
|
|
8356
|
-
flipY = false,
|
|
8357
|
-
rotation = 0,
|
|
8358
|
-
opacity = 1,
|
|
8359
|
-
zIndex = 0,
|
|
8360
|
-
columns = 16,
|
|
8361
|
-
animState: _animState,
|
|
8362
|
-
frameRate: _frameRate,
|
|
8363
|
-
className,
|
|
8364
|
-
onClick,
|
|
8365
|
-
action
|
|
8366
|
-
}) {
|
|
8367
|
-
const eventBus = useEventBus();
|
|
8368
|
-
const sourcePosition = useMemo(() => {
|
|
8369
|
-
const { sx, sy } = frameRect(frame, Math.floor(frame / columns), columns, frameWidth, frameHeight);
|
|
8370
|
-
return { x: sx, y: sy };
|
|
8371
|
-
}, [frame, columns, frameWidth, frameHeight]);
|
|
8372
|
-
const transform = useMemo(() => {
|
|
8373
|
-
const transforms = [
|
|
8374
|
-
`translate(${x}px, ${y}px)`
|
|
8375
|
-
];
|
|
8376
|
-
if (scale !== 1) {
|
|
8377
|
-
transforms.push(`scale(${scale})`);
|
|
8378
|
-
}
|
|
8379
|
-
if (flipX || flipY) {
|
|
8380
|
-
transforms.push(`scale(${flipX ? -1 : 1}, ${flipY ? -1 : 1})`);
|
|
8381
|
-
}
|
|
8382
|
-
if (rotation !== 0) {
|
|
8383
|
-
transforms.push(`rotate(${rotation}deg)`);
|
|
8384
|
-
}
|
|
8385
|
-
return transforms.join(" ");
|
|
8386
|
-
}, [x, y, scale, flipX, flipY, rotation]);
|
|
8387
|
-
const backgroundPosition = `-${sourcePosition.x}px -${sourcePosition.y}px`;
|
|
8388
|
-
const handleClick = () => {
|
|
8389
|
-
if (action) eventBus.emit(`UI:${action}`, {});
|
|
8390
|
-
onClick?.();
|
|
8391
|
-
};
|
|
8392
|
-
return /* @__PURE__ */ jsx(
|
|
8393
|
-
Box,
|
|
8394
|
-
{
|
|
8395
|
-
position: "absolute",
|
|
8396
|
-
className,
|
|
8397
|
-
onClick: action || onClick ? handleClick : void 0,
|
|
8398
|
-
style: {
|
|
8399
|
-
width: frameWidth,
|
|
8400
|
-
height: frameHeight,
|
|
8401
|
-
backgroundImage: `url(${spritesheet.url})`,
|
|
8402
|
-
backgroundPosition,
|
|
8403
|
-
backgroundRepeat: "no-repeat",
|
|
8404
|
-
imageRendering: "pixelated",
|
|
8405
|
-
transform,
|
|
8406
|
-
transformOrigin: "center center",
|
|
8407
|
-
opacity,
|
|
8408
|
-
zIndex,
|
|
8409
|
-
pointerEvents: action || onClick ? "auto" : "none"
|
|
8410
|
-
}
|
|
8411
|
-
}
|
|
8412
|
-
);
|
|
8413
|
-
}
|
|
8414
|
-
var DEFAULT_SPRITESHEET;
|
|
8415
|
-
var init_Sprite = __esm({
|
|
8416
|
-
"components/game/atoms/Sprite.tsx"() {
|
|
8417
|
-
"use client";
|
|
8418
|
-
init_useEventBus();
|
|
8419
|
-
init_Box();
|
|
8420
|
-
init_spriteAnimation();
|
|
8421
|
-
DEFAULT_SPRITESHEET = {
|
|
8422
|
-
url: "https://almadar-kflow-assets.web.app/shared/isometric-blocks/Spritesheet/allTiles_sheet.png",
|
|
8423
|
-
role: "tile",
|
|
8424
|
-
category: "tile"
|
|
8425
|
-
};
|
|
8426
|
-
}
|
|
8427
|
-
});
|
|
8428
|
-
function isKnownState(s) {
|
|
8429
|
-
return s in DEFAULT_STATE_STYLES;
|
|
8430
|
-
}
|
|
8431
|
-
function StateIndicator({
|
|
8432
|
-
assetUrl = DEFAULT_ASSET_URL,
|
|
8433
|
-
state = "idle",
|
|
8434
|
-
label,
|
|
8435
|
-
size = "md",
|
|
8436
|
-
animated = true,
|
|
8437
|
-
stateStyles,
|
|
8438
|
-
className
|
|
8439
|
-
}) {
|
|
8440
|
-
const mergedStyles = stateStyles ? { ...DEFAULT_STATE_STYLES, ...stateStyles } : DEFAULT_STATE_STYLES;
|
|
8441
|
-
const knownState = isKnownState(state) ? state : null;
|
|
8442
|
-
const config = knownState !== null ? mergedStyles[knownState] ?? DEFAULT_STYLE : DEFAULT_STYLE;
|
|
8443
|
-
const displayLabel = label ?? state.charAt(0).toUpperCase() + state.slice(1);
|
|
8444
|
-
return /* @__PURE__ */ jsxs(
|
|
8445
|
-
Box,
|
|
8446
|
-
{
|
|
8447
|
-
display: "inline-flex",
|
|
8448
|
-
className: cn(
|
|
8449
|
-
"items-center gap-1 rounded-full text-foreground font-medium",
|
|
8450
|
-
config.bgClass,
|
|
8451
|
-
SIZE_CLASSES[size],
|
|
8452
|
-
animated && (knownState === null || !STATIC_STATES.has(knownState)) && "animate-pulse",
|
|
8453
|
-
className
|
|
8454
|
-
),
|
|
8455
|
-
children: [
|
|
8456
|
-
/* @__PURE__ */ jsx(Box, { as: "span", children: assetUrl ? /* @__PURE__ */ jsx(GameIcon, { assetUrl, icon: "image", size: 16, alt: displayLabel, className: "flex-shrink-0" }) : typeof config.icon === "string" ? /^[a-zA-Z0-9-]+$/.test(config.icon) ? /* @__PURE__ */ jsx(Icon, { name: config.icon }) : config.icon : /* @__PURE__ */ jsx(Icon, { icon: config.icon }) }),
|
|
8457
|
-
/* @__PURE__ */ jsx(Box, { as: "span", children: displayLabel })
|
|
8458
|
-
]
|
|
8459
|
-
}
|
|
8460
|
-
);
|
|
8461
|
-
}
|
|
8462
|
-
var DEFAULT_ASSET_URL, DEFAULT_STATE_STYLES, DEFAULT_STYLE, STATIC_STATES, SIZE_CLASSES;
|
|
8463
|
-
var init_StateIndicator = __esm({
|
|
8464
|
-
"components/game/atoms/StateIndicator.tsx"() {
|
|
8465
|
-
init_Box();
|
|
8466
|
-
init_Icon();
|
|
8467
|
-
init_cn();
|
|
8468
|
-
init_GameIcon();
|
|
8469
|
-
DEFAULT_ASSET_URL = {
|
|
8470
|
-
url: "https://almadar-kflow-assets.web.app/shared/isometric-dungeon/Isometric/chestClosed_E.png",
|
|
8471
|
-
role: "ui",
|
|
8472
|
-
category: "state"
|
|
8473
|
-
};
|
|
8474
|
-
DEFAULT_STATE_STYLES = {
|
|
8475
|
-
idle: { icon: "\u23F8", bgClass: "bg-muted" },
|
|
8476
|
-
active: { icon: "\u25B6", bgClass: "bg-success" },
|
|
8477
|
-
sleeping: { icon: "\u{1F4A4}", bgClass: "bg-muted" },
|
|
8478
|
-
moving: { icon: "\u{1F6B6}", bgClass: "bg-info" },
|
|
8479
|
-
eating: { icon: "\u{1F37D}\uFE0F", bgClass: "bg-success" },
|
|
8480
|
-
waiting: { icon: "\u23F3", bgClass: "bg-warning" },
|
|
8481
|
-
happy: { icon: "\u{1F60A}", bgClass: "bg-success" },
|
|
8482
|
-
scared: { icon: "\u{1F628}", bgClass: "bg-error" },
|
|
8483
|
-
done: { icon: "\u2713", bgClass: "bg-success" },
|
|
8484
|
-
error: { icon: "\u2717", bgClass: "bg-error" },
|
|
8485
|
-
ready: { icon: "\u2713", bgClass: "bg-success" },
|
|
8486
|
-
cooldown: { icon: "\u{1F504}", bgClass: "bg-warning" }
|
|
8487
|
-
};
|
|
8488
|
-
DEFAULT_STYLE = { icon: "?", bgClass: "bg-muted" };
|
|
8489
|
-
STATIC_STATES = /* @__PURE__ */ new Set(["idle", "done"]);
|
|
8490
|
-
SIZE_CLASSES = {
|
|
8491
|
-
sm: "text-xs px-1.5 py-0.5",
|
|
8492
|
-
md: "text-sm px-2 py-1",
|
|
8493
|
-
lg: "text-base px-3 py-1.5"
|
|
8494
|
-
};
|
|
8495
|
-
StateIndicator.displayName = "StateIndicator";
|
|
8496
|
-
}
|
|
8497
|
-
});
|
|
8498
8237
|
function formatTime(seconds, format) {
|
|
8499
8238
|
const clamped = Math.max(0, Math.floor(seconds));
|
|
8500
8239
|
if (format === "ss") {
|
|
@@ -8551,524 +8290,6 @@ var init_TimerDisplay = __esm({
|
|
|
8551
8290
|
TimerDisplay.displayName = "TimerDisplay";
|
|
8552
8291
|
}
|
|
8553
8292
|
});
|
|
8554
|
-
function ResourceCounter({
|
|
8555
|
-
assetUrl = DEFAULT_ASSET_URL2,
|
|
8556
|
-
icon,
|
|
8557
|
-
label = "Gold",
|
|
8558
|
-
value = 250,
|
|
8559
|
-
max,
|
|
8560
|
-
color,
|
|
8561
|
-
size = "md",
|
|
8562
|
-
className
|
|
8563
|
-
}) {
|
|
8564
|
-
const sizes = sizeMap6[size];
|
|
8565
|
-
return /* @__PURE__ */ jsxs(
|
|
8566
|
-
Box,
|
|
8567
|
-
{
|
|
8568
|
-
className: cn(
|
|
8569
|
-
"inline-flex items-center rounded-container",
|
|
8570
|
-
"bg-card/80 border border-muted font-medium text-foreground",
|
|
8571
|
-
sizes.wrapper,
|
|
8572
|
-
className
|
|
8573
|
-
),
|
|
8574
|
-
children: [
|
|
8575
|
-
assetUrl ? /* @__PURE__ */ jsx(GameIcon, { assetUrl, icon: "image", size: sizes.img, alt: label, className: "flex-shrink-0" }) : icon ? /* @__PURE__ */ jsx(Box, { as: "span", className: cn("flex-shrink-0", sizes.icon), children: typeof icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: icon }) : /* @__PURE__ */ jsx(Icon, { icon }) }) : null,
|
|
8576
|
-
/* @__PURE__ */ jsx(Typography, { as: "span", className: "text-muted-foreground", children: label }),
|
|
8577
|
-
/* @__PURE__ */ jsxs(Typography, { as: "span", className: cn("font-bold tabular-nums", color && (color in colorTokenClasses2 ? colorTokenClasses2[color] : color)), children: [
|
|
8578
|
-
value,
|
|
8579
|
-
max != null && /* @__PURE__ */ jsxs(Typography, { as: "span", className: "text-muted-foreground", children: [
|
|
8580
|
-
"/",
|
|
8581
|
-
max
|
|
8582
|
-
] })
|
|
8583
|
-
] })
|
|
8584
|
-
]
|
|
8585
|
-
}
|
|
8586
|
-
);
|
|
8587
|
-
}
|
|
8588
|
-
var colorTokenClasses2, DEFAULT_ASSET_URL2, sizeMap6;
|
|
8589
|
-
var init_ResourceCounter = __esm({
|
|
8590
|
-
"components/game/atoms/ResourceCounter.tsx"() {
|
|
8591
|
-
init_cn();
|
|
8592
|
-
init_Icon();
|
|
8593
|
-
init_Box();
|
|
8594
|
-
init_Typography();
|
|
8595
|
-
init_GameIcon();
|
|
8596
|
-
colorTokenClasses2 = {
|
|
8597
|
-
primary: "text-primary",
|
|
8598
|
-
secondary: "text-secondary",
|
|
8599
|
-
success: "text-success",
|
|
8600
|
-
warning: "text-warning",
|
|
8601
|
-
error: "text-error",
|
|
8602
|
-
muted: "text-muted-foreground"
|
|
8603
|
-
};
|
|
8604
|
-
DEFAULT_ASSET_URL2 = {
|
|
8605
|
-
url: "https://almadar-kflow-assets.web.app/shared/world-map/gold_mine.png",
|
|
8606
|
-
role: "ui",
|
|
8607
|
-
category: "coin"
|
|
8608
|
-
};
|
|
8609
|
-
sizeMap6 = {
|
|
8610
|
-
sm: { wrapper: "text-xs gap-1 px-1.5 py-0.5", icon: "text-sm", img: 16 },
|
|
8611
|
-
md: { wrapper: "text-sm gap-1.5 px-2 py-1", icon: "text-base", img: 20 },
|
|
8612
|
-
lg: { wrapper: "text-base gap-2 px-3 py-1.5", icon: "text-lg", img: 28 }
|
|
8613
|
-
};
|
|
8614
|
-
ResourceCounter.displayName = "ResourceCounter";
|
|
8615
|
-
}
|
|
8616
|
-
});
|
|
8617
|
-
function ItemSlot({
|
|
8618
|
-
assetUrl = DEFAULT_ASSET_URL3,
|
|
8619
|
-
icon = "sword",
|
|
8620
|
-
label = "Iron Sword",
|
|
8621
|
-
quantity,
|
|
8622
|
-
rarity = "uncommon",
|
|
8623
|
-
empty,
|
|
8624
|
-
size = "md",
|
|
8625
|
-
selected,
|
|
8626
|
-
onClick,
|
|
8627
|
-
action,
|
|
8628
|
-
className
|
|
8629
|
-
}) {
|
|
8630
|
-
const eventBus = useEventBus();
|
|
8631
|
-
const isClickable = onClick != null || action != null;
|
|
8632
|
-
const px = assetSizeMap[size];
|
|
8633
|
-
return /* @__PURE__ */ jsx(
|
|
8634
|
-
Button,
|
|
8635
|
-
{
|
|
8636
|
-
variant: "ghost",
|
|
8637
|
-
onClick: () => {
|
|
8638
|
-
if (action) eventBus.emit(`UI:${action}`, {});
|
|
8639
|
-
onClick?.();
|
|
8640
|
-
},
|
|
8641
|
-
disabled: !isClickable,
|
|
8642
|
-
title: label,
|
|
8643
|
-
className: cn(
|
|
8644
|
-
"relative flex items-center justify-center rounded-interactive border-2",
|
|
8645
|
-
"bg-card/80 transition-all duration-150",
|
|
8646
|
-
sizeMap7[size],
|
|
8647
|
-
empty ? "border-border bg-card/50" : rarityBorderMap[rarity],
|
|
8648
|
-
!empty && rarityGlowMap[rarity],
|
|
8649
|
-
selected && "ring-2 ring-foreground ring-offset-1 ring-offset-background",
|
|
8650
|
-
isClickable && !empty && "hover:brightness-125 cursor-pointer",
|
|
8651
|
-
isClickable && empty && "hover:border-muted cursor-pointer",
|
|
8652
|
-
!isClickable && "cursor-default",
|
|
8653
|
-
className
|
|
8654
|
-
),
|
|
8655
|
-
children: empty ? /* @__PURE__ */ jsx(Typography, { as: "span", className: "text-muted-foreground text-base", children: "+" }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
8656
|
-
assetUrl ? /* @__PURE__ */ jsx(GameIcon, { assetUrl, icon: "image", size: px, alt: label, className: "flex-shrink-0" }) : icon ? /* @__PURE__ */ jsx(Box, { as: "span", className: "flex-shrink-0", children: typeof icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: icon }) : /* @__PURE__ */ jsx(Icon, { icon }) }) : null,
|
|
8657
|
-
quantity != null && quantity > 1 && /* @__PURE__ */ jsx(
|
|
8658
|
-
Typography,
|
|
8659
|
-
{
|
|
8660
|
-
as: "span",
|
|
8661
|
-
className: cn(
|
|
8662
|
-
"absolute -bottom-1 -right-1 flex items-center justify-center",
|
|
8663
|
-
"min-w-[18px] h-[18px] rounded-full px-1",
|
|
8664
|
-
"bg-surface border border-muted text-xs font-bold text-foreground"
|
|
8665
|
-
),
|
|
8666
|
-
children: quantity
|
|
8667
|
-
}
|
|
8668
|
-
)
|
|
8669
|
-
] })
|
|
8670
|
-
}
|
|
8671
|
-
);
|
|
8672
|
-
}
|
|
8673
|
-
var sizeMap7, rarityBorderMap, rarityGlowMap, DEFAULT_ASSET_URL3, assetSizeMap;
|
|
8674
|
-
var init_ItemSlot = __esm({
|
|
8675
|
-
"components/game/atoms/ItemSlot.tsx"() {
|
|
8676
|
-
"use client";
|
|
8677
|
-
init_cn();
|
|
8678
|
-
init_Icon();
|
|
8679
|
-
init_useEventBus();
|
|
8680
|
-
init_Button();
|
|
8681
|
-
init_Box();
|
|
8682
|
-
init_Typography();
|
|
8683
|
-
init_GameIcon();
|
|
8684
|
-
sizeMap7 = {
|
|
8685
|
-
sm: "w-10 h-10 text-lg",
|
|
8686
|
-
md: "w-14 h-14 text-2xl",
|
|
8687
|
-
lg: "w-18 h-18 text-3xl"
|
|
8688
|
-
};
|
|
8689
|
-
rarityBorderMap = {
|
|
8690
|
-
common: "border-muted",
|
|
8691
|
-
uncommon: "border-success",
|
|
8692
|
-
rare: "border-info",
|
|
8693
|
-
epic: "border-accent",
|
|
8694
|
-
legendary: "border-warning"
|
|
8695
|
-
};
|
|
8696
|
-
rarityGlowMap = {
|
|
8697
|
-
common: "",
|
|
8698
|
-
uncommon: "",
|
|
8699
|
-
rare: "shadow-sm",
|
|
8700
|
-
epic: "shadow-lg",
|
|
8701
|
-
legendary: "shadow-lg"
|
|
8702
|
-
};
|
|
8703
|
-
DEFAULT_ASSET_URL3 = {
|
|
8704
|
-
url: "https://almadar-kflow-assets.web.app/shared/isometric-dungeon/Isometric/chestClosed_E.png",
|
|
8705
|
-
role: "item",
|
|
8706
|
-
category: "item"
|
|
8707
|
-
};
|
|
8708
|
-
assetSizeMap = {
|
|
8709
|
-
sm: 28,
|
|
8710
|
-
md: 40,
|
|
8711
|
-
lg: 56
|
|
8712
|
-
};
|
|
8713
|
-
ItemSlot.displayName = "ItemSlot";
|
|
8714
|
-
}
|
|
8715
|
-
});
|
|
8716
|
-
function TurnIndicator({
|
|
8717
|
-
assetUrl = DEFAULT_ASSET_URL4,
|
|
8718
|
-
currentTurn = 1,
|
|
8719
|
-
maxTurns,
|
|
8720
|
-
activeTeam,
|
|
8721
|
-
phase,
|
|
8722
|
-
size = "md",
|
|
8723
|
-
className
|
|
8724
|
-
}) {
|
|
8725
|
-
const sizes = sizeMap8[size];
|
|
8726
|
-
return /* @__PURE__ */ jsxs(
|
|
8727
|
-
Box,
|
|
8728
|
-
{
|
|
8729
|
-
className: cn(
|
|
8730
|
-
"inline-flex items-center rounded-container",
|
|
8731
|
-
"bg-card/80 border border-muted font-medium text-foreground",
|
|
8732
|
-
sizes.wrapper,
|
|
8733
|
-
className
|
|
8734
|
-
),
|
|
8735
|
-
children: [
|
|
8736
|
-
/* @__PURE__ */ jsxs(Typography, { as: "span", className: "font-bold tabular-nums", children: [
|
|
8737
|
-
"Turn ",
|
|
8738
|
-
currentTurn,
|
|
8739
|
-
maxTurns != null && /* @__PURE__ */ jsxs(Typography, { as: "span", className: "text-muted-foreground", children: [
|
|
8740
|
-
"/",
|
|
8741
|
-
maxTurns
|
|
8742
|
-
] })
|
|
8743
|
-
] }),
|
|
8744
|
-
phase && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
8745
|
-
/* @__PURE__ */ jsx(Typography, { as: "span", className: "text-muted-foreground", children: "|" }),
|
|
8746
|
-
/* @__PURE__ */ jsx(Typography, { as: "span", className: "text-muted-foreground", children: phase })
|
|
8747
|
-
] }),
|
|
8748
|
-
activeTeam && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
8749
|
-
/* @__PURE__ */ jsx(Typography, { as: "span", className: "text-muted-foreground", children: "|" }),
|
|
8750
|
-
assetUrl ? /* @__PURE__ */ jsx(GameIcon, { assetUrl, icon: "image", size: 12, className: "flex-shrink-0" }) : /* @__PURE__ */ jsx(Box, { as: "span", className: cn("rounded-full bg-success/20", sizes.dot) }),
|
|
8751
|
-
/* @__PURE__ */ jsx(Typography, { as: "span", className: "text-success", children: activeTeam })
|
|
8752
|
-
] })
|
|
8753
|
-
]
|
|
8754
|
-
}
|
|
8755
|
-
);
|
|
8756
|
-
}
|
|
8757
|
-
var sizeMap8, DEFAULT_ASSET_URL4;
|
|
8758
|
-
var init_TurnIndicator = __esm({
|
|
8759
|
-
"components/game/atoms/TurnIndicator.tsx"() {
|
|
8760
|
-
init_cn();
|
|
8761
|
-
init_Box();
|
|
8762
|
-
init_Typography();
|
|
8763
|
-
init_GameIcon();
|
|
8764
|
-
sizeMap8 = {
|
|
8765
|
-
sm: { wrapper: "text-xs gap-1.5 px-2 py-0.5", dot: "w-1.5 h-1.5" },
|
|
8766
|
-
md: { wrapper: "text-sm gap-2 px-3 py-1", dot: "w-2 h-2" },
|
|
8767
|
-
lg: { wrapper: "text-base gap-2.5 px-4 py-1.5", dot: "w-2.5 h-2.5" }
|
|
8768
|
-
};
|
|
8769
|
-
DEFAULT_ASSET_URL4 = {
|
|
8770
|
-
url: "https://almadar-kflow-assets.web.app/shared/effects/particles/symbol_01.png",
|
|
8771
|
-
role: "ui",
|
|
8772
|
-
category: "turn"
|
|
8773
|
-
};
|
|
8774
|
-
TurnIndicator.displayName = "TurnIndicator";
|
|
8775
|
-
}
|
|
8776
|
-
});
|
|
8777
|
-
function getComboIntensity(combo) {
|
|
8778
|
-
if (combo >= 10) return "text-error animate-pulse";
|
|
8779
|
-
if (combo >= 7) return "text-warning";
|
|
8780
|
-
if (combo >= 4) return "text-warning";
|
|
8781
|
-
return "text-foreground";
|
|
8782
|
-
}
|
|
8783
|
-
function getComboScale(combo) {
|
|
8784
|
-
if (combo >= 10) return "scale-110";
|
|
8785
|
-
if (combo >= 5) return "scale-105";
|
|
8786
|
-
return "";
|
|
8787
|
-
}
|
|
8788
|
-
function ComboCounter({
|
|
8789
|
-
assetUrl = DEFAULT_ASSET_URL5,
|
|
8790
|
-
combo = 5,
|
|
8791
|
-
multiplier,
|
|
8792
|
-
streak,
|
|
8793
|
-
size = "md",
|
|
8794
|
-
className
|
|
8795
|
-
}) {
|
|
8796
|
-
const sizes = sizeMap9[size];
|
|
8797
|
-
if (combo <= 0) return null;
|
|
8798
|
-
return /* @__PURE__ */ jsxs(
|
|
8799
|
-
Box,
|
|
8800
|
-
{
|
|
8801
|
-
className: cn(
|
|
8802
|
-
"inline-flex flex-col items-center justify-center",
|
|
8803
|
-
"rounded-container bg-card/80 border border-muted px-3 py-1.5",
|
|
8804
|
-
"transition-transform duration-200",
|
|
8805
|
-
getComboScale(combo),
|
|
8806
|
-
className
|
|
8807
|
-
),
|
|
8808
|
-
children: [
|
|
8809
|
-
assetUrl && /* @__PURE__ */ jsx(GameIcon, { assetUrl, icon: "image", size: 24, className: "flex-shrink-0 mb-0.5" }),
|
|
8810
|
-
/* @__PURE__ */ jsx(Typography, { as: "span", className: cn("font-black tabular-nums leading-none", sizes.combo, getComboIntensity(combo)), children: combo }),
|
|
8811
|
-
/* @__PURE__ */ jsx(Typography, { as: "span", className: cn("font-bold uppercase tracking-wider text-muted-foreground", sizes.label), children: "combo" }),
|
|
8812
|
-
multiplier != null && multiplier > 1 && /* @__PURE__ */ jsxs(Typography, { as: "span", className: cn("font-bold text-warning tabular-nums", sizes.multiplier), children: [
|
|
8813
|
-
"x",
|
|
8814
|
-
multiplier.toFixed(1)
|
|
8815
|
-
] }),
|
|
8816
|
-
streak != null && streak > 0 && /* @__PURE__ */ jsxs(Typography, { as: "span", className: cn("text-muted-foreground tabular-nums", sizes.label), children: [
|
|
8817
|
-
streak,
|
|
8818
|
-
" streak"
|
|
8819
|
-
] })
|
|
8820
|
-
]
|
|
8821
|
-
}
|
|
8822
|
-
);
|
|
8823
|
-
}
|
|
8824
|
-
var DEFAULT_ASSET_URL5, sizeMap9;
|
|
8825
|
-
var init_ComboCounter = __esm({
|
|
8826
|
-
"components/game/atoms/ComboCounter.tsx"() {
|
|
8827
|
-
init_cn();
|
|
8828
|
-
init_Box();
|
|
8829
|
-
init_Typography();
|
|
8830
|
-
init_GameIcon();
|
|
8831
|
-
DEFAULT_ASSET_URL5 = {
|
|
8832
|
-
url: "https://almadar-kflow-assets.web.app/shared/effects/flash/flash00.png",
|
|
8833
|
-
role: "effect",
|
|
8834
|
-
category: "effect"
|
|
8835
|
-
};
|
|
8836
|
-
sizeMap9 = {
|
|
8837
|
-
sm: { combo: "text-lg", label: "text-xs", multiplier: "text-xs" },
|
|
8838
|
-
md: { combo: "text-2xl", label: "text-xs", multiplier: "text-sm" },
|
|
8839
|
-
lg: { combo: "text-4xl", label: "text-sm", multiplier: "text-base" }
|
|
8840
|
-
};
|
|
8841
|
-
ComboCounter.displayName = "ComboCounter";
|
|
8842
|
-
}
|
|
8843
|
-
});
|
|
8844
|
-
function WaypointMarker({
|
|
8845
|
-
assetUrl = DEFAULT_ASSET_URL6,
|
|
8846
|
-
label,
|
|
8847
|
-
icon,
|
|
8848
|
-
active = true,
|
|
8849
|
-
completed = false,
|
|
8850
|
-
size = "md",
|
|
8851
|
-
className
|
|
8852
|
-
}) {
|
|
8853
|
-
const sizes = sizeMap10[size];
|
|
8854
|
-
return /* @__PURE__ */ jsxs(Box, { className: cn("flex flex-col items-center", className), children: [
|
|
8855
|
-
/* @__PURE__ */ jsxs(Box, { className: "relative flex items-center justify-center", children: [
|
|
8856
|
-
active && /* @__PURE__ */ jsx(
|
|
8857
|
-
Box,
|
|
8858
|
-
{
|
|
8859
|
-
position: "absolute",
|
|
8860
|
-
className: cn(
|
|
8861
|
-
"rounded-full border-2 border-info animate-ping opacity-50",
|
|
8862
|
-
sizes.ring
|
|
8863
|
-
)
|
|
8864
|
-
}
|
|
8865
|
-
),
|
|
8866
|
-
active && /* @__PURE__ */ jsx(
|
|
8867
|
-
Box,
|
|
8868
|
-
{
|
|
8869
|
-
position: "absolute",
|
|
8870
|
-
className: cn(
|
|
8871
|
-
"rounded-full border-2 border-info",
|
|
8872
|
-
sizes.ring
|
|
8873
|
-
)
|
|
8874
|
-
}
|
|
8875
|
-
),
|
|
8876
|
-
/* @__PURE__ */ jsx(
|
|
8877
|
-
Box,
|
|
8878
|
-
{
|
|
8879
|
-
position: "relative",
|
|
8880
|
-
className: cn(
|
|
8881
|
-
"flex items-center justify-center rounded-full transition-all duration-200",
|
|
8882
|
-
sizes.dot,
|
|
8883
|
-
completed && "bg-success text-foreground",
|
|
8884
|
-
active && !completed && "bg-info text-foreground",
|
|
8885
|
-
!active && !completed && "bg-muted"
|
|
8886
|
-
),
|
|
8887
|
-
children: completed ? checkIcon : assetUrl ? /* @__PURE__ */ jsx(GameIcon, { assetUrl, icon: "image", size: sizes.img, alt: label, className: "flex-shrink-0" }) : icon ? typeof icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: icon }) : /* @__PURE__ */ jsx(Icon, { icon }) : null
|
|
8888
|
-
}
|
|
8889
|
-
)
|
|
8890
|
-
] }),
|
|
8891
|
-
label && /* @__PURE__ */ jsx(
|
|
8892
|
-
Typography,
|
|
8893
|
-
{
|
|
8894
|
-
as: "span",
|
|
8895
|
-
className: cn(
|
|
8896
|
-
"text-center whitespace-nowrap",
|
|
8897
|
-
sizes.label,
|
|
8898
|
-
completed ? "text-success" : active ? "text-info" : "text-muted-foreground"
|
|
8899
|
-
),
|
|
8900
|
-
children: label
|
|
8901
|
-
}
|
|
8902
|
-
)
|
|
8903
|
-
] });
|
|
8904
|
-
}
|
|
8905
|
-
var DEFAULT_ASSET_URL6, sizeMap10, checkIcon;
|
|
8906
|
-
var init_WaypointMarker = __esm({
|
|
8907
|
-
"components/game/atoms/WaypointMarker.tsx"() {
|
|
8908
|
-
init_cn();
|
|
8909
|
-
init_Icon();
|
|
8910
|
-
init_Box();
|
|
8911
|
-
init_Typography();
|
|
8912
|
-
init_GameIcon();
|
|
8913
|
-
DEFAULT_ASSET_URL6 = {
|
|
8914
|
-
url: "https://almadar-kflow-assets.web.app/shared/world-map/battle_marker.png",
|
|
8915
|
-
role: "ui",
|
|
8916
|
-
category: "waypoint"
|
|
8917
|
-
};
|
|
8918
|
-
sizeMap10 = {
|
|
8919
|
-
sm: { dot: "w-4 h-4", ring: "w-6 h-6", label: "text-xs mt-1", img: 12 },
|
|
8920
|
-
md: { dot: "w-6 h-6", ring: "w-8 h-8", label: "text-sm mt-1.5", img: 18 },
|
|
8921
|
-
lg: { dot: "w-8 h-8", ring: "w-10 h-10", label: "text-base mt-2", img: 24 }
|
|
8922
|
-
};
|
|
8923
|
-
checkIcon = /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 3, className: "w-3/5 h-3/5", children: /* @__PURE__ */ jsx("path", { d: "M5 13l4 4L19 7", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
8924
|
-
WaypointMarker.displayName = "WaypointMarker";
|
|
8925
|
-
}
|
|
8926
|
-
});
|
|
8927
|
-
function formatDuration(seconds) {
|
|
8928
|
-
if (seconds >= 60) {
|
|
8929
|
-
return `${Math.floor(seconds / 60)}m`;
|
|
8930
|
-
}
|
|
8931
|
-
return `${Math.round(seconds)}s`;
|
|
8932
|
-
}
|
|
8933
|
-
function StatusEffect({
|
|
8934
|
-
assetUrl = DEFAULT_ASSET_URL7,
|
|
8935
|
-
icon,
|
|
8936
|
-
label = "Shield",
|
|
8937
|
-
duration = 30,
|
|
8938
|
-
stacks,
|
|
8939
|
-
variant = "buff",
|
|
8940
|
-
size = "md",
|
|
8941
|
-
className
|
|
8942
|
-
}) {
|
|
8943
|
-
const sizes = sizeMap11[size];
|
|
8944
|
-
return /* @__PURE__ */ jsxs(Box, { position: "relative", className: cn("inline-flex flex-col items-center", className), children: [
|
|
8945
|
-
/* @__PURE__ */ jsxs(
|
|
8946
|
-
Box,
|
|
8947
|
-
{
|
|
8948
|
-
position: "relative",
|
|
8949
|
-
className: cn(
|
|
8950
|
-
"flex items-center justify-center rounded-interactive border-2",
|
|
8951
|
-
sizes.container,
|
|
8952
|
-
variantStyles7[variant]
|
|
8953
|
-
),
|
|
8954
|
-
title: label,
|
|
8955
|
-
children: [
|
|
8956
|
-
/* @__PURE__ */ jsx(Box, { as: "span", className: cn("flex items-center justify-center", sizes.icon), children: assetUrl ? /* @__PURE__ */ jsx(GameIcon, { assetUrl, icon: "image", size: sizes.img, alt: label, className: "flex-shrink-0" }) : icon != null && typeof icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: icon, size: "sm" }) : icon != null ? /* @__PURE__ */ jsx(Icon, { icon, size: "sm" }) : null }),
|
|
8957
|
-
duration !== void 0 && /* @__PURE__ */ jsx(
|
|
8958
|
-
Typography,
|
|
8959
|
-
{
|
|
8960
|
-
as: "span",
|
|
8961
|
-
className: cn(
|
|
8962
|
-
"absolute bottom-0 left-0 right-0 text-center font-mono font-bold text-foreground bg-background/60 leading-tight",
|
|
8963
|
-
sizes.timer
|
|
8964
|
-
),
|
|
8965
|
-
children: formatDuration(duration)
|
|
8966
|
-
}
|
|
8967
|
-
)
|
|
8968
|
-
]
|
|
8969
|
-
}
|
|
8970
|
-
),
|
|
8971
|
-
stacks !== void 0 && stacks > 1 && /* @__PURE__ */ jsx(
|
|
8972
|
-
Typography,
|
|
8973
|
-
{
|
|
8974
|
-
as: "span",
|
|
8975
|
-
className: cn(
|
|
8976
|
-
"absolute flex items-center justify-center rounded-full bg-card text-foreground font-bold leading-none",
|
|
8977
|
-
sizes.badge
|
|
8978
|
-
),
|
|
8979
|
-
children: stacks
|
|
8980
|
-
}
|
|
8981
|
-
),
|
|
8982
|
-
label && /* @__PURE__ */ jsx(Typography, { as: "span", className: "text-xs text-muted-foreground mt-0.5 text-center whitespace-nowrap", children: label })
|
|
8983
|
-
] });
|
|
8984
|
-
}
|
|
8985
|
-
var DEFAULT_ASSET_URL7, sizeMap11, variantStyles7;
|
|
8986
|
-
var init_StatusEffect = __esm({
|
|
8987
|
-
"components/game/atoms/StatusEffect.tsx"() {
|
|
8988
|
-
init_cn();
|
|
8989
|
-
init_Icon();
|
|
8990
|
-
init_Box();
|
|
8991
|
-
init_Typography();
|
|
8992
|
-
init_GameIcon();
|
|
8993
|
-
DEFAULT_ASSET_URL7 = {
|
|
8994
|
-
url: "https://almadar-kflow-assets.web.app/shared/effects/particles/flame_01.png",
|
|
8995
|
-
role: "ui",
|
|
8996
|
-
category: "effect"
|
|
8997
|
-
};
|
|
8998
|
-
sizeMap11 = {
|
|
8999
|
-
sm: { container: "w-8 h-8", icon: "text-sm", badge: "text-xs -top-1 -right-1 w-4 h-4", timer: "text-[9px]", img: 20 },
|
|
9000
|
-
md: { container: "w-10 h-10", icon: "text-base", badge: "text-xs -top-1 -right-1 w-5 h-5", timer: "text-xs", img: 28 },
|
|
9001
|
-
lg: { container: "w-12 h-12", icon: "text-lg", badge: "text-sm -top-1.5 -right-1.5 w-6 h-6", timer: "text-xs", img: 36 }
|
|
9002
|
-
};
|
|
9003
|
-
variantStyles7 = {
|
|
9004
|
-
buff: "border-success bg-success/20",
|
|
9005
|
-
debuff: "border-error bg-error/20",
|
|
9006
|
-
neutral: "border-muted bg-muted/20"
|
|
9007
|
-
};
|
|
9008
|
-
StatusEffect.displayName = "StatusEffect";
|
|
9009
|
-
}
|
|
9010
|
-
});
|
|
9011
|
-
function DamageNumber({
|
|
9012
|
-
assetUrl = DEFAULT_ASSET_URL8,
|
|
9013
|
-
value = 42,
|
|
9014
|
-
type = "damage",
|
|
9015
|
-
size = "md",
|
|
9016
|
-
className
|
|
9017
|
-
}) {
|
|
9018
|
-
const displayText = type === "miss" ? "MISS" : type === "heal" ? `+${value}` : `${value}`;
|
|
9019
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
9020
|
-
/* @__PURE__ */ jsx("style", { children: floatKeyframes }),
|
|
9021
|
-
/* @__PURE__ */ jsxs(
|
|
9022
|
-
Typography,
|
|
9023
|
-
{
|
|
9024
|
-
as: "span",
|
|
9025
|
-
className: cn(
|
|
9026
|
-
"inline-flex items-center gap-0.5 font-mono select-none pointer-events-none",
|
|
9027
|
-
sizeMap12[size],
|
|
9028
|
-
typeStyles[type],
|
|
9029
|
-
className
|
|
9030
|
-
),
|
|
9031
|
-
style: { animation: "damageFloat 1s ease-out forwards" },
|
|
9032
|
-
children: [
|
|
9033
|
-
assetUrl && /* @__PURE__ */ jsx(GameIcon, { assetUrl, icon: "image", size: 14, className: "flex-shrink-0" }),
|
|
9034
|
-
displayText
|
|
9035
|
-
]
|
|
9036
|
-
}
|
|
9037
|
-
)
|
|
9038
|
-
] });
|
|
9039
|
-
}
|
|
9040
|
-
var sizeMap12, typeStyles, floatKeyframes, DEFAULT_ASSET_URL8;
|
|
9041
|
-
var init_DamageNumber = __esm({
|
|
9042
|
-
"components/game/atoms/DamageNumber.tsx"() {
|
|
9043
|
-
init_cn();
|
|
9044
|
-
init_Typography();
|
|
9045
|
-
init_GameIcon();
|
|
9046
|
-
sizeMap12 = {
|
|
9047
|
-
sm: "text-sm",
|
|
9048
|
-
md: "text-lg",
|
|
9049
|
-
lg: "text-2xl"
|
|
9050
|
-
};
|
|
9051
|
-
typeStyles = {
|
|
9052
|
-
damage: "text-error font-bold",
|
|
9053
|
-
heal: "text-success font-bold",
|
|
9054
|
-
crit: "text-warning font-extrabold",
|
|
9055
|
-
miss: "text-muted-foreground italic"
|
|
9056
|
-
};
|
|
9057
|
-
floatKeyframes = `
|
|
9058
|
-
@keyframes damageFloat {
|
|
9059
|
-
0% { opacity: 1; transform: translateY(0) scale(1); }
|
|
9060
|
-
20% { transform: translateY(-8px) scale(1.1); }
|
|
9061
|
-
100% { opacity: 0; transform: translateY(-32px) scale(0.8); }
|
|
9062
|
-
}
|
|
9063
|
-
`;
|
|
9064
|
-
DEFAULT_ASSET_URL8 = {
|
|
9065
|
-
url: "https://almadar-kflow-assets.web.app/shared/effects/particles/spark_01.png",
|
|
9066
|
-
role: "effect",
|
|
9067
|
-
category: "effect"
|
|
9068
|
-
};
|
|
9069
|
-
DamageNumber.displayName = "DamageNumber";
|
|
9070
|
-
}
|
|
9071
|
-
});
|
|
9072
8293
|
function DialogueBubble({
|
|
9073
8294
|
speaker = "Hero",
|
|
9074
8295
|
text = "The dungeon awaits. Choose your path wisely.",
|
|
@@ -9130,16 +8351,14 @@ function ChoiceButton({
|
|
|
9130
8351
|
payload,
|
|
9131
8352
|
className
|
|
9132
8353
|
}) {
|
|
9133
|
-
const eventBus = useEventBus();
|
|
9134
8354
|
return /* @__PURE__ */ jsxs(
|
|
9135
8355
|
Button,
|
|
9136
8356
|
{
|
|
9137
8357
|
variant: "ghost",
|
|
9138
8358
|
disabled,
|
|
9139
|
-
|
|
9140
|
-
|
|
9141
|
-
|
|
9142
|
-
},
|
|
8359
|
+
action,
|
|
8360
|
+
actionPayload: payload,
|
|
8361
|
+
onClick,
|
|
9143
8362
|
className: cn(
|
|
9144
8363
|
"w-full text-left px-4 py-2.5 rounded-interactive border transition-all duration-150",
|
|
9145
8364
|
"flex items-center gap-2",
|
|
@@ -9178,7 +8397,6 @@ var init_ChoiceButton = __esm({
|
|
|
9178
8397
|
"components/game/atoms/ChoiceButton.tsx"() {
|
|
9179
8398
|
init_cn();
|
|
9180
8399
|
init_Icon();
|
|
9181
|
-
init_useEventBus();
|
|
9182
8400
|
init_Button();
|
|
9183
8401
|
init_Box();
|
|
9184
8402
|
init_Typography();
|
|
@@ -9186,250 +8404,6 @@ var init_ChoiceButton = __esm({
|
|
|
9186
8404
|
ChoiceButton.displayName = "ChoiceButton";
|
|
9187
8405
|
}
|
|
9188
8406
|
});
|
|
9189
|
-
function ActionButton({
|
|
9190
|
-
assetUrl = DEFAULT_ASSET_URL9,
|
|
9191
|
-
label = "Attack",
|
|
9192
|
-
icon,
|
|
9193
|
-
cooldown = 0,
|
|
9194
|
-
disabled = false,
|
|
9195
|
-
hotkey,
|
|
9196
|
-
size = "md",
|
|
9197
|
-
variant = "primary",
|
|
9198
|
-
onClick,
|
|
9199
|
-
action,
|
|
9200
|
-
className
|
|
9201
|
-
}) {
|
|
9202
|
-
const eventBus = useEventBus();
|
|
9203
|
-
const sizes = sizeMap13[size];
|
|
9204
|
-
const onCooldown = cooldown > 0;
|
|
9205
|
-
const isDisabled = disabled || onCooldown;
|
|
9206
|
-
const cooldownDeg = Math.round(cooldown * 360);
|
|
9207
|
-
return /* @__PURE__ */ jsxs(
|
|
9208
|
-
Button,
|
|
9209
|
-
{
|
|
9210
|
-
variant: variant === "danger" ? "danger" : variant === "secondary" ? "secondary" : "primary",
|
|
9211
|
-
disabled: isDisabled,
|
|
9212
|
-
onClick: () => {
|
|
9213
|
-
if (action) eventBus.emit(`UI:${action}`, {});
|
|
9214
|
-
onClick?.();
|
|
9215
|
-
},
|
|
9216
|
-
className: cn(
|
|
9217
|
-
"relative inline-flex items-center gap-1.5 rounded-interactive border font-medium overflow-hidden transition-colors duration-150",
|
|
9218
|
-
sizes.button,
|
|
9219
|
-
variantStyles8[variant],
|
|
9220
|
-
isDisabled && "opacity-60 cursor-not-allowed",
|
|
9221
|
-
className
|
|
9222
|
-
),
|
|
9223
|
-
children: [
|
|
9224
|
-
onCooldown && /* @__PURE__ */ jsx(
|
|
9225
|
-
Box,
|
|
9226
|
-
{
|
|
9227
|
-
position: "absolute",
|
|
9228
|
-
className: "inset-0 bg-foreground/40 pointer-events-none",
|
|
9229
|
-
style: {
|
|
9230
|
-
clipPath: `conic-gradient(from 0deg, transparent ${360 - cooldownDeg}deg, black ${360 - cooldownDeg}deg)`,
|
|
9231
|
-
WebkitClipPath: `conic-gradient(from 0deg, transparent ${360 - cooldownDeg}deg, black ${360 - cooldownDeg}deg)`,
|
|
9232
|
-
background: `conic-gradient(from 0deg, transparent ${360 - cooldownDeg}deg, rgba(0,0,0,0.6) ${360 - cooldownDeg}deg)`
|
|
9233
|
-
}
|
|
9234
|
-
}
|
|
9235
|
-
),
|
|
9236
|
-
assetUrl ? /* @__PURE__ */ jsx(GameIcon, { assetUrl, icon: "image", size: 16, className: cn("flex-shrink-0", sizes.icon) }) : icon ? /* @__PURE__ */ jsx(Box, { as: "span", className: cn("flex-shrink-0", sizes.icon), children: typeof icon === "string" ? (() => {
|
|
9237
|
-
const I = resolveIcon(icon);
|
|
9238
|
-
return I ? /* @__PURE__ */ jsx(I, { className: "w-4 h-4" }) : null;
|
|
9239
|
-
})() : /* @__PURE__ */ (() => {
|
|
9240
|
-
const I = icon;
|
|
9241
|
-
return /* @__PURE__ */ jsx(I, { className: "w-4 h-4" });
|
|
9242
|
-
})() }) : null,
|
|
9243
|
-
/* @__PURE__ */ jsx(Typography, { as: "span", className: "relative z-10", children: label }),
|
|
9244
|
-
hotkey && /* @__PURE__ */ jsx(
|
|
9245
|
-
Typography,
|
|
9246
|
-
{
|
|
9247
|
-
as: "span",
|
|
9248
|
-
className: cn(
|
|
9249
|
-
"absolute top-0.5 right-0.5 bg-foreground/30 text-primary-foreground rounded font-mono leading-tight",
|
|
9250
|
-
sizes.hotkey
|
|
9251
|
-
),
|
|
9252
|
-
children: hotkey
|
|
9253
|
-
}
|
|
9254
|
-
)
|
|
9255
|
-
]
|
|
9256
|
-
}
|
|
9257
|
-
);
|
|
9258
|
-
}
|
|
9259
|
-
var sizeMap13, variantStyles8, DEFAULT_ASSET_URL9;
|
|
9260
|
-
var init_ActionButton = __esm({
|
|
9261
|
-
"components/game/atoms/ActionButton.tsx"() {
|
|
9262
|
-
init_cn();
|
|
9263
|
-
init_Icon();
|
|
9264
|
-
init_useEventBus();
|
|
9265
|
-
init_Button();
|
|
9266
|
-
init_Box();
|
|
9267
|
-
init_Typography();
|
|
9268
|
-
init_GameIcon();
|
|
9269
|
-
sizeMap13 = {
|
|
9270
|
-
sm: { button: "h-button-sm px-3 text-xs", hotkey: "text-[9px] px-1", icon: "text-xs" },
|
|
9271
|
-
md: { button: "h-button-md px-4 text-sm", hotkey: "text-xs px-1.5", icon: "text-sm" },
|
|
9272
|
-
lg: { button: "h-button-lg px-5 text-base", hotkey: "text-xs px-2", icon: "text-base" }
|
|
9273
|
-
};
|
|
9274
|
-
variantStyles8 = {
|
|
9275
|
-
primary: "bg-primary text-primary-foreground hover:bg-primary-hover border-primary",
|
|
9276
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary-hover border-border",
|
|
9277
|
-
danger: "bg-error text-error-foreground hover:bg-error/90 border-error"
|
|
9278
|
-
};
|
|
9279
|
-
DEFAULT_ASSET_URL9 = {
|
|
9280
|
-
url: "https://almadar-kflow-assets.web.app/shared/effects/particles/slash_01.png",
|
|
9281
|
-
role: "ui",
|
|
9282
|
-
category: "action"
|
|
9283
|
-
};
|
|
9284
|
-
ActionButton.displayName = "ActionButton";
|
|
9285
|
-
}
|
|
9286
|
-
});
|
|
9287
|
-
function MiniMap({
|
|
9288
|
-
tiles = DEFAULT_TILES,
|
|
9289
|
-
units = DEFAULT_UNITS,
|
|
9290
|
-
width = 150,
|
|
9291
|
-
height = 150,
|
|
9292
|
-
mapWidth = 100,
|
|
9293
|
-
mapHeight = 100,
|
|
9294
|
-
viewportRect = DEFAULT_VIEWPORT,
|
|
9295
|
-
className,
|
|
9296
|
-
tileAssets,
|
|
9297
|
-
unitAssets
|
|
9298
|
-
}) {
|
|
9299
|
-
const canvasRef = React88.useRef(null);
|
|
9300
|
-
const imgCacheRef = React88.useRef(/* @__PURE__ */ new Map());
|
|
9301
|
-
function loadImg(url) {
|
|
9302
|
-
const cached = imgCacheRef.current.get(url);
|
|
9303
|
-
if (cached) return cached.complete ? cached : null;
|
|
9304
|
-
const img = new Image();
|
|
9305
|
-
img.src = url;
|
|
9306
|
-
img.onload = () => {
|
|
9307
|
-
const canvas = canvasRef.current;
|
|
9308
|
-
if (!canvas) return;
|
|
9309
|
-
const ctx = canvas.getContext("2d");
|
|
9310
|
-
if (ctx) ctx.clearRect(0, 0, 0, 0);
|
|
9311
|
-
};
|
|
9312
|
-
imgCacheRef.current.set(url, img);
|
|
9313
|
-
return null;
|
|
9314
|
-
}
|
|
9315
|
-
React88.useEffect(() => {
|
|
9316
|
-
const canvas = canvasRef.current;
|
|
9317
|
-
if (!canvas) return;
|
|
9318
|
-
const ctx = canvas.getContext("2d");
|
|
9319
|
-
if (!ctx) return;
|
|
9320
|
-
const scaleX2 = width / mapWidth;
|
|
9321
|
-
const scaleY2 = height / mapHeight;
|
|
9322
|
-
ctx.clearRect(0, 0, width, height);
|
|
9323
|
-
ctx.fillStyle = "#111";
|
|
9324
|
-
ctx.fillRect(0, 0, width, height);
|
|
9325
|
-
for (const tile of tiles) {
|
|
9326
|
-
const tileAsset = tileAssets?.[tile.color] ?? tileAssets?.["default"];
|
|
9327
|
-
const tileImg = tileAsset ? loadImg(tileAsset.url) : null;
|
|
9328
|
-
const tx = Math.floor(tile.x * scaleX2);
|
|
9329
|
-
const ty = Math.floor(tile.y * scaleY2);
|
|
9330
|
-
const tw = Math.max(1, Math.ceil(scaleX2));
|
|
9331
|
-
const th = Math.max(1, Math.ceil(scaleY2));
|
|
9332
|
-
if (tileImg) {
|
|
9333
|
-
ctx.drawImage(tileImg, tx, ty, tw, th);
|
|
9334
|
-
} else {
|
|
9335
|
-
ctx.fillStyle = tile.color;
|
|
9336
|
-
ctx.fillRect(tx, ty, tw, th);
|
|
9337
|
-
}
|
|
9338
|
-
}
|
|
9339
|
-
for (const unit of units) {
|
|
9340
|
-
if (unit.isPlayer) continue;
|
|
9341
|
-
const unitAsset = unitAssets?.[unit.color] ?? unitAssets?.["default"];
|
|
9342
|
-
const unitImg = unitAsset ? loadImg(unitAsset.url) : null;
|
|
9343
|
-
const ux = Math.floor(unit.x * scaleX2) - 1;
|
|
9344
|
-
const uy = Math.floor(unit.y * scaleY2) - 1;
|
|
9345
|
-
if (unitImg) {
|
|
9346
|
-
ctx.drawImage(unitImg, ux, uy, 5, 5);
|
|
9347
|
-
} else {
|
|
9348
|
-
ctx.fillStyle = unit.color;
|
|
9349
|
-
ctx.fillRect(ux, uy, 3, 3);
|
|
9350
|
-
}
|
|
9351
|
-
}
|
|
9352
|
-
if (viewportRect) {
|
|
9353
|
-
ctx.strokeStyle = "#ffffff";
|
|
9354
|
-
ctx.lineWidth = 1;
|
|
9355
|
-
ctx.strokeRect(
|
|
9356
|
-
Math.floor(viewportRect.x * scaleX2),
|
|
9357
|
-
Math.floor(viewportRect.y * scaleY2),
|
|
9358
|
-
Math.floor(viewportRect.w * scaleX2),
|
|
9359
|
-
Math.floor(viewportRect.h * scaleY2)
|
|
9360
|
-
);
|
|
9361
|
-
}
|
|
9362
|
-
}, [tiles, units, width, height, mapWidth, mapHeight, viewportRect, tileAssets, unitAssets]);
|
|
9363
|
-
const scaleX = width / mapWidth;
|
|
9364
|
-
const scaleY = height / mapHeight;
|
|
9365
|
-
const playerUnit = units.find((u) => u.isPlayer);
|
|
9366
|
-
const playerLeft = playerUnit ? Math.floor(playerUnit.x * scaleX) - 1 : null;
|
|
9367
|
-
const playerTop = playerUnit ? Math.floor(playerUnit.y * scaleY) - 1 : null;
|
|
9368
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
9369
|
-
/* @__PURE__ */ jsx("style", { children: `@keyframes minimap-blink{0%,49%{opacity:1}50%,100%{opacity:0}}` }),
|
|
9370
|
-
/* @__PURE__ */ jsxs(
|
|
9371
|
-
Box,
|
|
9372
|
-
{
|
|
9373
|
-
position: "relative",
|
|
9374
|
-
display: "inline-block",
|
|
9375
|
-
className: cn(
|
|
9376
|
-
"border border-border/20 rounded-container",
|
|
9377
|
-
className
|
|
9378
|
-
),
|
|
9379
|
-
children: [
|
|
9380
|
-
/* @__PURE__ */ jsx(
|
|
9381
|
-
"canvas",
|
|
9382
|
-
{
|
|
9383
|
-
ref: canvasRef,
|
|
9384
|
-
width,
|
|
9385
|
-
height,
|
|
9386
|
-
className: "block",
|
|
9387
|
-
style: { width, height }
|
|
9388
|
-
}
|
|
9389
|
-
),
|
|
9390
|
-
playerLeft !== null && playerTop !== null && /* @__PURE__ */ jsx(
|
|
9391
|
-
Box,
|
|
9392
|
-
{
|
|
9393
|
-
position: "absolute",
|
|
9394
|
-
style: {
|
|
9395
|
-
left: playerLeft,
|
|
9396
|
-
top: playerTop,
|
|
9397
|
-
width: 3,
|
|
9398
|
-
height: 3,
|
|
9399
|
-
backgroundColor: "#ffffff",
|
|
9400
|
-
animation: "minimap-blink 1s steps(2, end) infinite",
|
|
9401
|
-
pointerEvents: "none"
|
|
9402
|
-
}
|
|
9403
|
-
}
|
|
9404
|
-
)
|
|
9405
|
-
]
|
|
9406
|
-
}
|
|
9407
|
-
)
|
|
9408
|
-
] });
|
|
9409
|
-
}
|
|
9410
|
-
var DEFAULT_TILES, DEFAULT_UNITS, DEFAULT_VIEWPORT;
|
|
9411
|
-
var init_MiniMap = __esm({
|
|
9412
|
-
"components/game/atoms/MiniMap.tsx"() {
|
|
9413
|
-
"use client";
|
|
9414
|
-
init_cn();
|
|
9415
|
-
init_Box();
|
|
9416
|
-
DEFAULT_TILES = [
|
|
9417
|
-
{ x: 10, y: 10, color: "#4ade80" },
|
|
9418
|
-
{ x: 20, y: 15, color: "#4ade80" },
|
|
9419
|
-
{ x: 30, y: 25, color: "#22c55e" },
|
|
9420
|
-
{ x: 50, y: 40, color: "#4ade80" },
|
|
9421
|
-
{ x: 60, y: 55, color: "#16a34a" },
|
|
9422
|
-
{ x: 40, y: 60, color: "#4ade80" },
|
|
9423
|
-
{ x: 70, y: 30, color: "#22c55e" },
|
|
9424
|
-
{ x: 80, y: 70, color: "#4ade80" }
|
|
9425
|
-
];
|
|
9426
|
-
DEFAULT_UNITS = [
|
|
9427
|
-
{ x: 30, y: 30, color: "#60a5fa", isPlayer: true }
|
|
9428
|
-
];
|
|
9429
|
-
DEFAULT_VIEWPORT = { x: 20, y: 20, w: 40, h: 40 };
|
|
9430
|
-
MiniMap.displayName = "MiniMap";
|
|
9431
|
-
}
|
|
9432
|
-
});
|
|
9433
8407
|
function ControlGrid({
|
|
9434
8408
|
kind,
|
|
9435
8409
|
buttons = DEFAULT_BUTTONS,
|
|
@@ -9447,8 +8421,8 @@ function ControlGrid({
|
|
|
9447
8421
|
className
|
|
9448
8422
|
}) {
|
|
9449
8423
|
const eventBus = useEventBus();
|
|
9450
|
-
const [active, setActive] =
|
|
9451
|
-
const handlePress =
|
|
8424
|
+
const [active, setActive] = React81.useState(/* @__PURE__ */ new Set());
|
|
8425
|
+
const handlePress = React81.useCallback(
|
|
9452
8426
|
(id) => {
|
|
9453
8427
|
setActive((prev) => new Set(prev).add(id));
|
|
9454
8428
|
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
|
|
@@ -9462,7 +8436,7 @@ function ControlGrid({
|
|
|
9462
8436
|
},
|
|
9463
8437
|
[kind, actionEvent, directionEvent, directionEvents, eventBus, onAction, onDirection]
|
|
9464
8438
|
);
|
|
9465
|
-
const handleRelease =
|
|
8439
|
+
const handleRelease = React81.useCallback(
|
|
9466
8440
|
(id) => {
|
|
9467
8441
|
setActive((prev) => {
|
|
9468
8442
|
const next = new Set(prev);
|
|
@@ -9647,7 +8621,7 @@ function StatBadge({
|
|
|
9647
8621
|
{
|
|
9648
8622
|
className: cn(
|
|
9649
8623
|
"inline-flex items-center gap-2 rounded-container border backdrop-blur-sm",
|
|
9650
|
-
|
|
8624
|
+
sizeMap6[size] ?? sizeMap6.md,
|
|
9651
8625
|
variantMap2[variant] ?? variantMap2.default,
|
|
9652
8626
|
className
|
|
9653
8627
|
),
|
|
@@ -9684,7 +8658,7 @@ function StatBadge({
|
|
|
9684
8658
|
}
|
|
9685
8659
|
);
|
|
9686
8660
|
}
|
|
9687
|
-
var
|
|
8661
|
+
var sizeMap6, variantMap2;
|
|
9688
8662
|
var init_StatBadge = __esm({
|
|
9689
8663
|
"components/game/molecules/StatBadge.tsx"() {
|
|
9690
8664
|
init_cn();
|
|
@@ -9694,7 +8668,7 @@ var init_StatBadge = __esm({
|
|
|
9694
8668
|
init_GameIcon();
|
|
9695
8669
|
init_HealthBar();
|
|
9696
8670
|
init_ScoreDisplay();
|
|
9697
|
-
|
|
8671
|
+
sizeMap6 = {
|
|
9698
8672
|
sm: "text-xs px-2 py-1",
|
|
9699
8673
|
md: "text-sm px-3 py-1.5",
|
|
9700
8674
|
lg: "text-base px-4 py-2"
|
|
@@ -9709,129 +8683,6 @@ var init_StatBadge = __esm({
|
|
|
9709
8683
|
StatBadge.displayName = "StatBadge";
|
|
9710
8684
|
}
|
|
9711
8685
|
});
|
|
9712
|
-
function InventoryGrid({
|
|
9713
|
-
items = DEFAULT_GRID_ITEMS,
|
|
9714
|
-
columns = 4,
|
|
9715
|
-
totalSlots = 12,
|
|
9716
|
-
selectedId = "",
|
|
9717
|
-
onSelect,
|
|
9718
|
-
selectEvent,
|
|
9719
|
-
size = "md",
|
|
9720
|
-
className
|
|
9721
|
-
}) {
|
|
9722
|
-
const eventBus = useEventBus();
|
|
9723
|
-
const slotCount = totalSlots ?? items.length;
|
|
9724
|
-
const emptySlotCount = Math.max(0, slotCount - items.length);
|
|
9725
|
-
const handleSelect = React88.useCallback(
|
|
9726
|
-
(id) => {
|
|
9727
|
-
onSelect?.(id);
|
|
9728
|
-
if (selectEvent) {
|
|
9729
|
-
eventBus.emit(`UI:${selectEvent}`, { id });
|
|
9730
|
-
}
|
|
9731
|
-
},
|
|
9732
|
-
[onSelect, selectEvent, eventBus]
|
|
9733
|
-
);
|
|
9734
|
-
const gridClass = columnMap[columns] ?? `grid-cols-${columns}`;
|
|
9735
|
-
return /* @__PURE__ */ jsxs(
|
|
9736
|
-
Box,
|
|
9737
|
-
{
|
|
9738
|
-
className: cn("grid gap-2", gridClass, className),
|
|
9739
|
-
children: [
|
|
9740
|
-
items.map((item) => /* @__PURE__ */ jsx(
|
|
9741
|
-
ItemSlot,
|
|
9742
|
-
{
|
|
9743
|
-
icon: item.icon,
|
|
9744
|
-
assetUrl: item.assetUrl,
|
|
9745
|
-
label: item.label,
|
|
9746
|
-
quantity: item.quantity,
|
|
9747
|
-
rarity: item.rarity,
|
|
9748
|
-
size,
|
|
9749
|
-
selected: selectedId === item.id,
|
|
9750
|
-
onClick: () => handleSelect(item.id)
|
|
9751
|
-
},
|
|
9752
|
-
item.id
|
|
9753
|
-
)),
|
|
9754
|
-
Array.from({ length: emptySlotCount }).map((_, index) => /* @__PURE__ */ jsx(
|
|
9755
|
-
ItemSlot,
|
|
9756
|
-
{
|
|
9757
|
-
empty: true,
|
|
9758
|
-
size
|
|
9759
|
-
},
|
|
9760
|
-
`empty-${index}`
|
|
9761
|
-
))
|
|
9762
|
-
]
|
|
9763
|
-
}
|
|
9764
|
-
);
|
|
9765
|
-
}
|
|
9766
|
-
var columnMap, DEFAULT_GRID_ITEMS;
|
|
9767
|
-
var init_InventoryGrid = __esm({
|
|
9768
|
-
"components/game/molecules/InventoryGrid.tsx"() {
|
|
9769
|
-
"use client";
|
|
9770
|
-
init_cn();
|
|
9771
|
-
init_useEventBus();
|
|
9772
|
-
init_ItemSlot();
|
|
9773
|
-
init_Box();
|
|
9774
|
-
columnMap = {
|
|
9775
|
-
2: "grid-cols-2",
|
|
9776
|
-
3: "grid-cols-3",
|
|
9777
|
-
4: "grid-cols-4",
|
|
9778
|
-
5: "grid-cols-5",
|
|
9779
|
-
6: "grid-cols-6",
|
|
9780
|
-
7: "grid-cols-7",
|
|
9781
|
-
8: "grid-cols-8"
|
|
9782
|
-
};
|
|
9783
|
-
DEFAULT_GRID_ITEMS = [
|
|
9784
|
-
{ id: "grid-1", icon: "sword", label: "Iron Sword", quantity: 1, rarity: "common" },
|
|
9785
|
-
{ id: "grid-2", icon: "flask-conical", label: "Health Potion", quantity: 3, rarity: "uncommon" },
|
|
9786
|
-
{ id: "grid-3", icon: "shield", label: "Wooden Shield", quantity: 1, rarity: "common" },
|
|
9787
|
-
{ id: "grid-4", icon: "gem", label: "Ruby Gem", quantity: 2, rarity: "rare" }
|
|
9788
|
-
];
|
|
9789
|
-
InventoryGrid.displayName = "InventoryGrid";
|
|
9790
|
-
}
|
|
9791
|
-
});
|
|
9792
|
-
function ResourceBar({
|
|
9793
|
-
resources = DEFAULT_RESOURCES,
|
|
9794
|
-
size = "md",
|
|
9795
|
-
className
|
|
9796
|
-
}) {
|
|
9797
|
-
return /* @__PURE__ */ jsx(
|
|
9798
|
-
Box,
|
|
9799
|
-
{
|
|
9800
|
-
className: cn(
|
|
9801
|
-
"flex items-center gap-2 flex-wrap",
|
|
9802
|
-
className
|
|
9803
|
-
),
|
|
9804
|
-
children: resources.map((resource, i) => /* @__PURE__ */ jsx(
|
|
9805
|
-
StatBadge,
|
|
9806
|
-
{
|
|
9807
|
-
label: resource.label,
|
|
9808
|
-
value: resource.value,
|
|
9809
|
-
max: resource.max,
|
|
9810
|
-
format: resource.max != null ? "bar" : "number",
|
|
9811
|
-
icon: resource.icon,
|
|
9812
|
-
assetUrl: resource.assetUrl,
|
|
9813
|
-
size
|
|
9814
|
-
},
|
|
9815
|
-
i
|
|
9816
|
-
))
|
|
9817
|
-
}
|
|
9818
|
-
);
|
|
9819
|
-
}
|
|
9820
|
-
var DEFAULT_RESOURCES;
|
|
9821
|
-
var init_ResourceBar = __esm({
|
|
9822
|
-
"components/game/molecules/ResourceBar.tsx"() {
|
|
9823
|
-
"use client";
|
|
9824
|
-
init_cn();
|
|
9825
|
-
init_StatBadge();
|
|
9826
|
-
init_Box();
|
|
9827
|
-
DEFAULT_RESOURCES = [
|
|
9828
|
-
{ icon: "coins", label: "Gold", value: 320 },
|
|
9829
|
-
{ icon: "zap", label: "Energy", value: 7, max: 10 },
|
|
9830
|
-
{ icon: "gem", label: "Crystals", value: 15 }
|
|
9831
|
-
];
|
|
9832
|
-
ResourceBar.displayName = "ResourceBar";
|
|
9833
|
-
}
|
|
9834
|
-
});
|
|
9835
8686
|
function convertElementsToStats(elements) {
|
|
9836
8687
|
return elements.map((el) => {
|
|
9837
8688
|
const [source, field] = el.bind?.split(".") ?? [];
|
|
@@ -9939,7 +8790,7 @@ function GameMenu({
|
|
|
9939
8790
|
}) {
|
|
9940
8791
|
const resolvedOptions = options ?? menuItems ?? DEFAULT_MENU_OPTIONS;
|
|
9941
8792
|
const eventBus = useEventBus();
|
|
9942
|
-
const handleOptionClick =
|
|
8793
|
+
const handleOptionClick = React81.useCallback(
|
|
9943
8794
|
(option) => {
|
|
9944
8795
|
if (option.event) {
|
|
9945
8796
|
eventBus.emit(`UI:${option.event}`, { option });
|
|
@@ -10165,7 +9016,7 @@ function StateGraph({
|
|
|
10165
9016
|
}) {
|
|
10166
9017
|
const eventBus = useEventBus();
|
|
10167
9018
|
const nodes = states ?? [];
|
|
10168
|
-
const positions =
|
|
9019
|
+
const positions = React81.useMemo(() => layoutStates(nodes, width, height), [nodes, width, height]);
|
|
10169
9020
|
return /* @__PURE__ */ jsxs(
|
|
10170
9021
|
Box,
|
|
10171
9022
|
{
|
|
@@ -10224,6 +9075,152 @@ var init_StateGraph = __esm({
|
|
|
10224
9075
|
init_TransitionArrow();
|
|
10225
9076
|
}
|
|
10226
9077
|
});
|
|
9078
|
+
function MiniMap({
|
|
9079
|
+
tiles = DEFAULT_TILES,
|
|
9080
|
+
units = DEFAULT_UNITS,
|
|
9081
|
+
width = 150,
|
|
9082
|
+
height = 150,
|
|
9083
|
+
mapWidth = 100,
|
|
9084
|
+
mapHeight = 100,
|
|
9085
|
+
viewportRect = DEFAULT_VIEWPORT,
|
|
9086
|
+
className,
|
|
9087
|
+
tileAssets,
|
|
9088
|
+
unitAssets
|
|
9089
|
+
}) {
|
|
9090
|
+
const canvasRef = React81.useRef(null);
|
|
9091
|
+
const imgCacheRef = React81.useRef(/* @__PURE__ */ new Map());
|
|
9092
|
+
function loadImg(url) {
|
|
9093
|
+
const cached = imgCacheRef.current.get(url);
|
|
9094
|
+
if (cached) return cached.complete ? cached : null;
|
|
9095
|
+
const img = new Image();
|
|
9096
|
+
img.src = url;
|
|
9097
|
+
img.onload = () => {
|
|
9098
|
+
const canvas = canvasRef.current;
|
|
9099
|
+
if (!canvas) return;
|
|
9100
|
+
const ctx = canvas.getContext("2d");
|
|
9101
|
+
if (ctx) ctx.clearRect(0, 0, 0, 0);
|
|
9102
|
+
};
|
|
9103
|
+
imgCacheRef.current.set(url, img);
|
|
9104
|
+
return null;
|
|
9105
|
+
}
|
|
9106
|
+
React81.useEffect(() => {
|
|
9107
|
+
const canvas = canvasRef.current;
|
|
9108
|
+
if (!canvas) return;
|
|
9109
|
+
const ctx = canvas.getContext("2d");
|
|
9110
|
+
if (!ctx) return;
|
|
9111
|
+
const scaleX2 = width / mapWidth;
|
|
9112
|
+
const scaleY2 = height / mapHeight;
|
|
9113
|
+
ctx.clearRect(0, 0, width, height);
|
|
9114
|
+
ctx.fillStyle = "#111";
|
|
9115
|
+
ctx.fillRect(0, 0, width, height);
|
|
9116
|
+
for (const tile of tiles) {
|
|
9117
|
+
const tileAsset = tileAssets?.[tile.color] ?? tileAssets?.["default"];
|
|
9118
|
+
const tileImg = tileAsset ? loadImg(tileAsset.url) : null;
|
|
9119
|
+
const tx = Math.floor(tile.x * scaleX2);
|
|
9120
|
+
const ty = Math.floor(tile.y * scaleY2);
|
|
9121
|
+
const tw = Math.max(1, Math.ceil(scaleX2));
|
|
9122
|
+
const th = Math.max(1, Math.ceil(scaleY2));
|
|
9123
|
+
if (tileImg) {
|
|
9124
|
+
ctx.drawImage(tileImg, tx, ty, tw, th);
|
|
9125
|
+
} else {
|
|
9126
|
+
ctx.fillStyle = tile.color;
|
|
9127
|
+
ctx.fillRect(tx, ty, tw, th);
|
|
9128
|
+
}
|
|
9129
|
+
}
|
|
9130
|
+
for (const unit of units) {
|
|
9131
|
+
if (unit.isPlayer) continue;
|
|
9132
|
+
const unitAsset = unitAssets?.[unit.color] ?? unitAssets?.["default"];
|
|
9133
|
+
const unitImg = unitAsset ? loadImg(unitAsset.url) : null;
|
|
9134
|
+
const ux = Math.floor(unit.x * scaleX2) - 1;
|
|
9135
|
+
const uy = Math.floor(unit.y * scaleY2) - 1;
|
|
9136
|
+
if (unitImg) {
|
|
9137
|
+
ctx.drawImage(unitImg, ux, uy, 5, 5);
|
|
9138
|
+
} else {
|
|
9139
|
+
ctx.fillStyle = unit.color;
|
|
9140
|
+
ctx.fillRect(ux, uy, 3, 3);
|
|
9141
|
+
}
|
|
9142
|
+
}
|
|
9143
|
+
if (viewportRect) {
|
|
9144
|
+
ctx.strokeStyle = "#ffffff";
|
|
9145
|
+
ctx.lineWidth = 1;
|
|
9146
|
+
ctx.strokeRect(
|
|
9147
|
+
Math.floor(viewportRect.x * scaleX2),
|
|
9148
|
+
Math.floor(viewportRect.y * scaleY2),
|
|
9149
|
+
Math.floor(viewportRect.w * scaleX2),
|
|
9150
|
+
Math.floor(viewportRect.h * scaleY2)
|
|
9151
|
+
);
|
|
9152
|
+
}
|
|
9153
|
+
}, [tiles, units, width, height, mapWidth, mapHeight, viewportRect, tileAssets, unitAssets]);
|
|
9154
|
+
const scaleX = width / mapWidth;
|
|
9155
|
+
const scaleY = height / mapHeight;
|
|
9156
|
+
const playerUnit = units.find((u) => u.isPlayer);
|
|
9157
|
+
const playerLeft = playerUnit ? Math.floor(playerUnit.x * scaleX) - 1 : null;
|
|
9158
|
+
const playerTop = playerUnit ? Math.floor(playerUnit.y * scaleY) - 1 : null;
|
|
9159
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
9160
|
+
/* @__PURE__ */ jsx("style", { children: `@keyframes minimap-blink{0%,49%{opacity:1}50%,100%{opacity:0}}` }),
|
|
9161
|
+
/* @__PURE__ */ jsxs(
|
|
9162
|
+
Box,
|
|
9163
|
+
{
|
|
9164
|
+
position: "relative",
|
|
9165
|
+
display: "inline-block",
|
|
9166
|
+
className: cn(
|
|
9167
|
+
"border border-border/20 rounded-container",
|
|
9168
|
+
className
|
|
9169
|
+
),
|
|
9170
|
+
children: [
|
|
9171
|
+
/* @__PURE__ */ jsx(
|
|
9172
|
+
"canvas",
|
|
9173
|
+
{
|
|
9174
|
+
ref: canvasRef,
|
|
9175
|
+
width,
|
|
9176
|
+
height,
|
|
9177
|
+
className: "block",
|
|
9178
|
+
style: { width, height }
|
|
9179
|
+
}
|
|
9180
|
+
),
|
|
9181
|
+
playerLeft !== null && playerTop !== null && /* @__PURE__ */ jsx(
|
|
9182
|
+
Box,
|
|
9183
|
+
{
|
|
9184
|
+
position: "absolute",
|
|
9185
|
+
style: {
|
|
9186
|
+
left: playerLeft,
|
|
9187
|
+
top: playerTop,
|
|
9188
|
+
width: 3,
|
|
9189
|
+
height: 3,
|
|
9190
|
+
backgroundColor: "#ffffff",
|
|
9191
|
+
animation: "minimap-blink 1s steps(2, end) infinite",
|
|
9192
|
+
pointerEvents: "none"
|
|
9193
|
+
}
|
|
9194
|
+
}
|
|
9195
|
+
)
|
|
9196
|
+
]
|
|
9197
|
+
}
|
|
9198
|
+
)
|
|
9199
|
+
] });
|
|
9200
|
+
}
|
|
9201
|
+
var DEFAULT_TILES, DEFAULT_UNITS, DEFAULT_VIEWPORT;
|
|
9202
|
+
var init_MiniMap = __esm({
|
|
9203
|
+
"components/game/atoms/MiniMap.tsx"() {
|
|
9204
|
+
"use client";
|
|
9205
|
+
init_cn();
|
|
9206
|
+
init_Box();
|
|
9207
|
+
DEFAULT_TILES = [
|
|
9208
|
+
{ x: 10, y: 10, color: "#4ade80" },
|
|
9209
|
+
{ x: 20, y: 15, color: "#4ade80" },
|
|
9210
|
+
{ x: 30, y: 25, color: "#22c55e" },
|
|
9211
|
+
{ x: 50, y: 40, color: "#4ade80" },
|
|
9212
|
+
{ x: 60, y: 55, color: "#16a34a" },
|
|
9213
|
+
{ x: 40, y: 60, color: "#4ade80" },
|
|
9214
|
+
{ x: 70, y: 30, color: "#22c55e" },
|
|
9215
|
+
{ x: 80, y: 70, color: "#4ade80" }
|
|
9216
|
+
];
|
|
9217
|
+
DEFAULT_UNITS = [
|
|
9218
|
+
{ x: 30, y: 30, color: "#60a5fa", isPlayer: true }
|
|
9219
|
+
];
|
|
9220
|
+
DEFAULT_VIEWPORT = { x: 20, y: 20, w: 40, h: 40 };
|
|
9221
|
+
MiniMap.displayName = "MiniMap";
|
|
9222
|
+
}
|
|
9223
|
+
});
|
|
10227
9224
|
function useCamera() {
|
|
10228
9225
|
const cameraRef = useRef({ x: 0, y: 0, zoom: 1 });
|
|
10229
9226
|
const targetCameraRef = useRef(null);
|
|
@@ -10333,7 +9330,7 @@ function useCamera() {
|
|
|
10333
9330
|
};
|
|
10334
9331
|
}
|
|
10335
9332
|
var init_useCamera = __esm({
|
|
10336
|
-
"
|
|
9333
|
+
"hooks/useCamera.ts"() {
|
|
10337
9334
|
"use client";
|
|
10338
9335
|
}
|
|
10339
9336
|
});
|
|
@@ -11212,7 +10209,7 @@ function Canvas({
|
|
|
11212
10209
|
keyMap,
|
|
11213
10210
|
keyUpMap
|
|
11214
10211
|
};
|
|
11215
|
-
return /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
|
|
10212
|
+
return /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(Canvas3DHost, { ...props3d }) });
|
|
11216
10213
|
}
|
|
11217
10214
|
return /* @__PURE__ */ jsx(
|
|
11218
10215
|
Canvas2D,
|
|
@@ -11236,35 +10233,17 @@ function Canvas({
|
|
|
11236
10233
|
}
|
|
11237
10234
|
);
|
|
11238
10235
|
}
|
|
11239
|
-
var
|
|
10236
|
+
var Canvas3DHost;
|
|
11240
10237
|
var init_Canvas = __esm({
|
|
11241
10238
|
"components/game/molecules/Canvas.tsx"() {
|
|
11242
10239
|
"use client";
|
|
11243
10240
|
init_Canvas2D();
|
|
11244
|
-
|
|
11245
|
-
() => import('@almadar/ui/components/molecules/game/three').then((m) => ({ default: m.
|
|
10241
|
+
Canvas3DHost = lazy(
|
|
10242
|
+
() => import('@almadar/ui/components/molecules/game/three').then((m) => ({ default: m.Canvas3DHost }))
|
|
11246
10243
|
);
|
|
11247
10244
|
Canvas.displayName = "Canvas";
|
|
11248
10245
|
}
|
|
11249
10246
|
});
|
|
11250
|
-
var init_useGameAudio = __esm({
|
|
11251
|
-
"components/game/hooks/useGameAudio.ts"() {
|
|
11252
|
-
"use client";
|
|
11253
|
-
}
|
|
11254
|
-
});
|
|
11255
|
-
function useGameAudioContextOptional() {
|
|
11256
|
-
return useContext(GameAudioContext);
|
|
11257
|
-
}
|
|
11258
|
-
var GameAudioContext;
|
|
11259
|
-
var init_GameAudioProvider = __esm({
|
|
11260
|
-
"components/game/providers/GameAudioProvider.tsx"() {
|
|
11261
|
-
"use client";
|
|
11262
|
-
init_useEventBus();
|
|
11263
|
-
init_useGameAudio();
|
|
11264
|
-
GameAudioContext = createContext(null);
|
|
11265
|
-
GameAudioContext.displayName = "GameAudioContext";
|
|
11266
|
-
}
|
|
11267
|
-
});
|
|
11268
10247
|
function GameAudioToggle({
|
|
11269
10248
|
size = "sm",
|
|
11270
10249
|
className,
|
|
@@ -11296,11 +10275,80 @@ var init_GameAudioToggle = __esm({
|
|
|
11296
10275
|
"use client";
|
|
11297
10276
|
init_atoms();
|
|
11298
10277
|
init_cn();
|
|
11299
|
-
init_GameAudioProvider();
|
|
11300
10278
|
init_GameIcon();
|
|
11301
10279
|
GameAudioToggle.displayName = "GameAudioToggle";
|
|
11302
10280
|
}
|
|
11303
10281
|
});
|
|
10282
|
+
function isKnownState(s) {
|
|
10283
|
+
return s in DEFAULT_STATE_STYLES;
|
|
10284
|
+
}
|
|
10285
|
+
function StateIndicator({
|
|
10286
|
+
assetUrl = DEFAULT_ASSET_URL,
|
|
10287
|
+
state = "idle",
|
|
10288
|
+
label,
|
|
10289
|
+
size = "md",
|
|
10290
|
+
animated = true,
|
|
10291
|
+
stateStyles,
|
|
10292
|
+
className
|
|
10293
|
+
}) {
|
|
10294
|
+
const mergedStyles = stateStyles ? { ...DEFAULT_STATE_STYLES, ...stateStyles } : DEFAULT_STATE_STYLES;
|
|
10295
|
+
const knownState = isKnownState(state) ? state : null;
|
|
10296
|
+
const config = knownState !== null ? mergedStyles[knownState] ?? DEFAULT_STYLE : DEFAULT_STYLE;
|
|
10297
|
+
const displayLabel = label ?? state.charAt(0).toUpperCase() + state.slice(1);
|
|
10298
|
+
return /* @__PURE__ */ jsxs(
|
|
10299
|
+
Box,
|
|
10300
|
+
{
|
|
10301
|
+
display: "inline-flex",
|
|
10302
|
+
className: cn(
|
|
10303
|
+
"items-center gap-1 rounded-full text-foreground font-medium",
|
|
10304
|
+
config.bgClass,
|
|
10305
|
+
SIZE_CLASSES[size],
|
|
10306
|
+
animated && (knownState === null || !STATIC_STATES.has(knownState)) && "animate-pulse",
|
|
10307
|
+
className
|
|
10308
|
+
),
|
|
10309
|
+
children: [
|
|
10310
|
+
/* @__PURE__ */ jsx(Box, { as: "span", children: assetUrl ? /* @__PURE__ */ jsx(GameIcon, { assetUrl, icon: "image", size: 16, alt: displayLabel, className: "flex-shrink-0" }) : typeof config.icon === "string" ? /^[a-zA-Z0-9-]+$/.test(config.icon) ? /* @__PURE__ */ jsx(Icon, { name: config.icon }) : config.icon : /* @__PURE__ */ jsx(Icon, { icon: config.icon }) }),
|
|
10311
|
+
/* @__PURE__ */ jsx(Box, { as: "span", children: displayLabel })
|
|
10312
|
+
]
|
|
10313
|
+
}
|
|
10314
|
+
);
|
|
10315
|
+
}
|
|
10316
|
+
var DEFAULT_ASSET_URL, DEFAULT_STATE_STYLES, DEFAULT_STYLE, STATIC_STATES, SIZE_CLASSES;
|
|
10317
|
+
var init_StateIndicator = __esm({
|
|
10318
|
+
"components/game/atoms/StateIndicator.tsx"() {
|
|
10319
|
+
init_Box();
|
|
10320
|
+
init_Icon();
|
|
10321
|
+
init_cn();
|
|
10322
|
+
init_GameIcon();
|
|
10323
|
+
DEFAULT_ASSET_URL = {
|
|
10324
|
+
url: "https://almadar-kflow-assets.web.app/shared/isometric-dungeon/Isometric/chestClosed_E.png",
|
|
10325
|
+
role: "ui",
|
|
10326
|
+
category: "state"
|
|
10327
|
+
};
|
|
10328
|
+
DEFAULT_STATE_STYLES = {
|
|
10329
|
+
idle: { icon: "\u23F8", bgClass: "bg-muted" },
|
|
10330
|
+
active: { icon: "\u25B6", bgClass: "bg-success" },
|
|
10331
|
+
sleeping: { icon: "\u{1F4A4}", bgClass: "bg-muted" },
|
|
10332
|
+
moving: { icon: "\u{1F6B6}", bgClass: "bg-info" },
|
|
10333
|
+
eating: { icon: "\u{1F37D}\uFE0F", bgClass: "bg-success" },
|
|
10334
|
+
waiting: { icon: "\u23F3", bgClass: "bg-warning" },
|
|
10335
|
+
happy: { icon: "\u{1F60A}", bgClass: "bg-success" },
|
|
10336
|
+
scared: { icon: "\u{1F628}", bgClass: "bg-error" },
|
|
10337
|
+
done: { icon: "\u2713", bgClass: "bg-success" },
|
|
10338
|
+
error: { icon: "\u2717", bgClass: "bg-error" },
|
|
10339
|
+
ready: { icon: "\u2713", bgClass: "bg-success" },
|
|
10340
|
+
cooldown: { icon: "\u{1F504}", bgClass: "bg-warning" }
|
|
10341
|
+
};
|
|
10342
|
+
DEFAULT_STYLE = { icon: "?", bgClass: "bg-muted" };
|
|
10343
|
+
STATIC_STATES = /* @__PURE__ */ new Set(["idle", "done"]);
|
|
10344
|
+
SIZE_CLASSES = {
|
|
10345
|
+
sm: "text-xs px-1.5 py-0.5",
|
|
10346
|
+
md: "text-sm px-2 py-1",
|
|
10347
|
+
lg: "text-base px-3 py-1.5"
|
|
10348
|
+
};
|
|
10349
|
+
StateIndicator.displayName = "StateIndicator";
|
|
10350
|
+
}
|
|
10351
|
+
});
|
|
11304
10352
|
function LinearView({
|
|
11305
10353
|
trait,
|
|
11306
10354
|
size = "md",
|
|
@@ -11312,7 +10360,7 @@ function LinearView({
|
|
|
11312
10360
|
/* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
|
|
11313
10361
|
const isDone = i < currentIdx;
|
|
11314
10362
|
const isCurrent = i === currentIdx;
|
|
11315
|
-
return /* @__PURE__ */ jsxs(
|
|
10363
|
+
return /* @__PURE__ */ jsxs(React81__default.Fragment, { children: [
|
|
11316
10364
|
i > 0 && /* @__PURE__ */ jsx(
|
|
11317
10365
|
Typography,
|
|
11318
10366
|
{
|
|
@@ -11847,7 +10895,7 @@ function SequenceBar({
|
|
|
11847
10895
|
else onSlotRemove?.(index);
|
|
11848
10896
|
}, [emit, slotRemoveEvent, onSlotRemove, playing]);
|
|
11849
10897
|
const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
|
|
11850
|
-
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(
|
|
10898
|
+
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React81__default.Fragment, { children: [
|
|
11851
10899
|
i > 0 && /* @__PURE__ */ jsx(
|
|
11852
10900
|
Typography,
|
|
11853
10901
|
{
|
|
@@ -11885,254 +10933,10 @@ var init_SequenceBar = __esm({
|
|
|
11885
10933
|
SequenceBar.displayName = "SequenceBar";
|
|
11886
10934
|
}
|
|
11887
10935
|
});
|
|
11888
|
-
function RuleEditor({
|
|
11889
|
-
rule,
|
|
11890
|
-
availableEvents,
|
|
11891
|
-
availableActions,
|
|
11892
|
-
onChange,
|
|
11893
|
-
onRemove,
|
|
11894
|
-
disabled = false,
|
|
11895
|
-
className
|
|
11896
|
-
}) {
|
|
11897
|
-
const { t } = useTranslate();
|
|
11898
|
-
const handleWhenChange = useCallback((v) => {
|
|
11899
|
-
onChange({ ...rule, whenEvent: v });
|
|
11900
|
-
}, [rule, onChange]);
|
|
11901
|
-
const handleThenChange = useCallback((v) => {
|
|
11902
|
-
onChange({ ...rule, thenAction: v });
|
|
11903
|
-
}, [rule, onChange]);
|
|
11904
|
-
return /* @__PURE__ */ jsxs(HStack, { className: cn("items-center p-2 rounded-lg bg-muted/50 border border-border", className), gap: "sm", children: [
|
|
11905
|
-
/* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-primary font-bold whitespace-nowrap", children: t("eventHandler.when") }),
|
|
11906
|
-
/* @__PURE__ */ jsx(
|
|
11907
|
-
Select,
|
|
11908
|
-
{
|
|
11909
|
-
value: rule.whenEvent,
|
|
11910
|
-
onValueChange: handleWhenChange,
|
|
11911
|
-
options: availableEvents,
|
|
11912
|
-
disabled,
|
|
11913
|
-
className: "flex-1 min-w-0"
|
|
11914
|
-
}
|
|
11915
|
-
),
|
|
11916
|
-
/* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-accent font-bold whitespace-nowrap", children: "\u2192 " + t("eventHandler.then") }),
|
|
11917
|
-
/* @__PURE__ */ jsx(
|
|
11918
|
-
Select,
|
|
11919
|
-
{
|
|
11920
|
-
value: rule.thenAction,
|
|
11921
|
-
onValueChange: handleThenChange,
|
|
11922
|
-
options: availableActions,
|
|
11923
|
-
disabled,
|
|
11924
|
-
className: "flex-1 min-w-0"
|
|
11925
|
-
}
|
|
11926
|
-
),
|
|
11927
|
-
onRemove && /* @__PURE__ */ jsx(Button, { variant: "ghost", onClick: onRemove, disabled, className: "shrink-0", children: "\xD7" })
|
|
11928
|
-
] });
|
|
11929
|
-
}
|
|
11930
|
-
var init_RuleEditor = __esm({
|
|
11931
|
-
"components/game/molecules/RuleEditor.tsx"() {
|
|
11932
|
-
init_atoms();
|
|
11933
|
-
init_cn();
|
|
11934
|
-
RuleEditor.displayName = "RuleEditor";
|
|
11935
|
-
}
|
|
11936
|
-
});
|
|
11937
|
-
function EventLog({
|
|
11938
|
-
entries,
|
|
11939
|
-
maxHeight = 200,
|
|
11940
|
-
label,
|
|
11941
|
-
className
|
|
11942
|
-
}) {
|
|
11943
|
-
const { t } = useTranslate();
|
|
11944
|
-
const scrollRef = useRef(null);
|
|
11945
|
-
useEffect(() => {
|
|
11946
|
-
if (scrollRef.current) {
|
|
11947
|
-
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
11948
|
-
}
|
|
11949
|
-
}, [entries.length]);
|
|
11950
|
-
return /* @__PURE__ */ jsxs(VStack, { className: cn("p-3 rounded-lg bg-card border border-border", className), gap: "sm", children: [
|
|
11951
|
-
/* @__PURE__ */ jsx(Typography, { variant: "body2", className: "text-muted-foreground font-medium", children: label ?? t("eventHandler.eventLog") }),
|
|
11952
|
-
/* @__PURE__ */ jsx(
|
|
11953
|
-
Box,
|
|
11954
|
-
{
|
|
11955
|
-
ref: scrollRef,
|
|
11956
|
-
className: "overflow-y-auto",
|
|
11957
|
-
style: { maxHeight },
|
|
11958
|
-
children: /* @__PURE__ */ jsxs(VStack, { gap: "xs", children: [
|
|
11959
|
-
entries.length === 0 && /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-muted-foreground italic", children: t("eventHandler.noEvents") }),
|
|
11960
|
-
entries.map((entry) => /* @__PURE__ */ jsxs(HStack, { className: "items-start", gap: "xs", children: [
|
|
11961
|
-
/* @__PURE__ */ jsx(Typography, { variant: "caption", className: STATUS_STYLES[entry.status], children: STATUS_DOTS[entry.status] }),
|
|
11962
|
-
/* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-foreground", children: entry.icon }),
|
|
11963
|
-
/* @__PURE__ */ jsx(Typography, { variant: "caption", className: cn("flex-1", STATUS_STYLES[entry.status]), children: entry.message })
|
|
11964
|
-
] }, entry.id))
|
|
11965
|
-
] })
|
|
11966
|
-
}
|
|
11967
|
-
)
|
|
11968
|
-
] });
|
|
11969
|
-
}
|
|
11970
|
-
var STATUS_STYLES, STATUS_DOTS;
|
|
11971
|
-
var init_EventLog = __esm({
|
|
11972
|
-
"components/game/molecules/EventLog.tsx"() {
|
|
11973
|
-
init_atoms();
|
|
11974
|
-
init_cn();
|
|
11975
|
-
STATUS_STYLES = {
|
|
11976
|
-
pending: "text-muted-foreground",
|
|
11977
|
-
active: "text-primary animate-pulse",
|
|
11978
|
-
done: "text-success",
|
|
11979
|
-
error: "text-error"
|
|
11980
|
-
};
|
|
11981
|
-
STATUS_DOTS = {
|
|
11982
|
-
pending: "\u25CB",
|
|
11983
|
-
active: "\u25CF",
|
|
11984
|
-
done: "\u2714",
|
|
11985
|
-
error: "\u2717"
|
|
11986
|
-
};
|
|
11987
|
-
EventLog.displayName = "EventLog";
|
|
11988
|
-
}
|
|
11989
|
-
});
|
|
11990
10936
|
|
|
11991
|
-
//
|
|
11992
|
-
function objId(o) {
|
|
11993
|
-
return o.id == null ? "" : String(o.id);
|
|
11994
|
-
}
|
|
11995
|
-
function objName(o) {
|
|
11996
|
-
return o.name == null ? "" : String(o.name);
|
|
11997
|
-
}
|
|
11998
|
-
function objIcon(o) {
|
|
11999
|
-
return o.icon == null ? "" : String(o.icon);
|
|
12000
|
-
}
|
|
12001
|
-
function objStates(o) {
|
|
12002
|
-
return Array.isArray(o.states) ? o.states : [];
|
|
12003
|
-
}
|
|
12004
|
-
function objCurrentState(o) {
|
|
12005
|
-
return o.currentState == null ? "" : String(o.currentState);
|
|
12006
|
-
}
|
|
12007
|
-
function objAvailableEvents(o) {
|
|
12008
|
-
return Array.isArray(o.availableEvents) ? o.availableEvents : [];
|
|
12009
|
-
}
|
|
12010
|
-
function objAvailableActions(o) {
|
|
12011
|
-
return Array.isArray(o.availableActions) ? o.availableActions : [];
|
|
12012
|
-
}
|
|
12013
|
-
function objRules(o) {
|
|
12014
|
-
return Array.isArray(o.rules) ? o.rules : [];
|
|
12015
|
-
}
|
|
12016
|
-
function objMaxRules(o) {
|
|
12017
|
-
const n = Number(o.maxRules);
|
|
12018
|
-
return Number.isFinite(n) && n > 0 ? n : 3;
|
|
12019
|
-
}
|
|
10937
|
+
// lib/puzzleObject.ts
|
|
12020
10938
|
var init_puzzleObject = __esm({
|
|
12021
|
-
"
|
|
12022
|
-
}
|
|
12023
|
-
});
|
|
12024
|
-
function ObjectRulePanel({
|
|
12025
|
-
object,
|
|
12026
|
-
onRulesChange,
|
|
12027
|
-
rulesChangeEvent,
|
|
12028
|
-
disabled = false,
|
|
12029
|
-
className
|
|
12030
|
-
}) {
|
|
12031
|
-
const { t } = useTranslate();
|
|
12032
|
-
const { emit } = useEventBus();
|
|
12033
|
-
const id = objId(object);
|
|
12034
|
-
const name = objName(object);
|
|
12035
|
-
const icon = objIcon(object);
|
|
12036
|
-
const states = objStates(object);
|
|
12037
|
-
const currentState = objCurrentState(object);
|
|
12038
|
-
const availableEvents = objAvailableEvents(object);
|
|
12039
|
-
const availableActions = objAvailableActions(object);
|
|
12040
|
-
const rules = objRules(object);
|
|
12041
|
-
const maxRules = objMaxRules(object);
|
|
12042
|
-
const canAdd = rules.length < maxRules;
|
|
12043
|
-
const emitRules = useCallback((newRules) => {
|
|
12044
|
-
if (rulesChangeEvent) emit(`UI:${rulesChangeEvent}`, { objectId: id, rules: newRules });
|
|
12045
|
-
else onRulesChange?.(id, newRules);
|
|
12046
|
-
}, [rulesChangeEvent, emit, id, onRulesChange]);
|
|
12047
|
-
const handleRuleChange = useCallback((index, updatedRule) => {
|
|
12048
|
-
const newRules = [...rules];
|
|
12049
|
-
newRules[index] = updatedRule;
|
|
12050
|
-
emitRules(newRules);
|
|
12051
|
-
}, [rules, emitRules]);
|
|
12052
|
-
const handleRuleRemove = useCallback((index) => {
|
|
12053
|
-
const newRules = rules.filter((_, i) => i !== index);
|
|
12054
|
-
emitRules(newRules);
|
|
12055
|
-
}, [rules, emitRules]);
|
|
12056
|
-
const handleAddRule = useCallback(() => {
|
|
12057
|
-
if (!canAdd || disabled) return;
|
|
12058
|
-
const firstEvent = availableEvents[0]?.value || "";
|
|
12059
|
-
const firstAction = availableActions[0]?.value || "";
|
|
12060
|
-
const newRule = {
|
|
12061
|
-
id: `rule-${nextRuleId++}`,
|
|
12062
|
-
whenEvent: firstEvent,
|
|
12063
|
-
thenAction: firstAction
|
|
12064
|
-
};
|
|
12065
|
-
emitRules([...rules, newRule]);
|
|
12066
|
-
}, [canAdd, disabled, rules, availableEvents, availableActions, emitRules]);
|
|
12067
|
-
const machine = {
|
|
12068
|
-
name,
|
|
12069
|
-
states,
|
|
12070
|
-
currentState,
|
|
12071
|
-
transitions: rules.map((r) => ({
|
|
12072
|
-
from: currentState,
|
|
12073
|
-
to: states.find((s) => s !== currentState) || currentState,
|
|
12074
|
-
event: r.whenEvent
|
|
12075
|
-
}))
|
|
12076
|
-
};
|
|
12077
|
-
return /* @__PURE__ */ jsxs(VStack, { className: cn("p-4 rounded-lg bg-card border border-border", className), gap: "sm", children: [
|
|
12078
|
-
/* @__PURE__ */ jsxs(HStack, { className: "items-center", gap: "sm", children: [
|
|
12079
|
-
/* @__PURE__ */ jsx(Typography, { variant: "h5", children: icon }),
|
|
12080
|
-
/* @__PURE__ */ jsxs(VStack, { gap: "none", children: [
|
|
12081
|
-
/* @__PURE__ */ jsx(Typography, { variant: "body1", className: "text-foreground font-bold", children: name }),
|
|
12082
|
-
/* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-muted-foreground", children: t("eventHandler.state") + ": " + currentState })
|
|
12083
|
-
] })
|
|
12084
|
-
] }),
|
|
12085
|
-
/* @__PURE__ */ jsx(TraitStateViewer, { trait: machine, variant: "compact", size: "sm" }),
|
|
12086
|
-
/* @__PURE__ */ jsxs(VStack, { gap: "xs", children: [
|
|
12087
|
-
/* @__PURE__ */ jsx(Typography, { variant: "body2", className: "text-muted-foreground font-medium", children: t("eventHandler.rules", { count: rules.length, max: maxRules }) + ":" }),
|
|
12088
|
-
rules.map((rule, i) => /* @__PURE__ */ jsx(
|
|
12089
|
-
RuleEditor,
|
|
12090
|
-
{
|
|
12091
|
-
rule,
|
|
12092
|
-
availableEvents,
|
|
12093
|
-
availableActions,
|
|
12094
|
-
onChange: (r) => handleRuleChange(i, r),
|
|
12095
|
-
onRemove: () => handleRuleRemove(i),
|
|
12096
|
-
disabled
|
|
12097
|
-
},
|
|
12098
|
-
rule.id
|
|
12099
|
-
)),
|
|
12100
|
-
canAdd && !disabled && /* @__PURE__ */ jsx(Button, { variant: "ghost", onClick: handleAddRule, className: "self-start", children: t("eventHandler.addRule") })
|
|
12101
|
-
] })
|
|
12102
|
-
] });
|
|
12103
|
-
}
|
|
12104
|
-
var nextRuleId;
|
|
12105
|
-
var init_ObjectRulePanel = __esm({
|
|
12106
|
-
"components/game/molecules/ObjectRulePanel.tsx"() {
|
|
12107
|
-
init_atoms();
|
|
12108
|
-
init_cn();
|
|
12109
|
-
init_useEventBus();
|
|
12110
|
-
init_TraitStateViewer();
|
|
12111
|
-
init_RuleEditor();
|
|
12112
|
-
init_puzzleObject();
|
|
12113
|
-
nextRuleId = 1;
|
|
12114
|
-
ObjectRulePanel.displayName = "ObjectRulePanel";
|
|
12115
|
-
}
|
|
12116
|
-
});
|
|
12117
|
-
function VariablePanel({
|
|
12118
|
-
entityName,
|
|
12119
|
-
variables,
|
|
12120
|
-
className
|
|
12121
|
-
}) {
|
|
12122
|
-
const { t } = useTranslate();
|
|
12123
|
-
return /* @__PURE__ */ jsxs(VStack, { className: cn("p-3 rounded-lg bg-card border border-border", className), gap: "sm", children: [
|
|
12124
|
-
/* @__PURE__ */ jsx(Typography, { variant: "body2", className: "text-muted-foreground font-medium", children: t("stateArchitect.variables", { name: entityName }) }),
|
|
12125
|
-
(variables ?? []).map((v) => /* @__PURE__ */ jsxs(HStack, { className: "items-center justify-between", children: [
|
|
12126
|
-
/* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-foreground font-medium", children: v.name }),
|
|
12127
|
-
/* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-accent font-mono", children: v.value })
|
|
12128
|
-
] }, v.name))
|
|
12129
|
-
] });
|
|
12130
|
-
}
|
|
12131
|
-
var init_VariablePanel = __esm({
|
|
12132
|
-
"components/game/molecules/VariablePanel.tsx"() {
|
|
12133
|
-
init_atoms();
|
|
12134
|
-
init_cn();
|
|
12135
|
-
VariablePanel.displayName = "VariablePanel";
|
|
10939
|
+
"lib/puzzleObject.ts"() {
|
|
12136
10940
|
}
|
|
12137
10941
|
});
|
|
12138
10942
|
function StateJsonView({
|
|
@@ -12173,125 +10977,6 @@ var init_StateJsonView = __esm({
|
|
|
12173
10977
|
StateJsonView.displayName = "StateJsonView";
|
|
12174
10978
|
}
|
|
12175
10979
|
});
|
|
12176
|
-
var GameTemplate;
|
|
12177
|
-
var init_GameTemplate = __esm({
|
|
12178
|
-
"components/game/templates/GameTemplate.tsx"() {
|
|
12179
|
-
init_cn();
|
|
12180
|
-
init_Box();
|
|
12181
|
-
init_Stack();
|
|
12182
|
-
init_Typography();
|
|
12183
|
-
init_Button();
|
|
12184
|
-
GameTemplate = ({
|
|
12185
|
-
entity,
|
|
12186
|
-
title = "Game",
|
|
12187
|
-
children,
|
|
12188
|
-
hud,
|
|
12189
|
-
debugPanel,
|
|
12190
|
-
showDebugPanel = false,
|
|
12191
|
-
controls,
|
|
12192
|
-
className,
|
|
12193
|
-
backgroundAsset
|
|
12194
|
-
}) => {
|
|
12195
|
-
return /* @__PURE__ */ jsxs(
|
|
12196
|
-
Box,
|
|
12197
|
-
{
|
|
12198
|
-
display: "flex",
|
|
12199
|
-
fullHeight: true,
|
|
12200
|
-
className: cn("flex-col lg:flex-row", className),
|
|
12201
|
-
children: [
|
|
12202
|
-
/* @__PURE__ */ jsxs(Box, { display: "flex", className: "flex-1 flex-col", children: [
|
|
12203
|
-
/* @__PURE__ */ jsxs(
|
|
12204
|
-
Box,
|
|
12205
|
-
{
|
|
12206
|
-
padding: "md",
|
|
12207
|
-
border: true,
|
|
12208
|
-
className: "border-b-2 border-x-0 border-t-0 border-border flex items-center justify-between",
|
|
12209
|
-
children: [
|
|
12210
|
-
/* @__PURE__ */ jsx(Typography, { variant: "h4", children: title }),
|
|
12211
|
-
controls && /* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "center", children: [
|
|
12212
|
-
controls.isPlaying ? /* @__PURE__ */ jsx(
|
|
12213
|
-
Button,
|
|
12214
|
-
{
|
|
12215
|
-
variant: "secondary",
|
|
12216
|
-
size: "sm",
|
|
12217
|
-
icon: "pause",
|
|
12218
|
-
onClick: controls.onPause,
|
|
12219
|
-
children: "Pause"
|
|
12220
|
-
}
|
|
12221
|
-
) : /* @__PURE__ */ jsx(
|
|
12222
|
-
Button,
|
|
12223
|
-
{
|
|
12224
|
-
variant: "primary",
|
|
12225
|
-
size: "sm",
|
|
12226
|
-
icon: "play",
|
|
12227
|
-
onClick: controls.onPlay,
|
|
12228
|
-
children: "Play"
|
|
12229
|
-
}
|
|
12230
|
-
),
|
|
12231
|
-
/* @__PURE__ */ jsx(
|
|
12232
|
-
Button,
|
|
12233
|
-
{
|
|
12234
|
-
variant: "ghost",
|
|
12235
|
-
size: "sm",
|
|
12236
|
-
icon: "rotate-ccw",
|
|
12237
|
-
onClick: controls.onReset,
|
|
12238
|
-
children: "Reset"
|
|
12239
|
-
}
|
|
12240
|
-
)
|
|
12241
|
-
] })
|
|
12242
|
-
]
|
|
12243
|
-
}
|
|
12244
|
-
),
|
|
12245
|
-
/* @__PURE__ */ jsxs(
|
|
12246
|
-
Box,
|
|
12247
|
-
{
|
|
12248
|
-
position: "relative",
|
|
12249
|
-
fullWidth: true,
|
|
12250
|
-
className: backgroundAsset ? "flex-1" : "flex-1 bg-muted",
|
|
12251
|
-
style: backgroundAsset ? { backgroundImage: `url(${backgroundAsset.url})`, backgroundSize: "cover", backgroundPosition: "center" } : void 0,
|
|
12252
|
-
children: [
|
|
12253
|
-
children,
|
|
12254
|
-
hud && /* @__PURE__ */ jsx(
|
|
12255
|
-
Box,
|
|
12256
|
-
{
|
|
12257
|
-
position: "absolute",
|
|
12258
|
-
className: "top-0 left-0 right-0 pointer-events-none",
|
|
12259
|
-
children: /* @__PURE__ */ jsx(Box, { padding: "md", className: "pointer-events-auto w-fit", children: hud })
|
|
12260
|
-
}
|
|
12261
|
-
)
|
|
12262
|
-
]
|
|
12263
|
-
}
|
|
12264
|
-
)
|
|
12265
|
-
] }),
|
|
12266
|
-
showDebugPanel && debugPanel && /* @__PURE__ */ jsxs(
|
|
12267
|
-
Box,
|
|
12268
|
-
{
|
|
12269
|
-
bg: "surface",
|
|
12270
|
-
border: true,
|
|
12271
|
-
shadow: "sm",
|
|
12272
|
-
overflow: "auto",
|
|
12273
|
-
className: "w-full lg:w-80 lg:border-l-2 lg:border-t-0 border-t-2 border-border",
|
|
12274
|
-
children: [
|
|
12275
|
-
/* @__PURE__ */ jsx(
|
|
12276
|
-
Box,
|
|
12277
|
-
{
|
|
12278
|
-
padding: "md",
|
|
12279
|
-
border: true,
|
|
12280
|
-
className: "border-b-2 border-x-0 border-t-0 border-border",
|
|
12281
|
-
children: /* @__PURE__ */ jsx(Typography, { variant: "h6", children: "Debug Panel" })
|
|
12282
|
-
}
|
|
12283
|
-
),
|
|
12284
|
-
/* @__PURE__ */ jsx(Box, { padding: "md", children: debugPanel })
|
|
12285
|
-
]
|
|
12286
|
-
}
|
|
12287
|
-
)
|
|
12288
|
-
]
|
|
12289
|
-
}
|
|
12290
|
-
);
|
|
12291
|
-
};
|
|
12292
|
-
GameTemplate.displayName = "GameTemplate";
|
|
12293
|
-
}
|
|
12294
|
-
});
|
|
12295
10980
|
var FONT_BASE, GAME_FONTS, FONT_FACES, GameShell;
|
|
12296
10981
|
var init_GameShell = __esm({
|
|
12297
10982
|
"components/game/templates/GameShell.tsx"() {
|
|
@@ -12462,11 +11147,9 @@ var init_GameShell = __esm({
|
|
|
12462
11147
|
GameShell.displayName = "GameShell";
|
|
12463
11148
|
}
|
|
12464
11149
|
});
|
|
12465
|
-
|
|
12466
|
-
// components/game/molecules/index.ts
|
|
12467
11150
|
var init_molecules = __esm({
|
|
12468
11151
|
"components/game/molecules/index.ts"() {
|
|
12469
|
-
|
|
11152
|
+
init_gameShared();
|
|
12470
11153
|
init_puzzleObject();
|
|
12471
11154
|
}
|
|
12472
11155
|
});
|
|
@@ -12866,7 +11549,7 @@ var init_ErrorBoundary = __esm({
|
|
|
12866
11549
|
}
|
|
12867
11550
|
);
|
|
12868
11551
|
};
|
|
12869
|
-
ErrorBoundary = class extends
|
|
11552
|
+
ErrorBoundary = class extends React81__default.Component {
|
|
12870
11553
|
constructor(props) {
|
|
12871
11554
|
super(props);
|
|
12872
11555
|
__publicField(this, "reset", () => {
|
|
@@ -13148,7 +11831,7 @@ var init_Container = __esm({
|
|
|
13148
11831
|
as: Component = "div"
|
|
13149
11832
|
}) => {
|
|
13150
11833
|
const resolvedSize = maxWidth ?? size ?? "lg";
|
|
13151
|
-
return
|
|
11834
|
+
return React81__default.createElement(
|
|
13152
11835
|
Component,
|
|
13153
11836
|
{
|
|
13154
11837
|
className: cn(
|
|
@@ -15973,7 +14656,7 @@ var init_CodeBlock = __esm({
|
|
|
15973
14656
|
DIFF_STYLE_FALLBACK = { bg: "", prefix: " ", text: "text-foreground" };
|
|
15974
14657
|
LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
15975
14658
|
HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
15976
|
-
CodeBlock =
|
|
14659
|
+
CodeBlock = React81__default.memo(
|
|
15977
14660
|
({
|
|
15978
14661
|
code: rawCode,
|
|
15979
14662
|
language = "text",
|
|
@@ -16560,7 +15243,7 @@ var init_MarkdownContent = __esm({
|
|
|
16560
15243
|
init_Box();
|
|
16561
15244
|
init_CodeBlock();
|
|
16562
15245
|
init_cn();
|
|
16563
|
-
MarkdownContent =
|
|
15246
|
+
MarkdownContent = React81__default.memo(
|
|
16564
15247
|
({ content, direction = "ltr", className }) => {
|
|
16565
15248
|
const { t: _t } = useTranslate();
|
|
16566
15249
|
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
@@ -17837,7 +16520,7 @@ var init_StateMachineView = __esm({
|
|
|
17837
16520
|
style: { top: title ? 30 : 0 },
|
|
17838
16521
|
children: [
|
|
17839
16522
|
entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
|
|
17840
|
-
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(
|
|
16523
|
+
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React81__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
|
|
17841
16524
|
StateNode2,
|
|
17842
16525
|
{
|
|
17843
16526
|
state,
|
|
@@ -19268,14 +17951,14 @@ function SpacerPattern({ size = "flex" }) {
|
|
|
19268
17951
|
if (size === "flex") {
|
|
19269
17952
|
return /* @__PURE__ */ jsx(Spacer, {});
|
|
19270
17953
|
}
|
|
19271
|
-
const
|
|
17954
|
+
const sizeMap8 = {
|
|
19272
17955
|
xs: "0.25rem",
|
|
19273
17956
|
sm: "0.5rem",
|
|
19274
17957
|
md: "1rem",
|
|
19275
17958
|
lg: "1.5rem",
|
|
19276
17959
|
xl: "2rem"
|
|
19277
17960
|
};
|
|
19278
|
-
return /* @__PURE__ */ jsx(Box, { style: { width:
|
|
17961
|
+
return /* @__PURE__ */ jsx(Box, { style: { width: sizeMap8[size], height: sizeMap8[size], flexShrink: 0 } });
|
|
19279
17962
|
}
|
|
19280
17963
|
function DividerPattern({
|
|
19281
17964
|
orientation = "horizontal",
|
|
@@ -23394,8 +22077,8 @@ var init_Menu = __esm({
|
|
|
23394
22077
|
"bottom-end": "bottom-start"
|
|
23395
22078
|
};
|
|
23396
22079
|
const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
|
|
23397
|
-
const triggerChild =
|
|
23398
|
-
const triggerElement =
|
|
22080
|
+
const triggerChild = React81__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
|
|
22081
|
+
const triggerElement = React81__default.cloneElement(
|
|
23399
22082
|
triggerChild,
|
|
23400
22083
|
{
|
|
23401
22084
|
ref: triggerRef,
|
|
@@ -23490,14 +22173,14 @@ function useDataDnd(args) {
|
|
|
23490
22173
|
const isZone = Boolean(dragGroup || accepts || sortable);
|
|
23491
22174
|
const enabled = isZone || Boolean(dndRoot);
|
|
23492
22175
|
const eventBus = useEventBus();
|
|
23493
|
-
const parentRoot =
|
|
22176
|
+
const parentRoot = React81__default.useContext(RootCtx);
|
|
23494
22177
|
const isRoot = enabled && parentRoot === null;
|
|
23495
|
-
const zoneId =
|
|
22178
|
+
const zoneId = React81__default.useId();
|
|
23496
22179
|
const ownGroup = dragGroup ?? accepts ?? zoneId;
|
|
23497
|
-
const [optimisticOrders, setOptimisticOrders] =
|
|
23498
|
-
const optimisticOrdersRef =
|
|
22180
|
+
const [optimisticOrders, setOptimisticOrders] = React81__default.useState(() => /* @__PURE__ */ new Map());
|
|
22181
|
+
const optimisticOrdersRef = React81__default.useRef(optimisticOrders);
|
|
23499
22182
|
optimisticOrdersRef.current = optimisticOrders;
|
|
23500
|
-
const clearOptimisticOrder =
|
|
22183
|
+
const clearOptimisticOrder = React81__default.useCallback((group) => {
|
|
23501
22184
|
setOptimisticOrders((prev) => {
|
|
23502
22185
|
if (!prev.has(group)) return prev;
|
|
23503
22186
|
const next = new Map(prev);
|
|
@@ -23522,7 +22205,7 @@ function useDataDnd(args) {
|
|
|
23522
22205
|
const raw = it[dndItemIdField];
|
|
23523
22206
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
23524
22207
|
}).join("|");
|
|
23525
|
-
const itemIds =
|
|
22208
|
+
const itemIds = React81__default.useMemo(
|
|
23526
22209
|
() => orderedItems.map((it, idx) => {
|
|
23527
22210
|
const raw = it[dndItemIdField];
|
|
23528
22211
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
@@ -23533,7 +22216,7 @@ function useDataDnd(args) {
|
|
|
23533
22216
|
const raw = it[dndItemIdField];
|
|
23534
22217
|
return raw != null ? String(raw) : `__${idx}`;
|
|
23535
22218
|
}).join("|");
|
|
23536
|
-
|
|
22219
|
+
React81__default.useEffect(() => {
|
|
23537
22220
|
const root = isRoot ? null : parentRoot;
|
|
23538
22221
|
if (root) {
|
|
23539
22222
|
root.clearOptimisticOrder(ownGroup);
|
|
@@ -23541,20 +22224,20 @@ function useDataDnd(args) {
|
|
|
23541
22224
|
clearOptimisticOrder(ownGroup);
|
|
23542
22225
|
}
|
|
23543
22226
|
}, [itemsContentSig, ownGroup]);
|
|
23544
|
-
const zonesRef =
|
|
23545
|
-
const registerZone =
|
|
22227
|
+
const zonesRef = React81__default.useRef(/* @__PURE__ */ new Map());
|
|
22228
|
+
const registerZone = React81__default.useCallback((zoneId2, meta2) => {
|
|
23546
22229
|
zonesRef.current.set(zoneId2, meta2);
|
|
23547
22230
|
}, []);
|
|
23548
|
-
const unregisterZone =
|
|
22231
|
+
const unregisterZone = React81__default.useCallback((zoneId2) => {
|
|
23549
22232
|
zonesRef.current.delete(zoneId2);
|
|
23550
22233
|
}, []);
|
|
23551
|
-
const [activeDrag, setActiveDrag] =
|
|
23552
|
-
const [overZoneGroup, setOverZoneGroup] =
|
|
23553
|
-
const meta =
|
|
22234
|
+
const [activeDrag, setActiveDrag] = React81__default.useState(null);
|
|
22235
|
+
const [overZoneGroup, setOverZoneGroup] = React81__default.useState(null);
|
|
22236
|
+
const meta = React81__default.useMemo(
|
|
23554
22237
|
() => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
|
|
23555
22238
|
[ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
|
|
23556
22239
|
);
|
|
23557
|
-
|
|
22240
|
+
React81__default.useEffect(() => {
|
|
23558
22241
|
const target = isRoot ? null : parentRoot;
|
|
23559
22242
|
if (!target) {
|
|
23560
22243
|
zonesRef.current.set(zoneId, meta);
|
|
@@ -23573,7 +22256,7 @@ function useDataDnd(args) {
|
|
|
23573
22256
|
}, [parentRoot, isRoot, zoneId, meta]);
|
|
23574
22257
|
const sensors = useAlmadarDndSensors(true);
|
|
23575
22258
|
const collisionDetection = almadarDndCollisionDetection;
|
|
23576
|
-
const findZoneByItem =
|
|
22259
|
+
const findZoneByItem = React81__default.useCallback(
|
|
23577
22260
|
(id) => {
|
|
23578
22261
|
for (const z of zonesRef.current.values()) {
|
|
23579
22262
|
if (z.itemIds.includes(id)) return z;
|
|
@@ -23582,7 +22265,7 @@ function useDataDnd(args) {
|
|
|
23582
22265
|
},
|
|
23583
22266
|
[]
|
|
23584
22267
|
);
|
|
23585
|
-
|
|
22268
|
+
React81__default.useCallback(
|
|
23586
22269
|
(group) => {
|
|
23587
22270
|
for (const z of zonesRef.current.values()) {
|
|
23588
22271
|
if (z.group === group) return z;
|
|
@@ -23591,7 +22274,7 @@ function useDataDnd(args) {
|
|
|
23591
22274
|
},
|
|
23592
22275
|
[]
|
|
23593
22276
|
);
|
|
23594
|
-
const handleDragEnd =
|
|
22277
|
+
const handleDragEnd = React81__default.useCallback(
|
|
23595
22278
|
(event) => {
|
|
23596
22279
|
const { active, over } = event;
|
|
23597
22280
|
const activeIdStr = String(active.id);
|
|
@@ -23682,8 +22365,8 @@ function useDataDnd(args) {
|
|
|
23682
22365
|
},
|
|
23683
22366
|
[eventBus]
|
|
23684
22367
|
);
|
|
23685
|
-
const sortableData =
|
|
23686
|
-
const SortableItem =
|
|
22368
|
+
const sortableData = React81__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
|
|
22369
|
+
const SortableItem = React81__default.useCallback(
|
|
23687
22370
|
({ id, children }) => {
|
|
23688
22371
|
const {
|
|
23689
22372
|
attributes,
|
|
@@ -23723,7 +22406,7 @@ function useDataDnd(args) {
|
|
|
23723
22406
|
id: droppableId,
|
|
23724
22407
|
data: sortableData
|
|
23725
22408
|
});
|
|
23726
|
-
const ctx =
|
|
22409
|
+
const ctx = React81__default.useContext(RootCtx);
|
|
23727
22410
|
const activeDrag2 = ctx?.activeDrag ?? null;
|
|
23728
22411
|
const overZoneGroup2 = ctx?.overZoneGroup ?? null;
|
|
23729
22412
|
const isThisZoneOver = overZoneGroup2 === ownGroup;
|
|
@@ -23738,7 +22421,7 @@ function useDataDnd(args) {
|
|
|
23738
22421
|
showForeignPlaceholder,
|
|
23739
22422
|
ctxAvailable: ctx != null
|
|
23740
22423
|
});
|
|
23741
|
-
|
|
22424
|
+
React81__default.useEffect(() => {
|
|
23742
22425
|
dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
|
|
23743
22426
|
}, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
|
|
23744
22427
|
return /* @__PURE__ */ jsx(
|
|
@@ -23752,11 +22435,11 @@ function useDataDnd(args) {
|
|
|
23752
22435
|
}
|
|
23753
22436
|
);
|
|
23754
22437
|
};
|
|
23755
|
-
const rootContextValue =
|
|
22438
|
+
const rootContextValue = React81__default.useMemo(
|
|
23756
22439
|
() => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
|
|
23757
22440
|
[registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
|
|
23758
22441
|
);
|
|
23759
|
-
const handleDragStart =
|
|
22442
|
+
const handleDragStart = React81__default.useCallback((event) => {
|
|
23760
22443
|
const sourceZone = findZoneByItem(event.active.id);
|
|
23761
22444
|
const rect = event.active.rect.current.initial;
|
|
23762
22445
|
const height = rect?.height && rect.height > 0 ? rect.height : 64;
|
|
@@ -23775,7 +22458,7 @@ function useDataDnd(args) {
|
|
|
23775
22458
|
isRoot
|
|
23776
22459
|
});
|
|
23777
22460
|
}, [findZoneByItem, isRoot, zoneId]);
|
|
23778
|
-
const handleDragOver =
|
|
22461
|
+
const handleDragOver = React81__default.useCallback((event) => {
|
|
23779
22462
|
const { active, over } = event;
|
|
23780
22463
|
const overData = over?.data?.current;
|
|
23781
22464
|
const overGroup = overData?.dndGroup ?? null;
|
|
@@ -23845,7 +22528,7 @@ function useDataDnd(args) {
|
|
|
23845
22528
|
return next;
|
|
23846
22529
|
});
|
|
23847
22530
|
}, []);
|
|
23848
|
-
const handleDragCancel =
|
|
22531
|
+
const handleDragCancel = React81__default.useCallback((event) => {
|
|
23849
22532
|
setActiveDrag(null);
|
|
23850
22533
|
setOverZoneGroup(null);
|
|
23851
22534
|
dndLog.warn("dragCancel", {
|
|
@@ -23853,12 +22536,12 @@ function useDataDnd(args) {
|
|
|
23853
22536
|
reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
|
|
23854
22537
|
});
|
|
23855
22538
|
}, []);
|
|
23856
|
-
const handleDragEndWithCleanup =
|
|
22539
|
+
const handleDragEndWithCleanup = React81__default.useCallback((event) => {
|
|
23857
22540
|
handleDragEnd(event);
|
|
23858
22541
|
setActiveDrag(null);
|
|
23859
22542
|
setOverZoneGroup(null);
|
|
23860
22543
|
}, [handleDragEnd]);
|
|
23861
|
-
const wrapContainer =
|
|
22544
|
+
const wrapContainer = React81__default.useCallback(
|
|
23862
22545
|
(children) => {
|
|
23863
22546
|
if (!enabled) return children;
|
|
23864
22547
|
const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
|
|
@@ -23912,7 +22595,7 @@ var init_useDataDnd = __esm({
|
|
|
23912
22595
|
init_useAlmadarDndCollision();
|
|
23913
22596
|
init_Box();
|
|
23914
22597
|
dndLog = createLogger("almadar:ui:dnd");
|
|
23915
|
-
RootCtx =
|
|
22598
|
+
RootCtx = React81__default.createContext(null);
|
|
23916
22599
|
}
|
|
23917
22600
|
});
|
|
23918
22601
|
function renderIconInput(icon, props) {
|
|
@@ -24438,7 +23121,7 @@ function DataList({
|
|
|
24438
23121
|
}) {
|
|
24439
23122
|
const eventBus = useEventBus();
|
|
24440
23123
|
const { t } = useTranslate();
|
|
24441
|
-
const [visibleCount, setVisibleCount] =
|
|
23124
|
+
const [visibleCount, setVisibleCount] = React81__default.useState(pageSize || Infinity);
|
|
24442
23125
|
const fieldDefs = fields ?? columns ?? [];
|
|
24443
23126
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
24444
23127
|
const dnd = useDataDnd({
|
|
@@ -24457,7 +23140,7 @@ function DataList({
|
|
|
24457
23140
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
24458
23141
|
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
24459
23142
|
const hasRenderProp = typeof children === "function";
|
|
24460
|
-
|
|
23143
|
+
React81__default.useEffect(() => {
|
|
24461
23144
|
const renderItemTypeOf = typeof schemaRenderItem;
|
|
24462
23145
|
const childrenTypeOf = typeof children;
|
|
24463
23146
|
if (data.length > 0 && !hasRenderProp) {
|
|
@@ -24561,7 +23244,7 @@ function DataList({
|
|
|
24561
23244
|
const items2 = [...data];
|
|
24562
23245
|
const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
|
|
24563
23246
|
const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
|
|
24564
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
23247
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React81__default.Fragment, { children: [
|
|
24565
23248
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
|
|
24566
23249
|
group.items.map((itemData, index) => {
|
|
24567
23250
|
const id = itemData.id || `${gi}-${index}`;
|
|
@@ -24702,7 +23385,7 @@ function DataList({
|
|
|
24702
23385
|
className
|
|
24703
23386
|
),
|
|
24704
23387
|
children: [
|
|
24705
|
-
groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
23388
|
+
groups.map((group, gi) => /* @__PURE__ */ jsxs(React81__default.Fragment, { children: [
|
|
24706
23389
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
|
|
24707
23390
|
group.items.map(
|
|
24708
23391
|
(itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
|
|
@@ -24787,7 +23470,7 @@ var init_FormSection = __esm({
|
|
|
24787
23470
|
columns = 1,
|
|
24788
23471
|
className
|
|
24789
23472
|
}) => {
|
|
24790
|
-
const [collapsed, setCollapsed] =
|
|
23473
|
+
const [collapsed, setCollapsed] = React81__default.useState(defaultCollapsed);
|
|
24791
23474
|
const { t } = useTranslate();
|
|
24792
23475
|
const eventBus = useEventBus();
|
|
24793
23476
|
const gridClass = {
|
|
@@ -24795,7 +23478,7 @@ var init_FormSection = __esm({
|
|
|
24795
23478
|
2: "grid-cols-1 md:grid-cols-2",
|
|
24796
23479
|
3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
|
|
24797
23480
|
}[columns];
|
|
24798
|
-
|
|
23481
|
+
React81__default.useCallback(() => {
|
|
24799
23482
|
if (collapsible) {
|
|
24800
23483
|
setCollapsed((prev) => !prev);
|
|
24801
23484
|
eventBus.emit("UI:TOGGLE_COLLAPSE", { collapsed: !collapsed });
|
|
@@ -25681,7 +24364,7 @@ var init_Flex = __esm({
|
|
|
25681
24364
|
flexStyle.flexBasis = typeof basis === "number" ? `${basis}px` : basis;
|
|
25682
24365
|
}
|
|
25683
24366
|
}
|
|
25684
|
-
return
|
|
24367
|
+
return React81__default.createElement(Component, {
|
|
25685
24368
|
className: cn(
|
|
25686
24369
|
inline ? "inline-flex" : "flex",
|
|
25687
24370
|
directionStyles[direction],
|
|
@@ -25800,7 +24483,7 @@ var init_Grid = __esm({
|
|
|
25800
24483
|
as: Component = "div"
|
|
25801
24484
|
}) => {
|
|
25802
24485
|
const mergedStyle = rows ? { gridTemplateRows: `repeat(${rows}, minmax(0, 1fr))`, ...style } : style;
|
|
25803
|
-
return
|
|
24486
|
+
return React81__default.createElement(
|
|
25804
24487
|
Component,
|
|
25805
24488
|
{
|
|
25806
24489
|
className: cn(
|
|
@@ -25996,9 +24679,9 @@ var init_Popover = __esm({
|
|
|
25996
24679
|
onMouseLeave: handleClose,
|
|
25997
24680
|
onPointerDown: tapTriggerProps.onPointerDown
|
|
25998
24681
|
};
|
|
25999
|
-
const childElement =
|
|
24682
|
+
const childElement = React81__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
26000
24683
|
const childPointerDown = childElement.props.onPointerDown;
|
|
26001
|
-
const triggerElement =
|
|
24684
|
+
const triggerElement = React81__default.cloneElement(
|
|
26002
24685
|
childElement,
|
|
26003
24686
|
{
|
|
26004
24687
|
ref: triggerRef,
|
|
@@ -26600,9 +25283,9 @@ var init_Tooltip = __esm({
|
|
|
26600
25283
|
if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
|
|
26601
25284
|
};
|
|
26602
25285
|
}, []);
|
|
26603
|
-
const triggerElement =
|
|
25286
|
+
const triggerElement = React81__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
26604
25287
|
const childPointerDown = triggerElement.props.onPointerDown;
|
|
26605
|
-
const trigger =
|
|
25288
|
+
const trigger = React81__default.cloneElement(triggerElement, {
|
|
26606
25289
|
ref: triggerRef,
|
|
26607
25290
|
onMouseEnter: handleMouseEnter,
|
|
26608
25291
|
onMouseLeave: handleMouseLeave,
|
|
@@ -26692,7 +25375,7 @@ var init_WizardProgress = __esm({
|
|
|
26692
25375
|
children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
|
|
26693
25376
|
const isActive = index === currentStep;
|
|
26694
25377
|
const isCompleted = index < currentStep;
|
|
26695
|
-
return /* @__PURE__ */ jsxs(
|
|
25378
|
+
return /* @__PURE__ */ jsxs(React81__default.Fragment, { children: [
|
|
26696
25379
|
/* @__PURE__ */ jsx(
|
|
26697
25380
|
"button",
|
|
26698
25381
|
{
|
|
@@ -27595,13 +26278,13 @@ var init_LineChart = __esm({
|
|
|
27595
26278
|
LineChart2.displayName = "LineChart";
|
|
27596
26279
|
}
|
|
27597
26280
|
});
|
|
27598
|
-
var
|
|
26281
|
+
var sizeMap7, stateColors, ProgressDots;
|
|
27599
26282
|
var init_ProgressDots = __esm({
|
|
27600
26283
|
"components/core/molecules/ProgressDots.tsx"() {
|
|
27601
26284
|
"use client";
|
|
27602
26285
|
init_cn();
|
|
27603
26286
|
init_atoms();
|
|
27604
|
-
|
|
26287
|
+
sizeMap7 = {
|
|
27605
26288
|
sm: { dot: 6, active: 8 },
|
|
27606
26289
|
md: { dot: 8, active: 10 },
|
|
27607
26290
|
lg: { dot: 10, active: 14 }
|
|
@@ -27627,7 +26310,7 @@ var init_ProgressDots = __esm({
|
|
|
27627
26310
|
[currentIndex]
|
|
27628
26311
|
);
|
|
27629
26312
|
const resolveState = getState2 ?? defaultGetState;
|
|
27630
|
-
const dims =
|
|
26313
|
+
const dims = sizeMap7[size];
|
|
27631
26314
|
return /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", className: cn(className), children: Array.from({ length: count }, (_, index) => {
|
|
27632
26315
|
const state = resolveState(index);
|
|
27633
26316
|
const isActive = state === "active";
|
|
@@ -28253,13 +26936,13 @@ var init_MapView = __esm({
|
|
|
28253
26936
|
shadowSize: [41, 41]
|
|
28254
26937
|
});
|
|
28255
26938
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
28256
|
-
const { useEffect:
|
|
26939
|
+
const { useEffect: useEffect58, useRef: useRef58, useCallback: useCallback86, useState: useState87 } = React81__default;
|
|
28257
26940
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
28258
26941
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
28259
26942
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
28260
26943
|
const map = useMap();
|
|
28261
|
-
const prevRef =
|
|
28262
|
-
|
|
26944
|
+
const prevRef = useRef58({ centerLat, centerLng, zoom });
|
|
26945
|
+
useEffect58(() => {
|
|
28263
26946
|
const prev = prevRef.current;
|
|
28264
26947
|
if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
|
|
28265
26948
|
map.setView([centerLat, centerLng], zoom);
|
|
@@ -28270,7 +26953,7 @@ var init_MapView = __esm({
|
|
|
28270
26953
|
}
|
|
28271
26954
|
function MapClickHandler({ onMapClick }) {
|
|
28272
26955
|
const map = useMap();
|
|
28273
|
-
|
|
26956
|
+
useEffect58(() => {
|
|
28274
26957
|
if (!onMapClick) return;
|
|
28275
26958
|
const handler = (e) => {
|
|
28276
26959
|
onMapClick(e.latlng.lat, e.latlng.lng);
|
|
@@ -28298,8 +26981,8 @@ var init_MapView = __esm({
|
|
|
28298
26981
|
showAttribution = true
|
|
28299
26982
|
}) {
|
|
28300
26983
|
const eventBus = useEventBus2();
|
|
28301
|
-
const [clickedPosition, setClickedPosition] =
|
|
28302
|
-
const handleMapClick =
|
|
26984
|
+
const [clickedPosition, setClickedPosition] = useState87(null);
|
|
26985
|
+
const handleMapClick = useCallback86((lat, lng) => {
|
|
28303
26986
|
if (showClickedPin) {
|
|
28304
26987
|
setClickedPosition({ lat, lng });
|
|
28305
26988
|
}
|
|
@@ -28308,7 +26991,7 @@ var init_MapView = __esm({
|
|
|
28308
26991
|
eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
|
|
28309
26992
|
}
|
|
28310
26993
|
}, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
|
|
28311
|
-
const handleMarkerClick =
|
|
26994
|
+
const handleMarkerClick = useCallback86((marker) => {
|
|
28312
26995
|
onMarkerClick?.(marker);
|
|
28313
26996
|
if (markerClickEvent) {
|
|
28314
26997
|
eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
|
|
@@ -29168,8 +27851,8 @@ function TableView({
|
|
|
29168
27851
|
}) {
|
|
29169
27852
|
const eventBus = useEventBus();
|
|
29170
27853
|
const { t } = useTranslate();
|
|
29171
|
-
const [visibleCount, setVisibleCount] =
|
|
29172
|
-
const [localSelected, setLocalSelected] =
|
|
27854
|
+
const [visibleCount, setVisibleCount] = React81__default.useState(pageSize > 0 ? pageSize : Infinity);
|
|
27855
|
+
const [localSelected, setLocalSelected] = React81__default.useState(/* @__PURE__ */ new Set());
|
|
29173
27856
|
const colDefs = columns ?? fields ?? [];
|
|
29174
27857
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
29175
27858
|
const dnd = useDataDnd({
|
|
@@ -29364,12 +28047,12 @@ function TableView({
|
|
|
29364
28047
|
]
|
|
29365
28048
|
}
|
|
29366
28049
|
);
|
|
29367
|
-
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(
|
|
28050
|
+
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React81__default.Fragment, { children: rowInner }, id);
|
|
29368
28051
|
};
|
|
29369
28052
|
const items = Array.from(data);
|
|
29370
28053
|
const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
|
|
29371
28054
|
let runningIndex = 0;
|
|
29372
|
-
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
28055
|
+
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React81__default.Fragment, { children: [
|
|
29373
28056
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
|
|
29374
28057
|
group.items.map((row) => renderRow(row, runningIndex++))
|
|
29375
28058
|
] }, gi)) });
|
|
@@ -30588,7 +29271,7 @@ var init_StepFlow = __esm({
|
|
|
30588
29271
|
className
|
|
30589
29272
|
}) => {
|
|
30590
29273
|
if (orientation === "vertical") {
|
|
30591
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(
|
|
29274
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React81__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
|
|
30592
29275
|
/* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
|
|
30593
29276
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
30594
29277
|
showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
|
|
@@ -30599,7 +29282,7 @@ var init_StepFlow = __esm({
|
|
|
30599
29282
|
] })
|
|
30600
29283
|
] }) }, index)) });
|
|
30601
29284
|
}
|
|
30602
|
-
return /* @__PURE__ */ jsx(Box, { className: cn("w-full flex flex-col md:flex-row items-start gap-0", className), children: steps.map((step, index) => /* @__PURE__ */ jsxs(
|
|
29285
|
+
return /* @__PURE__ */ jsx(Box, { className: cn("w-full flex flex-col md:flex-row items-start gap-0", className), children: steps.map((step, index) => /* @__PURE__ */ jsxs(React81__default.Fragment, { children: [
|
|
30603
29286
|
/* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
|
|
30604
29287
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
30605
29288
|
/* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
|
|
@@ -31584,7 +30267,7 @@ var init_LikertScale = __esm({
|
|
|
31584
30267
|
md: "text-base",
|
|
31585
30268
|
lg: "text-lg"
|
|
31586
30269
|
};
|
|
31587
|
-
LikertScale =
|
|
30270
|
+
LikertScale = React81__default.forwardRef(
|
|
31588
30271
|
({
|
|
31589
30272
|
question,
|
|
31590
30273
|
options = DEFAULT_LIKERT_OPTIONS,
|
|
@@ -31596,7 +30279,7 @@ var init_LikertScale = __esm({
|
|
|
31596
30279
|
variant = "radios",
|
|
31597
30280
|
className
|
|
31598
30281
|
}, ref) => {
|
|
31599
|
-
const groupId =
|
|
30282
|
+
const groupId = React81__default.useId();
|
|
31600
30283
|
const eventBus = useEventBus();
|
|
31601
30284
|
const handleSelect = useCallback(
|
|
31602
30285
|
(next) => {
|
|
@@ -33878,7 +32561,7 @@ var init_DocBreadcrumb = __esm({
|
|
|
33878
32561
|
"aria-label": t("aria.breadcrumb"),
|
|
33879
32562
|
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
|
|
33880
32563
|
const isLast = idx === items.length - 1;
|
|
33881
|
-
return /* @__PURE__ */ jsxs(
|
|
32564
|
+
return /* @__PURE__ */ jsxs(React81__default.Fragment, { children: [
|
|
33882
32565
|
idx > 0 && /* @__PURE__ */ jsx(
|
|
33883
32566
|
Icon,
|
|
33884
32567
|
{
|
|
@@ -34747,7 +33430,7 @@ var init_MiniStateMachine = __esm({
|
|
|
34747
33430
|
const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
|
|
34748
33431
|
const tc = transitionCounts[s.name] ?? 0;
|
|
34749
33432
|
const role = getStateRole(s.name, s.isInitial ?? void 0, s.isTerminal ?? void 0, tc, maxTC);
|
|
34750
|
-
return /* @__PURE__ */ jsxs(
|
|
33433
|
+
return /* @__PURE__ */ jsxs(React81__default.Fragment, { children: [
|
|
34751
33434
|
/* @__PURE__ */ jsx(
|
|
34752
33435
|
AvlState,
|
|
34753
33436
|
{
|
|
@@ -34951,7 +33634,7 @@ var init_PageHeader = __esm({
|
|
|
34951
33634
|
info: "bg-info/10 text-info"
|
|
34952
33635
|
};
|
|
34953
33636
|
return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
|
|
34954
|
-
breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */ jsx(Box, { as: "nav", className: "mb-4", children: /* @__PURE__ */ jsx(Box, { as: "ol", className: "flex items-center gap-2 text-sm", children: breadcrumbs.map((crumb, idx) => /* @__PURE__ */ jsxs(
|
|
33637
|
+
breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */ jsx(Box, { as: "nav", className: "mb-4", children: /* @__PURE__ */ jsx(Box, { as: "ol", className: "flex items-center gap-2 text-sm", children: breadcrumbs.map((crumb, idx) => /* @__PURE__ */ jsxs(React81__default.Fragment, { children: [
|
|
34955
33638
|
idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
|
|
34956
33639
|
crumb.href ? /* @__PURE__ */ jsx(
|
|
34957
33640
|
"a",
|
|
@@ -35268,7 +33951,7 @@ var init_Navigation = __esm({
|
|
|
35268
33951
|
Navigation.displayName = "Navigation";
|
|
35269
33952
|
}
|
|
35270
33953
|
});
|
|
35271
|
-
var paddingStyles4,
|
|
33954
|
+
var paddingStyles4, variantStyles7, Section;
|
|
35272
33955
|
var init_Section = __esm({
|
|
35273
33956
|
"components/core/molecules/Section.tsx"() {
|
|
35274
33957
|
init_cn();
|
|
@@ -35281,7 +33964,7 @@ var init_Section = __esm({
|
|
|
35281
33964
|
lg: "p-6",
|
|
35282
33965
|
xl: "p-8"
|
|
35283
33966
|
};
|
|
35284
|
-
|
|
33967
|
+
variantStyles7 = {
|
|
35285
33968
|
default: "",
|
|
35286
33969
|
card: [
|
|
35287
33970
|
"bg-card",
|
|
@@ -35309,12 +33992,12 @@ var init_Section = __esm({
|
|
|
35309
33992
|
as: Component = "section"
|
|
35310
33993
|
}) => {
|
|
35311
33994
|
const hasHeader = title || description || action;
|
|
35312
|
-
return
|
|
33995
|
+
return React81__default.createElement(
|
|
35313
33996
|
Component,
|
|
35314
33997
|
{
|
|
35315
33998
|
className: cn(
|
|
35316
33999
|
paddingStyles4[padding],
|
|
35317
|
-
|
|
34000
|
+
variantStyles7[variant],
|
|
35318
34001
|
className
|
|
35319
34002
|
)
|
|
35320
34003
|
},
|
|
@@ -35683,7 +34366,7 @@ var init_WizardContainer = __esm({
|
|
|
35683
34366
|
const isCompleted = index < currentStep;
|
|
35684
34367
|
const stepKey = step.id ?? step.tabId ?? `step-${index}`;
|
|
35685
34368
|
const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
|
|
35686
|
-
return /* @__PURE__ */ jsxs(
|
|
34369
|
+
return /* @__PURE__ */ jsxs(React81__default.Fragment, { children: [
|
|
35687
34370
|
/* @__PURE__ */ jsx(
|
|
35688
34371
|
Button,
|
|
35689
34372
|
{
|
|
@@ -38116,7 +36799,7 @@ var init_DetailPanel = __esm({
|
|
|
38116
36799
|
}
|
|
38117
36800
|
});
|
|
38118
36801
|
function extractTitle(children) {
|
|
38119
|
-
if (!
|
|
36802
|
+
if (!React81__default.isValidElement(children)) return void 0;
|
|
38120
36803
|
const props = children.props;
|
|
38121
36804
|
if (typeof props.title === "string") {
|
|
38122
36805
|
return props.title;
|
|
@@ -38466,12 +37149,12 @@ var init_Form = __esm({
|
|
|
38466
37149
|
const isSchemaEntity = isOrbitalEntitySchema(entity);
|
|
38467
37150
|
const resolvedEntity = isSchemaEntity ? entity : void 0;
|
|
38468
37151
|
const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
|
|
38469
|
-
const normalizedInitialData =
|
|
37152
|
+
const normalizedInitialData = React81__default.useMemo(() => {
|
|
38470
37153
|
const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
|
|
38471
37154
|
const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
|
|
38472
37155
|
return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
|
|
38473
37156
|
}, [entity, initialData]);
|
|
38474
|
-
const entityDerivedFields =
|
|
37157
|
+
const entityDerivedFields = React81__default.useMemo(() => {
|
|
38475
37158
|
if (fields && fields.length > 0) return void 0;
|
|
38476
37159
|
if (!resolvedEntity) return void 0;
|
|
38477
37160
|
return resolvedEntity.fields.map(
|
|
@@ -38492,16 +37175,16 @@ var init_Form = __esm({
|
|
|
38492
37175
|
const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
|
|
38493
37176
|
const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
|
|
38494
37177
|
const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
|
|
38495
|
-
const [formData, setFormData] =
|
|
37178
|
+
const [formData, setFormData] = React81__default.useState(
|
|
38496
37179
|
normalizedInitialData
|
|
38497
37180
|
);
|
|
38498
|
-
const [collapsedSections, setCollapsedSections] =
|
|
37181
|
+
const [collapsedSections, setCollapsedSections] = React81__default.useState(
|
|
38499
37182
|
/* @__PURE__ */ new Set()
|
|
38500
37183
|
);
|
|
38501
|
-
const [submitError, setSubmitError] =
|
|
38502
|
-
const formRef =
|
|
37184
|
+
const [submitError, setSubmitError] = React81__default.useState(null);
|
|
37185
|
+
const formRef = React81__default.useRef(null);
|
|
38503
37186
|
const formMode = props.mode;
|
|
38504
|
-
const mountedRef =
|
|
37187
|
+
const mountedRef = React81__default.useRef(false);
|
|
38505
37188
|
if (!mountedRef.current) {
|
|
38506
37189
|
mountedRef.current = true;
|
|
38507
37190
|
debug("forms", "mount", {
|
|
@@ -38514,7 +37197,7 @@ var init_Form = __esm({
|
|
|
38514
37197
|
});
|
|
38515
37198
|
}
|
|
38516
37199
|
const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
|
|
38517
|
-
const evalContext =
|
|
37200
|
+
const evalContext = React81__default.useMemo(
|
|
38518
37201
|
() => ({
|
|
38519
37202
|
formValues: formData,
|
|
38520
37203
|
globalVariables: externalContext?.globalVariables ?? {},
|
|
@@ -38523,7 +37206,7 @@ var init_Form = __esm({
|
|
|
38523
37206
|
}),
|
|
38524
37207
|
[formData, externalContext]
|
|
38525
37208
|
);
|
|
38526
|
-
|
|
37209
|
+
React81__default.useEffect(() => {
|
|
38527
37210
|
debug("forms", "initialData-sync", {
|
|
38528
37211
|
mode: formMode,
|
|
38529
37212
|
normalizedInitialData,
|
|
@@ -38534,7 +37217,7 @@ var init_Form = __esm({
|
|
|
38534
37217
|
setFormData(normalizedInitialData);
|
|
38535
37218
|
}
|
|
38536
37219
|
}, [normalizedInitialData]);
|
|
38537
|
-
const processCalculations =
|
|
37220
|
+
const processCalculations = React81__default.useCallback(
|
|
38538
37221
|
(changedFieldId, newFormData) => {
|
|
38539
37222
|
if (!hiddenCalculations.length) return;
|
|
38540
37223
|
const context = {
|
|
@@ -38559,7 +37242,7 @@ var init_Form = __esm({
|
|
|
38559
37242
|
},
|
|
38560
37243
|
[hiddenCalculations, externalContext, eventBus]
|
|
38561
37244
|
);
|
|
38562
|
-
const checkViolations =
|
|
37245
|
+
const checkViolations = React81__default.useCallback(
|
|
38563
37246
|
(changedFieldId, newFormData) => {
|
|
38564
37247
|
if (!violationTriggers.length) return;
|
|
38565
37248
|
const context = {
|
|
@@ -38597,7 +37280,7 @@ var init_Form = __esm({
|
|
|
38597
37280
|
processCalculations(name, newFormData);
|
|
38598
37281
|
checkViolations(name, newFormData);
|
|
38599
37282
|
};
|
|
38600
|
-
const isFieldVisible =
|
|
37283
|
+
const isFieldVisible = React81__default.useCallback(
|
|
38601
37284
|
(fieldName) => {
|
|
38602
37285
|
const condition = conditionalFields[fieldName];
|
|
38603
37286
|
if (!condition) return true;
|
|
@@ -38605,7 +37288,7 @@ var init_Form = __esm({
|
|
|
38605
37288
|
},
|
|
38606
37289
|
[conditionalFields, evalContext]
|
|
38607
37290
|
);
|
|
38608
|
-
const isSectionVisible =
|
|
37291
|
+
const isSectionVisible = React81__default.useCallback(
|
|
38609
37292
|
(section) => {
|
|
38610
37293
|
if (!section.condition) return true;
|
|
38611
37294
|
return Boolean(evaluateFormExpression(section.condition, evalContext));
|
|
@@ -38681,7 +37364,7 @@ var init_Form = __esm({
|
|
|
38681
37364
|
eventBus.emit(`UI:${onCancel}`);
|
|
38682
37365
|
}
|
|
38683
37366
|
};
|
|
38684
|
-
const renderField =
|
|
37367
|
+
const renderField = React81__default.useCallback(
|
|
38685
37368
|
(field) => {
|
|
38686
37369
|
const fieldName = field.name || field.field;
|
|
38687
37370
|
if (!fieldName) return null;
|
|
@@ -38702,7 +37385,7 @@ var init_Form = __esm({
|
|
|
38702
37385
|
[formData, isFieldVisible, relationsData, relationsLoading, isLoading]
|
|
38703
37386
|
);
|
|
38704
37387
|
const effectiveFields = entityDerivedFields ?? fields;
|
|
38705
|
-
const normalizedFields =
|
|
37388
|
+
const normalizedFields = React81__default.useMemo(() => {
|
|
38706
37389
|
if (!effectiveFields || effectiveFields.length === 0) return [];
|
|
38707
37390
|
return effectiveFields.map((field) => {
|
|
38708
37391
|
if (typeof field === "string") {
|
|
@@ -38726,7 +37409,7 @@ var init_Form = __esm({
|
|
|
38726
37409
|
return field;
|
|
38727
37410
|
});
|
|
38728
37411
|
}, [effectiveFields, resolvedEntity]);
|
|
38729
|
-
const schemaFields =
|
|
37412
|
+
const schemaFields = React81__default.useMemo(() => {
|
|
38730
37413
|
if (normalizedFields.length === 0) return null;
|
|
38731
37414
|
if (isDebugEnabled()) {
|
|
38732
37415
|
debugGroup(`Form: ${entityName || "unknown"}`);
|
|
@@ -38736,7 +37419,7 @@ var init_Form = __esm({
|
|
|
38736
37419
|
}
|
|
38737
37420
|
return normalizedFields.map(renderField).filter(Boolean);
|
|
38738
37421
|
}, [normalizedFields, renderField, entityName, conditionalFields]);
|
|
38739
|
-
const sectionElements =
|
|
37422
|
+
const sectionElements = React81__default.useMemo(() => {
|
|
38740
37423
|
if (!sections || sections.length === 0) return null;
|
|
38741
37424
|
return sections.map((section) => {
|
|
38742
37425
|
if (!isSectionVisible(section)) {
|
|
@@ -39273,18 +37956,18 @@ function entityFieldsFromListItem(item) {
|
|
|
39273
37956
|
function getStatusStyle(fieldName, value) {
|
|
39274
37957
|
const val = String(value).toLowerCase();
|
|
39275
37958
|
if (val.includes("complete") || val.includes("done"))
|
|
39276
|
-
return
|
|
37959
|
+
return STATUS_STYLES.complete;
|
|
39277
37960
|
if (val.includes("active") || val.includes("progress"))
|
|
39278
|
-
return
|
|
37961
|
+
return STATUS_STYLES.active;
|
|
39279
37962
|
if (val.includes("pending") || val.includes("waiting"))
|
|
39280
|
-
return
|
|
37963
|
+
return STATUS_STYLES.pending;
|
|
39281
37964
|
if (val.includes("block") || val.includes("cancel"))
|
|
39282
|
-
return
|
|
39283
|
-
if (val.includes("high") || val.includes("urgent")) return
|
|
37965
|
+
return STATUS_STYLES.blocked;
|
|
37966
|
+
if (val.includes("high") || val.includes("urgent")) return STATUS_STYLES.high;
|
|
39284
37967
|
if (val.includes("medium") || val.includes("normal"))
|
|
39285
|
-
return
|
|
39286
|
-
if (val.includes("low")) return
|
|
39287
|
-
return
|
|
37968
|
+
return STATUS_STYLES.medium;
|
|
37969
|
+
if (val.includes("low")) return STATUS_STYLES.low;
|
|
37970
|
+
return STATUS_STYLES.default;
|
|
39288
37971
|
}
|
|
39289
37972
|
function formatValue3(value, fieldName) {
|
|
39290
37973
|
if (typeof value === "number") {
|
|
@@ -39317,7 +38000,7 @@ function formatValue3(value, fieldName) {
|
|
|
39317
38000
|
function formatFieldLabel2(fieldName) {
|
|
39318
38001
|
return fieldName.replace(/([A-Z])/g, " $1").replace(/^./, (str) => str.toUpperCase()).replace(/Id$/, "").trim();
|
|
39319
38002
|
}
|
|
39320
|
-
var
|
|
38003
|
+
var STATUS_STYLES, StatusBadge, ProgressIndicator, List3;
|
|
39321
38004
|
var init_List = __esm({
|
|
39322
38005
|
"components/core/organisms/List.tsx"() {
|
|
39323
38006
|
"use client";
|
|
@@ -39330,7 +38013,7 @@ var init_List = __esm({
|
|
|
39330
38013
|
init_getNestedValue();
|
|
39331
38014
|
init_useEventBus();
|
|
39332
38015
|
init_types2();
|
|
39333
|
-
|
|
38016
|
+
STATUS_STYLES = {
|
|
39334
38017
|
complete: {
|
|
39335
38018
|
bg: "bg-success/10",
|
|
39336
38019
|
text: "text-success",
|
|
@@ -39461,7 +38144,7 @@ var init_List = __esm({
|
|
|
39461
38144
|
if (entity && typeof entity === "object" && "id" in entity) return [entity];
|
|
39462
38145
|
return [];
|
|
39463
38146
|
}, [entity]);
|
|
39464
|
-
const getItemActions =
|
|
38147
|
+
const getItemActions = React81__default.useCallback(
|
|
39465
38148
|
(item) => {
|
|
39466
38149
|
if (!itemActions) return [];
|
|
39467
38150
|
if (typeof itemActions === "function") {
|
|
@@ -39936,7 +38619,7 @@ var init_MediaGallery = __esm({
|
|
|
39936
38619
|
[selectable, selectedItems, selectionEvent, eventBus]
|
|
39937
38620
|
);
|
|
39938
38621
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
39939
|
-
const items =
|
|
38622
|
+
const items = React81__default.useMemo(() => {
|
|
39940
38623
|
if (propItems) return propItems;
|
|
39941
38624
|
if (entityData.length === 0) return [];
|
|
39942
38625
|
return entityData.map((record, idx) => {
|
|
@@ -40099,7 +38782,7 @@ var init_MediaGallery = __esm({
|
|
|
40099
38782
|
}
|
|
40100
38783
|
});
|
|
40101
38784
|
function extractTitle2(children) {
|
|
40102
|
-
if (!
|
|
38785
|
+
if (!React81__default.isValidElement(children)) return void 0;
|
|
40103
38786
|
const props = children.props;
|
|
40104
38787
|
if (typeof props.title === "string") {
|
|
40105
38788
|
return props.title;
|
|
@@ -40373,7 +39056,7 @@ var init_debugRegistry = __esm({
|
|
|
40373
39056
|
}
|
|
40374
39057
|
});
|
|
40375
39058
|
function useDebugData() {
|
|
40376
|
-
const [data, setData] =
|
|
39059
|
+
const [data, setData] = React81.useState(() => ({
|
|
40377
39060
|
traits: [],
|
|
40378
39061
|
ticks: [],
|
|
40379
39062
|
guards: [],
|
|
@@ -40387,7 +39070,7 @@ function useDebugData() {
|
|
|
40387
39070
|
},
|
|
40388
39071
|
lastUpdate: Date.now()
|
|
40389
39072
|
}));
|
|
40390
|
-
|
|
39073
|
+
React81.useEffect(() => {
|
|
40391
39074
|
const updateData = () => {
|
|
40392
39075
|
setData({
|
|
40393
39076
|
traits: getAllTraits(),
|
|
@@ -40496,12 +39179,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
|
|
|
40496
39179
|
return positions;
|
|
40497
39180
|
}
|
|
40498
39181
|
function WalkMinimap() {
|
|
40499
|
-
const [walkStep, setWalkStep] =
|
|
40500
|
-
const [traits2, setTraits] =
|
|
40501
|
-
const [coveredEdges, setCoveredEdges] =
|
|
40502
|
-
const [completedTraits, setCompletedTraits] =
|
|
40503
|
-
const prevTraitRef =
|
|
40504
|
-
|
|
39182
|
+
const [walkStep, setWalkStep] = React81.useState(null);
|
|
39183
|
+
const [traits2, setTraits] = React81.useState([]);
|
|
39184
|
+
const [coveredEdges, setCoveredEdges] = React81.useState([]);
|
|
39185
|
+
const [completedTraits, setCompletedTraits] = React81.useState(/* @__PURE__ */ new Set());
|
|
39186
|
+
const prevTraitRef = React81.useRef(null);
|
|
39187
|
+
React81.useEffect(() => {
|
|
40505
39188
|
const interval = setInterval(() => {
|
|
40506
39189
|
const w = window;
|
|
40507
39190
|
const step = w.__orbitalWalkStep;
|
|
@@ -40937,15 +39620,15 @@ var init_EntitiesTab = __esm({
|
|
|
40937
39620
|
});
|
|
40938
39621
|
function EventFlowTab({ events: events2 }) {
|
|
40939
39622
|
const { t } = useTranslate();
|
|
40940
|
-
const [filter, setFilter] =
|
|
40941
|
-
const containerRef =
|
|
40942
|
-
const [autoScroll, setAutoScroll] =
|
|
40943
|
-
|
|
39623
|
+
const [filter, setFilter] = React81.useState("all");
|
|
39624
|
+
const containerRef = React81.useRef(null);
|
|
39625
|
+
const [autoScroll, setAutoScroll] = React81.useState(true);
|
|
39626
|
+
React81.useEffect(() => {
|
|
40944
39627
|
if (autoScroll && containerRef.current) {
|
|
40945
39628
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
40946
39629
|
}
|
|
40947
39630
|
}, [events2.length, autoScroll]);
|
|
40948
|
-
const filteredEvents =
|
|
39631
|
+
const filteredEvents = React81.useMemo(() => {
|
|
40949
39632
|
if (filter === "all") return events2;
|
|
40950
39633
|
return events2.filter((e) => e.type === filter);
|
|
40951
39634
|
}, [events2, filter]);
|
|
@@ -41061,7 +39744,7 @@ var init_EventFlowTab = __esm({
|
|
|
41061
39744
|
});
|
|
41062
39745
|
function GuardsPanel({ guards }) {
|
|
41063
39746
|
const { t } = useTranslate();
|
|
41064
|
-
const [filter, setFilter] =
|
|
39747
|
+
const [filter, setFilter] = React81.useState("all");
|
|
41065
39748
|
if (guards.length === 0) {
|
|
41066
39749
|
return /* @__PURE__ */ jsx(
|
|
41067
39750
|
EmptyState,
|
|
@@ -41074,7 +39757,7 @@ function GuardsPanel({ guards }) {
|
|
|
41074
39757
|
}
|
|
41075
39758
|
const passedCount = guards.filter((g) => g.result).length;
|
|
41076
39759
|
const failedCount = guards.length - passedCount;
|
|
41077
|
-
const filteredGuards =
|
|
39760
|
+
const filteredGuards = React81.useMemo(() => {
|
|
41078
39761
|
if (filter === "all") return guards;
|
|
41079
39762
|
if (filter === "passed") return guards.filter((g) => g.result);
|
|
41080
39763
|
return guards.filter((g) => !g.result);
|
|
@@ -41237,10 +39920,10 @@ function EffectBadge({ effect }) {
|
|
|
41237
39920
|
}
|
|
41238
39921
|
function TransitionTimeline({ transitions }) {
|
|
41239
39922
|
const { t } = useTranslate();
|
|
41240
|
-
const containerRef =
|
|
41241
|
-
const [autoScroll, setAutoScroll] =
|
|
41242
|
-
const [expandedId, setExpandedId] =
|
|
41243
|
-
|
|
39923
|
+
const containerRef = React81.useRef(null);
|
|
39924
|
+
const [autoScroll, setAutoScroll] = React81.useState(true);
|
|
39925
|
+
const [expandedId, setExpandedId] = React81.useState(null);
|
|
39926
|
+
React81.useEffect(() => {
|
|
41244
39927
|
if (autoScroll && containerRef.current) {
|
|
41245
39928
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
41246
39929
|
}
|
|
@@ -41520,9 +40203,9 @@ function getAllEvents(traits2) {
|
|
|
41520
40203
|
function EventDispatcherTab({ traits: traits2, schema }) {
|
|
41521
40204
|
const eventBus = useEventBus();
|
|
41522
40205
|
const { t } = useTranslate();
|
|
41523
|
-
const [log10, setLog] =
|
|
41524
|
-
const prevStatesRef =
|
|
41525
|
-
|
|
40206
|
+
const [log10, setLog] = React81.useState([]);
|
|
40207
|
+
const prevStatesRef = React81.useRef(/* @__PURE__ */ new Map());
|
|
40208
|
+
React81.useEffect(() => {
|
|
41526
40209
|
for (const trait of traits2) {
|
|
41527
40210
|
const prev = prevStatesRef.current.get(trait.id);
|
|
41528
40211
|
if (prev && prev !== trait.currentState) {
|
|
@@ -41691,10 +40374,10 @@ function VerifyModePanel({
|
|
|
41691
40374
|
localCount
|
|
41692
40375
|
}) {
|
|
41693
40376
|
const { t } = useTranslate();
|
|
41694
|
-
const [expanded, setExpanded] =
|
|
41695
|
-
const scrollRef =
|
|
41696
|
-
const prevCountRef =
|
|
41697
|
-
|
|
40377
|
+
const [expanded, setExpanded] = React81.useState(true);
|
|
40378
|
+
const scrollRef = React81.useRef(null);
|
|
40379
|
+
const prevCountRef = React81.useRef(0);
|
|
40380
|
+
React81.useEffect(() => {
|
|
41698
40381
|
if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
|
|
41699
40382
|
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
41700
40383
|
}
|
|
@@ -41751,10 +40434,10 @@ function RuntimeDebugger({
|
|
|
41751
40434
|
schema
|
|
41752
40435
|
}) {
|
|
41753
40436
|
const { t } = useTranslate();
|
|
41754
|
-
const [isCollapsed, setIsCollapsed] =
|
|
41755
|
-
const [isVisible, setIsVisible] =
|
|
40437
|
+
const [isCollapsed, setIsCollapsed] = React81.useState(mode === "verify" ? true : defaultCollapsed);
|
|
40438
|
+
const [isVisible, setIsVisible] = React81.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
|
|
41756
40439
|
const debugData = useDebugData();
|
|
41757
|
-
|
|
40440
|
+
React81.useEffect(() => {
|
|
41758
40441
|
if (mode === "inline") return;
|
|
41759
40442
|
return onDebugToggle((enabled) => {
|
|
41760
40443
|
setIsVisible(enabled);
|
|
@@ -41763,7 +40446,7 @@ function RuntimeDebugger({
|
|
|
41763
40446
|
}
|
|
41764
40447
|
});
|
|
41765
40448
|
}, [mode]);
|
|
41766
|
-
|
|
40449
|
+
React81.useEffect(() => {
|
|
41767
40450
|
if (mode === "inline") return;
|
|
41768
40451
|
const handleKeyDown = (e) => {
|
|
41769
40452
|
if (e.key === "`" && isVisible) {
|
|
@@ -42283,7 +40966,7 @@ var init_StatCard = __esm({
|
|
|
42283
40966
|
const labelToUse = propLabel ?? propTitle;
|
|
42284
40967
|
const eventBus = useEventBus();
|
|
42285
40968
|
const { t } = useTranslate();
|
|
42286
|
-
const handleActionClick =
|
|
40969
|
+
const handleActionClick = React81__default.useCallback(() => {
|
|
42287
40970
|
if (action?.event) {
|
|
42288
40971
|
eventBus.emit(`UI:${action.event}`, {});
|
|
42289
40972
|
}
|
|
@@ -42294,7 +40977,7 @@ var init_StatCard = __esm({
|
|
|
42294
40977
|
const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
42295
40978
|
const isLoading = externalLoading ?? false;
|
|
42296
40979
|
const error = externalError;
|
|
42297
|
-
const computeMetricValue =
|
|
40980
|
+
const computeMetricValue = React81__default.useCallback(
|
|
42298
40981
|
(metric, items) => {
|
|
42299
40982
|
if (metric.value !== void 0) {
|
|
42300
40983
|
return metric.value;
|
|
@@ -42333,7 +41016,7 @@ var init_StatCard = __esm({
|
|
|
42333
41016
|
},
|
|
42334
41017
|
[]
|
|
42335
41018
|
);
|
|
42336
|
-
const schemaStats =
|
|
41019
|
+
const schemaStats = React81__default.useMemo(() => {
|
|
42337
41020
|
if (!metrics || metrics.length === 0) return null;
|
|
42338
41021
|
return metrics.map((metric) => ({
|
|
42339
41022
|
label: metric.label,
|
|
@@ -42341,7 +41024,7 @@ var init_StatCard = __esm({
|
|
|
42341
41024
|
format: metric.format
|
|
42342
41025
|
}));
|
|
42343
41026
|
}, [metrics, data, computeMetricValue]);
|
|
42344
|
-
const calculatedTrend =
|
|
41027
|
+
const calculatedTrend = React81__default.useMemo(() => {
|
|
42345
41028
|
if (manualTrend !== void 0) return manualTrend;
|
|
42346
41029
|
if (previousValue === void 0 || currentValue === void 0)
|
|
42347
41030
|
return void 0;
|
|
@@ -42981,8 +41664,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
42981
41664
|
] });
|
|
42982
41665
|
};
|
|
42983
41666
|
InlineActivityStream = ({ activities, autoScroll = true, className }) => {
|
|
42984
|
-
const endRef =
|
|
42985
|
-
|
|
41667
|
+
const endRef = React81__default.useRef(null);
|
|
41668
|
+
React81__default.useEffect(() => {
|
|
42986
41669
|
if (!autoScroll) return;
|
|
42987
41670
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
42988
41671
|
}, [activities.length, autoScroll]);
|
|
@@ -43076,7 +41759,7 @@ var init_SubagentTracePanel = __esm({
|
|
|
43076
41759
|
};
|
|
43077
41760
|
SubagentRichCard = ({ subagent }) => {
|
|
43078
41761
|
const { t } = useTranslate();
|
|
43079
|
-
const activities =
|
|
41762
|
+
const activities = React81__default.useMemo(
|
|
43080
41763
|
() => subagentMessagesToActivities(subagent.messages),
|
|
43081
41764
|
[subagent.messages]
|
|
43082
41765
|
);
|
|
@@ -43153,8 +41836,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
43153
41836
|
] });
|
|
43154
41837
|
};
|
|
43155
41838
|
CoordinatorConversation = ({ messages, autoScroll = true, className }) => {
|
|
43156
|
-
const endRef =
|
|
43157
|
-
|
|
41839
|
+
const endRef = React81__default.useRef(null);
|
|
41840
|
+
React81__default.useEffect(() => {
|
|
43158
41841
|
if (!autoScroll) return;
|
|
43159
41842
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
43160
41843
|
}, [messages.length, autoScroll]);
|
|
@@ -43533,7 +42216,7 @@ var init_TeamOrganism = __esm({
|
|
|
43533
42216
|
TeamOrganism.displayName = "TeamOrganism";
|
|
43534
42217
|
}
|
|
43535
42218
|
});
|
|
43536
|
-
var lookStyles10,
|
|
42219
|
+
var lookStyles10, STATUS_STYLES2, Timeline;
|
|
43537
42220
|
var init_Timeline = __esm({
|
|
43538
42221
|
"components/core/organisms/Timeline.tsx"() {
|
|
43539
42222
|
"use client";
|
|
@@ -43549,7 +42232,7 @@ var init_Timeline = __esm({
|
|
|
43549
42232
|
horizontal: "flex-row [&>*]:flex-row [&>*]:items-center",
|
|
43550
42233
|
swimlane: "flex-row gap-6 [&>*]:flex-row [&>*]:items-center"
|
|
43551
42234
|
};
|
|
43552
|
-
|
|
42235
|
+
STATUS_STYLES2 = {
|
|
43553
42236
|
complete: {
|
|
43554
42237
|
dotColor: "text-success",
|
|
43555
42238
|
lineColor: "bg-success",
|
|
@@ -43584,7 +42267,7 @@ var init_Timeline = __esm({
|
|
|
43584
42267
|
}) => {
|
|
43585
42268
|
const { t } = useTranslate();
|
|
43586
42269
|
const entityData = entity ?? [];
|
|
43587
|
-
const items =
|
|
42270
|
+
const items = React81__default.useMemo(() => {
|
|
43588
42271
|
if (propItems) return propItems;
|
|
43589
42272
|
if (entityData.length === 0) return [];
|
|
43590
42273
|
return entityData.map((record, idx) => {
|
|
@@ -43633,7 +42316,7 @@ var init_Timeline = __esm({
|
|
|
43633
42316
|
title && /* @__PURE__ */ jsx(Typography, { variant: "h5", weight: "semibold", children: title }),
|
|
43634
42317
|
/* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("relative", lookStyles10[look]), children: items.map((item, idx) => {
|
|
43635
42318
|
const status = item.status || "pending";
|
|
43636
|
-
const style =
|
|
42319
|
+
const style = STATUS_STYLES2[status] || STATUS_STYLES2.pending;
|
|
43637
42320
|
const ItemIcon = item.icon || style.icon;
|
|
43638
42321
|
const isLast = idx === items.length - 1;
|
|
43639
42322
|
return /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "relative", children: [
|
|
@@ -43686,7 +42369,7 @@ var init_Timeline = __esm({
|
|
|
43686
42369
|
}
|
|
43687
42370
|
});
|
|
43688
42371
|
function extractToastProps(children) {
|
|
43689
|
-
if (!
|
|
42372
|
+
if (!React81__default.isValidElement(children)) {
|
|
43690
42373
|
if (typeof children === "string") {
|
|
43691
42374
|
return { message: children };
|
|
43692
42375
|
}
|
|
@@ -43728,7 +42411,7 @@ var init_ToastSlot = __esm({
|
|
|
43728
42411
|
eventBus.emit(`${prefix}CLOSE`);
|
|
43729
42412
|
};
|
|
43730
42413
|
if (!isVisible) return null;
|
|
43731
|
-
const isCustomContent =
|
|
42414
|
+
const isCustomContent = React81__default.isValidElement(children) && !message;
|
|
43732
42415
|
return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
|
|
43733
42416
|
Toast,
|
|
43734
42417
|
{
|
|
@@ -43744,38 +42427,13 @@ var init_ToastSlot = __esm({
|
|
|
43744
42427
|
ToastSlot.displayName = "ToastSlot";
|
|
43745
42428
|
}
|
|
43746
42429
|
});
|
|
43747
|
-
|
|
43748
|
-
|
|
43749
|
-
|
|
43750
|
-
const Resolved = m[name];
|
|
43751
|
-
if (!Resolved) {
|
|
43752
|
-
throw new Error(
|
|
43753
|
-
`[@almadar/ui] 3D component "${name}" was not found in the three subpath bundle.`
|
|
43754
|
-
);
|
|
43755
|
-
}
|
|
43756
|
-
return { default: Resolved };
|
|
43757
|
-
})
|
|
43758
|
-
);
|
|
43759
|
-
function ThreeWrapper(props) {
|
|
43760
|
-
return React88__default.createElement(
|
|
43761
|
-
ThreeBoundary,
|
|
43762
|
-
{ name },
|
|
43763
|
-
React88__default.createElement(
|
|
43764
|
-
React88__default.Suspense,
|
|
43765
|
-
{ fallback: null },
|
|
43766
|
-
React88__default.createElement(Lazy, props)
|
|
43767
|
-
)
|
|
43768
|
-
);
|
|
43769
|
-
}
|
|
43770
|
-
ThreeWrapper.displayName = `Lazy(${name})`;
|
|
43771
|
-
return ThreeWrapper;
|
|
43772
|
-
}
|
|
43773
|
-
var ThreeBoundary, GameCanvas3D2, COMPONENT_REGISTRY;
|
|
42430
|
+
|
|
42431
|
+
// components/core/organisms/component-registry.generated.ts
|
|
42432
|
+
var COMPONENT_REGISTRY;
|
|
43774
42433
|
var init_component_registry_generated = __esm({
|
|
43775
42434
|
"components/core/organisms/component-registry.generated.ts"() {
|
|
43776
42435
|
init_AboutPageTemplate();
|
|
43777
42436
|
init_Accordion();
|
|
43778
|
-
init_ActionButton();
|
|
43779
42437
|
init_ActionPalette();
|
|
43780
42438
|
init_ActionTile();
|
|
43781
42439
|
init_ActivationBlock();
|
|
@@ -43819,7 +42477,6 @@ var init_component_registry_generated = __esm({
|
|
|
43819
42477
|
init_ChoiceButton();
|
|
43820
42478
|
init_CodeBlock();
|
|
43821
42479
|
init_CodeRunnerPanel();
|
|
43822
|
-
init_ComboCounter();
|
|
43823
42480
|
init_CommunityLinks();
|
|
43824
42481
|
init_ConditionalWrapper();
|
|
43825
42482
|
init_ConfettiEffect();
|
|
@@ -43831,7 +42488,6 @@ var init_component_registry_generated = __esm({
|
|
|
43831
42488
|
init_ControlButton();
|
|
43832
42489
|
init_ControlGrid();
|
|
43833
42490
|
init_CounterTemplate();
|
|
43834
|
-
init_DamageNumber();
|
|
43835
42491
|
init_DashboardGrid();
|
|
43836
42492
|
init_DashboardLayout();
|
|
43837
42493
|
init_DataGrid();
|
|
@@ -43861,7 +42517,6 @@ var init_component_registry_generated = __esm({
|
|
|
43861
42517
|
init_EmptyState();
|
|
43862
42518
|
init_ErrorBoundary();
|
|
43863
42519
|
init_ErrorState();
|
|
43864
|
-
init_EventLog();
|
|
43865
42520
|
init_FeatureCard();
|
|
43866
42521
|
init_FeatureDetailPageTemplate();
|
|
43867
42522
|
init_FeatureGrid();
|
|
@@ -43878,12 +42533,10 @@ var init_component_registry_generated = __esm({
|
|
|
43878
42533
|
init_FormField();
|
|
43879
42534
|
init_FormSectionHeader();
|
|
43880
42535
|
init_GameAudioToggle();
|
|
43881
|
-
init_GameCard();
|
|
43882
42536
|
init_GameHud();
|
|
43883
42537
|
init_GameIcon();
|
|
43884
42538
|
init_GameMenu();
|
|
43885
42539
|
init_GameShell();
|
|
43886
|
-
init_GameTemplate();
|
|
43887
42540
|
init_GenericAppTemplate();
|
|
43888
42541
|
init_GeometricPattern();
|
|
43889
42542
|
init_GradientDivider();
|
|
@@ -43900,8 +42553,6 @@ var init_component_registry_generated = __esm({
|
|
|
43900
42553
|
init_Input();
|
|
43901
42554
|
init_InputGroup();
|
|
43902
42555
|
init_InstallBox();
|
|
43903
|
-
init_InventoryGrid();
|
|
43904
|
-
init_ItemSlot();
|
|
43905
42556
|
init_JazariStateMachine();
|
|
43906
42557
|
init_LandingPageTemplate();
|
|
43907
42558
|
init_LawReferenceTooltip();
|
|
@@ -43922,13 +42573,11 @@ var init_component_registry_generated = __esm({
|
|
|
43922
42573
|
init_MediaGallery();
|
|
43923
42574
|
init_Menu();
|
|
43924
42575
|
init_Meter();
|
|
43925
|
-
init_MiniMap();
|
|
43926
42576
|
init_Modal();
|
|
43927
42577
|
init_ModalSlot();
|
|
43928
42578
|
init_ModuleCard();
|
|
43929
42579
|
init_Navigation();
|
|
43930
42580
|
init_NumberStepper();
|
|
43931
|
-
init_ObjectRulePanel();
|
|
43932
42581
|
init_OptionConstraintGroup();
|
|
43933
42582
|
init_OrbitalVisualization();
|
|
43934
42583
|
init_Overlay();
|
|
@@ -43954,8 +42603,6 @@ var init_component_registry_generated = __esm({
|
|
|
43954
42603
|
init_RelationSelect();
|
|
43955
42604
|
init_RepeatableFormSection();
|
|
43956
42605
|
init_ReplyTree();
|
|
43957
|
-
init_ResourceBar();
|
|
43958
|
-
init_ResourceCounter();
|
|
43959
42606
|
init_RichBlockEditor();
|
|
43960
42607
|
init_RuntimeDebugger2();
|
|
43961
42608
|
init_ScaledDiagram();
|
|
@@ -43981,19 +42628,16 @@ var init_component_registry_generated = __esm({
|
|
|
43981
42628
|
init_Split();
|
|
43982
42629
|
init_SplitPane();
|
|
43983
42630
|
init_SplitSection();
|
|
43984
|
-
init_Sprite();
|
|
43985
42631
|
init_StarRating();
|
|
43986
42632
|
init_StatBadge();
|
|
43987
42633
|
init_StatCard();
|
|
43988
42634
|
init_StatDisplay();
|
|
43989
42635
|
init_StateGraph();
|
|
43990
|
-
init_StateIndicator();
|
|
43991
42636
|
init_StateJsonView();
|
|
43992
42637
|
init_StateMachineView();
|
|
43993
42638
|
init_StatsGrid();
|
|
43994
42639
|
init_StatsOrganism();
|
|
43995
42640
|
init_StatusDot();
|
|
43996
|
-
init_StatusEffect();
|
|
43997
42641
|
init_StepFlow();
|
|
43998
42642
|
init_StepFlowOrganism();
|
|
43999
42643
|
init_SubagentTracePanel();
|
|
@@ -44030,46 +42674,19 @@ var init_component_registry_generated = __esm({
|
|
|
44030
42674
|
init_TraitFrame();
|
|
44031
42675
|
init_TraitSlot();
|
|
44032
42676
|
init_TrendIndicator();
|
|
44033
|
-
init_TurnIndicator();
|
|
44034
42677
|
init_TypewriterText();
|
|
44035
42678
|
init_Typography();
|
|
44036
42679
|
init_UISlotRenderer();
|
|
44037
42680
|
init_UploadDropZone();
|
|
44038
|
-
init_VariablePanel();
|
|
44039
42681
|
init_VersionDiff();
|
|
44040
42682
|
init_ViolationAlert();
|
|
44041
42683
|
init_VoteStack();
|
|
44042
|
-
init_WaypointMarker();
|
|
44043
42684
|
init_WizardContainer();
|
|
44044
42685
|
init_WizardNavigation();
|
|
44045
42686
|
init_WizardProgress();
|
|
44046
|
-
ThreeBoundary = class extends React88__default.Component {
|
|
44047
|
-
constructor() {
|
|
44048
|
-
super(...arguments);
|
|
44049
|
-
__publicField(this, "state", { failed: false });
|
|
44050
|
-
}
|
|
44051
|
-
static getDerivedStateFromError() {
|
|
44052
|
-
return { failed: true };
|
|
44053
|
-
}
|
|
44054
|
-
render() {
|
|
44055
|
-
if (this.state.failed) {
|
|
44056
|
-
return React88__default.createElement(
|
|
44057
|
-
"div",
|
|
44058
|
-
{
|
|
44059
|
-
"data-testid": "three-unavailable",
|
|
44060
|
-
style: { padding: 16, fontSize: 13, lineHeight: 1.5, opacity: 0.7 }
|
|
44061
|
-
},
|
|
44062
|
-
`3D pattern "${this.props.name}" requires three.js. Install the optional peers three + @react-three/fiber + @react-three/drei (matching the host React major) to render it.`
|
|
44063
|
-
);
|
|
44064
|
-
}
|
|
44065
|
-
return this.props.children;
|
|
44066
|
-
}
|
|
44067
|
-
};
|
|
44068
|
-
GameCanvas3D2 = lazyThree("GameCanvas3D", () => import('@almadar/ui/components/molecules/game/three'));
|
|
44069
42687
|
COMPONENT_REGISTRY = {
|
|
44070
42688
|
"AboutPageTemplate": AboutPageTemplate,
|
|
44071
42689
|
"Accordion": Accordion,
|
|
44072
|
-
"ActionButton": ActionButton,
|
|
44073
42690
|
"ActionPalette": ActionPalette,
|
|
44074
42691
|
"ActionTile": ActionTile,
|
|
44075
42692
|
"ActivationBlock": ActivationBlock,
|
|
@@ -44118,7 +42735,6 @@ var init_component_registry_generated = __esm({
|
|
|
44118
42735
|
"ChoiceButton": ChoiceButton,
|
|
44119
42736
|
"CodeBlock": CodeBlock,
|
|
44120
42737
|
"CodeRunnerPanel": CodeRunnerPanel,
|
|
44121
|
-
"ComboCounter": ComboCounter,
|
|
44122
42738
|
"CommunityLinks": CommunityLinks,
|
|
44123
42739
|
"ConditionalWrapper": ConditionalWrapper,
|
|
44124
42740
|
"ConfettiEffect": ConfettiEffect,
|
|
@@ -44130,7 +42746,6 @@ var init_component_registry_generated = __esm({
|
|
|
44130
42746
|
"ControlButton": ControlButton,
|
|
44131
42747
|
"ControlGrid": ControlGrid,
|
|
44132
42748
|
"CounterTemplate": CounterTemplate,
|
|
44133
|
-
"DamageNumber": DamageNumber,
|
|
44134
42749
|
"DashboardGrid": DashboardGrid,
|
|
44135
42750
|
"DashboardLayout": DashboardLayout,
|
|
44136
42751
|
"DataGrid": DataGrid,
|
|
@@ -44162,7 +42777,6 @@ var init_component_registry_generated = __esm({
|
|
|
44162
42777
|
"EmptyState": EmptyState,
|
|
44163
42778
|
"ErrorBoundary": ErrorBoundary,
|
|
44164
42779
|
"ErrorState": ErrorState,
|
|
44165
|
-
"EventLog": EventLog,
|
|
44166
42780
|
"FeatureCard": FeatureCard,
|
|
44167
42781
|
"FeatureDetailPageTemplate": FeatureDetailPageTemplate,
|
|
44168
42782
|
"FeatureGrid": FeatureGrid,
|
|
@@ -44180,13 +42794,10 @@ var init_component_registry_generated = __esm({
|
|
|
44180
42794
|
"FormLayout": FormLayout,
|
|
44181
42795
|
"FormSectionHeader": FormSectionHeader,
|
|
44182
42796
|
"GameAudioToggle": GameAudioToggle,
|
|
44183
|
-
"GameCanvas3D": GameCanvas3D2,
|
|
44184
|
-
"GameCard": GameCard,
|
|
44185
42797
|
"GameHud": GameHud,
|
|
44186
42798
|
"GameIcon": GameIcon,
|
|
44187
42799
|
"GameMenu": GameMenu,
|
|
44188
42800
|
"GameShell": GameShell,
|
|
44189
|
-
"GameTemplate": GameTemplate,
|
|
44190
42801
|
"GenericAppTemplate": GenericAppTemplate,
|
|
44191
42802
|
"GeometricPattern": GeometricPattern,
|
|
44192
42803
|
"GradientDivider": GradientDivider,
|
|
@@ -44203,8 +42814,6 @@ var init_component_registry_generated = __esm({
|
|
|
44203
42814
|
"Input": Input,
|
|
44204
42815
|
"InputGroup": InputGroup,
|
|
44205
42816
|
"InstallBox": InstallBox,
|
|
44206
|
-
"InventoryGrid": InventoryGrid,
|
|
44207
|
-
"ItemSlot": ItemSlot,
|
|
44208
42817
|
"JazariStateMachine": JazariStateMachine,
|
|
44209
42818
|
"Label": LabelPattern,
|
|
44210
42819
|
"LabelPattern": LabelPattern,
|
|
@@ -44227,13 +42836,11 @@ var init_component_registry_generated = __esm({
|
|
|
44227
42836
|
"MediaGallery": MediaGallery,
|
|
44228
42837
|
"Menu": Menu,
|
|
44229
42838
|
"Meter": Meter,
|
|
44230
|
-
"MiniMap": MiniMap,
|
|
44231
42839
|
"Modal": Modal,
|
|
44232
42840
|
"ModalSlot": ModalSlot,
|
|
44233
42841
|
"ModuleCard": ModuleCard,
|
|
44234
42842
|
"Navigation": Navigation,
|
|
44235
42843
|
"NumberStepper": NumberStepper,
|
|
44236
|
-
"ObjectRulePanel": ObjectRulePanel,
|
|
44237
42844
|
"OptionConstraintGroup": OptionConstraintGroup,
|
|
44238
42845
|
"OrbitalVisualization": OrbitalVisualization,
|
|
44239
42846
|
"Overlay": Overlay,
|
|
@@ -44259,8 +42866,6 @@ var init_component_registry_generated = __esm({
|
|
|
44259
42866
|
"RelationSelect": RelationSelect,
|
|
44260
42867
|
"RepeatableFormSection": RepeatableFormSection,
|
|
44261
42868
|
"ReplyTree": ReplyTree,
|
|
44262
|
-
"ResourceBar": ResourceBar,
|
|
44263
|
-
"ResourceCounter": ResourceCounter,
|
|
44264
42869
|
"RichBlockEditor": RichBlockEditor,
|
|
44265
42870
|
"RuntimeDebugger": RuntimeDebugger,
|
|
44266
42871
|
"ScaledDiagram": ScaledDiagram,
|
|
@@ -44288,20 +42893,17 @@ var init_component_registry_generated = __esm({
|
|
|
44288
42893
|
"Split": Split,
|
|
44289
42894
|
"SplitPane": SplitPane,
|
|
44290
42895
|
"SplitSection": SplitSection,
|
|
44291
|
-
"Sprite": Sprite,
|
|
44292
42896
|
"Stack": Stack,
|
|
44293
42897
|
"StarRating": StarRating,
|
|
44294
42898
|
"StatBadge": StatBadge,
|
|
44295
42899
|
"StatCard": StatCard,
|
|
44296
42900
|
"StatDisplay": StatDisplay,
|
|
44297
42901
|
"StateGraph": StateGraph,
|
|
44298
|
-
"StateIndicator": StateIndicator,
|
|
44299
42902
|
"StateJsonView": StateJsonView,
|
|
44300
42903
|
"StateMachineView": StateMachineView,
|
|
44301
42904
|
"StatsGrid": StatsGrid,
|
|
44302
42905
|
"StatsOrganism": StatsOrganism,
|
|
44303
42906
|
"StatusDot": StatusDot,
|
|
44304
|
-
"StatusEffect": StatusEffect,
|
|
44305
42907
|
"StepFlow": StepFlow,
|
|
44306
42908
|
"StepFlowOrganism": StepFlowOrganism,
|
|
44307
42909
|
"SubagentTracePanel": SubagentTracePanel,
|
|
@@ -44338,17 +42940,14 @@ var init_component_registry_generated = __esm({
|
|
|
44338
42940
|
"TraitFrame": TraitFrame,
|
|
44339
42941
|
"TraitSlot": TraitSlot,
|
|
44340
42942
|
"TrendIndicator": TrendIndicator,
|
|
44341
|
-
"TurnIndicator": TurnIndicator,
|
|
44342
42943
|
"TypewriterText": TypewriterText,
|
|
44343
42944
|
"Typography": Typography,
|
|
44344
42945
|
"UISlotRenderer": UISlotRenderer,
|
|
44345
42946
|
"UploadDropZone": UploadDropZone,
|
|
44346
42947
|
"VStack": VStack,
|
|
44347
|
-
"VariablePanel": VariablePanel,
|
|
44348
42948
|
"VersionDiff": VersionDiff,
|
|
44349
42949
|
"ViolationAlert": ViolationAlert,
|
|
44350
42950
|
"VoteStack": VoteStack,
|
|
44351
|
-
"WaypointMarker": WaypointMarker,
|
|
44352
42951
|
"WizardContainer": WizardContainer,
|
|
44353
42952
|
"WizardNavigation": WizardNavigation,
|
|
44354
42953
|
"WizardProgress": WizardProgress,
|
|
@@ -44370,7 +42969,7 @@ function SuspenseConfigProvider({
|
|
|
44370
42969
|
config,
|
|
44371
42970
|
children
|
|
44372
42971
|
}) {
|
|
44373
|
-
return
|
|
42972
|
+
return React81__default.createElement(
|
|
44374
42973
|
SuspenseConfigContext.Provider,
|
|
44375
42974
|
{ value: config },
|
|
44376
42975
|
children
|
|
@@ -44412,7 +43011,7 @@ function enrichFormFields(fields, entityDef) {
|
|
|
44412
43011
|
}
|
|
44413
43012
|
return { name: field, label: field.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (c) => c.toUpperCase()) };
|
|
44414
43013
|
}
|
|
44415
|
-
if (field && typeof field === "object" && !Array.isArray(field) && !
|
|
43014
|
+
if (field && typeof field === "object" && !Array.isArray(field) && !React81__default.isValidElement(field) && !(field instanceof Date)) {
|
|
44416
43015
|
const obj = field;
|
|
44417
43016
|
const fieldName = typeof obj.name === "string" ? obj.name : typeof obj.field === "string" ? obj.field : void 0;
|
|
44418
43017
|
if (!fieldName) return field;
|
|
@@ -44865,7 +43464,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
|
|
|
44865
43464
|
const key = `${parentId}-${index}-trait:${traitName}`;
|
|
44866
43465
|
return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
|
|
44867
43466
|
}
|
|
44868
|
-
return /* @__PURE__ */ jsx(
|
|
43467
|
+
return /* @__PURE__ */ jsx(React81__default.Fragment, { children: child }, `${parentId}-${index}`);
|
|
44869
43468
|
}
|
|
44870
43469
|
if (!child || typeof child !== "object") return null;
|
|
44871
43470
|
const childId = `${parentId}-${index}`;
|
|
@@ -44918,14 +43517,14 @@ function isPatternConfig(value) {
|
|
|
44918
43517
|
if (value === null || value === void 0) return false;
|
|
44919
43518
|
if (typeof value !== "object") return false;
|
|
44920
43519
|
if (Array.isArray(value)) return false;
|
|
44921
|
-
if (
|
|
43520
|
+
if (React81__default.isValidElement(value)) return false;
|
|
44922
43521
|
if (value instanceof Date) return false;
|
|
44923
43522
|
if (typeof value === "function") return false;
|
|
44924
43523
|
const record = value;
|
|
44925
43524
|
return "type" in record && typeof record.type === "string" && getComponentForPattern$1(record.type) !== null;
|
|
44926
43525
|
}
|
|
44927
43526
|
function isPlainConfigObject(value) {
|
|
44928
|
-
if (
|
|
43527
|
+
if (React81__default.isValidElement(value)) return false;
|
|
44929
43528
|
if (value instanceof Date) return false;
|
|
44930
43529
|
const proto = Object.getPrototypeOf(value);
|
|
44931
43530
|
return proto === Object.prototype || proto === null;
|
|
@@ -45052,7 +43651,7 @@ function SlotContentRenderer({
|
|
|
45052
43651
|
for (const slotKey of CONTENT_NODE_SLOTS) {
|
|
45053
43652
|
const slotVal = restProps[slotKey];
|
|
45054
43653
|
if (slotVal === void 0 || slotVal === null) continue;
|
|
45055
|
-
if (
|
|
43654
|
+
if (React81__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
|
|
45056
43655
|
if (Array.isArray(slotVal) || typeof slotVal === "object" && "type" in slotVal) {
|
|
45057
43656
|
nodeSlotOverrides[slotKey] = renderPatternChildren(
|
|
45058
43657
|
slotVal,
|
|
@@ -45104,7 +43703,7 @@ function SlotContentRenderer({
|
|
|
45104
43703
|
const resolvedItems = Array.isArray(entityVal) && entityVal[0] !== "fn" ? entityVal : null;
|
|
45105
43704
|
if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
|
|
45106
43705
|
const sample = resolvedItems[0];
|
|
45107
|
-
if (sample && typeof sample === "object" && !Array.isArray(sample) && !
|
|
43706
|
+
if (sample && typeof sample === "object" && !Array.isArray(sample) && !React81__default.isValidElement(sample) && !(sample instanceof Date)) {
|
|
45108
43707
|
const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
|
|
45109
43708
|
finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
|
|
45110
43709
|
}
|
|
@@ -45462,7 +44061,7 @@ function resolveLambdaBindings(body, params, item, index) {
|
|
|
45462
44061
|
if (Array.isArray(body)) {
|
|
45463
44062
|
return body.map((b) => recur(b));
|
|
45464
44063
|
}
|
|
45465
|
-
if (body !== null && typeof body === "object" && !
|
|
44064
|
+
if (body !== null && typeof body === "object" && !React81__default.isValidElement(body) && !(body instanceof Date) && typeof body !== "function") {
|
|
45466
44065
|
const out = {};
|
|
45467
44066
|
for (const [k, v] of Object.entries(body)) {
|
|
45468
44067
|
out[k] = recur(v);
|
|
@@ -45481,7 +44080,7 @@ function getSlotContentRenderer2() {
|
|
|
45481
44080
|
function makeLambdaFn(params, lambdaBody, callerKey) {
|
|
45482
44081
|
return (item, index) => {
|
|
45483
44082
|
const resolvedBody = resolveLambdaBindings(lambdaBody, params, item, index);
|
|
45484
|
-
if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" ||
|
|
44083
|
+
if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" || React81__default.isValidElement(resolvedBody) || resolvedBody instanceof Date) {
|
|
45485
44084
|
return null;
|
|
45486
44085
|
}
|
|
45487
44086
|
const record = resolvedBody;
|
|
@@ -45500,7 +44099,7 @@ function makeLambdaFn(params, lambdaBody, callerKey) {
|
|
|
45500
44099
|
props: childProps,
|
|
45501
44100
|
priority: 0
|
|
45502
44101
|
};
|
|
45503
|
-
return
|
|
44102
|
+
return React81__default.createElement(SlotContentRenderer2, { content: childContent });
|
|
45504
44103
|
};
|
|
45505
44104
|
}
|
|
45506
44105
|
function convertNode(node, callerKey) {
|
|
@@ -45519,7 +44118,7 @@ function convertNode(node, callerKey) {
|
|
|
45519
44118
|
});
|
|
45520
44119
|
return anyChanged ? mapped : node;
|
|
45521
44120
|
}
|
|
45522
|
-
if (typeof node === "object" && !
|
|
44121
|
+
if (typeof node === "object" && !React81__default.isValidElement(node) && !(node instanceof Date)) {
|
|
45523
44122
|
return convertObjectProps(node);
|
|
45524
44123
|
}
|
|
45525
44124
|
return node;
|