@almadar/ui 5.95.0 → 5.96.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 +543 -212
- package/dist/components/game/3d/index.js +371 -36
- package/dist/components/game/3d/molecules/GameCanvas3D.d.ts +34 -3
- package/dist/components/game/3d/molecules/ModelLoader.d.ts +7 -1
- package/dist/components/game/3d/molecules/index.d.ts +0 -1
- 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/providers/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as React98 from 'react';
|
|
2
|
+
import React98__default, { createContext, useContext, useMemo, useRef, useEffect, useCallback, Suspense, useState, useLayoutEffect, lazy, useId, useSyncExternalStore } from 'react';
|
|
3
3
|
import { EventBusContext, useTraitScope, useEntitySchemaOptional, TraitScopeProvider, useCurrentPagePath } from '@almadar/ui/providers';
|
|
4
4
|
import { createLogger, isLogLevelEnabled } from '@almadar/logger';
|
|
5
5
|
import { clsx } from 'clsx';
|
|
@@ -388,7 +388,7 @@ var init_Box = __esm({
|
|
|
388
388
|
fixed: "fixed",
|
|
389
389
|
sticky: "sticky"
|
|
390
390
|
};
|
|
391
|
-
Box =
|
|
391
|
+
Box = React98__default.forwardRef(
|
|
392
392
|
({
|
|
393
393
|
padding,
|
|
394
394
|
paddingX,
|
|
@@ -453,7 +453,7 @@ var init_Box = __esm({
|
|
|
453
453
|
onPointerDown?.(e);
|
|
454
454
|
}, [hoverEvent, tapReveal, triggerProps, onPointerDown]);
|
|
455
455
|
const isClickable = action || onClick;
|
|
456
|
-
return
|
|
456
|
+
return React98__default.createElement(
|
|
457
457
|
Component,
|
|
458
458
|
{
|
|
459
459
|
ref,
|
|
@@ -549,7 +549,7 @@ function loadLib(key, importer) {
|
|
|
549
549
|
return p;
|
|
550
550
|
}
|
|
551
551
|
function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
|
|
552
|
-
const Lazy =
|
|
552
|
+
const Lazy = React98__default.lazy(async () => {
|
|
553
553
|
const lib = await loadLib(libKey, importer);
|
|
554
554
|
const Comp = pick(lib);
|
|
555
555
|
if (!Comp) {
|
|
@@ -559,7 +559,7 @@ function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
|
|
|
559
559
|
return { default: Comp };
|
|
560
560
|
});
|
|
561
561
|
const Wrapped = (props) => /* @__PURE__ */ jsx(
|
|
562
|
-
|
|
562
|
+
React98__default.Suspense,
|
|
563
563
|
{
|
|
564
564
|
fallback: /* @__PURE__ */ jsx(
|
|
565
565
|
"span",
|
|
@@ -1290,7 +1290,7 @@ var init_Icon = __esm({
|
|
|
1290
1290
|
const directIcon = typeof icon === "string" ? void 0 : icon;
|
|
1291
1291
|
const effectiveName = typeof icon === "string" ? icon : name;
|
|
1292
1292
|
const family = useIconFamily();
|
|
1293
|
-
const RenderedComponent =
|
|
1293
|
+
const RenderedComponent = React98__default.useMemo(() => {
|
|
1294
1294
|
if (directIcon) return null;
|
|
1295
1295
|
return effectiveName ? resolveIconForFamily(effectiveName, family) : null;
|
|
1296
1296
|
}, [directIcon, effectiveName, family]);
|
|
@@ -1340,6 +1340,210 @@ var init_Icon = __esm({
|
|
|
1340
1340
|
Icon.displayName = "Icon";
|
|
1341
1341
|
}
|
|
1342
1342
|
});
|
|
1343
|
+
|
|
1344
|
+
// lib/atlasSlice.ts
|
|
1345
|
+
function isTilesheet(a) {
|
|
1346
|
+
return typeof a.tileWidth === "number";
|
|
1347
|
+
}
|
|
1348
|
+
function getAtlas(url, onReady) {
|
|
1349
|
+
if (atlasCache.has(url)) return atlasCache.get(url) ?? void 0;
|
|
1350
|
+
atlasCache.set(url, void 0);
|
|
1351
|
+
fetch(url).then((r) => r.json()).then((json) => {
|
|
1352
|
+
atlasCache.set(url, json);
|
|
1353
|
+
onReady();
|
|
1354
|
+
}).catch(() => {
|
|
1355
|
+
atlasCache.set(url, null);
|
|
1356
|
+
});
|
|
1357
|
+
return void 0;
|
|
1358
|
+
}
|
|
1359
|
+
function subRectFor(atlas, sprite) {
|
|
1360
|
+
if (isTilesheet(atlas)) {
|
|
1361
|
+
let col;
|
|
1362
|
+
let row;
|
|
1363
|
+
if (sprite.includes(",")) {
|
|
1364
|
+
const [c, r] = sprite.split(",").map((n) => Number(n.trim()));
|
|
1365
|
+
col = c;
|
|
1366
|
+
row = r;
|
|
1367
|
+
} else {
|
|
1368
|
+
const i = Number(sprite);
|
|
1369
|
+
if (!Number.isFinite(i)) return null;
|
|
1370
|
+
col = i % atlas.columns;
|
|
1371
|
+
row = Math.floor(i / atlas.columns);
|
|
1372
|
+
}
|
|
1373
|
+
if (!Number.isFinite(col) || !Number.isFinite(row) || col < 0 || row < 0 || col >= atlas.columns || row >= atlas.rows) return null;
|
|
1374
|
+
const margin = atlas.margin ?? 0;
|
|
1375
|
+
const spacing = atlas.spacing ?? 0;
|
|
1376
|
+
return {
|
|
1377
|
+
sx: margin + col * (atlas.tileWidth + spacing),
|
|
1378
|
+
sy: margin + row * (atlas.tileHeight + spacing),
|
|
1379
|
+
sw: atlas.tileWidth,
|
|
1380
|
+
sh: atlas.tileHeight
|
|
1381
|
+
};
|
|
1382
|
+
}
|
|
1383
|
+
const st = atlas.subTextures[sprite];
|
|
1384
|
+
if (!st) return null;
|
|
1385
|
+
return { sx: st.x, sy: st.y, sw: st.width, sh: st.height };
|
|
1386
|
+
}
|
|
1387
|
+
function isAtlasAsset(asset) {
|
|
1388
|
+
return !!asset && typeof asset.atlas === "string" && typeof asset.sprite === "string";
|
|
1389
|
+
}
|
|
1390
|
+
function resolveAssetSource(img, asset, onReady) {
|
|
1391
|
+
if (isAtlasAsset(asset)) {
|
|
1392
|
+
const atlas = getAtlas(asset.atlas, onReady);
|
|
1393
|
+
if (!atlas) return null;
|
|
1394
|
+
const rect = subRectFor(atlas, asset.sprite);
|
|
1395
|
+
if (!rect) return null;
|
|
1396
|
+
return { img, rect, aspect: rect.sw / rect.sh };
|
|
1397
|
+
}
|
|
1398
|
+
const natW = img.naturalWidth || 1;
|
|
1399
|
+
const natH = img.naturalHeight || 1;
|
|
1400
|
+
return { img, rect: null, aspect: natW / natH };
|
|
1401
|
+
}
|
|
1402
|
+
function blit(ctx, src, dx, dy, dw, dh) {
|
|
1403
|
+
if (src.rect) ctx.drawImage(src.img, src.rect.sx, src.rect.sy, src.rect.sw, src.rect.sh, dx, dy, dw, dh);
|
|
1404
|
+
else ctx.drawImage(src.img, dx, dy, dw, dh);
|
|
1405
|
+
}
|
|
1406
|
+
var atlasCache;
|
|
1407
|
+
var init_atlasSlice = __esm({
|
|
1408
|
+
"lib/atlasSlice.ts"() {
|
|
1409
|
+
"use client";
|
|
1410
|
+
atlasCache = /* @__PURE__ */ new Map();
|
|
1411
|
+
}
|
|
1412
|
+
});
|
|
1413
|
+
function useAtlasSliceDataUrl(asset) {
|
|
1414
|
+
const [, bump] = React98.useReducer((x) => x + 1, 0);
|
|
1415
|
+
if (!isAtlasAsset(asset)) return void 0;
|
|
1416
|
+
const key = `${asset.atlas}#${asset.sprite}`;
|
|
1417
|
+
const cached = sliceDataUrlCache.get(key);
|
|
1418
|
+
if (cached) return cached;
|
|
1419
|
+
const atlas = getAtlas(asset.atlas, bump);
|
|
1420
|
+
const img = asset?.url ? getSheetImage(asset.url, bump) : null;
|
|
1421
|
+
if (!atlas || !img) return void 0;
|
|
1422
|
+
const rect = subRectFor(atlas, asset.sprite);
|
|
1423
|
+
if (!rect) return void 0;
|
|
1424
|
+
const canvas = document.createElement("canvas");
|
|
1425
|
+
canvas.width = rect.sw;
|
|
1426
|
+
canvas.height = rect.sh;
|
|
1427
|
+
const ctx = canvas.getContext("2d");
|
|
1428
|
+
if (!ctx) return void 0;
|
|
1429
|
+
ctx.imageSmoothingEnabled = false;
|
|
1430
|
+
ctx.drawImage(img, rect.sx, rect.sy, rect.sw, rect.sh, 0, 0, rect.sw, rect.sh);
|
|
1431
|
+
const url = canvas.toDataURL();
|
|
1432
|
+
sliceDataUrlCache.set(key, url);
|
|
1433
|
+
return url;
|
|
1434
|
+
}
|
|
1435
|
+
function AtlasPanel({ asset, borderSlice = 16, borderWidth = 16, mode = "nineSlice", className, style, children, "aria-hidden": ariaHidden }) {
|
|
1436
|
+
const dataUrl = useAtlasSliceDataUrl(asset);
|
|
1437
|
+
const skin = !dataUrl ? {} : mode === "repeat" ? { backgroundImage: `url(${dataUrl})`, backgroundRepeat: "repeat" } : {
|
|
1438
|
+
borderStyle: "solid",
|
|
1439
|
+
borderWidth,
|
|
1440
|
+
borderImageSource: `url(${dataUrl})`,
|
|
1441
|
+
borderImageSlice: `${borderSlice} fill`,
|
|
1442
|
+
borderImageWidth: borderWidth,
|
|
1443
|
+
borderImageRepeat: "stretch",
|
|
1444
|
+
imageRendering: "pixelated"
|
|
1445
|
+
};
|
|
1446
|
+
return /* @__PURE__ */ jsx("span", { "aria-hidden": ariaHidden, className: cn("inline-block", className), style: { ...skin, ...style }, children });
|
|
1447
|
+
}
|
|
1448
|
+
function getSheetImage(url, onReady) {
|
|
1449
|
+
const cached = imageCache.get(url);
|
|
1450
|
+
if (cached) return cached;
|
|
1451
|
+
(imageWaiters.get(url) ?? imageWaiters.set(url, /* @__PURE__ */ new Set()).get(url)).add(onReady);
|
|
1452
|
+
if (!imageCache.has(url)) {
|
|
1453
|
+
imageCache.set(url, null);
|
|
1454
|
+
const img = new Image();
|
|
1455
|
+
img.crossOrigin = "anonymous";
|
|
1456
|
+
img.onload = () => {
|
|
1457
|
+
imageCache.set(url, img);
|
|
1458
|
+
imageWaiters.get(url)?.forEach((fn) => fn());
|
|
1459
|
+
imageWaiters.delete(url);
|
|
1460
|
+
};
|
|
1461
|
+
img.src = url;
|
|
1462
|
+
}
|
|
1463
|
+
return null;
|
|
1464
|
+
}
|
|
1465
|
+
function AtlasImage({
|
|
1466
|
+
asset,
|
|
1467
|
+
size,
|
|
1468
|
+
width,
|
|
1469
|
+
height,
|
|
1470
|
+
fill = false,
|
|
1471
|
+
fit = "contain",
|
|
1472
|
+
alt,
|
|
1473
|
+
className,
|
|
1474
|
+
style,
|
|
1475
|
+
"aria-hidden": ariaHidden
|
|
1476
|
+
}) {
|
|
1477
|
+
const [, bump] = React98.useReducer((x) => x + 1, 0);
|
|
1478
|
+
const canvasRef = React98.useRef(null);
|
|
1479
|
+
const sliced = isAtlasAsset(asset);
|
|
1480
|
+
const atlas = sliced ? getAtlas(asset.atlas, bump) : void 0;
|
|
1481
|
+
const img = sliced && asset?.url ? getSheetImage(asset.url, bump) : null;
|
|
1482
|
+
const rect = sliced && atlas ? subRectFor(atlas, asset.sprite) : null;
|
|
1483
|
+
React98.useEffect(() => {
|
|
1484
|
+
const canvas = canvasRef.current;
|
|
1485
|
+
if (!canvas || !img || !rect) return;
|
|
1486
|
+
canvas.width = rect.sw;
|
|
1487
|
+
canvas.height = rect.sh;
|
|
1488
|
+
const ctx = canvas.getContext("2d");
|
|
1489
|
+
if (!ctx) return;
|
|
1490
|
+
ctx.imageSmoothingEnabled = false;
|
|
1491
|
+
ctx.clearRect(0, 0, rect.sw, rect.sh);
|
|
1492
|
+
ctx.drawImage(img, rect.sx, rect.sy, rect.sw, rect.sh, 0, 0, rect.sw, rect.sh);
|
|
1493
|
+
}, [img, rect?.sx, rect?.sy, rect?.sw, rect?.sh]);
|
|
1494
|
+
const w = fill ? "100%" : width ?? size;
|
|
1495
|
+
const h = fill ? "100%" : height ?? size;
|
|
1496
|
+
const boxStyle = {
|
|
1497
|
+
...fill ? { position: "absolute", inset: 0 } : {},
|
|
1498
|
+
width: w,
|
|
1499
|
+
height: h,
|
|
1500
|
+
objectFit: fit,
|
|
1501
|
+
imageRendering: "pixelated",
|
|
1502
|
+
...style
|
|
1503
|
+
};
|
|
1504
|
+
if (!asset?.url) return null;
|
|
1505
|
+
if (sliced) {
|
|
1506
|
+
if (!rect || !img) {
|
|
1507
|
+
return /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: cn("inline-block flex-shrink-0", className), style: { ...boxStyle, objectFit: void 0 } });
|
|
1508
|
+
}
|
|
1509
|
+
return /* @__PURE__ */ jsx(
|
|
1510
|
+
"canvas",
|
|
1511
|
+
{
|
|
1512
|
+
ref: canvasRef,
|
|
1513
|
+
role: ariaHidden ? void 0 : "img",
|
|
1514
|
+
"aria-hidden": ariaHidden,
|
|
1515
|
+
"aria-label": ariaHidden ? void 0 : alt ?? asset.name ?? asset.category ?? "",
|
|
1516
|
+
className: cn("flex-shrink-0", className),
|
|
1517
|
+
style: boxStyle
|
|
1518
|
+
}
|
|
1519
|
+
);
|
|
1520
|
+
}
|
|
1521
|
+
return /* @__PURE__ */ jsx(
|
|
1522
|
+
"img",
|
|
1523
|
+
{
|
|
1524
|
+
src: asset.url,
|
|
1525
|
+
alt: alt ?? asset.name ?? asset.category ?? "",
|
|
1526
|
+
"aria-hidden": ariaHidden,
|
|
1527
|
+
...typeof w === "number" ? { width: w } : {},
|
|
1528
|
+
...typeof h === "number" ? { height: h } : {},
|
|
1529
|
+
className: cn("flex-shrink-0", className),
|
|
1530
|
+
style: boxStyle
|
|
1531
|
+
}
|
|
1532
|
+
);
|
|
1533
|
+
}
|
|
1534
|
+
var sliceDataUrlCache, imageCache, imageWaiters;
|
|
1535
|
+
var init_AtlasImage = __esm({
|
|
1536
|
+
"components/core/atoms/AtlasImage.tsx"() {
|
|
1537
|
+
"use client";
|
|
1538
|
+
init_atlasSlice();
|
|
1539
|
+
init_cn();
|
|
1540
|
+
sliceDataUrlCache = /* @__PURE__ */ new Map();
|
|
1541
|
+
AtlasPanel.displayName = "AtlasPanel";
|
|
1542
|
+
imageCache = /* @__PURE__ */ new Map();
|
|
1543
|
+
imageWaiters = /* @__PURE__ */ new Map();
|
|
1544
|
+
AtlasImage.displayName = "AtlasImage";
|
|
1545
|
+
}
|
|
1546
|
+
});
|
|
1343
1547
|
function isIconLike(v) {
|
|
1344
1548
|
return typeof v.render === "function";
|
|
1345
1549
|
}
|
|
@@ -1352,7 +1556,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
1352
1556
|
const IconComp = value;
|
|
1353
1557
|
return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
|
|
1354
1558
|
}
|
|
1355
|
-
if (
|
|
1559
|
+
if (React98__default.isValidElement(value)) {
|
|
1356
1560
|
return value;
|
|
1357
1561
|
}
|
|
1358
1562
|
if (typeof value === "object" && value !== null && isIconLike(value)) {
|
|
@@ -1368,6 +1572,7 @@ var init_Button = __esm({
|
|
|
1368
1572
|
init_cn();
|
|
1369
1573
|
init_useEventBus();
|
|
1370
1574
|
init_Icon();
|
|
1575
|
+
init_AtlasImage();
|
|
1371
1576
|
variantStyles = {
|
|
1372
1577
|
primary: [
|
|
1373
1578
|
"bg-primary text-primary-foreground",
|
|
@@ -1428,7 +1633,7 @@ var init_Button = __esm({
|
|
|
1428
1633
|
md: "h-icon-default w-icon-default",
|
|
1429
1634
|
lg: "h-icon-default w-icon-default"
|
|
1430
1635
|
};
|
|
1431
|
-
Button =
|
|
1636
|
+
Button = React98__default.forwardRef(
|
|
1432
1637
|
({
|
|
1433
1638
|
className,
|
|
1434
1639
|
variant = "primary",
|
|
@@ -1452,7 +1657,7 @@ var init_Button = __esm({
|
|
|
1452
1657
|
const leftIconValue = leftIcon || iconProp;
|
|
1453
1658
|
const rightIconValue = rightIcon || iconRightProp;
|
|
1454
1659
|
const px = size === "sm" ? 16 : size === "lg" ? 20 : 16;
|
|
1455
|
-
const resolvedLeftIcon = iconAsset?.url ? /* @__PURE__ */ jsx(
|
|
1660
|
+
const resolvedLeftIcon = iconAsset?.url ? /* @__PURE__ */ jsx(AtlasImage, { asset: iconAsset, size: px, alt: iconAsset.name ?? iconAsset.category ?? "", className: "flex-shrink-0" }) : resolveIconProp(leftIconValue, iconSizeStyles[size]);
|
|
1456
1661
|
const resolvedRightIcon = resolveIconProp(rightIconValue, iconSizeStyles[size]);
|
|
1457
1662
|
const handleClick = (e) => {
|
|
1458
1663
|
if (action) {
|
|
@@ -1496,7 +1701,7 @@ var Dialog;
|
|
|
1496
1701
|
var init_Dialog = __esm({
|
|
1497
1702
|
"components/core/atoms/Dialog.tsx"() {
|
|
1498
1703
|
init_cn();
|
|
1499
|
-
Dialog =
|
|
1704
|
+
Dialog = React98__default.forwardRef(
|
|
1500
1705
|
({
|
|
1501
1706
|
role = "dialog",
|
|
1502
1707
|
"aria-modal": ariaModal = true,
|
|
@@ -1614,7 +1819,7 @@ var init_Typography = __esm({
|
|
|
1614
1819
|
}) => {
|
|
1615
1820
|
const variant = variantProp ?? (level ? `h${level}` : "body1");
|
|
1616
1821
|
const Component = as || defaultElements[variant];
|
|
1617
|
-
return
|
|
1822
|
+
return React98__default.createElement(
|
|
1618
1823
|
Component,
|
|
1619
1824
|
{
|
|
1620
1825
|
id,
|
|
@@ -2072,6 +2277,7 @@ var init_Badge = __esm({
|
|
|
2072
2277
|
"components/core/atoms/Badge.tsx"() {
|
|
2073
2278
|
init_cn();
|
|
2074
2279
|
init_Icon();
|
|
2280
|
+
init_AtlasImage();
|
|
2075
2281
|
variantStyles3 = {
|
|
2076
2282
|
default: [
|
|
2077
2283
|
"bg-muted text-foreground",
|
|
@@ -2109,7 +2315,7 @@ var init_Badge = __esm({
|
|
|
2109
2315
|
md: "px-2.5 py-1 text-sm",
|
|
2110
2316
|
lg: "px-3 py-1.5 text-base"
|
|
2111
2317
|
};
|
|
2112
|
-
Badge =
|
|
2318
|
+
Badge = React98__default.forwardRef(
|
|
2113
2319
|
({ className, variant = "default", size = "sm", amount, label, icon, iconAsset, children, onRemove, removeLabel, ...props }, ref) => {
|
|
2114
2320
|
const iconSizes3 = {
|
|
2115
2321
|
sm: "h-icon-default w-icon-default",
|
|
@@ -2117,7 +2323,7 @@ var init_Badge = __esm({
|
|
|
2117
2323
|
lg: "h-icon-default w-icon-default"
|
|
2118
2324
|
};
|
|
2119
2325
|
const iconPx = size === "lg" ? 20 : 16;
|
|
2120
|
-
const resolvedIcon = iconAsset?.url ? /* @__PURE__ */ jsx(
|
|
2326
|
+
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;
|
|
2121
2327
|
return /* @__PURE__ */ jsxs(
|
|
2122
2328
|
"span",
|
|
2123
2329
|
{
|
|
@@ -2446,7 +2652,7 @@ var init_SvgFlow = __esm({
|
|
|
2446
2652
|
width = 100,
|
|
2447
2653
|
height = 100
|
|
2448
2654
|
}) => {
|
|
2449
|
-
const markerId =
|
|
2655
|
+
const markerId = React98__default.useMemo(() => {
|
|
2450
2656
|
flowIdCounter += 1;
|
|
2451
2657
|
return `almadar-flow-arrow-${flowIdCounter}`;
|
|
2452
2658
|
}, []);
|
|
@@ -3039,7 +3245,7 @@ var init_SvgRing = __esm({
|
|
|
3039
3245
|
width = 100,
|
|
3040
3246
|
height = 100
|
|
3041
3247
|
}) => {
|
|
3042
|
-
const gradientId =
|
|
3248
|
+
const gradientId = React98__default.useMemo(() => {
|
|
3043
3249
|
ringIdCounter += 1;
|
|
3044
3250
|
return `almadar-ring-glow-${ringIdCounter}`;
|
|
3045
3251
|
}, []);
|
|
@@ -3220,7 +3426,7 @@ var init_Input = __esm({
|
|
|
3220
3426
|
init_cn();
|
|
3221
3427
|
init_Icon();
|
|
3222
3428
|
init_useEventBus();
|
|
3223
|
-
Input =
|
|
3429
|
+
Input = React98__default.forwardRef(
|
|
3224
3430
|
({
|
|
3225
3431
|
className,
|
|
3226
3432
|
inputType,
|
|
@@ -3380,7 +3586,7 @@ var Label;
|
|
|
3380
3586
|
var init_Label = __esm({
|
|
3381
3587
|
"components/core/atoms/Label.tsx"() {
|
|
3382
3588
|
init_cn();
|
|
3383
|
-
Label =
|
|
3589
|
+
Label = React98__default.forwardRef(
|
|
3384
3590
|
({ className, required, children, ...props }, ref) => {
|
|
3385
3591
|
return /* @__PURE__ */ jsxs(
|
|
3386
3592
|
"label",
|
|
@@ -3407,7 +3613,7 @@ var init_Textarea = __esm({
|
|
|
3407
3613
|
"components/core/atoms/Textarea.tsx"() {
|
|
3408
3614
|
init_cn();
|
|
3409
3615
|
init_useEventBus();
|
|
3410
|
-
Textarea =
|
|
3616
|
+
Textarea = React98__default.forwardRef(
|
|
3411
3617
|
({ className, error, onChange, ...props }, ref) => {
|
|
3412
3618
|
const eventBus = useEventBus();
|
|
3413
3619
|
const handleChange = (e) => {
|
|
@@ -3646,7 +3852,7 @@ var init_Select = __esm({
|
|
|
3646
3852
|
init_cn();
|
|
3647
3853
|
init_Icon();
|
|
3648
3854
|
init_useEventBus();
|
|
3649
|
-
Select =
|
|
3855
|
+
Select = React98__default.forwardRef(
|
|
3650
3856
|
(props, _ref) => {
|
|
3651
3857
|
const { multiple, searchable, clearable } = props;
|
|
3652
3858
|
if (multiple || searchable || clearable) {
|
|
@@ -3663,7 +3869,7 @@ var init_Checkbox = __esm({
|
|
|
3663
3869
|
"components/core/atoms/Checkbox.tsx"() {
|
|
3664
3870
|
init_cn();
|
|
3665
3871
|
init_useEventBus();
|
|
3666
|
-
Checkbox =
|
|
3872
|
+
Checkbox = React98__default.forwardRef(
|
|
3667
3873
|
({ className, label, id, onChange, ...props }, ref) => {
|
|
3668
3874
|
const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
3669
3875
|
const eventBus = useEventBus();
|
|
@@ -3717,7 +3923,7 @@ var init_Spinner = __esm({
|
|
|
3717
3923
|
md: "h-6 w-6",
|
|
3718
3924
|
lg: "h-8 w-8"
|
|
3719
3925
|
};
|
|
3720
|
-
Spinner =
|
|
3926
|
+
Spinner = React98__default.forwardRef(
|
|
3721
3927
|
({ className, size = "md", overlay, ...props }, ref) => {
|
|
3722
3928
|
if (overlay) {
|
|
3723
3929
|
return /* @__PURE__ */ jsx(
|
|
@@ -3807,7 +4013,7 @@ var init_Card = __esm({
|
|
|
3807
4013
|
chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
|
|
3808
4014
|
"tile-image-first": "p-0 overflow-hidden"
|
|
3809
4015
|
};
|
|
3810
|
-
Card =
|
|
4016
|
+
Card = React98__default.forwardRef(
|
|
3811
4017
|
({
|
|
3812
4018
|
className,
|
|
3813
4019
|
variant = "bordered",
|
|
@@ -3855,9 +4061,9 @@ var init_Card = __esm({
|
|
|
3855
4061
|
}
|
|
3856
4062
|
);
|
|
3857
4063
|
Card.displayName = "Card";
|
|
3858
|
-
CardHeader =
|
|
4064
|
+
CardHeader = React98__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
3859
4065
|
CardHeader.displayName = "CardHeader";
|
|
3860
|
-
CardTitle =
|
|
4066
|
+
CardTitle = React98__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3861
4067
|
"h3",
|
|
3862
4068
|
{
|
|
3863
4069
|
ref,
|
|
@@ -3870,11 +4076,11 @@ var init_Card = __esm({
|
|
|
3870
4076
|
}
|
|
3871
4077
|
));
|
|
3872
4078
|
CardTitle.displayName = "CardTitle";
|
|
3873
|
-
CardContent =
|
|
4079
|
+
CardContent = React98__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
|
|
3874
4080
|
CardContent.displayName = "CardContent";
|
|
3875
4081
|
CardBody = CardContent;
|
|
3876
4082
|
CardBody.displayName = "CardBody";
|
|
3877
|
-
CardFooter =
|
|
4083
|
+
CardFooter = React98__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3878
4084
|
"div",
|
|
3879
4085
|
{
|
|
3880
4086
|
ref,
|
|
@@ -3929,7 +4135,7 @@ var init_FilterPill = __esm({
|
|
|
3929
4135
|
md: "w-3.5 h-3.5",
|
|
3930
4136
|
lg: "w-4 h-4"
|
|
3931
4137
|
};
|
|
3932
|
-
FilterPill =
|
|
4138
|
+
FilterPill = React98__default.forwardRef(
|
|
3933
4139
|
({
|
|
3934
4140
|
className,
|
|
3935
4141
|
variant = "default",
|
|
@@ -4058,8 +4264,8 @@ var init_Avatar = __esm({
|
|
|
4058
4264
|
actionPayload
|
|
4059
4265
|
}) => {
|
|
4060
4266
|
const eventBus = useEventBus();
|
|
4061
|
-
const [imgFailed, setImgFailed] =
|
|
4062
|
-
|
|
4267
|
+
const [imgFailed, setImgFailed] = React98__default.useState(false);
|
|
4268
|
+
React98__default.useEffect(() => {
|
|
4063
4269
|
setImgFailed(false);
|
|
4064
4270
|
}, [src]);
|
|
4065
4271
|
const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
|
|
@@ -4172,7 +4378,7 @@ var init_Center = __esm({
|
|
|
4172
4378
|
as: Component = "div"
|
|
4173
4379
|
}) => {
|
|
4174
4380
|
const mergedStyle = minHeight ? { minHeight, ...style } : style;
|
|
4175
|
-
return
|
|
4381
|
+
return React98__default.createElement(Component, {
|
|
4176
4382
|
className: cn(
|
|
4177
4383
|
inline ? "inline-flex" : "flex",
|
|
4178
4384
|
horizontal && "justify-center",
|
|
@@ -4440,7 +4646,7 @@ var init_Radio = __esm({
|
|
|
4440
4646
|
md: "w-2.5 h-2.5",
|
|
4441
4647
|
lg: "w-3 h-3"
|
|
4442
4648
|
};
|
|
4443
|
-
Radio =
|
|
4649
|
+
Radio = React98__default.forwardRef(
|
|
4444
4650
|
({
|
|
4445
4651
|
label,
|
|
4446
4652
|
helperText,
|
|
@@ -4457,12 +4663,12 @@ var init_Radio = __esm({
|
|
|
4457
4663
|
onChange,
|
|
4458
4664
|
...props
|
|
4459
4665
|
}, ref) => {
|
|
4460
|
-
const reactId =
|
|
4666
|
+
const reactId = React98__default.useId();
|
|
4461
4667
|
const baseId = id || `radio-${reactId}`;
|
|
4462
4668
|
const hasError = !!error;
|
|
4463
4669
|
const eventBus = useEventBus();
|
|
4464
|
-
const [selected, setSelected] =
|
|
4465
|
-
|
|
4670
|
+
const [selected, setSelected] = React98__default.useState(value);
|
|
4671
|
+
React98__default.useEffect(() => {
|
|
4466
4672
|
if (value !== void 0) setSelected(value);
|
|
4467
4673
|
}, [value]);
|
|
4468
4674
|
const pick = (next, e) => {
|
|
@@ -4644,7 +4850,7 @@ var init_Switch = __esm({
|
|
|
4644
4850
|
"components/core/atoms/Switch.tsx"() {
|
|
4645
4851
|
"use client";
|
|
4646
4852
|
init_cn();
|
|
4647
|
-
Switch =
|
|
4853
|
+
Switch = React98.forwardRef(
|
|
4648
4854
|
({
|
|
4649
4855
|
checked,
|
|
4650
4856
|
defaultChecked = false,
|
|
@@ -4655,10 +4861,10 @@ var init_Switch = __esm({
|
|
|
4655
4861
|
name,
|
|
4656
4862
|
className
|
|
4657
4863
|
}, ref) => {
|
|
4658
|
-
const [isChecked, setIsChecked] =
|
|
4864
|
+
const [isChecked, setIsChecked] = React98.useState(
|
|
4659
4865
|
checked !== void 0 ? checked : defaultChecked
|
|
4660
4866
|
);
|
|
4661
|
-
|
|
4867
|
+
React98.useEffect(() => {
|
|
4662
4868
|
if (checked !== void 0) {
|
|
4663
4869
|
setIsChecked(checked);
|
|
4664
4870
|
}
|
|
@@ -4821,7 +5027,7 @@ var init_Stack = __esm({
|
|
|
4821
5027
|
};
|
|
4822
5028
|
const isHorizontal = direction === "horizontal";
|
|
4823
5029
|
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";
|
|
4824
|
-
return
|
|
5030
|
+
return React98__default.createElement(
|
|
4825
5031
|
Component,
|
|
4826
5032
|
{
|
|
4827
5033
|
className: cn(
|
|
@@ -5021,7 +5227,7 @@ var Aside;
|
|
|
5021
5227
|
var init_Aside = __esm({
|
|
5022
5228
|
"components/core/atoms/Aside.tsx"() {
|
|
5023
5229
|
init_cn();
|
|
5024
|
-
Aside =
|
|
5230
|
+
Aside = React98__default.forwardRef(
|
|
5025
5231
|
({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
|
|
5026
5232
|
);
|
|
5027
5233
|
Aside.displayName = "Aside";
|
|
@@ -5100,9 +5306,9 @@ var init_LawReferenceTooltip = __esm({
|
|
|
5100
5306
|
className
|
|
5101
5307
|
}) => {
|
|
5102
5308
|
const { t } = useTranslate();
|
|
5103
|
-
const [isVisible, setIsVisible] =
|
|
5104
|
-
const timeoutRef =
|
|
5105
|
-
const triggerRef =
|
|
5309
|
+
const [isVisible, setIsVisible] = React98__default.useState(false);
|
|
5310
|
+
const timeoutRef = React98__default.useRef(null);
|
|
5311
|
+
const triggerRef = React98__default.useRef(null);
|
|
5106
5312
|
const handleMouseEnter = () => {
|
|
5107
5313
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
5108
5314
|
timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
|
|
@@ -5113,7 +5319,7 @@ var init_LawReferenceTooltip = __esm({
|
|
|
5113
5319
|
};
|
|
5114
5320
|
const { revealed, triggerProps } = useTapReveal({ refs: [triggerRef] });
|
|
5115
5321
|
const open = isVisible || revealed;
|
|
5116
|
-
|
|
5322
|
+
React98__default.useEffect(() => {
|
|
5117
5323
|
return () => {
|
|
5118
5324
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
5119
5325
|
};
|
|
@@ -5323,7 +5529,7 @@ var init_StatusDot = __esm({
|
|
|
5323
5529
|
md: "w-2.5 h-2.5",
|
|
5324
5530
|
lg: "w-3 h-3"
|
|
5325
5531
|
};
|
|
5326
|
-
StatusDot =
|
|
5532
|
+
StatusDot = React98__default.forwardRef(
|
|
5327
5533
|
({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
|
|
5328
5534
|
return /* @__PURE__ */ jsx(
|
|
5329
5535
|
"span",
|
|
@@ -5377,7 +5583,7 @@ var init_TrendIndicator = __esm({
|
|
|
5377
5583
|
down: "trending-down",
|
|
5378
5584
|
flat: "arrow-right"
|
|
5379
5585
|
};
|
|
5380
|
-
TrendIndicator =
|
|
5586
|
+
TrendIndicator = React98__default.forwardRef(
|
|
5381
5587
|
({
|
|
5382
5588
|
className,
|
|
5383
5589
|
value,
|
|
@@ -5444,7 +5650,7 @@ var init_RangeSlider = __esm({
|
|
|
5444
5650
|
md: "w-4 h-4",
|
|
5445
5651
|
lg: "w-5 h-5"
|
|
5446
5652
|
};
|
|
5447
|
-
RangeSlider =
|
|
5653
|
+
RangeSlider = React98__default.forwardRef(
|
|
5448
5654
|
({
|
|
5449
5655
|
className,
|
|
5450
5656
|
min = 0,
|
|
@@ -6038,7 +6244,7 @@ var init_ContentSection = __esm({
|
|
|
6038
6244
|
md: "py-16",
|
|
6039
6245
|
lg: "py-24"
|
|
6040
6246
|
};
|
|
6041
|
-
ContentSection =
|
|
6247
|
+
ContentSection = React98__default.forwardRef(
|
|
6042
6248
|
({ children, background = "default", padding = "lg", id, className }, ref) => {
|
|
6043
6249
|
return /* @__PURE__ */ jsx(
|
|
6044
6250
|
Box,
|
|
@@ -6572,7 +6778,7 @@ var init_AnimatedReveal = __esm({
|
|
|
6572
6778
|
"scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
|
|
6573
6779
|
"none": {}
|
|
6574
6780
|
};
|
|
6575
|
-
AnimatedReveal =
|
|
6781
|
+
AnimatedReveal = React98__default.forwardRef(
|
|
6576
6782
|
({
|
|
6577
6783
|
trigger = "scroll",
|
|
6578
6784
|
animation = "fade-up",
|
|
@@ -6732,7 +6938,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
6732
6938
|
"components/marketing/atoms/AnimatedGraphic.tsx"() {
|
|
6733
6939
|
"use client";
|
|
6734
6940
|
init_cn();
|
|
6735
|
-
AnimatedGraphic =
|
|
6941
|
+
AnimatedGraphic = React98__default.forwardRef(
|
|
6736
6942
|
({
|
|
6737
6943
|
src,
|
|
6738
6944
|
svgContent,
|
|
@@ -6755,7 +6961,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
6755
6961
|
const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
|
|
6756
6962
|
const resolvedSvg = svgContent ?? fetchedSvg;
|
|
6757
6963
|
const prevAnimateRef = useRef(animate);
|
|
6758
|
-
const setRef =
|
|
6964
|
+
const setRef = React98__default.useCallback(
|
|
6759
6965
|
(node) => {
|
|
6760
6966
|
containerRef.current = node;
|
|
6761
6967
|
if (typeof ref === "function") ref(node);
|
|
@@ -7215,7 +7421,7 @@ function isoToScreen(tileX, tileY, scale, baseOffsetX, layout = "isometric") {
|
|
|
7215
7421
|
}
|
|
7216
7422
|
if (layout === "flat") {
|
|
7217
7423
|
const screenX2 = tileX * scaledTileWidth + baseOffsetX;
|
|
7218
|
-
const screenY2 = tileY *
|
|
7424
|
+
const screenY2 = tileY * scaledTileWidth;
|
|
7219
7425
|
return { x: screenX2, y: screenY2 };
|
|
7220
7426
|
}
|
|
7221
7427
|
const screenX = (tileX - tileY) * (scaledTileWidth / 2) + baseOffsetX;
|
|
@@ -7232,7 +7438,7 @@ function screenToIso(screenX, screenY, scale, baseOffsetX, layout = "isometric")
|
|
|
7232
7438
|
}
|
|
7233
7439
|
if (layout === "flat") {
|
|
7234
7440
|
const col = Math.round((screenX - baseOffsetX) / scaledTileWidth);
|
|
7235
|
-
const row = Math.round(screenY /
|
|
7441
|
+
const row = Math.round(screenY / scaledTileWidth);
|
|
7236
7442
|
return { x: col, y: row };
|
|
7237
7443
|
}
|
|
7238
7444
|
const adjustedX = screenX - baseOffsetX;
|
|
@@ -7306,13 +7512,11 @@ function GameIcon({ assetUrl, icon, size = "md", alt, className }) {
|
|
|
7306
7512
|
const px = typeof size === "number" ? size : sizeMap[size];
|
|
7307
7513
|
if (assetUrl?.url) {
|
|
7308
7514
|
return /* @__PURE__ */ jsx(
|
|
7309
|
-
|
|
7515
|
+
AtlasImage,
|
|
7310
7516
|
{
|
|
7311
|
-
|
|
7517
|
+
asset: assetUrl,
|
|
7518
|
+
size: px,
|
|
7312
7519
|
alt: alt ?? assetUrl.category ?? "",
|
|
7313
|
-
width: px,
|
|
7314
|
-
height: px,
|
|
7315
|
-
style: { imageRendering: "pixelated", objectFit: "contain", width: px, height: px },
|
|
7316
7520
|
className: cn("flex-shrink-0", className)
|
|
7317
7521
|
}
|
|
7318
7522
|
);
|
|
@@ -7326,6 +7530,7 @@ var init_GameIcon = __esm({
|
|
|
7326
7530
|
"use client";
|
|
7327
7531
|
init_cn();
|
|
7328
7532
|
init_Icon();
|
|
7533
|
+
init_AtlasImage();
|
|
7329
7534
|
sizeMap = {
|
|
7330
7535
|
sm: 16,
|
|
7331
7536
|
md: 24,
|
|
@@ -7351,13 +7556,12 @@ function GameCard({
|
|
|
7351
7556
|
className
|
|
7352
7557
|
}) {
|
|
7353
7558
|
const eventBus = useEventBus();
|
|
7354
|
-
const handleClick =
|
|
7559
|
+
const handleClick = React98.useCallback(() => {
|
|
7355
7560
|
if (disabled) return;
|
|
7356
7561
|
onClick?.(id);
|
|
7357
7562
|
if (clickEvent) eventBus.emit(`UI:${clickEvent}`, { cardId: id });
|
|
7358
7563
|
}, [disabled, id, onClick, clickEvent, eventBus]);
|
|
7359
7564
|
const artPx = artPxMap[size];
|
|
7360
|
-
const frameStyle = frameAsset?.url ? { backgroundImage: `url(${frameAsset.url})`, backgroundSize: "100% 100%", backgroundRepeat: "no-repeat" } : {};
|
|
7361
7565
|
return /* @__PURE__ */ jsxs(
|
|
7362
7566
|
Button,
|
|
7363
7567
|
{
|
|
@@ -7365,11 +7569,10 @@ function GameCard({
|
|
|
7365
7569
|
onClick: handleClick,
|
|
7366
7570
|
disabled,
|
|
7367
7571
|
title: name,
|
|
7368
|
-
style: frameStyle,
|
|
7369
7572
|
className: cn(
|
|
7370
|
-
"relative flex flex-col items-center rounded-interactive",
|
|
7371
|
-
"
|
|
7372
|
-
frameAsset?.url ? "border-0" : "border-2",
|
|
7573
|
+
"relative isolate flex flex-col items-center rounded-interactive",
|
|
7574
|
+
"px-1.5 pt-1.5 pb-1 transition-all duration-150",
|
|
7575
|
+
frameAsset?.url ? "border-0" : "border-2 bg-card/90",
|
|
7373
7576
|
cardSizeMap[size],
|
|
7374
7577
|
disabled ? "border-border opacity-50 cursor-not-allowed" : "border-accent hover:brightness-125 hover:-translate-y-1 cursor-pointer",
|
|
7375
7578
|
selected && "ring-2 ring-foreground ring-offset-1 ring-offset-background -translate-y-1",
|
|
@@ -7377,6 +7580,7 @@ function GameCard({
|
|
|
7377
7580
|
className
|
|
7378
7581
|
),
|
|
7379
7582
|
children: [
|
|
7583
|
+
frameAsset?.url && /* @__PURE__ */ jsx(AtlasImage, { asset: frameAsset, fill: true, fit: "fill", "aria-hidden": true, style: { zIndex: -1 } }),
|
|
7380
7584
|
cost != null && /* @__PURE__ */ jsx(
|
|
7381
7585
|
Typography,
|
|
7382
7586
|
{
|
|
@@ -7415,6 +7619,7 @@ var init_GameCard = __esm({
|
|
|
7415
7619
|
init_Box();
|
|
7416
7620
|
init_Button();
|
|
7417
7621
|
init_Typography();
|
|
7622
|
+
init_AtlasImage();
|
|
7418
7623
|
init_GameIcon();
|
|
7419
7624
|
cardSizeMap = {
|
|
7420
7625
|
sm: "w-16 h-24",
|
|
@@ -7575,7 +7780,7 @@ var init_HealthBar = __esm({
|
|
|
7575
7780
|
}
|
|
7576
7781
|
});
|
|
7577
7782
|
function ScoreDisplay({
|
|
7578
|
-
assetUrl
|
|
7783
|
+
assetUrl,
|
|
7579
7784
|
value,
|
|
7580
7785
|
score,
|
|
7581
7786
|
label,
|
|
@@ -7602,7 +7807,7 @@ function ScoreDisplay({
|
|
|
7602
7807
|
}
|
|
7603
7808
|
);
|
|
7604
7809
|
}
|
|
7605
|
-
var sizeMap3
|
|
7810
|
+
var sizeMap3;
|
|
7606
7811
|
var init_ScoreDisplay = __esm({
|
|
7607
7812
|
"components/game/2d/atoms/ScoreDisplay.tsx"() {
|
|
7608
7813
|
init_cn();
|
|
@@ -7616,16 +7821,11 @@ var init_ScoreDisplay = __esm({
|
|
|
7616
7821
|
lg: "text-2xl",
|
|
7617
7822
|
xl: "text-4xl"
|
|
7618
7823
|
};
|
|
7619
|
-
DEFAULT_ASSET_URL = {
|
|
7620
|
-
url: "https://almadar-kflow-assets.web.app/shared/effects/particles/star_01.png",
|
|
7621
|
-
role: "effect",
|
|
7622
|
-
category: "effect"
|
|
7623
|
-
};
|
|
7624
7824
|
ScoreDisplay.displayName = "ScoreDisplay";
|
|
7625
7825
|
}
|
|
7626
7826
|
});
|
|
7627
7827
|
function ControlButton({
|
|
7628
|
-
assetUrl =
|
|
7828
|
+
assetUrl = DEFAULT_ASSET_URL,
|
|
7629
7829
|
label,
|
|
7630
7830
|
icon,
|
|
7631
7831
|
size = "md",
|
|
@@ -7640,9 +7840,9 @@ function ControlButton({
|
|
|
7640
7840
|
className
|
|
7641
7841
|
}) {
|
|
7642
7842
|
const eventBus = useEventBus();
|
|
7643
|
-
const [isPressed, setIsPressed] =
|
|
7843
|
+
const [isPressed, setIsPressed] = React98.useState(false);
|
|
7644
7844
|
const actualPressed = pressed ?? isPressed;
|
|
7645
|
-
const handlePointerDown =
|
|
7845
|
+
const handlePointerDown = React98.useCallback(
|
|
7646
7846
|
(e) => {
|
|
7647
7847
|
e.preventDefault();
|
|
7648
7848
|
if (disabled) return;
|
|
@@ -7652,7 +7852,7 @@ function ControlButton({
|
|
|
7652
7852
|
},
|
|
7653
7853
|
[disabled, pressEvent, eventBus, onPress]
|
|
7654
7854
|
);
|
|
7655
|
-
const handlePointerUp =
|
|
7855
|
+
const handlePointerUp = React98.useCallback(
|
|
7656
7856
|
(e) => {
|
|
7657
7857
|
e.preventDefault();
|
|
7658
7858
|
if (disabled) return;
|
|
@@ -7662,7 +7862,7 @@ function ControlButton({
|
|
|
7662
7862
|
},
|
|
7663
7863
|
[disabled, releaseEvent, eventBus, onRelease]
|
|
7664
7864
|
);
|
|
7665
|
-
const handlePointerLeave =
|
|
7865
|
+
const handlePointerLeave = React98.useCallback(
|
|
7666
7866
|
(e) => {
|
|
7667
7867
|
if (isPressed) {
|
|
7668
7868
|
setIsPressed(false);
|
|
@@ -7703,7 +7903,7 @@ function ControlButton({
|
|
|
7703
7903
|
}
|
|
7704
7904
|
);
|
|
7705
7905
|
}
|
|
7706
|
-
var sizeMap4, shapeMap, variantMap,
|
|
7906
|
+
var sizeMap4, shapeMap, variantMap, DEFAULT_ASSET_URL;
|
|
7707
7907
|
var init_ControlButton = __esm({
|
|
7708
7908
|
"components/game/2d/atoms/ControlButton.tsx"() {
|
|
7709
7909
|
"use client";
|
|
@@ -7730,7 +7930,7 @@ var init_ControlButton = __esm({
|
|
|
7730
7930
|
secondary: "bg-secondary text-secondary-foreground border-border hover:bg-secondary-hover",
|
|
7731
7931
|
ghost: "bg-transparent text-foreground border-border hover:bg-muted"
|
|
7732
7932
|
};
|
|
7733
|
-
|
|
7933
|
+
DEFAULT_ASSET_URL = {
|
|
7734
7934
|
url: "https://almadar-kflow-assets.web.app/shared/effects/particles/circle_01.png",
|
|
7735
7935
|
role: "ui",
|
|
7736
7936
|
category: "control"
|
|
@@ -7823,7 +8023,7 @@ function isKnownState(s) {
|
|
|
7823
8023
|
return s in DEFAULT_STATE_STYLES;
|
|
7824
8024
|
}
|
|
7825
8025
|
function StateIndicator({
|
|
7826
|
-
assetUrl =
|
|
8026
|
+
assetUrl = DEFAULT_ASSET_URL2,
|
|
7827
8027
|
state = "idle",
|
|
7828
8028
|
label,
|
|
7829
8029
|
size = "md",
|
|
@@ -7853,14 +8053,14 @@ function StateIndicator({
|
|
|
7853
8053
|
}
|
|
7854
8054
|
);
|
|
7855
8055
|
}
|
|
7856
|
-
var
|
|
8056
|
+
var DEFAULT_ASSET_URL2, DEFAULT_STATE_STYLES, DEFAULT_STYLE, STATIC_STATES, SIZE_CLASSES;
|
|
7857
8057
|
var init_StateIndicator = __esm({
|
|
7858
8058
|
"components/game/2d/atoms/StateIndicator.tsx"() {
|
|
7859
8059
|
init_Box();
|
|
7860
8060
|
init_Icon();
|
|
7861
8061
|
init_cn();
|
|
7862
8062
|
init_GameIcon();
|
|
7863
|
-
|
|
8063
|
+
DEFAULT_ASSET_URL2 = {
|
|
7864
8064
|
url: "https://almadar-kflow-assets.web.app/shared/isometric-dungeon/Isometric/chestClosed_E.png",
|
|
7865
8065
|
role: "ui",
|
|
7866
8066
|
category: "state"
|
|
@@ -7946,7 +8146,7 @@ var init_TimerDisplay = __esm({
|
|
|
7946
8146
|
}
|
|
7947
8147
|
});
|
|
7948
8148
|
function ResourceCounter({
|
|
7949
|
-
assetUrl =
|
|
8149
|
+
assetUrl = DEFAULT_ASSET_URL3,
|
|
7950
8150
|
icon,
|
|
7951
8151
|
label = "Gold",
|
|
7952
8152
|
value = 250,
|
|
@@ -7979,7 +8179,7 @@ function ResourceCounter({
|
|
|
7979
8179
|
}
|
|
7980
8180
|
);
|
|
7981
8181
|
}
|
|
7982
|
-
var colorTokenClasses2,
|
|
8182
|
+
var colorTokenClasses2, DEFAULT_ASSET_URL3, sizeMap6;
|
|
7983
8183
|
var init_ResourceCounter = __esm({
|
|
7984
8184
|
"components/game/2d/atoms/ResourceCounter.tsx"() {
|
|
7985
8185
|
init_cn();
|
|
@@ -7995,7 +8195,7 @@ var init_ResourceCounter = __esm({
|
|
|
7995
8195
|
error: "text-error",
|
|
7996
8196
|
muted: "text-muted-foreground"
|
|
7997
8197
|
};
|
|
7998
|
-
|
|
8198
|
+
DEFAULT_ASSET_URL3 = {
|
|
7999
8199
|
url: "https://almadar-kflow-assets.web.app/shared/world-map/gold_mine.png",
|
|
8000
8200
|
role: "ui",
|
|
8001
8201
|
category: "coin"
|
|
@@ -8009,7 +8209,7 @@ var init_ResourceCounter = __esm({
|
|
|
8009
8209
|
}
|
|
8010
8210
|
});
|
|
8011
8211
|
function ItemSlot({
|
|
8012
|
-
assetUrl =
|
|
8212
|
+
assetUrl = DEFAULT_ASSET_URL4,
|
|
8013
8213
|
icon = "sword",
|
|
8014
8214
|
label = "Iron Sword",
|
|
8015
8215
|
quantity,
|
|
@@ -8064,7 +8264,7 @@ function ItemSlot({
|
|
|
8064
8264
|
}
|
|
8065
8265
|
);
|
|
8066
8266
|
}
|
|
8067
|
-
var sizeMap7, rarityBorderMap, rarityGlowMap,
|
|
8267
|
+
var sizeMap7, rarityBorderMap, rarityGlowMap, DEFAULT_ASSET_URL4, assetSizeMap;
|
|
8068
8268
|
var init_ItemSlot = __esm({
|
|
8069
8269
|
"components/game/2d/atoms/ItemSlot.tsx"() {
|
|
8070
8270
|
"use client";
|
|
@@ -8094,7 +8294,7 @@ var init_ItemSlot = __esm({
|
|
|
8094
8294
|
epic: "shadow-lg",
|
|
8095
8295
|
legendary: "shadow-lg"
|
|
8096
8296
|
};
|
|
8097
|
-
|
|
8297
|
+
DEFAULT_ASSET_URL4 = {
|
|
8098
8298
|
url: "https://almadar-kflow-assets.web.app/shared/isometric-dungeon/Isometric/chestClosed_E.png",
|
|
8099
8299
|
role: "item",
|
|
8100
8300
|
category: "item"
|
|
@@ -8108,7 +8308,7 @@ var init_ItemSlot = __esm({
|
|
|
8108
8308
|
}
|
|
8109
8309
|
});
|
|
8110
8310
|
function TurnIndicator({
|
|
8111
|
-
assetUrl =
|
|
8311
|
+
assetUrl = DEFAULT_ASSET_URL5,
|
|
8112
8312
|
currentTurn = 1,
|
|
8113
8313
|
maxTurns,
|
|
8114
8314
|
activeTeam,
|
|
@@ -8148,7 +8348,7 @@ function TurnIndicator({
|
|
|
8148
8348
|
}
|
|
8149
8349
|
);
|
|
8150
8350
|
}
|
|
8151
|
-
var sizeMap8,
|
|
8351
|
+
var sizeMap8, DEFAULT_ASSET_URL5;
|
|
8152
8352
|
var init_TurnIndicator = __esm({
|
|
8153
8353
|
"components/game/2d/atoms/TurnIndicator.tsx"() {
|
|
8154
8354
|
init_cn();
|
|
@@ -8160,7 +8360,7 @@ var init_TurnIndicator = __esm({
|
|
|
8160
8360
|
md: { wrapper: "text-sm gap-2 px-3 py-1", dot: "w-2 h-2" },
|
|
8161
8361
|
lg: { wrapper: "text-base gap-2.5 px-4 py-1.5", dot: "w-2.5 h-2.5" }
|
|
8162
8362
|
};
|
|
8163
|
-
|
|
8363
|
+
DEFAULT_ASSET_URL5 = {
|
|
8164
8364
|
url: "https://almadar-kflow-assets.web.app/shared/effects/particles/symbol_01.png",
|
|
8165
8365
|
role: "ui",
|
|
8166
8366
|
category: "turn"
|
|
@@ -8180,7 +8380,7 @@ function getComboScale(combo) {
|
|
|
8180
8380
|
return "";
|
|
8181
8381
|
}
|
|
8182
8382
|
function ComboCounter({
|
|
8183
|
-
assetUrl =
|
|
8383
|
+
assetUrl = DEFAULT_ASSET_URL6,
|
|
8184
8384
|
combo = 5,
|
|
8185
8385
|
multiplier,
|
|
8186
8386
|
streak,
|
|
@@ -8215,14 +8415,14 @@ function ComboCounter({
|
|
|
8215
8415
|
}
|
|
8216
8416
|
);
|
|
8217
8417
|
}
|
|
8218
|
-
var
|
|
8418
|
+
var DEFAULT_ASSET_URL6, sizeMap9;
|
|
8219
8419
|
var init_ComboCounter = __esm({
|
|
8220
8420
|
"components/game/2d/atoms/ComboCounter.tsx"() {
|
|
8221
8421
|
init_cn();
|
|
8222
8422
|
init_Box();
|
|
8223
8423
|
init_Typography();
|
|
8224
8424
|
init_GameIcon();
|
|
8225
|
-
|
|
8425
|
+
DEFAULT_ASSET_URL6 = {
|
|
8226
8426
|
url: "https://almadar-kflow-assets.web.app/shared/effects/flash/flash00.png",
|
|
8227
8427
|
role: "effect",
|
|
8228
8428
|
category: "effect"
|
|
@@ -8236,7 +8436,7 @@ var init_ComboCounter = __esm({
|
|
|
8236
8436
|
}
|
|
8237
8437
|
});
|
|
8238
8438
|
function WaypointMarker({
|
|
8239
|
-
assetUrl =
|
|
8439
|
+
assetUrl = DEFAULT_ASSET_URL7,
|
|
8240
8440
|
label,
|
|
8241
8441
|
icon,
|
|
8242
8442
|
active = true,
|
|
@@ -8296,7 +8496,7 @@ function WaypointMarker({
|
|
|
8296
8496
|
)
|
|
8297
8497
|
] });
|
|
8298
8498
|
}
|
|
8299
|
-
var
|
|
8499
|
+
var DEFAULT_ASSET_URL7, sizeMap10, checkIcon;
|
|
8300
8500
|
var init_WaypointMarker = __esm({
|
|
8301
8501
|
"components/game/2d/atoms/WaypointMarker.tsx"() {
|
|
8302
8502
|
init_cn();
|
|
@@ -8304,7 +8504,7 @@ var init_WaypointMarker = __esm({
|
|
|
8304
8504
|
init_Box();
|
|
8305
8505
|
init_Typography();
|
|
8306
8506
|
init_GameIcon();
|
|
8307
|
-
|
|
8507
|
+
DEFAULT_ASSET_URL7 = {
|
|
8308
8508
|
url: "https://almadar-kflow-assets.web.app/shared/world-map/battle_marker.png",
|
|
8309
8509
|
role: "ui",
|
|
8310
8510
|
category: "waypoint"
|
|
@@ -8325,7 +8525,7 @@ function formatDuration(seconds) {
|
|
|
8325
8525
|
return `${Math.round(seconds)}s`;
|
|
8326
8526
|
}
|
|
8327
8527
|
function StatusEffect({
|
|
8328
|
-
assetUrl =
|
|
8528
|
+
assetUrl = DEFAULT_ASSET_URL8,
|
|
8329
8529
|
icon,
|
|
8330
8530
|
label = "Shield",
|
|
8331
8531
|
duration = 30,
|
|
@@ -8376,7 +8576,7 @@ function StatusEffect({
|
|
|
8376
8576
|
label && /* @__PURE__ */ jsx(Typography, { as: "span", className: "text-xs text-muted-foreground mt-0.5 text-center whitespace-nowrap", children: label })
|
|
8377
8577
|
] });
|
|
8378
8578
|
}
|
|
8379
|
-
var
|
|
8579
|
+
var DEFAULT_ASSET_URL8, sizeMap11, variantStyles7;
|
|
8380
8580
|
var init_StatusEffect = __esm({
|
|
8381
8581
|
"components/game/2d/atoms/StatusEffect.tsx"() {
|
|
8382
8582
|
init_cn();
|
|
@@ -8384,7 +8584,7 @@ var init_StatusEffect = __esm({
|
|
|
8384
8584
|
init_Box();
|
|
8385
8585
|
init_Typography();
|
|
8386
8586
|
init_GameIcon();
|
|
8387
|
-
|
|
8587
|
+
DEFAULT_ASSET_URL8 = {
|
|
8388
8588
|
url: "https://almadar-kflow-assets.web.app/shared/effects/particles/flame_01.png",
|
|
8389
8589
|
role: "ui",
|
|
8390
8590
|
category: "effect"
|
|
@@ -8403,7 +8603,7 @@ var init_StatusEffect = __esm({
|
|
|
8403
8603
|
}
|
|
8404
8604
|
});
|
|
8405
8605
|
function DamageNumber({
|
|
8406
|
-
assetUrl =
|
|
8606
|
+
assetUrl = DEFAULT_ASSET_URL9,
|
|
8407
8607
|
value = 42,
|
|
8408
8608
|
type = "damage",
|
|
8409
8609
|
size = "md",
|
|
@@ -8431,7 +8631,7 @@ function DamageNumber({
|
|
|
8431
8631
|
)
|
|
8432
8632
|
] });
|
|
8433
8633
|
}
|
|
8434
|
-
var sizeMap12, typeStyles, floatKeyframes,
|
|
8634
|
+
var sizeMap12, typeStyles, floatKeyframes, DEFAULT_ASSET_URL9;
|
|
8435
8635
|
var init_DamageNumber = __esm({
|
|
8436
8636
|
"components/game/2d/atoms/DamageNumber.tsx"() {
|
|
8437
8637
|
init_cn();
|
|
@@ -8455,7 +8655,7 @@ var init_DamageNumber = __esm({
|
|
|
8455
8655
|
100% { opacity: 0; transform: translateY(-32px) scale(0.8); }
|
|
8456
8656
|
}
|
|
8457
8657
|
`;
|
|
8458
|
-
|
|
8658
|
+
DEFAULT_ASSET_URL9 = {
|
|
8459
8659
|
url: "https://almadar-kflow-assets.web.app/shared/effects/particles/spark_01.png",
|
|
8460
8660
|
role: "effect",
|
|
8461
8661
|
category: "effect"
|
|
@@ -8581,7 +8781,7 @@ var init_ChoiceButton = __esm({
|
|
|
8581
8781
|
}
|
|
8582
8782
|
});
|
|
8583
8783
|
function ActionButton({
|
|
8584
|
-
assetUrl =
|
|
8784
|
+
assetUrl = DEFAULT_ASSET_URL10,
|
|
8585
8785
|
label = "Attack",
|
|
8586
8786
|
icon,
|
|
8587
8787
|
cooldown = 0,
|
|
@@ -8650,7 +8850,7 @@ function ActionButton({
|
|
|
8650
8850
|
}
|
|
8651
8851
|
);
|
|
8652
8852
|
}
|
|
8653
|
-
var sizeMap13, variantStyles8,
|
|
8853
|
+
var sizeMap13, variantStyles8, DEFAULT_ASSET_URL10;
|
|
8654
8854
|
var init_ActionButton = __esm({
|
|
8655
8855
|
"components/game/2d/atoms/ActionButton.tsx"() {
|
|
8656
8856
|
init_cn();
|
|
@@ -8670,7 +8870,7 @@ var init_ActionButton = __esm({
|
|
|
8670
8870
|
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary-hover border-border",
|
|
8671
8871
|
danger: "bg-error text-error-foreground hover:bg-error/90 border-error"
|
|
8672
8872
|
};
|
|
8673
|
-
|
|
8873
|
+
DEFAULT_ASSET_URL10 = {
|
|
8674
8874
|
url: "https://almadar-kflow-assets.web.app/shared/effects/particles/slash_01.png",
|
|
8675
8875
|
role: "ui",
|
|
8676
8876
|
category: "action"
|
|
@@ -8690,8 +8890,8 @@ function MiniMap({
|
|
|
8690
8890
|
tileAssets,
|
|
8691
8891
|
unitAssets
|
|
8692
8892
|
}) {
|
|
8693
|
-
const canvasRef =
|
|
8694
|
-
const imgCacheRef =
|
|
8893
|
+
const canvasRef = React98.useRef(null);
|
|
8894
|
+
const imgCacheRef = React98.useRef(/* @__PURE__ */ new Map());
|
|
8695
8895
|
function loadImg(url) {
|
|
8696
8896
|
const cached = imgCacheRef.current.get(url);
|
|
8697
8897
|
if (cached) return cached.complete ? cached : null;
|
|
@@ -8706,7 +8906,7 @@ function MiniMap({
|
|
|
8706
8906
|
imgCacheRef.current.set(url, img);
|
|
8707
8907
|
return null;
|
|
8708
8908
|
}
|
|
8709
|
-
|
|
8909
|
+
React98.useEffect(() => {
|
|
8710
8910
|
const canvas = canvasRef.current;
|
|
8711
8911
|
if (!canvas) return;
|
|
8712
8912
|
const ctx = canvas.getContext("2d");
|
|
@@ -8841,8 +9041,8 @@ function ControlGrid({
|
|
|
8841
9041
|
className
|
|
8842
9042
|
}) {
|
|
8843
9043
|
const eventBus = useEventBus();
|
|
8844
|
-
const [active, setActive] =
|
|
8845
|
-
const handlePress =
|
|
9044
|
+
const [active, setActive] = React98.useState(/* @__PURE__ */ new Set());
|
|
9045
|
+
const handlePress = React98.useCallback(
|
|
8846
9046
|
(id) => {
|
|
8847
9047
|
setActive((prev) => new Set(prev).add(id));
|
|
8848
9048
|
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
|
|
@@ -8856,7 +9056,7 @@ function ControlGrid({
|
|
|
8856
9056
|
},
|
|
8857
9057
|
[kind, actionEvent, directionEvent, directionEvents, eventBus, onAction, onDirection]
|
|
8858
9058
|
);
|
|
8859
|
-
const handleRelease =
|
|
9059
|
+
const handleRelease = React98.useCallback(
|
|
8860
9060
|
(id) => {
|
|
8861
9061
|
setActive((prev) => {
|
|
8862
9062
|
const next = new Set(prev);
|
|
@@ -9114,7 +9314,7 @@ function InventoryGrid({
|
|
|
9114
9314
|
const eventBus = useEventBus();
|
|
9115
9315
|
const slotCount = totalSlots ?? items.length;
|
|
9116
9316
|
const emptySlotCount = Math.max(0, slotCount - items.length);
|
|
9117
|
-
const handleSelect =
|
|
9317
|
+
const handleSelect = React98.useCallback(
|
|
9118
9318
|
(id) => {
|
|
9119
9319
|
onSelect?.(id);
|
|
9120
9320
|
if (selectEvent) {
|
|
@@ -9331,7 +9531,7 @@ function GameMenu({
|
|
|
9331
9531
|
}) {
|
|
9332
9532
|
const resolvedOptions = options ?? menuItems ?? DEFAULT_MENU_OPTIONS;
|
|
9333
9533
|
const eventBus = useEventBus();
|
|
9334
|
-
const handleOptionClick =
|
|
9534
|
+
const handleOptionClick = React98.useCallback(
|
|
9335
9535
|
(option) => {
|
|
9336
9536
|
if (option.event) {
|
|
9337
9537
|
eventBus.emit(`UI:${option.event}`, { option });
|
|
@@ -9557,7 +9757,7 @@ function StateGraph({
|
|
|
9557
9757
|
}) {
|
|
9558
9758
|
const eventBus = useEventBus();
|
|
9559
9759
|
const nodes = states ?? [];
|
|
9560
|
-
const positions =
|
|
9760
|
+
const positions = React98.useMemo(() => layoutStates(nodes, width, height), [nodes, width, height]);
|
|
9561
9761
|
return /* @__PURE__ */ jsxs(
|
|
9562
9762
|
Box,
|
|
9563
9763
|
{
|
|
@@ -9616,76 +9816,6 @@ var init_StateGraph = __esm({
|
|
|
9616
9816
|
init_TransitionArrow();
|
|
9617
9817
|
}
|
|
9618
9818
|
});
|
|
9619
|
-
|
|
9620
|
-
// components/game/shared/atlasSlice.ts
|
|
9621
|
-
function isTilesheet(a) {
|
|
9622
|
-
return typeof a.tileWidth === "number";
|
|
9623
|
-
}
|
|
9624
|
-
function getAtlas(url, onReady) {
|
|
9625
|
-
if (atlasCache.has(url)) return atlasCache.get(url) ?? void 0;
|
|
9626
|
-
atlasCache.set(url, void 0);
|
|
9627
|
-
fetch(url).then((r) => r.json()).then((json) => {
|
|
9628
|
-
atlasCache.set(url, json);
|
|
9629
|
-
onReady();
|
|
9630
|
-
}).catch(() => {
|
|
9631
|
-
atlasCache.set(url, null);
|
|
9632
|
-
});
|
|
9633
|
-
return void 0;
|
|
9634
|
-
}
|
|
9635
|
-
function subRectFor(atlas, sprite) {
|
|
9636
|
-
if (isTilesheet(atlas)) {
|
|
9637
|
-
let col;
|
|
9638
|
-
let row;
|
|
9639
|
-
if (sprite.includes(",")) {
|
|
9640
|
-
const [c, r] = sprite.split(",").map((n) => Number(n.trim()));
|
|
9641
|
-
col = c;
|
|
9642
|
-
row = r;
|
|
9643
|
-
} else {
|
|
9644
|
-
const i = Number(sprite);
|
|
9645
|
-
if (!Number.isFinite(i)) return null;
|
|
9646
|
-
col = i % atlas.columns;
|
|
9647
|
-
row = Math.floor(i / atlas.columns);
|
|
9648
|
-
}
|
|
9649
|
-
if (!Number.isFinite(col) || !Number.isFinite(row) || col < 0 || row < 0 || col >= atlas.columns || row >= atlas.rows) return null;
|
|
9650
|
-
const margin = atlas.margin ?? 0;
|
|
9651
|
-
const spacing = atlas.spacing ?? 0;
|
|
9652
|
-
return {
|
|
9653
|
-
sx: margin + col * (atlas.tileWidth + spacing),
|
|
9654
|
-
sy: margin + row * (atlas.tileHeight + spacing),
|
|
9655
|
-
sw: atlas.tileWidth,
|
|
9656
|
-
sh: atlas.tileHeight
|
|
9657
|
-
};
|
|
9658
|
-
}
|
|
9659
|
-
const st = atlas.subTextures[sprite];
|
|
9660
|
-
if (!st) return null;
|
|
9661
|
-
return { sx: st.x, sy: st.y, sw: st.width, sh: st.height };
|
|
9662
|
-
}
|
|
9663
|
-
function isAtlasAsset(asset) {
|
|
9664
|
-
return !!asset && typeof asset.atlas === "string" && typeof asset.sprite === "string";
|
|
9665
|
-
}
|
|
9666
|
-
function resolveAssetSource(img, asset, onReady) {
|
|
9667
|
-
if (isAtlasAsset(asset)) {
|
|
9668
|
-
const atlas = getAtlas(asset.atlas, onReady);
|
|
9669
|
-
if (!atlas) return null;
|
|
9670
|
-
const rect = subRectFor(atlas, asset.sprite);
|
|
9671
|
-
if (!rect) return null;
|
|
9672
|
-
return { img, rect, aspect: rect.sw / rect.sh };
|
|
9673
|
-
}
|
|
9674
|
-
const natW = img.naturalWidth || 1;
|
|
9675
|
-
const natH = img.naturalHeight || 1;
|
|
9676
|
-
return { img, rect: null, aspect: natW / natH };
|
|
9677
|
-
}
|
|
9678
|
-
function blit(ctx, src, dx, dy, dw, dh) {
|
|
9679
|
-
if (src.rect) ctx.drawImage(src.img, src.rect.sx, src.rect.sy, src.rect.sw, src.rect.sh, dx, dy, dw, dh);
|
|
9680
|
-
else ctx.drawImage(src.img, dx, dy, dw, dh);
|
|
9681
|
-
}
|
|
9682
|
-
var atlasCache;
|
|
9683
|
-
var init_atlasSlice = __esm({
|
|
9684
|
-
"components/game/shared/atlasSlice.ts"() {
|
|
9685
|
-
"use client";
|
|
9686
|
-
atlasCache = /* @__PURE__ */ new Map();
|
|
9687
|
-
}
|
|
9688
|
-
});
|
|
9689
9819
|
function useCamera() {
|
|
9690
9820
|
const cameraRef = useRef({ x: 0, y: 0, zoom: 1 });
|
|
9691
9821
|
const targetCameraRef = useRef(null);
|
|
@@ -10093,11 +10223,11 @@ function SideView({
|
|
|
10093
10223
|
const canvasRef = useRef(null);
|
|
10094
10224
|
const eventBus = useEventBus();
|
|
10095
10225
|
const keysRef = useRef(/* @__PURE__ */ new Set());
|
|
10096
|
-
const
|
|
10226
|
+
const imageCache2 = useRef(/* @__PURE__ */ new Map());
|
|
10097
10227
|
const [loadedImages, setLoadedImages] = useState(/* @__PURE__ */ new Set());
|
|
10098
10228
|
const loadImage = useCallback((url) => {
|
|
10099
10229
|
if (!url) return null;
|
|
10100
|
-
const cached =
|
|
10230
|
+
const cached = imageCache2.current.get(url);
|
|
10101
10231
|
if (cached?.complete && cached.naturalWidth > 0) {
|
|
10102
10232
|
if (!loadedImages.has(url)) setLoadedImages((prev) => new Set(prev).add(url));
|
|
10103
10233
|
return cached;
|
|
@@ -10107,7 +10237,7 @@ function SideView({
|
|
|
10107
10237
|
img.crossOrigin = "anonymous";
|
|
10108
10238
|
img.src = url;
|
|
10109
10239
|
img.onload = () => setLoadedImages((prev) => new Set(prev).add(url));
|
|
10110
|
-
|
|
10240
|
+
imageCache2.current.set(url, img);
|
|
10111
10241
|
}
|
|
10112
10242
|
return null;
|
|
10113
10243
|
}, [loadedImages]);
|
|
@@ -10224,7 +10354,10 @@ function SideView({
|
|
|
10224
10354
|
camY = Math.max(0, Math.min(py - ch / 2 - 50, wh - ch));
|
|
10225
10355
|
}
|
|
10226
10356
|
const bgImage = bgImg ? loadImage(bgImg.url) : null;
|
|
10227
|
-
|
|
10357
|
+
const bgSrc = bgImage ? resolveAssetSource(bgImage, bgImg, NOOP) : null;
|
|
10358
|
+
if (bgSrc) {
|
|
10359
|
+
blit(ctx, bgSrc, 0, 0, cw, ch);
|
|
10360
|
+
} else if (bgImage) {
|
|
10228
10361
|
ctx.drawImage(bgImage, 0, 0, cw, ch);
|
|
10229
10362
|
} else if (bg) {
|
|
10230
10363
|
ctx.fillStyle = bg;
|
|
@@ -10422,6 +10555,7 @@ function Canvas2D({
|
|
|
10422
10555
|
const isSide = projection === "side";
|
|
10423
10556
|
const isFree = projection === "free";
|
|
10424
10557
|
const flatLike = projection === "hex" || projection === "flat" || isFree;
|
|
10558
|
+
const squareGrid = projection === "flat";
|
|
10425
10559
|
const tilesProp = Array.isArray(_tilesPropRaw) ? _tilesPropRaw : [];
|
|
10426
10560
|
const unitsProp = Array.isArray(_unitsPropRaw) ? _unitsPropRaw : [];
|
|
10427
10561
|
const featuresProp = Array.isArray(_featuresPropRaw) ? _featuresPropRaw : [];
|
|
@@ -10504,9 +10638,9 @@ function Canvas2D({
|
|
|
10504
10638
|
const effectiveDiamondTopY = diamondTopYProp ?? DIAMOND_TOP_Y;
|
|
10505
10639
|
const scaledDiamondTopY = effectiveDiamondTopY * scale;
|
|
10506
10640
|
const baseOffsetX = useMemo(() => {
|
|
10507
|
-
if (isFree) return 0;
|
|
10641
|
+
if (isFree || projection === "flat") return 0;
|
|
10508
10642
|
return (gridHeight - 1) * (scaledTileWidth / 2);
|
|
10509
|
-
}, [isFree, gridHeight, scaledTileWidth]);
|
|
10643
|
+
}, [isFree, projection, gridHeight, scaledTileWidth]);
|
|
10510
10644
|
const validMoveSet = useMemo(() => new Set(validMoves.map((p) => `${p.x},${p.y}`)), [validMoves]);
|
|
10511
10645
|
const attackTargetSet = useMemo(() => new Set(attackTargets.map((p) => `${p.x},${p.y}`)), [attackTargets]);
|
|
10512
10646
|
const spriteUrls = useMemo(() => {
|
|
@@ -10627,7 +10761,13 @@ function Canvas2D({
|
|
|
10627
10761
|
ctx.clearRect(0, 0, viewportSize.width, viewportSize.height);
|
|
10628
10762
|
if (backgroundImage) {
|
|
10629
10763
|
const bgImg = getImage(backgroundImage.url);
|
|
10630
|
-
|
|
10764
|
+
const bgSrc = bgImg ? resolveAssetSource(bgImg, backgroundImage, bumpAtlas) : null;
|
|
10765
|
+
if (bgSrc?.rect) {
|
|
10766
|
+
const k = Math.max(viewportSize.width / bgSrc.rect.sw, viewportSize.height / bgSrc.rect.sh);
|
|
10767
|
+
const dw = bgSrc.rect.sw * k;
|
|
10768
|
+
const dh = bgSrc.rect.sh * k;
|
|
10769
|
+
blit(ctx, bgSrc, (viewportSize.width - dw) / 2, (viewportSize.height - dh) / 2, dw, dh);
|
|
10770
|
+
} else if (bgImg) {
|
|
10631
10771
|
const cam2 = cameraRef.current;
|
|
10632
10772
|
const patW = bgImg.naturalWidth;
|
|
10633
10773
|
const patH = bgImg.naturalHeight;
|
|
@@ -10663,12 +10803,18 @@ function Canvas2D({
|
|
|
10663
10803
|
const src = img ? resolveAssetSource(img, terrainAsset, bumpAtlas) : null;
|
|
10664
10804
|
if (src) {
|
|
10665
10805
|
const drawW = scaledTileWidth;
|
|
10666
|
-
const drawH = scaledTileWidth / src.aspect;
|
|
10806
|
+
const drawH = squareGrid ? scaledTileWidth : scaledTileWidth / src.aspect;
|
|
10667
10807
|
const drawX = pos.x;
|
|
10668
10808
|
const drawY = flatLike ? pos.y : pos.y + scaledTileHeight - drawH;
|
|
10669
10809
|
blit(ctx, src, drawX, drawY, drawW, drawH);
|
|
10670
10810
|
} else if (img && img.naturalWidth === 0) {
|
|
10671
10811
|
ctx.drawImage(img, pos.x, pos.y, scaledTileWidth, scaledTileHeight);
|
|
10812
|
+
} else if (squareGrid) {
|
|
10813
|
+
ctx.fillStyle = tile.terrain === "water" ? "#3b82f6" : tile.terrain === "mountain" ? "#78716c" : tile.terrain === "stone" ? "#9ca3af" : "#4ade80";
|
|
10814
|
+
ctx.fillRect(pos.x, pos.y, scaledTileWidth, scaledTileWidth);
|
|
10815
|
+
ctx.strokeStyle = "rgba(0,0,0,0.2)";
|
|
10816
|
+
ctx.lineWidth = 1;
|
|
10817
|
+
ctx.strokeRect(pos.x, pos.y, scaledTileWidth, scaledTileWidth);
|
|
10672
10818
|
} else {
|
|
10673
10819
|
const centerX = pos.x + scaledTileWidth / 2;
|
|
10674
10820
|
const topY = pos.y + scaledDiamondTopY;
|
|
@@ -10685,9 +10831,13 @@ function Canvas2D({
|
|
|
10685
10831
|
ctx.stroke();
|
|
10686
10832
|
}
|
|
10687
10833
|
const drawHighlight = (color) => {
|
|
10834
|
+
ctx.fillStyle = color;
|
|
10835
|
+
if (squareGrid) {
|
|
10836
|
+
ctx.fillRect(pos.x, pos.y, scaledTileWidth, scaledTileWidth);
|
|
10837
|
+
return;
|
|
10838
|
+
}
|
|
10688
10839
|
const centerX = pos.x + scaledTileWidth / 2;
|
|
10689
10840
|
const topY = pos.y + scaledDiamondTopY;
|
|
10690
|
-
ctx.fillStyle = color;
|
|
10691
10841
|
ctx.beginPath();
|
|
10692
10842
|
ctx.moveTo(centerX, topY);
|
|
10693
10843
|
ctx.lineTo(pos.x + scaledTileWidth, topY + scaledFloorHeight / 2);
|
|
@@ -10704,7 +10854,7 @@ function Canvas2D({
|
|
|
10704
10854
|
if (attackTargetSet.has(tileKey)) drawHighlight("rgba(239, 68, 68, 0.35)");
|
|
10705
10855
|
if (debug2) {
|
|
10706
10856
|
const centerX = pos.x + scaledTileWidth / 2;
|
|
10707
|
-
const centerY = pos.y + scaledFloorHeight / 2 + scaledDiamondTopY;
|
|
10857
|
+
const centerY = squareGrid ? pos.y + scaledTileWidth / 2 : pos.y + scaledFloorHeight / 2 + scaledDiamondTopY;
|
|
10708
10858
|
ctx.fillStyle = "rgba(0, 0, 0, 0.7)";
|
|
10709
10859
|
ctx.font = `${12 * scale * 2}px monospace`;
|
|
10710
10860
|
ctx.textAlign = "center";
|
|
@@ -10726,9 +10876,9 @@ function Canvas2D({
|
|
|
10726
10876
|
const img = featureAsset?.url ? getImage(featureAsset.url) : null;
|
|
10727
10877
|
const src = img ? resolveAssetSource(img, featureAsset, bumpAtlas) : null;
|
|
10728
10878
|
const centerX = pos.x + scaledTileWidth / 2;
|
|
10729
|
-
const featureGroundY = pos.y + scaledDiamondTopY + scaledFloorHeight * 0.5;
|
|
10879
|
+
const featureGroundY = squareGrid ? pos.y + scaledTileWidth * 0.92 : pos.y + scaledDiamondTopY + scaledFloorHeight * 0.5;
|
|
10730
10880
|
const isCastle = feature.type === "castle";
|
|
10731
|
-
const featureDrawH = isCastle ? scaledFloorHeight * 3.5 : scaledFloorHeight * 1.6;
|
|
10881
|
+
const featureDrawH = squareGrid ? isCastle ? scaledTileWidth * 1.4 : scaledTileWidth * 0.8 : isCastle ? scaledFloorHeight * 3.5 : scaledFloorHeight * 1.6;
|
|
10732
10882
|
const maxFeatureW = isCastle ? scaledTileWidth * 1.8 : scaledTileWidth * 0.7;
|
|
10733
10883
|
if (src) {
|
|
10734
10884
|
const ar = src.aspect;
|
|
@@ -10767,11 +10917,11 @@ function Canvas2D({
|
|
|
10767
10917
|
}
|
|
10768
10918
|
const isSelected = unit.id === selectedUnitId;
|
|
10769
10919
|
const centerX = pos.x + scaledTileWidth / 2;
|
|
10770
|
-
const groundY = pos.y + scaledDiamondTopY + scaledFloorHeight * 0.5;
|
|
10920
|
+
const groundY = squareGrid ? pos.y + scaledTileWidth * 0.92 : pos.y + scaledDiamondTopY + scaledFloorHeight * 0.5;
|
|
10771
10921
|
const breatheOffset = 0;
|
|
10772
10922
|
const unitAsset = resolveUnitAsset(unit);
|
|
10773
10923
|
const img = unitAsset?.url ? getImage(unitAsset.url) : null;
|
|
10774
|
-
const unitDrawH = scaledFloorHeight * spriteHeightRatio * unitScale;
|
|
10924
|
+
const unitDrawH = squareGrid ? scaledTileWidth * 0.55 * spriteHeightRatio * unitScale : scaledFloorHeight * spriteHeightRatio * unitScale;
|
|
10775
10925
|
const maxUnitW = scaledTileWidth * spriteMaxWidthRatio * unitScale;
|
|
10776
10926
|
const unitIsSheet = unit.spriteSheet?.url !== void 0;
|
|
10777
10927
|
const unitSrc = img && !unitIsSheet ? resolveAssetSource(img, unitAsset, bumpAtlas) : null;
|
|
@@ -10790,7 +10940,7 @@ function Canvas2D({
|
|
|
10790
10940
|
if (unit.previousPosition && (unit.previousPosition.x !== unit.position.x || unit.previousPosition.y !== unit.position.y)) {
|
|
10791
10941
|
const ghostPos = project(unit.previousPosition.x, unit.previousPosition.y, baseOffsetX);
|
|
10792
10942
|
const ghostCenterX = ghostPos.x + scaledTileWidth / 2;
|
|
10793
|
-
const ghostGroundY = ghostPos.y + scaledDiamondTopY + scaledFloorHeight * 0.5;
|
|
10943
|
+
const ghostGroundY = squareGrid ? ghostPos.y + scaledTileWidth * 0.92 : ghostPos.y + scaledDiamondTopY + scaledFloorHeight * 0.5;
|
|
10794
10944
|
ctx.save();
|
|
10795
10945
|
ctx.globalAlpha = 0.25;
|
|
10796
10946
|
if (img) {
|
|
@@ -10873,17 +11023,24 @@ function Canvas2D({
|
|
|
10873
11023
|
}
|
|
10874
11024
|
}
|
|
10875
11025
|
for (const fx of effects) {
|
|
10876
|
-
const
|
|
10877
|
-
if (!
|
|
10878
|
-
const img = getImage(
|
|
11026
|
+
const fxAsset = assetManifest?.effects?.[fx.key];
|
|
11027
|
+
if (!fxAsset?.url) continue;
|
|
11028
|
+
const img = getImage(fxAsset.url);
|
|
10879
11029
|
if (!img) continue;
|
|
11030
|
+
const src = resolveAssetSource(img, fxAsset, bumpAtlas);
|
|
10880
11031
|
const pos = project(fx.x, fx.y, baseOffsetX);
|
|
10881
11032
|
const cx = pos.x + scaledTileWidth / 2;
|
|
10882
|
-
const cy = pos.y + scaledDiamondTopY + scaledFloorHeight * 0.5;
|
|
11033
|
+
const cy = squareGrid ? pos.y + scaledTileWidth / 2 : pos.y + scaledDiamondTopY + scaledFloorHeight * 0.5;
|
|
10883
11034
|
const alpha = Math.min(1, fx.ttl / 4);
|
|
10884
11035
|
const prev = ctx.globalAlpha;
|
|
10885
11036
|
ctx.globalAlpha = alpha;
|
|
10886
|
-
|
|
11037
|
+
if (src?.rect) {
|
|
11038
|
+
const dw = scaledTileWidth;
|
|
11039
|
+
const dh = dw / src.aspect;
|
|
11040
|
+
blit(ctx, src, cx - dw / 2, cy - dh / 2, dw, dh);
|
|
11041
|
+
} else {
|
|
11042
|
+
ctx.drawImage(img, cx - img.naturalWidth / 2, cy - img.naturalHeight / 2);
|
|
11043
|
+
}
|
|
10887
11044
|
ctx.globalAlpha = prev;
|
|
10888
11045
|
}
|
|
10889
11046
|
onDrawEffects?.(ctx, 0, getImage);
|
|
@@ -10896,6 +11053,7 @@ function Canvas2D({
|
|
|
10896
11053
|
effects,
|
|
10897
11054
|
project,
|
|
10898
11055
|
flatLike,
|
|
11056
|
+
squareGrid,
|
|
10899
11057
|
scale,
|
|
10900
11058
|
debug2,
|
|
10901
11059
|
resolveTerrainAsset,
|
|
@@ -10929,12 +11087,12 @@ function Canvas2D({
|
|
|
10929
11087
|
if (!unit?.position) return;
|
|
10930
11088
|
const pos = project(unit.position.x, unit.position.y, baseOffsetX);
|
|
10931
11089
|
const centerX = pos.x + scaledTileWidth / 2;
|
|
10932
|
-
const centerY = pos.y + scaledDiamondTopY + scaledFloorHeight / 2;
|
|
11090
|
+
const centerY = squareGrid ? pos.y + scaledTileWidth / 2 : pos.y + scaledDiamondTopY + scaledFloorHeight / 2;
|
|
10933
11091
|
targetCameraRef.current = {
|
|
10934
11092
|
x: centerX - viewportSize.width / 2,
|
|
10935
11093
|
y: centerY - viewportSize.height / 2
|
|
10936
11094
|
};
|
|
10937
|
-
}, [camera, selectedUnitId, units, project, baseOffsetX, scaledTileWidth, scaledDiamondTopY, scaledFloorHeight, viewportSize, targetCameraRef]);
|
|
11095
|
+
}, [camera, selectedUnitId, units, project, baseOffsetX, scaledTileWidth, squareGrid, scaledDiamondTopY, scaledFloorHeight, viewportSize, targetCameraRef]);
|
|
10938
11096
|
useEffect(() => {
|
|
10939
11097
|
if (isSide || !interpolateUnits) return;
|
|
10940
11098
|
unitInterp.onSnapshot(
|
|
@@ -11005,11 +11163,11 @@ function Canvas2D({
|
|
|
11005
11163
|
if (!tileHoverEvent || !canvasRef.current) return;
|
|
11006
11164
|
const world = screenToWorld(e.clientX, e.clientY, canvasRef.current, viewportSize);
|
|
11007
11165
|
const adjustedX = world.x - scaledTileWidth / 2;
|
|
11008
|
-
const adjustedY = world.y - scaledDiamondTopY - scaledFloorHeight / 2;
|
|
11166
|
+
const adjustedY = squareGrid ? world.y - scaledTileWidth / 2 : world.y - scaledDiamondTopY - scaledFloorHeight / 2;
|
|
11009
11167
|
const isoPos = unproject(adjustedX, adjustedY, baseOffsetX);
|
|
11010
11168
|
const tileExists = tilesProp.some((t2) => t2.x === isoPos.x && t2.y === isoPos.y);
|
|
11011
11169
|
if (tileExists) eventBus.emit(`UI:${tileHoverEvent}`, { x: isoPos.x, y: isoPos.y });
|
|
11012
|
-
}, [screenToWorld, viewportSize, scaledTileWidth, scaledDiamondTopY, scaledFloorHeight, unproject, baseOffsetX, tilesProp, tileHoverEvent, eventBus]);
|
|
11170
|
+
}, [screenToWorld, viewportSize, scaledTileWidth, squareGrid, scaledDiamondTopY, scaledFloorHeight, unproject, baseOffsetX, tilesProp, tileHoverEvent, eventBus]);
|
|
11013
11171
|
const handleCanvasPointerUp = useCallback((e) => {
|
|
11014
11172
|
singlePointerActiveRef.current = false;
|
|
11015
11173
|
if (enableCamera) handlePointerUp();
|
|
@@ -11017,7 +11175,7 @@ function Canvas2D({
|
|
|
11017
11175
|
if (!canvasRef.current) return;
|
|
11018
11176
|
const world = screenToWorld(e.clientX, e.clientY, canvasRef.current, viewportSize);
|
|
11019
11177
|
const adjustedX = world.x - scaledTileWidth / 2;
|
|
11020
|
-
const adjustedY = world.y - scaledDiamondTopY - scaledFloorHeight / 2;
|
|
11178
|
+
const adjustedY = squareGrid ? world.y - scaledTileWidth / 2 : world.y - scaledDiamondTopY - scaledFloorHeight / 2;
|
|
11021
11179
|
const isoPos = unproject(adjustedX, adjustedY, baseOffsetX);
|
|
11022
11180
|
const clickedUnit = units.find((u) => u.position?.x === isoPos.x && u.position?.y === isoPos.y);
|
|
11023
11181
|
if (clickedUnit && unitClickEvent) {
|
|
@@ -11026,7 +11184,7 @@ function Canvas2D({
|
|
|
11026
11184
|
const tileExists = tilesProp.some((t2) => t2.x === isoPos.x && t2.y === isoPos.y);
|
|
11027
11185
|
if (tileExists) eventBus.emit(`UI:${tileClickEvent}`, { x: isoPos.x, y: isoPos.y });
|
|
11028
11186
|
}
|
|
11029
|
-
}, [enableCamera, handlePointerUp, dragDistance, screenToWorld, viewportSize, scaledTileWidth, scaledDiamondTopY, scaledFloorHeight, unproject, baseOffsetX, units, tilesProp, unitClickEvent, tileClickEvent, eventBus]);
|
|
11187
|
+
}, [enableCamera, handlePointerUp, dragDistance, screenToWorld, viewportSize, scaledTileWidth, squareGrid, scaledDiamondTopY, scaledFloorHeight, unproject, baseOffsetX, units, tilesProp, unitClickEvent, tileClickEvent, eventBus]);
|
|
11030
11188
|
const handleCanvasPointerLeave = useCallback(() => {
|
|
11031
11189
|
handleMouseLeave();
|
|
11032
11190
|
if (tileLeaveEvent) eventBus.emit(`UI:${tileLeaveEvent}`, {});
|
|
@@ -11076,11 +11234,12 @@ function Canvas2D({
|
|
|
11076
11234
|
return units.filter((u) => !!u.position).map((u) => {
|
|
11077
11235
|
const pos = project(u.position.x, u.position.y, baseOffsetX);
|
|
11078
11236
|
const cam = cameraRef.current;
|
|
11237
|
+
const anchorY = squareGrid ? pos.y + scaledTileWidth * 0.92 : pos.y + scaledDiamondTopY + scaledFloorHeight * 0.5;
|
|
11079
11238
|
const screenX = (pos.x + scaledTileWidth / 2 - (cam.x + viewportSize.width / 2)) * cam.zoom + viewportSize.width / 2;
|
|
11080
|
-
const screenY = (
|
|
11239
|
+
const screenY = (anchorY - (cam.y + viewportSize.height / 2)) * cam.zoom + viewportSize.height / 2;
|
|
11081
11240
|
return { unit: u, screenX, screenY };
|
|
11082
11241
|
});
|
|
11083
|
-
}, [units, project, baseOffsetX, scaledTileWidth, scaledDiamondTopY, scaledFloorHeight, viewportSize, cameraRef]);
|
|
11242
|
+
}, [units, project, baseOffsetX, scaledTileWidth, squareGrid, scaledDiamondTopY, scaledFloorHeight, viewportSize, cameraRef]);
|
|
11084
11243
|
if (error) {
|
|
11085
11244
|
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: [
|
|
11086
11245
|
/* @__PURE__ */ jsx(Icon, { name: "alert-circle", size: "xl" }),
|
|
@@ -11326,7 +11485,7 @@ function LinearView({
|
|
|
11326
11485
|
/* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
|
|
11327
11486
|
const isDone = i < currentIdx;
|
|
11328
11487
|
const isCurrent = i === currentIdx;
|
|
11329
|
-
return /* @__PURE__ */ jsxs(
|
|
11488
|
+
return /* @__PURE__ */ jsxs(React98__default.Fragment, { children: [
|
|
11330
11489
|
i > 0 && /* @__PURE__ */ jsx(
|
|
11331
11490
|
Typography,
|
|
11332
11491
|
{
|
|
@@ -11861,7 +12020,7 @@ function SequenceBar({
|
|
|
11861
12020
|
else onSlotRemove?.(index);
|
|
11862
12021
|
}, [emit, slotRemoveEvent, onSlotRemove, playing]);
|
|
11863
12022
|
const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
|
|
11864
|
-
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(
|
|
12023
|
+
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React98__default.Fragment, { children: [
|
|
11865
12024
|
i > 0 && /* @__PURE__ */ jsx(
|
|
11866
12025
|
Typography,
|
|
11867
12026
|
{
|
|
@@ -14018,82 +14177,167 @@ var init_GameTemplate = __esm({
|
|
|
14018
14177
|
GameTemplate.displayName = "GameTemplate";
|
|
14019
14178
|
}
|
|
14020
14179
|
});
|
|
14021
|
-
var GameShell;
|
|
14180
|
+
var FONT_BASE, GAME_FONTS, FONT_FACES, GameShell;
|
|
14022
14181
|
var init_GameShell = __esm({
|
|
14023
14182
|
"components/game/2d/templates/GameShell.tsx"() {
|
|
14024
14183
|
init_cn();
|
|
14025
14184
|
init_Box();
|
|
14026
|
-
init_Stack();
|
|
14027
14185
|
init_Typography();
|
|
14186
|
+
init_AtlasImage();
|
|
14187
|
+
FONT_BASE = "https://almadar-kflow-assets.web.app/shared/_shared/kenney-fonts/fonts";
|
|
14188
|
+
GAME_FONTS = {
|
|
14189
|
+
future: "Kenney Future",
|
|
14190
|
+
"future-narrow": "Kenney Future Narrow",
|
|
14191
|
+
pixel: "Kenney Pixel",
|
|
14192
|
+
blocks: "Kenney Blocks",
|
|
14193
|
+
mini: "Kenney Mini"
|
|
14194
|
+
};
|
|
14195
|
+
FONT_FACES = `
|
|
14196
|
+
@font-face { font-family: 'Kenney Future'; src: url('${FONT_BASE}/Kenney%20Future.ttf') format('truetype'); font-display: swap; }
|
|
14197
|
+
@font-face { font-family: 'Kenney Future Narrow'; src: url('${FONT_BASE}/Kenney%20Future%20Narrow.ttf') format('truetype'); font-display: swap; }
|
|
14198
|
+
@font-face { font-family: 'Kenney Pixel'; src: url('${FONT_BASE}/Kenney%20Pixel.ttf') format('truetype'); font-display: swap; }
|
|
14199
|
+
@font-face { font-family: 'Kenney Blocks'; src: url('${FONT_BASE}/Kenney%20Blocks.ttf') format('truetype'); font-display: swap; }
|
|
14200
|
+
@font-face { font-family: 'Kenney Mini'; src: url('${FONT_BASE}/Kenney%20Mini.ttf') format('truetype'); font-display: swap; }
|
|
14201
|
+
.game-shell, .game-shell * { font-family: inherit; }
|
|
14202
|
+
`;
|
|
14028
14203
|
GameShell = ({
|
|
14029
14204
|
appName = "Game",
|
|
14030
14205
|
hud,
|
|
14206
|
+
addons,
|
|
14207
|
+
controls,
|
|
14208
|
+
overlay,
|
|
14031
14209
|
className,
|
|
14032
14210
|
showTopBar = true,
|
|
14033
14211
|
children,
|
|
14034
14212
|
backgroundAsset,
|
|
14035
|
-
hudBackgroundAsset
|
|
14213
|
+
hudBackgroundAsset,
|
|
14214
|
+
fontFamily = "future"
|
|
14036
14215
|
}) => {
|
|
14216
|
+
const font = GAME_FONTS[fontFamily] ?? fontFamily;
|
|
14037
14217
|
return /* @__PURE__ */ jsxs(
|
|
14038
14218
|
Box,
|
|
14039
14219
|
{
|
|
14040
|
-
|
|
14041
|
-
className: cn(
|
|
14042
|
-
"game-shell",
|
|
14043
|
-
"flex-col w-full h-screen overflow-hidden",
|
|
14044
|
-
className
|
|
14045
|
-
),
|
|
14220
|
+
className: cn("game-shell", className),
|
|
14046
14221
|
style: {
|
|
14222
|
+
position: "relative",
|
|
14047
14223
|
width: "100vw",
|
|
14048
14224
|
height: "100vh",
|
|
14049
14225
|
overflow: "hidden",
|
|
14050
|
-
background:
|
|
14051
|
-
color: "var(--color-text, #e0e0e0)"
|
|
14226
|
+
background: "var(--color-background, #0a0a0f)",
|
|
14227
|
+
color: "var(--color-text, #e0e0e0)",
|
|
14228
|
+
fontFamily: `'${font}', system-ui, sans-serif`
|
|
14052
14229
|
},
|
|
14053
14230
|
children: [
|
|
14054
|
-
|
|
14231
|
+
/* @__PURE__ */ jsx("style", { children: FONT_FACES }),
|
|
14232
|
+
backgroundAsset && /* @__PURE__ */ jsx(
|
|
14233
|
+
AtlasPanel,
|
|
14234
|
+
{
|
|
14235
|
+
asset: backgroundAsset,
|
|
14236
|
+
mode: "repeat",
|
|
14237
|
+
"aria-hidden": true,
|
|
14238
|
+
className: "game-shell__bg",
|
|
14239
|
+
style: { position: "absolute", inset: 0, opacity: 0.18, zIndex: 0, display: "block" }
|
|
14240
|
+
}
|
|
14241
|
+
),
|
|
14242
|
+
/* @__PURE__ */ jsx(Box, { className: "game-shell__content", style: { position: "absolute", inset: 0, zIndex: 1 }, children }),
|
|
14243
|
+
(showTopBar || hud) && /* @__PURE__ */ jsxs(
|
|
14055
14244
|
Box,
|
|
14056
14245
|
{
|
|
14057
|
-
className: "game-
|
|
14246
|
+
className: "game-shell__top pointer-events-none",
|
|
14058
14247
|
style: {
|
|
14059
|
-
|
|
14060
|
-
|
|
14061
|
-
|
|
14248
|
+
position: "absolute",
|
|
14249
|
+
top: 12,
|
|
14250
|
+
left: 12,
|
|
14251
|
+
right: 12,
|
|
14252
|
+
zIndex: 2,
|
|
14253
|
+
display: "flex",
|
|
14254
|
+
alignItems: "flex-start",
|
|
14255
|
+
gap: 12
|
|
14062
14256
|
},
|
|
14063
14257
|
children: [
|
|
14064
|
-
/* @__PURE__ */ jsx(
|
|
14065
|
-
|
|
14258
|
+
showTopBar && /* @__PURE__ */ jsx(
|
|
14259
|
+
AtlasPanel,
|
|
14066
14260
|
{
|
|
14067
|
-
|
|
14068
|
-
|
|
14069
|
-
|
|
14261
|
+
asset: hudBackgroundAsset,
|
|
14262
|
+
borderSlice: 12,
|
|
14263
|
+
borderWidth: 10,
|
|
14264
|
+
className: "game-shell__title pointer-events-auto",
|
|
14265
|
+
style: {
|
|
14266
|
+
padding: "6px 16px",
|
|
14267
|
+
background: hudBackgroundAsset ? void 0 : "rgba(18, 18, 31, 0.85)",
|
|
14268
|
+
borderRadius: hudBackgroundAsset ? void 0 : 10,
|
|
14269
|
+
boxShadow: "0 4px 14px rgba(0,0,0,0.45)",
|
|
14270
|
+
flexShrink: 0
|
|
14271
|
+
},
|
|
14070
14272
|
children: /* @__PURE__ */ jsx(
|
|
14071
14273
|
Typography,
|
|
14072
14274
|
{
|
|
14073
|
-
|
|
14275
|
+
as: "span",
|
|
14074
14276
|
style: {
|
|
14075
14277
|
fontWeight: 700,
|
|
14076
|
-
|
|
14278
|
+
fontSize: "1.05rem",
|
|
14279
|
+
letterSpacing: "0.06em",
|
|
14280
|
+
textShadow: "0 2px 0 rgba(0,0,0,0.5)",
|
|
14281
|
+
whiteSpace: "nowrap"
|
|
14077
14282
|
},
|
|
14078
14283
|
children: appName
|
|
14079
14284
|
}
|
|
14080
14285
|
)
|
|
14081
14286
|
}
|
|
14082
14287
|
),
|
|
14083
|
-
hud && /* @__PURE__ */ jsx(Box, { className: "game-shell__hud", style: {
|
|
14288
|
+
hud && /* @__PURE__ */ jsx(Box, { className: "game-shell__hud pointer-events-auto", style: { flex: 1, minWidth: 0 }, children: hud })
|
|
14084
14289
|
]
|
|
14085
14290
|
}
|
|
14086
14291
|
),
|
|
14087
|
-
/* @__PURE__ */ jsx(
|
|
14292
|
+
controls && /* @__PURE__ */ jsx(
|
|
14088
14293
|
Box,
|
|
14089
14294
|
{
|
|
14090
|
-
className: "game-
|
|
14295
|
+
className: "game-shell__controls pointer-events-auto",
|
|
14091
14296
|
style: {
|
|
14092
|
-
|
|
14093
|
-
|
|
14094
|
-
|
|
14297
|
+
position: "absolute",
|
|
14298
|
+
left: 16,
|
|
14299
|
+
bottom: 16,
|
|
14300
|
+
zIndex: 2,
|
|
14301
|
+
display: "flex",
|
|
14302
|
+
flexDirection: "column",
|
|
14303
|
+
alignItems: "flex-start",
|
|
14304
|
+
gap: 10,
|
|
14305
|
+
filter: "drop-shadow(0 6px 12px rgba(0,0,0,0.5))"
|
|
14095
14306
|
},
|
|
14096
|
-
children
|
|
14307
|
+
children: controls
|
|
14308
|
+
}
|
|
14309
|
+
),
|
|
14310
|
+
addons && /* @__PURE__ */ jsx(
|
|
14311
|
+
Box,
|
|
14312
|
+
{
|
|
14313
|
+
className: "game-shell__actions pointer-events-auto",
|
|
14314
|
+
style: {
|
|
14315
|
+
position: "absolute",
|
|
14316
|
+
right: 16,
|
|
14317
|
+
bottom: 16,
|
|
14318
|
+
zIndex: 2,
|
|
14319
|
+
display: "flex",
|
|
14320
|
+
flexDirection: "column",
|
|
14321
|
+
alignItems: "flex-end",
|
|
14322
|
+
gap: 10,
|
|
14323
|
+
filter: "drop-shadow(0 6px 12px rgba(0,0,0,0.5))"
|
|
14324
|
+
},
|
|
14325
|
+
children: addons
|
|
14326
|
+
}
|
|
14327
|
+
),
|
|
14328
|
+
overlay && /* @__PURE__ */ jsx(
|
|
14329
|
+
Box,
|
|
14330
|
+
{
|
|
14331
|
+
className: "game-shell__overlay pointer-events-none",
|
|
14332
|
+
style: {
|
|
14333
|
+
position: "absolute",
|
|
14334
|
+
inset: 0,
|
|
14335
|
+
zIndex: 3,
|
|
14336
|
+
display: "flex",
|
|
14337
|
+
alignItems: "center",
|
|
14338
|
+
justifyContent: "center"
|
|
14339
|
+
},
|
|
14340
|
+
children: /* @__PURE__ */ jsx(Box, { className: "pointer-events-auto", children: overlay })
|
|
14097
14341
|
}
|
|
14098
14342
|
)
|
|
14099
14343
|
]
|
|
@@ -14507,7 +14751,7 @@ var init_ErrorBoundary = __esm({
|
|
|
14507
14751
|
}
|
|
14508
14752
|
);
|
|
14509
14753
|
};
|
|
14510
|
-
ErrorBoundary = class extends
|
|
14754
|
+
ErrorBoundary = class extends React98__default.Component {
|
|
14511
14755
|
constructor(props) {
|
|
14512
14756
|
super(props);
|
|
14513
14757
|
__publicField(this, "reset", () => {
|
|
@@ -15172,7 +15416,7 @@ var init_Container = __esm({
|
|
|
15172
15416
|
as: Component = "div"
|
|
15173
15417
|
}) => {
|
|
15174
15418
|
const resolvedSize = maxWidth ?? size ?? "lg";
|
|
15175
|
-
return
|
|
15419
|
+
return React98__default.createElement(
|
|
15176
15420
|
Component,
|
|
15177
15421
|
{
|
|
15178
15422
|
className: cn(
|
|
@@ -17987,7 +18231,7 @@ var init_CodeBlock = __esm({
|
|
|
17987
18231
|
DIFF_STYLE_FALLBACK = { bg: "", prefix: " ", text: "text-foreground" };
|
|
17988
18232
|
LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
17989
18233
|
HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
17990
|
-
CodeBlock =
|
|
18234
|
+
CodeBlock = React98__default.memo(
|
|
17991
18235
|
({
|
|
17992
18236
|
code: rawCode,
|
|
17993
18237
|
language = "text",
|
|
@@ -18574,7 +18818,7 @@ var init_MarkdownContent = __esm({
|
|
|
18574
18818
|
init_Box();
|
|
18575
18819
|
init_CodeBlock();
|
|
18576
18820
|
init_cn();
|
|
18577
|
-
MarkdownContent =
|
|
18821
|
+
MarkdownContent = React98__default.memo(
|
|
18578
18822
|
({ content, direction = "ltr", className }) => {
|
|
18579
18823
|
const { t: _t } = useTranslate();
|
|
18580
18824
|
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
@@ -19901,7 +20145,7 @@ var init_StateMachineView = __esm({
|
|
|
19901
20145
|
style: { top: title ? 30 : 0 },
|
|
19902
20146
|
children: [
|
|
19903
20147
|
entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
|
|
19904
|
-
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(
|
|
20148
|
+
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React98__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
|
|
19905
20149
|
StateNode2,
|
|
19906
20150
|
{
|
|
19907
20151
|
state,
|
|
@@ -25539,8 +25783,8 @@ var init_Menu = __esm({
|
|
|
25539
25783
|
"bottom-end": "bottom-start"
|
|
25540
25784
|
};
|
|
25541
25785
|
const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
|
|
25542
|
-
const triggerChild =
|
|
25543
|
-
const triggerElement =
|
|
25786
|
+
const triggerChild = React98__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
|
|
25787
|
+
const triggerElement = React98__default.cloneElement(
|
|
25544
25788
|
triggerChild,
|
|
25545
25789
|
{
|
|
25546
25790
|
ref: triggerRef,
|
|
@@ -25635,14 +25879,14 @@ function useDataDnd(args) {
|
|
|
25635
25879
|
const isZone = Boolean(dragGroup || accepts || sortable);
|
|
25636
25880
|
const enabled = isZone || Boolean(dndRoot);
|
|
25637
25881
|
const eventBus = useEventBus();
|
|
25638
|
-
const parentRoot =
|
|
25882
|
+
const parentRoot = React98__default.useContext(RootCtx);
|
|
25639
25883
|
const isRoot = enabled && parentRoot === null;
|
|
25640
|
-
const zoneId =
|
|
25884
|
+
const zoneId = React98__default.useId();
|
|
25641
25885
|
const ownGroup = dragGroup ?? accepts ?? zoneId;
|
|
25642
|
-
const [optimisticOrders, setOptimisticOrders] =
|
|
25643
|
-
const optimisticOrdersRef =
|
|
25886
|
+
const [optimisticOrders, setOptimisticOrders] = React98__default.useState(() => /* @__PURE__ */ new Map());
|
|
25887
|
+
const optimisticOrdersRef = React98__default.useRef(optimisticOrders);
|
|
25644
25888
|
optimisticOrdersRef.current = optimisticOrders;
|
|
25645
|
-
const clearOptimisticOrder =
|
|
25889
|
+
const clearOptimisticOrder = React98__default.useCallback((group) => {
|
|
25646
25890
|
setOptimisticOrders((prev) => {
|
|
25647
25891
|
if (!prev.has(group)) return prev;
|
|
25648
25892
|
const next = new Map(prev);
|
|
@@ -25667,7 +25911,7 @@ function useDataDnd(args) {
|
|
|
25667
25911
|
const raw = it[dndItemIdField];
|
|
25668
25912
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
25669
25913
|
}).join("|");
|
|
25670
|
-
const itemIds =
|
|
25914
|
+
const itemIds = React98__default.useMemo(
|
|
25671
25915
|
() => orderedItems.map((it, idx) => {
|
|
25672
25916
|
const raw = it[dndItemIdField];
|
|
25673
25917
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
@@ -25678,7 +25922,7 @@ function useDataDnd(args) {
|
|
|
25678
25922
|
const raw = it[dndItemIdField];
|
|
25679
25923
|
return raw != null ? String(raw) : `__${idx}`;
|
|
25680
25924
|
}).join("|");
|
|
25681
|
-
|
|
25925
|
+
React98__default.useEffect(() => {
|
|
25682
25926
|
const root = isRoot ? null : parentRoot;
|
|
25683
25927
|
if (root) {
|
|
25684
25928
|
root.clearOptimisticOrder(ownGroup);
|
|
@@ -25686,20 +25930,20 @@ function useDataDnd(args) {
|
|
|
25686
25930
|
clearOptimisticOrder(ownGroup);
|
|
25687
25931
|
}
|
|
25688
25932
|
}, [itemsContentSig, ownGroup]);
|
|
25689
|
-
const zonesRef =
|
|
25690
|
-
const registerZone =
|
|
25933
|
+
const zonesRef = React98__default.useRef(/* @__PURE__ */ new Map());
|
|
25934
|
+
const registerZone = React98__default.useCallback((zoneId2, meta2) => {
|
|
25691
25935
|
zonesRef.current.set(zoneId2, meta2);
|
|
25692
25936
|
}, []);
|
|
25693
|
-
const unregisterZone =
|
|
25937
|
+
const unregisterZone = React98__default.useCallback((zoneId2) => {
|
|
25694
25938
|
zonesRef.current.delete(zoneId2);
|
|
25695
25939
|
}, []);
|
|
25696
|
-
const [activeDrag, setActiveDrag] =
|
|
25697
|
-
const [overZoneGroup, setOverZoneGroup] =
|
|
25698
|
-
const meta =
|
|
25940
|
+
const [activeDrag, setActiveDrag] = React98__default.useState(null);
|
|
25941
|
+
const [overZoneGroup, setOverZoneGroup] = React98__default.useState(null);
|
|
25942
|
+
const meta = React98__default.useMemo(
|
|
25699
25943
|
() => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
|
|
25700
25944
|
[ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
|
|
25701
25945
|
);
|
|
25702
|
-
|
|
25946
|
+
React98__default.useEffect(() => {
|
|
25703
25947
|
const target = isRoot ? null : parentRoot;
|
|
25704
25948
|
if (!target) {
|
|
25705
25949
|
zonesRef.current.set(zoneId, meta);
|
|
@@ -25718,7 +25962,7 @@ function useDataDnd(args) {
|
|
|
25718
25962
|
}, [parentRoot, isRoot, zoneId, meta]);
|
|
25719
25963
|
const sensors = useAlmadarDndSensors(true);
|
|
25720
25964
|
const collisionDetection = almadarDndCollisionDetection;
|
|
25721
|
-
const findZoneByItem =
|
|
25965
|
+
const findZoneByItem = React98__default.useCallback(
|
|
25722
25966
|
(id) => {
|
|
25723
25967
|
for (const z of zonesRef.current.values()) {
|
|
25724
25968
|
if (z.itemIds.includes(id)) return z;
|
|
@@ -25727,7 +25971,7 @@ function useDataDnd(args) {
|
|
|
25727
25971
|
},
|
|
25728
25972
|
[]
|
|
25729
25973
|
);
|
|
25730
|
-
|
|
25974
|
+
React98__default.useCallback(
|
|
25731
25975
|
(group) => {
|
|
25732
25976
|
for (const z of zonesRef.current.values()) {
|
|
25733
25977
|
if (z.group === group) return z;
|
|
@@ -25736,7 +25980,7 @@ function useDataDnd(args) {
|
|
|
25736
25980
|
},
|
|
25737
25981
|
[]
|
|
25738
25982
|
);
|
|
25739
|
-
const handleDragEnd =
|
|
25983
|
+
const handleDragEnd = React98__default.useCallback(
|
|
25740
25984
|
(event) => {
|
|
25741
25985
|
const { active, over } = event;
|
|
25742
25986
|
const activeIdStr = String(active.id);
|
|
@@ -25827,8 +26071,8 @@ function useDataDnd(args) {
|
|
|
25827
26071
|
},
|
|
25828
26072
|
[eventBus]
|
|
25829
26073
|
);
|
|
25830
|
-
const sortableData =
|
|
25831
|
-
const SortableItem =
|
|
26074
|
+
const sortableData = React98__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
|
|
26075
|
+
const SortableItem = React98__default.useCallback(
|
|
25832
26076
|
({ id, children }) => {
|
|
25833
26077
|
const {
|
|
25834
26078
|
attributes,
|
|
@@ -25868,7 +26112,7 @@ function useDataDnd(args) {
|
|
|
25868
26112
|
id: droppableId,
|
|
25869
26113
|
data: sortableData
|
|
25870
26114
|
});
|
|
25871
|
-
const ctx =
|
|
26115
|
+
const ctx = React98__default.useContext(RootCtx);
|
|
25872
26116
|
const activeDrag2 = ctx?.activeDrag ?? null;
|
|
25873
26117
|
const overZoneGroup2 = ctx?.overZoneGroup ?? null;
|
|
25874
26118
|
const isThisZoneOver = overZoneGroup2 === ownGroup;
|
|
@@ -25883,7 +26127,7 @@ function useDataDnd(args) {
|
|
|
25883
26127
|
showForeignPlaceholder,
|
|
25884
26128
|
ctxAvailable: ctx != null
|
|
25885
26129
|
});
|
|
25886
|
-
|
|
26130
|
+
React98__default.useEffect(() => {
|
|
25887
26131
|
dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
|
|
25888
26132
|
}, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
|
|
25889
26133
|
return /* @__PURE__ */ jsx(
|
|
@@ -25897,11 +26141,11 @@ function useDataDnd(args) {
|
|
|
25897
26141
|
}
|
|
25898
26142
|
);
|
|
25899
26143
|
};
|
|
25900
|
-
const rootContextValue =
|
|
26144
|
+
const rootContextValue = React98__default.useMemo(
|
|
25901
26145
|
() => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
|
|
25902
26146
|
[registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
|
|
25903
26147
|
);
|
|
25904
|
-
const handleDragStart =
|
|
26148
|
+
const handleDragStart = React98__default.useCallback((event) => {
|
|
25905
26149
|
const sourceZone = findZoneByItem(event.active.id);
|
|
25906
26150
|
const rect = event.active.rect.current.initial;
|
|
25907
26151
|
const height = rect?.height && rect.height > 0 ? rect.height : 64;
|
|
@@ -25920,7 +26164,7 @@ function useDataDnd(args) {
|
|
|
25920
26164
|
isRoot
|
|
25921
26165
|
});
|
|
25922
26166
|
}, [findZoneByItem, isRoot, zoneId]);
|
|
25923
|
-
const handleDragOver =
|
|
26167
|
+
const handleDragOver = React98__default.useCallback((event) => {
|
|
25924
26168
|
const { active, over } = event;
|
|
25925
26169
|
const overData = over?.data?.current;
|
|
25926
26170
|
const overGroup = overData?.dndGroup ?? null;
|
|
@@ -25990,7 +26234,7 @@ function useDataDnd(args) {
|
|
|
25990
26234
|
return next;
|
|
25991
26235
|
});
|
|
25992
26236
|
}, []);
|
|
25993
|
-
const handleDragCancel =
|
|
26237
|
+
const handleDragCancel = React98__default.useCallback((event) => {
|
|
25994
26238
|
setActiveDrag(null);
|
|
25995
26239
|
setOverZoneGroup(null);
|
|
25996
26240
|
dndLog.warn("dragCancel", {
|
|
@@ -25998,12 +26242,12 @@ function useDataDnd(args) {
|
|
|
25998
26242
|
reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
|
|
25999
26243
|
});
|
|
26000
26244
|
}, []);
|
|
26001
|
-
const handleDragEndWithCleanup =
|
|
26245
|
+
const handleDragEndWithCleanup = React98__default.useCallback((event) => {
|
|
26002
26246
|
handleDragEnd(event);
|
|
26003
26247
|
setActiveDrag(null);
|
|
26004
26248
|
setOverZoneGroup(null);
|
|
26005
26249
|
}, [handleDragEnd]);
|
|
26006
|
-
const wrapContainer =
|
|
26250
|
+
const wrapContainer = React98__default.useCallback(
|
|
26007
26251
|
(children) => {
|
|
26008
26252
|
if (!enabled) return children;
|
|
26009
26253
|
const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
|
|
@@ -26057,7 +26301,7 @@ var init_useDataDnd = __esm({
|
|
|
26057
26301
|
init_useAlmadarDndCollision();
|
|
26058
26302
|
init_Box();
|
|
26059
26303
|
dndLog = createLogger("almadar:ui:dnd");
|
|
26060
|
-
RootCtx =
|
|
26304
|
+
RootCtx = React98__default.createContext(null);
|
|
26061
26305
|
}
|
|
26062
26306
|
});
|
|
26063
26307
|
function renderIconInput(icon, props) {
|
|
@@ -26583,7 +26827,7 @@ function DataList({
|
|
|
26583
26827
|
}) {
|
|
26584
26828
|
const eventBus = useEventBus();
|
|
26585
26829
|
const { t } = useTranslate();
|
|
26586
|
-
const [visibleCount, setVisibleCount] =
|
|
26830
|
+
const [visibleCount, setVisibleCount] = React98__default.useState(pageSize || Infinity);
|
|
26587
26831
|
const fieldDefs = fields ?? columns ?? [];
|
|
26588
26832
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
26589
26833
|
const dnd = useDataDnd({
|
|
@@ -26602,7 +26846,7 @@ function DataList({
|
|
|
26602
26846
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
26603
26847
|
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
26604
26848
|
const hasRenderProp = typeof children === "function";
|
|
26605
|
-
|
|
26849
|
+
React98__default.useEffect(() => {
|
|
26606
26850
|
const renderItemTypeOf = typeof schemaRenderItem;
|
|
26607
26851
|
const childrenTypeOf = typeof children;
|
|
26608
26852
|
if (data.length > 0 && !hasRenderProp) {
|
|
@@ -26706,7 +26950,7 @@ function DataList({
|
|
|
26706
26950
|
const items2 = [...data];
|
|
26707
26951
|
const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
|
|
26708
26952
|
const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
|
|
26709
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
26953
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React98__default.Fragment, { children: [
|
|
26710
26954
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
|
|
26711
26955
|
group.items.map((itemData, index) => {
|
|
26712
26956
|
const id = itemData.id || `${gi}-${index}`;
|
|
@@ -26847,7 +27091,7 @@ function DataList({
|
|
|
26847
27091
|
className
|
|
26848
27092
|
),
|
|
26849
27093
|
children: [
|
|
26850
|
-
groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
27094
|
+
groups.map((group, gi) => /* @__PURE__ */ jsxs(React98__default.Fragment, { children: [
|
|
26851
27095
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
|
|
26852
27096
|
group.items.map(
|
|
26853
27097
|
(itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
|
|
@@ -26932,7 +27176,7 @@ var init_FormSection = __esm({
|
|
|
26932
27176
|
columns = 1,
|
|
26933
27177
|
className
|
|
26934
27178
|
}) => {
|
|
26935
|
-
const [collapsed, setCollapsed] =
|
|
27179
|
+
const [collapsed, setCollapsed] = React98__default.useState(defaultCollapsed);
|
|
26936
27180
|
const { t } = useTranslate();
|
|
26937
27181
|
const eventBus = useEventBus();
|
|
26938
27182
|
const gridClass = {
|
|
@@ -26940,7 +27184,7 @@ var init_FormSection = __esm({
|
|
|
26940
27184
|
2: "grid-cols-1 md:grid-cols-2",
|
|
26941
27185
|
3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
|
|
26942
27186
|
}[columns];
|
|
26943
|
-
|
|
27187
|
+
React98__default.useCallback(() => {
|
|
26944
27188
|
if (collapsible) {
|
|
26945
27189
|
setCollapsed((prev) => !prev);
|
|
26946
27190
|
eventBus.emit("UI:TOGGLE_COLLAPSE", { collapsed: !collapsed });
|
|
@@ -27890,7 +28134,7 @@ var init_Flex = __esm({
|
|
|
27890
28134
|
flexStyle.flexBasis = typeof basis === "number" ? `${basis}px` : basis;
|
|
27891
28135
|
}
|
|
27892
28136
|
}
|
|
27893
|
-
return
|
|
28137
|
+
return React98__default.createElement(Component, {
|
|
27894
28138
|
className: cn(
|
|
27895
28139
|
inline ? "inline-flex" : "flex",
|
|
27896
28140
|
directionStyles[direction],
|
|
@@ -28009,7 +28253,7 @@ var init_Grid = __esm({
|
|
|
28009
28253
|
as: Component = "div"
|
|
28010
28254
|
}) => {
|
|
28011
28255
|
const mergedStyle = rows2 ? { gridTemplateRows: `repeat(${rows2}, minmax(0, 1fr))`, ...style } : style;
|
|
28012
|
-
return
|
|
28256
|
+
return React98__default.createElement(
|
|
28013
28257
|
Component,
|
|
28014
28258
|
{
|
|
28015
28259
|
className: cn(
|
|
@@ -28205,9 +28449,9 @@ var init_Popover = __esm({
|
|
|
28205
28449
|
onMouseLeave: handleClose,
|
|
28206
28450
|
onPointerDown: tapTriggerProps.onPointerDown
|
|
28207
28451
|
};
|
|
28208
|
-
const childElement =
|
|
28452
|
+
const childElement = React98__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
28209
28453
|
const childPointerDown = childElement.props.onPointerDown;
|
|
28210
|
-
const triggerElement =
|
|
28454
|
+
const triggerElement = React98__default.cloneElement(
|
|
28211
28455
|
childElement,
|
|
28212
28456
|
{
|
|
28213
28457
|
ref: triggerRef,
|
|
@@ -28809,9 +29053,9 @@ var init_Tooltip = __esm({
|
|
|
28809
29053
|
if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
|
|
28810
29054
|
};
|
|
28811
29055
|
}, []);
|
|
28812
|
-
const triggerElement =
|
|
29056
|
+
const triggerElement = React98__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
28813
29057
|
const childPointerDown = triggerElement.props.onPointerDown;
|
|
28814
|
-
const trigger =
|
|
29058
|
+
const trigger = React98__default.cloneElement(triggerElement, {
|
|
28815
29059
|
ref: triggerRef,
|
|
28816
29060
|
onMouseEnter: handleMouseEnter,
|
|
28817
29061
|
onMouseLeave: handleMouseLeave,
|
|
@@ -28901,7 +29145,7 @@ var init_WizardProgress = __esm({
|
|
|
28901
29145
|
children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
|
|
28902
29146
|
const isActive = index === currentStep;
|
|
28903
29147
|
const isCompleted = index < currentStep;
|
|
28904
|
-
return /* @__PURE__ */ jsxs(
|
|
29148
|
+
return /* @__PURE__ */ jsxs(React98__default.Fragment, { children: [
|
|
28905
29149
|
/* @__PURE__ */ jsx(
|
|
28906
29150
|
"button",
|
|
28907
29151
|
{
|
|
@@ -30461,13 +30705,13 @@ var init_MapView = __esm({
|
|
|
30461
30705
|
shadowSize: [41, 41]
|
|
30462
30706
|
});
|
|
30463
30707
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
30464
|
-
const { useEffect:
|
|
30708
|
+
const { useEffect: useEffect68, useRef: useRef65, useCallback: useCallback103, useState: useState98 } = React98__default;
|
|
30465
30709
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
30466
30710
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
30467
30711
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
30468
30712
|
const map = useMap();
|
|
30469
|
-
const prevRef =
|
|
30470
|
-
|
|
30713
|
+
const prevRef = useRef65({ centerLat, centerLng, zoom });
|
|
30714
|
+
useEffect68(() => {
|
|
30471
30715
|
const prev = prevRef.current;
|
|
30472
30716
|
if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
|
|
30473
30717
|
map.setView([centerLat, centerLng], zoom);
|
|
@@ -30478,7 +30722,7 @@ var init_MapView = __esm({
|
|
|
30478
30722
|
}
|
|
30479
30723
|
function MapClickHandler({ onMapClick }) {
|
|
30480
30724
|
const map = useMap();
|
|
30481
|
-
|
|
30725
|
+
useEffect68(() => {
|
|
30482
30726
|
if (!onMapClick) return;
|
|
30483
30727
|
const handler = (e) => {
|
|
30484
30728
|
onMapClick(e.latlng.lat, e.latlng.lng);
|
|
@@ -31376,8 +31620,8 @@ function TableView({
|
|
|
31376
31620
|
}) {
|
|
31377
31621
|
const eventBus = useEventBus();
|
|
31378
31622
|
const { t } = useTranslate();
|
|
31379
|
-
const [visibleCount, setVisibleCount] =
|
|
31380
|
-
const [localSelected, setLocalSelected] =
|
|
31623
|
+
const [visibleCount, setVisibleCount] = React98__default.useState(pageSize > 0 ? pageSize : Infinity);
|
|
31624
|
+
const [localSelected, setLocalSelected] = React98__default.useState(/* @__PURE__ */ new Set());
|
|
31381
31625
|
const colDefs = columns ?? fields ?? [];
|
|
31382
31626
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
31383
31627
|
const dnd = useDataDnd({
|
|
@@ -31572,12 +31816,12 @@ function TableView({
|
|
|
31572
31816
|
]
|
|
31573
31817
|
}
|
|
31574
31818
|
);
|
|
31575
|
-
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(
|
|
31819
|
+
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React98__default.Fragment, { children: rowInner }, id);
|
|
31576
31820
|
};
|
|
31577
31821
|
const items = Array.from(data);
|
|
31578
31822
|
const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
|
|
31579
31823
|
let runningIndex = 0;
|
|
31580
|
-
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
31824
|
+
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React98__default.Fragment, { children: [
|
|
31581
31825
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
|
|
31582
31826
|
group.items.map((row) => renderRow(row, runningIndex++))
|
|
31583
31827
|
] }, gi)) });
|
|
@@ -32934,7 +33178,7 @@ var init_StepFlow = __esm({
|
|
|
32934
33178
|
className
|
|
32935
33179
|
}) => {
|
|
32936
33180
|
if (orientation === "vertical") {
|
|
32937
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(
|
|
33181
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React98__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
|
|
32938
33182
|
/* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
|
|
32939
33183
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
32940
33184
|
showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
|
|
@@ -32945,7 +33189,7 @@ var init_StepFlow = __esm({
|
|
|
32945
33189
|
] })
|
|
32946
33190
|
] }) }, index)) });
|
|
32947
33191
|
}
|
|
32948
|
-
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(
|
|
33192
|
+
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(React98__default.Fragment, { children: [
|
|
32949
33193
|
/* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
|
|
32950
33194
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
32951
33195
|
/* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
|
|
@@ -33930,7 +34174,7 @@ var init_LikertScale = __esm({
|
|
|
33930
34174
|
md: "text-base",
|
|
33931
34175
|
lg: "text-lg"
|
|
33932
34176
|
};
|
|
33933
|
-
LikertScale =
|
|
34177
|
+
LikertScale = React98__default.forwardRef(
|
|
33934
34178
|
({
|
|
33935
34179
|
question,
|
|
33936
34180
|
options = DEFAULT_LIKERT_OPTIONS,
|
|
@@ -33942,7 +34186,7 @@ var init_LikertScale = __esm({
|
|
|
33942
34186
|
variant = "radios",
|
|
33943
34187
|
className
|
|
33944
34188
|
}, ref) => {
|
|
33945
|
-
const groupId =
|
|
34189
|
+
const groupId = React98__default.useId();
|
|
33946
34190
|
const eventBus = useEventBus();
|
|
33947
34191
|
const handleSelect = useCallback(
|
|
33948
34192
|
(next) => {
|
|
@@ -36224,7 +36468,7 @@ var init_DocBreadcrumb = __esm({
|
|
|
36224
36468
|
"aria-label": t("aria.breadcrumb"),
|
|
36225
36469
|
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
|
|
36226
36470
|
const isLast = idx === items.length - 1;
|
|
36227
|
-
return /* @__PURE__ */ jsxs(
|
|
36471
|
+
return /* @__PURE__ */ jsxs(React98__default.Fragment, { children: [
|
|
36228
36472
|
idx > 0 && /* @__PURE__ */ jsx(
|
|
36229
36473
|
Icon,
|
|
36230
36474
|
{
|
|
@@ -37093,7 +37337,7 @@ var init_MiniStateMachine = __esm({
|
|
|
37093
37337
|
const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
|
|
37094
37338
|
const tc = transitionCounts[s.name] ?? 0;
|
|
37095
37339
|
const role = getStateRole(s.name, s.isInitial ?? void 0, s.isTerminal ?? void 0, tc, maxTC);
|
|
37096
|
-
return /* @__PURE__ */ jsxs(
|
|
37340
|
+
return /* @__PURE__ */ jsxs(React98__default.Fragment, { children: [
|
|
37097
37341
|
/* @__PURE__ */ jsx(
|
|
37098
37342
|
AvlState,
|
|
37099
37343
|
{
|
|
@@ -37297,7 +37541,7 @@ var init_PageHeader = __esm({
|
|
|
37297
37541
|
info: "bg-info/10 text-info"
|
|
37298
37542
|
};
|
|
37299
37543
|
return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
|
|
37300
|
-
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(
|
|
37544
|
+
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(React98__default.Fragment, { children: [
|
|
37301
37545
|
idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
|
|
37302
37546
|
crumb.href ? /* @__PURE__ */ jsx(
|
|
37303
37547
|
"a",
|
|
@@ -37655,7 +37899,7 @@ var init_Section = __esm({
|
|
|
37655
37899
|
as: Component = "section"
|
|
37656
37900
|
}) => {
|
|
37657
37901
|
const hasHeader = title || description || action;
|
|
37658
|
-
return
|
|
37902
|
+
return React98__default.createElement(
|
|
37659
37903
|
Component,
|
|
37660
37904
|
{
|
|
37661
37905
|
className: cn(
|
|
@@ -38029,7 +38273,7 @@ var init_WizardContainer = __esm({
|
|
|
38029
38273
|
const isCompleted = index < currentStep;
|
|
38030
38274
|
const stepKey = step.id ?? step.tabId ?? `step-${index}`;
|
|
38031
38275
|
const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
|
|
38032
|
-
return /* @__PURE__ */ jsxs(
|
|
38276
|
+
return /* @__PURE__ */ jsxs(React98__default.Fragment, { children: [
|
|
38033
38277
|
/* @__PURE__ */ jsx(
|
|
38034
38278
|
Button,
|
|
38035
38279
|
{
|
|
@@ -40462,7 +40706,7 @@ var init_DetailPanel = __esm({
|
|
|
40462
40706
|
}
|
|
40463
40707
|
});
|
|
40464
40708
|
function extractTitle(children) {
|
|
40465
|
-
if (!
|
|
40709
|
+
if (!React98__default.isValidElement(children)) return void 0;
|
|
40466
40710
|
const props = children.props;
|
|
40467
40711
|
if (typeof props.title === "string") {
|
|
40468
40712
|
return props.title;
|
|
@@ -40812,12 +41056,12 @@ var init_Form = __esm({
|
|
|
40812
41056
|
const isSchemaEntity = isOrbitalEntitySchema(entity);
|
|
40813
41057
|
const resolvedEntity = isSchemaEntity ? entity : void 0;
|
|
40814
41058
|
const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
|
|
40815
|
-
const normalizedInitialData =
|
|
41059
|
+
const normalizedInitialData = React98__default.useMemo(() => {
|
|
40816
41060
|
const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
|
|
40817
41061
|
const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
|
|
40818
41062
|
return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
|
|
40819
41063
|
}, [entity, initialData]);
|
|
40820
|
-
const entityDerivedFields =
|
|
41064
|
+
const entityDerivedFields = React98__default.useMemo(() => {
|
|
40821
41065
|
if (fields && fields.length > 0) return void 0;
|
|
40822
41066
|
if (!resolvedEntity) return void 0;
|
|
40823
41067
|
return resolvedEntity.fields.map(
|
|
@@ -40838,16 +41082,16 @@ var init_Form = __esm({
|
|
|
40838
41082
|
const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
|
|
40839
41083
|
const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
|
|
40840
41084
|
const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
|
|
40841
|
-
const [formData, setFormData] =
|
|
41085
|
+
const [formData, setFormData] = React98__default.useState(
|
|
40842
41086
|
normalizedInitialData
|
|
40843
41087
|
);
|
|
40844
|
-
const [collapsedSections, setCollapsedSections] =
|
|
41088
|
+
const [collapsedSections, setCollapsedSections] = React98__default.useState(
|
|
40845
41089
|
/* @__PURE__ */ new Set()
|
|
40846
41090
|
);
|
|
40847
|
-
const [submitError, setSubmitError] =
|
|
40848
|
-
const formRef =
|
|
41091
|
+
const [submitError, setSubmitError] = React98__default.useState(null);
|
|
41092
|
+
const formRef = React98__default.useRef(null);
|
|
40849
41093
|
const formMode = props.mode;
|
|
40850
|
-
const mountedRef =
|
|
41094
|
+
const mountedRef = React98__default.useRef(false);
|
|
40851
41095
|
if (!mountedRef.current) {
|
|
40852
41096
|
mountedRef.current = true;
|
|
40853
41097
|
debug("forms", "mount", {
|
|
@@ -40860,7 +41104,7 @@ var init_Form = __esm({
|
|
|
40860
41104
|
});
|
|
40861
41105
|
}
|
|
40862
41106
|
const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
|
|
40863
|
-
const evalContext =
|
|
41107
|
+
const evalContext = React98__default.useMemo(
|
|
40864
41108
|
() => ({
|
|
40865
41109
|
formValues: formData,
|
|
40866
41110
|
globalVariables: externalContext?.globalVariables ?? {},
|
|
@@ -40869,7 +41113,7 @@ var init_Form = __esm({
|
|
|
40869
41113
|
}),
|
|
40870
41114
|
[formData, externalContext]
|
|
40871
41115
|
);
|
|
40872
|
-
|
|
41116
|
+
React98__default.useEffect(() => {
|
|
40873
41117
|
debug("forms", "initialData-sync", {
|
|
40874
41118
|
mode: formMode,
|
|
40875
41119
|
normalizedInitialData,
|
|
@@ -40880,7 +41124,7 @@ var init_Form = __esm({
|
|
|
40880
41124
|
setFormData(normalizedInitialData);
|
|
40881
41125
|
}
|
|
40882
41126
|
}, [normalizedInitialData]);
|
|
40883
|
-
const processCalculations =
|
|
41127
|
+
const processCalculations = React98__default.useCallback(
|
|
40884
41128
|
(changedFieldId, newFormData) => {
|
|
40885
41129
|
if (!hiddenCalculations.length) return;
|
|
40886
41130
|
const context = {
|
|
@@ -40905,7 +41149,7 @@ var init_Form = __esm({
|
|
|
40905
41149
|
},
|
|
40906
41150
|
[hiddenCalculations, externalContext, eventBus]
|
|
40907
41151
|
);
|
|
40908
|
-
const checkViolations =
|
|
41152
|
+
const checkViolations = React98__default.useCallback(
|
|
40909
41153
|
(changedFieldId, newFormData) => {
|
|
40910
41154
|
if (!violationTriggers.length) return;
|
|
40911
41155
|
const context = {
|
|
@@ -40943,7 +41187,7 @@ var init_Form = __esm({
|
|
|
40943
41187
|
processCalculations(name, newFormData);
|
|
40944
41188
|
checkViolations(name, newFormData);
|
|
40945
41189
|
};
|
|
40946
|
-
const isFieldVisible =
|
|
41190
|
+
const isFieldVisible = React98__default.useCallback(
|
|
40947
41191
|
(fieldName) => {
|
|
40948
41192
|
const condition = conditionalFields[fieldName];
|
|
40949
41193
|
if (!condition) return true;
|
|
@@ -40951,7 +41195,7 @@ var init_Form = __esm({
|
|
|
40951
41195
|
},
|
|
40952
41196
|
[conditionalFields, evalContext]
|
|
40953
41197
|
);
|
|
40954
|
-
const isSectionVisible =
|
|
41198
|
+
const isSectionVisible = React98__default.useCallback(
|
|
40955
41199
|
(section) => {
|
|
40956
41200
|
if (!section.condition) return true;
|
|
40957
41201
|
return Boolean(evaluateFormExpression(section.condition, evalContext));
|
|
@@ -41027,7 +41271,7 @@ var init_Form = __esm({
|
|
|
41027
41271
|
eventBus.emit(`UI:${onCancel}`);
|
|
41028
41272
|
}
|
|
41029
41273
|
};
|
|
41030
|
-
const renderField =
|
|
41274
|
+
const renderField = React98__default.useCallback(
|
|
41031
41275
|
(field) => {
|
|
41032
41276
|
const fieldName = field.name || field.field;
|
|
41033
41277
|
if (!fieldName) return null;
|
|
@@ -41048,7 +41292,7 @@ var init_Form = __esm({
|
|
|
41048
41292
|
[formData, isFieldVisible, relationsData, relationsLoading, isLoading]
|
|
41049
41293
|
);
|
|
41050
41294
|
const effectiveFields = entityDerivedFields ?? fields;
|
|
41051
|
-
const normalizedFields =
|
|
41295
|
+
const normalizedFields = React98__default.useMemo(() => {
|
|
41052
41296
|
if (!effectiveFields || effectiveFields.length === 0) return [];
|
|
41053
41297
|
return effectiveFields.map((field) => {
|
|
41054
41298
|
if (typeof field === "string") {
|
|
@@ -41072,7 +41316,7 @@ var init_Form = __esm({
|
|
|
41072
41316
|
return field;
|
|
41073
41317
|
});
|
|
41074
41318
|
}, [effectiveFields, resolvedEntity]);
|
|
41075
|
-
const schemaFields =
|
|
41319
|
+
const schemaFields = React98__default.useMemo(() => {
|
|
41076
41320
|
if (normalizedFields.length === 0) return null;
|
|
41077
41321
|
if (isDebugEnabled()) {
|
|
41078
41322
|
debugGroup(`Form: ${entityName || "unknown"}`);
|
|
@@ -41082,7 +41326,7 @@ var init_Form = __esm({
|
|
|
41082
41326
|
}
|
|
41083
41327
|
return normalizedFields.map(renderField).filter(Boolean);
|
|
41084
41328
|
}, [normalizedFields, renderField, entityName, conditionalFields]);
|
|
41085
|
-
const sectionElements =
|
|
41329
|
+
const sectionElements = React98__default.useMemo(() => {
|
|
41086
41330
|
if (!sections || sections.length === 0) return null;
|
|
41087
41331
|
return sections.map((section) => {
|
|
41088
41332
|
if (!isSectionVisible(section)) {
|
|
@@ -41807,7 +42051,7 @@ var init_List = __esm({
|
|
|
41807
42051
|
if (entity && typeof entity === "object" && "id" in entity) return [entity];
|
|
41808
42052
|
return [];
|
|
41809
42053
|
}, [entity]);
|
|
41810
|
-
const getItemActions =
|
|
42054
|
+
const getItemActions = React98__default.useCallback(
|
|
41811
42055
|
(item) => {
|
|
41812
42056
|
if (!itemActions) return [];
|
|
41813
42057
|
if (typeof itemActions === "function") {
|
|
@@ -42282,7 +42526,7 @@ var init_MediaGallery = __esm({
|
|
|
42282
42526
|
[selectable, selectedItems, selectionEvent, eventBus]
|
|
42283
42527
|
);
|
|
42284
42528
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
42285
|
-
const items =
|
|
42529
|
+
const items = React98__default.useMemo(() => {
|
|
42286
42530
|
if (propItems) return propItems;
|
|
42287
42531
|
if (entityData.length === 0) return [];
|
|
42288
42532
|
return entityData.map((record, idx) => {
|
|
@@ -42445,7 +42689,7 @@ var init_MediaGallery = __esm({
|
|
|
42445
42689
|
}
|
|
42446
42690
|
});
|
|
42447
42691
|
function extractTitle2(children) {
|
|
42448
|
-
if (!
|
|
42692
|
+
if (!React98__default.isValidElement(children)) return void 0;
|
|
42449
42693
|
const props = children.props;
|
|
42450
42694
|
if (typeof props.title === "string") {
|
|
42451
42695
|
return props.title;
|
|
@@ -42700,7 +42944,7 @@ var init_debugRegistry = __esm({
|
|
|
42700
42944
|
}
|
|
42701
42945
|
});
|
|
42702
42946
|
function useDebugData() {
|
|
42703
|
-
const [data, setData] =
|
|
42947
|
+
const [data, setData] = React98.useState(() => ({
|
|
42704
42948
|
traits: [],
|
|
42705
42949
|
ticks: [],
|
|
42706
42950
|
guards: [],
|
|
@@ -42714,7 +42958,7 @@ function useDebugData() {
|
|
|
42714
42958
|
},
|
|
42715
42959
|
lastUpdate: Date.now()
|
|
42716
42960
|
}));
|
|
42717
|
-
|
|
42961
|
+
React98.useEffect(() => {
|
|
42718
42962
|
const updateData = () => {
|
|
42719
42963
|
setData({
|
|
42720
42964
|
traits: getAllTraits(),
|
|
@@ -42823,12 +43067,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
|
|
|
42823
43067
|
return positions;
|
|
42824
43068
|
}
|
|
42825
43069
|
function WalkMinimap() {
|
|
42826
|
-
const [walkStep, setWalkStep] =
|
|
42827
|
-
const [traits2, setTraits] =
|
|
42828
|
-
const [coveredEdges, setCoveredEdges] =
|
|
42829
|
-
const [completedTraits, setCompletedTraits] =
|
|
42830
|
-
const prevTraitRef =
|
|
42831
|
-
|
|
43070
|
+
const [walkStep, setWalkStep] = React98.useState(null);
|
|
43071
|
+
const [traits2, setTraits] = React98.useState([]);
|
|
43072
|
+
const [coveredEdges, setCoveredEdges] = React98.useState([]);
|
|
43073
|
+
const [completedTraits, setCompletedTraits] = React98.useState(/* @__PURE__ */ new Set());
|
|
43074
|
+
const prevTraitRef = React98.useRef(null);
|
|
43075
|
+
React98.useEffect(() => {
|
|
42832
43076
|
const interval = setInterval(() => {
|
|
42833
43077
|
const w = window;
|
|
42834
43078
|
const step = w.__orbitalWalkStep;
|
|
@@ -43264,15 +43508,15 @@ var init_EntitiesTab = __esm({
|
|
|
43264
43508
|
});
|
|
43265
43509
|
function EventFlowTab({ events: events2 }) {
|
|
43266
43510
|
const { t } = useTranslate();
|
|
43267
|
-
const [filter, setFilter] =
|
|
43268
|
-
const containerRef =
|
|
43269
|
-
const [autoScroll, setAutoScroll] =
|
|
43270
|
-
|
|
43511
|
+
const [filter, setFilter] = React98.useState("all");
|
|
43512
|
+
const containerRef = React98.useRef(null);
|
|
43513
|
+
const [autoScroll, setAutoScroll] = React98.useState(true);
|
|
43514
|
+
React98.useEffect(() => {
|
|
43271
43515
|
if (autoScroll && containerRef.current) {
|
|
43272
43516
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
43273
43517
|
}
|
|
43274
43518
|
}, [events2.length, autoScroll]);
|
|
43275
|
-
const filteredEvents =
|
|
43519
|
+
const filteredEvents = React98.useMemo(() => {
|
|
43276
43520
|
if (filter === "all") return events2;
|
|
43277
43521
|
return events2.filter((e) => e.type === filter);
|
|
43278
43522
|
}, [events2, filter]);
|
|
@@ -43388,7 +43632,7 @@ var init_EventFlowTab = __esm({
|
|
|
43388
43632
|
});
|
|
43389
43633
|
function GuardsPanel({ guards }) {
|
|
43390
43634
|
const { t } = useTranslate();
|
|
43391
|
-
const [filter, setFilter] =
|
|
43635
|
+
const [filter, setFilter] = React98.useState("all");
|
|
43392
43636
|
if (guards.length === 0) {
|
|
43393
43637
|
return /* @__PURE__ */ jsx(
|
|
43394
43638
|
EmptyState,
|
|
@@ -43401,7 +43645,7 @@ function GuardsPanel({ guards }) {
|
|
|
43401
43645
|
}
|
|
43402
43646
|
const passedCount = guards.filter((g) => g.result).length;
|
|
43403
43647
|
const failedCount = guards.length - passedCount;
|
|
43404
|
-
const filteredGuards =
|
|
43648
|
+
const filteredGuards = React98.useMemo(() => {
|
|
43405
43649
|
if (filter === "all") return guards;
|
|
43406
43650
|
if (filter === "passed") return guards.filter((g) => g.result);
|
|
43407
43651
|
return guards.filter((g) => !g.result);
|
|
@@ -43564,10 +43808,10 @@ function EffectBadge({ effect }) {
|
|
|
43564
43808
|
}
|
|
43565
43809
|
function TransitionTimeline({ transitions }) {
|
|
43566
43810
|
const { t } = useTranslate();
|
|
43567
|
-
const containerRef =
|
|
43568
|
-
const [autoScroll, setAutoScroll] =
|
|
43569
|
-
const [expandedId, setExpandedId] =
|
|
43570
|
-
|
|
43811
|
+
const containerRef = React98.useRef(null);
|
|
43812
|
+
const [autoScroll, setAutoScroll] = React98.useState(true);
|
|
43813
|
+
const [expandedId, setExpandedId] = React98.useState(null);
|
|
43814
|
+
React98.useEffect(() => {
|
|
43571
43815
|
if (autoScroll && containerRef.current) {
|
|
43572
43816
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
43573
43817
|
}
|
|
@@ -43847,9 +44091,9 @@ function getAllEvents(traits2) {
|
|
|
43847
44091
|
function EventDispatcherTab({ traits: traits2, schema }) {
|
|
43848
44092
|
const eventBus = useEventBus();
|
|
43849
44093
|
const { t } = useTranslate();
|
|
43850
|
-
const [log13, setLog] =
|
|
43851
|
-
const prevStatesRef =
|
|
43852
|
-
|
|
44094
|
+
const [log13, setLog] = React98.useState([]);
|
|
44095
|
+
const prevStatesRef = React98.useRef(/* @__PURE__ */ new Map());
|
|
44096
|
+
React98.useEffect(() => {
|
|
43853
44097
|
for (const trait of traits2) {
|
|
43854
44098
|
const prev = prevStatesRef.current.get(trait.id);
|
|
43855
44099
|
if (prev && prev !== trait.currentState) {
|
|
@@ -44018,10 +44262,10 @@ function VerifyModePanel({
|
|
|
44018
44262
|
localCount
|
|
44019
44263
|
}) {
|
|
44020
44264
|
const { t } = useTranslate();
|
|
44021
|
-
const [expanded, setExpanded] =
|
|
44022
|
-
const scrollRef =
|
|
44023
|
-
const prevCountRef =
|
|
44024
|
-
|
|
44265
|
+
const [expanded, setExpanded] = React98.useState(true);
|
|
44266
|
+
const scrollRef = React98.useRef(null);
|
|
44267
|
+
const prevCountRef = React98.useRef(0);
|
|
44268
|
+
React98.useEffect(() => {
|
|
44025
44269
|
if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
|
|
44026
44270
|
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
44027
44271
|
}
|
|
@@ -44078,10 +44322,10 @@ function RuntimeDebugger({
|
|
|
44078
44322
|
schema
|
|
44079
44323
|
}) {
|
|
44080
44324
|
const { t } = useTranslate();
|
|
44081
|
-
const [isCollapsed, setIsCollapsed] =
|
|
44082
|
-
const [isVisible, setIsVisible] =
|
|
44325
|
+
const [isCollapsed, setIsCollapsed] = React98.useState(mode === "verify" ? true : defaultCollapsed);
|
|
44326
|
+
const [isVisible, setIsVisible] = React98.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
|
|
44083
44327
|
const debugData = useDebugData();
|
|
44084
|
-
|
|
44328
|
+
React98.useEffect(() => {
|
|
44085
44329
|
if (mode === "inline") return;
|
|
44086
44330
|
return onDebugToggle((enabled) => {
|
|
44087
44331
|
setIsVisible(enabled);
|
|
@@ -44090,7 +44334,7 @@ function RuntimeDebugger({
|
|
|
44090
44334
|
}
|
|
44091
44335
|
});
|
|
44092
44336
|
}, [mode]);
|
|
44093
|
-
|
|
44337
|
+
React98.useEffect(() => {
|
|
44094
44338
|
if (mode === "inline") return;
|
|
44095
44339
|
const handleKeyDown = (e) => {
|
|
44096
44340
|
if (e.key === "`" && isVisible) {
|
|
@@ -44610,7 +44854,7 @@ var init_StatCard = __esm({
|
|
|
44610
44854
|
const labelToUse = propLabel ?? propTitle;
|
|
44611
44855
|
const eventBus = useEventBus();
|
|
44612
44856
|
const { t } = useTranslate();
|
|
44613
|
-
const handleActionClick =
|
|
44857
|
+
const handleActionClick = React98__default.useCallback(() => {
|
|
44614
44858
|
if (action?.event) {
|
|
44615
44859
|
eventBus.emit(`UI:${action.event}`, {});
|
|
44616
44860
|
}
|
|
@@ -44621,7 +44865,7 @@ var init_StatCard = __esm({
|
|
|
44621
44865
|
const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
44622
44866
|
const isLoading = externalLoading ?? false;
|
|
44623
44867
|
const error = externalError;
|
|
44624
|
-
const computeMetricValue =
|
|
44868
|
+
const computeMetricValue = React98__default.useCallback(
|
|
44625
44869
|
(metric, items) => {
|
|
44626
44870
|
if (metric.value !== void 0) {
|
|
44627
44871
|
return metric.value;
|
|
@@ -44660,7 +44904,7 @@ var init_StatCard = __esm({
|
|
|
44660
44904
|
},
|
|
44661
44905
|
[]
|
|
44662
44906
|
);
|
|
44663
|
-
const schemaStats =
|
|
44907
|
+
const schemaStats = React98__default.useMemo(() => {
|
|
44664
44908
|
if (!metrics || metrics.length === 0) return null;
|
|
44665
44909
|
return metrics.map((metric) => ({
|
|
44666
44910
|
label: metric.label,
|
|
@@ -44668,7 +44912,7 @@ var init_StatCard = __esm({
|
|
|
44668
44912
|
format: metric.format
|
|
44669
44913
|
}));
|
|
44670
44914
|
}, [metrics, data, computeMetricValue]);
|
|
44671
|
-
const calculatedTrend =
|
|
44915
|
+
const calculatedTrend = React98__default.useMemo(() => {
|
|
44672
44916
|
if (manualTrend !== void 0) return manualTrend;
|
|
44673
44917
|
if (previousValue === void 0 || currentValue === void 0)
|
|
44674
44918
|
return void 0;
|
|
@@ -45308,8 +45552,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
45308
45552
|
] });
|
|
45309
45553
|
};
|
|
45310
45554
|
InlineActivityStream = ({ activities, autoScroll = true, className }) => {
|
|
45311
|
-
const endRef =
|
|
45312
|
-
|
|
45555
|
+
const endRef = React98__default.useRef(null);
|
|
45556
|
+
React98__default.useEffect(() => {
|
|
45313
45557
|
if (!autoScroll) return;
|
|
45314
45558
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
45315
45559
|
}, [activities.length, autoScroll]);
|
|
@@ -45403,7 +45647,7 @@ var init_SubagentTracePanel = __esm({
|
|
|
45403
45647
|
};
|
|
45404
45648
|
SubagentRichCard = ({ subagent }) => {
|
|
45405
45649
|
const { t } = useTranslate();
|
|
45406
|
-
const activities =
|
|
45650
|
+
const activities = React98__default.useMemo(
|
|
45407
45651
|
() => subagentMessagesToActivities(subagent.messages),
|
|
45408
45652
|
[subagent.messages]
|
|
45409
45653
|
);
|
|
@@ -45480,8 +45724,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
45480
45724
|
] });
|
|
45481
45725
|
};
|
|
45482
45726
|
CoordinatorConversation = ({ messages, autoScroll = true, className }) => {
|
|
45483
|
-
const endRef =
|
|
45484
|
-
|
|
45727
|
+
const endRef = React98__default.useRef(null);
|
|
45728
|
+
React98__default.useEffect(() => {
|
|
45485
45729
|
if (!autoScroll) return;
|
|
45486
45730
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
45487
45731
|
}, [messages.length, autoScroll]);
|
|
@@ -45911,7 +46155,7 @@ var init_Timeline = __esm({
|
|
|
45911
46155
|
}) => {
|
|
45912
46156
|
const { t } = useTranslate();
|
|
45913
46157
|
const entityData = entity ?? [];
|
|
45914
|
-
const items =
|
|
46158
|
+
const items = React98__default.useMemo(() => {
|
|
45915
46159
|
if (propItems) return propItems;
|
|
45916
46160
|
if (entityData.length === 0) return [];
|
|
45917
46161
|
return entityData.map((record, idx) => {
|
|
@@ -46013,7 +46257,7 @@ var init_Timeline = __esm({
|
|
|
46013
46257
|
}
|
|
46014
46258
|
});
|
|
46015
46259
|
function extractToastProps(children) {
|
|
46016
|
-
if (!
|
|
46260
|
+
if (!React98__default.isValidElement(children)) {
|
|
46017
46261
|
if (typeof children === "string") {
|
|
46018
46262
|
return { message: children };
|
|
46019
46263
|
}
|
|
@@ -46055,7 +46299,7 @@ var init_ToastSlot = __esm({
|
|
|
46055
46299
|
eventBus.emit(`${prefix}CLOSE`);
|
|
46056
46300
|
};
|
|
46057
46301
|
if (!isVisible) return null;
|
|
46058
|
-
const isCustomContent =
|
|
46302
|
+
const isCustomContent = React98__default.isValidElement(children) && !message;
|
|
46059
46303
|
return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
|
|
46060
46304
|
Toast,
|
|
46061
46305
|
{
|
|
@@ -46072,7 +46316,7 @@ var init_ToastSlot = __esm({
|
|
|
46072
46316
|
}
|
|
46073
46317
|
});
|
|
46074
46318
|
function lazyThree(name, loader) {
|
|
46075
|
-
const Lazy =
|
|
46319
|
+
const Lazy = React98__default.lazy(
|
|
46076
46320
|
() => loader().then((m) => {
|
|
46077
46321
|
const Resolved = m[name];
|
|
46078
46322
|
if (!Resolved) {
|
|
@@ -46084,13 +46328,13 @@ function lazyThree(name, loader) {
|
|
|
46084
46328
|
})
|
|
46085
46329
|
);
|
|
46086
46330
|
function ThreeWrapper(props) {
|
|
46087
|
-
return
|
|
46331
|
+
return React98__default.createElement(
|
|
46088
46332
|
ThreeBoundary,
|
|
46089
46333
|
{ name },
|
|
46090
|
-
|
|
46091
|
-
|
|
46334
|
+
React98__default.createElement(
|
|
46335
|
+
React98__default.Suspense,
|
|
46092
46336
|
{ fallback: null },
|
|
46093
|
-
|
|
46337
|
+
React98__default.createElement(Lazy, props)
|
|
46094
46338
|
)
|
|
46095
46339
|
);
|
|
46096
46340
|
}
|
|
@@ -46113,6 +46357,7 @@ var init_component_registry_generated = __esm({
|
|
|
46113
46357
|
init_AnimatedReveal();
|
|
46114
46358
|
init_ArticleSection();
|
|
46115
46359
|
init_Aside();
|
|
46360
|
+
init_AtlasImage();
|
|
46116
46361
|
init_AuthLayout();
|
|
46117
46362
|
init_Avatar();
|
|
46118
46363
|
init_Badge();
|
|
@@ -46370,7 +46615,7 @@ var init_component_registry_generated = __esm({
|
|
|
46370
46615
|
init_WizardContainer();
|
|
46371
46616
|
init_WizardNavigation();
|
|
46372
46617
|
init_WizardProgress();
|
|
46373
|
-
ThreeBoundary = class extends
|
|
46618
|
+
ThreeBoundary = class extends React98__default.Component {
|
|
46374
46619
|
constructor() {
|
|
46375
46620
|
super(...arguments);
|
|
46376
46621
|
__publicField(this, "state", { failed: false });
|
|
@@ -46380,7 +46625,7 @@ var init_component_registry_generated = __esm({
|
|
|
46380
46625
|
}
|
|
46381
46626
|
render() {
|
|
46382
46627
|
if (this.state.failed) {
|
|
46383
|
-
return
|
|
46628
|
+
return React98__default.createElement(
|
|
46384
46629
|
"div",
|
|
46385
46630
|
{
|
|
46386
46631
|
"data-testid": "three-unavailable",
|
|
@@ -46412,6 +46657,8 @@ var init_component_registry_generated = __esm({
|
|
|
46412
46657
|
"AnimatedReveal": AnimatedReveal,
|
|
46413
46658
|
"ArticleSection": ArticleSection,
|
|
46414
46659
|
"Aside": Aside,
|
|
46660
|
+
"AtlasImage": AtlasImage,
|
|
46661
|
+
"AtlasPanel": AtlasPanel,
|
|
46415
46662
|
"AuthLayout": AuthLayout,
|
|
46416
46663
|
"Avatar": Avatar,
|
|
46417
46664
|
"Badge": Badge,
|
|
@@ -46704,7 +46951,7 @@ function SuspenseConfigProvider({
|
|
|
46704
46951
|
config,
|
|
46705
46952
|
children
|
|
46706
46953
|
}) {
|
|
46707
|
-
return
|
|
46954
|
+
return React98__default.createElement(
|
|
46708
46955
|
SuspenseConfigContext.Provider,
|
|
46709
46956
|
{ value: config },
|
|
46710
46957
|
children
|
|
@@ -46746,7 +46993,7 @@ function enrichFormFields(fields, entityDef) {
|
|
|
46746
46993
|
}
|
|
46747
46994
|
return { name: field, label: field.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (c) => c.toUpperCase()) };
|
|
46748
46995
|
}
|
|
46749
|
-
if (field && typeof field === "object" && !Array.isArray(field) && !
|
|
46996
|
+
if (field && typeof field === "object" && !Array.isArray(field) && !React98__default.isValidElement(field) && !(field instanceof Date)) {
|
|
46750
46997
|
const obj = field;
|
|
46751
46998
|
const fieldName = typeof obj.name === "string" ? obj.name : typeof obj.field === "string" ? obj.field : void 0;
|
|
46752
46999
|
if (!fieldName) return field;
|
|
@@ -47199,7 +47446,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
|
|
|
47199
47446
|
const key = `${parentId}-${index}-trait:${traitName}`;
|
|
47200
47447
|
return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
|
|
47201
47448
|
}
|
|
47202
|
-
return /* @__PURE__ */ jsx(
|
|
47449
|
+
return /* @__PURE__ */ jsx(React98__default.Fragment, { children: child }, `${parentId}-${index}`);
|
|
47203
47450
|
}
|
|
47204
47451
|
if (!child || typeof child !== "object") return null;
|
|
47205
47452
|
const childId = `${parentId}-${index}`;
|
|
@@ -47239,14 +47486,14 @@ function isPatternConfig(value) {
|
|
|
47239
47486
|
if (value === null || value === void 0) return false;
|
|
47240
47487
|
if (typeof value !== "object") return false;
|
|
47241
47488
|
if (Array.isArray(value)) return false;
|
|
47242
|
-
if (
|
|
47489
|
+
if (React98__default.isValidElement(value)) return false;
|
|
47243
47490
|
if (value instanceof Date) return false;
|
|
47244
47491
|
if (typeof value === "function") return false;
|
|
47245
47492
|
const record = value;
|
|
47246
47493
|
return "type" in record && typeof record.type === "string" && getComponentForPattern$1(record.type) !== null;
|
|
47247
47494
|
}
|
|
47248
47495
|
function isPlainConfigObject(value) {
|
|
47249
|
-
if (
|
|
47496
|
+
if (React98__default.isValidElement(value)) return false;
|
|
47250
47497
|
if (value instanceof Date) return false;
|
|
47251
47498
|
const proto = Object.getPrototypeOf(value);
|
|
47252
47499
|
return proto === Object.prototype || proto === null;
|
|
@@ -47372,7 +47619,7 @@ function SlotContentRenderer({
|
|
|
47372
47619
|
for (const slotKey of CONTENT_NODE_SLOTS) {
|
|
47373
47620
|
const slotVal = restProps[slotKey];
|
|
47374
47621
|
if (slotVal === void 0 || slotVal === null) continue;
|
|
47375
|
-
if (
|
|
47622
|
+
if (React98__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
|
|
47376
47623
|
if (Array.isArray(slotVal) || typeof slotVal === "object" && "type" in slotVal) {
|
|
47377
47624
|
nodeSlotOverrides[slotKey] = renderPatternChildren(
|
|
47378
47625
|
slotVal,
|
|
@@ -47421,7 +47668,7 @@ function SlotContentRenderer({
|
|
|
47421
47668
|
const resolvedItems = Array.isArray(entityVal) && entityVal[0] !== "fn" ? entityVal : null;
|
|
47422
47669
|
if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
|
|
47423
47670
|
const sample = resolvedItems[0];
|
|
47424
|
-
if (sample && typeof sample === "object" && !Array.isArray(sample) && !
|
|
47671
|
+
if (sample && typeof sample === "object" && !Array.isArray(sample) && !React98__default.isValidElement(sample) && !(sample instanceof Date)) {
|
|
47425
47672
|
const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
|
|
47426
47673
|
finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
|
|
47427
47674
|
}
|
|
@@ -47582,7 +47829,9 @@ var init_UISlotRenderer = __esm({
|
|
|
47582
47829
|
"content",
|
|
47583
47830
|
"addons",
|
|
47584
47831
|
"hud",
|
|
47585
|
-
"fallback"
|
|
47832
|
+
"fallback",
|
|
47833
|
+
"controls",
|
|
47834
|
+
"overlay"
|
|
47586
47835
|
]);
|
|
47587
47836
|
PATTERNS_WITH_CHILDREN = /* @__PURE__ */ new Set([
|
|
47588
47837
|
"stack",
|