@almadar/ui 5.95.0 → 5.97.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 +1665 -1416
- package/dist/avl/index.js +660 -411
- package/dist/components/core/atoms/AtlasImage.d.ts +58 -0
- package/dist/components/core/atoms/index.d.ts +1 -0
- package/dist/components/game/2d/molecules/Canvas2D.d.ts +4 -0
- package/dist/components/game/2d/templates/GameShell.d.ts +19 -23
- package/dist/components/game/3d/index.cjs +893 -439
- package/dist/components/game/3d/index.js +726 -268
- package/dist/components/game/3d/molecules/GameCanvas3D.d.ts +34 -3
- package/dist/components/game/3d/molecules/ModelLoader.d.ts +9 -1
- package/dist/components/game/3d/molecules/index.d.ts +0 -1
- package/dist/components/game/shared/isometricTypes.d.ts +2 -0
- package/dist/components/index.cjs +1645 -1392
- package/dist/components/index.js +637 -387
- package/dist/marketing/index.cjs +208 -73
- package/dist/marketing/index.js +166 -28
- package/dist/providers/index.cjs +1533 -1284
- package/dist/providers/index.js +636 -387
- package/dist/runtime/index.cjs +1526 -1277
- package/dist/runtime/index.js +640 -391
- package/package.json +1 -1
- package/dist/components/game/3d/molecules/Canvas3D.d.ts +0 -45
- /package/dist/{components/game/shared → lib}/atlasSlice.d.ts +0 -0
package/dist/runtime/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as React96 from 'react';
|
|
2
|
+
import React96__default, { useContext, useMemo, useRef, useEffect, useCallback, Suspense, useState, createContext, useSyncExternalStore, useLayoutEffect, lazy, useId } from 'react';
|
|
3
3
|
import { EventBusContext, useTraitScope, useEntitySchemaOptional, useEntitySchema, getAllPages, OrbitalProvider, TraitScopeProvider, ServerBridgeProvider, useCurrentPagePath, 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, isLogLevelEnabled } from '@almadar/logger';
|
|
@@ -937,7 +937,7 @@ var init_Box = __esm({
|
|
|
937
937
|
fixed: "fixed",
|
|
938
938
|
sticky: "sticky"
|
|
939
939
|
};
|
|
940
|
-
Box =
|
|
940
|
+
Box = React96__default.forwardRef(
|
|
941
941
|
({
|
|
942
942
|
padding,
|
|
943
943
|
paddingX,
|
|
@@ -1002,7 +1002,7 @@ var init_Box = __esm({
|
|
|
1002
1002
|
onPointerDown?.(e);
|
|
1003
1003
|
}, [hoverEvent, tapReveal, triggerProps, onPointerDown]);
|
|
1004
1004
|
const isClickable = action || onClick;
|
|
1005
|
-
return
|
|
1005
|
+
return React96__default.createElement(
|
|
1006
1006
|
Component,
|
|
1007
1007
|
{
|
|
1008
1008
|
ref,
|
|
@@ -1098,7 +1098,7 @@ function loadLib(key, importer) {
|
|
|
1098
1098
|
return p;
|
|
1099
1099
|
}
|
|
1100
1100
|
function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
|
|
1101
|
-
const Lazy =
|
|
1101
|
+
const Lazy = React96__default.lazy(async () => {
|
|
1102
1102
|
const lib = await loadLib(libKey, importer);
|
|
1103
1103
|
const Comp = pick(lib);
|
|
1104
1104
|
if (!Comp) {
|
|
@@ -1108,7 +1108,7 @@ function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
|
|
|
1108
1108
|
return { default: Comp };
|
|
1109
1109
|
});
|
|
1110
1110
|
const Wrapped = (props) => /* @__PURE__ */ jsx(
|
|
1111
|
-
|
|
1111
|
+
React96__default.Suspense,
|
|
1112
1112
|
{
|
|
1113
1113
|
fallback: /* @__PURE__ */ jsx(
|
|
1114
1114
|
"span",
|
|
@@ -1839,7 +1839,7 @@ var init_Icon = __esm({
|
|
|
1839
1839
|
const directIcon = typeof icon === "string" ? void 0 : icon;
|
|
1840
1840
|
const effectiveName = typeof icon === "string" ? icon : name;
|
|
1841
1841
|
const family = useIconFamily();
|
|
1842
|
-
const RenderedComponent =
|
|
1842
|
+
const RenderedComponent = React96__default.useMemo(() => {
|
|
1843
1843
|
if (directIcon) return null;
|
|
1844
1844
|
return effectiveName ? resolveIconForFamily(effectiveName, family) : null;
|
|
1845
1845
|
}, [directIcon, effectiveName, family]);
|
|
@@ -1889,6 +1889,210 @@ var init_Icon = __esm({
|
|
|
1889
1889
|
Icon.displayName = "Icon";
|
|
1890
1890
|
}
|
|
1891
1891
|
});
|
|
1892
|
+
|
|
1893
|
+
// lib/atlasSlice.ts
|
|
1894
|
+
function isTilesheet(a) {
|
|
1895
|
+
return typeof a.tileWidth === "number";
|
|
1896
|
+
}
|
|
1897
|
+
function getAtlas(url, onReady) {
|
|
1898
|
+
if (atlasCache.has(url)) return atlasCache.get(url) ?? void 0;
|
|
1899
|
+
atlasCache.set(url, void 0);
|
|
1900
|
+
fetch(url).then((r) => r.json()).then((json) => {
|
|
1901
|
+
atlasCache.set(url, json);
|
|
1902
|
+
onReady();
|
|
1903
|
+
}).catch(() => {
|
|
1904
|
+
atlasCache.set(url, null);
|
|
1905
|
+
});
|
|
1906
|
+
return void 0;
|
|
1907
|
+
}
|
|
1908
|
+
function subRectFor(atlas, sprite) {
|
|
1909
|
+
if (isTilesheet(atlas)) {
|
|
1910
|
+
let col;
|
|
1911
|
+
let row;
|
|
1912
|
+
if (sprite.includes(",")) {
|
|
1913
|
+
const [c, r] = sprite.split(",").map((n) => Number(n.trim()));
|
|
1914
|
+
col = c;
|
|
1915
|
+
row = r;
|
|
1916
|
+
} else {
|
|
1917
|
+
const i = Number(sprite);
|
|
1918
|
+
if (!Number.isFinite(i)) return null;
|
|
1919
|
+
col = i % atlas.columns;
|
|
1920
|
+
row = Math.floor(i / atlas.columns);
|
|
1921
|
+
}
|
|
1922
|
+
if (!Number.isFinite(col) || !Number.isFinite(row) || col < 0 || row < 0 || col >= atlas.columns || row >= atlas.rows) return null;
|
|
1923
|
+
const margin = atlas.margin ?? 0;
|
|
1924
|
+
const spacing = atlas.spacing ?? 0;
|
|
1925
|
+
return {
|
|
1926
|
+
sx: margin + col * (atlas.tileWidth + spacing),
|
|
1927
|
+
sy: margin + row * (atlas.tileHeight + spacing),
|
|
1928
|
+
sw: atlas.tileWidth,
|
|
1929
|
+
sh: atlas.tileHeight
|
|
1930
|
+
};
|
|
1931
|
+
}
|
|
1932
|
+
const st = atlas.subTextures[sprite];
|
|
1933
|
+
if (!st) return null;
|
|
1934
|
+
return { sx: st.x, sy: st.y, sw: st.width, sh: st.height };
|
|
1935
|
+
}
|
|
1936
|
+
function isAtlasAsset(asset) {
|
|
1937
|
+
return !!asset && typeof asset.atlas === "string" && typeof asset.sprite === "string";
|
|
1938
|
+
}
|
|
1939
|
+
function resolveAssetSource(img, asset, onReady) {
|
|
1940
|
+
if (isAtlasAsset(asset)) {
|
|
1941
|
+
const atlas = getAtlas(asset.atlas, onReady);
|
|
1942
|
+
if (!atlas) return null;
|
|
1943
|
+
const rect = subRectFor(atlas, asset.sprite);
|
|
1944
|
+
if (!rect) return null;
|
|
1945
|
+
return { img, rect, aspect: rect.sw / rect.sh };
|
|
1946
|
+
}
|
|
1947
|
+
const natW = img.naturalWidth || 1;
|
|
1948
|
+
const natH = img.naturalHeight || 1;
|
|
1949
|
+
return { img, rect: null, aspect: natW / natH };
|
|
1950
|
+
}
|
|
1951
|
+
function blit(ctx, src, dx, dy, dw, dh) {
|
|
1952
|
+
if (src.rect) ctx.drawImage(src.img, src.rect.sx, src.rect.sy, src.rect.sw, src.rect.sh, dx, dy, dw, dh);
|
|
1953
|
+
else ctx.drawImage(src.img, dx, dy, dw, dh);
|
|
1954
|
+
}
|
|
1955
|
+
var atlasCache;
|
|
1956
|
+
var init_atlasSlice = __esm({
|
|
1957
|
+
"lib/atlasSlice.ts"() {
|
|
1958
|
+
"use client";
|
|
1959
|
+
atlasCache = /* @__PURE__ */ new Map();
|
|
1960
|
+
}
|
|
1961
|
+
});
|
|
1962
|
+
function useAtlasSliceDataUrl(asset) {
|
|
1963
|
+
const [, bump] = React96.useReducer((x) => x + 1, 0);
|
|
1964
|
+
if (!isAtlasAsset(asset)) return void 0;
|
|
1965
|
+
const key = `${asset.atlas}#${asset.sprite}`;
|
|
1966
|
+
const cached = sliceDataUrlCache.get(key);
|
|
1967
|
+
if (cached) return cached;
|
|
1968
|
+
const atlas = getAtlas(asset.atlas, bump);
|
|
1969
|
+
const img = asset?.url ? getSheetImage(asset.url, bump) : null;
|
|
1970
|
+
if (!atlas || !img) return void 0;
|
|
1971
|
+
const rect = subRectFor(atlas, asset.sprite);
|
|
1972
|
+
if (!rect) return void 0;
|
|
1973
|
+
const canvas = document.createElement("canvas");
|
|
1974
|
+
canvas.width = rect.sw;
|
|
1975
|
+
canvas.height = rect.sh;
|
|
1976
|
+
const ctx = canvas.getContext("2d");
|
|
1977
|
+
if (!ctx) return void 0;
|
|
1978
|
+
ctx.imageSmoothingEnabled = false;
|
|
1979
|
+
ctx.drawImage(img, rect.sx, rect.sy, rect.sw, rect.sh, 0, 0, rect.sw, rect.sh);
|
|
1980
|
+
const url = canvas.toDataURL();
|
|
1981
|
+
sliceDataUrlCache.set(key, url);
|
|
1982
|
+
return url;
|
|
1983
|
+
}
|
|
1984
|
+
function AtlasPanel({ asset, borderSlice = 16, borderWidth = 16, mode = "nineSlice", className, style, children, "aria-hidden": ariaHidden }) {
|
|
1985
|
+
const dataUrl = useAtlasSliceDataUrl(asset);
|
|
1986
|
+
const skin = !dataUrl ? {} : mode === "repeat" ? { backgroundImage: `url(${dataUrl})`, backgroundRepeat: "repeat" } : {
|
|
1987
|
+
borderStyle: "solid",
|
|
1988
|
+
borderWidth,
|
|
1989
|
+
borderImageSource: `url(${dataUrl})`,
|
|
1990
|
+
borderImageSlice: `${borderSlice} fill`,
|
|
1991
|
+
borderImageWidth: borderWidth,
|
|
1992
|
+
borderImageRepeat: "stretch",
|
|
1993
|
+
imageRendering: "pixelated"
|
|
1994
|
+
};
|
|
1995
|
+
return /* @__PURE__ */ jsx("span", { "aria-hidden": ariaHidden, className: cn("inline-block", className), style: { ...skin, ...style }, children });
|
|
1996
|
+
}
|
|
1997
|
+
function getSheetImage(url, onReady) {
|
|
1998
|
+
const cached = imageCache.get(url);
|
|
1999
|
+
if (cached) return cached;
|
|
2000
|
+
(imageWaiters.get(url) ?? imageWaiters.set(url, /* @__PURE__ */ new Set()).get(url)).add(onReady);
|
|
2001
|
+
if (!imageCache.has(url)) {
|
|
2002
|
+
imageCache.set(url, null);
|
|
2003
|
+
const img = new Image();
|
|
2004
|
+
img.crossOrigin = "anonymous";
|
|
2005
|
+
img.onload = () => {
|
|
2006
|
+
imageCache.set(url, img);
|
|
2007
|
+
imageWaiters.get(url)?.forEach((fn) => fn());
|
|
2008
|
+
imageWaiters.delete(url);
|
|
2009
|
+
};
|
|
2010
|
+
img.src = url;
|
|
2011
|
+
}
|
|
2012
|
+
return null;
|
|
2013
|
+
}
|
|
2014
|
+
function AtlasImage({
|
|
2015
|
+
asset,
|
|
2016
|
+
size,
|
|
2017
|
+
width,
|
|
2018
|
+
height,
|
|
2019
|
+
fill = false,
|
|
2020
|
+
fit = "contain",
|
|
2021
|
+
alt,
|
|
2022
|
+
className,
|
|
2023
|
+
style,
|
|
2024
|
+
"aria-hidden": ariaHidden
|
|
2025
|
+
}) {
|
|
2026
|
+
const [, bump] = React96.useReducer((x) => x + 1, 0);
|
|
2027
|
+
const canvasRef = React96.useRef(null);
|
|
2028
|
+
const sliced = isAtlasAsset(asset);
|
|
2029
|
+
const atlas = sliced ? getAtlas(asset.atlas, bump) : void 0;
|
|
2030
|
+
const img = sliced && asset?.url ? getSheetImage(asset.url, bump) : null;
|
|
2031
|
+
const rect = sliced && atlas ? subRectFor(atlas, asset.sprite) : null;
|
|
2032
|
+
React96.useEffect(() => {
|
|
2033
|
+
const canvas = canvasRef.current;
|
|
2034
|
+
if (!canvas || !img || !rect) return;
|
|
2035
|
+
canvas.width = rect.sw;
|
|
2036
|
+
canvas.height = rect.sh;
|
|
2037
|
+
const ctx = canvas.getContext("2d");
|
|
2038
|
+
if (!ctx) return;
|
|
2039
|
+
ctx.imageSmoothingEnabled = false;
|
|
2040
|
+
ctx.clearRect(0, 0, rect.sw, rect.sh);
|
|
2041
|
+
ctx.drawImage(img, rect.sx, rect.sy, rect.sw, rect.sh, 0, 0, rect.sw, rect.sh);
|
|
2042
|
+
}, [img, rect?.sx, rect?.sy, rect?.sw, rect?.sh]);
|
|
2043
|
+
const w = fill ? "100%" : width ?? size;
|
|
2044
|
+
const h = fill ? "100%" : height ?? size;
|
|
2045
|
+
const boxStyle = {
|
|
2046
|
+
...fill ? { position: "absolute", inset: 0 } : {},
|
|
2047
|
+
width: w,
|
|
2048
|
+
height: h,
|
|
2049
|
+
objectFit: fit,
|
|
2050
|
+
imageRendering: "pixelated",
|
|
2051
|
+
...style
|
|
2052
|
+
};
|
|
2053
|
+
if (!asset?.url) return null;
|
|
2054
|
+
if (sliced) {
|
|
2055
|
+
if (!rect || !img) {
|
|
2056
|
+
return /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: cn("inline-block flex-shrink-0", className), style: { ...boxStyle, objectFit: void 0 } });
|
|
2057
|
+
}
|
|
2058
|
+
return /* @__PURE__ */ jsx(
|
|
2059
|
+
"canvas",
|
|
2060
|
+
{
|
|
2061
|
+
ref: canvasRef,
|
|
2062
|
+
role: ariaHidden ? void 0 : "img",
|
|
2063
|
+
"aria-hidden": ariaHidden,
|
|
2064
|
+
"aria-label": ariaHidden ? void 0 : alt ?? asset.name ?? asset.category ?? "",
|
|
2065
|
+
className: cn("flex-shrink-0", className),
|
|
2066
|
+
style: boxStyle
|
|
2067
|
+
}
|
|
2068
|
+
);
|
|
2069
|
+
}
|
|
2070
|
+
return /* @__PURE__ */ jsx(
|
|
2071
|
+
"img",
|
|
2072
|
+
{
|
|
2073
|
+
src: asset.url,
|
|
2074
|
+
alt: alt ?? asset.name ?? asset.category ?? "",
|
|
2075
|
+
"aria-hidden": ariaHidden,
|
|
2076
|
+
...typeof w === "number" ? { width: w } : {},
|
|
2077
|
+
...typeof h === "number" ? { height: h } : {},
|
|
2078
|
+
className: cn("flex-shrink-0", className),
|
|
2079
|
+
style: boxStyle
|
|
2080
|
+
}
|
|
2081
|
+
);
|
|
2082
|
+
}
|
|
2083
|
+
var sliceDataUrlCache, imageCache, imageWaiters;
|
|
2084
|
+
var init_AtlasImage = __esm({
|
|
2085
|
+
"components/core/atoms/AtlasImage.tsx"() {
|
|
2086
|
+
"use client";
|
|
2087
|
+
init_atlasSlice();
|
|
2088
|
+
init_cn();
|
|
2089
|
+
sliceDataUrlCache = /* @__PURE__ */ new Map();
|
|
2090
|
+
AtlasPanel.displayName = "AtlasPanel";
|
|
2091
|
+
imageCache = /* @__PURE__ */ new Map();
|
|
2092
|
+
imageWaiters = /* @__PURE__ */ new Map();
|
|
2093
|
+
AtlasImage.displayName = "AtlasImage";
|
|
2094
|
+
}
|
|
2095
|
+
});
|
|
1892
2096
|
function isIconLike(v) {
|
|
1893
2097
|
return typeof v.render === "function";
|
|
1894
2098
|
}
|
|
@@ -1901,7 +2105,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
1901
2105
|
const IconComp = value;
|
|
1902
2106
|
return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
|
|
1903
2107
|
}
|
|
1904
|
-
if (
|
|
2108
|
+
if (React96__default.isValidElement(value)) {
|
|
1905
2109
|
return value;
|
|
1906
2110
|
}
|
|
1907
2111
|
if (typeof value === "object" && value !== null && isIconLike(value)) {
|
|
@@ -1917,6 +2121,7 @@ var init_Button = __esm({
|
|
|
1917
2121
|
init_cn();
|
|
1918
2122
|
init_useEventBus();
|
|
1919
2123
|
init_Icon();
|
|
2124
|
+
init_AtlasImage();
|
|
1920
2125
|
variantStyles = {
|
|
1921
2126
|
primary: [
|
|
1922
2127
|
"bg-primary text-primary-foreground",
|
|
@@ -1977,7 +2182,7 @@ var init_Button = __esm({
|
|
|
1977
2182
|
md: "h-icon-default w-icon-default",
|
|
1978
2183
|
lg: "h-icon-default w-icon-default"
|
|
1979
2184
|
};
|
|
1980
|
-
Button =
|
|
2185
|
+
Button = React96__default.forwardRef(
|
|
1981
2186
|
({
|
|
1982
2187
|
className,
|
|
1983
2188
|
variant = "primary",
|
|
@@ -2001,7 +2206,7 @@ var init_Button = __esm({
|
|
|
2001
2206
|
const leftIconValue = leftIcon || iconProp;
|
|
2002
2207
|
const rightIconValue = rightIcon || iconRightProp;
|
|
2003
2208
|
const px = size === "sm" ? 16 : size === "lg" ? 20 : 16;
|
|
2004
|
-
const resolvedLeftIcon = iconAsset?.url ? /* @__PURE__ */ jsx(
|
|
2209
|
+
const resolvedLeftIcon = iconAsset?.url ? /* @__PURE__ */ jsx(AtlasImage, { asset: iconAsset, size: px, alt: iconAsset.name ?? iconAsset.category ?? "", className: "flex-shrink-0" }) : resolveIconProp(leftIconValue, iconSizeStyles[size]);
|
|
2005
2210
|
const resolvedRightIcon = resolveIconProp(rightIconValue, iconSizeStyles[size]);
|
|
2006
2211
|
const handleClick = (e) => {
|
|
2007
2212
|
if (action) {
|
|
@@ -2045,7 +2250,7 @@ var Dialog;
|
|
|
2045
2250
|
var init_Dialog = __esm({
|
|
2046
2251
|
"components/core/atoms/Dialog.tsx"() {
|
|
2047
2252
|
init_cn();
|
|
2048
|
-
Dialog =
|
|
2253
|
+
Dialog = React96__default.forwardRef(
|
|
2049
2254
|
({
|
|
2050
2255
|
role = "dialog",
|
|
2051
2256
|
"aria-modal": ariaModal = true,
|
|
@@ -2163,7 +2368,7 @@ var init_Typography = __esm({
|
|
|
2163
2368
|
}) => {
|
|
2164
2369
|
const variant = variantProp ?? (level ? `h${level}` : "body1");
|
|
2165
2370
|
const Component = as || defaultElements[variant];
|
|
2166
|
-
return
|
|
2371
|
+
return React96__default.createElement(
|
|
2167
2372
|
Component,
|
|
2168
2373
|
{
|
|
2169
2374
|
id,
|
|
@@ -2621,6 +2826,7 @@ var init_Badge = __esm({
|
|
|
2621
2826
|
"components/core/atoms/Badge.tsx"() {
|
|
2622
2827
|
init_cn();
|
|
2623
2828
|
init_Icon();
|
|
2829
|
+
init_AtlasImage();
|
|
2624
2830
|
variantStyles3 = {
|
|
2625
2831
|
default: [
|
|
2626
2832
|
"bg-muted text-foreground",
|
|
@@ -2658,7 +2864,7 @@ var init_Badge = __esm({
|
|
|
2658
2864
|
md: "px-2.5 py-1 text-sm",
|
|
2659
2865
|
lg: "px-3 py-1.5 text-base"
|
|
2660
2866
|
};
|
|
2661
|
-
Badge =
|
|
2867
|
+
Badge = React96__default.forwardRef(
|
|
2662
2868
|
({ className, variant = "default", size = "sm", amount, label, icon, iconAsset, children, onRemove, removeLabel, ...props }, ref) => {
|
|
2663
2869
|
const iconSizes3 = {
|
|
2664
2870
|
sm: "h-icon-default w-icon-default",
|
|
@@ -2666,7 +2872,7 @@ var init_Badge = __esm({
|
|
|
2666
2872
|
lg: "h-icon-default w-icon-default"
|
|
2667
2873
|
};
|
|
2668
2874
|
const iconPx = size === "lg" ? 20 : 16;
|
|
2669
|
-
const resolvedIcon = iconAsset?.url ? /* @__PURE__ */ jsx(
|
|
2875
|
+
const resolvedIcon = iconAsset?.url ? /* @__PURE__ */ jsx(AtlasImage, { asset: iconAsset, size: iconPx, alt: iconAsset.name ?? iconAsset.category ?? "", className: "flex-shrink-0" }) : typeof icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: icon, className: iconSizes3[size] }) : icon ? /* @__PURE__ */ jsx(Icon, { icon, className: iconSizes3[size] }) : null;
|
|
2670
2876
|
return /* @__PURE__ */ jsxs(
|
|
2671
2877
|
"span",
|
|
2672
2878
|
{
|
|
@@ -2995,7 +3201,7 @@ var init_SvgFlow = __esm({
|
|
|
2995
3201
|
width = 100,
|
|
2996
3202
|
height = 100
|
|
2997
3203
|
}) => {
|
|
2998
|
-
const markerId =
|
|
3204
|
+
const markerId = React96__default.useMemo(() => {
|
|
2999
3205
|
flowIdCounter += 1;
|
|
3000
3206
|
return `almadar-flow-arrow-${flowIdCounter}`;
|
|
3001
3207
|
}, []);
|
|
@@ -3588,7 +3794,7 @@ var init_SvgRing = __esm({
|
|
|
3588
3794
|
width = 100,
|
|
3589
3795
|
height = 100
|
|
3590
3796
|
}) => {
|
|
3591
|
-
const gradientId =
|
|
3797
|
+
const gradientId = React96__default.useMemo(() => {
|
|
3592
3798
|
ringIdCounter += 1;
|
|
3593
3799
|
return `almadar-ring-glow-${ringIdCounter}`;
|
|
3594
3800
|
}, []);
|
|
@@ -3769,7 +3975,7 @@ var init_Input = __esm({
|
|
|
3769
3975
|
init_cn();
|
|
3770
3976
|
init_Icon();
|
|
3771
3977
|
init_useEventBus();
|
|
3772
|
-
Input =
|
|
3978
|
+
Input = React96__default.forwardRef(
|
|
3773
3979
|
({
|
|
3774
3980
|
className,
|
|
3775
3981
|
inputType,
|
|
@@ -3929,7 +4135,7 @@ var Label;
|
|
|
3929
4135
|
var init_Label = __esm({
|
|
3930
4136
|
"components/core/atoms/Label.tsx"() {
|
|
3931
4137
|
init_cn();
|
|
3932
|
-
Label =
|
|
4138
|
+
Label = React96__default.forwardRef(
|
|
3933
4139
|
({ className, required, children, ...props }, ref) => {
|
|
3934
4140
|
return /* @__PURE__ */ jsxs(
|
|
3935
4141
|
"label",
|
|
@@ -3956,7 +4162,7 @@ var init_Textarea = __esm({
|
|
|
3956
4162
|
"components/core/atoms/Textarea.tsx"() {
|
|
3957
4163
|
init_cn();
|
|
3958
4164
|
init_useEventBus();
|
|
3959
|
-
Textarea =
|
|
4165
|
+
Textarea = React96__default.forwardRef(
|
|
3960
4166
|
({ className, error, onChange, ...props }, ref) => {
|
|
3961
4167
|
const eventBus = useEventBus();
|
|
3962
4168
|
const handleChange = (e) => {
|
|
@@ -4195,7 +4401,7 @@ var init_Select = __esm({
|
|
|
4195
4401
|
init_cn();
|
|
4196
4402
|
init_Icon();
|
|
4197
4403
|
init_useEventBus();
|
|
4198
|
-
Select =
|
|
4404
|
+
Select = React96__default.forwardRef(
|
|
4199
4405
|
(props, _ref) => {
|
|
4200
4406
|
const { multiple, searchable, clearable } = props;
|
|
4201
4407
|
if (multiple || searchable || clearable) {
|
|
@@ -4212,7 +4418,7 @@ var init_Checkbox = __esm({
|
|
|
4212
4418
|
"components/core/atoms/Checkbox.tsx"() {
|
|
4213
4419
|
init_cn();
|
|
4214
4420
|
init_useEventBus();
|
|
4215
|
-
Checkbox =
|
|
4421
|
+
Checkbox = React96__default.forwardRef(
|
|
4216
4422
|
({ className, label, id, onChange, ...props }, ref) => {
|
|
4217
4423
|
const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
4218
4424
|
const eventBus = useEventBus();
|
|
@@ -4266,7 +4472,7 @@ var init_Spinner = __esm({
|
|
|
4266
4472
|
md: "h-6 w-6",
|
|
4267
4473
|
lg: "h-8 w-8"
|
|
4268
4474
|
};
|
|
4269
|
-
Spinner =
|
|
4475
|
+
Spinner = React96__default.forwardRef(
|
|
4270
4476
|
({ className, size = "md", overlay, ...props }, ref) => {
|
|
4271
4477
|
if (overlay) {
|
|
4272
4478
|
return /* @__PURE__ */ jsx(
|
|
@@ -4356,7 +4562,7 @@ var init_Card = __esm({
|
|
|
4356
4562
|
chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
|
|
4357
4563
|
"tile-image-first": "p-0 overflow-hidden"
|
|
4358
4564
|
};
|
|
4359
|
-
Card =
|
|
4565
|
+
Card = React96__default.forwardRef(
|
|
4360
4566
|
({
|
|
4361
4567
|
className,
|
|
4362
4568
|
variant = "bordered",
|
|
@@ -4404,9 +4610,9 @@ var init_Card = __esm({
|
|
|
4404
4610
|
}
|
|
4405
4611
|
);
|
|
4406
4612
|
Card.displayName = "Card";
|
|
4407
|
-
CardHeader =
|
|
4613
|
+
CardHeader = React96__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
4408
4614
|
CardHeader.displayName = "CardHeader";
|
|
4409
|
-
CardTitle =
|
|
4615
|
+
CardTitle = React96__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
4410
4616
|
"h3",
|
|
4411
4617
|
{
|
|
4412
4618
|
ref,
|
|
@@ -4419,11 +4625,11 @@ var init_Card = __esm({
|
|
|
4419
4625
|
}
|
|
4420
4626
|
));
|
|
4421
4627
|
CardTitle.displayName = "CardTitle";
|
|
4422
|
-
CardContent =
|
|
4628
|
+
CardContent = React96__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
|
|
4423
4629
|
CardContent.displayName = "CardContent";
|
|
4424
4630
|
CardBody = CardContent;
|
|
4425
4631
|
CardBody.displayName = "CardBody";
|
|
4426
|
-
CardFooter =
|
|
4632
|
+
CardFooter = React96__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
4427
4633
|
"div",
|
|
4428
4634
|
{
|
|
4429
4635
|
ref,
|
|
@@ -4478,7 +4684,7 @@ var init_FilterPill = __esm({
|
|
|
4478
4684
|
md: "w-3.5 h-3.5",
|
|
4479
4685
|
lg: "w-4 h-4"
|
|
4480
4686
|
};
|
|
4481
|
-
FilterPill =
|
|
4687
|
+
FilterPill = React96__default.forwardRef(
|
|
4482
4688
|
({
|
|
4483
4689
|
className,
|
|
4484
4690
|
variant = "default",
|
|
@@ -4607,8 +4813,8 @@ var init_Avatar = __esm({
|
|
|
4607
4813
|
actionPayload
|
|
4608
4814
|
}) => {
|
|
4609
4815
|
const eventBus = useEventBus();
|
|
4610
|
-
const [imgFailed, setImgFailed] =
|
|
4611
|
-
|
|
4816
|
+
const [imgFailed, setImgFailed] = React96__default.useState(false);
|
|
4817
|
+
React96__default.useEffect(() => {
|
|
4612
4818
|
setImgFailed(false);
|
|
4613
4819
|
}, [src]);
|
|
4614
4820
|
const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
|
|
@@ -4721,7 +4927,7 @@ var init_Center = __esm({
|
|
|
4721
4927
|
as: Component = "div"
|
|
4722
4928
|
}) => {
|
|
4723
4929
|
const mergedStyle = minHeight ? { minHeight, ...style } : style;
|
|
4724
|
-
return
|
|
4930
|
+
return React96__default.createElement(Component, {
|
|
4725
4931
|
className: cn(
|
|
4726
4932
|
inline ? "inline-flex" : "flex",
|
|
4727
4933
|
horizontal && "justify-center",
|
|
@@ -4989,7 +5195,7 @@ var init_Radio = __esm({
|
|
|
4989
5195
|
md: "w-2.5 h-2.5",
|
|
4990
5196
|
lg: "w-3 h-3"
|
|
4991
5197
|
};
|
|
4992
|
-
Radio =
|
|
5198
|
+
Radio = React96__default.forwardRef(
|
|
4993
5199
|
({
|
|
4994
5200
|
label,
|
|
4995
5201
|
helperText,
|
|
@@ -5006,12 +5212,12 @@ var init_Radio = __esm({
|
|
|
5006
5212
|
onChange,
|
|
5007
5213
|
...props
|
|
5008
5214
|
}, ref) => {
|
|
5009
|
-
const reactId =
|
|
5215
|
+
const reactId = React96__default.useId();
|
|
5010
5216
|
const baseId = id || `radio-${reactId}`;
|
|
5011
5217
|
const hasError = !!error;
|
|
5012
5218
|
const eventBus = useEventBus();
|
|
5013
|
-
const [selected, setSelected] =
|
|
5014
|
-
|
|
5219
|
+
const [selected, setSelected] = React96__default.useState(value);
|
|
5220
|
+
React96__default.useEffect(() => {
|
|
5015
5221
|
if (value !== void 0) setSelected(value);
|
|
5016
5222
|
}, [value]);
|
|
5017
5223
|
const pick = (next, e) => {
|
|
@@ -5193,7 +5399,7 @@ var init_Switch = __esm({
|
|
|
5193
5399
|
"components/core/atoms/Switch.tsx"() {
|
|
5194
5400
|
"use client";
|
|
5195
5401
|
init_cn();
|
|
5196
|
-
Switch =
|
|
5402
|
+
Switch = React96.forwardRef(
|
|
5197
5403
|
({
|
|
5198
5404
|
checked,
|
|
5199
5405
|
defaultChecked = false,
|
|
@@ -5204,10 +5410,10 @@ var init_Switch = __esm({
|
|
|
5204
5410
|
name,
|
|
5205
5411
|
className
|
|
5206
5412
|
}, ref) => {
|
|
5207
|
-
const [isChecked, setIsChecked] =
|
|
5413
|
+
const [isChecked, setIsChecked] = React96.useState(
|
|
5208
5414
|
checked !== void 0 ? checked : defaultChecked
|
|
5209
5415
|
);
|
|
5210
|
-
|
|
5416
|
+
React96.useEffect(() => {
|
|
5211
5417
|
if (checked !== void 0) {
|
|
5212
5418
|
setIsChecked(checked);
|
|
5213
5419
|
}
|
|
@@ -5370,7 +5576,7 @@ var init_Stack = __esm({
|
|
|
5370
5576
|
};
|
|
5371
5577
|
const isHorizontal = direction === "horizontal";
|
|
5372
5578
|
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";
|
|
5373
|
-
return
|
|
5579
|
+
return React96__default.createElement(
|
|
5374
5580
|
Component,
|
|
5375
5581
|
{
|
|
5376
5582
|
className: cn(
|
|
@@ -5570,7 +5776,7 @@ var Aside;
|
|
|
5570
5776
|
var init_Aside = __esm({
|
|
5571
5777
|
"components/core/atoms/Aside.tsx"() {
|
|
5572
5778
|
init_cn();
|
|
5573
|
-
Aside =
|
|
5779
|
+
Aside = React96__default.forwardRef(
|
|
5574
5780
|
({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
|
|
5575
5781
|
);
|
|
5576
5782
|
Aside.displayName = "Aside";
|
|
@@ -5649,9 +5855,9 @@ var init_LawReferenceTooltip = __esm({
|
|
|
5649
5855
|
className
|
|
5650
5856
|
}) => {
|
|
5651
5857
|
const { t } = useTranslate();
|
|
5652
|
-
const [isVisible, setIsVisible] =
|
|
5653
|
-
const timeoutRef =
|
|
5654
|
-
const triggerRef =
|
|
5858
|
+
const [isVisible, setIsVisible] = React96__default.useState(false);
|
|
5859
|
+
const timeoutRef = React96__default.useRef(null);
|
|
5860
|
+
const triggerRef = React96__default.useRef(null);
|
|
5655
5861
|
const handleMouseEnter = () => {
|
|
5656
5862
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
5657
5863
|
timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
|
|
@@ -5662,7 +5868,7 @@ var init_LawReferenceTooltip = __esm({
|
|
|
5662
5868
|
};
|
|
5663
5869
|
const { revealed, triggerProps } = useTapReveal({ refs: [triggerRef] });
|
|
5664
5870
|
const open = isVisible || revealed;
|
|
5665
|
-
|
|
5871
|
+
React96__default.useEffect(() => {
|
|
5666
5872
|
return () => {
|
|
5667
5873
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
5668
5874
|
};
|
|
@@ -5872,7 +6078,7 @@ var init_StatusDot = __esm({
|
|
|
5872
6078
|
md: "w-2.5 h-2.5",
|
|
5873
6079
|
lg: "w-3 h-3"
|
|
5874
6080
|
};
|
|
5875
|
-
StatusDot =
|
|
6081
|
+
StatusDot = React96__default.forwardRef(
|
|
5876
6082
|
({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
|
|
5877
6083
|
return /* @__PURE__ */ jsx(
|
|
5878
6084
|
"span",
|
|
@@ -5926,7 +6132,7 @@ var init_TrendIndicator = __esm({
|
|
|
5926
6132
|
down: "trending-down",
|
|
5927
6133
|
flat: "arrow-right"
|
|
5928
6134
|
};
|
|
5929
|
-
TrendIndicator =
|
|
6135
|
+
TrendIndicator = React96__default.forwardRef(
|
|
5930
6136
|
({
|
|
5931
6137
|
className,
|
|
5932
6138
|
value,
|
|
@@ -5993,7 +6199,7 @@ var init_RangeSlider = __esm({
|
|
|
5993
6199
|
md: "w-4 h-4",
|
|
5994
6200
|
lg: "w-5 h-5"
|
|
5995
6201
|
};
|
|
5996
|
-
RangeSlider =
|
|
6202
|
+
RangeSlider = React96__default.forwardRef(
|
|
5997
6203
|
({
|
|
5998
6204
|
className,
|
|
5999
6205
|
min = 0,
|
|
@@ -6552,7 +6758,7 @@ var init_ContentSection = __esm({
|
|
|
6552
6758
|
md: "py-16",
|
|
6553
6759
|
lg: "py-24"
|
|
6554
6760
|
};
|
|
6555
|
-
ContentSection =
|
|
6761
|
+
ContentSection = React96__default.forwardRef(
|
|
6556
6762
|
({ children, background = "default", padding = "lg", id, className }, ref) => {
|
|
6557
6763
|
return /* @__PURE__ */ jsx(
|
|
6558
6764
|
Box,
|
|
@@ -7086,7 +7292,7 @@ var init_AnimatedReveal = __esm({
|
|
|
7086
7292
|
"scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
|
|
7087
7293
|
"none": {}
|
|
7088
7294
|
};
|
|
7089
|
-
AnimatedReveal =
|
|
7295
|
+
AnimatedReveal = React96__default.forwardRef(
|
|
7090
7296
|
({
|
|
7091
7297
|
trigger = "scroll",
|
|
7092
7298
|
animation = "fade-up",
|
|
@@ -7246,7 +7452,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
7246
7452
|
"components/marketing/atoms/AnimatedGraphic.tsx"() {
|
|
7247
7453
|
"use client";
|
|
7248
7454
|
init_cn();
|
|
7249
|
-
AnimatedGraphic =
|
|
7455
|
+
AnimatedGraphic = React96__default.forwardRef(
|
|
7250
7456
|
({
|
|
7251
7457
|
src,
|
|
7252
7458
|
svgContent,
|
|
@@ -7269,7 +7475,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
7269
7475
|
const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
|
|
7270
7476
|
const resolvedSvg = svgContent ?? fetchedSvg;
|
|
7271
7477
|
const prevAnimateRef = useRef(animate);
|
|
7272
|
-
const setRef =
|
|
7478
|
+
const setRef = React96__default.useCallback(
|
|
7273
7479
|
(node) => {
|
|
7274
7480
|
containerRef.current = node;
|
|
7275
7481
|
if (typeof ref === "function") ref(node);
|
|
@@ -7741,7 +7947,7 @@ function isoToScreen(tileX, tileY, scale, baseOffsetX, layout = "isometric") {
|
|
|
7741
7947
|
}
|
|
7742
7948
|
if (layout === "flat") {
|
|
7743
7949
|
const screenX2 = tileX * scaledTileWidth + baseOffsetX;
|
|
7744
|
-
const screenY2 = tileY *
|
|
7950
|
+
const screenY2 = tileY * scaledTileWidth;
|
|
7745
7951
|
return { x: screenX2, y: screenY2 };
|
|
7746
7952
|
}
|
|
7747
7953
|
const screenX = (tileX - tileY) * (scaledTileWidth / 2) + baseOffsetX;
|
|
@@ -7758,7 +7964,7 @@ function screenToIso(screenX, screenY, scale, baseOffsetX, layout = "isometric")
|
|
|
7758
7964
|
}
|
|
7759
7965
|
if (layout === "flat") {
|
|
7760
7966
|
const col = Math.round((screenX - baseOffsetX) / scaledTileWidth);
|
|
7761
|
-
const row = Math.round(screenY /
|
|
7967
|
+
const row = Math.round(screenY / scaledTileWidth);
|
|
7762
7968
|
return { x: col, y: row };
|
|
7763
7969
|
}
|
|
7764
7970
|
const adjustedX = screenX - baseOffsetX;
|
|
@@ -7832,13 +8038,11 @@ function GameIcon({ assetUrl, icon, size = "md", alt, className }) {
|
|
|
7832
8038
|
const px = typeof size === "number" ? size : sizeMap[size];
|
|
7833
8039
|
if (assetUrl?.url) {
|
|
7834
8040
|
return /* @__PURE__ */ jsx(
|
|
7835
|
-
|
|
8041
|
+
AtlasImage,
|
|
7836
8042
|
{
|
|
7837
|
-
|
|
8043
|
+
asset: assetUrl,
|
|
8044
|
+
size: px,
|
|
7838
8045
|
alt: alt ?? assetUrl.category ?? "",
|
|
7839
|
-
width: px,
|
|
7840
|
-
height: px,
|
|
7841
|
-
style: { imageRendering: "pixelated", objectFit: "contain", width: px, height: px },
|
|
7842
8046
|
className: cn("flex-shrink-0", className)
|
|
7843
8047
|
}
|
|
7844
8048
|
);
|
|
@@ -7852,6 +8056,7 @@ var init_GameIcon = __esm({
|
|
|
7852
8056
|
"use client";
|
|
7853
8057
|
init_cn();
|
|
7854
8058
|
init_Icon();
|
|
8059
|
+
init_AtlasImage();
|
|
7855
8060
|
sizeMap = {
|
|
7856
8061
|
sm: 16,
|
|
7857
8062
|
md: 24,
|
|
@@ -7877,13 +8082,12 @@ function GameCard({
|
|
|
7877
8082
|
className
|
|
7878
8083
|
}) {
|
|
7879
8084
|
const eventBus = useEventBus();
|
|
7880
|
-
const handleClick =
|
|
8085
|
+
const handleClick = React96.useCallback(() => {
|
|
7881
8086
|
if (disabled) return;
|
|
7882
8087
|
onClick?.(id);
|
|
7883
8088
|
if (clickEvent) eventBus.emit(`UI:${clickEvent}`, { cardId: id });
|
|
7884
8089
|
}, [disabled, id, onClick, clickEvent, eventBus]);
|
|
7885
8090
|
const artPx = artPxMap[size];
|
|
7886
|
-
const frameStyle = frameAsset?.url ? { backgroundImage: `url(${frameAsset.url})`, backgroundSize: "100% 100%", backgroundRepeat: "no-repeat" } : {};
|
|
7887
8091
|
return /* @__PURE__ */ jsxs(
|
|
7888
8092
|
Button,
|
|
7889
8093
|
{
|
|
@@ -7891,11 +8095,10 @@ function GameCard({
|
|
|
7891
8095
|
onClick: handleClick,
|
|
7892
8096
|
disabled,
|
|
7893
8097
|
title: name,
|
|
7894
|
-
style: frameStyle,
|
|
7895
8098
|
className: cn(
|
|
7896
|
-
"relative flex flex-col items-center rounded-interactive",
|
|
7897
|
-
"
|
|
7898
|
-
frameAsset?.url ? "border-0" : "border-2",
|
|
8099
|
+
"relative isolate flex flex-col items-center rounded-interactive",
|
|
8100
|
+
"px-1.5 pt-1.5 pb-1 transition-all duration-150",
|
|
8101
|
+
frameAsset?.url ? "border-0" : "border-2 bg-card/90",
|
|
7899
8102
|
cardSizeMap[size],
|
|
7900
8103
|
disabled ? "border-border opacity-50 cursor-not-allowed" : "border-accent hover:brightness-125 hover:-translate-y-1 cursor-pointer",
|
|
7901
8104
|
selected && "ring-2 ring-foreground ring-offset-1 ring-offset-background -translate-y-1",
|
|
@@ -7903,6 +8106,7 @@ function GameCard({
|
|
|
7903
8106
|
className
|
|
7904
8107
|
),
|
|
7905
8108
|
children: [
|
|
8109
|
+
frameAsset?.url && /* @__PURE__ */ jsx(AtlasImage, { asset: frameAsset, fill: true, fit: "fill", "aria-hidden": true, style: { zIndex: -1 } }),
|
|
7906
8110
|
cost != null && /* @__PURE__ */ jsx(
|
|
7907
8111
|
Typography,
|
|
7908
8112
|
{
|
|
@@ -7941,6 +8145,7 @@ var init_GameCard = __esm({
|
|
|
7941
8145
|
init_Box();
|
|
7942
8146
|
init_Button();
|
|
7943
8147
|
init_Typography();
|
|
8148
|
+
init_AtlasImage();
|
|
7944
8149
|
init_GameIcon();
|
|
7945
8150
|
cardSizeMap = {
|
|
7946
8151
|
sm: "w-16 h-24",
|
|
@@ -8101,7 +8306,7 @@ var init_HealthBar = __esm({
|
|
|
8101
8306
|
}
|
|
8102
8307
|
});
|
|
8103
8308
|
function ScoreDisplay({
|
|
8104
|
-
assetUrl
|
|
8309
|
+
assetUrl,
|
|
8105
8310
|
value,
|
|
8106
8311
|
score,
|
|
8107
8312
|
label,
|
|
@@ -8128,7 +8333,7 @@ function ScoreDisplay({
|
|
|
8128
8333
|
}
|
|
8129
8334
|
);
|
|
8130
8335
|
}
|
|
8131
|
-
var sizeMap3
|
|
8336
|
+
var sizeMap3;
|
|
8132
8337
|
var init_ScoreDisplay = __esm({
|
|
8133
8338
|
"components/game/2d/atoms/ScoreDisplay.tsx"() {
|
|
8134
8339
|
init_cn();
|
|
@@ -8142,16 +8347,11 @@ var init_ScoreDisplay = __esm({
|
|
|
8142
8347
|
lg: "text-2xl",
|
|
8143
8348
|
xl: "text-4xl"
|
|
8144
8349
|
};
|
|
8145
|
-
DEFAULT_ASSET_URL = {
|
|
8146
|
-
url: "https://almadar-kflow-assets.web.app/shared/effects/particles/star_01.png",
|
|
8147
|
-
role: "effect",
|
|
8148
|
-
category: "effect"
|
|
8149
|
-
};
|
|
8150
8350
|
ScoreDisplay.displayName = "ScoreDisplay";
|
|
8151
8351
|
}
|
|
8152
8352
|
});
|
|
8153
8353
|
function ControlButton({
|
|
8154
|
-
assetUrl =
|
|
8354
|
+
assetUrl = DEFAULT_ASSET_URL,
|
|
8155
8355
|
label,
|
|
8156
8356
|
icon,
|
|
8157
8357
|
size = "md",
|
|
@@ -8166,9 +8366,9 @@ function ControlButton({
|
|
|
8166
8366
|
className
|
|
8167
8367
|
}) {
|
|
8168
8368
|
const eventBus = useEventBus();
|
|
8169
|
-
const [isPressed, setIsPressed] =
|
|
8369
|
+
const [isPressed, setIsPressed] = React96.useState(false);
|
|
8170
8370
|
const actualPressed = pressed ?? isPressed;
|
|
8171
|
-
const handlePointerDown =
|
|
8371
|
+
const handlePointerDown = React96.useCallback(
|
|
8172
8372
|
(e) => {
|
|
8173
8373
|
e.preventDefault();
|
|
8174
8374
|
if (disabled) return;
|
|
@@ -8178,7 +8378,7 @@ function ControlButton({
|
|
|
8178
8378
|
},
|
|
8179
8379
|
[disabled, pressEvent, eventBus, onPress]
|
|
8180
8380
|
);
|
|
8181
|
-
const handlePointerUp =
|
|
8381
|
+
const handlePointerUp = React96.useCallback(
|
|
8182
8382
|
(e) => {
|
|
8183
8383
|
e.preventDefault();
|
|
8184
8384
|
if (disabled) return;
|
|
@@ -8188,7 +8388,7 @@ function ControlButton({
|
|
|
8188
8388
|
},
|
|
8189
8389
|
[disabled, releaseEvent, eventBus, onRelease]
|
|
8190
8390
|
);
|
|
8191
|
-
const handlePointerLeave =
|
|
8391
|
+
const handlePointerLeave = React96.useCallback(
|
|
8192
8392
|
(e) => {
|
|
8193
8393
|
if (isPressed) {
|
|
8194
8394
|
setIsPressed(false);
|
|
@@ -8229,7 +8429,7 @@ function ControlButton({
|
|
|
8229
8429
|
}
|
|
8230
8430
|
);
|
|
8231
8431
|
}
|
|
8232
|
-
var sizeMap4, shapeMap, variantMap,
|
|
8432
|
+
var sizeMap4, shapeMap, variantMap, DEFAULT_ASSET_URL;
|
|
8233
8433
|
var init_ControlButton = __esm({
|
|
8234
8434
|
"components/game/2d/atoms/ControlButton.tsx"() {
|
|
8235
8435
|
"use client";
|
|
@@ -8256,7 +8456,7 @@ var init_ControlButton = __esm({
|
|
|
8256
8456
|
secondary: "bg-secondary text-secondary-foreground border-border hover:bg-secondary-hover",
|
|
8257
8457
|
ghost: "bg-transparent text-foreground border-border hover:bg-muted"
|
|
8258
8458
|
};
|
|
8259
|
-
|
|
8459
|
+
DEFAULT_ASSET_URL = {
|
|
8260
8460
|
url: "https://almadar-kflow-assets.web.app/shared/effects/particles/circle_01.png",
|
|
8261
8461
|
role: "ui",
|
|
8262
8462
|
category: "control"
|
|
@@ -8349,7 +8549,7 @@ function isKnownState(s) {
|
|
|
8349
8549
|
return s in DEFAULT_STATE_STYLES;
|
|
8350
8550
|
}
|
|
8351
8551
|
function StateIndicator({
|
|
8352
|
-
assetUrl =
|
|
8552
|
+
assetUrl = DEFAULT_ASSET_URL2,
|
|
8353
8553
|
state = "idle",
|
|
8354
8554
|
label,
|
|
8355
8555
|
size = "md",
|
|
@@ -8379,14 +8579,14 @@ function StateIndicator({
|
|
|
8379
8579
|
}
|
|
8380
8580
|
);
|
|
8381
8581
|
}
|
|
8382
|
-
var
|
|
8582
|
+
var DEFAULT_ASSET_URL2, DEFAULT_STATE_STYLES, DEFAULT_STYLE, STATIC_STATES, SIZE_CLASSES;
|
|
8383
8583
|
var init_StateIndicator = __esm({
|
|
8384
8584
|
"components/game/2d/atoms/StateIndicator.tsx"() {
|
|
8385
8585
|
init_Box();
|
|
8386
8586
|
init_Icon();
|
|
8387
8587
|
init_cn();
|
|
8388
8588
|
init_GameIcon();
|
|
8389
|
-
|
|
8589
|
+
DEFAULT_ASSET_URL2 = {
|
|
8390
8590
|
url: "https://almadar-kflow-assets.web.app/shared/isometric-dungeon/Isometric/chestClosed_E.png",
|
|
8391
8591
|
role: "ui",
|
|
8392
8592
|
category: "state"
|
|
@@ -8472,7 +8672,7 @@ var init_TimerDisplay = __esm({
|
|
|
8472
8672
|
}
|
|
8473
8673
|
});
|
|
8474
8674
|
function ResourceCounter({
|
|
8475
|
-
assetUrl =
|
|
8675
|
+
assetUrl = DEFAULT_ASSET_URL3,
|
|
8476
8676
|
icon,
|
|
8477
8677
|
label = "Gold",
|
|
8478
8678
|
value = 250,
|
|
@@ -8505,7 +8705,7 @@ function ResourceCounter({
|
|
|
8505
8705
|
}
|
|
8506
8706
|
);
|
|
8507
8707
|
}
|
|
8508
|
-
var colorTokenClasses2,
|
|
8708
|
+
var colorTokenClasses2, DEFAULT_ASSET_URL3, sizeMap6;
|
|
8509
8709
|
var init_ResourceCounter = __esm({
|
|
8510
8710
|
"components/game/2d/atoms/ResourceCounter.tsx"() {
|
|
8511
8711
|
init_cn();
|
|
@@ -8521,7 +8721,7 @@ var init_ResourceCounter = __esm({
|
|
|
8521
8721
|
error: "text-error",
|
|
8522
8722
|
muted: "text-muted-foreground"
|
|
8523
8723
|
};
|
|
8524
|
-
|
|
8724
|
+
DEFAULT_ASSET_URL3 = {
|
|
8525
8725
|
url: "https://almadar-kflow-assets.web.app/shared/world-map/gold_mine.png",
|
|
8526
8726
|
role: "ui",
|
|
8527
8727
|
category: "coin"
|
|
@@ -8535,7 +8735,7 @@ var init_ResourceCounter = __esm({
|
|
|
8535
8735
|
}
|
|
8536
8736
|
});
|
|
8537
8737
|
function ItemSlot({
|
|
8538
|
-
assetUrl =
|
|
8738
|
+
assetUrl = DEFAULT_ASSET_URL4,
|
|
8539
8739
|
icon = "sword",
|
|
8540
8740
|
label = "Iron Sword",
|
|
8541
8741
|
quantity,
|
|
@@ -8590,7 +8790,7 @@ function ItemSlot({
|
|
|
8590
8790
|
}
|
|
8591
8791
|
);
|
|
8592
8792
|
}
|
|
8593
|
-
var sizeMap7, rarityBorderMap, rarityGlowMap,
|
|
8793
|
+
var sizeMap7, rarityBorderMap, rarityGlowMap, DEFAULT_ASSET_URL4, assetSizeMap;
|
|
8594
8794
|
var init_ItemSlot = __esm({
|
|
8595
8795
|
"components/game/2d/atoms/ItemSlot.tsx"() {
|
|
8596
8796
|
"use client";
|
|
@@ -8620,7 +8820,7 @@ var init_ItemSlot = __esm({
|
|
|
8620
8820
|
epic: "shadow-lg",
|
|
8621
8821
|
legendary: "shadow-lg"
|
|
8622
8822
|
};
|
|
8623
|
-
|
|
8823
|
+
DEFAULT_ASSET_URL4 = {
|
|
8624
8824
|
url: "https://almadar-kflow-assets.web.app/shared/isometric-dungeon/Isometric/chestClosed_E.png",
|
|
8625
8825
|
role: "item",
|
|
8626
8826
|
category: "item"
|
|
@@ -8634,7 +8834,7 @@ var init_ItemSlot = __esm({
|
|
|
8634
8834
|
}
|
|
8635
8835
|
});
|
|
8636
8836
|
function TurnIndicator({
|
|
8637
|
-
assetUrl =
|
|
8837
|
+
assetUrl = DEFAULT_ASSET_URL5,
|
|
8638
8838
|
currentTurn = 1,
|
|
8639
8839
|
maxTurns,
|
|
8640
8840
|
activeTeam,
|
|
@@ -8674,7 +8874,7 @@ function TurnIndicator({
|
|
|
8674
8874
|
}
|
|
8675
8875
|
);
|
|
8676
8876
|
}
|
|
8677
|
-
var sizeMap8,
|
|
8877
|
+
var sizeMap8, DEFAULT_ASSET_URL5;
|
|
8678
8878
|
var init_TurnIndicator = __esm({
|
|
8679
8879
|
"components/game/2d/atoms/TurnIndicator.tsx"() {
|
|
8680
8880
|
init_cn();
|
|
@@ -8686,7 +8886,7 @@ var init_TurnIndicator = __esm({
|
|
|
8686
8886
|
md: { wrapper: "text-sm gap-2 px-3 py-1", dot: "w-2 h-2" },
|
|
8687
8887
|
lg: { wrapper: "text-base gap-2.5 px-4 py-1.5", dot: "w-2.5 h-2.5" }
|
|
8688
8888
|
};
|
|
8689
|
-
|
|
8889
|
+
DEFAULT_ASSET_URL5 = {
|
|
8690
8890
|
url: "https://almadar-kflow-assets.web.app/shared/effects/particles/symbol_01.png",
|
|
8691
8891
|
role: "ui",
|
|
8692
8892
|
category: "turn"
|
|
@@ -8706,7 +8906,7 @@ function getComboScale(combo) {
|
|
|
8706
8906
|
return "";
|
|
8707
8907
|
}
|
|
8708
8908
|
function ComboCounter({
|
|
8709
|
-
assetUrl =
|
|
8909
|
+
assetUrl = DEFAULT_ASSET_URL6,
|
|
8710
8910
|
combo = 5,
|
|
8711
8911
|
multiplier,
|
|
8712
8912
|
streak,
|
|
@@ -8741,14 +8941,14 @@ function ComboCounter({
|
|
|
8741
8941
|
}
|
|
8742
8942
|
);
|
|
8743
8943
|
}
|
|
8744
|
-
var
|
|
8944
|
+
var DEFAULT_ASSET_URL6, sizeMap9;
|
|
8745
8945
|
var init_ComboCounter = __esm({
|
|
8746
8946
|
"components/game/2d/atoms/ComboCounter.tsx"() {
|
|
8747
8947
|
init_cn();
|
|
8748
8948
|
init_Box();
|
|
8749
8949
|
init_Typography();
|
|
8750
8950
|
init_GameIcon();
|
|
8751
|
-
|
|
8951
|
+
DEFAULT_ASSET_URL6 = {
|
|
8752
8952
|
url: "https://almadar-kflow-assets.web.app/shared/effects/flash/flash00.png",
|
|
8753
8953
|
role: "effect",
|
|
8754
8954
|
category: "effect"
|
|
@@ -8762,7 +8962,7 @@ var init_ComboCounter = __esm({
|
|
|
8762
8962
|
}
|
|
8763
8963
|
});
|
|
8764
8964
|
function WaypointMarker({
|
|
8765
|
-
assetUrl =
|
|
8965
|
+
assetUrl = DEFAULT_ASSET_URL7,
|
|
8766
8966
|
label,
|
|
8767
8967
|
icon,
|
|
8768
8968
|
active = true,
|
|
@@ -8822,7 +9022,7 @@ function WaypointMarker({
|
|
|
8822
9022
|
)
|
|
8823
9023
|
] });
|
|
8824
9024
|
}
|
|
8825
|
-
var
|
|
9025
|
+
var DEFAULT_ASSET_URL7, sizeMap10, checkIcon;
|
|
8826
9026
|
var init_WaypointMarker = __esm({
|
|
8827
9027
|
"components/game/2d/atoms/WaypointMarker.tsx"() {
|
|
8828
9028
|
init_cn();
|
|
@@ -8830,7 +9030,7 @@ var init_WaypointMarker = __esm({
|
|
|
8830
9030
|
init_Box();
|
|
8831
9031
|
init_Typography();
|
|
8832
9032
|
init_GameIcon();
|
|
8833
|
-
|
|
9033
|
+
DEFAULT_ASSET_URL7 = {
|
|
8834
9034
|
url: "https://almadar-kflow-assets.web.app/shared/world-map/battle_marker.png",
|
|
8835
9035
|
role: "ui",
|
|
8836
9036
|
category: "waypoint"
|
|
@@ -8851,7 +9051,7 @@ function formatDuration(seconds) {
|
|
|
8851
9051
|
return `${Math.round(seconds)}s`;
|
|
8852
9052
|
}
|
|
8853
9053
|
function StatusEffect({
|
|
8854
|
-
assetUrl =
|
|
9054
|
+
assetUrl = DEFAULT_ASSET_URL8,
|
|
8855
9055
|
icon,
|
|
8856
9056
|
label = "Shield",
|
|
8857
9057
|
duration = 30,
|
|
@@ -8902,7 +9102,7 @@ function StatusEffect({
|
|
|
8902
9102
|
label && /* @__PURE__ */ jsx(Typography, { as: "span", className: "text-xs text-muted-foreground mt-0.5 text-center whitespace-nowrap", children: label })
|
|
8903
9103
|
] });
|
|
8904
9104
|
}
|
|
8905
|
-
var
|
|
9105
|
+
var DEFAULT_ASSET_URL8, sizeMap11, variantStyles7;
|
|
8906
9106
|
var init_StatusEffect = __esm({
|
|
8907
9107
|
"components/game/2d/atoms/StatusEffect.tsx"() {
|
|
8908
9108
|
init_cn();
|
|
@@ -8910,7 +9110,7 @@ var init_StatusEffect = __esm({
|
|
|
8910
9110
|
init_Box();
|
|
8911
9111
|
init_Typography();
|
|
8912
9112
|
init_GameIcon();
|
|
8913
|
-
|
|
9113
|
+
DEFAULT_ASSET_URL8 = {
|
|
8914
9114
|
url: "https://almadar-kflow-assets.web.app/shared/effects/particles/flame_01.png",
|
|
8915
9115
|
role: "ui",
|
|
8916
9116
|
category: "effect"
|
|
@@ -8929,7 +9129,7 @@ var init_StatusEffect = __esm({
|
|
|
8929
9129
|
}
|
|
8930
9130
|
});
|
|
8931
9131
|
function DamageNumber({
|
|
8932
|
-
assetUrl =
|
|
9132
|
+
assetUrl = DEFAULT_ASSET_URL9,
|
|
8933
9133
|
value = 42,
|
|
8934
9134
|
type = "damage",
|
|
8935
9135
|
size = "md",
|
|
@@ -8957,7 +9157,7 @@ function DamageNumber({
|
|
|
8957
9157
|
)
|
|
8958
9158
|
] });
|
|
8959
9159
|
}
|
|
8960
|
-
var sizeMap12, typeStyles, floatKeyframes,
|
|
9160
|
+
var sizeMap12, typeStyles, floatKeyframes, DEFAULT_ASSET_URL9;
|
|
8961
9161
|
var init_DamageNumber = __esm({
|
|
8962
9162
|
"components/game/2d/atoms/DamageNumber.tsx"() {
|
|
8963
9163
|
init_cn();
|
|
@@ -8981,7 +9181,7 @@ var init_DamageNumber = __esm({
|
|
|
8981
9181
|
100% { opacity: 0; transform: translateY(-32px) scale(0.8); }
|
|
8982
9182
|
}
|
|
8983
9183
|
`;
|
|
8984
|
-
|
|
9184
|
+
DEFAULT_ASSET_URL9 = {
|
|
8985
9185
|
url: "https://almadar-kflow-assets.web.app/shared/effects/particles/spark_01.png",
|
|
8986
9186
|
role: "effect",
|
|
8987
9187
|
category: "effect"
|
|
@@ -9107,7 +9307,7 @@ var init_ChoiceButton = __esm({
|
|
|
9107
9307
|
}
|
|
9108
9308
|
});
|
|
9109
9309
|
function ActionButton({
|
|
9110
|
-
assetUrl =
|
|
9310
|
+
assetUrl = DEFAULT_ASSET_URL10,
|
|
9111
9311
|
label = "Attack",
|
|
9112
9312
|
icon,
|
|
9113
9313
|
cooldown = 0,
|
|
@@ -9176,7 +9376,7 @@ function ActionButton({
|
|
|
9176
9376
|
}
|
|
9177
9377
|
);
|
|
9178
9378
|
}
|
|
9179
|
-
var sizeMap13, variantStyles8,
|
|
9379
|
+
var sizeMap13, variantStyles8, DEFAULT_ASSET_URL10;
|
|
9180
9380
|
var init_ActionButton = __esm({
|
|
9181
9381
|
"components/game/2d/atoms/ActionButton.tsx"() {
|
|
9182
9382
|
init_cn();
|
|
@@ -9196,7 +9396,7 @@ var init_ActionButton = __esm({
|
|
|
9196
9396
|
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary-hover border-border",
|
|
9197
9397
|
danger: "bg-error text-error-foreground hover:bg-error/90 border-error"
|
|
9198
9398
|
};
|
|
9199
|
-
|
|
9399
|
+
DEFAULT_ASSET_URL10 = {
|
|
9200
9400
|
url: "https://almadar-kflow-assets.web.app/shared/effects/particles/slash_01.png",
|
|
9201
9401
|
role: "ui",
|
|
9202
9402
|
category: "action"
|
|
@@ -9216,8 +9416,8 @@ function MiniMap({
|
|
|
9216
9416
|
tileAssets,
|
|
9217
9417
|
unitAssets
|
|
9218
9418
|
}) {
|
|
9219
|
-
const canvasRef =
|
|
9220
|
-
const imgCacheRef =
|
|
9419
|
+
const canvasRef = React96.useRef(null);
|
|
9420
|
+
const imgCacheRef = React96.useRef(/* @__PURE__ */ new Map());
|
|
9221
9421
|
function loadImg(url) {
|
|
9222
9422
|
const cached = imgCacheRef.current.get(url);
|
|
9223
9423
|
if (cached) return cached.complete ? cached : null;
|
|
@@ -9232,7 +9432,7 @@ function MiniMap({
|
|
|
9232
9432
|
imgCacheRef.current.set(url, img);
|
|
9233
9433
|
return null;
|
|
9234
9434
|
}
|
|
9235
|
-
|
|
9435
|
+
React96.useEffect(() => {
|
|
9236
9436
|
const canvas = canvasRef.current;
|
|
9237
9437
|
if (!canvas) return;
|
|
9238
9438
|
const ctx = canvas.getContext("2d");
|
|
@@ -9367,8 +9567,8 @@ function ControlGrid({
|
|
|
9367
9567
|
className
|
|
9368
9568
|
}) {
|
|
9369
9569
|
const eventBus = useEventBus();
|
|
9370
|
-
const [active, setActive] =
|
|
9371
|
-
const handlePress =
|
|
9570
|
+
const [active, setActive] = React96.useState(/* @__PURE__ */ new Set());
|
|
9571
|
+
const handlePress = React96.useCallback(
|
|
9372
9572
|
(id) => {
|
|
9373
9573
|
setActive((prev) => new Set(prev).add(id));
|
|
9374
9574
|
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
|
|
@@ -9382,7 +9582,7 @@ function ControlGrid({
|
|
|
9382
9582
|
},
|
|
9383
9583
|
[kind, actionEvent, directionEvent, directionEvents, eventBus, onAction, onDirection]
|
|
9384
9584
|
);
|
|
9385
|
-
const handleRelease =
|
|
9585
|
+
const handleRelease = React96.useCallback(
|
|
9386
9586
|
(id) => {
|
|
9387
9587
|
setActive((prev) => {
|
|
9388
9588
|
const next = new Set(prev);
|
|
@@ -9640,7 +9840,7 @@ function InventoryGrid({
|
|
|
9640
9840
|
const eventBus = useEventBus();
|
|
9641
9841
|
const slotCount = totalSlots ?? items.length;
|
|
9642
9842
|
const emptySlotCount = Math.max(0, slotCount - items.length);
|
|
9643
|
-
const handleSelect =
|
|
9843
|
+
const handleSelect = React96.useCallback(
|
|
9644
9844
|
(id) => {
|
|
9645
9845
|
onSelect?.(id);
|
|
9646
9846
|
if (selectEvent) {
|
|
@@ -9857,7 +10057,7 @@ function GameMenu({
|
|
|
9857
10057
|
}) {
|
|
9858
10058
|
const resolvedOptions = options ?? menuItems ?? DEFAULT_MENU_OPTIONS;
|
|
9859
10059
|
const eventBus = useEventBus();
|
|
9860
|
-
const handleOptionClick =
|
|
10060
|
+
const handleOptionClick = React96.useCallback(
|
|
9861
10061
|
(option) => {
|
|
9862
10062
|
if (option.event) {
|
|
9863
10063
|
eventBus.emit(`UI:${option.event}`, { option });
|
|
@@ -10083,7 +10283,7 @@ function StateGraph({
|
|
|
10083
10283
|
}) {
|
|
10084
10284
|
const eventBus = useEventBus();
|
|
10085
10285
|
const nodes = states ?? [];
|
|
10086
|
-
const positions =
|
|
10286
|
+
const positions = React96.useMemo(() => layoutStates(nodes, width, height), [nodes, width, height]);
|
|
10087
10287
|
return /* @__PURE__ */ jsxs(
|
|
10088
10288
|
Box,
|
|
10089
10289
|
{
|
|
@@ -10142,76 +10342,6 @@ var init_StateGraph = __esm({
|
|
|
10142
10342
|
init_TransitionArrow();
|
|
10143
10343
|
}
|
|
10144
10344
|
});
|
|
10145
|
-
|
|
10146
|
-
// components/game/shared/atlasSlice.ts
|
|
10147
|
-
function isTilesheet(a) {
|
|
10148
|
-
return typeof a.tileWidth === "number";
|
|
10149
|
-
}
|
|
10150
|
-
function getAtlas(url, onReady) {
|
|
10151
|
-
if (atlasCache.has(url)) return atlasCache.get(url) ?? void 0;
|
|
10152
|
-
atlasCache.set(url, void 0);
|
|
10153
|
-
fetch(url).then((r) => r.json()).then((json) => {
|
|
10154
|
-
atlasCache.set(url, json);
|
|
10155
|
-
onReady();
|
|
10156
|
-
}).catch(() => {
|
|
10157
|
-
atlasCache.set(url, null);
|
|
10158
|
-
});
|
|
10159
|
-
return void 0;
|
|
10160
|
-
}
|
|
10161
|
-
function subRectFor(atlas, sprite) {
|
|
10162
|
-
if (isTilesheet(atlas)) {
|
|
10163
|
-
let col;
|
|
10164
|
-
let row;
|
|
10165
|
-
if (sprite.includes(",")) {
|
|
10166
|
-
const [c, r] = sprite.split(",").map((n) => Number(n.trim()));
|
|
10167
|
-
col = c;
|
|
10168
|
-
row = r;
|
|
10169
|
-
} else {
|
|
10170
|
-
const i = Number(sprite);
|
|
10171
|
-
if (!Number.isFinite(i)) return null;
|
|
10172
|
-
col = i % atlas.columns;
|
|
10173
|
-
row = Math.floor(i / atlas.columns);
|
|
10174
|
-
}
|
|
10175
|
-
if (!Number.isFinite(col) || !Number.isFinite(row) || col < 0 || row < 0 || col >= atlas.columns || row >= atlas.rows) return null;
|
|
10176
|
-
const margin = atlas.margin ?? 0;
|
|
10177
|
-
const spacing = atlas.spacing ?? 0;
|
|
10178
|
-
return {
|
|
10179
|
-
sx: margin + col * (atlas.tileWidth + spacing),
|
|
10180
|
-
sy: margin + row * (atlas.tileHeight + spacing),
|
|
10181
|
-
sw: atlas.tileWidth,
|
|
10182
|
-
sh: atlas.tileHeight
|
|
10183
|
-
};
|
|
10184
|
-
}
|
|
10185
|
-
const st = atlas.subTextures[sprite];
|
|
10186
|
-
if (!st) return null;
|
|
10187
|
-
return { sx: st.x, sy: st.y, sw: st.width, sh: st.height };
|
|
10188
|
-
}
|
|
10189
|
-
function isAtlasAsset(asset) {
|
|
10190
|
-
return !!asset && typeof asset.atlas === "string" && typeof asset.sprite === "string";
|
|
10191
|
-
}
|
|
10192
|
-
function resolveAssetSource(img, asset, onReady) {
|
|
10193
|
-
if (isAtlasAsset(asset)) {
|
|
10194
|
-
const atlas = getAtlas(asset.atlas, onReady);
|
|
10195
|
-
if (!atlas) return null;
|
|
10196
|
-
const rect = subRectFor(atlas, asset.sprite);
|
|
10197
|
-
if (!rect) return null;
|
|
10198
|
-
return { img, rect, aspect: rect.sw / rect.sh };
|
|
10199
|
-
}
|
|
10200
|
-
const natW = img.naturalWidth || 1;
|
|
10201
|
-
const natH = img.naturalHeight || 1;
|
|
10202
|
-
return { img, rect: null, aspect: natW / natH };
|
|
10203
|
-
}
|
|
10204
|
-
function blit(ctx, src, dx, dy, dw, dh) {
|
|
10205
|
-
if (src.rect) ctx.drawImage(src.img, src.rect.sx, src.rect.sy, src.rect.sw, src.rect.sh, dx, dy, dw, dh);
|
|
10206
|
-
else ctx.drawImage(src.img, dx, dy, dw, dh);
|
|
10207
|
-
}
|
|
10208
|
-
var atlasCache;
|
|
10209
|
-
var init_atlasSlice = __esm({
|
|
10210
|
-
"components/game/shared/atlasSlice.ts"() {
|
|
10211
|
-
"use client";
|
|
10212
|
-
atlasCache = /* @__PURE__ */ new Map();
|
|
10213
|
-
}
|
|
10214
|
-
});
|
|
10215
10345
|
function useCamera() {
|
|
10216
10346
|
const cameraRef = useRef({ x: 0, y: 0, zoom: 1 });
|
|
10217
10347
|
const targetCameraRef = useRef(null);
|
|
@@ -10440,11 +10570,11 @@ function SideView({
|
|
|
10440
10570
|
const canvasRef = useRef(null);
|
|
10441
10571
|
const eventBus = useEventBus();
|
|
10442
10572
|
const keysRef = useRef(/* @__PURE__ */ new Set());
|
|
10443
|
-
const
|
|
10573
|
+
const imageCache2 = useRef(/* @__PURE__ */ new Map());
|
|
10444
10574
|
const [loadedImages, setLoadedImages] = useState(/* @__PURE__ */ new Set());
|
|
10445
10575
|
const loadImage = useCallback((url) => {
|
|
10446
10576
|
if (!url) return null;
|
|
10447
|
-
const cached =
|
|
10577
|
+
const cached = imageCache2.current.get(url);
|
|
10448
10578
|
if (cached?.complete && cached.naturalWidth > 0) {
|
|
10449
10579
|
if (!loadedImages.has(url)) setLoadedImages((prev) => new Set(prev).add(url));
|
|
10450
10580
|
return cached;
|
|
@@ -10454,7 +10584,7 @@ function SideView({
|
|
|
10454
10584
|
img.crossOrigin = "anonymous";
|
|
10455
10585
|
img.src = url;
|
|
10456
10586
|
img.onload = () => setLoadedImages((prev) => new Set(prev).add(url));
|
|
10457
|
-
|
|
10587
|
+
imageCache2.current.set(url, img);
|
|
10458
10588
|
}
|
|
10459
10589
|
return null;
|
|
10460
10590
|
}, [loadedImages]);
|
|
@@ -10571,7 +10701,10 @@ function SideView({
|
|
|
10571
10701
|
camY = Math.max(0, Math.min(py - ch / 2 - 50, wh - ch));
|
|
10572
10702
|
}
|
|
10573
10703
|
const bgImage = bgImg ? loadImage(bgImg.url) : null;
|
|
10574
|
-
|
|
10704
|
+
const bgSrc = bgImage ? resolveAssetSource(bgImage, bgImg, NOOP) : null;
|
|
10705
|
+
if (bgSrc) {
|
|
10706
|
+
blit(ctx, bgSrc, 0, 0, cw, ch);
|
|
10707
|
+
} else if (bgImage) {
|
|
10575
10708
|
ctx.drawImage(bgImage, 0, 0, cw, ch);
|
|
10576
10709
|
} else if (bg) {
|
|
10577
10710
|
ctx.fillStyle = bg;
|
|
@@ -10769,6 +10902,7 @@ function Canvas2D({
|
|
|
10769
10902
|
const isSide = projection === "side";
|
|
10770
10903
|
const isFree = projection === "free";
|
|
10771
10904
|
const flatLike = projection === "hex" || projection === "flat" || isFree;
|
|
10905
|
+
const squareGrid = projection === "flat";
|
|
10772
10906
|
const tilesProp = Array.isArray(_tilesPropRaw) ? _tilesPropRaw : [];
|
|
10773
10907
|
const unitsProp = Array.isArray(_unitsPropRaw) ? _unitsPropRaw : [];
|
|
10774
10908
|
const featuresProp = Array.isArray(_featuresPropRaw) ? _featuresPropRaw : [];
|
|
@@ -10851,9 +10985,9 @@ function Canvas2D({
|
|
|
10851
10985
|
const effectiveDiamondTopY = diamondTopYProp ?? DIAMOND_TOP_Y;
|
|
10852
10986
|
const scaledDiamondTopY = effectiveDiamondTopY * scale;
|
|
10853
10987
|
const baseOffsetX = useMemo(() => {
|
|
10854
|
-
if (isFree) return 0;
|
|
10988
|
+
if (isFree || projection === "flat") return 0;
|
|
10855
10989
|
return (gridHeight - 1) * (scaledTileWidth / 2);
|
|
10856
|
-
}, [isFree, gridHeight, scaledTileWidth]);
|
|
10990
|
+
}, [isFree, projection, gridHeight, scaledTileWidth]);
|
|
10857
10991
|
const validMoveSet = useMemo(() => new Set(validMoves.map((p) => `${p.x},${p.y}`)), [validMoves]);
|
|
10858
10992
|
const attackTargetSet = useMemo(() => new Set(attackTargets.map((p) => `${p.x},${p.y}`)), [attackTargets]);
|
|
10859
10993
|
const spriteUrls = useMemo(() => {
|
|
@@ -10974,7 +11108,13 @@ function Canvas2D({
|
|
|
10974
11108
|
ctx.clearRect(0, 0, viewportSize.width, viewportSize.height);
|
|
10975
11109
|
if (backgroundImage) {
|
|
10976
11110
|
const bgImg = getImage(backgroundImage.url);
|
|
10977
|
-
|
|
11111
|
+
const bgSrc = bgImg ? resolveAssetSource(bgImg, backgroundImage, bumpAtlas) : null;
|
|
11112
|
+
if (bgSrc?.rect) {
|
|
11113
|
+
const k = Math.max(viewportSize.width / bgSrc.rect.sw, viewportSize.height / bgSrc.rect.sh);
|
|
11114
|
+
const dw = bgSrc.rect.sw * k;
|
|
11115
|
+
const dh = bgSrc.rect.sh * k;
|
|
11116
|
+
blit(ctx, bgSrc, (viewportSize.width - dw) / 2, (viewportSize.height - dh) / 2, dw, dh);
|
|
11117
|
+
} else if (bgImg) {
|
|
10978
11118
|
const cam2 = cameraRef.current;
|
|
10979
11119
|
const patW = bgImg.naturalWidth;
|
|
10980
11120
|
const patH = bgImg.naturalHeight;
|
|
@@ -11010,12 +11150,18 @@ function Canvas2D({
|
|
|
11010
11150
|
const src = img ? resolveAssetSource(img, terrainAsset, bumpAtlas) : null;
|
|
11011
11151
|
if (src) {
|
|
11012
11152
|
const drawW = scaledTileWidth;
|
|
11013
|
-
const drawH = scaledTileWidth / src.aspect;
|
|
11153
|
+
const drawH = squareGrid ? scaledTileWidth : scaledTileWidth / src.aspect;
|
|
11014
11154
|
const drawX = pos.x;
|
|
11015
11155
|
const drawY = flatLike ? pos.y : pos.y + scaledTileHeight - drawH;
|
|
11016
11156
|
blit(ctx, src, drawX, drawY, drawW, drawH);
|
|
11017
11157
|
} else if (img && img.naturalWidth === 0) {
|
|
11018
11158
|
ctx.drawImage(img, pos.x, pos.y, scaledTileWidth, scaledTileHeight);
|
|
11159
|
+
} else if (squareGrid) {
|
|
11160
|
+
ctx.fillStyle = tile.terrain === "water" ? "#3b82f6" : tile.terrain === "mountain" ? "#78716c" : tile.terrain === "stone" ? "#9ca3af" : "#4ade80";
|
|
11161
|
+
ctx.fillRect(pos.x, pos.y, scaledTileWidth, scaledTileWidth);
|
|
11162
|
+
ctx.strokeStyle = "rgba(0,0,0,0.2)";
|
|
11163
|
+
ctx.lineWidth = 1;
|
|
11164
|
+
ctx.strokeRect(pos.x, pos.y, scaledTileWidth, scaledTileWidth);
|
|
11019
11165
|
} else {
|
|
11020
11166
|
const centerX = pos.x + scaledTileWidth / 2;
|
|
11021
11167
|
const topY = pos.y + scaledDiamondTopY;
|
|
@@ -11032,9 +11178,13 @@ function Canvas2D({
|
|
|
11032
11178
|
ctx.stroke();
|
|
11033
11179
|
}
|
|
11034
11180
|
const drawHighlight = (color) => {
|
|
11181
|
+
ctx.fillStyle = color;
|
|
11182
|
+
if (squareGrid) {
|
|
11183
|
+
ctx.fillRect(pos.x, pos.y, scaledTileWidth, scaledTileWidth);
|
|
11184
|
+
return;
|
|
11185
|
+
}
|
|
11035
11186
|
const centerX = pos.x + scaledTileWidth / 2;
|
|
11036
11187
|
const topY = pos.y + scaledDiamondTopY;
|
|
11037
|
-
ctx.fillStyle = color;
|
|
11038
11188
|
ctx.beginPath();
|
|
11039
11189
|
ctx.moveTo(centerX, topY);
|
|
11040
11190
|
ctx.lineTo(pos.x + scaledTileWidth, topY + scaledFloorHeight / 2);
|
|
@@ -11051,7 +11201,7 @@ function Canvas2D({
|
|
|
11051
11201
|
if (attackTargetSet.has(tileKey)) drawHighlight("rgba(239, 68, 68, 0.35)");
|
|
11052
11202
|
if (debug2) {
|
|
11053
11203
|
const centerX = pos.x + scaledTileWidth / 2;
|
|
11054
|
-
const centerY = pos.y + scaledFloorHeight / 2 + scaledDiamondTopY;
|
|
11204
|
+
const centerY = squareGrid ? pos.y + scaledTileWidth / 2 : pos.y + scaledFloorHeight / 2 + scaledDiamondTopY;
|
|
11055
11205
|
ctx.fillStyle = "rgba(0, 0, 0, 0.7)";
|
|
11056
11206
|
ctx.font = `${12 * scale * 2}px monospace`;
|
|
11057
11207
|
ctx.textAlign = "center";
|
|
@@ -11073,9 +11223,9 @@ function Canvas2D({
|
|
|
11073
11223
|
const img = featureAsset?.url ? getImage(featureAsset.url) : null;
|
|
11074
11224
|
const src = img ? resolveAssetSource(img, featureAsset, bumpAtlas) : null;
|
|
11075
11225
|
const centerX = pos.x + scaledTileWidth / 2;
|
|
11076
|
-
const featureGroundY = pos.y + scaledDiamondTopY + scaledFloorHeight * 0.5;
|
|
11226
|
+
const featureGroundY = squareGrid ? pos.y + scaledTileWidth * 0.92 : pos.y + scaledDiamondTopY + scaledFloorHeight * 0.5;
|
|
11077
11227
|
const isCastle = feature.type === "castle";
|
|
11078
|
-
const featureDrawH = isCastle ? scaledFloorHeight * 3.5 : scaledFloorHeight * 1.6;
|
|
11228
|
+
const featureDrawH = squareGrid ? isCastle ? scaledTileWidth * 1.4 : scaledTileWidth * 0.8 : isCastle ? scaledFloorHeight * 3.5 : scaledFloorHeight * 1.6;
|
|
11079
11229
|
const maxFeatureW = isCastle ? scaledTileWidth * 1.8 : scaledTileWidth * 0.7;
|
|
11080
11230
|
if (src) {
|
|
11081
11231
|
const ar = src.aspect;
|
|
@@ -11114,11 +11264,11 @@ function Canvas2D({
|
|
|
11114
11264
|
}
|
|
11115
11265
|
const isSelected = unit.id === selectedUnitId;
|
|
11116
11266
|
const centerX = pos.x + scaledTileWidth / 2;
|
|
11117
|
-
const groundY = pos.y + scaledDiamondTopY + scaledFloorHeight * 0.5;
|
|
11267
|
+
const groundY = squareGrid ? pos.y + scaledTileWidth * 0.92 : pos.y + scaledDiamondTopY + scaledFloorHeight * 0.5;
|
|
11118
11268
|
const breatheOffset = 0;
|
|
11119
11269
|
const unitAsset = resolveUnitAsset(unit);
|
|
11120
11270
|
const img = unitAsset?.url ? getImage(unitAsset.url) : null;
|
|
11121
|
-
const unitDrawH = scaledFloorHeight * spriteHeightRatio * unitScale;
|
|
11271
|
+
const unitDrawH = squareGrid ? scaledTileWidth * 0.55 * spriteHeightRatio * unitScale : scaledFloorHeight * spriteHeightRatio * unitScale;
|
|
11122
11272
|
const maxUnitW = scaledTileWidth * spriteMaxWidthRatio * unitScale;
|
|
11123
11273
|
const unitIsSheet = unit.spriteSheet?.url !== void 0;
|
|
11124
11274
|
const unitSrc = img && !unitIsSheet ? resolveAssetSource(img, unitAsset, bumpAtlas) : null;
|
|
@@ -11137,7 +11287,7 @@ function Canvas2D({
|
|
|
11137
11287
|
if (unit.previousPosition && (unit.previousPosition.x !== unit.position.x || unit.previousPosition.y !== unit.position.y)) {
|
|
11138
11288
|
const ghostPos = project(unit.previousPosition.x, unit.previousPosition.y, baseOffsetX);
|
|
11139
11289
|
const ghostCenterX = ghostPos.x + scaledTileWidth / 2;
|
|
11140
|
-
const ghostGroundY = ghostPos.y + scaledDiamondTopY + scaledFloorHeight * 0.5;
|
|
11290
|
+
const ghostGroundY = squareGrid ? ghostPos.y + scaledTileWidth * 0.92 : ghostPos.y + scaledDiamondTopY + scaledFloorHeight * 0.5;
|
|
11141
11291
|
ctx.save();
|
|
11142
11292
|
ctx.globalAlpha = 0.25;
|
|
11143
11293
|
if (img) {
|
|
@@ -11220,17 +11370,24 @@ function Canvas2D({
|
|
|
11220
11370
|
}
|
|
11221
11371
|
}
|
|
11222
11372
|
for (const fx of effects) {
|
|
11223
|
-
const
|
|
11224
|
-
if (!
|
|
11225
|
-
const img = getImage(
|
|
11373
|
+
const fxAsset = assetManifest?.effects?.[fx.key];
|
|
11374
|
+
if (!fxAsset?.url) continue;
|
|
11375
|
+
const img = getImage(fxAsset.url);
|
|
11226
11376
|
if (!img) continue;
|
|
11377
|
+
const src = resolveAssetSource(img, fxAsset, bumpAtlas);
|
|
11227
11378
|
const pos = project(fx.x, fx.y, baseOffsetX);
|
|
11228
11379
|
const cx = pos.x + scaledTileWidth / 2;
|
|
11229
|
-
const cy = pos.y + scaledDiamondTopY + scaledFloorHeight * 0.5;
|
|
11380
|
+
const cy = squareGrid ? pos.y + scaledTileWidth / 2 : pos.y + scaledDiamondTopY + scaledFloorHeight * 0.5;
|
|
11230
11381
|
const alpha = Math.min(1, fx.ttl / 4);
|
|
11231
11382
|
const prev = ctx.globalAlpha;
|
|
11232
11383
|
ctx.globalAlpha = alpha;
|
|
11233
|
-
|
|
11384
|
+
if (src?.rect) {
|
|
11385
|
+
const dw = scaledTileWidth;
|
|
11386
|
+
const dh = dw / src.aspect;
|
|
11387
|
+
blit(ctx, src, cx - dw / 2, cy - dh / 2, dw, dh);
|
|
11388
|
+
} else {
|
|
11389
|
+
ctx.drawImage(img, cx - img.naturalWidth / 2, cy - img.naturalHeight / 2);
|
|
11390
|
+
}
|
|
11234
11391
|
ctx.globalAlpha = prev;
|
|
11235
11392
|
}
|
|
11236
11393
|
onDrawEffects?.(ctx, 0, getImage);
|
|
@@ -11243,6 +11400,7 @@ function Canvas2D({
|
|
|
11243
11400
|
effects,
|
|
11244
11401
|
project,
|
|
11245
11402
|
flatLike,
|
|
11403
|
+
squareGrid,
|
|
11246
11404
|
scale,
|
|
11247
11405
|
debug2,
|
|
11248
11406
|
resolveTerrainAsset,
|
|
@@ -11276,12 +11434,12 @@ function Canvas2D({
|
|
|
11276
11434
|
if (!unit?.position) return;
|
|
11277
11435
|
const pos = project(unit.position.x, unit.position.y, baseOffsetX);
|
|
11278
11436
|
const centerX = pos.x + scaledTileWidth / 2;
|
|
11279
|
-
const centerY = pos.y + scaledDiamondTopY + scaledFloorHeight / 2;
|
|
11437
|
+
const centerY = squareGrid ? pos.y + scaledTileWidth / 2 : pos.y + scaledDiamondTopY + scaledFloorHeight / 2;
|
|
11280
11438
|
targetCameraRef.current = {
|
|
11281
11439
|
x: centerX - viewportSize.width / 2,
|
|
11282
11440
|
y: centerY - viewportSize.height / 2
|
|
11283
11441
|
};
|
|
11284
|
-
}, [camera, selectedUnitId, units, project, baseOffsetX, scaledTileWidth, scaledDiamondTopY, scaledFloorHeight, viewportSize, targetCameraRef]);
|
|
11442
|
+
}, [camera, selectedUnitId, units, project, baseOffsetX, scaledTileWidth, squareGrid, scaledDiamondTopY, scaledFloorHeight, viewportSize, targetCameraRef]);
|
|
11285
11443
|
useEffect(() => {
|
|
11286
11444
|
if (isSide || !interpolateUnits) return;
|
|
11287
11445
|
unitInterp.onSnapshot(
|
|
@@ -11352,11 +11510,11 @@ function Canvas2D({
|
|
|
11352
11510
|
if (!tileHoverEvent || !canvasRef.current) return;
|
|
11353
11511
|
const world = screenToWorld(e.clientX, e.clientY, canvasRef.current, viewportSize);
|
|
11354
11512
|
const adjustedX = world.x - scaledTileWidth / 2;
|
|
11355
|
-
const adjustedY = world.y - scaledDiamondTopY - scaledFloorHeight / 2;
|
|
11513
|
+
const adjustedY = squareGrid ? world.y - scaledTileWidth / 2 : world.y - scaledDiamondTopY - scaledFloorHeight / 2;
|
|
11356
11514
|
const isoPos = unproject(adjustedX, adjustedY, baseOffsetX);
|
|
11357
11515
|
const tileExists = tilesProp.some((t2) => t2.x === isoPos.x && t2.y === isoPos.y);
|
|
11358
11516
|
if (tileExists) eventBus.emit(`UI:${tileHoverEvent}`, { x: isoPos.x, y: isoPos.y });
|
|
11359
|
-
}, [screenToWorld, viewportSize, scaledTileWidth, scaledDiamondTopY, scaledFloorHeight, unproject, baseOffsetX, tilesProp, tileHoverEvent, eventBus]);
|
|
11517
|
+
}, [screenToWorld, viewportSize, scaledTileWidth, squareGrid, scaledDiamondTopY, scaledFloorHeight, unproject, baseOffsetX, tilesProp, tileHoverEvent, eventBus]);
|
|
11360
11518
|
const handleCanvasPointerUp = useCallback((e) => {
|
|
11361
11519
|
singlePointerActiveRef.current = false;
|
|
11362
11520
|
if (enableCamera) handlePointerUp();
|
|
@@ -11364,7 +11522,7 @@ function Canvas2D({
|
|
|
11364
11522
|
if (!canvasRef.current) return;
|
|
11365
11523
|
const world = screenToWorld(e.clientX, e.clientY, canvasRef.current, viewportSize);
|
|
11366
11524
|
const adjustedX = world.x - scaledTileWidth / 2;
|
|
11367
|
-
const adjustedY = world.y - scaledDiamondTopY - scaledFloorHeight / 2;
|
|
11525
|
+
const adjustedY = squareGrid ? world.y - scaledTileWidth / 2 : world.y - scaledDiamondTopY - scaledFloorHeight / 2;
|
|
11368
11526
|
const isoPos = unproject(adjustedX, adjustedY, baseOffsetX);
|
|
11369
11527
|
const clickedUnit = units.find((u) => u.position?.x === isoPos.x && u.position?.y === isoPos.y);
|
|
11370
11528
|
if (clickedUnit && unitClickEvent) {
|
|
@@ -11373,7 +11531,7 @@ function Canvas2D({
|
|
|
11373
11531
|
const tileExists = tilesProp.some((t2) => t2.x === isoPos.x && t2.y === isoPos.y);
|
|
11374
11532
|
if (tileExists) eventBus.emit(`UI:${tileClickEvent}`, { x: isoPos.x, y: isoPos.y });
|
|
11375
11533
|
}
|
|
11376
|
-
}, [enableCamera, handlePointerUp, dragDistance, screenToWorld, viewportSize, scaledTileWidth, scaledDiamondTopY, scaledFloorHeight, unproject, baseOffsetX, units, tilesProp, unitClickEvent, tileClickEvent, eventBus]);
|
|
11534
|
+
}, [enableCamera, handlePointerUp, dragDistance, screenToWorld, viewportSize, scaledTileWidth, squareGrid, scaledDiamondTopY, scaledFloorHeight, unproject, baseOffsetX, units, tilesProp, unitClickEvent, tileClickEvent, eventBus]);
|
|
11377
11535
|
const handleCanvasPointerLeave = useCallback(() => {
|
|
11378
11536
|
handleMouseLeave();
|
|
11379
11537
|
if (tileLeaveEvent) eventBus.emit(`UI:${tileLeaveEvent}`, {});
|
|
@@ -11423,11 +11581,12 @@ function Canvas2D({
|
|
|
11423
11581
|
return units.filter((u) => !!u.position).map((u) => {
|
|
11424
11582
|
const pos = project(u.position.x, u.position.y, baseOffsetX);
|
|
11425
11583
|
const cam = cameraRef.current;
|
|
11584
|
+
const anchorY = squareGrid ? pos.y + scaledTileWidth * 0.92 : pos.y + scaledDiamondTopY + scaledFloorHeight * 0.5;
|
|
11426
11585
|
const screenX = (pos.x + scaledTileWidth / 2 - (cam.x + viewportSize.width / 2)) * cam.zoom + viewportSize.width / 2;
|
|
11427
|
-
const screenY = (
|
|
11586
|
+
const screenY = (anchorY - (cam.y + viewportSize.height / 2)) * cam.zoom + viewportSize.height / 2;
|
|
11428
11587
|
return { unit: u, screenX, screenY };
|
|
11429
11588
|
});
|
|
11430
|
-
}, [units, project, baseOffsetX, scaledTileWidth, scaledDiamondTopY, scaledFloorHeight, viewportSize, cameraRef]);
|
|
11589
|
+
}, [units, project, baseOffsetX, scaledTileWidth, squareGrid, scaledDiamondTopY, scaledFloorHeight, viewportSize, cameraRef]);
|
|
11431
11590
|
if (error) {
|
|
11432
11591
|
return /* @__PURE__ */ jsx(Box, { className: cn("flex items-center justify-center w-full h-full bg-[var(--color-card)] rounded-container", className), children: /* @__PURE__ */ jsxs(Stack, { direction: "vertical", gap: "md", align: "center", children: [
|
|
11433
11592
|
/* @__PURE__ */ jsx(Icon, { name: "alert-circle", size: "xl" }),
|
|
@@ -11673,7 +11832,7 @@ function LinearView({
|
|
|
11673
11832
|
/* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
|
|
11674
11833
|
const isDone = i < currentIdx;
|
|
11675
11834
|
const isCurrent = i === currentIdx;
|
|
11676
|
-
return /* @__PURE__ */ jsxs(
|
|
11835
|
+
return /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
|
|
11677
11836
|
i > 0 && /* @__PURE__ */ jsx(
|
|
11678
11837
|
Typography,
|
|
11679
11838
|
{
|
|
@@ -12208,7 +12367,7 @@ function SequenceBar({
|
|
|
12208
12367
|
else onSlotRemove?.(index);
|
|
12209
12368
|
}, [emit, slotRemoveEvent, onSlotRemove, playing]);
|
|
12210
12369
|
const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
|
|
12211
|
-
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(
|
|
12370
|
+
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
|
|
12212
12371
|
i > 0 && /* @__PURE__ */ jsx(
|
|
12213
12372
|
Typography,
|
|
12214
12373
|
{
|
|
@@ -14365,82 +14524,167 @@ var init_GameTemplate = __esm({
|
|
|
14365
14524
|
GameTemplate.displayName = "GameTemplate";
|
|
14366
14525
|
}
|
|
14367
14526
|
});
|
|
14368
|
-
var GameShell;
|
|
14527
|
+
var FONT_BASE, GAME_FONTS, FONT_FACES, GameShell;
|
|
14369
14528
|
var init_GameShell = __esm({
|
|
14370
14529
|
"components/game/2d/templates/GameShell.tsx"() {
|
|
14371
14530
|
init_cn();
|
|
14372
14531
|
init_Box();
|
|
14373
|
-
init_Stack();
|
|
14374
14532
|
init_Typography();
|
|
14533
|
+
init_AtlasImage();
|
|
14534
|
+
FONT_BASE = "https://almadar-kflow-assets.web.app/shared/_shared/kenney-fonts/fonts";
|
|
14535
|
+
GAME_FONTS = {
|
|
14536
|
+
future: "Kenney Future",
|
|
14537
|
+
"future-narrow": "Kenney Future Narrow",
|
|
14538
|
+
pixel: "Kenney Pixel",
|
|
14539
|
+
blocks: "Kenney Blocks",
|
|
14540
|
+
mini: "Kenney Mini"
|
|
14541
|
+
};
|
|
14542
|
+
FONT_FACES = `
|
|
14543
|
+
@font-face { font-family: 'Kenney Future'; src: url('${FONT_BASE}/Kenney%20Future.ttf') format('truetype'); font-display: swap; }
|
|
14544
|
+
@font-face { font-family: 'Kenney Future Narrow'; src: url('${FONT_BASE}/Kenney%20Future%20Narrow.ttf') format('truetype'); font-display: swap; }
|
|
14545
|
+
@font-face { font-family: 'Kenney Pixel'; src: url('${FONT_BASE}/Kenney%20Pixel.ttf') format('truetype'); font-display: swap; }
|
|
14546
|
+
@font-face { font-family: 'Kenney Blocks'; src: url('${FONT_BASE}/Kenney%20Blocks.ttf') format('truetype'); font-display: swap; }
|
|
14547
|
+
@font-face { font-family: 'Kenney Mini'; src: url('${FONT_BASE}/Kenney%20Mini.ttf') format('truetype'); font-display: swap; }
|
|
14548
|
+
.game-shell, .game-shell * { font-family: inherit; }
|
|
14549
|
+
`;
|
|
14375
14550
|
GameShell = ({
|
|
14376
14551
|
appName = "Game",
|
|
14377
14552
|
hud,
|
|
14553
|
+
addons,
|
|
14554
|
+
controls,
|
|
14555
|
+
overlay,
|
|
14378
14556
|
className,
|
|
14379
14557
|
showTopBar = true,
|
|
14380
14558
|
children,
|
|
14381
14559
|
backgroundAsset,
|
|
14382
|
-
hudBackgroundAsset
|
|
14560
|
+
hudBackgroundAsset,
|
|
14561
|
+
fontFamily = "future"
|
|
14383
14562
|
}) => {
|
|
14563
|
+
const font = GAME_FONTS[fontFamily] ?? fontFamily;
|
|
14384
14564
|
return /* @__PURE__ */ jsxs(
|
|
14385
14565
|
Box,
|
|
14386
14566
|
{
|
|
14387
|
-
|
|
14388
|
-
className: cn(
|
|
14389
|
-
"game-shell",
|
|
14390
|
-
"flex-col w-full h-screen overflow-hidden",
|
|
14391
|
-
className
|
|
14392
|
-
),
|
|
14567
|
+
className: cn("game-shell", className),
|
|
14393
14568
|
style: {
|
|
14569
|
+
position: "relative",
|
|
14394
14570
|
width: "100vw",
|
|
14395
14571
|
height: "100vh",
|
|
14396
14572
|
overflow: "hidden",
|
|
14397
|
-
background:
|
|
14398
|
-
color: "var(--color-text, #e0e0e0)"
|
|
14573
|
+
background: "var(--color-background, #0a0a0f)",
|
|
14574
|
+
color: "var(--color-text, #e0e0e0)",
|
|
14575
|
+
fontFamily: `'${font}', system-ui, sans-serif`
|
|
14399
14576
|
},
|
|
14400
14577
|
children: [
|
|
14401
|
-
|
|
14578
|
+
/* @__PURE__ */ jsx("style", { children: FONT_FACES }),
|
|
14579
|
+
backgroundAsset && /* @__PURE__ */ jsx(
|
|
14580
|
+
AtlasPanel,
|
|
14581
|
+
{
|
|
14582
|
+
asset: backgroundAsset,
|
|
14583
|
+
mode: "repeat",
|
|
14584
|
+
"aria-hidden": true,
|
|
14585
|
+
className: "game-shell__bg",
|
|
14586
|
+
style: { position: "absolute", inset: 0, opacity: 0.18, zIndex: 0, display: "block" }
|
|
14587
|
+
}
|
|
14588
|
+
),
|
|
14589
|
+
/* @__PURE__ */ jsx(Box, { className: "game-shell__content", style: { position: "absolute", inset: 0, zIndex: 1 }, children }),
|
|
14590
|
+
(showTopBar || hud) && /* @__PURE__ */ jsxs(
|
|
14402
14591
|
Box,
|
|
14403
14592
|
{
|
|
14404
|
-
className: "game-
|
|
14593
|
+
className: "game-shell__top pointer-events-none",
|
|
14405
14594
|
style: {
|
|
14406
|
-
|
|
14407
|
-
|
|
14408
|
-
|
|
14595
|
+
position: "absolute",
|
|
14596
|
+
top: 12,
|
|
14597
|
+
left: 12,
|
|
14598
|
+
right: 12,
|
|
14599
|
+
zIndex: 2,
|
|
14600
|
+
display: "flex",
|
|
14601
|
+
alignItems: "flex-start",
|
|
14602
|
+
gap: 12
|
|
14409
14603
|
},
|
|
14410
14604
|
children: [
|
|
14411
|
-
/* @__PURE__ */ jsx(
|
|
14412
|
-
|
|
14605
|
+
showTopBar && /* @__PURE__ */ jsx(
|
|
14606
|
+
AtlasPanel,
|
|
14413
14607
|
{
|
|
14414
|
-
|
|
14415
|
-
|
|
14416
|
-
|
|
14608
|
+
asset: hudBackgroundAsset,
|
|
14609
|
+
borderSlice: 12,
|
|
14610
|
+
borderWidth: 10,
|
|
14611
|
+
className: "game-shell__title pointer-events-auto",
|
|
14612
|
+
style: {
|
|
14613
|
+
padding: "6px 16px",
|
|
14614
|
+
background: hudBackgroundAsset ? void 0 : "rgba(18, 18, 31, 0.85)",
|
|
14615
|
+
borderRadius: hudBackgroundAsset ? void 0 : 10,
|
|
14616
|
+
boxShadow: "0 4px 14px rgba(0,0,0,0.45)",
|
|
14617
|
+
flexShrink: 0
|
|
14618
|
+
},
|
|
14417
14619
|
children: /* @__PURE__ */ jsx(
|
|
14418
14620
|
Typography,
|
|
14419
14621
|
{
|
|
14420
|
-
|
|
14622
|
+
as: "span",
|
|
14421
14623
|
style: {
|
|
14422
14624
|
fontWeight: 700,
|
|
14423
|
-
|
|
14625
|
+
fontSize: "1.05rem",
|
|
14626
|
+
letterSpacing: "0.06em",
|
|
14627
|
+
textShadow: "0 2px 0 rgba(0,0,0,0.5)",
|
|
14628
|
+
whiteSpace: "nowrap"
|
|
14424
14629
|
},
|
|
14425
14630
|
children: appName
|
|
14426
14631
|
}
|
|
14427
14632
|
)
|
|
14428
14633
|
}
|
|
14429
14634
|
),
|
|
14430
|
-
hud && /* @__PURE__ */ jsx(Box, { className: "game-shell__hud", style: {
|
|
14635
|
+
hud && /* @__PURE__ */ jsx(Box, { className: "game-shell__hud pointer-events-auto", style: { flex: 1, minWidth: 0 }, children: hud })
|
|
14431
14636
|
]
|
|
14432
14637
|
}
|
|
14433
14638
|
),
|
|
14434
|
-
/* @__PURE__ */ jsx(
|
|
14639
|
+
controls && /* @__PURE__ */ jsx(
|
|
14435
14640
|
Box,
|
|
14436
14641
|
{
|
|
14437
|
-
className: "game-
|
|
14642
|
+
className: "game-shell__controls pointer-events-auto",
|
|
14438
14643
|
style: {
|
|
14439
|
-
|
|
14440
|
-
|
|
14441
|
-
|
|
14644
|
+
position: "absolute",
|
|
14645
|
+
left: 16,
|
|
14646
|
+
bottom: 16,
|
|
14647
|
+
zIndex: 2,
|
|
14648
|
+
display: "flex",
|
|
14649
|
+
flexDirection: "column",
|
|
14650
|
+
alignItems: "flex-start",
|
|
14651
|
+
gap: 10,
|
|
14652
|
+
filter: "drop-shadow(0 6px 12px rgba(0,0,0,0.5))"
|
|
14442
14653
|
},
|
|
14443
|
-
children
|
|
14654
|
+
children: controls
|
|
14655
|
+
}
|
|
14656
|
+
),
|
|
14657
|
+
addons && /* @__PURE__ */ jsx(
|
|
14658
|
+
Box,
|
|
14659
|
+
{
|
|
14660
|
+
className: "game-shell__actions pointer-events-auto",
|
|
14661
|
+
style: {
|
|
14662
|
+
position: "absolute",
|
|
14663
|
+
right: 16,
|
|
14664
|
+
bottom: 16,
|
|
14665
|
+
zIndex: 2,
|
|
14666
|
+
display: "flex",
|
|
14667
|
+
flexDirection: "column",
|
|
14668
|
+
alignItems: "flex-end",
|
|
14669
|
+
gap: 10,
|
|
14670
|
+
filter: "drop-shadow(0 6px 12px rgba(0,0,0,0.5))"
|
|
14671
|
+
},
|
|
14672
|
+
children: addons
|
|
14673
|
+
}
|
|
14674
|
+
),
|
|
14675
|
+
overlay && /* @__PURE__ */ jsx(
|
|
14676
|
+
Box,
|
|
14677
|
+
{
|
|
14678
|
+
className: "game-shell__overlay pointer-events-none",
|
|
14679
|
+
style: {
|
|
14680
|
+
position: "absolute",
|
|
14681
|
+
inset: 0,
|
|
14682
|
+
zIndex: 3,
|
|
14683
|
+
display: "flex",
|
|
14684
|
+
alignItems: "center",
|
|
14685
|
+
justifyContent: "center"
|
|
14686
|
+
},
|
|
14687
|
+
children: /* @__PURE__ */ jsx(Box, { className: "pointer-events-auto", children: overlay })
|
|
14444
14688
|
}
|
|
14445
14689
|
)
|
|
14446
14690
|
]
|
|
@@ -14854,7 +15098,7 @@ var init_ErrorBoundary = __esm({
|
|
|
14854
15098
|
}
|
|
14855
15099
|
);
|
|
14856
15100
|
};
|
|
14857
|
-
ErrorBoundary = class extends
|
|
15101
|
+
ErrorBoundary = class extends React96__default.Component {
|
|
14858
15102
|
constructor(props) {
|
|
14859
15103
|
super(props);
|
|
14860
15104
|
__publicField(this, "reset", () => {
|
|
@@ -15136,7 +15380,7 @@ var init_Container = __esm({
|
|
|
15136
15380
|
as: Component = "div"
|
|
15137
15381
|
}) => {
|
|
15138
15382
|
const resolvedSize = maxWidth ?? size ?? "lg";
|
|
15139
|
-
return
|
|
15383
|
+
return React96__default.createElement(
|
|
15140
15384
|
Component,
|
|
15141
15385
|
{
|
|
15142
15386
|
className: cn(
|
|
@@ -17951,7 +18195,7 @@ var init_CodeBlock = __esm({
|
|
|
17951
18195
|
DIFF_STYLE_FALLBACK = { bg: "", prefix: " ", text: "text-foreground" };
|
|
17952
18196
|
LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
17953
18197
|
HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
17954
|
-
CodeBlock =
|
|
18198
|
+
CodeBlock = React96__default.memo(
|
|
17955
18199
|
({
|
|
17956
18200
|
code: rawCode,
|
|
17957
18201
|
language = "text",
|
|
@@ -18538,7 +18782,7 @@ var init_MarkdownContent = __esm({
|
|
|
18538
18782
|
init_Box();
|
|
18539
18783
|
init_CodeBlock();
|
|
18540
18784
|
init_cn();
|
|
18541
|
-
MarkdownContent =
|
|
18785
|
+
MarkdownContent = React96__default.memo(
|
|
18542
18786
|
({ content, direction = "ltr", className }) => {
|
|
18543
18787
|
const { t: _t } = useTranslate();
|
|
18544
18788
|
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
@@ -19815,7 +20059,7 @@ var init_StateMachineView = __esm({
|
|
|
19815
20059
|
style: { top: title ? 30 : 0 },
|
|
19816
20060
|
children: [
|
|
19817
20061
|
entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
|
|
19818
|
-
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(
|
|
20062
|
+
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React96__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
|
|
19819
20063
|
StateNode2,
|
|
19820
20064
|
{
|
|
19821
20065
|
state,
|
|
@@ -25372,8 +25616,8 @@ var init_Menu = __esm({
|
|
|
25372
25616
|
"bottom-end": "bottom-start"
|
|
25373
25617
|
};
|
|
25374
25618
|
const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
|
|
25375
|
-
const triggerChild =
|
|
25376
|
-
const triggerElement =
|
|
25619
|
+
const triggerChild = React96__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
|
|
25620
|
+
const triggerElement = React96__default.cloneElement(
|
|
25377
25621
|
triggerChild,
|
|
25378
25622
|
{
|
|
25379
25623
|
ref: triggerRef,
|
|
@@ -25468,14 +25712,14 @@ function useDataDnd(args) {
|
|
|
25468
25712
|
const isZone = Boolean(dragGroup || accepts || sortable);
|
|
25469
25713
|
const enabled = isZone || Boolean(dndRoot);
|
|
25470
25714
|
const eventBus = useEventBus();
|
|
25471
|
-
const parentRoot =
|
|
25715
|
+
const parentRoot = React96__default.useContext(RootCtx);
|
|
25472
25716
|
const isRoot = enabled && parentRoot === null;
|
|
25473
|
-
const zoneId =
|
|
25717
|
+
const zoneId = React96__default.useId();
|
|
25474
25718
|
const ownGroup = dragGroup ?? accepts ?? zoneId;
|
|
25475
|
-
const [optimisticOrders, setOptimisticOrders] =
|
|
25476
|
-
const optimisticOrdersRef =
|
|
25719
|
+
const [optimisticOrders, setOptimisticOrders] = React96__default.useState(() => /* @__PURE__ */ new Map());
|
|
25720
|
+
const optimisticOrdersRef = React96__default.useRef(optimisticOrders);
|
|
25477
25721
|
optimisticOrdersRef.current = optimisticOrders;
|
|
25478
|
-
const clearOptimisticOrder =
|
|
25722
|
+
const clearOptimisticOrder = React96__default.useCallback((group) => {
|
|
25479
25723
|
setOptimisticOrders((prev) => {
|
|
25480
25724
|
if (!prev.has(group)) return prev;
|
|
25481
25725
|
const next = new Map(prev);
|
|
@@ -25500,7 +25744,7 @@ function useDataDnd(args) {
|
|
|
25500
25744
|
const raw = it[dndItemIdField];
|
|
25501
25745
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
25502
25746
|
}).join("|");
|
|
25503
|
-
const itemIds =
|
|
25747
|
+
const itemIds = React96__default.useMemo(
|
|
25504
25748
|
() => orderedItems.map((it, idx) => {
|
|
25505
25749
|
const raw = it[dndItemIdField];
|
|
25506
25750
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
@@ -25511,7 +25755,7 @@ function useDataDnd(args) {
|
|
|
25511
25755
|
const raw = it[dndItemIdField];
|
|
25512
25756
|
return raw != null ? String(raw) : `__${idx}`;
|
|
25513
25757
|
}).join("|");
|
|
25514
|
-
|
|
25758
|
+
React96__default.useEffect(() => {
|
|
25515
25759
|
const root = isRoot ? null : parentRoot;
|
|
25516
25760
|
if (root) {
|
|
25517
25761
|
root.clearOptimisticOrder(ownGroup);
|
|
@@ -25519,20 +25763,20 @@ function useDataDnd(args) {
|
|
|
25519
25763
|
clearOptimisticOrder(ownGroup);
|
|
25520
25764
|
}
|
|
25521
25765
|
}, [itemsContentSig, ownGroup]);
|
|
25522
|
-
const zonesRef =
|
|
25523
|
-
const registerZone =
|
|
25766
|
+
const zonesRef = React96__default.useRef(/* @__PURE__ */ new Map());
|
|
25767
|
+
const registerZone = React96__default.useCallback((zoneId2, meta2) => {
|
|
25524
25768
|
zonesRef.current.set(zoneId2, meta2);
|
|
25525
25769
|
}, []);
|
|
25526
|
-
const unregisterZone =
|
|
25770
|
+
const unregisterZone = React96__default.useCallback((zoneId2) => {
|
|
25527
25771
|
zonesRef.current.delete(zoneId2);
|
|
25528
25772
|
}, []);
|
|
25529
|
-
const [activeDrag, setActiveDrag] =
|
|
25530
|
-
const [overZoneGroup, setOverZoneGroup] =
|
|
25531
|
-
const meta =
|
|
25773
|
+
const [activeDrag, setActiveDrag] = React96__default.useState(null);
|
|
25774
|
+
const [overZoneGroup, setOverZoneGroup] = React96__default.useState(null);
|
|
25775
|
+
const meta = React96__default.useMemo(
|
|
25532
25776
|
() => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
|
|
25533
25777
|
[ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
|
|
25534
25778
|
);
|
|
25535
|
-
|
|
25779
|
+
React96__default.useEffect(() => {
|
|
25536
25780
|
const target = isRoot ? null : parentRoot;
|
|
25537
25781
|
if (!target) {
|
|
25538
25782
|
zonesRef.current.set(zoneId, meta);
|
|
@@ -25551,7 +25795,7 @@ function useDataDnd(args) {
|
|
|
25551
25795
|
}, [parentRoot, isRoot, zoneId, meta]);
|
|
25552
25796
|
const sensors = useAlmadarDndSensors(true);
|
|
25553
25797
|
const collisionDetection = almadarDndCollisionDetection;
|
|
25554
|
-
const findZoneByItem =
|
|
25798
|
+
const findZoneByItem = React96__default.useCallback(
|
|
25555
25799
|
(id) => {
|
|
25556
25800
|
for (const z of zonesRef.current.values()) {
|
|
25557
25801
|
if (z.itemIds.includes(id)) return z;
|
|
@@ -25560,7 +25804,7 @@ function useDataDnd(args) {
|
|
|
25560
25804
|
},
|
|
25561
25805
|
[]
|
|
25562
25806
|
);
|
|
25563
|
-
|
|
25807
|
+
React96__default.useCallback(
|
|
25564
25808
|
(group) => {
|
|
25565
25809
|
for (const z of zonesRef.current.values()) {
|
|
25566
25810
|
if (z.group === group) return z;
|
|
@@ -25569,7 +25813,7 @@ function useDataDnd(args) {
|
|
|
25569
25813
|
},
|
|
25570
25814
|
[]
|
|
25571
25815
|
);
|
|
25572
|
-
const handleDragEnd =
|
|
25816
|
+
const handleDragEnd = React96__default.useCallback(
|
|
25573
25817
|
(event) => {
|
|
25574
25818
|
const { active, over } = event;
|
|
25575
25819
|
const activeIdStr = String(active.id);
|
|
@@ -25660,8 +25904,8 @@ function useDataDnd(args) {
|
|
|
25660
25904
|
},
|
|
25661
25905
|
[eventBus]
|
|
25662
25906
|
);
|
|
25663
|
-
const sortableData =
|
|
25664
|
-
const SortableItem =
|
|
25907
|
+
const sortableData = React96__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
|
|
25908
|
+
const SortableItem = React96__default.useCallback(
|
|
25665
25909
|
({ id, children }) => {
|
|
25666
25910
|
const {
|
|
25667
25911
|
attributes,
|
|
@@ -25701,7 +25945,7 @@ function useDataDnd(args) {
|
|
|
25701
25945
|
id: droppableId,
|
|
25702
25946
|
data: sortableData
|
|
25703
25947
|
});
|
|
25704
|
-
const ctx =
|
|
25948
|
+
const ctx = React96__default.useContext(RootCtx);
|
|
25705
25949
|
const activeDrag2 = ctx?.activeDrag ?? null;
|
|
25706
25950
|
const overZoneGroup2 = ctx?.overZoneGroup ?? null;
|
|
25707
25951
|
const isThisZoneOver = overZoneGroup2 === ownGroup;
|
|
@@ -25716,7 +25960,7 @@ function useDataDnd(args) {
|
|
|
25716
25960
|
showForeignPlaceholder,
|
|
25717
25961
|
ctxAvailable: ctx != null
|
|
25718
25962
|
});
|
|
25719
|
-
|
|
25963
|
+
React96__default.useEffect(() => {
|
|
25720
25964
|
dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
|
|
25721
25965
|
}, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
|
|
25722
25966
|
return /* @__PURE__ */ jsx(
|
|
@@ -25730,11 +25974,11 @@ function useDataDnd(args) {
|
|
|
25730
25974
|
}
|
|
25731
25975
|
);
|
|
25732
25976
|
};
|
|
25733
|
-
const rootContextValue =
|
|
25977
|
+
const rootContextValue = React96__default.useMemo(
|
|
25734
25978
|
() => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
|
|
25735
25979
|
[registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
|
|
25736
25980
|
);
|
|
25737
|
-
const handleDragStart =
|
|
25981
|
+
const handleDragStart = React96__default.useCallback((event) => {
|
|
25738
25982
|
const sourceZone = findZoneByItem(event.active.id);
|
|
25739
25983
|
const rect = event.active.rect.current.initial;
|
|
25740
25984
|
const height = rect?.height && rect.height > 0 ? rect.height : 64;
|
|
@@ -25753,7 +25997,7 @@ function useDataDnd(args) {
|
|
|
25753
25997
|
isRoot
|
|
25754
25998
|
});
|
|
25755
25999
|
}, [findZoneByItem, isRoot, zoneId]);
|
|
25756
|
-
const handleDragOver =
|
|
26000
|
+
const handleDragOver = React96__default.useCallback((event) => {
|
|
25757
26001
|
const { active, over } = event;
|
|
25758
26002
|
const overData = over?.data?.current;
|
|
25759
26003
|
const overGroup = overData?.dndGroup ?? null;
|
|
@@ -25823,7 +26067,7 @@ function useDataDnd(args) {
|
|
|
25823
26067
|
return next;
|
|
25824
26068
|
});
|
|
25825
26069
|
}, []);
|
|
25826
|
-
const handleDragCancel =
|
|
26070
|
+
const handleDragCancel = React96__default.useCallback((event) => {
|
|
25827
26071
|
setActiveDrag(null);
|
|
25828
26072
|
setOverZoneGroup(null);
|
|
25829
26073
|
dndLog.warn("dragCancel", {
|
|
@@ -25831,12 +26075,12 @@ function useDataDnd(args) {
|
|
|
25831
26075
|
reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
|
|
25832
26076
|
});
|
|
25833
26077
|
}, []);
|
|
25834
|
-
const handleDragEndWithCleanup =
|
|
26078
|
+
const handleDragEndWithCleanup = React96__default.useCallback((event) => {
|
|
25835
26079
|
handleDragEnd(event);
|
|
25836
26080
|
setActiveDrag(null);
|
|
25837
26081
|
setOverZoneGroup(null);
|
|
25838
26082
|
}, [handleDragEnd]);
|
|
25839
|
-
const wrapContainer =
|
|
26083
|
+
const wrapContainer = React96__default.useCallback(
|
|
25840
26084
|
(children) => {
|
|
25841
26085
|
if (!enabled) return children;
|
|
25842
26086
|
const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
|
|
@@ -25890,7 +26134,7 @@ var init_useDataDnd = __esm({
|
|
|
25890
26134
|
init_useAlmadarDndCollision();
|
|
25891
26135
|
init_Box();
|
|
25892
26136
|
dndLog = createLogger("almadar:ui:dnd");
|
|
25893
|
-
RootCtx =
|
|
26137
|
+
RootCtx = React96__default.createContext(null);
|
|
25894
26138
|
}
|
|
25895
26139
|
});
|
|
25896
26140
|
function renderIconInput(icon, props) {
|
|
@@ -26416,7 +26660,7 @@ function DataList({
|
|
|
26416
26660
|
}) {
|
|
26417
26661
|
const eventBus = useEventBus();
|
|
26418
26662
|
const { t } = useTranslate();
|
|
26419
|
-
const [visibleCount, setVisibleCount] =
|
|
26663
|
+
const [visibleCount, setVisibleCount] = React96__default.useState(pageSize || Infinity);
|
|
26420
26664
|
const fieldDefs = fields ?? columns ?? [];
|
|
26421
26665
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
26422
26666
|
const dnd = useDataDnd({
|
|
@@ -26435,7 +26679,7 @@ function DataList({
|
|
|
26435
26679
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
26436
26680
|
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
26437
26681
|
const hasRenderProp = typeof children === "function";
|
|
26438
|
-
|
|
26682
|
+
React96__default.useEffect(() => {
|
|
26439
26683
|
const renderItemTypeOf = typeof schemaRenderItem;
|
|
26440
26684
|
const childrenTypeOf = typeof children;
|
|
26441
26685
|
if (data.length > 0 && !hasRenderProp) {
|
|
@@ -26539,7 +26783,7 @@ function DataList({
|
|
|
26539
26783
|
const items2 = [...data];
|
|
26540
26784
|
const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
|
|
26541
26785
|
const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
|
|
26542
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
26786
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
|
|
26543
26787
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
|
|
26544
26788
|
group.items.map((itemData, index) => {
|
|
26545
26789
|
const id = itemData.id || `${gi}-${index}`;
|
|
@@ -26680,7 +26924,7 @@ function DataList({
|
|
|
26680
26924
|
className
|
|
26681
26925
|
),
|
|
26682
26926
|
children: [
|
|
26683
|
-
groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
26927
|
+
groups.map((group, gi) => /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
|
|
26684
26928
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
|
|
26685
26929
|
group.items.map(
|
|
26686
26930
|
(itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
|
|
@@ -26765,7 +27009,7 @@ var init_FormSection = __esm({
|
|
|
26765
27009
|
columns = 1,
|
|
26766
27010
|
className
|
|
26767
27011
|
}) => {
|
|
26768
|
-
const [collapsed, setCollapsed] =
|
|
27012
|
+
const [collapsed, setCollapsed] = React96__default.useState(defaultCollapsed);
|
|
26769
27013
|
const { t } = useTranslate();
|
|
26770
27014
|
const eventBus = useEventBus();
|
|
26771
27015
|
const gridClass = {
|
|
@@ -26773,7 +27017,7 @@ var init_FormSection = __esm({
|
|
|
26773
27017
|
2: "grid-cols-1 md:grid-cols-2",
|
|
26774
27018
|
3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
|
|
26775
27019
|
}[columns];
|
|
26776
|
-
|
|
27020
|
+
React96__default.useCallback(() => {
|
|
26777
27021
|
if (collapsible) {
|
|
26778
27022
|
setCollapsed((prev) => !prev);
|
|
26779
27023
|
eventBus.emit("UI:TOGGLE_COLLAPSE", { collapsed: !collapsed });
|
|
@@ -27659,7 +27903,7 @@ var init_Flex = __esm({
|
|
|
27659
27903
|
flexStyle.flexBasis = typeof basis === "number" ? `${basis}px` : basis;
|
|
27660
27904
|
}
|
|
27661
27905
|
}
|
|
27662
|
-
return
|
|
27906
|
+
return React96__default.createElement(Component, {
|
|
27663
27907
|
className: cn(
|
|
27664
27908
|
inline ? "inline-flex" : "flex",
|
|
27665
27909
|
directionStyles[direction],
|
|
@@ -27778,7 +28022,7 @@ var init_Grid = __esm({
|
|
|
27778
28022
|
as: Component = "div"
|
|
27779
28023
|
}) => {
|
|
27780
28024
|
const mergedStyle = rows2 ? { gridTemplateRows: `repeat(${rows2}, minmax(0, 1fr))`, ...style } : style;
|
|
27781
|
-
return
|
|
28025
|
+
return React96__default.createElement(
|
|
27782
28026
|
Component,
|
|
27783
28027
|
{
|
|
27784
28028
|
className: cn(
|
|
@@ -27974,9 +28218,9 @@ var init_Popover = __esm({
|
|
|
27974
28218
|
onMouseLeave: handleClose,
|
|
27975
28219
|
onPointerDown: tapTriggerProps.onPointerDown
|
|
27976
28220
|
};
|
|
27977
|
-
const childElement =
|
|
28221
|
+
const childElement = React96__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
27978
28222
|
const childPointerDown = childElement.props.onPointerDown;
|
|
27979
|
-
const triggerElement =
|
|
28223
|
+
const triggerElement = React96__default.cloneElement(
|
|
27980
28224
|
childElement,
|
|
27981
28225
|
{
|
|
27982
28226
|
ref: triggerRef,
|
|
@@ -28578,9 +28822,9 @@ var init_Tooltip = __esm({
|
|
|
28578
28822
|
if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
|
|
28579
28823
|
};
|
|
28580
28824
|
}, []);
|
|
28581
|
-
const triggerElement =
|
|
28825
|
+
const triggerElement = React96__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
28582
28826
|
const childPointerDown = triggerElement.props.onPointerDown;
|
|
28583
|
-
const trigger =
|
|
28827
|
+
const trigger = React96__default.cloneElement(triggerElement, {
|
|
28584
28828
|
ref: triggerRef,
|
|
28585
28829
|
onMouseEnter: handleMouseEnter,
|
|
28586
28830
|
onMouseLeave: handleMouseLeave,
|
|
@@ -28670,7 +28914,7 @@ var init_WizardProgress = __esm({
|
|
|
28670
28914
|
children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
|
|
28671
28915
|
const isActive = index === currentStep;
|
|
28672
28916
|
const isCompleted = index < currentStep;
|
|
28673
|
-
return /* @__PURE__ */ jsxs(
|
|
28917
|
+
return /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
|
|
28674
28918
|
/* @__PURE__ */ jsx(
|
|
28675
28919
|
"button",
|
|
28676
28920
|
{
|
|
@@ -30230,13 +30474,13 @@ var init_MapView = __esm({
|
|
|
30230
30474
|
shadowSize: [41, 41]
|
|
30231
30475
|
});
|
|
30232
30476
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
30233
|
-
const { useEffect:
|
|
30477
|
+
const { useEffect: useEffect67, useRef: useRef65, useCallback: useCallback98, useState: useState97 } = React96__default;
|
|
30234
30478
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
30235
30479
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
30236
30480
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
30237
30481
|
const map = useMap();
|
|
30238
|
-
const prevRef =
|
|
30239
|
-
|
|
30482
|
+
const prevRef = useRef65({ centerLat, centerLng, zoom });
|
|
30483
|
+
useEffect67(() => {
|
|
30240
30484
|
const prev = prevRef.current;
|
|
30241
30485
|
if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
|
|
30242
30486
|
map.setView([centerLat, centerLng], zoom);
|
|
@@ -30247,7 +30491,7 @@ var init_MapView = __esm({
|
|
|
30247
30491
|
}
|
|
30248
30492
|
function MapClickHandler({ onMapClick }) {
|
|
30249
30493
|
const map = useMap();
|
|
30250
|
-
|
|
30494
|
+
useEffect67(() => {
|
|
30251
30495
|
if (!onMapClick) return;
|
|
30252
30496
|
const handler = (e) => {
|
|
30253
30497
|
onMapClick(e.latlng.lat, e.latlng.lng);
|
|
@@ -31145,8 +31389,8 @@ function TableView({
|
|
|
31145
31389
|
}) {
|
|
31146
31390
|
const eventBus = useEventBus();
|
|
31147
31391
|
const { t } = useTranslate();
|
|
31148
|
-
const [visibleCount, setVisibleCount] =
|
|
31149
|
-
const [localSelected, setLocalSelected] =
|
|
31392
|
+
const [visibleCount, setVisibleCount] = React96__default.useState(pageSize > 0 ? pageSize : Infinity);
|
|
31393
|
+
const [localSelected, setLocalSelected] = React96__default.useState(/* @__PURE__ */ new Set());
|
|
31150
31394
|
const colDefs = columns ?? fields ?? [];
|
|
31151
31395
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
31152
31396
|
const dnd = useDataDnd({
|
|
@@ -31341,12 +31585,12 @@ function TableView({
|
|
|
31341
31585
|
]
|
|
31342
31586
|
}
|
|
31343
31587
|
);
|
|
31344
|
-
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(
|
|
31588
|
+
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React96__default.Fragment, { children: rowInner }, id);
|
|
31345
31589
|
};
|
|
31346
31590
|
const items = Array.from(data);
|
|
31347
31591
|
const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
|
|
31348
31592
|
let runningIndex = 0;
|
|
31349
|
-
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
31593
|
+
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
|
|
31350
31594
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
|
|
31351
31595
|
group.items.map((row) => renderRow(row, runningIndex++))
|
|
31352
31596
|
] }, gi)) });
|
|
@@ -32565,7 +32809,7 @@ var init_StepFlow = __esm({
|
|
|
32565
32809
|
className
|
|
32566
32810
|
}) => {
|
|
32567
32811
|
if (orientation === "vertical") {
|
|
32568
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(
|
|
32812
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React96__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
|
|
32569
32813
|
/* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
|
|
32570
32814
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
32571
32815
|
showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
|
|
@@ -32576,7 +32820,7 @@ var init_StepFlow = __esm({
|
|
|
32576
32820
|
] })
|
|
32577
32821
|
] }) }, index)) });
|
|
32578
32822
|
}
|
|
32579
|
-
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(
|
|
32823
|
+
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(React96__default.Fragment, { children: [
|
|
32580
32824
|
/* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
|
|
32581
32825
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
32582
32826
|
/* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
|
|
@@ -33561,7 +33805,7 @@ var init_LikertScale = __esm({
|
|
|
33561
33805
|
md: "text-base",
|
|
33562
33806
|
lg: "text-lg"
|
|
33563
33807
|
};
|
|
33564
|
-
LikertScale =
|
|
33808
|
+
LikertScale = React96__default.forwardRef(
|
|
33565
33809
|
({
|
|
33566
33810
|
question,
|
|
33567
33811
|
options = DEFAULT_LIKERT_OPTIONS,
|
|
@@ -33573,7 +33817,7 @@ var init_LikertScale = __esm({
|
|
|
33573
33817
|
variant = "radios",
|
|
33574
33818
|
className
|
|
33575
33819
|
}, ref) => {
|
|
33576
|
-
const groupId =
|
|
33820
|
+
const groupId = React96__default.useId();
|
|
33577
33821
|
const eventBus = useEventBus();
|
|
33578
33822
|
const handleSelect = useCallback(
|
|
33579
33823
|
(next) => {
|
|
@@ -35855,7 +36099,7 @@ var init_DocBreadcrumb = __esm({
|
|
|
35855
36099
|
"aria-label": t("aria.breadcrumb"),
|
|
35856
36100
|
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
|
|
35857
36101
|
const isLast = idx === items.length - 1;
|
|
35858
|
-
return /* @__PURE__ */ jsxs(
|
|
36102
|
+
return /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
|
|
35859
36103
|
idx > 0 && /* @__PURE__ */ jsx(
|
|
35860
36104
|
Icon,
|
|
35861
36105
|
{
|
|
@@ -36724,7 +36968,7 @@ var init_MiniStateMachine = __esm({
|
|
|
36724
36968
|
const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
|
|
36725
36969
|
const tc = transitionCounts[s.name] ?? 0;
|
|
36726
36970
|
const role = getStateRole(s.name, s.isInitial ?? void 0, s.isTerminal ?? void 0, tc, maxTC);
|
|
36727
|
-
return /* @__PURE__ */ jsxs(
|
|
36971
|
+
return /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
|
|
36728
36972
|
/* @__PURE__ */ jsx(
|
|
36729
36973
|
AvlState,
|
|
36730
36974
|
{
|
|
@@ -36928,7 +37172,7 @@ var init_PageHeader = __esm({
|
|
|
36928
37172
|
info: "bg-info/10 text-info"
|
|
36929
37173
|
};
|
|
36930
37174
|
return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
|
|
36931
|
-
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(
|
|
37175
|
+
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(React96__default.Fragment, { children: [
|
|
36932
37176
|
idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
|
|
36933
37177
|
crumb.href ? /* @__PURE__ */ jsx(
|
|
36934
37178
|
"a",
|
|
@@ -37286,7 +37530,7 @@ var init_Section = __esm({
|
|
|
37286
37530
|
as: Component = "section"
|
|
37287
37531
|
}) => {
|
|
37288
37532
|
const hasHeader = title || description || action;
|
|
37289
|
-
return
|
|
37533
|
+
return React96__default.createElement(
|
|
37290
37534
|
Component,
|
|
37291
37535
|
{
|
|
37292
37536
|
className: cn(
|
|
@@ -37660,7 +37904,7 @@ var init_WizardContainer = __esm({
|
|
|
37660
37904
|
const isCompleted = index < currentStep;
|
|
37661
37905
|
const stepKey = step.id ?? step.tabId ?? `step-${index}`;
|
|
37662
37906
|
const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
|
|
37663
|
-
return /* @__PURE__ */ jsxs(
|
|
37907
|
+
return /* @__PURE__ */ jsxs(React96__default.Fragment, { children: [
|
|
37664
37908
|
/* @__PURE__ */ jsx(
|
|
37665
37909
|
Button,
|
|
37666
37910
|
{
|
|
@@ -40093,7 +40337,7 @@ var init_DetailPanel = __esm({
|
|
|
40093
40337
|
}
|
|
40094
40338
|
});
|
|
40095
40339
|
function extractTitle(children) {
|
|
40096
|
-
if (!
|
|
40340
|
+
if (!React96__default.isValidElement(children)) return void 0;
|
|
40097
40341
|
const props = children.props;
|
|
40098
40342
|
if (typeof props.title === "string") {
|
|
40099
40343
|
return props.title;
|
|
@@ -40443,12 +40687,12 @@ var init_Form = __esm({
|
|
|
40443
40687
|
const isSchemaEntity = isOrbitalEntitySchema(entity);
|
|
40444
40688
|
const resolvedEntity = isSchemaEntity ? entity : void 0;
|
|
40445
40689
|
const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
|
|
40446
|
-
const normalizedInitialData =
|
|
40690
|
+
const normalizedInitialData = React96__default.useMemo(() => {
|
|
40447
40691
|
const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
|
|
40448
40692
|
const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
|
|
40449
40693
|
return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
|
|
40450
40694
|
}, [entity, initialData]);
|
|
40451
|
-
const entityDerivedFields =
|
|
40695
|
+
const entityDerivedFields = React96__default.useMemo(() => {
|
|
40452
40696
|
if (fields && fields.length > 0) return void 0;
|
|
40453
40697
|
if (!resolvedEntity) return void 0;
|
|
40454
40698
|
return resolvedEntity.fields.map(
|
|
@@ -40469,16 +40713,16 @@ var init_Form = __esm({
|
|
|
40469
40713
|
const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
|
|
40470
40714
|
const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
|
|
40471
40715
|
const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
|
|
40472
|
-
const [formData, setFormData] =
|
|
40716
|
+
const [formData, setFormData] = React96__default.useState(
|
|
40473
40717
|
normalizedInitialData
|
|
40474
40718
|
);
|
|
40475
|
-
const [collapsedSections, setCollapsedSections] =
|
|
40719
|
+
const [collapsedSections, setCollapsedSections] = React96__default.useState(
|
|
40476
40720
|
/* @__PURE__ */ new Set()
|
|
40477
40721
|
);
|
|
40478
|
-
const [submitError, setSubmitError] =
|
|
40479
|
-
const formRef =
|
|
40722
|
+
const [submitError, setSubmitError] = React96__default.useState(null);
|
|
40723
|
+
const formRef = React96__default.useRef(null);
|
|
40480
40724
|
const formMode = props.mode;
|
|
40481
|
-
const mountedRef =
|
|
40725
|
+
const mountedRef = React96__default.useRef(false);
|
|
40482
40726
|
if (!mountedRef.current) {
|
|
40483
40727
|
mountedRef.current = true;
|
|
40484
40728
|
debug("forms", "mount", {
|
|
@@ -40491,7 +40735,7 @@ var init_Form = __esm({
|
|
|
40491
40735
|
});
|
|
40492
40736
|
}
|
|
40493
40737
|
const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
|
|
40494
|
-
const evalContext =
|
|
40738
|
+
const evalContext = React96__default.useMemo(
|
|
40495
40739
|
() => ({
|
|
40496
40740
|
formValues: formData,
|
|
40497
40741
|
globalVariables: externalContext?.globalVariables ?? {},
|
|
@@ -40500,7 +40744,7 @@ var init_Form = __esm({
|
|
|
40500
40744
|
}),
|
|
40501
40745
|
[formData, externalContext]
|
|
40502
40746
|
);
|
|
40503
|
-
|
|
40747
|
+
React96__default.useEffect(() => {
|
|
40504
40748
|
debug("forms", "initialData-sync", {
|
|
40505
40749
|
mode: formMode,
|
|
40506
40750
|
normalizedInitialData,
|
|
@@ -40511,7 +40755,7 @@ var init_Form = __esm({
|
|
|
40511
40755
|
setFormData(normalizedInitialData);
|
|
40512
40756
|
}
|
|
40513
40757
|
}, [normalizedInitialData]);
|
|
40514
|
-
const processCalculations =
|
|
40758
|
+
const processCalculations = React96__default.useCallback(
|
|
40515
40759
|
(changedFieldId, newFormData) => {
|
|
40516
40760
|
if (!hiddenCalculations.length) return;
|
|
40517
40761
|
const context = {
|
|
@@ -40536,7 +40780,7 @@ var init_Form = __esm({
|
|
|
40536
40780
|
},
|
|
40537
40781
|
[hiddenCalculations, externalContext, eventBus]
|
|
40538
40782
|
);
|
|
40539
|
-
const checkViolations =
|
|
40783
|
+
const checkViolations = React96__default.useCallback(
|
|
40540
40784
|
(changedFieldId, newFormData) => {
|
|
40541
40785
|
if (!violationTriggers.length) return;
|
|
40542
40786
|
const context = {
|
|
@@ -40574,7 +40818,7 @@ var init_Form = __esm({
|
|
|
40574
40818
|
processCalculations(name, newFormData);
|
|
40575
40819
|
checkViolations(name, newFormData);
|
|
40576
40820
|
};
|
|
40577
|
-
const isFieldVisible =
|
|
40821
|
+
const isFieldVisible = React96__default.useCallback(
|
|
40578
40822
|
(fieldName) => {
|
|
40579
40823
|
const condition = conditionalFields[fieldName];
|
|
40580
40824
|
if (!condition) return true;
|
|
@@ -40582,7 +40826,7 @@ var init_Form = __esm({
|
|
|
40582
40826
|
},
|
|
40583
40827
|
[conditionalFields, evalContext]
|
|
40584
40828
|
);
|
|
40585
|
-
const isSectionVisible =
|
|
40829
|
+
const isSectionVisible = React96__default.useCallback(
|
|
40586
40830
|
(section) => {
|
|
40587
40831
|
if (!section.condition) return true;
|
|
40588
40832
|
return Boolean(evaluateFormExpression(section.condition, evalContext));
|
|
@@ -40658,7 +40902,7 @@ var init_Form = __esm({
|
|
|
40658
40902
|
eventBus.emit(`UI:${onCancel}`);
|
|
40659
40903
|
}
|
|
40660
40904
|
};
|
|
40661
|
-
const renderField =
|
|
40905
|
+
const renderField = React96__default.useCallback(
|
|
40662
40906
|
(field) => {
|
|
40663
40907
|
const fieldName = field.name || field.field;
|
|
40664
40908
|
if (!fieldName) return null;
|
|
@@ -40679,7 +40923,7 @@ var init_Form = __esm({
|
|
|
40679
40923
|
[formData, isFieldVisible, relationsData, relationsLoading, isLoading]
|
|
40680
40924
|
);
|
|
40681
40925
|
const effectiveFields = entityDerivedFields ?? fields;
|
|
40682
|
-
const normalizedFields =
|
|
40926
|
+
const normalizedFields = React96__default.useMemo(() => {
|
|
40683
40927
|
if (!effectiveFields || effectiveFields.length === 0) return [];
|
|
40684
40928
|
return effectiveFields.map((field) => {
|
|
40685
40929
|
if (typeof field === "string") {
|
|
@@ -40703,7 +40947,7 @@ var init_Form = __esm({
|
|
|
40703
40947
|
return field;
|
|
40704
40948
|
});
|
|
40705
40949
|
}, [effectiveFields, resolvedEntity]);
|
|
40706
|
-
const schemaFields =
|
|
40950
|
+
const schemaFields = React96__default.useMemo(() => {
|
|
40707
40951
|
if (normalizedFields.length === 0) return null;
|
|
40708
40952
|
if (isDebugEnabled()) {
|
|
40709
40953
|
debugGroup(`Form: ${entityName || "unknown"}`);
|
|
@@ -40713,7 +40957,7 @@ var init_Form = __esm({
|
|
|
40713
40957
|
}
|
|
40714
40958
|
return normalizedFields.map(renderField).filter(Boolean);
|
|
40715
40959
|
}, [normalizedFields, renderField, entityName, conditionalFields]);
|
|
40716
|
-
const sectionElements =
|
|
40960
|
+
const sectionElements = React96__default.useMemo(() => {
|
|
40717
40961
|
if (!sections || sections.length === 0) return null;
|
|
40718
40962
|
return sections.map((section) => {
|
|
40719
40963
|
if (!isSectionVisible(section)) {
|
|
@@ -41438,7 +41682,7 @@ var init_List = __esm({
|
|
|
41438
41682
|
if (entity && typeof entity === "object" && "id" in entity) return [entity];
|
|
41439
41683
|
return [];
|
|
41440
41684
|
}, [entity]);
|
|
41441
|
-
const getItemActions =
|
|
41685
|
+
const getItemActions = React96__default.useCallback(
|
|
41442
41686
|
(item) => {
|
|
41443
41687
|
if (!itemActions) return [];
|
|
41444
41688
|
if (typeof itemActions === "function") {
|
|
@@ -41913,7 +42157,7 @@ var init_MediaGallery = __esm({
|
|
|
41913
42157
|
[selectable, selectedItems, selectionEvent, eventBus]
|
|
41914
42158
|
);
|
|
41915
42159
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
41916
|
-
const items =
|
|
42160
|
+
const items = React96__default.useMemo(() => {
|
|
41917
42161
|
if (propItems) return propItems;
|
|
41918
42162
|
if (entityData.length === 0) return [];
|
|
41919
42163
|
return entityData.map((record, idx) => {
|
|
@@ -42076,7 +42320,7 @@ var init_MediaGallery = __esm({
|
|
|
42076
42320
|
}
|
|
42077
42321
|
});
|
|
42078
42322
|
function extractTitle2(children) {
|
|
42079
|
-
if (!
|
|
42323
|
+
if (!React96__default.isValidElement(children)) return void 0;
|
|
42080
42324
|
const props = children.props;
|
|
42081
42325
|
if (typeof props.title === "string") {
|
|
42082
42326
|
return props.title;
|
|
@@ -42350,7 +42594,7 @@ var init_debugRegistry = __esm({
|
|
|
42350
42594
|
}
|
|
42351
42595
|
});
|
|
42352
42596
|
function useDebugData() {
|
|
42353
|
-
const [data, setData] =
|
|
42597
|
+
const [data, setData] = React96.useState(() => ({
|
|
42354
42598
|
traits: [],
|
|
42355
42599
|
ticks: [],
|
|
42356
42600
|
guards: [],
|
|
@@ -42364,7 +42608,7 @@ function useDebugData() {
|
|
|
42364
42608
|
},
|
|
42365
42609
|
lastUpdate: Date.now()
|
|
42366
42610
|
}));
|
|
42367
|
-
|
|
42611
|
+
React96.useEffect(() => {
|
|
42368
42612
|
const updateData = () => {
|
|
42369
42613
|
setData({
|
|
42370
42614
|
traits: getAllTraits(),
|
|
@@ -42473,12 +42717,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
|
|
|
42473
42717
|
return positions;
|
|
42474
42718
|
}
|
|
42475
42719
|
function WalkMinimap() {
|
|
42476
|
-
const [walkStep, setWalkStep] =
|
|
42477
|
-
const [traits2, setTraits] =
|
|
42478
|
-
const [coveredEdges, setCoveredEdges] =
|
|
42479
|
-
const [completedTraits, setCompletedTraits] =
|
|
42480
|
-
const prevTraitRef =
|
|
42481
|
-
|
|
42720
|
+
const [walkStep, setWalkStep] = React96.useState(null);
|
|
42721
|
+
const [traits2, setTraits] = React96.useState([]);
|
|
42722
|
+
const [coveredEdges, setCoveredEdges] = React96.useState([]);
|
|
42723
|
+
const [completedTraits, setCompletedTraits] = React96.useState(/* @__PURE__ */ new Set());
|
|
42724
|
+
const prevTraitRef = React96.useRef(null);
|
|
42725
|
+
React96.useEffect(() => {
|
|
42482
42726
|
const interval = setInterval(() => {
|
|
42483
42727
|
const w = window;
|
|
42484
42728
|
const step = w.__orbitalWalkStep;
|
|
@@ -42914,15 +43158,15 @@ var init_EntitiesTab = __esm({
|
|
|
42914
43158
|
});
|
|
42915
43159
|
function EventFlowTab({ events: events2 }) {
|
|
42916
43160
|
const { t } = useTranslate();
|
|
42917
|
-
const [filter, setFilter] =
|
|
42918
|
-
const containerRef =
|
|
42919
|
-
const [autoScroll, setAutoScroll] =
|
|
42920
|
-
|
|
43161
|
+
const [filter, setFilter] = React96.useState("all");
|
|
43162
|
+
const containerRef = React96.useRef(null);
|
|
43163
|
+
const [autoScroll, setAutoScroll] = React96.useState(true);
|
|
43164
|
+
React96.useEffect(() => {
|
|
42921
43165
|
if (autoScroll && containerRef.current) {
|
|
42922
43166
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
42923
43167
|
}
|
|
42924
43168
|
}, [events2.length, autoScroll]);
|
|
42925
|
-
const filteredEvents =
|
|
43169
|
+
const filteredEvents = React96.useMemo(() => {
|
|
42926
43170
|
if (filter === "all") return events2;
|
|
42927
43171
|
return events2.filter((e) => e.type === filter);
|
|
42928
43172
|
}, [events2, filter]);
|
|
@@ -43038,7 +43282,7 @@ var init_EventFlowTab = __esm({
|
|
|
43038
43282
|
});
|
|
43039
43283
|
function GuardsPanel({ guards }) {
|
|
43040
43284
|
const { t } = useTranslate();
|
|
43041
|
-
const [filter, setFilter] =
|
|
43285
|
+
const [filter, setFilter] = React96.useState("all");
|
|
43042
43286
|
if (guards.length === 0) {
|
|
43043
43287
|
return /* @__PURE__ */ jsx(
|
|
43044
43288
|
EmptyState,
|
|
@@ -43051,7 +43295,7 @@ function GuardsPanel({ guards }) {
|
|
|
43051
43295
|
}
|
|
43052
43296
|
const passedCount = guards.filter((g) => g.result).length;
|
|
43053
43297
|
const failedCount = guards.length - passedCount;
|
|
43054
|
-
const filteredGuards =
|
|
43298
|
+
const filteredGuards = React96.useMemo(() => {
|
|
43055
43299
|
if (filter === "all") return guards;
|
|
43056
43300
|
if (filter === "passed") return guards.filter((g) => g.result);
|
|
43057
43301
|
return guards.filter((g) => !g.result);
|
|
@@ -43214,10 +43458,10 @@ function EffectBadge({ effect }) {
|
|
|
43214
43458
|
}
|
|
43215
43459
|
function TransitionTimeline({ transitions }) {
|
|
43216
43460
|
const { t } = useTranslate();
|
|
43217
|
-
const containerRef =
|
|
43218
|
-
const [autoScroll, setAutoScroll] =
|
|
43219
|
-
const [expandedId, setExpandedId] =
|
|
43220
|
-
|
|
43461
|
+
const containerRef = React96.useRef(null);
|
|
43462
|
+
const [autoScroll, setAutoScroll] = React96.useState(true);
|
|
43463
|
+
const [expandedId, setExpandedId] = React96.useState(null);
|
|
43464
|
+
React96.useEffect(() => {
|
|
43221
43465
|
if (autoScroll && containerRef.current) {
|
|
43222
43466
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
43223
43467
|
}
|
|
@@ -43497,9 +43741,9 @@ function getAllEvents(traits2) {
|
|
|
43497
43741
|
function EventDispatcherTab({ traits: traits2, schema }) {
|
|
43498
43742
|
const eventBus = useEventBus();
|
|
43499
43743
|
const { t } = useTranslate();
|
|
43500
|
-
const [log9, setLog] =
|
|
43501
|
-
const prevStatesRef =
|
|
43502
|
-
|
|
43744
|
+
const [log9, setLog] = React96.useState([]);
|
|
43745
|
+
const prevStatesRef = React96.useRef(/* @__PURE__ */ new Map());
|
|
43746
|
+
React96.useEffect(() => {
|
|
43503
43747
|
for (const trait of traits2) {
|
|
43504
43748
|
const prev = prevStatesRef.current.get(trait.id);
|
|
43505
43749
|
if (prev && prev !== trait.currentState) {
|
|
@@ -43668,10 +43912,10 @@ function VerifyModePanel({
|
|
|
43668
43912
|
localCount
|
|
43669
43913
|
}) {
|
|
43670
43914
|
const { t } = useTranslate();
|
|
43671
|
-
const [expanded, setExpanded] =
|
|
43672
|
-
const scrollRef =
|
|
43673
|
-
const prevCountRef =
|
|
43674
|
-
|
|
43915
|
+
const [expanded, setExpanded] = React96.useState(true);
|
|
43916
|
+
const scrollRef = React96.useRef(null);
|
|
43917
|
+
const prevCountRef = React96.useRef(0);
|
|
43918
|
+
React96.useEffect(() => {
|
|
43675
43919
|
if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
|
|
43676
43920
|
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
43677
43921
|
}
|
|
@@ -43728,10 +43972,10 @@ function RuntimeDebugger({
|
|
|
43728
43972
|
schema
|
|
43729
43973
|
}) {
|
|
43730
43974
|
const { t } = useTranslate();
|
|
43731
|
-
const [isCollapsed, setIsCollapsed] =
|
|
43732
|
-
const [isVisible, setIsVisible] =
|
|
43975
|
+
const [isCollapsed, setIsCollapsed] = React96.useState(mode === "verify" ? true : defaultCollapsed);
|
|
43976
|
+
const [isVisible, setIsVisible] = React96.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
|
|
43733
43977
|
const debugData = useDebugData();
|
|
43734
|
-
|
|
43978
|
+
React96.useEffect(() => {
|
|
43735
43979
|
if (mode === "inline") return;
|
|
43736
43980
|
return onDebugToggle((enabled) => {
|
|
43737
43981
|
setIsVisible(enabled);
|
|
@@ -43740,7 +43984,7 @@ function RuntimeDebugger({
|
|
|
43740
43984
|
}
|
|
43741
43985
|
});
|
|
43742
43986
|
}, [mode]);
|
|
43743
|
-
|
|
43987
|
+
React96.useEffect(() => {
|
|
43744
43988
|
if (mode === "inline") return;
|
|
43745
43989
|
const handleKeyDown = (e) => {
|
|
43746
43990
|
if (e.key === "`" && isVisible) {
|
|
@@ -44260,7 +44504,7 @@ var init_StatCard = __esm({
|
|
|
44260
44504
|
const labelToUse = propLabel ?? propTitle;
|
|
44261
44505
|
const eventBus = useEventBus();
|
|
44262
44506
|
const { t } = useTranslate();
|
|
44263
|
-
const handleActionClick =
|
|
44507
|
+
const handleActionClick = React96__default.useCallback(() => {
|
|
44264
44508
|
if (action?.event) {
|
|
44265
44509
|
eventBus.emit(`UI:${action.event}`, {});
|
|
44266
44510
|
}
|
|
@@ -44271,7 +44515,7 @@ var init_StatCard = __esm({
|
|
|
44271
44515
|
const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
44272
44516
|
const isLoading = externalLoading ?? false;
|
|
44273
44517
|
const error = externalError;
|
|
44274
|
-
const computeMetricValue =
|
|
44518
|
+
const computeMetricValue = React96__default.useCallback(
|
|
44275
44519
|
(metric, items) => {
|
|
44276
44520
|
if (metric.value !== void 0) {
|
|
44277
44521
|
return metric.value;
|
|
@@ -44310,7 +44554,7 @@ var init_StatCard = __esm({
|
|
|
44310
44554
|
},
|
|
44311
44555
|
[]
|
|
44312
44556
|
);
|
|
44313
|
-
const schemaStats =
|
|
44557
|
+
const schemaStats = React96__default.useMemo(() => {
|
|
44314
44558
|
if (!metrics || metrics.length === 0) return null;
|
|
44315
44559
|
return metrics.map((metric) => ({
|
|
44316
44560
|
label: metric.label,
|
|
@@ -44318,7 +44562,7 @@ var init_StatCard = __esm({
|
|
|
44318
44562
|
format: metric.format
|
|
44319
44563
|
}));
|
|
44320
44564
|
}, [metrics, data, computeMetricValue]);
|
|
44321
|
-
const calculatedTrend =
|
|
44565
|
+
const calculatedTrend = React96__default.useMemo(() => {
|
|
44322
44566
|
if (manualTrend !== void 0) return manualTrend;
|
|
44323
44567
|
if (previousValue === void 0 || currentValue === void 0)
|
|
44324
44568
|
return void 0;
|
|
@@ -44958,8 +45202,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
44958
45202
|
] });
|
|
44959
45203
|
};
|
|
44960
45204
|
InlineActivityStream = ({ activities, autoScroll = true, className }) => {
|
|
44961
|
-
const endRef =
|
|
44962
|
-
|
|
45205
|
+
const endRef = React96__default.useRef(null);
|
|
45206
|
+
React96__default.useEffect(() => {
|
|
44963
45207
|
if (!autoScroll) return;
|
|
44964
45208
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
44965
45209
|
}, [activities.length, autoScroll]);
|
|
@@ -45053,7 +45297,7 @@ var init_SubagentTracePanel = __esm({
|
|
|
45053
45297
|
};
|
|
45054
45298
|
SubagentRichCard = ({ subagent }) => {
|
|
45055
45299
|
const { t } = useTranslate();
|
|
45056
|
-
const activities =
|
|
45300
|
+
const activities = React96__default.useMemo(
|
|
45057
45301
|
() => subagentMessagesToActivities(subagent.messages),
|
|
45058
45302
|
[subagent.messages]
|
|
45059
45303
|
);
|
|
@@ -45130,8 +45374,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
45130
45374
|
] });
|
|
45131
45375
|
};
|
|
45132
45376
|
CoordinatorConversation = ({ messages, autoScroll = true, className }) => {
|
|
45133
|
-
const endRef =
|
|
45134
|
-
|
|
45377
|
+
const endRef = React96__default.useRef(null);
|
|
45378
|
+
React96__default.useEffect(() => {
|
|
45135
45379
|
if (!autoScroll) return;
|
|
45136
45380
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
45137
45381
|
}, [messages.length, autoScroll]);
|
|
@@ -45561,7 +45805,7 @@ var init_Timeline = __esm({
|
|
|
45561
45805
|
}) => {
|
|
45562
45806
|
const { t } = useTranslate();
|
|
45563
45807
|
const entityData = entity ?? [];
|
|
45564
|
-
const items =
|
|
45808
|
+
const items = React96__default.useMemo(() => {
|
|
45565
45809
|
if (propItems) return propItems;
|
|
45566
45810
|
if (entityData.length === 0) return [];
|
|
45567
45811
|
return entityData.map((record, idx) => {
|
|
@@ -45663,7 +45907,7 @@ var init_Timeline = __esm({
|
|
|
45663
45907
|
}
|
|
45664
45908
|
});
|
|
45665
45909
|
function extractToastProps(children) {
|
|
45666
|
-
if (!
|
|
45910
|
+
if (!React96__default.isValidElement(children)) {
|
|
45667
45911
|
if (typeof children === "string") {
|
|
45668
45912
|
return { message: children };
|
|
45669
45913
|
}
|
|
@@ -45705,7 +45949,7 @@ var init_ToastSlot = __esm({
|
|
|
45705
45949
|
eventBus.emit(`${prefix}CLOSE`);
|
|
45706
45950
|
};
|
|
45707
45951
|
if (!isVisible) return null;
|
|
45708
|
-
const isCustomContent =
|
|
45952
|
+
const isCustomContent = React96__default.isValidElement(children) && !message;
|
|
45709
45953
|
return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
|
|
45710
45954
|
Toast,
|
|
45711
45955
|
{
|
|
@@ -45722,7 +45966,7 @@ var init_ToastSlot = __esm({
|
|
|
45722
45966
|
}
|
|
45723
45967
|
});
|
|
45724
45968
|
function lazyThree(name, loader) {
|
|
45725
|
-
const Lazy =
|
|
45969
|
+
const Lazy = React96__default.lazy(
|
|
45726
45970
|
() => loader().then((m) => {
|
|
45727
45971
|
const Resolved = m[name];
|
|
45728
45972
|
if (!Resolved) {
|
|
@@ -45734,13 +45978,13 @@ function lazyThree(name, loader) {
|
|
|
45734
45978
|
})
|
|
45735
45979
|
);
|
|
45736
45980
|
function ThreeWrapper(props) {
|
|
45737
|
-
return
|
|
45981
|
+
return React96__default.createElement(
|
|
45738
45982
|
ThreeBoundary,
|
|
45739
45983
|
{ name },
|
|
45740
|
-
|
|
45741
|
-
|
|
45984
|
+
React96__default.createElement(
|
|
45985
|
+
React96__default.Suspense,
|
|
45742
45986
|
{ fallback: null },
|
|
45743
|
-
|
|
45987
|
+
React96__default.createElement(Lazy, props)
|
|
45744
45988
|
)
|
|
45745
45989
|
);
|
|
45746
45990
|
}
|
|
@@ -45763,6 +46007,7 @@ var init_component_registry_generated = __esm({
|
|
|
45763
46007
|
init_AnimatedReveal();
|
|
45764
46008
|
init_ArticleSection();
|
|
45765
46009
|
init_Aside();
|
|
46010
|
+
init_AtlasImage();
|
|
45766
46011
|
init_AuthLayout();
|
|
45767
46012
|
init_Avatar();
|
|
45768
46013
|
init_Badge();
|
|
@@ -46020,7 +46265,7 @@ var init_component_registry_generated = __esm({
|
|
|
46020
46265
|
init_WizardContainer();
|
|
46021
46266
|
init_WizardNavigation();
|
|
46022
46267
|
init_WizardProgress();
|
|
46023
|
-
ThreeBoundary = class extends
|
|
46268
|
+
ThreeBoundary = class extends React96__default.Component {
|
|
46024
46269
|
constructor() {
|
|
46025
46270
|
super(...arguments);
|
|
46026
46271
|
__publicField(this, "state", { failed: false });
|
|
@@ -46030,7 +46275,7 @@ var init_component_registry_generated = __esm({
|
|
|
46030
46275
|
}
|
|
46031
46276
|
render() {
|
|
46032
46277
|
if (this.state.failed) {
|
|
46033
|
-
return
|
|
46278
|
+
return React96__default.createElement(
|
|
46034
46279
|
"div",
|
|
46035
46280
|
{
|
|
46036
46281
|
"data-testid": "three-unavailable",
|
|
@@ -46062,6 +46307,8 @@ var init_component_registry_generated = __esm({
|
|
|
46062
46307
|
"AnimatedReveal": AnimatedReveal,
|
|
46063
46308
|
"ArticleSection": ArticleSection,
|
|
46064
46309
|
"Aside": Aside,
|
|
46310
|
+
"AtlasImage": AtlasImage,
|
|
46311
|
+
"AtlasPanel": AtlasPanel,
|
|
46065
46312
|
"AuthLayout": AuthLayout,
|
|
46066
46313
|
"Avatar": Avatar,
|
|
46067
46314
|
"Badge": Badge,
|
|
@@ -46354,7 +46601,7 @@ function SuspenseConfigProvider({
|
|
|
46354
46601
|
config,
|
|
46355
46602
|
children
|
|
46356
46603
|
}) {
|
|
46357
|
-
return
|
|
46604
|
+
return React96__default.createElement(
|
|
46358
46605
|
SuspenseConfigContext.Provider,
|
|
46359
46606
|
{ value: config },
|
|
46360
46607
|
children
|
|
@@ -46396,7 +46643,7 @@ function enrichFormFields(fields, entityDef) {
|
|
|
46396
46643
|
}
|
|
46397
46644
|
return { name: field, label: field.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (c) => c.toUpperCase()) };
|
|
46398
46645
|
}
|
|
46399
|
-
if (field && typeof field === "object" && !Array.isArray(field) && !
|
|
46646
|
+
if (field && typeof field === "object" && !Array.isArray(field) && !React96__default.isValidElement(field) && !(field instanceof Date)) {
|
|
46400
46647
|
const obj = field;
|
|
46401
46648
|
const fieldName = typeof obj.name === "string" ? obj.name : typeof obj.field === "string" ? obj.field : void 0;
|
|
46402
46649
|
if (!fieldName) return field;
|
|
@@ -46849,7 +47096,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
|
|
|
46849
47096
|
const key = `${parentId}-${index}-trait:${traitName}`;
|
|
46850
47097
|
return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
|
|
46851
47098
|
}
|
|
46852
|
-
return /* @__PURE__ */ jsx(
|
|
47099
|
+
return /* @__PURE__ */ jsx(React96__default.Fragment, { children: child }, `${parentId}-${index}`);
|
|
46853
47100
|
}
|
|
46854
47101
|
if (!child || typeof child !== "object") return null;
|
|
46855
47102
|
const childId = `${parentId}-${index}`;
|
|
@@ -46889,14 +47136,14 @@ function isPatternConfig(value) {
|
|
|
46889
47136
|
if (value === null || value === void 0) return false;
|
|
46890
47137
|
if (typeof value !== "object") return false;
|
|
46891
47138
|
if (Array.isArray(value)) return false;
|
|
46892
|
-
if (
|
|
47139
|
+
if (React96__default.isValidElement(value)) return false;
|
|
46893
47140
|
if (value instanceof Date) return false;
|
|
46894
47141
|
if (typeof value === "function") return false;
|
|
46895
47142
|
const record = value;
|
|
46896
47143
|
return "type" in record && typeof record.type === "string" && getComponentForPattern$1(record.type) !== null;
|
|
46897
47144
|
}
|
|
46898
47145
|
function isPlainConfigObject(value) {
|
|
46899
|
-
if (
|
|
47146
|
+
if (React96__default.isValidElement(value)) return false;
|
|
46900
47147
|
if (value instanceof Date) return false;
|
|
46901
47148
|
const proto = Object.getPrototypeOf(value);
|
|
46902
47149
|
return proto === Object.prototype || proto === null;
|
|
@@ -47022,7 +47269,7 @@ function SlotContentRenderer({
|
|
|
47022
47269
|
for (const slotKey of CONTENT_NODE_SLOTS) {
|
|
47023
47270
|
const slotVal = restProps[slotKey];
|
|
47024
47271
|
if (slotVal === void 0 || slotVal === null) continue;
|
|
47025
|
-
if (
|
|
47272
|
+
if (React96__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
|
|
47026
47273
|
if (Array.isArray(slotVal) || typeof slotVal === "object" && "type" in slotVal) {
|
|
47027
47274
|
nodeSlotOverrides[slotKey] = renderPatternChildren(
|
|
47028
47275
|
slotVal,
|
|
@@ -47071,7 +47318,7 @@ function SlotContentRenderer({
|
|
|
47071
47318
|
const resolvedItems = Array.isArray(entityVal) && entityVal[0] !== "fn" ? entityVal : null;
|
|
47072
47319
|
if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
|
|
47073
47320
|
const sample = resolvedItems[0];
|
|
47074
|
-
if (sample && typeof sample === "object" && !Array.isArray(sample) && !
|
|
47321
|
+
if (sample && typeof sample === "object" && !Array.isArray(sample) && !React96__default.isValidElement(sample) && !(sample instanceof Date)) {
|
|
47075
47322
|
const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
|
|
47076
47323
|
finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
|
|
47077
47324
|
}
|
|
@@ -47232,7 +47479,9 @@ var init_UISlotRenderer = __esm({
|
|
|
47232
47479
|
"content",
|
|
47233
47480
|
"addons",
|
|
47234
47481
|
"hud",
|
|
47235
|
-
"fallback"
|
|
47482
|
+
"fallback",
|
|
47483
|
+
"controls",
|
|
47484
|
+
"overlay"
|
|
47236
47485
|
]);
|
|
47237
47486
|
PATTERNS_WITH_CHILDREN = /* @__PURE__ */ new Set([
|
|
47238
47487
|
"stack",
|
|
@@ -47363,7 +47612,7 @@ function resolveLambdaBindings(body, params, item, index) {
|
|
|
47363
47612
|
if (Array.isArray(body)) {
|
|
47364
47613
|
return body.map((b) => recur(b));
|
|
47365
47614
|
}
|
|
47366
|
-
if (body !== null && typeof body === "object" && !
|
|
47615
|
+
if (body !== null && typeof body === "object" && !React96__default.isValidElement(body) && !(body instanceof Date) && typeof body !== "function") {
|
|
47367
47616
|
const out = {};
|
|
47368
47617
|
for (const [k, v] of Object.entries(body)) {
|
|
47369
47618
|
out[k] = recur(v);
|
|
@@ -47382,7 +47631,7 @@ function getSlotContentRenderer2() {
|
|
|
47382
47631
|
function makeLambdaFn(params, lambdaBody, callerKey) {
|
|
47383
47632
|
return (item, index) => {
|
|
47384
47633
|
const resolvedBody = resolveLambdaBindings(lambdaBody, params, item, index);
|
|
47385
|
-
if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" ||
|
|
47634
|
+
if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" || React96__default.isValidElement(resolvedBody) || resolvedBody instanceof Date) {
|
|
47386
47635
|
return null;
|
|
47387
47636
|
}
|
|
47388
47637
|
const record = resolvedBody;
|
|
@@ -47401,7 +47650,7 @@ function makeLambdaFn(params, lambdaBody, callerKey) {
|
|
|
47401
47650
|
props: childProps,
|
|
47402
47651
|
priority: 0
|
|
47403
47652
|
};
|
|
47404
|
-
return
|
|
47653
|
+
return React96__default.createElement(SlotContentRenderer2, { content: childContent });
|
|
47405
47654
|
};
|
|
47406
47655
|
}
|
|
47407
47656
|
function convertNode(node, callerKey) {
|
|
@@ -47420,7 +47669,7 @@ function convertNode(node, callerKey) {
|
|
|
47420
47669
|
});
|
|
47421
47670
|
return anyChanged ? mapped : node;
|
|
47422
47671
|
}
|
|
47423
|
-
if (typeof node === "object" && !
|
|
47672
|
+
if (typeof node === "object" && !React96__default.isValidElement(node) && !(node instanceof Date)) {
|
|
47424
47673
|
return convertObjectProps(node);
|
|
47425
47674
|
}
|
|
47426
47675
|
return node;
|